From 444a8b7823e8823617e035219dd29c92052fc904 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Wed, 8 Apr 2020 19:08:22 -0400 Subject: [PATCH] O2Hawk: small timing fix --- BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs | 1 + BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs b/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs index d0fad1dfcb..f2e0f51288 100644 --- a/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs +++ b/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs @@ -490,6 +490,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048 if (counter_en) { + // NOTE: Odyssey 2 games tend to enable the counter within a few cycles of a falling edge and expect to count to take place if (!T1 && T1_old && (TotalExecutedCycles > next_T1_check)) { if (Regs[TIM] == 255) diff --git a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs index 69d69bfa4b..51b6941541 100644 --- a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/PPU.cs @@ -253,7 +253,8 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk } else { - if (cycle == 182 && (LY < LINE_VBL)) + // NOTE: most games expect one less T1 pulse after VBL, maybe some pre-render line + if (cycle == 182 && (LY < LINE_VBL) && (LY > 0)) { HBL = true; // Send T1 pulses