Skip to content

Fix incorrect data sent during Game Boy Player handshake #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elipsitz
Copy link

This commit fixes an out-of-bounds buffer read (due to an off by one error) that leads to the library sending the wrong response to the Game Boy Player immediately after the "NINTENDO" handshake.

After 'B0BB4F44', the GBA should send back '8000B0BB'. However, the code was actually reading past the end of the "NINTENDO" array, sending something like 'FF00B0BB' (depending on how the code is compiled).

Given that this apparently worked before, the Game Boy Player evidently doesn't verify that (or there are multiple correct answers). However, all other games I tested properly send '8000', and this is clearly the intention of the code.


Note that I'm unable to test this on a Game Boy Player for a little while, so if someone else could confirm that it still works, that'd be great. That being said, this makes the behavior match official games, as far as I can tell.

This commit fixes an out-of-bounds buffer read (due to an off by one
error) that leads to the library sending the wrong response to the Game
Boy Player immediately after the "NINTENDO" handshake.

After 'B0BB4F44', the GBA should send back '8000B0BB'. However, the code
was actually reading past the end of the "NINTENDO" array, sending
something like 'FF00B0BB' (depending on how the code is compiled).

Given that this apparently worked before, the Game Boy Player evidently
doesn't verify that (or there are multiple correct answers). However,
all other games I tested properly send '8000', and this is clearly the
intention of the code.
@evanbowman
Copy link
Owner

Thank you for fixing this! I have a Gameboy Player, I'll try to test it sometime this week. If everything looks good during testing, then I'll certainly merge your changes.

@evanbowman
Copy link
Owner

Somehow I completely forgot about this! I don't have access to a gameboy player at the moment, but I will attempt to test soon when I do.

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