diff --git a/src/emu/video/315_5124.c b/src/emu/video/315_5124.c index e9b8fe524ce..0cd47f5e7c8 100644 --- a/src/emu/video/315_5124.c +++ b/src/emu/video/315_5124.c @@ -89,7 +89,7 @@ const device_type SEGA315_5246 = &device_creator; const device_type SEGA315_5378 = &device_creator; -PALETTE_INIT( sega315_5124 ) +PALETTE_INIT_MEMBER(sega315_5124_device, sega315_5124) { int i; for (i = 0; i < 64; i++) @@ -97,29 +97,29 @@ PALETTE_INIT( sega315_5124 ) int r = i & 0x03; int g = (i & 0x0c) >> 2; int b = (i & 0x30) >> 4; - palette_set_color_rgb(machine, i, pal2bit(r), pal2bit(g), pal2bit(b)); + palette_set_color_rgb(machine(), i, pal2bit(r), pal2bit(g), pal2bit(b)); } /* TMS9918 palette */ - palette_set_color_rgb(machine, 64+ 0, 0, 0, 0); - palette_set_color_rgb(machine, 64+ 1, 0, 0, 0); - palette_set_color_rgb(machine, 64+ 2, 33, 200, 66); - palette_set_color_rgb(machine, 64+ 3, 94, 220, 120); - palette_set_color_rgb(machine, 64+ 4, 84, 85, 237); - palette_set_color_rgb(machine, 64+ 5, 125, 118, 252); - palette_set_color_rgb(machine, 64+ 6, 212, 82, 77); - palette_set_color_rgb(machine, 64+ 7, 66, 235, 245); - palette_set_color_rgb(machine, 64+ 8, 252, 85, 84); - palette_set_color_rgb(machine, 64+ 9, 255, 121, 120); - palette_set_color_rgb(machine, 64+10, 212, 193, 84); - palette_set_color_rgb(machine, 64+11, 230, 206, 128); - palette_set_color_rgb(machine, 64+12, 33, 176, 59); - palette_set_color_rgb(machine, 64+13, 201, 91, 186); - palette_set_color_rgb(machine, 64+14, 204, 204, 204); - palette_set_color_rgb(machine, 64+15, 255, 255, 255); + palette_set_color_rgb(machine(), 64+ 0, 0, 0, 0); + palette_set_color_rgb(machine(), 64+ 1, 0, 0, 0); + palette_set_color_rgb(machine(), 64+ 2, 33, 200, 66); + palette_set_color_rgb(machine(), 64+ 3, 94, 220, 120); + palette_set_color_rgb(machine(), 64+ 4, 84, 85, 237); + palette_set_color_rgb(machine(), 64+ 5, 125, 118, 252); + palette_set_color_rgb(machine(), 64+ 6, 212, 82, 77); + palette_set_color_rgb(machine(), 64+ 7, 66, 235, 245); + palette_set_color_rgb(machine(), 64+ 8, 252, 85, 84); + palette_set_color_rgb(machine(), 64+ 9, 255, 121, 120); + palette_set_color_rgb(machine(), 64+10, 212, 193, 84); + palette_set_color_rgb(machine(), 64+11, 230, 206, 128); + palette_set_color_rgb(machine(), 64+12, 33, 176, 59); + palette_set_color_rgb(machine(), 64+13, 201, 91, 186); + palette_set_color_rgb(machine(), 64+14, 204, 204, 204); + palette_set_color_rgb(machine(), 64+15, 255, 255, 255); } -PALETTE_INIT( sega315_5378 ) +PALETTE_INIT_MEMBER(sega315_5124_device, sega315_5378) { int i; for (i = 0; i < 4096; i++) @@ -127,7 +127,7 @@ PALETTE_INIT( sega315_5378 ) int r = i & 0x000f; int g = (i & 0x00f0) >> 4; int b = (i & 0x0f00) >> 8; - palette_set_color_rgb(machine, i, pal4bit(r), pal4bit(g), pal4bit(b)); + palette_set_color_rgb(machine(), i, pal4bit(r), pal4bit(g), pal4bit(b)); } } diff --git a/src/emu/video/315_5124.h b/src/emu/video/315_5124.h index e5d0ee7433c..98c3da96295 100644 --- a/src/emu/video/315_5124.h +++ b/src/emu/video/315_5124.h @@ -36,9 +36,6 @@ #define SEGA315_5124_PALETTE_SIZE (64+16) #define SEGA315_5378_PALETTE_SIZE 4096 -PALETTE_INIT( sega315_5124 ); -PALETTE_INIT( sega315_5378 ); - #define SEGA315_5378_CRAM_SIZE 0x40 /* 32 colors x 2 bytes per color = 64 bytes */ #define SEGA315_5124_CRAM_SIZE 0x20 /* 32 colors x 1 bytes per color = 32 bytes */ @@ -79,6 +76,9 @@ public: DECLARE_WRITE8_MEMBER( register_write ); DECLARE_READ8_MEMBER( vcount_read ); DECLARE_READ8_MEMBER( hcount_read ); + + DECLARE_PALETTE_INIT( sega315_5124 ); + DECLARE_PALETTE_INIT( sega315_5378 ); void hcount_latch() { hcount_latch_at_hpos( m_screen->hpos() ); }; void hcount_latch_at_hpos( int hpos ); diff --git a/src/emu/video/huc6260.c b/src/emu/video/huc6260.c index 02c52b7d428..1e69c2ccc75 100644 --- a/src/emu/video/huc6260.c +++ b/src/emu/video/huc6260.c @@ -23,7 +23,7 @@ #define HUC6260_HSYNC_START ( HUC6260_WPF - HUC6260_HSYNC_LENGTH ) -PALETTE_INIT( huc6260 ) +void huc6260_device::palette_init() { int i; @@ -34,8 +34,8 @@ PALETTE_INIT( huc6260 ) int b = pal3bit( ( i ) & 7 ); int y = ( ( 66 * r + 129 * g + 25 * b + 128 ) >> 8 ) + 16; - palette_set_color_rgb( machine, i, r, g, b ); - palette_set_color_rgb( machine, 512 + i, y, y, y ); + palette_set_color_rgb( machine(), i, r, g, b ); + palette_set_color_rgb( machine(), 512 + i, y, y, y ); } } diff --git a/src/emu/video/huc6260.h b/src/emu/video/huc6260.h index 327b0c43c34..136beb0423c 100644 --- a/src/emu/video/huc6260.h +++ b/src/emu/video/huc6260.h @@ -18,9 +18,6 @@ #define HUC6260_LPF 263 /* max number of lines in a single frame */ -PALETTE_INIT( huc6260 ); - - #define MCFG_HUC6260_ADD( _tag, clock, _intrf ) \ MCFG_DEVICE_ADD( _tag, HUC6260, clock ) \ MCFG_DEVICE_CONFIG( _intrf ) @@ -61,6 +58,7 @@ protected: virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + virtual void palette_init(); private: int m_last_h; diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c index 987fd3b8171..b06e84e2626 100644 --- a/src/emu/video/v9938.c +++ b/src/emu/video/v9938.c @@ -243,13 +243,13 @@ b0 is set if b2 and b1 are set (remember, color bus is 3 bits) */ -PALETTE_INIT( v9938 ) +PALETTE_INIT_MEMBER(v99x8_device, v9938) { int i; // create the full 512 colour palette for (i=0;i<512;i++) - palette_set_color_rgb(machine, i, pal3bit(i >> 6), pal3bit(i >> 3), pal3bit(i >> 0)); + palette_set_color_rgb(machine(), i, pal3bit(i >> 6), pal3bit(i >> 3), pal3bit(i >> 0)); } /* @@ -265,16 +265,16 @@ to emulate this. Also it keeps the palette a reasonable size. :) UINT16 *v99x8_device::s_pal_indYJK; -PALETTE_INIT( v9958 ) +PALETTE_INIT_MEMBER(v99x8_device, v9958) { int r,g,b,y,j,k,i,k0,j0,n; UINT8 pal[19268*3]; // init v9938 512-color palette - PALETTE_INIT_CALL(v9938); + PALETTE_INIT_CALL_MEMBER(v9938); if (v99x8_device::s_pal_indYJK == NULL) - v99x8_device::s_pal_indYJK = auto_alloc_array(machine,UINT16, 0x20000); + v99x8_device::s_pal_indYJK = auto_alloc_array(machine(),UINT16, 0x20000); // set up YJK table LOG(("Building YJK table for V9958 screens, may take a while ... \n")); @@ -312,7 +312,7 @@ PALETTE_INIT( v9958 ) pal[i*3+0] = r; pal[i*3+1] = g; pal[i*3+2] = b; - palette_set_color(machine, i+512, MAKE_RGB(r, g, b)); + palette_set_color(machine(), i+512, MAKE_RGB(r, g, b)); v99x8_device::s_pal_indYJK[y | j << 5 | k << (5 + 6)] = i + 512; i++; } diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h index e07cf80ec92..8093e4d38d8 100644 --- a/src/emu/video/v9938.h +++ b/src/emu/video/v9938.h @@ -59,8 +59,6 @@ class v99x8_device : public device_t, public device_memory_interface, public device_video_interface { - friend PALETTE_INIT( v9958 ); - protected: // construction/destruction v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock); @@ -79,6 +77,9 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); + + DECLARE_PALETTE_INIT(v9938); + DECLARE_PALETTE_INIT(v9958); UINT8 vram_r(); UINT8 status_r(); @@ -252,8 +253,5 @@ public: v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; -PALETTE_INIT( v9938 ); -PALETTE_INIT( v9958 ); - #endif diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c index 92c7a6ff40c..1201630d758 100644 --- a/src/mame/drivers/big10.c +++ b/src/mame/drivers/big10.c @@ -61,7 +61,6 @@ #include "sound/ay8910.h" #include "video/v9938.h" #include "machine/nvram.h" -#include "drivlgcy.h" class big10_state : public driver_device @@ -268,7 +267,7 @@ static MACHINE_CONFIG_START( big10, big10_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT(v9938) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c index 13540480b9d..c84c8eabc07 100644 --- a/src/mame/drivers/cave.c +++ b/src/mame/drivers/cave.c @@ -1598,7 +1598,7 @@ static GFXDECODE_START( dfeveron ) /* There are only $800 colors here, the first half for sprites the second half for tiles. We use $8000 virtual colors instead for consistency with games having $8000 real colors. - A PALETTE_INIT function is thus needed for sprites */ + A palette_init function is thus needed for sprites */ // "sprites" GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4400, 0x40 ) // [0] Layer 0 @@ -1611,7 +1611,7 @@ GFXDECODE_END static GFXDECODE_START( ddonpach ) /* Layers 01 are 4 bit deep and use the first 16 of every 256 - colors for any given color code (a PALETTE_INIT function + colors for any given color code (a palette_init function is provided for these layers, filling the 8000-83ff entries in the color table). Layer 2 uses the whole 256 for any given color code and the 4000-7fff range in the color table. */ @@ -1630,7 +1630,7 @@ static GFXDECODE_START( donpachi ) /* There are only $800 colors here, the first half for sprites the second half for tiles. We use $8000 virtual colors instead for consistency with games having $8000 real colors. - A PALETTE_INIT function is thus needed for sprites */ + A palette_init function is thus needed for sprites */ // "sprites" GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4400, 0x40 ) // [0] Layer 0 @@ -1657,7 +1657,7 @@ static GFXDECODE_START( hotdogst ) /* There are only $800 colors here, the first half for sprites the second half for tiles. We use $8000 virtual colors instead for consistency with games having $8000 real colors. - A PALETTE_INIT function is needed for sprites */ + A palette_init function is needed for sprites */ // "sprites" GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4000, 0x40 ) // [0] Layer 0 @@ -1685,7 +1685,7 @@ static GFXDECODE_START( mazinger ) first 16 colors of each palette, Indeed, the gfx data in ROM is empty in the top 4 bits. Additionally even if there are $40 color codes, only $400 colors are addressable. - A PALETTE_INIT function is thus needed for sprites and layer 0. */ + A palette_init function is thus needed for sprites and layer 0. */ // "sprites" GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4000, 0x40 ) // [0] Layer 0 diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c index 72294c18f27..ced301c87d0 100644 --- a/src/mame/drivers/csplayh5.c +++ b/src/mame/drivers/csplayh5.c @@ -24,7 +24,6 @@ #include "cpu/z80/z80daisy.h" #include "machine/nvram.h" #include "cpu/h83002/h8.h" -#include "drivlgcy.h" class csplayh5_state : public driver_device @@ -665,7 +664,7 @@ static MACHINE_CONFIG_START( csplayh5, csplayh5_state ) MCFG_SCREEN_UPDATE_DEVICE("v9958", v9958_device, screen_update) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT( v9958 ) + MCFG_PALETTE_INIT_OVERRIDE(v9958_device, v9958) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/ggconnie.c b/src/mame/drivers/ggconnie.c index f91e7e2ef06..6adba961cb8 100644 --- a/src/mame/drivers/ggconnie.c +++ b/src/mame/drivers/ggconnie.c @@ -25,7 +25,6 @@ #include "sound/c6280.h" #include "sound/okim6295.h" #include "machine/msm6242.h" -#include "drivlgcy.h" class ggconnie_state : public pce_common_state @@ -271,7 +270,6 @@ static MACHINE_CONFIG_START( ggconnie, ggconnie_state ) MCFG_SCREEN_UPDATE_DRIVER( ggconnie_state, screen_update ) MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE ) - MCFG_PALETTE_INIT( huc6260 ) MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK/3, sgx_huc6260_config ) MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config ) diff --git a/src/mame/drivers/kas89.c b/src/mame/drivers/kas89.c index 23256ba688b..bfd91101350 100644 --- a/src/mame/drivers/kas89.c +++ b/src/mame/drivers/kas89.c @@ -196,7 +196,6 @@ #include "sound/ay8910.h" #include "video/v9938.h" #include "machine/nvram.h" -#include "drivlgcy.h" #include "kas89.lh" @@ -800,7 +799,7 @@ static MACHINE_CONFIG_START( kas89, kas89_state ) MCFG_SCREEN_VISIBLE_AREA(0, 544 - 1, 0, 480 - 1) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT(v9938) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c index e3b8e7c9d41..2b8db733ef2 100644 --- a/src/mame/drivers/kingdrby.c +++ b/src/mame/drivers/kingdrby.c @@ -1144,7 +1144,7 @@ ROM_START( kingdrbb ) // has 'Made in Taiwan' on the PCB. ROM_REGION( 0x4000, "raw_prom", 0 ) ROM_LOAD( "kingdrbb_u1.bin", 0x0000, 0x4000, CRC(97931952) SHA1(a0ef3be105f2ed7f744c73e92c583d25bb322e6a) ) // palette but in a normal rom? - ROM_REGION( 0x200, "proms", ROMREGION_ERASE00 ) // address shuffled, decoded inside PALETTE_INIT + ROM_REGION( 0x200, "proms", ROMREGION_ERASE00 ) // address shuffled, decoded inside palette_init // ROM_COPY( "raw_prom", 0x1000, 0x000, 0x200 ) // ROM_COPY( "raw_prom", 0x3000, 0x200, 0x200 ) //identical to 0x1000 bank diff --git a/src/mame/drivers/kurukuru.c b/src/mame/drivers/kurukuru.c index 822a8356cd9..829e852a054 100644 --- a/src/mame/drivers/kurukuru.c +++ b/src/mame/drivers/kurukuru.c @@ -198,7 +198,6 @@ #include "video/v9938.h" #include "machine/ticket.h" #include "machine/nvram.h" -#include "drivlgcy.h" class kurukuru_state : public driver_device { @@ -590,7 +589,7 @@ static MACHINE_CONFIG_START( kurukuru, kurukuru_state ) MCFG_SCREEN_UPDATE_DEVICE("v9938", v9938_device, screen_update) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT( v9938 ) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index 2d700719c1c..acc8096a8c0 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -531,7 +531,7 @@ static MACHINE_CONFIG_START( megatech, mtech_state ) MCFG_SCREEN_UPDATE_DRIVER(mtech_state, screen_update_megatech_menu) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_SEGA315_5246_ADD("vdp1", _vdp_intf) MCFG_SEGA315_5246_SET_SCREEN("menu") diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index b5b79e7835c..cde7f9e5245 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -176,7 +176,6 @@ Not all regional versions are available for each Megatouch series #include "machine/ins8250.h" #include "machine/microtch.h" #include "machine/nvram.h" -#include "drivlgcy.h" struct ds1204_t @@ -1255,10 +1254,9 @@ static MACHINE_CONFIG_START( meritm_crt250, meritm_state ) MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2) MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1) MCFG_SCREEN_UPDATE_DRIVER(meritm_state, screen_update_meritm) + MCFG_PALETTE_LENGTH(512) - - MCFG_PALETTE_INIT( v9938 ) - + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c index c53ffcc9e8d..41fdfb3daef 100644 --- a/src/mame/drivers/sangho.c +++ b/src/mame/drivers/sangho.c @@ -46,7 +46,6 @@ TODO: #include "cpu/z80/z80.h" #include "video/v9938.h" #include "sound/2413intf.h" -#include "drivlgcy.h" class sangho_state : public driver_device @@ -441,11 +440,10 @@ static MACHINE_CONFIG_START( pzlestar, sangho_state ) MCFG_SCREEN_SIZE(512 + 32, (212 + 28) * 2) MCFG_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1) - MCFG_PALETTE_LENGTH(19268) - MCFG_MACHINE_RESET_OVERRIDE(sangho_state,pzlestar) - MCFG_PALETTE_INIT( v9958 ) + MCFG_PALETTE_LENGTH(19268) + MCFG_PALETTE_INIT_OVERRIDE(v9958_device, v9958) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2413, 3580000) @@ -473,11 +471,10 @@ static MACHINE_CONFIG_START( sexyboom, sangho_state ) MCFG_SCREEN_SIZE(512 + 32, (212 + 28) * 2) MCFG_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1) - MCFG_PALETTE_LENGTH(19268) - MCFG_MACHINE_RESET_OVERRIDE(sangho_state,sexyboom) - MCFG_PALETTE_INIT( v9958 ) + MCFG_PALETTE_LENGTH(19268) + MCFG_PALETTE_INIT_OVERRIDE(v9958_device, v9958) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2413, 3580000) diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c index e7bf0b243e8..f2684e0d08f 100644 --- a/src/mame/drivers/segae.c +++ b/src/mame/drivers/segae.c @@ -306,7 +306,6 @@ covert megatech / megaplay drivers to use new code etc. etc. #include "machine/segacrp2.h" #include "video/315_5124.h" #include "includes/segaipt.h" -#include "drivlgcy.h" class systeme_state : public driver_device @@ -1119,7 +1118,7 @@ static MACHINE_CONFIG_START( systeme, systeme_state ) MCFG_SCREEN_UPDATE_DRIVER(systeme_state, screen_update_systeme) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_SEGA315_5124_ADD("vdp1", _315_5124_1_intf) MCFG_DEVICE_ADDRESS_MAP(AS_0, vdp1_map) diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c index 69eff352336..711a647a400 100644 --- a/src/mame/drivers/sfkick.c +++ b/src/mame/drivers/sfkick.c @@ -56,7 +56,6 @@ YM2203C #include "video/v9938.h" #include "machine/i8255.h" #include "sound/2203intf.h" -#include "drivlgcy.h" class sfkick_state : public driver_device @@ -498,12 +497,10 @@ static MACHINE_CONFIG_START( sfkick, sfkick_state ) MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1) MCFG_PALETTE_LENGTH(512) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) MCFG_I8255A_ADD( "ppi8255", ppi8255_intf ) - - MCFG_PALETTE_INIT( v9938 ) - MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym1", YM2203, MASTER_CLOCK/6) MCFG_YM2203_IRQ_HANDLER(WRITELINE(sfkick_state, irqhandler)) diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c index fe3c374894f..30bcfc9065f 100644 --- a/src/mame/drivers/sothello.c +++ b/src/mame/drivers/sothello.c @@ -40,7 +40,6 @@ OSC : 8.0000MHz(X1) 21.477 MHz(X2) 384kHz(X3) #include "sound/2203intf.h" #include "sound/msm5205.h" #include "video/v9938.h" -#include "drivlgcy.h" class sothello_state : public driver_device @@ -391,7 +390,7 @@ static MACHINE_CONFIG_START( sothello, sothello_state ) MCFG_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT( v9938 ) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/tonton.c b/src/mame/drivers/tonton.c index 998a189af2b..15783031255 100644 --- a/src/mame/drivers/tonton.c +++ b/src/mame/drivers/tonton.c @@ -27,7 +27,6 @@ #include "video/v9938.h" #include "machine/ticket.h" #include "machine/nvram.h" -#include "drivlgcy.h" class tonton_state : public driver_device { @@ -283,7 +282,7 @@ static MACHINE_CONFIG_START( tonton, tonton_state ) MCFG_SCREEN_UPDATE_DEVICE("v9938", v9938_device, screen_update) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT( v9938 ) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c index 930e4c58e8c..d4cc6405bfb 100644 --- a/src/mame/drivers/tourtabl.c +++ b/src/mame/drivers/tourtabl.c @@ -11,7 +11,6 @@ #include "cpu/m6502/m6502.h" #include "sound/tiaintf.h" #include "video/tia.h" -#include "drivlgcy.h" class tourtabl_state : public driver_device @@ -189,7 +188,7 @@ static MACHINE_CONFIG_START( tourtabl, tourtabl_state ) MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update) MCFG_PALETTE_LENGTH(TIA_PALETTE_LENGTH) - MCFG_PALETTE_INIT(tia_NTSC) + MCFG_PALETTE_INIT_OVERRIDE(tia_video_device, tia_ntsc) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/video/tia.c b/src/mame/video/tia.c index f9f3966750a..656a90e74f4 100644 --- a/src/mame/video/tia.c +++ b/src/mame/video/tia.c @@ -45,7 +45,7 @@ static void extend_palette(running_machine &machine) { } } -PALETTE_INIT( tia_NTSC ) +PALETTE_INIT_MEMBER(tia_video_device, tia_ntsc) { int i, j; @@ -94,17 +94,17 @@ PALETTE_INIT( tia_NTSC ) if (G > 1) G = 1; if (B > 1) B = 1; - palette_set_color_rgb(machine,8 * i + j, + palette_set_color_rgb(machine(),8 * i + j, (UINT8) (255 * R + 0.5), (UINT8) (255 * G + 0.5), (UINT8) (255 * B + 0.5)); } } - extend_palette( machine ); + extend_palette( machine() ); } -PALETTE_INIT( tia_PAL ) +PALETTE_INIT_MEMBER(tia_video_device, tia_pal) { int i, j; @@ -153,13 +153,13 @@ PALETTE_INIT( tia_PAL ) if (G > 1) G = 1; if (B > 1) B = 1; - palette_set_color_rgb(machine,8 * i + j, + palette_set_color_rgb(machine(),8 * i + j, (UINT8) (255 * R + 0.5), (UINT8) (255 * G + 0.5), (UINT8) (255 * B + 0.5)); } } - extend_palette( machine ); + extend_palette( machine() ); } // device type definition diff --git a/src/mame/video/tia.h b/src/mame/video/tia.h index a296dc7be07..85c8f6314c6 100644 --- a/src/mame/video/tia.h +++ b/src/mame/video/tia.h @@ -60,6 +60,9 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); + + DECLARE_PALETTE_INIT(tia_ntsc); + DECLARE_PALETTE_INIT(tia_pal); protected: // device-level overrides @@ -208,7 +211,4 @@ private: // device type definition extern const device_type TIA_VIDEO; -PALETTE_INIT( tia_NTSC ); -PALETTE_INIT( tia_PAL ); - #endif /* _VIDEO_TIA_H_ */ diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c index ab52c2b1a2a..6c271243c12 100644 --- a/src/mess/drivers/a2600.c +++ b/src/mess/drivers/a2600.c @@ -19,7 +19,6 @@ TODO: #include "video/tia.h" #include "machine/vcsctrl.h" #include "hashfile.h" -#include "drivlgcy.h" #define CONTROL1_TAG "joyport1" #define CONTROL2_TAG "joyport2" @@ -1942,7 +1941,7 @@ static MACHINE_CONFIG_START( a2600, a2600_state ) MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update) MCFG_PALETTE_LENGTH( TIA_PALETTE_LENGTH ) - MCFG_PALETTE_INIT(tia_NTSC) + MCFG_PALETTE_INIT_OVERRIDE(tia_video_device, tia_ntsc) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1979,7 +1978,7 @@ static MACHINE_CONFIG_START( a2600p, a2600_state ) MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update) MCFG_PALETTE_LENGTH( TIA_PALETTE_LENGTH ) - MCFG_PALETTE_INIT(tia_PAL) + MCFG_PALETTE_INIT_OVERRIDE(tia_video_device, tia_pal) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index 8ee2ca2f1fd..3f5788c4e97 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -325,7 +325,6 @@ PCB Layouts missing #include "includes/msx.h" -#include "drivlgcy.h" static ADDRESS_MAP_START ( msx_memory_map, AS_PROGRAM, 8, msx_state ) AM_RANGE( 0x0000, 0x1fff) AM_READ_BANK("bank1") AM_WRITE(msx_page0_w) @@ -1170,7 +1169,7 @@ static MACHINE_CONFIG_START( msx2, msx_state ) MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1) MCFG_PALETTE_LENGTH(512) - MCFG_PALETTE_INIT(v9938) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/pce.c b/src/mess/drivers/pce.c index 8f45dba660f..231334672c0 100644 --- a/src/mess/drivers/pce.c +++ b/src/mess/drivers/pce.c @@ -63,7 +63,6 @@ Super System Card: #include "sound/msm5205.h" #include "video/huc6270.h" #include "video/huc6202.h" -#include "drivlgcy.h" /* todo: alternate forms of input (multitap, mouse, etc.) */ static INPUT_PORTS_START( pce ) @@ -381,7 +380,6 @@ static MACHINE_CONFIG_START( pce_common, pce_state ) MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update ) MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE ) - MCFG_PALETTE_INIT( huc6260 ) MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, pce_huc6260_config ) MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config ) @@ -426,7 +424,6 @@ static MACHINE_CONFIG_START( sgx, pce_state ) MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update ) MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE ) - MCFG_PALETTE_INIT( huc6260 ) MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, sgx_huc6260_config ) MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config ) diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c index ac86c05b1ff..7837e9769b1 100644 --- a/src/mess/drivers/sms.c +++ b/src/mess/drivers/sms.c @@ -220,7 +220,6 @@ DC00 - Selection buttons #2, 9-16 (R) #include "imagedev/cartslot.h" #include "includes/sms.h" #include "machine/sega8_rom.h" -#include "drivlgcy.h" #include "sms1.lh" @@ -528,7 +527,7 @@ static MACHINE_CONFIG_DERIVED( sms2_ntsc, sms_ntsc_base ) MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_ntsc_intf) MCFG_SEGA315_5246_SET_SCREEN("screen") @@ -564,7 +563,7 @@ static MACHINE_CONFIG_DERIVED( sms1_ntsc, sms_ntsc_base ) MCFG_DEFAULT_LAYOUT(layout_sms1) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_VIDEO_START_OVERRIDE(sms_state,sms1) MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1) @@ -602,7 +601,7 @@ static MACHINE_CONFIG_START( sms_sdisp, smssdisp_state ) MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", sms_store_intf) MCFG_SEGA315_5246_SET_SCREEN("screen") @@ -697,7 +696,7 @@ static MACHINE_CONFIG_DERIVED( sms2_pal, sms_pal_base ) MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_pal_intf) MCFG_SEGA315_5246_SET_SCREEN("screen") @@ -733,7 +732,7 @@ static MACHINE_CONFIG_DERIVED( sms1_pal, sms_pal_base ) MCFG_DEFAULT_LAYOUT(layout_sms1) MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5124) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5124_device, sega315_5124) MCFG_VIDEO_START_OVERRIDE(sms_state,sms1) MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1) @@ -786,7 +785,7 @@ static MACHINE_CONFIG_START( gamegear, sms_state ) MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_gamegear) MCFG_PALETTE_LENGTH(SEGA315_5378_PALETTE_SIZE) - MCFG_PALETTE_INIT(sega315_5378) + MCFG_PALETTE_INIT_OVERRIDE(sega315_5378_device, sega315_5378) MCFG_VIDEO_START_OVERRIDE(sms_state,gamegear) diff --git a/src/mess/machine/ti99/videowrp.h b/src/mess/machine/ti99/videowrp.h index 68ac730d1ed..52ff87efc8b 100644 --- a/src/mess/machine/ti99/videowrp.h +++ b/src/mess/machine/ti99/videowrp.h @@ -168,7 +168,7 @@ protected: MCFG_SCREEN_SIZE(_x, _y) \ MCFG_SCREEN_VISIBLE_AREA(0, _x - 1, 0, _y - 1) \ MCFG_PALETTE_LENGTH(512) \ - MCFG_PALETTE_INIT(v9938) + MCFG_PALETTE_INIT_OVERRIDE(v9938_device, v9938) #define MCFG_TI_SOUND_94624_ADD(_tag, _conf) \ MCFG_DEVICE_ADD(_tag, TISOUND_94624, 0) \