Previous 199869 Revisions Next

r30739 Saturday 31st May, 2014 at 11:36:40 UTC by David Haywood
use generic palette handling, remove artificial brightness boost (nw)
[src/mame/drivers]cbuster.c
[src/mame/includes]cbuster.h
[src/mame/video]cbuster.c

trunk/src/mame/includes/cbuster.h
r30738r30739
2323      m_audiocpu(*this, "audiocpu"),
2424      m_deco_tilegen1(*this, "tilegen1"),
2525      m_deco_tilegen2(*this, "tilegen2"),
26      m_palette(*this, "palette"),
27      m_generic_paletteram_16(*this, "paletteram"),
28      m_generic_paletteram2_16(*this, "paletteram2")
26      m_palette(*this, "palette")
2927   { }
3028
3129   /* memory pointers */
r30738r30739
4947   required_device<deco16ic_device> m_deco_tilegen1;
5048   required_device<deco16ic_device> m_deco_tilegen2;
5149   required_device<palette_device> m_palette;
52   required_shared_ptr<UINT16> m_generic_paletteram_16;
53   required_shared_ptr<UINT16> m_generic_paletteram2_16;
5450   DECLARE_WRITE16_MEMBER(twocrude_control_w);
5551   DECLARE_READ16_MEMBER(twocrude_control_r);
56   DECLARE_WRITE16_MEMBER(twocrude_palette_24bit_rg_w);
57   DECLARE_WRITE16_MEMBER(twocrude_palette_24bit_b_w);
5852   DECLARE_DRIVER_INIT(twocrude);
5953   virtual void machine_start();
6054   virtual void machine_reset();
6155   virtual void video_start();
6256   UINT32 screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
63   void update_24bitcol( int offset );
6457   DECO16IC_BANK_CB_MEMBER(bank_callback);
6558};
trunk/src/mame/video/cbuster.c
r30738r30739
99
1010/******************************************************************************/
1111
12/* maybe the game should just use generic palette handling, and have a darker palette by design... */
1312
14void cbuster_state::update_24bitcol( int offset )
15{
16   UINT8 r, g, b; /* The highest palette value seems to be 0x8e */
17
18   r = (UINT8)((float)((m_generic_paletteram_16[offset]  >> 0) & 0xff) * 1.75);
19   g = (UINT8)((float)((m_generic_paletteram_16[offset]  >> 8) & 0xff) * 1.75);
20   b = (UINT8)((float)((m_generic_paletteram2_16[offset] >> 0) & 0xff) * 1.75);
21
22   m_palette->set_pen_color(offset, rgb_t(r, g, b));
23}
24
25WRITE16_MEMBER(cbuster_state::twocrude_palette_24bit_rg_w)
26{
27   COMBINE_DATA(&m_generic_paletteram_16[offset]);
28   update_24bitcol(offset);
29}
30
31WRITE16_MEMBER(cbuster_state::twocrude_palette_24bit_b_w)
32{
33   COMBINE_DATA(&m_generic_paletteram2_16[offset]);
34   update_24bitcol(offset);
35}
36
37
3813/******************************************************************************/
3914
4015
trunk/src/mame/drivers/cbuster.c
r30738r30739
126126   AM_RANGE(0x0b4000, 0x0b4001) AM_WRITENOP
127127   AM_RANGE(0x0b5000, 0x0b500f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
128128   AM_RANGE(0x0b6000, 0x0b600f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
129   AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_WRITE(twocrude_palette_24bit_rg_w) AM_SHARE("paletteram")
130   AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_WRITE(twocrude_palette_24bit_b_w) AM_SHARE("paletteram2")
129   AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
130   AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_DEVWRITE("palette", palette_device, write_ext) AM_SHARE("palette_ext")
131131   AM_RANGE(0x0bc000, 0x0bc00f) AM_READWRITE(twocrude_control_r, twocrude_control_w)
132132ADDRESS_MAP_END
133133
134
135
134136/******************************************************************************/
135137
136138static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cbuster_state )
r30738r30739
306308
307309   MCFG_GFXDECODE_ADD("gfxdecode", "palette", cbuster)
308310   MCFG_PALETTE_ADD("palette", 2048)
311   MCFG_PALETTE_FORMAT(XBGR)
309312
313
310314   MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0)
311315   MCFG_DECO16IC_SPLIT(0)
312316   MCFG_DECO16IC_WIDTH12(1)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team