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)
To make code review easier, here' the summary of the lzma code:
All files in Core/Src/porting/lib/lzma are from the official lzma-sdk and unmodified, except for the following bullet points.
Core/Src/porting/lib/lzma/lzma.c and the corresponding header file are novel. This just makes a slightly easier to use API.
Core/Src/porting/lib/lzma/7zTypes.h: the additional pointer void *Mem was added to the ISzAlloc struct to make it easier to just use stack memory for allocations. Basically the Alloc function gets called once, requesting for the specified buffer amount, and we just give it Mem.
No additional python dependencies are introduced since lzma comes with python.
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:
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:
Core/Src/porting/lib/lzma
are from the official lzma-sdk and unmodified, except for the following bullet points.Core/Src/porting/lib/lzma/lzma.c
and the corresponding header file are novel. This just makes a slightly easier to use API.Core/Src/porting/lib/lzma/7zTypes.h
: the additional pointervoid *Mem
was added to theISzAlloc
struct to make it easier to just use stack memory for allocations. Basically theAlloc
function gets called once, requesting for the specified buffer amount, and we just give itMem
.No additional python dependencies are introduced since
lzma
comes with python.