From f0d575194984a9ce9ce246c1d7b3a6bef7cf8b7a Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Wed, 20 Feb 2019 22:35:22 +0000 Subject: [PATCH] Fix Z80 LDIR Signed-off-by: Adrian Conlon --- Z80/Z80.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Z80/Z80.cs b/Z80/Z80.cs index dd704f1..ff43196 100644 --- a/Z80/Z80.cs +++ b/Z80/Z80.cs @@ -1874,7 +1874,7 @@ namespace EightBit return ((this.F() & (byte)StatusBits.PF) != 0) && ((this.F() & (byte)StatusBits.ZF) == 0); // See CPD } - private void BlockLoad(Register16 source, Register16 destination, Register16 counter) + private void BlockLoad(Register16 source, Register16 destination, ref Register16 counter) { var value = this.Bus.Read(source); this.Bus.Write(destination, value); @@ -1887,7 +1887,7 @@ namespace EightBit private void LDI() { - this.BlockLoad(this.HL()++, this.DE()++, this.BC()); + this.BlockLoad(this.HL()++, this.DE()++, ref this.BC()); } private bool LDIR() @@ -1898,7 +1898,7 @@ namespace EightBit private void LDD() { - this.BlockLoad(this.HL()--, this.DE()--, this.BC()); + this.BlockLoad(this.HL()--, this.DE()--, ref this.BC()); } private bool LDDR()