Skip to content

Fixed FDS registers, and OAM Buffer#4637

Open
100thCoin wants to merge 1 commit intoTASEmulators:masterfrom
100thCoin:OamBuffer2004Fix
Open

Fixed FDS registers, and OAM Buffer#4637
100thCoin wants to merge 1 commit intoTASEmulators:masterfrom
100thCoin:OamBuffer2004Fix

Conversation

@100thCoin
Copy link
Contributor

@100thCoin 100thCoin commented Feb 23, 2026

A while back, I made changes to how APU registers are read. This is because APU registers are only readable if the 6502 address bus is within the range of $4000 to $401F. Unbeknownst to me, this change broke reads from the Famicom Disk System Registers. I have corrected that issue, and ran relevant tests.

Additionally, the primary purpose for me making this PR was to make a very small change to OAM evaluation, where writes to OAM2 become reads from OAM2. It was simply reading from OAM2[0] instead of using the OAM2 address, which I have corrected.

Relevant test for this OAM2 behavior. I'll admit that this isn't my most readable test. It just sets up OAM with a specific pattern, reads from $2004 on every ppu cycle of a specific scanline, (across a couple frames. This obviously cannot be done in a single frame) and then evaluates the results.

Previous results:
image

Error code 6 is pretty much saying that the data after those OAM2 writes become reads was incorrect.

After making this change:
image

Check if completed:

FDS registers don't need to be "Activated" like the APU registers.
After the OAM Address wraps around, writes to OAM2 are replaced with reads to OAM2. This was already being emulated, but importantly, the ppu continues reading from wherever the OAM2 address was.
@YoshiRulz YoshiRulz added the Core: NesHawk Nintendo Entertainment System (NES) / Famicom / Famicom Disk System (FDS) core label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core: NesHawk Nintendo Entertainment System (NES) / Famicom / Famicom Disk System (FDS) core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants