Page 1 of 1

Memory-based battery/state saves

Posted: Fri Oct 17, 2008 3:57 pm
by Tantric

I'd like to see memory-based versions of emuReadBattery/emuWriteBattery included. Mem based saves can be very important for porting to different platforms - for VBA Wii I need it for saving via network, for example.

 

This would be the same idea as emuReadMemState/emuWriteMemState vs emuReadState/emuWriteState. Actually what I'd really suggest (for ease of your code maintenance) is to scrap the file-dependent functions for states/batteries and replace them with memory versions only. The file I/O can be handled in the specific port code before/after using the "emu" functions. Switching from file IO to memory IO is extremely simple. I've actually already written memory-based battery functions for the VBA-M Wii port but I'd love to see this in the VBA-M code itself - it would make updating my port easier.


Memory-based battery/state saves

Posted: Fri Oct 17, 2008 4:16 pm
by spacy51

Yes, that was also bugging me a while ago. IMO, the ROM loading should also be done by the the GUI/port and the core should just get a pointer to the ROM data.

 

The only thing that stopped me from improving this was the effort that I'd have to rewrite the MFC, GTK AND SDL front-ends -_-"

But maybe I can do the first steps and other people can take care of the rest.


Memory-based battery/state saves

Posted: Fri Oct 17, 2008 4:25 pm
by Tantric

Yes, just a pointer to the ROM would be great too. The memory-based idea actually applies to anything/everything that uses file IO - another thing is IPS. It really is very simple to change, just that it has to be done everywhere all at once.


Memory-based battery/state saves

Posted: Fri Oct 17, 2008 5:44 pm
by spacy51

In the Qt branch, I already changed the ROM loading to simple pointer passing and it works.

 

I think I will do the requested changes on the trunk as well, but use macros so the old and the new functions will work.