Replace some custom palette inits with the appropriate standard callback

This commit is contained in:
Dirk Best 2017-05-22 02:53:52 +02:00
parent b4644cf2a5
commit ff0eab691d
11 changed files with 8 additions and 201 deletions

View File

@ -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")

View File

@ -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)

View File

@ -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)

View File

@ -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 )

View File

@ -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")

View File

@ -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);

View File

@ -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;

View File

@ -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 );

View File

@ -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

View File

@ -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();

View File

@ -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;