Skip to content

Fixed open bus behavior - #11

Open
100thCoin wants to merge 1 commit into
krikzz:mainfrom
100thCoin:main
Open

Fixed open bus behavior#11
100thCoin wants to merge 1 commit into
krikzz:mainfrom
100thCoin:main

Conversation

@100thCoin

Copy link
Copy Markdown

Currently, reading from open bus on an Everdrive N8 Pro (from address $4020 through $7FFF) always returns the high byte of the address bus. This can be quite easily fooled by running LDA $50FF, X where X is non-zero. Let's say X is 1. The LDA instruction will perform a dummy read on address $5000, where the value $50 will be read (from the high byte operand), and then the second read will be on address $5100. With the current logic, this would return $51, which is incorrect, as the data bus should still be unchanged from when the high byte operand was read. Similarly, a DMC DMA would change the data bus value, which wouldn't be visible on an everdrive outside of the $4000 through $401F range.

This change that I made simply reads the data bus value back instead of the high byte of the address bus. I've made a test for open bus behavior in my accuracy ROM, AccuracyCoin. Here's the results before and after this change:

Before:
image

Error code 3 is: "Indexed addressing crossing a page boundary should not update the data bus to the new high byte value."

After:
image

Return the data bus instead of the high byte of the address bus.
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.

1 participant