Snapshot and TAP quick loading working. Manic Miner fully emulated

This commit is contained in:
2026-04-22 11:46:57 +01:00
parent e52cdeac54
commit b50f7a79da
2 changed files with 114 additions and 2 deletions

View File

@@ -326,6 +326,10 @@ namespace Desktop
mnemonic = $"JR NC, 0x{dest:X4}";
instructionLength = 2;
break;
case 0x31:
mnemonic = "LD SP, nn";
instructionLength = 3;
break;
case 0x32:
{
ushort addr32 = (ushort)(_memoryBus.Read((ushort)(currentPc + 1)) | (_memoryBus.Read((ushort)(currentPc + 2)) << 8));
@@ -1029,6 +1033,10 @@ namespace Desktop
mnemonic = "IM 1";
instructionLength = 2;
break;
case 0x58:
mnemonic = "IN E, (C)";
instructionLength = 2;
break;
case 0x5A: mnemonic = "ADC HL, DE"; instructionLength = 2; break;
case 0x5B:
ushort addr5B = (ushort)(_memoryBus.Read((ushort)(currentPc + 2)) | (_memoryBus.Read((ushort)(currentPc + 3)) << 8));
@@ -1105,7 +1113,12 @@ namespace Desktop
{
byte fdOpcode = _memoryBus.Read((ushort)(currentPc + 1));
if (fdOpcode == 0x21) // LD IY, nn
if (fdOpcode == 0x19) // ADD IY, DE
{
mnemonic = $"ADD IY, DE";
instructionLength = 2;
}
else if (fdOpcode == 0x21) // LD IY, nn
{
ushort iyVal = (ushort)(_memoryBus.Read((ushort)(currentPc + 2)) | (_memoryBus.Read((ushort)(currentPc + 3)) << 8));
mnemonic = $"LD IY, 0x{iyVal:X4}";
@@ -1169,6 +1182,13 @@ namespace Desktop
mnemonic = $"LD E, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x66)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD H, (IY{sign}{d})";
instructionLength = 3;
}
else if (fdOpcode == 0x6E)
{
sbyte offsetL = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
@@ -1198,6 +1218,13 @@ namespace Desktop
mnemonic = $"LD (IY{sign}{d}), H";
instructionLength = 3;
}
else if (fdOpcode == 0x77) // LD (IY+d), A
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));
string sign = d >= 0 ? "+" : "";
mnemonic = $"LD (IY{sign}{d}), A";
instructionLength = 3;
}
else if (fdOpcode == 0x7E) // LD A, (IY+d)
{
sbyte d = (sbyte)_memoryBus.Read((ushort)(currentPc + 2));