Compression Algorithm for DKC2 1.0 U

Share and discuss all facets of DKC ROM hacking...

Compression Algorithm for DKC2 1.0 U

Postby rainbowsprinklez » December 20th, 2019, 8:28 am

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?
Veteran Venturer
Bananas received 108
Posts: 568
Joined: 2016

Re: Compression Algorithm for DKC2 1.0 U

Postby Kingizor » December 20th, 2019, 8:47 am

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).
Trailblazer
Bananas received 77
Posts: 247
Joined: 2010

Re: Compression Algorithm for DKC2 1.0 U

Postby Mattrizzle » December 25th, 2019, 4:21 am

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)
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: Compression Algorithm for DKC2 1.0 U

Postby rainbowsprinklez » January 19th, 2020, 3:02 pm

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.
Veteran Venturer
Bananas received 108
Posts: 568
Joined: 2016


Return to ROM Hacking

Who is online

Users browsing this forum: No registered users and 4 guests