Mario Kart Super Circuit - Color Restoration - Help Needed

Started by RunTheCoins, September 13, 2022, 09:09:31 AM

Previous topic - Next topic

RunTheCoins

So I've been wanting to tell you all about My new mod, which is a color restoration for Mario Kart Super Circuit.
I wasn't planning to show anything just yet... But Us at the Mario Kart Super Circuit modding community can't for the life of us can figure out how to edit the track tiles yet... so we all do need help with that honestly, but all the tiles have been edited and I did want to show them off so I can at least get a sense of how to improve them honestly.

(Also someone figured out how to edit the tiles by using NLZ-GBA Advance, but is there any other way is my question?)

Also if anyone want's to join the modding server then here's the link! : https://discord.gg/DKuhVJpTPb
So sprites are going to be modified as well, but I wanted this to be taken care of first, so I'm hoping to get some help at least!


Also after all these improvements to the game, Mario Kart 64 Advance will be going into development, I just want the game to be the best it could be before that happens!

TheGershon

So what does 'Restoration' mean in this context? Would that be, for example, matching the SNES tracks to their SMK colors, or adjusting the whole game to what it would look like if it didn't have to compensate for the original GBA screen?

RunTheCoins

adjusting the whole game to what it would look like if it didn't have to compensate for the original GBA screen, though I am interested in getting the SNES tracks to look like the original, though at this moment no not right now.

Polargames

Hello RunTheCoins, Here is a link that might help you out on your project. https://github.com/badduck32/super-circuit-track-editor

On the github is also a link to a website that has more information. 😀 I hope this helps you out.

N.Dpendent

Hey, i did the "Better Colors" Hack a while ago. If i can help i`ll do! Here i can tell you, what i changed, maybe you want to change something...

MARIO (Offset: 00344600 / 00344610)
F07D 9CF3 94D2 7FC2 293D 4C65 F7E2 5A1D E618 FFFF 558A BFE3 3321 1FD3 56C2 5F2D (ORIGINAL)
F07D 9CF3 EF3D FC35 E618 4174 B5D2 5A1D 0000 FFFF 558A 1FC3 CC10 BFD6 D32D 3E04 (EDITED)

LUIGI (Offset: 00344800 / 00344810)
03DE 9CF3 94D2 DAEF F3D7 A08B C08A E514 FFFF B5D2 9FBE 5FD7 B118 7C25 424D 4065 (ORIGINAL)
03DE 9CF7 EF3D DAEF C927 E89E 4182 0000 FFFF B5D2 9FBE 5FD7 CC10 7C25 2120 0549 (EDITED)

PEACH (Offset: 00344C00 / 00244C10)
5DB6 9CF3 94D2 5FEA FFFF FFFA B16C 9F55 1A35 0000 E414 FF9B 3F87 DB8A AD31 DFE7 (ORIGINAL)
5DB6 9CF3 EF3D 9F55 FFFF 9FFA 4618 1A35 342D 0000 E414 9F83 3F87 1982 AD31 DFE7 (EDITED)

YOSHI (Offset: 00345400 / 00345410)
8638 9CF3 94D2 C410 8638 E4C2 F8D7 8C9B 2592 FFFF F5A7 17DB FFC7 471D 510D 9D15 (ORIGINAL)
8638 9CF3 EF3D 0000 8638 E08E F8D7 8C9B 8001 FFFF D2B3 17DB FFA7 E618 CC10 9D15 (EDITED)

BOWSER (Offset: 00344A00 / 00344A10)
8669 9CF3 94D2 A714 53CA E7B3 8025 F3B6 608A E08E FFD7 3FB3 3A15 0B1D DF25 FFFF (ORIGINAL)
8669 9CF3 EF3D 0000 53CA 8DA3 8025 F3B6 608A E08E FFD7 7E86 D310 A714 3A21 FFFF (EDITED)

WARIO (Offset: 00345000 / 00345010)
05AE 9CF3 94D2 FFFE 1EEA 964D FFDB 103D 3965 E814 F7DE DFB7 7FA2 1FD7 FFFF 7421 (ORIGINAL)
05AE 9CF3 EF3D 9FFA 7D5D 964D DFCB AC28 B55C 0000 F7DE 5F83 1982 1FC3 FFFF AA08 (EDITED)

DONKEY KONG (Offset: 00344E00 / 00344E10)
A044 9CF3 94D2 0721 E91C 52C6 5FC7 38DF 9E83 FFE3 FFAE 1E10 BB2D 7615 341D 1011 (ORIGINAL)
A044 9CF3 EF3D 0721 0000 52C6 5FC7 38DF 9E83 FFE3 BABA 3E04 BB21 5519 F104 AA04 (EDITED)

TOAD (Offset: 00345200 / 00345210)
A044 9CF3 94D2 747D 9EFE D26C 3BEF A418 DFC7 9FFF 5E8E 9FC7 7D1C 0F3D D7DA FFFF (ORIGINAL)
A044 9CF3 EF3D 464D 52F7 AC28 3BEF 0000 DFC7 9FFF 1E42 9FC7 1F00 A418 D7DA FFFF (EDITED)

LAKITU (Offset: 00066EC0 / 00066EE0)
1F7C DFE7 BFBB BF82 5901 CEFF 2A75 7F31 1900 2925 F039 95D2 19E3 9DF3 FFFF 0000 (ORIGINAL)
1F7C DFE7 BF82 1982 5901 8897 C2B6 3E04 342D 0000 AD31 95D2 17DB 39E7 FFFF 0000 (EDITED)

I didn`t find the paletts for the backgrounds, so i only changed the sprites.

