For use in the Wii port, I've converted the IPS/UPS/PPF Patch.cpp file into a memory-based version. I'm posting this work here in case you wish to use it.
Â
The easiest way I found to do this was to create memory based duplicates of the standard C file functions (fopen/fread/etc). I thought this might be advantageous to VBA-M to use, allowing for easier portability and making it so that you don't have to modify the core files to support differences in ports. In my implementation I do my file loading before tapping into the Patch.cpp functions. I'm including a basic framework for memory based file replacements (these are intended to mimic the behavior of the std c library file functions - write functions aren't there, but would be easy enough to add), and an updated Patch.cpp that uses these functions. A working implementation is also on the VBA-M Wii SVN. Similar ideas are in the memgzio from VBA and also the FCEUFILE structure that FCE Ultra uses. Feel free to use any of my code if you want.