From d7f75c954fe1bc30007ca7bef063db481e03d8af Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Mon, 17 Dec 2018 20:22:48 +0100 Subject: -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] --- src/devices/bus/a2bus/a2echoii.cpp | 20 ++++-- src/devices/bus/a800/a800_slot.h | 50 +++++++------ src/devices/bus/a800/a8sio.h | 32 ++++----- src/devices/machine/netlist.h | 5 ++ src/devices/sound/pokey.cpp | 4 +- src/devices/sound/pokey.h | 140 +++++++++++++++---------------------- src/devices/sound/sn76477.h | 40 ----------- src/devices/sound/tms36xx.h | 20 ------ src/devices/sound/tms5110.h | 58 +-------------- src/devices/sound/tms5220.h | 42 ++--------- src/devices/video/saa5050.h | 1 + src/devices/video/tms3556.h | 2 +- src/devices/video/vector.h | 2 +- 13 files changed, 126 insertions(+), 290 deletions(-) (limited to 'src/devices') 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 + 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 + 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 + 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(*device).set_a8sio_slot(_nbtag, _tag); - -#define MCFG_A8SIO_DATA_IN_CB(_devcb) \ - downcast(*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 devcb_base &set_clock_in_callback(Object &&cb) { return m_out_clock_in_cb.set_callback(std::forward(cb)); } - template devcb_base &set_data_in_callback(Object &&cb) { return m_out_data_in_cb.set_callback(std::forward(cb)); } - template devcb_base &set_audio_in_callback(Object &&cb) { return m_out_audio_in_cb.set_callback(std::forward(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(*device).set_pot_r_callback<0>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT1_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<1>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT2_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<2>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT3_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<3>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT4_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<4>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT5_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<5>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT6_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<6>(DEVCB_##_devcb); - -#define MCFG_POKEY_POT7_R_CB(_devcb) \ - downcast(*device).set_pot_r_callback<7>(DEVCB_##_devcb); - -#define MCFG_POKEY_ALLPOT_R_CB(_devcb) \ - downcast(*device).set_allpot_r_callback(DEVCB_##_devcb); - -#define MCFG_POKEY_SERIN_R_CB(_devcb) \ - downcast(*device).set_serin_r_callback(DEVCB_##_devcb); - -#define MCFG_POKEY_SEROUT_W_CB(_devcb) \ - downcast(*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(*device).set_keyboard_callback(pokey_device::kb_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_POKEY_INTERRUPT_CB(_class, _method) \ - downcast(*device).set_interrupt_callback(pokey_device::int_cb_delegate(&_class::_method, #_class "::" #_method, this)); - - -#define MCFG_POKEY_OUTPUT_RC(_R, _C, _V) \ - (downcast(device))->m_output_type = pokey_device::RC_LOWPASS; \ - (downcast(device))->m_r_pullup = (_R); \ - (downcast(device))->m_cap = (_C); \ - (downcast(device))->m_v_ref = (_V); - -/* C ignored, please see pokey.c */ - -#define MCFG_POKEY_OUTPUT_OPAMP(_R, _C, _V) \ - (downcast(device))->m_output_type = pokey_device::OPAMP_C_TO_GROUND; \ - (downcast(device))->m_r_pullup = (_R); \ - (downcast(device))->m_cap = (_C); \ - (downcast(device))->m_v_ref = (_V); - -#define MCFG_POKEY_OUTPUT_OPAMP_LOW_PASS(_R, _C, _V) \ - (downcast(device))->m_output_type = pokey_device::OPAMP_LOW_PASS; \ - (downcast(device))->m_r_pullup = (_R); \ - (downcast(device))->m_cap = (_C); \ - (downcast(device))->m_v_ref = (_V); - -#define MCFG_POKEY_OUTPUT_DISCRETE() \ - (downcast(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 kb_cb_delegate; - typedef device_delegate 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 devcb_base &set_pot_r_callback(Object &&cb) { return m_pot_r_cb[N].set_callback(std::forward(cb)); } - template devcb_base &set_allpot_r_callback(Object &&cb) { return m_allpot_r_cb.set_callback(std::forward(cb)); } - template devcb_base &set_serin_r_callback(Object &&cb) { return m_serin_r_cb.set_callback(std::forward(cb)); } - template devcb_base &set_serout_w_callback(Object &&cb) { return m_serout_w_cb.set_callback(std::forward(cb)); } template 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 void set_keyboard_callback(Object &&cb) { m_keyboard_r = std::forward(cb); } - template void set_interrupt_callback(Object &&cb) { m_irq_f = std::forward(cb); } + /* k543210 = k5 ... k0 returns bit0: kr1, bit1: kr2 */ + /* all are, in contrast to actual hardware, ACTIVE_HIGH */ + typedef device_delegate kb_cb_delegate; + void set_keyboard_callback(kb_cb_delegate callback) { m_keyboard_r = callback; } + template 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(nullptr))); + } + template void set_keyboard_callback(uint8_t (FunctionClass::*callback)(uint8_t), const char *name) + { + set_keyboard_callback(kb_cb_delegate(callback, name, nullptr, static_cast(nullptr))); + } + + typedef device_delegate int_cb_delegate; + void set_interrupt_callback(int_cb_delegate callback) { m_irq_f = callback; } + template 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(nullptr))); + } + template void set_interrupt_callback(void (FunctionClass::*callback)(int), const char *name) + { + set_interrupt_callback(int_cb_delegate(callback, name, nullptr, static_cast(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(*device).set_noise_params(_clock_res, _filter_res, _filter_cap); - -#define MCFG_SN76477_DECAY_RES(_decay_res) \ - downcast(*device).set_decay_res(_decay_res); - -#define MCFG_SN76477_ATTACK_PARAMS(_decay_cap, _res) \ - downcast(*device).set_attack_params(_decay_cap, _res); - -#define MCFG_SN76477_AMP_RES(_amp_res) \ - downcast(*device).set_amp_res(_amp_res); - -#define MCFG_SN76477_FEEDBACK_RES(_feedback_res) \ - downcast(*device).set_feedback_res(_feedback_res); - -#define MCFG_SN76477_VCO_PARAMS(_volt, _cap, _res) \ - downcast(*device).set_vco_params(_volt, _cap, _res); - -#define MCFG_SN76477_PITCH_VOLTAGE(_volt) \ - downcast(*device).set_pitch_voltage(_volt); - -#define MCFG_SN76477_SLF_PARAMS(_cap, _res) \ - downcast(*device).set_slf_params(_cap, _res); - -#define MCFG_SN76477_ONESHOT_PARAMS(_cap, _res) \ - downcast(*device).set_oneshot_params(_cap, _res); - -#define MCFG_SN76477_VCO_MODE(_mode) \ - downcast(*device).set_vco_mode(_mode); - -#define MCFG_SN76477_MIXER_PARAMS(_a, _b, _c) \ - downcast(*device).set_mixer_params(_a, _b, _c); - -#define MCFG_SN76477_ENVELOPE_PARAMS(_env1, _env2) \ - downcast(*device).set_envelope_params(_env1, _env2); - -#define MCFG_SN76477_ENABLE(_enable) \ - downcast(*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 @@ -5,26 +5,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(*device).set_subtype((tms36xx_device::subtype::type)); - -#define MCFG_TMS36XX_DECAY_TIMES(_dec0, _dec1, _dec2, _dec3, _dec4, _dec5) \ - downcast(*device).set_decays(_dec0, _dec1, _dec2, _dec3, _dec4, _dec5); - -#define MCFG_TMS36XX_TUNE_SPEED(_speed) \ - downcast(*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(*device).set_m0_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_M1_CB(_devcb) \ - downcast(*device).set_m1_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_ADDR_CB(_devcb) \ - downcast(*device).set_addr_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_DATA_CB(_devcb) \ - downcast(*device).set_data_callback(DEVCB_##_devcb); - -#define MCFG_TMS5110_ROMCLK_CB(_devcb) \ - downcast(*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 devcb_base &set_m0_callback(Object &&cb) { return m_m0_cb.set_callback(std::forward(cb)); } - template devcb_base &set_m1_callback(Object &&cb) { return m_m1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_addr_callback(Object &&cb) { return m_addr_cb.set_callback(std::forward(cb)); } - template devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward(cb)); } - template devcb_base &set_romclk_callback(Object &&cb) { return m_romclk_cb.set_callback(std::forward(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 devcb_base &set_pdc_callback(Object object) { return m_pdc_cb.set_callback(std::forward(object)); } - template devcb_base &set_ctl_callback(Object object) { return m_ctl_cb.set_callback(std::forward(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(*device).set_region(_region); - -#define MCFG_TMSPROM_ROM_SIZE(_size) \ - downcast(*device).set_rom_size(_size); - -#define MCFG_TMSPROM_PDC_BIT(_bit) \ - downcast(*device).set_pdc_bit(_bit); - -#define MCFG_TMSPROM_CTL1_BIT(_bit) \ - downcast(*device).set_ctl1_bit(_bit); - -#define MCFG_TMSPROM_CTL2_BIT(_bit) \ - downcast(*device).set_ctl2_bit(_bit); - -#define MCFG_TMSPROM_CTL4_BIT(_bit) \ - downcast(*device).set_ctl4_bit(_bit); - -#define MCFG_TMSPROM_CTL8_BIT(_bit) \ - downcast(*device).set_ctl8_bit(_bit); - -#define MCFG_TMSPROM_RESET_BIT(_bit) \ - downcast(*device).set_reset_bit(_bit); - -#define MCFG_TMSPROM_STOP_BIT(_bit) \ - downcast(*device).set_stop_bit(_bit); - -#define MCFG_TMSPROM_PDC_CB(_devcb) \ - downcast(*device).set_pdc_callback(DEVCB_##_devcb); - -#define MCFG_TMSPROM_CTL_CB(_devcb) \ - downcast(*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(*device).set_irq_handler(DEVCB_##_devcb); - -/* Ready callback function, active low, i.e. state=0 */ -#define MCFG_TMS52XX_READYQ_HANDLER(_devcb) \ - downcast(*device).set_readyq_handler(DEVCB_##_devcb); - -/* old VSM handler, remove me! */ -#define MCFG_TMS52XX_SPEECHROM(_tag) \ - downcast(*device).set_speechrom_tag(_tag); - -/* new VSM handler */ -#define MCFG_TMS52XX_M0_CB(_devcb) \ - downcast(*device).set_m0_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_M1_CB(_devcb) \ - downcast(*device).set_m1_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_ADDR_CB(_devcb) \ - downcast(*device).set_addr_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_DATA_CB(_devcb) \ - downcast(*device).set_data_callback(DEVCB_##_devcb); - -#define MCFG_TMS52XX_ROMCLK_CB(_devcb) \ - downcast(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 devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } - template devcb_base &set_readyq_handler(Object &&cb) { return m_readyq_handler.set_callback(std::forward(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 devcb_base &set_m0_callback(Object &&cb) { return m_m0_cb.set_callback(std::forward(cb)); } - template devcb_base &set_m1_callback(Object &&cb) { return m_m1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_addr_callback(Object &&cb) { return m_addr_cb.set_callback(std::forward(cb)); } - template devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward(cb)); } - template devcb_base &set_romclk_callback(Object &&cb) { return m_romclk_cb.set_callback(std::forward(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 devcb_base &set_d_rd_callback(Object &&cb) { return m_read_d.set_callback(std::forward(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 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(); -- cgit v1.2.3