ShadowOne333

Sounds like the backgrounds might have some sort of compression.
I'm guessing the often popular LZ77 compression used in GBA games for palettes.
It's a nightmare, they don't even help compressing anything lol

I'll try to see tomorrow if that's the case, I'll attempt a quick palette search with the first stage and then I'll post my findings.

As a side thing, I wanted to ask, if alongside the palette rework, would you consider restoring the censored stuff from the game?
Like the original Sunset Wilds title card and sprites, also I wanted to ask if the Music Restoration hack is compatible with the localized MK64 voices for Super Circuit.


RunTheCoins

First, yes the hack is compatible with the Localized voice hack, though someone released a better one not that long ago so I might add that in, and I can add the original Sunset wild tile card and sprites, though I am also planning on adding the original Prototype boosters in as well, I just got that working in game if anyone wants to see

I'm still trying to figure out another way to get the tile palettes edited, since NLZ-GBA doesn't work for me sadly I'll have to look into other tools

RunTheCoins

Quote from: N.Dpendent on September 13, 2022, 10:46:13 PMHey, i did the "Better Colors" Hack a while ago. If i can help i`ll do! Here i can tell you, what i changed, maybe you want to change something...

MARIO (Offset: 00344600 / 00344610)
F07D 9CF3 94D2 7FC2 293D 4C65 F7E2 5A1D E618 FFFF 558A BFE3 3321 1FD3 56C2 5F2D (ORIGINAL)
F07D 9CF3 EF3D FC35 E618 4174 B5D2 5A1D 0000 FFFF 558A 1FC3 CC10 BFD6 D32D 3E04 (EDITED)

LUIGI (Offset: 00344800 / 00344810)
03DE 9CF3 94D2 DAEF F3D7 A08B C08A E514 FFFF B5D2 9FBE 5FD7 B118 7C25 424D 4065 (ORIGINAL)
03DE 9CF7 EF3D DAEF C927 E89E 4182 0000 FFFF B5D2 9FBE 5FD7 CC10 7C25 2120 0549 (EDITED)

PEACH (Offset: 00344C00 / 00244C10)
5DB6 9CF3 94D2 5FEA FFFF FFFA B16C 9F55 1A35 0000 E414 FF9B 3F87 DB8A AD31 DFE7 (ORIGINAL)
5DB6 9CF3 EF3D 9F55 FFFF 9FFA 4618 1A35 342D 0000 E414 9F83 3F87 1982 AD31 DFE7 (EDITED)

YOSHI (Offset: 00345400 / 00345410)
8638 9CF3 94D2 C410 8638 E4C2 F8D7 8C9B 2592 FFFF F5A7 17DB FFC7 471D 510D 9D15 (ORIGINAL)
8638 9CF3 EF3D 0000 8638 E08E F8D7 8C9B 8001 FFFF D2B3 17DB FFA7 E618 CC10 9D15 (EDITED)

BOWSER (Offset: 00344A00 / 00344A10)
8669 9CF3 94D2 A714 53CA E7B3 8025 F3B6 608A E08E FFD7 3FB3 3A15 0B1D DF25 FFFF (ORIGINAL)
8669 9CF3 EF3D 0000 53CA 8DA3 8025 F3B6 608A E08E FFD7 7E86 D310 A714 3A21 FFFF (EDITED)

WARIO (Offset: 00345000 / 00345010)
05AE 9CF3 94D2 FFFE 1EEA 964D FFDB 103D 3965 E814 F7DE DFB7 7FA2 1FD7 FFFF 7421 (ORIGINAL)
05AE 9CF3 EF3D 9FFA 7D5D 964D DFCB AC28 B55C 0000 F7DE 5F83 1982 1FC3 FFFF AA08 (EDITED)

DONKEY KONG (Offset: 00344E00 / 00344E10)
A044 9CF3 94D2 0721 E91C 52C6 5FC7 38DF 9E83 FFE3 FFAE 1E10 BB2D 7615 341D 1011 (ORIGINAL)
A044 9CF3 EF3D 0721 0000 52C6 5FC7 38DF 9E83 FFE3 BABA 3E04 BB21 5519 F104 AA04 (EDITED)

TOAD (Offset: 00345200 / 00345210)
A044 9CF3 94D2 747D 9EFE D26C 3BEF A418 DFC7 9FFF 5E8E 9FC7 7D1C 0F3D D7DA FFFF (ORIGINAL)
A044 9CF3 EF3D 464D 52F7 AC28 3BEF 0000 DFC7 9FFF 1E42 9FC7 1F00 A418 D7DA FFFF (EDITED)

LAKITU (Offset: 00066EC0 / 00066EE0)
1F7C DFE7 BFBB BF82 5901 CEFF 2A75 7F31 1900 2925 F039 95D2 19E3 9DF3 FFFF 0000 (ORIGINAL)
1F7C DFE7 BF82 1982 5901 8897 C2B6 3E04 342D 0000 AD31 95D2 17DB 39E7 FFFF 0000 (EDITED)

I didn`t find the paletts for the backgrounds, so i only changed the sprites.


