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

Add support for snapshots inside ZIP archives #29

Open
hippietrail opened this issue Sep 12, 2022 · 2 comments
Open

Add support for snapshots inside ZIP archives #29

hippietrail opened this issue Sep 12, 2022 · 2 comments

Comments

@hippietrail
Copy link
Contributor

I've actually got ZIP parsing and extracting working in pure Swift in a standalone tool.
Just need to use that logic to make a new Loader.

@hippietrail
Copy link
Contributor Author

One problem is the Loader is currently set up only to take a path/URL.
The Zip Loader will take a path but then it will have a Data that it will need to pass to the SNA or Z80 loader.

I can just make a version that only does SNA by copying and pasting code from the SNA loader as a proof of concept first.

@shaymanjohn
Copy link
Owner

I think it might be better to change the SupportedGameTypes enum to be called SupportedFileTypes, and add zip as a case in there - this should ensure drag and drop still works for zip files.

Inside the Loader class we'd still get a URL, but we could add some logic to unzip and extract the first file with a valid file type (as it's possible the zip file could have multiple files) - the loader shouldn't need to change too much if we did it this way, just an extra check for a zip and and an unzip routine which returned the data.

I've previously looked at this for SpeccyMac: https://github.com/marmelroy/Zip

Then we just add it as a dependent package, and can just use it immediately.

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