SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit d0d39015eefb4aec0fe28c58276a046623501639 parent f08f16346e807da0b4987c705e0aaecd2bd8d521 Author: Lior Halphon <LIJI32@gmail.com> Date: Thu, 25 Nov 2021 21:17:49 +0200 Let update_input_hint_callback get called during turbo Diffstat:
| M | Core/timing.c | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Core/timing.c b/Core/timing.c @@ -54,13 +54,17 @@ bool GB_timing_sync_turbo(GB_gameboy_t *gb) void GB_timing_sync(GB_gameboy_t *gb) { + /* Prevent syncing if not enough time has passed.*/ + if (gb->cycles_since_last_sync < LCDC_PERIOD / 3) return; + if (gb->turbo) { gb->cycles_since_last_sync = 0; + if (gb->update_input_hint_callback) { + gb->update_input_hint_callback(gb); + } return; } - /* Prevent syncing if not enough time has passed.*/ - if (gb->cycles_since_last_sync < LCDC_PERIOD / 3) return; - + uint64_t target_nanoseconds = gb->cycles_since_last_sync * 1000000000LL / 2 / GB_get_clock_rate(gb); /* / 2 because we use 8MHz units */ int64_t nanoseconds = get_nanoseconds(); int64_t time_to_sleep = target_nanoseconds + gb->last_sync - nanoseconds;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.