trunk/src/mame/drivers/mario.c
r32737 | r32738 | |
92 | 92 | #include "emu.h" |
93 | 93 | #include "cpu/z80/z80.h" |
94 | 94 | #include "machine/z80dma.h" |
| 95 | #include "sound/ay8910.h" |
95 | 96 | |
96 | 97 | #include "includes/mario.h" |
97 | 98 | |
r32737 | r32738 | |
129 | 130 | * |
130 | 131 | *************************************/ |
131 | 132 | |
132 | | static ADDRESS_MAP_START( mario_map, AS_PROGRAM, 8, mario_state ) |
| 133 | static ADDRESS_MAP_START( mario_map, AS_PROGRAM, 8, mario_state) |
133 | 134 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
134 | 135 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
135 | 136 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ |
r32737 | r32738 | |
148 | 149 | AM_RANGE(0xf000, 0xffff) AM_ROM |
149 | 150 | ADDRESS_MAP_END |
150 | 151 | |
151 | | static ADDRESS_MAP_START( masao_map, AS_PROGRAM, 8, mario_state ) |
| 152 | static ADDRESS_MAP_START( masao_map, AS_PROGRAM, 8, mario_state) |
152 | 153 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
153 | 154 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
154 | 155 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ |
r32737 | r32738 | |
167 | 168 | AM_RANGE(0xf000, 0xffff) AM_ROM |
168 | 169 | ADDRESS_MAP_END |
169 | 170 | |
170 | | static ADDRESS_MAP_START( mario_io_map, AS_IO, 8, mario_state ) |
| 171 | static ADDRESS_MAP_START( mario_io_map, AS_IO, 8, mario_state) |
171 | 172 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
172 | 173 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("z80dma", z80dma_device, read, write) /* dma controller */ |
173 | 174 | ADDRESS_MAP_END |
174 | 175 | |
| 176 | |
| 177 | static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state) |
| 178 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 179 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 180 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ |
| 181 | AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram") |
| 182 | //AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1") |
| 183 | AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") /* DSW */ |
| 184 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 185 | ADDRESS_MAP_END |
| 186 | |
| 187 | static ADDRESS_MAP_START( mariobl_io_map, AS_IO, 8, mario_state ) |
| 188 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 189 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_w) |
| 190 | AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay1", ay8910_device, data_w) |
| 191 | AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ay2", ay8910_device, data_r, address_w) |
| 192 | AM_RANGE(0x81, 0x81) AM_DEVWRITE("ay2", ay8910_device, data_w) |
| 193 | ADDRESS_MAP_END |
| 194 | |
| 195 | |
175 | 196 | /************************************* |
176 | 197 | * |
177 | 198 | * Port definitions |
r32737 | r32738 | |
312 | 333 | GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 32 ) |
313 | 334 | GFXDECODE_END |
314 | 335 | |
| 336 | static const gfx_layout spritelayout_bl = |
| 337 | { |
| 338 | 16,16, /* 16*16 sprites */ |
| 339 | RGN_FRAC(1,3), /* 256 sprites */ |
| 340 | 3, /* 3 bits per pixel */ |
| 341 | { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, |
| 342 | { 0, 1, 2, 3, 4, 5, 6, 7, |
| 343 | 64,65,66,67,68,69,70,71 }, |
| 344 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 345 | 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, |
| 346 | 16*16 |
| 347 | }; |
315 | 348 | |
| 349 | static GFXDECODE_START( mariobl ) |
| 350 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) |
| 351 | GFXDECODE_ENTRY( "gfx2", 0, spritelayout_bl, 0, 32 ) |
| 352 | GFXDECODE_END |
| 353 | |
316 | 354 | /************************************* |
317 | 355 | * |
318 | 356 | * Machine driver |
r32737 | r32738 | |
371 | 409 | MCFG_FRAGMENT_ADD(masao_audio) |
372 | 410 | MACHINE_CONFIG_END |
373 | 411 | |
| 412 | /* |
| 413 | Mario Bros japan bootleg on Ambush hardware |
374 | 414 | |
| 415 | This romset (japanese version) comes from a faulty bootleg pcb.Game differences are none. |
| 416 | Note:it runs on a modified (extended) Tecfri's Ambush hardware. |
| 417 | Main cpu Z80 |
| 418 | Sound ic AY-3-8910 x2 -instead of AY-3-8912 x2 of Ambush |
| 419 | Work ram 4Kb (6116 x2) -double of Ambush |
| 420 | OSC: 18,432 Mhz |
| 421 | Rom definition: |
| 422 | mbjba-6, mbjba-7, mbjba-8 main program |
| 423 | mbjba-1 to mbjba-5 gfx (chars,sprites) |
| 424 | Eproms are 2732,2764,27128 |
| 425 | |
| 426 | Dumped by tirino73 |
| 427 | */ |
| 428 | |
| 429 | static MACHINE_CONFIG_START( mariobl, mario_state ) |
| 430 | |
| 431 | MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* XTAL confirmed, divisor guessed */ |
| 432 | MCFG_CPU_PROGRAM_MAP(mariobl_map) |
| 433 | MCFG_CPU_IO_MAP(mariobl_io_map) |
| 434 | MCFG_CPU_VBLANK_INT_DRIVER("screen", mario_state, irq0_line_hold) |
| 435 | |
| 436 | /* video hardware */ |
| 437 | MCFG_SCREEN_ADD("screen", RASTER) |
| 438 | MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) |
| 439 | MCFG_SCREEN_UPDATE_DRIVER(mario_state, screen_update_mariobl) |
| 440 | MCFG_SCREEN_PALETTE("palette") |
| 441 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", mariobl) |
| 442 | MCFG_PALETTE_ADD("palette", 512) |
| 443 | MCFG_PALETTE_INIT_OWNER(mario_state, mario) |
| 444 | |
| 445 | /* sound hardware */ |
| 446 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 447 | |
| 448 | MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ |
| 449 | // MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM")) |
| 450 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
| 451 | |
| 452 | MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ |
| 453 | // MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS")) |
| 454 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
| 455 | |
| 456 | MACHINE_CONFIG_END |
| 457 | |
375 | 458 | /************************************* |
376 | 459 | * |
377 | 460 | * ROM definitions |
r32737 | r32738 | |
540 | 623 | ROM_LOAD( "tma1-c-4p.4p", 0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) ) |
541 | 624 | ROM_END |
542 | 625 | |
| 626 | ROM_START( mariobl ) |
| 627 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 628 | ROM_LOAD( "mbjba-8.7i", 0x0000, 0x4000, CRC(344c959d) SHA1(162e39c3a17e0dcde3b7eefebe224318c8884de2) ) |
| 629 | ROM_LOAD( "mbjba-7.7g", 0x4000, 0x2000, CRC(06faf308) SHA1(8c213d9390c168034c1673f3dd97b99322b3485a) ) |
| 630 | ROM_LOAD( "mbjba-6.7f", 0xe000, 0x2000, CRC(761dd670) SHA1(6d6e45ced8c535cdf56e0ed1bcedb342e9e10a55) ) |
| 631 | |
| 632 | ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT ) |
| 633 | ROM_LOAD( "mbjba-4.4l", 0x1000, 0x1000, CRC(9379e836) SHA1(fcce66c1b2c5120441840b80723c7d209d42bc45) ) |
| 634 | ROM_LOAD( "mbjba-5.4n", 0x0000, 0x1000, CRC(9bbcf9fb) SHA1(a917241a3bd94bff72f509d6b3ab8358b9c03eac) ) |
| 635 | |
| 636 | ROM_REGION( 0x6000, "gfx2", 0 ) |
| 637 | ROM_LOAD( "mbjba-1.3l", 0x4000, 0x2000, CRC(c772cb8f) SHA1(7fd6dd9888928fad5c50d96b4ecff954ea8975ce) ) |
| 638 | ROM_LOAD( "mbjba-2.3ls", 0x2000, 0x2000, CRC(7b58c92e) SHA1(25dfce7a4a93f661f495cc80378d445a2b064ba7) ) |
| 639 | ROM_LOAD( "mbjba-3.3ns", 0x0000, 0x2000, CRC(3981adb2) SHA1(c12a0c2ae04de6969f4b2dae3bdefc4515d87c55) ) |
| 640 | |
| 641 | ROM_REGION( 0x0200, "proms", 0 ) // no prom was present in the dump, assuming to be the same |
| 642 | ROM_LOAD( "tma1-c-4p.4p", 0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) ) |
| 643 | ROM_END |
| 644 | |
543 | 645 | /************************************* |
544 | 646 | * |
545 | 647 | * Game drivers |
r32737 | r32738 | |
551 | 653 | GAME( 1983, marioo, mario, mario, marioo, driver_device, 0, ROT0, "Nintendo of America", "Mario Bros. (US, Unknown Rev)", GAME_SUPPORTS_SAVE ) |
552 | 654 | GAME( 1983, marioj, mario, mario, marioj, driver_device, 0, ROT0, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE ) |
553 | 655 | GAME( 1983, masao, mario, masao, masao, driver_device, 0, ROT0, "bootleg", "Masao", GAME_SUPPORTS_SAVE ) |
| 656 | GAME( 1983, mariobl, mario, mariobl, marioj, driver_device, 0, ROT180, "bootleg", "Mario Bros. (Japan, bootleg)", GAME_SUPPORTS_SAVE ) // was listed as 'on extended Ambush hardware' but doesn't seem similar apart from the sound system? |