From 3ff1151171b7ede0522c8d4795c728906ebc72ee Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sat, 24 Dec 2016 15:01:41 -0500 Subject: [PATCH] Intellivision fix color stack --- .../Consoles/Intellivision/Intellivision.IEmulator.cs | 5 ++++- BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index 3375b771fd..aeb12746d1 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Intellivision get_controller_state(); // this timer tracks cycles stolen by the STIC during the visible part of the frame, quite a large number of them actually - int delay_cycles = 600; + int delay_cycles = 700; int delay_timer = -1; _cpu.PendingCycles = (14934 - 3791 + _cpu.GetPendingCycles()); @@ -38,6 +38,9 @@ namespace BizHawk.Emulation.Cores.Intellivision bool active_display = _stic.active_display; + //also at the start of every frame the color stack is reset + _stic.ColorSP = 0x0028; + while (_cpu.GetPendingCycles() > 0) { int cycles = _cpu.Execute(); diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs index 08b7a83d12..aadccd5d98 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/STIC.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Intellivision public bool Sr1, Sr2, Sst, Fgbg = false; public bool active_display, in_vb_1, in_vb_2 = false; private ushort[] Register = new ushort[64]; - private ushort ColorSP = 0x0028; + public ushort ColorSP = 0x0028; public byte[] mobs = new byte[8]; public byte[] y_mobs = new byte[8]; @@ -324,9 +324,6 @@ namespace BizHawk.Emulation.Cores.Intellivision // here we will also need to apply the 'delay' register values. // this shifts the background portion of the screen relative to the mobs - //also at the start of every frame the color stack is reset - ColorSP = 0x0028; - // The background is a 20x12 grid of "cards". for (int card_row = input_row; card_row < (input_row+1); card_row++) {