PabloMK7 / citra

A Nintendo 3DS Emulator
GNU General Public License v2.0
3.5k stars 611 forks source link

CHD 7z or zip archive support #100

Open SuperPat45 opened 5 months ago

SuperPat45 commented 5 months ago

Is there an existing issue for this?

What feature are you suggesting?

Add support for loading 3ds roms files in 7z or zip archive, at least on desktop, by decompressing in the temp folder and load the first .3ds file. Or ideally, CHD compression support would be awesome as it does not need decompression before the launch.

Why would this feature be useful?

As 3ds roms are quite large, this would save a lot of disk space, or the need to use a frontend such as LaunchBox to launch games.

the-burrito-triangle commented 5 months ago

I'd argue that CHD (compressed hunks of data, developed by MAME) is the better compressed file format to support. CHDs already have support for LZMA and other compression formats and is generally supported by many emulators whose platform originally used CD or DVD storage mediums. CHDs can also be optimized for compression size, CPU usage and hunk sizes that the emulator is more performant at reading (e.g., 2kb for DVDs or another sector size native to a given platform). We would just need to do some research on what the 3DS reads natively (or what Citra uses) and then use a fast compression format like zstd (much less CPU usage than LZMA for slightly larger files) to have a performant compressed data option.

The main point against .7zip, is that LZMA can take literal minutes to decompress a 4GiB 3DS game. And depending on the platform, the temp space uses the physical disk (as opposed to RAM on a Linux desktop). So this would add multi-gigabyte writes every time the game is opened and add massive loading times during decompression. Hence the need for a more performant format intended for emulators: CHD.

Azenny1986 commented 3 months ago

NDSTokyoTrim does the job on windows, I use it and never had a problem with citra android

Starman99x commented 1 month ago

This would be very useful.