Previous 199869 Revisions Next

r18254 Wednesday 3rd October, 2012 at 03:00:41 UTC by Angelo Salese
Added irq ack to Shanghai 3 HW [Angelo Salese]

Fixed M68K and hooked up SCREEN_RAW_PARAMS for Blocken. Game was definitely running at erratic speeds before [Angelo Salese, Tafoid]
[src/mame/drivers]shangha3.c
[src/mame/includes]shangha3.h

trunk/src/mame/includes/shangha3.h
r18253r18254
2424   DECLARE_WRITE16_MEMBER(shangha3_flipscreen_w);
2525   DECLARE_WRITE16_MEMBER(shangha3_gfxlist_addr_w);
2626   DECLARE_WRITE16_MEMBER(shangha3_blitter_go_w);
27   DECLARE_WRITE16_MEMBER(shangha3_irq_ack_w);
2728   DECLARE_DRIVER_INIT(shangha3);
2829   DECLARE_DRIVER_INIT(heberpop);
2930   virtual void video_start();
trunk/src/mame/drivers/shangha3.c
r18253r18254
99driver by Nicola Salmoria
1010
1111TODO:
12all games:
13- Blitter needs to be device-ized
1214shangha3:
1315- The zoom used for the "100" floating score when you remove tiles is very
1416  rough.
r18253r18254
1618- Unknown writes to sound ports 40/41
1719blocken:
1820- 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.
1925
2026***************************************************************************/
2127
r18253r18254
5056
5157   return result[m_prot_count++ % 9];
5258}
59
5360WRITE16_MEMBER(shangha3_state::shangha3_prot_w)
5461{
5562   logerror("PC %04x: write %02x to 20004e\n",space.device().safe_pc(),data);
r18253r18254
114121   }
115122}
116123
124WRITE16_MEMBER(shangha3_state::shangha3_irq_ack_w)
125{
126   machine().device("maincpu")->execute().set_input_line(4, CLEAR_LINE);
127}
117128
118
119129static ADDRESS_MAP_START( shangha3_map, AS_PROGRAM, 16, shangha3_state )
120130   AM_RANGE(0x000000, 0x07ffff) AM_ROM
121131   AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram_RRRRRGGGGGBBBBBx_word_w) AM_SHARE("paletteram")
122132   AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS")
123133   AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
124134   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)
126136   AM_RANGE(0x20000c, 0x20000d) AM_WRITE(shangha3_coinctrl_w)
127137   AM_RANGE(0x20001e, 0x20001f) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff)
128138   AM_RANGE(0x20002e, 0x20002f) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_w, 0x00ff)
r18253r18254
141151   AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
142152   AM_RANGE(0x200004, 0x200005) AM_READ_PORT("DSW")
143153   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)
145155   AM_RANGE(0x20000c, 0x20000d) AM_WRITE(heberpop_coinctrl_w)
146156   AM_RANGE(0x20000e, 0x20000f) AM_WRITE(heberpop_sound_command_w)
147157   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("ram")   /* gfx & work ram */
r18253r18254
153163static ADDRESS_MAP_START( blocken_map, AS_PROGRAM, 16, shangha3_state )
154164   AM_RANGE(0x000000, 0x0fffff) AM_ROM
155165   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
157167   AM_RANGE(0x100004, 0x100005) AM_READ_PORT("DSW")
158168   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?)
160170   AM_RANGE(0x10000c, 0x10000d) AM_WRITE(blocken_coinctrl_w)
161171   AM_RANGE(0x10000e, 0x10000f) AM_WRITE(heberpop_sound_command_w)
162172   AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram_RRRRRGGGGGBBBBBx_word_w) AM_SHARE("paletteram")
r18253r18254
471481   /* basic machine hardware */
472482   MCFG_CPU_ADD("maincpu", M68000, 8000000)
473483   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)
475485
476486   /* video hardware */
477487   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
r18253r18254
504514   /* basic machine hardware */
505515   MCFG_CPU_ADD("maincpu", M68000, 8000000)
506516   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)
508518
509519   MCFG_CPU_ADD("audiocpu", Z80, 6000000)   /* 6 MHz ??? */
510520   MCFG_CPU_PROGRAM_MAP(heberpop_sound_map)
r18253r18254
536546   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
537547MACHINE_CONFIG_END
538548
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
539551
540552static MACHINE_CONFIG_START( blocken, shangha3_state )
541553
542554   /* basic machine hardware */
543   MCFG_CPU_ADD("maincpu", M68000, 8000000)
555   MCFG_CPU_ADD("maincpu", M68000, BLOCKEN_MASTER_CLOCK/4) // TMP68HC000N-16
544556   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)
546558
547   MCFG_CPU_ADD("audiocpu", Z80, 6000000)   /* 6 MHz ??? */
559   MCFG_CPU_ADD("audiocpu", Z80, BLOCKEN_MASTER_CLOCK/8)   /* 6 MHz? */
548560   MCFG_CPU_PROGRAM_MAP(heberpop_sound_map)
549561   MCFG_CPU_IO_MAP(heberpop_sound_io_map)   /* NMI triggered by YM3438 */
550562
r18253r18254
552564   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
553565
554566   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
559573   MCFG_SCREEN_UPDATE_DRIVER(shangha3_state, screen_update_shangha3)
560574
561575   MCFG_GFXDECODE(shangha3)
r18253r18254
565579   /* sound hardware */
566580   MCFG_SPEAKER_STANDARD_MONO("mono")
567581
568   MCFG_SOUND_ADD("ymsnd", YM3438, 8000000)
582   MCFG_SOUND_ADD("ymsnd", YM3438, BLOCKEN_MASTER_CLOCK/6) /* 8 MHz? */
569583   MCFG_SOUND_CONFIG(ym3438_config)
570584   MCFG_SOUND_ROUTE(0, "mono", 0.40)
571585   MCFG_SOUND_ROUTE(1, "mono", 0.40)
r18253r18254
616630ROM_END
617631
618632ROM_START( blocken )
619   ROM_REGION( 0x100000, "maincpu", 0 )
633   ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF )
620634   ROM_LOAD16_BYTE( "ic31j.bin",    0x0000, 0x20000, CRC(ec8de2a3) SHA1(09a6b8c1b656b17ab3d1fc057902487e4f94cf02) )
621635   ROM_LOAD16_BYTE( "ic32j.bin",    0x0001, 0x20000, CRC(79b96240) SHA1(c1246bd4b91fa45c581a8fdf90cc6beb85adf8ec) )
622636
r18253r18254
650664
651665DRIVER_INIT_MEMBER(shangha3_state,shangha3)
652666{
653
654667   m_do_shadows = 1;
655668}
656669
657670DRIVER_INIT_MEMBER(shangha3_state,heberpop)
658671{
659
660672   m_do_shadows = 0;
661673}
662674
663675GAME( 1993, shangha3, 0, shangha3, shangha3, shangha3_state, shangha3, ROT0, "Sunsoft", "Shanghai III (Japan)", 0 )
664676GAME( 1994, heberpop, 0, heberpop, heberpop, shangha3_state, heberpop, ROT0, "Sunsoft / Atlus", "Hebereke no Popoon (Japan)", 0 )
665GAME( 1994, blocken,  0, blocken,  blocken, shangha3_state,  heberpop, ROT0, "KID / Visco", "Blocken (Japan)", 0 )
677GAME( 1994, blocken,  0, blocken,  blocken, shangha3_state,  heberpop, ROT0, "KID / Visco", "Blocken (Japan)", GAME_IMPERFECT_GRAPHICS )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team