Implemented many more OpCodes - 11042026_02_38
This commit is contained in:
@@ -132,6 +132,8 @@ namespace Desktop
|
||||
lblHL.Text = $"HL: {_cpu.HL.Word:X4}";
|
||||
lblPC.Text = $"PC: {_cpu.PC:X4}";
|
||||
lblSP.Text = $"SP: {_cpu.SP:X4}";
|
||||
lblIX.Text = $"IX: {_cpu.IX.Word:X4}";
|
||||
lblIY.Text = $"IY: {_cpu.IY.Word:X4}";
|
||||
|
||||
// 2. Update Flags & T-States
|
||||
lblFlags.Text = $"Flags: {_cpu.GetFlagsString()}";
|
||||
@@ -345,7 +347,7 @@ namespace Desktop
|
||||
ushort bcAddr = (ushort)(_memoryBus.Read((ushort)(currentPc + 2)) | (_memoryBus.Read((ushort)(currentPc + 3)) << 8));
|
||||
mnemonic = $"LD (0x{bcAddr:X4}), BC";
|
||||
instructionLength = 4;
|
||||
break;
|
||||
break;
|
||||
case 0x47:
|
||||
mnemonic = "LD I, A";
|
||||
instructionLength = 2; // 0xED + 0x47
|
||||
@@ -384,6 +386,23 @@ namespace Desktop
|
||||
case 0xF9:
|
||||
mnemonic = "LD SP, HL";
|
||||
break;
|
||||
case 0xFD:
|
||||
{
|
||||
byte fdOpcode = _memoryBus.Read((ushort)(currentPc + 1));
|
||||
|
||||
if (fdOpcode == 0x21) // LD IY, nn
|
||||
{
|
||||
ushort iyVal = (ushort)(_memoryBus.Read((ushort)(currentPc + 2)) | (_memoryBus.Read((ushort)(currentPc + 3)) << 8));
|
||||
mnemonic = $"LD IY, 0x{iyVal:X4}";
|
||||
instructionLength = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
mnemonic = $"FD PREFIX UNKNOWN (0x{fdOpcode:X2})";
|
||||
instructionLength = 2; // Fallback so we don't freeze the UI
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
mnemonic = $"UNKNOWN (0x{opcode:X2})";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user