beanieaxolotl / shinen-gax-python

Reimplementation of the GAX Sound Engine in Python
MIT License
5 stars 0 forks source link

RLE compression of pattern data doesn't work #3

Closed beanieaxolotl closed 3 months ago

beanieaxolotl commented 3 months ago

Due to a few refactors in the packing script, the RLE compression does not work. This results in the song data being larger than it should be.

I have compared the music data stream of "song_12" from Madagascar between both the original ROM file and the script's output, and I think I know why this happened. The empty patterns are likely not being caught by the pattern compressor as it should, resulting in the hilariously-bloated output I get.

image

beanieaxolotl commented 3 months ago

Just fixed the compression of empty steps in a song. All I did was add a sub-function to check if all of the fields in a command object are set to None, and if so it returns True.

image

Empty patterns are less egregious now, but they are still incorrect. They are instead encoded as an RLE command with the param being the song's step count.