Previous 199869 Revisions Next

r20712 Sunday 3rd February, 2013 at 22:06:36 UTC by David Haywood
spbactnp progress (nw)
[src/mame/drivers]spbactn.c
[src/mame/includes]spbactn.h
[src/mame/video]spbactn.c

trunk/src/mame/includes/spbactn.h
r20711r20712
2222   bitmap_ind16 m_tile_bitmap_bg;
2323   bitmap_ind16 m_tile_bitmap_fg;
2424   DECLARE_WRITE16_MEMBER(soundcommand_w);
25
26   DECLARE_WRITE16_MEMBER( spbatnp_90002_w );
27   DECLARE_WRITE16_MEMBER( spbatnp_90006_w );
28   DECLARE_WRITE16_MEMBER( spbatnp_9000a_w );
29   DECLARE_WRITE16_MEMBER( spbatnp_9000c_w );
30   DECLARE_WRITE16_MEMBER( spbatnp_9000e_w );
31
32   DECLARE_WRITE16_MEMBER( spbatnp_90124_w );
33   DECLARE_WRITE16_MEMBER( spbatnp_9012c_w );
34
35   
36
2537   virtual void video_start();
2638   UINT32 screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
2739   UINT32 screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
trunk/src/mame/video/spbactn.c
r20711r20712
127127{
128128   int attr = m_bgvideoram[tile_index];
129129   int tileno = m_bgvideoram[tile_index+0x2000];
130   SET_TILE_INFO_MEMBER(1, tileno, ((attr & 0x00f0)>>4), 0);
130   SET_TILE_INFO_MEMBER(1, tileno, ((attr & 0x00f0)>>4)+0x80, 0);
131131}
132132
133133
r20711r20712
142142   int attr = m_fgvideoram[tile_index];
143143   int tileno = m_fgvideoram[tile_index+0x2000];
144144
145   SET_TILE_INFO_MEMBER(0, tileno, ((attr & 0x00f0)>>4), 0);
145   int color = ((attr & 0x00f0)>>4);
146   
147   /* blending */
148   if (attr & 0x0008)
149      color += 0x00f0;
150   else
151      color |= 0x0080;
152
153   SET_TILE_INFO_MEMBER(0, tileno, color, 0);
146154}
147155
148156
r20711r20712
156164
157165   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);
158166   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   m_bg_tilemap->set_transparent_pen(0);
168   m_fg_tilemap->set_transparent_pen(0);
159169
160170}
161171
162int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites)
172
173WRITE16_MEMBER( spbactn_state::spbatnp_90002_w )
163174{
164   int offs, sx, sy;
175   //printf("spbatnp_90002_w %04x\n",data);
176}
165177
166   m_tile_bitmap_fg.fill(0, cliprect);
178WRITE16_MEMBER( spbactn_state::spbatnp_90006_w )
179{
180   //printf("spbatnp_90006_w %04x\n",data);
181}
167182
168   /* draw table bg gfx */
169   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
170   {
171      int attr, code, color;
172183
173      code = m_bgvideoram[offs + 0x4000 / 2];
174      attr = m_bgvideoram[offs + 0x0000 / 2];
184WRITE16_MEMBER( spbactn_state::spbatnp_9000c_w )
185{
186   //printf("spbatnp_9000c_w %04x\n",data);
187}
175188
176      color = ((attr & 0x00f0) >> 4) | 0x80;
189WRITE16_MEMBER( spbactn_state::spbatnp_9000e_w )
190{
191   //printf("spbatnp_9000e_w %04x\n",data);
192}
177193
178      drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1],
179               code,
180               machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(),
181               0, 0,
182               16 * sx, 8 * sy,
183               (UINT32)-1);
194WRITE16_MEMBER( spbactn_state::spbatnp_9000a_w )
195{
196   //printf("spbatnp_9000a_w %04x\n",data);
197}
184198
185      sx++;
186      if (sx > 63)
187      {
188         sy++;
189         sx = 0;
190      }
191   }
199WRITE16_MEMBER( spbactn_state::spbatnp_90124_w )
200{
201   //printf("spbatnp_90124_w %04x\n",data);
202   m_bg_tilemap->set_scrolly(0, data);
192203
193   if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0, alt_sprites))
194   {
195      /* kludge: draw table bg gfx again if priority 0 sprites are enabled */
196      for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
197      {
198         int attr, code, color;
204}
199205
200         code = m_bgvideoram[offs + 0x4000 / 2];
201         attr = m_bgvideoram[offs + 0x0000 / 2];
206WRITE16_MEMBER( spbactn_state::spbatnp_9012c_w )
207{
208   //printf("spbatnp_9012c_w %04x\n",data);
209   m_bg_tilemap->set_scrollx(0, data);
210}
202211
203         color = ((attr & 0x00f0) >> 4) | 0x80;
204212
205         drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1],
206               code,
207               machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(),
208               0, 0,
209               16 * sx, 8 * sy,
210               0);
211213
212         sx++;
213         if (sx > 63)
214         {
215            sy++;
216            sx = 0;
217         }
218      }
219   }
214int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites)
215{
216   m_tile_bitmap_fg.fill(0, cliprect);
220217
221   draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1, alt_sprites);
218   m_bg_tilemap->draw(m_tile_bitmap_bg, cliprect, TILEMAP_DRAW_OPAQUE, 0);
222219
223   /* draw table fg gfx */
224   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
225   {
226      int attr, code, color;
227220
228      code = m_fgvideoram[offs + 0x4000 / 2];
229      attr = m_fgvideoram[offs + 0x0000 / 2];
230221
231      color = ((attr & 0x00f0) >> 4);
222   if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0, alt_sprites))
223   {
224      m_bg_tilemap->draw(m_tile_bitmap_bg, cliprect, 0, 0);
225   }
232226
233      /* blending */
234      if (attr & 0x0008)
235         color += 0x00f0;
236      else
237         color |= 0x0080;
227   draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1, alt_sprites);
238228
239      drawgfx_transpen_raw(m_tile_bitmap_fg, cliprect, machine().gfx[0],
240               code,
241               machine().gfx[0]->colorbase() + color * machine().gfx[0]->granularity(),
242               0, 0,
243               16 * sx, 8 * sy,
244               0);
229   m_fg_tilemap->draw(m_tile_bitmap_fg, cliprect, 0, 0);
245230
246      sx++;
247      if (sx > 63)
248      {
249         sy++;
250         sx = 0;
251      }
252   }
253231
254232   draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 2, alt_sprites);
255233   draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 3, alt_sprites);
trunk/src/mame/drivers/spbactn.c
r20711r20712
160160   AM_RANGE(0x90030, 0x90031) AM_READ_PORT("DSW1")
161161   AM_RANGE(0x90040, 0x90041) AM_READ_PORT("DSW2")
162162
163   /* this is an awful lot of unknowns */
163   /* this are an awful lot of unknowns */
164164   AM_RANGE(0x90000, 0x90001) AM_WRITENOP
165165   AM_RANGE(0x90010, 0x90011) AM_WRITE(soundcommand_w)
166166//  AM_RANGE(0x90020, 0x90021) AM_WRITE(soundcommand_w)
r20711r20712
203203   AM_RANGE(0x70000, 0x77fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bgvideoram")
204204   AM_RANGE(0x80000, 0x827ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_word_w) AM_SHARE("paletteram")   // yes R and G are swapped vs. the released version
205205
206   AM_RANGE(0x90002, 0x90003) AM_WRITE( spbatnp_90002_w )
207   AM_RANGE(0x90006, 0x90007) AM_WRITE( spbatnp_90006_w )
208   AM_RANGE(0x9000a, 0x9000b) AM_WRITE( spbatnp_9000a_w )
209   AM_RANGE(0x9000c, 0x9000d) AM_WRITE( spbatnp_9000c_w )
210   AM_RANGE(0x9000e, 0x9000f) AM_WRITE( spbatnp_9000e_w )
211
212   AM_RANGE(0x90124, 0x90125) AM_WRITE( spbatnp_90124_w ) // bg scroll
213   AM_RANGE(0x9012c, 0x9012d) AM_WRITE( spbatnp_9012c_w ) // bg scroll
214
215   
216
206217   AM_RANGE(0x90000, 0x900ff) AM_READ(temp_read_handler_r) // temp
207218
208219ADDRESS_MAP_END
r20711r20712
218229ADDRESS_MAP_END
219230
220231
232
233static ADDRESS_MAP_START( spbactnp_extra_map, AS_PROGRAM, 8, spbactn_state )
234   AM_RANGE(0x0000, 0xefff) AM_ROM
235   AM_RANGE(0xc000, 0xc7ff) AM_RAM
236   AM_RANGE(0xe000, 0xefff) AM_RAM
237   AM_RANGE(0xd000, 0xd1ff) AM_RAM
238   AM_RANGE(0xd200, 0xd200) AM_RAM
239ADDRESS_MAP_END
240
241
242
221243static INPUT_PORTS_START( spbactn )
222244   PORT_START("IN0")
223245   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r20711r20712
432454   MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state,  irq3_line_hold)
433455
434456   MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz)
435   MCFG_CPU_PROGRAM_MAP(spbactn_sound_map) // wrong
457   MCFG_CPU_PROGRAM_MAP(spbactn_sound_map)
436458
437   // there is a rom for another Z80 and a socket for one..
459   // yes another cpu..
460   MCFG_CPU_ADD("extracpu", Z80, XTAL_4MHz)
461   MCFG_CPU_PROGRAM_MAP(spbactnp_extra_map)
462   MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state,  irq0_line_hold)
438463
464
439465   /* video hardware */
440466   MCFG_SCREEN_ADD("screen", RASTER)
441467   MCFG_SCREEN_REFRESH_RATE(60)
r20711r20712
521547   ROM_LOAD16_BYTE( "spa.21k", 0x20001, 0x10000, CRC(8226f644) SHA1(2d3e32368fbfec7437bd972096fd92972f52f6b0) )
522548
523549   ROM_REGION( 0x10000, "audiocpu", 0 )
524   ROM_LOAD( "6204_6-6.29c",   0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) )
550   ROM_LOAD( "spa.17g", 0x00000, 0x10000, CRC(445fc2c5) SHA1(c0e40496cfcaa0a8c90fb05111fadee74582f91a) )
525551
526552   
527553   ROM_REGION( 0x40000, "oki", 0 )
r20711r20712
540566   ROM_LOAD( "spa_sp1_3-14-a-10.4m", 0x20000, 0x20000, CRC(86406336) SHA1(bf091dc13404535e6baee990f5e957d3538841ac) )
541567
542568
569   /* does this have an extra (horizontal) screen maybe, with the girls being displayed on that instead of the main one.. */
570   ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's annother z80 rom... unused for now
571   ROM_LOAD( "6204_6-6.29c",   0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) )
543572
544   ROM_REGION( 0x10000, "otherz80", 0 ) // what? it's annother z80 rom... unused for now
545   ROM_LOAD( "spa.17g", 0x00000, 0x10000, CRC(445fc2c5) SHA1(c0e40496cfcaa0a8c90fb05111fadee74582f91a) )
546
547573   ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation??
548574   ROM_LOAD( "spa.25c", 0x00000, 0x20000, CRC(02b69ab9) SHA1(368e774693a6fab756faaeec4ffd42406816e6e2) )
549575
550576   ROM_REGION( 0x10000, "misc", 0 ) //misc
551   ROM_LOAD( "p109.18d", 0x00000, 0x100, CRC(2297a725) SHA1(211ebae11ca55cc67df29291c3e0916836550bfb) )
552   ROM_LOAD( "pin.b.sub.23g", 0x00000, 0x100, CRC(3a0c70ed) SHA1(9be38c421e9a14f6811752a4464dd5dbf037e385) )
577   ROM_LOAD( "p109.18d", 0x00000, 0x100, CRC(2297a725) SHA1(211ebae11ca55cc67df29291c3e0916836550bfb) ) // mostly empty.. is this correct?
578   ROM_LOAD( "pin.b.sub.23g", 0x00000, 0x100, CRC(3a0c70ed) SHA1(9be38c421e9a14f6811752a4464dd5dbf037e385) ) // mostly empty.. is this correct?
553579   ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) )
554580ROM_END
555581

Previous 199869 Revisions Next


© 1997-2024 The MAME Team