Skip to content

usable movie sram #4337

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

SuuperW
Copy link
Contributor

@SuuperW SuuperW commented May 27, 2025

Users should be able to extract the sram from a movie file and use it, and be able to replace the sram in a movie.

Check if completed:

@SuuperW SuuperW force-pushed the usable_movie_sram branch from a9067ab to 9f80f2f Compare May 28, 2025 02:47
@Morilli
Copy link
Collaborator

Morilli commented May 30, 2025

I'm personally indifferent on whether or not sram should be compressed, but won't this require a version bump?
And if we do format changes, we should ideally bundle as many of them into one version change as possible, like #3734 or #2090 and perhaps renaming the text files that are actually json to .json already.

@CasualPokePlayer
Copy link
Member

Yeah, I prefer this just being a version bump instead of just creating a new file.

@SuuperW
Copy link
Contributor Author

SuuperW commented May 30, 2025

I made it use a different file name, so that it can see which is there. That means old files can still be loaded, which I think it valuable. If there will be other changes that cannot be backward-compatible then yeah this could be bundled with that and then not bother with making this backward-compatible.

@YoshiRulz
Copy link
Member

Was the filename changed when Zstd compression was added?

And keep in mind that migrating movies from older versions isn't something we claim to support.

@SuuperW
Copy link
Contributor Author

SuuperW commented May 30, 2025

Was the filename changed when Zstd compression was added?

No.

And keep in mind that migrating movies from older versions isn't something we claim to support.

But when it's easy to make something backward-compatible, I will.

@SuuperW SuuperW force-pushed the usable_movie_sram branch from 9f80f2f to d454102 Compare June 18, 2025 01:45
@SuuperW SuuperW changed the title dont zstd compress sram usable movie sram Jun 18, 2025
@SuuperW
Copy link
Contributor Author

SuuperW commented Jun 18, 2025

I changed my approach for making movie SRAM usable/editable. to also address #3734. All zstd compressed files are now given an additional .zst extension. So MovieSaveRam.bin is now MovieSaveRam.bin.zst. These can be easily decompressed with either Windows' File Explorer or 7-Zip File Manager, which makes the uncompressed content readily available.
When loading, if a .zst version is not found it will look for a non-zst version and use that if found. This makes replacing the MovieSaveRam file easy.

This does not address #2090 or update JSON files to actually have .json extension. Do we want to do both of those along with this version bump?

@YoshiRulz
Copy link
Member

IMO the .bin should take precedence over .bin.zst

@SuuperW
Copy link
Contributor Author

SuuperW commented Jun 18, 2025

IMO the .bin should take precedence over .bin.zst

I just made the most likely to exist one be the first it checked, but I think your suggestion makes sense. Although it might also make sense to fail if they both exist and tell the user they should delete one, so that there's no ambiguity.

SuuperW added 3 commits June 20, 2025 03:20
This resolves TASEmulators#3734. Bitmaps are still compressed, but clearly marked as such. Both Windows 11 File Explorer and 7-Zip File Manager can nicely decompress them.
Making zstd compression optional while loading also means files can be edited or replaced if necessary, e.g. changing the SRAM of a movie.
…tensions, this has no consequences for users not manually opening our archive files.
@SuuperW SuuperW force-pushed the usable_movie_sram branch from d454102 to 79fb358 Compare June 20, 2025 08:23
@SuuperW
Copy link
Contributor Author

SuuperW commented Jun 20, 2025

I realized that the ZipStateLoader in master doesn't care at all what the file extensions are, which means we could change the extension of JSON files to .json with no real consequences. So I modified the commit to keep that behavior, and then changed file extensions to .json.

It also now throws if there are two files with the same name minus extension, except in the case that one is .zst in which case uncompressed takes precedence.

And why not go ahead and zstd compress the text/json files too? Since users can still access them, edit them, and replace them.

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

Successfully merging this pull request may close these issues.

4 participants