summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nicola Salmoria <nicola@mamedev.org>2008-04-13 15:43:06 +0000
committer Nicola Salmoria <nicola@mamedev.org>2008-04-13 15:43:06 +0000
commit9d8d92441834e0b0b98ba3054135ebf027338a2e (patch)
treef3b2f7087e1bb18ec92794549f8a6a4a371120cd
parent02b2ba8a6dbd45715532d44d867908227f02af09 (diff)
this should be the correct palette formula according to schematics
-rw-r--r--src/mame/video/bionicc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c
index 2ef63be14a2..ee47fa4135e 100644
--- a/src/mame/video/bionicc.c
+++ b/src/mame/video/bionicc.c
@@ -131,16 +131,23 @@ WRITE16_HANDLER( bionicc_txvideoram_w )
WRITE16_HANDLER( bionicc_paletteram_w )
{
- int red, green, blue, bright;
+ int r, g, b, bright;
data = COMBINE_DATA(&paletteram16[offset]);
- bright = 0x10 + (data&0x0f);
+ bright = (data&0x0f);
- red = ((data>>12)&0x0f) * bright * 0x11 / 0x1f;
- green = ((data>>8 )&0x0f) * bright * 0x11 / 0x1f;
- blue = ((data>>4 )&0x0f) * bright * 0x11 / 0x1f;
+ r = ((data>>12)&0x0f) * 0x11;
+ g = ((data>>8 )&0x0f) * 0x11;
+ b = ((data>>4 )&0x0f) * 0x11;
+
+ if ((bright & 0x08) == 0)
+ {
+ r = r * (0x07 + bright) / 0x0e;
+ g = g * (0x07 + bright) / 0x0e;
+ b = b * (0x07 + bright) / 0x0e;
+ }
- palette_set_color (machine, offset, MAKE_RGB(red, green, blue));
+ palette_set_color (machine, offset, MAKE_RGB(r, g, b));
}
WRITE16_HANDLER( bionicc_scroll_w )