Previous 199869 Revisions Next

r20715 Sunday 3rd February, 2013 at 23:09:12 UTC by David Haywood
not really sure what's mapped to this additional cpu...
[src/mame/drivers]spbactn.c
[src/mame/includes]spbactn.h
[src/mame/video]spbactn.c

trunk/src/mame/video/spbactn.c
r20714r20715
155155
156156
157157
158void spbactn_state::video_start()
158VIDEO_START_MEMBER(spbactn_state,spbactn)
159159{
160160   /* allocate bitmaps */
161161   machine().primary_screen->register_screen_bitmap(m_tile_bitmap_bg);
162162   machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg);
163163
164
165164   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);
166165   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);
167166   m_bg_tilemap->set_transparent_pen(0);
r20714r20715
169168
170169}
171170
172
171VIDEO_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}
173177WRITE16_MEMBER( spbactn_state::spbatnp_90002_w )
174178{
175179   //printf("spbatnp_90002_w %04x\n",data);
r20714r20715
210214}
211215
212216
217WRITE8_MEMBER(spbactn_state::extraram_w)
218{
219   COMBINE_DATA(&m_extraram[offset]);
220   m_extra_tilemap->mark_tile_dirty(offset/2);
221}
213222
223TILE_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
214233int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites)
215234{
216235   m_tile_bitmap_fg.fill(0, cliprect);
r20714r20715
244263
245264UINT32 spbactn_state::screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
246265{
266   // hack to make the extra cpu do something..
267   m_extraram2[0x104] = machine().rand();
268   m_extraram2[0x105] = machine().rand();
269
247270   return draw_video(screen,bitmap,cliprect,true);
248271}
trunk/src/mame/includes/spbactn.h
r20714r20715
55      : driver_device(mconfig, type, tag) ,
66      m_bgvideoram(*this, "bgvideoram"),
77      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   { }
912
1013   required_shared_ptr<UINT16> m_bgvideoram;
1114   required_shared_ptr<UINT16> m_fgvideoram;
1215   required_shared_ptr<UINT16> m_spvideoram;
16   optional_shared_ptr<UINT8> m_extraram;
17   optional_shared_ptr<UINT8> m_extraram2;
1318
1419   tilemap_t    *m_bg_tilemap;
1520   tilemap_t    *m_fg_tilemap;
21
22   tilemap_t    *m_extra_tilemap;
23
1624   DECLARE_WRITE16_MEMBER(bg_videoram_w);
1725   DECLARE_WRITE16_MEMBER(fg_videoram_w);
1826   TILE_GET_INFO_MEMBER(get_bg_tile_info);
1927   TILE_GET_INFO_MEMBER(get_fg_tile_info);
2028
29   DECLARE_WRITE8_MEMBER(extraram_w);
30   TILE_GET_INFO_MEMBER(get_extra_tile_info);
2131
32
33
2234   bitmap_ind16 m_tile_bitmap_bg;
2335   bitmap_ind16 m_tile_bitmap_fg;
36
37
2438   DECLARE_WRITE16_MEMBER(soundcommand_w);
2539
2640   DECLARE_WRITE16_MEMBER( spbatnp_90002_w );
r20714r20715
3246   DECLARE_WRITE16_MEMBER( spbatnp_90124_w );
3347   DECLARE_WRITE16_MEMBER( spbatnp_9012c_w );
3448
35   
49   DECLARE_VIDEO_START(spbactn);
50   DECLARE_VIDEO_START(spbactnp);
3651
37   virtual void video_start();
52
53   //virtual void video_start();
3854   UINT32 screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3955   UINT32 screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4056   int draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites);
trunk/src/mame/drivers/spbactn.c
r20714r20715
232232
233233static ADDRESS_MAP_START( spbactnp_extra_map, AS_PROGRAM, 8, spbactn_state )
234234   AM_RANGE(0x0000, 0xefff) AM_ROM
235   AM_RANGE(0xc000, 0xc7ff) AM_RAM
235   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("extraram2")
236236   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")
238238   AM_RANGE(0xd200, 0xd200) AM_RAM
239239ADDRESS_MAP_END
240240
r20714r20715
428428   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
429429   MCFG_SCREEN_SIZE(64*8, 32*8)
430430   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
431   MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactn)
431432   MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactn)
432433
433434   MCFG_GFXDECODE(spbactn)
r20714r20715
460461   MCFG_CPU_ADD("extracpu", Z80, XTAL_4MHz)
461462   MCFG_CPU_PROGRAM_MAP(spbactnp_extra_map)
462463   MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state,  irq0_line_hold)
464//   MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state,  nmi_line_pulse)
463465
464466
465467   /* video hardware */
r20714r20715
468470   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
469471   MCFG_SCREEN_SIZE(64*8, 32*8)
470472   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
473   MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactnp)
471474   MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactnp)
472475
473476   MCFG_GFXDECODE(spbactnp)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team