Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Mortal Kombat II : SMS palette improvement

Reply to topic
Author Message
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Mortal Kombat II : SMS palette improvement
Post Posted: Thu Oct 19, 2023 7:45 pm
Hey everyone,

I decided to take a short break from my current project and look at improving a game I always loved : Mortal Kombat II on SMS.

When I was a kid, my family didn't have a ton of money. We lived in France by the way. Luckily, there was the SMS here in Europe, it was much more affordable than the MegaDrive or SNES, and my parents bought me one. I enjoyed a lot of 16 bits games in their 8 bits SMS versions, and had a blast to be frank. These were good days :)

Even though I was a kid, I got Mortal Kombat II. Parents weren't really aware of violence in games back then, but these were only some pixels moving around, so not as detailed as nowadays. I enjoyed the game a lot.

Many years later I discovered the GG port and was blown away by the color palettes : the game looks much better on the GG ! Still I thought that something had to be wrong on SMS, especially with the backgrounds. How come they looked so bad ? Even the SMS should have been able to do better.

After I started developing my own GG/SMS games I also started looking at games and how they were coded. And when I checked MKII on SMS, the results were obvious in the palettes : duplicate colors and a loss of gradients. I instantly thought : developers converted the palettes to the SMS in a quick & dirty way and called it a day. The GG game was obviously the lead platform, at least for the visuals.

That's when the thought occurred to me that I could try to fix them. But when I was looking for the palettes in ROM, I could never find them. After failing and postponing a few times, I tried again this week. And this time, I went for the assembly code and tried to look at places where the VDP is written. Looking for setups to write the CRAM. After quite some time and trial & error, I finally found out the truth about palettes in MKII on SMS...

Developers put the GG palettes inside the ROM. They load them in RAM (C280/C290 and C2A0/C2B0) and then, with a function they convert them on the fly to the SMS (see picture). I suppose this must be the same process for GG to SMS conversions I saw on the site, in principle.

So now that I have understood this (all by myself ! super proud of me lol), I have starting changing the palettes to improve the visuals. I have of course to decide on the SMS palettes first, and then change them to GG palettes, before writing them down back in the ROM at the correct places. A super fun process !

I have improved all three backgrounds and the first 4 characters (including player 1+2 colors of course). Backgrounds also have a fixed "dark" palette for Fatalities, that I have updated as well.

A few things make this extremely challenging though, so I don't have a lot of freedom. There are gradients of black/dark grey/grey/white that are used abundantly in the backgrounds AND the characters at once. So I cannot change them. Which means I have to deal with a lot of dark grey and some light grey in places. I have managed around these to the best of my possibilities, while trying to stay close enough to intended colors and using all gradients available in the visuals. And not turning this into Disney Land either, backgrounds are supposed to be a bit dark.

Same problem applies to characters, with wasted color slots, I am working on it...

Once this is complete, I will submit the hack to romhacking as I did with another one in the past. It can maybe be added to the site here as well.

In hindsight, I probably didn't pick the most straightforward first game for a palette update haha !

Hope this was of interest !
Mortal Kombat 2_patch_v1.png (4.36 KB)
goro lair
Mortal Kombat 2_patch_v1.png
image.png (44.57 KB)
func_conversion
image.png
Capture.png (60.78 KB)
kitana_original
Capture.png
Capture2.png (59.69 KB)
kitana_improved
Capture2.png

  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 874
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Thu Oct 19, 2023 9:39 pm
Awesome! 👍
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jan 2022
  • Posts: 8
  • Location: Chile
Reply with quote
Post Posted: Thu Oct 19, 2023 10:11 pm
You can't imagine how long I waited for news like this, I feel like Master System's Mortal Kombat II could have done so many more things. (in fact, it seems unfair to me that the only difference in gamegear is that the sprites looked more gigantic on the screen given its low resolution)

I hope to see more news soon, have much success!
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Fri Oct 20, 2023 9:08 am
Have you looked at the tiles as well? The background tiles are uncompressed in the rom, so they are easy to change.
It might give you a bit more freedom. When a color is shared between background and fighter, you can "assign" another color by changing the tile.
You can also add dithering to get "fake" darker colors.. or smoother gradients etc.
Not sure how the tilemap is stored, but if you can figure that out, you might be able to replace/improve the backgound even further.

Unfortunately the fighter's tiles are nowhere to be found. They might be compressed. Or just stored in an alternative way.
I guess the latter. These tiles need to be streamed from ROM to video memory, so that needs to be as fast as possible. In other words reading the data must be really simple.

Same goes for MK1. However MK3 has "uncompressed" background and fighter tiles!


