Fixed a bug where SameBoy freeze for a moment after leaving turbo mode

This commit is contained in:
Lior Halphon 2017-06-03 17:02:12 +03:00
parent d72807dd67
commit 65b0dcb2c5

View File

@ -49,7 +49,10 @@ bool GB_timing_sync_turbo(GB_gameboy_t *gb)
void GB_timing_sync(GB_gameboy_t *gb) void GB_timing_sync(GB_gameboy_t *gb)
{ {
if (gb->turbo) return; if (gb->turbo) {
gb->cycles_since_last_sync = 0;
return;
}
/* Prevent syncing if not enough time has passed.*/ /* Prevent syncing if not enough time has passed.*/
if (gb->cycles_since_last_sync < LCDC_PERIOD / 4) return; if (gb->cycles_since_last_sync < LCDC_PERIOD / 4) return;