Writing to the Action Replay?


Established Member
I made some progress attempting to RLE01 compress\decompress the Action Replay's save data. I'm not familiar with how to flash the save data back to the cart however. My naive approach (I was hoping it would at least work in Yabause and fail on real hardware) was to do something like this:

    memcpy((unsigned char*)(CARTRIDGE_MEMORY + ACTION_REPLACE_SAVES_OFFSET), compressedBuf, compressedSize);

This has no affect in Yabause. Any advice on how to do this? Thanks in advance.

Here is the latest beta release of Save Game Copier: Release Action Replay Delete Save Beta (Not Working) · slinga-homebrew/Save-Game-Copier. The relevant source code is in backends/actionreplay.c.


Established Member
Even if user can write it, this "read-only" memory, so there's a mechanism to prevent ROM from being modified or erased.

Here are sample source code about how to write to flash ROM :

① You need to identify the sector size and select which magic commands to use in order to access flash ROM.
This may vary but in the vast majority of Action Replay carts sector of 256 bytes (128 bytes per chip) and these "default" methods are used.

② Before writing data to a sector it must be erased.
-> All access are done on a sector basis. So even if you want to just write one byte it requires to access a whole 256 bytes sector.

③ After sector is erased, data can be written with the appropriate command.

Pseudo Saturn Kai flasher utility erases whole flash ROM and then writes the firmware on it. So rather than erasing then writing each sectors I would suggest to erase whole section you want to update and then to write it. Repeating erase and write operations may work but as I have little experience regarding that it may be safer to use something as close as possible as methods already in use.

(I was hoping it would at least work in Yabause and fail on real hardware)

Yabause does a relatively well emulation of flash ROM : Yabause/yabause
And that's a good point because there's nothing worse than a bug that can't be reproduced on emulator. Also it allows to do preliminary prototyping instead of testing everything directly on real hardware.


Established Member
Thank you for the advice. This seems like it's going to get pretty complicated, especially if I need to support specific chips. I think I'm going to punt and leave Action Replay support as read-only.
Last edited: