summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author briantro <briantro@users.noreply.github.com>2017-08-29 20:51:33 -0500
committer briantro <briantro@users.noreply.github.com>2017-08-29 20:51:33 -0500
commitcf296a486cd074edd82ee7b7567153aa3283bd3a (patch)
tree9e6fef78fd8ab6eed806a21f09ee3013cf08fb63
parent8d7d3f3232aaad253b5142bade9fe551cfe675b2 (diff)
parenta7472823ce0cbca588e2682f8ed3c43eec08c7e3 (diff)
Merge branch 'master' of https://github.com/mamedev/mame
-rw-r--r--src/mame/drivers/wallc.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mame/drivers/wallc.cpp b/src/mame/drivers/wallc.cpp
index a10d4d68a0c..77d9a68f5ff 100644
--- a/src/mame/drivers/wallc.cpp
+++ b/src/mame/drivers/wallc.cpp
@@ -77,6 +77,7 @@ public:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_PALETTE_INIT(wallc);
+ DECLARE_PALETTE_INIT(unkitpkr);
DECLARE_VIDEO_START(unkitpkr);
DECLARE_DRIVER_INIT(wallc);
DECLARE_DRIVER_INIT(wallca);
@@ -159,6 +160,45 @@ PALETTE_INIT_MEMBER(wallc_state, wallc)
}
}
+PALETTE_INIT_MEMBER(wallc_state, unkitpkr)
+{
+// this pcb has 470 ohms resistors instead of the expected 330 ohms.
+ const uint8_t *color_prom = memregion("proms")->base();
+ int i;
+
+ static const int resistances_rg[2] = { 470, 220 };
+ static const int resistances_b[3] = { 655, 470, 220 };
+ double weights_r[2], weights_g[2], weights_b[3];
+
+ compute_resistor_weights(0, 255, -1.0,
+ 2, resistances_rg, weights_r, 470, 0,
+ 2, resistances_rg, weights_g, 470, 0,
+ 3, resistances_b, weights_b, 470, 655+220);
+
+ for (i = 0;i < palette.entries();i++)
+ {
+ int bit0,bit1,bit7,r,g,b;
+
+ /* red component */
+ bit0 = (color_prom[i] >> 5) & 0x01;
+ bit1 = (color_prom[i] >> 6) & 0x01;
+ r = combine_2_weights(weights_r, bit1, bit0);
+
+ /* green component */
+ bit0 = (color_prom[i] >> 2) & 0x01;
+ bit1 = (color_prom[i] >> 3) & 0x01;
+ g = combine_2_weights(weights_g, bit1, bit0);
+
+ /* blue component */
+ bit0 = (color_prom[i] >> 0) & 0x01;
+ bit1 = (color_prom[i] >> 1) & 0x01;
+ bit7 = (color_prom[i] >> 7) & 0x01;
+ b = combine_3_weights(weights_b, bit7, bit1, bit0);
+
+ palette.set_pen_color(i,rgb_t(r,g,b));
+ }
+}
+
WRITE8_MEMBER(wallc_state::videoram_w)
{
m_videoram[offset] = data;
@@ -460,6 +500,8 @@ static MACHINE_CONFIG_DERIVED( unkitpkr, wallc )
MCFG_CPU_PROGRAM_MAP(unkitpkr_map)
MCFG_VIDEO_START_OVERRIDE(wallc_state, unkitpkr)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(wallc_state, unkitpkr)
/* sound hardware */
MCFG_SOUND_MODIFY("aysnd")