-
Notifications
You must be signed in to change notification settings - Fork 72
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
savestate size #84
Comments
Yeah, that looks broken. But I can't find how to fix that thing. There is a memstream_close(), but it takes a stream reference as argument, and memstream_get_last_size() doesn't use anything like that - it pokes some global variables instead. That entire memstream file is a big mess. If it supports multiple streams, then it shouldn't have those globals at all, it should just require a reference for everything. The globals should be in libretro.c instead. |
I'm glad you agree. It gave me a bad feeling too. I'm disappointed it wasn't as simple as I thought at my first glance. Blrrrrrr |
The stream is already correctly closed. memstream_open was changed at some point to have a "writing" parameter, but the mapping to OPEN_STREAM in snes9x.h always calls it with 0. That is why memstream_close always sets last_file_size to the complete size of the buffer. Changing the define to set the writing parameter depending on the mode should fix it. |
memstream_open having a writing parameter would help if we actually used that function. I guess the relevant refactoring was done after whatever version this is based on (1.52, I think?). |
The memstream here was a hack by themaister to get the old s9x version to save to memory instead of a file. The functions are mapped in snes9x.h:
S9xFreezeGame causes calls to OPEN_STREAM and CLOSE_STREAM, which then ends up in the memory set up by memstream_set_buffer. |
Not verified, just pasting from IRC for recordkeeping:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: