Description
For GBA Action Replay v3 pointer codes, currently only the 32-bit pointer codetype is working properly. The 8-bit and 16-bit pointer codetype aren't functioning as intended and may even crash mGBA. This has to do with the address offset (available on 8/16-bit type).
Pointer Write
Write to the [address located in base address] + offset.
40aaaaaa yyyyyyxx, baseAddress = 0a0aaaaa, offset = yyyyyy
42aaaaaa yyyyxxxx, baseAddress = 0a0aaaaa, offset = yyyy*2
44aaaaaa xxxxxxxx, baseAddress = 0a0aaaaa
The current calculation:
address = _readMem(device->p, address + cheat->addressOffset, 4);
This is adding the offset to the base address.
But instead, we should be reading the base address first, and adding the offset to that. Something like:
address = _readMem(device->p, address, 4) + cheat->addressOffset;