From 2c30b661ffdbfafbef2a3e99a3112b3741ad1153 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 8 Jul 2017 13:50:08 -0700 Subject: [PATCH] GBA SIO: Improve SIO Normal dummy driver (fixes #520) --- CHANGES | 1 + src/gba/sio.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 67f4ebb62..e537e96f6 100644 --- a/CHANGES +++ b/CHANGES @@ -163,6 +163,7 @@ Bugfixes: - GB Video: Fix LYC regression - Qt: Fix translation initialization (fixes mgba.io/i/776) - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) + - GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520) Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/src/gba/sio.c b/src/gba/sio.c index 33a7c99d7..67b051303 100644 --- a/src/gba/sio.c +++ b/src/gba/sio.c @@ -155,11 +155,13 @@ void GBASIOWriteSIOCNT(struct GBASIO* sio, uint16_t value) { case SIO_NORMAL_8: case SIO_NORMAL_32: value |= 0x0004; - if ((value & 0x4080) == 0x4080) { - // TODO: Test this on hardware to see if this is correct - GBARaiseIRQ(sio->p, IRQ_SIO); + if ((value & 0x0081) == 0x0081) { + if (value & 0x4000) { + // TODO: Test this on hardware to see if this is correct + GBARaiseIRQ(sio->p, IRQ_SIO); + } + value &= ~0x0080; } - value &= ~0x0080; break; default: // TODO