From 6b871cd104b71ac0723d9c215436ceaf27acd378 Mon Sep 17 00:00:00 2001 From: OV2 Date: Wed, 30 May 2018 16:15:17 +0200 Subject: [PATCH] Use Timings.H_Max_Master when calculating cycles for next irq (fixes #315) --- ppu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ppu.cpp b/ppu.cpp index c2cf76d0..d1ebb450 100644 --- a/ppu.cpp +++ b/ppu.cpp @@ -278,7 +278,7 @@ static int CyclesUntilNext (int hc, int vc) { // It's still in this frame */ // Add number of lines - total += (vc - vpos) * Timings.H_Max; + total += (vc - vpos) * Timings.H_Max_Master; // If line 240 is in there and we're odd, subtract a dot if (vpos <= 240 && vc > 240 && Timings.InterlaceField & !IPPU.Interlace) total -= ONE_DOT_CYCLE; @@ -290,11 +290,11 @@ static int CyclesUntilNext (int hc, int vc) return hc; } - total += (Timings.V_Max - vpos) * Timings.H_Max; + total += (Timings.V_Max - vpos) * Timings.H_Max_Master; if (vpos <= 240 && Timings.InterlaceField && !IPPU.Interlace) total -= ONE_DOT_CYCLE; - total += (vc) * Timings.H_Max; + total += (vc) * Timings.H_Max_Master; if (vc > 240 && !Timings.InterlaceField && !IPPU.Interlace) total -= ONE_DOT_CYCLE; }