Implemented many more OpCodes - 11042026_02_38

This commit is contained in:
2026-04-11 02:38:20 +01:00
parent d953eb4ec7
commit c2bbaf7672
3 changed files with 106 additions and 41 deletions

View File

@@ -447,6 +447,8 @@ namespace Core.Cpu
case 0xF9: // LD SP, HL
SP = HL.Word; // (Use SP.Word = HL.Word if you made SP a RegisterPair)
return 6;
case 0xFD:
return ExecuteFDPrefix();
default:
throw new NotImplementedException($"Opcode 0x{opcode:X2} at PC 0x{(PC - 1):X4} is not implemented.");
}
@@ -509,5 +511,20 @@ namespace Core.Cpu
throw new NotImplementedException($"Extended ED Opcode 0x{extendedOpcode:X2} at PC 0x{(PC - 1):X4} is not implemented.");
}
}
private int ExecuteFDPrefix()
{
byte opcode = FetchByte();
switch (opcode)
{
case 0x21: // LD IY, nn
IY.Word = FetchWord();
return 14; // Takes 14 T-States
default:
throw new NotImplementedException($"FD prefix opcode {opcode:X2} not implemented!");
}
}
}
}