Also, thank you for this, you did a great job on that hack, I would love to use these pallets honestly, I've tried to perfect them before but they didn't come out as good honestly

ShadowOne333

#8
I think I found the palette for Peach Circuit.
Take a look at this image (forgot to show the offset, it's 0x00288FC6 in APE):



The values correspond to the second row of palettes from the Background colours.
The first two colours match in APE, from mGBA you grab the 16-bit value (0x045C) using the Palette viewer inside Tools -> Game state views -> View Palette and you'll get the windows on the bottom left.

From there, flip the value of the palette you want to find in the ROM using APE.
For example, for the colour in the window, we have 16-bit value of 0x045C, we separate it in two pairs of bytes (04 5C) and then we flip them in order, so 5C 04.
You input this 5C 04 in APE, and then do the same for the following colour (54 04).
Select "Load by searching" with APE, and then start writing your colours.
After you put the very first two colours in the "Actual palette" area, click on the "Search" button, and you'll see that the "Offset (Hex)" box changes. Once you get a first match, change the option from "Load by searching" to "Load from offset" and you'll see ALL of the adjacent data that matches those two colours.

From what I'm seeing, all of the colours after the 5404 match to the rest of the colours in the 2nd palette row 1:1. (Although for some reason, APE doesn't seem to load their colours properly, dunno why).

But hey, at least I think I found a way to find them :)
Also, if you keep clicking on Search after your first match, it'll continue going to other offsets that might have a match with the colours you wrote, so if you don't see the matching Hex bytes to those of the other colours, keep looking in other offsets.

Hope this helps!



EDIT:
I think I found what's going on with the colours.
For some reason, Super Circuit adds 0x80 to the palette value.
In order to see the correct colours in APE, you need to substract 0x80 from the bytes in Hex you get from the ROM, take the example of the previous image, and you get the correct colours after substracting 0x80 from each one of the colours:



So just remember, that to see them in APE, you need to substract 0x80 from them, and to write them back in the ROM, you add the 0x80 back :D

radimerry

8-bit tiles are split into multiple parts (LZ77)
2873ec
287b34
2882d0
288a64

with bg palette starting at 288FA4 (256 colours)

(easier to see with nlz file)

RunTheCoins

