From 8c7e5098c0df7bf3ecf6ccfe85d2c13b4faf725d Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sat, 24 Dec 2016 09:14:24 -0500 Subject: [PATCH] Intellivision bug fix --- .../Consoles/Intellivision/Intellivision.IEmulator.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index cf97a03a13..b7be158169 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -33,18 +33,21 @@ namespace BizHawk.Emulation.Cores.Intellivision int delay_cycles = 600; int delay_timer = -1; + Console.WriteLine(14934 - 3791 + _cpu.GetPendingCycles()); _cpu.PendingCycles = (14934 - 3791 + _cpu.GetPendingCycles()); _stic.Sr1 = true; + bool active_display = _stic.active_display; + while (_cpu.GetPendingCycles() > 0) { int cycles = _cpu.Execute(); _psg.generate_sound(cycles); - if (delay_cycles>=0 && _stic.active_display) + if (delay_cycles>=0 && active_display) delay_cycles += cycles; - if (delay_timer> 0 && _stic.active_display) + if (delay_timer> 0 && active_display) { delay_timer -= cycles; if (delay_timer<=0) @@ -54,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Intellivision } } - if (delay_cycles>= 750 && _stic.active_display) + if (delay_cycles>= 750 && active_display) { delay_cycles = -1; delay_timer = 110; @@ -70,6 +73,8 @@ namespace BizHawk.Emulation.Cores.Intellivision Connect(); } + Console.WriteLine(_stic.GetSr2()); + // set up VBlank variables _stic.in_vb_1 = true; _stic.in_vb_2 = true;