From 1779d1dc40d89580cbcfb5b538cd2113efed391b Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sun, 17 Aug 2025 12:03:51 +0100 Subject: [PATCH] Intel processors all seem to act slightly differently with regards to HALT --- EightBit/IntelProcessor.cs | 1 - LR35902/LR35902.cs | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EightBit/IntelProcessor.cs b/EightBit/IntelProcessor.cs index 292cf52..e38e719 100644 --- a/EightBit/IntelProcessor.cs +++ b/EightBit/IntelProcessor.cs @@ -70,7 +70,6 @@ namespace EightBit { RaisingHALT?.Invoke(this, EventArgs.Empty); this.HALT.Raise(); - this.PC.Increment(); RaisedHALT?.Invoke(this, EventArgs.Empty); } } diff --git a/LR35902/LR35902.cs b/LR35902/LR35902.cs index a0efed9..a05940c 100644 --- a/LR35902/LR35902.cs +++ b/LR35902/LR35902.cs @@ -13,6 +13,7 @@ namespace LR35902 { this.bus = bus; this.RaisedPOWER += this.LR35902_RaisedPOWER; + this.RaisingHALT += this.LR35902_RaisingHALT; } private readonly Bus bus; @@ -230,6 +231,7 @@ namespace LR35902 this.Execute(this.FetchInstruction()); } } + private void LR35902_RaisedPOWER(object? sender, EventArgs e) { this.RaiseWR(); @@ -238,6 +240,11 @@ namespace LR35902 this.EI = false; } + private void LR35902_RaisingHALT(object? sender, EventArgs e) + { + this.PC.Increment(); + } + protected override void HandleRESET() { base.HandleRESET();