all repos — mgba @ 22c55f21dcea5282a0a10131e7348553e3b8ad1b

mGBA Game Boy Advance Emulator

GB: Fix SGB controller incrementing
Vicki Pfau vi@endrift.com
Mon, 02 Sep 2019 21:36:40 -0700
commit

22c55f21dcea5282a0a10131e7348553e3b8ad1b

parent

74e09675ce2792d6a4fc79c9f4fe1f893513efac

3 files changed, 5 insertions(+), 8 deletions(-)

jump to
M CHANGESCHANGES

@@ -55,7 +55,7 @@ - GBA: Set up GPIO mapping on null and ELF ROM regions (fixes mgba.io/i/1481)

- GBA Cheats: Fix value incrementing in CB slide codes (fixes mgba.io/i/1501) - Qt: Only show emulator restart warning once per settings saving - Qt: Improve cheat view UX - - GB: Fix SGB controller selection initialization (fixes mgba.io/i/1104) + - GB: Fix SGB controller incrementing (fixes mgba.io/i/1104) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/gb/gb.csrc/gb/gb.c

@@ -435,7 +435,7 @@ }

gb->sgbBit = -1; gb->sgbControllers = 0; - gb->sgbCurrentController = 3; + gb->sgbCurrentController = 0; gb->currentSgbBits = 0; memset(gb->sgbPacket, 0, sizeof(gb->sgbPacket));
M src/gb/io.csrc/gb/io.c

@@ -119,14 +119,11 @@ gb->currentSgbBits = bits;

if (gb->sgbBit > 128) { switch (bits) { case 1: - gb->sgbBit |= 2; - break; - case 2: - gb->sgbBit |= 4; + gb->sgbBit ^= 2; break; case 3: - if (gb->sgbBit == 135) { - gb->sgbBit &= ~6; + if (gb->sgbBit == 131) { + gb->sgbBit &= ~2; gb->sgbCurrentController = (gb->sgbCurrentController + 1) & gb->sgbControllers; } break;