all repos — mgba @ 74e09675ce2792d6a4fc79c9f4fe1f893513efac

mGBA Game Boy Advance Emulator

GB: Fix SGB controller selection initialization (fixes #1104)
Vicki Pfau vi@endrift.com
Sun, 01 Sep 2019 21:30:31 -0700
commit

74e09675ce2792d6a4fc79c9f4fe1f893513efac

parent

178348d44588f6454908e360c874119ee73d79e1

4 files changed, 5 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -55,6 +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) 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 = 0; + gb->sgbCurrentController = 3; gb->currentSgbBits = 0; memset(gb->sgbPacket, 0, sizeof(gb->sgbPacket));
M src/gb/io.csrc/gb/io.c

@@ -535,13 +535,13 @@ }

static uint8_t _readKeys(struct GB* gb) { uint8_t keys = *gb->keySource; - if (gb->sgbCurrentController != 0) { + if (gb->sgbCurrentController & gb->sgbControllers) { keys = 0; } uint8_t joyp = gb->memory.io[REG_JOYP]; switch (joyp & 0x30) { case 0x30: - keys = gb->sgbCurrentController; + keys = gb->sgbCurrentController & gb->sgbControllers; break; case 0x20: keys >>= 4;
M src/gb/video.csrc/gb/video.c

@@ -702,7 +702,7 @@ case SGB_ATTR_SET:

break; case SGB_MLT_REQ: video->p->sgbControllers = video->sgbPacketBuffer[1] & 0x3; - video->p->sgbCurrentController = 0; + video->p->sgbCurrentController &= video->p->sgbControllers; return; case SGB_MASK_EN: video->renderer->sgbRenderMode = video->sgbPacketBuffer[1] & 0x3;