use generic palette handling, remove artificial brightness boost (nw)

This commit is contained in:
David Haywood 2014-05-31 11:36:40 +00:00
parent 498542d77b
commit 8235822f61
3 changed files with 7 additions and 35 deletions

View File

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

View File

@ -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<deco16ic_device> m_deco_tilegen1;
required_device<deco16ic_device> m_deco_tilegen2;
required_device<palette_device> m_palette;
required_shared_ptr<UINT16> m_generic_paletteram_16;
required_shared_ptr<UINT16> 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);
};

View File

@ -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);
}
/******************************************************************************/