From 33843265f84559ce620dff7d1ac5898e5f63fdae Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 13 Dec 2016 16:47:21 -0500 Subject: [PATCH] Update CP1610 to include Halts from SR2 --- BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs | 8 ++++++++ BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs index 8970964ae9..7e3a5ac2b6 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs @@ -159,6 +159,14 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 TotalExecutedCycles += cycles; return cycles; } + + // This simulates the Halting caused by the STIC during visible frame using SR2 + if (BusRq && Interruptible) {// && !IntRM && !Interrupted) { + PendingCycles--; + return 1; + } + + if (Logging) { int addrToAdvance; diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs index 1236cfc9ba..755bc572b3 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.cs @@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 public void SetBusRq(bool value) { - BusRq = value; + BusRq = !value; } public int GetPendingCycles()