GBA SIO: Add a dummy driver for Normal mode

This commit is contained in:
Jeffrey Pfau 2015-05-24 23:51:49 -07:00
parent 3974042259
commit e0d0e86b70
2 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,7 @@ Misc:
- 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:

View File

@ -133,6 +133,23 @@ void GBASIOWriteRCNT(struct GBASIO* sio, uint16_t value) {
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);