Skip to content
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

emscripten_load_state missing #15

Closed
pgodwin opened this issue Dec 24, 2020 · 4 comments
Closed

emscripten_load_state missing #15

pgodwin opened this issue Dec 24, 2020 · 4 comments

Comments

@pgodwin
Copy link
Contributor

pgodwin commented Dec 24, 2020

Hi there

Looks emscripten_load_state referenced in libhalfix.js is missing in emscripten.c ?

@pgodwin
Copy link
Contributor Author

pgodwin commented Dec 25, 2020

I quickly added in

EMSCRIPTEN_KEEPALIVE
void emscripten_load_state(void){
    state_read_from_file("");
}

Which seems to load state correctly. However, loading it with a drive image specified (http://localhost:8080/?hda=os2&savestate=states/os2) causes the XHR paths to be corrupted for subsequent disk access. Ie http://localhost:8080/%C2%88%7F%01%C2%88%7F%01%10/blk0000000b.bin.gz which obviously don't work

Using it without savestate= works, with the expected XHR URLS (Eg http://localhost:8080/os2/blk00000000.bin.gz). So I suspect something is getting overriden when state is loaded, but unsure where.

@pgodwin
Copy link
Contributor Author

pgodwin commented Dec 25, 2020

after an embarrassing amount of time trying to work this out, uncommenting this line fixed it.

//state_field(obj, 4, "path_count", &this->path_count);

@nepx
Copy link
Owner

nepx commented Dec 26, 2020

Savestates were primarily used for debugging (shorten boot times) and added to the browser version as an afterthought. That's the reason behind the (currently unused) jszip.min.js dependency in index.html. Theoretically, they should work, but I've run into some problems regarding them. I tried it with Windows XP a few months ago and the whole system BSOD'ed on me after a few seconds, likely due to hard drive problems.

They work like a charm on the native version, provided that all settings are identical, but at the moment, they're not very "user-friendly," requiring you to comment/uncomment a preprocessor macro. Browser support has historically been much more flaky, but I'm also interested in getting savestates to work to speed up boot times.

@pgodwin
Copy link
Contributor Author

pgodwin commented Dec 26, 2020

They're quite handy :)

Here's OS2 2.0 which seems to work with Halfix. https://labs.obsoletemadness.com/labs/halfix/index.html?hda=os2&savestate=states/os2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants