summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emupal.cpp
diff options
context:
space:
mode:
author Bryan McPhail <bmcphail@vcmame.net>2017-06-27 17:00:41 -0400
committer Bryan McPhail <bmcphail@vcmame.net>2017-06-27 17:00:41 -0400
commitdad7fca1f75e1d1e6ba766ab15bbe0e4e905a24e (patch)
treefd6743f6b2362b198b7b446534b8164fb0728d0c /src/emu/emupal.cpp
parent226e732dea37e66eefa3d99bbda0d80416cd0104 (diff)
Add alternate revision of Cobra Command. Add correct palette weighting for all Dec8 games
Diffstat (limited to 'src/emu/emupal.cpp')
-rw-r--r--src/emu/emupal.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp
index 4062b0f74f7..27bfc65927d 100644
--- a/src/emu/emupal.cpp
+++ b/src/emu/emupal.cpp
@@ -507,3 +507,22 @@ rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder(u32 raw)
u8 const b = pal5bit(((raw >> 0) & 0x0f) | ((raw >> 8) & 0x10));
return rgb_t(r, g, b);
}
+
+// This conversion mimics the specific weighting used by the Data East
+// custom resistor pack marked DECO RM-C3 to convert the digital
+// palette for analog output. It is used on games such as The Real
+// Ghostbusters, Gondomania, Cobra Command, Psychonics Oscar.
+//
+// Resistor values are 220 ohms (MSB), 470 ohms, 1 kohm, 2.2 kohm (LSB)
+rgb_t raw_to_rgb_converter::deco_rgb_decoder(u32 raw)
+{
+ u8 r = raw&0xf;
+ u8 g = (raw>>4)&0xf;
+ u8 b = (raw>>8)&0xf;
+
+ r = 0x0e * (r&1) + 0x1f * ((r&2)>>1) + 0x43 * ((r&4)>>2) + 0x8f * ((r&8)>>3);
+ g = 0x0e * (g&1) + 0x1f * ((g&2)>>1) + 0x43 * ((g&4)>>2) + 0x8f * ((g&8)>>3);
+ b = 0x0e * (b&1) + 0x1f * ((b&2)>>1) + 0x43 * ((b&4)>>2) + 0x8f * ((b&8)>>3);
+
+ return rgb_t(r, g, b);
+}