diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 16882e66e74..f8891d3bf4f 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -541,6 +541,25 @@ ADDRESS_MAP_START( seibu2_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1) ADDRESS_MAP_END +ADDRESS_MAP_START( seibu2_raiden2_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x1fff) AM_ROM + AM_RANGE(0x2000, 0x27ff) AM_RAM + AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w) + AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w) + AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w) + AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w) + AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w) + AM_RANGE(0x4008, 0x4008) AM_WRITE(YM2151_register_port_0_w) + AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w) + AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r) + AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r) + AM_RANGE(0x4013, 0x4013) AM_READ_PORT("COIN") + AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w) + AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w) + AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w) + AM_RANGE(0x6002, 0x6002) AM_READWRITE(OKIM6295_status_1_r, OKIM6295_data_1_w) + AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1) +ADDRESS_MAP_END ADDRESS_MAP_START( seibu3_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h index 2c5b306b6ed..d6f14f3dbc5 100644 --- a/src/mame/audio/seibu.h +++ b/src/mame/audio/seibu.h @@ -31,6 +31,7 @@ ADDRESS_MAP_EXTERN(seibu_sound_map, 8); ADDRESS_MAP_EXTERN(seibu2_sound_map, 8); +ADDRESS_MAP_EXTERN(seibu2_raiden2_sound_map, 8); ADDRESS_MAP_EXTERN(seibu3_sound_map, 8); ADDRESS_MAP_EXTERN(seibu3_adpcm_sound_map, 8); @@ -83,6 +84,10 @@ extern const struct YM2203interface seibu_ym2203_interface; MDRV_CPU_ADD(Z80, freq) \ MDRV_CPU_PROGRAM_MAP(seibu2_sound_map,0) \ +#define SEIBU2_RAIDEN2_SOUND_SYSTEM_CPU(freq) \ + MDRV_CPU_ADD(Z80, freq) \ + MDRV_CPU_PROGRAM_MAP(seibu2_raiden2_sound_map,0) \ + #define SEIBU3_SOUND_SYSTEM_CPU(freq) \ MDRV_CPU_ADD(Z80, freq) \ MDRV_CPU_PROGRAM_MAP(seibu3_sound_map,0) \ @@ -125,6 +130,24 @@ extern const struct YM2203interface seibu_ym2203_interface; MDRV_SOUND_CONFIG(okim6295_interface_region_##region##_pin7low) \ MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ + +#define SEIBU_SOUND_SYSTEM_YM2151_RAIDEN2_INTERFACE(freq1,freq2,regiona, regionb) \ + MDRV_SPEAKER_STANDARD_MONO("mono") \ + \ + MDRV_SOUND_ADD(YM2151, freq1) \ + MDRV_SOUND_CONFIG(seibu_ym2151_interface) \ + MDRV_SOUND_ROUTE(0, "mono", 0.50) \ + MDRV_SOUND_ROUTE(1, "mono", 0.50) \ + \ + MDRV_SOUND_ADD(OKIM6295, freq2) \ + MDRV_SOUND_CONFIG(okim6295_interface_region_##regiona##_pin7high) \ + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ + \ + MDRV_SOUND_ADD(OKIM6295, freq2) \ + MDRV_SOUND_CONFIG(okim6295_interface_region_##regionb##_pin7high) \ + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) \ + + #define SEIBU_SOUND_SYSTEM_YM2203_INTERFACE(freq) \ MDRV_SPEAKER_STANDARD_MONO("mono") \ \ diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index fd1139b9c57..26b7e2036c8 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -766,6 +766,8 @@ ADDRESS_MAP_END /* INPUT PORTS */ static INPUT_PORTS_START( raiden2 ) + SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ + PORT_START /* IN0 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -839,11 +841,13 @@ static INPUT_PORTS_START( raiden2 ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( raidendx ) + SEIBU_COIN_INPUTS /* coin inputs read through sound cpu */ + PORT_START /* IN0 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -917,6 +921,9 @@ static INPUT_PORTS_START( raidendx ) PORT_START /* START BUTTONS */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -984,6 +991,10 @@ static MACHINE_DRIVER_START( raiden2 ) MDRV_MACHINE_RESET(raiden2) + SEIBU2_RAIDEN2_SOUND_SYSTEM_CPU(14318180/4) + + MDRV_MACHINE_RESET(seibu_sound_1) + /* video hardware */ MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) @@ -1004,6 +1015,10 @@ static MACHINE_DRIVER_START( raiden2 ) MDRV_VIDEO_START(raiden2) MDRV_VIDEO_UPDATE(raiden2) + /* sound hardware */ + SEIBU_SOUND_SYSTEM_YM2151_RAIDEN2_INTERFACE(28636360/8,28636360/28,1,2) + + /* Sound hardware infos: Z80 and YM2151 are clocked at XTAL_28_63636MHz/8 */ /* The 2 Oki M6295 are clocked at XTAL_28_63636MHz/28 and pin 7 is high for both */ @@ -1043,7 +1058,10 @@ ROM_START( raiden2 ) ROM_RELOAD(0x100001, 0x80000) ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "snd", 0x000000, 0x10000, CRC(f51a28f9) SHA1(7ae2e2ba0c8159a544a8fd2bb0c2c694ba849302) ) + ROM_LOAD( "snd", 0x000000, 0x08000, CRC(f51a28f9) SHA1(7ae2e2ba0c8159a544a8fd2bb0c2c694ba849302) ) + ROM_CONTINUE(0x10000,0x8000) + ROM_COPY( REGION_CPU2, 0, 0x018000, 0x08000 ) + ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) /* chars */ ROM_LOAD( "px0", 0x000000, 0x020000, CRC(c9ec9469) SHA1(a29f480a1bee073be7a177096ef58e1887a5af24) ) @@ -1058,9 +1076,11 @@ ROM_START( raiden2 ) ROM_LOAD32_WORD( "obj3", 0x400000, 0x200000, CRC(897a0322) SHA1(abb2737a2446da5b364fc2d96524b43d808f4126) ) ROM_LOAD32_WORD( "obj4", 0x400002, 0x200000, CRC(b676e188) SHA1(19cc838f1ccf9c4203cd0e5365e5d99ff3a4ff0f) ) - ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ + ROM_REGION( 0x080000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "voi1", 0x00000, 0x80000, CRC(f340457b) SHA1(8169acb24c82f68d223a31af38ee36eb6cb3adf4) ) - ROM_LOAD( "voi2", 0x80000, 0x80000, CRC(d321ff54) SHA1(b61e602525f36eb28a1408ffb124abfbb6a08706) ) + + ROM_REGION( 0x080000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "voi2", 0x00000, 0x80000, CRC(d321ff54) SHA1(b61e602525f36eb28a1408ffb124abfbb6a08706) ) ROM_END /* @@ -1112,6 +1132,8 @@ ROM_START( raiden2a ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END ROM_START( raiden2b ) @@ -1141,6 +1163,8 @@ ROM_START( raiden2b ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END /* @@ -1209,7 +1233,9 @@ ROM_START( raiden2c ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) - ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_END ROM_START( raiden2d ) @@ -1237,7 +1263,9 @@ ROM_START( raiden2d ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "seibu6", 0x00000, 0x40000, CRC(fb0fca23) SHA1(4b2217b121a66c5ab6015537609cf908ffedaf86) ) - ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_END @@ -1307,7 +1335,9 @@ ROM_START( raiden2e ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "r2_voi1.bin", 0x00000, 0x40000, CRC(488d050f) SHA1(fde2fd64fea6bc39e1a42885d21d362bc6be2ac2) ) - ROM_LOAD( "r2_voi2.bin", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "r2_voi2.bin", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_END @@ -1386,7 +1416,9 @@ ROM_START( raidndx ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) - ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ ROM_LOAD( "copx-d2.6s", 0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) ) @@ -1458,7 +1490,9 @@ ROM_START( raidndxj ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) /* not from this set, assumed to be the same */ - ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ /* not from this set, assumed to be the same */ @@ -1535,7 +1569,9 @@ ROM_START( raidndxa ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) /* not from this set, assumed to be the same */ - ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ /* not from this set, assumed to be the same */ @@ -1570,7 +1606,9 @@ ROM_START( raidndxm ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "dx_6.3b", 0x00000, 0x40000, CRC(9a9196da) SHA1(3d1ee67fb0d40a231ce04d10718f07ffb76db455) ) /* not from this set, assumed to be the same */ - ROM_LOAD( "dx_pcm.3a", 0x80000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, 0 ) /* ADPCM samples */ + ROM_LOAD( "dx_pcm.3a", 0x00000, 0x40000, CRC(8cf0d17e) SHA1(0fbe0b1e1ca5360c7c8329331408e3d799b4714c) ) ROM_REGION( 0x40000, REGION_USER2, 0 ) /* COPDX */ /* not from this set, assumed to be the same */ @@ -1608,6 +1646,8 @@ ROM_START( zeroteam ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END ROM_START( zeroteaa ) @@ -1637,6 +1677,8 @@ ROM_START( zeroteaa ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END ROM_START( zerotsel ) @@ -1666,6 +1708,8 @@ ROM_START( zerotsel ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END /* set contained only program roms, was marked as 'non-encrytped' but program isn't encrypted anyway?! */ @@ -1696,6 +1740,8 @@ ROM_START( zeroteab ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END /* Different hardware, uses COPX-D3 for protection */ @@ -1721,6 +1767,8 @@ ROM_START( nzerotea ) ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* ADPCM samples */ ROM_LOAD( "6.pcm", 0x00000, 0x40000, CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) + + ROM_REGION( 0x100000, REGION_SOUND2, ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c index 7ede476c893..6cd27a6d5ae 100644 --- a/src/mame/machine/seicop.c +++ b/src/mame/machine/seicop.c @@ -1981,10 +1981,14 @@ READ16_HANDLER( raiden2_mcu_r ) return generic_cop_r(machine, offset, mem_mask); break; - case (0x340/2): return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3) << 8); - case (0x344/2): return input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1) << 8); - case (0x34c/2): return input_port_read_indexed(machine, 4) | 0xff00; + case (0x340/2): return input_port_read_indexed(machine, 3) | (input_port_read_indexed(machine, 4) << 8); + case (0x344/2): return input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 2) << 8); + case (0x34c/2): return input_port_read_indexed(machine, 5) | 0xff00; + /* Inputs */ + case (0x308/2): return seibu_main_word_r(machine,2,0); + case (0x30c/2): return seibu_main_word_r(machine,3,0); + case (0x314/2): return seibu_main_word_r(machine,5,0); } } @@ -2027,6 +2031,12 @@ WRITE16_HANDLER( raiden2_mcu_w ) case (0x2be/2): sprcpt_adr_w(machine,offset,data,mem_mask); break; case (0x2ce/2): sprcpt_flags_2_w(machine,offset,data,mem_mask); break; + case (0x300/2): { seibu_main_word_w(machine,0,cop_mcu_ram[offset],0xff00); break; } + case (0x304/2): { seibu_main_word_w(machine,1,cop_mcu_ram[offset],0xff00); break; } + case (0x310/2): { seibu_main_word_w(machine,4,cop_mcu_ram[offset],0xff00); break; } + case (0x318/2): { seibu_main_word_w(machine,6,cop_mcu_ram[offset],0xff00); break; } + + } }