From 6b8eb8063a9685427f448a75a74967d89aaca73f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 2 Apr 2021 02:54:14 +0300 Subject: [PATCH] Fix a bug where SameBoy would start in "faux turbo mode" --- Core/timing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/timing.c b/Core/timing.c index 18cf571..1da82a3 100644 --- a/Core/timing.c +++ b/Core/timing.c @@ -69,7 +69,7 @@ void GB_timing_sync(GB_gameboy_t *gb) gb->last_sync += target_nanoseconds; } else { - if (-time_to_sleep < LCDC_PERIOD * 1200000000LL / GB_get_clock_rate(gb)) { + if (time_to_sleep < 0 && -time_to_sleep < LCDC_PERIOD * 1200000000LL / GB_get_clock_rate(gb)) { // We're running a bit too slow, but the difference is small enough, // just skip this sync and let it even out return;