diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-12-17 20:22:48 +0100 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-12-17 20:27:50 +0100 |
commit | d7f75c954fe1bc30007ca7bef063db481e03d8af (patch) | |
tree | 4a50795f5c7a7178993864b518c1dd00d549e5be | |
parent | b8aff36f3cb48c753f4bf21399665d2c6a4efba5 (diff) |
-bus/a2bus/a2echoii, a800/a800_slot, a8sio: Removed MCFG macros. [Ryan Holtz]
-sound/pokey, sn76477, tms36xx, tms5110, tms5220: Removed MCFG macros. [Ryan Holtz]
-audio/astrof, bwidow, bzone, dkong, jedi, mw8080bw, n8080, scramble, segag80r, snk6502, zaccaria: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-drivers/asteroid, atari400, atarisy2, bagman, bartop52, bzone, ccastles, centiped, cloak, cloud9, dai3wksi,
exelv, foodf, gp_1, hh_tms1k, irobot, liberatr, looping, malzak, maxaflex, mhavoc, missile, mrgame,
naughtyb, quantum, rotaryf, route16, runaway, scyclone, spaceg, spectra, tempest, tispeak, toratora,
tunhunt: Removed MACHINE_CONFIG macros. [Ryan Holtz]
68 files changed, 2189 insertions, 2408 deletions
diff --git a/src/devices/bus/a2bus/a2echoii.cpp b/src/devices/bus/a2bus/a2echoii.cpp index edbd5dc5693..4bc6c9ccfb2 100644 --- a/src/devices/bus/a2bus/a2echoii.cpp +++ b/src/devices/bus/a2bus/a2echoii.cpp @@ -55,17 +55,23 @@ DEFINE_DEVICE_TYPE(A2BUS_ECHOII, a2bus_echoii_device, "a2echoii", "Street Electr // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(a2bus_echoii_device::device_add_mconfig) +void a2bus_echoii_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "echoii").front_center(); - MCFG_DEVICE_ADD(TMS_TAG, TMS5220, 640000) // Note the Echo II card has an R/C circuit (and sometimes a 'FREQ' potentiometer) to control the tms5220[c]'s clock frequency; 640khz is the nominal '8khz' value according to the TMS5220 datasheet. - // The EchoIIb card however has a 74LS92 which divides the apple2's Q3 ((14.318/7)MHz asymmetrical) clock by 6 to produce a 681.809khz/2 clock, which doesn't actually make sense, since the tms5220, unless it has a mask option (mentioned on the datasheet) to use a ceramic resonator instead of an r/c circuit, needs a clock at twice that speed. Could it be that the EchoIIb uses tsp5220C chips with a special mask option? + tms5220_device &tms(TMS5220(config, TMS_TAG, 640000)); + // Note the Echo II card has an R/C circuit (and sometimes a 'FREQ' potentiometer) to control the tms5220[c]'s clock frequency; 640khz is + // the nominal '8khz' value according to the TMS5220 datasheet. + // The EchoIIb card however has a 74LS92 which divides the apple2's Q3 ((14.318/7)MHz asymmetrical) clock by 6 to produce a 681.809khz/2 + // clock, which doesn't actually make sense, since the tms5220, unless it has a mask option (mentioned on the datasheet) to use a ceramic + // resonator instead of an r/c circuit, needs a clock at twice that speed. Could it be that the EchoIIb uses tsp5220C chips with a special + // mask option? // Some Old EchoII cards shipped with TMS5200(really?), some with TMS5220. Many (most?) were retrofitted with a TMS5220 or TMS5220C later. // The later VSM-socket-less EchoII shipped with a TMS5220. // The EchoIIb and later cards shipped with a TMS5220C - //MCFG_TMS52XX_IRQ_HANDLER(WRITELINE(*this, a2bus_echoii_device, tms_irq_callback)) - MCFG_TMS52XX_READYQ_HANDLER(WRITELINE(*this, a2bus_echoii_device, tms_readyq_callback)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "echoii", 1.0) -MACHINE_CONFIG_END + //tms.irq_cb().set(FUNC(a2bus_echoii_device::tms_irq_callback)); + tms.ready_cb().set(FUNC(a2bus_echoii_device::tms_readyq_callback)); + tms.add_route(ALL_OUTPUTS, "echoii", 1.0); +} //************************************************************************** // LIVE DEVICE diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index 569d912329c..cb31b6eacc2 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -12,6 +12,7 @@ TYPE DEFINITIONS ***************************************************************************/ +#define A800SLOT_ROM_REGION_TAG ":cart:rom" /* PCB */ enum @@ -90,7 +91,16 @@ class a800_cart_slot_device : public device_t, { public: // construction/destruction - a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template <typename T> + a800_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : a800_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } + a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~a800_cart_slot_device(); // image-level overrides @@ -141,6 +151,15 @@ class a5200_cart_slot_device : public a800_cart_slot_device { public: // construction/destruction + template <typename T> + a5200_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : a5200_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~a5200_cart_slot_device(); @@ -156,6 +175,15 @@ class xegs_cart_slot_device : public a800_cart_slot_device { public: // construction/destruction + template <typename T> + xegs_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) + : xegs_cart_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + } xegs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~xegs_cart_slot_device(); @@ -170,24 +198,4 @@ DECLARE_DEVICE_TYPE(A800_CART_SLOT, a800_cart_slot_device) DECLARE_DEVICE_TYPE(A5200_CART_SLOT, a5200_cart_slot_device) DECLARE_DEVICE_TYPE(XEGS_CART_SLOT, xegs_cart_slot_device) - -/*************************************************************************** - DEVICE CONFIGURATION MACROS - ***************************************************************************/ - -#define A800SLOT_ROM_REGION_TAG ":cart:rom" - -#define MCFG_A800_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, A800_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - -#define MCFG_A5200_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, A5200_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - -#define MCFG_XEGS_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ - MCFG_DEVICE_ADD(_tag, XEGS_CART_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) - - #endif // MAME_BUS_A800_A800_SLOT_H diff --git a/src/devices/bus/a800/a8sio.h b/src/devices/bus/a800/a8sio.h index a2c88b08328..b513ea0c9f1 100644 --- a/src/devices/bus/a800/a8sio.h +++ b/src/devices/bus/a800/a8sio.h @@ -35,25 +35,21 @@ #pragma once - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_A8SIO_SLOT_ADD(_nbtag, _tag, _def_slot) \ - MCFG_DEVICE_ADD(_tag, A8SIO_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(a8sio_cards, _def_slot, false) \ - downcast<a8sio_slot_device &>(*device).set_a8sio_slot(_nbtag, _tag); - -#define MCFG_A8SIO_DATA_IN_CB(_devcb) \ - downcast<a8sio_device &>(*device).set_data_in_callback(DEVCB_##_devcb); - +void a8sio_cards(device_slot_interface &device); class a8sio_slot_device : public device_t, public device_slot_interface { public: // construction/destruction + a8sio_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, char const *dflt) + : a8sio_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + a8sio_cards(*this); + set_default_option(dflt); + set_fixed(false); + } a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration @@ -84,9 +80,9 @@ public: a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration - template <class Object> devcb_base &set_clock_in_callback(Object &&cb) { return m_out_clock_in_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_data_in_callback(Object &&cb) { return m_out_data_in_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_audio_in_callback(Object &&cb) { return m_out_audio_in_cb.set_callback(std::forward<Object>(cb)); } + auto clock_in() { return m_out_clock_in_cb.bind(); } + auto data_in() { return m_out_data_in_cb.bind(); } + auto audio_in() { return m_out_audio_in_cb.bind(); } void add_a8sio_card(device_a8sio_card_interface *card); device_a8sio_card_interface *get_a8sio_card(); @@ -114,7 +110,6 @@ protected: device_a8sio_card_interface *m_device; }; - // device type definition DECLARE_DEVICE_TYPE(A8SIO, a8sio_device) @@ -141,7 +136,4 @@ public: const char *m_a8sio_slottag; }; - -void a8sio_cards(device_slot_interface &device); - #endif // MAME_BUS_A800_A8SIO_H diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index 46d7fbef7b5..1c00aeec8f5 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -411,6 +411,11 @@ class netlist_mame_logic_input_device : public device_t, public netlist_mame_sub { public: // construction/destruction + netlist_mame_logic_input_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *param_name, const uint32_t shift) + : netlist_mame_logic_input_device(mconfig, tag, owner, (uint32_t)0) + { + set_params(param_name, shift); + } netlist_mame_logic_input_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); void set_params(const char *param_name, const uint32_t shift); diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 53ad7f26fdf..487a1b4e83b 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -183,13 +183,13 @@ pokey_device::pokey_device(const machine_config &mconfig, const char *tag, devic device_sound_interface(mconfig, *this), device_execute_interface(mconfig, *this), device_state_interface(mconfig, *this), - m_output_type(LEGACY_LINEAR), m_icount(0), m_stream(nullptr), m_pot_r_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} }, m_allpot_r_cb(*this), m_serin_r_cb(*this), - m_serout_w_cb(*this) + m_serout_w_cb(*this), + m_output_type(LEGACY_LINEAR) { } diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h index edcf760f756..ec1a21b3541 100644 --- a/src/devices/sound/pokey.h +++ b/src/devices/sound/pokey.h @@ -53,76 +53,6 @@ #define POKEY_KEYBOARD_CB_MEMBER(_name) uint8_t _name(uint8_t k543210) #define POKEY_INTERRUPT_CB_MEMBER(_name) void _name(int mask) - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_POKEY_POT0_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<0>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT1_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<1>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT2_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<2>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT3_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<3>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT4_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<4>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT5_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<5>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT6_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<6>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT7_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_pot_r_callback<7>(DEVCB_##_devcb); - -#define MCFG_POKEY_ALLPOT_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_allpot_r_callback(DEVCB_##_devcb); - -#define MCFG_POKEY_SERIN_R_CB(_devcb) \ - downcast<pokey_device &>(*device).set_serin_r_callback(DEVCB_##_devcb); - -#define MCFG_POKEY_SEROUT_W_CB(_devcb) \ - downcast<pokey_device &>(*device).set_serout_w_callback(DEVCB_##_devcb); - -/* k543210 = k5 ... k0 returns bit0: kr1, bit1: kr2 */ -/* all are, in contrast to actual hardware, ACTIVE_HIGH */ -#define MCFG_POKEY_KEYBOARD_CB(_class, _method) \ - downcast<pokey_device &>(*device).set_keyboard_callback(pokey_device::kb_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_POKEY_INTERRUPT_CB(_class, _method) \ - downcast<pokey_device &>(*device).set_interrupt_callback(pokey_device::int_cb_delegate(&_class::_method, #_class "::" #_method, this)); - - -#define MCFG_POKEY_OUTPUT_RC(_R, _C, _V) \ - (downcast<pokey_device *>(device))->m_output_type = pokey_device::RC_LOWPASS; \ - (downcast<pokey_device *>(device))->m_r_pullup = (_R); \ - (downcast<pokey_device *>(device))->m_cap = (_C); \ - (downcast<pokey_device *>(device))->m_v_ref = (_V); - -/* C ignored, please see pokey.c */ - -#define MCFG_POKEY_OUTPUT_OPAMP(_R, _C, _V) \ - (downcast<pokey_device *>(device))->m_output_type = pokey_device::OPAMP_C_TO_GROUND; \ - (downcast<pokey_device *>(device))->m_r_pullup = (_R); \ - (downcast<pokey_device *>(device))->m_cap = (_C); \ - (downcast<pokey_device *>(device))->m_v_ref = (_V); - -#define MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(_R, _C, _V) \ - (downcast<pokey_device *>(device))->m_output_type = pokey_device::OPAMP_LOW_PASS; \ - (downcast<pokey_device *>(device))->m_r_pullup = (_R); \ - (downcast<pokey_device *>(device))->m_cap = (_C); \ - (downcast<pokey_device *>(device))->m_v_ref = (_V); - -#define MCFG_POKEY_OUTPUT_DISCRETE() \ - (downcast<pokey_device *>(device))->m_output_type = pokey_device::DISCRETE_VAR_R; - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -135,10 +65,6 @@ class pokey_device : public device_t, public device_state_interface { public: - - typedef device_delegate<uint8_t (uint8_t k543210)> kb_cb_delegate; - typedef device_delegate<void (int mask)> int_cb_delegate; - /* CONSTANT DEFINITIONS */ /* exact 1.79 MHz clock freq (of the Atari 800 that is) */ @@ -210,17 +136,34 @@ public: // construction/destruction pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <unsigned N, class Object> devcb_base &set_pot_r_callback(Object &&cb) { return m_pot_r_cb[N].set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_allpot_r_callback(Object &&cb) { return m_allpot_r_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_serin_r_callback(Object &&cb) { return m_serin_r_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_serout_w_callback(Object &&cb) { return m_serout_w_cb.set_callback(std::forward<Object>(cb)); } template <unsigned N> auto pot_r() { return m_pot_r_cb[N].bind(); } auto allpot_r() { return m_allpot_r_cb.bind(); } auto serin_r() { return m_serin_r_cb.bind(); } auto serout_w() { return m_serout_w_cb.bind(); } - template <typename Object> void set_keyboard_callback(Object &&cb) { m_keyboard_r = std::forward<Object>(cb); } - template <typename Object> void set_interrupt_callback(Object &&cb) { m_irq_f = std::forward<Object>(cb); } + /* k543210 = k5 ... k0 returns bit0: kr1, bit1: kr2 */ + /* all are, in contrast to actual hardware, ACTIVE_HIGH */ + typedef device_delegate<uint8_t (uint8_t k543210)> kb_cb_delegate; + void set_keyboard_callback(kb_cb_delegate callback) { m_keyboard_r = callback; } + template <class FunctionClass> void set_keyboard_callback(const char *devname, uint8_t (FunctionClass::*callback)(uint8_t), const char *name) + { + set_keyboard_callback(kb_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); + } + template <class FunctionClass> void set_keyboard_callback(uint8_t (FunctionClass::*callback)(uint8_t), const char *name) + { + set_keyboard_callback(kb_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); + } + + typedef device_delegate<void (int mask)> int_cb_delegate; + void set_interrupt_callback(int_cb_delegate callback) { m_irq_f = callback; } + template <class FunctionClass> void set_interrupt_callback(const char *devname, void (FunctionClass::*callback)(int), const char *name) + { + set_interrupt_callback(int_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); + } + template <class FunctionClass> void set_interrupt_callback(void (FunctionClass::*callback)(int), const char *name) + { + set_interrupt_callback(int_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); + } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -229,11 +172,35 @@ public: void serin_ready(int after); // analog output configuration + void set_output_rc(double r, double c, double v) + { + m_output_type = pokey_device::RC_LOWPASS; + m_r_pullup = r; + m_cap = c; + m_v_ref = v; + } + + /* C ignored, please see pokey.c */ + void set_output_opamp(double r, double c, double v) + { + m_output_type = pokey_device::OPAMP_C_TO_GROUND; + m_r_pullup = r; + m_cap = c; + m_v_ref = v; + } - output_type m_output_type; - double m_r_pullup; - double m_cap; - double m_v_ref; + void set_output_opamp_low_pass(double r, double c, double v) + { + m_output_type = pokey_device::OPAMP_LOW_PASS; + m_r_pullup = r; + m_cap = c; + m_v_ref = v; + } + + void set_output_discrete() + { + m_output_type = pokey_device::DISCRETE_VAR_R; + } protected: // device-level overrides @@ -357,6 +324,11 @@ private: uint32_t m_poly9[0x1ff]; uint32_t m_poly17[0x1ffff]; uint32_t m_voltab[0x10000]; + + output_type m_output_type; + double m_r_pullup; + double m_cap; + double m_v_ref; }; diff --git a/src/devices/sound/sn76477.h b/src/devices/sound/sn76477.h index 04e6386b62b..5e58407cb50 100644 --- a/src/devices/sound/sn76477.h +++ b/src/devices/sound/sn76477.h @@ -49,46 +49,6 @@ * *****************************************************************************/ - -#define MCFG_SN76477_NOISE_PARAMS(_clock_res, _filter_res, _filter_cap) \ - downcast<sn76477_device &>(*device).set_noise_params(_clock_res, _filter_res, _filter_cap); - -#define MCFG_SN76477_DECAY_RES(_decay_res) \ - downcast<sn76477_device &>(*device).set_decay_res(_decay_res); - -#define MCFG_SN76477_ATTACK_PARAMS(_decay_cap, _res) \ - downcast<sn76477_device &>(*device).set_attack_params(_decay_cap, _res); - -#define MCFG_SN76477_AMP_RES(_amp_res) \ - downcast<sn76477_device &>(*device).set_amp_res(_amp_res); - -#define MCFG_SN76477_FEEDBACK_RES(_feedback_res) \ - downcast<sn76477_device &>(*device).set_feedback_res(_feedback_res); - -#define MCFG_SN76477_VCO_PARAMS(_volt, _cap, _res) \ - downcast<sn76477_device &>(*device).set_vco_params(_volt, _cap, _res); - -#define MCFG_SN76477_PITCH_VOLTAGE(_volt) \ - downcast<sn76477_device &>(*device).set_pitch_voltage(_volt); - -#define MCFG_SN76477_SLF_PARAMS(_cap, _res) \ - downcast<sn76477_device &>(*device).set_slf_params(_cap, _res); - -#define MCFG_SN76477_ONESHOT_PARAMS(_cap, _res) \ - downcast<sn76477_device &>(*device).set_oneshot_params(_cap, _res); - -#define MCFG_SN76477_VCO_MODE(_mode) \ - downcast<sn76477_device &>(*device).set_vco_mode(_mode); - -#define MCFG_SN76477_MIXER_PARAMS(_a, _b, _c) \ - downcast<sn76477_device &>(*device).set_mixer_params(_a, _b, _c); - -#define MCFG_SN76477_ENVELOPE_PARAMS(_env1, _env2) \ - downcast<sn76477_device &>(*device).set_envelope_params(_env1, _env2); - -#define MCFG_SN76477_ENABLE(_enable) \ - downcast<sn76477_device &>(*device).set_enable(_enable); - class sn76477_device : public device_t, public device_sound_interface { diff --git a/src/devices/sound/tms36xx.h b/src/devices/sound/tms36xx.h index 01fdc22d306..3e517a09f77 100644 --- a/src/devices/sound/tms36xx.h +++ b/src/devices/sound/tms36xx.h @@ -6,26 +6,6 @@ #pragma once //************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TMS36XX_ADD(tag, clock) \ - MCFG_DEVICE_ADD((tag), TMS36XX, (clock)) - -#define MCFG_TMS36XX_REPLACE(tag, clock) \ - MCFG_DEVICE_REPLACE((tag), TMS36XX, (clock)) - -#define MCFG_TMS36XX_TYPE(type) \ - downcast<tms36xx_device &>(*device).set_subtype((tms36xx_device::subtype::type)); - -#define MCFG_TMS36XX_DECAY_TIMES(_dec0, _dec1, _dec2, _dec3, _dec4, _dec5) \ - downcast<tms36xx_device &>(*device).set_decays(_dec0, _dec1, _dec2, _dec3, _dec4, _dec5); - -#define MCFG_TMS36XX_TUNE_SPEED(_speed) \ - downcast<tms36xx_device &>(*device).set_tune_speed(_speed); - - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h index 4857326b697..12f279155eb 100644 --- a/src/devices/sound/tms5110.h +++ b/src/devices/sound/tms5110.h @@ -13,22 +13,6 @@ /* usually 640000 for 8000 Hz sample rate or */ /* usually 800000 for 10000 Hz sample rate. */ -#define MCFG_TMS5110_M0_CB(_devcb) \ - downcast<tms5110_device &>(*device).set_m0_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_M1_CB(_devcb) \ - downcast<tms5110_device &>(*device).set_m1_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_ADDR_CB(_devcb) \ - downcast<tms5110_device &>(*device).set_addr_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_DATA_CB(_devcb) \ - downcast<tms5110_device &>(*device).set_data_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_ROMCLK_CB(_devcb) \ - downcast<tms5110_device &>(*device).set_romclk_callback(DEVCB_##_devcb); - - class tms5110_device : public device_t, public device_sound_interface { public: @@ -51,11 +35,6 @@ public: tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_m0_callback(Object &&cb) { return m_m0_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_m1_callback(Object &&cb) { return m_m1_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_addr_callback(Object &&cb) { return m_addr_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_romclk_callback(Object &&cb) { return m_romclk_cb.set_callback(std::forward<Object>(cb)); } auto m0() { return m_m0_cb.bind(); } auto m1() { return m_m1_cb.bind(); } auto addr() { return m_addr_cb.bind(); } @@ -291,8 +270,8 @@ public: void set_ctl8_bit(uint8_t ctl8_bit) { m_ctl8_bit = ctl8_bit; } void set_reset_bit(uint8_t reset_bit) { m_reset_bit = reset_bit; } void set_stop_bit(uint8_t stop_bit) { m_stop_bit = stop_bit; } - template<class Object> devcb_base &set_pdc_callback(Object object) { return m_pdc_cb.set_callback(std::forward<Object>(object)); } - template<class Object> devcb_base &set_ctl_callback(Object object) { return m_ctl_cb.set_callback(std::forward<Object>(object)); } + auto pdc() { return m_pdc_cb.bind(); } + auto ctl() { return m_ctl_cb.bind(); } DECLARE_WRITE_LINE_MEMBER( m0_w ); DECLARE_READ_LINE_MEMBER( data_r ); @@ -342,37 +321,4 @@ private: DECLARE_DEVICE_TYPE(TMSPROM, tmsprom_device) -#define MCFG_TMSPROM_REGION(_region) \ - downcast<tmsprom_device &>(*device).set_region(_region); - -#define MCFG_TMSPROM_ROM_SIZE(_size) \ - downcast<tmsprom_device &>(*device).set_rom_size(_size); - -#define MCFG_TMSPROM_PDC_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_pdc_bit(_bit); - -#define MCFG_TMSPROM_CTL1_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_ctl1_bit(_bit); - -#define MCFG_TMSPROM_CTL2_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_ctl2_bit(_bit); - -#define MCFG_TMSPROM_CTL4_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_ctl4_bit(_bit); - -#define MCFG_TMSPROM_CTL8_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_ctl8_bit(_bit); - -#define MCFG_TMSPROM_RESET_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_reset_bit(_bit); - -#define MCFG_TMSPROM_STOP_BIT(_bit) \ - downcast<tmsprom_device &>(*device).set_stop_bit(_bit); - -#define MCFG_TMSPROM_PDC_CB(_devcb) \ - downcast<tmsprom_device &>(*device).set_pdc_callback(DEVCB_##_devcb); - -#define MCFG_TMSPROM_CTL_CB(_devcb) \ - downcast<tmsprom_device &>(*device).set_ctl_callback(DEVCB_##_devcb); - #endif // MAME_SOUND_TMS5110_H diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index a14d1ef86ce..712500058ca 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -14,34 +14,6 @@ /* usually 640000 for 8000 Hz sample rate or */ /* usually 800000 for 10000 Hz sample rate. */ -/* IRQ callback function, active low, i.e. state=0 */ -#define MCFG_TMS52XX_IRQ_HANDLER(_devcb) \ - downcast<tms5220_device &>(*device).set_irq_handler(DEVCB_##_devcb); - -/* Ready callback function, active low, i.e. state=0 */ -#define MCFG_TMS52XX_READYQ_HANDLER(_devcb) \ - downcast<tms5220_device &>(*device).set_readyq_handler(DEVCB_##_devcb); - -/* old VSM handler, remove me! */ -#define MCFG_TMS52XX_SPEECHROM(_tag) \ - downcast<tms5220_device &>(*device).set_speechrom_tag(_tag); - -/* new VSM handler */ -#define MCFG_TMS52XX_M0_CB(_devcb) \ - downcast<tms5220_device &>(*device).set_m0_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_M1_CB(_devcb) \ - downcast<tms5220_device &>(*device).set_m1_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_ADDR_CB(_devcb) \ - downcast<tms5220_device &>(*device).set_addr_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_DATA_CB(_devcb) \ - downcast<tms5220_device &>(*device).set_data_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_ROMCLK_CB(_devcb) \ - downcast<tms5220_device &>(device).set_romclk_callback(DEVCB_##_devcb); - class tms5220_device : public device_t, public device_sound_interface { public: @@ -53,22 +25,16 @@ public: tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // configuration helpers - template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_readyq_handler(Object &&cb) { return m_readyq_handler.set_callback(std::forward<Object>(cb)); } - + // IRQ callback function, active low, i.e. state=0 auto irq_cb() { return m_irq_handler.bind(); } + + // Ready callback function, active low, i.e. state=0 auto ready_cb() { return m_readyq_handler.bind(); } // old VSM support, remove me! void set_speechrom_tag(const char *_tag) { m_speechrom_tag = _tag; } - // new VSM support - template <class Object> devcb_base &set_m0_callback(Object &&cb) { return m_m0_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_m1_callback(Object &&cb) { return m_m1_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_addr_callback(Object &&cb) { return m_addr_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_romclk_callback(Object &&cb) { return m_romclk_cb.set_callback(std::forward<Object>(cb)); } + // new VSM support auto m0_cb() { return m_m0_cb.bind(); } auto m1_cb() { return m_m1_cb.bind(); } auto addr_cb() { return m_addr_cb.bind(); } diff --git a/src/devices/video/saa5050.h b/src/devices/video/saa5050.h index 532e715eeff..6e1aa5cec6a 100644 --- a/src/devices/video/saa5050.h +++ b/src/devices/video/saa5050.h @@ -59,6 +59,7 @@ public: void set_screen_size(int cols, int rows, int size) { m_cols = cols; m_rows = rows; m_size = size; } template <class Object> devcb_base &set_d_rd_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); } + auto d_cb() { return m_read_d.bind(); } // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/video/tms3556.h b/src/devices/video/tms3556.h index 9111d0c26e9..11146f8b21f 100644 --- a/src/devices/video/tms3556.h +++ b/src/devices/video/tms3556.h @@ -44,7 +44,7 @@ public: static constexpr unsigned TOTAL_HEIGHT = 250 + TOP_BORDER + BOTTOM_BORDER; // construction/destruction - tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); DECLARE_READ8_MEMBER( vram_r ); DECLARE_WRITE8_MEMBER( vram_w ); diff --git a/src/devices/video/vector.h b/src/devices/video/vector.h index dca693133f8..919395f043a 100644 --- a/src/devices/video/vector.h +++ b/src/devices/video/vector.h @@ -30,7 +30,7 @@ public: template <typename T> static constexpr rgb_t color444(T c) { return rgb_t(pal4bit(c >> 8), pal4bit(c >> 4), pal4bit(c >> 0)); } // construction/destruction - vector_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vector_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void clear_list(); diff --git a/src/mame/audio/astrof.cpp b/src/mame/audio/astrof.cpp index 497591479e0..3969227b5d3 100644 --- a/src/mame/audio/astrof.cpp +++ b/src/mame/audio/astrof.cpp @@ -195,21 +195,22 @@ WRITE8_MEMBER(astrof_state::tomahawk_audio_w) } -MACHINE_CONFIG_START(astrof_state::tomahawk_audio) +void astrof_state::tomahawk_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res N/C - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res: N/C - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.033), RES_K(33)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(2.2), RES_K(47)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, 0); + m_sn->set_amp_res(RES_K(47)); + m_sn->set_feedback_res(RES_K(47)); + m_sn->set_vco_params(0, CAP_U(0.033), RES_K(33)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(2.2), RES_K(47)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(0, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/audio/bwidow.cpp b/src/mame/audio/bwidow.cpp index a4dea00bb78..0384035ff91 100644 --- a/src/mame/audio/bwidow.cpp +++ b/src/mame/audio/bwidow.cpp @@ -148,32 +148,29 @@ static DISCRETE_SOUND_START(gravitar_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(bwidow_state::bwidow_audio) +void bwidow_state::bwidow_audio(machine_config &config) +{ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK / 8) /* C/D3 */ - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW0")) - MCFG_POKEY_OUTPUT_OPAMP(BW_R51, BW_C31, 5.0) - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0) + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK / 8)); /* C/D3 */ + pokey1.allpot_r().set_ioport("DSW0"); + pokey1.set_output_opamp(BW_R51, BW_C31, 5.0); + pokey1.add_route(0, "discrete", 1.0, 0); - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK / 8) /* B3 */ - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1")) - MCFG_POKEY_OUTPUT_OPAMP(BW_R47, BW_C32, 5.0) - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 1) + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK / 8)); /* B3 */ + pokey2.allpot_r().set_ioport("DSW1"); + pokey2.set_output_opamp(BW_R47, BW_C32, 5.0); + pokey2.add_route(0, "discrete", 1.0, 1); - MCFG_DEVICE_ADD("discrete", DISCRETE, bwidow_discrete) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + DISCRETE(config, "discrete", bwidow_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); //MCFG_QUANTUM_PERFECT_CPU("pokey1") +} -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(bwidow_state::gravitar_audio) - MCFG_DEVICE_MODIFY("pokey1") - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(BW_R51, GRAV_C34, 5.0) /* BW_C31 ignored */ +void bwidow_state::gravitar_audio(machine_config &config) +{ + subdevice<pokey_device>("pokey1")->set_output_opamp_low_pass(BW_R51, GRAV_C34, 5.0); /* BW_C31 ignored */ - MCFG_DEVICE_MODIFY("discrete") - MCFG_DISCRETE_INTF(gravitar_discrete) -MACHINE_CONFIG_END + subdevice<discrete_sound_device>("discrete")->set_intf(gravitar_discrete); +} diff --git a/src/mame/audio/bzone.cpp b/src/mame/audio/bzone.cpp index 5698b787737..8172d686685 100644 --- a/src/mame/audio/bzone.cpp +++ b/src/mame/audio/bzone.cpp @@ -396,17 +396,14 @@ WRITE8_MEMBER(bzone_state::bzone_sounds_w) machine().sound().system_enable(data & 0x20); } - -MACHINE_CONFIG_START(bzone_state::bzone_audio) - +void bzone_state::bzone_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, BZONE_MASTER_CLOCK / 8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN3")) - MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0) - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0) + pokey_device &pokey(POKEY(config, "pokey", BZONE_MASTER_CLOCK / 8)); + pokey.allpot_r().set_ioport("IN3"); + pokey.set_output_rc(RES_K(10), CAP_U(0.015), 5.0); + pokey.add_route(0, "discrete", 1.0, 0); - MCFG_DEVICE_ADD("discrete", DISCRETE, bzone_discrete) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, "discrete", bzone_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/audio/crbaloon.cpp b/src/mame/audio/crbaloon.cpp index 1b9649aa891..1414ae546e9 100644 --- a/src/mame/audio/crbaloon.cpp +++ b/src/mame/audio/crbaloon.cpp @@ -138,26 +138,25 @@ static DISCRETE_SOUND_START(crbaloon_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(crbaloon_state::crbaloon_audio) - +void crbaloon_state::crbaloon_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(470)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(220)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1.0), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_M(1)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(200)) // feedback_res - MCFG_SN76477_VCO_PARAMS(5.0, CAP_P(470), RES_K(330)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_P(420), RES_K(20)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.0), RES_K(47)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 1) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(0) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0) - - MCFG_DEVICE_ADD("discrete", DISCRETE, crbaloon_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(47), RES_K(330), CAP_P(470)); + m_sn->set_decay_res(RES_K(220)); + m_sn->set_attack_params(CAP_U(1.0), RES_K(4.7)); + m_sn->set_amp_res(RES_M(1)); + m_sn->set_feedback_res(RES_K(200)); + m_sn->set_vco_params(5.0, CAP_P(470), RES_K(330)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_P(420), RES_K(20)); + m_sn->set_oneshot_params(CAP_U(1.0), RES_K(47)); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 1); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(0); + m_sn->add_route(ALL_OUTPUTS, "mono", 2.0); + + DISCRETE(config, "discrete", crbaloon_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp index 2ac1dc6578f..7a1f37a9393 100644 --- a/src/mame/audio/dkong.cpp +++ b/src/mame/audio/dkong.cpp @@ -1311,8 +1311,8 @@ void dkong_state::dkong3_sound2_map(address_map &map) * *************************************/ -MACHINE_CONFIG_START(dkong_state::dkong2b_audio) - +void dkong_state::dkong2b_audio(machine_config &config) +{ /* sound latches */ LATCH8(config, m_ls175_3d); /* sound cmd latch */ m_ls175_3d->set_maskout(0xf0); @@ -1349,19 +1349,19 @@ MACHINE_CONFIG_START(dkong_state::dkong2b_audio) m_soundcpu->t1_in_cb().set("ls259.6h", FUNC(latch8_device::bit4_q_r)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, dkong2b_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, "discrete", dkong2b_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(dkong_state::radarscp_audio) +void dkong_state::radarscp_audio(machine_config &config) +{ dkong2b_audio(config); - MCFG_DEVICE_REPLACE("discrete", DISCRETE, radarscp_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.7) -MACHINE_CONFIG_END + DISCRETE(config.replace(), "discrete", radarscp_discrete).add_route(ALL_OUTPUTS, "mono", 0.7); +} -MACHINE_CONFIG_START(dkong_state::radarscp1_audio) +void dkong_state::radarscp1_audio(machine_config &config) +{ radarscp_audio(config); m_soundcpu->set_addrmap(AS_IO, &dkong_state::radarscp1_sound_io_map); @@ -1378,17 +1378,17 @@ MACHINE_CONFIG_START(dkong_state::radarscp1_audio) /* tms memory controller */ M58819(config, "m58819", 0); - MCFG_DEVICE_ADD("tms", M58817, XTAL(640'000)) - MCFG_TMS5110_M0_CB(WRITELINE("m58819", tms6100_device, m0_w)) - MCFG_TMS5110_M1_CB(WRITELINE("m58819", tms6100_device, m1_w)) - MCFG_TMS5110_ADDR_CB(WRITE8("m58819", tms6100_device, add_w)) - MCFG_TMS5110_DATA_CB(READLINE("m58819", tms6100_device, data_line_r)) - MCFG_TMS5110_ROMCLK_CB(WRITELINE("m58819", tms6100_device, clk_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(dkong_state::dkongjr_audio) + M58817(config, m_m58817, XTAL(640'000)); + m_m58817->m0().set("m58819", FUNC(tms6100_device::m0_w)); + m_m58817->m1().set("m58819", FUNC(tms6100_device::m1_w)); + m_m58817->addr().set("m58819", FUNC(tms6100_device::add_w)); + m_m58817->data().set("m58819", FUNC(tms6100_device::data_line_r)); + m_m58817->romclk().set("m58819", FUNC(tms6100_device::clk_w)); + m_m58817->add_route(ALL_OUTPUTS, "mono", 1.0); +} +void dkong_state::dkongjr_audio(machine_config &config) +{ /* sound latches */ LATCH8(config, "ls174.3d").set_maskout(0xe0); @@ -1421,17 +1421,13 @@ MACHINE_CONFIG_START(dkong_state::dkongjr_audio) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, dkongjr_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(dkong_state::dkong3_audio) - - MCFG_DEVICE_ADD("n2a03a", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(dkong3_sound1_map) + DISCRETE(config, "discrete", dkongjr_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} - MCFG_DEVICE_ADD("n2a03b", N2A03, NTSC_APU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(dkong3_sound2_map) +void dkong_state::dkong3_audio(machine_config &config) +{ + N2A03(config, "n2a03a", NTSC_APU_CLOCK).set_addrmap(AS_PROGRAM, &dkong_state::dkong3_sound1_map); + N2A03(config, "n2a03b", NTSC_APU_CLOCK).set_addrmap(AS_PROGRAM, &dkong_state::dkong3_sound2_map); /* sound latches */ LATCH8(config, "latch1"); @@ -1439,4 +1435,4 @@ MACHINE_CONFIG_START(dkong_state::dkong3_audio) LATCH8(config, "latch3"); SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} diff --git a/src/mame/audio/jedi.cpp b/src/mame/audio/jedi.cpp index b6b34a0180e..3c61b1876b8 100644 --- a/src/mame/audio/jedi.cpp +++ b/src/mame/audio/jedi.cpp @@ -116,36 +116,36 @@ void jedi_state::audio_map(address_map &map) * *************************************/ -MACHINE_CONFIG_START(jedi_state::jedi_audio) - - MCFG_DEVICE_ADD("audiocpu", M6502, JEDI_AUDIO_CPU_CLOCK) - MCFG_DEVICE_PROGRAM_MAP(audio_map) +void jedi_state::jedi_audio(machine_config &config) +{ + M6502(config, m_audiocpu, JEDI_AUDIO_CPU_CLOCK); + m_audiocpu->set_addrmap(AS_PROGRAM, &jedi_state::audio_map); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("pokey1", POKEY, JEDI_POKEY_CLOCK) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) + pokey_device &pokey1(POKEY(config, "pokey1", JEDI_POKEY_CLOCK)); + pokey1.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey1.add_route(ALL_OUTPUTS, "lspeaker", 0.30); + pokey1.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - MCFG_DEVICE_ADD("pokey2", POKEY, JEDI_POKEY_CLOCK) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) + pokey_device &pokey2(POKEY(config, "pokey2", JEDI_POKEY_CLOCK)); + pokey2.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey2.add_route(ALL_OUTPUTS, "lspeaker", 0.30); + pokey2.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - MCFG_DEVICE_ADD("pokey3", POKEY, JEDI_POKEY_CLOCK) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) + pokey_device &pokey3(POKEY(config, "pokey3", JEDI_POKEY_CLOCK)); + pokey3.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey3.add_route(ALL_OUTPUTS, "lspeaker", 0.30); - MCFG_DEVICE_ADD("pokey4", POKEY, JEDI_POKEY_CLOCK) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) + pokey_device &pokey4(POKEY(config, "pokey4", JEDI_POKEY_CLOCK)); + pokey4.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey4.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - MCFG_DEVICE_ADD("tms", TMS5220, JEDI_TMS5220_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + TMS5220(config, m_tms, JEDI_TMS5220_CLOCK); + m_tms->add_route(ALL_OUTPUTS, "lspeaker", 1.0); + m_tms->add_route(ALL_OUTPUTS, "rspeaker", 1.0); GENERIC_LATCH_8(config, m_soundlatch); // 5E (LS374) + 3E (LS279) pins 13-15 GENERIC_LATCH_8(config, m_sacklatch); // 4E (LS374) + 3E (LS279) pins 1-4 -MACHINE_CONFIG_END +} diff --git a/src/mame/audio/mw8080bw.cpp b/src/mame/audio/mw8080bw.cpp index 67c7a133406..ffad8d5224f 100644 --- a/src/mame/audio/mw8080bw.cpp +++ b/src/mame/audio/mw8080bw.cpp @@ -144,15 +144,16 @@ static const char *const seawolf_sample_names[] = nullptr }; -MACHINE_CONFIG_START(mw8080bw_state::seawolf_audio) +void mw8080bw_state::seawolf_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(5) - MCFG_SAMPLES_NAMES(seawolf_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(5); + m_samples->set_samples_names(seawolf_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.6); +} WRITE8_MEMBER(mw8080bw_state::seawolf_audio_w) @@ -198,22 +199,23 @@ static const char *const gunfight_sample_names[] = }; -MACHINE_CONFIG_START(mw8080bw_state::gunfight_audio) +void mw8080bw_state::gunfight_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("samples1", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(gunfight_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) + SAMPLES(config, m_samples1); + m_samples1->set_channels(1); + m_samples1->set_samples_names(gunfight_sample_names); + m_samples1->add_route(ALL_OUTPUTS, "lspeaker", 0.50); - MCFG_DEVICE_ADD("samples2", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(gunfight_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) -MACHINE_CONFIG_END + SAMPLES(config, m_samples2); + m_samples2->set_channels(1); + m_samples2->set_samples_names(gunfight_sample_names); + m_samples2->add_route(ALL_OUTPUTS, "rspeaker", 0.50); +} WRITE8_MEMBER(mw8080bw_state::gunfight_audio_w) @@ -308,11 +310,12 @@ static DISCRETE_SOUND_START(tornbase_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::tornbase_audio) +void mw8080bw_state::tornbase_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, tornbase_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, tornbase_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1); +} WRITE8_MEMBER(mw8080bw_state::tornbase_audio_w) @@ -351,9 +354,10 @@ WRITE8_MEMBER(mw8080bw_state::tornbase_audio_w) * *************************************/ -MACHINE_CONFIG_START(mw8080bw_state::zzzap_audio ) +void mw8080bw_state::zzzap_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); -MACHINE_CONFIG_END +} WRITE8_MEMBER(mw8080bw_state::zzzap_audio_1_w) @@ -553,11 +557,12 @@ static DISCRETE_SOUND_START(maze_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::maze_audio) +void mw8080bw_state::maze_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, maze_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, maze_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} void mw8080bw_state::maze_write_discrete(uint8_t maze_tone_timing_state) @@ -798,13 +803,14 @@ static DISCRETE_SOUND_START(boothill_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::boothill_audio) +void mw8080bw_state::boothill_audio(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("discrete", DISCRETE, boothill_discrete) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, boothill_discrete); + m_discrete->add_route(0, "lspeaker", 1.0); + m_discrete->add_route(1, "rspeaker", 1.0); +} WRITE8_MEMBER(mw8080bw_state::boothill_audio_w) @@ -1028,11 +1034,12 @@ static DISCRETE_SOUND_START(checkmat_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::checkmat_audio) +void mw8080bw_state::checkmat_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, checkmat_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, checkmat_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.4); +} WRITE8_MEMBER(mw8080bw_state::checkmat_audio_w) @@ -1238,11 +1245,12 @@ static DISCRETE_SOUND_START(desertgu_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::desertgu_audio) +void mw8080bw_state::desertgu_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, desertgu_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, desertgu_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.8); +} WRITE8_MEMBER(mw8080bw_state::desertgu_audio_1_w) @@ -1502,11 +1510,12 @@ static DISCRETE_SOUND_START(dplay_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::dplay_audio) +void mw8080bw_state::dplay_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, dplay_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, dplay_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.8); +} WRITE8_MEMBER(mw8080bw_state::dplay_audio_w) @@ -1542,22 +1551,23 @@ static const char *const gmissile_sample_names[] = nullptr }; -MACHINE_CONFIG_START(mw8080bw_state::gmissile_audio) +void mw8080bw_state::gmissile_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("samples1", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(gmissile_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.9) + SAMPLES(config, m_samples1); + m_samples1->set_channels(1); + m_samples1->set_samples_names(gmissile_sample_names); + m_samples1->add_route(ALL_OUTPUTS, "lspeaker", 1.9); - MCFG_DEVICE_ADD("samples2", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(gmissile_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.9) -MACHINE_CONFIG_END + SAMPLES(config, m_samples2); + m_samples2->set_channels(1); + m_samples2->set_samples_names(gmissile_sample_names); + m_samples2->add_route(ALL_OUTPUTS, "rspeaker", 1.9); +} WRITE8_MEMBER(mw8080bw_state::gmissile_audio_1_w) @@ -1636,22 +1646,23 @@ static const char *const m4_sample_names[] = }; -MACHINE_CONFIG_START(mw8080bw_state::m4_audio) +void mw8080bw_state::m4_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("samples1", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(m4_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1) + SAMPLES(config, m_samples1); + m_samples1->set_channels(2); + m_samples1->set_samples_names(m4_sample_names); + m_samples1->add_route(ALL_OUTPUTS, "lspeaker", 1); - MCFG_DEVICE_ADD("samples2", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(m4_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1) -MACHINE_CONFIG_END + SAMPLES(config, m_samples2); + m_samples2->set_channels(2); + m_samples2->set_samples_names(m4_sample_names); + m_samples2->add_route(ALL_OUTPUTS, "rspeaker", 1); +} WRITE8_MEMBER(mw8080bw_state::m4_audio_1_w) @@ -1892,19 +1903,20 @@ static const char *const clowns_sample_names[] = nullptr }; -MACHINE_CONFIG_START(mw8080bw_state::clowns_audio) +void mw8080bw_state::clowns_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(clowns_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) + SAMPLES(config, m_samples); + m_samples->set_channels(1); + m_samples->set_samples_names(clowns_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.70); - MCFG_DEVICE_ADD("discrete", DISCRETE, clowns_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, clowns_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.25); +} WRITE8_MEMBER(mw8080bw_state::clowns_audio_1_w) @@ -2264,12 +2276,13 @@ DISCRETE_GAIN(NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_SND, _num - 1), DISCRETE_OUTPUT(NODE_90, 11000) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::spacwalk_audio) +void mw8080bw_state::spacwalk_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, spacwalk_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, spacwalk_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} WRITE8_MEMBER(mw8080bw_state::spacwalk_audio_1_w) { @@ -2492,12 +2505,13 @@ static DISCRETE_SOUND_START(shuffle_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::shuffle_audio) +void mw8080bw_state::shuffle_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, shuffle_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, shuffle_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0); +} WRITE8_MEMBER(mw8080bw_state::shuffle_audio_1_w) @@ -2671,13 +2685,14 @@ static DISCRETE_SOUND_START(dogpatch_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::dogpatch_audio) +void mw8080bw_state::dogpatch_audio(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("discrete", DISCRETE, dogpatch_discrete) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, dogpatch_discrete); + m_discrete->add_route(0, "lspeaker", 1.0); + m_discrete->add_route(1, "rspeaker", 1.0); +} WRITE8_MEMBER(mw8080bw_state::dogpatch_audio_w) @@ -3176,28 +3191,29 @@ static DISCRETE_SOUND_START(spcenctr_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::spcenctr_audio) +void mw8080bw_state::spcenctr_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.047), RES_K(56)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(150)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) - - MCFG_DEVICE_ADD("discrete", DISCRETE, spcenctr_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, RES_K(100)); + m_sn->set_amp_res(RES_K(56)); + m_sn->set_feedback_res(RES_K(10)); + m_sn->set_vco_params(0, CAP_U(0.047), RES_K(56)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(150)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.20); + + DISCRETE(config, m_discrete, spcenctr_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.45); +} @@ -3261,15 +3277,16 @@ static const char *const phantom2_sample_names[] = nullptr }; -MACHINE_CONFIG_START(mw8080bw_state::phantom2_audio) +void mw8080bw_state::phantom2_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(phantom2_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_names(phantom2_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1); +} WRITE8_MEMBER(mw8080bw_state::phantom2_audio_1_w) @@ -3391,12 +3408,13 @@ static DISCRETE_SOUND_START(bowler_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::bowler_audio) +void mw8080bw_state::bowler_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, bowler_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, bowler_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 1); +} WRITE8_MEMBER(mw8080bw_state::bowler_audio_1_w) @@ -3505,32 +3523,33 @@ static const char *const invaders_sample_names[] = /* left in for all games that hack into invaders samples for audio */ -MACHINE_CONFIG_START(mw8080bw_state::invaders_samples_audio) +void mw8080bw_state::invaders_samples_audio(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(invaders_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, RES_K(100)); + m_sn->set_amp_res(RES_K(56)); + m_sn->set_feedback_res(RES_K(10)); + m_sn->set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.5); + + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(invaders_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} /* nodes - inputs */ @@ -4087,28 +4106,29 @@ static DISCRETE_SOUND_START(invaders_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::invaders_audio) +void mw8080bw_state::invaders_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - - MCFG_DEVICE_ADD("discrete", DISCRETE, invaders_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, RES_K(100)); + m_sn->set_amp_res(RES_K(56)); + m_sn->set_feedback_res(RES_K(10)); + m_sn->set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.5); + + DISCRETE(config, m_discrete, invaders_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.5); +} WRITE8_MEMBER(mw8080bw_state::invaders_audio_1_w) @@ -4504,11 +4524,12 @@ static DISCRETE_SOUND_START(blueshrk_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::blueshrk_audio) +void mw8080bw_state::blueshrk_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("discrete", DISCRETE, blueshrk_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, blueshrk_discrete); + m_discrete->add_route(ALL_OUTPUTS, "mono", 0.25); +} WRITE8_MEMBER(mw8080bw_state::blueshrk_audio_w) @@ -4665,46 +4686,47 @@ static DISCRETE_SOUND_START(invad2ct_discrete) DISCRETE_SOUND_END -MACHINE_CONFIG_START(mw8080bw_state::invad2ct_audio) +void mw8080bw_state::invad2ct_audio(machine_config &config) +{ SPEAKER(config, "spk1").front_left(); SPEAKER(config, "spk2").front_right(); - MCFG_DEVICE_ADD("discrete", DISCRETE, invad2ct_discrete) - MCFG_SOUND_ROUTE(0, "spk1", 0.5) - MCFG_SOUND_ROUTE(1, "spk2", 0.5) - - MCFG_DEVICE_ADD("sn1", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spk1", 0.3) - - MCFG_DEVICE_ADD("sn2", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.047), RES_K(39)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "spk2", 0.3) -MACHINE_CONFIG_END + DISCRETE(config, m_discrete, invad2ct_discrete); + m_discrete->add_route(0, "spk1", 0.5); + m_discrete->add_route(1, "spk2", 0.5); + + SN76477(config, m_sn1); + m_sn1->set_noise_params(0, 0, 0); + m_sn1->set_decay_res(0); + m_sn1->set_attack_params(0, RES_K(100)); + m_sn1->set_amp_res(RES_K(56)); + m_sn1->set_feedback_res(RES_K(10)); + m_sn1->set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + m_sn1->set_pitch_voltage(5.0); + m_sn1->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn1->set_oneshot_params(0, 0); + m_sn1->set_vco_mode(1); + m_sn1->set_mixer_params(0, 0, 0); + m_sn1->set_envelope_params(1, 0); + m_sn1->set_enable(1); + m_sn1->add_route(ALL_OUTPUTS, "spk1", 0.3); + + SN76477(config, m_sn2); + m_sn2->set_noise_params(0, 0, 0); + m_sn2->set_decay_res(0); + m_sn2->set_attack_params(0, RES_K(100)); + m_sn2->set_amp_res(RES_K(56)); + m_sn2->set_feedback_res(RES_K(10)); + m_sn2->set_vco_params(0, CAP_U(0.047), RES_K(39)); + m_sn2->set_pitch_voltage(5.0); + m_sn2->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn2->set_oneshot_params(0, 0); + m_sn2->set_vco_mode(1); + m_sn2->set_mixer_params(0, 0, 0); + m_sn2->set_envelope_params(1, 0); + m_sn2->set_enable(1); + m_sn2->add_route(ALL_OUTPUTS, "spk2", 0.3); +} WRITE8_MEMBER(mw8080bw_state::invad2ct_audio_1_w) diff --git a/src/mame/audio/n8080.cpp b/src/mame/audio/n8080.cpp index 426968b61f7..90557f27c3c 100644 --- a/src/mame/audio/n8080.cpp +++ b/src/mame/audio/n8080.cpp @@ -466,15 +466,13 @@ void n8080_state::n8080_sound_cpu_map(address_map &map) map(0x0000, 0x03ff).rom(); } - void n8080_state::helifire_sound_io_map(address_map &map) { map(0x00, 0x7f).r(FUNC(n8080_state::helifire_8035_external_ram_r)); } - -MACHINE_CONFIG_START(n8080_state::spacefev_sound) - +void n8080_state::spacefev_sound(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(n8080_state,spacefev) MCFG_SOUND_RESET_OVERRIDE(n8080_state,spacefev) @@ -486,35 +484,35 @@ MACHINE_CONFIG_START(n8080_state::spacefev_sound) m_audiocpu->p1_in_cb().set(FUNC(n8080_state::n8080_8035_p1_r)); m_audiocpu->p2_out_cb().set(FUNC(n8080_state::n8080_dac_w)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("vco_timer", n8080_state, spacefev_vco_voltage_timer, attotime::from_hz(1000)) + TIMER(config, "vco_timer").configure_periodic(FUNC(n8080_state::spacefev_vco_voltage_timer), attotime::from_hz(1000)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("n8080_dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT) - - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(36), RES_K(150), CAP_N(1)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(1)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1.0), RES_K(20)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_N(1), RES_M(1.5)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_N(47), RES_M(1)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_N(47), RES_K(820)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(n8080_state::sheriff_sound) - + DAC_1BIT(config, m_n8080_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT); + + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(36), RES_K(150), CAP_N(1)); + m_sn->set_decay_res(RES_M(1)); + m_sn->set_attack_params(CAP_U(1.0), RES_K(20)); + m_sn->set_amp_res(RES_K(150)); + m_sn->set_feedback_res(RES_K(47)); + m_sn->set_vco_params(0, CAP_N(1), RES_M(1.5)); + m_sn->set_pitch_voltage(0); + m_sn->set_slf_params(CAP_N(47), RES_M(1)); + m_sn->set_oneshot_params(CAP_N(47), RES_K(820)); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "speaker", 0.35); +} + +void n8080_state::sheriff_sound(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(n8080_state,sheriff) MCFG_SOUND_RESET_OVERRIDE(n8080_state,sheriff) @@ -529,30 +527,30 @@ MACHINE_CONFIG_START(n8080_state::sheriff_sound) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("n8080_dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT) - - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(36), RES_K(100), CAP_N(1)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(620)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1.0), RES_K(20)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_N(1), RES_M(1.5)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_N(47), RES_M(1.5)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_N(47), RES_K(560)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.35) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(n8080_state::helifire_sound) - + DAC_1BIT(config, m_n8080_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT); + + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(36), RES_K(100), CAP_N(1)); + m_sn->set_decay_res(RES_K(620)); + m_sn->set_attack_params(CAP_U(1.0), RES_K(20)); + m_sn->set_amp_res(RES_K(150)); + m_sn->set_feedback_res(RES_K(47)); + m_sn->set_vco_params(0, CAP_N(1), RES_M(1.5)); + m_sn->set_pitch_voltage(0); + m_sn->set_slf_params(CAP_N(47), RES_M(1.5)); + m_sn->set_oneshot_params(CAP_N(47), RES_K(560)); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "speaker", 0.35); +} + +void n8080_state::helifire_sound(machine_config &config) +{ MCFG_SOUND_START_OVERRIDE(n8080_state,helifire) MCFG_SOUND_RESET_OVERRIDE(n8080_state,helifire) @@ -566,11 +564,13 @@ MACHINE_CONFIG_START(n8080_state::helifire_sound) m_audiocpu->p1_out_cb().set("helifire_dac", FUNC(dac_byte_interface::data_w)); m_audiocpu->p2_out_cb().set(FUNC(n8080_state::helifire_sound_ctrl_w)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("helifire_dac_volume_timer", n8080_state, helifire_dac_volume_timer, attotime::from_hz(1000)) + TIMER(config, "helifire_dac_volume_timer").configure_periodic(FUNC(n8080_state::helifire_dac_volume_timer), attotime::from_hz(1000)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("helifire_dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // unknown DAC - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "helifire_dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "helifire_dac", -1.0, DAC_VREF_NEG_INPUT) -MACHINE_CONFIG_END + DAC_8BIT_R2R(config, m_helifire_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "helifire_dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "helifire_dac", -1.0, DAC_VREF_NEG_INPUT); +} diff --git a/src/mame/audio/scramble.cpp b/src/mame/audio/scramble.cpp index d57d9887a6d..075d0fd235a 100644 --- a/src/mame/audio/scramble.cpp +++ b/src/mame/audio/scramble.cpp @@ -263,25 +263,25 @@ void scramble_state::ad2083_sound_io_map(address_map &map) map(0x80, 0x80).w("ay2", FUNC(ay8910_device::address_w)); } -MACHINE_CONFIG_START(scramble_state::ad2083_audio) - - MCFG_DEVICE_ADD("audiocpu", Z80, 14318000/8) /* 1.78975 MHz */ - MCFG_DEVICE_PROGRAM_MAP(ad2083_sound_map) - MCFG_DEVICE_IO_MAP(ad2083_sound_io_map) - - MCFG_DEVICE_ADD("tmsprom", TMSPROM, AD2083_TMS5110_CLOCK / 2) /* rom clock */ - MCFG_TMSPROM_REGION("5110ctrl") /* prom memory region - sound region is automatically assigned */ - MCFG_TMSPROM_ROM_SIZE(0x1000) /* individual rom_size */ - MCFG_TMSPROM_PDC_BIT(1) /* bit # of pdc line */ +void scramble_state::ad2083_audio(machine_config &config) +{ + Z80(config, m_audiocpu, 14318000/8); /* 1.78975 MHz */ + m_audiocpu->set_addrmap(AS_PROGRAM, &scramble_state::ad2083_sound_map); + m_audiocpu->set_addrmap(AS_IO, &scramble_state::ad2083_sound_io_map); + + TMSPROM(config, m_tmsprom, AD2083_TMS5110_CLOCK / 2); /* rom clock */ + m_tmsprom->set_region("5110ctrl"); /* prom memory region - sound region is automatically assigned */ + m_tmsprom->set_rom_size(0x1000); /* individual rom_size */ + m_tmsprom->set_pdc_bit(1); /* bit # of pdc line */ /* virtual bit 8: constant 0, virtual bit 9:constant 1 */ - MCFG_TMSPROM_CTL1_BIT(8) /* bit # of ctl1 line */ - MCFG_TMSPROM_CTL2_BIT(2) /* bit # of ctl2 line */ - MCFG_TMSPROM_CTL4_BIT(8) /* bit # of ctl4 line */ - MCFG_TMSPROM_CTL8_BIT(2) /* bit # of ctl8 line */ - MCFG_TMSPROM_RESET_BIT(6) /* bit # of rom reset */ - MCFG_TMSPROM_STOP_BIT(7) /* bit # of stop */ - MCFG_TMSPROM_PDC_CB(WRITELINE("tms", tms5110_device, pdc_w)) /* tms pdc func */ - MCFG_TMSPROM_CTL_CB(WRITE8("tms", tms5110_device, ctl_w)) /* tms ctl func */ + m_tmsprom->set_ctl1_bit(8); /* bit # of ctl1 line */ + m_tmsprom->set_ctl2_bit(2); /* bit # of ctl2 line */ + m_tmsprom->set_ctl4_bit(8); /* bit # of ctl4 line */ + m_tmsprom->set_ctl8_bit(2); /* bit # of ctl8 line */ + m_tmsprom->set_reset_bit(6); /* bit # of rom reset */ + m_tmsprom->set_stop_bit(7); /* bit # of stop */ + m_tmsprom->pdc().set("tms", FUNC(tms5110_device::pdc_w)); /* tms pdc func */ + m_tmsprom->ctl().set("tms", FUNC(tms5110_device::ctl_w)); /* tms ctl func */ SPEAKER(config, "mono").front_center(); @@ -295,8 +295,8 @@ MACHINE_CONFIG_START(scramble_state::ad2083_audio) ay2.port_a_read_callback().set(FUNC(scramble_state::hotshock_soundlatch_r)); ay2.add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("tms", TMS5110A, AD2083_TMS5110_CLOCK) - MCFG_TMS5110_M0_CB(WRITELINE("tmsprom", tmsprom_device, m0_w)) - MCFG_TMS5110_DATA_CB(READLINE("tmsprom", tmsprom_device, data_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + tms5110a_device &tms(TMS5110A(config, "tms", AD2083_TMS5110_CLOCK)); + tms.m0().set("tmsprom", FUNC(tmsprom_device::m0_w)); + tms.data().set("tmsprom", FUNC(tmsprom_device::data_r)); + tms.add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp index 6c3047405ca..e1cda7c68be 100644 --- a/src/mame/audio/segag80r.cpp +++ b/src/mame/audio/segag80r.cpp @@ -228,14 +228,14 @@ static const char *const astrob_sample_names[] = }; -MACHINE_CONFIG_START(segag80r_state::astrob_sound_board) - +void segag80r_state::astrob_sound_board(machine_config &config) +{ /* sound hardware */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(11) - MCFG_SAMPLES_NAMES(astrob_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(11); + m_samples->set_samples_names(astrob_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); +} /************************************* @@ -415,22 +415,21 @@ static const char *const sega005_sample_names[] = }; -MACHINE_CONFIG_START(segag80r_state::sega005_sound_board) - +void segag80r_state::sega005_sound_board(machine_config &config) +{ i8255_device &ppi(I8255A(config, "ppi8255")); ppi.out_pa_callback().set(FUNC(segag80r_state::sega005_sound_a_w)); ppi.out_pb_callback().set(FUNC(segag80r_state::sega005_sound_b_w)); /* sound hardware */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(7) - MCFG_SAMPLES_NAMES(sega005_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(7); + m_samples->set_samples_names(sega005_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); - MCFG_DEVICE_ADD("005", SEGA005, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END + SEGA005(config, "005", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); +} /************************************* @@ -577,15 +576,15 @@ static const char *const spaceod_sample_names[] = }; -MACHINE_CONFIG_START(segag80r_state::spaceod_sound_board) - +void segag80r_state::spaceod_sound_board(machine_config &config) +{ /* sound hardware */ - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(11) - MCFG_SAMPLES_NAMES(spaceod_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(11); + m_samples->set_samples_names(spaceod_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); +} /************************************* @@ -810,7 +809,8 @@ WRITE8_MEMBER(monsterb_sound_device::n7751_p2_w) * *************************************/ -MACHINE_CONFIG_START(monsterb_sound_device::device_add_mconfig) +void monsterb_sound_device::device_add_mconfig(machine_config &config) +{ /* basic machine hardware */ N7751(config, m_audiocpu, 6000000); m_audiocpu->t1_in_cb().set_constant(0); // labelled as "TEST", connected to ground @@ -826,19 +826,21 @@ MACHINE_CONFIG_START(monsterb_sound_device::device_add_mconfig) m_i8243->p6_out_cb().set(FUNC(monsterb_sound_device::n7751_rom_addr_w<8>)); m_i8243->p7_out_cb().set(FUNC(monsterb_sound_device::n7751_rom_select_w)); - MCFG_DEVICE_ADD(m_samples, SAMPLES) - MCFG_SAMPLES_CHANNELS(2) - MCFG_SAMPLES_NAMES(monsterb_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(2); + m_samples->set_samples_names(monsterb_sample_names); + m_samples->add_route(ALL_OUTPUTS, "speaker", 0.25); - MCFG_TMS36XX_ADD(m_music, 247) - MCFG_TMS36XX_TYPE(TMS3617) - MCFG_TMS36XX_DECAY_TIMES(0.5, 0.5, 0.5, 0.5, 0.5, 0.5) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) + TMS36XX(config, m_music, 247); + m_music->set_subtype(tms36xx_device::subtype::TMS3617); + m_music->set_decays(0.5, 0.5, 0.5, 0.5, 0.5, 0.5); + m_music->add_route(ALL_OUTPUTS, "speaker", 0.5); - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // 50K (R91-97)/100K (R98-106) ladder network - 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) + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // 50K (R91-97)/100K (R98-106) ladder network + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); SPEAKER(config, "speaker").front_center(); -MACHINE_CONFIG_END +} diff --git a/src/mame/audio/snk6502.cpp b/src/mame/audio/snk6502.cpp index 1fa6af8811c..43dfcb58aee 100644 --- a/src/mame/audio/snk6502.cpp +++ b/src/mame/audio/snk6502.cpp @@ -684,51 +684,52 @@ WRITE8_MEMBER(vanguard_sound_device::speech_w) m_custom->speech_w(data, vanguard_table, 2); } -MACHINE_CONFIG_START(vanguard_sound_device::device_add_mconfig) +void vanguard_sound_device::device_add_mconfig(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(m_custom, SNK6502_SOUND, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + SNK6502_SOUND(config, m_custom, 0); + m_custom->add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(3) - MCFG_SAMPLES_NAMES(vanguard_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + SAMPLES(config, m_samples); + m_samples->set_channels(3); + m_samples->set_samples_names(vanguard_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("sn76477.1", SN76477) + sn76477_device &sn76477_1(SN76477(config, "sn76477.1")); // SHOT A GND: 2,9,26,27 +5V: 15,25 - MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_M(1.5), CAP_P(220)) // noise + filter - MCFG_SN76477_DECAY_RES(0) // decay_res - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(4.7)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn76477.2", SN76477) + sn76477_1.set_noise_params(RES_K(470), RES_M(1.5), CAP_P(220)); + sn76477_1.set_decay_res(0); + sn76477_1.set_attack_params(0, 0); + sn76477_1.set_amp_res(RES_K(47)); + sn76477_1.set_feedback_res(RES_K(4.7)); + sn76477_1.set_vco_params(0, 0, 0); + sn76477_1.set_pitch_voltage(0); + sn76477_1.set_slf_params(0, 0); + sn76477_1.set_oneshot_params(0, 0); + sn76477_1.set_vco_mode(0); + sn76477_1.set_mixer_params(0, 1, 0); + sn76477_1.set_envelope_params(1, 1); + sn76477_1.set_enable(1); + sn76477_1.add_route(ALL_OUTPUTS, "mono", 0.50); + + SN76477(config, m_sn76477_2); // SHOT B GND: 1,2,26,27 +5V: 15,25,28 - MCFG_SN76477_NOISE_PARAMS(RES_K(10), RES_K(30), 0) // noise + filter - MCFG_SN76477_DECAY_RES(0) // decay_res - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(4.7)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + m_sn76477_2->set_noise_params(RES_K(10), RES_K(30), 0); + m_sn76477_2->set_decay_res(0); + m_sn76477_2->set_attack_params(0, 0); + m_sn76477_2->set_amp_res(RES_K(47)); + m_sn76477_2->set_feedback_res(RES_K(4.7)); + m_sn76477_2->set_vco_params(0, 0, 0); + m_sn76477_2->set_pitch_voltage(0); + m_sn76477_2->set_slf_params(0, 0); + m_sn76477_2->set_oneshot_params(0, 0); + m_sn76477_2->set_vco_mode(0); + m_sn76477_2->set_mixer_params(0, 1, 0); + m_sn76477_2->set_envelope_params(0, 1); + m_sn76477_2->set_enable(1); + m_sn76477_2->add_route(ALL_OUTPUTS, "mono", 0.25); +} void vanguard_sound_device::device_start() { @@ -891,24 +892,24 @@ MACHINE_CONFIG_START(fantasy_sound_device::device_add_mconfig) MCFG_SAMPLES_NAMES(fantasy_sample_names) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - MCFG_DEVICE_ADD("sn76477.1", SN76477) + sn76477_device &sn76477_1(SN76477(config, "sn76477.1")); // BOMB GND: 2,9,26,27 +5V: 15,25 - MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_M(1.5), CAP_P(220)) // noise + filter - MCFG_SN76477_DECAY_RES(0) // decay_res - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(470)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(4.7)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C + sn76477_1.set_noise_params(RES_K(470), RES_M(1.5), CAP_P(220)); + sn76477_1.set_decay_res(0); + sn76477_1.set_attack_params(0, 0); + sn76477_1.set_amp_res(RES_K(470)); + sn76477_1.set_feedback_res(RES_K(4.7)); + sn76477_1.set_vco_params(0, 0, 0); + sn76477_1.set_pitch_voltage(0); + sn76477_1.set_slf_params(0, 0); + sn76477_1.set_oneshot_params(0, 0); + sn76477_1.set_vco_mode(0); + sn76477_1.set_mixer_params(0, 1, 0); // schematic does not show pin 1 grounded, but it must be. // otherwise it is using the VCO for the envelope, but the VCO is not hooked up - MCFG_SN76477_ENVELOPE_PARAMS(0, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(0) // enable - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0) + sn76477_1.set_envelope_params(0, 1); + sn76477_1.set_enable(0); + sn76477_1.add_route(0, "discrete", 1.0, 0); MCFG_DEVICE_ADD("discrete", DISCRETE, fantasy_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) @@ -1035,56 +1036,56 @@ MACHINE_CONFIG_START(sasuke_sound_device::device_add_mconfig) MCFG_SAMPLES_NAMES(sasuke_sample_names) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12) - MCFG_DEVICE_ADD("sn76477.1", SN76477) + sn76477_device &sn76477_1(SN76477(config, "sn76477.1")); // ic48 GND: 2,22,26,27,28 +5V: 1,15,25 - MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_K(150), CAP_P(4700)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(22)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(10), RES_K(10)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(100)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res: N/C - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage: N/C - MCFG_SN76477_SLF_PARAMS(0, RES_K(10)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(2.2), RES_K(100)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn76477.2", SN76477) + sn76477_1.set_noise_params(RES_K(470), RES_K(150), CAP_P(4700)); + sn76477_1.set_decay_res(RES_K(22)); + sn76477_1.set_attack_params(CAP_U(10), RES_K(10)); + sn76477_1.set_amp_res(RES_K(100)); + sn76477_1.set_feedback_res(RES_K(47)); + sn76477_1.set_vco_params(0, 0, 0); + sn76477_1.set_pitch_voltage(0); + sn76477_1.set_slf_params(0, RES_K(10)); + sn76477_1.set_oneshot_params(CAP_U(2.2), RES_K(100)); + sn76477_1.set_vco_mode(0); + sn76477_1.set_mixer_params(0, 1, 0); + sn76477_1.set_envelope_params(1, 0); + sn76477_1.set_enable(1); + sn76477_1.add_route(ALL_OUTPUTS, "mono", 0.50); + + sn76477_device &sn76477_2(SN76477(config, "sn76477.2")); // ic51 GND: 2,26,27 +5V: 1,15,22,25,28 - MCFG_SN76477_NOISE_PARAMS(RES_K(340), RES_K(47), CAP_P(100)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(470)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(4.7), RES_K(10)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(100)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_P(220), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage: N/C - MCFG_SN76477_SLF_PARAMS(0, RES_K(220)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(22), RES_K(47)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn76477.3", SN76477) + sn76477_2.set_noise_params(RES_K(340), RES_K(47), CAP_P(100)); + sn76477_2.set_decay_res(RES_K(470)); + sn76477_2.set_attack_params(CAP_U(4.7), RES_K(10)); + sn76477_2.set_amp_res(RES_K(100)); + sn76477_2.set_feedback_res(RES_K(47)); + sn76477_2.set_vco_params(0, CAP_P(220), RES_K(1000)); + sn76477_2.set_pitch_voltage(0); + sn76477_2.set_slf_params(0, RES_K(220)); + sn76477_2.set_oneshot_params(CAP_U(22), RES_K(47)); + sn76477_2.set_vco_mode(1); + sn76477_2.set_mixer_params(0, 1, 0); + sn76477_2.set_envelope_params(1, 1); + sn76477_2.set_enable(1); + sn76477_2.add_route(ALL_OUTPUTS, "mono", 0.50); + + sn76477_device &sn76477_3(SN76477(config, "sn76477.3")); // ic52 GND: 2,22,27,28 +5V: 1,15,25,26 - MCFG_SN76477_NOISE_PARAMS(RES_K(330), RES_K(47), CAP_P(100)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(1)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(1)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(100)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_P(1000), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage: N/C - MCFG_SN76477_SLF_PARAMS(CAP_U(1), RES_K(10)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(2.2), RES_K(150)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(1, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + sn76477_3.set_noise_params(RES_K(330), RES_K(47), CAP_P(100)); + sn76477_3.set_decay_res(RES_K(1)); + sn76477_3.set_attack_params(0, RES_K(1)); + sn76477_3.set_amp_res(RES_K(100)); + sn76477_3.set_feedback_res(RES_K(47)); + sn76477_3.set_vco_params(0, CAP_P(1000), RES_K(1000)); + sn76477_3.set_pitch_voltage(0); + sn76477_3.set_slf_params(CAP_U(1), RES_K(10)); + sn76477_3.set_oneshot_params(CAP_U(2.2), RES_K(150)); + sn76477_3.set_vco_mode(0); + sn76477_3.set_mixer_params(1, 1, 0); + sn76477_3.set_envelope_params(1, 0); + sn76477_3.set_enable(1); + sn76477_3.add_route(ALL_OUTPUTS, "mono", 0.50); MACHINE_CONFIG_END void sasuke_sound_device::device_start() @@ -1175,22 +1176,22 @@ MACHINE_CONFIG_START(satansat_sound_device::device_add_mconfig) MCFG_SAMPLES_NAMES(vanguard_sample_names) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_DEVICE_ADD("sn76477.1", SN76477) + sn76477_device &sn76477_1(SN76477(config, "sn76477.1")); // ??? GND: 2,26,27 +5V: 15,25 - MCFG_SN76477_NOISE_PARAMS(RES_K(470), RES_M(1.5), CAP_P(220)) // noise + filter - MCFG_SN76477_DECAY_RES(0) // decay_res - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 1, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + sn76477_1.set_noise_params(RES_K(470), RES_M(1.5), CAP_P(220)); + sn76477_1.set_decay_res(0); + sn76477_1.set_attack_params(0, 0); + sn76477_1.set_amp_res(RES_K(47)); + sn76477_1.set_feedback_res(RES_K(47)); + sn76477_1.set_vco_params(0, 0, 0); + sn76477_1.set_pitch_voltage(0); + sn76477_1.set_slf_params(0, 0); + sn76477_1.set_oneshot_params(0, 0); + sn76477_1.set_vco_mode(0); + sn76477_1.set_mixer_params(0, 1, 0); + sn76477_1.set_envelope_params(1, 1); + sn76477_1.set_enable(1); + sn76477_1.add_route(ALL_OUTPUTS, "mono", 1.0); MACHINE_CONFIG_END void satansat_sound_device::device_start() diff --git a/src/mame/audio/zaccaria.cpp b/src/mame/audio/zaccaria.cpp index d9365fbea36..6f856015861 100644 --- a/src/mame/audio/zaccaria.cpp +++ b/src/mame/audio/zaccaria.cpp @@ -222,12 +222,13 @@ READ8_MEMBER(zac1b111xx_melody_base::melodypsg1_portb_r) return m_melody_command; } -MACHINE_CONFIG_START(zac1b111xx_melody_base::device_add_mconfig) - MCFG_DEVICE_ADD("melodycpu", M6802, XTAL(3'579'545)) // verified on pcb - MCFG_DEVICE_PROGRAM_MAP(zac1b111xx_melody_base_map) +void zac1b111xx_melody_base::device_add_mconfig(machine_config &config) +{ + M6802(config, m_melodycpu, XTAL(3'579'545)); // verified on pcb + m_melodycpu->set_addrmap(AS_PROGRAM, &zac1b111xx_melody_base::zac1b111xx_melody_base_map); - MCFG_DEVICE_ADD("timebase", CLOCK, XTAL(3'579'545)/4096/2) // CPU clock divided using 4040 and half of 74LS74 - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE("melodypia", pia6821_device, cb1_w)) + clock_device &timebase(CLOCK(config, "timebase", XTAL(3'579'545)/4096/2)); // CPU clock divided using 4040 and half of 74LS74 + timebase.signal_handler().set(m_melodypia, FUNC(pia6821_device::cb1_w)); PIA6821(config, m_melodypia, 0); m_melodypia->readpa_handler().set(FUNC(zac1b111xx_melody_base::melodypia_porta_r)); @@ -240,7 +241,7 @@ MACHINE_CONFIG_START(zac1b111xx_melody_base::device_add_mconfig) m_melodypsg1->port_b_read_callback().set(FUNC(zac1b111xx_melody_base::melodypsg1_portb_r)); AY8910(config, m_melodypsg2, XTAL(3'579'545)/2); // CPU clock divided using 4040 -MACHINE_CONFIG_END +} void zac1b111xx_melody_base::device_start() { @@ -301,18 +302,18 @@ WRITE8_MEMBER(zac1b11107_audio_device::melodypsg2_porta_w) // TODO: assume LEVELT is controlled here as is the case for 1B11142? } -MACHINE_CONFIG_START(zac1b11107_audio_device::device_add_mconfig) +void zac1b11107_audio_device::device_add_mconfig(machine_config &config) +{ zac1b111xx_melody_base::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("melodycpu") - MCFG_DEVICE_PROGRAM_MAP(zac1b11107_melody_map) + m_melodycpu->set_addrmap(AS_PROGRAM, &zac1b11107_audio_device::zac1b11107_melody_map); m_melodypsg1->port_a_write_callback().set(FUNC(zac1b11107_audio_device::melodypsg1_porta_w)); m_melodypsg1->add_route(ALL_OUTPUTS, *this, 0.5, AUTO_ALLOC_INPUT, 0); m_melodypsg2->port_a_write_callback().set(FUNC(zac1b11107_audio_device::melodypsg2_porta_w)); m_melodypsg2->add_route(ALL_OUTPUTS, *this, 0.5, AUTO_ALLOC_INPUT, 0); -MACHINE_CONFIG_END +} @@ -402,11 +403,11 @@ WRITE8_MEMBER(zac1b11142_audio_device::pia_1i_portb_w) // TODO: a LED output().set_led_value(0, BIT(data, 4)); } -MACHINE_CONFIG_START(zac1b11142_audio_device::device_add_mconfig) +void zac1b11142_audio_device::device_add_mconfig(machine_config &config) +{ zac1b111xx_melody_base::device_add_mconfig(config); - MCFG_DEVICE_MODIFY("melodycpu") - MCFG_DEVICE_PROGRAM_MAP(zac1b11142_melody_map) + m_melodycpu->set_addrmap(AS_PROGRAM, &zac1b11142_audio_device::zac1b11142_melody_map); m_melodypsg1->port_a_write_callback().set(FUNC(zac1b11142_audio_device::ay_4g_porta_w)); m_melodypsg1->add_route(0, "sound_nl", 1.0, 0); @@ -419,48 +420,49 @@ MACHINE_CONFIG_START(zac1b11142_audio_device::device_add_mconfig) m_melodypsg2->add_route(1, "sound_nl", 1.0, 4); m_melodypsg2->add_route(2, "sound_nl", 1.0, 5); - MCFG_DEVICE_ADD("audiocpu", M6802, XTAL(3'579'545)) // verified on pcb - MCFG_DEVICE_PROGRAM_MAP(zac1b11142_audio_map) + M6802(config, m_audiocpu, XTAL(3'579'545)); // verified on pcb + m_audiocpu->set_addrmap(AS_PROGRAM, &zac1b11142_audio_device::zac1b11142_audio_map); PIA6821(config, m_pia_1i, 0); - m_pia_1i->readpa_handler().set("speech", FUNC(tms5220_device::status_r)); - m_pia_1i->writepa_handler().set("speech", FUNC(tms5220_device::data_w)); + m_pia_1i->readpa_handler().set(m_speech, FUNC(tms5220_device::status_r)); + m_pia_1i->writepa_handler().set(m_speech, FUNC(tms5220_device::data_w)); m_pia_1i->writepb_handler().set(FUNC(zac1b11142_audio_device::pia_1i_portb_w)); - MCFG_DEVICE_ADD("dac", MC1408, 0) MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.40, 0) // mc1408.1f - 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) + MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.40, 0); // mc1408.1f + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); // There is no xtal, the clock is obtained from a RC oscillator as shown in the TMS5220 datasheet (R=100kOhm C=22pF) // 162kHz measured on pin 3 20 minutes after power on, clock would then be 162.3*4=649.2kHz - MCFG_DEVICE_ADD("speech", TMS5200, 649200) // ROMCLK pin measured at 162.3Khz, OSC is exactly *4 of that) - MCFG_TMS52XX_IRQ_HANDLER(WRITELINE("pia_1i", pia6821_device, cb1_w)) - MCFG_TMS52XX_READYQ_HANDLER(WRITELINE("pia_1i", pia6821_device, ca2_w)) - MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.80, 0) - - MCFG_DEVICE_ADD("sound_nl", NETLIST_SOUND, 48000) - MCFG_NETLIST_SETUP(zac1b11142) - MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 1.0, 0) - - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa0", "I_IOA0.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa1", "I_IOA1.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa2", "I_IOA2.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa3", "I_IOA3.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa4", "I_IOA4.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "level", "I_LEVEL.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "levelt", "I_LEVELT.IN", 0) - MCFG_NETLIST_LOGIC_INPUT("sound_nl", "sw1", "I_SW1.IN", 0) - - MCFG_NETLIST_STREAM_INPUT("sound_nl", 0, "R_AY4G_A.R") - MCFG_NETLIST_STREAM_INPUT("sound_nl", 1, "R_AY4G_B.R") - MCFG_NETLIST_STREAM_INPUT("sound_nl", 2, "R_AY4G_C.R") - MCFG_NETLIST_STREAM_INPUT("sound_nl", 3, "R_AY4H_A.R") - MCFG_NETLIST_STREAM_INPUT("sound_nl", 4, "R_AY4H_B.R") - MCFG_NETLIST_STREAM_INPUT("sound_nl", 5, "R_AY4H_C.R") - - MCFG_NETLIST_STREAM_OUTPUT("sound_nl", 0, "P1.2") - MCFG_NETLIST_ANALOG_MULT_OFFSET(3000.0 * 10.0, 0.0) // FIXME: no clue what numbers to use here -MACHINE_CONFIG_END + TMS5200(config, m_speech, 649200); // ROMCLK pin measured at 162.3Khz, OSC is exactly *4 of that) + m_speech->irq_cb().set(m_pia_1i, FUNC(pia6821_device::cb1_w)); + m_speech->ready_cb().set(m_pia_1i, FUNC(pia6821_device::ca2_w)); + m_speech->add_route(ALL_OUTPUTS, *this, 0.80, 0); + + netlist_mame_sound_device &sound_nl(NETLIST_SOUND(config, "sound_nl", 48000)); + sound_nl.set_constructor(netlist_zac1b11142); + sound_nl.add_route(ALL_OUTPUTS, *this, 1.0, 0); + + NETLIST_LOGIC_INPUT(config, "sound_nl:ioa0", "I_IOA0.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:ioa1", "I_IOA1.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:ioa2", "I_IOA2.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:ioa3", "I_IOA3.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:ioa4", "I_IOA4.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:level", "I_LEVEL.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:levelt", "I_LEVELT.IN", 0); + NETLIST_LOGIC_INPUT(config, "sound_nl:sw1", "I_SW1.IN", 0); + + NETLIST_STREAM_INPUT(config, "sound_nl:cin0", 0, "R_AY4G_A.R"); + NETLIST_STREAM_INPUT(config, "sound_nl:cin1", 1, "R_AY4G_B.R"); + NETLIST_STREAM_INPUT(config, "sound_nl:cin2", 2, "R_AY4G_C.R"); + NETLIST_STREAM_INPUT(config, "sound_nl:cin3", 3, "R_AY4H_A.R"); + NETLIST_STREAM_INPUT(config, "sound_nl:cin4", 4, "R_AY4H_B.R"); + NETLIST_STREAM_INPUT(config, "sound_nl:cin5", 5, "R_AY4H_C.R"); + + NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "P1.2").set_mult_offset(3000.0 * 10.0, 0.0); // FIXME: no clue what numbers to use here +} ioport_constructor zac1b11142_audio_device::device_input_ports() const { diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp index ad77e2fc5bb..1cde5338f2f 100644 --- a/src/mame/drivers/8080bw.cpp +++ b/src/mame/drivers/8080bw.cpp @@ -1564,21 +1564,21 @@ MACHINE_CONFIG_START(_8080bw_state::schaser) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(470)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(2.2)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1.0), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(0) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(33)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(39)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.1), RES_K(220)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0) + sn76477_device &snsnd(SN76477(config, "snsnd")); + snsnd.set_noise_params(RES_K(47), RES_K(330), CAP_P(470)); + snsnd.set_decay_res(RES_M(2.2)); + snsnd.set_attack_params(CAP_U(1.0), RES_K(4.7)); + snsnd.set_amp_res(0); + snsnd.set_feedback_res(RES_K(33)); + snsnd.set_vco_params(0, CAP_U(0.1), RES_K(39)); + snsnd.set_pitch_voltage(5.0); + snsnd.set_slf_params(CAP_U(1.0), RES_K(120)); + snsnd.set_oneshot_params(CAP_U(0.1), RES_K(220)); + snsnd.set_vco_mode(1); + snsnd.set_mixer_params(0, 0, 0); + snsnd.set_envelope_params(1, 0); + snsnd.set_enable(1); + snsnd.add_route(0, "discrete", 1.0, 0); MCFG_DEVICE_ADD("discrete", DISCRETE, schaser_discrete) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) @@ -1898,21 +1898,21 @@ MACHINE_CONFIG_START(_8080bw_state::lupin3) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + sn76477_device &snsnd(SN76477(config, "snsnd")); + snsnd.set_noise_params(0, 0, 0); + snsnd.set_decay_res(0); + snsnd.set_attack_params(0, RES_K(100)); + snsnd.set_amp_res(RES_K(56)); + snsnd.set_feedback_res(RES_K(10)); + snsnd.set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + snsnd.set_pitch_voltage(5.0); + snsnd.set_slf_params(CAP_U(1.0), RES_K(120)); + snsnd.set_oneshot_params(0, 0); + snsnd.set_vco_mode(1); + snsnd.set_mixer_params(0, 0, 0); + snsnd.set_envelope_params(1, 0); + snsnd.set_enable(1); + snsnd.add_route(ALL_OUTPUTS, "mono", 0.5); MCFG_DEVICE_ADD("samples", SAMPLES) MCFG_SAMPLES_CHANNELS(4) diff --git a/src/mame/drivers/abc80.cpp b/src/mame/drivers/abc80.cpp index 1508992d2d6..ab56eab9795 100644 --- a/src/mame/drivers/abc80.cpp +++ b/src/mame/drivers/abc80.cpp @@ -497,17 +497,17 @@ MACHINE_CONFIG_START(abc80_state::abc80) // sound hardware SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD(SN76477_TAG, SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter: R26 47k - R24 330k - C52 390p - MCFG_SN76477_DECAY_RES(RES_K(47)) // decay_res: R23 47k - MCFG_SN76477_ATTACK_PARAMS(CAP_U(10), RES_K(2.2)) // attack_decay_cap + attack_res: C50 10u/35V - R21 2.2k - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res: R19 33k - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res: R18 10k - MCFG_SN76477_VCO_PARAMS(0, CAP_N(10), RES_K(100)) // VCO volt + cap + res: 0V/2.5V (voltage divider R17 1k / R16 1k) - C48 10n - R20 100k - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage: N/C - MCFG_SN76477_SLF_PARAMS(CAP_U(1), RES_K(220)) // slf caps + res: C51 1u/35V - R22 220k - 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) + SN76477(config, m_csg); + m_csg->set_noise_params(RES_K(47), RES_K(330), CAP_P(390)); + m_csg->set_decay_res(RES_K(47)); + m_csg->set_attack_params(CAP_U(10), RES_K(2.2)); + m_csg->set_amp_res(RES_K(33)); + m_csg->set_feedback_res(RES_K(10)); + m_csg->set_vco_params(0, CAP_N(10), RES_K(100)); + m_csg->set_pitch_voltage(0); + m_csg->set_slf_params(CAP_U(1), RES_K(220)); + m_csg->set_oneshot_params(CAP_U(0.1), RES_K(330)); + m_csg->add_route(ALL_OUTPUTS, "mono", 0.25); WAVE(config, "wave", CASSETTE_TAG).add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp index d790b5760ed..e3d97ac9747 100644 --- a/src/mame/drivers/asteroid.cpp +++ b/src/mame/drivers/asteroid.cpp @@ -731,12 +731,12 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(asteroid_state::asteroid_base) - +void asteroid_state::asteroid_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/8) - MCFG_DEVICE_PROGRAM_MAP(asteroid_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(asteroid_state, asteroid_interrupt, CLOCK_3KHZ/12) + M6502(config, m_maincpu, MASTER_CLOCK/8); + m_maincpu->set_addrmap(AS_PROGRAM, &asteroid_state::asteroid_map); + m_maincpu->set_periodic_int(FUNC(asteroid_state::asteroid_interrupt), attotime::from_hz(CLOCK_3KHZ/12)); WATCHDOG_TIMER(config, "watchdog"); @@ -753,51 +753,52 @@ MACHINE_CONFIG_START(asteroid_state::asteroid_base) outlatch.bit_handler<5>().set(FUNC(asteroid_state::coin_counter_right_w)); // COIN CNTRR /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(CLOCK_3KHZ/12/4) - MCFG_SCREEN_SIZE(400,300) - MCFG_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182) - MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) + VECTOR(config, "vector"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_VECTOR)); + screen.set_refresh_hz(CLOCK_3KHZ/12/4); + screen.set_size(400,300); + screen.set_visarea(522, 1566, 394, 1182); + screen.set_screen_update("vector", FUNC(vector_device::screen_update)); DVG(config, m_dvg, 0); m_dvg->set_vector_tag("vector"); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(asteroid_state::asteroid) +void asteroid_state::asteroid(machine_config &config) +{ asteroid_base(config); /* sound hardware */ asteroid_sound(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(asteroid_state::asterock) +void asteroid_state::asterock(machine_config &config) +{ asteroid(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PERIODIC_INT_DRIVER(asteroid_state, asterock_interrupt, CLOCK_3KHZ/12) -MACHINE_CONFIG_END - + m_maincpu->set_periodic_int(FUNC(asteroid_state::asterock_interrupt), attotime::from_hz(CLOCK_3KHZ/12)); +} -MACHINE_CONFIG_START(asteroid_state::astdelux) +void asteroid_state::astdelux(machine_config &config) +{ asteroid_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(astdelux_map) + m_maincpu->set_addrmap(AS_PROGRAM, &asteroid_state::astdelux_map); - MCFG_DEVICE_ADD("earom", ER2055) + ER2055(config, m_earom); /* sound hardware */ astdelux_sound(config); - MCFG_DEVICE_ADD("pokey", POKEY, MASTER_CLOCK/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2")) - MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + pokey_device &pokey(POKEY(config, "pokey", MASTER_CLOCK/8)); + pokey.allpot_r().set_ioport("DSW2"); + pokey.set_output_rc(RES_K(10), CAP_U(0.015), 5.0); + pokey.add_route(ALL_OUTPUTS, "mono", 1.0); + + config.device_remove("outlatch"); - MCFG_DEVICE_REMOVE("outlatch") ls259_device &audiolatch(*subdevice<ls259_device>("audiolatch")); audiolatch.q_out_cb<0>().set_output("led0").invert(); // START1 audiolatch.q_out_cb<1>().set_output("led1").invert(); // START2 diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp index eb3fcc4afa1..e5867a55297 100644 --- a/src/mame/drivers/atari400.cpp +++ b/src/mame/drivers/atari400.cpp @@ -2017,7 +2017,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( a400_state::a5200_interrupt ) MACHINE_RESET_MEMBER( a400_state, a400 ) { - subdevice<pokey_device>("pokey")->write(machine().dummy_space(), 15, 0); + m_pokey->write(machine().dummy_space(), 15, 0); } @@ -2109,21 +2109,21 @@ WRITE8_MEMBER(a400_state::a800xl_pia_pb_w) **************************************************************/ -MACHINE_CONFIG_START(a400_state::atari_common_nodac) +void a400_state::atari_common_nodac(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, pokey_device::FREQ_17_EXACT) + M6502(config, m_maincpu, pokey_device::FREQ_17_EXACT); MCFG_MACHINE_RESET_OVERRIDE( a400_state, a400 ) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1)) - MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) - MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1)); + m_screen->set_visarea(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y); + m_screen->set_screen_update("antic", FUNC(antic_device::screen_update)); + m_screen->set_palette("palette"); - MCFG_PALETTE_ADD("palette", sizeof(atari_palette) / 3) - MCFG_PALETTE_INIT_OWNER(a400_state, a400) + PALETTE(config, "palette", sizeof(atari_palette) / 3).set_init(FUNC(a400_state::palette_init_a400)); PIA6821(config, m_pia, 0); m_pia->readpa_handler().set_ioport("djoy_0_1"); @@ -2131,34 +2131,34 @@ MACHINE_CONFIG_START(a400_state::atari_common_nodac) m_pia->ca2_handler().set("a8sio", FUNC(a8sio_device::motor_w)); m_pia->cb2_handler().set("fdc", FUNC(atari_fdc_device::pia_cb2_w)); - MCFG_DEVICE_ADD("a8sio", A8SIO, 0) - MCFG_A8SIO_DATA_IN_CB(WRITELINE("pokey", pokey_device, sid_w)) - MCFG_A8SIO_SLOT_ADD("a8sio", "sio", nullptr) + A8SIO(config, "a8sio", 0).data_in().set("pokey", FUNC(pokey_device::sid_w)); + A8SIO_SLOT(config, "sio", nullptr).set_a8sio_slot("a8sio", "sio"); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, pokey_device::FREQ_17_EXACT) - MCFG_POKEY_POT0_R_CB(IOPORT("analog_0")) - MCFG_POKEY_POT1_R_CB(IOPORT("analog_1")) - MCFG_POKEY_POT2_R_CB(IOPORT("analog_2")) - MCFG_POKEY_POT3_R_CB(IOPORT("analog_3")) - MCFG_POKEY_POT4_R_CB(IOPORT("analog_4")) - MCFG_POKEY_POT5_R_CB(IOPORT("analog_5")) - MCFG_POKEY_POT6_R_CB(IOPORT("analog_6")) - MCFG_POKEY_POT7_R_CB(IOPORT("analog_7")) - MCFG_POKEY_SERIN_R_CB(READ8("fdc", atari_fdc_device, serin_r)) - MCFG_POKEY_SEROUT_W_CB(WRITE8("fdc", atari_fdc_device, serout_w)) - MCFG_POKEY_KEYBOARD_CB(a400_state, a800_keyboard) - MCFG_POKEY_INTERRUPT_CB(a400_state, interrupt_cb) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(a400_state::atari_common) + POKEY(config, m_pokey, pokey_device::FREQ_17_EXACT); + m_pokey->pot_r<0>().set_ioport("analog_0"); + m_pokey->pot_r<1>().set_ioport("analog_1"); + m_pokey->pot_r<2>().set_ioport("analog_2"); + m_pokey->pot_r<3>().set_ioport("analog_3"); + m_pokey->pot_r<4>().set_ioport("analog_4"); + m_pokey->pot_r<5>().set_ioport("analog_5"); + m_pokey->pot_r<6>().set_ioport("analog_6"); + m_pokey->pot_r<7>().set_ioport("analog_7"); + m_pokey->serin_r().set("fdc", FUNC(atari_fdc_device::serin_r)); + m_pokey->serout_w().set("fdc", FUNC(atari_fdc_device::serout_w)); + m_pokey->set_keyboard_callback(FUNC(a400_state::a800_keyboard)); + m_pokey->set_interrupt_callback(FUNC(a400_state::interrupt_cb)); + m_pokey->add_route(ALL_OUTPUTS, "speaker", 1.0); +} + +void a400_state::atari_common(machine_config &config) +{ atari_common_nodac(config); - MCFG_DEVICE_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.03) - MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) + DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.03); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); /* internal ram */ RAM(config, m_ram).set_default_size("48K"); @@ -2171,122 +2171,113 @@ MACHINE_CONFIG_START(a400_state::atari_common) m_antic->set_gtia_tag(m_gtia); /* devices */ - MCFG_DEVICE_ADD("fdc", ATARI_FDC, 0) + ATARI_FDC(config, "fdc", 0); - MCFG_A800_CARTRIDGE_ADD("cartleft", a800_left, nullptr) + A800_CART_SLOT(config, "cartleft", a800_left, nullptr); /* software lists */ - MCFG_SOFTWARE_LIST_ADD("flop_list","a800_flop") - MCFG_SOFTWARE_LIST_ADD("cart_list","a800") - MCFG_SOFTWARE_LIST_ADD("xegs_list","xegs") -MACHINE_CONFIG_END - + SOFTWARE_LIST(config, "flop_list").set_original("a800_flop"); + SOFTWARE_LIST(config, "cart_list").set_original("a800"); + SOFTWARE_LIST(config, "xegs_list").set_original("xegs"); +} // memory map A400 + NTSC screen -MACHINE_CONFIG_START(a400_state::a400) +void a400_state::a400(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a400_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a400_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a400_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a400_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE( a400_state, a400 ) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); m_gtia->set_region(GTIA_NTSC); -MACHINE_CONFIG_END - +} // memory map A400 + PAL screen -MACHINE_CONFIG_START(a400_state::a400pal) +void a400_state::a400pal(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a400_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a400_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a400_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a400_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE( a400_state, a400 ) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_50HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ); m_gtia->set_region(GTIA_PAL); -MACHINE_CONFIG_END - +} // memory map A800 + NTSC screen + Right cartslot -MACHINE_CONFIG_START(a400_state::a800) +void a400_state::a800(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a400_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a400_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a400_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a400_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE( a400_state, a800 ) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); m_gtia->set_region(GTIA_NTSC); - MCFG_A800_CARTRIDGE_ADD("cartright", a800_right, nullptr) -MACHINE_CONFIG_END + A800_CART_SLOT(config, "cartright", a800_right, nullptr); +} // memory map A800 + PAL screen + Right cartslot -MACHINE_CONFIG_START(a400_state::a800pal) +void a400_state::a800pal(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a400_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a400_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a400_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a400_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE( a400_state, a800 ) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_50HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ); m_gtia->set_region(GTIA_PAL); - MCFG_A800_CARTRIDGE_ADD("cartright", a800_right, nullptr) -MACHINE_CONFIG_END + A800_CART_SLOT(config, "cartright", a800_right, nullptr); +} // memory map A600XL (same as 800XL but less RAM) + NTSC screen + MMU via PIA portB -MACHINE_CONFIG_START(a400_state::a600xl) +void a400_state::a600xl(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a600xl_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a800xl_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a600xl_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a800xl_interrupt), "screen", 0, 1); m_pia->writepb_handler().set(FUNC(a400_state::a600xl_pia_pb_w)); MCFG_MACHINE_START_OVERRIDE( a400_state, a800xl ) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); m_gtia->set_region(GTIA_NTSC); m_ram->set_default_size("16K"); -MACHINE_CONFIG_END - +} // memory map A800XL + NTSC screen + MMU via PIA portB -MACHINE_CONFIG_START(a400_state::a800xl) +void a400_state::a800xl(machine_config &config) +{ atari_common(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a800xl_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a800xl_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a800xl_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a800xl_interrupt), "screen", 0, 1); m_pia->writepb_handler().set(FUNC(a400_state::a800xl_pia_pb_w)); @@ -2294,84 +2285,74 @@ MACHINE_CONFIG_START(a400_state::a800xl) m_ram->set_default_size("64K"); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); m_gtia->set_region(GTIA_NTSC); -MACHINE_CONFIG_END +} // memory map A800XL + PAL screen + MMU via PIA portB -MACHINE_CONFIG_START(a400_state::a800xlpal) +void a400_state::a800xlpal(machine_config &config) +{ a800xl(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_CLOCK( 1773000 ) + m_maincpu->set_clock(1773000); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_50HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ); m_gtia->set_region(GTIA_PAL); - MCFG_DEVICE_MODIFY("pokey") - MCFG_DEVICE_CLOCK(1773000) -MACHINE_CONFIG_END + m_pokey->set_clock(1773000); +} // memory map A1200XL+ MMU via PIA portB -MACHINE_CONFIG_START(a400_state::a1200xl) +void a400_state::a1200xl(machine_config &config) +{ a800xl(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a1200xl_mem) - + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a1200xl_mem); m_pia->writepb_handler().set(FUNC(a400_state::a800xl_pia_pb_w)); -MACHINE_CONFIG_END - +} // memory map A130XE (extra RAM only partially emulated) -MACHINE_CONFIG_START(a400_state::a130xe) +void a400_state::a130xe(machine_config &config) +{ a800xl(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a130xe_mem) - + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a130xe_mem); m_ram->set_default_size("128K"); -MACHINE_CONFIG_END - +} // memory map XEGS, only XEGS bankswitch supported -MACHINE_CONFIG_START(a400_state::xegs) +void a400_state::xegs(machine_config &config) +{ a800xl(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(xegs_mem) - - MCFG_DEVICE_REMOVE("cartleft") - MCFG_DEVICE_REMOVE("cart_list") + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::xegs_mem); - MCFG_XEGS_CARTRIDGE_ADD("cartleft", xegs_carts, nullptr) -MACHINE_CONFIG_END + config.device_remove("cartleft"); + config.device_remove("cart_list"); + XEGS_CART_SLOT(config, "cartleft", xegs_carts, nullptr); +} // memory map A5200, different ports, less RAM -MACHINE_CONFIG_START(a400_state::a5200) +void a400_state::a5200(machine_config &config) +{ atari_common_nodac(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(a5200_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a400_state, a5200_interrupt, "screen", 0, 1) + m_maincpu->set_addrmap(AS_PROGRAM, &a400_state::a5200_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(a400_state::a5200_interrupt), "screen", 0, 1); // FIXME: should there be anything connected where other system have the fdc? - MCFG_DEVICE_MODIFY("pokey") - MCFG_POKEY_SERIN_R_CB(CONSTANT(0)) - MCFG_POKEY_SEROUT_W_CB(NOOP) - MCFG_POKEY_KEYBOARD_CB(a400_state, a5200_keypads) - MCFG_POKEY_INTERRUPT_CB(a400_state, interrupt_cb) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) + m_pokey->serin_r().set_constant(0); + m_pokey->serout_w().set_nop(); + m_pokey->set_keyboard_callback(FUNC(a400_state::a5200_keypads)); + m_pokey->set_interrupt_callback(FUNC(a400_state::interrupt_cb)); + m_pokey->add_route(ALL_OUTPUTS, "speaker", 1.0); ATARI_GTIA(config, m_gtia, 0); m_gtia->set_region(GTIA_NTSC); @@ -2385,18 +2366,17 @@ MACHINE_CONFIG_START(a400_state::a5200) MCFG_MACHINE_START_OVERRIDE( a400_state, a5200 ) - MCFG_SCREEN_MODIFY( "screen" ) - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); - MCFG_A5200_CARTRIDGE_ADD("cartleft", a5200_carts, nullptr) + A5200_CART_SLOT(config, "cartleft", a5200_carts, nullptr); /* Software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","a5200") + SOFTWARE_LIST(config, "cart_list").set_original("a5200"); /* internal ram */ RAM(config, m_ram).set_default_size("16K"); -MACHINE_CONFIG_END +} /************************************************************** diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp index dc89508711a..837ac387cfe 100644 --- a/src/mame/drivers/atarisy2.cpp +++ b/src/mame/drivers/atarisy2.cpp @@ -1182,8 +1182,8 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(atarisy2_state::atarisy2) - +void atarisy2_state::atarisy2(machine_config &config) +{ /* basic machine hardware */ T11(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->set_initial_mode(0x36ff); /* initial mode word has DAL15,14,11,8 pulled low */ @@ -1211,22 +1211,21 @@ MACHINE_CONFIG_START(atarisy2_state::atarisy2) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_atarisy2) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_FORMAT_CLASS(2, atarisy2_state, RRRRGGGGBBBBIIII) + GFXDECODE(config, "gfxdecode", "palette", gfx_atarisy2); + PALETTE(config, "palette", 256).set_format(raw_to_rgb_converter(2, &atarisy2_state::RRRRGGGGBBBBIIII_decoder)); - MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, atarisy2_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 128,64) - MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, atarisy2_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,48, 0) + TILEMAP(config, m_playfield_tilemap, "gfxdecode", 2, 8,8, TILEMAP_SCAN_ROWS, 128,64).set_info_callback(FUNC(atarisy2_state::get_playfield_tile_info)); + TILEMAP(config, m_alpha_tilemap, "gfxdecode", 2, 8,8, TILEMAP_SCAN_ROWS, 64,48, 0).set_info_callback(FUNC(atarisy2_state::get_alpha_tile_info)); ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, atarisy2_state::s_mob_config); m_mob->set_gfxdecode(m_gfxdecode); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 640, 0, 512, 416, 0, 384) - MCFG_SCREEN_UPDATE_DRIVER(atarisy2_state, screen_update_atarisy2) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, atarisy2_state, vblank_int)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + screen.set_raw(VIDEO_CLOCK/2, 640, 0, 512, 416, 0, 384); + screen.set_screen_update(FUNC(atarisy2_state::screen_update_atarisy2)); + screen.set_palette("palette"); + screen.screen_vblank().set(FUNC(atarisy2_state::vblank_int)); ADDRESS_MAP_BANK(config, "vrambank").set_map(&atarisy2_state::vrambank_map).set_options(ENDIANNESS_LITTLE, 16, 15, 0x2000); @@ -1240,18 +1239,18 @@ MACHINE_CONFIG_START(atarisy2_state::atarisy2) m_ym2151->add_route(0, "lspeaker", 0.60); m_ym2151->add_route(1, "rspeaker", 0.60); - MCFG_DEVICE_ADD("pokey1", POKEY, SOUND_CLOCK/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW0")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.35) + POKEY(config, m_pokey[0], SOUND_CLOCK/8); + m_pokey[0]->allpot_r().set_ioport("DSW0"); + m_pokey[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.35); - MCFG_DEVICE_ADD("pokey2", POKEY, SOUND_CLOCK/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.35) + POKEY(config, m_pokey[1], SOUND_CLOCK/8); + m_pokey[1]->allpot_r().set_ioport("DSW1"); + m_pokey[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.35); - MCFG_DEVICE_ADD("tms", TMS5220C, MASTER_CLOCK/4/4/2) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75) -MACHINE_CONFIG_END + TMS5220C(config, m_tms5220, MASTER_CLOCK/4/4/2); + m_tms5220->add_route(ALL_OUTPUTS, "lspeaker", 0.75); + m_tms5220->add_route(ALL_OUTPUTS, "rspeaker", 0.75); +} void atarisy2_state::paperboy(machine_config &config) diff --git a/src/mame/drivers/bagman.cpp b/src/mame/drivers/bagman.cpp index 0920327a430..e67b6865c78 100644 --- a/src/mame/drivers/bagman.cpp +++ b/src/mame/drivers/bagman.cpp @@ -474,27 +474,28 @@ void bagman_state::bagman_base(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); } -MACHINE_CONFIG_START(bagman_state::bagman) +void bagman_state::bagman(machine_config &config) +{ bagman_base(config); - MCFG_DEVICE_ADD("tmsprom", TMSPROM, 640000 / 2) /* rom clock */ - MCFG_TMSPROM_REGION("5110ctrl") /* prom memory region - sound region is automatically assigned */ - MCFG_TMSPROM_ROM_SIZE(0x1000) /* individual rom_size */ - MCFG_TMSPROM_PDC_BIT(1) /* bit # of pdc line */ + TMSPROM(config, m_tmsprom, 640000 / 2); /* rom clock */ + m_tmsprom->set_region("5110ctrl"); /* prom memory region - sound region is automatically assigned */ + m_tmsprom->set_rom_size(0x1000); /* individual rom_size */ + m_tmsprom->set_pdc_bit(1); /* bit # of pdc line */ /* virtual bit 8: constant 0, virtual bit 9:constant 1 */ - MCFG_TMSPROM_CTL1_BIT(8) /* bit # of ctl1 line */ - MCFG_TMSPROM_CTL2_BIT(2) /* bit # of ctl2 line */ - MCFG_TMSPROM_CTL4_BIT(8) /* bit # of ctl4 line */ - MCFG_TMSPROM_CTL8_BIT(2) /* bit # of ctl8 line */ - MCFG_TMSPROM_RESET_BIT(6) /* bit # of rom reset */ - MCFG_TMSPROM_STOP_BIT(7) /* bit # of stop */ - MCFG_TMSPROM_PDC_CB(WRITELINE("tms", tms5110_device, pdc_w)) /* tms pdc func */ - MCFG_TMSPROM_CTL_CB(WRITE8("tms", tms5110_device, ctl_w)) /* tms ctl func */ - - MCFG_DEVICE_ADD("tms", TMS5110A, 640000) - MCFG_TMS5110_M0_CB(WRITELINE("tmsprom", tmsprom_device, m0_w)) - MCFG_TMS5110_DATA_CB(READLINE("tmsprom", tmsprom_device, data_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + m_tmsprom->set_ctl1_bit(8); /* bit # of ctl1 line */ + m_tmsprom->set_ctl2_bit(2); /* bit # of ctl2 line */ + m_tmsprom->set_ctl4_bit(8); /* bit # of ctl4 line */ + m_tmsprom->set_ctl8_bit(2); /* bit # of ctl8 line */ + m_tmsprom->set_reset_bit(6); /* bit # of rom reset */ + m_tmsprom->set_stop_bit(7); /* bit # of stop */ + m_tmsprom->pdc().set("tms", FUNC(tms5110_device::pdc_w)); /* tms pdc func */ + m_tmsprom->pdc().set("tms", FUNC(tms5110_device::ctl_w)); /* tms ctl func */ + + tms5110a_device &tms(TMS5110A(config, "tms", 640000)); + tms.m0().set("tmsprom", FUNC(tmsprom_device::m0_w)); + tms.data().set("tmsprom", FUNC(tmsprom_device::data_r)); + tms.add_route(ALL_OUTPUTS, "mono", 1.0); LS259(config, m_tmslatch); // 7H m_tmslatch->q_out_cb<0>().set(FUNC(bagman_state::tmsprom_bit_w)); @@ -503,7 +504,7 @@ MACHINE_CONFIG_START(bagman_state::bagman) m_tmslatch->q_out_cb<3>().set("tmsprom", FUNC(tmsprom_device::enable_w)); m_tmslatch->q_out_cb<4>().set(FUNC(bagman_state::tmsprom_csq0_w)); m_tmslatch->q_out_cb<5>().set(FUNC(bagman_state::tmsprom_csq1_w)); -MACHINE_CONFIG_END +} void bagman_state::sbagman(machine_config &config) { @@ -517,12 +518,12 @@ void bagman_state::sbagmani(machine_config &config) m_mainlatch->q_out_cb<3>().set(FUNC(bagman_state::video_enable_w)); } -MACHINE_CONFIG_START(bagman_state::pickin) - +void bagman_state::pickin(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, BAGMAN_H0) - MCFG_DEVICE_PROGRAM_MAP(pickin_map) - MCFG_DEVICE_IO_MAP(main_portmap) + Z80(config, m_maincpu, BAGMAN_H0); + m_maincpu->set_addrmap(AS_PROGRAM, &bagman_state::pickin_map); + m_maincpu->set_addrmap(AS_IO, &bagman_state::main_portmap); LS259(config, m_mainlatch); m_mainlatch->q_out_cb<0>().set(FUNC(bagman_state::irq_mask_w)); @@ -535,16 +536,14 @@ MACHINE_CONFIG_START(bagman_state::pickin) m_mainlatch->q_out_cb<7>().set_nop(); // ???? /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(bagman_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, bagman_state, vblank_irq)) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pickin) - MCFG_PALETTE_ADD("palette", 64) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + screen.set_screen_update(FUNC(bagman_state::screen_update)); + screen.set_palette(m_palette); + screen.screen_vblank().set(FUNC(bagman_state::vblank_irq)); - MCFG_PALETTE_INIT_OWNER(bagman_state,bagman) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_pickin); + PALETTE(config, m_palette, 64).set_init(FUNC(bagman_state::palette_init_bagman)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -556,7 +555,7 @@ MACHINE_CONFIG_START(bagman_state::pickin) /* maybe */ AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.40); -MACHINE_CONFIG_END +} /* @@ -576,12 +575,12 @@ z80 */ -MACHINE_CONFIG_START(bagman_state::botanic) - +void bagman_state::botanic(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, BAGMAN_H0) - MCFG_DEVICE_PROGRAM_MAP(pickin_map) - MCFG_DEVICE_IO_MAP(main_portmap) + Z80(config, m_maincpu, BAGMAN_H0); + m_maincpu->set_addrmap(AS_PROGRAM, &bagman_state::pickin_map); + m_maincpu->set_addrmap(AS_IO, &bagman_state::main_portmap); LS259(config, m_mainlatch); m_mainlatch->q_out_cb<0>().set(FUNC(bagman_state::irq_mask_w)); @@ -594,16 +593,14 @@ MACHINE_CONFIG_START(bagman_state::botanic) m_mainlatch->q_out_cb<7>().set_nop(); // ???? /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(bagman_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, bagman_state, vblank_irq)) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bagman) - MCFG_PALETTE_ADD("palette", 64) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(BAGMAN_HCLK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + screen.set_screen_update(FUNC(bagman_state::screen_update)); + screen.set_palette(m_palette); + screen.screen_vblank().set(FUNC(bagman_state::vblank_irq)); - MCFG_PALETTE_INIT_OWNER(bagman_state,bagman) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_bagman); + PALETTE(config, m_palette, 64).set_init(FUNC(bagman_state::palette_init_bagman)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -614,7 +611,7 @@ MACHINE_CONFIG_START(bagman_state::botanic) aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.40); -MACHINE_CONFIG_END +} /*************************************************************************** diff --git a/src/mame/drivers/bartop52.cpp b/src/mame/drivers/bartop52.cpp index e819402b974..f43f5872506 100644 --- a/src/mame/drivers/bartop52.cpp +++ b/src/mame/drivers/bartop52.cpp @@ -118,7 +118,7 @@ void bartop52_state::machine_reset() { atari_common_state::machine_reset(); - subdevice<pokey_device>("pokey")->write(machine().dummy_space(), 15, 0); + m_pokey->write(machine().dummy_space(), 15, 0); } TIMER_DEVICE_CALLBACK_MEMBER( bartop52_state::bartop_interrupt ) @@ -126,11 +126,12 @@ TIMER_DEVICE_CALLBACK_MEMBER( bartop52_state::bartop_interrupt ) m_antic->generic_interrupt(4); } -MACHINE_CONFIG_START(bartop52_state::a5200) +void bartop52_state::a5200(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, pokey_device::FREQ_17_EXACT) - MCFG_DEVICE_PROGRAM_MAP(a5200_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bartop52_state, bartop_interrupt, "screen", 0, 1) + M6502(config, m_maincpu, pokey_device::FREQ_17_EXACT); + m_maincpu->set_addrmap(AS_PROGRAM, &bartop52_state::a5200_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(bartop52_state::bartop_interrupt), "screen", 0, 1); ATARI_GTIA(config, m_gtia, 0); m_gtia->set_region(GTIA_NTSC); @@ -139,30 +140,28 @@ MACHINE_CONFIG_START(bartop52_state::a5200) m_antic->set_gtia_tag(m_gtia); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1)) - MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) - MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1)); + m_screen->set_visarea(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y); + m_screen->set_refresh_hz(antic_device::FRAME_RATE_60HZ); + m_screen->set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); + m_screen->set_screen_update("antic", FUNC(antic_device::screen_update)); + m_screen->set_palette("palette"); - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(bartop52_state, atari) + PALETTE(config, "palette", 256).set_init(FUNC(bartop52_state::palette_init_atari)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, pokey_device::FREQ_17_EXACT) - MCFG_POKEY_POT0_R_CB(IOPORT("analog_0")) - MCFG_POKEY_POT1_R_CB(IOPORT("analog_1")) - MCFG_POKEY_POT2_R_CB(IOPORT("analog_2")) - MCFG_POKEY_POT3_R_CB(IOPORT("analog_3")) - MCFG_POKEY_KEYBOARD_CB(bartop52_state, a5200_keypads) - MCFG_POKEY_INTERRUPT_CB(bartop52_state, interrupt_cb) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) -MACHINE_CONFIG_END + POKEY(config, m_pokey, pokey_device::FREQ_17_EXACT); + m_pokey->pot_r<0>().set_ioport("analog_0"); + m_pokey->pot_r<1>().set_ioport("analog_1"); + m_pokey->pot_r<2>().set_ioport("analog_2"); + m_pokey->pot_r<3>().set_ioport("analog_3"); + m_pokey->set_keyboard_callback(FUNC(bartop52_state::a5200_keypads)); + m_pokey->set_interrupt_callback(FUNC(bartop52_state::interrupt_cb)); + m_pokey->add_route(ALL_OUTPUTS, "mono", 1.00); +} ROM_START(barbball) ROM_REGION(0x10000, "maincpu", 0) diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp index 30885b9fa68..c9cfbfc1716 100644 --- a/src/mame/drivers/bzone.cpp +++ b/src/mame/drivers/bzone.cpp @@ -214,7 +214,6 @@ #include "video/vector.h" #include "video/avgdvg.h" #include "sound/pokey.h" -#include "screen.h" #include "speaker.h" #include "bzone.lh" @@ -569,66 +568,61 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(bzone_state::bzone_base) - +void bzone_state::bzone_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, BZONE_MASTER_CLOCK / 8) - MCFG_DEVICE_PROGRAM_MAP(bzone_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(bzone_state, bzone_interrupt, BZONE_CLOCK_3KHZ / 12) + M6502(config, m_maincpu, BZONE_MASTER_CLOCK / 8); + m_maincpu->set_addrmap(AS_PROGRAM, &bzone_state::bzone_map); + m_maincpu->set_periodic_int(FUNC(bzone_state::bzone_interrupt), attotime::from_hz(BZONE_CLOCK_3KHZ / 12)); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(BZONE_CLOCK_3KHZ / 12 / 6) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 400) - MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) + VECTOR(config, "vector"); + SCREEN(config, m_screen, SCREEN_TYPE_VECTOR); + m_screen->set_refresh_hz(BZONE_CLOCK_3KHZ / 12 / 6); + m_screen->set_size(400, 300); + m_screen->set_visarea(0, 580, 0, 400); + m_screen->set_screen_update("vector", FUNC(vector_device::screen_update)); avg_device &avg(AVG_BZONE(config, "avg", 0)); avg.set_vector_tag("vector"); /* Drivers */ MATHBOX(config, m_mathbox, 0); +} -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(bzone_state::bzone) +void bzone_state::bzone(machine_config &config) +{ bzone_base(config); /* sound hardware */ bzone_audio(config); +} -MACHINE_CONFIG_END - - - -MACHINE_CONFIG_START(redbaron_state::redbaron) +void redbaron_state::redbaron(machine_config &config) +{ bzone_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(redbaron_map) + m_maincpu->set_addrmap(AS_PROGRAM, &redbaron_state::redbaron_map); - MCFG_DEVICE_ADD("earom", ER2055) + ER2055(config, m_earom); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE(BZONE_CLOCK_3KHZ / 12 / 4) - MCFG_SCREEN_VISIBLE_AREA(0, 520, 0, 400) + m_screen->set_refresh_hz(BZONE_CLOCK_3KHZ / 12 / 4); + m_screen->set_visarea(0, 520, 0, 400); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, 1500000) - MCFG_POKEY_ALLPOT_R_CB(READ8(*this, redbaron_state, redbaron_joy_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - - MCFG_DEVICE_ADD("custom", REDBARON, 0) + pokey_device &pokey(POKEY(config, "pokey", 1500000)); + pokey.allpot_r().set(FUNC(redbaron_state::redbaron_joy_r)); + pokey.add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + REDBARON(config, m_redbaronsound, 0); + m_redbaronsound->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp index 99390bc6390..f3d68ab9f04 100644 --- a/src/mame/drivers/ccastles.cpp +++ b/src/mame/drivers/ccastles.cpp @@ -431,8 +431,8 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(ccastles_state::ccastles) - +void ccastles_state::ccastles(machine_config &config) +{ /* basic machine hardware */ M6502(config, m_maincpu, MASTER_CLOCK/8); m_maincpu->set_addrmap(AS_PROGRAM, &ccastles_state::main_map); @@ -454,28 +454,28 @@ MACHINE_CONFIG_START(ccastles_state::ccastles) X2212(config, "nvram_4a").set_auto_save(true); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ccastles) - MCFG_PALETTE_ADD("palette", 32) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ccastles); + PALETTE(config, m_palette, 32); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, 0, HTOTAL - 1, VTOTAL, 0, VTOTAL - 1) /* will be adjusted later */ - MCFG_SCREEN_UPDATE_DRIVER(ccastles_state, screen_update_ccastles) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, 0, HTOTAL - 1, VTOTAL, 0, VTOTAL - 1); /* will be adjusted later */ + m_screen->set_screen_update(FUNC(ccastles_state::screen_update_ccastles)); + m_screen->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK/8) + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK/8)); /* NOTE: 1k + 0.2k is not 100% exact, but should not make an audible difference */ - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + pokey1.set_output_opamp(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0); + pokey1.add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK/8) + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK/8)); /* NOTE: 1k + 0.2k is not 100% exact, but should not make an audible difference */ - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("IN1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + pokey2.set_output_opamp(RES_K(1) + RES_K(0.2), CAP_U(0.01), 5.0); + pokey2.allpot_r().set_ioport("IN1"); + pokey2.add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp index 77d4d55f01b..fe0795b1862 100644 --- a/src/mame/drivers/centiped.cpp +++ b/src/mame/drivers/centiped.cpp @@ -1738,15 +1738,15 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(centiped_state::centiped_base) - +void centiped_state::centiped_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 12096000/8) /* 1.512 MHz (slows down to 0.75MHz while accessing playfield RAM) */ + M6502(config, m_maincpu, 12096000/8); /* 1.512 MHz (slows down to 0.75MHz while accessing playfield RAM) */ MCFG_MACHINE_START_OVERRIDE(centiped_state,centiped) MCFG_MACHINE_RESET_OVERRIDE(centiped_state,centiped) - MCFG_DEVICE_ADD("earom", ER2055) + ER2055(config, m_earom); LS259(config, m_outlatch); m_outlatch->q_out_cb<0>().set(FUNC(centiped_state::coin_counter_left_w)); @@ -1758,27 +1758,26 @@ MACHINE_CONFIG_START(centiped_state::centiped_base) WATCHDOG_TIMER(config, "watchdog"); /* timer */ - MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", centiped_state, generate_interrupt, "screen", 0, 16) + TIMER(config, "32v").configure_scanline(FUNC(centiped_state::generate_interrupt), "screen", 0, 16); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_centiped) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + m_screen->set_screen_update(FUNC(centiped_state::screen_update_centiped)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_centiped) - MCFG_PALETTE_ADD("palette", 4+4*4*4*4) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_centiped); + PALETTE(config, m_palette, 4+4*4*4*4); MCFG_VIDEO_START_OVERRIDE(centiped_state,centiped) +} -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(centiped_state::centiped) +void centiped_state::centiped(machine_config &config) +{ centiped_base(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(centiped_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::centiped_map); // M10 m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); @@ -1786,26 +1785,25 @@ MACHINE_CONFIG_START(centiped_state::centiped) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, 12096000/8) - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(3.3), CAP_U(0.01), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - -MACHINE_CONFIG_END + pokey_device &pokey(POKEY(config, "pokey", 12096000/8)); + pokey.set_output_opamp_low_pass(RES_K(3.3), CAP_U(0.01), 5.0); + pokey.add_route(ALL_OUTPUTS, "mono", 0.5); +} -MACHINE_CONFIG_START(centiped_state::centipedj) +void centiped_state::centipedj(machine_config &config) +{ centiped(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(centipedj_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::centipedj_map); +} -MACHINE_CONFIG_START(centiped_state::caterplr) +void centiped_state::caterplr(machine_config &config) +{ centiped_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(caterplr_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::caterplr_map); m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); @@ -1813,15 +1811,14 @@ MACHINE_CONFIG_START(centiped_state::caterplr) SPEAKER(config, "mono").front_center(); AY8910(config, m_aysnd, 12096000/8).add_route(ALL_OUTPUTS, "mono", 1.0); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(centiped_state::centipdb) +void centiped_state::centipdb(machine_config &config) +{ centiped_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(centipdb_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::centipdb_map); m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::flip_screen_w)); @@ -1831,15 +1828,15 @@ MACHINE_CONFIG_START(centiped_state::centipdb) AY8910(config, m_aysnd, 12096000/8); m_aysnd->port_a_read_callback().set(FUNC(centiped_state::caterplr_unknown_r)); m_aysnd->add_route(ALL_OUTPUTS, "mono", 2.0); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(centiped_state::magworm) +void centiped_state::magworm(machine_config &config) +{ centiped_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(magworm_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::magworm_map); + MCFG_MACHINE_RESET_OVERRIDE(centiped_state,magworm) // 12A @@ -1849,15 +1846,14 @@ MACHINE_CONFIG_START(centiped_state::magworm) SPEAKER(config, "mono").front_center(); AY8912(config, m_aysnd, 12096000/8).add_route(ALL_OUTPUTS, "mono", 2.0); // AY-3-8912 at 2/3H -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(centiped_state::milliped) +void centiped_state::milliped(machine_config &config) +{ centiped_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(milliped_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::milliped_map); // 12E m_outlatch->q_out_cb<5>().set(FUNC(centiped_state::input_select_w)); // TBEN @@ -1865,47 +1861,43 @@ MACHINE_CONFIG_START(centiped_state::milliped) m_outlatch->q_out_cb<7>().set(FUNC(centiped_state::control_select_w)); // CNTRLSEL /* video hardware */ - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_milliped) - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(4*4+4*4*4*4*4) + m_gfxdecode->set_info(gfx_milliped); + m_palette->set_entries(4*4+4*4*4*4*4); MCFG_VIDEO_START_OVERRIDE(centiped_state,milliped) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_milliped) + m_screen->set_screen_update(FUNC(centiped_state::screen_update_milliped)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, 12096000/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("pokey2", POKEY, 12096000/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey", 12096000/8)); + pokey1.allpot_r().set_ioport("DSW1"); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); + pokey_device &pokey2(POKEY(config, "pokey2", 12096000/8)); + pokey2.allpot_r().set_ioport("DSW2"); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(centiped_state::multiped) +void centiped_state::multiped(machine_config &config) +{ milliped(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(multiped_map) - - MCFG_DEVICE_REMOVE("earom") - EEPROM_93C46_8BIT(config, "eeprom"); -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::multiped_map); + config.device_remove("earom"); + EEPROM_93C46_8BIT(config, m_eeprom); +} -MACHINE_CONFIG_START(centiped_state::warlords) +void centiped_state::warlords(machine_config &config) +{ centiped_base(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(warlords_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::warlords_map); - MCFG_DEVICE_REMOVE("earom") + config.device_remove("earom"); // these extra LEDs also appear on Centipede schematics // P9 @@ -1913,50 +1905,46 @@ MACHINE_CONFIG_START(centiped_state::warlords) m_outlatch->q_out_cb<6>().set_output("led3").invert(); // LED 4 /* video hardware */ - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_warlords) - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_ENTRIES(8*4+8*4) + m_gfxdecode->set_info(gfx_warlords); + m_palette->set_entries(8*4+8*4); + m_palette->set_init(FUNC(centiped_state::palette_init_warlords)); - MCFG_PALETTE_INIT_OWNER(centiped_state,warlords) MCFG_VIDEO_START_OVERRIDE(centiped_state,warlords) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_warlords) + + m_screen->set_screen_update(FUNC(centiped_state::screen_update_warlords)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, 12096000/8) - MCFG_POKEY_POT0_R_CB(IOPORT("PADDLE0")) - MCFG_POKEY_POT1_R_CB(IOPORT("PADDLE1")) - MCFG_POKEY_POT2_R_CB(IOPORT("PADDLE2")) - MCFG_POKEY_POT3_R_CB(IOPORT("PADDLE3")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - + pokey_device &pokey(POKEY(config, "pokey", 12096000/8)); + pokey.pot_r<0>().set_ioport("PADDLE0"); + pokey.pot_r<1>().set_ioport("PADDLE1"); + pokey.pot_r<2>().set_ioport("PADDLE2"); + pokey.pot_r<3>().set_ioport("PADDLE3"); + pokey.add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(centiped_state::mazeinv) +void centiped_state::mazeinv(machine_config &config) +{ milliped(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(mazeinv_map) + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::mazeinv_map); m_outlatch->q_out_cb<7>().set_nop(); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_centiped) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(centiped_state::bullsdrt) + m_screen->set_screen_update(FUNC(centiped_state::screen_update_centiped)); +} +void centiped_state::bullsdrt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", S2650, 12096000/8) - MCFG_DEVICE_PROGRAM_MAP(bullsdrt_map) - MCFG_DEVICE_IO_MAP(bullsdrt_port_map) - MCFG_DEVICE_DATA_MAP(bullsdrt_data_map) + S2650(config, m_maincpu, 12096000/8); + m_maincpu->set_addrmap(AS_PROGRAM, ¢iped_state::bullsdrt_map); + m_maincpu->set_addrmap(AS_IO, ¢iped_state::bullsdrt_port_map); + m_maincpu->set_addrmap(AS_DATA, ¢iped_state::bullsdrt_data_map); - MCFG_DEVICE_ADD("earom", ER2055) + ER2055(config, m_earom); LS259(config, m_outlatch); m_outlatch->q_out_cb<1>().set(FUNC(centiped_state::bullsdrt_coin_count_w)); @@ -1967,24 +1955,24 @@ MACHINE_CONFIG_START(centiped_state::bullsdrt) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(centiped_state, screen_update_bullsdrt) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); + m_screen->set_screen_update(FUNC(centiped_state::screen_update_bullsdrt)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_centiped) - MCFG_PALETTE_ADD("palette", 4+4*4*4*4) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_centiped); + PALETTE(config, m_palette, 4+4*4*4*4); MCFG_VIDEO_START_OVERRIDE(centiped_state,bullsdrt) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76496, 12096000/8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + sn76496_device &snsnd(SN76496(config, "snsnd", 12096000/8)); + snsnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} diff --git a/src/mame/drivers/cloak.cpp b/src/mame/drivers/cloak.cpp index 0bee1fb795c..3825566f4ad 100644 --- a/src/mame/drivers/cloak.cpp +++ b/src/mame/drivers/cloak.cpp @@ -313,18 +313,18 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(cloak_state::cloak) - +void cloak_state::cloak(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 1000000) /* 1 MHz ???? */ - MCFG_DEVICE_PROGRAM_MAP(master_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(cloak_state, irq0_line_hold, 4*60) + M6502(config, m_maincpu, 1000000); /* 1 MHz ???? */ + m_maincpu->set_addrmap(AS_PROGRAM, &cloak_state::master_map); + m_maincpu->set_periodic_int(FUNC(cloak_state::irq0_line_hold), attotime::from_hz(4*60)); - MCFG_DEVICE_ADD("slave", M6502, 1250000) /* 1.25 MHz ???? */ - MCFG_DEVICE_PROGRAM_MAP(slave_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(cloak_state, irq0_line_hold, 2*60) + M6502(config, m_slave, 1250000); /* 1.25 MHz ???? */ + m_slave->set_addrmap(AS_PROGRAM, &cloak_state::slave_map); + m_slave->set_periodic_int(FUNC(cloak_state::irq0_line_hold), attotime::from_hz(2*60)); - MCFG_QUANTUM_TIME(attotime::from_hz(1000)) + config.m_minimum_quantum = attotime::from_hz(1000); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -339,32 +339,31 @@ MACHINE_CONFIG_START(cloak_state::cloak) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 3*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(cloak_state, screen_update_cloak) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cloak) - MCFG_PALETTE_ADD("palette", 64) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 3*8, 32*8-1); + m_screen->set_screen_update(FUNC(cloak_state::screen_update_cloak)); + m_screen->set_palette(m_palette); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_cloak); + PALETTE(config, m_palette, 64); /* sound hardware */ SPEAKER(config, "mono").front_center(); /* more low pass filters ==> DISCRETE processing */ - MCFG_DEVICE_ADD("pokey1", POKEY, XTAL(10'000'000)/8) /* Accurate to recording */ - MCFG_POKEY_ALLPOT_R_CB(IOPORT("START")) - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(1), CAP_U(0.047), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("pokey2", POKEY, XTAL(10'000'000)/8) /* Accurate to recording */ - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW")) - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(1), CAP_U(0.022), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey1", XTAL(10'000'000)/8)); /* Accurate to recording */ + pokey1.allpot_r().set_ioport("START"); + pokey1.set_output_opamp_low_pass(RES_K(1), CAP_U(0.047), 5.0); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); + + pokey_device &pokey2(POKEY(config, "pokey2", XTAL(10'000'000)/8)); /* Accurate to recording */ + pokey2.allpot_r().set_ioport("DSW"); + pokey2.set_output_opamp_low_pass(RES_K(1), CAP_U(0.022), 5.0); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/cloud9.cpp b/src/mame/drivers/cloud9.cpp index b6f3e80085c..73bd173edfb 100644 --- a/src/mame/drivers/cloud9.cpp +++ b/src/mame/drivers/cloud9.cpp @@ -392,8 +392,8 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(cloud9_state::cloud9) - +void cloud9_state::cloud9(machine_config &config) +{ /* basic machine hardware */ M6502(config, m_maincpu, MASTER_CLOCK/8); m_maincpu->set_addrmap(AS_PROGRAM, &cloud9_state::cloud9_map); @@ -409,29 +409,29 @@ MACHINE_CONFIG_START(cloud9_state::cloud9) X2212(config, "nvram").set_auto_save(true); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cloud9) - MCFG_PALETTE_ADD("palette", 64) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_cloud9); + PALETTE(config, m_palette, 64); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE((float)PIXEL_CLOCK / (float)VTOTAL / (float)HTOTAL) - MCFG_SCREEN_SIZE(HTOTAL, VTOTAL) - MCFG_SCREEN_VBLANK_TIME(0) /* VBLANK is handled manually */ - MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 231) - MCFG_SCREEN_UPDATE_DRIVER(cloud9_state, screen_update_cloud9) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz((float)PIXEL_CLOCK / (float)VTOTAL / (float)HTOTAL); + m_screen->set_size(HTOTAL, VTOTAL); + m_screen->set_vblank_time(0); /* VBLANK is handled manually */ + m_screen->set_visarea(0, 255, 0, 231); + m_screen->set_screen_update(FUNC(cloud9_state::screen_update_cloud9)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("videolatch", LS259, 0) + LS259(config, m_videolatch); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK/8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK/8)); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK/8)); + pokey2.allpot_r().set_ioport("DSW"); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/dai3wksi.cpp b/src/mame/drivers/dai3wksi.cpp index a8dde4929d1..71a1b08a5ea 100644 --- a/src/mame/drivers/dai3wksi.cpp +++ b/src/mame/drivers/dai3wksi.cpp @@ -406,132 +406,131 @@ void dai3wksi_state::machine_reset() } -MACHINE_CONFIG_START(dai3wksi_state::dai3wksi) - +void dai3wksi_state::dai3wksi(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, XTAL(10'000'000)/4) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dai3wksi_state, irq0_line_hold) - + Z80(config, m_maincpu, XTAL(10'000'000)/4); + m_maincpu->set_addrmap(AS_PROGRAM, &dai3wksi_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(dai3wksi_state::irq0_line_hold)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(4, 251, 8, 247) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_UPDATE_DRIVER(dai3wksi_state, screen_update_dai3wksi) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_size(256, 256); + screen.set_visarea(4, 251, 8, 247); + screen.set_refresh_hz(60); + screen.set_screen_update(FUNC(dai3wksi_state::screen_update_dai3wksi)); - MCFG_PALETTE_ADD_3BIT_BRG("palette") + PALETTE(config, m_palette, 8).set_init("palette", FUNC(palette_device::palette_init_3bit_brg)); SPEAKER(config, "mono").front_center(); #if (USE_SAMPLES) - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(dai3wksi_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(dai3wksi_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 0.50); #else // Invader Hit - MCFG_DEVICE_ADD("ic76", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(RES_K(4.7)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.1), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.022), RES_K(33)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res: N/C - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(0) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + sn76477_device &ic76(SN76477(config, "ic76")); + ic76.set_noise_params(0, 0, 0); + ic76.set_decay_res(RES_K(4.7)); + ic76.set_attack_params(CAP_U(0.1), RES_K(4.7)); + ic76.set_amp_res(RES_K(150)); + ic76.set_feedback_res(RES_K(47)); + ic76.set_vco_params(0, CAP_U(0.022), RES_K(33)); + ic76.set_pitch_voltage(5.0); + ic76.set_slf_params(0, 0); + ic76.set_oneshot_params(0, 0); + ic76.set_vco_mode(0); + ic76.set_mixer_params(0, 0, 0); + ic76.set_envelope_params(0, 0); + ic76.set_enable(0); + ic76.add_route(ALL_OUTPUTS, "mono", 0.4); // Ship Movement - MCFG_DEVICE_ADD("ic77", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(RES_K(4.7)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.1), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res: N/C - MCFG_SN76477_PITCH_VOLTAGE(0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.0022), RES_K(200)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(10), RES_K(4.7)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(5) // VCO mode - MCFG_SN76477_MIXER_PARAMS(5, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(5, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + SN76477(config, m_ic77); + m_ic77->set_noise_params(0, 0, 0); + m_ic77->set_decay_res(RES_K(4.7)); + m_ic77->set_attack_params(CAP_U(0.1), RES_K(4.7)); + m_ic77->set_amp_res(RES_K(150)); + m_ic77->set_feedback_res(RES_K(47)); + m_ic77->set_vco_params(0, 0, 0); + m_ic77->set_pitch_voltage(0); + m_ic77->set_slf_params(CAP_U(0.0022), RES_K(200)); + m_ic77->set_oneshot_params(CAP_U(10), RES_K(4.7)); + m_ic77->set_vco_mode(5); + m_ic77->set_mixer_params(5, 0, 0); + m_ic77->set_envelope_params(5, 0); + m_ic77->set_enable(1); + m_ic77->add_route(ALL_OUTPUTS, "mono", 0.4); // Danger - MCFG_DEVICE_ADD("ic78", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), 0, 0) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(200)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.1), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.47), RES_K(75)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_N(1), RES_K(47)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(10), RES_K(22)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(5) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(5, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + SN76477(config, m_ic78); + m_ic78->set_noise_params(RES_K(47), 0, 0); + m_ic78->set_decay_res(RES_K(200)); + m_ic78->set_attack_params(CAP_U(0.1), RES_K(4.7)); + m_ic78->set_amp_res(RES_K(150)); + m_ic78->set_feedback_res(RES_K(47)); + m_ic78->set_vco_params(0, CAP_U(0.47), RES_K(75)); + m_ic78->set_pitch_voltage(5.0); + m_ic78->set_slf_params(CAP_N(1), RES_K(47)); + m_ic78->set_oneshot_params(CAP_U(10), RES_K(22)); + m_ic78->set_vco_mode(5); + m_ic78->set_mixer_params(0, 0, 0); + m_ic78->set_envelope_params(5, 0); + m_ic78->set_enable(1); + m_ic78->add_route(ALL_OUTPUTS, "mono", 0.4); // Invader Marching Noise - MCFG_DEVICE_ADD("ic79", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(RES_K(56)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.1), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.01), RES_K(100)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_N(1), RES_K(150)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(10), RES_K(22)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(5) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(5, 5) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + SN76477(config, m_ic79); + m_ic79->set_noise_params(0, 0, 0); + m_ic79->set_decay_res(RES_K(56)); + m_ic79->set_attack_params(CAP_U(0.1), RES_K(4.7)); + m_ic79->set_amp_res(RES_K(150)); + m_ic79->set_feedback_res(RES_K(47)); + m_ic79->set_vco_params(0, CAP_U(0.01), RES_K(100)); + m_ic79->set_pitch_voltage(5.0); + m_ic79->set_slf_params(CAP_N(1), RES_K(150)); + m_ic79->set_oneshot_params(CAP_U(10), RES_K(22)); + m_ic79->set_vco_mode(5); + m_ic79->set_mixer_params(0, 0, 0); + m_ic79->set_envelope_params(5, 5); + m_ic79->set_enable(1); + m_ic79->add_route(ALL_OUTPUTS, "mono", 0.4); // Big Planet Explosion - MCFG_DEVICE_ADD("ic80", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(470)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(2)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1.0), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, 0, 0) // VCO volt + cap + res: N/C - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(0, 0) // slf caps + res: N/C - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(10), RES_K(55)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(5) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 5, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(5, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + SN76477(config, m_ic80); + m_ic80->set_noise_params(RES_K(47), RES_K(330), CAP_P(470)); + m_ic80->set_decay_res(RES_M(2)); + m_ic80->set_attack_params(CAP_U(1.0), RES_K(4.7)); + m_ic80->set_amp_res(RES_K(150)); + m_ic80->set_feedback_res(RES_K(47)); + m_ic80->set_vco_params(0, 0, 0); + m_ic80->set_pitch_voltage(5.0); + m_ic80->set_slf_params(0, 0); + m_ic80->set_oneshot_params(CAP_U(10), RES_K(55)); + m_ic80->set_vco_mode(5); + m_ic80->set_mixer_params(0, 5, 0); + m_ic80->set_envelope_params(5, 0); + m_ic80->set_enable(1); + m_ic80->add_route(ALL_OUTPUTS, "mono", 0.4); // Plane Shoot noise - MCFG_DEVICE_ADD("ic81", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(RES_K(200)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(10), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(150)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2.5, CAP_U(0.01), RES_K(100)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_N(0.47), RES_K(100)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(10), RES_K(6.8)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 5, 5) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(5, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4) + SN76477(config, m_ic81); + m_ic81->set_noise_params(0, 0, 0); + m_ic81->set_decay_res(RES_K(200)); + m_ic81->set_attack_params(CAP_U(10), RES_K(4.7)); + m_ic81->set_amp_res(RES_K(150)); + m_ic81->set_feedback_res(RES_K(47)); + m_ic81->set_vco_params(2.5, CAP_U(0.01), RES_K(100)); + m_ic81->set_pitch_voltage(5.0); + m_ic81->set_slf_params(CAP_N(0.47), RES_K(100)); + m_ic81->set_oneshot_params(CAP_U(10), RES_K(6.8)); + m_ic81->set_vco_mode(0); + m_ic81->set_mixer_params(0, 5, 5); + m_ic81->set_envelope_params(5, 0); + m_ic81->set_enable(1); + m_ic81->add_route(ALL_OUTPUTS, "mono", 0.4); #endif MACHINE_CONFIG_END diff --git a/src/mame/drivers/exelv.cpp b/src/mame/drivers/exelv.cpp index a9100970c09..3df238daec6 100644 --- a/src/mame/drivers/exelv.cpp +++ b/src/mame/drivers/exelv.cpp @@ -481,15 +481,15 @@ MACHINE_START_MEMBER( exelv_state, exeltel) } -MACHINE_CONFIG_START(exelv_state::exl100) - +void exelv_state::exl100(machine_config &config) +{ /* basic machine hardware */ TMS7020_EXL(config, m_maincpu, XTAL(4'915'200)); m_maincpu->set_addrmap(AS_PROGRAM, &exelv_state::tms7020_mem); m_maincpu->in_porta().set(FUNC(exelv_state::tms7020_porta_r)); m_maincpu->out_portb().set(FUNC(exelv_state::tms7020_portb_w)); - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(exelv_state::exelv_hblank_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE(exelv_state, exl100) tms7041_device &subcpu(TMS7041(config, "tms7041", XTAL(4'915'200))); @@ -500,52 +500,50 @@ MACHINE_CONFIG_START(exelv_state::exl100) subcpu.in_portd().set(FUNC(exelv_state::tms7041_portd_r)); subcpu.out_portd().set(FUNC(exelv_state::tms7041_portd_w)); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); - MCFG_TMS3556_ADD("tms3556") + TMS3556(config, m_tms3556); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_UPDATE_DEVICE("tms3556", tms3556_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + screen.set_screen_update("tms3556", FUNC(tms3556_device::screen_update)); #if TMS3556_DOUBLE_WIDTH - MCFG_SCREEN_SIZE(tms3556_device::TOTAL_WIDTH*2, tms3556_device::TOTAL_HEIGHT*2) - MCFG_SCREEN_VISIBLE_AREA(0, tms3556_device::TOTAL_WIDTH*2-1, 0, tms3556_device::TOTAL_HEIGHT*2-1) + screen.set_size(tms3556_device::TOTAL_WIDTH*2, tms3556_device::TOTAL_HEIGHT*2); + screen.set_visarea(0, tms3556_device::TOTAL_WIDTH*2-1, 0, tms3556_device::TOTAL_HEIGHT*2-1); #else - MCFG_SCREEN_SIZE(tms3556_device::TOTAL_WIDTH, tms3556_device::TOTAL_HEIGHT*2) - MCFG_SCREEN_VISIBLE_AREA(0, tms3556_device::TOTAL_WIDTH-1, 0, tms3556_device::TOTAL_HEIGHT-1) + screen.set_size(tms3556_device::TOTAL_WIDTH, tms3556_device::TOTAL_HEIGHT*2); + screen.set_visarea(0, tms3556_device::TOTAL_WIDTH-1, 0, tms3556_device::TOTAL_HEIGHT-1); #endif - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_PALETTE("palette") + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_palette("palette"); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, "palette", 8).set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); // MCFG_DEVICE_ADD("vsm", SPEECHROM, 0) /* sound */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5220c", TMS5220C, 640000) - // MCFG_TMS52XX_SPEECHROM("vsm") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + TMS5220C(config, m_tms5220c, 640000); + // m_tms5220c->set_speechrom_tag("vsm"); + m_tms5220c->add_route(ALL_OUTPUTS, "mono", 1.00); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "exelvision_cart") - MCFG_GENERIC_EXTENSIONS("bin,rom") - - MCFG_SOFTWARE_LIST_ADD("cart_list", "exl100") -MACHINE_CONFIG_END - + GENERIC_CARTSLOT(config, "cartslot", generic_linear_slot, "exelvision_cart", "bin,rom"); -MACHINE_CONFIG_START(exelv_state::exeltel) + SOFTWARE_LIST(config, "cart_list").set_original("exl100"); +} +void exelv_state::exeltel(machine_config &config) +{ /* basic machine hardware */ TMS7040(config, m_maincpu, XTAL(4'915'200)); m_maincpu->set_addrmap(AS_PROGRAM, &exelv_state::tms7040_mem); m_maincpu->in_porta().set(FUNC(exelv_state::tms7020_porta_r)); m_maincpu->out_portb().set(FUNC(exelv_state::tms7020_portb_w)); - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) + TIMER(config, "scantimer").configure_scanline(FUNC(exelv_state::exelv_hblank_interrupt), "screen", 0, 1); MCFG_MACHINE_START_OVERRIDE(exelv_state, exeltel) tms7042_device &subcpu(TMS7042(config, "tms7042", XTAL(4'915'200))); @@ -556,35 +554,35 @@ MACHINE_CONFIG_START(exelv_state::exeltel) subcpu.in_portd().set(FUNC(exelv_state::tms7041_portd_r)); subcpu.out_portd().set(FUNC(exelv_state::tms7041_portd_w)); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); - MCFG_TMS3556_ADD("tms3556") + TMS3556(config, m_tms3556); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_UPDATE_DEVICE("tms3556", tms3556_device, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + screen.set_screen_update("tms3556", FUNC(tms3556_device::screen_update)); #if TMS3556_DOUBLE_WIDTH - MCFG_SCREEN_SIZE(tms3556_device::TOTAL_WIDTH*2, tms3556_device::TOTAL_HEIGHT*2) - MCFG_SCREEN_VISIBLE_AREA(0, tms3556_device::TOTAL_WIDTH*2-1, 0, tms3556_device::TOTAL_HEIGHT*2-1) + screen.set_size(tms3556_device::TOTAL_WIDTH*2, tms3556_device::TOTAL_HEIGHT*2); + screen.set_visarea(0, tms3556_device::TOTAL_WIDTH*2-1, 0, tms3556_device::TOTAL_HEIGHT*2-1); #else - MCFG_SCREEN_SIZE(tms3556_device::TOTAL_WIDTH, tms3556_device::TOTAL_HEIGHT*2) - MCFG_SCREEN_VISIBLE_AREA(0, tms3556_device::TOTAL_WIDTH-1, 0, tms3556_device::TOTAL_HEIGHT-1) + screen.set_size(tms3556_device::TOTAL_WIDTH, tms3556_device::TOTAL_HEIGHT*2); + screen.set_visarea(0, tms3556_device::TOTAL_WIDTH-1, 0, tms3556_device::TOTAL_HEIGHT-1); #endif - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_PALETTE("palette") + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_palette("palette"); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, "palette", 8).set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); - MCFG_DEVICE_ADD("vsm", SPEECHROM, 0) + SPEECHROM(config, "vsm", 0); /* sound */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5220c", TMS5220C, 640000) - MCFG_TMS52XX_SPEECHROM("vsm") - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) -MACHINE_CONFIG_END + TMS5220C(config, m_tms5220c, 640000); + m_tms5220c->set_speechrom_tag("vsm"); + m_tms5220c->add_route(ALL_OUTPUTS, "mono", 1.00); +} /* diff --git a/src/mame/drivers/foodf.cpp b/src/mame/drivers/foodf.cpp index ded2116a2c6..98182ab15d1 100644 --- a/src/mame/drivers/foodf.cpp +++ b/src/mame/drivers/foodf.cpp @@ -337,11 +337,11 @@ READ8_MEMBER(foodf_state::pot_r) * *************************************/ -MACHINE_CONFIG_START(foodf_state::foodf) - +void foodf_state::foodf(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, MASTER_CLOCK/2) - MCFG_DEVICE_PROGRAM_MAP(main_map) + M68000(config, m_maincpu, MASTER_CLOCK/2); + m_maincpu->set_addrmap(AS_PROGRAM, &foodf_state::main_map); adc0809_device &adc(ADC0809(config, "adc", MASTER_CLOCK/16)); adc.in_callback<0>().set_ioport("STICK1_Y"); @@ -353,39 +353,39 @@ MACHINE_CONFIG_START(foodf_state::foodf) WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8); - MCFG_TIMER_DRIVER_ADD(m_scan_timer, foodf_state, scanline_update_timer) + TIMER(config, m_scan_timer).configure_generic(FUNC(foodf_state::scanline_update_timer)); /* video hardware */ - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_foodf) - MCFG_PALETTE_ADD("palette", 256) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_foodf); + PALETTE(config, m_palette, 256); - MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("playfield", "gfxdecode", 2, foodf_state, get_playfield_tile_info, 8,8, SCAN_COLS, 32,32, 0) + TILEMAP(config, m_playfield_tilemap, "gfxdecode", 2, 8,8, TILEMAP_SCAN_COLS, 32,32, 0).set_info_callback(FUNC(foodf_state::get_playfield_tile_info)); - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 384, 0, 256, 259, 0, 224) - MCFG_SCREEN_UPDATE_DRIVER(foodf_state, screen_update_foodf) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, foodf_state, video_int_write_line)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MASTER_CLOCK/2, 384, 0, 256, 259, 0, 224); + m_screen->set_screen_update(FUNC(foodf_state::screen_update_foodf)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(foodf_state::video_int_write_line)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK/2/10) - MCFG_POKEY_POT0_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, foodf_state, pot_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK/2/10) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) - - MCFG_DEVICE_ADD("pokey3", POKEY, MASTER_CLOCK/2/10) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK/2/10)); + pokey1.pot_r<0>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<1>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<2>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<3>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<4>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<5>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<6>().set(FUNC(foodf_state::pot_r)); + pokey1.pot_r<7>().set(FUNC(foodf_state::pot_r)); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.33); + + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK/2/10)); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.33); + + pokey_device &pokey3(POKEY(config, "pokey3", MASTER_CLOCK/2/10)); + pokey3.add_route(ALL_OUTPUTS, "mono", 0.33); MACHINE_CONFIG_END diff --git a/src/mame/drivers/gp_1.cpp b/src/mame/drivers/gp_1.cpp index 44ce1385b17..076bf94eb02 100644 --- a/src/mame/drivers/gp_1.cpp +++ b/src/mame/drivers/gp_1.cpp @@ -435,7 +435,8 @@ static const z80_daisy_config daisy_chain[] = { nullptr } }; -MACHINE_CONFIG_START(gp_1_state::gp_1) +void gp_1_state::gp_1(machine_config &config) +{ /* basic machine hardware */ Z80(config, m_maincpu, 2457600); m_maincpu->set_addrmap(AS_PROGRAM, &gp_1_state::gp_1_map); @@ -458,30 +459,31 @@ MACHINE_CONFIG_START(gp_1_state::gp_1) Z80CTC(config, m_ctc, 2457600); m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // Todo: absence of ints will cause a watchdog reset - MCFG_TIMER_DRIVER_ADD_PERIODIC("gp1", gp_1_state, zero_timer, attotime::from_hz(120)) // mains freq*2 -MACHINE_CONFIG_END + TIMER(config, "gp1").configure_periodic(FUNC(gp_1_state::zero_timer), attotime::from_hz(120)); // mains freq*2 +} -MACHINE_CONFIG_START(gp_1_state::gp_1s) +void gp_1_state::gp_1s(machine_config &config) +{ gp_1(config); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, 0) // attack_decay_cap + attack_res: N/C - MCFG_SN76477_AMP_RES(RES_K(220)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(47)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(56)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(220)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(0) // VCO mode: N/C - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C: N/C - MCFG_SN76477_ENVELOPE_PARAMS(0, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, 0); + m_sn->set_amp_res(RES_K(220)); + m_sn->set_feedback_res(RES_K(47)); + m_sn->set_vco_params(0, CAP_U(0.1), RES_K(56)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(220)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(0, 1); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 1.0); m_ppi->out_pa_callback().set(FUNC(gp_1_state::portas_w)); -MACHINE_CONFIG_END +} ROM_START( gp_110 ) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 24c47bfd6c1..e33d5636308 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -6107,35 +6107,35 @@ READ8_MEMBER(bshipb_state::read_k) // buttons are same as bship set -MACHINE_CONFIG_START(bshipb_state::bshipb) - +void bshipb_state::bshipb(machine_config &config) +{ /* basic machine hardware */ TMS1000(config, m_maincpu, 200000); // approximation - RC osc. R=100K, C=47pF m_maincpu->k().set(FUNC(bshipb_state::read_k)); m_maincpu->r().set(FUNC(bshipb_state::write_r)); m_maincpu->o().set(FUNC(bshipb_state::write_o)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_bship); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("sn76477", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(100), CAP_P(47)) // R18, R17, C8 - MCFG_SN76477_DECAY_RES(RES_M(3.3)) // R16 - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.47), RES_K(15)) // C7, R20 - MCFG_SN76477_AMP_RES(RES_K(100)) // R19 - MCFG_SN76477_FEEDBACK_RES(RES_K(39)) // R7 - MCFG_SN76477_VCO_PARAMS(5.0 * RES_VOLTAGE_DIVIDER(RES_K(47), RES_K(33)), CAP_U(0.01), RES_K(270)) // R15/R14, C5, switchable R5/R3/R4 - MCFG_SN76477_PITCH_VOLTAGE(5.0) - MCFG_SN76477_SLF_PARAMS(CAP_U(22), RES_K(750)) // switchable C4, switchable R13/R12 - MCFG_SN76477_ONESHOT_PARAMS(0, RES_INF) // NC, switchable R11 - MCFG_SN76477_VCO_MODE(0) // switchable - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // switchable, GND, GND - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // Vreg, GND - MCFG_SN76477_ENABLE(0) // switchable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(47), RES_K(100), CAP_P(47)); + m_sn->set_decay_res(RES_M(3.3)); + m_sn->set_attack_params(CAP_U(0.47), RES_K(15)); + m_sn->set_amp_res(RES_K(100)); + m_sn->set_feedback_res(RES_K(39)); + m_sn->set_vco_params(5.0 * RES_VOLTAGE_DIVIDER(RES_K(47), RES_K(33)), CAP_U(0.01), RES_K(270)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(22), RES_K(750)); + m_sn->set_oneshot_params(0, RES_INF); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(0); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.35); +} diff --git a/src/mame/drivers/irobot.cpp b/src/mame/drivers/irobot.cpp index 4c32df0c689..4ca24af4c99 100644 --- a/src/mame/drivers/irobot.cpp +++ b/src/mame/drivers/irobot.cpp @@ -282,11 +282,11 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(irobot_state::irobot) - +void irobot_state::irobot(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", MC6809E, MAIN_CLOCK / 8) - MCFG_DEVICE_PROGRAM_MAP(irobot_map) + MC6809E(config, m_maincpu, MAIN_CLOCK / 8); + m_maincpu->set_addrmap(AS_PROGRAM, &irobot_state::irobot_map); adc0809_device &adc(ADC0809(config, "adc", MAIN_CLOCK / 16)); adc.in_callback<0>().set_ioport("AN0"); @@ -295,20 +295,20 @@ MACHINE_CONFIG_START(irobot_state::irobot) X2212(config, "nvram").set_auto_save(true); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(32*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1) - MCFG_SCREEN_UPDATE_DRIVER(irobot_state, screen_update_irobot) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_size(32*8, 32*8); + m_screen->set_visarea(0*8, 32*8-1, 0*8, 29*8-1); + m_screen->set_screen_update(FUNC(irobot_state::screen_update_irobot)); + m_screen->set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_irobot) - MCFG_PALETTE_ADD("palette", 64 + 32) /* 64 for polygons, 32 for text */ - MCFG_PALETTE_INIT_OWNER(irobot_state, irobot) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_irobot); + PALETTE(config, m_palette, 64 + 32); /* 64 for polygons, 32 for text */ + m_palette->set_init(FUNC(irobot_state::palette_init_irobot)); - MCFG_TIMER_DRIVER_ADD("irvg_timer", irobot_state, irobot_irvg_done_callback) - MCFG_TIMER_DRIVER_ADD("irmb_timer", irobot_state, irobot_irmb_done_callback) + TIMER(config, "irvg_timer").configure_generic(FUNC(irobot_state::irobot_irvg_done_callback)); + TIMER(config, "irmb_timer").configure_generic(FUNC(irobot_state::irobot_irmb_done_callback)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -316,19 +316,19 @@ MACHINE_CONFIG_START(irobot_state::irobot) /* FIXME: I-Robot has all channels of the quad-pokey tied together * This needs to be taken into account in the design. */ - MCFG_DEVICE_ADD("pokey1", POKEY, MAIN_CLOCK / 8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + POKEY(config, m_pokey[0], MAIN_CLOCK / 8); + m_pokey[0]->allpot_r().set_ioport("DSW2"); + m_pokey[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("pokey2", POKEY, MAIN_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + POKEY(config, m_pokey[1], MAIN_CLOCK / 8); + m_pokey[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("pokey3", POKEY, MAIN_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + POKEY(config, m_pokey[2], MAIN_CLOCK / 8); + m_pokey[2]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("pokey4", POKEY, MAIN_CLOCK / 8) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + POKEY(config, m_pokey[3], MAIN_CLOCK / 8); + m_pokey[3]->add_route(ALL_OUTPUTS, "mono", 0.25); +} diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp index f021a5a9fdb..837fc987a1b 100644 --- a/src/mame/drivers/liberatr.cpp +++ b/src/mame/drivers/liberatr.cpp @@ -420,14 +420,14 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(liberatr_state::liberatr) - +void liberatr_state::liberatr(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/16) /* 1.25Mhz divided from 20Mhz master clock */ - MCFG_DEVICE_PROGRAM_MAP(liberatr_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(driver_device,irq0_line_hold,4*60) + m6502_device &maincpu(M6502(config, "maincpu", MASTER_CLOCK/16)); /* 1.25Mhz divided from 20Mhz master clock */ + maincpu.set_addrmap(AS_PROGRAM, &liberatr_state::liberatr_map); + maincpu.set_periodic_int(FUNC(driver_device::irq0_line_hold), attotime::from_hz(4*60)); - MCFG_DEVICE_ADD("earom", ER2055, 0) + ER2055(config, m_earom); LS259(config, m_outlatch); m_outlatch->q_out_cb<0>().set_output("led0").invert(); // START LED1 @@ -442,35 +442,34 @@ MACHINE_CONFIG_START(liberatr_state::liberatr) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_UPDATE_DRIVER(liberatr_state, screen_update) - MCFG_SCREEN_SIZE(256,256) - MCFG_SCREEN_VISIBLE_AREA(8, 247, 13, 244) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_screen_update(FUNC(liberatr_state::screen_update)); + m_screen->set_size(256,256); + m_screen->set_visarea(8, 247, 13, 244); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */ - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW2")) - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(4.7), CAP_U(0.01), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK/16) /* 1.25Mhz from Phi2 signal from 6502 */ - MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(RES_K(4.7), CAP_U(0.01), 5.0) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK/16)); /* 1.25Mhz from Phi2 signal from 6502 */ + pokey1.allpot_r().set_ioport("DSW2"); + pokey1.set_output_opamp_low_pass(RES_K(4.7), CAP_U(0.01), 5.0); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK/16)); /* 1.25Mhz from Phi2 signal from 6502 */ + pokey2.set_output_opamp_low_pass(RES_K(4.7), CAP_U(0.01), 5.0); + pokey2.allpot_r().set_ioport("DSW1"); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(liberatr_state::liberat2) +void liberatr_state::liberat2(machine_config &config) +{ liberatr(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(liberat2_map) -MACHINE_CONFIG_END + subdevice<m6502_device>("maincpu")->set_addrmap(AS_PROGRAM, &liberatr_state::liberat2_map); +} diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp index 56cdd2ca1b3..3e9066dcf68 100644 --- a/src/mame/drivers/looping.cpp +++ b/src/mame/drivers/looping.cpp @@ -621,8 +621,8 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(looping_state::looping) - +void looping_state::looping(machine_config &config) +{ // CPU TMS9995, standard variant; no line connections TMS9995(config, m_maincpu, MAIN_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &looping_state::looping_map); @@ -655,15 +655,14 @@ MACHINE_CONFIG_START(looping_state::looping) WATCHDOG_TIMER(config, m_watchdog); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(looping_state, screen_update_looping) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + screen.set_screen_update(FUNC(looping_state::screen_update_looping)); + screen.set_palette(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_looping) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_looping); - MCFG_PALETTE_ADD("palette", 32) - MCFG_PALETTE_INIT_OWNER(looping_state, looping) + PALETTE(config, m_palette, 32).set_init(FUNC(looping_state::palette_init_looping)); ls259_device &videolatch(LS259(config, "videolatch")); // E2 on video board videolatch.q_out_cb<1>().set(FUNC(looping_state::level2_irq_set)); @@ -679,13 +678,15 @@ MACHINE_CONFIG_START(looping_state::looping) m_aysnd->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); m_aysnd->add_route(ALL_OUTPUTS, "speaker", 0.2); - MCFG_DEVICE_ADD("tms", TMS5220, TMS_CLOCK) - MCFG_TMS52XX_IRQ_HANDLER(WRITELINE(*this, looping_state, looping_spcint)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) + TMS5220(config, m_tms, TMS_CLOCK); + m_tms->irq_cb().set(FUNC(looping_state::looping_spcint)); + m_tms->add_route(ALL_OUTPUTS, "speaker", 0.5); - MCFG_DEVICE_ADD("dac", DAC_2BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // 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) + DAC_2BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); ls259_device &sen0(LS259(config, "sen0")); // B3 on sound board sen0.q_out_cb<0>().set(FUNC(looping_state::looping_souint_clr)); @@ -695,7 +696,7 @@ MACHINE_CONFIG_START(looping_state::looping) sen1.q_out_cb<0>().set(FUNC(looping_state::ay_enable_w)); sen1.q_out_cb<1>().set(FUNC(looping_state::speech_enable_w)); sen1.q_out_cb<2>().set(FUNC(looping_state::ballon_enable_w)); -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/malzak.cpp b/src/mame/drivers/malzak.cpp index 6cca8d11d4a..1b28b1cd97c 100644 --- a/src/mame/drivers/malzak.cpp +++ b/src/mame/drivers/malzak.cpp @@ -296,8 +296,8 @@ void malzak_state::machine_reset() m_malzak_y = 0; } -MACHINE_CONFIG_START(malzak_state::malzak) - +void malzak_state::malzak(machine_config &config) +{ /* basic machine hardware */ S2650(config, m_maincpu, 3800000/4); m_maincpu->set_addrmap(AS_PROGRAM, &malzak_state::malzak_map); @@ -306,16 +306,15 @@ MACHINE_CONFIG_START(malzak_state::malzak) m_maincpu->sense_handler().set(m_screen, FUNC(screen_device::vblank)); /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(480, 512) /* vert size is a guess */ - MCFG_SCREEN_VISIBLE_AREA(0, 479, 0, 479) - MCFG_SCREEN_UPDATE_DRIVER(malzak_state, screen_update) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(50); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + m_screen->set_size(480, 512); /* vert size is a guess */ + m_screen->set_visarea(0, 479, 0, 479); + m_screen->set_screen_update(FUNC(malzak_state::screen_update)); - MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_malzak) - MCFG_PALETTE_ADD(m_palette, 128) - MCFG_PALETTE_INIT_OWNER(malzak_state, malzak) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_malzak); + PALETTE(config, m_palette, 128).set_init(FUNC(malzak_state::palette_init_malzak)); S2636(config, m_s2636[0], 0); m_s2636[0]->set_offsets(0, -16); // -8, -16 @@ -325,55 +324,54 @@ MACHINE_CONFIG_START(malzak_state::malzak) m_s2636[1]->set_offsets(0, -16); // -9, -16 m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD(m_trom, SAA5050, 6000000) - MCFG_SAA5050_D_CALLBACK(READ8(*this, malzak_state, videoram_r)) - MCFG_SAA5050_SCREEN_SIZE(42, 24, 64) + SAA5050(config, m_trom, 6000000); + m_trom->d_cb().set(FUNC(malzak_state::videoram_r)); + m_trom->set_screen_size(42, 24, 64); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("sn1", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(1, 1, 1) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - - MCFG_DEVICE_ADD("sn2", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(1, 1, 1) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 1) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(malzak_state::malzak2) + sn76477_device &sn1(SN76477(config, "sn1")); + sn1.set_noise_params(0, 0, 0); + sn1.set_decay_res(0); + sn1.set_attack_params(0, RES_K(100)); + sn1.set_amp_res(RES_K(56)); + sn1.set_feedback_res(RES_K(10)); + sn1.set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + sn1.set_pitch_voltage(5.0); + sn1.set_slf_params(CAP_U(1.0), RES_K(120)); + sn1.set_oneshot_params(0, 0); + sn1.set_vco_mode(0); + sn1.set_mixer_params(1, 1, 1); + sn1.set_envelope_params(1, 1); + sn1.set_enable(1); + sn1.add_route(ALL_OUTPUTS, "mono", 0.25); + + sn76477_device &sn2(SN76477(config, "sn2")); + sn2.set_noise_params(0, 0, 0); + sn2.set_decay_res(0); + sn2.set_attack_params(0, RES_K(100)); + sn2.set_amp_res(RES_K(56)); + sn2.set_feedback_res(RES_K(10)); + sn2.set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + sn2.set_pitch_voltage(5.0); + sn2.set_slf_params(CAP_U(1.0), RES_K(120)); + sn2.set_oneshot_params(0, 0); + sn2.set_vco_mode(0); + sn2.set_mixer_params(1, 1, 1); + sn2.set_envelope_params(1, 1); + sn2.set_enable(1); + sn2.add_route(ALL_OUTPUTS, "mono", 0.25); +} + +void malzak_state::malzak2(machine_config &config) +{ malzak(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP(malzak2_map) + m_maincpu->set_addrmap(AS_PROGRAM, &malzak_state::malzak2_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); -MACHINE_CONFIG_END +} ROM_START( malzak ) ROM_REGION( 0x8000, "maincpu", 0 ) diff --git a/src/mame/drivers/maxaflex.cpp b/src/mame/drivers/maxaflex.cpp index 8f136a13212..27964085570 100644 --- a/src/mame/drivers/maxaflex.cpp +++ b/src/mame/drivers/maxaflex.cpp @@ -38,6 +38,7 @@ public: maxaflex_state(const machine_config &mconfig, device_type type, const char *tag) : atari_common_state(mconfig, type, tag) , m_mcu(*this, "mcu") + , m_pokey(*this, "pokey") , m_speaker(*this, "speaker") , m_region_maincpu(*this, "maincpu") , m_dsw(*this, "dsw") @@ -77,6 +78,7 @@ private: uint8_t m_portc_out; required_device<m68705p3_device> m_mcu; + required_device<pokey_device> m_pokey; required_device<speaker_sound_device> m_speaker; required_region_ptr<uint8_t> m_region_maincpu; required_ioport m_dsw; @@ -306,7 +308,7 @@ void maxaflex_state::machine_reset() { atari_common_state::machine_reset(); - subdevice<pokey_device>("pokey")->write(machine().dummy_space(), 15, 0); + m_pokey->write(machine().dummy_space(), 15, 0); // Supervisor board reset m_portb_out = 0xff; @@ -321,11 +323,12 @@ TIMER_DEVICE_CALLBACK_MEMBER( maxaflex_state::mf_interrupt ) m_antic->generic_interrupt(2); } -MACHINE_CONFIG_START(maxaflex_state::maxaflex) +void maxaflex_state::maxaflex(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, pokey_device::FREQ_17_EXACT) - MCFG_DEVICE_PROGRAM_MAP(a600xl_mem) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", maxaflex_state, mf_interrupt, "screen", 0, 1) + m6502_device &maincpu(M6502(config, "maincpu", pokey_device::FREQ_17_EXACT)); + maincpu.set_addrmap(AS_PROGRAM, &maxaflex_state::a600xl_mem); + TIMER(config, "scantimer").configure_scanline(FUNC(maxaflex_state::mf_interrupt), "screen", 0, 1); M68705P3(config, m_mcu, 3579545); m_mcu->porta_r().set(FUNC(maxaflex_state::mcu_porta_r)); @@ -347,32 +350,30 @@ MACHINE_CONFIG_START(maxaflex_state::maxaflex) pia.cb2_handler().set(FUNC(maxaflex_state::pia_cb2_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) - MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(maxaflex_state, atari) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_visarea(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y); + screen.set_refresh_hz(antic_device::FRAME_RATE_60HZ); + screen.set_size(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ); + screen.set_screen_update("antic", FUNC(antic_device::screen_update)); + screen.set_palette("palette"); + + PALETTE(config, "palette", 256).set_init(FUNC(maxaflex_state::palette_init_atari)); config.set_default_layout(layout_maxaflex); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, pokey_device::FREQ_17_EXACT) - MCFG_POKEY_INTERRUPT_CB(maxaflex_state, interrupt_cb) - MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.0), 5.0) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + POKEY(config, m_pokey, pokey_device::FREQ_17_EXACT); + m_pokey->set_interrupt_callback(FUNC(maxaflex_state::interrupt_cb)); + m_pokey->set_output_rc(RES_K(1), CAP_U(0.0), 5.0); + m_pokey->add_route(ALL_OUTPUTS, "mono", 1.0); - MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.50); RAM(config, RAM_TAG).set_default_size("16K"); -MACHINE_CONFIG_END +} ROM_START(maxaflex) diff --git a/src/mame/drivers/mhavoc.cpp b/src/mame/drivers/mhavoc.cpp index 50d0017fbc9..6cacca4895f 100644 --- a/src/mame/drivers/mhavoc.cpp +++ b/src/mame/drivers/mhavoc.cpp @@ -516,28 +516,28 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(mhavoc_state::mhavoc) - +void mhavoc_state::mhavoc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("alpha", M6502, MHAVOC_CLOCK_2_5M) /* 2.5 MHz */ - MCFG_DEVICE_PROGRAM_MAP(alpha_map) + M6502(config, m_alpha, MHAVOC_CLOCK_2_5M); /* 2.5 MHz */ + m_alpha->set_addrmap(AS_PROGRAM, &mhavoc_state::alpha_map); - MCFG_DEVICE_ADD("gamma", M6502, MHAVOC_CLOCK_1_25M) /* 1.25 MHz */ - MCFG_DEVICE_PROGRAM_MAP(gamma_map) + M6502(config, m_gamma, MHAVOC_CLOCK_1_25M); /* 1.25 MHz */ + m_gamma->set_addrmap(AS_PROGRAM, &mhavoc_state::gamma_map); EEPROM_2804(config, "eeprom"); - MCFG_TIMER_DRIVER_ADD_PERIODIC("5k_timer", mhavoc_state, mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K)) + TIMER(config, "5k_timer").configure_periodic(FUNC(mhavoc_state::mhavoc_cpu_irq_clock), attotime::from_hz(MHAVOC_CLOCK_5K)); WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 300, 0, 260) - MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) + VECTOR(config, "vector"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_VECTOR)); + screen.set_refresh_hz(50); + screen.set_size(400, 300); + screen.set_visarea(0, 300, 0, 260); + screen.set_screen_update("vector", FUNC(vector_device::screen_update)); avg_device &avg(AVG_MHAVOC(config, "avg", 0)); avg.set_vector_tag("vector"); @@ -551,54 +551,52 @@ MACHINE_CONFIG_START(mhavoc_state::mhavoc) * ==> DISCRETE emulation, below is just an approximation. */ - MCFG_DEVICE_ADD("pokey1", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW1")) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - - MCFG_DEVICE_ADD("pokey2", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + POKEY(config, m_pokey[0], MHAVOC_CLOCK_1_25M); + m_pokey[0]->allpot_r().set_ioport("DSW1"); + m_pokey[0]->set_output_opamp(RES_K(1), CAP_U(0.001), 5.0); + m_pokey[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("pokey3", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + POKEY(config, m_pokey[1], MHAVOC_CLOCK_1_25M); + m_pokey[1]->set_output_opamp(RES_K(1), CAP_U(0.001), 5.0); + m_pokey[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - MCFG_DEVICE_ADD("pokey4", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), CAP_U(0.001), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END + POKEY(config, m_pokey[2], MHAVOC_CLOCK_1_25M); + m_pokey[2]->set_output_opamp(RES_K(1), CAP_U(0.001), 5.0); + m_pokey[2]->add_route(ALL_OUTPUTS, "mono", 0.25); + POKEY(config, m_pokey[3], MHAVOC_CLOCK_1_25M); + m_pokey[3]->set_output_opamp(RES_K(1), CAP_U(0.001), 5.0); + m_pokey[3]->add_route(ALL_OUTPUTS, "mono", 0.25); +} -MACHINE_CONFIG_START(mhavoc_state::mhavocrv) +void mhavoc_state::mhavocrv(machine_config &config) +{ mhavoc(config); - MCFG_DEVICE_ADD("tms", TMS5220, MHAVOC_CLOCK/2/9) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END - + TMS5220(config, m_tms, MHAVOC_CLOCK/2/9); + m_tms->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(mhavoc_state::alphaone) +void mhavoc_state::alphaone(machine_config &config) +{ mhavoc(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("alpha") - MCFG_DEVICE_PROGRAM_MAP(alphaone_map) - MCFG_DEVICE_REMOVE("gamma") + m_alpha->set_addrmap(AS_PROGRAM, &mhavoc_state::alphaone_map); + config.device_remove("gamma"); - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 500) + subdevice<screen_device>("screen")->set_visarea(0, 580, 0, 500); /* sound hardware */ - MCFG_DEVICE_REPLACE("pokey1", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + POKEY(config.replace(), m_pokey[0], MHAVOC_CLOCK_1_25M); + m_pokey[0]->add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_REPLACE("pokey2", POKEY, MHAVOC_CLOCK_1_25M) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + POKEY(config.replace(), m_pokey[1], MHAVOC_CLOCK_1_25M); + m_pokey[1]->add_route(ALL_OUTPUTS, "mono", 0.50); - MCFG_DEVICE_REMOVE("pokey3") - MCFG_DEVICE_REMOVE("pokey4") -MACHINE_CONFIG_END + config.device_remove("pokey3"); + config.device_remove("pokey4"); +} diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp index c4f1ac425f2..0da3bd88a0d 100644 --- a/src/mame/drivers/missile.cpp +++ b/src/mame/drivers/missile.cpp @@ -1151,47 +1151,46 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(missile_state::missile) - +void missile_state::missile(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK/8) - MCFG_DEVICE_PROGRAM_MAP(main_map) + M6502(config, m_maincpu, MASTER_CLOCK/8); + m_maincpu->set_addrmap(AS_PROGRAM, &missile_state::main_map); WATCHDOG_TIMER(config, m_watchdog).set_vblank_count(m_screen, 8); /* video hardware */ - MCFG_PALETTE_ADD("palette", 8) + PALETTE(config, m_palette, 8); - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(missile_state, screen_update_missile) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + m_screen->set_screen_update(FUNC(missile_state::screen_update_missile)); + m_screen->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey", POKEY, MASTER_CLOCK/8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("R8")) - MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.1), 5.0) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + POKEY(config, m_pokey, MASTER_CLOCK/8); + m_pokey->allpot_r().set_ioport("R8"); + m_pokey->set_output_rc(RES_K(10), CAP_U(0.1), 5.0); + m_pokey->add_route(ALL_OUTPUTS, "mono", 1.0); +} -MACHINE_CONFIG_START(missile_state::missilea) +void missile_state::missilea(machine_config &config) +{ missile(config); - MCFG_DEVICE_REMOVE("pokey") -MACHINE_CONFIG_END + config.device_remove("pokey"); +} -MACHINE_CONFIG_START(missile_state::missileb) +void missile_state::missileb(machine_config &config) +{ missilea(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(bootleg_main_map) + m_maincpu->set_addrmap(AS_PROGRAM, &missile_state::bootleg_main_map); AY8912(config, "ay8912", MASTER_CLOCK/8).add_route(ALL_OUTPUTS, "mono", 0.75); - -MACHINE_CONFIG_END +} /************************************* diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp index cf5d2ddc3fa..8a358f08e40 100644 --- a/src/mame/drivers/mrgame.cpp +++ b/src/mame/drivers/mrgame.cpp @@ -535,22 +535,23 @@ uint32_t mrgame_state::screen_update_mrgame(screen_device &screen, bitmap_ind16 return 0; } -MACHINE_CONFIG_START(mrgame_state::mrgame) +void mrgame_state::mrgame(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 6_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(mrgame_state, irq1_line_hold, 183) + M68000(config, m_maincpu, 6_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &mrgame_state::main_map); + m_maincpu->set_periodic_int(FUNC(mrgame_state::irq1_line_hold), attotime::from_hz(183)); - MCFG_DEVICE_ADD("videocpu", Z80, 18.432_MHz_XTAL / 6) - MCFG_DEVICE_PROGRAM_MAP(video_map) + Z80(config, m_videocpu, 18.432_MHz_XTAL / 6); + m_videocpu->set_addrmap(AS_PROGRAM, &mrgame_state::video_map); - MCFG_DEVICE_ADD("audiocpu1", Z80, 4_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(audio1_map) - MCFG_DEVICE_IO_MAP(audio1_io) + Z80(config, m_audiocpu1, 4_MHz_XTAL); + m_audiocpu1->set_addrmap(AS_PROGRAM, &mrgame_state::audio1_map); + m_audiocpu1->set_addrmap(AS_IO, &mrgame_state::audio1_io); - MCFG_DEVICE_ADD("audiocpu2", Z80, 4_MHz_XTAL) - MCFG_DEVICE_PROGRAM_MAP(audio2_map) - MCFG_DEVICE_IO_MAP(audio2_io) + Z80(config, m_audiocpu2, 4_MHz_XTAL); + m_audiocpu2->set_addrmap(AS_PROGRAM, &mrgame_state::audio2_map); + m_audiocpu2->set_addrmap(AS_IO, &mrgame_state::audio2_io); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 5564 (x2) + battery @@ -565,53 +566,57 @@ MACHINE_CONFIG_START(mrgame_state::mrgame) //watchdog.set_vblank_count("screen", 8); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(18.432_MHz_XTAL / 3, 384, 0, 256, 264, 8, 248) // If you align with X on test screen some info is chopped off - MCFG_SCREEN_UPDATE_DRIVER(mrgame_state, screen_update_mrgame) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, mrgame_state, vblank_nmi_w)) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(18.432_MHz_XTAL / 3, 384, 0, 256, 264, 8, 248); // If you align with X on test screen some info is chopped off + screen.set_screen_update(FUNC(mrgame_state::screen_update_mrgame)); + screen.set_palette(m_palette); + screen.screen_vblank().set(FUNC(mrgame_state::vblank_nmi_w)); - MCFG_PALETTE_ADD("palette", 64) - MCFG_PALETTE_INIT_OWNER(mrgame_state, mrgame) + PALETTE(config, m_palette, 64).set_init(FUNC(mrgame_state::palette_init_mrgame)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mrgame) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_mrgame); /* Sound */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) // unknown DAC - MCFG_DEVICE_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) // unknown DAC - MCFG_DEVICE_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC - 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_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dacvol", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dacvol", -1.0, DAC_VREF_NEG_INPUT) - - MCFG_DEVICE_ADD("tms", TMS5220, 672000) // uses a RC combination. 672k copied from jedi.h - MCFG_TMS52XX_READYQ_HANDLER(INPUTLINE("audiocpu2", Z80_INPUT_LINE_BOGUSWAIT)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + DAC_8BIT_R2R(config, "ldac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.25); // unknown DAC + DAC_8BIT_R2R(config, "rdac", 0).add_route(ALL_OUTPUTS, "rspeaker", 0.25); // unknown DAC + + dac_8bit_r2r_device &dacvol(DAC_8BIT_R2R(config, "dacvol", 0)); // unknown DAC + dacvol.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT); + dacvol.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT); + dacvol.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT); + dacvol.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT); + + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dacvol", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dacvol", -1.0, DAC_VREF_NEG_INPUT); + + tms5220_device &tms(TMS5220(config, "tms", 672000)); // uses a RC combination. 672k copied from jedi.h + tms.ready_cb().set_inputline("audiocpu2", Z80_INPUT_LINE_BOGUSWAIT); + tms.add_route(ALL_OUTPUTS, "lspeaker", 1.0); + tms.add_route(ALL_OUTPUTS, "rspeaker", 1.0); /* Devices */ - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", mrgame_state, irq_timer, attotime::from_hz(16000)) //ugh + TIMER(config, "irq_timer").configure_periodic(FUNC(mrgame_state::irq_timer), attotime::from_hz(16000)); //ugh i8255_device &ppi(I8255A(config, "ppi")); ppi.in_pa_callback().set(FUNC(mrgame_state::porta_r)); ppi.out_pb_callback().set(FUNC(mrgame_state::portb_w)); ppi.in_pc_callback().set(FUNC(mrgame_state::portc_r)); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(mrgame_state::wcup90) +void mrgame_state::wcup90(machine_config &config) +{ mrgame(config); - MCFG_DEVICE_MODIFY("videocpu") - MCFG_DEVICE_PROGRAM_MAP(wcup90_video_map) + m_videocpu->set_addrmap(AS_PROGRAM, &mrgame_state::wcup90_video_map); m_selectlatch->q_out_cb<1>().set(FUNC(mrgame_state::intst_w)); // U48 - MCFG_DEVICE_MODIFY("screen") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, mrgame_state, vblank_int_w)) -MACHINE_CONFIG_END + subdevice<screen_device>("screen")->screen_vblank().set(FUNC(mrgame_state::vblank_int_w)); +} /*------------------------------------------------------------------- / Dakar (06/1988) diff --git a/src/mame/drivers/naughtyb.cpp b/src/mame/drivers/naughtyb.cpp index 801fb3a511c..b8b7632ae28 100644 --- a/src/mame/drivers/naughtyb.cpp +++ b/src/mame/drivers/naughtyb.cpp @@ -407,78 +407,57 @@ static GFXDECODE_START( gfx_naughtyb ) GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*4, 32 ) GFXDECODE_END - -MACHINE_CONFIG_START(naughtyb_state::naughtyb) - +void naughtyb_state::naughtyb_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */ - MCFG_DEVICE_PROGRAM_MAP(naughtyb_map) + Z80(config, m_maincpu, CLOCK_XTAL / 4); /* 12 MHz clock, divided by 4. CPU is a Z80A */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(36*8, 28*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_naughtyb) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(naughtyb_state, naughtyb) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_size(36*8, 28*8); + m_screen->set_visarea(0*8, 36*8-1, 0*8, 28*8-1); + m_screen->set_screen_update(FUNC(naughtyb_state::screen_update)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_naughtyb); + PALETTE(config, m_palette, 256).set_init(FUNC(naughtyb_state::palette_init_naughtyb)); /* sound hardware */ /* uses the TMS3615NS for sound */ SPEAKER(config, "mono").front_center(); - MCFG_TMS36XX_ADD("tms", 350) - MCFG_TMS36XX_TYPE(TMS3615) - MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0) + tms36xx_device &tms(TMS36XX(config, "tms", 350)); + tms.set_subtype(tms36xx_device::subtype::TMS3615); + tms.set_decays(0.15, 0.20, 0, 0, 0, 0); // NOTE: it's unknown if the TMS3615 mixes more than one voice internally. // A wav taken from Pop Flamer sounds like there are at least no 'odd' // harmonics (5 1/3' and 2 2/3') - MCFG_SOUND_ROUTE(0, "mono", 0.60) - - MCFG_DEVICE_ADD("naughtyb_custom", NAUGHTYB_SOUND) - MCFG_SOUND_ROUTE(0, "mono", 0.40) -MACHINE_CONFIG_END - + tms.add_route(0, "mono", 0.60); +} -/* Exactly the same but for certain address writes */ -MACHINE_CONFIG_START(naughtyb_state::popflame) +void naughtyb_state::naughtyb(machine_config &config) +{ + naughtyb_base(config); - /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */ - MCFG_DEVICE_PROGRAM_MAP(popflame_map) + m_maincpu->set_addrmap(AS_PROGRAM, &naughtyb_state::naughtyb_map); - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(36*8, 28*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_naughtyb) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(naughtyb_state, naughtyb) + NAUGHTYB_SOUND(config, m_naughtyb_custom); + m_naughtyb_custom->add_route(0, "mono", 0.40); +} - /* sound hardware */ - SPEAKER(config, "mono").front_center(); +/* Exactly the same but for certain address writes */ +void naughtyb_state::popflame(machine_config &config) +{ + naughtyb_base(config); - MCFG_TMS36XX_ADD("tms", 350) - MCFG_TMS36XX_TYPE(TMS3615) - MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0) - // NOTE: it's unknown if the TMS3615 mixes more than one voice internally. - // A wav taken from Pop Flamer sounds like there are at least no 'odd' - // harmonics (5 1/3' and 2 2/3') - MCFG_SOUND_ROUTE(0, "mono", 0.60) + m_maincpu->set_addrmap(AS_PROGRAM, &naughtyb_state::popflame_map); - MCFG_DEVICE_ADD("popflame_custom", POPFLAME_SOUND) - MCFG_SOUND_ROUTE(0, "mono", 1.0) -MACHINE_CONFIG_END + POPFLAME_SOUND(config, m_popflame_custom); + m_popflame_custom->add_route(0, "mono", 1.0); +} diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp index ffa9b11753c..1bfdac5d570 100644 --- a/src/mame/drivers/quantum.cpp +++ b/src/mame/drivers/quantum.cpp @@ -285,24 +285,24 @@ DISCRETE_SOUND_END * *************************************/ -MACHINE_CONFIG_START(quantum_state::quantum) - +void quantum_state::quantum(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, MASTER_CLOCK / 2) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(quantum_state, irq1_line_hold, CLOCK_3KHZ / 12) + M68000(config, m_maincpu, MASTER_CLOCK / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &quantum_state::main_map); + m_maincpu->set_periodic_int(FUNC(quantum_state::irq1_line_hold), attotime::from_hz(CLOCK_3KHZ / 12)); X2212(config, "nvram"); // "137288-001" in parts list and schematic diagram WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 900, 0, 600) - MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) + VECTOR(config, "vector"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_VECTOR)); + screen.set_refresh_hz(60); + screen.set_size(400, 300); + screen.set_visarea(0, 900, 0, 600); + screen.set_screen_update("vector", FUNC(vector_device::screen_update)); AVG_QUANTUM(config, m_avg, 0); m_avg->set_vector_tag("vector"); @@ -310,33 +310,32 @@ MACHINE_CONFIG_START(quantum_state::quantum) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, 600000) - MCFG_POKEY_POT0_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, quantum_state, input_1_r)) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 0) - - MCFG_DEVICE_ADD("pokey2", POKEY, 600000) - MCFG_POKEY_POT0_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, quantum_state, input_2_r)) - MCFG_POKEY_OUTPUT_OPAMP(RES_K(1), 0.0, 5.0) - MCFG_SOUND_ROUTE(0, "discrete", 1.0, 1) - - MCFG_DEVICE_ADD("discrete", DISCRETE, quantum_discrete) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey1", 600000)); + pokey1.pot_r<0>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<1>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<2>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<3>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<4>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<5>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<6>().set(FUNC(quantum_state::input_1_r)); + pokey1.pot_r<7>().set(FUNC(quantum_state::input_1_r)); + pokey1.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey1.add_route(0, "discrete", 1.0, 0); + + pokey_device &pokey2(POKEY(config, "pokey2", 600000)); + pokey2.pot_r<0>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<1>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<2>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<3>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<4>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<5>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<6>().set(FUNC(quantum_state::input_2_r)); + pokey2.pot_r<7>().set(FUNC(quantum_state::input_2_r)); + pokey2.set_output_opamp(RES_K(1), 0.0, 5.0); + pokey2.add_route(0, "discrete", 1.0, 1); + + DISCRETE(config, "discrete", quantum_discrete).add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/rotaryf.cpp b/src/mame/drivers/rotaryf.cpp index fa488f63ae0..362f81b2388 100644 --- a/src/mame/drivers/rotaryf.cpp +++ b/src/mame/drivers/rotaryf.cpp @@ -263,13 +263,13 @@ static INPUT_PORTS_START( rotaryf ) INPUT_PORTS_END -MACHINE_CONFIG_START(rotaryf_state::rotaryf) - +void rotaryf_state::rotaryf(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",I8085A,4000000) /* ?? MHz */ - MCFG_DEVICE_PROGRAM_MAP(rotaryf_map) - MCFG_DEVICE_IO_MAP(rotaryf_io_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", rotaryf_state, rotaryf_interrupt, "screen", 0, 1) + I8085A(config, m_maincpu, 4000000); /* ?? MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &rotaryf_state::rotaryf_map); + m_maincpu->set_addrmap(AS_IO, &rotaryf_state::rotaryf_io_map); + TIMER(config, "scantimer").configure_scanline(FUNC(rotaryf_state::rotaryf_interrupt), "screen", 0, 1); i8255_device &ppi(I8255(config, "ppi")); ppi.out_pa_callback().set(FUNC(rotaryf_state::porta_w)); @@ -278,35 +278,35 @@ MACHINE_CONFIG_START(rotaryf_state::rotaryf) //ppi.tri_pc_callback().set_constant(0); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(32*8, 262) /* vert size is a guess, taken from mw8080bw */ - MCFG_SCREEN_VISIBLE_AREA(1*8, 30*8-1, 0*8, 32*8-1) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_UPDATE_DRIVER(rotaryf_state, screen_update) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_size(32*8, 262); /* vert size is a guess, taken from mw8080bw */ + screen.set_visarea(1*8, 30*8-1, 0*8, 32*8-1); + screen.set_refresh_hz(60); + screen.set_screen_update(FUNC(rotaryf_state::screen_update)); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(rotaryf_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, RES_K(100)); + m_sn->set_amp_res(RES_K(56)); + m_sn->set_feedback_res(RES_K(10)); + m_sn->set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.5); + + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(rotaryf_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} ROM_START( rotaryf ) diff --git a/src/mame/drivers/route16.cpp b/src/mame/drivers/route16.cpp index ff8f8371f2f..ffe89fb096a 100644 --- a/src/mame/drivers/route16.cpp +++ b/src/mame/drivers/route16.cpp @@ -592,117 +592,110 @@ void route16_state::init_route16() save_item(NAME(m_protection_data)); } -MACHINE_CONFIG_START(route16_state::route16) - +void route16_state::route16(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("cpu1", Z80, 2500000) /* 10MHz / 4 = 2.5MHz */ - MCFG_DEVICE_PROGRAM_MAP(route16_cpu1_map) - MCFG_DEVICE_IO_MAP(cpu1_io_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", route16_state, irq0_line_hold) + Z80(config, m_cpu1, 2500000); /* 10MHz / 4 = 2.5MHz */ + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::route16_cpu1_map); + m_cpu1->set_addrmap(AS_IO, &route16_state::cpu1_io_map); + m_cpu1->set_vblank_int("screen", FUNC(route16_state::irq0_line_hold)); - MCFG_DEVICE_ADD("cpu2", Z80, 2500000) /* 10MHz / 4 = 2.5MHz */ - MCFG_DEVICE_PROGRAM_MAP(route16_cpu2_map) + Z80(config, m_cpu2, 2500000); /* 10MHz / 4 = 2.5MHz */ + m_cpu2->set_addrmap(AS_PROGRAM, &route16_state::route16_cpu2_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) - MCFG_SCREEN_REFRESH_RATE(57) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) /* frames per second, vblank duration */ - MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_route16) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_size(256, 256); + m_screen->set_visarea(0, 256-1, 0, 256-1); + m_screen->set_refresh_hz(57); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_screen_update(FUNC(route16_state::screen_update_route16)); - MCFG_PALETTE_ADD_3BIT_RGB("palette") + PALETTE(config, m_palette, 8).set_init("palette", FUNC(palette_device::palette_init_3bit_rgb)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); AY8910(config, "ay8910", 10000000/8).add_route(ALL_OUTPUTS, "speaker", 0.5); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(route16_state::routex) +void route16_state::routex(machine_config &config) +{ route16(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("cpu1") - MCFG_DEVICE_PROGRAM_MAP(routex_cpu1_map) -MACHINE_CONFIG_END + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::routex_cpu1_map); +} -MACHINE_CONFIG_START(route16_state::stratvox) +void route16_state::stratvox(machine_config &config) +{ route16(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("cpu1") - MCFG_DEVICE_PROGRAM_MAP(stratvox_cpu1_map) - - MCFG_DEVICE_MODIFY("cpu2") - MCFG_DEVICE_PROGRAM_MAP(stratvox_cpu2_map) - + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::stratvox_cpu1_map); + m_cpu2->set_addrmap(AS_PROGRAM, &route16_state::stratvox_cpu2_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_jongpute) + m_screen->set_screen_update(FUNC(route16_state::screen_update_jongpute)); /* sound hardware */ subdevice<ay8910_device>("ay8910")->port_a_write_callback().set(FUNC(route16_state::stratvox_sn76477_w)); /* SN76477 commands (not used in Route 16?) */ - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(150), CAP_U(0.001)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(3.3)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(1), RES_K(4.7)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(200)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(55)) // feedback_res - MCFG_SN76477_VCO_PARAMS(5.0 * 2/ (2 + 10), CAP_U(0.022), RES_K(100)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(75)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(2.2), RES_K(4.7)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // 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) -MACHINE_CONFIG_END - - -MACHINE_CONFIG_START(route16_state::speakres) + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(47), RES_K(150), CAP_U(0.001)); + m_sn->set_decay_res(RES_M(3.3)); + m_sn->set_attack_params(CAP_U(1), RES_K(4.7)); + m_sn->set_amp_res(RES_K(200)); + m_sn->set_feedback_res(RES_K(55)); + m_sn->set_vco_params(5.0 * 2/ (2 + 10), CAP_U(0.022), RES_K(100)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(75)); + m_sn->set_oneshot_params(CAP_U(2.2), RES_K(4.7)); + m_sn->set_vco_mode(0); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(0, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "speaker", 0.5); + + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} + +void route16_state::speakres(machine_config &config) +{ stratvox(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("cpu1") - MCFG_DEVICE_PROGRAM_MAP(speakres_cpu1_map) + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::speakres_cpu1_map); MCFG_MACHINE_START_OVERRIDE(route16_state, speakres) -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(route16_state::spacecho) +void route16_state::spacecho(machine_config &config) +{ speakres(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("cpu2") - MCFG_DEVICE_PERIODIC_INT_DRIVER(route16_state, irq0_line_hold, 48*60) -MACHINE_CONFIG_END - + m_cpu2->set_periodic_int(FUNC(route16_state::irq0_line_hold), attotime::from_hz(48*60)); +} -MACHINE_CONFIG_START(route16_state::jongpute) +void route16_state::jongpute(machine_config &config) +{ route16(config); - MCFG_DEVICE_MODIFY("cpu1") - MCFG_DEVICE_PROGRAM_MAP(jongpute_cpu1_map) - MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_IO) + m_cpu1->set_addrmap(AS_PROGRAM, &route16_state::jongpute_cpu1_map); + m_cpu1->set_addrmap(AS_IO, address_map_constructor()); MCFG_MACHINE_START_OVERRIDE(route16_state, jongpute) /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_jongpute) + m_screen->set_screen_update(FUNC(route16_state::screen_update_jongpute)); - MCFG_DEVICE_REMOVE("palette") - MCFG_PALETTE_ADD_3BIT_BGR("palette") -MACHINE_CONFIG_END + PALETTE(config.replace(), m_palette, 8).set_init("palette", FUNC(palette_device::palette_init_3bit_bgr)); +} diff --git a/src/mame/drivers/runaway.cpp b/src/mame/drivers/runaway.cpp index 90f42152651..781e5c8b02b 100644 --- a/src/mame/drivers/runaway.cpp +++ b/src/mame/drivers/runaway.cpp @@ -345,11 +345,11 @@ static GFXDECODE_START( gfx_qwak ) GFXDECODE_END -MACHINE_CONFIG_START(runaway_state::runaway) - +void runaway_state::runaway(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 12096000 / 8) /* ? */ - MCFG_DEVICE_PROGRAM_MAP(runaway_map) + M6502(config, m_maincpu, 12096000 / 8); /* ? */ + m_maincpu->set_addrmap(AS_PROGRAM, &runaway_state::runaway_map); ls259_device &mainlatch(LS259(config, "mainlatch")); mainlatch.q_out_cb<0>().set_nop(); // coin counter? @@ -361,55 +361,51 @@ MACHINE_CONFIG_START(runaway_state::runaway) ER2055(config, m_earom); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 263) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(runaway_state, screen_update_runaway) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_runaway) - MCFG_PALETTE_ADD("palette", 16) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(256, 263); + m_screen->set_visarea(0, 255, 0, 239); + m_screen->set_screen_update(FUNC(runaway_state::screen_update_runaway)); + m_screen->set_palette(m_palette); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_runaway); + PALETTE(config, m_palette, 16); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, 12096000 / 8) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("6008")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("pokey2", POKEY, 12096000 / 8) - MCFG_POKEY_POT0_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, runaway_state, runaway_pot_r)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END - + pokey_device &pokey1(POKEY(config, "pokey1", 12096000 / 8)); + pokey1.allpot_r().set_ioport("6008"); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); + + pokey_device &pokey2(POKEY(config, "pokey2", 12096000 / 8)); + pokey2.pot_r<0>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<1>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<2>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<3>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<4>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<5>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<6>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.pot_r<7>().set(FUNC(runaway_state::runaway_pot_r)); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} -MACHINE_CONFIG_START(runaway_state::qwak) +void runaway_state::qwak(machine_config &config) +{ runaway(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(qwak_map) + m_maincpu->set_addrmap(AS_PROGRAM, &runaway_state::qwak_map); - MCFG_DEVICE_REMOVE("earom") + config.device_remove("earom"); /* video hardware */ - MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_qwak) + m_gfxdecode->set_info(gfx_qwak); MCFG_VIDEO_START_OVERRIDE(runaway_state,qwak) - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(runaway_state, screen_update_qwak) - -MACHINE_CONFIG_END + m_screen->set_screen_update(FUNC(runaway_state::screen_update_qwak)); +} ROM_START( runaway ) ROM_REGION( 0x10000, "maincpu", 0 ) diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp index a76e52e51e2..4618d0752da 100644 --- a/src/mame/drivers/scyclone.cpp +++ b/src/mame/drivers/scyclone.cpp @@ -607,20 +607,20 @@ INTERRUPT_GEN_MEMBER(scyclone_state::irq) } -MACHINE_CONFIG_START(scyclone_state::scyclone) - +void scyclone_state::scyclone(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, 5000000/2) // MOSTEK Z80-CPU ? MHz (there's also a 9.987MHz XTAL) intermissions seem driven directly by CPU speed for reference - MCFG_DEVICE_PROGRAM_MAP(scyclone_map) - MCFG_DEVICE_IO_MAP(scyclone_iomap) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", scyclone_state, irq) + Z80(config, m_maincpu, 5000000/2); // MOSTEK Z80-CPU ? MHz (there's also a 9.987MHz XTAL) intermissions seem driven directly by CPU speed for reference + m_maincpu->set_addrmap(AS_PROGRAM, &scyclone_state::scyclone_map); + m_maincpu->set_addrmap(AS_IO, &scyclone_state::scyclone_iomap); + m_maincpu->set_vblank_int("screen", FUNC(scyclone_state::irq)); // sound ? - MCFG_DEVICE_ADD("subcpu", Z80, 5000000/2) // LH0080 Z80-CPU SHARP ? MHz (5Mhz XTAL on this sub-pcb) - MCFG_DEVICE_PROGRAM_MAP(scyclone_sub_map) - MCFG_DEVICE_IO_MAP(scyclone_sub_iomap) + z80_device &subcpu(Z80(config, "subcpu", 5000000/2)); // LH0080 Z80-CPU SHARP ? MHz (5Mhz XTAL on this sub-pcb) + subcpu.set_addrmap(AS_PROGRAM, &scyclone_state::scyclone_sub_map); + subcpu.set_addrmap(AS_IO, &scyclone_state::scyclone_sub_iomap); // no idea, but it does wait on an irq in places, irq0 increases a register checked in the wait loop so without it sound dies after a while - MCFG_DEVICE_PERIODIC_INT_DRIVER(scyclone_state, irq0_line_hold, 400*60) + subcpu.set_periodic_int(FUNC(scyclone_state::irq0_line_hold), attotime::from_hz(400*60)); GENERIC_LATCH_8(config, m_soundlatch); @@ -628,47 +628,44 @@ MACHINE_CONFIG_START(scyclone_state::scyclone) MB14241(config, "mb14241"); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(scyclone_state, screen_update_scyclone) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) // due to hw collisions + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(256, 256); + screen.set_visarea(0, 256-1, 0, 256-32-1); + screen.set_screen_update(FUNC(scyclone_state::screen_update_scyclone)); + screen.set_video_attributes(VIDEO_ALWAYS_UPDATE); // due to hw collisions - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_scyclone) - MCFG_PALETTE_ADD("palette", 8 + 4*4) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_scyclone); + PALETTE(config, m_palette, 8 + 4*4); /* sound hardware */ SPEAKER(config, "speaker").front_center(); - MCFG_DEVICE_ADD("snsnd0", SN76477) - MCFG_SN76477_ENABLE(1) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) + sn76477_device &snsnd0(SN76477(config, "snsnd0")); + snsnd0.set_enable(1); + snsnd0.add_route(ALL_OUTPUTS, "speaker", 0.2); - MCFG_DEVICE_ADD("snsnd1", SN76477) - MCFG_SN76477_ENABLE(1) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.2) + sn76477_device &snsnd1(SN76477(config, "snsnd1")); + snsnd1.set_enable(1); + snsnd1.add_route(ALL_OUTPUTS, "speaker", 0.2); // this is just taken from route16.cpp - MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // 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) + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); + vref.set_output(5.0); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); - MCFG_DEVICE_ADD("dac2", DAC_8BIT_R2R, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25) // unknown DAC + DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC - MCFG_DEVICE_ADD("vref2", VOLTAGE_REGULATOR, 0) - MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) - MCFG_SOUND_ROUTE(0, "dac2", 1.0, DAC_VREF_POS_INPUT) - MCFG_SOUND_ROUTE(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) - -MACHINE_CONFIG_END + voltage_regulator_device &vref2(VOLTAGE_REGULATOR(config, "vref2", 0)); + vref2.set_output(5.0); + vref2.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); + vref2.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT); +} ROM_START( scyclone ) ROM_REGION( 0x3000, "maincpu", 0 ) diff --git a/src/mame/drivers/spaceg.cpp b/src/mame/drivers/spaceg.cpp index 44f122284da..fe1a48426c2 100644 --- a/src/mame/drivers/spaceg.cpp +++ b/src/mame/drivers/spaceg.cpp @@ -507,51 +507,50 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(spaceg_state::spaceg) - +void spaceg_state::spaceg(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80,2500000) /* 2.5 MHz */ - MCFG_DEVICE_PROGRAM_MAP(spaceg_map) + Z80(config, m_maincpu, 2500000); /* 2.5 MHz */ + m_maincpu->set_addrmap(AS_PROGRAM, &spaceg_state::spaceg_map); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 32, 255) - MCFG_SCREEN_UPDATE_DRIVER(spaceg_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) // 60 Hz NMIs (verified) - - MCFG_PALETTE_ADD("palette", 16+128-16) - MCFG_PALETTE_INIT_OWNER(spaceg_state, spaceg) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_size(256, 256); + screen.set_visarea(0, 255, 32, 255); + screen.set_screen_update(FUNC(spaceg_state::screen_update)); + screen.set_palette(m_palette); + screen.screen_vblank().set_inputline("maincpu", INPUT_LINE_NMI); // 60 Hz NMIs (verified) + + PALETTE(config, m_palette, 16+128-16).set_init(FUNC(spaceg_state::palette_init_spaceg)); /* sound hardware */ SPEAKER(config, "mono").front_center(); // HACK: SN76477 parameters copied from space invaders - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(0, 0, 0) // noise + filter: N/C - MCFG_SN76477_DECAY_RES(0) // decay_res: N/C - MCFG_SN76477_ATTACK_PARAMS(0, RES_K(100)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(56)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(10)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(8.2)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(120)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(0, 0) // oneshot caps + res: N/C - MCFG_SN76477_VCO_MODE(1) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(1, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) + SN76477(config, m_sn); + m_sn->set_noise_params(0, 0, 0); + m_sn->set_decay_res(0); + m_sn->set_attack_params(0, RES_K(100)); + m_sn->set_amp_res(RES_K(56)); + m_sn->set_feedback_res(RES_K(10)); + m_sn->set_vco_params(0, CAP_U(0.1), RES_K(8.2)); + m_sn->set_pitch_voltage(5.0); + m_sn->set_slf_params(CAP_U(1.0), RES_K(120)); + m_sn->set_oneshot_params(0, 0); + m_sn->set_vco_mode(1); + m_sn->set_mixer_params(0, 0, 0); + m_sn->set_envelope_params(1, 0); + m_sn->set_enable(1); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.5); // HACK: samples copied from space invaders - MCFG_DEVICE_ADD("samples", SAMPLES) - MCFG_SAMPLES_CHANNELS(6) - MCFG_SAMPLES_NAMES(invaders_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + SAMPLES(config, m_samples); + m_samples->set_channels(6); + m_samples->set_samples_names(invaders_sample_names); + m_samples->add_route(ALL_OUTPUTS, "mono", 1.0); +} /************************************* diff --git a/src/mame/drivers/spectra.cpp b/src/mame/drivers/spectra.cpp index 2bf0248e7a6..fb5d20cb989 100644 --- a/src/mame/drivers/spectra.cpp +++ b/src/mame/drivers/spectra.cpp @@ -229,10 +229,11 @@ TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::outtimer) } -MACHINE_CONFIG_START(spectra_state::spectra) +void spectra_state::spectra(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(3'579'545)/4) // actually a M6503 - MCFG_DEVICE_PROGRAM_MAP(spectra_map) + M6502(config, m_maincpu, XTAL(3'579'545)/4); // actually a M6503 + m_maincpu->set_addrmap(AS_PROGRAM, &spectra_state::spectra_map); riot6532_device &riot(RIOT6532(config, "riot", XTAL(3'579'545)/4)); riot.in_pa_callback().set(FUNC(spectra_state::porta_r)); @@ -243,8 +244,8 @@ MACHINE_CONFIG_START(spectra_state::spectra) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", spectra_state, nmitimer, attotime::from_hz(120)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("outtimer", spectra_state, outtimer, attotime::from_hz(1200)) + TIMER(config, "nmitimer").configure_periodic(FUNC(spectra_state::nmitimer), attotime::from_hz(120)); + TIMER(config, "outtimer").configure_periodic(FUNC(spectra_state::outtimer), attotime::from_hz(1200)); /* Video */ config.set_default_layout(layout_spectra); @@ -253,21 +254,21 @@ MACHINE_CONFIG_START(spectra_state::spectra) genpin_audio(config); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("snsnd", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_M(1000), RES_M(1000), CAP_N(0)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(470)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_N(1), RES_K(22)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(100)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(52)) // feedback_res - MCFG_SN76477_VCO_PARAMS(5.0, CAP_U(0.01), RES_K(390)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(0.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_M(1)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.47), RES_K(470)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) + SN76477(config, m_snsnd); + m_snsnd->set_noise_params(RES_M(1000), RES_M(1000), CAP_N(0)); + m_snsnd->set_decay_res(RES_K(470)); + m_snsnd->set_attack_params(CAP_N(1), RES_K(22)); + m_snsnd->set_amp_res(RES_K(100)); + m_snsnd->set_feedback_res(RES_K(52)); + m_snsnd->set_vco_params(5.0, CAP_U(0.01), RES_K(390)); + m_snsnd->set_pitch_voltage(0.0); + m_snsnd->set_slf_params(CAP_U(0.1), RES_M(1)); + m_snsnd->set_oneshot_params(CAP_U(0.47), RES_K(470)); + m_snsnd->set_vco_mode(0); + m_snsnd->set_mixer_params(0, 0, 0); + m_snsnd->set_envelope_params(0, 0); + m_snsnd->set_enable(1); + m_snsnd->add_route(ALL_OUTPUTS, "mono", 0.30); MACHINE_CONFIG_END /*-------------------------------- diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp index 8626bd2be72..fa19a262031 100644 --- a/src/mame/drivers/tempest.cpp +++ b/src/mame/drivers/tempest.cpp @@ -631,24 +631,24 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(tempest_state::tempest) - +void tempest_state::tempest(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, MASTER_CLOCK / 8) - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(tempest_state, irq0_line_assert, CLOCK_3KHZ / 12) + M6502(config, m_maincpu, MASTER_CLOCK / 8); + m_maincpu->set_addrmap(AS_PROGRAM, &tempest_state::main_map); + m_maincpu->set_periodic_int(FUNC(tempest_state::irq0_line_assert), attotime::from_hz(CLOCK_3KHZ / 12)); WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_hz(CLOCK_3KHZ / 256)); - MCFG_DEVICE_ADD("earom", ER2055) + ER2055(config, m_earom); /* video hardware */ - MCFG_VECTOR_ADD("vector") - MCFG_SCREEN_ADD("screen", VECTOR) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(400, 300) - MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 570) - MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) + VECTOR(config, "vector"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_VECTOR)); + screen.set_refresh_hz(60); + screen.set_size(400, 300); + screen.set_visarea(0, 580, 0, 570); + screen.set_screen_update("vector", FUNC(vector_device::screen_update)); AVG_TEMPEST(config, m_avg, 0); m_avg->set_vector_tag("vector"); @@ -659,32 +659,30 @@ MACHINE_CONFIG_START(tempest_state::tempest) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_CLOCK / 8) - MCFG_POKEY_POT0_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, tempest_state, input_port_1_bit_r)) - MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) - - MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_CLOCK / 8) - MCFG_POKEY_POT0_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT1_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT2_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_POT7_R_CB(READ8(*this, tempest_state, input_port_2_bit_r)) - MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0) - - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey1", MASTER_CLOCK / 8)); + pokey1.pot_r<0>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<1>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<2>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<3>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<4>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<5>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<6>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.pot_r<7>().set(FUNC(tempest_state::input_port_1_bit_r)); + pokey1.set_output_rc(RES_K(10), CAP_U(0.015), 5.0); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.5); + + pokey_device &pokey2(POKEY(config, "pokey2", MASTER_CLOCK / 8)); + pokey2.pot_r<0>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<1>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<2>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<3>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<4>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<5>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<6>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.pot_r<7>().set(FUNC(tempest_state::input_port_2_bit_r)); + pokey2.set_output_rc(RES_K(10), CAP_U(0.015), 5.0); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.5); +} diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index 63d26875622..4ef220d27fa 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -1268,20 +1268,19 @@ INPUT_PORTS_END ***************************************************************************/ -MACHINE_CONFIG_START(tispeak_state::tms5110_route) - +void tispeak_state::tms5110_route(machine_config &config) +{ /* sound hardware */ - MCFG_DEVICE_MODIFY("tms5100") - MCFG_TMS5110_M0_CB(WRITELINE(m_tms6100, tms6100_device, m0_w)) - MCFG_TMS5110_M1_CB(WRITELINE(m_tms6100, tms6100_device, m1_w)) - MCFG_TMS5110_ADDR_CB(WRITE8(m_tms6100, tms6100_device, add_w)) - MCFG_TMS5110_DATA_CB(READLINE(m_tms6100, tms6100_device, data_line_r)) - MCFG_TMS5110_ROMCLK_CB(WRITELINE(m_tms6100, tms6100_device, clk_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(tispeak_state::snmath) + m_tms5100->m0().set(m_tms6100, FUNC(tms6100_device::m0_w)); + m_tms5100->m1().set(m_tms6100, FUNC(tms6100_device::m1_w)); + m_tms5100->addr().set(m_tms6100, FUNC(tms6100_device::add_w)); + m_tms5100->data().set(m_tms6100, FUNC(tms6100_device::data_line_r)); + m_tms5100->romclk().set(m_tms6100, FUNC(tms6100_device::clk_w)); + m_tms5100->add_route(ALL_OUTPUTS, "mono", 0.5); +} +void tispeak_state::snmath(machine_config &config) +{ /* basic machine hardware */ tms0270_cpu_device &tms(TMS0270(config, m_maincpu, MASTER_CLOCK/2)); tms.k().set(FUNC(tispeak_state::snspell_read_k)); @@ -1292,19 +1291,20 @@ MACHINE_CONFIG_START(tispeak_state::snmath) tms.write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w)); tms.write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_snmath); /* sound hardware */ TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5100", CD2801, MASTER_CLOCK) + CD2801(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::sns_cd2801) +void tispeak_state::sns_cd2801(machine_config &config) +{ snmath(config); /* basic machine hardware */ @@ -1313,45 +1313,49 @@ MACHINE_CONFIG_START(tispeak_state::sns_cd2801) config.set_default_layout(layout_snspell); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snspell") - MCFG_GENERIC_EXTENSIONS("vsm") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snspell", "vsm"); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); - MCFG_SOFTWARE_LIST_ADD("cart_list", "snspell") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("snspell"); +} -MACHINE_CONFIG_START(tispeak_state::snspellit) +void tispeak_state::snspellit(machine_config &config) +{ sns_cd2801(config); /* basic machine hardware */ config.set_default_layout(layout_snmath); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::sns_tmc0281) +void tispeak_state::sns_tmc0281(machine_config &config) +{ sns_cd2801(config); /* sound hardware */ - MCFG_DEVICE_REPLACE("tms5100", TMC0281, MASTER_CLOCK) + TMC0281(config.replace(), m_tms5100, MASTER_CLOCK); tms5110_route(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::snspellsp) +void tispeak_state::snspellsp(machine_config &config) +{ sns_tmc0281(config); /* basic machine hardware */ config.set_default_layout(layout_snspellsp); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::sns_tmc0281d) +void tispeak_state::sns_tmc0281d(machine_config &config) +{ sns_cd2801(config); /* sound hardware */ - MCFG_DEVICE_REPLACE("tms5100", TMC0281D, MASTER_CLOCK) + TMC0281D(config.replace(), m_tms5100, MASTER_CLOCK); tms5110_route(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::snread) +void tispeak_state::snread(machine_config &config) +{ snmath(config); /* basic machine hardware */ @@ -1360,15 +1364,15 @@ MACHINE_CONFIG_START(tispeak_state::snread) config.set_default_layout(layout_snread); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snread") - MCFG_GENERIC_EXTENSIONS("vsm") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snread", "vsm"); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); - MCFG_SOFTWARE_LIST_ADD("cart_list", "snread") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("snread"); +} -MACHINE_CONFIG_START(tispeak_state::lantutor) +void tispeak_state::lantutor(machine_config &config) +{ snmath(config); /* basic machine hardware */ @@ -1378,17 +1382,16 @@ MACHINE_CONFIG_START(tispeak_state::lantutor) config.set_default_layout(layout_snread); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "lantutor") - MCFG_GENERIC_MANDATORY - MCFG_GENERIC_EXTENSIONS("vsm,bin") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) - - MCFG_SOFTWARE_LIST_ADD("cart_list", "lantutor") -MACHINE_CONFIG_END + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "lantutor", "vsm,bin"); + m_cart->set_must_be_loaded(true); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); + SOFTWARE_LIST(config, "cart_list").set_original("lantutor"); +} -MACHINE_CONFIG_START(tispeak_state::snspellc) +void tispeak_state::snspellc(machine_config &config) +{ /* basic machine hardware */ TMS1100(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::snspellc_read_k)); @@ -1401,83 +1404,82 @@ MACHINE_CONFIG_START(tispeak_state::snspellc) TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5100", TMC0281D, MASTER_CLOCK) + TMC0281D(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snspell") - MCFG_GENERIC_EXTENSIONS("vsm") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snspell", "vsm"); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); - MCFG_SOFTWARE_LIST_ADD("cart_list", "snspell") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("snspell"); +} -MACHINE_CONFIG_START(tispeak_state::snspellcuk) +void tispeak_state::snspellcuk(machine_config &config) +{ snspellc(config); /* sound hardware */ - MCFG_DEVICE_REPLACE("tms5100", CD2801, MASTER_CLOCK) // CD2801A! + CD2801(config.replace(), m_tms5100, MASTER_CLOCK); // CD2801A! tms5110_route(config); -MACHINE_CONFIG_END - +} -MACHINE_CONFIG_START(tispeak_state::vocaid) +void tispeak_state::vocaid(machine_config &config) +{ /* basic machine hardware */ TMS1100(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::tntell_read_k)); m_maincpu->o().set(FUNC(tispeak_state::snspellc_write_o)); m_maincpu->r().set(FUNC(tispeak_state::snspellc_write_r)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("ol_timer", tispeak_state, tntell_get_overlay, attotime::from_msec(50)) + TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1)); + TIMER(config, "ol_timer").configure_periodic(FUNC(tispeak_state::tntell_get_overlay), attotime::from_msec(50)); config.set_default_layout(layout_tntell); /* sound hardware */ TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5100", CD2802, MASTER_CLOCK) + CD2802(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(tispeak_state::tntell) +void tispeak_state::tntell(machine_config &config) +{ vocaid(config); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "tntell") - MCFG_GENERIC_EXTENSIONS("vsm") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) - - MCFG_SOFTWARE_LIST_ADD("cart_list", "tntell") -MACHINE_CONFIG_END + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "tntell", "vsm"); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); + SOFTWARE_LIST(config, "cart_list").set_original("tntell"); +} -MACHINE_CONFIG_START(tispeak_state::k28m2) +void tispeak_state::k28m2(machine_config &config) +{ /* basic machine hardware */ TMS1400(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::k28_read_k)); m_maincpu->o().set(FUNC(tispeak_state::k28_write_o)); m_maincpu->r().set(FUNC(tispeak_state::k28_write_r)); - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_k28m2); /* sound hardware */ TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("tms5100", TMS5110A, MASTER_CLOCK) + TMS5110A(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); /* cartridge */ - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "k28m2") - MCFG_GENERIC_EXTENSIONS("vsm") - MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "k28m2", "vsm"); + m_cart->set_device_load(device_image_load_delegate(&tispeak_state::device_image_load_tispeak_cartridge, this)); - MCFG_SOFTWARE_LIST_ADD("cart_list", "k28m2") -MACHINE_CONFIG_END + SOFTWARE_LIST(config, "cart_list").set_original("k28m2"); +} diff --git a/src/mame/drivers/toratora.cpp b/src/mame/drivers/toratora.cpp index 3bcf4021684..b53ba43f42c 100644 --- a/src/mame/drivers/toratora.cpp +++ b/src/mame/drivers/toratora.cpp @@ -395,12 +395,12 @@ void toratora_state::machine_reset() m_clear_tv = 0; } -MACHINE_CONFIG_START(toratora_state::toratora) - +void toratora_state::toratora(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6800, 5185000 / 8) /* 5.185 MHz XTAL divided by 8 (@ U94.12) */ - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(toratora_state, toratora_timer, 250) /* timer counting at 250 Hz */ + M6800(config, m_maincpu, 5185000 / 8); /* 5.185 MHz XTAL divided by 8 (@ U94.12) */ + m_maincpu->set_addrmap(AS_PROGRAM, &toratora_state::main_map); + m_maincpu->set_periodic_int(FUNC(toratora_state::toratora_timer), attotime::from_hz(250)); /* timer counting at 250 Hz */ PIA6821(config, m_pia_u1, 0); m_pia_u1->writepb_handler().set(FUNC(toratora_state::port_b_u1_w)); @@ -420,49 +420,48 @@ MACHINE_CONFIG_START(toratora_state::toratora) m_pia_u2->cb2_handler().set(FUNC(toratora_state::cb2_u2_w)); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0,256-1,8,248-1) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_UPDATE_DRIVER(toratora_state, screen_update_toratora) + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_size(256, 256); + screen.set_visarea(0,256-1,8,248-1); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_screen_update(FUNC(toratora_state::screen_update_toratora)); /* audio hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("sn1", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(470), CAP_P(470)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(2)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.2), RES_K(3.3)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(50)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(51)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(10)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.1), RES_K(100)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("sn2", SN76477) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(470), CAP_P(470)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_M(2)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.2), RES_K(3.3)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(47)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(50)) // feedback_res - MCFG_SN76477_VCO_PARAMS(0, CAP_U(0.1), RES_K(51)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(5.0) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(1.0), RES_K(10)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.1), RES_K(100)) // oneshot caps + res - MCFG_SN76477_VCO_MODE(0) // VCO mode - MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // mixer A, B, C - MCFG_SN76477_ENVELOPE_PARAMS(0, 0) // envelope 1, 2 - MCFG_SN76477_ENABLE(1) // enable - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - -MACHINE_CONFIG_END + SN76477(config, m_sn1); + m_sn1->set_noise_params(RES_K(47), RES_K(470), CAP_P(470)); + m_sn1->set_decay_res(RES_M(2)); + m_sn1->set_attack_params(CAP_U(0.2), RES_K(3.3)); + m_sn1->set_amp_res(RES_K(47)); + m_sn1->set_feedback_res(RES_K(50)); + m_sn1->set_vco_params(0, CAP_U(0.1), RES_K(51)); + m_sn1->set_pitch_voltage(5.0); + m_sn1->set_slf_params(CAP_U(1.0), RES_K(10)); + m_sn1->set_oneshot_params(CAP_U(0.1), RES_K(100)); + m_sn1->set_vco_mode(0); + m_sn1->set_mixer_params(0, 0, 0); + m_sn1->set_envelope_params(0, 0); + m_sn1->set_enable(1); + m_sn1->add_route(ALL_OUTPUTS, "mono", 0.50); + + SN76477(config, m_sn2); + m_sn2->set_noise_params(RES_K(47), RES_K(470), CAP_P(470)); + m_sn2->set_decay_res(RES_M(2)); + m_sn2->set_attack_params(CAP_U(0.2), RES_K(3.3)); + m_sn2->set_amp_res(RES_K(47)); + m_sn2->set_feedback_res(RES_K(50)); + m_sn2->set_vco_params(0, CAP_U(0.1), RES_K(51)); + m_sn2->set_pitch_voltage(5.0); + m_sn2->set_slf_params(CAP_U(1.0), RES_K(10)); + m_sn2->set_oneshot_params(CAP_U(0.1), RES_K(100)); + m_sn2->set_vco_mode(0); + m_sn2->set_mixer_params(0, 0, 0); + m_sn2->set_envelope_params(0, 0); + m_sn2->set_enable(1); + m_sn2->add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/drivers/tunhunt.cpp b/src/mame/drivers/tunhunt.cpp index 9bfa8649e67..906d4ef5576 100644 --- a/src/mame/drivers/tunhunt.cpp +++ b/src/mame/drivers/tunhunt.cpp @@ -269,46 +269,46 @@ GFXDECODE_END * *************************************/ -MACHINE_CONFIG_START(tunhunt_state::tunhunt) - +void tunhunt_state::tunhunt(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, 12.096_MHz_XTAL/6) /* ??? */ - MCFG_DEVICE_PROGRAM_MAP(main_map) - MCFG_DEVICE_PERIODIC_INT_DRIVER(tunhunt_state, irq0_line_hold, 4*60) /* 48V, 112V, 176V, 240V */ + M6502(config, m_maincpu, 12.096_MHz_XTAL/6); /* ??? */ + m_maincpu->set_addrmap(AS_PROGRAM, &tunhunt_state::main_map); + m_maincpu->set_periodic_int(FUNC(tunhunt_state::irq0_line_hold), attotime::from_hz(4*60)); /* 48V, 112V, 176V, 240V */ /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) - MCFG_SCREEN_SIZE(256, 256-16) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 255-16) - MCFG_SCREEN_UPDATE_DRIVER(tunhunt_state, screen_update) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tunhunt) - MCFG_PALETTE_ADD("palette", 0x1a) - MCFG_PALETTE_INDIRECT_ENTRIES(16) - MCFG_PALETTE_INIT_OWNER(tunhunt_state, tunhunt) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_size(256, 256-16); + m_screen->set_visarea(0, 255, 0, 255-16); + m_screen->set_screen_update(FUNC(tunhunt_state::screen_update)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_tunhunt); + PALETTE(config, m_palette, 0x1a); + m_palette->set_indirect_entries(16); + m_palette->set_init(FUNC(tunhunt_state::palette_init_tunhunt)); /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("pokey1", POKEY, 12.096_MHz_XTAL/10) - MCFG_POKEY_ALLPOT_R_CB(IOPORT("DSW")) - MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.047), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - - MCFG_DEVICE_ADD("pokey2", POKEY, 12.096_MHz_XTAL/10) - MCFG_POKEY_POT0_R_CB(IOPORT("IN1")) - MCFG_POKEY_POT1_R_CB(IOPORT("IN2")) - MCFG_POKEY_POT2_R_CB(READ8(*this, tunhunt_state, dsw2_0r)) - MCFG_POKEY_POT3_R_CB(READ8(*this, tunhunt_state, dsw2_1r)) - MCFG_POKEY_POT4_R_CB(READ8(*this, tunhunt_state, dsw2_2r)) - MCFG_POKEY_POT5_R_CB(READ8(*this, tunhunt_state, dsw2_3r)) - MCFG_POKEY_POT6_R_CB(READ8(*this, tunhunt_state, dsw2_4r)) - MCFG_POKEY_OUTPUT_RC(RES_K(1), CAP_U(0.047), 5.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END + pokey_device &pokey1(POKEY(config, "pokey1", 12.096_MHz_XTAL/10)); + pokey1.allpot_r().set_ioport("DSW"); + pokey1.set_output_rc(RES_K(1), CAP_U(0.047), 5.0); + pokey1.add_route(ALL_OUTPUTS, "mono", 0.50); + + pokey_device &pokey2(POKEY(config, "pokey2", 12.096_MHz_XTAL/10)); + pokey2.pot_r<0>().set_ioport("IN1"); + pokey2.pot_r<1>().set_ioport("IN2"); + pokey2.pot_r<2>().set(FUNC(tunhunt_state::dsw2_0r)); + pokey2.pot_r<3>().set(FUNC(tunhunt_state::dsw2_1r)); + pokey2.pot_r<4>().set(FUNC(tunhunt_state::dsw2_2r)); + pokey2.pot_r<5>().set(FUNC(tunhunt_state::dsw2_3r)); + pokey2.pot_r<6>().set(FUNC(tunhunt_state::dsw2_4r)); + pokey2.set_output_rc(RES_K(1), CAP_U(0.047), 5.0); + pokey2.add_route(ALL_OUTPUTS, "mono", 0.50); +} diff --git a/src/mame/includes/atari400.h b/src/mame/includes/atari400.h index 5fffac63604..af901207ecf 100644 --- a/src/mame/includes/atari400.h +++ b/src/mame/includes/atari400.h @@ -36,6 +36,7 @@ public: , m_maincpu(*this, "maincpu") , m_gtia(*this, "gtia") , m_antic(*this, "antic") + , m_pokey(*this, "pokey") , m_screen(*this, "screen") , m_keyboard(*this, "keyboard.%u", 0) , m_keypad(*this, "keypad.%u", 0) @@ -55,6 +56,7 @@ protected: required_device<cpu_device> m_maincpu; required_device<gtia_device> m_gtia; required_device<antic_device> m_antic; + required_device<pokey_device> m_pokey; required_device<screen_device> m_screen; optional_ioport_array<8> m_keyboard; optional_ioport_array<4> m_keypad; diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h index 345b23ef54f..e59b94dd50e 100644 --- a/src/mame/includes/bzone.h +++ b/src/mame/includes/bzone.h @@ -14,6 +14,7 @@ #include "machine/er2055.h" #include "machine/mathbox.h" #include "sound/discrete.h" +#include "screen.h" #define BZONE_MASTER_CLOCK (XTAL(12'096'000)) #define BZONE_CLOCK_3KHZ (BZONE_MASTER_CLOCK / 4096) @@ -26,6 +27,7 @@ public: m_maincpu(*this, "maincpu"), m_mathbox(*this, "mathbox"), m_discrete(*this, "discrete"), + m_screen(*this, "screen"), m_startled(*this, "startled") { } @@ -45,12 +47,13 @@ protected: void bzone_audio(machine_config &config); void bzone_map(address_map &map); -private: required_device<cpu_device> m_maincpu; required_device<mathbox_device> m_mathbox; optional_device<discrete_device> m_discrete; + required_device<screen_device> m_screen; output_finder<> m_startled; +private: uint8_t m_analog_data; }; diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h index 8b0e1c37750..46eb37a4df3 100644 --- a/src/mame/includes/mw8080bw.h +++ b/src/mame/includes/mw8080bw.h @@ -136,7 +136,7 @@ protected: required_shared_ptr<uint8_t> m_main_ram; optional_shared_ptr<uint8_t> m_colorram; optional_shared_ptr<uint8_t> m_colorram2; - optional_device<discrete_device> m_discrete; + optional_device<discrete_sound_device> m_discrete; /* other devices */ optional_device<samples_device> m_samples; diff --git a/src/mame/includes/naughtyb.h b/src/mame/includes/naughtyb.h index 1b226cd3f32..f78609c9f05 100644 --- a/src/mame/includes/naughtyb.h +++ b/src/mame/includes/naughtyb.h @@ -25,6 +25,7 @@ public: m_scrollreg(*this, "scrollreg") { } + void naughtyb_base(machine_config &config); void popflame(machine_config &config); void naughtyb(machine_config &config); diff --git a/src/mame/includes/route16.h b/src/mame/includes/route16.h index 658b6743ca5..4374a81ffc5 100644 --- a/src/mame/includes/route16.h +++ b/src/mame/includes/route16.h @@ -7,6 +7,7 @@ #include "sound/sn76477.h" #include "emupal.h" +#include "screen.h" class route16_state : public driver_device { @@ -20,6 +21,7 @@ public: , m_videoram1(*this, "videoram1") , m_videoram2(*this, "videoram2") , m_palette(*this, "palette") + , m_screen(*this, "screen") , m_protection_data(0) {} @@ -67,6 +69,7 @@ private: required_shared_ptr<uint8_t> m_videoram1; required_shared_ptr<uint8_t> m_videoram2; required_device<palette_device> m_palette; + required_device<screen_device> m_screen; uint8_t m_protection_data; uint8_t m_jongpute_port_select; diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp index 4ea4d7b1bf7..c9d8e551a5a 100644 --- a/src/mame/machine/hec2hrp.cpp +++ b/src/mame/machine/hec2hrp.cpp @@ -788,26 +788,25 @@ static DISCRETE_SOUND_START( hec2hrp_discrete ) DISCRETE_OUTPUT(NODE_01, 5000) DISCRETE_SOUND_END -MACHINE_CONFIG_START(hec2hrp_state::hector_audio) +void hec2hrp_state::hector_audio(machine_config &config) +{ SPEAKER(config, "mono").front_center(); - 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 - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_DEVICE_ADD("discrete", DISCRETE, hec2hrp_discrete) /* Son 1bit*/ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - -MACHINE_CONFIG_END + WAVE(config, "wave", m_cassette).add_route(0, "mono", 0.25); /* Sound level for cassette, as it is in mono => output channel=0*/ + + SN76477(config, m_sn); + m_sn->set_noise_params(RES_K(47), RES_K(330), CAP_P(390)); + m_sn->set_decay_res(RES_K(680)); + m_sn->set_attack_params(CAP_U(47), RES_K(180)); + m_sn->set_amp_res(RES_K(33)); + m_sn->set_feedback_res(RES_K(100)); + m_sn->set_vco_params(2, CAP_N(47), RES_K(1000)); + m_sn->set_pitch_voltage(2); + m_sn->set_slf_params(CAP_U(0.1), RES_K(180)); + m_sn->set_oneshot_params(CAP_U(1.00001), RES_K(10000)); + m_sn->add_route(ALL_OUTPUTS, "mono", 0.1); + + DISCRETE(config, m_discrete, hec2hrp_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); /* 1-bit sound */ +} /* DISK II drive for: Hector HRX |