Skip to content

NES: Fix N163 internal RAM address auto-increasement wrapping behavior#102

Open
HeeminTV wants to merge 1 commit intonesdev-org:masterfrom
HeeminTV:n163_autoinc_fix
Open

NES: Fix N163 internal RAM address auto-increasement wrapping behavior#102
HeeminTV wants to merge 1 commit intonesdev-org:masterfrom
HeeminTV:n163_autoinc_fix

Conversation

@HeeminTV
Copy link
Copy Markdown

The real N163 just clips the address when you try to read or write in auto-inc mode.

Test ROM: https://github.com/HeeminTV/Famicom-Tests/tree/main/n163_addresswrappingtest

@TakuikaNinja
Copy link
Copy Markdown

Do you have a non-interactive test ROM for this? That would probably be better for automated testing.
We've been tracking this issue internally and I've previously made this remark:

it should just be a matter of writing values $00-$7F to chip RAM with autoincrement on (after disabling N163 audio), then doing one extra read to detect if the address overflowed or stayed at $7F
it'll probably be worth asking Zynidian to run it on their dev cart, since they originally reported it

@HeeminTV
Copy link
Copy Markdown
Author

HeeminTV commented May 10, 2026

I don't. does it have to be hotswapped? My two COB N163s and two QFP N163s all had "clipping" behavior.

@Fiskbit
Copy link
Copy Markdown
Member

Fiskbit commented May 11, 2026

At least for MesenCE, it doesn't matter if it's interactive or not because automated testing uses movie playback. However, the hotswap behavior is a problem, because basically no emulators allow doing something like this. An emulator test ROM needs to for the target mapper (and in this case, it may as well be automated).

As for the code, if seems to me like these lines:

_ramPosition = (_ramPosition + 1) & 0x7F;

should be changed to just _ramPosition++; because the ANDing is made redundant by the if check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants