From d6e9315ff568cd4906c2cdf25786cbe5a6e6fc17 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 2 Sep 2019 21:36:40 -0700 Subject: [PATCH] GB: SGB controller cleanup --- src/gb/io.c | 4 ++-- src/gb/video.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gb/io.c b/src/gb/io.c index 1398a9a8f..2adb86bde 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -532,13 +532,13 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) { 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; diff --git a/src/gb/video.c b/src/gb/video.c index 329174e02..020889ca9 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -702,7 +702,7 @@ void GBVideoWriteSGBPacket(struct GBVideo* video, uint8_t* data) { 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;