From a5a7ace86eb0feaf156842029af59a869151712a Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 26 Feb 2015 23:10:01 -0800 Subject: [PATCH] GBA SIO: Fix RCNT reading for mode --- src/gba/sio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gba/sio.c b/src/gba/sio.c index 2f7f5c30b..4f93e4e21 100644 --- a/src/gba/sio.c +++ b/src/gba/sio.c @@ -29,7 +29,7 @@ static struct GBASIODriver* _lookupDriver(struct GBASIO* sio, enum GBASIOMode mo } static void _switchMode(struct GBASIO* sio) { - unsigned mode = ((sio->rcnt >> 14) & 0xC) | ((sio->siocnt >> 12) & 0x3); + unsigned mode = ((sio->rcnt & 0xC000) | (sio->siocnt & 0x3000)) >> 12; enum GBASIOMode oldMode = sio->mode; if (mode < 8) { sio->mode = (enum GBASIOMode) (mode & 0x3);