Genesis colors? Which is the correct one? (5 pics)
#18
Posted 26 October 2009 - 09:57 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.
Reason for edit: Gens/GS technical stuff.
#19
Posted 26 October 2009 - 09:59 AM
I'm glad we finally have a definitive answer to this. This proves that eke's idea AND my random guess were right.
#20
Posted 26 October 2009 - 10:05 AM
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.
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


