mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-04-20 21:16:29 +00:00
Fuse fixes: Correct bus read/write order of XHTL
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+9
-10
@@ -1269,7 +1269,7 @@ namespace EightBit
|
||||
this.Tick(11);
|
||||
break;
|
||||
case 4: // EX (SP),HL
|
||||
this.XHTL();
|
||||
this.XHTL(this.HL2());
|
||||
this.Tick(19);
|
||||
break;
|
||||
case 5: // EX DE,HL
|
||||
@@ -1788,19 +1788,18 @@ namespace EightBit
|
||||
this.F = AdjustXY(this.F, this.A = (byte)~this.A);
|
||||
}
|
||||
|
||||
private void XHTL()
|
||||
private void XHTL(Register16 exchange)
|
||||
{
|
||||
var hl2 = this.HL2();
|
||||
this.Bus.Address.Word = this.SP.Word;
|
||||
this.MEMPTR.Low = this.BusRead();
|
||||
this.Bus.Data = hl2.Low;
|
||||
this.BusWrite();
|
||||
hl2.Low = this.MEMPTR.Low;
|
||||
this.MEMPTR.Low = this.BusRead(this.SP.Word);
|
||||
++this.Bus.Address.Word;
|
||||
this.MEMPTR.High = this.BusRead();
|
||||
this.Bus.Data = hl2.High;
|
||||
this.Bus.Data = exchange.High;
|
||||
this.BusWrite();
|
||||
hl2.High = this.MEMPTR.High;
|
||||
exchange.High = this.MEMPTR.High;
|
||||
--this.Bus.Address.Word;
|
||||
this.Bus.Data = exchange.Low;
|
||||
this.BusWrite();
|
||||
exchange.Low = this.MEMPTR.Low;
|
||||
}
|
||||
|
||||
private void BlockCompare(ushort source, ushort counter)
|
||||
|
||||
Reference in New Issue
Block a user