diff options
Diffstat (limited to 'src/mame/drivers/raiden2.cpp')
-rw-r--r-- | src/mame/drivers/raiden2.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/mame/drivers/raiden2.cpp b/src/mame/drivers/raiden2.cpp index 16ac0d40761..4b47914c972 100644 --- a/src/mame/drivers/raiden2.cpp +++ b/src/mame/drivers/raiden2.cpp @@ -377,25 +377,25 @@ void raiden2_state::draw_sprites(const rectangle &cliprect) WRITE16_MEMBER(raiden2_state::raiden2_background_w) { - COMBINE_DATA(&back_data[offset]); + COMBINE_DATA(&m_back_data[offset]); background_layer->mark_tile_dirty(offset); } WRITE16_MEMBER(raiden2_state::raiden2_midground_w) { - COMBINE_DATA(&mid_data[offset]); + COMBINE_DATA(&m_mid_data[offset]); midground_layer->mark_tile_dirty(offset); } WRITE16_MEMBER(raiden2_state::raiden2_foreground_w) { - COMBINE_DATA(&fore_data[offset]); + COMBINE_DATA(&m_fore_data[offset]); foreground_layer->mark_tile_dirty(offset); } WRITE16_MEMBER(raiden2_state::raiden2_text_w) { - COMBINE_DATA(&text_data[offset]); + COMBINE_DATA(&m_text_data[offset]); text_layer->mark_tile_dirty(offset); } @@ -481,7 +481,7 @@ WRITE16_MEMBER(raiden2_state::raidendx_cop_bank_2_w) TILE_GET_INFO_MEMBER(raiden2_state::get_back_tile_info) { - int tile = back_data[tile_index]; + int tile = m_back_data[tile_index]; int color = (tile >> 12) | (0 << 4); tile = (tile & 0xfff) | (bg_bank << 12); @@ -491,7 +491,7 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_back_tile_info) TILE_GET_INFO_MEMBER(raiden2_state::get_mid_tile_info) { - int tile = mid_data[tile_index]; + int tile = m_mid_data[tile_index]; int color = (tile >> 12) | (2 << 4); tile = (tile & 0xfff) | (mid_bank << 12); @@ -501,7 +501,7 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_mid_tile_info) TILE_GET_INFO_MEMBER(raiden2_state::get_fore_tile_info) { - int tile = fore_data[tile_index]; + int tile = m_fore_data[tile_index]; int color = (tile >> 12) | (1 << 4); tile = (tile & 0xfff) | (fg_bank << 12); @@ -511,7 +511,7 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_fore_tile_info) TILE_GET_INFO_MEMBER(raiden2_state::get_text_tile_info) { - int tile = text_data[tile_index]; + int tile = m_text_data[tile_index]; int color = (tile>>12)&0xf; tile &= 0xfff; @@ -524,15 +524,18 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_text_tile_info) VIDEO_START_MEMBER(raiden2_state,raiden2) { - back_data = make_unique_clear<uint16_t[]>(0x800/2); - fore_data = make_unique_clear<uint16_t[]>(0x800/2); - mid_data = make_unique_clear<uint16_t[]>(0x800/2); - text_data = make_unique_clear<uint16_t[]>(0x1000/2); + m_back_data = make_unique_clear<uint16_t[]>(0x800/2); + m_fore_data = make_unique_clear<uint16_t[]>(0x800/2); + m_mid_data = make_unique_clear<uint16_t[]>(0x800/2); + m_text_data = make_unique_clear<uint16_t[]>(0x1000/2); + m_palette_data = make_unique_clear<uint16_t[]>(0x1000/2); + m_palette->basemem().set(m_palette_data.get(), 0x1000/2 * sizeof(uint16_t), 16, ENDIANNESS_LITTLE, 2); - save_pointer(NAME(back_data.get()), 0x800/2); - save_pointer(NAME(fore_data.get()), 0x800/2); - save_pointer(NAME(mid_data.get()), 0x800/2); - save_pointer(NAME(text_data.get()), 0x1000/2); + save_pointer(NAME(m_back_data.get()), 0x800/2); + save_pointer(NAME(m_fore_data.get()), 0x800/2); + save_pointer(NAME(m_mid_data.get()), 0x800/2); + save_pointer(NAME(m_text_data.get()), 0x1000/2); + save_pointer(NAME(m_palette_data.get()), 0x1000/2); text_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(raiden2_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64,32 ); background_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(raiden2_state::get_back_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,32 ); @@ -1450,7 +1453,7 @@ MACHINE_CONFIG_START(raiden2_state::raiden2) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_raiden2) MCFG_PALETTE_ADD("palette", 2048) - //MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) + MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(*this, raiden2_state, tilemap_enable_w)) @@ -1458,6 +1461,8 @@ MACHINE_CONFIG_START(raiden2_state::raiden2) MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, raiden2_state, m_videoram_private_w)) + MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) + MCFG_RAIDEN2COP_HOST_CPU("maincpu") MCFG_VIDEO_START_OVERRIDE(raiden2_state,raiden2) @@ -1524,7 +1529,7 @@ MACHINE_CONFIG_START(raiden2_state::zeroteam) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_raiden2) MCFG_PALETTE_ADD("palette", 2048) - //MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) + MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(*this, raiden2_state, tilemap_enable_w)) @@ -1532,6 +1537,8 @@ MACHINE_CONFIG_START(raiden2_state::zeroteam) MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, raiden2_state, m_videoram_private_w)) + MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) + MCFG_RAIDEN2COP_HOST_CPU("maincpu") MCFG_VIDEO_START_OVERRIDE(raiden2_state,raiden2) |