Heh, sorry about that. Was posting from work and couldn't check the code. There's a typo in ReadData that makes it applies random byte-swapping when reading an indirect value. To fix, replace:
Code: Select all
case kLocation_IndirectIndexed:
{
UINT32 address;
INT32 offset = action->extendData;
UINT8 cpu = (parameter >> 2) & 0x7;
UINT8 addressBytes = (parameter & 0x3) + 1;
CPUInfo * info = GetCPUInfo(cpu);
address = DoCPURead(cpu, action->address, addressBytes, CPUNeedsSwap(parameter) ^ swapBytes);
if(info)
address = DoShift(address, info->addressShift);
address += offset;
return DoCPURead(cpu, address, bytes, CPUNeedsSwap(parameter) ^ swapBytes);
}
break;
with
Code: Select all
case kLocation_IndirectIndexed:
{
UINT32 address;
INT32 offset = action->extendData;
UINT8 cpu = (parameter >> 2) & 0x7;
UINT8 addressBytes = (parameter & 0x3) + 1;
CPUInfo * info = GetCPUInfo(cpu);
address = DoCPURead(cpu, action->address, addressBytes, CPUNeedsSwap(cpu) ^ swapBytes);
if(info)
address = DoShift(address, info->addressShift);
address += offset;
return DoCPURead(cpu, address, bytes, CPUNeedsSwap(cpu) ^ swapBytes);
}
break;
in the ReadData function. (lines 9674-9689 in this copy of the code)
EDIT: fixed reference to incorrect function (oops)