Dolphin, the GameCube and Wii emulator - Forums

Full Version: Decompressing GCZ to ISO fills with 0xFF
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

osupka

I use Wit to scrub a Wii iso. This tool fills the unused bytes with 0x00. When I compress this ISO with Dolphin to GCZ, then decompress it back to ISO, Dolphin uses 0xFF to fill the unused bytes. So in the result the 0x00 are replaced with 0xFF. Why does Dolphin have such behaviour? What's the point?
What's the difference? The hash won't match the one from the original anymore either way. The unused bytes are like you write, unused, so it totally does not matter what's in there.

osupka

(02-20-2016, 08:53 AM)mimimi Wrote: [ -> ]What's the difference? The hash won't match the one from the original anymore either way. The unused bytes are like you write, unused, so it totally does not matter what's in there.

It breaks the "sparse file" effect. Otherwise some filesystems like NTFS (and some linux's) would be able to optimize the storage for bulk 0x00 blocks.
Doesn't the program need to tell the OS which areas are sparse in order for that to work? Non-sparse 0x00 doesn't have any advantage over non-sparse 0xFF.

osupka

(02-21-2016, 05:54 AM)JosJuice Wrote: [ -> ]Doesn't the program need to tell the OS which areas are sparse in order for that to work? Non-sparse 0x00 doesn't have any advantage over non-sparse 0xFF.

There are third party tools (and a user can write his own, 10 lines of code actually) that search the specified files for large empty blocks, and turns them into sparse files.
You can use wit to decompress the ISO from GCZ too if you're concerned with 0x00's instead of 0xFF's...
(02-21-2016, 06:52 AM)osupka Wrote: [ -> ]There are third party tools (and a user can write his own, 10 lines of code actually) that search the specified files for large empty blocks, and turns them into sparse files.

Fair point. There's no particular reason to use 0xFF as far as I know, so making Dolphin use 0x00 instead doesn't sound like a controversial change. I can't do it right now, but if anyone else wants to, changing this line should be enough: https://github.com/dolphin-emu/dolphin/b...r.cpp#L137

osupka

(02-21-2016, 06:58 AM)Jhonn Wrote: [ -> ]You can use wit to decompress the ISO from GCZ too if you're concerned with 0x00's instead of 0xFF's...

Actually, that didn't work when I tried. I don't know why, but I get an error when trying to decompress Dolphin GCZ's with Wit. Although no problem when decompressing Wit GCZ's with Dolphin.

But yes, I use wit to make ISOs sparse again. Just use wit on the decompressed ISO.