kbeckmann / game-and-watch-retro-go

Emulator collection for Nintendo® Game & Watch™
GNU General Public License v2.0
440 stars 133 forks source link

LZMA ROM compression #148

Closed BrianPugh closed 3 years ago

BrianPugh commented 3 years ago

This adds support for LZMA compression. It yields higher compression ratios than zopfli, and the significantly slower decompression speed seems to have no actual impact (would like more testers though!). Also, luckily (unlike zopfli), this doesn't tickle the Link's Awakening bug at the beginning of the game.

Compression examples:

ROM: Super Mario Bros 3 (nes)
Uncompressed: 393,232
Zopfli: 220,330
LZMA: 204,626 (15,704 byte, 7.67% improvement over zopfli)
ROM: Link's Awakening (GB)
Uncompressed: 524,288
Zopfli: 307,224
LZMA: 288,871 (18,353 byte, 6.35% improvement over zopfli)

GB support depends on: https://github.com/kbeckmann/retro-go-stm32/pull/15

To make code review easier, here' the summary of the lzma code:

No additional python dependencies are introduced since lzma comes with python.

kbeckmann commented 3 years ago

Thanks for this PR and sorry for the delay in handling it :grimacing: