all repos — mgba @ d6e9315ff568cd4906c2cdf25786cbe5a6e6fc17

mGBA Game Boy Advance Emulator

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

d6e9315ff568cd4906c2cdf25786cbe5a6e6fc17

parent

22c55f21dcea5282a0a10131e7348553e3b8ad1b

2 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/gb/io.csrc/gb/io.c

@@ -532,13 +532,13 @@ }

static uint8_t _readKeys(struct GB* gb) { uint8_t keys = *gb->keySource; - if (gb->sgbCurrentController & gb->sgbControllers) { + if (gb->sgbCurrentController != 0) { keys = 0; } uint8_t joyp = gb->memory.io[REG_JOYP]; switch (joyp & 0x30) { case 0x30: - keys = gb->sgbCurrentController & gb->sgbControllers; + keys = gb->sgbCurrentController; 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 &= video->p->sgbControllers; + video->p->sgbCurrentController = 0; return; case SGB_MASK_EN: video->renderer->sgbRenderMode = video->sgbPacketBuffer[1] & 0x3;