diff --git a/src/mame/midw8080/8080bw.cpp b/src/mame/midw8080/8080bw.cpp index 19c355d9833..edb8585fab1 100644 --- a/src/mame/midw8080/8080bw.cpp +++ b/src/mame/midw8080/8080bw.cpp @@ -2278,6 +2278,17 @@ void _8080bw_state::polaris(machine_config &config) /* */ /*******************************************************/ +void ozmawars_state::ozmawars_io_map(address_map &map) +{ + map(0x00, 0x00).portr("IN0").nopw(); // ozmawars2 writes random stuff here + map(0x01, 0x01).portr("IN1"); + map(0x02, 0x02).portr("IN2"); + map(0x03, 0x03).w(FUNC(ozmawars_state::ozmawars_port03_w)); + map(0x04, 0x04).w(FUNC(ozmawars_state::ozmawars_port04_w)); + map(0x05, 0x05).w(FUNC(ozmawars_state::ozmawars_port05_w)); + map(0x06, 0x06).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); +} + static INPUT_PORTS_START( ozmawars ) PORT_INCLUDE( sicv_base ) @@ -2307,6 +2318,27 @@ static INPUT_PORTS_START( spaceph ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END +void ozmawars_state::ozmawars(machine_config &config) +{ + mw8080bw_root(config); + + /* basic machine hardware */ + m_maincpu->set_addrmap(AS_IO, &ozmawars_state::ozmawars_io_map); + MCFG_MACHINE_START_OVERRIDE(ozmawars_state,extra_8080bw) + + /* 60 Hz signal clocks two LS161. Ripple carry will */ + /* reset circuit, if LS161 not cleared before. */ + WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); + + /* video hardware */ + m_screen->set_screen_update(FUNC(ozmawars_state::screen_update_invadpt2)); + + PALETTE(config, m_palette, palette_device::RBG_3BIT); + + /* sound hardware */ + ozmawars_samples_audio(config); +} + /*******************************************************/ @@ -5998,8 +6030,8 @@ GAME( 1980, vortex, 0, vortex, vortex, vortex_state, init_vo GAME( 1979, rollingc, 0, rollingc, rollingc, rollingc_state, empty_init, ROT270, "Nichibutsu", "Rolling Crash / Moon Base", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, ozmawars, 0, invadpt2, ozmawars, _8080bw_state, empty_init, ROT270, "SNK", "Ozma Wars (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1979, ozmawars2, ozmawars, invadpt2, ozmawars, _8080bw_state, empty_init, ROT270, "SNK", "Ozma Wars (set 2)", MACHINE_SUPPORTS_SAVE ) // Uses Taito's three board color version of Space Invaders PCB +GAME( 1979, ozmawars, 0, ozmawars, ozmawars, ozmawars_state, empty_init, ROT270, "SNK", "Ozma Wars (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1979, ozmawars2, ozmawars, ozmawars, ozmawars, ozmawars_state, empty_init, ROT270, "SNK", "Ozma Wars (set 2)", MACHINE_SUPPORTS_SAVE ) // Uses Taito's three board color version of Space Invaders PCB GAME( 1979, ozmawarsmr, ozmawars, invaders, ozmawars, invaders_state, empty_init, ROT270, "bootleg (Model Racing)", "Ozma Wars (Model Racing bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1979, spaceph, ozmawars, invaders, spaceph, invaders_state, empty_init, ROT270, "bootleg? (Zilec Games)", "Space Phantoms (bootleg of Ozma Wars)", MACHINE_SUPPORTS_SAVE ) GAME( 1979, solfight, ozmawars, invaders, ozmawars, invaders_state, empty_init, ROT270, "bootleg", "Solar Fight (bootleg of Ozma Wars)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/midw8080/8080bw.h b/src/mame/midw8080/8080bw.h index b78a2a6660a..2c87b91b554 100644 --- a/src/mame/midw8080/8080bw.h +++ b/src/mame/midw8080/8080bw.h @@ -126,6 +126,7 @@ protected: DECLARE_MACHINE_START(extra_8080bw_vh); DECLARE_MACHINE_START(extra_8080bw_sh); + DECLARE_MACHINE_START(extra_8080bw); uint32_t screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -187,7 +188,6 @@ private: uint8_t schaser_scattered_colorram_r(offs_t offset); void schaser_scattered_colorram_w(offs_t offset, uint8_t data); - DECLARE_MACHINE_START(extra_8080bw); DECLARE_MACHINE_START(sflush); DECLARE_MACHINE_START(schaser); DECLARE_MACHINE_START(schasercv); @@ -430,6 +430,31 @@ private: }; +/*************************************/ +/* SNK Ozma Wars */ +/*************************************/ + +class ozmawars_state : public _8080bw_state +{ +public: + ozmawars_state(const machine_config &mconfig, device_type type, const char *tag) + : _8080bw_state(mconfig, type, tag) + { } + + void ozmawars(machine_config &config); + void ozmawars_samples_audio(machine_config &config); + +private: + void ozmawars_port03_w(uint8_t data); + void ozmawars_port04_w(uint8_t data); + void ozmawars_port05_w(uint8_t data); + void ozmawars_io_map(address_map &map); + u8 m_port03 = 0; + u8 m_port05 = 0; + bool m_sound_enable = 0; +}; + + /*******************************************************/ /* Wing Yosaku to Donbei */ /*******************************************************/ diff --git a/src/mame/midw8080/8080bw_a.cpp b/src/mame/midw8080/8080bw_a.cpp index c636c9cafa5..83e948e4b92 100644 --- a/src/mame/midw8080/8080bw_a.cpp +++ b/src/mame/midw8080/8080bw_a.cpp @@ -56,7 +56,7 @@ DEFINE_DEVICE_TYPE(CANE_AUDIO, cane_audio_device, "cane_audio", "Model Racing static const char *const invaders_sample_names[] = { "*invaders", - "1", /* shot/missle */ + "1", /* shot/missile */ "2", /* base hit/explosion */ "3", /* invader hit */ "4", /* fleet move 1 */ @@ -110,7 +110,7 @@ void _8080bw_state::invadpt2_sh_port_1_w(uint8_t data) m_sn->enable_w(!BIT(data, 0)); // SAUCER SOUND - if (BIT(rising_bits, 1)) m_samples->start(0, 0); // MISSLE SOUND + if (BIT(rising_bits, 1)) m_samples->start(0, 0); // MISSILE SOUND if (BIT(rising_bits, 2)) m_samples->start(1, 1); // EXPLOSION if (BIT(rising_bits, 3)) m_samples->start(2, 2); // INVADER HIT if (BIT(rising_bits, 4)) m_samples->start(5, 8); // BONUS MISSILE BASE @@ -147,6 +147,103 @@ void _8080bw_state::invadpt2_sh_port_2_w(uint8_t data) +/*******************************************************/ +/* */ +/* SNK "Ozma Wars" */ +/* No schematic or manual could be found. */ +/* Suspected of having a SN76577 for the enemy */ +/* movement sounds, another for the enemy death */ +/* sounds, and analog circuits for the shooting and */ +/* explosion sounds. */ +/* */ +/*******************************************************/ + +static const char *const ozmawars_sample_names[] = +{ + "*ozmawars", + "ow0", // shoot + "ow1", // die + "ow2", // docking 1 + "ow3", // docking 2 + "ow4", // docking 3 + "ow5", // docking 4 + "ow6", // refuel + "ow7", // comet + "ow8", // hit invader + "ow9", // hit meteor + "ow10", // stage with invaders + "ow11", // globe-thing after the comet + "ow12", // not sure + "ow13", // stage with wheels + "ow14", // meteor stage + nullptr +}; + + +void ozmawars_state::ozmawars_port03_w(uint8_t data) +{ + uint8_t rising_bits = data & ~m_port03; + + m_port03 = data; + m_screen_red = BIT(data, 2); + m_sound_enable = BIT(data, 5); + + if (m_sound_enable) + { + if (BIT(rising_bits, 0)) m_samples->start(4, 11, 1); // the globe-thing after the comet + if (BIT(rising_bits, 1)) m_samples->start(0, 0); // fire + if (BIT(rising_bits, 2)) m_samples->start(1, 1); // die + if (BIT(rising_bits, 3)) m_samples->start(2, 8); // hit inv + if (BIT(rising_bits, 4)) m_samples->start(4, 6); // refuel + } + else + m_samples->stop(4); +} + +void ozmawars_state::ozmawars_port04_w(uint8_t data) +{ + if (m_sound_enable) + { + if (data == 0x01) m_samples->start(4, 13, 1); // stage with wheels + if (data == 0x15) m_samples->start(4, 10, 1); // stage with invaders + if (data == 0x17) m_samples->start(4, 9); // meteor hit + if (data == 0x1f) m_samples->start(4, 14, 1); // meteor stage + //if (data == 0x35) m_samples->start(4, 12, 1); // + //if (data == 0x3f) m_samples->start(4, 11, 1); // + } + if (data == 0) m_samples->stop(4); // +} + +void ozmawars_state::ozmawars_port05_w(uint8_t data) +{ + uint8_t rising_bits = data & ~m_port05; + + m_port05 = data; + m_flip_screen = BIT(data, 5) & ioport(CABINET_PORT_TAG)->read(); + m_color_map = BIT(data, 5); + + if (m_sound_enable) + { + if (BIT(rising_bits, 0)) m_samples->start(4, 2); // docking 1 + if (BIT(rising_bits, 1)) m_samples->start(4, 3); // docking 2 + if (BIT(rising_bits, 2)) m_samples->start(4, 4); // docking 3 + if (BIT(rising_bits, 3)) m_samples->start(4, 5); // docking 4 + if (BIT(rising_bits, 4)) m_samples->start(4, 7); // comet + } +} + +void ozmawars_state::ozmawars_samples_audio(machine_config &config) +{ + SPEAKER(config, "mono").front_center(); + + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(ozmawars_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} + + + /*******************************************************/ /* */ /* Space Ranger */