From 0a09fba091822fb64cbacca502c9b91a005b546c Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 9 Apr 2016 16:48:37 +0300 Subject: [PATCH] Correcting DIV and TIMA speed in CGB's double speed mode --- Core/timing.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/timing.c b/Core/timing.c index b80ba77..249647b 100644 --- a/Core/timing.c +++ b/Core/timing.c @@ -13,6 +13,9 @@ void advance_cycles(GB_gameboy_t *gb, unsigned char cycles) gb->dma_cycles = 0; } + gb->div_cycles += cycles; + gb->tima_cycles += cycles; + if (gb->cgb_double_speed) { cycles >>=1; } @@ -20,8 +23,6 @@ void advance_cycles(GB_gameboy_t *gb, unsigned char cycles) // Not affected by speed boost gb->hdma_cycles += cycles; gb->display_cycles += cycles; - gb->div_cycles += cycles; - gb->tima_cycles += cycles; gb->apu_cycles += cycles; hdma_run(gb); timers_run(gb);