From 7c8d253123733d667e271668f00bacceb390175d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 6 Sep 2019 21:24:51 -0700 Subject: [PATCH] GB: SGB bug compat --- src/gb/video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gb/video.c b/src/gb/video.c index 329174e02..43a9d7637 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -701,6 +701,9 @@ void GBVideoWriteSGBPacket(struct GBVideo* video, uint8_t* data) { case SGB_ATTR_SET: break; case SGB_MLT_REQ: + if ((video->sgbPacketBuffer[1] & 0x3) == 2) { // XXX: This unmasked increment appears to be an SGB hardware bug + ++video->p->sgbCurrentController; + } video->p->sgbControllers = video->sgbPacketBuffer[1] & 0x3; video->p->sgbCurrentController &= video->p->sgbControllers; return;