Repository navigation
Conversation
…, and make Fx0A wait for release With jump quirks on, Bxnn added only the low byte of the address to Vx, so jump0 0xE00 with vE at 0x9C landed at 0x09C rather than 0xE9C. The whole twelve bit address counts, including the nibble that names the register. The existing unit test encoded the low byte reading and is updated, with the jump row of Timendus' quirks test as the reference. With clip quirks on, a sprite whose start lay past the edge was not drawn at all. The start always wraps around the screen; clipping only decides what happens to the part that hangs over. That is the ERR2 the quirks test shows on its clipping row. Fx0A resumed when a key went down. The original hardware moves on when the key is released, which the keypad test checks for. The key is now remembered on press and the register written on release. Three unit tests added; one updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The same three things I found in Chip8Python (craigthomas/Chip8Python#51) are in this port, found by reading the same routines. Each is fixed with a unit test.
Quirked jump. With
jump_quirkson,Bxnnadded only the low byte of the address toVx, sojump0 0xE00withvEat0x9Clanded at0x09Cinstead of0xE9C. The whole twelve bit address counts; its top nibble both names the register and is part of the address. The existingtest_jump_index_plus_value_jump_quirksencoded the low byte reading, so it changes with this, with the jump row of Timendus' quirks test as the reference.Clipping. With
clip_quirkson, a sprite whose start position lay past the edge was not drawn at all, because the position was only wrapped when clipping was off. The start always wraps around the screen; clipping only decides what happens to the part that hangs over. That is theERR2the quirks test shows on its clipping row. Fixed in bothdraw_normal_spriteanddraw_extended_sprite.Fx0A. Execution resumed onSDL_KEYDOWN. The original hardware moves on when the key is released, and the keypad test's third check reportsNOT RELEASEDfor this. The key is now remembered on key down in a newkeypress_pendingglobal and the register written on the matchingSDL_KEYUP.Not touched:
Fx29uses the whole register as a character number, andtest_load_sprite_index_integrationasserts that with0x10, so I have left it as you have it.I could not link SDL2, SDL2_mixer and CUnit on this machine, so the changed files have been compiled with
-fsyntax-onlyagainst the SDL 2.30 headers but the test binary has not been run here; the CI run on this pull request is its first. In the Python port the same three fixes took the quirks test from a crash on the SUPER-CHIP path andERR2on clipping to every row passing, and the keypad test fromNOT RELEASEDtoALL GOOD.