From 364d79fde9c561e93b3e8aee7800f9f51db029e6 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Wed, 28 Aug 2019 23:28:01 +0100 Subject: [PATCH] Correct Z80 halt interrupt bug. Signed-off-by: Adrian Conlon --- Z80/Z80.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Z80/Z80.cs b/Z80/Z80.cs index 32775dc..bd600f8 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -258,7 +258,11 @@ namespace EightBit protected override void HandleINT() { base.HandleINT(); - this.RaiseHALT(); + if (this.Halted) + { + this.Proceed(); + } + if (this.IFF1) { this.DisableInterrupts(); @@ -1392,7 +1396,11 @@ namespace EightBit private void HandleNMI() { this.RaiseNMI(); - this.RaiseHALT(); + if (this.Halted) + { + this.Proceed(); + } + this.IFF1 = false; this.Restart(0x66); this.Tick(13);