trunk/src/mame/drivers/spbactn.c
| r20473 | r20474 | |
| 80 | 80 | lev 6 : 0x78 : 0000 1ab2 - writes to 90031 |
| 81 | 81 | lev 7 : 0x7c : ffff ffff - invalid |
| 82 | 82 | |
| 83 | | I can't use tilemap routines because they don't work with tiles having a |
| 84 | | greater height than width, which is the case on this game once its rotated. |
| 85 | | |
| 86 | 83 | TODO : (also check the notes from the galspnbl.c driver) |
| 87 | 84 | |
| 88 | 85 | - coin insertion is not recognized consistenly. |
| 89 | | - sprite/tile priority is sometimes wrong (see 1st table when ball in bumpers). |
| 90 | | - lots of unknown writes, what are they meant to do |
| 91 | | - verify some of the code which is from the other drivers such as sprite |
| 92 | | drawing as priorities are questionable in places |
| 93 | | - add support for blended sprites. |
| 86 | - rewrite video, do single pass sprite render, move sprite code to device, share with gaiden.c etc. |
| 87 | - convert to tilemaps |
| 88 | - all the unknown regs |
| 94 | 89 | |
| 90 | |
| 95 | 91 | Unmapped writes (P.O.S.T.) |
| 96 | 92 | |
| 97 | 93 | cpu #0 (PC=00001C3A): unmapped memory word write to 00090080 = 0F30 & FFFF |
| r20473 | r20474 | |
| 197 | 193 | AM_RANGE(0xa0206, 0xa0207) AM_WRITENOP |
| 198 | 194 | ADDRESS_MAP_END |
| 199 | 195 | |
| 196 | |
| 197 | |
| 198 | static ADDRESS_MAP_START( spbactnp_map, AS_PROGRAM, 16, spbactn_state ) |
| 199 | AM_RANGE(0x00000, 0x3ffff) AM_ROM |
| 200 | AM_RANGE(0x40000, 0x43fff) AM_RAM // main ram |
| 201 | AM_RANGE(0x50000, 0x50fff) AM_RAM AM_SHARE("spvideoram") |
| 202 | AM_RANGE(0x60000, 0x67fff) AM_RAM AM_SHARE("fgvideoram") |
| 203 | AM_RANGE(0x70000, 0x77fff) AM_RAM AM_SHARE("bgvideoram") |
| 204 | AM_RANGE(0x80000, 0x827ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_word_w) AM_SHARE("paletteram") // yes R and G are swapped vs. the released version |
| 205 | |
| 206 | AM_RANGE(0x90000, 0x900ff) AM_READ(temp_read_handler_r) // temp |
| 207 | |
| 208 | ADDRESS_MAP_END |
| 209 | |
| 200 | 210 | static ADDRESS_MAP_START( spbactn_sound_map, AS_PROGRAM, 8, spbactn_state ) |
| 201 | 211 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 202 | 212 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| r20473 | r20474 | |
| 334 | 344 | GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x0000, 16 + 384 ) |
| 335 | 345 | GFXDECODE_END |
| 336 | 346 | |
| 347 | |
| 348 | static const gfx_layout proto_fgtilelayout = |
| 349 | { |
| 350 | 16,8, |
| 351 | RGN_FRAC(1,1), |
| 352 | 4, |
| 353 | { 0, 1, 2, 3 }, |
| 354 | { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, 64*4, 65*4, 66*4, 67*4, 68*4, 69*4, 70*4, 71*4 }, |
| 355 | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, |
| 356 | 64*8 |
| 357 | }; |
| 358 | |
| 359 | |
| 360 | |
| 361 | static const gfx_layout proto_spr_layout = |
| 362 | { |
| 363 | 8,8, |
| 364 | RGN_FRAC(1,1), |
| 365 | 4, |
| 366 | { 0, 1, 2, 3 }, |
| 367 | { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, |
| 368 | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, |
| 369 | 32*8 |
| 370 | }; |
| 371 | |
| 372 | |
| 373 | static GFXDECODE_START( spbactnp ) |
| 374 | GFXDECODE_ENTRY( "gfx1", 0, proto_fgtilelayout, 0x0200, 16 + 240 ) |
| 375 | GFXDECODE_ENTRY( "gfx2", 0, proto_fgtilelayout, 0x0300, 16 + 128 ) // wrong |
| 376 | GFXDECODE_ENTRY( "gfx3", 0, proto_spr_layout, 0x0000, 16 + 384 ) |
| 377 | |
| 378 | GFXDECODE_ENTRY( "gfx4", 0, proto_spr_layout, 0x0000, 16 + 384 ) // more sprites maybe? |
| 379 | |
| 380 | GFXDECODE_END |
| 381 | |
| 382 | |
| 337 | 383 | static void irqhandler(device_t *device, int linestate) |
| 338 | 384 | { |
| 339 | 385 | device->machine().device("audiocpu")->execute().set_input_line(0, linestate); |
| r20473 | r20474 | |
| 377 | 423 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 378 | 424 | MACHINE_CONFIG_END |
| 379 | 425 | |
| 426 | |
| 427 | static MACHINE_CONFIG_START( spbactnp, spbactn_state ) |
| 428 | |
| 429 | /* basic machine hardware */ |
| 430 | MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) |
| 431 | MCFG_CPU_PROGRAM_MAP(spbactnp_map) |
| 432 | MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, irq3_line_hold) |
| 433 | |
| 434 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz) |
| 435 | MCFG_CPU_PROGRAM_MAP(spbactn_sound_map) // wrong |
| 436 | |
| 437 | // there is a rom for another Z80?? |
| 438 | |
| 439 | /* video hardware */ |
| 440 | MCFG_SCREEN_ADD("screen", RASTER) |
| 441 | MCFG_SCREEN_REFRESH_RATE(60) |
| 442 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 443 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 444 | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) |
| 445 | MCFG_SCREEN_UPDATE_DRIVER(spbactn_state, screen_update_spbactnp) |
| 446 | |
| 447 | MCFG_GFXDECODE(spbactnp) |
| 448 | MCFG_PALETTE_LENGTH(0x2800/2) |
| 449 | |
| 450 | |
| 451 | /* sound hardware - different? */ |
| 452 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 453 | |
| 454 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) |
| 455 | MCFG_SOUND_CONFIG(ym3812_config) |
| 456 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 457 | |
| 458 | MCFG_OKIM6295_ADD("oki", XTAL_4MHz/4, OKIM6295_PIN7_HIGH) |
| 459 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 460 | MACHINE_CONFIG_END |
| 461 | |
| 462 | |
| 380 | 463 | ROM_START( spbactn ) |
| 381 | 464 | /* Board 9002-A (CPU Board) */ |
| 382 | 465 | ROM_REGION( 0x40000, "maincpu", 0 ) |
| r20473 | r20474 | |
| 429 | 512 | ROM_LOAD( "b-u111", 0x40000, 0x40000, CRC(1cc1379a) SHA1(44fdab8cb5ab1488688f1ac52f005454e835efee) ) |
| 430 | 513 | ROM_END |
| 431 | 514 | |
| 515 | |
| 516 | ROM_START( spbactnp ) |
| 517 | ROM_REGION( 0x40000, "maincpu", 0 ) |
| 518 | ROM_LOAD16_BYTE( "spa.18k", 0x00000, 0x10000, CRC(40f6a1e6) SHA1(533e1eb96f54b976f50d5b8927160b46b2740c83) ) |
| 519 | ROM_LOAD16_BYTE( "spa.22k", 0x00001, 0x10000, CRC(ce31871e) SHA1(8670c051d775fee6dcd2aa82cdb6f3fcc4338bd5) ) |
| 520 | ROM_LOAD16_BYTE( "spa.17k", 0x20000, 0x10000, CRC(c9860ae9) SHA1(3c2479be75ee84165470e9ca0a9d3b2ce679703d) ) |
| 521 | ROM_LOAD16_BYTE( "spa.21k", 0x20001, 0x10000, CRC(8226f644) SHA1(2d3e32368fbfec7437bd972096fd92972f52f6b0) ) |
| 522 | |
| 523 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 524 | ROM_LOAD( "6204_6-6.29c", 0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) ) |
| 525 | |
| 526 | |
| 527 | ROM_REGION( 0x40000, "oki", 0 ) |
| 528 | ROM_LOAD( "spa_data_2-21-a10.8e", 0x00000, 0x20000, CRC(87427d7d) SHA1(f76b0dc3f0d87deb0f0c81084aff9756b236e867) ) // same as regular |
| 529 | |
| 530 | ROM_REGION( 0x080000, "gfx1", 0 ) /* 16x8 FG Tiles */ |
| 531 | ROM_LOAD16_BYTE( "spa_back0_split0_5-17-p-1.27b", 0x00000, 0x20000, CRC(37922110) SHA1(8edb6745ab6b6937f1365d35bfcdbe86198de668) ) |
| 532 | ROM_LOAD16_BYTE( "spa_back0_split1_5-17-p-1.27c", 0x00001, 0x20000, CRC(9d6ef9ab) SHA1(338ff1bd9d30a61d782616cccb4108daac6a8612) ) |
| 533 | |
| 534 | ROM_REGION( 0x080000, "gfx2", 0 ) /* 16x8 BG Tiles */ // it only ever draws the background from the rocket level, for all levels?? |
| 535 | ROM_LOAD16_BYTE( "spa_back1_split0_3-14-a-11.26b", 0x00000, 0x20000, CRC(6953fd62) SHA1(fb6061f5ad48e0d91d3dad96afbac2d64908f0a7) ) |
| 536 | ROM_LOAD16_BYTE( "spa_back1_split1_3-14-a-11.26c", 0x00001, 0x20000, CRC(b4123511) SHA1(c65b912238bab74bf46b5d5486c1d998813ef511) ) |
| 537 | |
| 538 | ROM_REGION( 0x040000, "gfx3", 0 ) /* 8x8 Sprite Tiles */ |
| 539 | ROM_LOAD( "spa_sp0_4-18-p-8.5m", 0x00000, 0x20000, CRC(cd6ba360) SHA1(a01f65a678b6987ae877c381f74515efee4b492e) ) |
| 540 | ROM_LOAD( "spa_sp1_3-14-a-10.4m", 0x20000, 0x20000, CRC(86406336) SHA1(bf091dc13404535e6baee990f5e957d3538841ac) ) |
| 541 | |
| 542 | |
| 543 | |
| 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 | |
| 547 | ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation?? |
| 548 | ROM_LOAD( "spa.25c", 0x00000, 0x20000, CRC(02b69ab9) SHA1(368e774693a6fab756faaeec4ffd42406816e6e2) ) |
| 549 | |
| 550 | 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) ) |
| 553 | ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) ) |
| 554 | ROM_END |
| 555 | |
| 432 | 556 | GAME( 1991, spbactn, 0, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS ) |
| 433 | 557 | GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 558 | GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING ) // early proto, (c) date is 2 years earlier! |
trunk/src/mame/video/spbactn.c
| r20473 | r20474 | |
| 1 | | /* video/spbactn.c - see drivers/spbactn.c for more info */ |
| 2 | | /* rather similar to galspnbl.c */ |
| 3 | 1 | |
| 4 | 2 | #include "emu.h" |
| 5 | 3 | #include "includes/spbactn.h" |
| r20473 | r20474 | |
| 35 | 33 | |
| 36 | 34 | |
| 37 | 35 | /* from gals pinball (which was in turn from ninja gaiden) */ |
| 38 | | static int draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) |
| 36 | static int draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, bool alt_sprites) |
| 39 | 37 | { |
| 40 | 38 | static const UINT8 layout[8][8] = |
| 41 | 39 | { |
| r20473 | r20474 | |
| 59 | 57 | int col, row; |
| 60 | 58 | |
| 61 | 59 | attr = state->m_spvideoram[offs]; |
| 60 | |
| 61 | int pri = (state->m_spvideoram[offs] & 0x0030); |
| 62 | // int pri = (state->m_spvideoram[offs+2] & 0x0030); |
| 63 | |
| 64 | |
| 62 | 65 | if ((attr & 0x0004) && |
| 63 | | ((attr & 0x0030) >> 4) == priority) |
| 66 | ((pri & 0x0030) >> 4) == priority) |
| 64 | 67 | { |
| 65 | 68 | flipx = attr & 0x0001; |
| 66 | 69 | flipy = attr & 0x0002; |
| 67 | 70 | |
| 68 | 71 | code = state->m_spvideoram[offs + 1]; |
| 69 | 72 | |
| 70 | | color = state->m_spvideoram[offs + 2]; |
| 71 | | size = 1 << (color & 0x0003); /* 1,2,4,8 */ |
| 73 | if (alt_sprites) |
| 74 | { |
| 75 | color = state->m_spvideoram[offs + 0]; |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | color = state->m_spvideoram[offs + 2]; |
| 80 | } |
| 81 | |
| 82 | size = 1 << (state->m_spvideoram[offs + 2] & 0x0003); /* 1,2,4,8 */ |
| 72 | 83 | color = (color & 0x00f0) >> 4; |
| 73 | 84 | |
| 74 | 85 | sx = state->m_spvideoram[offs + 4]; |
| r20473 | r20474 | |
| 113 | 124 | machine().primary_screen->register_screen_bitmap(m_tile_bitmap_fg); |
| 114 | 125 | } |
| 115 | 126 | |
| 116 | | UINT32 spbactn_state::screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 127 | int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites) |
| 117 | 128 | { |
| 118 | 129 | int offs, sx, sy; |
| 119 | 130 | |
| r20473 | r20474 | |
| 144 | 155 | } |
| 145 | 156 | } |
| 146 | 157 | |
| 147 | | if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0)) |
| 158 | if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0, alt_sprites)) |
| 148 | 159 | { |
| 149 | 160 | /* kludge: draw table bg gfx again if priority 0 sprites are enabled */ |
| 150 | 161 | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| r20473 | r20474 | |
| 172 | 183 | } |
| 173 | 184 | } |
| 174 | 185 | |
| 175 | | draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1); |
| 186 | draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1, alt_sprites); |
| 176 | 187 | |
| 177 | 188 | /* draw table fg gfx */ |
| 178 | 189 | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| r20473 | r20474 | |
| 205 | 216 | } |
| 206 | 217 | } |
| 207 | 218 | |
| 208 | | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 2); |
| 209 | | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 3); |
| 219 | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 2, alt_sprites); |
| 220 | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 3, alt_sprites); |
| 210 | 221 | |
| 211 | 222 | /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ |
| 212 | 223 | blendbitmaps(machine(), bitmap, m_tile_bitmap_bg, m_tile_bitmap_fg, cliprect); |
| 213 | 224 | return 0; |
| 214 | 225 | } |
| 226 | |
| 227 | UINT32 spbactn_state::screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 228 | { |
| 229 | return draw_video(screen,bitmap,cliprect,false); |
| 230 | } |
| 231 | |
| 232 | UINT32 spbactn_state::screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 233 | { |
| 234 | return draw_video(screen,bitmap,cliprect,true); |
| 235 | } |