Implemented enough OpCodes for the CPU to run forever

This commit is contained in:
2026-04-15 14:39:33 +01:00
parent e48b2226f4
commit d9966099f8
2 changed files with 7 additions and 0 deletions

View File

@@ -490,6 +490,8 @@ namespace Core.Cpu
return 7;
case 0x14: DE.High = Inc8(DE.High); return 4; // INC D
case 0x1C: DE.Low = Inc8(DE.Low); return 4; // INC E
case 0x1E: DE.Low = FetchByte(); // LD E, n
return 7;
case 0x24: HL.High = Inc8(HL.High); return 4; // INC H
case 0x2C: HL.Low = Inc8(HL.Low); return 4; // INC L
case 0x34:

View File

@@ -341,6 +341,11 @@ namespace Desktop
case 0x1B:
mnemonic = "DEC DE";
break;
case 0x1E:
byte val1E = _memoryBus.Read((ushort)(currentPc + 1));
mnemonic = $"LD E, 0x{val1E:X2}";
instructionLength = 2;
break;
case 0x20:
sbyte jrOffset = (sbyte)_memoryBus.Read((ushort)(currentPc + 1));
ushort destination = (ushort)(currentPc + 2 + jrOffset);