R4-R7 now auto-increment for all of the indirect opcodes. My documentation is inconsistent on whether R6 increments or decrements on right, but in any case, my output now matches my source until the DECR, which hasn't been implemented yet.

This commit is contained in:
brandman211 2012-07-27 04:07:06 +00:00
parent 3a56f65c3f
commit 4d1f0114c4
1 changed files with 9 additions and 18 deletions

View File

@ -1081,12 +1081,9 @@ namespace BizHawk.Emulation.CPUs.CP1610
mem = (byte)((opcode >> 3) & 0x7);
src = (byte)(opcode & 0x7);
WriteMemory(Register[mem], Register[src]);
// Stack mode.
if (mem == 0x6)
RegisterSP++;
// Immediate mode.
if (mem == 0x7)
RegisterPC++;
// Auto-increment.
if (mem >= 0x4)
Register[mem]++;
PendingCycles -= 9; TotalExecutedCycles += 9;
break;
// MVI
@ -1177,12 +1174,9 @@ namespace BizHawk.Emulation.CPUs.CP1610
Register[dest] |= (ushort)(ReadMemory(Register[mem]) & 0xFF);
PendingCycles -= 10; TotalExecutedCycles += 10;
}
// Stack mode.
if (mem == 0x6)
RegisterSP++;
// Immediate mode.
if (mem == 0x7)
RegisterPC++;
// Auto-increment.
if (mem >= 0x4)
Register[mem]++;
break;
// ADD
case 0x2C0:
@ -1272,12 +1266,9 @@ namespace BizHawk.Emulation.CPUs.CP1610
mem_read |= (ushort)(ReadMemory(Register[mem]) & 0xFF);
PendingCycles -= 10; TotalExecutedCycles += 10;
}
// Stack mode.
if (mem == 0x6)
RegisterSP++;
// Immediate mode.
if (mem == 0x7)
RegisterPC++;
// Auto-increment.
if (mem >= 0x4)
Register[mem]++;
dest_value = Register[dest];
result = mem_read + dest_value;
Calc_FlagC(result);