Sonic and Sega Retro Message Board: Genesis colors? - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

Genesis colors? Which is the correct one? (5 pics)

#16 User is online Oerg866 

Posted 26 October 2009 - 04:29 AM

  • High fidelity since 1993
  • Posts: 1622
  • Joined: 07-September 06
  • Gender:Male
  • Location:Frankfurt East-side, Germany
  • Project:MDEM, demoscene stuff, music, coding ...
  • Wiki edits:3
QUOTE (nineko @ Oct 25 2009, 10:38 PM)
Haha it turns out my random guess was just right in the end :]


Maybe, but in that post it doesn't say that it's the definitively right option, it states that the VDP stuff hasn't correctly been measured yet.

Or am I missing something?

#17 User is offline TmEE 

Posted 26 October 2009 - 04:40 AM

  • Watermelons are good stuff
  • Posts: 1484
  • Joined: 06-January 08
  • Gender:Male
  • Location:Estonia, Rapla City
  • Project:Mélodie, Radical Rat, Cannon Cat, SMStrk
  • Wiki edits:11


hääv fann

#18 User is online GerbilSoft 

Posted 26 October 2009 - 09:57 AM

  • RickRotate'd.
  • Posts: 1600
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
QUOTE (TmEE @ Oct 26 2009, 05:40 AM)


hääv fann

Essentially, to convert it to 32-bit, you simply copy each color component to both nybbles of the 8-bit component.

mdR: 0xE
mdG: 0xE
mdB: 0xE

pcR = mdR | (mdR << 4);
pcG = mdG | (mdG << 4);
pcB = mdB | (mdB << 4);

Gens/GS uses floating-point arithmetic to calculate the values, since this was needed for the "Full" scaling algorithm (also for 15-bit and 16-bit color); however, it ends up with the same results. I might add an optimized version for 32-bit color later, though it's not really that important since the palette calculation is only done once (unless the palette settings are changed by the user).

EDIT: With regards to S/H effects, Gens/GS maintains a 256-entry palette. Entries 0-63 are normal, 64-127 are shadow, 128-191 are highlight, and 192-255 are normal. (No, I'm not really sure why the normal entries are duplicated. It was like that in the original Gens.) T_VDP_Update_Palette() is a templated function that's called whenever the CRAM changes. This function updates the 256-entry palette with "real" (15/16/32-bit) entries based on CRAM.

The first thing T_VDP_Update_Palette() does when it reads a CRAM entry is AND it with 0x0EEE (or 0x0222 if the Palette Select bit is cleared). It then treats the entry as if it's a Normal color when looking up the palette value. Then, if Shadow/Highlight is enabled, it shifts the CRAM value around to get the shadow and highlight entries: (CRAM >> 1) for shadow, and ((CRAM >> 1) | 0x888) for highlight.
This post has been edited by GerbilSoft: 26 October 2009 - 10:09 AM
Reason for edit: Gens/GS technical stuff.

#19 User is offline nineko 

Posted 26 October 2009 - 09:59 AM

  • I am the Holy Cat
  • Posts: 5238
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
I'm glad we finally have a definitive answer to this. This proves that eke's idea AND my random guess were right.

#20 User is offline MainMemory 

Posted 26 October 2009 - 10:05 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 2663
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
So, this means that Sonic & Knuckles Collection is the winner? I would hope that SEGA knows how their own stuff works.
In case you didn't know, S&KC uses the Genesis palette format, byteswapped because it's on a PC. (GR 0B)
Edit: Question, does anybody know where the "Night Mode" flag is in Sonic 3? I can't get it to activate in S&K Collection's S3 Mode.
This post has been edited by MainMemory: 26 October 2009 - 10:20 AM

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users