Page 1 of 1

Memory-based Patch support

Posted: Mon Oct 27, 2008 12:53 am
by Tantric

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.


Memory-based Patch support

Posted: Tue Oct 28, 2008 4:08 pm
by Squall Leonhart

i don't commit patches without proof that they work, without bugs.


Memory-based Patch support

Posted: Thu Oct 30, 2008 1:51 am
by KunaiTeam

I think it's great that you're contributing back, Tantric, I'm not sure that we'll need memory-based functions for the desktop versions of VBA-M, but people porting it to other systems might find it useful.


Memory-based Patch support

Posted: Thu Oct 30, 2008 2:44 am
by slacker

even if patches are not used its good to have them available on the forums then whoever wants to can apply them manually. keep posting them tantric.


Memory-based Patch support

Posted: Thu Oct 30, 2008 3:37 am
by spacy51

I might apply that later, when I have more time and ideas what to do with it.