Skip to content

NES: Ignore consecutive reads to 4016/4017#185

Merged
Fiskbit merged 1 commit into
masterfrom
Sour4016DoubleRead
Jun 22, 2026
Merged

NES: Ignore consecutive reads to 4016/4017#185
Fiskbit merged 1 commit into
masterfrom
Sour4016DoubleRead

Conversation

@SourMesen

Copy link
Copy Markdown
Collaborator

The NES (and AV Famicom) both ignore consecutive reads to 4016/4017 (when the reads on 2 consecutive CPU cycles). This implements that behavior when the corresponding console type is selected.

Also simplifies the DMA logic, because some of the DMA code existed only to simulate the same result. Moving this logic to the 4016/4017 reads makes the code simpler and allows it to work properly when a regular instruction reads from 4016/4017 twice in a row, too.

The NES (and AV Famicom) both ignore consecutive reads to 4016/4017 (when the reads on 2 consecutive CPU cycles). This implements that behavior when the corresponding console type is selected.
These changes also simplify the DMA code, because a lot of extra code was in the DMA logic to simulate the same result. Moving this logic to the 4016/4017 reads makes the code simpler and allows it to work properly when a regular instruction reads from 4016/4017 twice in a row, too.
@SourMesen SourMesen force-pushed the Sour4016DoubleRead branch from e49bb8c to 7a11ec8 Compare June 21, 2026 08:25
@Fiskbit Fiskbit merged commit 142884b into master Jun 22, 2026
23 checks passed
@SourMesen SourMesen deleted the Sour4016DoubleRead branch June 24, 2026 10:36
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.

2 participants