-
Notifications
You must be signed in to change notification settings - Fork 76
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
Expose save states through the ui #10
Comments
Also if that can be re-written without the use of localforage. The blob from save states needs to be encoded for localstorage |
In one of my projects I tried to have the system save as someone was closing the window, but apparently you can't have any async/callbacks in the onclose handlers. Unfortunately I got stuck here because I could not figure out how to convert a blob to a string without using async which is needed for localStorage. Although indexedDB works without the conversion, apparently won't save onclose either. |
My solution was just save on interval. This caused a studder at first but I re-arranged the code above so only |
Just thought I'd chime in to say that I also had this problem on a different project of mine that used local storage/db, and I couldn't find a way to do it either and also settled on an interval of sorts, so I'm not sure there's a better option. |
Where do we insert the code on the first comment? Would this let me load download savegames (I asked on #23 )? |
Yeah I think it would let you download/upload save games. And it could go in index.html, or somewhere else. If you are going to look at this, it might be worth taking a look at this commit I made which fixed it from the original source: The GameBoyAdvanceRenderProxy() was the renderer the original project used, I think the intention was to use service workers as background threads to get higher performance, however in my testing I didn't see a difference and I think the service workers makes things more complicated. The render proxy didn't have save states implemented so that's why I swapped back. Also save states were completely broken before that register change which I'm kind of shocked I was able to debug I kind of stumbled on it. Another thing to note on save states is while loading, I have noticed that sometimes the screen/sound is glitchy for a few frames before just suddenly working fine. This might have to do with video/audio registers, but either way it didn't matter for what I was trying to do so I didn't look into it. |
what file to put the code in, and where in the code? |
This should work
However we are running out of room in the ui, so some ui designs make be helpful
The text was updated successfully, but these errors were encountered: