-
Notifications
You must be signed in to change notification settings - Fork 34
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
Is it possible to add a callback when the user saves in-game #163
Comments
I didn't know that functionality existed, which is what has so far prevented me from implementing auto-persistence features. I might just have to figure out how to bind it in my fork of mGBA, hopefully it doesn't require threading (which I haven't gotten to a full implementation with web workers). I'll investigate this one as I free up! For context:
|
And just in case I've done a bad job at disseminating information, you should never have to download your safe files unless you want backups! The |
@KobeOne2 How'd you learn about the |
Just wanted to say I've got a tentative POC up here: Demo link (see file system modal and console output) I'll try to polish this up as I'm available! |
Thank you for your hard work.
They seem to be listed here https://mgba.io/docs/scripting.html#class-CallbackManager. |
Nice! I really need to dig deeper into mGBA docs 😂 |
Just noting that this is still in progress! Running into some issues adding a function to the wasm table immediately after emulator initialization/game startup, but should be able to work through that 😎 |
@KobeOne2 I've extended the mGBA core functionality to add user defined callbacks, at least all of the ones I could prove were accessible! You can find the work done to add callbacks on the mGBA wasm core side here And an example of how I use them on the js side here I may add a few more callbacks as time goes on and I make the UI a little more conducive for actual emulator settings, but feel free to submit a PR here if you want to add some functionality! This should give you a template for adding your own callbacks, but feel free to create another issue, discussion, or comment here if you need any assistance! 😎 |
Hello, and thank you for your fantastic project. I've been using it a lot recently due to my current circumstances.
Anyway, I was wondering if it was possible (to prevent forgetting to download the save😅) to trigger an automatic download prompt or even upload the save to a server whenever a player saved in-game. I tried to add this capability myself, but I couldn't find a way to detect when the save game changed. So, do you know if it is even doable with WASM mGBA? As far as I can tell, mGBA should have a callback "saveDataUpdated".
The text was updated successfully, but these errors were encountered: