News for hackers. Stuff that matters.
Re:The Super Nintendo Cartridges by fabiensanglard on Monday April 22, 2024 @05:18AM (#40112647)
Yea, after writing this I regretted using zip to estimate usage.

Probably would get better number by extracting each zip and look how much zero padding is at the end of the file. WDYT?

Re:The Super Nintendo Cartridges by Dwedit on Monday April 22, 2024 @05:27AM (#40112681)
I think applying RLE to the file might give a better estimate, because files have blank space throughout, not just at the end. Just tried it on Super Mario World and the estimated size was 479,154 (468K) bytes.

If you don't have an RLE tool handy, you can force Pucrunch to act as an RLE-only compressor by using the -r 0 switch which disables the LZ compression feature.

Re:The Super Nintendo Cartridges by morcheeba on Monday April 22, 2024 @06:46AM (#40113059)
hexdump will automatically does "squeezing" of repeated lines. Follow this with a line count and multiply by the bytes/line and you'll get a rough number of non-repetitive bytes. https://man7.org/linux/man-pages/man1/hexdump.1.html
Re:The Super Nintendo Cartridges by anthk on Tuesday April 23, 2024 @01:43PM (#40134781)
Use xxd or od then.
Re:The Super Nintendo Cartridges by justsomehnguy on Monday April 22, 2024 @05:37AM (#40112715)
Just query each archive for the total uncompressed data. While the 'real' code+data is less than the size of the banks, the banks are always ^2.
Re:The Super Nintendo Cartridges by Dwedit on Monday April 22, 2024 @05:39AM (#40112725)
The goal here isn't to tell the real file sizes, the goal here is to estimate the "effective" file size without any padding. Padding can be at places other than the end of the file.