diff --git a/src/mame/drivers/spbactn.c b/src/mame/drivers/spbactn.c index 722684066f5..c823e93995d 100644 --- a/src/mame/drivers/spbactn.c +++ b/src/mame/drivers/spbactn.c @@ -232,9 +232,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( spbactnp_extra_map, AS_PROGRAM, 8, spbactn_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xc000, 0xc7ff) AM_RAM + AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("extraram2") AM_RANGE(0xe000, 0xefff) AM_RAM - AM_RANGE(0xd000, 0xd1ff) AM_RAM + AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE( extraram_w ) AM_SHARE("extraram") AM_RANGE(0xd200, 0xd200) AM_RAM ADDRESS_MAP_END @@ -428,6 +428,7 @@ static MACHINE_CONFIG_START( spbactn, spbactn_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) + MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactn) MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactn) MCFG_GFXDECODE(spbactn) @@ -460,6 +461,7 @@ static MACHINE_CONFIG_START( spbactnp, spbactn_state ) MCFG_CPU_ADD("extracpu", Z80, XTAL_4MHz) MCFG_CPU_PROGRAM_MAP(spbactnp_extra_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, irq0_line_hold) +// MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, nmi_line_pulse) /* video hardware */ @@ -468,6 +470,7 @@ static MACHINE_CONFIG_START( spbactnp, spbactn_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) + MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactnp) MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactnp) MCFG_GFXDECODE(spbactnp) diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h index 85b58636c29..fbff93cf10f 100644 --- a/src/mame/includes/spbactn.h +++ b/src/mame/includes/spbactn.h @@ -5,22 +5,36 @@ public: : driver_device(mconfig, type, tag) , m_bgvideoram(*this, "bgvideoram"), m_fgvideoram(*this, "fgvideoram"), - m_spvideoram(*this, "spvideoram"){ } + m_spvideoram(*this, "spvideoram"), + m_extraram(*this, "extraram"), + m_extraram2(*this, "extraram2") + { } required_shared_ptr m_bgvideoram; required_shared_ptr m_fgvideoram; required_shared_ptr m_spvideoram; + optional_shared_ptr m_extraram; + optional_shared_ptr m_extraram2; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; + + tilemap_t *m_extra_tilemap; + DECLARE_WRITE16_MEMBER(bg_videoram_w); DECLARE_WRITE16_MEMBER(fg_videoram_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); + DECLARE_WRITE8_MEMBER(extraram_w); + TILE_GET_INFO_MEMBER(get_extra_tile_info); + + bitmap_ind16 m_tile_bitmap_bg; bitmap_ind16 m_tile_bitmap_fg; + + DECLARE_WRITE16_MEMBER(soundcommand_w); DECLARE_WRITE16_MEMBER( spbatnp_90002_w ); @@ -32,9 +46,11 @@ public: DECLARE_WRITE16_MEMBER( spbatnp_90124_w ); DECLARE_WRITE16_MEMBER( spbatnp_9012c_w ); - + DECLARE_VIDEO_START(spbactn); + DECLARE_VIDEO_START(spbactnp); - virtual void video_start(); + + //virtual void video_start(); UINT32 screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites); diff --git a/src/mame/video/spbactn.c b/src/mame/video/spbactn.c index bfe239e29b6..bea2625666a 100644 --- a/src/mame/video/spbactn.c +++ b/src/mame/video/spbactn.c @@ -155,13 +155,12 @@ TILE_GET_INFO_MEMBER(spbactn_state::get_fg_tile_info) -void spbactn_state::video_start() +VIDEO_START_MEMBER(spbactn_state,spbactn) { /* allocate bitmaps */ machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg); machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg); - m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spbactn_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 64, 128); m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spbactn_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 64, 128); m_bg_tilemap->set_transparent_pen(0); @@ -169,7 +168,12 @@ void spbactn_state::video_start() } - +VIDEO_START_MEMBER(spbactn_state,spbactnp) +{ + VIDEO_START_CALL_MEMBER(spbactn); + // no idea.. + m_extra_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spbactn_state::get_extra_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 16, 16); +} WRITE16_MEMBER( spbactn_state::spbatnp_90002_w ) { //printf("spbatnp_90002_w %04x\n",data); @@ -210,6 +214,21 @@ WRITE16_MEMBER( spbactn_state::spbatnp_9012c_w ) } +WRITE8_MEMBER(spbactn_state::extraram_w) +{ + COMBINE_DATA(&m_extraram[offset]); + m_extra_tilemap->mark_tile_dirty(offset/2); +} + +TILE_GET_INFO_MEMBER(spbactn_state::get_extra_tile_info) +{ + int tileno = m_extraram[(tile_index*2)+1]; + tileno |= m_extraram[(tile_index*2)] << 8; + SET_TILE_INFO_MEMBER(3, tileno, 0, 0); +} + + + int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites) { @@ -244,5 +263,9 @@ UINT32 spbactn_state::screen_update_spbactn(screen_device &screen, bitmap_rgb32 UINT32 spbactn_state::screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + // hack to make the extra cpu do something.. + m_extraram2[0x104] = machine().rand(); + m_extraram2[0x105] = machine().rand(); + return draw_video(screen,bitmap,cliprect,true); }