Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect SGB Joypad Incrementing Behavior (Breaks Gamera - Daikaijuu Kuuchuu Kessen) #220

Open
CasualPokePlayer opened this issue Sep 8, 2021 · 0 comments

Comments

@CasualPokePlayer
Copy link

CasualPokePlayer commented Sep 8, 2021

A bit of a forward from mgba-emu/mgba#2202, but bsnes seems to suffer the same incorrect behavior that mGBA + other HLE SGB emulators have with incrementing the SGB Joypad number.

Simply be, this game expects to be able to increment the joypad number without writing $30 in between joypad reads. This is possible since all that is needed to increment the joypad number is P15 going from low to high, nothing else. The "lock" behavior currently in I believe was a simple misinterpretation of endrift's test results (re: 90f094b) going off the assumption that you need to write $30 to increment the joypad number (which was something someone came up with in the Pandocs, with no discernible source of this claim besides an implication from Nintendo documentation).

I wrote a test to prove this, which can be found here:
sgb-mlt-test.zip
https://github.com/CasualPokePlayer/test-roms/blob/sgb-mlt-test/src/intro.asm

The results show that simple P15 low to highs will increment the joypad number, and implementing such behavior in other emus still pass endrift's previous tests. The fix is ultimately fairly simple here anyways.

On a minor slightly unrelated note, it seems like reads of joyp are also broken in the way that the written P14 and P15 bits do not get correctly set and are always read as low, which is incorrect. Might be something Sameboy needs to fix? I don't know /shrug

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

No branches or pull requests

1 participant