GBA SIO: Fix double-unloading active driver

This commit is contained in:
Vicki Pfau 2020-02-24 19:55:09 -08:00
parent 1352e2fc4f
commit 85f663fccc
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Emulation fixes:
- GBA DMA: Linger last DMA on bus (fixes mgba.io/i/301 and mgba.io/i/1320)
- GBA Memory: Improve gamepak prefetch timing
- GBA SIO: Fix Multiplayer busy bit
- GBA SIO: Fix double-unloading active driver
- GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319)
- GBA Video: Fix Hblank timing
Other fixes:

View File

@ -75,10 +75,13 @@ void GBASIODeinit(struct GBASIO* sio) {
}
void GBASIOReset(struct GBASIO* sio) {
GBASIODeinit(sio);
if (sio->activeDriver && sio->activeDriver->unload) {
sio->activeDriver->unload(sio->activeDriver);
}
sio->rcnt = RCNT_INITIAL;
sio->siocnt = 0;
sio->mode = -1;
sio->activeDriver = NULL;
_switchMode(sio);
}