trunk/src/mame/video/spbactn.c
| r20714 | r20715 | |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | |
| 158 | | void spbactn_state::video_start() |
| 158 | VIDEO_START_MEMBER(spbactn_state,spbactn) |
| 159 | 159 | { |
| 160 | 160 | /* allocate bitmaps */ |
| 161 | 161 | machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg); |
| 162 | 162 | machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg); |
| 163 | 163 | |
| 164 | | |
| 165 | 164 | 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); |
| 166 | 165 | 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); |
| 167 | 166 | m_bg_tilemap->set_transparent_pen(0); |
| r20714 | r20715 | |
| 169 | 168 | |
| 170 | 169 | } |
| 171 | 170 | |
| 172 | | |
| 171 | VIDEO_START_MEMBER(spbactn_state,spbactnp) |
| 172 | { |
| 173 | VIDEO_START_CALL_MEMBER(spbactn); |
| 174 | // no idea.. |
| 175 | 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); |
| 176 | } |
| 173 | 177 | WRITE16_MEMBER( spbactn_state::spbatnp_90002_w ) |
| 174 | 178 | { |
| 175 | 179 | //printf("spbatnp_90002_w %04x\n",data); |
| r20714 | r20715 | |
| 210 | 214 | } |
| 211 | 215 | |
| 212 | 216 | |
| 217 | WRITE8_MEMBER(spbactn_state::extraram_w) |
| 218 | { |
| 219 | COMBINE_DATA(&m_extraram[offset]); |
| 220 | m_extra_tilemap->mark_tile_dirty(offset/2); |
| 221 | } |
| 213 | 222 | |
| 223 | TILE_GET_INFO_MEMBER(spbactn_state::get_extra_tile_info) |
| 224 | { |
| 225 | int tileno = m_extraram[(tile_index*2)+1]; |
| 226 | tileno |= m_extraram[(tile_index*2)] << 8; |
| 227 | SET_TILE_INFO_MEMBER(3, tileno, 0, 0); |
| 228 | } |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 214 | 233 | int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites) |
| 215 | 234 | { |
| 216 | 235 | m_tile_bitmap_fg.fill(0, cliprect); |
| r20714 | r20715 | |
| 244 | 263 | |
| 245 | 264 | UINT32 spbactn_state::screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 246 | 265 | { |
| 266 | // hack to make the extra cpu do something.. |
| 267 | m_extraram2[0x104] = machine().rand(); |
| 268 | m_extraram2[0x105] = machine().rand(); |
| 269 | |
| 247 | 270 | return draw_video(screen,bitmap,cliprect,true); |
| 248 | 271 | } |
trunk/src/mame/includes/spbactn.h
| r20714 | r20715 | |
| 5 | 5 | : driver_device(mconfig, type, tag) , |
| 6 | 6 | m_bgvideoram(*this, "bgvideoram"), |
| 7 | 7 | m_fgvideoram(*this, "fgvideoram"), |
| 8 | | m_spvideoram(*this, "spvideoram"){ } |
| 8 | m_spvideoram(*this, "spvideoram"), |
| 9 | m_extraram(*this, "extraram"), |
| 10 | m_extraram2(*this, "extraram2") |
| 11 | { } |
| 9 | 12 | |
| 10 | 13 | required_shared_ptr<UINT16> m_bgvideoram; |
| 11 | 14 | required_shared_ptr<UINT16> m_fgvideoram; |
| 12 | 15 | required_shared_ptr<UINT16> m_spvideoram; |
| 16 | optional_shared_ptr<UINT8> m_extraram; |
| 17 | optional_shared_ptr<UINT8> m_extraram2; |
| 13 | 18 | |
| 14 | 19 | tilemap_t *m_bg_tilemap; |
| 15 | 20 | tilemap_t *m_fg_tilemap; |
| 21 | |
| 22 | tilemap_t *m_extra_tilemap; |
| 23 | |
| 16 | 24 | DECLARE_WRITE16_MEMBER(bg_videoram_w); |
| 17 | 25 | DECLARE_WRITE16_MEMBER(fg_videoram_w); |
| 18 | 26 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 19 | 27 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 20 | 28 | |
| 29 | DECLARE_WRITE8_MEMBER(extraram_w); |
| 30 | TILE_GET_INFO_MEMBER(get_extra_tile_info); |
| 21 | 31 | |
| 32 | |
| 33 | |
| 22 | 34 | bitmap_ind16 m_tile_bitmap_bg; |
| 23 | 35 | bitmap_ind16 m_tile_bitmap_fg; |
| 36 | |
| 37 | |
| 24 | 38 | DECLARE_WRITE16_MEMBER(soundcommand_w); |
| 25 | 39 | |
| 26 | 40 | DECLARE_WRITE16_MEMBER( spbatnp_90002_w ); |
| r20714 | r20715 | |
| 32 | 46 | DECLARE_WRITE16_MEMBER( spbatnp_90124_w ); |
| 33 | 47 | DECLARE_WRITE16_MEMBER( spbatnp_9012c_w ); |
| 34 | 48 | |
| 35 | | |
| 49 | DECLARE_VIDEO_START(spbactn); |
| 50 | DECLARE_VIDEO_START(spbactnp); |
| 36 | 51 | |
| 37 | | virtual void video_start(); |
| 52 | |
| 53 | //virtual void video_start(); |
| 38 | 54 | UINT32 screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 39 | 55 | UINT32 screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 40 | 56 | int draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites); |
trunk/src/mame/drivers/spbactn.c
| r20714 | r20715 | |
| 232 | 232 | |
| 233 | 233 | static ADDRESS_MAP_START( spbactnp_extra_map, AS_PROGRAM, 8, spbactn_state ) |
| 234 | 234 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 235 | | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 235 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("extraram2") |
| 236 | 236 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 237 | | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 237 | AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE( extraram_w ) AM_SHARE("extraram") |
| 238 | 238 | AM_RANGE(0xd200, 0xd200) AM_RAM |
| 239 | 239 | ADDRESS_MAP_END |
| 240 | 240 | |
| r20714 | r20715 | |
| 428 | 428 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 429 | 429 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 430 | 430 | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) |
| 431 | MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactn) |
| 431 | 432 | MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactn) |
| 432 | 433 | |
| 433 | 434 | MCFG_GFXDECODE(spbactn) |
| r20714 | r20715 | |
| 460 | 461 | MCFG_CPU_ADD("extracpu", Z80, XTAL_4MHz) |
| 461 | 462 | MCFG_CPU_PROGRAM_MAP(spbactnp_extra_map) |
| 462 | 463 | MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, irq0_line_hold) |
| 464 | // MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, nmi_line_pulse) |
| 463 | 465 | |
| 464 | 466 | |
| 465 | 467 | /* video hardware */ |
| r20714 | r20715 | |
| 468 | 470 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 469 | 471 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 470 | 472 | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) |
| 473 | MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactnp) |
| 471 | 474 | MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactnp) |
| 472 | 475 | |
| 473 | 476 | MCFG_GFXDECODE(spbactnp) |