summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2017-05-22 02:53:52 +0200
committer Dirk Best <mail@dirk-best.de>2017-05-22 02:54:26 +0200
commitff0eab691d14273d7171da9adb8bbf647551bf71 (patch)
tree823c53cb9fee7de1c8348888a2571d59d2d54ac9
parentb4644cf2a55bcb01aafab1a865e964d5c3f2f1db (diff)
Replace some custom palette inits with the appropriate standard callback
-rw-r--r--src/mame/drivers/40love.cpp6
-rw-r--r--src/mame/drivers/gluck2.cpp41
-rw-r--r--src/mame/drivers/istellar.cpp42
-rw-r--r--src/mame/drivers/lvcards.cpp4
-rw-r--r--src/mame/drivers/mustache.cpp3
-rw-r--r--src/mame/includes/40love.h1
-rw-r--r--src/mame/includes/lvcards.h1
-rw-r--r--src/mame/includes/mustache.h1
-rw-r--r--src/mame/video/40love.cpp40
-rw-r--r--src/mame/video/lvcards.cpp36
-rw-r--r--src/mame/video/mustache.cpp34
11 files changed, 8 insertions, 201 deletions
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index a3ebd11ea5d..50302081763 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -1073,8 +1073,7 @@ static MACHINE_CONFIG_START( 40love )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
- MCFG_PALETTE_ADD("palette", 1024)
- MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 1024)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
@@ -1131,8 +1130,7 @@ static MACHINE_CONFIG_START( undoukai )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
- MCFG_PALETTE_ADD("palette", 1024)
- MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 1024)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
diff --git a/src/mame/drivers/gluck2.cpp b/src/mame/drivers/gluck2.cpp
index a0155e09fb2..7f5b644d30f 100644
--- a/src/mame/drivers/gluck2.cpp
+++ b/src/mame/drivers/gluck2.cpp
@@ -227,7 +227,6 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info);
virtual void video_start() override;
- DECLARE_PALETTE_INIT(gluck2);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@@ -281,43 +280,6 @@ uint32_t gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
}
-PALETTE_INIT_MEMBER(gluck2_state, gluck2)
-{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
-
- for (i = 0; i < 0x100; i++)
- {
- int bit0, bit1, bit2, bit3;
- int r, g, b;
-
- /* red component */
- bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
- bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
- bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
- bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
- r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* green component */
- bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
- bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
- bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
- bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
- g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* blue component */
- bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
- bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
- bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
- bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
- b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- palette.set_pen_color(i, rgb_t(r, g, b));
-
- }
-}
-
-
/**********************************************
* R/W Handlers *
**********************************************/
@@ -538,8 +500,7 @@ static MACHINE_CONFIG_START( gluck2 )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gluck2)
- MCFG_PALETTE_ADD("palette", 0x100)
- MCFG_PALETTE_INIT_OWNER(gluck2_state, gluck2)
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
MCFG_MC6845_SHOW_BORDER_AREA(false)
diff --git a/src/mame/drivers/istellar.cpp b/src/mame/drivers/istellar.cpp
index 3f28c9cd07b..10fb360e45e 100644
--- a/src/mame/drivers/istellar.cpp
+++ b/src/mame/drivers/istellar.cpp
@@ -59,7 +59,6 @@ public:
DECLARE_WRITE8_MEMBER(z80_2_ldp_write);
DECLARE_DRIVER_INIT(istellar);
virtual void machine_start() override;
- DECLARE_PALETTE_INIT(istellar);
uint32_t screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_callback_istellar);
required_device<cpu_device> m_maincpu;
@@ -276,43 +275,6 @@ static INPUT_PORTS_START( istellar )
/* SERVICE might be hanging out back here */
INPUT_PORTS_END
-PALETTE_INIT_MEMBER(istellar_state, istellar)
-{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
-
- for (i = 0; i < palette.entries(); i++)
- {
- int r,g,b;
- int bit0,bit1,bit2,bit3;
-
- /* Daphne says "TODO: get the real interstellar resistor values" */
-
- /* red component */
- bit0 = (color_prom[i+0x000] >> 0) & 0x01;
- bit1 = (color_prom[i+0x000] >> 1) & 0x01;
- bit2 = (color_prom[i+0x000] >> 2) & 0x01;
- bit3 = (color_prom[i+0x000] >> 3) & 0x01;
- r = (0x8f * bit3) + (0x43 * bit2) + (0x1f * bit1) + (0x0e * bit0);
-
- /* green component */
- bit0 = (color_prom[i+0x100] >> 0) & 0x01;
- bit1 = (color_prom[i+0x100] >> 1) & 0x01;
- bit2 = (color_prom[i+0x100] >> 2) & 0x01;
- bit3 = (color_prom[i+0x100] >> 3) & 0x01;
- g = (0x8f * bit3) + (0x43 * bit2) + (0x1f * bit1) + (0x0e * bit0);
-
- /* blue component */
- bit0 = (color_prom[i+0x200] >> 0) & 0x01;
- bit1 = (color_prom[i+0x200] >> 1) & 0x01;
- bit2 = (color_prom[i+0x200] >> 2) & 0x01;
- bit3 = (color_prom[i+0x200] >> 3) & 0x01;
- b = (0x8f * bit3) + (0x43 * bit2) + (0x1f * bit1) + (0x0e * bit0);
-
- palette.set_pen_color(i,rgb_t(r,g,b));
- }
-}
-
static const gfx_layout istellar_gfx_layout =
{
8,8,
@@ -364,8 +326,8 @@ static MACHINE_CONFIG_START( istellar )
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_PALETTE_INIT_OWNER(istellar_state, istellar)
+ // Daphne says "TODO: get the real interstellar resistor values"
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", istellar)
diff --git a/src/mame/drivers/lvcards.cpp b/src/mame/drivers/lvcards.cpp
index e72db16f15a..ef4fe725d5d 100644
--- a/src/mame/drivers/lvcards.cpp
+++ b/src/mame/drivers/lvcards.cpp
@@ -499,8 +499,8 @@ static MACHINE_CONFIG_DERIVED( ponttehk, lvcards )
MCFG_MACHINE_RESET_OVERRIDE(lvcards_state,lvpoker)
// video hardware
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_INIT_OWNER(lvcards_state,ponttehk)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
MACHINE_CONFIG_END
ROM_START( lvpoker )
diff --git a/src/mame/drivers/mustache.cpp b/src/mame/drivers/mustache.cpp
index c8d6a3e1782..845d8d65609 100644
--- a/src/mame/drivers/mustache.cpp
+++ b/src/mame/drivers/mustache.cpp
@@ -200,8 +200,7 @@ static MACHINE_CONFIG_START( mustache )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mustache)
- MCFG_PALETTE_ADD("palette", 8*16+16*8)
- MCFG_PALETTE_INIT_OWNER(mustache_state, mustache)
+ MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h
index 37e3ba8e2c8..94eeaf5b276 100644
--- a/src/mame/includes/40love.h
+++ b/src/mame/includes/40love.h
@@ -108,7 +108,6 @@ public:
DECLARE_DRIVER_INIT(40love);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void video_start() override;
- DECLARE_PALETTE_INIT(fortyl);
DECLARE_MACHINE_START(40love);
DECLARE_MACHINE_RESET(40love);
DECLARE_MACHINE_START(undoukai);
diff --git a/src/mame/includes/lvcards.h b/src/mame/includes/lvcards.h
index 418e6376923..42dc7f74d02 100644
--- a/src/mame/includes/lvcards.h
+++ b/src/mame/includes/lvcards.h
@@ -26,7 +26,6 @@ public:
DECLARE_PALETTE_INIT(lvcards);
DECLARE_MACHINE_START(lvpoker);
DECLARE_MACHINE_RESET(lvpoker);
- DECLARE_PALETTE_INIT(ponttehk);
uint32_t screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/includes/mustache.h b/src/mame/includes/mustache.h
index 340d8fbe026..73e155633aa 100644
--- a/src/mame/includes/mustache.h
+++ b/src/mame/includes/mustache.h
@@ -37,7 +37,6 @@ public:
DECLARE_DRIVER_INIT(mustache);
virtual void video_start() override;
- DECLARE_PALETTE_INIT(mustache);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
diff --git a/src/mame/video/40love.cpp b/src/mame/video/40love.cpp
index 046f162668a..6beb000f1df 100644
--- a/src/mame/video/40love.cpp
+++ b/src/mame/video/40love.cpp
@@ -8,46 +8,6 @@
#include "includes/40love.h"
-/*
-* color prom decoding
-*/
-
-PALETTE_INIT_MEMBER(fortyl_state, fortyl)
-{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
-
- for (i = 0; i < palette.entries(); i++)
- {
- int bit0, bit1, bit2, bit3, r, g, b;
-
- /* red component */
- bit0 = (color_prom[0] >> 0) & 0x01;
- bit1 = (color_prom[0] >> 1) & 0x01;
- bit2 = (color_prom[0] >> 2) & 0x01;
- bit3 = (color_prom[0] >> 3) & 0x01;
- r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* green component */
- bit0 = (color_prom[palette.entries()] >> 0) & 0x01;
- bit1 = (color_prom[palette.entries()] >> 1) & 0x01;
- bit2 = (color_prom[palette.entries()] >> 2) & 0x01;
- bit3 = (color_prom[palette.entries()] >> 3) & 0x01;
- g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* blue component */
- bit0 = (color_prom[2*palette.entries()] >> 0) & 0x01;
- bit1 = (color_prom[2*palette.entries()] >> 1) & 0x01;
- bit2 = (color_prom[2*palette.entries()] >> 2) & 0x01;
- bit3 = (color_prom[2*palette.entries()] >> 3) & 0x01;
- b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- palette.set_pen_color(i, rgb_t(r,g,b));
-
- color_prom++;
- }
-}
-
/***************************************************************************
Callbacks for the TileMap code
diff --git a/src/mame/video/lvcards.cpp b/src/mame/video/lvcards.cpp
index 5a380a84593..d7e9ad81758 100644
--- a/src/mame/video/lvcards.cpp
+++ b/src/mame/video/lvcards.cpp
@@ -12,42 +12,6 @@
#include "includes/lvcards.h"
-PALETTE_INIT_MEMBER(lvcards_state,ponttehk)
-{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
-
- for ( i = 0; i < palette.entries(); i++ )
- {
- int bit0,bit1,bit2,bit3,r,g,b;
-
- /* red component */
- bit0 = (color_prom[0] >> 0) & 0x01;
- bit1 = (color_prom[0] >> 1) & 0x01;
- bit2 = (color_prom[0] >> 2) & 0x01;
- bit3 = (color_prom[0] >> 3) & 0x01;
- r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* green component */
- bit0 = (color_prom[palette.entries()] >> 0) & 0x01;
- bit1 = (color_prom[palette.entries()] >> 1) & 0x01;
- bit2 = (color_prom[palette.entries()] >> 2) & 0x01;
- bit3 = (color_prom[palette.entries()] >> 3) & 0x01;
- g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* blue component */
- bit0 = (color_prom[2*palette.entries()] >> 0) & 0x01;
- bit1 = (color_prom[2*palette.entries()] >> 1) & 0x01;
- bit2 = (color_prom[2*palette.entries()] >> 2) & 0x01;
- bit3 = (color_prom[2*palette.entries()] >> 3) & 0x01;
- b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- palette.set_pen_color(i,rgb_t(r,g,b));
-
- color_prom++;
- }
-}
-
PALETTE_INIT_MEMBER(lvcards_state, lvcards)//Ever so slightly different, but different enough.
{
const uint8_t *color_prom = memregion("proms")->base();
diff --git a/src/mame/video/mustache.cpp b/src/mame/video/mustache.cpp
index 8e11878c571..9a8f03217b7 100644
--- a/src/mame/video/mustache.cpp
+++ b/src/mame/video/mustache.cpp
@@ -12,40 +12,6 @@
#include "includes/mustache.h"
-PALETTE_INIT_MEMBER(mustache_state, mustache)
-{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
-
- for (i = 0;i < 256;i++)
- {
- int bit0,bit1,bit2,bit3,r,g,b;
-
- /* red component */
- bit0 = (color_prom[i] >> 0) & 0x01;
- bit1 = (color_prom[i] >> 1) & 0x01;
- bit2 = (color_prom[i] >> 2) & 0x01;
- bit3 = (color_prom[i] >> 3) & 0x01;
- r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* green component */
- bit0 = (color_prom[i + 256] >> 0) & 0x01;
- bit1 = (color_prom[i + 256] >> 1) & 0x01;
- bit2 = (color_prom[i + 256] >> 2) & 0x01;
- bit3 = (color_prom[i + 256] >> 3) & 0x01;
- g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- /* blue component */
- bit0 = (color_prom[i + 512] >> 0) & 0x01;
- bit1 = (color_prom[i + 512] >> 1) & 0x01;
- bit2 = (color_prom[i + 512] >> 2) & 0x01;
- bit3 = (color_prom[i + 512] >> 3) & 0x01;
- b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
-
- palette.set_pen_color(i,rgb_t(r,g,b));
- }
-}
-
WRITE8_MEMBER(mustache_state::videoram_w)
{
m_videoram[offset] = data;