This commit is contained in:
David Haywood 2014-09-22 15:13:19 +00:00
parent 99f2c48264
commit 3bcf797e99
5 changed files with 77 additions and 95 deletions

View File

@ -84,6 +84,7 @@ Preliminary COP MCU memory map
static ADDRESS_MAP_START( legionna_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, legionna_mcu_r, legionna_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -99,6 +100,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( heatbrl_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100640, 0x10068f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, heatbrl_mcu_r, heatbrl_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */
AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -112,6 +114,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( godzilla_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, godzilla_mcu_r, godzilla_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */
AM_RANGE(0x100800, 0x100fff) AM_RAM
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
@ -139,6 +142,7 @@ WRITE16_MEMBER(legionna_state::wordswapram_w)
static ADDRESS_MAP_START( denjinmk_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, denjinmk_mcu_r, denjinmk_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */
AM_RANGE(0x100800, 0x100fff) AM_RAM
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
@ -156,6 +160,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( grainbow_map, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, grainbow_mcu_r, grainbow_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */
AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -172,6 +177,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cupsoc_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsoc_mcu_r,cupsoc_mcu_w) AM_SHARE("cop_mcu_ram")
AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -191,6 +197,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cupsocs_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10060f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)//?
AM_RANGE(0x100640, 0x10067f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsocs_mcu_r,cupsocs_mcu_w) AM_SHARE("cop_mcu_ram")
AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -210,6 +218,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cupsocbl_mem, AS_PROGRAM, 16, legionna_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
//AM_RANGE(0x100000, 0x1003ff) AM_RAM
AM_RANGE(0x100600, 0x10060f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)//?
AM_RANGE(0x100640, 0x10067f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
AM_RANGE(0x100000, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, copdxbl_0_r,copdxbl_0_w) AM_SHARE("cop_mcu_ram")
AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
@ -1080,6 +1090,10 @@ static MACHINE_CONFIG_START( legionna, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_legionna)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", legionna)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
//MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
@ -1113,6 +1127,11 @@ static MACHINE_CONFIG_START( heatbrl, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_legionna)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", heatbrl)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
@ -1147,6 +1166,11 @@ static MACHINE_CONFIG_START( godzilla, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_godzilla)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", heatbrl)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
@ -1182,6 +1206,11 @@ static MACHINE_CONFIG_START( denjinmk, legionna_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", heatbrl)
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
//MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
@ -1213,6 +1242,11 @@ static MACHINE_CONFIG_START( grainbow, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_grainbow)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", grainbow)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
@ -1247,6 +1281,11 @@ static MACHINE_CONFIG_START( cupsoc, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_grainbow)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cupsoc)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)
@ -1290,6 +1329,11 @@ static MACHINE_CONFIG_START( cupsocbl, legionna_state )
MCFG_SCREEN_UPDATE_DRIVER(legionna_state, screen_update_grainbow)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(legionna_state, tilemap_enable_w))
MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(legionna_state, tile_scroll_w))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", heatbrl_csb)
MCFG_PALETTE_ADD_INIT_BLACK("palette", 128*16)

View File

@ -1,6 +1,6 @@
#include "sound/okim6295.h"
#include "machine/raiden2cop.h"
#include "video/seibu_crtc.h"
class legionna_state : public driver_device
{
@ -18,7 +18,9 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_wordswapram(*this, "wordswapram")
{ }
{
memset(scrollvals, 0, sizeof(UINT16)*6);
}
required_shared_ptr<UINT16> m_spriteram;
UINT16* m_back_data;
@ -38,7 +40,9 @@ public:
UINT16 m_back_gfx_bank;
UINT16 m_fore_gfx_bank;
UINT16 m_mid_gfx_bank;
UINT16 scrollvals[6];
DECLARE_WRITE16_MEMBER(tilemap_enable_w);
DECLARE_WRITE16_MEMBER(tile_scroll_w);
DECLARE_WRITE16_MEMBER(videowrite_cb_w);
DECLARE_WRITE16_MEMBER(wordswapram_w);
DECLARE_WRITE16_MEMBER(legionna_background_w);

View File

@ -1630,7 +1630,6 @@ seibu_cop_legacy_device::seibu_cop_legacy_device(const machine_config &mconfig,
m_cop_sprite_dma_param(0),
m_raiden2cop(*this, ":raiden2cop")
{
memset(m_seibu_vregs, 0, sizeof(UINT16)*0x50/2);
for (int i = 0; i < 8; i++)
{
@ -1684,7 +1683,6 @@ void seibu_cop_legacy_device::device_start()
save_item(NAME(m_cop_sprite_dma_abs_y));
save_item(NAME(m_cop_sprite_dma_size));
save_item(NAME(m_cop_sprite_dma_param));
save_item(NAME(m_seibu_vregs));
}
//-------------------------------------------------
@ -1695,24 +1693,6 @@ void seibu_cop_legacy_device::device_reset()
{
}
WRITE16_MEMBER( seibu_cop_legacy_device::seibu_common_video_regs_w )
{
legionna_state *state = space.machine().driver_data<legionna_state>();
COMBINE_DATA(&m_seibu_vregs[offset]);
switch(offset)
{
case (0x01a/2): { state->flip_screen_set(m_seibu_vregs[offset] & 0x01); break; }
case (0x01c/2): { state->m_layer_disable = m_seibu_vregs[offset]; break; }
case (0x020/2): { state->m_scrollram16[0] = m_seibu_vregs[offset]; break; }
case (0x022/2): { state->m_scrollram16[1] = m_seibu_vregs[offset]; break; }
case (0x024/2): { state->m_scrollram16[2] = m_seibu_vregs[offset]; break; }
case (0x026/2): { state->m_scrollram16[3] = m_seibu_vregs[offset]; break; }
case (0x028/2): { state->m_scrollram16[4] = m_seibu_vregs[offset]; break; }
case (0x02a/2): { state->m_scrollram16[5] = m_seibu_vregs[offset]; break; }
default: { logerror("seibu_common_video_regs_w unhandled offset %02x %04x\n",offset*2,data); break; }
}
}
/*
@ -2949,11 +2929,7 @@ WRITE16_MEMBER( seibu_cop_legacy_device::heatbrl_mcu_w )
if(offset == 0x200/2) //irq ack / sprite buffering?
return;
if(offset >= 0x240/2 && offset <= 0x28f/2)
{
seibu_common_video_regs_w(space,offset-0x240/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x3c0/2 && offset <= 0x3df/2)
{
@ -2997,12 +2973,6 @@ WRITE16_MEMBER( seibu_cop_legacy_device::cupsoc_mcu_w )
if(offset == 0x280/2) //irq ack / sprite buffering?
return;
if(offset >= 0x200/2 && offset <= 0x24f/2)
{
seibu_common_video_regs_w(space,offset-0x200/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x300/2 && offset <= 0x31f/2)
{
space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
@ -3039,17 +3009,7 @@ WRITE16_MEMBER( seibu_cop_legacy_device::cupsocs_mcu_w )
if(offset == 0x280/2) //irq ack / sprite buffering?
return;
if(offset >= 0x240/2 && offset <= 0x27f/2)
{
seibu_common_video_regs_w(space,offset-0x240/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x200/2 && offset <= 0x20f/2)
{
seibu_common_video_regs_w(space,(offset-0x200/2)+(0x40/2),m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x340/2 && offset <= 0x35f/2)
{
@ -3092,11 +3052,6 @@ WRITE16_MEMBER( seibu_cop_legacy_device::godzilla_mcu_w )
if(offset == 0x280/2) //irq ack / sprite buffering?
return;
if(offset >= 0x200/2 && offset <= 0x24f/2)
{
seibu_common_video_regs_w(space,offset-0x200/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x300/2 && offset <= 0x31f/2)
{
@ -3144,11 +3099,6 @@ WRITE16_MEMBER( seibu_cop_legacy_device::denjinmk_mcu_w )
return;
}
if(offset >= 0x200/2 && offset <= 0x24f/2)
{
seibu_common_video_regs_w(space,offset-0x200/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x300/2 && offset <= 0x31f/2)
{
@ -3191,11 +3141,6 @@ WRITE16_MEMBER( seibu_cop_legacy_device::grainbow_mcu_w )
if(offset == 0x280/2) //irq ack / sprite buffering?
return;
if(offset >= 0x200/2 && offset <= 0x24f/2)
{
seibu_common_video_regs_w(space,offset-0x200/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x300/2 && offset <= 0x31f/2)
{
@ -3236,11 +3181,6 @@ WRITE16_MEMBER( seibu_cop_legacy_device::legionna_mcu_w )
if(offset == 0x280/2) //irq ack / sprite buffering?
return;
if(offset >= 0x200/2 && offset <= 0x24f/2)
{
seibu_common_video_regs_w(space,offset-0x200/2,m_cop_mcu_ram[offset],mem_mask);
return;
}
if(offset >= 0x300/2 && offset <= 0x31f/2)
{

View File

@ -58,7 +58,6 @@ private:
UINT8 m_cop_rng_max_value;
UINT16 m_copd2_offs;
UINT32 m_cop_register[8];
UINT16 m_seibu_vregs[0x50/2];
UINT16 m_cop_status,m_cop_dist,m_cop_angle;
UINT16 m_cop_hit_status;
INT16 m_cop_hit_val_x,m_cop_hit_val_y,m_cop_hit_val_z,m_cop_hit_val_unk;
@ -75,7 +74,6 @@ private:
void copd2_set_tableoffset(UINT16 data);
void copd2_set_tabledata(UINT16 data);
DECLARE_WRITE16_MEMBER( seibu_common_video_regs_w );
void cop_take_hit_box_params(UINT8 offs);
UINT8 cop_calculate_collsion_detection();
DECLARE_READ16_MEMBER( generic_cop_r );

View File

@ -20,6 +20,29 @@
/******************************************************************************/
WRITE16_MEMBER(legionna_state::tilemap_enable_w)
{
COMBINE_DATA(&m_layer_disable);
}
WRITE16_MEMBER(legionna_state::tile_scroll_w)
{
COMBINE_DATA(scrollvals + offset);
data = scrollvals[offset];
tilemap_t *tm = 0;
switch(offset/2) {
case 0: tm = m_background_layer; break;
case 1: tm = m_midground_layer; break;
case 2: tm = m_foreground_layer; break;
}
if(offset & 1)
tm->set_scrolly(0, data);
else
tm->set_scrollx(0, data);
}
void heatbrl_setgfxbank(running_machine &machine, UINT16 data)
{
legionna_state *state = machine.driver_data<legionna_state>();
@ -457,15 +480,6 @@ void legionna_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
UINT32 legionna_state::screen_update_legionna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* Setup the tilemaps */
m_background_layer->set_scrollx(0, m_scrollram16[0] );
m_background_layer->set_scrolly(0, m_scrollram16[1] );
m_midground_layer->set_scrollx(0, m_scrollram16[2] );
m_midground_layer->set_scrolly(0, m_scrollram16[3] );
m_foreground_layer->set_scrollx(0, m_scrollram16[4] );
m_foreground_layer->set_scrolly(0, m_scrollram16[5] );
m_text_layer->set_scrollx(0, 0/*m_scrollram16[6]*/ );
m_text_layer->set_scrolly(0, 0/*m_scrollram16[7]*/ );
screen.priority().fill(0, cliprect);
bitmap.fill(m_palette->black_pen(), cliprect); /* wrong color? */
@ -485,17 +499,7 @@ UINT32 legionna_state::screen_update_legionna(screen_device &screen, bitmap_ind1
UINT32 legionna_state::screen_update_godzilla(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// m_text_layer->set_scrollx(0, 0 );
// m_text_layer->set_scrolly(0, 112 );
/* Setup the tilemaps */
m_background_layer->set_scrollx(0, m_scrollram16[0] );
m_background_layer->set_scrolly(0, m_scrollram16[1] );
m_midground_layer->set_scrollx(0, m_scrollram16[2] );
m_midground_layer->set_scrolly(0, m_scrollram16[3] );
m_foreground_layer->set_scrollx(0, m_scrollram16[4] );
m_foreground_layer->set_scrolly(0, m_scrollram16[5] );
m_text_layer->set_scrollx(0, 0/*m_scrollram16[6]*/ );
m_text_layer->set_scrolly(0, 0/*m_scrollram16[7]*/ );
bitmap.fill(0x0200, cliprect);
@ -513,15 +517,7 @@ UINT32 legionna_state::screen_update_godzilla(screen_device &screen, bitmap_ind1
UINT32 legionna_state::screen_update_grainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* Setup the tilemaps */
m_background_layer->set_scrollx(0, m_scrollram16[0] );
m_background_layer->set_scrolly(0, m_scrollram16[1] );
m_midground_layer->set_scrollx(0, m_scrollram16[2] );
m_midground_layer->set_scrolly(0, m_scrollram16[3] );
m_foreground_layer->set_scrollx(0, m_scrollram16[4] );
m_foreground_layer->set_scrolly(0, m_scrollram16[5] );
m_text_layer->set_scrollx(0, 0/*m_scrollram16[6]*/ );
m_text_layer->set_scrolly(0, 0/*m_scrollram16[7]*/ );
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);