From 080f203a5597370db838c6b23a427f45f979effc Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 3 May 2025 12:09:34 +0100 Subject: [PATCH] Unify Intel style JR CC code and fix SM83 timing issues. --- EightBit/IntelProcessor.cs | 6 ++---- LR35902/LR35902.cs | 9 --------- Z80/Z80.cs | 10 ---------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/EightBit/IntelProcessor.cs b/EightBit/IntelProcessor.cs index 67ef438..f7ae4a6 100644 --- a/EightBit/IntelProcessor.cs +++ b/EightBit/IntelProcessor.cs @@ -173,13 +173,11 @@ namespace EightBit protected virtual bool JumpRelativeConditional(bool condition) { - this.Intermediate.Assign(this.PC); - ++this.PC.Word; + var offset = this.FetchByte(); if (condition) { - this.JumpRelative(this.MemoryRead(this.Intermediate)); + this.JumpRelative(offset); } - return condition; } diff --git a/LR35902/LR35902.cs b/LR35902/LR35902.cs index 73224d7..a30d6d1 100644 --- a/LR35902/LR35902.cs +++ b/LR35902/LR35902.cs @@ -354,15 +354,6 @@ namespace LR35902 return base.ReturnConditional(condition); } - protected override bool JumpRelativeConditional(bool condition) - { - if (!base.JumpRelativeConditional(condition)) - { - this.MemoryRead(this.PC); - } - return condition; - } - protected override void Return() { base.Return(); diff --git a/Z80/Z80.cs b/Z80/Z80.cs index 63f36c2..fae51fd 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -563,16 +563,6 @@ namespace Z80 this.Tick(5); } - protected override bool JumpRelativeConditional(bool condition) - { - var offset = this.FetchByte(); - if (condition) - { - this.JumpRelative(offset); - } - return condition; - } - private int Zero() { return ZeroTest(this.F);