diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp index 6df531ebaee..36b56e79ee0 100644 --- a/src/mame/drivers/karnov.cpp +++ b/src/mame/drivers/karnov.cpp @@ -826,8 +826,7 @@ static MACHINE_CONFIG_START( karnov ) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", karnov) - MCFG_PALETTE_ADD("palette", 1024) - MCFG_PALETTE_INIT_OWNER(karnov_state, karnov) + MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) @@ -905,8 +904,7 @@ static MACHINE_CONFIG_START( wndrplnt ) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", karnov) - MCFG_PALETTE_ADD("palette", 1024) - MCFG_PALETTE_INIT_OWNER(karnov_state, karnov) + MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h index 9c11f22b015..84b41b76824 100644 --- a/src/mame/includes/karnov.h +++ b/src/mame/includes/karnov.h @@ -9,6 +9,7 @@ #include "machine/gen_latch.h" #include "video/bufsprite.h" #include "video/deckarn.h" +#include "video/decrmc3.h" class karnov_state : public driver_device { @@ -32,7 +33,7 @@ public: required_device m_spriteram; required_device m_spritegen; required_device m_gfxdecode; - required_device m_palette; + required_device m_palette; required_device m_soundlatch; /* memory pointers */ @@ -69,7 +70,6 @@ public: TILE_GET_INFO_MEMBER(get_fix_tile_info); virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_PALETTE_INIT(karnov); DECLARE_VIDEO_START(karnov); DECLARE_VIDEO_START(wndrplnt); uint32_t screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/video/karnov.cpp b/src/mame/video/karnov.cpp index 7fa4afa9769..a1584d7b2ed 100644 --- a/src/mame/video/karnov.cpp +++ b/src/mame/video/karnov.cpp @@ -9,64 +9,6 @@ #include "emu.h" #include "includes/karnov.h" -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Karnov has two 1024x8 palette PROM. - I don't know the exact values of the resistors between the RAM and the - RGB output. I assumed these values (the same as Commando) - - bit 7 -- 220 ohm resistor -- GREEN - -- 470 ohm resistor -- GREEN - -- 1 kohm resistor -- GREEN - -- 2.2kohm resistor -- GREEN - -- 220 ohm resistor -- RED - -- 470 ohm resistor -- RED - -- 1 kohm resistor -- RED - bit 0 -- 2.2kohm resistor -- RED - - bit 7 -- unused - -- unused - -- unused - -- unused - -- 220 ohm resistor -- BLUE - -- 470 ohm resistor -- BLUE - -- 1 kohm resistor -- BLUE - bit 0 -- 2.2kohm resistor -- BLUE - -***************************************************************************/ - -PALETTE_INIT_MEMBER(karnov_state, karnov) -{ - 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; - - 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; - bit0 = (color_prom[0] >> 4) & 0x01; - bit1 = (color_prom[0] >> 5) & 0x01; - bit2 = (color_prom[0] >> 6) & 0x01; - bit3 = (color_prom[0] >> 7) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - 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; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i, rgb_t(r, g, b)); - color_prom++; - } -} - void karnov_state::karnov_flipscreen_w( int data ) { m_flipscreen = data;