From f1e5e041983f1433eebdb3c8a55c328d56467ca5 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 25 Nov 2021 21:46:51 +0200 Subject: [PATCH] ...even when timekeeping is disabled --- Core/timing.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Core/timing.c b/Core/timing.c index 5c5eccf..e3023b4 100644 --- a/Core/timing.c +++ b/Core/timing.c @@ -95,6 +95,16 @@ bool GB_timing_sync_turbo(GB_gameboy_t *gb) void GB_timing_sync(GB_gameboy_t *gb) { + if (gb->cycles_since_last_sync < LCDC_PERIOD / 3) return; + gb->cycles_since_last_sync = 0; + + if (gb->turbo) { + gb->cycles_since_last_sync = 0; + if (gb->update_input_hint_callback) { + gb->update_input_hint_callback(gb); + } + return; + } } #endif