Implemented enough OpCodes for the CPU to run forever
This commit is contained in:
@@ -490,6 +490,8 @@ namespace Core.Cpu
|
|||||||
return 7;
|
return 7;
|
||||||
case 0x14: DE.High = Inc8(DE.High); return 4; // INC D
|
case 0x14: DE.High = Inc8(DE.High); return 4; // INC D
|
||||||
case 0x1C: DE.Low = Inc8(DE.Low); return 4; // INC E
|
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 0x24: HL.High = Inc8(HL.High); return 4; // INC H
|
||||||
case 0x2C: HL.Low = Inc8(HL.Low); return 4; // INC L
|
case 0x2C: HL.Low = Inc8(HL.Low); return 4; // INC L
|
||||||
case 0x34:
|
case 0x34:
|
||||||
|
|||||||
@@ -341,6 +341,11 @@ namespace Desktop
|
|||||||
case 0x1B:
|
case 0x1B:
|
||||||
mnemonic = "DEC DE";
|
mnemonic = "DEC DE";
|
||||||
break;
|
break;
|
||||||
|
case 0x1E:
|
||||||
|
byte val1E = _memoryBus.Read((ushort)(currentPc + 1));
|
||||||
|
mnemonic = $"LD E, 0x{val1E:X2}";
|
||||||
|
instructionLength = 2;
|
||||||
|
break;
|
||||||
case 0x20:
|
case 0x20:
|
||||||
sbyte jrOffset = (sbyte)_memoryBus.Read((ushort)(currentPc + 1));
|
sbyte jrOffset = (sbyte)_memoryBus.Read((ushort)(currentPc + 1));
|
||||||
ushort destination = (ushort)(currentPc + 2 + jrOffset);
|
ushort destination = (ushort)(currentPc + 2 + jrOffset);
|
||||||
|
|||||||
Reference in New Issue
Block a user