B.t.w. i did a small hack of MK1. I change the background tiles of Goro's Lair, which makes the eyes visible in the background.
(compared to the arcade, there seemed to be too many eyes, but that's how it is in the GG version as well)

  View user's profile Send private message Visit poster's website
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Fri Oct 20, 2023 3:48 pm
slogra wrote
Have you looked at the tiles as well?

I did not look into it and it does go beyond my initial intention. I could check it out, if only to fix tiles without touching the tilemap.

What tool do you use for this ?

Edit : found a tool called yy
I am going to reassign some colors and adjust a few minor details in the backgrounds.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Fri Oct 20, 2023 6:43 pm
Yychr will work, but i never found a way to import an SMS palette.

Mastertileconverter is easier when it comes to palettes as you can import a raw palette from Mekaw.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Sat Oct 21, 2023 1:44 am
Here is a screenshot of the palette in a hex editor and the same palette imported palette in Master Tile Converter.




And a small headsup. You need to make sure to not overwrite any of the "noise" in the rom. You will break the game if you overwrite the noise.

To avoid overwriting the noise, you have import the image in 2 sections:
1. All tiles except the last row
2. The last row where the last tile is on the right (as in the screenshot below)

Make sure to crop those sections in you picture editor before you import.
Perhaps other tile editors are better at importing a selected number of tiles, but i don't know.
Btw What picture editor are you using?



  View user's profile Send private message Visit poster's website
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Sat Oct 21, 2023 6:44 am
Thanks for the details.

I actually already used yy to edit the tiles. It worked very well in my opinion. I simply had to put the palettes manually, but this is pretty quick and then you can save them for later. And the tool allows modifying the pixels directly, no need to import/export anything.

So I adjusted a few things, mainly the usage of grey and dark grey that I replaced by other colors in a few places.

I went with an orange tint for the Tomb because there were too many colors shared with character skin, which was reducing readability.

  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Sat Oct 21, 2023 8:05 am
Well done, it looks really great!

There is just one thing on my mind. The colors of the pit are not purple in the arcade game. Most of it is blue, grey and whatever the color or the light is.
pit2 crop.png (45.85 KB)
pit2 crop.png

  View user's profile Send private message Visit poster's website
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Sat Oct 21, 2023 10:13 am
slogra wrote
Well done, it looks really great!

There is just one thing on my mind. The colors of the pit are not purple in the arcade game. Most of it is blue, grey and whatever the color or the light is.

My intention was not necessarily to get closer to the arcade.

And if you tried it out yourself, you would see that you do not have the freedom to do whatever you like/prefer.

The colors you are going to use are dictated by the gradient from the mountains. You don't want to make this super light.

So the darker one has to be the darkest blue. And then starting from this, the next gradient has to be 1 Blue and 1 Red or 1 Green on top of it. Otherwise it will get to light. And when doing this, you end up defining colors for the road at the same time.

I never intended to completely redraw the backgrounds.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Sat Oct 21, 2023 10:40 am
The purple reminds me more of the wasteland stage.

Blue can look darker than purple if you use this gradient: 1 lbue, 2 blue, 1 green+2 blue.

It will look like this:

(Sorry for the blurry screenshot. For some reason it scales in a bad way.)

pit-blues00.png (95.13 KB)
pit-blues00.png

  View user's profile Send private message Visit poster's website
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Sat Oct 21, 2023 11:41 am
slogra wrote
The purple reminds me more of the wasteland stage.

Blue can look darker than purple if you use this gradient: 1 lbue, 2 blue, 1 green+2 blue.

It will look like this:

Your picture is wasting one gradient. The darkest blue I use is actually black in your picture, which is what the original game does, and what I wanted to fix :)

(you also get a glimpse at wasted slots for Lui Kang and Jax, by the way)

The last 4 colors (black/dark grey/grey/white) are already used by the background. The 4 colors just before are the 4 additional colors you can use in your background : you might want to avoid reusing the 4 previous colors (in your case : black). The very first color of the palette is also used in the background, you can change it, it is safe.

So if you change your black for 1 Blue (which is a must to me), I will let you see the chain effect that this leads to.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Sat Oct 21, 2023 6:00 pm
I see what you mean now. I did not notice the black that should be dark blue.

What do think about these variations?




pit-blues02.png (37.65 KB)
pit-blues02.png
pit-blues03.png (36.89 KB)
pit-blues03.png
pit-blues04.png (36.12 KB)
pit-blues04.png

  View user's profile Send private message Visit poster's website
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Sat Oct 21, 2023 6:12 pm
slogra wrote
What do think about these variations?

The road in grey is something I definitely wanted to avoid. Honestly, it doesn't look very good.

The last one is the one I prefer. It definitely feels blue, but I find that the last two colors are too much of the same level of "brightness" so we don't tell them appart a lot, while a gradient is definitely possible and adds more depth.

Here is my palette if you want to see how I did it
RGB
0 0 1
1 0 1
1 0 2
1 1 2
and
1 1 3 (first color of the palette)

I like the idea of the dark side of the mountains to be blue while the rest has an additional, minor component to it.

Tiles have been edited of course, I removed most of the unwanted dark grey and adjusted the moon.
Capture.PNG (926.31 KB)
Capture.PNG

  View user's profile Send private message
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Sun Oct 22, 2023 9:54 am
For anyone who wants to try the hack, it is now available on romhacking.

https://www.romhacking.net/hacks/8154/

I need to change a picture, I uploaded an old one. Also, I will be releasing an update soon because I have also fixed Lui Kang's Fatality, which was using dedicated palettes.

Finally, for people who would like to change the colors themselves to something that they prefer, here is a quick summary of where to look at and how to proceed.


In this picture we see the current gameplay, the palette RAM. In yellow are the four last gradients that should not be touched as they are used by both character and background.
The four gradients right before are used for the BG and you can change them. The very first color can be changed as well.


Starting from C280, you have the GG palette 1.
At C2A0 you the GG palette 2.
All of these are values used to calculate the SMS palette 1 and palette 2. So the first two bytes at C280 and C281 are used to calculate the very first color.



They are 36 08, being in order G R 0 B. My understanding of their code is that below 4 you get 0, below 8 you get 1, below C you get 2 and otherwise you get 3.
In this case you end up with 1 Red and 2 Blue.

I decided to put 0 to get 0, 4 to get 1, 8 to get 2 and F to get 3.

With this information, you know what to search in the ROM for replacement, and what to put in order to have the wanted colors.
Capture.PNG (215.46 KB)
cap
Capture.PNG
C280.PNG (27.93 KB)
C280
C280.PNG
convert_to_GG.PNG (12.93 KB)
convert
convert_to_GG.PNG

  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!