From e5f7ea6ffc8cd5a60c252bed82d9d481a5210d38 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 9 May 2018 22:11:48 +1000 Subject: [PATCH 1/4] namcos22: put rear speakers behind (nw) --- src/mame/drivers/namcos22.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp index 11e8993886c..af1bfe0c343 100644 --- a/src/mame/drivers/namcos22.cpp +++ b/src/mame/drivers/namcos22.cpp @@ -3810,8 +3810,8 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(namcos22_state::cybrcomm) namcos22(config); - SPEAKER(config, "rear_left").front_left(); - SPEAKER(config, "rear_right").front_right(); + SPEAKER(config, "rear_left", -0.2, 0.0, -0.5); + SPEAKER(config, "rear_right", 0.2, 0.0, -0.5); MCFG_DEVICE_MODIFY("c352") MCFG_SOUND_ROUTE(2, "rear_left", 1.00) @@ -3933,8 +3933,8 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(namcos22_state::tokyowar) namcos22s(config); - SPEAKER(config, "seat").front_center(); - SPEAKER(config, "vibration").front_center(); + SPEAKER(config, "seat", 0.0, 0.0, 0.0); + SPEAKER(config, "vibration", 0.0, 0.0, 0.0); MCFG_DEVICE_MODIFY("c352") MCFG_SOUND_ROUTE(3, "seat", 1.00) From 65711d82fc0d8bb78af890fae8cd4a77db75bd20 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 9 May 2018 09:19:00 -0400 Subject: [PATCH 2/4] astrocde.cpp: Driver and device modernization (nw) - Rename sound device, document pinout and add input and output callbacks - Add addressable and non-addressable output latch devices - Add watchdog timers for most games - Use memory maps instead of hacking in handlers in DRIVER_INIT --- src/devices/sound/astrocde.cpp | 92 +++++-- src/devices/sound/astrocde.h | 91 ++++++- src/mame/drivers/astrocde.cpp | 440 +++++++++++++++++---------------- src/mame/drivers/astrohome.cpp | 34 ++- src/mame/drivers/g627.cpp | 4 +- src/mame/includes/astrocde.h | 52 ++-- src/mame/video/astrocde.cpp | 192 ++++++-------- 7 files changed, 497 insertions(+), 408 deletions(-) diff --git a/src/devices/sound/astrocde.cpp b/src/devices/sound/astrocde.cpp index 36b0f76601a..e3600a88286 100644 --- a/src/devices/sound/astrocde.cpp +++ b/src/devices/sound/astrocde.cpp @@ -39,6 +39,19 @@ Register 7: D7..D0: Noise volume +************************************************************ + + The device has active high(!) SO strobes triggered by + read accesses, which transfer data from the the 8 SI + lines to the bus. Logically SO0-7 and SI0-7 ought to + be hooked up to the same input matrix, but this only + appears to be the case with the Astrocade home systems. + The arcade games instead channel the SI inputs through + a quartet of MC14539B (pin-compatible with 74153) CMOS + multiplexers and connect the SO strobes to unrelated + outputs which generally use the upper 8 address bits + as data. + ***********************************************************/ #include "emu.h" @@ -46,7 +59,7 @@ // device type definition -DEFINE_DEVICE_TYPE(ASTROCADE, astrocade_device, "astrocade", "Astrocade") +DEFINE_DEVICE_TYPE(ASTROCADE_IO, astrocade_io_device, "astrocade_io", "Astrocade Custom I/O") //************************************************************************** @@ -54,39 +67,54 @@ DEFINE_DEVICE_TYPE(ASTROCADE, astrocade_device, "astrocade", "Astrocade") //************************************************************************** //------------------------------------------------- -// astrocade_device - constructor +// astrocade_io_device - constructor //------------------------------------------------- -astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ASTROCADE, tag, owner, clock), - device_sound_interface(mconfig, *this), - m_stream(nullptr), - m_master_count(0), - m_vibrato_clock(0), - m_noise_clock(0), - m_noise_state(0), - m_a_count(0), - m_a_state(0), - m_b_count(0), - m_b_state(0), - m_c_count(0), - m_c_state(0) +astrocade_io_device::astrocade_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, ASTROCADE_IO, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , m_stream(nullptr) + , m_master_count(0) + , m_vibrato_clock(0) + , m_noise_clock(0) + , m_noise_state(0) + , m_a_count(0) + , m_a_state(0) + , m_b_count(0) + , m_b_state(0) + , m_c_count(0) + , m_c_state(0) + , m_si_callback(*this) + , m_so_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_pots(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG}) { memset(m_reg, 0, sizeof(uint8_t)*8); memset(m_bitswap, 0, sizeof(uint8_t)*256); } +//------------------------------------------------- +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time +//------------------------------------------------- + +void astrocade_io_device::device_resolve_objects() +{ + m_si_callback.resolve_safe(0); + for (auto &cb : m_so_callback) + cb.resolve_safe(); +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -void astrocade_device::device_start() +void astrocade_io_device::device_start() { - int i; - /* generate a bitswap table for the noise */ - for (i = 0; i < 256; i++) + for (int i = 0; i < 256; i++) m_bitswap[i] = bitswap<8>(i, 0,1,2,3,4,5,6,7); /* allocate a stream for output */ @@ -102,7 +130,7 @@ void astrocade_device::device_start() // sound_stream_update - handle a stream update //------------------------------------------------- -void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +void astrocade_io_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *dest = outputs[0]; uint16_t noise_state; @@ -218,7 +246,7 @@ void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t // device_reset - device-specific reset //------------------------------------------------- -void astrocade_device::device_reset() +void astrocade_io_device::device_reset() { memset(m_reg, 0, sizeof(m_reg)); @@ -243,7 +271,7 @@ void astrocade_device::device_reset() // Save state registration //------------------------------------------------- -void astrocade_device::state_save_register() +void astrocade_io_device::state_save_register() { save_item(NAME(m_reg)); @@ -270,7 +298,7 @@ void astrocade_device::state_save_register() * *************************************/ -WRITE8_MEMBER( astrocade_device::astrocade_sound_w ) +WRITE8_MEMBER(astrocade_io_device::write) { if ((offset & 8) != 0) offset = (offset >> 8) & 7; @@ -283,3 +311,19 @@ WRITE8_MEMBER( astrocade_device::astrocade_sound_w ) /* stash the new register value */ m_reg[offset & 7] = data; } + + +READ8_MEMBER(astrocade_io_device::read) +{ + if ((offset & 0x0f) < 0x08) + { + if (!machine().side_effects_disabled()) + m_so_callback[offset & 7](space, 0, offset >> 8); + + return m_si_callback(space, offset & 7); + } + else if ((offset & 0x0f) >= 0x0c) + return m_pots[offset & 3].read_safe(0); + else + return 0xff; +} diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h index c24c51d70ec..1ebeeae5e52 100644 --- a/src/devices/sound/astrocde.h +++ b/src/devices/sound/astrocde.h @@ -1,5 +1,34 @@ // license:BSD-3-Clause // copyright-holders:Aaron Giles,Frank Palazzolo +/*********************************************************** + + Astrocade custom 'IO' chip + +************************************************************ + _____ _____ + Vss 1 |* \_/ | 40 MXD7 + SI0 2 | | 39 MXD6 + SI1 3 | | 38 MXD5 + SI2 4 | | 37 MXD4 + SI3 5 | | 36 MXD3 + SI4 6 | | 35 MXD2 + SI5 7 | | 34 MXD1 + SI6 8 | | 33 MXD0 + SI7 9 | | 32 SO0 + POT0 10 | CUSTOM | 31 SO1 + POT1 11 | I/O | 30 SO2 + POT2 12 | | 29 SO3 + POT3 13 | | 28 SO4 + DISCHG 14 | | 27 SO5 + MONOS 15 | | 26 SO6 + ϕ 16 | | 25 SO7 + /RESET 17 | | 24 AUDIO + TEST 18 | | 23 /RD + /IORQ 19 | | 22 Vgg + /ϕ 20 |_____________| 21 Vdd + +***********************************************************/ + #ifndef MAME_SOUND_ASTROCDE_H #define MAME_SOUND_ASTROCDE_H @@ -10,11 +39,44 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_ASTROCADE_ADD(tag, clock) \ - MCFG_DEVICE_ADD((tag), ASTROCADE, (clock)) +#define MCFG_ASTROCADE_IO_SI_READ_CB(_devcb) \ + devcb = &downcast(*device).set_si_callback(DEVCB_##_devcb); -#define MCFG_ASTROCADE_REPLACE(tag, clock) \ - MCFG_DEVICE_REPLACE((tag), ASTROCADE, (clock)) +#define MCFG_ASTROCADE_IO_SO0_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<0>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO1_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<1>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO2_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<2>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO3_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<3>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO4_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<4>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO5_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<5>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO6_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<6>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_SO7_STROBE_CB(_devcb) \ + devcb = &downcast(*device).set_so_callback<7>(DEVCB_##_devcb); + +#define MCFG_ASTROCADE_IO_POT0(_tag) \ + downcast(*device).set_pot_tag<0>(_tag); + +#define MCFG_ASTROCADE_IO_POT1(_tag) \ + downcast(*device).set_pot_tag<1>(_tag); + +#define MCFG_ASTROCADE_IO_POT2(_tag) \ + downcast(*device).set_pot_tag<2>(_tag); + +#define MCFG_ASTROCADE_IO_POT3(_tag) \ + downcast(*device).set_pot_tag<3>(_tag); @@ -22,15 +84,21 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> astrocade_device +// ======================> astrocade_io_device -class astrocade_device : public device_t, public device_sound_interface +class astrocade_io_device : public device_t, public device_sound_interface { public: - astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + astrocade_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // configuration access + template devcb_base &set_si_callback(Object &&cb) { return m_si_callback.set_callback(std::forward(cb)); } + template devcb_base &set_so_callback(Object &&cb) { return m_so_callback[N].set_callback(std::forward(cb)); } + template void set_pot_tag(const char *tag) { m_pots[N].set_tag(tag); } protected: // device-level overrides + virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; @@ -38,7 +106,8 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; public: - DECLARE_WRITE8_MEMBER( astrocade_sound_w ); + DECLARE_WRITE8_MEMBER(write); + DECLARE_READ8_MEMBER(read); private: void state_save_register(); @@ -63,8 +132,12 @@ private: uint8_t m_c_state; /* current tone generator C state */ uint8_t m_bitswap[256]; /* bitswap table */ + + devcb_read8 m_si_callback; + devcb_write8 m_so_callback[8]; + optional_ioport_array<4> m_pots; }; -DECLARE_DEVICE_TYPE(ASTROCADE, astrocade_device) +DECLARE_DEVICE_TYPE(ASTROCADE_IO, astrocade_io_device) #endif // MAME_SOUND_ASTROCDE_H diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp index 70e37e68280..7daf1cf5330 100644 --- a/src/mame/drivers/astrocde.cpp +++ b/src/mame/drivers/astrocde.cpp @@ -120,6 +120,9 @@ #include "cpu/z80/z80daisy.h" #include "machine/z80ctc.h" #include "machine/nvram.h" +#include "machine/74259.h" +#include "machine/output_latch.h" +#include "machine/watchdog.h" #include "sound/ay8910.h" #include "sound/votrax.h" @@ -164,26 +167,6 @@ WRITE8_MEMBER(astrocde_state::protected_ram_w) * *************************************/ -WRITE8_MEMBER(astrocde_state::seawolf2_lamps_w) -{ - /* 0x42 = player 2 (left), 0x43 = player 1 (right) */ - /* --x----- explosion */ - /* ---x---- RELOAD (active low) */ - /* ----x--- torpedo 1 available */ - /* -----x-- torpedo 2 available */ - /* ------x- torpedo 3 available */ - /* -------x torpedo 4 available */ - - output().set_lamp_value((offset ^ 1) * 7 + 0, ( data >> 5) & 1); /* 0/7 = hit lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 1, (~data >> 4) & 1); /* 1/8 = reload lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 2, ( data >> 4) & 1); /* 2/9 = ready lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 3, ( data >> 3) & 1); /* 3/10 = torpedo 1 lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 4, ( data >> 2) & 1); /* 4/11 = torpedo 2 lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 5, ( data >> 1) & 1); /* 5/12 = torpedo 3 lamp */ - output().set_lamp_value((offset ^ 1) * 7 + 6, ( data >> 0) & 1); /* 6/13 = torpedo 4 lamp */ -} - - WRITE8_MEMBER(astrocde_state::seawolf2_sound_1_w)// Port 40 { uint8_t rising_bits = data & ~m_port_1_last; @@ -229,6 +212,33 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41 +/************************************* + * + * Generic input/output + * + *************************************/ + +READ8_MEMBER(astrocde_state::input_mux_r) +{ + return m_handle[offset & 3].read_safe(0xff); +} + + +template +WRITE_LINE_MEMBER(astrocde_state::coin_counter_w) +{ + machine().bookkeeping().coin_counter_w(Coin, state); +} + + +template +WRITE_LINE_MEMBER(astrocde_state::sparkle_w) +{ + m_sparkle[Bit] = state; +} + + + /************************************* * * Extra Bases specific input/output @@ -254,112 +264,47 @@ WRITE8_MEMBER(astrocde_state::ebases_coin_w) -/************************************* - * - * Space Zap specific input/output - * - *************************************/ - -READ8_MEMBER(astrocde_state::spacezap_io_r) -{ - machine().bookkeeping().coin_counter_w(0, (offset >> 8) & 1); - machine().bookkeeping().coin_counter_w(1, (offset >> 9) & 1); - return m_p3handle.read_safe(0xff); -} - - - -/************************************* - * - * Wizard of Wor specific input/output - * - *************************************/ - -READ8_MEMBER(astrocde_state::wow_io_r) -{ - uint8_t data = (offset >> 8) & 1; - - switch ((offset >> 9) & 7) - { - case 0: machine().bookkeeping().coin_counter_w(0, data); break; - case 1: machine().bookkeeping().coin_counter_w(1, data); break; - case 2: m_sparkle[0] = data; break; - case 3: m_sparkle[1] = data; break; - case 4: m_sparkle[2] = data; break; - case 5: m_sparkle[3] = data; break; - case 7: machine().bookkeeping().coin_counter_w(2, data); break; - } - return 0xff; -} - - /************************************* * * Gorf specific input/output * *************************************/ -READ8_MEMBER(astrocde_state::gorf_io_1_r) +WRITE_LINE_MEMBER(astrocde_state::gorf_sound_switch_w) { - uint8_t data = (offset >> 8) & 1; - - switch ((offset >> 9) & 7) - { - case 0: machine().bookkeeping().coin_counter_w(0, data); break; - case 1: machine().bookkeeping().coin_counter_w(1, data); break; - case 2: m_sparkle[0] = data; break; - case 3: m_sparkle[1] = data; break; - case 4: m_sparkle[2] = data; break; - case 5: m_sparkle[3] = data; break; - case 6: - m_astrocade_sound1->set_output_gain(0, data ? 0.0 : 1.0); - m_votrax->set_output_gain(0, data ? 1.0 : 0.0); - break; - case 7: osd_printf_debug("io_1:%d\n", data); break; - } - return 0xff; -} - - -READ8_MEMBER(astrocde_state::gorf_io_2_r) -{ - uint8_t data = (offset >> 8) & 1; - - switch ((offset >> 9) & 7) - { - case 0: output().set_lamp_value(0, data); break; - case 1: output().set_lamp_value(1, data); break; - case 2: output().set_lamp_value(2, data); break; - case 3: output().set_lamp_value(3, data); break; - case 4: output().set_lamp_value(4, data); break; - case 5: output().set_lamp_value(5, data); break; - case 6: /* n/c */ break; - case 7: output().set_lamp_value(7, data); break; - } - return 0xff; + m_astrocade_sound1->set_output_gain(0, state ? 0.0 : 1.0); + m_votrax->set_output_gain(0, state ? 1.0 : 0.0); } /************************************* * - * Robby Roto specific input/output + * Demons & Dragons specific input/output * *************************************/ -READ8_MEMBER(astrocde_state::robby_io_r) +WRITE8_MEMBER(astrocde_state::demndrgn_banksw_w) { - uint8_t data = (offset >> 8) & 1; + int bank = (data >> 5) & 3; + m_bank4000->set_bank(bank); + m_bank8000->set_entry(bank); +} - switch ((offset >> 9) & 7) - { - case 0: machine().bookkeeping().coin_counter_w(0, data); break; - case 1: machine().bookkeeping().coin_counter_w(1, data); break; - case 2: machine().bookkeeping().coin_counter_w(2, data); break; - case 6: output().set_led_value(0, data); break; - case 7: output().set_led_value(1, data); break; - } - return 0xff; +WRITE_LINE_MEMBER(astrocde_state::demndrgn_input_select_w) +{ + m_input_select = state; +} + +CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r) +{ + return m_joystick[m_input_select]->read(); +} + + +WRITE8_MEMBER(astrocde_state::demndrgn_sound_w) +{ + logerror("Trigger sound sample 0x%02x\n",data); } @@ -370,35 +315,6 @@ READ8_MEMBER(astrocde_state::robby_io_r) * *************************************/ -READ8_MEMBER(astrocde_state::profpac_io_1_r) -{ - machine().bookkeeping().coin_counter_w(0, (offset >> 8) & 1); - machine().bookkeeping().coin_counter_w(1, (offset >> 9) & 1); - output().set_led_value(0, (offset >> 10) & 1); - output().set_led_value(1, (offset >> 11) & 1); - return 0xff; -} - - -READ8_MEMBER(astrocde_state::profpac_io_2_r) -{ - output().set_lamp_value(0, (offset >> 8) & 1); /* left lamp A */ - output().set_lamp_value(1, (offset >> 9) & 1); /* left lamp B */ - output().set_lamp_value(2, (offset >> 10) & 1); /* left lamp C */ - output().set_lamp_value(3, (offset >> 12) & 1); /* right lamp A */ - output().set_lamp_value(4, (offset >> 13) & 1); /* right lamp B */ - output().set_lamp_value(5, (offset >> 14) & 1); /* right lamp C */ - return 0xff; -} - - -WRITE8_MEMBER(astrocde_state::demndrgn_banksw_w) -{ - int bank = (data >> 5) & 3; - m_bank4000->set_bank(bank); - m_bank8000->set_entry(bank); -} - WRITE8_MEMBER(astrocde_state::profpac_banksw_w) { @@ -418,36 +334,6 @@ WRITE8_MEMBER(astrocde_state::profpac_banksw_w) } -/************************************* - * - * Demons & Dragons specific input/output - * - *************************************/ - -READ8_MEMBER(astrocde_state::demndrgn_io_r) -{ - machine().bookkeeping().coin_counter_w(0, (offset >> 8) & 1); - machine().bookkeeping().coin_counter_w(1, (offset >> 9) & 1); - output().set_led_value(0, (offset >> 10) & 1); - output().set_led_value(1, (offset >> 11) & 1); - m_input_select = (offset >> 12) & 1; - return 0xff; -} - - - -CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r) -{ - return m_joystick[m_input_select]->read(); -} - - -WRITE8_MEMBER(astrocde_state::demndrgn_sound_w) -{ - logerror("Trigger sound sample 0x%02x\n",data); -} - - /************************************* * @@ -507,14 +393,12 @@ WRITE8_MEMBER(astrocde_state::tenpindx_lights_w) * *************************************/ -READ8_MEMBER( astrocde_state::votrax_speech_r ) +WRITE8_MEMBER(astrocde_state::votrax_speech_w) { - uint8_t data = offset >> 8; m_votrax->inflection_w(space, 0, data >> 6); m_votrax->write(space, 0, data); /* Note : We should really also use volume in this as well as frequency */ - return data; /* Return nicely */ } @@ -633,13 +517,40 @@ void astrocde_state::tenpin_sub_map(address_map &map) void astrocde_state::port_map(address_map &map) { - map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w)); + map(0x0000, 0x000f).mirror(0xff00).rw(this, FUNC(astrocde_state::video_register_r), FUNC(astrocde_state::video_register_w)); + map(0x0010, 0x001f).select(0xff00).r("astrocade1", FUNC(astrocade_io_device::read)); + map(0x0010, 0x0018).select(0xff00).w("astrocade1", FUNC(astrocade_io_device::write)); + map(0x0019, 0x0019).mirror(0xff00).w(this, FUNC(astrocde_state::expand_register_w)); +} + + +void astrocde_state::port_map_discrete(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x0f).rw(this, FUNC(astrocde_state::video_register_r), FUNC(astrocde_state::video_register_w)); + map(0x10, 0x10).portr("HANDLE0"); + map(0x11, 0x11).portr("HANDLE1"); + map(0x12, 0x12).portr("HANDLE2"); + map(0x13, 0x13).portr("HANDLE3"); + map(0x19, 0x19).w(this, FUNC(astrocde_state::expand_register_w)); + map(0x40, 0x40).mirror(0x18).w(this, FUNC(astrocde_state::seawolf2_sound_1_w)); + map(0x41, 0x41).mirror(0x18).w(this, FUNC(astrocde_state::seawolf2_sound_2_w)); + map(0x42, 0x42).mirror(0x18).w("lamplatch2", FUNC(output_latch_device::write)); + map(0x43, 0x43).mirror(0x18).w("lamplatch1", FUNC(output_latch_device::write)); +} + + +void astrocde_state::port_map_ebases(address_map &map) +{ + port_map(map); + map(0x0020, 0x0020).mirror(0xff07).w(this, FUNC(astrocde_state::ebases_coin_w)); + map(0x0028, 0x0028).mirror(0xff07).w(this, FUNC(astrocde_state::ebases_trackball_select_w)); } void astrocde_state::port_map_mono_pattern(address_map &map) { - map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w)); + port_map(map); map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w)); map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w)); } @@ -647,29 +558,25 @@ void astrocde_state::port_map_mono_pattern(address_map &map) void astrocde_state::port_map_stereo_pattern(address_map &map) { - map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w)); - map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_device::astrocade_sound_w)); - map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w)); - map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w)); + port_map_mono_pattern(map); + map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_io_device::write)); } void astrocde_state::port_map_16col_pattern(address_map &map) { - map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w)); - map(0x0050, 0x0058).select(0xff00).w("astrocade2", FUNC(astrocade_device::astrocade_sound_w)); - map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w)); + port_map_stereo_pattern(map); map(0x00bf, 0x00bf).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_page_select_w)); map(0x00c3, 0x00c3).mirror(0xff00).r(this, FUNC(astrocde_state::profpac_intercept_r)); map(0x00c0, 0x00c5).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_screenram_ctrl_w)); map(0x00f3, 0x00f3).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_banksw_w)); - map(0xa55b, 0xa55b).w(this, FUNC(astrocde_state::protected_ram_enable_w)); } void astrocde_state::port_map_16col_pattern_nosound(address_map &map) { - map(0x0000, 0x0019).select(0xff00).rw(this, FUNC(astrocde_state::astrocade_data_chip_register_r), FUNC(astrocde_state::astrocade_data_chip_register_w)); + map(0x0000, 0x000f).mirror(0xff00).rw(this, FUNC(astrocde_state::video_register_r), FUNC(astrocde_state::video_register_w)); + map(0x0019, 0x0019).mirror(0xff00).w(this, FUNC(astrocde_state::expand_register_w)); map(0x0078, 0x007e).mirror(0xff00).w(this, FUNC(astrocde_state::astrocade_pattern_board_w)); map(0x00bf, 0x00bf).mirror(0xff00).w(this, FUNC(astrocde_state::profpac_page_select_w)); map(0x00c3, 0x00c3).mirror(0xff00).r(this, FUNC(astrocde_state::profpac_intercept_r)); @@ -679,6 +586,14 @@ void astrocde_state::port_map_16col_pattern_nosound(address_map &map) } +void astrocde_state::port_map_16col_pattern_demndrgn(address_map &map) +{ + port_map_16col_pattern_nosound(map); + map(0x0010, 0x001f).select(0xff00).r("astrocade1", FUNC(astrocade_io_device::read)); + map(0x0097, 0x0097).mirror(0xff00).w(this, FUNC(astrocde_state::demndrgn_sound_w)); +} + + void astrocde_state::port_map_16col_pattern_tenpindx(address_map &map) { port_map_16col_pattern_nosound(map); @@ -1311,7 +1226,8 @@ MACHINE_CONFIG_START(astrocde_state::astrocade_mono_sound) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_ASTROCADE_ADD("astrocade1", ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) + MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -1322,11 +1238,16 @@ MACHINE_CONFIG_START(astrocde_state::astrocade_stereo_sound) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_ASTROCADE_ADD("astrocade1", ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) + MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) + MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_ASTROCADE_ADD("astrocade2", ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade2", ASTROCADE_IO, ASTROCADE_CLOCK/4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + + MCFG_WATCHDOG_ADD("watchdog") // MC14024B on CPU board at U18 + MCFG_WATCHDOG_VBLANK_INIT("screen", 128) // CLK = VERTDR, Q7 used for RESET MACHINE_CONFIG_END @@ -1343,7 +1264,25 @@ MACHINE_CONFIG_START(astrocde_state::seawolf2) /* basic machine hardware */ MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(seawolf2_map) - MCFG_DEVICE_IO_MAP(port_map) + MCFG_DEVICE_IO_MAP(port_map_discrete) + + MCFG_DEVICE_ADD("lamplatch1", OUTPUT_LATCH, 0) // 74174 on game board at N2 + MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp6")) // right player torpedo 4 available + MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp5")) // right player torpedo 3 available + MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp4")) // right player torpedo 2 available + MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("lamp3")) // right player torpedo 1 available + MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp2")) // right player ready + MCFG_DEVCB_CHAIN_OUTPUT(OUTPUT("lamp1")) MCFG_DEVCB_INVERT // right player reload (active low) + MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp0")) // right player explosion (hit) + + MCFG_DEVICE_ADD("lamplatch2", OUTPUT_LATCH, 0) // 74174 on game board at P2 + MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp13")) // left player torpedo 4 available + MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp12")) // left player torpedo 3 available + MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp11")) // left player torpedo 2 available + MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("lamp10")) // left player torpedo 1 available + MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp9")) // left player ready + MCFG_DEVCB_CHAIN_OUTPUT(OUTPUT("lamp8")) MCFG_DEVCB_INVERT // left player reload (active low) + MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp7")) // left player explosion (hit) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1372,7 +1311,13 @@ MACHINE_CONFIG_START(astrocde_state::ebases) /* basic machine hardware */ MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(ebases_map) - MCFG_DEVICE_IO_MAP(port_map) + MCFG_DEVICE_IO_MAP(port_map_ebases) + + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO1_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) + + MCFG_WATCHDOG_ADD("watchdog") // MC14024 on CPU board at U18 + MCFG_WATCHDOG_VBLANK_INIT("screen", 128) // CLK = VERTDR, Q7 used for RESET MACHINE_CONFIG_END @@ -1384,6 +1329,17 @@ MACHINE_CONFIG_START(astrocde_state::spacezap) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(spacezap_map) MCFG_DEVICE_IO_MAP(port_map_mono_pattern) + + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) + MCFG_ASTROCADE_IO_SO3_STROBE_CB(WRITE8("outlatch", output_latch_device, write)) + + MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // MC14174B on game board at U16 + MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + + MCFG_WATCHDOG_ADD("watchdog") // MC14024 on CPU board at U18 + MCFG_WATCHDOG_VBLANK_INIT("screen", 128) // CLK = VERTDR, Q7 used for RESET MACHINE_CONFIG_END MACHINE_CONFIG_START(astrocde_state::wow) @@ -1395,6 +1351,15 @@ MACHINE_CONFIG_START(astrocde_state::wow) MCFG_DEVICE_PROGRAM_MAP(wow_map) MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) + MCFG_DEVICE_ADD("outlatch", CD4099, 0) + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<0>)) + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<1>)) + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<2>)) + MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<3>)) + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<2>)) + /* video hardware */ MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_DEFAULT_POSITION(1.0, 0.0, 1.0, 0.0) /* adjusted to match screenshots */ @@ -1403,6 +1368,10 @@ MACHINE_CONFIG_START(astrocde_state::wow) /* sound hardware */ SPEAKER(config, "center").front_center(); + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) + MCFG_ASTROCADE_IO_SO7_STROBE_CB(WRITE8(*this, astrocde_state, votrax_speech_w)) + MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "center", 0.85) MACHINE_CONFIG_END @@ -1416,6 +1385,29 @@ MACHINE_CONFIG_START(astrocde_state::gorf) MCFG_DEVICE_PROGRAM_MAP(wow_map) MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) + MCFG_DEVICE_ADD("outlatch", CD4099, 0) // MC14099B on game board at U6 + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<0>)) + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<1>)) + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<2>)) + MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, astrocde_state, sparkle_w<3>)) + MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, astrocde_state, gorf_sound_switch_w)) + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("lamp6")) + + MCFG_DEVICE_ADD("lamplatch", CD4099, 0) // MC14099B on game board at U7 + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("lamp0")) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("lamp1")) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(OUTPUT("lamp2")) + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(OUTPUT("lamp3")) + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(OUTPUT("lamp4")) + MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(OUTPUT("lamp5")) + MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // n/c + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("lamp7")) + + MCFG_WATCHDOG_ADD("watchdog") // MC14024 on CPU board at U18 + MCFG_WATCHDOG_VBLANK_INIT("screen", 128) // CLK = VERTDR, Q7 used for RESET + /* video hardware */ MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_DEFAULT_POSITION(1.0, 0.0, 1.0, 0.0) /* adjusted to match flyer */ @@ -1424,10 +1416,15 @@ MACHINE_CONFIG_START(astrocde_state::gorf) SPEAKER(config, "upper", 0.0, 0.0, 1.0); SPEAKER(config, "lower", 0.0, -0.5, 1.0); - MCFG_ASTROCADE_ADD("astrocade1", ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) + MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_state, input_mux_r)) + MCFG_ASTROCADE_IO_SO0_STROBE_CB(WRITE8("watchdog", watchdog_timer_device, reset_w)) + MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) + MCFG_ASTROCADE_IO_SO6_STROBE_CB(WRITE8("lamplatch", cd4099_device, write_nibble_d0)) + MCFG_ASTROCADE_IO_SO7_STROBE_CB(WRITE8(*this, astrocde_state, votrax_speech_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 1.0) - MCFG_ASTROCADE_ADD("astrocade2", ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade2", ASTROCADE_IO, ASTROCADE_CLOCK/4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lower", 1.0) MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000) @@ -1444,7 +1441,17 @@ MACHINE_CONFIG_START(astrocde_state::robby) MCFG_DEVICE_PROGRAM_MAP(robby_map) MCFG_DEVICE_IO_MAP(port_map_stereo_pattern) - MCFG_NVRAM_ADD_0FILL("nvram") + MCFG_NVRAM_ADD_0FILL("nvram") // HM6116LP-4 + battery + + MCFG_DEVICE_ADD("outlatch", CD4099, 0) // on game board at U1 + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, astrocde_state, coin_counter_w<2>)) + MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(OUTPUT("led0")) + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(OUTPUT("led1")) + + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("outlatch", cd4099_device, write_nibble_d0)) MACHINE_CONFIG_END @@ -1460,16 +1467,47 @@ MACHINE_CONFIG_START(astrocde_state::profpac) MCFG_DEVICE_MODIFY("bank4000") MCFG_DEVICE_PROGRAM_MAP(profpac_bank4000_map) MCFG_ADDRESS_MAP_BANK_ADDR_WIDTH(20) + + MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // 74LS174 on game board at U6 + MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("led0")) + MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("led1")) + + MCFG_DEVICE_ADD("lamplatch", OUTPUT_LATCH, 0) // 74LS174 on game board at U7 + MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp0")) // left lamp A + MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp1")) // left lamp B + MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp2")) // left lamp C + MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp3")) // right lamp A + MCFG_OUTPUT_LATCH_BIT5_HANDLER(OUTPUT("lamp4")) // right lamp B + MCFG_OUTPUT_LATCH_BIT6_HANDLER(OUTPUT("lamp5")) // right lamp C + + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO4_STROBE_CB(WRITE8("outlatch", output_latch_device, write)) + MCFG_ASTROCADE_IO_SO5_STROBE_CB(WRITE8("lamplatch", output_latch_device, write)) MACHINE_CONFIG_END MACHINE_CONFIG_START(astrocde_state::demndrgn) astrocade_16color_base(config); + astrocade_mono_sound(config); // used only for I/O /* basic machine hardware */ MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(demndrgn_map) - MCFG_DEVICE_IO_MAP(port_map_16col_pattern_nosound) + MCFG_DEVICE_IO_MAP(port_map_16col_pattern_demndrgn) + + MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) + MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<0>)) + MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(*this, astrocde_state, coin_counter_w<1>)) + MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("led0")) + MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("led1")) + MCFG_OUTPUT_LATCH_BIT4_HANDLER(WRITELINE(*this, astrocde_state, demndrgn_input_select_w)) + + MCFG_DEVICE_MODIFY("astrocade1") + MCFG_ASTROCADE_IO_SO4_STROBE_CB(WRITE8("outlatch", output_latch_device, write)) + MCFG_ASTROCADE_IO_POT0("FIREX") + MCFG_ASTROCADE_IO_POT1("FIREY") MACHINE_CONFIG_END @@ -1727,58 +1765,42 @@ ROM_END DRIVER_INIT_MEMBER(astrocde_state,seawolf2) { m_video_config = 0x00; - m_maincpu->space(AS_IO).install_write_handler(0x40, 0x40, 0, 0xff18, 0, write8_delegate(FUNC(astrocde_state::seawolf2_sound_1_w), this)); - m_maincpu->space(AS_IO).install_write_handler(0x41, 0x41, 0, 0xff18, 0, write8_delegate(FUNC(astrocde_state::seawolf2_sound_2_w), this)); - m_maincpu->space(AS_IO).install_write_handler(0x42, 0x43, 0, 0xff18, 0, write8_delegate(FUNC(astrocde_state::seawolf2_lamps_w), this)); } DRIVER_INIT_MEMBER(astrocde_state,ebases) { m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW; - m_maincpu->space(AS_IO).install_write_handler(0x20, 0x20, 0, 0xff07, 0, write8_delegate(FUNC(astrocde_state::ebases_coin_w), this)); - m_maincpu->space(AS_IO).install_write_handler(0x28, 0x28, 0, 0xff07, 0, write8_delegate(FUNC(astrocde_state::ebases_trackball_select_w), this)); } DRIVER_INIT_MEMBER(astrocde_state,spacezap) { m_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW; - m_maincpu->space(AS_IO).install_read_handler(0x13, 0x13, 0, 0xfc00, 0x0300, read8_delegate(FUNC(astrocde_state::spacezap_io_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,wow) { m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0, 0xf000, 0x0f00, read8_delegate(FUNC(astrocde_state::wow_io_r), this)); - m_maincpu->space(AS_IO).install_read_handler(0x17, 0x17, 0, 0x0000, 0xff00, read8_delegate(FUNC(astrocde_state::votrax_speech_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,gorf) { m_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0, 0xf000, 0x0f00, read8_delegate(FUNC(astrocde_state::gorf_io_1_r), this)); - m_maincpu->space(AS_IO).install_read_handler(0x16, 0x16, 0, 0xf000, 0x0f00, read8_delegate(FUNC(astrocde_state::gorf_io_2_r), this)); - m_maincpu->space(AS_IO).install_read_handler(0x17, 0x17, 0, 0x0000, 0xff00, read8_delegate(FUNC(astrocde_state::votrax_speech_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,robby) { m_video_config = AC_SOUND_PRESENT; - m_maincpu->space(AS_IO).install_read_handler(0x15, 0x15, 0, 0xf000, 0x0f00, read8_delegate(FUNC(astrocde_state::robby_io_r), this)); } DRIVER_INIT_MEMBER(astrocde_state,profpac) { - address_space &iospace = m_maincpu->space(AS_IO); - m_video_config = AC_SOUND_PRESENT; - iospace.install_read_handler(0x14, 0x14, 0, 0xf000, 0x0f00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r), this)); - iospace.install_read_handler(0x15, 0x15, 0, 0x8800, 0x7700, read8_delegate(FUNC(astrocde_state::profpac_io_2_r), this)); /* configure banking */ m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000); @@ -1788,13 +1810,7 @@ DRIVER_INIT_MEMBER(astrocde_state,profpac) DRIVER_INIT_MEMBER(astrocde_state,demndrgn) { - address_space &iospace = m_maincpu->space(AS_IO); - m_video_config = 0x00; - iospace.install_read_handler(0x14, 0x14, 0, 0xe000, 0x1f00, read8_delegate(FUNC(astrocde_state::demndrgn_io_r), this)); - iospace.install_read_port(0x1c, 0x1c, 0xff00, "FIREX"); - iospace.install_read_port(0x1d, 0x1d, 0xff00, "FIREY"); - iospace.install_write_handler(0x97, 0x97, 0, 0xff00, 0x0000, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w), this)); /* configure banking */ m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000); diff --git a/src/mame/drivers/astrohome.cpp b/src/mame/drivers/astrohome.cpp index c095ad6218c..e2ef8b4db8a 100644 --- a/src/mame/drivers/astrohome.cpp +++ b/src/mame/drivers/astrohome.cpp @@ -29,14 +29,20 @@ public: : astrocde_state(mconfig, type, tag) , m_cart(*this, "cartslot") , m_exp(*this, "exp") + , m_keypad(*this, "KEYPAD%u", 0U) { } + void astrocde(machine_config &config); +private: + DECLARE_READ8_MEMBER(inputs_r); + DECLARE_MACHINE_START(astrocde); + + void astrocade_io(address_map &map); + void astrocade_mem(address_map &map); + required_device m_cart; required_device m_exp; - DECLARE_MACHINE_START(astrocde); - void astrocde(machine_config &config); - void astrocade_io(address_map &map); - void astrocade_mem(address_map &map); + required_ioport_array<4> m_keypad; }; /********************************************************************************* @@ -64,7 +70,10 @@ void astrocde_mess_state::astrocade_mem(address_map &map) void astrocde_mess_state::astrocade_io(address_map &map) { - map(0x00, 0x1f).select(0xff00).rw(this, FUNC(astrocde_mess_state::astrocade_data_chip_register_r), FUNC(astrocde_mess_state::astrocade_data_chip_register_w)); + map(0x00, 0x0f).mirror(0xff00).rw(this, FUNC(astrocde_state::video_register_r), FUNC(astrocde_state::video_register_w)); + map(0x10, 0x1f).select(0xff00).r("astrocade1", FUNC(astrocade_io_device::read)); + map(0x10, 0x18).select(0xff00).w("astrocade1", FUNC(astrocade_io_device::write)); + map(0x19, 0x19).mirror(0xff00).w(this, FUNC(astrocde_state::expand_register_w)); } /************************************* @@ -90,6 +99,14 @@ void astrocde_mess_state::astrocade_io(address_map &map) * *************************************/ +READ8_MEMBER(astrocde_mess_state::inputs_r) +{ + if (BIT(offset, 2)) + return m_keypad[offset & 3]->read(); + else + return m_handle[offset & 3]->read(); +} + static INPUT_PORTS_START( astrocde ) PORT_START("P1HANDLE") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_8WAY @@ -216,7 +233,12 @@ MACHINE_CONFIG_START(astrocde_mess_state::astrocde) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("astrocade1", ASTROCADE, ASTROCADE_CLOCK/4) + MCFG_DEVICE_ADD("astrocade1", ASTROCADE_IO, ASTROCADE_CLOCK/4) + MCFG_ASTROCADE_IO_SI_READ_CB(READ8(*this, astrocde_mess_state, inputs_r)) + MCFG_ASTROCADE_IO_POT0("P1_KNOB") + MCFG_ASTROCADE_IO_POT1("P2_KNOB") + MCFG_ASTROCADE_IO_POT2("P3_KNOB") + MCFG_ASTROCADE_IO_POT3("P4_KNOB") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* expansion port */ diff --git a/src/mame/drivers/g627.cpp b/src/mame/drivers/g627.cpp index 7a8b6c56ade..aed13414f51 100644 --- a/src/mame/drivers/g627.cpp +++ b/src/mame/drivers/g627.cpp @@ -96,7 +96,7 @@ void g627_state::io_map(address_map &map) map.global_mask(0xff); map(0x00, 0x02).w(this, FUNC(g627_state::disp_w)); map(0x03, 0x07).w(this, FUNC(g627_state::lamp_w)); - map(0x10, 0x17).w("astrocade", FUNC(astrocade_device::astrocade_sound_w)); + map(0x10, 0x17).w("astrocade", FUNC(astrocade_io_device::write)); map(0x20, 0x27).rw("i8156", FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); } @@ -311,7 +311,7 @@ MACHINE_CONFIG_START(g627_state::g627) /* Sound */ genpin_audio(config); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("astrocade", ASTROCADE, 14138000/8) // 0066-117XX audio chip + MCFG_DEVICE_ADD("astrocade", ASTROCADE_IO, 14138000/8) // 0066-117XX audio chip MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* Video */ diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h index 06afff09e6b..22da5fb205d 100644 --- a/src/mame/includes/astrocde.h +++ b/src/mame/includes/astrocde.h @@ -43,18 +43,7 @@ public: m_soundlatch(*this, "soundlatch"), m_bank4000(*this, "bank4000"), m_bank8000(*this, "bank8000"), - m_p1handle(*this, "P1HANDLE"), - m_p2handle(*this, "P2HANDLE"), - m_p3handle(*this, "P3HANDLE"), - m_p4handle(*this, "P4HANDLE"), - m_keypad0(*this, "KEYPAD0"), - m_keypad1(*this, "KEYPAD1"), - m_keypad2(*this, "KEYPAD2"), - m_keypad3(*this, "KEYPAD3"), - m_p1_knob(*this, "P1_KNOB"), - m_p2_knob(*this, "P2_KNOB"), - m_p3_knob(*this, "P3_KNOB"), - m_p4_knob(*this, "P4_KNOB"), + m_handle(*this, "P%uHANDLE", 1U), m_trackball(*this, { { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" } }), m_joystick(*this, { { "MOVEX", "MOVEY" } }), m_interrupt_scanline(0xff) @@ -64,25 +53,14 @@ public: optional_device m_subcpu; optional_device m_samples; optional_device m_votrax; - optional_device m_astrocade_sound1; + optional_device m_astrocade_sound1; optional_shared_ptr m_videoram; optional_shared_ptr m_protected_ram; required_device m_screen; optional_device m_soundlatch; optional_device m_bank4000; optional_memory_bank m_bank8000; - optional_ioport m_p1handle; - optional_ioport m_p2handle; - optional_ioport m_p3handle; - optional_ioport m_p4handle; - optional_ioport m_keypad0; - optional_ioport m_keypad1; - optional_ioport m_keypad2; - optional_ioport m_keypad3; - optional_ioport m_p1_knob; - optional_ioport m_p2_knob; - optional_ioport m_p3_knob; - optional_ioport m_p4_knob; + optional_ioport_array<4> m_handle; optional_ioport_array<4> m_trackball; optional_ioport_array<2> m_joystick; @@ -136,28 +114,25 @@ public: DECLARE_WRITE8_MEMBER(protected_ram_enable_w); DECLARE_READ8_MEMBER(protected_ram_r); DECLARE_WRITE8_MEMBER(protected_ram_w); - DECLARE_WRITE8_MEMBER(seawolf2_lamps_w); DECLARE_WRITE8_MEMBER(seawolf2_sound_1_w); DECLARE_WRITE8_MEMBER(seawolf2_sound_2_w); DECLARE_WRITE8_MEMBER(ebases_trackball_select_w); DECLARE_WRITE8_MEMBER(ebases_coin_w); - DECLARE_READ8_MEMBER(spacezap_io_r); - DECLARE_READ8_MEMBER(wow_io_r); - DECLARE_READ8_MEMBER(gorf_io_1_r); - DECLARE_READ8_MEMBER(gorf_io_2_r); - DECLARE_READ8_MEMBER(robby_io_r); - DECLARE_READ8_MEMBER(profpac_io_1_r); - DECLARE_READ8_MEMBER(profpac_io_2_r); + DECLARE_READ8_MEMBER(input_mux_r); + template DECLARE_WRITE_LINE_MEMBER(coin_counter_w); + template DECLARE_WRITE_LINE_MEMBER(sparkle_w); + DECLARE_WRITE_LINE_MEMBER(gorf_sound_switch_w); DECLARE_WRITE8_MEMBER(profpac_banksw_w); DECLARE_WRITE8_MEMBER(demndrgn_banksw_w); - DECLARE_READ8_MEMBER(demndrgn_io_r); + DECLARE_WRITE_LINE_MEMBER(demndrgn_input_select_w); DECLARE_WRITE8_MEMBER(demndrgn_sound_w); DECLARE_WRITE8_MEMBER(tenpindx_lamp_w); DECLARE_WRITE8_MEMBER(tenpindx_counter_w); DECLARE_WRITE8_MEMBER(tenpindx_lights_w); - DECLARE_READ8_MEMBER(astrocade_data_chip_register_r); - DECLARE_WRITE8_MEMBER(astrocade_data_chip_register_w); + DECLARE_READ8_MEMBER(video_register_r); + DECLARE_WRITE8_MEMBER(video_register_w); DECLARE_WRITE8_MEMBER(astrocade_funcgen_w); + DECLARE_WRITE8_MEMBER(expand_register_w); DECLARE_WRITE8_MEMBER(astrocade_pattern_board_w); DECLARE_WRITE8_MEMBER(profpac_page_select_w); DECLARE_READ8_MEMBER(profpac_intercept_r); @@ -193,7 +168,7 @@ public: void init_sparklestar(); virtual void machine_start() override; - DECLARE_READ8_MEMBER( votrax_speech_r ); + DECLARE_WRITE8_MEMBER(votrax_speech_w); CUSTOM_INPUT_MEMBER( votrax_speech_status_r ); void astrocade_base(machine_config &config); @@ -213,8 +188,11 @@ public: void demndrgn_map(address_map &map); void ebases_map(address_map &map); void port_map(address_map &map); + void port_map_discrete(address_map &map); + void port_map_ebases(address_map &map); void port_map_16col_pattern(address_map &map); void port_map_16col_pattern_nosound(address_map &map); + void port_map_16col_pattern_demndrgn(address_map &map); void port_map_16col_pattern_tenpindx(address_map &map); void port_map_mono_pattern(address_map &map); void port_map_stereo_pattern(address_map &map); diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp index f90564e4077..cc53ca0cf1a 100644 --- a/src/mame/video/astrocde.cpp +++ b/src/mame/video/astrocde.cpp @@ -469,151 +469,100 @@ TIMER_CALLBACK_MEMBER(astrocde_state::scanline_callback) * *************************************/ -READ8_MEMBER(astrocde_state::astrocade_data_chip_register_r) +READ8_MEMBER(astrocde_state::video_register_r) { uint8_t result = 0xff; /* these are the core registers */ switch (offset & 0xff) { - case 0x08: /* intercept feedback */ - result = m_funcgen_intercept; - m_funcgen_intercept = 0; - break; + case 0x08: /* intercept feedback */ + result = m_funcgen_intercept; + m_funcgen_intercept = 0; + break; - case 0x0e: /* vertical feedback (from lightpen interrupt) */ - result = m_vertical_feedback; - break; + case 0x0e: /* vertical feedback (from lightpen interrupt) */ + result = m_vertical_feedback; + break; - case 0x0f: /* horizontal feedback (from lightpen interrupt) */ - result = m_horizontal_feedback; - break; - - case 0x10: /* player 1 handle */ - result = m_p1handle.read_safe(0xff); - break; - - case 0x11: /* player 2 handle */ - result = m_p2handle.read_safe(0xff); - break; - - case 0x12: /* player 3 handle */ - result = m_p3handle.read_safe(0xff); - break; - - case 0x13: /* player 4 handle */ - result = m_p4handle.read_safe(0xff); - break; - - case 0x14: /* keypad column 0 */ - result = m_keypad0.read_safe(0xff); - break; - - case 0x15: /* keypad column 1 */ - result = m_keypad1.read_safe(0xff); - break; - - case 0x16: /* keypad column 2 */ - result = m_keypad2.read_safe(0xff); - break; - - case 0x17: /* keypad column 3 */ - result = m_keypad3.read_safe(0xff); - break; - - case 0x1c: /* player 1 knob */ - result = m_p1_knob.read_safe(0xff); - break; - - case 0x1d: /* player 2 knob */ - result = m_p2_knob.read_safe(0xff); - break; - - case 0x1e: /* player 3 knob */ - result = m_p3_knob.read_safe(0xff); - break; - - case 0x1f: /* player 4 knob */ - result = m_p4_knob.read_safe(0xff); - break; + case 0x0f: /* horizontal feedback (from lightpen interrupt) */ + result = m_horizontal_feedback; + break; } return result; } -WRITE8_MEMBER(astrocde_state::astrocade_data_chip_register_w) +WRITE8_MEMBER(astrocde_state::video_register_w) { /* these are the core registers */ switch (offset & 0xff) { - case 0x00: /* color table is in registers 0-7 */ - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - m_colors[offset & 7] = data; - break; + case 0x00: /* color table is in registers 0-7 */ + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + m_colors[offset & 7] = data; + break; - case 0x08: /* mode register */ - m_video_mode = data & 1; - break; + case 0x08: /* mode register */ + m_video_mode = data & 1; + break; - case 0x09: /* color split pixel */ - m_colorsplit = 2 * (data & 0x3f); - m_bgdata = ((data & 0xc0) >> 6) * 0x55; - break; + case 0x09: /* color split pixel */ + m_colorsplit = 2 * (data & 0x3f); + m_bgdata = ((data & 0xc0) >> 6) * 0x55; + break; - case 0x0a: /* vertical blank register */ - m_vblank = data; - break; + case 0x0a: /* vertical blank register */ + m_vblank = data; + break; - case 0x0b: /* color block transfer */ - m_colors[(offset >> 8) & 7] = data; - break; + case 0x0b: /* color block transfer */ + m_colors[(offset >> 8) & 7] = data; + break; - case 0x0c: /* function generator */ - m_funcgen_control = data; - m_funcgen_expand_count = 0; /* reset flip-flop for expand mode on write to this register */ - m_funcgen_rotate_count = 0; /* reset counter for rotate mode on write to this register */ - m_funcgen_shift_prev_data = 0; /* reset shift buffer on write to this register */ - break; + case 0x0c: /* function generator */ + m_funcgen_control = data; + m_funcgen_expand_count = 0; /* reset flip-flop for expand mode on write to this register */ + m_funcgen_rotate_count = 0; /* reset counter for rotate mode on write to this register */ + m_funcgen_shift_prev_data = 0; /* reset shift buffer on write to this register */ + break; - case 0x0d: /* interrupt feedback */ - m_interrupt_vector = data; - m_maincpu->set_input_line(0, CLEAR_LINE); - break; + case 0x0d: /* interrupt feedback */ + m_interrupt_vector = data; + m_maincpu->set_input_line(0, CLEAR_LINE); + break; - case 0x0e: /* interrupt enable and mode */ - m_interrupt_enabl = data; - m_maincpu->set_input_line(0, CLEAR_LINE); - break; + case 0x0e: /* interrupt enable and mode */ + m_interrupt_enabl = data; + m_maincpu->set_input_line(0, CLEAR_LINE); + break; - case 0x0f: /* interrupt line */ - m_interrupt_scanline = data; - m_maincpu->set_input_line(0, CLEAR_LINE); - break; + case 0x0f: /* interrupt line */ + m_interrupt_scanline = data; + m_maincpu->set_input_line(0, CLEAR_LINE); + break; - case 0x10: /* master oscillator register */ - case 0x11: /* tone A frequency register */ - case 0x12: /* tone B frequency register */ - case 0x13: /* tone C frequency register */ - case 0x14: /* vibrato register */ - case 0x15: /* tone C volume, noise modulation and MUX register */ - case 0x16: /* tone A volume and tone B volume register */ - case 0x17: /* noise volume register */ - case 0x18: /* sound block transfer */ - if (m_video_config & AC_SOUND_PRESENT) - m_astrocade_sound1->astrocade_sound_w(space, offset, data); - break; - - case 0x19: /* expand register */ - m_funcgen_expand_color[0] = data & 0x03; - m_funcgen_expand_color[1] = (data >> 2) & 0x03; - break; +#ifdef UNUSED_OLD_CODE + case 0x10: /* master oscillator register */ + case 0x11: /* tone A frequency register */ + case 0x12: /* tone B frequency register */ + case 0x13: /* tone C frequency register */ + case 0x14: /* vibrato register */ + case 0x15: /* tone C volume, noise modulation and MUX register */ + case 0x16: /* tone A volume and tone B volume register */ + case 0x17: /* noise volume register */ + case 0x18: /* sound block transfer */ + if (m_video_config & AC_SOUND_PRESENT) + m_astrocade_sound1->write(space, offset, data); + break; +#endif } } @@ -713,6 +662,13 @@ WRITE8_MEMBER(astrocde_state::astrocade_funcgen_w) } +WRITE8_MEMBER(astrocde_state::expand_register_w) +{ + m_funcgen_expand_color[0] = data & 0x03; + m_funcgen_expand_color[1] = (data >> 2) & 0x03; +} + + /************************************* * From 21cadd2246cbc2e0117233b200d1735b31cb4e77 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 9 May 2018 10:04:32 -0400 Subject: [PATCH 3/4] Fix tiny build (nw) --- scripts/target/mame/tiny.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 1ea68a3eaf5..89f29aface1 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -68,6 +68,7 @@ MACHINES["Z80PIO"] = true MACHINES["68681"] = true MACHINES["BANKDEV"] = true MACHINES["GEN_LATCH"] = true +MACHINES["OUTPUT_LATCH"] = true MACHINES["TICKET"] = true MACHINES["WATCHDOG"] = true From e93b99f9364f34bc2b47e389d0afaa61a3f2f307 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 10 May 2018 00:30:00 +1000 Subject: [PATCH 4/4] (nw) remove more low-value macros and add a couple more constructor options --- src/devices/bus/einstein/pipe/speculator.cpp | 8 ++---- src/devices/bus/vcs/scharger.cpp | 2 +- src/devices/sound/wave.cpp | 6 ++-- src/devices/sound/wave.h | 22 ++++++-------- src/devices/video/nt7534.h | 5 +--- src/mame/drivers/a5105.cpp | 6 ++-- src/mame/drivers/a6809.cpp | 3 +- src/mame/drivers/abc80.cpp | 3 +- src/mame/drivers/ac1.cpp | 3 +- src/mame/drivers/acrnsys1.cpp | 3 +- src/mame/drivers/aim65.cpp | 3 +- src/mame/drivers/alphatro.cpp | 6 ++-- src/mame/drivers/amstrad.cpp | 6 ++-- src/mame/drivers/apf.cpp | 3 +- src/mame/drivers/apogee.cpp | 3 +- src/mame/drivers/applix.cpp | 3 +- src/mame/drivers/binbug.cpp | 6 ++-- src/mame/drivers/bk.cpp | 3 +- src/mame/drivers/bmjr.cpp | 6 ++-- src/mame/drivers/bml3.cpp | 6 ++-- src/mame/drivers/c80.cpp | 3 +- src/mame/drivers/camplynx.cpp | 3 +- src/mame/drivers/cd2650.cpp | 6 ++-- src/mame/drivers/coco12.cpp | 6 ++-- src/mame/drivers/controlid.cpp | 29 ++++++++++--------- src/mame/drivers/crvision.cpp | 6 ++-- src/mame/drivers/d6800.cpp | 6 ++-- src/mame/drivers/dai.cpp | 7 ++--- src/mame/drivers/dolphunk.cpp | 6 ++-- src/mame/drivers/elwro800.cpp | 6 ++-- src/mame/drivers/et3400.cpp | 3 +- src/mame/drivers/excali64.cpp | 6 ++-- src/mame/drivers/fc100.cpp | 3 +- src/mame/drivers/fm7.cpp | 30 +++++++------------- src/mame/drivers/galaxy.cpp | 8 ++---- src/mame/drivers/h8.cpp | 6 ++-- src/mame/drivers/homelab.cpp | 9 ++---- src/mame/drivers/instruct.cpp | 3 +- src/mame/drivers/jr100.cpp | 6 ++-- src/mame/drivers/jtc.cpp | 6 ++-- src/mame/drivers/jupace.cpp | 6 ++-- src/mame/drivers/kc.cpp | 12 +++----- src/mame/drivers/lola8a.cpp | 3 +- src/mame/drivers/lviv.cpp | 6 ++-- src/mame/drivers/mbee.cpp | 12 +++----- src/mame/drivers/mc1502.cpp | 5 ++-- src/mame/drivers/mekd2.cpp | 3 +- src/mame/drivers/microtan.cpp | 3 +- src/mame/drivers/mikro80.cpp | 3 +- src/mame/drivers/mikrosha.cpp | 3 +- src/mame/drivers/mk14.cpp | 3 +- src/mame/drivers/mkit09.cpp | 6 ++-- src/mame/drivers/msx.cpp | 9 ++---- src/mame/drivers/mycom.cpp | 3 +- src/mame/drivers/mz2000.cpp | 6 ++-- src/mame/drivers/mz700.cpp | 6 ++-- src/mame/drivers/mz80.cpp | 6 ++-- src/mame/drivers/ondra.cpp | 3 +- src/mame/drivers/orao.cpp | 6 ++-- src/mame/drivers/oric.cpp | 3 +- src/mame/drivers/orion.cpp | 15 ++++------ src/mame/drivers/partner.cpp | 3 +- src/mame/drivers/pc6001.cpp | 3 +- src/mame/drivers/pcm.cpp | 6 ++-- src/mame/drivers/pegasus.cpp | 3 +- src/mame/drivers/pencil2.cpp | 3 +- src/mame/drivers/phc25.cpp | 3 +- src/mame/drivers/phunsy.cpp | 6 ++-- src/mame/drivers/pk8000.cpp | 6 ++-- src/mame/drivers/pk8020.cpp | 6 ++-- src/mame/drivers/pmd85.cpp | 3 +- src/mame/drivers/poly88.cpp | 3 +- src/mame/drivers/pp01.cpp | 6 ++-- src/mame/drivers/primo.cpp | 6 ++-- src/mame/drivers/pro80.cpp | 3 +- src/mame/drivers/proteus3.cpp | 3 +- src/mame/drivers/ptcsol.cpp | 9 ++---- src/mame/drivers/pv2000.cpp | 3 +- src/mame/drivers/px8.cpp | 3 +- src/mame/drivers/radio86.cpp | 3 +- src/mame/drivers/ravens.cpp | 6 ++-- src/mame/drivers/rx78.cpp | 3 +- src/mame/drivers/sorcerer.cpp | 6 ++-- src/mame/drivers/spc1000.cpp | 3 +- src/mame/drivers/spc1500.cpp | 3 +- src/mame/drivers/special.cpp | 10 +++---- src/mame/drivers/spectrum.cpp | 6 ++-- src/mame/drivers/super80.cpp | 12 +++----- src/mame/drivers/svi318.cpp | 6 ++-- src/mame/drivers/tavernie.cpp | 3 +- src/mame/drivers/tec1.cpp | 8 ++---- src/mame/drivers/ti99_4p.cpp | 3 +- src/mame/drivers/ti99_4x.cpp | 9 ++---- src/mame/drivers/ti99_8.cpp | 3 +- src/mame/drivers/tm990189.cpp | 12 +++----- src/mame/drivers/trs80.cpp | 6 ++-- src/mame/drivers/tutor.cpp | 3 +- src/mame/drivers/ut88.cpp | 8 ++---- src/mame/drivers/vc4000.cpp | 3 +- src/mame/drivers/vector06.cpp | 3 +- src/mame/drivers/vg5k.cpp | 5 ++-- src/mame/drivers/vtech1.cpp | 3 +- src/mame/drivers/vtech2.cpp | 6 ++-- src/mame/drivers/x07.cpp | 6 ++-- src/mame/drivers/x1.cpp | 4 +-- src/mame/drivers/x1twin.cpp | 4 +-- src/mame/drivers/z1013.cpp | 3 +- src/mame/drivers/z9001.cpp | 6 ++-- src/mame/drivers/zx.cpp | 6 ++-- src/mame/includes/mbee.h | 2 +- src/mame/includes/sorcerer.h | 4 +-- src/mame/includes/super80.h | 2 +- src/mame/machine/coco.cpp | 2 +- src/mame/machine/hec2hrp.cpp | 3 +- src/mame/video/comx35.cpp | 6 ++-- src/mame/video/pecom.cpp | 3 +- 116 files changed, 226 insertions(+), 422 deletions(-) diff --git a/src/devices/bus/einstein/pipe/speculator.cpp b/src/devices/bus/einstein/pipe/speculator.cpp index 1925a55620f..8334f2d3f65 100644 --- a/src/devices/bus/einstein/pipe/speculator.cpp +++ b/src/devices/bus/einstein/pipe/speculator.cpp @@ -45,12 +45,10 @@ MACHINE_CONFIG_START(einstein_speculator_device::device_add_mconfig) MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITELINE(*this, einstein_speculator_device, ic5b_q_w)) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_CASSETTE_ADD("cassette") + MCFG_CASSETTE_ADD(m_cassette) MCFG_CASSETTE_FORMATS(tzx_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) MCFG_CASSETTE_INTERFACE("spectrum_cass") diff --git a/src/devices/bus/vcs/scharger.cpp b/src/devices/bus/vcs/scharger.cpp index 85ede8b6b26..36a9ee65acc 100644 --- a/src/devices/bus/vcs/scharger.cpp +++ b/src/devices/bus/vcs/scharger.cpp @@ -93,7 +93,7 @@ MACHINE_CONFIG_START(a26_rom_ss_device::device_add_mconfig) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("a2600_cass") -// MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") +// MCFG_SOUND_WAVE_ADD("wave", "cassette") // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END diff --git a/src/devices/sound/wave.cpp b/src/devices/sound/wave.cpp index c7dd698dab6..ac564f70226 100644 --- a/src/devices/sound/wave.cpp +++ b/src/devices/sound/wave.cpp @@ -25,13 +25,12 @@ -DEFINE_DEVICE_TYPE(WAVE, wave_device, "wave", "Wave") +DEFINE_DEVICE_TYPE(WAVE, wave_device, "wave", "Cassette Sound") wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WAVE, tag, owner, clock) , device_sound_interface(mconfig, *this) - , m_cassette_tag(nullptr) - , m_cass(nullptr) + , m_cass(*this, finder_base::DUMMY_TAG) { } @@ -47,7 +46,6 @@ void wave_device::device_start() machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate()); else machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate()); - m_cass = owner()->subdevice(m_cassette_tag); } //------------------------------------------------- diff --git a/src/devices/sound/wave.h b/src/devices/sound/wave.h index 27ad6f18682..fe5cf6b51a2 100644 --- a/src/devices/sound/wave.h +++ b/src/devices/sound/wave.h @@ -15,9 +15,15 @@ class wave_device : public device_t, public device_sound_interface { public: - wave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template + wave_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cassette_tag) + : wave_device(mconfig, tag, owner, uint32_t(0)) + { + m_cass.set_tag(std::forward(cassette_tag)); + } + wave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - void set_cassette_tag(const char *cassette_tag) { m_cassette_tag = cassette_tag; } + template void set_cassette_tag(T &&cassette_tag) { m_cass.set_tag(std::forward(cassette_tag)); } protected: // device-level overrides @@ -27,19 +33,9 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - const char *m_cassette_tag; - cassette_image_device *m_cass; + required_device m_cass; }; DECLARE_DEVICE_TYPE(WAVE, wave_device) - -#define WAVE_TAG "wave" -#define WAVE2_TAG "wave2" - - -#define MCFG_SOUND_WAVE_ADD(_tag, _cass_tag) \ - MCFG_DEVICE_ADD( _tag, WAVE, 0 ) \ - downcast(*device).set_cassette_tag(_cass_tag); - #endif // MAME_SOUND_WAVE_H diff --git a/src/devices/video/nt7534.h b/src/devices/video/nt7534.h index 210ca50552c..06e37d2bd26 100644 --- a/src/devices/video/nt7534.h +++ b/src/devices/video/nt7534.h @@ -12,9 +12,6 @@ #pragma once -#define MCFG_NT7534_ADD( _tag ) \ - MCFG_DEVICE_ADD( _tag, NT7534, 0 ) - #define MCFG_NT7534_PIXEL_UPDATE_CB(_class, _method) \ downcast(*device).set_pixel_update_cb(nt7534_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this)); @@ -33,7 +30,7 @@ public: typedef device_delegate pixel_update_delegate; // construction/destruction - nt7534_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nt7534_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); template void set_pixel_update_cb(Object &&cb) { m_pixel_update_cb = std::forward(cb); } diff --git a/src/mame/drivers/a5105.cpp b/src/mame/drivers/a5105.cpp index b2204c52f10..84a8ec7c967 100644 --- a/src/mame/drivers/a5105.cpp +++ b/src/mame/drivers/a5105.cpp @@ -586,10 +586,8 @@ MACHINE_CONFIG_START(a5105_state::a5105) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("beeper", BEEP, 500) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + BEEP(config, "beeper", 500).add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_DEVICE_ADD("upd7220", UPD7220, XTAL(15'000'000) / 16) // unk clock diff --git a/src/mame/drivers/a6809.cpp b/src/mame/drivers/a6809.cpp index 13757281abd..78bfb85efc2 100644 --- a/src/mame/drivers/a6809.cpp +++ b/src/mame/drivers/a6809.cpp @@ -240,8 +240,7 @@ MACHINE_CONFIG_START(a6809_state::a6809) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("via", VIA6522, XTAL(4'000'000) / 4) diff --git a/src/mame/drivers/abc80.cpp b/src/mame/drivers/abc80.cpp index ddc61a9262f..6d25a0aedb2 100644 --- a/src/mame/drivers/abc80.cpp +++ b/src/mame/drivers/abc80.cpp @@ -509,8 +509,7 @@ MACHINE_CONFIG_START(abc80_state::abc80) MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.1), RES_K(330)) // oneshot caps + res: C53 0.1u - R25 330k MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", CASSETTE_TAG).add_route(ALL_OUTPUTS, "mono", 0.25); // devices MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(11'980'800)/2/2) diff --git a/src/mame/drivers/ac1.cpp b/src/mame/drivers/ac1.cpp index ecb7cdda717..18e850b2b3c 100644 --- a/src/mame/drivers/ac1.cpp +++ b/src/mame/drivers/ac1.cpp @@ -155,8 +155,7 @@ MACHINE_CONFIG_START(ac1_state::ac1) MCFG_PALETTE_ADD_MONOCHROME("palette") SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MACHINE_CONFIG_END diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp index d8cb8ef1a56..d4a2fcd2f01 100644 --- a/src/mame/drivers/acrnsys1.cpp +++ b/src/mame/drivers/acrnsys1.cpp @@ -274,8 +274,7 @@ MACHINE_CONFIG_START(acrnsys1_state::acrnsys1) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* devices */ MCFG_DEVICE_ADD("b1", INS8154, 0) diff --git a/src/mame/drivers/aim65.cpp b/src/mame/drivers/aim65.cpp index a4dd3084356..8befd6904a7 100644 --- a/src/mame/drivers/aim65.cpp +++ b/src/mame/drivers/aim65.cpp @@ -207,8 +207,7 @@ MACHINE_CONFIG_START(aim65_state::aim65) /* Sound - wave sound only */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* other devices */ MCFG_DEVICE_ADD("riot", MOS6532_NEW, AIM65_CLOCK) diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp index f146f43f3a7..b001d796a72 100644 --- a/src/mame/drivers/alphatro.cpp +++ b/src/mame/drivers/alphatro.cpp @@ -717,10 +717,8 @@ MACHINE_CONFIG_START(alphatro_state::alphatro) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, 950) /* piezo-device needs to be measured */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + BEEP(config, "beeper", 950).add_route(ALL_OUTPUTS, "mono", 1.00); /* piezo-device needs to be measured */ + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_UPD765A_ADD("fdc", true, true) diff --git a/src/mame/drivers/amstrad.cpp b/src/mame/drivers/amstrad.cpp index 78ae761a2c3..829daa592a9 100644 --- a/src/mame/drivers/amstrad.cpp +++ b/src/mame/drivers/amstrad.cpp @@ -948,8 +948,7 @@ MACHINE_CONFIG_START(amstrad_state::amstrad_base) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("ay", AY8912, XTAL(16'000'000) / 16) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, amstrad_state, amstrad_psg_porta_read)) /* portA read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) @@ -1076,8 +1075,7 @@ MACHINE_CONFIG_START(amstrad_state::cpcplus) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("ay", AY8912, XTAL(40'000'000) / 40) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, amstrad_state, amstrad_psg_porta_read)) /* portA read */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/apf.cpp b/src/mame/drivers/apf.cpp index e9dc9a82e99..cc538bfe4a7 100644 --- a/src/mame/drivers/apf.cpp +++ b/src/mame/drivers/apf.cpp @@ -562,8 +562,7 @@ MACHINE_CONFIG_START(apf_state::apfimag) MCFG_RAM_DEFAULT_SIZE("8K") MCFG_RAM_EXTRA_OPTIONS("16K") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.15); MCFG_DEVICE_ADD("pia1", PIA6821, 0) MCFG_PIA_READPA_HANDLER(READ8(*this, apf_state, pia1_porta_r)) diff --git a/src/mame/drivers/apogee.cpp b/src/mame/drivers/apogee.cpp index e280fde1833..365bf5c07fc 100644 --- a/src/mame/drivers/apogee.cpp +++ b/src/mame/drivers/apogee.cpp @@ -254,8 +254,7 @@ MACHINE_CONFIG_START(apogee_state::apogee) MCFG_PALETTE_INIT_OWNER(apogee_state,radio86) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) MCFG_SPEAKER_LEVELS(4, speaker_levels) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp index 5174f8c052b..68c2be0417c 100644 --- a/src/mame/drivers/applix.cpp +++ b/src/mame/drivers/applix.cpp @@ -878,8 +878,7 @@ MACHINE_CONFIG_START(applix_state::applix) MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT) MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "lspeaker", 0.50); /* Devices */ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL(30'000'000) / 16) // MC6545 @ 1.875 MHz diff --git a/src/mame/drivers/binbug.cpp b/src/mame/drivers/binbug.cpp index 6bdeef87701..cdd24aca87b 100644 --- a/src/mame/drivers/binbug.cpp +++ b/src/mame/drivers/binbug.cpp @@ -325,8 +325,7 @@ MACHINE_CONFIG_START(binbug_state::binbug) /* Cassette */ MCFG_CASSETTE_ADD( "cassette" ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* quickload */ MCFG_QUICKLOAD_ADD("quickload", binbug_state, binbug, "pgm", 1) @@ -561,8 +560,7 @@ MACHINE_CONFIG_START(dg680_state::dg680) /* Cassette */ MCFG_CASSETTE_ADD( "cassette" ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(8'000'000) / 4) diff --git a/src/mame/drivers/bk.cpp b/src/mame/drivers/bk.cpp index 79bf5f50674..04782172016 100644 --- a/src/mame/drivers/bk.cpp +++ b/src/mame/drivers/bk.cpp @@ -184,8 +184,7 @@ MACHINE_CONFIG_START(bk_state::bk0010) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) diff --git a/src/mame/drivers/bmjr.cpp b/src/mame/drivers/bmjr.cpp index c3c93309e98..1d7b3f7945b 100644 --- a/src/mame/drivers/bmjr.cpp +++ b/src/mame/drivers/bmjr.cpp @@ -357,10 +357,8 @@ MACHINE_CONFIG_START(bmjr_state::bmjr) /* Audio */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, 1200) // guesswork - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); // guesswork + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp index abea68e0287..777a27b9266 100644 --- a/src/mame/drivers/bml3.cpp +++ b/src/mame/drivers/bml3.cpp @@ -1014,10 +1014,8 @@ MACHINE_CONFIG_START(bml3_state::bml3_common) /* Audio */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* slot devices */ MCFG_DEVICE_ADD("bml3bus", BML3BUS, 0) diff --git a/src/mame/drivers/c80.cpp b/src/mame/drivers/c80.cpp index 669fff0b3e8..a1df7752e73 100644 --- a/src/mame/drivers/c80.cpp +++ b/src/mame/drivers/c80.cpp @@ -279,8 +279,7 @@ MACHINE_CONFIG_START(c80_state::c80) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* internal ram */ MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mame/drivers/camplynx.cpp b/src/mame/drivers/camplynx.cpp index b3dd2be9943..1643938e786 100644 --- a/src/mame/drivers/camplynx.cpp +++ b/src/mame/drivers/camplynx.cpp @@ -851,8 +851,7 @@ MACHINE_CONFIG_START(camplynx_state::lynx_common) MCFG_DEVICE_ADD("dac", DAC_6BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.375) // unknown DAC MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.02) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.02); MACHINE_CONFIG_END MACHINE_CONFIG_START(camplynx_state::lynx_disk) diff --git a/src/mame/drivers/cd2650.cpp b/src/mame/drivers/cd2650.cpp index 97efb70a8f7..81b2bf1b5b6 100644 --- a/src/mame/drivers/cd2650.cpp +++ b/src/mame/drivers/cd2650.cpp @@ -316,10 +316,8 @@ MACHINE_CONFIG_START(cd2650_state::cd2650) /* Sound */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("beeper", BEEP, 950) // guess - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + BEEP(config, "beeper", 950).add_route(ALL_OUTPUTS, "mono", 0.50); // guess /* Devices */ MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp index b92724dc897..a59932d1556 100644 --- a/src/mame/drivers/coco12.cpp +++ b/src/mame/drivers/coco12.cpp @@ -390,11 +390,9 @@ MACHINE_CONFIG_START(coco_state::coco_sound) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) // Single-bit sound: R22 = 10K - MCFG_DEVICE_ADD("sbs", DAC_1BIT, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) + DAC_1BIT(config, "sbs", 0).add_route(ALL_OUTPUTS, "speaker", 0.125); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MACHINE_CONFIG_END diff --git a/src/mame/drivers/controlid.cpp b/src/mame/drivers/controlid.cpp index 2fd0d91642c..f2cbf683288 100644 --- a/src/mame/drivers/controlid.cpp +++ b/src/mame/drivers/controlid.cpp @@ -37,8 +37,9 @@ class controlidx628_state : public driver_device { public: controlidx628_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_lcdc(*this, "nt7534") { } + : driver_device(mconfig, type, tag) + , m_lcdc(*this, "nt7534") + { } void controlidx628(machine_config &config); private: @@ -113,26 +114,26 @@ PALETTE_INIT_MEMBER(controlidx628_state, controlidx628) MACHINE_CONFIG_START(controlidx628_state::controlidx628) // basic machine hardware - MCFG_DEVICE_ADD("maincpu", I80C32, XTAL(11'059'200)) /* Actually the board has an Atmel AT89S52 mcu. */ + MCFG_DEVICE_ADD("maincpu", I80C32, XTAL(11'059'200)) // Actually the board has an Atmel AT89S52 MCU. MCFG_DEVICE_PROGRAM_MAP(prog_map) MCFG_DEVICE_IO_MAP(io_map) MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, controlidx628_state, p0_w)) MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, controlidx628_state, p1_w)) MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, controlidx628_state, p3_w)) - /* video hardware */ - MCFG_SCREEN_ADD("screen", LCD) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_SIZE(132, 65) - MCFG_SCREEN_VISIBLE_AREA(3, 130, 0, 63) - MCFG_SCREEN_UPDATE_DEVICE("nt7534", nt7534_device, screen_update) - MCFG_SCREEN_PALETTE("palette") + // video hardware + MCFG_SCREEN_ADD("screen", LCD) + MCFG_SCREEN_REFRESH_RATE(50) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate + MCFG_SCREEN_SIZE(132, 65) + MCFG_SCREEN_VISIBLE_AREA(3, 130, 0, 63) + MCFG_SCREEN_UPDATE_DEVICE("nt7534", nt7534_device, screen_update) + MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 2) - MCFG_PALETTE_INIT_OWNER(controlidx628_state, controlidx628) + MCFG_PALETTE_ADD("palette", 2) + MCFG_PALETTE_INIT_OWNER(controlidx628_state, controlidx628) - MCFG_NT7534_ADD("nt7534") + NT7534(config, m_lcdc); MACHINE_CONFIG_END diff --git a/src/mame/drivers/crvision.cpp b/src/mame/drivers/crvision.cpp index 9896d32d214..9f58c09d6f6 100644 --- a/src/mame/drivers/crvision.cpp +++ b/src/mame/drivers/crvision.cpp @@ -768,8 +768,7 @@ MACHINE_CONFIG_START(crvision_state::creativision) MCFG_SN76496_READY_HANDLER(WRITELINE(PIA6821_TAG, pia6821_device, cb1_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(1, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(1, "mono", 0.25); // cartridge MCFG_CRVISION_CARTRIDGE_ADD("cartslot", crvision_cart, nullptr) @@ -852,8 +851,7 @@ MACHINE_CONFIG_START(laser2001_state::lasr2001) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(1, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(1, "mono", 0.25); // cartridge MCFG_CRVISION_CARTRIDGE_ADD("cartslot", crvision_cart, nullptr) diff --git a/src/mame/drivers/d6800.cpp b/src/mame/drivers/d6800.cpp index b511e13f820..43a33bcce3e 100644 --- a/src/mame/drivers/d6800.cpp +++ b/src/mame/drivers/d6800.cpp @@ -402,10 +402,8 @@ MACHINE_CONFIG_START(d6800_state::d6800) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.50); + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ MCFG_DEVICE_ADD("pia", PIA6821, 0) diff --git a/src/mame/drivers/dai.cpp b/src/mame/drivers/dai.cpp index 13efcd72d9b..2e1be7ce0f7 100644 --- a/src/mame/drivers/dai.cpp +++ b/src/mame/drivers/dai.cpp @@ -221,13 +221,10 @@ MACHINE_CONFIG_START(dai_state::dai) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("custom", DAI_SOUND) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) + DAI_SOUND(config, "custom").add_route(0, "lspeaker", 0.50).add_route(1, "rspeaker", 0.50); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/dolphunk.cpp b/src/mame/drivers/dolphunk.cpp index 50a57570a5e..8cf5655144a 100644 --- a/src/mame/drivers/dolphunk.cpp +++ b/src/mame/drivers/dolphunk.cpp @@ -244,13 +244,11 @@ MACHINE_CONFIG_START(dauphin_state::dauphin) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_TIMER_DRIVER_ADD_PERIODIC("dauphin_c", dauphin_state, dauphin_c, attotime::from_hz(4000)) MACHINE_CONFIG_END diff --git a/src/mame/drivers/elwro800.cpp b/src/mame/drivers/elwro800.cpp index 299dab5e777..bec5edd8149 100644 --- a/src/mame/drivers/elwro800.cpp +++ b/src/mame/drivers/elwro800.cpp @@ -614,10 +614,8 @@ MACHINE_CONFIG_START(elwro800_state::elwro800) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(tzx_cassette_formats) diff --git a/src/mame/drivers/et3400.cpp b/src/mame/drivers/et3400.cpp index 20c8036b25d..097a37bdcf0 100644 --- a/src/mame/drivers/et3400.cpp +++ b/src/mame/drivers/et3400.cpp @@ -251,8 +251,7 @@ MACHINE_CONFIG_START(et3400_state::et3400) MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/excali64.cpp b/src/mame/drivers/excali64.cpp index ed80866ccb0..e89095cac43 100644 --- a/src/mame/drivers/excali64.cpp +++ b/src/mame/drivers/excali64.cpp @@ -576,10 +576,8 @@ MACHINE_CONFIG_START(excali64_state::excali64) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* Video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/fc100.cpp b/src/mame/drivers/fc100.cpp index 2175c285e35..5e2bc11c47e 100644 --- a/src/mame/drivers/fc100.cpp +++ b/src/mame/drivers/fc100.cpp @@ -530,8 +530,7 @@ MACHINE_CONFIG_START(fc100_state::fc100) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MCFG_DEVICE_ADD("psg", AY8910, XTAL(7'159'090)/3/2) /* AY-3-8910 - clock not verified */ MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp index 03c354424e5..6196e0cf85b 100644 --- a/src/mame/drivers/fm7.cpp +++ b/src/mame/drivers/fm7.cpp @@ -2081,10 +2081,8 @@ MACHINE_CONFIG_START(fm7_state::fm7) SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("psg", AY8910, XTAL(4'915'200) / 4) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 1.00) - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_MACHINE_START_OVERRIDE(fm7_state,fm7) @@ -2134,10 +2132,8 @@ MACHINE_CONFIG_START(fm7_state::fm8) MCFG_QUANTUM_PERFECT_CPU("sub") SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_MACHINE_START_OVERRIDE(fm7_state,fm7) @@ -2187,10 +2183,8 @@ MACHINE_CONFIG_START(fm7_state::fm77av) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, fm7_state, fm77av_joy_1_r)) MCFG_AY8910_PORT_B_READ_CB(READ8(*this, fm7_state, fm77av_joy_2_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",1.0) - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_MACHINE_START_OVERRIDE(fm7_state,fm77av) @@ -2262,10 +2256,8 @@ MACHINE_CONFIG_START(fm7_state::fm11) MCFG_DEVICE_IO_MAP(fm11_x86_io) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_MACHINE_START_OVERRIDE(fm7_state,fm11) @@ -2327,10 +2319,8 @@ MACHINE_CONFIG_START(fm7_state::fm16beta) MCFG_QUANTUM_PERFECT_CPU("sub") SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, 1200) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.25) + BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_MACHINE_START_OVERRIDE(fm7_state,fm16) diff --git a/src/mame/drivers/galaxy.cpp b/src/mame/drivers/galaxy.cpp index 68cb071eeeb..d8d385fde6d 100644 --- a/src/mame/drivers/galaxy.cpp +++ b/src/mame/drivers/galaxy.cpp @@ -201,8 +201,7 @@ MACHINE_CONFIG_START(galaxy_state::galaxy) MCFG_SNAPSHOT_ADD("snapshot", galaxy_state, galaxy, "gal", 0) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(gtp_cassette_formats) @@ -244,9 +243,8 @@ MACHINE_CONFIG_START(galaxy_state::galaxyp) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("ay8910", AY8910, XTAL/4) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + MCFG_DEVICE_ADD("ay8910", AY8910, XTAL/4) // FIXME: really no output routes for this AY? + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(gtp_cassette_formats) diff --git a/src/mame/drivers/h8.cpp b/src/mame/drivers/h8.cpp index 106e1aa980f..daad3c0004f 100644 --- a/src/mame/drivers/h8.cpp +++ b/src/mame/drivers/h8.cpp @@ -323,10 +323,8 @@ MACHINE_CONFIG_START(h8_state::h8) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("beeper", BEEP, H8_BEEP_FRQ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + BEEP(config, "beeper", H8_BEEP_FRQ).add_route(ALL_OUTPUTS, "mono", 1.00); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("uart", I8251, 0) diff --git a/src/mame/drivers/homelab.cpp b/src/mame/drivers/homelab.cpp index 06d68a01768..44de590a4cd 100644 --- a/src/mame/drivers/homelab.cpp +++ b/src/mame/drivers/homelab.cpp @@ -770,8 +770,7 @@ MACHINE_CONFIG_START(homelab_state::homelab) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", 2) @@ -803,8 +802,7 @@ MACHINE_CONFIG_START(homelab_state::homelab3) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", 2) @@ -836,8 +834,7 @@ MACHINE_CONFIG_START(homelab_state::brailab4) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("mea8000", MEA8000, 3840000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) diff --git a/src/mame/drivers/instruct.cpp b/src/mame/drivers/instruct.cpp index 7ee4496297a..1570215fb88 100644 --- a/src/mame/drivers/instruct.cpp +++ b/src/mame/drivers/instruct.cpp @@ -437,8 +437,7 @@ MACHINE_CONFIG_START(instruct_state::instruct) /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/jr100.cpp b/src/mame/drivers/jr100.cpp index 7cc33da0951..fae0dd89df7 100644 --- a/src/mame/drivers/jr100.cpp +++ b/src/mame/drivers/jr100.cpp @@ -393,10 +393,8 @@ MACHINE_CONFIG_START(jr100_state::jr100) MCFG_VIA6522_CB2_HANDLER(WRITELINE(*this, jr100_state, jr100_via_write_cb2)) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00); MCFG_DEVICE_ADD("beeper", BEEP, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) diff --git a/src/mame/drivers/jtc.cpp b/src/mame/drivers/jtc.cpp index 6528e54ac6b..8f128e4b777 100644 --- a/src/mame/drivers/jtc.cpp +++ b/src/mame/drivers/jtc.cpp @@ -735,11 +735,9 @@ MACHINE_CONFIG_START(jtc_state::basic) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(1, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(1, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp index 3e7aebe2e4b..4572e985137 100644 --- a/src/mame/drivers/jupace.cpp +++ b/src/mame/drivers/jupace.cpp @@ -773,10 +773,8 @@ MACHINE_CONFIG_START(ace_state::ace) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00); MCFG_DEVICE_ADD(AY8910_TAG, AY8910, XTAL(6'500'000)/2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/kc.cpp b/src/mame/drivers/kc.cpp index 0f029f292d9..dd91b1dc447 100644 --- a/src/mame/drivers/kc.cpp +++ b/src/mame/drivers/kc.cpp @@ -134,10 +134,8 @@ MACHINE_CONFIG_START(kc_state::kc85_3) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ MCFG_QUICKLOAD_ADD("quickload", kc_state, kc, "kcc", 2) @@ -218,10 +216,8 @@ MACHINE_CONFIG_START(kc85_4_state::kc85_4) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ MCFG_QUICKLOAD_ADD("quickload", kc_state, kc, "kcc", 2) diff --git a/src/mame/drivers/lola8a.cpp b/src/mame/drivers/lola8a.cpp index 6be5316a130..8032ac61351 100644 --- a/src/mame/drivers/lola8a.cpp +++ b/src/mame/drivers/lola8a.cpp @@ -294,8 +294,7 @@ MACHINE_CONFIG_START(lola8a_state::lola8a) /* Cassette */ MCFG_CASSETTE_ADD( "cassette" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/lviv.cpp b/src/mame/drivers/lviv.cpp index b24c11a97e5..955bc2f082c 100644 --- a/src/mame/drivers/lviv.cpp +++ b/src/mame/drivers/lviv.cpp @@ -460,10 +460,8 @@ MACHINE_CONFIG_START(lviv_state::lviv) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* snapshot */ MCFG_SNAPSHOT_ADD("snapshot", lviv_state, lviv, "sav", 0) diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index 003d0a098b9..4e079930f80 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -677,10 +677,8 @@ MACHINE_CONFIG_START(mbee_state::mbee) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL(12'000'000) / 8) @@ -736,10 +734,8 @@ MACHINE_CONFIG_START(mbee_state::mbeeic) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* devices */ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8) diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp index 5034a49bc4d..6da6f30b4ec 100644 --- a/src/mame/drivers/mc1502.cpp +++ b/src/mame/drivers/mc1502.cpp @@ -297,9 +297,8 @@ MACHINE_CONFIG_START(mc1502_state::mc1502) MCFG_DEVICE_ADD("isa2", ISA8_SLOT, 0, "isa", mc1502_isa8_cards, "rom", false) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + WAVE(config, "wave", "cassette"); // FIXME: really no output routes for the cassette sound? + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.80); MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit6)) diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp index 0efda01cc51..3415d03753e 100644 --- a/src/mame/drivers/mekd2.cpp +++ b/src/mame/drivers/mekd2.cpp @@ -382,8 +382,7 @@ MACHINE_CONFIG_START(mekd2_state::mekd2) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/microtan.cpp b/src/mame/drivers/microtan.cpp index 218cf79c733..0c00f10eafe 100644 --- a/src/mame/drivers/microtan.cpp +++ b/src/mame/drivers/microtan.cpp @@ -232,8 +232,7 @@ MACHINE_CONFIG_START(microtan_state::microtan) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("ay8910.1", AY8910, 1000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) MCFG_DEVICE_ADD("ay8910.2", AY8910, 1000000) diff --git a/src/mame/drivers/mikro80.cpp b/src/mame/drivers/mikro80.cpp index 117ef167a9d..95c75791acf 100644 --- a/src/mame/drivers/mikro80.cpp +++ b/src/mame/drivers/mikro80.cpp @@ -188,8 +188,7 @@ MACHINE_CONFIG_START(mikro80_state::mikro80) MCFG_PALETTE_ADD_MONOCHROME("palette") SPEAKER(config, "speaker").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(rk8_cassette_formats) diff --git a/src/mame/drivers/mikrosha.cpp b/src/mame/drivers/mikrosha.cpp index accb19619fc..b2629cff9a7 100644 --- a/src/mame/drivers/mikrosha.cpp +++ b/src/mame/drivers/mikrosha.cpp @@ -245,8 +245,7 @@ MACHINE_CONFIG_START(mikrosha_state::mikrosha) MCFG_PALETTE_INIT_OWNER(mikrosha_state,radio86) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("dma8257", I8257, XTAL(16'000'000) / 9) MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, radio86_state, hrq_w)) diff --git a/src/mame/drivers/mk14.cpp b/src/mame/drivers/mk14.cpp index b4b17f8bc34..e06f4b781dd 100644 --- a/src/mame/drivers/mk14.cpp +++ b/src/mame/drivers/mk14.cpp @@ -211,8 +211,7 @@ MACHINE_CONFIG_START(mk14_state::mk14) // sound SPEAKER(config, "speaker").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.05); MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) MCFG_DEVICE_ADD("dac8", ZN425E, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // Ferranti ZN425E MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) diff --git a/src/mame/drivers/mkit09.cpp b/src/mame/drivers/mkit09.cpp index 8a3537c36ca..7e7456572dc 100644 --- a/src/mame/drivers/mkit09.cpp +++ b/src/mame/drivers/mkit09.cpp @@ -205,8 +205,7 @@ MACHINE_CONFIG_START(mkit09_state::mkit09) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("pia", PIA6821, 0) @@ -230,8 +229,7 @@ MACHINE_CONFIG_START(mkit09_state::mkit09a) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("pia", PIA6821, 0) diff --git a/src/mame/drivers/msx.cpp b/src/mame/drivers/msx.cpp index 6d12981e0a1..bc5fed2a61e 100644 --- a/src/mame/drivers/msx.cpp +++ b/src/mame/drivers/msx.cpp @@ -1365,8 +1365,7 @@ MACHINE_CONFIG_START(msx_state::msx) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(10'738'635)/3/2) MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, msx_state, msx_psg_port_a_r)) @@ -1518,8 +1517,7 @@ MACHINE_CONFIG_START(msx_state::msx2) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(21'477'272)/6/2) MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, msx_state, msx_psg_port_a_r)) @@ -1576,8 +1574,7 @@ MACHINE_CONFIG_START(msx_state::msx2p) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("ay8910", AY8910, XTAL(21'477'272)/6/2) MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, msx_state, msx_psg_port_a_r)) diff --git a/src/mame/drivers/mycom.cpp b/src/mame/drivers/mycom.cpp index f3c9d24a8a2..ef7aab41c9e 100644 --- a/src/mame/drivers/mycom.cpp +++ b/src/mame/drivers/mycom.cpp @@ -543,8 +543,7 @@ MACHINE_CONFIG_START(mycom_state::mycom) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MCFG_DEVICE_ADD("sn1", SN76489, XTAL(10'000'000) / 4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50) diff --git a/src/mame/drivers/mz2000.cpp b/src/mame/drivers/mz2000.cpp index b57ae7f001b..dd14b5eac6e 100644 --- a/src/mame/drivers/mz2000.cpp +++ b/src/mame/drivers/mz2000.cpp @@ -927,11 +927,9 @@ MACHINE_CONFIG_START(mz2000_state::mz2000) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("beeper", BEEP, 4096) - MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.15) + BEEP(config, "beeper", 4096).add_route(ALL_OUTPUTS,"mono",0.15); MACHINE_CONFIG_END MACHINE_CONFIG_START(mz2000_state::mz80b) diff --git a/src/mame/drivers/mz700.cpp b/src/mame/drivers/mz700.cpp index eda092ad40b..795b1219c56 100644 --- a/src/mame/drivers/mz700.cpp +++ b/src/mame/drivers/mz700.cpp @@ -398,10 +398,8 @@ MACHINE_CONFIG_START(mz_state::mz700) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* ne556 timers */ MCFG_TIMER_DRIVER_ADD_PERIODIC("cursor", mz_state, ne556_cursor_callback, attotime::from_hz(1.5)) diff --git a/src/mame/drivers/mz80.cpp b/src/mame/drivers/mz80.cpp index 7fc34aee344..d317a3e9a44 100644 --- a/src/mame/drivers/mz80.cpp +++ b/src/mame/drivers/mz80.cpp @@ -298,10 +298,8 @@ MACHINE_CONFIG_START(mz80_state::mz80k) /* Audio */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_DEVICE_ADD("ppi8255", I8255, 0) diff --git a/src/mame/drivers/ondra.cpp b/src/mame/drivers/ondra.cpp index 6aa0a83eb60..e640ef0719f 100644 --- a/src/mame/drivers/ondra.cpp +++ b/src/mame/drivers/ondra.cpp @@ -142,8 +142,7 @@ MACHINE_CONFIG_START(ondra_state::ondra) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) diff --git a/src/mame/drivers/orao.cpp b/src/mame/drivers/orao.cpp index 0b1e849e832..418452e0813 100644 --- a/src/mame/drivers/orao.cpp +++ b/src/mame/drivers/orao.cpp @@ -189,10 +189,8 @@ MACHINE_CONFIG_START(orao_state::orao) /* audio hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette") MCFG_CASSETTE_FORMATS(orao_cassette_formats) diff --git a/src/mame/drivers/oric.cpp b/src/mame/drivers/oric.cpp index f05f0f1b28c..bba9b07b128 100644 --- a/src/mame/drivers/oric.cpp +++ b/src/mame/drivers/oric.cpp @@ -790,8 +790,7 @@ MACHINE_CONFIG_START(oric_state::oric) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("ay8912", AY8912, XTAL(12'000'000)/12) MCFG_AY8910_OUTPUT_TYPE(AY8910_DISCRETE_OUTPUT) MCFG_AY8910_RES_LOADS(4700, 4700, 4700) diff --git a/src/mame/drivers/orion.cpp b/src/mame/drivers/orion.cpp index 19297b94ce7..5c880df930e 100644 --- a/src/mame/drivers/orion.cpp +++ b/src/mame/drivers/orion.cpp @@ -126,8 +126,7 @@ MACHINE_CONFIG_START(orion_state::orion128) MCFG_VIDEO_START_OVERRIDE(orion_state,orion128) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(rko_cassette_formats) @@ -202,10 +201,8 @@ MACHINE_CONFIG_START(orion_state::orionz80) MCFG_MC146818_ADD( "rtc", XTAL(4'194'304) ) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.0); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("ay8912", AY8912, 1773400) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) @@ -278,10 +275,8 @@ MACHINE_CONFIG_START(orion_state::orionpro) MCFG_VIDEO_START_OVERRIDE(orion_state,orion128) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.0); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("ay8912", AY8912, 1773400) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) diff --git a/src/mame/drivers/partner.cpp b/src/mame/drivers/partner.cpp index 815157f846b..c730204c4fa 100644 --- a/src/mame/drivers/partner.cpp +++ b/src/mame/drivers/partner.cpp @@ -199,8 +199,7 @@ MACHINE_CONFIG_START(partner_state::partner) MCFG_PALETTE_INIT_OWNER(partner_state,radio86) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("dma8257", I8257, XTAL(16'000'000) / 9) MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, partner_state, hrq_w)) diff --git a/src/mame/drivers/pc6001.cpp b/src/mame/drivers/pc6001.cpp index 6ab55b07326..4ed4910e381 100644 --- a/src/mame/drivers/pc6001.cpp +++ b/src/mame/drivers/pc6001.cpp @@ -1529,8 +1529,7 @@ MACHINE_CONFIG_START(pc6001_state::pc6001) MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) -// MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") -// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +// WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* TODO: accurate timing on this */ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", pc6001_state, keyboard_callback, attotime::from_hz(250)) diff --git a/src/mame/drivers/pcm.cpp b/src/mame/drivers/pcm.cpp index fc904af7b8c..2281aeff75e 100644 --- a/src/mame/drivers/pcm.cpp +++ b/src/mame/drivers/pcm.cpp @@ -274,10 +274,8 @@ MACHINE_CONFIG_START(pcm_state::pcm) /* Sound */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_K7659_KEYBOARD_ADD() diff --git a/src/mame/drivers/pegasus.cpp b/src/mame/drivers/pegasus.cpp index 7a2e2a99cb9..b3f4235f7c9 100644 --- a/src/mame/drivers/pegasus.cpp +++ b/src/mame/drivers/pegasus.cpp @@ -504,8 +504,7 @@ MACHINE_CONFIG_START(pegasus_state::pegasus) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* devices */ MCFG_DEVICE_ADD("pia_s", PIA6821, 0) diff --git a/src/mame/drivers/pencil2.cpp b/src/mame/drivers/pencil2.cpp index 4c263c4dc2d..8e9a17c869c 100644 --- a/src/mame/drivers/pencil2.cpp +++ b/src/mame/drivers/pencil2.cpp @@ -324,8 +324,7 @@ MACHINE_CONFIG_START(pencil2_state::pencil2) SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("sn76489a", SN76489A, XTAL(10'738'635)/3) // guess MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/phc25.cpp b/src/mame/drivers/phc25.cpp index a7b59c670c2..186d773b1e1 100644 --- a/src/mame/drivers/phc25.cpp +++ b/src/mame/drivers/phc25.cpp @@ -320,8 +320,7 @@ MACHINE_CONFIG_START(phc25_state::phc25) MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY0")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("JOY1")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.15); /* devices */ MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/phunsy.cpp b/src/mame/drivers/phunsy.cpp index 86a02788cf5..04cbba8809a 100644 --- a/src/mame/drivers/phunsy.cpp +++ b/src/mame/drivers/phunsy.cpp @@ -364,10 +364,8 @@ MACHINE_CONFIG_START(phunsy_state::phunsy) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) diff --git a/src/mame/drivers/pk8000.cpp b/src/mame/drivers/pk8000.cpp index a3fe9c08560..7682eb83e5b 100644 --- a/src/mame/drivers/pk8000.cpp +++ b/src/mame/drivers/pk8000.cpp @@ -390,10 +390,8 @@ MACHINE_CONFIG_START(pk8000_state::pk8000) /* audio hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp index f8de3af24ce..b589aa11bb1 100644 --- a/src/mame/drivers/pk8020.cpp +++ b/src/mame/drivers/pk8020.cpp @@ -235,10 +235,8 @@ MACHINE_CONFIG_START(pk8020_state::pk8020) /* audio hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.25); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) diff --git a/src/mame/drivers/pmd85.cpp b/src/mame/drivers/pmd85.cpp index 6e4e7488aaf..d1691091bfa 100644 --- a/src/mame/drivers/pmd85.cpp +++ b/src/mame/drivers/pmd85.cpp @@ -626,8 +626,7 @@ MACHINE_CONFIG_START(pmd85_state::pmd85) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/poly88.cpp b/src/mame/drivers/poly88.cpp index ad15d5675fd..7a87d734db5 100644 --- a/src/mame/drivers/poly88.cpp +++ b/src/mame/drivers/poly88.cpp @@ -218,8 +218,7 @@ MACHINE_CONFIG_START(poly88_state::poly88) /* audio hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/pp01.cpp b/src/mame/drivers/pp01.cpp index 601011b7117..266fc80e50f 100644 --- a/src/mame/drivers/pp01.cpp +++ b/src/mame/drivers/pp01.cpp @@ -220,10 +220,8 @@ MACHINE_CONFIG_START(pp01_state::pp01) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - //MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + //WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* Devices */ MCFG_DEVICE_ADD("uart", I8251, 0) diff --git a/src/mame/drivers/primo.cpp b/src/mame/drivers/primo.cpp index 6ba14d439bc..6fd39d067ce 100644 --- a/src/mame/drivers/primo.cpp +++ b/src/mame/drivers/primo.cpp @@ -265,10 +265,8 @@ MACHINE_CONFIG_START(primo_state::primoa32) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* snapshot/quickload */ MCFG_SNAPSHOT_ADD("snapshot", primo_state, primo, "pss", 0) diff --git a/src/mame/drivers/pro80.cpp b/src/mame/drivers/pro80.cpp index af8e5919964..e95ee7c8015 100644 --- a/src/mame/drivers/pro80.cpp +++ b/src/mame/drivers/pro80.cpp @@ -184,8 +184,7 @@ MACHINE_CONFIG_START(pro80_state::pro80) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/proteus3.cpp b/src/mame/drivers/proteus3.cpp index 933a9f5ca40..82b37b0419d 100644 --- a/src/mame/drivers/proteus3.cpp +++ b/src/mame/drivers/proteus3.cpp @@ -407,8 +407,7 @@ MACHINE_CONFIG_START(proteus3_state::proteus3) MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_c", proteus3_state, timer_c, attotime::from_hz(4800)) MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", proteus3_state, timer_p, attotime::from_hz(40000)) diff --git a/src/mame/drivers/ptcsol.cpp b/src/mame/drivers/ptcsol.cpp index 46bb1ff693d..223bf62319e 100644 --- a/src/mame/drivers/ptcsol.cpp +++ b/src/mame/drivers/ptcsol.cpp @@ -733,12 +733,9 @@ MACHINE_CONFIG_START(sol20_state::sol20) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.00) // music board - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) // cass1 speaker - MCFG_SOUND_WAVE_ADD(WAVE2_TAG, "cassette2") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) // cass2 speaker + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 2.00); // music board + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); // cass1 speaker + WAVE(config, "wave2", "cassette2").add_route(ALL_OUTPUTS, "mono", 0.05); // cass2 speaker // devices MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/pv2000.cpp b/src/mame/drivers/pv2000.cpp index d6caacf54f2..7568e06300f 100644 --- a/src/mame/drivers/pv2000.cpp +++ b/src/mame/drivers/pv2000.cpp @@ -404,8 +404,7 @@ MACHINE_CONFIG_START(pv2000_state::pv2000) MCFG_DEVICE_ADD("sn76489a", SN76489A, XTAL(7'159'090)/2) /* 3.579545 MHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/px8.cpp b/src/mame/drivers/px8.cpp index 2a0c2850b03..784fe625247 100644 --- a/src/mame/drivers/px8.cpp +++ b/src/mame/drivers/px8.cpp @@ -780,8 +780,7 @@ MACHINE_CONFIG_START(px8_state::px8) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(0, "mono", 0.25); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("capsule1", generic_plain_slot, "px8_cart") diff --git a/src/mame/drivers/radio86.cpp b/src/mame/drivers/radio86.cpp index 66102c49a95..506864cc965 100644 --- a/src/mame/drivers/radio86.cpp +++ b/src/mame/drivers/radio86.cpp @@ -380,8 +380,7 @@ MACHINE_CONFIG_START(radio86_state::radio86) MCFG_PALETTE_INIT_OWNER(radio86_state,radio86) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("dma8257", I8257, XTAL(16'000'000) / 9) MCFG_I8257_OUT_HRQ_CB(WRITELINE(*this, radio86_state, hrq_w)) diff --git a/src/mame/drivers/ravens.cpp b/src/mame/drivers/ravens.cpp index e212893fd62..1564e738855 100644 --- a/src/mame/drivers/ravens.cpp +++ b/src/mame/drivers/ravens.cpp @@ -353,8 +353,7 @@ MACHINE_CONFIG_START(ravens_state::ravens) /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MACHINE_CONFIG_END MACHINE_CONFIG_START(ravens_state::ravens2) @@ -377,8 +376,7 @@ MACHINE_CONFIG_START(ravens_state::ravens2) /* cassette */ MCFG_CASSETTE_ADD( "cassette" ) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mame/drivers/rx78.cpp b/src/mame/drivers/rx78.cpp index 3854d6d2a82..13aa65121a1 100644 --- a/src/mame/drivers/rx78.cpp +++ b/src/mame/drivers/rx78.cpp @@ -504,8 +504,7 @@ MACHINE_CONFIG_START(rx78_state::rx78) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("sn1", SN76489A, XTAL(28'636'363)/8) // unknown divider MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) diff --git a/src/mame/drivers/sorcerer.cpp b/src/mame/drivers/sorcerer.cpp index eb0a2138828..5d29f53f362 100644 --- a/src/mame/drivers/sorcerer.cpp +++ b/src/mame/drivers/sorcerer.cpp @@ -436,10 +436,8 @@ MACHINE_CONFIG_START(sorcerer_state::sorcerer) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) // cass1 speaker - MCFG_SOUND_WAVE_ADD(WAVE2_TAG, "cassette2") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) // cass2 speaker + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); // cass1 speaker + WAVE(config, "wave2", "cassette2").add_route(ALL_OUTPUTS, "mono", 0.05); // cass2 speaker MCFG_DEVICE_ADD( "uart", AY31015, 0 ) MCFG_AY31015_TX_CLOCK(ES_UART_CLOCK) diff --git a/src/mame/drivers/spc1000.cpp b/src/mame/drivers/spc1000.cpp index 905bb229c53..ec117cd8bd1 100644 --- a/src/mame/drivers/spc1000.cpp +++ b/src/mame/drivers/spc1000.cpp @@ -486,8 +486,7 @@ MACHINE_CONFIG_START(spc1000_state::spc1000) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spc1000_state, porta_r)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8("cent_data_out", output_latch_device, write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); MCFG_DEVICE_ADD("ext1", SPC1000_EXP_SLOT, 0) MCFG_DEVICE_SLOT_INTERFACE(spc1000_exp, nullptr, false) diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp index 6a4a055fadd..6fc4602c689 100644 --- a/src/mame/drivers/spc1500.cpp +++ b/src/mame/drivers/spc1500.cpp @@ -911,8 +911,7 @@ MACHINE_CONFIG_START(spc1500_state::spc1500) MCFG_AY8910_PORT_A_READ_CB(READ8(*this, spc1500_state, psga_r)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, spc1500_state, psgb_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, spc1500_state, centronics_busy_w)) diff --git a/src/mame/drivers/special.cpp b/src/mame/drivers/special.cpp index f30dd4b5072..3d090382d8a 100644 --- a/src/mame/drivers/special.cpp +++ b/src/mame/drivers/special.cpp @@ -384,12 +384,11 @@ MACHINE_CONFIG_START(special_state::special) /* audio hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625) + DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.0625); MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); /* Devices */ MCFG_DEVICE_ADD("ppi8255", I8255, 0) @@ -506,12 +505,11 @@ MACHINE_CONFIG_START(special_state::erik) /* audio hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.0625) + DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.0625); MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp index 77559a20ce8..2fbbe6aae8c 100644 --- a/src/mame/drivers/spectrum.cpp +++ b/src/mame/drivers/spectrum.cpp @@ -693,10 +693,8 @@ MACHINE_CONFIG_START(spectrum_state::spectrum_common) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* expansion port */ MCFG_SPECTRUM_EXPANSION_SLOT_ADD("exp", spectrum_expansion_devices, "kempjoy") diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp index 4f1443358a8..dd1f1b3011a 100644 --- a/src/mame/drivers/super80.cpp +++ b/src/mame/drivers/super80.cpp @@ -733,10 +733,8 @@ MACHINE_CONFIG_START(super80_state::super80) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_DEVICE_ADD("samples", SAMPLES) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_NAMES(relay_sample_names) @@ -827,10 +825,8 @@ MACHINE_CONFIG_START(super80_state::super80v) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); MCFG_DEVICE_ADD("samples", SAMPLES) MCFG_SAMPLES_CHANNELS(1) MCFG_SAMPLES_NAMES(relay_sample_names) diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp index a3c89879c21..05dc7471c0b 100644 --- a/src/mame/drivers/svi318.cpp +++ b/src/mame/drivers/svi318.cpp @@ -557,10 +557,8 @@ MACHINE_CONFIG_START(svi3x8_state::svi318) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.25); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("psg", AY8910, XTAL(10'738'635) / 6) MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY")) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, svi3x8_state, bank_w)) diff --git a/src/mame/drivers/tavernie.cpp b/src/mame/drivers/tavernie.cpp index 9663389f0b9..8bfa6763a43 100644 --- a/src/mame/drivers/tavernie.cpp +++ b/src/mame/drivers/tavernie.cpp @@ -301,8 +301,7 @@ MACHINE_CONFIG_START(tavernie_state::cpu09) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/tec1.cpp b/src/mame/drivers/tec1.cpp index e93aeebbb7e..d5db3a246a4 100644 --- a/src/mame/drivers/tec1.cpp +++ b/src/mame/drivers/tec1.cpp @@ -89,7 +89,7 @@ public: , m_maincpu(*this, "maincpu") , m_speaker(*this, "speaker") , m_cass(*this, "cassette") - , m_wave(*this, WAVE_TAG) + , m_wave(*this, "wave") , m_key_pressed(0) , m_io_line0(*this, "LINE0") , m_io_line1(*this, "LINE1") @@ -441,10 +441,8 @@ MACHINE_CONFIG_START(tec1_state::tecjmon) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index f00e3c8b46a..152702522d3 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -1038,8 +1038,7 @@ MACHINE_CONFIG_START(ti99_4p_state::ti99_4p_60hz) SPEAKER(config, "cass_out").front_center(); MCFG_CASSETTE_ADD( "cassette" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "cass_out", 0.25); // Joystick port MCFG_TI_JOYPORT4A_ADD( TI_JOYPORT_TAG ) diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 516bfc6c090..38e268c2959 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -900,8 +900,7 @@ MACHINE_CONFIG_START(ti99_4x_state::ti99_4) MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_ADD( "cassette2" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "cass_out", 0.25); // GROM devices MCFG_GROM_ADD( TI99_GROM0_TAG, 0, TI99_CONSOLEGROM, 0x0000, WRITELINE(*this, ti99_4x_state, console_ready_grom)) @@ -1019,8 +1018,7 @@ MACHINE_CONFIG_START(ti99_4x_state::ti99_4a) MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_ADD( "cassette2" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "cass_out", 0.25); // GROM devices MCFG_GROM_ADD( TI99_GROM0_TAG, 0, TI99_CONSOLEGROM, 0x0000, WRITELINE(*this, ti99_4x_state, console_ready_grom)) @@ -1176,8 +1174,7 @@ MACHINE_CONFIG_START(ti99_4x_state::ti99_4ev_60hz) MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_ADD( "cassette2" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "cass_out", 0.25); // GROM devices MCFG_GROM_ADD( TI99_GROM0_TAG, 0, TI99_CONSOLEGROM, 0x0000, WRITELINE(*this, ti99_4x_state, console_ready_grom)) diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index e26c51307d1..cda481fb9b1 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -794,8 +794,7 @@ MACHINE_CONFIG_START(ti99_8_state::ti99_8) // Cassette drive SPEAKER(config, "cass_out").front_center(); MCFG_CASSETTE_ADD( "cassette" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "cass_out", 0.25); // GROM library MCFG_GROM_ADD( TI998_SYSGROM0_TAG, 0, TI998_SYSGROM_REG, 0x0000, WRITELINE(TI998_MAINBOARD_TAG, bus::ti99::internal::mainboard8_device, system_grom_ready)) diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index c70b433b04a..1bcdd235e30 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -824,10 +824,8 @@ MACHINE_CONFIG_START(tm990189_state::tm990_189) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) @@ -885,10 +883,8 @@ MACHINE_CONFIG_START(tm990189_state::tm990_189_v) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) /* one two-level buzzer */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* one two-level buzzer */ /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mame/drivers/trs80.cpp b/src/mame/drivers/trs80.cpp index 765cd95205d..95fb05e333b 100644 --- a/src/mame/drivers/trs80.cpp +++ b/src/mame/drivers/trs80.cpp @@ -624,10 +624,8 @@ MACHINE_CONFIG_START(trs80_state::trs80) // the original model I, level I, /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05); /* devices */ MCFG_CASSETTE_ADD("cassette") diff --git a/src/mame/drivers/tutor.cpp b/src/mame/drivers/tutor.cpp index 0d4a12b652b..7bca1a782ae 100644 --- a/src/mame/drivers/tutor.cpp +++ b/src/mame/drivers/tutor.cpp @@ -760,8 +760,7 @@ MACHINE_CONFIG_START(tutor_state::tutor) MCFG_DEVICE_ADD("sn76489a", SN76489A, 3579545) /* 3.579545 MHz */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, tutor_state, write_centronics_busy)) diff --git a/src/mame/drivers/ut88.cpp b/src/mame/drivers/ut88.cpp index e5d44ed739f..daa58201e4e 100644 --- a/src/mame/drivers/ut88.cpp +++ b/src/mame/drivers/ut88.cpp @@ -209,12 +209,11 @@ MACHINE_CONFIG_START(ut88_state::ut88) /* audio hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); /* Devices */ MCFG_DEVICE_ADD("ppi8255", I8255A, 0) @@ -243,8 +242,7 @@ MACHINE_CONFIG_START(ut88_state::ut88mini) /* Cassette */ SPEAKER(config, "speaker").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(rku_cassette_formats) diff --git a/src/mame/drivers/vc4000.cpp b/src/mame/drivers/vc4000.cpp index ef822f4bfb9..28a7df52bb0 100644 --- a/src/mame/drivers/vc4000.cpp +++ b/src/mame/drivers/vc4000.cpp @@ -598,8 +598,7 @@ MACHINE_CONFIG_START(vc4000_state::elektor) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(elektor_mem) MCFG_CASSETTE_ADD( "cassette" ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END diff --git a/src/mame/drivers/vector06.cpp b/src/mame/drivers/vector06.cpp index 6d3615daaa9..4916a2bdc53 100644 --- a/src/mame/drivers/vector06.cpp +++ b/src/mame/drivers/vector06.cpp @@ -181,8 +181,7 @@ MACHINE_CONFIG_START(vector06_state::vector06) MCFG_PALETTE_INIT_OWNER(vector06_state, vector06) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* devices */ MCFG_DEVICE_ADD("ppi8255", I8255, 0) diff --git a/src/mame/drivers/vg5k.cpp b/src/mame/drivers/vg5k.cpp index 8e1efe3c1b1..84af1d80189 100644 --- a/src/mame/drivers/vg5k.cpp +++ b/src/mame/drivers/vg5k.cpp @@ -390,13 +390,12 @@ MACHINE_CONFIG_START(vg5k_state::vg5k) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.125) + DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.125); MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) /* cassette */ - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "speaker", 0.25) + WAVE(config, "wave", "cassette").add_route(0, "speaker", 0.25); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(vg5k_cassette_formats) diff --git a/src/mame/drivers/vtech1.cpp b/src/mame/drivers/vtech1.cpp index 412e495aeff..84c1faaf036 100644 --- a/src/mame/drivers/vtech1.cpp +++ b/src/mame/drivers/vtech1.cpp @@ -454,8 +454,7 @@ MACHINE_CONFIG_START(vtech1_state::laser110) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) MCFG_SPEAKER_LEVELS(4, speaker_levels) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) diff --git a/src/mame/drivers/vtech2.cpp b/src/mame/drivers/vtech2.cpp index 750a72739b8..c70a3222a77 100644 --- a/src/mame/drivers/vtech2.cpp +++ b/src/mame/drivers/vtech2.cpp @@ -439,10 +439,8 @@ MACHINE_CONFIG_START(vtech2_state::laser350) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.75); MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(vtech2_cassette_formats) diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index 6b48c637502..1354447ce39 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -1502,10 +1502,8 @@ MACHINE_CONFIG_START(x07_state::x07) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD( "beeper", BEEP, 0 ) - MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 0.50 ) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + BEEP(config, "beeper", 0).add_route(ALL_OUTPUTS, "mono", 0.50); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* printer */ MCFG_DEVICE_ADD("printer", PRINTER, 0) diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp index 67ebe6f1240..2721876a9d3 100644 --- a/src/mame/drivers/x1.cpp +++ b/src/mame/drivers/x1.cpp @@ -2276,9 +2276,7 @@ MACHINE_CONFIG_START(x1_state::x1) MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) MCFG_SOUND_ROUTE(1, "lspeaker", 0.5) MCFG_SOUND_ROUTE(2, "rspeaker", 0.5) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.10) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.10); MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_FORMATS(x1_cassette_formats) diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp index 1073a7158f4..f064e3cd8b0 100644 --- a/src/mame/drivers/x1twin.cpp +++ b/src/mame/drivers/x1twin.cpp @@ -507,9 +507,7 @@ MACHINE_CONFIG_START(x1twin_state::x1twin) MCFG_SOUND_ROUTE(0, "x1_r", 0.25) MCFG_SOUND_ROUTE(1, "x1_l", 0.5) MCFG_SOUND_ROUTE(2, "x1_r", 0.5) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "x1_l", 0.25) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "x1_r", 0.10) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "x1_l", 0.25).add_route(ALL_OUTPUTS, "x1_r", 0.10); MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_FORMATS(x1_cassette_formats) diff --git a/src/mame/drivers/z1013.cpp b/src/mame/drivers/z1013.cpp index ade01619763..3b36b37e063 100644 --- a/src/mame/drivers/z1013.cpp +++ b/src/mame/drivers/z1013.cpp @@ -388,8 +388,7 @@ MACHINE_CONFIG_START(z1013_state::z1013) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); /* devices */ MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(1'000'000)) diff --git a/src/mame/drivers/z9001.cpp b/src/mame/drivers/z9001.cpp index 350c5995b86..b60553b2615 100644 --- a/src/mame/drivers/z9001.cpp +++ b/src/mame/drivers/z9001.cpp @@ -224,10 +224,8 @@ MACHINE_CONFIG_START(z9001_state::z9001) /* Sound */ SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("beeper", BEEP, 800) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); + BEEP(config, "beeper", 800).add_route(ALL_OUTPUTS, "mono", 0.50); /* Devices */ MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) diff --git a/src/mame/drivers/zx.cpp b/src/mame/drivers/zx.cpp index 806e4c965e2..7eed9f24fc7 100644 --- a/src/mame/drivers/zx.cpp +++ b/src/mame/drivers/zx.cpp @@ -383,10 +383,8 @@ MACHINE_CONFIG_START(zx_state::zx81_spk ) /* sound hardware */ /* Used by pc8300/lambda/pow3000 */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.75); + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END MACHINE_CONFIG_START(zx_state::ts1000) diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index e95302af897..bae296595c8 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -45,7 +45,7 @@ public: , m_maincpu(*this, "maincpu") , m_pio(*this, "z80pio") , m_cassette(*this, "cassette") - , m_wave(*this, WAVE_TAG) + , m_wave(*this, "wave") , m_speaker(*this, "speaker") , m_centronics(*this, "centronics") , m_cent_data_out(*this, "cent_data_out") diff --git a/src/mame/includes/sorcerer.h b/src/mame/includes/sorcerer.h index abfef33f451..cd98658c694 100644 --- a/src/mame/includes/sorcerer.h +++ b/src/mame/includes/sorcerer.h @@ -56,8 +56,8 @@ public: , m_maincpu(*this, "maincpu") , m_cassette1(*this, "cassette") , m_cassette2(*this, "cassette2") - , m_wave1(*this, WAVE_TAG) - , m_wave2(*this, WAVE2_TAG) + , m_wave1(*this, "wave") + , m_wave2(*this, "wave2") , m_uart(*this, "uart") , m_rs232(*this, "rs232") , m_centronics(*this, "centronics") diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index cbeb5847b37..6d21adce8ac 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -40,7 +40,7 @@ public: , m_p_videoram(*this, "videoram") , m_pio(*this, "z80pio") , m_cassette(*this, "cassette") - , m_wave(*this, WAVE_TAG) + , m_wave(*this, "wave") , m_samples(*this, "samples") , m_speaker(*this, "speaker") , m_centronics(*this, "centronics") diff --git a/src/mame/machine/coco.cpp b/src/mame/machine/coco.cpp index cfb60864d67..345a8ed18e8 100644 --- a/src/mame/machine/coco.cpp +++ b/src/mame/machine/coco.cpp @@ -88,7 +88,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch m_pia_1(*this, PIA1_TAG), m_dac(*this, "dac"), m_sbs(*this, "sbs"), - m_wave(*this, WAVE_TAG), + m_wave(*this, "wave"), m_screen(*this, SCREEN_TAG), m_cococart(*this, CARTRIDGE_TAG), m_ram(*this, RAM_TAG), diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp index 0a4d30f5eac..3dbd3bf8df2 100644 --- a/src/mame/machine/hec2hrp.cpp +++ b/src/mame/machine/hec2hrp.cpp @@ -805,8 +805,7 @@ DISCRETE_SOUND_END MACHINE_CONFIG_START(hec2hrp_state::hector_audio) SPEAKER(config, "mono").front_center(); - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25) /* Sound level for cassette, as it is in mono => output channel=0*/ + WAVE(config, "wave", "cassette").add_route(0, "mono", 0.25); /* Sound level for cassette, as it is in mono => output channel=0*/ MCFG_DEVICE_ADD("sn76477", SN76477) MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter diff --git a/src/mame/video/comx35.cpp b/src/mame/video/comx35.cpp index d59b84b087e..2754d80d2d5 100644 --- a/src/mame/video/comx35.cpp +++ b/src/mame/video/comx35.cpp @@ -105,8 +105,7 @@ MACHINE_CONFIG_START(comx35_state::comx35_pal_video) MCFG_CDP1869_SET_SCREEN(SCREEN_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END MACHINE_CONFIG_START(comx35_state::comx35_ntsc_video) @@ -125,6 +124,5 @@ MACHINE_CONFIG_START(comx35_state::comx35_ntsc_video) MCFG_CDP1869_SET_SCREEN(SCREEN_TAG) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END diff --git a/src/mame/video/pecom.cpp b/src/mame/video/pecom.cpp index 37bed986e47..d013bb52a52 100644 --- a/src/mame/video/pecom.cpp +++ b/src/mame/video/pecom.cpp @@ -104,6 +104,5 @@ MACHINE_CONFIG_START(pecom_state::pecom_video) MCFG_CDP1869_PAL_NTSC_CALLBACK(VCC) MCFG_CDP1869_PRD_CALLBACK(WRITELINE(*this, pecom_state, pecom_prd_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); MACHINE_CONFIG_END