For the GBA flash cart and corresponding EZ4 client, the Gameboy roms have to be modified before they are saved onto the flash cart in order to save the game. Basically, a routine in the EZ4 client searches for a block of bytes and then replaces those bytes with the custom saving code/bytes. So, the work is done ahead of time, and not in real time or from the flash cart. Is this similar to what you are thinking?