libretro / dosbox-libretro

Port of DOSBox (upstream) to the libretro API.
GNU General Public License v2.0
61 stars 40 forks source link

Zip Loading #49

Open RobLoach opened 7 years ago

RobLoach commented 7 years ago

Allow loading games from .zip files.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40461959-zip-loading?utm_campaign=plugin&utm_content=tracker%2F2175333&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2175333&utm_medium=issues&utm_source=github).
andres-asm commented 7 years ago

I think it can be implemented in the frontend, I tried mentioning it to some people last night but noone listened.

The idea would be to have some extensions that cause the whole archive to be extracted instead of just the one you pick, so it would extract whole archives if you load cue, toc, exe, m3u, wad, pak for instance.

andres-asm commented 7 years ago

https://hastebin.com/eburoyuzaq.cs

andres-asm commented 7 years ago

the function to extract full archives doesn't yet exist :p it's "pseudocode"

meepingsnesroms commented 7 years ago

What we need is for RetroArch to finally get emulated filesystem support then we can just read from the archive as a directory and all file access will be cross platform.

When that happens I will convert the core to use the emulated filesystem instead of needs_full_path=true.

RobLoach commented 7 years ago

Mount the archive as an emulated volume? Love2D does something like this with their .love files.

i30817 commented 6 years ago

What i do for dos emulation is to use copy-on-write drive to play the games (which is typically mounted on top of a DOSBOX game dir). If, and only if, you can identify a game archive/directory uniquely you could get something like a UUID for it, place a new (if not existing) dir on 'saves/dosbox/UUID' for the 'copy' part of the copy on write and have a mount of the zip as the source.

Still inferior to having no zip (Especially for very large games) and DOS games are super super diverse in terms of files (because they save/write configs on the same dir, have extra files, patches, fanpatches etc) so i'm thinking you Don't want to standardize UUIDs as primary keys. Just create a new one if the user changed the archive. Also, you probably want a way to recognize a zip as a 'dosgame', so either using 'zip' as extension is a bad idea, or you should only do this for files with a corresponding 'dosbox.conf' of the same name or something like that.

BTW, this is similar strategy to what FS-UAE does to autoconfigure Amiga games (along with the retrogames database) but they have the luxury of having stable crcs (because amiga game floppies don't write to themselves but a dedicated save floppy, and hdgames are covered by whdload which separates writes to special files). So the database can actually list all of the relevant files and create a 'good' UUID primary key to autoconfigure and get metadata.