mirror of
https://github.com/holub/mame
synced 2025-07-09 11:48:12 +03:00
Replace some custom palette inits with the appropriate standard callback
This commit is contained in:
parent
b4644cf2a5
commit
ff0eab691d
@ -1073,8 +1073,7 @@ static MACHINE_CONFIG_START( 40love )
|
|||||||
MCFG_SCREEN_PALETTE("palette")
|
MCFG_SCREEN_PALETTE("palette")
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
|
||||||
MCFG_PALETTE_ADD("palette", 1024)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 1024)
|
||||||
MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
|
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MCFG_SPEAKER_STANDARD_MONO("speaker")
|
MCFG_SPEAKER_STANDARD_MONO("speaker")
|
||||||
@ -1131,8 +1130,7 @@ static MACHINE_CONFIG_START( undoukai )
|
|||||||
MCFG_SCREEN_PALETTE("palette")
|
MCFG_SCREEN_PALETTE("palette")
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 40love)
|
||||||
MCFG_PALETTE_ADD("palette", 1024)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 1024)
|
||||||
MCFG_PALETTE_INIT_OWNER(fortyl_state, fortyl)
|
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MCFG_SPEAKER_STANDARD_MONO("speaker")
|
MCFG_SPEAKER_STANDARD_MONO("speaker")
|
||||||
|
@ -227,7 +227,6 @@ public:
|
|||||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||||
|
|
||||||
virtual void video_start() override;
|
virtual void video_start() override;
|
||||||
DECLARE_PALETTE_INIT(gluck2);
|
|
||||||
|
|
||||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
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 *
|
* R/W Handlers *
|
||||||
**********************************************/
|
**********************************************/
|
||||||
@ -538,8 +500,7 @@ static MACHINE_CONFIG_START( gluck2 )
|
|||||||
MCFG_SCREEN_PALETTE("palette")
|
MCFG_SCREEN_PALETTE("palette")
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gluck2)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gluck2)
|
||||||
MCFG_PALETTE_ADD("palette", 0x100)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
|
||||||
MCFG_PALETTE_INIT_OWNER(gluck2_state, gluck2)
|
|
||||||
|
|
||||||
MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
|
MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
|
||||||
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
||||||
|
@ -59,7 +59,6 @@ public:
|
|||||||
DECLARE_WRITE8_MEMBER(z80_2_ldp_write);
|
DECLARE_WRITE8_MEMBER(z80_2_ldp_write);
|
||||||
DECLARE_DRIVER_INIT(istellar);
|
DECLARE_DRIVER_INIT(istellar);
|
||||||
virtual void machine_start() override;
|
virtual void machine_start() override;
|
||||||
DECLARE_PALETTE_INIT(istellar);
|
|
||||||
uint32_t screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
uint32_t screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||||
INTERRUPT_GEN_MEMBER(vblank_callback_istellar);
|
INTERRUPT_GEN_MEMBER(vblank_callback_istellar);
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
@ -276,43 +275,6 @@ static INPUT_PORTS_START( istellar )
|
|||||||
/* SERVICE might be hanging out back here */
|
/* SERVICE might be hanging out back here */
|
||||||
INPUT_PORTS_END
|
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 =
|
static const gfx_layout istellar_gfx_layout =
|
||||||
{
|
{
|
||||||
8,8,
|
8,8,
|
||||||
@ -364,8 +326,8 @@ static MACHINE_CONFIG_START( istellar )
|
|||||||
/* video hardware */
|
/* video hardware */
|
||||||
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
|
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
|
||||||
|
|
||||||
MCFG_PALETTE_ADD("palette", 256)
|
// Daphne says "TODO: get the real interstellar resistor values"
|
||||||
MCFG_PALETTE_INIT_OWNER(istellar_state, istellar)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", istellar)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", istellar)
|
||||||
|
|
||||||
|
@ -499,8 +499,8 @@ static MACHINE_CONFIG_DERIVED( ponttehk, lvcards )
|
|||||||
MCFG_MACHINE_RESET_OVERRIDE(lvcards_state,lvpoker)
|
MCFG_MACHINE_RESET_OVERRIDE(lvcards_state,lvpoker)
|
||||||
|
|
||||||
// video hardware
|
// video hardware
|
||||||
MCFG_PALETTE_MODIFY("palette")
|
MCFG_DEVICE_REMOVE("palette")
|
||||||
MCFG_PALETTE_INIT_OWNER(lvcards_state,ponttehk)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
ROM_START( lvpoker )
|
ROM_START( lvpoker )
|
||||||
|
@ -200,8 +200,7 @@ static MACHINE_CONFIG_START( mustache )
|
|||||||
MCFG_SCREEN_PALETTE("palette")
|
MCFG_SCREEN_PALETTE("palette")
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mustache)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mustache)
|
||||||
MCFG_PALETTE_ADD("palette", 8*16+16*8)
|
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", "proms", 256)
|
||||||
MCFG_PALETTE_INIT_OWNER(mustache_state, mustache)
|
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||||
|
@ -108,7 +108,6 @@ public:
|
|||||||
DECLARE_DRIVER_INIT(40love);
|
DECLARE_DRIVER_INIT(40love);
|
||||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||||
virtual void video_start() override;
|
virtual void video_start() override;
|
||||||
DECLARE_PALETTE_INIT(fortyl);
|
|
||||||
DECLARE_MACHINE_START(40love);
|
DECLARE_MACHINE_START(40love);
|
||||||
DECLARE_MACHINE_RESET(40love);
|
DECLARE_MACHINE_RESET(40love);
|
||||||
DECLARE_MACHINE_START(undoukai);
|
DECLARE_MACHINE_START(undoukai);
|
||||||
|
@ -26,7 +26,6 @@ public:
|
|||||||
DECLARE_PALETTE_INIT(lvcards);
|
DECLARE_PALETTE_INIT(lvcards);
|
||||||
DECLARE_MACHINE_START(lvpoker);
|
DECLARE_MACHINE_START(lvpoker);
|
||||||
DECLARE_MACHINE_RESET(lvpoker);
|
DECLARE_MACHINE_RESET(lvpoker);
|
||||||
DECLARE_PALETTE_INIT(ponttehk);
|
|
||||||
uint32_t screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
uint32_t screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
required_device<gfxdecode_device> m_gfxdecode;
|
required_device<gfxdecode_device> m_gfxdecode;
|
||||||
|
@ -37,7 +37,6 @@ public:
|
|||||||
|
|
||||||
DECLARE_DRIVER_INIT(mustache);
|
DECLARE_DRIVER_INIT(mustache);
|
||||||
virtual void video_start() override;
|
virtual void video_start() override;
|
||||||
DECLARE_PALETTE_INIT(mustache);
|
|
||||||
|
|
||||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||||
|
@ -8,46 +8,6 @@
|
|||||||
#include "includes/40love.h"
|
#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
|
Callbacks for the TileMap code
|
||||||
|
@ -12,42 +12,6 @@
|
|||||||
#include "includes/lvcards.h"
|
#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.
|
PALETTE_INIT_MEMBER(lvcards_state, lvcards)//Ever so slightly different, but different enough.
|
||||||
{
|
{
|
||||||
const uint8_t *color_prom = memregion("proms")->base();
|
const uint8_t *color_prom = memregion("proms")->base();
|
||||||
|
@ -12,40 +12,6 @@
|
|||||||
#include "includes/mustache.h"
|
#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)
|
WRITE8_MEMBER(mustache_state::videoram_w)
|
||||||
{
|
{
|
||||||
m_videoram[offset] = data;
|
m_videoram[offset] = data;
|
||||||
|
Loading…
Reference in New Issue
Block a user