Implemented a few more OpCodes. Manic Miner sounds great!

This commit is contained in:
2026-04-22 02:00:50 +01:00
parent a63152b04d
commit e52cdeac54
2 changed files with 125 additions and 1 deletions

View File

@@ -835,6 +835,11 @@ namespace Desktop
mnemonic = $"LD L, (IX{sign}{d})";
instructionLength = 3;
}
else if (ddOpcode == 0x6F) // LD IXL, A
{
mnemonic = $"LD IXL, A)";
instructionLength = 2;
}
else if (ddOpcode == 0x71) // LD (IX+d), B
{
sbyte offset = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
@@ -1058,6 +1063,10 @@ namespace Desktop
mnemonic = "LDIR";
instructionLength = 2;
break;
case 0xB1:
mnemonic = "CPIR";
instructionLength = 2;
break;
case 0xB8:
mnemonic = "LDDR";
instructionLength = 2;
@@ -1102,6 +1111,13 @@ namespace Desktop
mnemonic = $"LD IY, 0x{iyVal:X4}";
instructionLength = 4;
}
else if (fdOpcode == 0x34) // INC IY
{
//sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
//string sign = d >= 0 ? "+" : "";
mnemonic = $"INC IY";
instructionLength = 2;
}
else if (fdOpcode == 0x34) // INC (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
@@ -1182,6 +1198,13 @@ namespace Desktop
mnemonic = $"LD (IY{sign}{d}), H";
instructionLength = 3;
}
else if (fdOpcode == 0x7E) // LD A, (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD A, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x86) // ADD A, (IY+d)
{
sbyte dAdd = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
@@ -1197,6 +1220,13 @@ namespace Desktop
mnemonic = $"SUB (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0xA6) //AND (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"AND (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0xCB) // FD CB prefix
{
cbOp = _memoryBus.Read((ushort)(currentPc + 1));
@@ -1227,7 +1257,7 @@ namespace Desktop
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD (IY{sign}{d}), L";
instructionLength = 3;
}
}
else
{
mnemonic = $"FD PREFIX UNKNOWN (0x{fdOpcode:X2})";