News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)  (Read 3807 times)

Homer177

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
So I've been trying to restore SNES colors to the GBA port of Donkey Kong Country 2. The foreground was pretty simple as the objects had similar palettes in both ports. Background palettes seem to be a totally different animal, though. Pirate Panic looks alright, though some things look out of place:



Mainbrace Mayhem, on the other hand.....



So how can I get the original SNES palette here:



to GBA:



Each time I try it just looks more screwed up. I did manage to get around DKC2's LZ77 compression thanks to some folks in the chat, but I guess that was the easy part. Any suggestions would be welcome.
« Last Edit: July 01, 2020, 11:20:33 am by Homer177 »

FAST6191

  • Hero Member
  • *****
  • Posts: 2897
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #1 on: July 02, 2020, 09:43:57 am »
The Donkey Kong Country GBA games are generally considered a hard one for this kind of restoration, or at least they usually come with a bunch of other downsides than just the washed out palette which is why it is only comparatively recently we saw the first game ( http://www.romhacking.net/hacks/4051/ ) despite restorations going back many years ( http://www.romhacking.net/?page=hacks&genre=&platform=10&game=&category=&perpage=20&order=&dir=&title=palette&author=&hacksearch=Go ).

In this case it looks like it is not a simple pump the brightness palette swap between ports but something rather more custom.
You will then want to figure out what corresponds to what and copy across/remake colours individually. Basic, if tedious, way is make a nice obvious change for the SNES game's palette (one of those browns to something neon and not in the palette) and figure out what pixels it corresponds to, figure out where those pixels are on the GBA (possibly easier said than done if you have the scaled sprites problem) and then edit the GBA palette corresponding to those.
Hopefully there are no palette animations.

The GBA and SNES share a palette format after a fashion/in some modes so there are games where you can import and export (possibly even from savestates on the the game you are coming from) as trivially as finding them in the ROM but it seems you encountered one of the ports/remakes where it was not a straight copy and paste job.

Homer177

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #2 on: July 02, 2020, 12:24:01 pm »
I've actually used bright red in palette ram to figure out what palettes are doing. I only recently found tools that work well with its LZ77 compression but that seems to have brought about other problems.

FAST6191

  • Hero Member
  • *****
  • Posts: 2897
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #3 on: July 02, 2020, 08:59:56 pm »
"other problems"
Depending upon what tool you found to handle recompression then they often only do WRAM safe recompression. For video stuff you likely want VRAM safe instead.
I would then suggest GBAcrusher for anything needed as far as recompression on the GBA. By all means use whatever detection or log capable tools you want to find the stuff in the first place, then you can note where it is and direct other tools later. I don't know why it is the case, especially when most such programs are nominally focused on graphics, but it is what it is.

http://members.iinet.net.au/~freeaxs/gbacomp/#BIOS%20Decompression%20Functions (should have a download for GBAcrusher as well)
http://problemkaputt.de/gbatek.htm#biosdecompressionfunctions

That said are the palettes really compressed? Compressed graphics is absolutely nothing remarkable in the slightest but compressed palettes is rather less common as they are usually only a few bytes long and compression gains are minimal there both in general and because of the small size. Still it does happen.

Homer177

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #4 on: July 03, 2020, 08:17:19 am »
I'm actually using LZ77 Restructor and that has a VRAM safe option. Having opened up the .gba file in said program confirmed the compression thanks in part to Danke who pointed it out.

marc_max

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #5 on: July 24, 2020, 02:10:41 am »
I didn't know there was someone working on restoring DKC2, nice!

I colorized DKC. Do not try to find similarities between GBA and SNES palettes. Rare used a custom software to reduce all sprites and backgrounds sizes. And since GBA had more VRAM for palettes, they just didn't worry about keeping the same palettes (as other GBA ports) and let that software create its own palettes. Restoring these palettes is a hell, but it's doable.

What I did was:
* injected these palettes in a level (with a custom tool that allowed me to insert it just by setting an offset):

* opened the game in an emulator, and also the SNES version
* took an screenshot where I could see both GBA/SNES screens and also emulator VRAM palette viewers for both
* used Photoshop, using the eyedropper and paint bucket tools I started to restore every color (using the eyedropper to choose the old color, and the paint bucket to fill its matching GBA color, it would then restore that color in the screen and its emulator VRAM palette viewer color too)
* after restoring all colors, I copied the GBA VRAM palette viewer window and pasted in my custom tool, injecting the whole palette automatically






I still keep a backup of my tool, if you are interested on it. The only edit I'd need is to allow it to decrypt/encrypt LZ77 palettes.

Homer177

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #6 on: August 04, 2020, 05:58:23 pm »
I've been doing the same, more or less. Background palettes are hellish to work with. I've been using LZ77Restructor 2 to decrypt the background palette code with mixed results.

Any help you can send my way is much appreciated.

Off topic: Your Dr. Mario DX work is great. I'd love to do the same with Mario's Picross/Picross 2 but I wouldn't even know where to start.

yossariano

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Restoring SNES Palettes to GBA Ports (Donkey Kong Country 2)
« Reply #7 on: August 14, 2020, 02:45:21 am »
I just created an account to say, thank you guys for doing this. I am watching this topic eagerly.

marc_max- I loved your DKC GBA restoration! I was bummed when I saw no similar one for DKC2, my favorite game in the series.

Homer177- Those screenshots look great! Please keep this up, I'm sure I'm not the only one out there who is looking for a proper color fix for DKC2 on GBA.

I had a look at Advanced Palette Editor and considered doing this myself, but it's way too daunting for me. Just want to say you guys are legends and it is appreciated.