Fix incorrect data sent during Game Boy Player handshake #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.