-
Notifications
You must be signed in to change notification settings - Fork 614
Add backup memory import/export functions to interface API #930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backup memory import/export functions to interface API #930
Conversation
|
what's the difference between raw and file api(s) ? could need an explanation in the header. |
Great question! I'm actually reconsidering whether
This would make the API simpler and, if the What do you think? |
changing a C api after the fact isn't a great idea. since the upstream api already uses the force_size parameter, i'd just add it to the interface api as well and document what it's for in the header. |
I've added documentation. I hope it is in this repository coding style. |
|
well done now you only need to rename _raw to _file and remove the less powerful existing _file api. |
Done! Simplified to single import_file() function with force_size parameter. |
|
@rofl0r I see that I need to provide a fix to this code. I got to access somehow |
hmmpf. code looked good and i manually triggered workflow runs, but for some reason only the appveyor action ran. yes, please provide a fix asap. |
This reverts commit 47f91c4. this commit breaks build and is reverted until a PR with a fix comes in.
|
i've reverted this PR for now. feel free to file a new one - based on master - once you got it working and passing our CI, as well as actually tested it - because what you did here didn't even compile. |
Problem
The interface API has
desmume_savestate_load/savefor savestates but nothing equivalent for battery saves (.sav/.dsv files). This means tools using the library can't load in-game saves programmatically - they have to use the GUI first.Solution
Added three functions to interface.h/cpp that wrap the existing BackupDevice methods:
The implementation is straightforward - it calls BackupDevice::importData() (which already handles .sav, .dsv, .duc formats) and resets the emulator on success, same as the GUI does.
Testing
Compiles cleanly on Windows (VS2022 x64)
Will do functional testing through py-desmume bindings once this merges
The functions follow the same pattern as the existing savestate API, just for backup memory instead. Let me know if you want any changes to the implementation.