modernize some other older palette handlers (nw)

This commit is contained in:
David Haywood 2014-03-05 23:51:23 +00:00
parent 1e92c5de80
commit 0aa6e840cd
4 changed files with 11 additions and 31 deletions

View File

@ -141,6 +141,9 @@
#define PALETTE_FORMAT_RRRRGGGGBBBBRGBx raw_to_rgb_converter(2, &raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder)
#define PALETTE_FORMAT_xRGBRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder)
// standard 5-6-5 formats
#define PALETTE_FORMAT_BBBBBGGGGGGRRRRR raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,6,5, 0,5,11>)
// standard 8-8-8 formats
#define PALETTE_FORMAT_XRGB raw_to_rgb_converter(4, &raw_to_rgb_converter::standard_rgb_decoder<8,8,8, 16,8,0>)
#define PALETTE_FORMAT_XBGR raw_to_rgb_converter(4, &raw_to_rgb_converter::standard_rgb_decoder<8,8,8, 0,8,16>)

View File

@ -313,19 +313,9 @@ WRITE8_MEMBER(airbustr_state::soundcommand2_w)
m_soundlatch2_status = 1; // soundlatch2 has been written
}
WRITE8_MEMBER(airbustr_state::airbustr_paletteram_w)
{
int val;
/* ! byte 1 ! ! byte 0 ! */
/* xGGG GGRR RRRB BBBB */
/* x432 1043 2104 3210 */
m_paletteram[offset] = data;
val = (m_paletteram[offset | 1] << 8) | m_paletteram[offset & ~1];
m_palette->set_pen_color(offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
}
WRITE8_MEMBER(airbustr_state::airbustr_coin_counter_w)
{
@ -359,7 +349,7 @@ static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, airbustr_state )
AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(airbustr_colorram2_w) AM_SHARE("colorram2")
AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(airbustr_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(airbustr_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xd000, 0xd5ff) AM_RAM_WRITE(airbustr_paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0xd000, 0xd5ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xd600, 0xdfff) AM_RAM
AM_RANGE(0xe000, 0xefff) AM_RAM
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("share1")
@ -638,6 +628,7 @@ static MACHINE_CONFIG_START( airbustr, airbustr_state )
MCFG_GFXDECODE_ADD("gfxdecode", airbustr)
MCFG_PALETTE_ADD("palette", 768)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_KANEKO_PANDORA_ADD("pandora", airbustr_pandora_config)
MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")

View File

@ -46,7 +46,6 @@ public:
astrocorp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_spriteram(*this, "spriteram"),
m_paletteram(*this, "paletteram"),
m_maincpu(*this, "maincpu"),
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
@ -55,7 +54,6 @@ public:
/* memory pointers */
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_paletteram;
/* video-related */
bitmap_ind16 m_bitmap;
@ -67,7 +65,6 @@ public:
DECLARE_WRITE16_MEMBER(skilldrp_outputs_w);
DECLARE_WRITE16_MEMBER(astrocorp_screen_enable_w);
DECLARE_READ16_MEMBER(astrocorp_unk_r);
DECLARE_WRITE16_MEMBER(astrocorp_palette_w);
DECLARE_WRITE16_MEMBER(astrocorp_sound_bank_w);
DECLARE_WRITE16_MEMBER(skilldrp_sound_bank_w);
DECLARE_DRIVER_INIT(showhanc);
@ -290,16 +287,6 @@ READ16_MEMBER(astrocorp_state::astrocorp_unk_r)
return 0xffff; // bit 3?
}
// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
WRITE16_MEMBER(astrocorp_state::astrocorp_palette_w)
{
COMBINE_DATA(&m_paletteram[offset]);
m_palette->set_pen_color(offset,
pal5bit((m_paletteram[offset] >> 0) & 0x1f),
pal6bit((m_paletteram[offset] >> 5) & 0x3f),
pal5bit((m_paletteram[offset] >> 11) & 0x1f)
);
}
static ADDRESS_MAP_START( showhand_map, AS_PROGRAM, 16, astrocorp_state )
AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
@ -309,7 +296,7 @@ static ADDRESS_MAP_START( showhand_map, AS_PROGRAM, 16, astrocorp_state )
AM_RANGE( 0x058000, 0x058001 ) AM_WRITE(astrocorp_eeprom_w)
AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE(showhand_outputs_w)
AM_RANGE( 0x05e000, 0x05e001 ) AM_READ_PORT("EEPROMIN")
AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_SHARE("paletteram")
AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE( 0x070000, 0x073fff ) AM_RAM AM_SHARE("nvram") // battery
AM_RANGE( 0x080000, 0x080001 ) AM_WRITE(astrocorp_sound_bank_w)
AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_screen_enable_w)
@ -318,7 +305,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( showhanc_map, AS_PROGRAM, 16, astrocorp_state )
AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_SHARE("paletteram")
AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE( 0x070000, 0x070001 ) AM_WRITE(astrocorp_sound_bank_w)
AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_SHARE("spriteram")
AM_RANGE( 0x082000, 0x082001 ) AM_WRITE(astrocorp_draw_sprites_w)
@ -339,7 +326,7 @@ static ADDRESS_MAP_START( skilldrp_map, AS_PROGRAM, 16, astrocorp_state )
AM_RANGE( 0x208000, 0x208001 ) AM_WRITE(astrocorp_eeprom_w)
AM_RANGE( 0x20a000, 0x20a001 ) AM_WRITE(skilldrp_outputs_w)
AM_RANGE( 0x20e000, 0x20e001 ) AM_READ_PORT("EEPROMIN")
AM_RANGE( 0x380000, 0x3801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_SHARE("paletteram")
AM_RANGE( 0x380000, 0x3801ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE( 0x400000, 0x400001 ) AM_WRITE(astrocorp_screen_enable_w)
AM_RANGE( 0x500000, 0x507fff ) AM_RAM AM_SHARE("nvram") // battery
AM_RANGE( 0x580000, 0x580001 ) AM_WRITE(skilldrp_sound_bank_w)
@ -355,7 +342,7 @@ static ADDRESS_MAP_START( speeddrp_map, AS_PROGRAM, 16, astrocorp_state )
AM_RANGE( 0x388000, 0x388001 ) AM_WRITE(astrocorp_eeprom_w)
AM_RANGE( 0x38a000, 0x38a001 ) AM_WRITE(skilldrp_outputs_w)
AM_RANGE( 0x38e000, 0x38e001 ) AM_READ_PORT("EEPROMIN")
AM_RANGE( 0x480000, 0x4801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_SHARE("paletteram")
AM_RANGE( 0x480000, 0x4801ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE( 0x500000, 0x500001 ) AM_WRITE(astrocorp_screen_enable_w)
AM_RANGE( 0x580000, 0x580001 ) AM_WRITE(skilldrp_sound_bank_w)
AM_RANGE( 0x600000, 0x600001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
@ -499,6 +486,7 @@ static MACHINE_CONFIG_START( showhand, astrocorp_state )
MCFG_GFXDECODE_ADD("gfxdecode", astrocorp)
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_PALETTE_FORMAT(BBBBBGGGGGGRRRRR)
MCFG_VIDEO_START_OVERRIDE(astrocorp_state,astrocorp)
@ -550,6 +538,7 @@ static MACHINE_CONFIG_START( skilldrp, astrocorp_state )
MCFG_GFXDECODE_ADD("gfxdecode", astrocorp)
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_PALETTE_FORMAT(BBBBBGGGGGGRRRRR)
MCFG_VIDEO_START_OVERRIDE(astrocorp_state,astrocorp)

View File

@ -16,7 +16,6 @@ public:
m_colorram2(*this, "colorram2"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_paletteram(*this, "paletteram"),
m_master(*this, "master"),
m_slave(*this, "slave"),
m_audiocpu(*this, "audiocpu"),
@ -32,7 +31,6 @@ public:
required_shared_ptr<UINT8> m_colorram2;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
required_shared_ptr<UINT8> m_paletteram;
/* video-related */
tilemap_t *m_bg_tilemap;
@ -67,7 +65,6 @@ public:
DECLARE_READ8_MEMBER(soundcommand2_r);
DECLARE_WRITE8_MEMBER(soundcommand_w);
DECLARE_WRITE8_MEMBER(soundcommand2_w);
DECLARE_WRITE8_MEMBER(airbustr_paletteram_w);
DECLARE_WRITE8_MEMBER(airbustr_coin_counter_w);
DECLARE_WRITE8_MEMBER(airbustr_videoram_w);
DECLARE_WRITE8_MEMBER(airbustr_colorram_w);