From a06b63feb2103d9f00653d5910ffd58046724bd0 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 14 Nov 2012 12:29:01 +0000 Subject: [PATCH] darthvdr : added 'invaders' sound [Robbbert] --- src/mame/audio/8080bw.c | 26 ++++++++++++++++++++++++++ src/mame/drivers/8080bw.c | 13 +++++++++++-- src/mame/includes/8080bw.h | 2 ++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c index 40193cc94c8..73f39b48947 100644 --- a/src/mame/audio/8080bw.c +++ b/src/mame/audio/8080bw.c @@ -1228,3 +1228,29 @@ WRITE8_MEMBER(_8080bw_state::shuttlei_sh_port_2_w) break; } } + +WRITE8_MEMBER( _8080bw_state::darthvdr_08_w ) +{ + UINT8 rising_bits = data & ~m_port_1_last_extra; + + machine().sound().system_enable(data & 0x01); + + if (rising_bits & 0x02) m_samples->start(0, 0); /* Shoot */ + if (rising_bits & 0x04) m_samples->start(3, 7); /* Hit UFO */ + if (rising_bits & 0x10) m_samples->start(5, 8); /* Bonus */ + + sn76477_enable_w(m_sn, data & 0x20 ? 0:1); /* UFO */ + + if (rising_bits & 0x40) m_samples->start(1, 1); /* Death */ + if (rising_bits & 0x80) m_samples->start(2, 2); /* Hit */ + + if (rising_bits & 0x08) + { + m_samples->start(4, m_fleet_step); /* Fleet move in 4 steps */ + m_fleet_step++; + if (m_fleet_step > 6) m_fleet_step = 3; + } + + m_port_1_last_extra = data; +} + diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c index 4fa97495b4a..e135bec05d0 100644 --- a/src/mame/drivers/8080bw.c +++ b/src/mame/drivers/8080bw.c @@ -2067,6 +2067,9 @@ Another (same checksums) dump came from board labeled SI-7811M-2 MACHINE_START_MEMBER(_8080bw_state,darthvdr) { /* do nothing for now - different interrupt system */ + m_fleet_step = 3; + m_samples = machine().device("samples"); + m_sn = machine().device("snsnd"); } @@ -2085,7 +2088,10 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( darthvdr_io_map, AS_IO, 8, _8080bw_state ) AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") - AM_RANGE(0x00, 0x0f) AM_WRITENOP + + AM_RANGE(0x00, 0x00) AM_WRITENOP + AM_RANGE(0x04, 0x04) AM_WRITENOP + AM_RANGE(0x08, 0x08) AM_WRITE(darthvdr_08_w) // sound ADDRESS_MAP_END @@ -2138,6 +2144,9 @@ static MACHINE_CONFIG_DERIVED_CLASS( darthvdr, mw8080bw_root, _8080bw_state ) MCFG_MACHINE_START_OVERRIDE(_8080bw_state,darthvdr) MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,darthvdr) + + /* sound hardware */ + MCFG_FRAGMENT_ADD(invaders_samples_audio) MACHINE_CONFIG_END @@ -3959,7 +3968,7 @@ GAMEL(1979, jspecter, invaders, invaders, jspecter, driver_device, 0, ROT270 GAMEL(1979, jspecter2, invaders, invaders, jspecter, driver_device, 0, ROT270, "bootleg (Jatre)", "Jatre Specter (set 2)", GAME_SUPPORTS_SAVE, layout_invaders ) GAMEL(1978, spacewr3, invaders, spcewars, sicv, driver_device, 0, ROT270, "bootleg", "Space War Part 3", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_invaders ) // unrelated to Sanritsu's version? GAMEL(1978, invader4, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg", "Space Invaders Part Four", GAME_SUPPORTS_SAVE, layout_invaders ) -GAME( 1978, darthvdr, invaders, darthvdr, darthvdr, driver_device, 0, ROT270, "bootleg", "Darth Vader (bootleg of Space Invaders)", GAME_SUPPORTS_SAVE | GAME_NO_SOUND ) +GAME( 1978, darthvdr, invaders, darthvdr, darthvdr, driver_device, 0, ROT270, "bootleg", "Darth Vader (bootleg of Space Invaders)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) GAMEL(19??, tst_invd, invaders, invaders, sicv, driver_device, 0, ROT0, "", "Space Invaders Test ROM", GAME_SUPPORTS_SAVE, layout_invaders ) // other Taito diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h index 17c4e7fe7c8..88cc7547bfa 100644 --- a/src/mame/includes/8080bw.h +++ b/src/mame/includes/8080bw.h @@ -31,6 +31,7 @@ public: UINT8 m_c8080bw_flip_screen; UINT8 m_color_map; UINT8 m_screen_red; + UINT8 m_fleet_step; attotime m_schaser_effect_555_time_remain; INT32 m_schaser_effect_555_time_remain_savable; @@ -56,6 +57,7 @@ public: DECLARE_WRITE8_MEMBER(lrescue_sh_port_1_w); DECLARE_WRITE8_MEMBER(lrescue_sh_port_2_w); DECLARE_WRITE8_MEMBER(cosmo_sh_port_2_w); + DECLARE_WRITE8_MEMBER(darthvdr_08_w); DECLARE_WRITE8_MEMBER(ballbomb_01_w); DECLARE_WRITE8_MEMBER(ballbomb_sh_port_1_w); DECLARE_WRITE8_MEMBER(ballbomb_sh_port_2_w);