trunk/src/mame/drivers/shangha3.c
r18253 | r18254 | |
9 | 9 | driver by Nicola Salmoria |
10 | 10 | |
11 | 11 | TODO: |
| 12 | all games: |
| 13 | - Blitter needs to be device-ized |
12 | 14 | shangha3: |
13 | 15 | - The zoom used for the "100" floating score when you remove tiles is very |
14 | 16 | rough. |
r18253 | r18254 | |
16 | 18 | - Unknown writes to sound ports 40/41 |
17 | 19 | blocken: |
18 | 20 | - incomplete zoom support, and missing rotation support. |
| 21 | - attract mode tries to read at 0x80000-0xfffff area, returning 0 in there |
| 22 | freezes the demo play for some frames (MT #00985). For now I've returned $ff, |
| 23 | but needs HW tests to check out what lies in there (maybe a ROM mirror). |
| 24 | - how to play screen is bogus, it basically doesn't follow the ball at all. |
19 | 25 | |
20 | 26 | ***************************************************************************/ |
21 | 27 | |
r18253 | r18254 | |
50 | 56 | |
51 | 57 | return result[m_prot_count++ % 9]; |
52 | 58 | } |
| 59 | |
53 | 60 | WRITE16_MEMBER(shangha3_state::shangha3_prot_w) |
54 | 61 | { |
55 | 62 | logerror("PC %04x: write %02x to 20004e\n",space.device().safe_pc(),data); |
r18253 | r18254 | |
114 | 121 | } |
115 | 122 | } |
116 | 123 | |
| 124 | WRITE16_MEMBER(shangha3_state::shangha3_irq_ack_w) |
| 125 | { |
| 126 | machine().device("maincpu")->execute().set_input_line(4, CLEAR_LINE); |
| 127 | } |
117 | 128 | |
118 | | |
119 | 129 | static ADDRESS_MAP_START( shangha3_map, AS_PROGRAM, 16, shangha3_state ) |
120 | 130 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
121 | 131 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram_RRRRRGGGGGBBBBBx_word_w) AM_SHARE("paletteram") |
122 | 132 | AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS") |
123 | 133 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
124 | 134 | AM_RANGE(0x200008, 0x200009) AM_WRITE(shangha3_blitter_go_w) |
125 | | AM_RANGE(0x20000a, 0x20000b) AM_WRITENOP /* irq ack? */ |
| 135 | AM_RANGE(0x20000a, 0x20000b) AM_WRITE(shangha3_irq_ack_w) |
126 | 136 | AM_RANGE(0x20000c, 0x20000d) AM_WRITE(shangha3_coinctrl_w) |
127 | 137 | AM_RANGE(0x20001e, 0x20001f) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff) |
128 | 138 | AM_RANGE(0x20002e, 0x20002f) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w, 0x00ff) |
r18253 | r18254 | |
141 | 151 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
142 | 152 | AM_RANGE(0x200004, 0x200005) AM_READ_PORT("DSW") |
143 | 153 | AM_RANGE(0x200008, 0x200009) AM_WRITE(shangha3_blitter_go_w) |
144 | | AM_RANGE(0x20000a, 0x20000b) AM_WRITENOP /* irq ack? */ |
| 154 | AM_RANGE(0x20000a, 0x20000b) AM_WRITE(shangha3_irq_ack_w) |
145 | 155 | AM_RANGE(0x20000c, 0x20000d) AM_WRITE(heberpop_coinctrl_w) |
146 | 156 | AM_RANGE(0x20000e, 0x20000f) AM_WRITE(heberpop_sound_command_w) |
147 | 157 | AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("ram") /* gfx & work ram */ |
r18253 | r18254 | |
153 | 163 | static ADDRESS_MAP_START( blocken_map, AS_PROGRAM, 16, shangha3_state ) |
154 | 164 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
155 | 165 | AM_RANGE(0x100000, 0x100001) AM_READ_PORT("INPUTS") |
156 | | AM_RANGE(0x100002, 0x100003) AM_READ_PORT("SYSTEM") |
| 166 | AM_RANGE(0x100002, 0x100003) AM_READ_PORT("SYSTEM") AM_WRITENOP // w -> unknown purpose |
157 | 167 | AM_RANGE(0x100004, 0x100005) AM_READ_PORT("DSW") |
158 | 168 | AM_RANGE(0x100008, 0x100009) AM_WRITE(shangha3_blitter_go_w) |
159 | | AM_RANGE(0x10000a, 0x10000b) AM_WRITENOP /* irq ack? */ |
| 169 | AM_RANGE(0x10000a, 0x10000b) AM_READNOP AM_WRITE(shangha3_irq_ack_w) // r -> unknown purpose (value doesn't matter, left-over?) |
160 | 170 | AM_RANGE(0x10000c, 0x10000d) AM_WRITE(blocken_coinctrl_w) |
161 | 171 | AM_RANGE(0x10000e, 0x10000f) AM_WRITE(heberpop_sound_command_w) |
162 | 172 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram_RRRRRGGGGGBBBBBx_word_w) AM_SHARE("paletteram") |
r18253 | r18254 | |
471 | 481 | /* basic machine hardware */ |
472 | 482 | MCFG_CPU_ADD("maincpu", M68000, 8000000) |
473 | 483 | MCFG_CPU_PROGRAM_MAP(shangha3_map) |
474 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_hold) |
| 484 | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) |
475 | 485 | |
476 | 486 | /* video hardware */ |
477 | 487 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
r18253 | r18254 | |
504 | 514 | /* basic machine hardware */ |
505 | 515 | MCFG_CPU_ADD("maincpu", M68000, 8000000) |
506 | 516 | MCFG_CPU_PROGRAM_MAP(heberpop_map) |
507 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_hold) |
| 517 | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) |
508 | 518 | |
509 | 519 | MCFG_CPU_ADD("audiocpu", Z80, 6000000) /* 6 MHz ??? */ |
510 | 520 | MCFG_CPU_PROGRAM_MAP(heberpop_sound_map) |
r18253 | r18254 | |
536 | 546 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
537 | 547 | MACHINE_CONFIG_END |
538 | 548 | |
| 549 | /* a Blocken PCB shot barely shows a 48 MHz xtal, game is definitely too slow at 8 MHz (noticeable thru colour cycling effects) */ |
| 550 | #define BLOCKEN_MASTER_CLOCK XTAL_48MHz |
539 | 551 | |
540 | 552 | static MACHINE_CONFIG_START( blocken, shangha3_state ) |
541 | 553 | |
542 | 554 | /* basic machine hardware */ |
543 | | MCFG_CPU_ADD("maincpu", M68000, 8000000) |
| 555 | MCFG_CPU_ADD("maincpu", M68000, BLOCKEN_MASTER_CLOCK/4) // TMP68HC000N-16 |
544 | 556 | MCFG_CPU_PROGRAM_MAP(blocken_map) |
545 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_hold) |
| 557 | MCFG_CPU_VBLANK_INT_DRIVER("screen", shangha3_state, irq4_line_assert) |
546 | 558 | |
547 | | MCFG_CPU_ADD("audiocpu", Z80, 6000000) /* 6 MHz ??? */ |
| 559 | MCFG_CPU_ADD("audiocpu", Z80, BLOCKEN_MASTER_CLOCK/8) /* 6 MHz? */ |
548 | 560 | MCFG_CPU_PROGRAM_MAP(heberpop_sound_map) |
549 | 561 | MCFG_CPU_IO_MAP(heberpop_sound_io_map) /* NMI triggered by YM3438 */ |
550 | 562 | |
r18253 | r18254 | |
552 | 564 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS) |
553 | 565 | |
554 | 566 | MCFG_SCREEN_ADD("screen", RASTER) |
555 | | MCFG_SCREEN_REFRESH_RATE(60) |
556 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
557 | | MCFG_SCREEN_SIZE(24*16, 16*16) |
558 | | MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1) |
| 567 | // MCFG_SCREEN_REFRESH_RATE(60) |
| 568 | // MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 569 | // MCFG_SCREEN_SIZE(24*16, 16*16) |
| 570 | // MCFG_SCREEN_VISIBLE_AREA(0*16, 24*16-1, 1*16, 15*16-1) |
| 571 | MCFG_SCREEN_RAW_PARAMS(BLOCKEN_MASTER_CLOCK/6,512,0,24*16,263,1*16,15*16) /* refresh rate is unknown */ |
| 572 | |
559 | 573 | MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update_shangha3) |
560 | 574 | |
561 | 575 | MCFG_GFXDECODE(shangha3) |
r18253 | r18254 | |
565 | 579 | /* sound hardware */ |
566 | 580 | MCFG_SPEAKER_STANDARD_MONO("mono") |
567 | 581 | |
568 | | MCFG_SOUND_ADD("ymsnd", YM3438, 8000000) |
| 582 | MCFG_SOUND_ADD("ymsnd", YM3438, BLOCKEN_MASTER_CLOCK/6) /* 8 MHz? */ |
569 | 583 | MCFG_SOUND_CONFIG(ym3438_config) |
570 | 584 | MCFG_SOUND_ROUTE(0, "mono", 0.40) |
571 | 585 | MCFG_SOUND_ROUTE(1, "mono", 0.40) |
r18253 | r18254 | |
616 | 630 | ROM_END |
617 | 631 | |
618 | 632 | ROM_START( blocken ) |
619 | | ROM_REGION( 0x100000, "maincpu", 0 ) |
| 633 | ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) |
620 | 634 | ROM_LOAD16_BYTE( "ic31j.bin", 0x0000, 0x20000, CRC(ec8de2a3) SHA1(09a6b8c1b656b17ab3d1fc057902487e4f94cf02) ) |
621 | 635 | ROM_LOAD16_BYTE( "ic32j.bin", 0x0001, 0x20000, CRC(79b96240) SHA1(c1246bd4b91fa45c581a8fdf90cc6beb85adf8ec) ) |
622 | 636 | |
r18253 | r18254 | |
650 | 664 | |
651 | 665 | DRIVER_INIT_MEMBER(shangha3_state,shangha3) |
652 | 666 | { |
653 | | |
654 | 667 | m_do_shadows = 1; |
655 | 668 | } |
656 | 669 | |
657 | 670 | DRIVER_INIT_MEMBER(shangha3_state,heberpop) |
658 | 671 | { |
659 | | |
660 | 672 | m_do_shadows = 0; |
661 | 673 | } |
662 | 674 | |
663 | 675 | GAME( 1993, shangha3, 0, shangha3, shangha3, shangha3_state, shangha3, ROT0, "Sunsoft", "Shanghai III (Japan)", 0 ) |
664 | 676 | GAME( 1994, heberpop, 0, heberpop, heberpop, shangha3_state, heberpop, ROT0, "Sunsoft / Atlus", "Hebereke no Popoon (Japan)", 0 ) |
665 | | GAME( 1994, blocken, 0, blocken, blocken, shangha3_state, heberpop, ROT0, "KID / Visco", "Blocken (Japan)", 0 ) |
| 677 | GAME( 1994, blocken, 0, blocken, blocken, shangha3_state, heberpop, ROT0, "KID / Visco", "Blocken (Japan)", GAME_IMPERFECT_GRAPHICS ) |