diff --git a/CHANGES b/CHANGES index 9496d97a1..ca460464c 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Features: Emulation fixes: - GB Audio: Fix channels 1/2 staying muted if restarted after long silence - GB Serialize: Add missing Pocket Cam state to savestates + - GB SIO: Disabling SIO should cancel pending transfers (fixes mgba.io/i/2537) - GB Video: Implement DMG-style sprite ordering - GBA BIOS: Fix clobbering registers with word-sized CpuSet - GBA Video: Disable BG target 1 blending when OBJ blending (fixes mgba.io/i/2722) diff --git a/src/gb/sio.c b/src/gb/sio.c index d327b606d..649213168 100644 --- a/src/gb/sio.c +++ b/src/gb/sio.c @@ -91,11 +91,13 @@ void GBSIOWriteSB(struct GBSIO* sio, uint8_t sb) { void GBSIOWriteSC(struct GBSIO* sio, uint8_t sc) { sio->period = GBSIOCyclesPerTransfer[GBRegisterSCGetClockSpeed(sc)]; // TODO Shift Clock if (GBRegisterSCIsEnable(sc)) { - mTimingDeschedule(&sio->p->timing, &sio->event); if (GBRegisterSCIsShiftClock(sc)) { + mTimingDeschedule(&sio->p->timing, &sio->event); mTimingSchedule(&sio->p->timing, &sio->event, sio->period * (2 - sio->p->doubleSpeed)); sio->remainingBits = 8; } + } else { + mTimingDeschedule(&sio->p->timing, &sio->event); } if (sio->driver) { sio->driver->writeSC(sio->driver, sc);