Add battery save import/export methods - #68
Conversation
|
Update: DeSmuME PR has been merged! The backup import/export API is now part of the official DeSmuME repository. Submodule updated I've updated the
Python bindings work correctly with the merged C++ API. This PR is now fully ready for review. Let me know if you need any changes! I think I can ping you @mike8699 as a maintainer. |
theCapypara
left a comment
There was a problem hiding this comment.
Great stuff! Thanks a lot!
Unfortunately this project is currently without a maintainer, but as the original author it LGTM!
So there is no possibility for merge? |
|
@mike8699 what do you think about this PR? |
Looks great. Unfortunately, I am not a maintainer but just a past contributor 🙃 |
|
Hi, sorry for the delay, I was not receiving notifications until I was pinged. Unfortunately, it seems like the build is failing for reasons unrelated to your changes (I opened #70 to fix the workflow, but that one fails with an error). There's currently no one available to fix the build, so I'm afraid that both #70 and by extension this PR will remain unmerged for now. Thanks for taking the time to contribute, and sorry for the disappointment. |
@Frostbyte0x70, I created fixes for the Github CI in #71. It passed all runs, beside |
d09c55d to
dd4392e
Compare
| [submodule "desmume_src"] | ||
| path = desmume_src | ||
| url = https://github.com/SkyTemple/desmume.git | ||
| url = https://github.com/TASEmulators/desmume.git |
There was a problem hiding this comment.
Doesn't this mean we'll lose the commits added in our fork of desmume? The commit that's currently checked out in the submodule has a few commits not present upstream, and the branch said commit is in has those plus a few more that were added later.
There was a problem hiding this comment.
So should I port my recent changes made to TASEmulators/desmume to your fork? It's actually just +43 lines of code.
There was a problem hiding this comment.
Are those the only changes needed from the Desmume repo to get your feature to work? If so, I could just cherry-pick that commit into the branch used by the submodule.
There was a problem hiding this comment.
Yeah, I just need changes from this PR. But I don't get which branch should I pull from? I'll pull from the correct place, port changes and test, but I don't understand the starting point for me :(
There was a problem hiding this comment.
IIRC I just backported some compilation fixes onto an older commit because I didn't want to fully update in case things break, there shouldn't be any functional difference and it's probably fine to update.
I'd recommend seeing what the base commit was that exists in the upstream repo and what commits I actually added on top of that, should be fairly easy with the git CLI, just kinda hard with GitHub's UI, though the network graph should also show it.
There was a problem hiding this comment.
I'd recommend seeing what the base commit was that exists in the upstream repo and what commits I actually added on top of that
I believe the second link I posted above shows exactly that. For now, I'll just replicate the changes from Konstantysz's PR on the branch used by the submodule (which seems to be interface-build).
There was a problem hiding this comment.
Alright, I've added the changes from the PR. @Konstantysz you can now checkout commit SkyTemple/desmume@42ee6ea on the Desmume submodule and push again.
Frostbyte0x70
left a comment
There was a problem hiding this comment.
It finally works! 🎉
Thanks!
Thanks too! |
Summary
Adds Python bindings for battery save import/export to match the new DeSmuME interface API.
Dependencies
This PR temporarily points the
desmume_srcsubmodule to my fork until the upstream PR is merged.Changes
DeSmuME_Backupclass with three methods:backup.import_file(path)- auto-detects format (.sav, .dsv, .duc, .dss)backup.import_raw(path, size)- manual size overridebackup.export_file(path)- export to .dsvbackupproperty toDeSmuMEclassUsage Example
Use Case
I'm building a Pokemon shiny hunting tool that needs to load battery saves programmatically across multiple emulator instances. Currently there's no way to do this without manual GUI interaction.
Testing
Functional testing pending - will compile custom libdesmume.dll and test with Pokemon ROMs once DeSmuME PR is reviewed.
Once the upstream DeSmuME PR merges, I'll update the submodule to point back to SkyTemple/desmume.