GBA SIO: Add a dummy driver for Normal mode
Jeffrey Pfau jeffrey@endrift.com
Sun, 24 May 2015 23:51:49 -0700
2 files changed,
18 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -39,6 +39,7 @@ - Qt: Fast forward (held) option moved from Other to Emulation menu
- All: Add --help flag for command line programs - Qt: Show version info in window title - All: Fix sanitize-deb script to set file permissions properly if run as (fake)root + - GBA SIO: Add a dummy driver for Normal mode 0.2.1: (2015-05-13) Bugfixes:
M
src/gba/sio.c
→
src/gba/sio.c
@@ -133,6 +133,23 @@
void GBASIOWriteSIOCNT(struct GBASIO* sio, uint16_t value) { if (sio->activeDriver && sio->activeDriver->writeRegister) { value = sio->activeDriver->writeRegister(sio->activeDriver, REG_SIOCNT, value); + } else { + // Dummy drivers + switch (sio->mode) { + case SIO_NORMAL_8: + case SIO_NORMAL_32: + value |= 0x0004; + if (value & 0x0080) { + if ((value & 0x4080) == 0x4080) { + // TODO: Test this on hardware to see if this is correct + GBARaiseIRQ(sio->p, IRQ_SIO); + } + value &= ~0x0080; + break; + default: + // TODO + break; + } } sio->siocnt = value; _switchMode(sio);