macsbug -- defect names after RTD

This commit is contained in:
Kelvin Sherlock 2013-02-19 18:27:33 -05:00
parent ab63801242
commit 486bc5001b

View File

@ -562,15 +562,28 @@ void InstructionLogger()
#endif #endif
} }
if (opcode == 0x4E75 || opcode == 0x4ED0) // RTS or JMP (A0) int mboffset = 0;
switch (opcode)
{ {
case 0x4E75: // rts
case 0x4ED0: // jmp (a0)
mboffset = 2;
break;
case 0x4E74: // rtd #
mboffset = 4;
break;
}
if (mboffset) // RTS or JMP (A0)
{
pc += mboffset;
// check for MacsBug name after rts. // check for MacsBug name after rts.
std::string s; std::string s;
unsigned b = memoryReadByte(pc + 2); unsigned b = memoryReadByte(pc);
if (b > 0x80 && b < 0xa0) if (b > 0x80 && b < 0xa0)
{ {
b -= 0x80; b -= 0x80;
pc += 3; pc++;
s.reserve(b); s.reserve(b);
for (unsigned i = 0; i < b; ++i) for (unsigned i = 0; i < b; ++i)
{ {