From ec59b422b94befbafa05aee14b0d46ea3c7fd040 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Thu, 21 May 2026 16:35:20 +0100 Subject: [PATCH] Simplify PC increment/decrement a little --- EightBit/Processor.cs | 2 -- MC6809/MC6809.cs | 2 +- Z80/Z80.cs | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/EightBit/Processor.cs b/EightBit/Processor.cs index 2f725bc..c7d1a0d 100644 --- a/EightBit/Processor.cs +++ b/EightBit/Processor.cs @@ -206,8 +206,6 @@ namespace EightBit protected virtual void IncrementPC() => this.PC.Increment(); - protected virtual void DecrementPC() => this.PC.Decrement(); - protected virtual void ImmediateAddress() { this.Bus.Address.Assign(this.PC); diff --git a/MC6809/MC6809.cs b/MC6809/MC6809.cs index b5af411..5a58782 100644 --- a/MC6809/MC6809.cs +++ b/MC6809/MC6809.cs @@ -635,7 +635,7 @@ namespace MC6809 protected override void ImmediateAddress() { this.EA.Assign(this.PC); - this.IncrementPC(); + this.PC.Increment(); } protected void RelativeByteAddress() diff --git a/Z80/Z80.cs b/Z80/Z80.cs index d5a46ba..63626b4 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -1984,9 +1984,9 @@ namespace Z80 private void RepeatBlockInstruction() { - this.DecrementPC(); + this.PC.Decrement(); this.MEMPTR.Assign(this.PC); - this.DecrementPC(); + this.PC.Decrement(); this.AdjustXY(this.PC.High); this.Tick(5); }