Skip to content

PARv3 pointer codes not working properly #2026

Closed
@flingrocks

Description

@flingrocks

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions