From 926cf64fe72aed77d482de67c4fa31e926dff3b5 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 30 Dec 2012 17:38:44 +0000 Subject: [PATCH] dual GB: tweak frame timing. dual GB frame timing closely resembles that of lsnes-gambatte; with more than one console, there's no point trying to precisely sync to the v-timing of just one of them. --- BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs index 618466f9e0..64cafc16cb 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/Gameboy/GambatteLink.cs @@ -113,6 +113,8 @@ namespace BizHawk.Emulation.Consoles.GB for (int target = 0; target < SampPerFrame;) { target += step; + if (target > SampPerFrame) + target = SampPerFrame; // don't run for slightly too long depending on step // gambatte_runfor() aborts early when a frame is produced, but we don't want that, hence the while() while (nL < target) @@ -150,7 +152,7 @@ namespace BizHawk.Emulation.Consoles.GB overflowL = nL - SampPerFrame; overflowR = nR - SampPerFrame; if (overflowL < 0 || overflowR < 0) - throw new Exception("Sound problem?"); + throw new Exception("Timing problem?"); if (rendersound) {