For anything related to VDP (plane, color, sprite, tiles)

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Hello,

So, information I gathered and questions :

- colors are in 9 bits
- we write it in the order B + G + R
=> in Binary it should be written 000 000 000 (9 bits), right ?

- for the Megadrive, the different Decimal values for each R, G and B can be : 000, 032, 064, 096, 128, 160, 192, 224
- in Hex, it is corresponding to 00, 20, 40, 60, 80, A0, C0, E0
- in Binary : 00000000, 01000000, 10000000, 11000000, 10000000, 10100000, 11000000, 11100000

=> Why do we write MD colors like that : 0x0BGR ?
example : is 0x0EEE a shortcut for #E0E0E0 ? Why don't we write #E0E0E0 ?

=> pure white :
Black will be 0x0000, but white ? Maximum we can get is 0x0EEE, that is quite light gray...
How to get a white color ?

=> What are the values for Shadow and Highlight colors ?
=> can we have Normal, Shadow and Higlight colors in a same palette ?

=> I saw this on the web but it's telling different values for MD RGB. What is the truth ? :
"Normal : 0, 36, 72, 108, 144, 180, 216, 252
Shadow : 0, 18, 36, 54, 72, 90, 108, 126
Highlight : 126, 144, 162, 180, 198, 216, 234, 252"
(Dec) 0, 36, 72, 108, 144, 180, 216, 252 = (Hex) 00, 24, 48, 6C, 90, B4, D8, FC
Does it mean that we can't have an accurate range of values ?
But this range "00, 24, 48, 6C, 90, B4, D8, FC" would not be possible to be written in the way 0x0BGR because we completely loose the second number, and there would be a lack of accuracy
For "00, 20, 40, 60, 80, A0, C0, E0", second number is always 0 so it's more easy.

=> I used "genitile" + "BMP to Tiles.bat" to get Palette and Tiles from a picture.
This is what I got for the palette :
dc.w 0x0eee
dc.w 0x0d0f
dc.w 0x0cbb
dc.w 0x0940
dc.w 0x0a40
dc.w 0x0630
dc.w 0x0a50
dc.w 0x0840
dc.w 0x0b60
dc.w 0x0a50
dc.w 0x0222
dc.w 0x0899
dc.w 0x08cf
dc.w 0x058d
dc.w 0x022a
dc.w 0x0000
Some of the colors don't match with none of the two range of values I showed above...
For information, I did this picture (40x64 pxl sprite) on Photoshop, with 15+1 transparent color, with colors not matching to Genesis Palette (because I don't know it).
I thougt Genitile would then take the nearest colours to match MD 512 colors Palette.
Am I wrong ?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
=> What are the colors values ranges in R, G, and B (Bin or Hex) that the MegaDrive understands (Normal / Shadow / Hilight) ? In Assembly or C <=
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This message is probably a little bit messy, sorry.
Thanks,
TAMA

TmEE co.(TM)
Very interested
Posts: 2358
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:
Palette entry format is 0BBB0GGG0RRR

On PC you use sequence based 255/7 to get even mapping of the 8 states into 256 of PC screen.

255 / 7 = 36.428, for sake of simplicity it is rounded to 36. Then you get sequence :
0, 36, 72 108, 144, 180, 216, 252/255

When you add shadow/highlight to the mix you get these sequences :
Shadow : 0, 18, 36, 54, 72, 90, 108, 126
Highlight : 126, 144, 162, 180, 198, 216, 234, 252/255
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Hi,
Thank you.

I'm now making a background image (actually adapting a background from Metal Slug).
Can we mix in a single palette some Normal / Highlight and Shadow colors ?
Can we use different palette for a single background plane ?
In a PLANE B of a background we usually don't need transparency : can I use color 0 as a real color used for my background ?

TAMA

mikejmoffitt
Very interested
Posts: 86
Joined: Fri Sep 25, 2015 4:16 pm