Quote from: ShadowOne333 on September 14, 2022, 10:31:45 AMI think I found the palette for Peach Circuit.
Take a look at this image (forgot to show the offset, it's 0x00288FC6 in APE):



The values correspond to the second row of palettes from the Background colours.
The first two colours match in APE, from mGBA you grab the 16-bit value (0x045C) using the Palette viewer inside Tools -> Game state views -> View Palette and you'll get the windows on the bottom left.

From there, flip the value of the palette you want to find in the ROM using APE.
For example, for the colour in the window, we have 16-bit value of 0x045C, we separate it in two pairs of bytes (04 5C) and then we flip them in order, so 5C 04.
You input this 5C 04 in APE, and then do the same for the following colour (54 04).
Select "Load by searching" with APE, and then start writing your colours.
After you put the very first two colours in the "Actual palette" area, click on the "Search" button, and you'll see that the "Offset (Hex)" box changes. Once you get a first match, change the option from "Load by searching" to "Load from offset" and you'll see ALL of the adjacent data that matches those two colours.

From what I'm seeing, all of the colours after the 5404 match to the rest of the colours in the 2nd palette row 1:1. (Although for some reason, APE doesn't seem to load their colours properly, dunno why).

But hey, at least I think I found a way to find them :)
Also, if you keep clicking on Search after your first match, it'll continue going to other offsets that might have a match with the colours you wrote, so if you don't see the matching Hex bytes to those of the other colours, keep looking in other offsets.

Hope this helps!



EDIT:
I think I found what's going on with the colours.
For some reason, Super Circuit adds 0x80 to the palette value.
In order to see the correct colours in APE, you need to substract 0x80 from the bytes in Hex you get from the ROM, take the example of the previous image, and you get the correct colours after substracting 0x80 from each one of the colours:



So just remember, that to see them in APE, you need to substract 0x80 from them, and to write them back in the ROM, you add the 0x80 back :D

Oh wow, that's a lot more work here than I thought you had to do, though at least now there's info on how to edit the background palletes, though I'm still working on getting tiles in the game still as well (at least there's info on where they are)

ShadowOne333

Quote from: RunTheCoins on September 14, 2022, 11:28:34 AMOh wow, that's a lot more work here than I thought you had to do, though at least now there's info on how to edit the background palletes, though I'm still working on getting tiles in the game still as well (at least there's info on where they are)

The info @radimerry gave is also good, the BG palette data should start around 0x288FA4. You can go from there :thumbsup:
Best of luck with the restoration!

radimerry

#12
This tool can help with the compression
https://www.romhacking.net/utilities/433/


Put in the compressed address to uncompress. And go backward. Be careful that the size fits or you'll have to remap the ptr also.

track tile1 tile2 tile3 tile4 pal
----------------------------------------------
peach 2873ec 287b34 2882d0 288a64 288fa4
shyguy 28d364 28db34 28e1dc 28e708 28ec74
river 2ab40c 2aba60 2ac14c 2ac9b0 2acf84
bowser 29d0dc 29d980 29de38 29e024 29e3a0


EDIT:
30002d8 has the in-game color palette, sent to 5000000.

Actual road tilemap is more interesting.


Vram bg2 is swapped at horizon LY=49.
(put bp at 3002400 and check the mem)

N.Dpendent

Quote from: RunTheCoins on September 14, 2022, 08:14:54 AMAlso, thank you for this, you did a great job on that hack, I would love to use these pallets honestly, I've tried to perfect them before but they didn't come out as good honestly

Feel free to do! I`m just a beginner with this stuff and did this for my own preferences. But why not make other people happy? Work is done anyway...

wabbajackw

#14
why you want to add prototype boosters? Normal are not okay?

Nintenja

Quote from: N.Dpendent on September 14, 2022, 04:36:00 PMFeel free to do! I`m just a beginner with this stuff and did this for my own preferences. But why not make other people happy? Work is done anyway...

Your hack is included and credited in this compilation I put together called Mario Kart Super Circuit-Freemastered v1.5. Hopefully I have your Blessing in adding your "better colors v1.1" hack to this compilation as it's essential. Link and info included:

https://archive.org/details/mario-kart-super-circuit-freemastered

All patches listed are in one easy to patch .ips file:
1.HQ Music Restore v6.0  by "Run the Coins"    (gained permission to use)
https://www.romhacking.net/hacks/6774/
2.N64 Voices(local voices v1.0) by "Emilianomario27"
https://www.romhacking.net/hacks/5135/
3.Widescreen patch by "gamemasterplc"
4.Better Colors v1.1 by "N.Dpendent"
https://www.romhacking.net/hacks/4879/
5.Original Sunset Wilds title card & sprites by "SCD"  (gained permission to use)
https://www.romhacking.net/hacks/3491/

Patch to Mario Kart - Super Circuit (USA) CRC32: ED316E37
Use some filters in an emulator and have fun.
List and links to all my projects:
https://www.romhacking.net/forum/index.php?topic=35801.0
Sub and follow me on youtube:
https://youtube.com/@TheNintenja