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 - TMS9918 colors for SMS VDP

Reply to topic
Author Message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
TMS9918 colors for SMS VDP
Post Posted: Fri Mar 10, 2006 7:08 am
Using a 315-5124 VDP in a US NTSC SMS 1 console, here are the CRAM values that match the TMS9918 palette.

The TMS9918 modes of the SMS use a slightly different palette than a true TMS9918, and (thankfully) there are direct CRAM equivalents for each color.



 TMS color    CRAM value    Color
             (%--BBGGRR)

 $00          $00           Transparent (Black)
 $01          $00           Black
 $02          $08           Green 0
 $03          $0C           Green 2
 $04          $10           Blue 0
 $05          $30           Blue 1
 $06          $01           Red 0
 $07          $3C           Cyan
 $08          $02           Red 1
 $09          $03           Red 2
 $0A          $05           Yellow 0
 $0B          $0F           Yellow 1
 $0C          $04           Green 1
 $0D          $33           Pink
 $0E          $15           Gray
 $0F          $3F           White


So an SMS emulator would want to use these, but not (for example) when emulating the SC-3000H or SG-1000 which have a TMS9918 and different palette.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8649
  • Location: Paris, France
Reply with quote
Post Posted: Fri Mar 10, 2006 9:39 am
Thank you.
This is greatly useful.
Also note that the Game Gear supports legacy TMS9918 modes but using CRAM for palette, so the CRAM has to be filled with those values and you can play SG-1000 games on Game Gear:

(this is an old test I made, AFAIK with non correct values)
  View user's profile Send private message Visit poster's website
  • Joined: 21 Jul 2005
  • Posts: 412
  • Location: GBG
Reply with quote
Post Posted: Fri Mar 10, 2006 11:28 am
Wow, most games look horrible with that palette though.
Here is a RGB24 version:


   DCB 0x00,0x00,0x00
   DCB 0x00,0x00,0x00
   DCB 0x00,0xAA,0x00
   DCB 0x00,0xFF,0x00
   DCB 0x00,0x00,0x55
   DCB 0x00,0x00,0xFF
   DCB 0x55,0x00,0x00
   DCB 0x00,0xFF,0xFF
   DCB 0xAA,0x00,0x00
   DCB 0xFF,0x00,0x00
   DCB 0x55,0x55,0x00
   DCB 0xFF,0xFF,0x00
   DCB 0x00,0x55,0x00
   DCB 0xFF,0x00,0xFF
   DCB 0x55,0x55,0x55
   DCB 0xFF,0xFF,0xFF


I hope that is the correct conversion.

Also, shouldn't the names of Green 0 & Green 1 change names?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Fri Mar 10, 2006 1:31 pm
I made a quick comparison here:

http://www.smspower.org/maxim/forumstuff/colours.html

One thing I would mention is that the SMS colour values are wrong. We've gone into this before, but failed to come up with a reliable way of getting "correct" colours, since consumer video capture hardware does not tend to cope well with artificial images like these, especially coming through a dodgy RF connection (as I was using at that time). However, I would like to add this observation: in Bock's Birthday 2004, I have a huge dark grey "xiao" character in the background, and on the TV, it is a much lighter grey colour than I expected. This would appear to be a "gamma" issue - TVs have a "gamma" of 2.2 which will tend to skew colours from linear distribution (00 55 aa ff) to one bunched at the high end (more like 00 88 cc ff, total guess).

Does anyone have a copy of the images from the thread linked above?
  View user's profile Send private message Visit poster's website
  • Joined: 26 Dec 2004
  • Posts: 374
  • Location: Japan
Reply with quote
Post Posted: Fri Mar 10, 2006 1:44 pm
For what it's worth, I also made a hacked version of Tototek's SMS-Pro/GG-Pro menu ROM to set up the palette correctly (?) for SG-1000 games.

http://disgruntleddesigner.com/chrisc/segahacking/ChrisBoot.zip
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Mar 10, 2006 3:13 pm
FluBBa wrote
Wow, most games look horrible with that palette though.
Here is a RGB24 version:


Yes, which is why it's a good distinction to make. I was testing my software under Kega and the colors (being true to the TMS9918) didn't match what I saw on my TV at all.

Quote
I hope that is the correct conversion.


Probably, we are just talking about filling bits here ;)

Quote
Also, shouldn't the names of Green 0 & Green 1 change names?


Oh, yes. I sort of guessed the names as I went along and as the greens aren't grouped together I must have transposed them. ;)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Fri Mar 10, 2006 3:50 pm
Charles MacDonald wrote
Oh, yes. I sort of guessed the names as I went along and as the greens aren't grouped together I must have transposed them. ;)

The "official" names (from the TMS9918 manual, apparently) are:

0 Transparent
1 Black
2 Medium Green
3 Light Green
4 Dark Blue
5 Light Blue
6 Dark Red
7 Cyan
8 Medium Red
9 Light Red
A Dark Yellow
B Light Yellow
C Dark Green
D Magenta
E Grey
F White
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Mar 10, 2006 4:27 pm
Here's the color editing program if anyone wants to test on their console.

I used a hardcoded delay to move the split-screen flicker into the right border so there would be no interruption between the TMS9918 (bottom) and SMS (top) color display areas, not sure how that will work on a PAL machine.
tmscol.zip (2.13 KB)
TMS9918 Color Test Program

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14735
  • Location: London
Reply with quote
Post Posted: Fri Mar 10, 2006 9:18 pm
I just tested on a PAL SMS with the same results.

There is a tiny bit of noise in the picture (I circled where it is, although it's not really noticeable in the photo) due to different timing but the demo functions perfectly.

I tried a real SG game for comparison - The Castle runs nicely on my RAM cart :) I also used the better camera with a nice long exposure setting to grab that one without black bars.
DSC00076.JPG (22.81 KB)
The best shot I could get...
DSC00076.JPG
DSCN0840.JPG (25.61 KB)
Example of an SG game
DSCN0840.JPG

  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!