Memory-based Patch support

Post Reply
Tantric
Junior Member
Posts: 17
Joined: Sat Oct 04, 2008 3:12 pm

Memory-based Patch support

Post 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.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

Memory-based Patch support

Post by Squall Leonhart »

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

KunaiTeam
Junior Member
Posts: 44
Joined: Thu Aug 14, 2008 9:37 pm

Memory-based Patch support

Post 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.

slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

Memory-based Patch support

Post 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.

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

Memory-based Patch support

Post by spacy51 »

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

Post Reply