all repos — mgba @ e0d0e86b7065cdaed1f7006183977e207714bccd

mGBA Game Boy Advance Emulator

GBA SIO: Add a dummy driver for Normal mode
Jeffrey Pfau jeffrey@endrift.com
Sun, 24 May 2015 23:51:49 -0700
commit

e0d0e86b7065cdaed1f7006183977e207714bccd

parent

39740422598fba88e0b8598263432c30f339dc3f

2 files changed, 18 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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);