Getting keyboard working - WIP

This commit is contained in:
2026-04-16 16:31:15 +01:00
parent 968141056b
commit c74d2cc764
3 changed files with 107 additions and 3 deletions

View File

@@ -768,6 +768,10 @@ namespace Desktop
{
mnemonic = $"SET {targetBit}, {targetReg}";
}
else if (opGroup == 7) // SRL Group (0x38 to 0x3F)
{
mnemonic = $"SET {targetBit}, {targetReg}";
}
else
{
mnemonic = $"EXT UNKNOWN (ED {cbOp:X2})";
@@ -802,6 +806,23 @@ namespace Desktop
case 0xD8:
mnemonic = "RET C";
break;
case 0xDD:
{
byte ddOpcode = _memoryBus.Read((ushort)(currentPc + 1));
if (ddOpcode == 0x21) // LD IX, nn
{
ushort ixVal = (ushort)(_memoryBus.Read((ushort)(currentPc + 2)) | (_memoryBus.Read((ushort)(currentPc + 3)) << 8));
mnemonic = $"LD IX, 0x{ixVal:X4}";
instructionLength = 4;
}
else
{
mnemonic = $"DD PREFIX UNKNOWN (0x{ddOpcode:X2})";
instructionLength = 2; // Fallback to prevent UI freezing
}
break;
}
case 0xDE:
byte sbcValue = _memoryBus.Read((ushort)(currentPc + 1));
mnemonic = $"SBC A, 0x{sbcValue:X2}";
@@ -937,6 +958,27 @@ namespace Desktop
mnemonic = $"LD B, (IY{signB}{dB})";
instructionLength = 3;
}
else if (fdOpcode == 0x4E) // LD C, (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD C, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x56) // LD D, (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD D, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x5E) // LD E, (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD E, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x6E)
{
sbyte offsetL = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));