Page 1 of 1

Compression Algorithm for DKC2 1.0 U

PostPosted: December 20th, 2019, 8:28 am
by rainbowsprinklez
Does anyone, by chance, know the compression algorithm used by dkc2 for images? I found the credits screen, but it looks like this in tlp https://imgur.com/a/5fKwBy1. I would like to edit that, preferably in place. does anyone know how? or do I need to make a whole new one?

Re: Compression Algorithm for DKC2 1.0 U

PostPosted: December 20th, 2019, 8:47 am
by Kingizor
Yes, it's the standard DKC2/DKC3 one. Almost all the background tilesets in the game use it and most of the tilemaps do too. The single screens don't have compressed tilemaps in DKC2 if I recall, but maybe I'm wrong about that.

There are a handful of decompressors, but the only standalone compressor at the moment is the one that came with the SDK2 editor. There was source code so it shouldn't be too hard to get something up and running.

Perhaps Quaraage's editor might have some relevant functionality? It certainlyhas a lot of features and I think his fork of the compressor was able to achieve better results in some cases.

Here are a list of locations too that might be helpful: (1, 2).

Re: Compression Algorithm for DKC2 1.0 U

PostPosted: December 25th, 2019, 4:21 am
by Mattrizzle
From my notes, here is the location of the decompression routine in DKC2 (U) 1.0:
BB8D91 (JSL) Decompress data into WRAM; X should contain the lower 16 bits (word) of the ROM address, Y should contain bank byte of the address, accumulator should contain the lower word of the WRAM destination (the bank byte is always 7F)

Re: Compression Algorithm for DKC2 1.0 U

PostPosted: January 19th, 2020, 3:02 pm
by rainbowsprinklez
Thank you Kingizor and Matt! I failed to consult this site (I forgot xD) but I still figured things out! Recently, I just reverse engineered how the game constructs sprites, so I kinda shifted focus xD. I do that a lot.