-Enabled and tested DECR.

-Fixed my disassembly of branch; I wasn't thinking in hexadecimal. >_<
-Subtracted 1 from the negated offset when branching in reverse. The next op is "BNEQ $FFFC".
This commit is contained in:
brandman211 2012-07-27 04:46:44 +00:00
parent 4d1f0114c4
commit 4864aaa291
2 changed files with 10 additions and 10 deletions

View File

@ -716,8 +716,8 @@ namespace BizHawk.Emulation.CPUs.CP1610
case 0x23E:
case 0x23F:
offset = ReadMemory((ushort)(pc + 1));
cond = opcode & 0x15;
ext = opcode & 0x16;
cond = opcode & 0xF;
ext = opcode & 0x10;
if (ext != 0)
result = "BEXT";
else
@ -754,30 +754,31 @@ namespace BizHawk.Emulation.CPUs.CP1610
case 0x9:
result = "BNC";
break;
case 0x10:
case 0xA:
result = "BNOV";
break;
case 0x11:
case 0xB:
result = "BMI";
break;
case 0x12:
case 0xC:
result = "BNEQ";
break;
case 0x13:
case 0xD:
result = "BGE";
break;
case 0x14:
case 0xE:
result = "BGT";
break;
case 0x15:
case 0xF:
result = "BESC";
break;
}
}
if (cond != 0x8)
{
// Branch in the reverse direction by negating the offset and subtracting 1.
if (((opcode >> 5) & 0x1) != 0)
offset = (ushort)-offset;
offset = (ushort)(-offset - 1);
result += string.Format(" ${0:X4}", offset);
if (ext != 0)
result += string.Format(", ${0:X1}", opcode & 0x8);

View File

@ -137,7 +137,6 @@ namespace BizHawk.Emulation.CPUs.CP1610
case 0x015:
case 0x016:
case 0x017:
throw new NotImplementedException();
dest = (byte)(opcode & 0x7);
result = (Register[dest] - 1) & 0xFFFF;
Calc_FlagS(result);