All keys implemented and a few more OpCodes

This commit is contained in:
2026-04-18 21:04:29 +01:00
parent c35bbda53f
commit 7bc85a485b
3 changed files with 74 additions and 8 deletions

View File

@@ -1677,6 +1677,17 @@ namespace Core.Cpu
// 4. Write the immediate value directly into memory
_memory.Write(address36, n36);
return 19;
case 0x56: // LD D, (IX+d)
// 1. Fetch the displacement byte and cast it to a signed sbyte
sbyte offset56 = (sbyte)FetchByte();
// 2. Calculate the exact memory address (IX + offset)
ushort address56 = (ushort)(IX.Word + offset56);
// 3. Read the byte from memory and drop it into the D register (High byte of DE)
DE.High = _memory.Read(address56);
return 19;
case 0x5E: // LD E, (IX+d)
// 1. Fetch the displacement byte and cast it to a signed sbyte
@@ -1688,7 +1699,18 @@ namespace Core.Cpu
// 3. Read the byte from memory and drop it into the E register
DE.Low = _memory.Read(address5E);
return 19; // 19 T-States
return 19;
case 0x6E: // LD L, (IX+d)
// 1. Fetch the displacement byte and cast it to a signed sbyte
sbyte offset6E = (sbyte)FetchByte();
// 2. Calculate the exact memory address (IX + offset)
ushort address6E = (ushort)(IX.Word + offset6E);
// 3. Read the byte from memory and drop it into the L register (Low byte of HL)
HL.Low = _memory.Read(address6E);
return 19;
case 0x74: // LD (IX+d), H
// 1. Fetch the displacement byte and cast it to a signed sbyte
sbyte offset74 = (sbyte)FetchByte();