Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
I translated the aPLib/apultra decompressor for i8080 to GBZ80. I'm just leaving the link here for those who may be interested.
Link: https://github.com/untoxa/UnaPACK.GBZ80
Offline
Looks like it's faster than PuCrunch providing similar ratios. I've added it to my Game Boy Compression Playground. Thanks~!
Offline
I used this combined with apultra for compressing gbt_player music in Petris today.
It worked well- converted mod file sizes shrunk a lot and the time required to decompress right before starting playback isn't noticeable.
Uncompressed: 9,671 bytes
Compressed: 2,226 bytes
To keep decompression simpler I modified mod2gbt to produce a single large array (in a separate binary file) plus a set of pattern offsets (instead of one array per pattern and a set of pointers to those patterns). Then an entire song can be extracted into a single memory location and the relative pattern offsets are overlayed on it.
For reference in case others find it useful:
https://github.com/bbbbbr/gbt-player/co … 491ee127a6
And from the makefile
$(MOD2GBT_SINGLEARRAY) $< $(basename $(basename $(notdir $<)))_mod $(subst .b,,$(suffix $(<:%.mod=%))) > /dev/null $(APULTRA) output.bin output_comp.bin $(BIN2C) output_comp.bin output_comp.c $(basename $(basename $(notdir $<)))_mod cat output_comp.c >> output.c
Last edited by bbbbbr (2020-08-07 22:21:43)
Offline
wow! that is nice! but you have to spare a lot of ram for decompressed tune.
Offline
Hi, I tested the decompressor today but unfortunately it does not work. I used the original version appack.exe to compress the data. When I decompress it with appack.exe the data output is ok. But when I decompress it with your function UNAPACK(const unsigned char * sour, unsigned char * dest) it seems not to work.
Can somebody give a small example how to use it? Thanks!
Uncompressed data:
0x18,0x1D,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x16,0x00,0x00,0x00,0x16...
Compressed data:
0x41,0x50,0x33,0x32,0x18,0x00,0x00,0x00,0x43,0x04,0x00,0x00,0x2E,0x8B,0x5D...
Function output:
0x41,0x33,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x43,0x04,0x00,0x00,0x2E,0x8B...
Last edited by 0x7f (2020-08-08 08:37:27)
Offline
please, drop me a line to untoxa (at) mail (dot) ru, i'll send you an example. please send me your data too.
ps: try this compressor: https://github.com/emmanuel-marty/apult … ses/latest
pps: ah! i know what your problem is! original appack.exe produces data with header. you should skip that header:
UNAPACK(packed_data + 24, buffer);
if you are using the original appack.exe utility.
Last edited by toxa (2020-08-08 14:45:15)
Offline
Hi toxa, the compressor from the link works like a charm! So many thanks!!!
Offline
toxa wrote:
wow! that is nice! but you have to spare a lot of ram for decompressed tune.
Yeah, it does take some space. The largest song is ~3K bytes unpacked, so that's the uncompressed buffer size. My project isn't using much of the CGB's RAM so it's a good trade-off for saving the ROM space.
Offline