diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c index f7bee1d9333..6afabcabf12 100644 --- a/src/mame/drivers/cbuster.c +++ b/src/mame/drivers/cbuster.c @@ -126,11 +126,13 @@ static ADDRESS_MAP_START( twocrude_map, AS_PROGRAM, 16, cbuster_state ) AM_RANGE(0x0b4000, 0x0b4001) AM_WRITENOP AM_RANGE(0x0b5000, 0x0b500f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w) AM_RANGE(0x0b6000, 0x0b600f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w) - AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_WRITE(twocrude_palette_24bit_rg_w) AM_SHARE("paletteram") - AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_WRITE(twocrude_palette_24bit_b_w) AM_SHARE("paletteram2") + AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") + AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_DEVWRITE("palette", palette_device, write_ext) AM_SHARE("palette_ext") AM_RANGE(0x0bc000, 0x0bc00f) AM_READWRITE(twocrude_control_r, twocrude_control_w) ADDRESS_MAP_END + + /******************************************************************************/ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cbuster_state ) @@ -306,6 +308,8 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", cbuster) MCFG_PALETTE_ADD("palette", 2048) + MCFG_PALETTE_FORMAT(XBGR) + MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) diff --git a/src/mame/includes/cbuster.h b/src/mame/includes/cbuster.h index 1d0786b050a..650611b3d66 100644 --- a/src/mame/includes/cbuster.h +++ b/src/mame/includes/cbuster.h @@ -23,9 +23,7 @@ public: m_audiocpu(*this, "audiocpu"), m_deco_tilegen1(*this, "tilegen1"), m_deco_tilegen2(*this, "tilegen2"), - m_palette(*this, "palette"), - m_generic_paletteram_16(*this, "paletteram"), - m_generic_paletteram2_16(*this, "paletteram2") + m_palette(*this, "palette") { } /* memory pointers */ @@ -49,17 +47,12 @@ public: required_device m_deco_tilegen1; required_device m_deco_tilegen2; required_device m_palette; - required_shared_ptr m_generic_paletteram_16; - required_shared_ptr m_generic_paletteram2_16; DECLARE_WRITE16_MEMBER(twocrude_control_w); DECLARE_READ16_MEMBER(twocrude_control_r); - DECLARE_WRITE16_MEMBER(twocrude_palette_24bit_rg_w); - DECLARE_WRITE16_MEMBER(twocrude_palette_24bit_b_w); DECLARE_DRIVER_INIT(twocrude); virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); UINT32 screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void update_24bitcol( int offset ); DECO16IC_BANK_CB_MEMBER(bank_callback); }; diff --git a/src/mame/video/cbuster.c b/src/mame/video/cbuster.c index a7b50d24be3..d1ebea1182f 100644 --- a/src/mame/video/cbuster.c +++ b/src/mame/video/cbuster.c @@ -9,31 +9,6 @@ /******************************************************************************/ -/* maybe the game should just use generic palette handling, and have a darker palette by design... */ - -void cbuster_state::update_24bitcol( int offset ) -{ - UINT8 r, g, b; /* The highest palette value seems to be 0x8e */ - - r = (UINT8)((float)((m_generic_paletteram_16[offset] >> 0) & 0xff) * 1.75); - g = (UINT8)((float)((m_generic_paletteram_16[offset] >> 8) & 0xff) * 1.75); - b = (UINT8)((float)((m_generic_paletteram2_16[offset] >> 0) & 0xff) * 1.75); - - m_palette->set_pen_color(offset, rgb_t(r, g, b)); -} - -WRITE16_MEMBER(cbuster_state::twocrude_palette_24bit_rg_w) -{ - COMBINE_DATA(&m_generic_paletteram_16[offset]); - update_24bitcol(offset); -} - -WRITE16_MEMBER(cbuster_state::twocrude_palette_24bit_b_w) -{ - COMBINE_DATA(&m_generic_paletteram2_16[offset]); - update_24bitcol(offset); -} - /******************************************************************************/