From 8fd43467283fad4cc8e9a19fd6255bd5413c0152 Mon Sep 17 00:00:00 2001 From: wilbertpol Date: Wed, 21 Feb 2018 10:44:28 +0100 Subject: de-staticify initializations for mame/machine (#3251) --- src/mame/drivers/expro02.cpp | 2 +- src/mame/drivers/galpanic.cpp | 2 +- src/mame/drivers/kaneko16.cpp | 8 +-- src/mame/drivers/namcos2.cpp | 4 +- src/mame/drivers/namcos21.cpp | 4 +- src/mame/drivers/sandscrp.cpp | 2 +- src/mame/machine/315-5838_317-0229_comp.h | 14 ++-- src/mame/machine/315-5881_crypt.h | 7 +- src/mame/machine/315_5296.h | 82 +++++++++++------------ src/mame/machine/6883sam.h | 13 ++-- src/mame/machine/abc80kb.h | 4 +- src/mame/machine/acs8600_ics.h | 12 ++-- src/mame/machine/apollo_kbd.h | 8 +-- src/mame/machine/apricotkb.h | 4 +- src/mame/machine/asic65.h | 6 +- src/mame/machine/atarigen.cpp | 11 ---- src/mame/machine/atarigen.h | 16 ++--- src/mame/machine/c117.cpp | 13 ---- src/mame/machine/c117.h | 14 ++-- src/mame/machine/cammu.h | 8 +-- src/mame/machine/cat702.h | 6 +- src/mame/machine/compiskb.h | 4 +- src/mame/machine/cuda.cpp | 11 ---- src/mame/machine/cuda.h | 20 +++--- src/mame/machine/dc-ctrl.cpp | 24 ------- src/mame/machine/dc-ctrl.h | 30 ++++----- src/mame/machine/dec_lk201.h | 4 +- src/mame/machine/deco146.cpp | 21 ------ src/mame/machine/deco146.h | 43 +++++++----- src/mame/machine/deco_irq.cpp | 10 --- src/mame/machine/deco_irq.h | 36 +++++------ src/mame/machine/decopincpu.cpp | 6 -- src/mame/machine/decopincpu.h | 10 +-- src/mame/machine/egret.cpp | 11 ---- src/mame/machine/egret.h | 20 +++--- src/mame/machine/esqpanel.h | 16 ++--- src/mame/machine/fm_scsi.h | 10 +-- src/mame/machine/gaelco3d.h | 4 +- src/mame/machine/gridkeyb.h | 4 +- src/mame/machine/hp9845_printer.h | 14 ++-- src/mame/machine/ibm6580_fdc.h | 12 ++-- src/mame/machine/ibm6580_kbd.h | 12 ++-- src/mame/machine/igs025.cpp | 8 --- src/mame/machine/igs025.h | 4 +- src/mame/machine/interpro_ioga.cpp | 8 --- src/mame/machine/interpro_ioga.h | 46 +++++++------ src/mame/machine/interpro_sga.h | 4 +- src/mame/machine/isbc_208.h | 8 +-- src/mame/machine/isbc_215g.h | 12 ++-- src/mame/machine/jvs13551.cpp | 6 -- src/mame/machine/jvs13551.h | 26 ++++---- src/mame/machine/k573cass.h | 38 +++++------ src/mame/machine/kaneko_hit.cpp | 7 -- src/mame/machine/kaneko_hit.h | 6 +- src/mame/machine/kaneko_toybox.cpp | 12 ---- src/mame/machine/kaneko_toybox.h | 8 +-- src/mame/machine/kay_kbd.h | 5 +- src/mame/machine/kc_keyb.h | 4 +- src/mame/machine/km035.h | 8 +-- src/mame/machine/konppc.h | 8 +-- src/mame/machine/m24_kbd.h | 4 +- src/mame/machine/m24_z8000.h | 4 +- src/mame/machine/mackbd.h | 10 +-- src/mame/machine/maple-dc.cpp | 12 ---- src/mame/machine/maple-dc.h | 8 +-- src/mame/machine/mapledev.cpp | 8 --- src/mame/machine/mapledev.h | 8 ++- src/mame/machine/mega32x.cpp | 11 ---- src/mame/machine/mega32x.h | 6 +- src/mame/machine/megacdcd.cpp | 30 --------- src/mame/machine/megacdcd.h | 20 +++--- src/mame/machine/microdrv.h | 4 +- src/mame/machine/micropolis.h | 25 ++++--- src/mame/machine/midikbd.h | 4 +- src/mame/machine/midwayic.h | 32 ++++----- src/mame/machine/mie.cpp | 12 ---- src/mame/machine/mie.h | 22 +++---- src/mame/machine/mm1kb.h | 4 +- src/mame/machine/mmboard.h | 6 +- src/mame/machine/ms7004.h | 8 +-- src/mame/machine/msx_matsushita.h | 5 +- src/mame/machine/msx_systemflags.h | 6 +- src/mame/machine/namco06.h | 34 +++++----- src/mame/machine/namco51.h | 16 ++--- src/mame/machine/namco53.h | 18 +++--- src/mame/machine/namco62.h | 16 ++--- src/mame/machine/namco_c148.h | 27 ++++---- src/mame/machine/namcoio.h | 40 ++++++------ src/mame/machine/naomibd.cpp | 7 -- src/mame/machine/naomibd.h | 4 +- src/mame/machine/naomigd.cpp | 7 -- src/mame/machine/naomigd.h | 8 ++- src/mame/machine/naomim4.cpp | 6 -- src/mame/machine/naomim4.h | 4 +- src/mame/machine/nextkbd.h | 12 ++-- src/mame/machine/nextmo.h | 8 +-- src/mame/machine/nmk004.h | 5 +- src/mame/machine/nmk112.h | 14 ++-- src/mame/machine/pc1512kb.h | 8 +-- src/mame/machine/pc9801_kbd.h | 4 +- src/mame/machine/pcd_kbd.h | 4 +- src/mame/machine/psxcd.h | 6 +- src/mame/machine/qimi.h | 4 +- src/mame/machine/rad_eu3a05gpio.h | 12 ++-- src/mame/machine/segacrp2_device.cpp | 6 -- src/mame/machine/segacrp2_device.h | 4 +- src/mame/machine/segacrpt_device.cpp | 30 --------- src/mame/machine/segacrpt_device.h | 20 +++--- src/mame/machine/segaic16.cpp | 37 ----------- src/mame/machine/segaic16.h | 37 +++++------ src/mame/machine/st0016.h | 4 +- src/mame/machine/tait8741.h | 36 +++++------ src/mame/machine/taito68705interface.h | 15 ++--- src/mame/machine/taitoio.h | 104 +++++++++++++++--------------- src/mame/machine/taitosjsec.h | 25 +++---- src/mame/machine/tandy2kb.h | 8 +-- src/mame/machine/trs80m2kb.h | 4 +- src/mame/machine/upd65031.h | 24 +++---- src/mame/machine/v1050kb.h | 4 +- src/mame/machine/victor9k_fdc.h | 12 ++-- src/mame/machine/victor9k_kb.h | 8 +-- src/mame/machine/vs9209.h | 44 ++++++------- src/mame/machine/vt100_kbd.h | 6 +- src/mame/machine/wangpckb.h | 4 +- src/mame/machine/x820kb.h | 4 +- src/mame/machine/znmcu.h | 22 +++---- src/mame/machine/zorbakbd.h | 5 +- src/mame/machine/zs01.h | 4 +- src/mame/machine/zx8302.h | 62 +++++++++--------- src/mame/video/atarimo.cpp | 21 ------ src/mame/video/atarimo.h | 4 +- src/mame/video/atarirle.cpp | 11 ---- src/mame/video/atarirle.h | 2 +- src/mame/video/avgdvg.cpp | 15 ----- src/mame/video/avgdvg.h | 6 +- src/mame/video/decbac06.cpp | 17 ----- src/mame/video/decbac06.h | 9 ++- src/mame/video/deckarn.cpp | 15 ----- src/mame/video/deckarn.h | 4 +- src/mame/video/decmxc06.cpp | 16 ----- src/mame/video/decmxc06.h | 4 +- src/mame/video/deco16ic.cpp | 10 --- src/mame/video/deco16ic.h | 4 +- src/mame/video/deco_ace.cpp | 10 --- src/mame/video/deco_ace.h | 2 +- src/mame/video/deco_zoomspr.cpp | 11 ---- src/mame/video/deco_zoomspr.h | 2 +- src/mame/video/decocomn.cpp | 10 --- src/mame/video/decocomn.h | 2 +- src/mame/video/decodmd1.cpp | 5 -- src/mame/video/decodmd1.h | 2 +- src/mame/video/decodmd2.cpp | 5 -- src/mame/video/decodmd2.h | 2 +- src/mame/video/decodmd3.cpp | 5 -- src/mame/video/decodmd3.h | 2 +- src/mame/video/decospr.cpp | 16 ----- src/mame/video/decospr.h | 4 +- src/mame/video/decrmc3.cpp | 28 -------- src/mame/video/decrmc3.h | 12 ++-- src/mame/video/dooyong.cpp | 42 ------------ src/mame/video/dooyong.h | 21 +++--- src/mame/video/fuukifg.cpp | 6 -- src/mame/video/fuukifg.h | 2 +- src/mame/video/igs017_igs031.cpp | 6 -- src/mame/video/igs017_igs031.h | 2 +- src/mame/video/k001005.cpp | 5 -- src/mame/video/k001005.h | 2 +- src/mame/video/k007121.cpp | 10 --- src/mame/video/k007121.h | 2 +- src/mame/video/k007342.cpp | 10 --- src/mame/video/k007342.h | 2 +- src/mame/video/k007420.cpp | 10 --- src/mame/video/k007420.h | 2 +- src/mame/video/k051960.cpp | 9 --- src/mame/video/k051960.h | 2 +- src/mame/video/k052109.cpp | 10 --- src/mame/video/k052109.h | 2 +- src/mame/video/k053250.cpp | 6 -- src/mame/video/k053250.h | 6 +- src/mame/video/k053250_ps.cpp | 6 -- src/mame/video/k053250_ps.h | 6 +- src/mame/video/kan_pand.cpp | 10 --- src/mame/video/kan_pand.h | 2 +- src/mame/video/kaneko_grap2.cpp | 16 ----- src/mame/video/kaneko_grap2.h | 4 +- src/mame/video/kaneko_spr.cpp | 31 --------- src/mame/video/kaneko_spr.h | 18 ++++-- src/mame/video/kaneko_tmap.cpp | 28 -------- src/mame/video/kaneko_tmap.h | 14 ++-- src/mame/video/mb60553.cpp | 12 ---- src/mame/video/mb60553.h | 4 +- src/mame/video/ms1_tmap.cpp | 21 ------ src/mame/video/ms1_tmap.h | 8 +-- src/mame/video/pc080sn.cpp | 10 --- src/mame/video/pc080sn.h | 2 +- src/mame/video/pc090oj.cpp | 20 ------ src/mame/video/pc090oj.h | 4 +- src/mame/video/segaic16.cpp | 17 ----- src/mame/video/segaic16.h | 4 +- src/mame/video/segaic24.cpp | 5 -- src/mame/video/segaic24.h | 2 +- src/mame/video/seta001.cpp | 10 --- src/mame/video/seta001.h | 2 +- src/mame/video/snk68_spr.cpp | 21 ------ src/mame/video/snk68_spr.h | 6 +- src/mame/video/st0020.cpp | 12 ---- src/mame/video/st0020.h | 4 +- src/mame/video/tc0080vco.cpp | 10 --- src/mame/video/tc0080vco.h | 2 +- src/mame/video/tc0100scn.cpp | 20 ------ src/mame/video/tc0100scn.h | 4 +- src/mame/video/tc0110pcr.cpp | 10 --- src/mame/video/tc0110pcr.h | 2 +- src/mame/video/tc0180vcu.cpp | 10 --- src/mame/video/tc0180vcu.h | 2 +- src/mame/video/tc0280grd.cpp | 11 ---- src/mame/video/tc0280grd.h | 2 +- src/mame/video/tc0480scp.cpp | 10 --- src/mame/video/tc0480scp.h | 2 +- src/mame/video/tecmo_mix.cpp | 41 ------------ src/mame/video/tecmo_mix.h | 33 ++++++++-- src/mame/video/tecmo_spr.cpp | 16 ----- src/mame/video/tecmo_spr.h | 6 +- src/mame/video/toaplan_scu.cpp | 6 -- src/mame/video/toaplan_scu.h | 6 +- src/mame/video/vs920a.cpp | 13 ---- src/mame/video/vs920a.h | 4 +- src/mame/video/vsystem_spr.cpp | 50 -------------- src/mame/video/vsystem_spr.h | 20 +++--- src/mame/video/vsystem_spr2.cpp | 32 --------- src/mame/video/vsystem_spr2.h | 14 ++-- 231 files changed, 924 insertions(+), 1936 deletions(-) (limited to 'src/mame') diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index 37b59c6e7e4..34f884a1478 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -930,7 +930,7 @@ MACHINE_CONFIG_START(expro02_state::expro02) MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - kaneko_hit_device::set_type(*device, 0); + MCFG_KANEKO_HIT_TYPE(0) diff --git a/src/mame/drivers/galpanic.cpp b/src/mame/drivers/galpanic.cpp index 178d8be56c7..1cea0c488f3 100644 --- a/src/mame/drivers/galpanic.cpp +++ b/src/mame/drivers/galpanic.cpp @@ -273,7 +273,7 @@ MACHINE_CONFIG_START(galpanic_state::galpanica) /* basic machine hardware */ MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - kaneko_hit_device::set_type(*device, 0); + MCFG_KANEKO_HIT_TYPE(0) /* arm watchdog */ MCFG_WATCHDOG_MODIFY("watchdog") diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp index 49b6ed955f4..f2cd8788831 100644 --- a/src/mame/drivers/kaneko16.cpp +++ b/src/mame/drivers/kaneko16.cpp @@ -2164,7 +2164,7 @@ MACHINE_CONFIG_START(kaneko16_gtmr_state::gtmr) MCFG_DEVICE_ADD("toybox", KANEKO_TOYBOX, 0) /* part of the toybox? */ MCFG_DEVICE_ADD("kan_hit", KANEKO_HIT, 0) - kaneko_hit_device::set_type(*device, 1); + MCFG_KANEKO_HIT_TYPE(1) MCFG_VIDEO_START_OVERRIDE(kaneko16_gtmr_state,kaneko16) @@ -2239,7 +2239,7 @@ MACHINE_CONFIG_START(kaneko16_gtmr_state::bonkadv) MCFG_DEVICE_MODIFY("toybox") MCFG_TOYBOX_GAME_TYPE(BONK) MCFG_DEVICE_MODIFY("kan_hit") - kaneko_hit_device::set_type(*device, 0); + MCFG_KANEKO_HIT_TYPE(0) MACHINE_CONFIG_END @@ -2419,7 +2419,7 @@ MACHINE_CONFIG_START(kaneko16_shogwarr_state::shogwarr) MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("kan_hit", KANEKO_HIT, 0) - kaneko_hit_device::set_type(*device, 1); + MCFG_KANEKO_HIT_TYPE(1) MCFG_DEVICE_ADD("calc3_prot", KANEKO_CALC3, 0) @@ -2459,7 +2459,7 @@ MACHINE_CONFIG_START(kaneko16_shogwarr_state::brapboys) MCFG_DEVICE_ADDRESS_MAP(0, brapboys_oki2_map) MCFG_DEVICE_MODIFY("kan_hit") - kaneko_hit_device::set_type(*device, 2); + MCFG_KANEKO_HIT_TYPE(2) MCFG_DEVICE_REMOVE("eeprom") MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp index fbc3955d467..0ca0d08fa23 100644 --- a/src/mame/drivers/namcos2.cpp +++ b/src/mame/drivers/namcos2.cpp @@ -1683,12 +1683,12 @@ via software as INT1 MACHINE_CONFIG_START(namcos2_state::configure_c148_standard) MCFG_NAMCO_C148_ADD("master_intc","maincpu",true) - namco_c148_device::link_c148_device(*device,"slave_intc"); + MCFG_NAMCO_C148_LINK("slave_intc") MCFG_NAMCO_C148_EXT1_CB(WRITE8(namcos2_state, sound_reset_w)) MCFG_NAMCO_C148_EXT2_CB(WRITE8(namcos2_state, system_reset_w)) MCFG_NAMCO_C148_ADD("slave_intc","slave",false) - namco_c148_device::link_c148_device(*device,"master_intc"); + MCFG_NAMCO_C148_LINK("master_intc") MACHINE_CONFIG_END diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp index 0a7101c185c..ff6e13a3ecc 100644 --- a/src/mame/drivers/namcos21.cpp +++ b/src/mame/drivers/namcos21.cpp @@ -1873,12 +1873,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcos21_state::screen_scanline) MACHINE_CONFIG_START(namcos21_state::configure_c148_standard) MCFG_NAMCO_C148_ADD("master_intc","maincpu",true) - namco_c148_device::link_c148_device(*device,"slave_intc"); + MCFG_NAMCO_C148_LINK("slave_intc") MCFG_NAMCO_C148_EXT1_CB(WRITE8(namcos21_state, sound_reset_w)) MCFG_NAMCO_C148_EXT2_CB(WRITE8(namcos21_state, system_reset_w)) MCFG_NAMCO_C148_ADD("slave_intc","slave",false) - namco_c148_device::link_c148_device(*device,"master_intc"); + MCFG_NAMCO_C148_LINK("master_intc") MACHINE_CONFIG_END diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp index 7bfd0340a67..2a9040688f3 100644 --- a/src/mame/drivers/sandscrp.cpp +++ b/src/mame/drivers/sandscrp.cpp @@ -508,7 +508,7 @@ MACHINE_CONFIG_START(sandscrp_state::sandscrp) MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - kaneko_hit_device::set_type(*device, 0); + MCFG_KANEKO_HIT_TYPE(0) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") diff --git a/src/mame/machine/315-5838_317-0229_comp.h b/src/mame/machine/315-5838_317-0229_comp.h index 0990472fadb..ff1231e99d5 100644 --- a/src/mame/machine/315-5838_317-0229_comp.h +++ b/src/mame/machine/315-5838_317-0229_comp.h @@ -10,10 +10,10 @@ typedef device_delegate sega_dec_read_delegate; DECLARE_DEVICE_TYPE(SEGA315_5838_COMP, sega_315_5838_comp_device) #define MCFG_SET_5838_READ_CALLBACK_CH1( _class, _method) \ - sega_315_5838_comp_device::set_read_cb_ch1(*device, sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_read_cb_ch1(sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_SET_5838_READ_CALLBACK_CH2( _class, _method) \ - sega_315_5838_comp_device::set_read_cb_ch2(*device, sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_read_cb_ch2(sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); class sega_315_5838_comp_device : public device_t { @@ -21,16 +21,14 @@ public: // construction/destruction sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_read_cb_ch1(device_t &device,sega_dec_read_delegate readcb) + void set_read_cb_ch1(sega_dec_read_delegate readcb) { - sega_315_5838_comp_device &dev = downcast(device); - dev.m_channel[0].m_read_ch = readcb; + m_channel[0].m_read_ch = readcb; } - static void set_read_cb_ch2(device_t &device,sega_dec_read_delegate readcb) + void set_read_cb_ch2(sega_dec_read_delegate readcb) { - sega_315_5838_comp_device &dev = downcast(device); - dev.m_channel[1].m_read_ch = readcb; + m_channel[1].m_read_ch = readcb; } DECLARE_READ32_MEMBER(decathlt_prot1_r); diff --git a/src/mame/machine/315-5881_crypt.h b/src/mame/machine/315-5881_crypt.h index 62c0de16e9a..a0929ac7201 100644 --- a/src/mame/machine/315-5881_crypt.h +++ b/src/mame/machine/315-5881_crypt.h @@ -11,7 +11,7 @@ typedef device_delegate sega_m2_read_delegate; DECLARE_DEVICE_TYPE(SEGA315_5881_CRYPT, sega_315_5881_crypt_device) #define MCFG_SET_READ_CALLBACK( _class, _method) \ - sega_315_5881_crypt_device::set_read_cb(*device, sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_read_cb(sega_m2_read_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); class sega_315_5881_crypt_device : public device_t @@ -28,10 +28,9 @@ public: sega_m2_read_delegate m_read; - static void set_read_cb(device_t &device,sega_m2_read_delegate readcb) + void set_read_cb(sega_m2_read_delegate readcb) { - sega_315_5881_crypt_device &dev = downcast(device); - dev.m_read = readcb; + m_read = readcb; } protected: diff --git a/src/mame/machine/315_5296.h b/src/mame/machine/315_5296.h index f02e82f1ca5..08786d0952f 100644 --- a/src/mame/machine/315_5296.h +++ b/src/mame/machine/315_5296.h @@ -19,47 +19,47 @@ // A to H 8-bit input ports #define MCFG_315_5296_IN_PORTA_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pa_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pa_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTB_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pb_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pb_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTC_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pc_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pc_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTD_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pd_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pd_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTE_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pe_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pe_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTF_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pf_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pf_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTG_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_pg_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_pg_callback(DEVCB_##_devcb); #define MCFG_315_5296_IN_PORTH_CB(_devcb) \ - devcb = &sega_315_5296_device::set_in_ph_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_ph_callback(DEVCB_##_devcb); // A to H 8-bit output ports #define MCFG_315_5296_OUT_PORTA_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pa_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pa_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTB_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pb_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pb_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTC_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pc_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pc_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTD_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pd_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pd_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTE_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pe_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pe_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTF_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pf_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pf_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTG_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_pg_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_pg_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_PORTH_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_ph_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_ph_callback(DEVCB_##_devcb); // CNT output pins #define MCFG_315_5296_OUT_CNT0_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_cnt0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_cnt0_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_CNT1_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_cnt1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_cnt1_callback(DEVCB_##_devcb); #define MCFG_315_5296_OUT_CNT2_CB(_devcb) \ - devcb = &sega_315_5296_device::set_out_cnt2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_cnt2_callback(DEVCB_##_devcb); //************************************************************************** @@ -73,28 +73,28 @@ class sega_315_5296_device : public device_t public: sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } - template static devcb_base &set_in_pb_callback(device_t &device, _Object object) { return downcast(device).m_in_pb_cb.set_callback(object); } - template static devcb_base &set_in_pc_callback(device_t &device, _Object object) { return downcast(device).m_in_pc_cb.set_callback(object); } - template static devcb_base &set_in_pd_callback(device_t &device, _Object object) { return downcast(device).m_in_pd_cb.set_callback(object); } - template static devcb_base &set_in_pe_callback(device_t &device, _Object object) { return downcast(device).m_in_pe_cb.set_callback(object); } - template static devcb_base &set_in_pf_callback(device_t &device, _Object object) { return downcast(device).m_in_pf_cb.set_callback(object); } - template static devcb_base &set_in_pg_callback(device_t &device, _Object object) { return downcast(device).m_in_pg_cb.set_callback(object); } - template static devcb_base &set_in_ph_callback(device_t &device, _Object object) { return downcast(device).m_in_ph_cb.set_callback(object); } - - template static devcb_base &set_out_pa_callback(device_t &device, _Object object) { return downcast(device).m_out_pa_cb.set_callback(object); } - template static devcb_base &set_out_pb_callback(device_t &device, _Object object) { return downcast(device).m_out_pb_cb.set_callback(object); } - template static devcb_base &set_out_pc_callback(device_t &device, _Object object) { return downcast(device).m_out_pc_cb.set_callback(object); } - template static devcb_base &set_out_pd_callback(device_t &device, _Object object) { return downcast(device).m_out_pd_cb.set_callback(object); } - template static devcb_base &set_out_pe_callback(device_t &device, _Object object) { return downcast(device).m_out_pe_cb.set_callback(object); } - template static devcb_base &set_out_pf_callback(device_t &device, _Object object) { return downcast(device).m_out_pf_cb.set_callback(object); } - template static devcb_base &set_out_pg_callback(device_t &device, _Object object) { return downcast(device).m_out_pg_cb.set_callback(object); } - template static devcb_base &set_out_ph_callback(device_t &device, _Object object) { return downcast(device).m_out_ph_cb.set_callback(object); } - - template static devcb_base &set_out_cnt0_callback(device_t &device, _Object object) { return downcast(device).m_out_cnt0_cb.set_callback(object); } - template static devcb_base &set_out_cnt1_callback(device_t &device, _Object object) { return downcast(device).m_out_cnt1_cb.set_callback(object); } - template static devcb_base &set_out_cnt2_callback(device_t &device, _Object object) { return downcast(device).m_out_cnt2_cb.set_callback(object); } + // configuration helpers + template devcb_base &set_in_pa_callback(_Object object) { return m_in_pa_cb.set_callback(object); } + template devcb_base &set_in_pb_callback(_Object object) { return m_in_pb_cb.set_callback(object); } + template devcb_base &set_in_pc_callback(_Object object) { return m_in_pc_cb.set_callback(object); } + template devcb_base &set_in_pd_callback(_Object object) { return m_in_pd_cb.set_callback(object); } + template devcb_base &set_in_pe_callback(_Object object) { return m_in_pe_cb.set_callback(object); } + template devcb_base &set_in_pf_callback(_Object object) { return m_in_pf_cb.set_callback(object); } + template devcb_base &set_in_pg_callback(_Object object) { return m_in_pg_cb.set_callback(object); } + template devcb_base &set_in_ph_callback(_Object object) { return m_in_ph_cb.set_callback(object); } + + template devcb_base &set_out_pa_callback(_Object object) { return m_out_pa_cb.set_callback(object); } + template devcb_base &set_out_pb_callback(_Object object) { return m_out_pb_cb.set_callback(object); } + template devcb_base &set_out_pc_callback(_Object object) { return m_out_pc_cb.set_callback(object); } + template devcb_base &set_out_pd_callback(_Object object) { return m_out_pd_cb.set_callback(object); } + template devcb_base &set_out_pe_callback(_Object object) { return m_out_pe_cb.set_callback(object); } + template devcb_base &set_out_pf_callback(_Object object) { return m_out_pf_cb.set_callback(object); } + template devcb_base &set_out_pg_callback(_Object object) { return m_out_pg_cb.set_callback(object); } + template devcb_base &set_out_ph_callback(_Object object) { return m_out_ph_cb.set_callback(object); } + + template devcb_base &set_out_cnt0_callback(_Object object) { return m_out_cnt0_cb.set_callback(object); } + template devcb_base &set_out_cnt1_callback(_Object object) { return m_out_cnt1_cb.set_callback(object); } + template devcb_base &set_out_cnt2_callback(_Object object) { return m_out_cnt2_cb.set_callback(object); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/mame/machine/6883sam.h b/src/mame/machine/6883sam.h index b9d954d4c7d..0817ab37503 100644 --- a/src/mame/machine/6883sam.h +++ b/src/mame/machine/6883sam.h @@ -16,10 +16,10 @@ #define MCFG_SAM6883_ADD(_tag, _clock, _cputag, _cpuspace) \ MCFG_DEVICE_ADD(_tag, SAM6883, _clock) \ - sam6883_device::configure_cpu(*device, _cputag, _cpuspace); + downcast(*device).configure_cpu(_cputag, _cpuspace); #define MCFG_SAM6883_RES_CALLBACK(_read) \ - devcb = &sam6883_device::set_res_rd_callback(*device, DEVCB_##_read); + devcb = &downcast(*device).set_res_rd_callback(DEVCB_##_read); //************************************************************************** @@ -91,13 +91,12 @@ class sam6883_device : public device_t, public sam6883_friend_device_interface public: sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_res_rd_callback(device_t &device, Object &&cb) { return downcast(device).m_read_res.set_callback(std::forward(cb)); } + template devcb_base &set_res_rd_callback(Object &&cb) { return m_read_res.set_callback(std::forward(cb)); } - static void configure_cpu(device_t &device, const char *tag, int space) + void configure_cpu(const char *tag, int space) { - sam6883_device &dev = downcast(device); - dev.m_cpu_tag = tag; - dev.m_cpu_space_ref = space; + m_cpu_tag = tag; + m_cpu_space_ref = space; } // called to configure banks diff --git a/src/mame/machine/abc80kb.h b/src/mame/machine/abc80kb.h index 5416a8611ca..093a5ef88a3 100644 --- a/src/mame/machine/abc80kb.h +++ b/src/mame/machine/abc80kb.h @@ -25,7 +25,7 @@ //************************************************************************** #define MCFG_ABC80_KEYBOARD_KEYDOWN_CALLBACK(_write) \ - devcb = &abc80_keyboard_device::set_keydown_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_keydown_wr_callback(DEVCB_##_write); @@ -41,7 +41,7 @@ public: // construction/destruction abc80_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_keydown_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_keydown.set_callback(object); } + template devcb_base &set_keydown_wr_callback(_Object object) { return m_write_keydown.set_callback(object); } uint8_t data_r(); diff --git a/src/mame/machine/acs8600_ics.h b/src/mame/machine/acs8600_ics.h index ac6e6fb842f..14f47fe9d81 100644 --- a/src/mame/machine/acs8600_ics.h +++ b/src/mame/machine/acs8600_ics.h @@ -19,9 +19,9 @@ public: DECLARE_WRITE8_MEMBER(hostram_w); DECLARE_WRITE_LINE_MEMBER(attn_w); - template static devcb_base &static_set_irq1_callback(device_t &device, Object &&cb) { return downcast(device).m_out_irq1_func.set_callback(std::forward(cb)); } - template static devcb_base &static_set_irq2_callback(device_t &device, Object &&cb) { return downcast(device).m_out_irq2_func.set_callback(std::forward(cb)); } - static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag) { downcast(device).m_maincpu_tag = maincpu_tag; } + template devcb_base &set_irq1_callback(Object &&cb) { return m_out_irq1_func.set_callback(std::forward(cb)); } + template devcb_base &set_irq2_callback(Object &&cb) { return m_out_irq2_func.set_callback(std::forward(cb)); } + void set_maincpu_tag(const char *maincpu_tag) { m_maincpu_tag = maincpu_tag; } const tiny_rom_entry *device_rom_region() const override; void ics_io(address_map &map); @@ -39,13 +39,13 @@ private: u8 m_hiaddr, m_ctrl; }; #define MCFG_ACS8600_ICS_MAINCPU(_maincpu_tag) \ - acs8600_ics_device::static_set_maincpu_tag(*device, _maincpu_tag); + downcast(*device).set_maincpu_tag(_maincpu_tag); #define MCFG_ACS8600_ICS_IRQ1(_irq_line) \ - devcb = &acs8600_ics_device::static_set_irq1_callback(*device, DEVCB_##_irq_line); + devcb = &downcast(*device).set_irq1_callback(DEVCB_##_irq_line); #define MCFG_ACS8600_ICS_IRQ2(_irq_line) \ - devcb = &acs8600_ics_device::static_set_irq2_callback(*device, DEVCB_##_irq_line); + devcb = &downcast(*device).set_irq2_callback(DEVCB_##_irq_line); DECLARE_DEVICE_TYPE(ACS8600_ICS, acs8600_ics_device) diff --git a/src/mame/machine/apollo_kbd.h b/src/mame/machine/apollo_kbd.h index a2486df55f3..096a1be7710 100644 --- a/src/mame/machine/apollo_kbd.h +++ b/src/mame/machine/apollo_kbd.h @@ -29,10 +29,10 @@ //************************************************************************** #define MCFG_APOLLO_KBD_TX_CALLBACK(_cb) \ - devcb = &apollo_kbd_device::set_tx_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_tx_cb(DEVCB_##_cb); #define MCFG_APOLLO_KBD_GERMAN_CALLBACK(_cb) \ - devcb = &apollo_kbd_device::set_german_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_german_cb(DEVCB_##_cb); //************************************************************************** @@ -47,8 +47,8 @@ public: // construction/destruction apollo_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_tx_cb(device_t &device, Object &&cb) { return downcast(device).m_tx_w.set_callback(std::forward(cb)); } - template static devcb_base &set_german_cb(device_t &device, Object &&cb) { return downcast(device).m_german_r.set_callback(std::forward(cb)); } + template devcb_base &set_tx_cb(Object &&cb) { return m_tx_w.set_callback(std::forward(cb)); } + template devcb_base &set_german_cb(Object &&cb) { return m_german_r.set_callback(std::forward(cb)); } private: // device-level overrides diff --git a/src/mame/machine/apricotkb.h b/src/mame/machine/apricotkb.h index fc92d38f73e..268812a7bc9 100644 --- a/src/mame/machine/apricotkb.h +++ b/src/mame/machine/apricotkb.h @@ -27,7 +27,7 @@ //************************************************************************** #define MCFG_APRICOT_KEYBOARD_TXD_CALLBACK(_write) \ - devcb = &apricot_keyboard_device::set_tcd_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_tcd_wr_callback(DEVCB_##_write); @@ -43,7 +43,7 @@ public: // construction/destruction apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_txd_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_txd.set_callback(object); } + template devcb_base &set_txd_wr_callback(_Object object) { return m_write_txd.set_callback(object); } uint8_t read_keyboard(); diff --git a/src/mame/machine/asic65.h b/src/mame/machine/asic65.h index 0a167114f3e..877bcaaf284 100644 --- a/src/mame/machine/asic65.h +++ b/src/mame/machine/asic65.h @@ -24,8 +24,8 @@ class asic65_device : public device_t public: asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // (static) configuration helpers - static void set_type(device_t &device, int type) { downcast(device).m_asic65_type = type; } + // configuration helpers + void set_type(int type) { m_asic65_type = type; } void reset_line(int state); DECLARE_WRITE16_MEMBER( data_w ); @@ -79,6 +79,6 @@ DECLARE_DEVICE_TYPE(ASIC65, asic65_device) #define MCFG_ASIC65_ADD(_tag, _type) \ MCFG_DEVICE_ADD(_tag, ASIC65, 0) \ - asic65_device::set_type(*device, _type); + downcast(*device).set_type(_type); #endif // MAME_MACHINE_ASIC65_H diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp index e4ec35a73c8..5ca6abf5f0f 100644 --- a/src/mame/machine/atarigen.cpp +++ b/src/mame/machine/atarigen.cpp @@ -70,17 +70,6 @@ atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, } -//------------------------------------------------- -// static_set_sound_cpu: Set the tag of the -// sound CPU -//------------------------------------------------- - -void atari_sound_comm_device::static_set_sound_cpu(device_t &device, const char *cputag) -{ - downcast(device).m_sound_cpu_tag = cputag; -} - - //------------------------------------------------- // device_start: Start up the device //------------------------------------------------- diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index 7289eca9f32..b21cc3359e3 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -34,15 +34,15 @@ #define MCFG_ATARI_SOUND_COMM_ADD(_tag, _soundcpu, _intcb) \ MCFG_DEVICE_ADD(_tag, ATARI_SOUND_COMM, 0) \ - atari_sound_comm_device::static_set_sound_cpu(*device, _soundcpu); \ - devcb = &atari_sound_comm_device::static_set_main_int_cb(*device, DEVCB_##_intcb); + downcast(*device).set_sound_cpu(_soundcpu); \ + devcb = &downcast(*device).set_main_int_cb(DEVCB_##_intcb); #define MCFG_ATARI_VAD_ADD(_tag, _screen, _intcb) \ MCFG_DEVICE_ADD(_tag, ATARI_VAD, 0) \ MCFG_VIDEO_SET_SCREEN(_screen) \ - devcb = &atari_vad_device::static_set_scanline_int_cb(*device, DEVCB_##_intcb); + devcb = &downcast(*device).set_scanline_int_cb(DEVCB_##_intcb); #define MCFG_ATARI_VAD_PLAYFIELD(_class, _gfxtag, _getinfo) \ { std::string fulltag(device->tag()); fulltag.append(":playfield"); device_t *device; \ @@ -102,9 +102,9 @@ public: // construction/destruction atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - static void static_set_sound_cpu(device_t &device, const char *cputag); - template static devcb_base &static_set_main_int_cb(device_t &device, _Object object) { return downcast(device).m_main_int_cb.set_callback(object); } + // configuration helpers + void set_sound_cpu(const char *cputag) { m_sound_cpu_tag = cputag; } + template devcb_base &set_main_int_cb(_Object object) { return m_main_int_cb.set_callback(object); } // getters DECLARE_READ_LINE_MEMBER(main_to_sound_ready) { return m_main_to_sound_ready ? ASSERT_LINE : CLEAR_LINE; } @@ -175,8 +175,8 @@ public: // construction/destruction atari_vad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &static_set_scanline_int_cb(device_t &device, _Object object) { return downcast(device).m_scanline_int_cb.set_callback(object); } + // configuration helpers + template devcb_base &set_scanline_int_cb(_Object object) { return m_scanline_int_cb.set_callback(object); } // getters tilemap_device &alpha() const { return *m_alpha_tilemap; } diff --git a/src/mame/machine/c117.cpp b/src/mame/machine/c117.cpp index c7780007fd7..bbd7f542043 100644 --- a/src/mame/machine/c117.cpp +++ b/src/mame/machine/c117.cpp @@ -51,19 +51,6 @@ device_memory_interface::space_config_vector namco_c117_device::memory_space_con }; } -//------------------------------------------------- -// set_cpu_tags - set the tags of the two CPUs -// connected to the device -//------------------------------------------------- - -void namco_c117_device::set_cpu_tags(device_t &device, const char *maintag, const char *subtag) -{ - namco_c117_device &c117 = downcast(device); - c117.m_maincpu_tag = maintag; - c117.m_subcpu_tag = subtag; -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/machine/c117.h b/src/mame/machine/c117.h index 0e26b8aba0d..2f67cb9d413 100644 --- a/src/mame/machine/c117.h +++ b/src/mame/machine/c117.h @@ -14,10 +14,10 @@ //************************************************************************** #define MCFG_CUS117_CPUS(_maincpu, _subcpu) \ - namco_c117_device::set_cpu_tags(*device, _maincpu, _subcpu); + downcast(*device).set_cpu_tags(_maincpu, _subcpu); #define MCFG_CUS117_SUBRES_CB(_devcb) \ - devcb = &namco_c117_device::set_subres_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_subres_cb(DEVCB_##_devcb); //*************************************************************************** @@ -32,9 +32,13 @@ public: //construction/destruction namco_c117_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration - static void set_cpu_tags(device_t &device, const char *maintag, const char *subtag); - template static devcb_base &set_subres_cb(device_t &device, _Object object) { return downcast(device).m_subres_cb.set_callback(object); } + // configuration + void set_cpu_tags(const char *maintag, const char *subtag) + { + m_maincpu_tag = maintag; + m_subcpu_tag = subtag; + } + template devcb_base &set_subres_cb(_Object object) { return m_subres_cb.set_callback(object); } DECLARE_READ8_MEMBER(main_r); DECLARE_READ8_MEMBER(sub_r); diff --git a/src/mame/machine/cammu.h b/src/mame/machine/cammu.h index 0b5074a7149..cb38c433aae 100644 --- a/src/mame/machine/cammu.h +++ b/src/mame/machine/cammu.h @@ -7,10 +7,10 @@ #pragma once #define MCFG_CAMMU_SSW_CB(_sswcb) \ - devcb = &cammu_device::static_set_ssw_callback(*device, DEVCB_##_sswcb); + devcb = &downcast(*device).set_ssw_callback(DEVCB_##_sswcb); #define MCFG_CAMMU_EXCEPTION_CB(_exceptioncb) \ - devcb = &cammu_device::static_set_exception_callback(*device, DEVCB_##_exceptioncb); + devcb = &downcast(*device).set_exception_callback(DEVCB_##_exceptioncb); #define MCFG_CAMMU_LINK(_tag) \ cammu_c3_device::static_add_linked(*device, _tag); @@ -18,8 +18,8 @@ class cammu_device : public device_t, public device_memory_interface { public: - template static devcb_base &static_set_ssw_callback(device_t &device, Object &&cb) { return downcast(device).m_ssw_func.set_callback(std::forward(cb)); } - template static devcb_base &static_set_exception_callback(device_t &device, Object &&cb) { return downcast(device).m_exception_func.set_callback(std::forward(cb)); } + template devcb_base &set_ssw_callback(Object &&cb) { return m_ssw_func.set_callback(std::forward(cb)); } + template devcb_base &set_exception_callback(Object &&cb) { return m_exception_func.set_callback(std::forward(cb)); } static const u32 CAMMU_PAGE_SIZE = 0x1000; static const u32 CAMMU_PAGE_MASK = (CAMMU_PAGE_SIZE - 1); diff --git a/src/mame/machine/cat702.h b/src/mame/machine/cat702.h index 550da70f991..4c66568b817 100644 --- a/src/mame/machine/cat702.h +++ b/src/mame/machine/cat702.h @@ -11,15 +11,15 @@ DECLARE_DEVICE_TYPE(CAT702, cat702_device) #define MCFG_CAT702_DATAOUT_HANDLER(_devcb) \ - devcb = &cat702_device::set_dataout_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dataout_handler(DEVCB_##_devcb); class cat702_device : public device_t { public: cat702_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_dataout_handler(device_t &device, Object &&cb) { return downcast(device).m_dataout_handler.set_callback(std::forward(cb)); } + // configuration helpers + template devcb_base &set_dataout_handler(Object &&cb) { return m_dataout_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(write_select); DECLARE_WRITE_LINE_MEMBER(write_datain); diff --git a/src/mame/machine/compiskb.h b/src/mame/machine/compiskb.h index 5feac9b83e3..86d3b154577 100644 --- a/src/mame/machine/compiskb.h +++ b/src/mame/machine/compiskb.h @@ -20,7 +20,7 @@ //************************************************************************** #define MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(_devcb) \ - devcb = &compis_keyboard_device::set_out_tx_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_tx_handler(DEVCB_##_devcb); @@ -37,7 +37,7 @@ public: // construction/destruction compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_out_tx_handler(device_t &device, Object &&cb) { return downcast(device).m_out_tx_handler.set_callback(std::forward(cb)); } + template devcb_base &set_out_tx_handler(Object &&cb) { return m_out_tx_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( si_w ); diff --git a/src/mame/machine/cuda.cpp b/src/mame/machine/cuda.cpp index 4da469e6302..d6c5aebbb06 100644 --- a/src/mame/machine/cuda.cpp +++ b/src/mame/machine/cuda.cpp @@ -383,17 +383,6 @@ cuda_device::cuda_device(const machine_config &mconfig, const char *tag, device_ { } -//------------------------------------------------- -// static_set_type - configuration helper to set -// the chip type -//------------------------------------------------- - -void cuda_device::static_set_type(device_t &device, int type) -{ - cuda_device &cuda = downcast(device); - cuda.rom_offset = type; -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/machine/cuda.h b/src/mame/machine/cuda.h index 1859d06fdbc..699329087a8 100644 --- a/src/mame/machine/cuda.h +++ b/src/mame/machine/cuda.h @@ -32,22 +32,22 @@ MCFG_DEVICE_REMOVE(CUDA_TAG) #define MCFG_CUDA_TYPE(_type) \ - cuda_device::static_set_type(*device, _type); + downcast(*device).set_type(_type); #define MCFG_CUDA_REMOVE() \ MCFG_DEVICE_REMOVE(CUDA_TAG) #define MCFG_CUDA_RESET_CALLBACK(_cb) \ - devcb = &cuda_device::set_reset_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_reset_cb(DEVCB_##_cb); #define MCFG_CUDA_LINECHANGE_CALLBACK(_cb) \ - devcb = &cuda_device::set_linechange_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_linechange_cb(DEVCB_##_cb); #define MCFG_CUDA_VIA_CLOCK_CALLBACK(_cb) \ - devcb = &cuda_device::set_via_clock_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_via_clock_cb(DEVCB_##_cb); #define MCFG_CUDA_VIA_DATA_CALLBACK(_cb) \ - devcb = &cuda_device::set_via_data_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_via_data_cb(DEVCB_##_cb); //************************************************************************** // TYPE DEFINITIONS @@ -62,7 +62,7 @@ public: cuda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - static void static_set_type(device_t &device, int type); + void set_type(int type) { rom_offset = type; } // device_config_nvram_interface overrides virtual void nvram_default() override; @@ -96,10 +96,10 @@ public: int rom_offset; - template static devcb_base &set_reset_cb(device_t &device, _Object wr) { return downcast(device).write_reset.set_callback(wr); } - template static devcb_base &set_linechange_cb(device_t &device, _Object wr) { return downcast(device).write_linechange.set_callback(wr); } - template static devcb_base &set_via_clock_cb(device_t &device, _Object wr) { return downcast(device).write_via_clock.set_callback(wr); } - template static devcb_base &set_via_data_cb(device_t &device, _Object wr) { return downcast(device).write_via_data.set_callback(wr); } + template devcb_base &set_reset_cb(_Object wr) { return write_reset.set_callback(wr); } + template devcb_base &set_linechange_cb(_Object wr) { return write_linechange.set_callback(wr); } + template devcb_base &set_via_clock_cb(_Object wr) { return write_via_clock.set_callback(wr); } + template devcb_base &set_via_data_cb(_Object wr) { return write_via_data.set_callback(wr); } devcb_write_line write_reset, write_linechange, write_via_clock, write_via_data; diff --git a/src/mame/machine/dc-ctrl.cpp b/src/mame/machine/dc-ctrl.cpp index fa8f28346f5..a24a84cfd6a 100644 --- a/src/mame/machine/dc-ctrl.cpp +++ b/src/mame/machine/dc-ctrl.cpp @@ -5,30 +5,6 @@ DEFINE_DEVICE_TYPE(DC_CONTROLLER, dc_controller_device, "dcctrl", "Dreamcast Controller") -void dc_controller_device::static_set_port_tag(device_t &device, int port, const char *tag) -{ - dc_controller_device &ctrl = downcast(device); - ctrl.port_tag[port] = tag; -} - -void dc_controller_device::static_set_id(device_t &device, const char *id) -{ - dc_controller_device &ctrl = downcast(device); - ctrl.id = id; -} - -void dc_controller_device::static_set_license(device_t &device, const char *license) -{ - dc_controller_device &ctrl = downcast(device); - ctrl.license = license; -} - -void dc_controller_device::static_set_versions(device_t &device, const char *versions) -{ - dc_controller_device &ctrl = downcast(device); - ctrl.versions = versions; -} - dc_controller_device::dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : maple_device(mconfig, DC_CONTROLLER, tag, owner, clock) { diff --git a/src/mame/machine/dc-ctrl.h b/src/mame/machine/dc-ctrl.h index b5b98f42dab..fa809478bf7 100644 --- a/src/mame/machine/dc-ctrl.h +++ b/src/mame/machine/dc-ctrl.h @@ -9,23 +9,23 @@ #define MCFG_DC_CONTROLLER_ADD(_tag, _host_tag, _host_port, d0, d1, a0, a1, a2, a3, a4, a5) \ MCFG_MAPLE_DEVICE_ADD(_tag, DC_CONTROLLER, 0, _host_tag, _host_port) \ - dc_controller_device::static_set_port_tag(*device, 0, d0); \ - dc_controller_device::static_set_port_tag(*device, 1, d1); \ - dc_controller_device::static_set_port_tag(*device, 2, a0); \ - dc_controller_device::static_set_port_tag(*device, 3, a1); \ - dc_controller_device::static_set_port_tag(*device, 4, a2); \ - dc_controller_device::static_set_port_tag(*device, 5, a3); \ - dc_controller_device::static_set_port_tag(*device, 6, a4); \ - dc_controller_device::static_set_port_tag(*device, 7, a5); + downcast(*device).set_port_tag(0, d0); \ + downcast(*device).set_port_tag(1, d1); \ + downcast(*device).set_port_tag(2, a0); \ + downcast(*device).set_port_tag(3, a1); \ + downcast(*device).set_port_tag(4, a2); \ + downcast(*device).set_port_tag(5, a3); \ + downcast(*device).set_port_tag(6, a4); \ + downcast(*device).set_port_tag(7, a5); #define MCFG_DC_CONTROLLER_SET_ID(id) \ - dc_controller_device::static_set_id(*device, id); + downcast(*device).set_id(id); #define MCFG_DC_CONTROLLER_SET_LICENSE(license) \ - dc_controller_device::static_set_license(*device, license); + downcast(*device).set_license(license); #define MCFG_DC_CONTROLLER_SET_VERSIONS(versions) \ - dc_controller_device::static_set_versions(*device, versions); + ddowncast(*device).set_versions(versions); class dc_controller_device : public maple_device { @@ -33,10 +33,10 @@ public: // construction/destruction dc_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_port_tag(device_t &device, int port, const char *tag); - static void static_set_id(device_t &device, const char *id); - static void static_set_license(device_t &device, const char *license); - static void static_set_versions(device_t &device, const char *versions); + void set_port_tag(int port, const char *tag) { port_tag[port] = tag; } + void set_id(const char *new_id) { id = new_id; } + void set_license(const char *new_license) { license = new_license; } + void set_versions(const char *new_versions) { versions = new_versions; } void maple_w(const uint32_t *data, uint32_t in_size) override; diff --git a/src/mame/machine/dec_lk201.h b/src/mame/machine/dec_lk201.h index 51f1835b20a..231e3157a36 100644 --- a/src/mame/machine/dec_lk201.h +++ b/src/mame/machine/dec_lk201.h @@ -35,7 +35,7 @@ //************************************************************************** #define MCFG_LK201_TX_HANDLER(_cb) \ - devcb = &lk201_device::set_tx_handler(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_tx_handler(DEVCB_##_cb); //************************************************************************** // TYPE DEFINITIONS @@ -60,7 +60,7 @@ public: DECLARE_READ8_MEMBER(timer_r); DECLARE_WRITE8_MEMBER(timer_w); - template static devcb_base &set_tx_handler(device_t &device, _Object wr) { return downcast(device).m_tx_handler.set_callback(wr); } + template devcb_base &set_tx_handler(_Object wr) { return m_tx_handler.set_callback(wr); } void lk201_map(address_map &map); protected: diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp index 34e0d7d0486..c306996a1c5 100644 --- a/src/mame/machine/deco146.cpp +++ b/src/mame/machine/deco146.cpp @@ -1341,27 +1341,6 @@ deco_146_base_device::deco_146_base_device(const machine_config &mconfig, device m_external_addrswap[9] = 9; } -void deco_146_base_device::set_interface_scramble(device_t &device,uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0) -{ - deco_146_base_device &dev = downcast(device); - dev.m_external_addrswap[9] = a9; - dev.m_external_addrswap[8] = a8; - dev.m_external_addrswap[7] = a7; - dev.m_external_addrswap[6] = a6; - dev.m_external_addrswap[5] = a5; - dev.m_external_addrswap[4] = a4; - dev.m_external_addrswap[3] = a3; - dev.m_external_addrswap[2] = a2; - dev.m_external_addrswap[1] = a1; - dev.m_external_addrswap[0] = a0; -} - -void deco_146_base_device::set_use_magic_read_address_xor(device_t &device, int use_xor) -{ - deco_146_base_device &dev = downcast(device); - dev.m_magic_read_address_xor_enabled = use_xor; -} - void deco_146_base_device::device_start() { for (int i=0;i<0x80;i++) diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index 28c7e889d5c..ebd75b86ac3 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -9,29 +9,29 @@ #define MCFG_DECO146_IN_PORTA_CB(_devcb) \ - devcb = &deco_146_base_device::set_port_a_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_port_a_cb(DEVCB_##_devcb); #define MCFG_DECO146_IN_PORTB_CB(_devcb) \ - devcb = &deco_146_base_device::set_port_b_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_port_b_cb(DEVCB_##_devcb); #define MCFG_DECO146_IN_PORTC_CB(_devcb) \ - devcb = &deco_146_base_device::set_port_c_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_port_c_cb(DEVCB_##_devcb); #define MCFG_DECO146_SOUNDLATCH_IRQ_CB(_devcb) \ - devcb = &deco_146_base_device::set_soundlatch_irq_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_soundlatch_irq_callback(DEVCB_##_devcb); // there are some standard ways the chip gets hooked up, so have them here ready to use #define MCFG_DECO146_SET_INTERFACE_SCRAMBLE( a9,a8,a7,a6,a5,a4,a3,a2,a1,a0 ) \ - deco_146_base_device::set_interface_scramble(*device, a9,a8,a7,a6,a5,a4,a3,a2,a1,a0); + downcast(*device).set_interface_scramble(a9,a8,a7,a6,a5,a4,a3,a2,a1,a0); #define MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE \ - deco_146_base_device::set_interface_scramble(*device, 0,1,2,3,4,5,6,7,8,9); + downcast(*device).set_interface_scramble(0,1,2,3,4,5,6,7,8,9); #define MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE \ - deco_146_base_device::set_interface_scramble(*device, 4,5,3,6,2,7,1,8,0,9 ); + downcast(*device).set_interface_scramble(4,5,3,6,2,7,1,8,0,9 ); #define MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR \ - deco_146_base_device::set_use_magic_read_address_xor(*device, 1 ); + downcast(*device).set_use_magic_read_address_xor(1); @@ -82,14 +82,25 @@ public: void write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags); uint16_t read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags); - template static devcb_base &set_port_a_cb(device_t &device, Object &&object) { return downcast(device).m_port_a_r.set_callback(std::forward(object)); } - template static devcb_base &set_port_b_cb(device_t &device, Object &&object) { return downcast(device).m_port_b_r.set_callback(std::forward(object)); } - template static devcb_base &set_port_c_cb(device_t &device, Object &&object) { return downcast(device).m_port_c_r.set_callback(std::forward(object)); } - static void set_interface_scramble(device_t &device,uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0); - static void set_use_magic_read_address_xor(device_t &device, int use_xor); - - template static devcb_base &set_soundlatch_irq_callback(device_t &device, Object &&cb) - { return downcast(device).m_soundlatch_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_port_a_cb(Object &&object) { return m_port_a_r.set_callback(std::forward(object)); } + template devcb_base &set_port_b_cb(Object &&object) { return m_port_b_r.set_callback(std::forward(object)); } + template devcb_base &set_port_c_cb(Object &&object) { return m_port_c_r.set_callback(std::forward(object)); } + void set_interface_scramble(uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0) + { + m_external_addrswap[9] = a9; + m_external_addrswap[8] = a8; + m_external_addrswap[7] = a7; + m_external_addrswap[6] = a6; + m_external_addrswap[5] = a5; + m_external_addrswap[4] = a4; + m_external_addrswap[3] = a3; + m_external_addrswap[2] = a2; + m_external_addrswap[1] = a1; + m_external_addrswap[0] = a0; + } + void set_use_magic_read_address_xor(int use_xor) { m_magic_read_address_xor_enabled = use_xor; } + + template devcb_base &set_soundlatch_irq_callback(Object &&cb) { return m_soundlatch_irq_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( soundlatch_r ); diff --git a/src/mame/machine/deco_irq.cpp b/src/mame/machine/deco_irq.cpp index 911857aebcf..cf3f66ce5be 100644 --- a/src/mame/machine/deco_irq.cpp +++ b/src/mame/machine/deco_irq.cpp @@ -83,16 +83,6 @@ void deco_irq_device::device_reset() { } -//------------------------------------------------- -// set_screen_tag - set screen we are attached to -//------------------------------------------------- - -void deco_irq_device::set_screen_tag(device_t &device, const char *tag) -{ - deco_irq_device &dev = dynamic_cast(device); - dev.m_screen.set_tag(tag); -} - //------------------------------------------------- // scanline_callback - called on each scanline //------------------------------------------------- diff --git a/src/mame/machine/deco_irq.h b/src/mame/machine/deco_irq.h index 6ff77cff70e..8266d31563e 100644 --- a/src/mame/machine/deco_irq.h +++ b/src/mame/machine/deco_irq.h @@ -20,25 +20,25 @@ #define MCFG_DECO_IRQ_ADD(_tag, _screen_tag) \ MCFG_DEVICE_ADD(_tag, DECO_IRQ, 0) \ - deco_irq_device::set_screen_tag(*device, "^" _screen_tag); + downcast(*device).set_screen_tag("^" _screen_tag); #define MCFG_DECO_IRQ_LIGHTGUN1_CB(_devcb) \ - devcb = &deco_irq_device::set_lightgun1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_lightgun1_callback(DEVCB_##_devcb); #define MCFG_DECO_IRQ_LIGHTGUN2_CB(_devcb) \ - devcb = &deco_irq_device::set_lightgun2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_lightgun2_callback(DEVCB_##_devcb); #define MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(_devcb) \ - devcb = &deco_irq_device::set_lightgun_irq_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_lightgun_irq_callback(DEVCB_##_devcb); #define MCFG_DECO_IRQ_RASTER1_IRQ_CB(_devcb) \ - devcb = &deco_irq_device::set_raster1_irq_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_raster1_irq_callback(DEVCB_##_devcb); #define MCFG_DECO_IRQ_RASTER2_IRQ_CB(_devcb) \ - devcb = &deco_irq_device::set_raster2_irq_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_raster2_irq_callback(DEVCB_##_devcb); #define MCFG_DECO_IRQ_VBLANK_IRQ_CB(_devcb) \ - devcb = &deco_irq_device::set_vblank_irq_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_vblank_irq_callback(DEVCB_##_devcb); //************************************************************************** @@ -52,26 +52,20 @@ public: deco_irq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - template static devcb_base &set_lightgun1_callback(device_t &device, Object &&cb) - { return downcast(device).m_lightgun1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_lightgun1_callback(Object &&cb) { return m_lightgun1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_lightgun2_callback(device_t &device, Object &&cb) - { return downcast(device).m_lightgun2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_lightgun2_callback(Object &&cb) { return m_lightgun2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_lightgun_irq_callback(device_t &device, Object &&cb) - { return downcast(device).m_lightgun_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_lightgun_irq_callback(Object &&cb) { return m_lightgun_irq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_raster1_irq_callback(device_t &device, Object &&cb) - { return downcast(device).m_raster1_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_raster1_irq_callback(Object &&cb) { return m_raster1_irq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_raster2_irq_callback(device_t &device, Object &&cb) - { return downcast(device).m_raster2_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_raster2_irq_callback(Object &&cb) { return m_raster2_irq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_vblank_irq_callback(device_t &device, Object &&cb) - { return downcast(device).m_vblank_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_vblank_irq_callback(Object &&cb) { return m_vblank_irq_cb.set_callback(std::forward(cb)); } - // static configuration - static void set_screen_tag(device_t &device, const char *tag); + // configuration + void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } TIMER_CALLBACK_MEMBER(scanline_callback); diff --git a/src/mame/machine/decopincpu.cpp b/src/mame/machine/decopincpu.cpp index 319ce2c65fc..8a90f3b62cf 100644 --- a/src/mame/machine/decopincpu.cpp +++ b/src/mame/machine/decopincpu.cpp @@ -294,12 +294,6 @@ void decocpu_type1_device::device_start() m_cpu->space(AS_PROGRAM).install_rom(0x4000,0xffff,ROM+0x4000); } -void decocpu_type1_device::static_set_cpuregion(device_t &device, const char *tag) -{ - decocpu_type1_device &cpuboard = downcast(device); - cpuboard.m_cputag = tag; -} - decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : decocpu_type2_device(mconfig, DECOCPU2, tag, owner, clock) {} diff --git a/src/mame/machine/decopincpu.h b/src/mame/machine/decopincpu.h index 9368cc14a8e..85b88761451 100644 --- a/src/mame/machine/decopincpu.h +++ b/src/mame/machine/decopincpu.h @@ -17,19 +17,19 @@ #define MCFG_DECOCPU_TYPE1_ADD(_tag, _clock, _region) \ MCFG_DEVICE_ADD(_tag, DECOCPU1, _clock) \ - decocpu_type1_device::static_set_cpuregion(*device, _region); + downcast(*device).set_cpuregion(_region); #define MCFG_DECOCPU_TYPE2_ADD(_tag, _clock, _region) \ MCFG_DEVICE_ADD(_tag, DECOCPU2, _clock) \ - decocpu_type1_device::static_set_cpuregion(*device, _region); + downcast(*device).set_cpuregion(_region); #define MCFG_DECOCPU_TYPE3_ADD(_tag, _clock, _region) \ MCFG_DEVICE_ADD(_tag, DECOCPU3, _clock) \ - decocpu_type1_device::static_set_cpuregion(*device, _region); + downcast(*device).set_cpuregion(_region); #define MCFG_DECOCPU_TYPE3B_ADD(_tag, _clock, _region) \ MCFG_DEVICE_ADD(_tag, DECOCPU3B, _clock) \ - decocpu_type1_device::static_set_cpuregion(*device, _region); + downcast(*device).set_cpuregion(_region); #define MCFG_DECOCPU_DISPLAY(_disp_r, _disp_w) \ downcast(device)->set_display_read_callback(DEVCB_##_disp_r); \ @@ -81,7 +81,7 @@ public: INPUT_CHANGED_MEMBER(main_nmi); INPUT_CHANGED_MEMBER(audio_nmi); - static void static_set_cpuregion(device_t &device, const char *tag); + void set_cpuregion(const char *tag) { m_cputag = tag; } void decocpu1_map(address_map &map); protected: diff --git a/src/mame/machine/egret.cpp b/src/mame/machine/egret.cpp index 12538809c27..647ff09d328 100644 --- a/src/mame/machine/egret.cpp +++ b/src/mame/machine/egret.cpp @@ -334,17 +334,6 @@ egret_device::egret_device(const machine_config &mconfig, const char *tag, devic { } -//------------------------------------------------- -// static_set_type - configuration helper to set -// the chip type -//------------------------------------------------- - -void egret_device::static_set_type(device_t &device, int type) -{ - egret_device &egret = downcast(device); - egret.rom_offset = type; -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/machine/egret.h b/src/mame/machine/egret.h index 767ed5be447..1cb7e59090a 100644 --- a/src/mame/machine/egret.h +++ b/src/mame/machine/egret.h @@ -30,22 +30,22 @@ MCFG_EGRET_TYPE(_type) #define MCFG_EGRET_TYPE(_type) \ - egret_device::static_set_type(*device, _type); + downcast(*device).set_type(_type); #define MCFG_EGRET_REMOVE() \ MCFG_DEVICE_REMOVE(EGRET_TAG) #define MCFG_EGRET_RESET_CALLBACK(_cb) \ - devcb = &egret_device::set_reset_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_reset_cb(DEVCB_##_cb); #define MCFG_EGRET_LINECHANGE_CALLBACK(_cb) \ - devcb = &egret_device::set_linechange_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_linechange_cb(DEVCB_##_cb); #define MCFG_EGRET_VIA_CLOCK_CALLBACK(_cb) \ - devcb = &egret_device::set_via_clock_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_via_clock_cb(DEVCB_##_cb); #define MCFG_EGRET_VIA_DATA_CALLBACK(_cb) \ - devcb = &egret_device::set_via_data_cb(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_via_data_cb(DEVCB_##_cb); //************************************************************************** // TYPE DEFINITIONS @@ -60,7 +60,7 @@ public: egret_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - static void static_set_type(device_t &device, int type); + void set_type(int type) { rom_offset = type; } // device_config_nvram_interface overrides virtual void nvram_default() override; @@ -94,10 +94,10 @@ public: int rom_offset; - template static devcb_base &set_reset_cb(device_t &device, _Object wr) { return downcast(device).write_reset.set_callback(wr); } - template static devcb_base &set_linechange_cb(device_t &device, _Object wr) { return downcast(device).write_linechange.set_callback(wr); } - template static devcb_base &set_via_clock_cb(device_t &device, _Object wr) { return downcast(device).write_via_clock.set_callback(wr); } - template static devcb_base &set_via_data_cb(device_t &device, _Object wr) { return downcast(device).write_via_data.set_callback(wr); } + template devcb_base &set_reset_cb(_Object wr) { return write_reset.set_callback(wr); } + template devcb_base &set_linechange_cb(_Object wr) { return write_linechange.set_callback(wr); } + template devcb_base &set_via_clock_cb(_Object wr) { return write_via_clock.set_callback(wr); } + template devcb_base &set_via_data_cb(_Object wr) { return write_via_data.set_callback(wr); } devcb_write_line write_reset, write_linechange, write_via_clock, write_via_data; diff --git a/src/mame/machine/esqpanel.h b/src/mame/machine/esqpanel.h index de2e9918f83..3cd91a86fdc 100644 --- a/src/mame/machine/esqpanel.h +++ b/src/mame/machine/esqpanel.h @@ -51,10 +51,10 @@ MCFG_DEVICE_REMOVE(_tag) #define MCFG_ESQPANEL_TX_CALLBACK(_write) \ - devcb = &esqpanel_device::set_tx_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_tx_wr_callback(DEVCB_##_write); #define MCFG_ESQPANEL_ANALOG_CALLBACK(_write) \ - devcb = &esqpanel_device::set_analog_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_analog_wr_callback(DEVCB_##_write); //************************************************************************** // TYPE DEFINITIONS @@ -69,15 +69,9 @@ namespace esqpanel { class esqpanel_device : public device_t, public device_serial_interface { public: - template - static devcb_base &set_tx_wr_callback(device_t &device, Object &&cb) { - return downcast(device).m_write_tx.set_callback(std::forward(cb)); - } - - template - static devcb_base &set_analog_wr_callback(device_t &device, Object &&cb) { - return downcast(device).m_write_analog.set_callback(std::forward(cb)); - } + template devcb_base &set_tx_wr_callback(Object &&cb) { return m_write_tx.set_callback(std::forward(cb)); } + + template devcb_base &set_analog_wr_callback(Object &&cb) { return m_write_analog.set_callback(std::forward(cb)); } void xmit_char(uint8_t data); void set_analog_value(offs_t offset, uint16_t value); diff --git a/src/mame/machine/fm_scsi.h b/src/mame/machine/fm_scsi.h index d9d3a09d1e0..2fcd1950fbd 100644 --- a/src/mame/machine/fm_scsi.h +++ b/src/mame/machine/fm_scsi.h @@ -16,9 +16,9 @@ MCFG_DEVICE_ADD(_tag, FMSCSI, 0) #define MCFG_FMSCSI_IRQ_HANDLER(_devcb) \ - devcb = &fmscsi_device::set_irq_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_irq_handler(DEVCB_##_devcb); #define MCFG_FMSCSI_DRQ_HANDLER(_devcb) \ - devcb = &fmscsi_device::set_drq_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_drq_handler(DEVCB_##_devcb); class fmscsi_device : public legacy_scsi_host_adapter { @@ -26,9 +26,9 @@ public: // construction/destruction fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast(device).m_irq_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_drq_handler(device_t &device, Object &&cb) { return downcast(device).m_drq_handler.set_callback(std::forward(cb)); } + // configuration helpers + template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } + template devcb_base &set_drq_handler(Object &&cb) { return m_drq_handler.set_callback(std::forward(cb)); } // any publically accessible interfaces needed for runtime uint8_t fmscsi_data_r(void); diff --git a/src/mame/machine/gaelco3d.h b/src/mame/machine/gaelco3d.h index 7e3b6ee6ad4..5b66b23e4a0 100644 --- a/src/mame/machine/gaelco3d.h +++ b/src/mame/machine/gaelco3d.h @@ -16,7 +16,7 @@ ***************************************************************************/ #define MCFG_GAELCO_SERIAL_IRQ_HANDLER(_devcb) \ - devcb = &gaelco_serial_device::set_irq_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_irq_handler(DEVCB_##_devcb); @@ -33,7 +33,7 @@ public: gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast(device).m_irq_handler.set_callback(std::forward(cb)); } + template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER(status_r); DECLARE_WRITE8_MEMBER(data_w); diff --git a/src/mame/machine/gridkeyb.h b/src/mame/machine/gridkeyb.h index 1e11df26b90..c70669dcb05 100644 --- a/src/mame/machine/gridkeyb.h +++ b/src/mame/machine/gridkeyb.h @@ -16,7 +16,7 @@ #define GRIDKEYBCB_DEVPUT(tag, cls, fnc) grid_keyboard_device::output_delegate((&cls::fnc), (#cls "::" #fnc), (tag), ((cls *)nullptr)) #define MCFG_GRID_KEYBOARD_CB(cb) \ - grid_keyboard_device::set_keyboard_callback(*device, (GRIDKEYBCB_##cb)); + downcast(*device).set_keyboard_callback((GRIDKEYBCB_##cb)); @@ -52,7 +52,7 @@ public: device_t *owner, u32 clock); - template static void set_keyboard_callback(device_t &device, Object &&cb) { downcast(device).m_keyboard_cb = std::forward(cb); } + template void set_keyboard_callback(Object &&cb) { m_keyboard_cb = std::forward(cb); } virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/machine/hp9845_printer.h b/src/mame/machine/hp9845_printer.h index db88d87f2c7..0c8aea9e594 100644 --- a/src/mame/machine/hp9845_printer.h +++ b/src/mame/machine/hp9845_printer.h @@ -16,13 +16,13 @@ #include "imagedev/bitbngr.h" #define MCFG_9845PRT_IRL_HANDLER(_devcb) \ - devcb = &hp9845_printer_device::set_irl_handler(*device , DEVCB_##_devcb); + devcb = &downcast(*device).set_irl_handler(DEVCB_##_devcb); #define MCFG_9845PRT_FLG_HANDLER(_devcb) \ - devcb = &hp9845_printer_device::set_flg_handler(*device , DEVCB_##_devcb); + devcb = &downcast(*device).set_flg_handler(DEVCB_##_devcb); #define MCFG_9845PRT_STS_HANDLER(_devcb) \ - devcb = &hp9845_printer_device::set_sts_handler(*device , DEVCB_##_devcb); + devcb = &downcast(*device).set_sts_handler(DEVCB_##_devcb); class hp9845_printer_device : public device_t { @@ -30,10 +30,10 @@ public: // construction/destruction hp9845_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_irl_handler(device_t &device, Object &&cb) { return downcast(device).m_irl_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_flg_handler(device_t &device, Object &&cb) { return downcast(device).m_flg_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_sts_handler(device_t &device, Object &&cb) { return downcast(device).m_sts_handler.set_callback(std::forward(cb)); } + // configuration helpers + template devcb_base &set_irl_handler(Object &&cb) { return m_irl_handler.set_callback(std::forward(cb)); } + template devcb_base &set_flg_handler(Object &&cb) { return m_flg_handler.set_callback(std::forward(cb)); } + template devcb_base &set_sts_handler(Object &&cb) { return m_sts_handler.set_callback(std::forward(cb)); } // device-level overrides virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/mame/machine/ibm6580_fdc.h b/src/mame/machine/ibm6580_fdc.h index 1e62fbf8fd5..30bbb2c9b6f 100644 --- a/src/mame/machine/ibm6580_fdc.h +++ b/src/mame/machine/ibm6580_fdc.h @@ -10,13 +10,13 @@ #define MCFG_DW_FDC_OUT_DATA_HANDLER(_devcb) \ - devcb = &dw_fdc_device::set_out_data_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_data_handler(DEVCB_##_devcb); #define MCFG_DW_FDC_OUT_CLOCK_HANDLER(_devcb) \ - devcb = &dw_fdc_device::set_out_clock_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_clock_handler(DEVCB_##_devcb); #define MCFG_DW_FDC_OUT_STROBE_HANDLER(_devcb) \ - devcb = &dw_fdc_device::set_out_strobe_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_strobe_handler(DEVCB_##_devcb); class dw_fdc_device : public device_t @@ -24,9 +24,9 @@ class dw_fdc_device : public device_t public: dw_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_out_data_handler(device_t &device, Object &&cb) { return downcast(device).m_out_data.set_callback(std::forward(cb)); } - template static devcb_base &set_out_clock_handler(device_t &device, Object &&cb) { return downcast(device).m_out_clock.set_callback(std::forward(cb)); } - template static devcb_base &set_out_strobe_handler(device_t &device, Object &&cb) { return downcast(device).m_out_strobe.set_callback(std::forward(cb)); } + template devcb_base &set_out_data_handler(Object &&cb) { return m_out_data.set_callback(std::forward(cb)); } + template devcb_base &set_out_clock_handler(Object &&cb) { return m_out_clock.set_callback(std::forward(cb)); } + template devcb_base &set_out_strobe_handler(Object &&cb) { return m_out_strobe.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(reset_w); DECLARE_WRITE_LINE_MEMBER(ack_w); diff --git a/src/mame/machine/ibm6580_kbd.h b/src/mame/machine/ibm6580_kbd.h index fcdb6064598..f39ce79857b 100644 --- a/src/mame/machine/ibm6580_kbd.h +++ b/src/mame/machine/ibm6580_kbd.h @@ -7,22 +7,22 @@ #define MCFG_DW_KEYBOARD_OUT_DATA_HANDLER(_devcb) \ - devcb = &dw_keyboard_device::set_out_data_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_data_handler(DEVCB_##_devcb); #define MCFG_DW_KEYBOARD_OUT_CLOCK_HANDLER(_devcb) \ - devcb = &dw_keyboard_device::set_out_clock_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_clock_handler(DEVCB_##_devcb); #define MCFG_DW_KEYBOARD_OUT_STROBE_HANDLER(_devcb) \ - devcb = &dw_keyboard_device::set_out_strobe_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_strobe_handler(DEVCB_##_devcb); class dw_keyboard_device : public device_t { public: dw_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_out_data_handler(device_t &device, Object &&cb) { return downcast(device).m_out_data.set_callback(std::forward(cb)); } - template static devcb_base &set_out_clock_handler(device_t &device, Object &&cb) { return downcast(device).m_out_clock.set_callback(std::forward(cb)); } - template static devcb_base &set_out_strobe_handler(device_t &device, Object &&cb) { return downcast(device).m_out_strobe.set_callback(std::forward(cb)); } + template devcb_base &set_out_data_handler(Object &&cb) { return m_out_data.set_callback(std::forward(cb)); } + template devcb_base &set_out_clock_handler(Object &&cb) { return m_out_clock.set_callback(std::forward(cb)); } + template devcb_base &set_out_strobe_handler(Object &&cb) { return m_out_strobe.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(reset_w); DECLARE_WRITE_LINE_MEMBER(ack_w); diff --git a/src/mame/machine/igs025.cpp b/src/mame/machine/igs025.cpp index 30dc0940fcd..63f58c66003 100644 --- a/src/mame/machine/igs025.cpp +++ b/src/mame/machine/igs025.cpp @@ -29,14 +29,6 @@ void igs025_device::no_callback_setup() -void igs025_device::set_external_cb(device_t &device,igs025_execute_external newcb) -{ - //printf("set_external_cb\n"); - igs025_device &dev = downcast(device); - dev.m_execute_external = newcb; -} - - void igs025_device::device_start() { // Reset IGS025 stuff diff --git a/src/mame/machine/igs025.h b/src/mame/machine/igs025.h index 7d58b365b8b..bcf01989d51 100644 --- a/src/mame/machine/igs025.h +++ b/src/mame/machine/igs025.h @@ -10,7 +10,7 @@ typedef device_delegate igs025_execute_external; #define MCFG_IGS025_SET_EXTERNAL_EXECUTE( _class, _method) \ - igs025_device::set_external_cb(*device, igs025_execute_external(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_external_cb(igs025_execute_external(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); class igs025_device : public device_t { @@ -25,7 +25,7 @@ public: igs025_execute_external m_execute_external; - static void set_external_cb(device_t &device,igs025_execute_external newcb); + void set_external_cb(igs025_execute_external newcb) { m_execute_external = newcb; } DECLARE_WRITE16_MEMBER( olds_w ); DECLARE_WRITE16_MEMBER( drgw2_d80000_protection_w ); diff --git a/src/mame/machine/interpro_ioga.cpp b/src/mame/machine/interpro_ioga.cpp index 05155582c26..27cbaa3d5aa 100644 --- a/src/mame/machine/interpro_ioga.cpp +++ b/src/mame/machine/interpro_ioga.cpp @@ -193,14 +193,6 @@ sapphire_ioga_device::sapphire_ioga_device(const machine_config &mconfig, const { } -void interpro_ioga_device::static_set_memory(device_t &device, const char *const tag, const int spacenum) -{ - interpro_ioga_device &ioga = dynamic_cast(device); - - ioga.m_memory_tag = tag; - ioga.m_memory_spacenum = spacenum; -} - void interpro_ioga_device::device_start() { assert_always(m_memory_tag != nullptr, "memory tag and address space number must be configured"); diff --git a/src/mame/machine/interpro_ioga.h b/src/mame/machine/interpro_ioga.h index 489753b6586..67c53ea96ab 100644 --- a/src/mame/machine/interpro_ioga.h +++ b/src/mame/machine/interpro_ioga.h @@ -7,30 +7,30 @@ #pragma once #define MCFG_INTERPRO_IOGA_NMI_CB(_out_nmi) \ - devcb = &interpro_ioga_device::static_set_out_nmi_callback(*device, DEVCB_##_out_nmi); + devcb = &downcast(*device).set_out_nmi_callback(DEVCB_##_out_nmi); #define MCFG_INTERPRO_IOGA_IRQ_CB(_out_irq) \ - devcb = &interpro_ioga_device::static_set_out_irq_callback(*device, DEVCB_##_out_irq); + devcb = &downcast(*device).set_out_irq_callback(DEVCB_##_out_irq); #define MCFG_INTERPRO_IOGA_IVEC_CB(_out_ivec) \ - devcb = &interpro_ioga_device::static_set_out_ivec_callback(*device, DEVCB_##_out_ivec); + devcb = &downcast(*device).set_out_ivec_callback(DEVCB_##_out_ivec); #define MCFG_INTERPRO_IOGA_DMA_CB(_channel, _dma_r, _dma_w) \ - devcb = &interpro_ioga_device::static_set_dma_r_callback(*device, _channel, DEVCB_##_dma_r); \ - devcb = &interpro_ioga_device::static_set_dma_w_callback(*device, _channel, DEVCB_##_dma_w); + devcb = &downcast(*device).set_dma_r_callback(_channel, DEVCB_##_dma_r); \ + devcb = &downcast(*device).set_dma_w_callback(_channel, DEVCB_##_dma_w); #define MCFG_INTERPRO_IOGA_SERIAL_DMA_CB(_channel, _dma_r, _dma_w) \ - devcb = &interpro_ioga_device::static_set_serial_dma_r_callback(*device, _channel, DEVCB_##_dma_r); \ - devcb = &interpro_ioga_device::static_set_serial_dma_w_callback(*device, _channel, DEVCB_##_dma_w); + devcb = &downcast(*device).set_serial_dma_r_callback(_channel, DEVCB_##_dma_r); \ + devcb = &downcast(*device).set_serial_dma_w_callback(_channel, DEVCB_##_dma_w); #define MCFG_INTERPRO_IOGA_FDCTC_CB(_tc) \ - devcb = &interpro_ioga_device::static_set_fdc_tc_callback(*device, DEVCB_##_tc); + devcb = &downcast(*device).set_fdc_tc_callback(DEVCB_##_tc); #define MCFG_INTERPRO_IOGA_ETH_CA_CB(_ca) \ - devcb = &interpro_ioga_device::static_set_eth_ca_callback(*device, DEVCB_##_ca); + devcb = &downcast(*device).set_eth_ca_callback(DEVCB_##_ca); #define MCFG_INTERPRO_IOGA_MEMORY(_tag, _spacenum) \ - interpro_ioga_device::static_set_memory(*device, _tag, _spacenum); + downcast(*device).set_memory(_tag, _spacenum); class interpro_ioga_device : public device_t { @@ -106,17 +106,21 @@ protected: }; public: - template static devcb_base &static_set_out_nmi_callback(device_t &device, _Object object) { return downcast(device).m_out_nmi_func.set_callback(object); } - template static devcb_base &static_set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_func.set_callback(object); } - template static devcb_base &static_set_out_ivec_callback(device_t &device, _Object object) { return downcast(device).m_out_ivec_func.set_callback(object); } - template static devcb_base &static_set_dma_r_callback(device_t &device, int channel, _Object object) { return downcast(device).m_dma_channel[channel].device_r.set_callback(object); } - template static devcb_base &static_set_dma_w_callback(device_t &device, int channel, _Object object) { return downcast(device).m_dma_channel[channel].device_w.set_callback(object); } - template static devcb_base &static_set_serial_dma_r_callback(device_t &device, int channel, _Object object) { return downcast(device).m_serial_dma_channel[channel].device_r.set_callback(object); } - template static devcb_base &static_set_serial_dma_w_callback(device_t &device, int channel, _Object object) { return downcast(device).m_serial_dma_channel[channel].device_w.set_callback(object); } - template static devcb_base &static_set_fdc_tc_callback(device_t &device, _Object object) { return downcast(device).m_fdc_tc_func.set_callback(object); } - template static devcb_base &static_set_eth_ca_callback(device_t &device, _Object object) { return downcast(device).m_eth_ca_func.set_callback(object); } - - static void static_set_memory(device_t &device, const char *const tag, const int spacenum); + template devcb_base &set_out_nmi_callback(_Object object) { return m_out_nmi_func.set_callback(object); } + template devcb_base &set_out_irq_callback(_Object object) { return m_out_irq_func.set_callback(object); } + template devcb_base &set_out_ivec_callback(_Object object) { return m_out_ivec_func.set_callback(object); } + template devcb_base &set_dma_r_callback(int channel, _Object object) { return m_dma_channel[channel].device_r.set_callback(object); } + template devcb_base &set_dma_w_callback(int channel, _Object object) { return m_dma_channel[channel].device_w.set_callback(object); } + template devcb_base &set_serial_dma_r_callback(int channel, _Object object) { return m_serial_dma_channel[channel].device_r.set_callback(object); } + template devcb_base &set_serial_dma_w_callback(int channel, _Object object) { return m_serial_dma_channel[channel].device_w.set_callback(object); } + template devcb_base &set_fdc_tc_callback(_Object object) { return m_fdc_tc_func.set_callback(object); } + template devcb_base &set_eth_ca_callback(_Object object) { return m_eth_ca_func.set_callback(object); } + + void set_memory(const char *const tag, const int spacenum) + { + m_memory_tag = tag; + m_memory_spacenum = spacenum; + } virtual void map(address_map &map) = 0; diff --git a/src/mame/machine/interpro_sga.h b/src/mame/machine/interpro_sga.h index 691859aceea..c784ecd6a62 100644 --- a/src/mame/machine/interpro_sga.h +++ b/src/mame/machine/interpro_sga.h @@ -7,14 +7,14 @@ #pragma once #define MCFG_INTERPRO_SGA_BERR_CB(_out_berr) \ - devcb = &interpro_sga_device::static_set_out_berr_callback(*device, DEVCB_##_out_berr); + devcb = &downcast(*device).set_out_berr_callback(DEVCB_##_out_berr); class interpro_sga_device : public device_t { public: interpro_sga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &static_set_out_berr_callback(device_t &device, _Object object) { return downcast(device).out_berr_func.set_callback(object); } + template devcb_base &set_out_berr_callback(_Object object) { return out_berr_func.set_callback(object); } virtual void map(address_map &map); diff --git a/src/mame/machine/isbc_208.h b/src/mame/machine/isbc_208.h index 111a88a6289..97116b8a32c 100644 --- a/src/mame/machine/isbc_208.h +++ b/src/mame/machine/isbc_208.h @@ -18,8 +18,8 @@ public: DECLARE_READ8_MEMBER(stat_r); DECLARE_WRITE8_MEMBER(aux_w); - template static devcb_base &static_set_irq_callback(device_t &device, Object &&cb) { return downcast(device).m_out_irq_func.set_callback(std::forward(cb)); } - static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag) { downcast(device).m_maincpu_tag = maincpu_tag; } + template devcb_base &set_irq_callback(Object &&cb) { return m_out_irq_func.set_callback(std::forward(cb)); } + void set_maincpu_tag(const char *maincpu_tag) { m_maincpu_tag = maincpu_tag; } protected: virtual void device_start() override; @@ -44,10 +44,10 @@ private: DECLARE_FLOPPY_FORMATS( floppy_formats ); }; #define MCFG_ISBC_208_MAINCPU(_maincpu_tag) \ - isbc_208_device::static_set_maincpu_tag(*device, _maincpu_tag); + downcast(*device).set_maincpu_tag(_maincpu_tag); #define MCFG_ISBC_208_IRQ(_irq_line) \ - devcb = &isbc_208_device::static_set_irq_callback(*device, DEVCB_##_irq_line); + devcb = &downcast(*device).set_irq_callback(DEVCB_##_irq_line); DECLARE_DEVICE_TYPE(ISBC_208, isbc_208_device) diff --git a/src/mame/machine/isbc_215g.h b/src/mame/machine/isbc_215g.h index 6984cd6d2a6..ef4c057d335 100644 --- a/src/mame/machine/isbc_215g.h +++ b/src/mame/machine/isbc_215g.h @@ -21,9 +21,9 @@ public: DECLARE_READ16_MEMBER(mem_r); DECLARE_WRITE16_MEMBER(mem_w); - static void static_set_wakeup_addr(device_t &device, uint32_t wakeup) { downcast(device).m_wakeup = wakeup; } - static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag) { downcast(device).m_maincpu_tag = maincpu_tag; } - template static devcb_base &static_set_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_func.set_callback(object); } + void set_wakeup_addr(uint32_t wakeup) { m_wakeup = wakeup; } + void set_maincpu_tag(const char *maincpu_tag) { m_maincpu_tag = maincpu_tag; } + template devcb_base &set_irq_callback(_Object object) { return m_out_irq_func.set_callback(object); } void isbc_215g_io(address_map &map); void isbc_215g_mem(address_map &map); @@ -68,11 +68,11 @@ private: #define MCFG_ISBC_215_ADD(_tag, _wakeup, _maincpu_tag) \ MCFG_DEVICE_ADD(_tag, ISBC_215G, 0) \ - isbc_215g_device::static_set_wakeup_addr(*device, _wakeup); \ - isbc_215g_device::static_set_maincpu_tag(*device, _maincpu_tag); + downcast(*device).set_wakeup_addr(_wakeup); \ + downcast(*device).set_maincpu_tag(_maincpu_tag); #define MCFG_ISBC_215_IRQ(_irq_line) \ - devcb = &isbc_215g_device::static_set_irq_callback(*device, DEVCB_##_irq_line); + devcb = &downcast(*device).set_irq_callback(DEVCB_##_irq_line); DECLARE_DEVICE_TYPE(ISBC_215G, isbc_215g_device) diff --git a/src/mame/machine/jvs13551.cpp b/src/mame/machine/jvs13551.cpp index 4de551dfeb3..6b75d21dd6a 100644 --- a/src/mame/machine/jvs13551.cpp +++ b/src/mame/machine/jvs13551.cpp @@ -43,12 +43,6 @@ const tiny_rom_entry *sega_837_13551_device::device_rom_region() const return ROM_NAME(jvs13551); } -void sega_837_13551_device::static_set_port_tag(device_t &device, int port, const char *tag) -{ - sega_837_13551_device &ctrl = downcast(device); - ctrl.port_tag[port] = tag; -} - MACHINE_CONFIG_START(sega_837_13551_device::device_add_mconfig) MCFG_CPU_ADD("iomcu", TMP90PH44, 10000000) // unknown clock MACHINE_CONFIG_END diff --git a/src/mame/machine/jvs13551.h b/src/mame/machine/jvs13551.h index 77f1bd4ff3c..279937612c9 100644 --- a/src/mame/machine/jvs13551.h +++ b/src/mame/machine/jvs13551.h @@ -9,18 +9,18 @@ #define MCFG_SEGA_837_13551_DEVICE_ADD(_tag, _host, tilt, d0, d1, a0, a1, a2, a3, a4, a5, a6, a7, out) \ MCFG_JVS_DEVICE_ADD(_tag, SEGA_837_13551, _host) \ - sega_837_13551_device::static_set_port_tag(*device, 0, tilt); \ - sega_837_13551_device::static_set_port_tag(*device, 1, d0); \ - sega_837_13551_device::static_set_port_tag(*device, 2, d1); \ - sega_837_13551_device::static_set_port_tag(*device, 3, a0); \ - sega_837_13551_device::static_set_port_tag(*device, 4, a1); \ - sega_837_13551_device::static_set_port_tag(*device, 5, a2); \ - sega_837_13551_device::static_set_port_tag(*device, 6, a3); \ - sega_837_13551_device::static_set_port_tag(*device, 7, a4); \ - sega_837_13551_device::static_set_port_tag(*device, 8, a5); \ - sega_837_13551_device::static_set_port_tag(*device, 9, a6); \ - sega_837_13551_device::static_set_port_tag(*device, 10, a7); \ - sega_837_13551_device::static_set_port_tag(*device, 11, out); + downcast(*device).set_port_tag(0, tilt); \ + downcast(*device).set_port_tag(1, d0); \ + downcast(*device).set_port_tag(2, d1); \ + downcast(*device).set_port_tag(3, a0); \ + downcast(*device).set_port_tag(4, a1); \ + downcast(*device).set_port_tag(5, a2); \ + downcast(*device).set_port_tag(6, a3); \ + downcast(*device).set_port_tag(7, a4); \ + downcast(*device).set_port_tag(8, a5); \ + downcast(*device).set_port_tag(9, a6); \ + downcast(*device).set_port_tag(10, a7); \ + downcast(*device).set_port_tag(11, out); class jvs_host; @@ -28,7 +28,7 @@ class sega_837_13551_device : public jvs_device { public: sega_837_13551_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_port_tag(device_t &device, int port, const char *tag); + void set_port_tag(int port, const char *tag) { port_tag[port] = tag; } virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/mame/machine/k573cass.h b/src/mame/machine/k573cass.h index 09b33df3fd3..a79e60e33dd 100644 --- a/src/mame/machine/k573cass.h +++ b/src/mame/machine/k573cass.h @@ -17,7 +17,7 @@ #include "machine/zs01.h" #define MCFG_KONAMI573_CASSETTE_DSR_HANDLER(_devcb) \ - devcb = &konami573_cassette_slot_device::set_dsr_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dsr_handler(DEVCB_##_devcb); DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_SLOT, konami573_cassette_slot_device) @@ -32,7 +32,7 @@ class konami573_cassette_slot_device : public device_t, public: konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_dsr_handler(device_t &device, Object &&cb) { return downcast(device).m_dsr_handler.set_callback(std::forward(cb)); } + template devcb_base &set_dsr_handler(Object &&cb) { return m_dsr_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(write_line_d0); DECLARE_WRITE_LINE_MEMBER(write_line_d1); @@ -143,28 +143,28 @@ DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_Y, konami573_cassette_y_device) #define MCFG_KONAMI573_CASSETTE_Y_D0_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d0_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d0_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D1_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d1_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d1_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D2_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d2_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d2_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D3_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d3_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d3_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D4_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d4_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d4_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D5_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d5_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d5_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D6_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d6_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d6_handler(DEVCB_##_devcb); #define MCFG_KONAMI573_CASSETTE_Y_D7_HANDLER(_devcb) \ - devcb = &konami573_cassette_y_device::set_d7_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_d7_handler(DEVCB_##_devcb); class konami573_cassette_y_device: public device_t, public konami573_cassette_interface @@ -172,15 +172,15 @@ class konami573_cassette_y_device: public device_t, public: konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_d0_handler(device_t &device, _Object object) { return downcast(device).m_d0_handler.set_callback(object); } - template static devcb_base &set_d1_handler(device_t &device, _Object object) { return downcast(device).m_d1_handler.set_callback(object); } - template static devcb_base &set_d2_handler(device_t &device, _Object object) { return downcast(device).m_d2_handler.set_callback(object); } - template static devcb_base &set_d3_handler(device_t &device, _Object object) { return downcast(device).m_d3_handler.set_callback(object); } - template static devcb_base &set_d4_handler(device_t &device, _Object object) { return downcast(device).m_d4_handler.set_callback(object); } - template static devcb_base &set_d5_handler(device_t &device, _Object object) { return downcast(device).m_d5_handler.set_callback(object); } - template static devcb_base &set_d6_handler(device_t &device, _Object object) { return downcast(device).m_d6_handler.set_callback(object); } - template static devcb_base &set_d7_handler(device_t &device, _Object object) { return downcast(device).m_d7_handler.set_callback(object); } + // configuration helpers + template devcb_base &set_d0_handler(_Object object) { return m_d0_handler.set_callback(object); } + template devcb_base &set_d1_handler(_Object object) { return m_d1_handler.set_callback(object); } + template devcb_base &set_d2_handler(_Object object) { return m_d2_handler.set_callback(object); } + template devcb_base &set_d3_handler(_Object object) { return m_d3_handler.set_callback(object); } + template devcb_base &set_d4_handler(_Object object) { return m_d4_handler.set_callback(object); } + template devcb_base &set_d5_handler(_Object object) { return m_d5_handler.set_callback(object); } + template devcb_base &set_d6_handler(_Object object) { return m_d6_handler.set_callback(object); } + template devcb_base &set_d7_handler(_Object object) { return m_d7_handler.set_callback(object); } virtual DECLARE_READ_LINE_MEMBER(read_line_secflash_sda) override; virtual DECLARE_WRITE_LINE_MEMBER(write_line_d0) override; diff --git a/src/mame/machine/kaneko_hit.cpp b/src/mame/machine/kaneko_hit.cpp index 763eed0c78b..b3112eec53f 100644 --- a/src/mame/machine/kaneko_hit.cpp +++ b/src/mame/machine/kaneko_hit.cpp @@ -40,13 +40,6 @@ kaneko_hit_device::kaneko_hit_device(const machine_config &mconfig, const char * } -void kaneko_hit_device::set_type(device_t &device, int hittype) -{ - kaneko_hit_device &dev = downcast(device); - dev.m_hittype = hittype; -} - - void kaneko_hit_device::device_start() { /* m_hit */ diff --git a/src/mame/machine/kaneko_hit.h b/src/mame/machine/kaneko_hit.h index 40f3355776a..c93d103a629 100644 --- a/src/mame/machine/kaneko_hit.h +++ b/src/mame/machine/kaneko_hit.h @@ -9,12 +9,16 @@ #include "machine/watchdog.h" +#define MCFG_KANEKO_HIT_TYPE(_type) \ + downcast(*device).set_type(_type); + + class kaneko_hit_device : public device_t { public: kaneko_hit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_type(device_t &device, int hittype); + void set_type(int hittype) { m_hittype = hittype; } int m_hittype; diff --git a/src/mame/machine/kaneko_toybox.cpp b/src/mame/machine/kaneko_toybox.cpp index 930573fbb70..23905f67dc6 100644 --- a/src/mame/machine/kaneko_toybox.cpp +++ b/src/mame/machine/kaneko_toybox.cpp @@ -383,18 +383,6 @@ kaneko_toybox_device::kaneko_toybox_device(const machine_config &mconfig, const m_mcu_com[0] = m_mcu_com[1] = m_mcu_com[2] = m_mcu_com[3] = 0; } -void kaneko_toybox_device::set_table(device_t &device, int tabletype) -{ - kaneko_toybox_device &dev = downcast(device); - dev.m_tabletype = tabletype; -} - -void kaneko_toybox_device::set_game_type(device_t &device, int gametype) -{ - kaneko_toybox_device &dev = downcast(device); - dev.m_gametype = gametype; -} - void kaneko_toybox_device::device_start() { memset(m_mcu_com, 0, 4 * sizeof( uint16_t) ); diff --git a/src/mame/machine/kaneko_toybox.h b/src/mame/machine/kaneko_toybox.h index 6d040ae1d76..ab15e75131c 100644 --- a/src/mame/machine/kaneko_toybox.h +++ b/src/mame/machine/kaneko_toybox.h @@ -17,8 +17,8 @@ public: kaneko_toybox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_table(device_t &device, int tabletype); - static void set_game_type(device_t &device, int gametype); + void set_table(int tabletype) { m_tabletype = tabletype; } + void set_game_type(int gametype) { m_gametype = gametype; } DECLARE_WRITE16_MEMBER(mcu_com0_w); DECLARE_WRITE16_MEMBER(mcu_com1_w); @@ -47,9 +47,9 @@ private: DECLARE_DEVICE_TYPE(KANEKO_TOYBOX, kaneko_toybox_device) #define MCFG_TOYBOX_TABLE_TYPE(_type) \ - kaneko_toybox_device::set_table(*device, kaneko_toybox_device::TABLE_##_type); + downcast(*device).set_table(kaneko_toybox_device::TABLE_##_type); #define MCFG_TOYBOX_GAME_TYPE(_type) \ - kaneko_toybox_device::set_game_type(*device, kaneko_toybox_device::GAME_##_type); + downcast(*device).set_game_type(kaneko_toybox_device::GAME_##_type); #endif // MAME_MACHINE_KANEKO_TOYBOX_H diff --git a/src/mame/machine/kay_kbd.h b/src/mame/machine/kay_kbd.h index 95a1128625e..689fdb1e32e 100644 --- a/src/mame/machine/kay_kbd.h +++ b/src/mame/machine/kay_kbd.h @@ -9,7 +9,7 @@ #define MCFG_KAYPRO10KBD_RXD_CB(cb) \ - devcb = &kaypro_10_keyboard_device::set_rxd_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_rxd_cb(DEVCB_##cb); class kaypro_10_keyboard_device : public device_t @@ -21,8 +21,7 @@ public: device_t *owner, std::uint32_t clock); - template static devcb_base &set_rxd_cb(device_t &device, Object &&cb) - { return downcast(device).m_rxd_cb.set_callback(std::forward(cb)); } + template devcb_base &set_rxd_cb(Object &&cb) { return m_rxd_cb.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(txd_w) { m_txd = state ? 1U : 0U; } diff --git a/src/mame/machine/kc_keyb.h b/src/mame/machine/kc_keyb.h index 726724df280..08d23773372 100644 --- a/src/mame/machine/kc_keyb.h +++ b/src/mame/machine/kc_keyb.h @@ -12,7 +12,7 @@ #pragma once #define MCFG_KC_KEYBOARD_OUT_CALLBACK(_write) \ - devcb = &kc_keyboard_device::set_out_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_out_wr_callback(DEVCB_##_write); /*************************************************************************** TYPE DEFINITIONS @@ -27,7 +27,7 @@ public: kc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~kc_keyboard_device(); - template static devcb_base &set_out_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_out.set_callback(std::forward(cb)); } + template devcb_base &set_out_wr_callback(Object &&cb) { return m_write_out.set_callback(std::forward(cb)); } // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/machine/km035.h b/src/mame/machine/km035.h index 188613b1074..aae0036c37c 100644 --- a/src/mame/machine/km035.h +++ b/src/mame/machine/km035.h @@ -18,10 +18,10 @@ //************************************************************************** #define MCFG_KM035_TX_HANDLER(_cb) \ - devcb = &km035_device::set_tx_handler(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_tx_handler(DEVCB_##_cb); #define MCFG_KM035_RTS_HANDLER(_cb) \ - devcb = &km035_device::set_rts_handler(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_rts_handler(DEVCB_##_cb); //************************************************************************** @@ -36,8 +36,8 @@ public: // construction/destruction km035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_tx_handler(device_t &device, _Object wr) { return downcast(device).m_tx_handler.set_callback(wr); } - template static devcb_base &set_rts_handler(device_t &device, _Object wr) { return downcast(device).m_rts_handler.set_callback(wr); } + template devcb_base &set_tx_handler(_Object wr) { return m_tx_handler.set_callback(wr); } + template devcb_base &set_rts_handler(_Object wr) { return m_rts_handler.set_callback(wr); } DECLARE_WRITE_LINE_MEMBER( write_rxd ); diff --git a/src/mame/machine/konppc.h b/src/mame/machine/konppc.h index 8ec5324e1bd..c1cf8eb0ab7 100644 --- a/src/mame/machine/konppc.h +++ b/src/mame/machine/konppc.h @@ -6,10 +6,10 @@ #pragma once #define MCFG_KONPPC_CGBOARD_NUMBER(_num) \ - konppc_device::static_set_num_boards(*device, _num); + downcast(*device).set_num_boards(_num); #define MCFG_KONPPC_CGBOARD_TYPE(_cgtype) \ - konppc_device::static_set_cbboard_type(*device, konppc_device::CGBOARD_TYPE_##_cgtype); + downcast(*device).set_cbboard_type(konppc_device::CGBOARD_TYPE_##_cgtype); class konppc_device : public device_t { @@ -25,8 +25,8 @@ public: // construction/destruction konppc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_num_boards(device_t &device, int num) { downcast(device).num_cgboards = num; } - static void static_set_cbboard_type(device_t &device, int cgtype) { downcast(device).cgboard_type = cgtype; } + void set_num_boards(int num) { num_cgboards = num; } + void set_cbboard_type(int cgtype) { cgboard_type = cgtype; } void set_cgboard_id(int board_id); int get_cgboard_id(void); diff --git a/src/mame/machine/m24_kbd.h b/src/mame/machine/m24_kbd.h index 529e4f9eaa4..cf3c7df39f4 100644 --- a/src/mame/machine/m24_kbd.h +++ b/src/mame/machine/m24_kbd.h @@ -8,14 +8,14 @@ #include "cpu/mcs48/mcs48.h" #define MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(_devcb) \ - devcb = &m24_keyboard_device::set_out_data_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_data_handler(DEVCB_##_devcb); class m24_keyboard_device : public device_t { public: m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_out_data_handler(device_t &device, Object &&cb) { return downcast(device).m_out_data.set_callback(std::forward(cb)); } + template devcb_base &set_out_data_handler(Object &&cb) { return m_out_data.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER(clock_w); DECLARE_WRITE_LINE_MEMBER(data_w); diff --git a/src/mame/machine/m24_z8000.h b/src/mame/machine/m24_z8000.h index d124764c669..970f5aa273c 100644 --- a/src/mame/machine/m24_z8000.h +++ b/src/mame/machine/m24_z8000.h @@ -11,14 +11,14 @@ #include "machine/pic8259.h" #define MCFG_M24_Z8000_HALT(_devcb) \ - devcb = &m24_z8000_device::set_halt_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_halt_callback(DEVCB_##_devcb); class m24_z8000_device : public device_t { public: m24_z8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_halt_callback(device_t &device, Object &&cb) { return downcast(device).m_halt_out.set_callback(std::forward(cb)); } + template devcb_base &set_halt_callback(Object &&cb) { return m_halt_out.set_callback(std::forward(cb)); } DECLARE_READ16_MEMBER(pmem_r); DECLARE_WRITE16_MEMBER(pmem_w); diff --git a/src/mame/machine/mackbd.h b/src/mame/machine/mackbd.h index ede2bc6c73c..b443cf0a056 100644 --- a/src/mame/machine/mackbd.h +++ b/src/mame/machine/mackbd.h @@ -21,10 +21,10 @@ MCFG_DEVICE_REMOVE(_tag) #define MCFG_MACKBD_CLKOUT_HANDLER(_devcb) \ - devcb = &mackbd_device::set_clkout_handler(*device, DEVCB_##_devcb); + devcb = downcast(*device).set_clkout_handler(DEVCB_##_devcb); #define MCFG_MACKBD_DATAOUT_HANDLER(_devcb) \ - devcb = &mackbd_device::set_dataout_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dataout_handler(DEVCB_##_devcb); //************************************************************************** // TYPE DEFINITIONS @@ -35,9 +35,9 @@ class mackbd_device : public device_t { public: - // static config helper - template static devcb_base &set_clkout_handler(device_t &device, _Object object) { return downcast(device).m_clkout_handler.set_callback(object); } - template static devcb_base &set_dataout_handler(device_t &device, _Object object) { return downcast(device).m_dataout_handler.set_callback(object); } + // config helper + template devcb_base &set_clkout_handler(_Object object) { return m_clkout_handler.set_callback(object); } + template devcb_base &set_dataout_handler(_Object object) { return m_dataout_handler.set_callback(object); } // construction/destruction mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/maple-dc.cpp b/src/mame/machine/maple-dc.cpp index 51f50520d26..6583d1d0353 100644 --- a/src/mame/machine/maple-dc.cpp +++ b/src/mame/machine/maple-dc.cpp @@ -16,18 +16,6 @@ ADDRESS_MAP_START(maple_dc_device::amap) AM_RANGE(0x8c, 0x8f) AM_WRITE(sb_mdapro_w) ADDRESS_MAP_END -void maple_dc_device::static_set_maincpu_tag(device_t &device, const char *maincpu_tag) -{ - maple_dc_device &maple_dc = downcast(device); - maple_dc.maincpu_tag = maincpu_tag; -} - -void maple_dc_device::static_set_irq_cb(device_t &device, void (*irq_cb)(running_machine &)) -{ - maple_dc_device &maple_dc = downcast(device); - maple_dc.irq_cb = irq_cb; -} - maple_dc_device::maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MAPLE_DC, tag, owner, clock) { diff --git a/src/mame/machine/maple-dc.h b/src/mame/machine/maple-dc.h index e43f79a6d89..860294e2d4f 100644 --- a/src/mame/machine/maple-dc.h +++ b/src/mame/machine/maple-dc.h @@ -9,8 +9,8 @@ #define MCFG_MAPLE_DC_ADD(_tag, _maincpu_tag, _irq_cb) \ MCFG_DEVICE_ADD(_tag, MAPLE_DC, 0) \ - maple_dc_device::static_set_maincpu_tag(*device, _maincpu_tag); \ - maple_dc_device::static_set_irq_cb(*device, _irq_cb); + downcast(*device).set_maincpu_tag(_maincpu_tag); \ + downcast(*device).set_irq_cb(_irq_cb); class maple_device; @@ -18,8 +18,8 @@ class maple_dc_device : public device_t { public: maple_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_maincpu_tag(device_t &device, const char *maincpu_tag); - static void static_set_irq_cb(device_t &device, void (*irq_cb)(running_machine &)); + void set_maincpu_tag(const char *new_maincpu_tag) { maincpu_tag = new_maincpu_tag; } + void set_irq_cb(void (*new_irq_cb)(running_machine &)) { irq_cb = new_irq_cb; } DECLARE_READ32_MEMBER(sb_mdstar_r); // 5f6c04 DECLARE_WRITE32_MEMBER(sb_mdstar_w); diff --git a/src/mame/machine/mapledev.cpp b/src/mame/machine/mapledev.cpp index 68144ee0f97..3ff8c096990 100644 --- a/src/mame/machine/mapledev.cpp +++ b/src/mame/machine/mapledev.cpp @@ -4,14 +4,6 @@ #include "mapledev.h" #include "maple-dc.h" -void maple_device::static_set_host(device_t &device, const char *_host_tag, int _host_port) -{ - maple_device &dev = downcast(device); - dev.host_tag = _host_tag; - dev.host_port = _host_port; -} - - maple_device::maple_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) { host_tag = nullptr; diff --git a/src/mame/machine/mapledev.h b/src/mame/machine/mapledev.h index 6d858fbd442..8dca02e8a63 100644 --- a/src/mame/machine/mapledev.h +++ b/src/mame/machine/mapledev.h @@ -5,12 +5,16 @@ #define MCFG_MAPLE_DEVICE_ADD(_tag, _type, _clock, _host_tag, _host_port) \ MCFG_DEVICE_ADD(_tag, _type, _clock) \ - maple_device::static_set_host(*device, _host_tag, _host_port); + downcast(*device).set_host(_host_tag, _host_port); class maple_device : public device_t { public: - static void static_set_host(device_t &device, const char *_host_tag, int _host_port); + void set_host(const char *_host_tag, int _host_port) + { + host_tag = _host_tag; + host_port = _host_port; + } virtual void maple_w(const uint32_t *data, uint32_t in_size) = 0; void maple_r(uint32_t *data, uint32_t &out_size, bool &partial); virtual void maple_reset(); diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp index 1ae6291a3cc..91f6a66ebb8 100644 --- a/src/mame/machine/mega32x.cpp +++ b/src/mame/machine/mega32x.cpp @@ -249,17 +249,6 @@ sega_32x_pal_device::sega_32x_pal_device(const machine_config &mconfig, const ch { } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void sega_32x_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast(device).m_palette.set_tag(tag); -} - - READ16_MEMBER( sega_32x_device::_32x_68k_palette_r ) { return m_32x_palette[offset]; diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h index 7679bd48276..e2f39c596dc 100644 --- a/src/mame/machine/mega32x.h +++ b/src/mame/machine/mega32x.h @@ -27,8 +27,8 @@ public: update_total_scanlines(mode3); } - // static configuration - static void static_set_palette_tag(device_t &device, const char *tag); + // configuration + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } DECLARE_READ32_MEMBER( _32x_sh2_master_4000_common_4002_r ); DECLARE_READ32_MEMBER( _32x_sh2_slave_4000_common_4002_r ); @@ -223,6 +223,6 @@ DECLARE_DEVICE_TYPE(SEGA_32X_NTSC, sega_32x_ntsc_device) DECLARE_DEVICE_TYPE(SEGA_32X_PAL, sega_32x_pal_device) #define MCFG_SEGA_32X_PALETTE(_palette_tag) \ - sega_32x_device::static_set_palette_tag(*device, "^" _palette_tag); + downcast(*device).set_palette_tag("^" _palette_tag); #endif // MAME_MACHINE_MEGA32X_H diff --git a/src/mame/machine/megacdcd.cpp b/src/mame/machine/megacdcd.cpp index 24b410a1ff3..32791449db3 100644 --- a/src/mame/machine/megacdcd.cpp +++ b/src/mame/machine/megacdcd.cpp @@ -161,36 +161,6 @@ void lc89510_temp_device::dummy_interrupt_callback(void) { } -void lc89510_temp_device::set_CDC_Do_DMA(device_t &device,segacd_dma_delegate new_segacd_dma_callback) -{ - lc89510_temp_device &dev = downcast(device); - dev.segacd_dma_callback = new_segacd_dma_callback; -} - -void lc89510_temp_device::set_type1_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback) -{ - lc89510_temp_device &dev = downcast(device); - dev.type1_interrupt_callback = interrupt_callback; -} - -void lc89510_temp_device::set_type2_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback) -{ - lc89510_temp_device &dev = downcast(device); - dev.type2_interrupt_callback = interrupt_callback; -} - -void lc89510_temp_device::set_type3_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback) -{ - lc89510_temp_device &dev = downcast(device); - dev.type3_interrupt_callback = interrupt_callback; -} - -void lc89510_temp_device::set_is_neoCD(device_t &device, bool is_neoCD) -{ - lc89510_temp_device &dev = downcast(device); - dev.is_neoCD = is_neoCD; -} - // HACK for DMA handling, this gets replaced void lc89510_temp_device::Fake_CDC_Do_DMA(int &dmacount, uint8_t *CDC_BUFFER, uint16_t &dma_addrc, uint16_t &destination ) { diff --git a/src/mame/machine/megacdcd.h b/src/mame/machine/megacdcd.h index a909b87fa02..2b10feb7b2f 100644 --- a/src/mame/machine/megacdcd.h +++ b/src/mame/machine/megacdcd.h @@ -13,26 +13,26 @@ typedef device_delegate segacd_dma_ typedef device_delegate interrupt_delegate; #define MCFG_SEGACD_HACK_SET_CDC_DO_DMA( _class, _method) \ - lc89510_temp_device::set_CDC_Do_DMA(*device, segacd_dma_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_CDC_Do_DMA(segacd_dma_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_SEGACD_HACK_SET_NEOCD \ - lc89510_temp_device::set_is_neoCD(*device, true); + downcast(*device).set_is_neoCD(true); #define MCFG_SET_TYPE1_INTERRUPT_CALLBACK( _class, _method) \ - lc89510_temp_device::set_type1_interrupt_callback(*device, interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_type1_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_SET_TYPE2_INTERRUPT_CALLBACK( _class, _method) \ - lc89510_temp_device::set_type2_interrupt_callback(*device, interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_type2_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_SET_TYPE3_INTERRUPT_CALLBACK( _class, _method) \ - lc89510_temp_device::set_type3_interrupt_callback(*device, interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); + downcast(*device).set_type3_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); class lc89510_temp_device : public device_t { public: - static void set_is_neoCD(device_t &device, bool is_neoCD); + void set_is_neoCD(bool new_is_neoCD) { is_neoCD = new_is_neoCD; } - static void set_type1_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback); - static void set_type2_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback); - static void set_type3_interrupt_callback(device_t &device,interrupt_delegate interrupt_callback); + void set_type1_interrupt_callback(interrupt_delegate interrupt_callback) { type1_interrupt_callback = interrupt_callback; } + void set_type2_interrupt_callback(interrupt_delegate interrupt_callback) { type2_interrupt_callback = interrupt_callback; } + void set_type3_interrupt_callback(interrupt_delegate interrupt_callback) { type3_interrupt_callback = interrupt_callback; } - static void set_CDC_Do_DMA(device_t &device,segacd_dma_delegate new_segacd_dma_callback); + void set_CDC_Do_DMA(segacd_dma_delegate new_segacd_dma_callback) { segacd_dma_callback = new_segacd_dma_callback; } lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h index 069f4e37d87..ced4d175223 100644 --- a/src/mame/machine/microdrv.h +++ b/src/mame/machine/microdrv.h @@ -28,7 +28,7 @@ MCFG_DEVICE_ADD(_tag, MICRODRIVE, 0) #define MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(_write) \ - devcb = µdrive_image_device::set_comms_out_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_comms_out_wr_callback(DEVCB_##_write); @@ -46,7 +46,7 @@ public: microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~microdrive_image_device(); - template static devcb_base &set_comms_out_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_comms_out.set_callback(std::forward(cb)); } + template devcb_base &set_comms_out_wr_callback(Object &&cb) { return m_write_comms_out.set_callback(std::forward(cb)); } // image-level overrides virtual image_init_result call_load() override; diff --git a/src/mame/machine/micropolis.h b/src/mame/machine/micropolis.h index 9ee893c1cdd..7474e77cbaf 100644 --- a/src/mame/machine/micropolis.h +++ b/src/mame/machine/micropolis.h @@ -22,19 +22,19 @@ ***************************************************************************/ #define MCFG_MICROPOLIS_DRIVE_TAGS(_tag1, _tag2, _tag3, _tag4) \ - micropolis_device::set_drive_tags(*device, _tag1, _tag2, _tag3, _tag4); + downcast(*device).set_drive_tags(_tag1, _tag2, _tag3, _tag4); #define MCFG_MICROPOLIS_DEFAULT_DRIVE4_TAGS \ MCFG_MICROPOLIS_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3) #define MCFG_MICROPOLIS_DDEN_CALLBACK(_read) \ - devcb = µpolis_device::set_dden_rd_callback(*device, DEVCB_##_read); + devcb = &downcast(*device).set_dden_rd_callback(DEVCB_##_read); #define MCFG_MICROPOLIS_INTRQ_CALLBACK(_write) \ - devcb = µpolis_device::set_intrq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_intrq_wr_callback(DEVCB_##_write); #define MCFG_MICROPOLIS_DRQ_CALLBACK(_write) \ - devcb = µpolis_device::set_drq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_drq_wr_callback(DEVCB_##_write); /*************************************************************************** MACROS @@ -45,17 +45,16 @@ class micropolis_device : public device_t public: micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_dden_rd_callback(device_t &device, Object &&cb) { return downcast(device).m_read_dden.set_callback(std::forward(cb)); } - template static devcb_base &set_intrq_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_intrq.set_callback(std::forward(cb)); } - template static devcb_base &set_drq_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_drq.set_callback(std::forward(cb)); } + template devcb_base &set_dden_rd_callback(Object &&cb) { return m_read_dden.set_callback(std::forward(cb)); } + template devcb_base &set_intrq_wr_callback(Object &&cb) { return m_write_intrq.set_callback(std::forward(cb)); } + template devcb_base &set_drq_wr_callback(Object &&cb) { return m_write_drq.set_callback(std::forward(cb)); } - static void set_drive_tags(device_t &device, const char *tag1, const char *tag2, const char *tag3, const char *tag4) + void set_drive_tags(const char *tag1, const char *tag2, const char *tag3, const char *tag4) { - micropolis_device &dev = downcast(device); - dev.m_floppy_drive_tags[0] = tag1; - dev.m_floppy_drive_tags[1] = tag2; - dev.m_floppy_drive_tags[2] = tag3; - dev.m_floppy_drive_tags[3] = tag4; + m_floppy_drive_tags[0] = tag1; + m_floppy_drive_tags[1] = tag2; + m_floppy_drive_tags[2] = tag3; + m_floppy_drive_tags[3] = tag4; } void set_drive(uint8_t drive); // set current drive (0-3) diff --git a/src/mame/machine/midikbd.h b/src/mame/machine/midikbd.h index 2d1e81f4dcc..ea7c69f9cef 100644 --- a/src/mame/machine/midikbd.h +++ b/src/mame/machine/midikbd.h @@ -8,7 +8,7 @@ #define MCFG_MIDI_KBD_ADD(_tag, _devcb, _clock) \ MCFG_DEVICE_ADD(_tag, MIDI_KBD, _clock) \ - devcb = &midi_keyboard_device::static_set_tx_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_tx_callback(DEVCB_##_devcb); class midi_keyboard_device : public device_t, public device_serial_interface { @@ -16,7 +16,7 @@ public: midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ioport_constructor device_input_ports() const override; - template static devcb_base &static_set_tx_callback(device_t &device, Object &&cb) { return downcast(device).m_out_tx_func.set_callback(std::forward(cb)); } + template devcb_base &set_tx_callback(Object &&cb) { return m_out_tx_func.set_callback(std::forward(cb)); } protected: void device_start() override; diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h index 1a55043cd65..e682f9d451c 100644 --- a/src/mame/machine/midwayic.h +++ b/src/mame/machine/midwayic.h @@ -23,7 +23,7 @@ public: // construction/destruction midway_serial_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_upper(device_t &device, int upper) { downcast(device).m_upper = upper; } + void set_upper(int upper) { m_upper = upper; } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -54,7 +54,7 @@ private: DECLARE_DEVICE_TYPE(MIDWAY_SERIAL_PIC, midway_serial_pic_device) #define MCFG_MIDWAY_SERIAL_PIC_UPPER(_upper) \ - midway_serial_pic_device::static_set_upper(*device, _upper); + downcast(*device).set_upper(_upper); /* 1st generation Midway serial PIC - emulation */ @@ -96,7 +96,7 @@ public: // construction/destruction midway_serial_pic2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_yearoffs(device_t &device, int yearoffs) { downcast(device).m_yearoffs = yearoffs; } + void set_yearoffs(int yearoffs) { m_yearoffs = yearoffs; } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -143,7 +143,7 @@ DECLARE_DEVICE_TYPE(MIDWAY_SERIAL_PIC2, midway_serial_pic2_device) #define MCFG_MIDWAY_SERIAL_PIC2_UPPER MCFG_MIDWAY_SERIAL_PIC_UPPER #define MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(_yearoffs) \ - midway_serial_pic2_device::static_set_yearoffs(*device, _yearoffs); + downcast(*device).set_yearoffs(_yearoffs); /* I/O ASIC connected to 2nd generation PIC */ @@ -155,12 +155,12 @@ public: // construction/destruction midway_ioasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_shuffle(device_t &device, uint8_t shuffle) { downcast(device).m_shuffle_type = shuffle; } - static void static_set_shuffle_default(device_t &device, uint8_t shuffle) { downcast(device).m_shuffle_default = shuffle; } - static void static_set_auto_ack(device_t &device, uint8_t auto_ack) { downcast(device).m_auto_ack = auto_ack; } - template static devcb_base &set_irqhandler_callback(device_t &device, _Object object) { return downcast(device).m_irq_callback.set_callback(object); } - template static devcb_base &set_serial_tx_callback(device_t &device, _Object object) { return downcast(device).m_serial_tx_cb.set_callback(object); } - template static devcb_base &set_aux_output_callback(device_t &device, _Object object) { return downcast(device).m_aux_output_cb.set_callback(object); } + void set_shuffle(uint8_t shuffle) { m_shuffle_type = shuffle; } + void set_shuffle_default(uint8_t shuffle) { m_shuffle_default = shuffle; } + void set_auto_ack(uint8_t auto_ack) { m_auto_ack = auto_ack; } + template devcb_base &set_irqhandler_callback(_Object object) { return m_irq_callback.set_callback(object); } + template devcb_base &set_serial_tx_callback(_Object object) { return m_serial_tx_cb.set_callback(object); } + template devcb_base &set_aux_output_callback(_Object object) { return m_aux_output_cb.set_callback(object); } void set_shuffle_state(int state); void fifo_w(uint16_t data); @@ -228,22 +228,22 @@ DECLARE_DEVICE_TYPE(MIDWAY_IOASIC, midway_ioasic_device) #define MCFG_MIDWAY_IOASIC_YEAR_OFFS MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS #define MCFG_MIDWAY_IOASIC_SHUFFLE(_shuffle) \ - midway_ioasic_device::static_set_shuffle(*device, _shuffle); + downcast(*device).set_shuffle(_shuffle); #define MCFG_MIDWAY_IOASIC_SHUFFLE_DEFAULT(_shuffle) \ - midway_ioasic_device::static_set_shuffle_default(*device, _shuffle); + downcast(*device).set_shuffle_default(_shuffle); #define MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(_write) \ - devcb = &midway_ioasic_device::set_irqhandler_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_irqhandler_callback(DEVCB_##_write); #define MCFG_MIDWAY_IOASIC_AUTO_ACK(_ack) \ - midway_ioasic_device::static_set_auto_ack(*device, _ack); + downcast(*device).set_auto_ack(_ack); #define MCFG_MIDWAY_IOASIC_OUT_TX_CB(_devcb) \ - devcb = &midway_ioasic_device::set_serial_tx_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_serial_tx_callback(DEVCB_##_devcb); #define MCFG_MIDWAY_IOASIC_AUX_OUT_CB(_devcb) \ - devcb = &midway_ioasic_device::set_aux_output_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_aux_output_callback(DEVCB_##_devcb); enum diff --git a/src/mame/machine/mie.cpp b/src/mame/machine/mie.cpp index 6580f8af236..cd10ac7786f 100644 --- a/src/mame/machine/mie.cpp +++ b/src/mame/machine/mie.cpp @@ -58,18 +58,6 @@ ROM_START( mie ) ROM_LOAD( "315-6146.bin", 0x000, 0x800, CRC(9b197e35) SHA1(864d14d58732dd4e2ee538ccc71fa8df7013ba06)) ROM_END -void mie_device::static_set_gpio_name(device_t &device, int entry, const char *name) -{ - mie_device &mie = downcast(device); - mie.gpio_name[entry] = name; -} - -void mie_device::static_set_jvs_name(device_t &device, const char *name) -{ - mie_device &mie = downcast(device); - mie.jvs_name = name; -} - const tiny_rom_entry *mie_device::device_rom_region() const { return ROM_NAME(mie); diff --git a/src/mame/machine/mie.h b/src/mame/machine/mie.h index e094fd9c839..bb27602cd06 100644 --- a/src/mame/machine/mie.h +++ b/src/mame/machine/mie.h @@ -13,15 +13,15 @@ #define MCFG_MIE_ADD(_tag, _clock, _host_tag, _host_port, g0, g1, g2, g3, g4, g5, g6, g7) \ MCFG_MAPLE_DEVICE_ADD(_tag "_maple", MIE, _clock, _host_tag, _host_port) \ - mie_device::static_set_gpio_name(*device, 0, g0); \ - mie_device::static_set_gpio_name(*device, 1, g1); \ - mie_device::static_set_gpio_name(*device, 2, g2); \ - mie_device::static_set_gpio_name(*device, 3, g3); \ - mie_device::static_set_gpio_name(*device, 4, g4); \ - mie_device::static_set_gpio_name(*device, 5, g5); \ - mie_device::static_set_gpio_name(*device, 6, g6); \ - mie_device::static_set_gpio_name(*device, 7, g7); \ - mie_device::static_set_jvs_name(*device, _tag); \ + downcast(*device).set_gpio_name(0, g0); \ + downcast(*device).set_gpio_name(1, g1); \ + downcast(*device).set_gpio_name(2, g2); \ + downcast(*device).set_gpio_name(3, g3); \ + downcast(*device).set_gpio_name(4, g4); \ + downcast(*device).set_gpio_name(5, g5); \ + downcast(*device).set_gpio_name(6, g6); \ + downcast(*device).set_gpio_name(7, g7); \ + downcast(*device).set_jvs_name(_tag); \ MCFG_DEVICE_ADD(_tag, MIE_JVS, _clock) class mie_jvs_device; @@ -33,8 +33,8 @@ class mie_device : public maple_device public: mie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_gpio_name(device_t &device, int entry, const char *name); - static void static_set_jvs_name(device_t &device, const char *name); + void set_gpio_name(int entry, const char *name) { gpio_name[entry] = name; } + void set_jvs_name(const char *name) { jvs_name = name; } DECLARE_READ8_MEMBER(control_r); DECLARE_WRITE8_MEMBER(control_w); diff --git a/src/mame/machine/mm1kb.h b/src/mame/machine/mm1kb.h index a6531c5015d..9cf08ecd942 100644 --- a/src/mame/machine/mm1kb.h +++ b/src/mame/machine/mm1kb.h @@ -20,7 +20,7 @@ //************************************************************************** #define MCFG_MM1_KEYBOARD_KBST_CALLBACK(_write) \ - devcb = &mm1_keyboard_device::set_kbst_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_kbst_wr_callback(DEVCB_##_write); @@ -36,7 +36,7 @@ public: // construction/destruction mm1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_kbst_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_kbst.set_callback(std::forward(cb)); } + template devcb_base &set_kbst_wr_callback(Object &&cb) { return m_write_kbst.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ) { return m_data; } diff --git a/src/mame/machine/mmboard.h b/src/mame/machine/mmboard.h index c8dc722bc4a..ec3e4cdd9dc 100644 --- a/src/mame/machine/mmboard.h +++ b/src/mame/machine/mmboard.h @@ -29,7 +29,7 @@ MCFG_DEVICE_ADD(_tag, MEPHISTO_BUTTONS_BOARD, 0) \ #define MCFG_MEPHISTO_BOARD_DISABLE_LEDS(_val) \ - mephisto_board_device::static_set_disable_leds(*device, _val); + downcast(*device).set_disable_leds(_val); #define MCFG_MEPHISTO_DISPLAY_MODUL_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, MEPHISTO_DISPLAY_MODUL, 0) @@ -47,8 +47,8 @@ public: // construction/destruction mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - static void static_set_disable_leds(device_t &device, int _disable_leds) { mephisto_board_device &dev=downcast(device); dev.m_disable_leds = _disable_leds; } + // configuration helpers + void set_disable_leds(int _disable_leds) { m_disable_leds = _disable_leds; } DECLARE_READ8_MEMBER(input_r); DECLARE_WRITE8_MEMBER(led_w); diff --git a/src/mame/machine/ms7004.h b/src/mame/machine/ms7004.h index 8d5eced803b..78452904777 100644 --- a/src/mame/machine/ms7004.h +++ b/src/mame/machine/ms7004.h @@ -19,10 +19,10 @@ //************************************************************************** #define MCFG_MS7004_TX_HANDLER(_cb) \ - devcb = &ms7004_device::set_tx_handler(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_tx_handler(DEVCB_##_cb); #define MCFG_MS7004_RTS_HANDLER(_cb) \ - devcb = &ms7004_device::set_rts_handler(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_rts_handler(DEVCB_##_cb); //************************************************************************** @@ -37,8 +37,8 @@ public: // construction/destruction ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_tx_handler(device_t &device, Object &&wr) { return downcast(device).m_tx_handler.set_callback(std::forward(wr)); } - template static devcb_base &set_rts_handler(device_t &device, Object &&wr) { return downcast(device).m_rts_handler.set_callback(std::forward(wr)); } + template devcb_base &set_tx_handler(Object &&wr) { return m_tx_handler.set_callback(std::forward(wr)); } + template devcb_base &set_rts_handler(Object &&wr) { return m_rts_handler.set_callback(std::forward(wr)); } DECLARE_WRITE_LINE_MEMBER( write_rxd ); diff --git a/src/mame/machine/msx_matsushita.h b/src/mame/machine/msx_matsushita.h index 8daad1a006b..8e155e2b399 100644 --- a/src/mame/machine/msx_matsushita.h +++ b/src/mame/machine/msx_matsushita.h @@ -14,7 +14,7 @@ DECLARE_DEVICE_TYPE(MSX_MATSUSHITA, msx_matsushita_device) MCFG_DEVICE_ADD(_tag, MSX_MATSUSHITA, 0) #define MCFG_MSX_MATSUSHITA_TURBO_CB(_devcb) \ - devcb = &msx_matsushita_device::set_turbo_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_turbo_callback(DEVCB_##_devcb); class msx_matsushita_device : public device_t, @@ -24,8 +24,7 @@ class msx_matsushita_device : public device_t, public: msx_matsushita_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_turbo_callback(device_t &device, Object &&cb) - { return downcast(device).m_turbo_out_cb.set_callback(std::forward(cb)); } + template devcb_base &set_turbo_callback(Object &&cb) { return m_turbo_out_cb.set_callback(std::forward(cb)); } virtual DECLARE_READ8_MEMBER(switched_read) override; virtual DECLARE_WRITE8_MEMBER(switched_write) override; diff --git a/src/mame/machine/msx_systemflags.h b/src/mame/machine/msx_systemflags.h index aacb60187a0..60ad9bf552d 100644 --- a/src/mame/machine/msx_systemflags.h +++ b/src/mame/machine/msx_systemflags.h @@ -14,7 +14,7 @@ DECLARE_DEVICE_TYPE(MSX_SYSTEMFLAGS, msx_systemflags_device) #define MCFG_MSX_SYSTEMFLAGS_ADD(_tag, _initial_value) \ MCFG_DEVICE_ADD(_tag, MSX_SYSTEMFLAGS, 0) \ - msx_systemflags_device::set_initial_value(*device, _initial_value); + downcast(*device).set_initial_value(_initial_value); class msx_systemflags_device : public device_t @@ -22,8 +22,8 @@ class msx_systemflags_device : public device_t public: msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - static void set_initial_value(device_t &device, uint8_t initial_value) { dynamic_cast(device).m_initial_value = initial_value; } + // configuration helpers + void set_initial_value(uint8_t initial_value) { m_initial_value = initial_value; } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); diff --git a/src/mame/machine/namco06.h b/src/mame/machine/namco06.h index 9b2af7522ad..da58638d10a 100644 --- a/src/mame/machine/namco06.h +++ b/src/mame/machine/namco06.h @@ -20,45 +20,45 @@ struct namco_06xx_config MCFG_DEVICE_ADD(_tag, NAMCO_06XX, _clock) #define MCFG_NAMCO_06XX_MAINCPU(_tag) \ - namco_06xx_device::set_maincpu(*device, "^" _tag); + downcast(*device).set_maincpu("^" _tag); #define MCFG_NAMCO_06XX_READ_0_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_1_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_2_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_3_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_REQUEST_0_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_request_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_request_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_REQUEST_1_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_request_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_request_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_REQUEST_2_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_request_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_request_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_READ_REQUEST_3_CB(_devcb) \ - devcb = &namco_06xx_device::set_read_request_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_request_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_WRITE_0_CB(_devcb) \ - devcb = &namco_06xx_device::set_write_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_WRITE_1_CB(_devcb) \ - devcb = &namco_06xx_device::set_write_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_WRITE_2_CB(_devcb) \ - devcb = &namco_06xx_device::set_write_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_06XX_WRITE_3_CB(_devcb) \ - devcb = &namco_06xx_device::set_write_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_callback<3>(DEVCB_##_devcb); /* device get info callback */ @@ -67,13 +67,13 @@ class namco_06xx_device : public device_t public: namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_maincpu(device_t &device, const char *tag) { downcast(device).m_nmicpu.set_tag(tag); } + void set_maincpu(const char *tag) { m_nmicpu.set_tag(tag); } - template static devcb_base &set_read_callback(device_t &device, Object &&cb) { return downcast(device).m_read[N].set_callback(std::forward(cb)); } + template devcb_base &set_read_callback(Object &&cb) { return m_read[N].set_callback(std::forward(cb)); } - template static devcb_base &set_read_request_callback(device_t &device, Object &&cb) { return downcast(device).m_readreq[N].set_callback(std::forward(cb)); } + template devcb_base &set_read_request_callback(Object &&cb) { return m_readreq[N].set_callback(std::forward(cb)); } - template static devcb_base &set_write_callback(device_t &device, Object &&cb) { return downcast(device).m_write[N].set_callback(std::forward(cb)); } + template devcb_base &set_write_callback(Object &&cb) { return m_write[N].set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); diff --git a/src/mame/machine/namco51.h b/src/mame/machine/namco51.h index c1f0a1d66f8..edb868f14de 100644 --- a/src/mame/machine/namco51.h +++ b/src/mame/machine/namco51.h @@ -12,31 +12,31 @@ MCFG_DEVICE_ADD(_tag, NAMCO_51XX, _clock) #define MCFG_NAMCO_51XX_INPUT_0_CB(_devcb) \ - devcb = &namco_51xx_device::set_input_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_51XX_INPUT_1_CB(_devcb) \ - devcb = &namco_51xx_device::set_input_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_51XX_INPUT_2_CB(_devcb) \ - devcb = &namco_51xx_device::set_input_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_51XX_INPUT_3_CB(_devcb) \ - devcb = &namco_51xx_device::set_input_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO_51XX_OUTPUT_0_CB(_devcb) \ - devcb = &namco_51xx_device::set_output_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_51XX_OUTPUT_1_CB(_devcb) \ - devcb = &namco_51xx_device::set_output_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_callback<1>(DEVCB_##_devcb); class namco_51xx_device : public device_t { public: namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_input_callback(device_t &device, Object &&cb) { return downcast(device).m_in[N].set_callback(std::forward(cb)); } + template devcb_base &set_input_callback(Object &&cb) { return m_in[N].set_callback(std::forward(cb)); } - template static devcb_base &set_output_callback(device_t &device, Object &&cb) { return downcast(device).m_out[N].set_callback(std::forward(cb)); } + template devcb_base &set_output_callback(Object &&cb) { return m_out[N].set_callback(std::forward(cb)); } DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); diff --git a/src/mame/machine/namco53.h b/src/mame/machine/namco53.h index f6c3c66aef2..7b8852bc738 100644 --- a/src/mame/machine/namco53.h +++ b/src/mame/machine/namco53.h @@ -11,22 +11,22 @@ MCFG_DEVICE_ADD(_tag, NAMCO_53XX, _clock) #define MCFG_NAMCO_53XX_K_CB(_devcb) \ - devcb = &namco_53xx_device::set_k_port_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_k_port_callback(DEVCB_##_devcb); #define MCFG_NAMCO_53XX_INPUT_0_CB(_devcb) \ - devcb = &namco_53xx_device::set_input_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_53XX_INPUT_1_CB(_devcb) \ - devcb = &namco_53xx_device::set_input_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_53XX_INPUT_2_CB(_devcb) \ - devcb = &namco_53xx_device::set_input_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_53XX_INPUT_3_CB(_devcb) \ - devcb = &namco_53xx_device::set_input_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO_53XX_P_CB(_devcb) \ - devcb = &namco_53xx_device::set_p_port_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_p_port_callback(DEVCB_##_devcb); class namco_53xx_device : public device_t @@ -34,10 +34,10 @@ class namco_53xx_device : public device_t public: namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_input_callback(device_t &device, Object &&cb) { return downcast(device).m_in[N].set_callback(std::forward(cb)); } + template devcb_base &set_input_callback(Object &&cb) { return m_in[N].set_callback(std::forward(cb)); } - template static devcb_base &set_k_port_callback(device_t &device, Object &&cb) { return downcast(device).m_k.set_callback(std::forward(cb)); } - template static devcb_base &set_p_port_callback(device_t &device, Object &&cb) { return downcast(device).m_p.set_callback(std::forward(cb)); } + template devcb_base &set_k_port_callback(Object &&cb) { return m_k.set_callback(std::forward(cb)); } + template devcb_base &set_p_port_callback(Object &&cb) { return m_p.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( K_r ); DECLARE_READ8_MEMBER( R0_r ); diff --git a/src/mame/machine/namco62.h b/src/mame/machine/namco62.h index c2b882c29a1..c4bffda3ab9 100644 --- a/src/mame/machine/namco62.h +++ b/src/mame/machine/namco62.h @@ -9,22 +9,22 @@ MCFG_DEVICE_ADD(_tag, NAMCO_62XX, _clock) #define MCFG_NAMCO_62XX_INPUT_0_CB(_devcb) \ - devcb = &namco_62xx_device::set_input_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_62XX_INPUT_1_CB(_devcb) \ - devcb = &namco_62xx_device::set_input_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO_62XX_INPUT_2_CB(_devcb) \ - devcb = &namco_62xx_device::set_input_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO_62XX_INPUT_3_CB(_devcb) \ - devcb = &namco_62xx_device::set_input_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO_62XX_OUTPUT_0_CB(_devcb) \ - devcb = &namco_62xx_device::set_output_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO_62XX_OUTPUT_1_CB(_devcb) \ - devcb = &namco_62xx_device::set_output_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_callback<1>(DEVCB_##_devcb); class namco_62xx_device : public device_t @@ -32,9 +32,9 @@ class namco_62xx_device : public device_t public: namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_input_callback(device_t &device, Object &&cb) { return downcast(device).m_in[N].set_callback(std::forward(cb)); } + template devcb_base &set_input_callback(Object &&cb) { return m_in[N].set_callback(std::forward(cb)); } - template static devcb_base &set_output_callback(device_t &device, Object &&cb) { return downcast(device).m_out[N].set_callback(std::forward(cb)); } + template devcb_base &set_output_callback(Object &&cb) { return m_out[N].set_callback(std::forward(cb)); } protected: // device-level overrides diff --git a/src/mame/machine/namco_c148.h b/src/mame/machine/namco_c148.h index fe8e47e4500..d595799a77b 100644 --- a/src/mame/machine/namco_c148.h +++ b/src/mame/machine/namco_c148.h @@ -19,13 +19,16 @@ #define MCFG_NAMCO_C148_ADD(_tag, _cputag, _cpumaster) \ MCFG_DEVICE_ADD(_tag, NAMCO_C148, 0) \ - namco_c148_device::configure_device(*device, _cputag, _cpumaster); + downcast(*device).configure_device(_cputag, _cpumaster); + +#define MCFG_NAMCO_C148_LINK(_tag) \ + downcast(*device).link_c148_device(_tag); #define MCFG_NAMCO_C148_EXT1_CB(_cb) \ - devcb = &namco_c148_device::set_out_ext1_callback(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_out_ext1_callback(DEVCB_##_cb); #define MCFG_NAMCO_C148_EXT2_CB(_cb) \ - devcb = &namco_c148_device::set_out_ext2_callback(*device, DEVCB_##_cb); + devcb = &downcast(*device).set_out_ext2_callback(DEVCB_##_cb); //************************************************************************** @@ -42,22 +45,16 @@ public: void map(address_map &map); - static void configure_device(device_t &device, const char *tag, bool is_master) + void configure_device(const char *tag, bool is_master) { - namco_c148_device &dev = downcast(device); - dev.m_hostcpu_tag = tag; - dev.m_hostcpu_master = is_master; + m_hostcpu_tag = tag; + m_hostcpu_master = is_master; } - static void link_c148_device(device_t &device, const char *tag) - { - namco_c148_device &dev = downcast(device); - - dev.m_linked_c148_tag = tag; - } + void link_c148_device(const char *tag) { m_linked_c148_tag = tag; } - template static devcb_base &set_out_ext1_callback(device_t &device, _Object object) { return downcast(device).m_out_ext1_cb.set_callback(object); } - template static devcb_base &set_out_ext2_callback(device_t &device, _Object object) { return downcast(device).m_out_ext2_cb.set_callback(object); } + template devcb_base &set_out_ext1_callback(_Object object) { return m_out_ext1_cb.set_callback(object); } + template devcb_base &set_out_ext2_callback(_Object object) { return m_out_ext2_cb.set_callback(object); } devcb_write8 m_out_ext1_cb; devcb_write8 m_out_ext2_cb; diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h index 2dece40ec90..a0fd950369e 100644 --- a/src/mame/machine/namcoio.h +++ b/src/mame/machine/namcoio.h @@ -11,8 +11,8 @@ class namcoio_device : public device_t { public: - template static devcb_base &set_in_callback(device_t &device, Object &&cb) { return downcast(device).m_in_cb[N].set_callback(std::forward(cb)); } - template static devcb_base &set_out_callback(device_t &device, Object &&cb) { return downcast(device).m_out_cb[N].set_callback(std::forward(cb)); } + template devcb_base &set_in_callback(Object &&cb) { return m_in_cb[N].set_callback(std::forward(cb)); } + template devcb_base &set_out_callback(Object &&cb) { return m_out_cb[N].set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ); @@ -89,59 +89,59 @@ DECLARE_DEVICE_TYPE(NAMCO_59XX, namco59xx_device) ***************************************************************************/ #define MCFG_NAMCO56XX_IN_0_CB(_devcb) \ - devcb = &namco56xx_device::set_in_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO56XX_IN_1_CB(_devcb) \ - devcb = &namco56xx_device::set_in_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO56XX_IN_2_CB(_devcb) \ - devcb = &namco56xx_device::set_in_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO56XX_IN_3_CB(_devcb) \ - devcb = &namco56xx_device::set_in_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO56XX_OUT_0_CB(_devcb) \ - devcb = &namco56xx_device::set_out_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO56XX_OUT_1_CB(_devcb) \ - devcb = &namco56xx_device::set_out_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_IN_0_CB(_devcb) \ - devcb = &namco58xx_device::set_in_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_IN_1_CB(_devcb) \ - devcb = &namco58xx_device::set_in_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_IN_2_CB(_devcb) \ - devcb = &namco58xx_device::set_in_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_IN_3_CB(_devcb) \ - devcb = &namco58xx_device::set_in_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_OUT_0_CB(_devcb) \ - devcb = &namco58xx_device::set_out_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO58XX_OUT_1_CB(_devcb) \ - devcb = &namco58xx_device::set_out_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_IN_0_CB(_devcb) \ - devcb = &namco59xx_device::set_in_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_IN_1_CB(_devcb) \ - devcb = &namco59xx_device::set_in_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<1>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_IN_2_CB(_devcb) \ - devcb = &namco59xx_device::set_in_callback<2>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<2>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_IN_3_CB(_devcb) \ - devcb = &namco59xx_device::set_in_callback<3>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_callback<3>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_OUT_0_CB(_devcb) \ - devcb = &namco59xx_device::set_out_callback<0>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<0>(DEVCB_##_devcb); #define MCFG_NAMCO59XX_OUT_1_CB(_devcb) \ - devcb = &namco59xx_device::set_out_callback<1>(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_callback<1>(DEVCB_##_devcb); #endif // MAME_MACHINE_NAMCOIO_H diff --git a/src/mame/machine/naomibd.cpp b/src/mame/machine/naomibd.cpp index 47bee977fa9..0d9a9b29b0b 100644 --- a/src/mame/machine/naomibd.cpp +++ b/src/mame/machine/naomibd.cpp @@ -79,13 +79,6 @@ naomi_board::naomi_board(const machine_config &mconfig, device_type type, const eeprom_tag = nullptr; } -void naomi_board::static_set_eeprom_tag(device_t &device, const char *_eeprom_tag) -{ - naomi_board &dev = downcast(device); - dev.eeprom_tag = _eeprom_tag; -} - - void naomi_board::device_start() { naomi_g1_device::device_start(); diff --git a/src/mame/machine/naomibd.h b/src/mame/machine/naomibd.h index aa61334873b..046cecca7f6 100644 --- a/src/mame/machine/naomibd.h +++ b/src/mame/machine/naomibd.h @@ -10,12 +10,12 @@ #define MCFG_NAOMI_BOARD_ADD(_tag, type, _eeprom_tag, _irq_cb) \ MCFG_NAOMI_G1_ADD(_tag, type, _irq_cb) \ - naomi_board::static_set_eeprom_tag(*device, _eeprom_tag); + downcast(*device).set_eeprom_tag(_eeprom_tag); class naomi_board : public naomi_g1_device { public: - static void static_set_eeprom_tag(device_t &device, const char *_eeprom_tag); + void set_eeprom_tag(const char *_eeprom_tag) { eeprom_tag = _eeprom_tag; } // Can be patched in the underlying class virtual void submap(address_map &map); diff --git a/src/mame/machine/naomigd.cpp b/src/mame/machine/naomigd.cpp index 2327e4def75..9c41ae21f9a 100644 --- a/src/mame/machine/naomigd.cpp +++ b/src/mame/machine/naomigd.cpp @@ -407,13 +407,6 @@ naomi_gdrom_board::naomi_gdrom_board(const machine_config &mconfig, const char * pic_tag = nullptr; } -void naomi_gdrom_board::static_set_tags(device_t &device, const char *_image_tag, const char *_pic_tag) -{ - naomi_gdrom_board &dev = downcast(device); - dev.image_tag = _image_tag; - dev.pic_tag = _pic_tag; -} - void naomi_gdrom_board::find_file(const char *name, const uint8_t *dir_sector, uint32_t &file_start, uint32_t &file_size) { file_start = 0; diff --git a/src/mame/machine/naomigd.h b/src/mame/machine/naomigd.h index 8408cbd3295..4736d274b66 100644 --- a/src/mame/machine/naomigd.h +++ b/src/mame/machine/naomigd.h @@ -9,14 +9,18 @@ #define MCFG_NAOMI_GDROM_BOARD_ADD(_tag, _image_tag, _pic_tag, _eeprom_tag, _irq_cb) \ MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_GDROM_BOARD, _eeprom_tag, _irq_cb) \ - naomi_gdrom_board::static_set_tags(*device, _image_tag, _pic_tag); + downcast(*device).set_tags(_image_tag, _pic_tag); class naomi_gdrom_board : public naomi_board { public: naomi_gdrom_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_tags(device_t &device, const char *_image_tag, const char *_pic_tag); + void set_tags(const char *_image_tag, const char *_pic_tag) + { + image_tag = _image_tag; + pic_tag = _pic_tag; + } uint8_t *memory(uint32_t &size) { size = dimm_data_size; return dimm_data; } diff --git a/src/mame/machine/naomim4.cpp b/src/mame/machine/naomim4.cpp index 5e31e2b5723..143ab149b12 100644 --- a/src/mame/machine/naomim4.cpp +++ b/src/mame/machine/naomim4.cpp @@ -52,12 +52,6 @@ naomi_m4_board::naomi_m4_board(const machine_config &mconfig, const char *tag, d { } -void naomi_m4_board::static_set_tags(device_t &device, const char *key_tag) -{ - naomi_m4_board &dev = downcast(device); - dev.m_key_data.set_tag(key_tag); -} - void naomi_m4_board::device_start() { naomi_board::device_start(); diff --git a/src/mame/machine/naomim4.h b/src/mame/machine/naomim4.h index 70c83a9035a..f8fb3ad517c 100644 --- a/src/mame/machine/naomim4.h +++ b/src/mame/machine/naomim4.h @@ -7,14 +7,14 @@ #define MCFG_NAOMI_M4_BOARD_ADD(_tag, _key_tag, _eeprom_tag, _irq_cb) \ MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M4_BOARD, _eeprom_tag, _irq_cb) \ - naomi_m4_board::static_set_tags(*device, "^" _key_tag); + downcast(*device).set_tags("^" _key_tag); class naomi_m4_board : public naomi_board { public: naomi_m4_board(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void static_set_tags(device_t &device, const char *key_tag); + void set_tags(const char *key_tag) { m_key_data.set_tag(key_tag); } virtual void submap(address_map &map) override; diff --git a/src/mame/machine/nextkbd.h b/src/mame/machine/nextkbd.h index b706712c28e..7e04b5e1ba6 100644 --- a/src/mame/machine/nextkbd.h +++ b/src/mame/machine/nextkbd.h @@ -7,21 +7,21 @@ #define MCFG_NEXTKBD_INT_CHANGE_CALLBACK(_write) \ - devcb = &nextkbd_device::set_int_change_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_int_change_wr_callback(DEVCB_##_write); #define MCFG_NEXTKBD_INT_POWER_CALLBACK(_write) \ - devcb = &nextkbd_device::set_int_power_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_int_power_wr_callback(DEVCB_##_write); #define MCFG_NEXTKBD_INT_NMI_CALLBACK(_write) \ - devcb = &nextkbd_device::set_int_nmi_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_int_nmi_wr_callback(DEVCB_##_write); class nextkbd_device : public device_t { public: nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_int_change_wr_callback(device_t &device, Object &&cb) { return downcast(device).int_change_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_int_power_wr_callback(device_t &device, Object &&cb) { return downcast(device).int_power_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_int_nmi_wr_callback(device_t &device, Object &&cb) { return downcast(device).int_nmi_cb.set_callback(std::forward(cb)); } + template devcb_base &set_int_change_wr_callback(Object &&cb) { return int_change_cb.set_callback(std::forward(cb)); } + template devcb_base &set_int_power_wr_callback(Object &&cb) { return int_power_cb.set_callback(std::forward(cb)); } + template devcb_base &set_int_nmi_wr_callback(Object &&cb) { return int_nmi_cb.set_callback(std::forward(cb)); } void amap(address_map &map); diff --git a/src/mame/machine/nextmo.h b/src/mame/machine/nextmo.h index 4dfa6416f5a..66d98938c62 100644 --- a/src/mame/machine/nextmo.h +++ b/src/mame/machine/nextmo.h @@ -6,18 +6,18 @@ #pragma once #define MCFG_NEXTMO_IRQ_CALLBACK(_write) \ - devcb = &nextmo_device::set_irq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_irq_wr_callback(DEVCB_##_write); #define MCFG_NEXTMO_DRQ_CALLBACK(_write) \ - devcb = &nextmo_device::set_drq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_drq_wr_callback(DEVCB_##_write); class nextmo_device : public device_t { public: nextmo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast(device).irq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_drq_wr_callback(device_t &device, Object &&cb) { return downcast(device).drq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_irq_wr_callback(Object &&cb) { return irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_drq_wr_callback(Object &&cb) { return drq_cb.set_callback(std::forward(cb)); } void map(address_map &map); diff --git a/src/mame/machine/nmk004.h b/src/mame/machine/nmk004.h index 1570df59fa9..a7905a3dbfb 100644 --- a/src/mame/machine/nmk004.h +++ b/src/mame/machine/nmk004.h @@ -18,13 +18,12 @@ MCFG_DEVICE_ADD(tag, NMK004, clock) #define MCFG_NMK004_RESET_CB(cb) \ - nmk004_device::set_reset_cb(*device, DEVCB_##cb); + downcast(*device).set_reset_cb(DEVCB_##cb); class nmk004_device : public device_t { public: - template static devcb_base &set_reset_cb(device_t &device, Obj &&object) - { return downcast(device).m_reset_cb.set_callback(std::forward(object)); } + template devcb_base &set_reset_cb(Obj &&object) { return m_reset_cb.set_callback(std::forward(object)); } nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/nmk112.h b/src/mame/machine/nmk112.h index ac722031c55..f8f87bba5a1 100644 --- a/src/mame/machine/nmk112.h +++ b/src/mame/machine/nmk112.h @@ -20,10 +20,10 @@ class nmk112_device : public device_t public: nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration - static void set_rom0_tag(device_t &device, const char *tag) { downcast(device).m_tag0 = tag; } - static void set_rom1_tag(device_t &device, const char *tag) { downcast(device).m_tag1 = tag; } - static void set_page_mask(device_t &device, uint8_t mask) { downcast(device).m_page_mask = ~mask; } + // configuration + void set_rom0_tag(const char *tag) { m_tag0 = tag; } + void set_rom1_tag(const char *tag) { m_tag1 = tag; } + void set_page_mask(uint8_t mask) { m_page_mask = ~mask; } DECLARE_WRITE8_MEMBER( okibank_w ); @@ -56,13 +56,13 @@ DECLARE_DEVICE_TYPE(NMK112, nmk112_device) ***************************************************************************/ #define MCFG_NMK112_ROM0(_tag) \ - nmk112_device::set_rom0_tag(*device, _tag); + downcast(*device).set_rom0_tag(_tag); #define MCFG_NMK112_ROM1(_tag) \ - nmk112_device::set_rom1_tag(*device, _tag); + downcast(*device).set_rom1_tag(_tag); #define MCFG_NMK112_DISABLE_PAGEMASK(_mask) \ - nmk112_device::set_page_mask(*device, _mask); + downcast(*device).set_page_mask(_mask); #endif // MAME_MACHINE_NMK112_H diff --git a/src/mame/machine/pc1512kb.h b/src/mame/machine/pc1512kb.h index ec6de694946..2789c998b32 100644 --- a/src/mame/machine/pc1512kb.h +++ b/src/mame/machine/pc1512kb.h @@ -30,10 +30,10 @@ //************************************************************************** #define MCFG_PC1512_KEYBOARD_CLOCK_CALLBACK(_write) \ - devcb = &pc1512_keyboard_device::set_clock_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_clock_wr_callback(DEVCB_##_write); #define MCFG_PC1512_KEYBOARD_DATA_CALLBACK(_write) \ - devcb = &pc1512_keyboard_device::set_data_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_data_wr_callback(DEVCB_##_write); @@ -49,8 +49,8 @@ public: // construction/destruction pc1512_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_clock_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_clock.set_callback(std::forward(cb)); } - template static devcb_base &set_data_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_data.set_callback(std::forward(cb)); } + template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } + template devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( data_w ); DECLARE_WRITE_LINE_MEMBER( clock_w ); diff --git a/src/mame/machine/pc9801_kbd.h b/src/mame/machine/pc9801_kbd.h index a5b6912c1cc..140a8c326e5 100644 --- a/src/mame/machine/pc9801_kbd.h +++ b/src/mame/machine/pc9801_kbd.h @@ -17,7 +17,7 @@ //************************************************************************** #define MCFG_PC9801_KBD_IRQ_CALLBACK(_write) \ - devcb = &pc9801_kbd_device::set_irq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_irq_wr_callback(DEVCB_##_write); //************************************************************************** @@ -32,7 +32,7 @@ public: // construction/destruction pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_irq.set_callback(std::forward(cb)); } + template devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward(cb)); } virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/machine/pcd_kbd.h b/src/mame/machine/pcd_kbd.h index d8998be4468..b8f95c2853a 100644 --- a/src/mame/machine/pcd_kbd.h +++ b/src/mame/machine/pcd_kbd.h @@ -6,14 +6,14 @@ #pragma once #define MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(_devcb) \ - devcb = &pcd_keyboard_device::set_out_tx_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_tx_handler(DEVCB_##_devcb); class pcd_keyboard_device : public device_t { public: pcd_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_out_tx_handler(device_t &device, Object &&cb) { return downcast(device).m_out_tx_handler.set_callback(std::forward(cb)); } + template devcb_base &set_out_tx_handler(Object &&cb) { return m_out_tx_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( t0_w ); diff --git a/src/mame/machine/psxcd.h b/src/mame/machine/psxcd.h index b1cc0e5966a..efb36dc51db 100644 --- a/src/mame/machine/psxcd.h +++ b/src/mame/machine/psxcd.h @@ -16,15 +16,15 @@ MCFG_DEVICE_ADD(_tag, PSXCD, 0) #define MCFG_PSXCD_IRQ_HANDLER(_devcb) \ - devcb = &psxcd_device::set_irq_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_irq_handler(DEVCB_##_devcb); class psxcd_device : public cdrom_image_device { public: psxcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast(device).m_irq_handler.set_callback(std::forward(cb)); } + // configuration helpers + template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } virtual image_init_result call_load() override; virtual void call_unload() override; diff --git a/src/mame/machine/qimi.h b/src/mame/machine/qimi.h index 210e5e35486..baef9984218 100644 --- a/src/mame/machine/qimi.h +++ b/src/mame/machine/qimi.h @@ -19,7 +19,7 @@ //************************************************************************** #define MCFG_QIMI_EXTINT_CALLBACK(_write) \ - devcb = &qimi_device::set_exting_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_exting_wr_callback(DEVCB_##_write); @@ -35,7 +35,7 @@ public: // construction/destruction qimi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_exting_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_extint.set_callback(std::forward(cb)); } + template devcb_base &set_exting_wr_callback(Object &&cb) { return m_write_extint.set_callback(std::forward(cb)); } // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/machine/rad_eu3a05gpio.h b/src/mame/machine/rad_eu3a05gpio.h index ad72f61008a..435e09be56f 100644 --- a/src/mame/machine/rad_eu3a05gpio.h +++ b/src/mame/machine/rad_eu3a05gpio.h @@ -5,13 +5,13 @@ #define MAME_AUDIO_RAD_EU3A05GPIO_H #define MCFG_RADICA6502_GPIO_READ_PORT0_CB(_devcb) \ - devcb = &radica6502_gpio_device::set_gpio_read_0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_gpio_read_0_callback(DEVCB_##_devcb); #define MCFG_RADICA6502_GPIO_READ_PORT1_CB(_devcb) \ - devcb = &radica6502_gpio_device::set_gpio_read_1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_gpio_read_1_callback(DEVCB_##_devcb); #define MCFG_RADICA6502_GPIO_READ_PORT2_CB(_devcb) \ - devcb = &radica6502_gpio_device::set_gpio_read_2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_gpio_read_2_callback(DEVCB_##_devcb); class radica6502_gpio_device : public device_t @@ -19,9 +19,9 @@ class radica6502_gpio_device : public device_t public: radica6502_gpio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_gpio_read_0_callback(device_t &device, Object &&cb) { return downcast(device).m_space_read0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_gpio_read_1_callback(device_t &device, Object &&cb) { return downcast(device).m_space_read1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_gpio_read_2_callback(device_t &device, Object &&cb) { return downcast(device).m_space_read2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_gpio_read_0_callback(Object &&cb) { return m_space_read0_cb.set_callback(std::forward(cb)); } + template devcb_base &set_gpio_read_1_callback(Object &&cb) { return m_space_read1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_gpio_read_2_callback(Object &&cb) { return m_space_read2_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER(gpio_r); DECLARE_WRITE8_MEMBER(gpio_w); diff --git a/src/mame/machine/segacrp2_device.cpp b/src/mame/machine/segacrp2_device.cpp index 38cebe5815c..6e8f09c6a16 100644 --- a/src/mame/machine/segacrp2_device.cpp +++ b/src/mame/machine/segacrp2_device.cpp @@ -102,12 +102,6 @@ void segacrp2_z80_device::device_start() { z80_device::device_start(); decrypt() void segacrp2_z80_device::device_reset() { z80_device::device_reset(); } void segacrp2_z80_device::decrypt() { } -void segacrp2_z80_device::set_decrypted_tag(device_t &device, const char* decrypted_tag) -{ - segacrp2_z80_device &dev = downcast(device); - dev.m_decrypted_tag = decrypted_tag; -} - sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5177, tag, owner, clock) {} diff --git a/src/mame/machine/segacrp2_device.h b/src/mame/machine/segacrp2_device.h index 8bda4564b43..2b8a8039990 100644 --- a/src/mame/machine/segacrp2_device.h +++ b/src/mame/machine/segacrp2_device.h @@ -10,13 +10,13 @@ #define MCFG_SEGAZ80_SET_DECRYPTED_TAG(_tag) \ - segacrp2_z80_device::set_decrypted_tag(*device, _tag); + downcast(*device).set_decrypted_tag(_tag); // base class class segacrp2_z80_device : public z80_device { public: - static void set_decrypted_tag(device_t &device, const char* decrypted_tag); + void set_decrypted_tag(const char* decrypted_tag) { m_decrypted_tag = decrypted_tag; } const char* m_decrypted_tag; protected: segacrp2_z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/segacrpt_device.cpp b/src/mame/machine/segacrpt_device.cpp index 5a75586c417..cc1131ece2f 100644 --- a/src/mame/machine/segacrpt_device.cpp +++ b/src/mame/machine/segacrpt_device.cpp @@ -324,18 +324,6 @@ void segacrpt_z80_device::device_reset() z80_device::device_reset(); } -void segacrpt_z80_device::set_decrypted_tag(device_t &device, const char* decrypted_tag) -{ - segacrpt_z80_device &dev = downcast(device); - dev.m_decrypted_tag = decrypted_tag; -} - -void segacrpt_z80_device::set_decrypted_ptr(device_t &device, uint8_t* ptr) -{ - segacrpt_z80_device &dev = downcast(device); - dev.m_decrypted_ptr = ptr; -} - void segacrpt_z80_device::set_region_p(uint8_t* ptr) { m_region_ptr = ptr; @@ -346,24 +334,6 @@ void segacrpt_z80_device::set_decrypted_p(uint8_t* ptr) m_decrypted_ptr = ptr; } -void segacrpt_z80_device::set_size(device_t &device, int size) -{ - segacrpt_z80_device &dev = downcast(device); - dev.m_decode_size = size; -} - -void segacrpt_z80_device::set_numbanks(device_t &device, int numbanks) -{ - segacrpt_z80_device &dev = downcast(device); - dev.m_numbanks = numbanks; -} - -void segacrpt_z80_device::set_banksize(device_t &device, int banksize) -{ - segacrpt_z80_device &dev = downcast(device); - dev.m_banksize = banksize; -} - diff --git a/src/mame/machine/segacrpt_device.h b/src/mame/machine/segacrpt_device.h index cadbc8957c4..1c31d6a0116 100644 --- a/src/mame/machine/segacrpt_device.h +++ b/src/mame/machine/segacrpt_device.h @@ -10,30 +10,30 @@ #define MCFG_SEGACRPT_SET_DECRYPTED_TAG(_tag) \ - segacrpt_z80_device::set_decrypted_tag(*device, _tag); + downcast(*device).set_decrypted_tag(_tag); #define MCFG_SEGACRPT_SET_DECRYPTED_PTR(_tag) \ - segacrpt_z80_device::set_decrypted_ptr(*device, _ptr); + downcast(*device).set_decrypted_ptr(_ptr); #define MCFG_SEGACRPT_SET_SIZE(_size) \ - segacrpt_z80_device::set_size(*device, _size); + downcast(*device).set_size(_size); #define MCFG_SEGACRPT_SET_NUMBANKS(_numbanks) \ - segacrpt_z80_device::set_numbanks(*device, _numbanks); + downcast(*device).set_numbanks(_numbanks); #define MCFG_SEGACRPT_SET_BANKSIZE(_banksize) \ - segacrpt_z80_device::set_banksize(*device, _banksize); + downcast(*device).set_banksize(_banksize); // base class class segacrpt_z80_device : public z80_device { public: - static void set_decrypted_tag(device_t &device, const char* decrypted_tag); - static void set_decrypted_ptr(device_t &device, uint8_t* ptr); // toprollr - static void set_size(device_t &device, int size); - static void set_numbanks(device_t &device, int _numbanks); - static void set_banksize(device_t &device, int _banksize); + void set_decrypted_tag(const char* decrypted_tag) { m_decrypted_tag = decrypted_tag; } + void set_decrypted_ptr(uint8_t* ptr) { m_decrypted_ptr = ptr; } // toprollr + void set_size(int size) { m_decode_size = size; } + void set_numbanks(int numbanks) { m_numbanks = numbanks; } + void set_banksize(int banksize) { m_banksize = banksize; } void set_decrypted_p(uint8_t* ptr); void set_region_p(uint8_t* ptr); diff --git a/src/mame/machine/segaic16.cpp b/src/mame/machine/segaic16.cpp index 665fb2b3166..68150faa7d8 100644 --- a/src/mame/machine/segaic16.cpp +++ b/src/mame/machine/segaic16.cpp @@ -211,31 +211,6 @@ sega_315_5195_mapper_device::sega_315_5195_mapper_device(const machine_config &m } -//------------------------------------------------- -// static_set_cputag - configuration helper -// to set the tag of the CPU device -//------------------------------------------------- - -void sega_315_5195_mapper_device::static_set_cputag(device_t &device, const char *cpu) -{ - sega_315_5195_mapper_device &mapper = downcast(device); - mapper.m_cpu.set_tag(cpu); - mapper.m_cpuregion.set_tag(cpu); -} - - -//------------------------------------------------- -// static_set_mapper - configuration helper -// to set the mapper function -//------------------------------------------------- - -void sega_315_5195_mapper_device::static_set_mapper(device_t &device, mapper_delegate callback) -{ - sega_315_5195_mapper_device &mapper = downcast(device); - mapper.m_mapper = callback; -} - - //------------------------------------------------- // write - handle a write to the memory mapper //------------------------------------------------- @@ -947,18 +922,6 @@ sega_315_5250_compare_timer_device::sega_315_5250_compare_timer_device(const mac } -//------------------------------------------------- -// static_set_timer_ack - configuration helper -// to set the timer acknowledge function -//------------------------------------------------- - -void sega_315_5250_compare_timer_device::static_set_timer_ack(device_t &device, timer_ack_delegate callback) -{ - sega_315_5250_compare_timer_device &timer = downcast(device); - timer.m_timer_ack = callback; -} - - //------------------------------------------------- // clock - clock the timer //------------------------------------------------- diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h index 1f04ac3c061..b7b22ddb6bb 100644 --- a/src/mame/machine/segaic16.h +++ b/src/mame/machine/segaic16.h @@ -23,12 +23,12 @@ #define MCFG_SEGA_315_5195_MAPPER_ADD(_tag, _cputag, _class, _mapper) \ MCFG_DEVICE_ADD(_tag, SEGA_315_5195_MEM_MAPPER, 0) \ - sega_315_5195_mapper_device::static_set_cputag(*device, "^" _cputag); \ - sega_315_5195_mapper_device::static_set_mapper(*device, sega_315_5195_mapper_device::mapper_delegate(&_class::_mapper, #_class "::" #_mapper, nullptr, (_class *)nullptr)); + downcast(*device).set_cputag("^" _cputag); \ + downcast(*device).set_mapper(sega_315_5195_mapper_device::mapper_delegate(&_class::_mapper, #_class "::" #_mapper, nullptr, (_class *)nullptr)); #define MCFG_SEGA_315_5195_SOUND_READ_CALLBACK(_devcb) \ - devcb = &sega_315_5195_mapper_device::static_set_sound_read(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_sound_read(DEVCB_##_devcb); #define MCFG_SEGA_315_5195_SOUND_WRITE_CALLBACK(_devcb) \ - devcb = &sega_315_5195_mapper_device::static_set_sound_write(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_sound_write(DEVCB_##_devcb); #define MCFG_SEGA_315_5248_MULTIPLIER_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, SEGA_315_5248_MULTIPLIER, 0) @@ -39,9 +39,9 @@ #define MCFG_SEGA_315_5250_COMPARE_TIMER_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, SEGA_315_5250_COMPARE_TIMER, 0) #define MCFG_SEGA_315_5250_TIMER_ACK(_class, _func) \ - sega_315_5250_compare_timer_device::static_set_timer_ack(*device, sega_315_5250_compare_timer_device::timer_ack_delegate(&_class::_func, #_class "::" #_func, nullptr, (_class *)nullptr)); + downcast(*device).set_timer_ack(sega_315_5250_compare_timer_device::timer_ack_delegate(&_class::_func, #_class "::" #_func, nullptr, (_class *)nullptr)); #define MCFG_SEGA_315_5250_SOUND_WRITE_CALLBACK(_devcb) \ - devcb = &sega_315_5250_compare_timer_device::static_set_sound_write(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_sound_write(DEVCB_##_devcb); //************************************************************************** @@ -94,17 +94,15 @@ public: // construction/destruction sega_315_5195_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - static void static_set_cputag(device_t &device, const char *cpu); - static void static_set_mapper(device_t &device, mapper_delegate callback); - template static devcb_base &static_set_sound_read(device_t &device, Object &&object) + // configuration helpers + void set_cputag(const char *cpu) { - return downcast(device).m_sound_read.set_callback(std::forward(object)); - } - template static devcb_base &static_set_sound_write(device_t &device, Object &&object) - { - return downcast(device).m_sound_write.set_callback(std::forward(object)); + m_cpu.set_tag(cpu); + m_cpuregion.set_tag(cpu); } + void set_mapper(mapper_delegate callback) { m_mapper = callback; } + template devcb_base &set_sound_read(Object &&object) { return m_sound_read.set_callback(std::forward(object)); } + template devcb_base &set_sound_write(Object &&object) { return m_sound_write.set_callback(std::forward(object)); } // public interface DECLARE_READ8_MEMBER( read ); @@ -245,12 +243,9 @@ public: // construction/destruction sega_315_5250_compare_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - static void static_set_timer_ack(device_t &device, timer_ack_delegate callback); - template static devcb_base &static_set_sound_write(device_t &device, Object &&object) - { - return downcast(device).m_sound_write.set_callback(std::forward(object)); - } + // configuration helpers + void set_timer_ack(timer_ack_delegate callback) { m_timer_ack = callback; } + template devcb_base &set_sound_write(Object &&object) { return m_sound_write.set_callback(std::forward(object)); } // public interface bool clock(); diff --git a/src/mame/machine/st0016.h b/src/mame/machine/st0016.h index 0819c0fef81..333cda7f837 100644 --- a/src/mame/machine/st0016.h +++ b/src/mame/machine/st0016.h @@ -15,7 +15,7 @@ typedef device_delegate st0016_dma_offs_delegate; #define ST0016_DMA_OFFS_CB(name) uint8_t name(void) #define MCFG_ST0016_DMA_OFFS_CB(_class, _method) \ - st0016_cpu_device::set_dma_offs_callback(*device, st0016_dma_offs_delegate(&_class::_method, #_class "::" #_method, this)); + downcast(*device).set_dma_offs_callback(st0016_dma_offs_delegate(&_class::_method, #_class "::" #_method, this)); class st0016_cpu_device : public z80_device, public device_gfx_interface @@ -23,7 +23,7 @@ class st0016_cpu_device : public z80_device, public device_gfx_interface public: st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); - static void set_dma_offs_callback(device_t &device, st0016_dma_offs_delegate callback) { downcast(device).m_dma_offs_cb = callback; } + void set_dma_offs_callback(st0016_dma_offs_delegate callback) { m_dma_offs_cb = callback; } DECLARE_WRITE8_MEMBER(st0016_sprite_bank_w); DECLARE_WRITE8_MEMBER(st0016_palette_bank_w); diff --git a/src/mame/machine/tait8741.h b/src/mame/machine/tait8741.h index ba97e80b8e3..5da76a49d7a 100644 --- a/src/mame/machine/tait8741.h +++ b/src/mame/machine/tait8741.h @@ -18,23 +18,23 @@ MCFG_DEVICE_ADD(_tag, TAITO8741_4PACK, 0) #define MCFG_TAITO8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \ - devcb = &taito8741_4pack_device::set_port_handler_0_callback(*device, DEVCB_##_devcb0); \ - devcb = &taito8741_4pack_device::set_port_handler_1_callback(*device, DEVCB_##_devcb1); \ - devcb = &taito8741_4pack_device::set_port_handler_2_callback(*device, DEVCB_##_devcb2); \ - devcb = &taito8741_4pack_device::set_port_handler_3_callback(*device, DEVCB_##_devcb3); + devcb = &downcast(*device).set_port_handler_0_callback(DEVCB_##_devcb0); \ + devcb = &downcast(*device).set_port_handler_1_callback(DEVCB_##_devcb1); \ + devcb = &downcast(*device).set_port_handler_2_callback(DEVCB_##_devcb2); \ + devcb = &downcast(*device).set_port_handler_3_callback(DEVCB_##_devcb3); #define MCFG_TAITO8741_MODES(_mode0, _mode1, _mode2, _mode3) \ - taito8741_4pack_device::static_set_mode(*device, 0, _mode0); \ - taito8741_4pack_device::static_set_mode(*device, 1, _mode1); \ - taito8741_4pack_device::static_set_mode(*device, 2, _mode2); \ - taito8741_4pack_device::static_set_mode(*device, 3, _mode3); + downcast(*device).set_mode(0, _mode0); \ + downcast(*device).set_mode(1, _mode1); \ + downcast(*device).set_mode(2, _mode2); \ + downcast(*device).set_mode(3, _mode3); #define MCFG_TAITO8741_CONNECT(_con0, _con1, _con2, _con3) \ - taito8741_4pack_device::static_set_connect(*device, 0, _con0); \ - taito8741_4pack_device::static_set_connect(*device, 1, _con1); \ - taito8741_4pack_device::static_set_connect(*device, 2, _con2); \ - taito8741_4pack_device::static_set_connect(*device, 3, _con3); + downcast(*device).set_connect(0, _con0); \ + downcast(*device).set_connect(1, _con1); \ + downcast(*device).set_connect(2, _con2); \ + downcast(*device).set_connect(3, _con3); class taito8741_4pack_device : public device_t @@ -42,13 +42,13 @@ class taito8741_4pack_device : public device_t public: taito8741_4pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_port_handler_0_callback(device_t &device, Object &&cb) { return downcast(device).m_port_handler_0_r.set_callback(std::forward(cb)); } - template static devcb_base &set_port_handler_1_callback(device_t &device, Object &&cb) { return downcast(device).m_port_handler_1_r.set_callback(std::forward(cb)); } - template static devcb_base &set_port_handler_2_callback(device_t &device, Object &&cb) { return downcast(device).m_port_handler_2_r.set_callback(std::forward(cb)); } - template static devcb_base &set_port_handler_3_callback(device_t &device, Object &&cb) { return downcast(device).m_port_handler_3_r.set_callback(std::forward(cb)); } + template devcb_base &set_port_handler_0_callback(Object &&cb) { return m_port_handler_0_r.set_callback(std::forward(cb)); } + template devcb_base &set_port_handler_1_callback(Object &&cb) { return m_port_handler_1_r.set_callback(std::forward(cb)); } + template devcb_base &set_port_handler_2_callback(Object &&cb) { return m_port_handler_2_r.set_callback(std::forward(cb)); } + template devcb_base &set_port_handler_3_callback(Object &&cb) { return m_port_handler_3_r.set_callback(std::forward(cb)); } - static void static_set_mode(device_t &device, int num, uint8_t mode) { downcast(device).m_taito8741[num].mode = mode; } - static void static_set_connect(device_t &device, int num, int conn) { downcast(device).m_taito8741[num].connect = conn; } + void set_mode(int num, uint8_t mode) { m_taito8741[num].mode = mode; } + void set_connect(int num, int conn) { m_taito8741[num].connect = conn; } DECLARE_READ8_MEMBER( read_0 ) { if(offset&1) return status_r(0); else return data_r(0); } DECLARE_WRITE8_MEMBER( write_0 ) { if(offset&1) command_w(0,data); else data_w(0,data); } diff --git a/src/mame/machine/taito68705interface.h b/src/mame/machine/taito68705interface.h index 7d7365bc8bd..ce87836187e 100644 --- a/src/mame/machine/taito68705interface.h +++ b/src/mame/machine/taito68705interface.h @@ -17,8 +17,7 @@ DECLARE_DEVICE_TYPE(ARKANOID_68705P5, arkanoid_68705p5_device) class taito68705_mcu_device_base : public device_t { public: - template static devcb_base &set_semaphore_cb(device_t &device, Obj &&cb) - { return downcast(device).m_semaphore_cb.set_callback(std::forward(cb)); } + template devcb_base &set_semaphore_cb(Obj &&cb) { return m_semaphore_cb.set_callback(std::forward(cb)); } // host interface DECLARE_READ8_MEMBER(data_r); @@ -64,13 +63,12 @@ private: #define MCFG_TAITO_M68705_AUX_STROBE_CB(cb) \ - devcb = &taito68705_mcu_device::set_aux_strobe_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_aux_strobe_cb(DEVCB_##cb); class taito68705_mcu_device : public taito68705_mcu_device_base { public: - template static devcb_base &set_aux_strobe_cb(device_t &device, Obj &&cb) - { return downcast(device).m_aux_strobe_cb.set_callback(std::forward(cb)); } + template devcb_base &set_aux_strobe_cb(Obj &&cb) { return m_aux_strobe_cb.set_callback(std::forward(cb)); } taito68705_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -100,16 +98,15 @@ protected: #define MCFG_ARKANOID_MCU_SEMAPHORE_CB(cb) \ - devcb = &arkanoid_mcu_device_base::set_semaphore_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_semaphore_cb(DEVCB_##cb); #define MCFG_ARKANOID_MCU_PORTB_R_CB(cb) \ - devcb = &arkanoid_mcu_device_base::set_portb_r_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_portb_r_cb(DEVCB_##cb); class arkanoid_mcu_device_base : public taito68705_mcu_device_base { public: - template static devcb_base &set_portb_r_cb(device_t &device, Obj &&cb) - { return downcast(device).m_portb_r_cb.set_callback(std::forward(cb)); } + template devcb_base &set_portb_r_cb(Obj &&cb) { return m_portb_r_cb.set_callback(std::forward(cb)); } protected: arkanoid_mcu_device_base( diff --git a/src/mame/machine/taitoio.h b/src/mame/machine/taitoio.h index a4e3c0ef51f..63b843b8f28 100644 --- a/src/mame/machine/taitoio.h +++ b/src/mame/machine/taitoio.h @@ -21,12 +21,12 @@ class tc0040ioc_device : public device_t public: tc0040ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_read_0_callback(device_t &device, Object &&cb) { return downcast(device).m_read_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_1_callback(device_t &device, Object &&cb) { return downcast(device).m_read_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_2_callback(device_t &device, Object &&cb) { return downcast(device).m_read_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_3_callback(device_t &device, Object &&cb) { return downcast(device).m_read_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_4_callback(device_t &device, Object &&cb) { return downcast(device).m_write_4_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_7_callback(device_t &device, Object &&cb) { return downcast(device).m_read_7_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -64,13 +64,13 @@ class tc0220ioc_device : public device_t public: tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_read_0_callback(device_t &device, Object &&cb) { return downcast(device).m_read_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_1_callback(device_t &device, Object &&cb) { return downcast(device).m_read_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_2_callback(device_t &device, Object &&cb) { return downcast(device).m_read_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_3_callback(device_t &device, Object &&cb) { return downcast(device).m_read_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_3_callback(device_t &device, Object &&cb) { return downcast(device).m_write_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_4_callback(device_t &device, Object &&cb) { return downcast(device).m_write_4_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_7_callback(device_t &device, Object &&cb) { return downcast(device).m_read_7_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_3_callback(Object &&cb) { return m_write_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -103,13 +103,13 @@ class tc0510nio_device : public device_t public: tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_read_0_callback(device_t &device, Object &&cb) { return downcast(device).m_read_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_1_callback(device_t &device, Object &&cb) { return downcast(device).m_read_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_2_callback(device_t &device, Object &&cb) { return downcast(device).m_read_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_3_callback(device_t &device, Object &&cb) { return downcast(device).m_read_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_3_callback(device_t &device, Object &&cb) { return downcast(device).m_write_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_4_callback(device_t &device, Object &&cb) { return downcast(device).m_write_4_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_7_callback(device_t &device, Object &&cb) { return downcast(device).m_read_7_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_3_callback(Object &&cb) { return m_write_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -146,12 +146,12 @@ class tc0640fio_device : public device_t public: tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_read_0_callback(device_t &device, Object &&cb) { return downcast(device).m_read_0_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_1_callback(device_t &device, Object &&cb) { return downcast(device).m_read_1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_2_callback(device_t &device, Object &&cb) { return downcast(device).m_read_2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_3_callback(device_t &device, Object &&cb) { return downcast(device).m_read_3_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_write_4_callback(device_t &device, Object &&cb) { return downcast(device).m_write_4_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_read_7_callback(device_t &device, Object &&cb) { return downcast(device).m_read_7_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_0_callback(Object &&cb) { return m_read_0_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_1_callback(Object &&cb) { return m_read_1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_2_callback(Object &&cb) { return m_read_2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_3_callback(Object &&cb) { return m_read_3_cb.set_callback(std::forward(cb)); } + template devcb_base &set_write_4_callback(Object &&cb) { return m_write_4_cb.set_callback(std::forward(cb)); } + template devcb_base &set_read_7_callback(Object &&cb) { return m_read_7_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( read ); @@ -189,85 +189,85 @@ DECLARE_DEVICE_TYPE(TC0640FIO, tc0640fio_device) ***************************************************************************/ #define MCFG_TC0040IOC_READ_0_CB(_devcb) \ - devcb = &tc0040ioc_device::set_read_0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_0_callback(DEVCB_##_devcb); #define MCFG_TC0040IOC_READ_1_CB(_devcb) \ - devcb = &tc0040ioc_device::set_read_1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_1_callback(DEVCB_##_devcb); #define MCFG_TC0040IOC_READ_2_CB(_devcb) \ - devcb = &tc0040ioc_device::set_read_2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_2_callback(DEVCB_##_devcb); #define MCFG_TC0040IOC_READ_3_CB(_devcb) \ - devcb = &tc0040ioc_device::set_read_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_3_callback(DEVCB_##_devcb); #define MCFG_TC0040IOC_WRITE_4_CB(_devcb) \ - devcb = &tc0040ioc_device::set_write_4_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_4_callback(DEVCB_##_devcb); #define MCFG_TC0040IOC_READ_7_CB(_devcb) \ - devcb = &tc0040ioc_device::set_read_7_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_7_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_READ_0_CB(_devcb) \ - devcb = &tc0220ioc_device::set_read_0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_0_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_READ_1_CB(_devcb) \ - devcb = &tc0220ioc_device::set_read_1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_1_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_READ_2_CB(_devcb) \ - devcb = &tc0220ioc_device::set_read_2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_2_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_READ_3_CB(_devcb) \ - devcb = &tc0220ioc_device::set_read_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_3_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_WRITE_3_CB(_devcb) \ - devcb = &tc0220ioc_device::set_write_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_3_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_WRITE_4_CB(_devcb) \ - devcb = &tc0220ioc_device::set_write_4_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_4_callback(DEVCB_##_devcb); #define MCFG_TC0220IOC_READ_7_CB(_devcb) \ - devcb = &tc0220ioc_device::set_read_7_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_7_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_READ_0_CB(_devcb) \ - devcb = &tc0510nio_device::set_read_0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_0_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_READ_1_CB(_devcb) \ - devcb = &tc0510nio_device::set_read_1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_1_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_READ_2_CB(_devcb) \ - devcb = &tc0510nio_device::set_read_2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_2_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_READ_3_CB(_devcb) \ - devcb = &tc0510nio_device::set_read_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_3_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_WRITE_3_CB(_devcb) \ - devcb = &tc0510nio_device::set_write_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_3_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_WRITE_4_CB(_devcb) \ - devcb = &tc0510nio_device::set_write_4_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_4_callback(DEVCB_##_devcb); #define MCFG_TC0510NIO_READ_7_CB(_devcb) \ - devcb = &tc0510nio_device::set_read_7_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_7_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_READ_0_CB(_devcb) \ - devcb = &tc0640fio_device::set_read_0_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_0_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_READ_1_CB(_devcb) \ - devcb = &tc0640fio_device::set_read_1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_1_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_READ_2_CB(_devcb) \ - devcb = &tc0640fio_device::set_read_2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_2_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_READ_3_CB(_devcb) \ - devcb = &tc0640fio_device::set_read_3_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_3_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_WRITE_4_CB(_devcb) \ - devcb = &tc0640fio_device::set_write_4_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_write_4_callback(DEVCB_##_devcb); #define MCFG_TC0640FIO_READ_7_CB(_devcb) \ - devcb = &tc0640fio_device::set_read_7_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_read_7_callback(DEVCB_##_devcb); #endif // MAME_MACHINE_TAITOIO_H diff --git a/src/mame/machine/taitosjsec.h b/src/mame/machine/taitosjsec.h index 98132067428..48ccfe57a1b 100644 --- a/src/mame/machine/taitosjsec.h +++ b/src/mame/machine/taitosjsec.h @@ -11,15 +11,15 @@ DECLARE_DEVICE_TYPE(TAITO_SJ_SECURITY_MCU, taito_sj_security_mcu_device) #define MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(mode) \ - taito_sj_security_mcu_device::set_int_mode(*device, taito_sj_security_mcu_device::int_mode::mode); + downcast(*device).set_int_mode(taito_sj_security_mcu_device::int_mode::mode); #define MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(cb) \ - devcb = &taito_sj_security_mcu_device::set_68read_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_68read_cb(DEVCB_##cb); #define MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(cb) \ - devcb = &taito_sj_security_mcu_device::set_68write_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_68write_cb(DEVCB_##cb); #define MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(cb) \ - devcb = &taito_sj_security_mcu_device::set_68intrq_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_68intrq_cb(DEVCB_##cb); #define MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(cb) \ - devcb = &taito_sj_security_mcu_device::set_busrq_cb(*device, DEVCB_##cb); + devcb = &downcast(*device).set_busrq_cb(DEVCB_##cb); class taito_sj_security_mcu_device : public device_t { @@ -31,16 +31,11 @@ public: WRITE }; - static void set_int_mode(device_t &device, int_mode mode) - { downcast(device).m_int_mode = mode; } - template static devcb_base &set_68read_cb(device_t &device, Obj &&cb) - { return downcast(device).m_68read_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_68write_cb(device_t &device, Obj &&cb) - { return downcast(device).m_68write_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_68intrq_cb(device_t &device, Obj &&cb) - { return downcast(device).m_68intrq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_busrq_cb(device_t &device, Obj &&cb) - { return downcast(device).m_busrq_cb.set_callback(std::forward(cb)); } + void set_int_mode(int_mode mode) { m_int_mode = mode; } + template devcb_base &set_68read_cb(Obj &&cb) { return m_68read_cb.set_callback(std::forward(cb)); } + template devcb_base &set_68write_cb(Obj &&cb) { return m_68write_cb.set_callback(std::forward(cb)); } + template devcb_base &set_68intrq_cb(Obj &&cb) { return m_68intrq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_busrq_cb(Obj &&cb) { return m_busrq_cb.set_callback(std::forward(cb)); } taito_sj_security_mcu_device( machine_config const &mconfig, diff --git a/src/mame/machine/tandy2kb.h b/src/mame/machine/tandy2kb.h index 6348b9a073b..f6a6f1e24eb 100644 --- a/src/mame/machine/tandy2kb.h +++ b/src/mame/machine/tandy2kb.h @@ -28,10 +28,10 @@ //************************************************************************** #define MCFG_TANDY2000_KEYBOARD_CLOCK_CALLBACK(_write) \ - devcb = &tandy2k_keyboard_device::set_clock_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_clock_wr_callback(DEVCB_##_write); #define MCFG_TANDY2000_KEYBOARD_DATA_CALLBACK(_write) \ - devcb = &tandy2k_keyboard_device::set_data_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_data_wr_callback(DEVCB_##_write); @@ -47,8 +47,8 @@ public: // construction/destruction tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_clock_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_clock.set_callback(std::forward(cb)); } - template static devcb_base &set_data_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_data.set_callback(std::forward(cb)); } + template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } + template devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( power_w ); DECLARE_WRITE_LINE_MEMBER( reset_w ); diff --git a/src/mame/machine/trs80m2kb.h b/src/mame/machine/trs80m2kb.h index bd4b4159614..29ff764f31c 100644 --- a/src/mame/machine/trs80m2kb.h +++ b/src/mame/machine/trs80m2kb.h @@ -29,7 +29,7 @@ //************************************************************************** #define MCFG_TRS80M2_KEYBOARD_CLOCK_CALLBACK(_write) \ - devcb = &trs80m2_keyboard_device::set_clock_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_clock_wr_callback(DEVCB_##_write); @@ -45,7 +45,7 @@ public: // construction/destruction trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_clock_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_write_clock.set_callback(std::forward(cb)); } + template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( busy_w ); DECLARE_READ_LINE_MEMBER( data_r ); diff --git a/src/mame/machine/upd65031.h b/src/mame/machine/upd65031.h index c588922898f..f5c8e0e7cc0 100644 --- a/src/mame/machine/upd65031.h +++ b/src/mame/machine/upd65031.h @@ -18,22 +18,22 @@ //************************************************************************** #define MCFG_UPD65031_KB_CALLBACK(_read) \ - devcb = &upd65031_device::set_kb_rd_callback(*device, DEVCB_##_read); + devcb = &downcast(*device).set_kb_rd_callback(DEVCB_##_read); #define MCFG_UPD65031_INT_CALLBACK(_write) \ - devcb = &upd65031_device::set_int_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_int_wr_callback(DEVCB_##_write); #define MCFG_UPD65031_NMI_CALLBACK(_write) \ - devcb = &upd65031_device::set_nmi_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_nmi_wr_callback(DEVCB_##_write); #define MCFG_UPD65031_SPKR_CALLBACK(_write) \ - devcb = &upd65031_device::set_spkr_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_spkr_wr_callback(DEVCB_##_write); #define MCFG_UPD65031_SCR_UPDATE_CB(_class, _method) \ - upd65031_device::set_screen_update_callback(*device, upd65031_screen_update_delegate(&_class::_method, #_class "::" #_method, this)); + downcast(*device).set_screen_update_callback(upd65031_screen_update_delegate(&_class::_method, #_class "::" #_method, this)); #define MCFG_UPD65031_MEM_UPDATE_CB(_class, _method) \ - upd65031_device::set_memory_update_callback(*device, upd65031_memory_update_delegate(&_class::_method, #_class "::" #_method, this)); + downcast(*device).set_memory_update_callback(upd65031_memory_update_delegate(&_class::_method, #_class "::" #_method, this)); //************************************************************************** @@ -55,13 +55,13 @@ public: // construction/destruction upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_kb_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_kb.set_callback(object); } - template static devcb_base &set_int_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_int.set_callback(object); } - template static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_nmi.set_callback(object); } - template static devcb_base &set_spkr_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_spkr.set_callback(object); } + template devcb_base &set_kb_rd_callback(_Object object) { return m_read_kb.set_callback(object); } + template devcb_base &set_int_wr_callback(_Object object) { return m_write_int.set_callback(object); } + template devcb_base &set_nmi_wr_callback(_Object object) { return m_write_nmi.set_callback(object); } + template devcb_base &set_spkr_wr_callback(_Object object) { return m_write_spkr.set_callback(object); } - static void set_screen_update_callback(device_t &device, upd65031_screen_update_delegate callback) { downcast(device).m_screen_update_cb = callback; } - static void set_memory_update_callback(device_t &device, upd65031_memory_update_delegate callback) { downcast(device).m_out_mem_cb = callback; } + void set_screen_update_callback(upd65031_screen_update_delegate callback) { m_screen_update_cb = callback; } + void set_memory_update_callback(upd65031_memory_update_delegate callback) { m_out_mem_cb = callback; } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/mame/machine/v1050kb.h b/src/mame/machine/v1050kb.h index 6350488aa54..231a135b48e 100644 --- a/src/mame/machine/v1050kb.h +++ b/src/mame/machine/v1050kb.h @@ -21,7 +21,7 @@ //************************************************************************** #define MCFG_V1050_KEYBOARD_OUT_TX_HANDLER(_devcb) \ - devcb = &v1050_keyboard_device::set_out_tx_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_tx_handler(DEVCB_##_devcb); @@ -40,7 +40,7 @@ public: // device flags static constexpr feature_type imperfect_features() { return feature::KEYBOARD; } - template static devcb_base &set_out_tx_handler(device_t &device, Object &&cb) { return downcast(device).m_out_tx_handler.set_callback(std::forward(cb)); } + template devcb_base &set_out_tx_handler(Object &&cb) { return m_out_tx_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( si_w ); diff --git a/src/mame/machine/victor9k_fdc.h b/src/mame/machine/victor9k_fdc.h index cfb349b89cd..7987bc30f0c 100644 --- a/src/mame/machine/victor9k_fdc.h +++ b/src/mame/machine/victor9k_fdc.h @@ -24,13 +24,13 @@ //************************************************************************** #define MCFG_VICTOR_9000_FDC_IRQ_CB(_write) \ - devcb = &victor_9000_fdc_device::set_irq_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_irq_wr_callback(DEVCB_##_write); #define MCFG_VICTOR_9000_FDC_SYN_CB(_write) \ - devcb = &victor_9000_fdc_device::set_syn_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_syn_wr_callback(DEVCB_##_write); #define MCFG_VICTOR_9000_FDC_LBRDY_CB(_write) \ - devcb = &victor_9000_fdc_device::set_lbrdy_wr_callback(*device, DEVCB_##_write); + devcb = &downcast(*device).set_lbrdy_wr_callback(DEVCB_##_write); @@ -46,9 +46,9 @@ public: // construction/destruction victor_9000_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_irq_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_syn_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_syn_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_lbrdy_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_lbrdy_cb.set_callback(std::forward(cb)); } + template devcb_base &set_irq_wr_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward(cb)); } + template devcb_base &set_syn_wr_callback(Object &&cb) { return m_syn_cb.set_callback(std::forward(cb)); } + template devcb_base &set_lbrdy_wr_callback(Object &&cb) { return m_lbrdy_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( cs5_r ) { return m_via4->read(space, offset); } DECLARE_WRITE8_MEMBER( cs5_w ) { m_via4->write(space, offset, data); } diff --git a/src/mame/machine/victor9k_kb.h b/src/mame/machine/victor9k_kb.h index a686b71b7f1..709ee28f927 100644 --- a/src/mame/machine/victor9k_kb.h +++ b/src/mame/machine/victor9k_kb.h @@ -21,10 +21,10 @@ //************************************************************************** #define MCFG_VICTOR9K_KBRDY_HANDLER(_devcb) \ - devcb = &victor_9000_keyboard_device::set_kbrdy_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_kbrdy_cb(DEVCB_##_devcb); #define MCFG_VICTOR9K_KBDATA_HANDLER(_devcb) \ - devcb = &victor_9000_keyboard_device::set_kbdata_cb(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_kbdata_cb(DEVCB_##_devcb); //************************************************************************** @@ -39,8 +39,8 @@ public: // construction/destruction victor_9000_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_kbrdy_cb(device_t &device, _Object object) { return downcast(device).m_kbrdy_cb.set_callback(object); } - template static devcb_base &set_kbdata_cb(device_t &device, _Object object) { return downcast(device).m_kbdata_cb.set_callback(object); } + template devcb_base &set_kbrdy_cb(_Object object) { return m_kbrdy_cb.set_callback(object); } + template devcb_base &set_kbdata_cb(_Object object) { return m_kbdata_cb.set_callback(object); } DECLARE_WRITE_LINE_MEMBER( kback_w ); diff --git a/src/mame/machine/vs9209.h b/src/mame/machine/vs9209.h index f4fb1cee393..161799419cc 100644 --- a/src/mame/machine/vs9209.h +++ b/src/mame/machine/vs9209.h @@ -16,40 +16,40 @@ //************************************************************************** #define MCFG_VS9209_IN_PORTA_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 0, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(0, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTB_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 1, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(1, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTC_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 2, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(2, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTD_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 3, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(3, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTE_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 4, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(4, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTF_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 5, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(5, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTG_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 6, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(6, DEVCB_##_devcb); #define MCFG_VS9209_IN_PORTH_CB(_devcb) \ - devcb = &vs9209_device::set_input_cb(*device, 7, DEVCB_##_devcb); + devcb = &downcast(*device).set_input_cb(7, DEVCB_##_devcb); #ifdef VS9209_PROBABLY_NONEXISTENT_OUTPUTS #define MCFG_VS9209_OUT_PORTA_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 0, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(0, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTB_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 1, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(1, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTC_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 2, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(2, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTD_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 3, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(3, DEVCB_##_devcb); #endif #define MCFG_VS9209_OUT_PORTE_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 4, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(4, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTF_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 5, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(5, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTG_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 6, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(6, DEVCB_##_devcb); #define MCFG_VS9209_OUT_PORTH_CB(_devcb) \ - devcb = &vs9209_device::set_output_cb(*device, 7, DEVCB_##_devcb); + devcb = &downcast(*device).set_output_cb(7, DEVCB_##_devcb); //************************************************************************** // TYPE DEFINITIONS @@ -63,18 +63,16 @@ public: // construction/destruction vs9209_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // static configuration - template - static devcb_base &set_input_cb(device_t &device, int p, Object &&obj) + // configuration + template devcb_base &set_input_cb(int p, Object &&obj) { assert(p >= 0 && p < 8); - return downcast(device).m_input_cb[p].set_callback(std::forward(obj)); + return m_input_cb[p].set_callback(std::forward(obj)); } - template - static devcb_base &set_output_cb(device_t &device, int p, Object &&obj) + template devcb_base &set_output_cb(int p, Object &&obj) { assert(p >= 0 && p < 8); - return downcast(device).m_output_cb[p].set_callback(std::forward(obj)); + return m_output_cb[p].set_callback(std::forward(obj)); } // memory handlers diff --git a/src/mame/machine/vt100_kbd.h b/src/mame/machine/vt100_kbd.h index f3c924c7134..f43bf075961 100644 --- a/src/mame/machine/vt100_kbd.h +++ b/src/mame/machine/vt100_kbd.h @@ -21,7 +21,7 @@ //************************************************************************** #define MCFG_VT100_KEYBOARD_INT_CALLBACK(_devcb) \ - devcb = &vt100_keyboard_device::set_int_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_int_callback(DEVCB_##_devcb); //************************************************************************** @@ -36,8 +36,8 @@ public: // construction/destruction vt100_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // static configuration - template static devcb_base &set_int_callback(device_t &device, Object &&cb) { return downcast(device).m_int_cb.set_callback(std::forward(cb)); } + // configuration + template devcb_base &set_int_callback(Object &&cb) { return m_int_cb.set_callback(std::forward(cb)); } // accessors (for now) void control_w(u8 data); diff --git a/src/mame/machine/wangpckb.h b/src/mame/machine/wangpckb.h index 3b891c82abc..b9cb4e927b4 100644 --- a/src/mame/machine/wangpckb.h +++ b/src/mame/machine/wangpckb.h @@ -33,7 +33,7 @@ MCFG_DEVICE_ADD(WANGPC_KEYBOARD_TAG, WANGPC_KEYBOARD, 0) #define MCFG_WANGPCKB_TXD_HANDLER(_devcb) \ - devcb = &wangpc_keyboard_device::set_txd_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_txd_handler(DEVCB_##_devcb); //************************************************************************** @@ -49,7 +49,7 @@ public: // construction/destruction wangpc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_txd_handler(device_t &device, Object &&cb) { return downcast(device).m_txd_handler.set_callback(std::forward(cb)); } + template devcb_base &set_txd_handler(Object &&cb) { return m_txd_handler.set_callback(std::forward(cb)); } DECLARE_WRITE_LINE_MEMBER( write_rxd ); diff --git a/src/mame/machine/x820kb.h b/src/mame/machine/x820kb.h index 4c56abf8d0d..1a17b8d3123 100644 --- a/src/mame/machine/x820kb.h +++ b/src/mame/machine/x820kb.h @@ -20,7 +20,7 @@ //************************************************************************** #define MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(_devcb) \ - devcb = &xerox_820_keyboard_device::set_kbstb_wr_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_kbstb_wr_callback(DEVCB_##_devcb); @@ -36,7 +36,7 @@ public: // construction/destruction xerox_820_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template static devcb_base &set_kbstb_wr_callback(device_t &device, Object &&cb) { return downcast(device).m_kbstb_cb.set_callback(std::forward(cb)); } + template devcb_base &set_kbstb_wr_callback(Object &&cb) { return m_kbstb_cb.set_callback(std::forward(cb)); } uint8_t read() { return m_bus; } diff --git a/src/mame/machine/znmcu.h b/src/mame/machine/znmcu.h index 2c97e21a128..8603bac7eb8 100644 --- a/src/mame/machine/znmcu.h +++ b/src/mame/machine/znmcu.h @@ -9,31 +9,31 @@ DECLARE_DEVICE_TYPE(ZNMCU, znmcu_device) #define MCFG_ZNMCU_DATAOUT_HANDLER(_devcb) \ - devcb = &znmcu_device::set_dataout_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dataout_handler(DEVCB_##_devcb); #define MCFG_ZNMCU_DSR_HANDLER(_devcb) \ - devcb = &znmcu_device::set_dsr_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dsr_handler(DEVCB_##_devcb); #define MCFG_ZNMCU_DSW_HANDLER(_devcb) \ - devcb = &znmcu_device::set_dsw_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_dsw_handler(DEVCB_##_devcb); #define MCFG_ZNMCU_ANALOG1_HANDLER(_devcb) \ - devcb = &znmcu_device::set_analog1_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_analog1_handler(DEVCB_##_devcb); #define MCFG_ZNMCU_ANALOG2_HANDLER(_devcb) \ - devcb = &znmcu_device::set_analog2_handler(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_analog2_handler(DEVCB_##_devcb); class znmcu_device : public device_t { public: znmcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // static configuration helpers - template static devcb_base &set_dsw_handler(device_t &device, Object &&cb) { return downcast(device).m_dsw_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_analog1_handler(device_t &device, Object &&cb) { return downcast(device).m_analog1_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_analog2_handler(device_t &device, Object &&cb) { return downcast(device).m_analog2_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_dataout_handler(device_t &device, Object &&cb) { return downcast(device).m_dataout_handler.set_callback(std::forward(cb)); } - template static devcb_base &set_dsr_handler(device_t &device, Object &&cb) { return downcast(device).m_dsr_handler.set_callback(std::forward(cb)); } + // configuration helpers + template devcb_base &set_dsw_handler(Object &&cb) { return m_dsw_handler.set_callback(std::forward(cb)); } + template devcb_base &set_analog1_handler(Object &&cb) { return m_analog1_handler.set_callback(std::forward(cb)); } + template devcb_base &set_analog2_handler(Object &&cb) { return m_analog2_handler.set_callback(std::forward(cb)); } + template devcb_base &set_dataout_handler(Object &&cb) { return m_dataout_handler.set_callback(std::forward(cb)); } + template devcb_base &set_dsr_handler(Object &&cb) { return m_dsr_handler.set_callback(std::forward(cb)); } WRITE_LINE_MEMBER(write_select); WRITE_LINE_MEMBER(write_clock); diff --git a/src/mame/machine/zorbakbd.h b/src/mame/machine/zorbakbd.h index 8fe8c99d6a7..2a60738d4c5 100644 --- a/src/mame/machine/zorbakbd.h +++ b/src/mame/machine/zorbakbd.h @@ -11,13 +11,12 @@ DECLARE_DEVICE_TYPE(ZORBA_KEYBOARD, zorba_keyboard_device) #define MCFG_ZORBA_KEYBOARD_RXD_CB(cb) \ - zorba_keyboard_device::set_rxd_cb(*device, DEVCB_##cb); + downcast(*device).set_rxd_cb(DEVCB_##cb); class zorba_keyboard_device : public device_t { public: - template static devcb_base &set_rxd_cb(device_t &device, Obj &&cb) - { return downcast(device).m_rxd_cb.set_callback(std::forward(cb)); } + template devcb_base &set_rxd_cb(Obj &&cb) { return m_rxd_cb.set_callback(std::forward(cb)); } zorba_keyboard_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/zs01.h b/src/mame/machine/zs01.h index 60611ade967..a1c98f7c686 100644 --- a/src/mame/machine/zs01.h +++ b/src/mame/machine/zs01.h @@ -17,7 +17,7 @@ #define MCFG_ZS01_ADD( _tag ) \ MCFG_DEVICE_ADD( _tag, ZS01, 0 ) #define MCFG_ZS01_DS2401( ds2401_tag ) \ - zs01_device::static_set_ds2401_tag( *device, ds2401_tag ); + downcast(*device).set_ds2401_tag( ds2401_tag ); class zs01_device : public device_t, public device_nvram_interface @@ -27,7 +27,7 @@ public: zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // inline configuration helpers - static void static_set_ds2401_tag( device_t &device, const char *ds2401_tag ) { downcast( device ).m_ds2401_tag = ds2401_tag; } + void set_ds2401_tag( const char *ds2401_tag ) { m_ds2401_tag = ds2401_tag; } DECLARE_WRITE_LINE_MEMBER( write_cs ); DECLARE_WRITE_LINE_MEMBER( write_rst ); diff --git a/src/mame/machine/zx8302.h b/src/mame/machine/zx8302.h index a2a96de72ba..f04ddb7c687 100644 --- a/src/mame/machine/zx8302.h +++ b/src/mame/machine/zx8302.h @@ -41,49 +41,49 @@ ///************************************************************************* #define MCFG_ZX8302_RTC_CLOCK(_clk) \ - zx8302_device::set_rtc_clock(*device, _clk); + downcast(*device).set_rtc_clock(_clk); #define MCFG_ZX8302_OUT_IPL1L_CB(_devcb) \ - devcb = &zx8302_device::set_out_ipl1l_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_ipl1l_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_BAUDX4_CB(_devcb) \ - devcb = &zx8302_device::set_out_baudx4_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_baudx4_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_COMDATA_CB(_devcb) \ - devcb = &zx8302_device::set_out_comdata_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_comdata_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_TXD1_CB(_devcb) \ - devcb = &zx8302_device::set_out_txd1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_txd1_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_TXD2_CB(_devcb) \ - devcb = &zx8302_device::set_out_txd2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_txd2_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_NETOUT_CB(_devcb) \ - devcb = &zx8302_device::set_out_netout_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_netout_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_MDSELCK_CB(_devcb) \ - devcb = &zx8302_device::set_out_mdselck_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_mdselck_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_MDSELD_CB(_devcb) \ - devcb = &zx8302_device::set_out_mdseld_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_mdseld_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_MDRDW_CB(_devcb) \ - devcb = &zx8302_device::set_out_mdrdw_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_mdrdw_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_ERASE_CB(_devcb) \ - devcb = &zx8302_device::set_out_erase_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_erase_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_RAW1_CB(_devcb) \ - devcb = &zx8302_device::set_out_raw1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_raw1_callback(DEVCB_##_devcb); #define MCFG_ZX8302_IN_RAW1_CB(_devcb) \ - devcb = &zx8302_device::set_in_raw1_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_raw1_callback(DEVCB_##_devcb); #define MCFG_ZX8302_OUT_RAW2_CB(_devcb) \ - devcb = &zx8302_device::set_out_raw2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_out_raw2_callback(DEVCB_##_devcb); #define MCFG_ZX8302_IN_RAW2_CB(_devcb) \ - devcb = &zx8302_device::set_in_raw2_callback(*device, DEVCB_##_devcb); + devcb = &downcast(*device).set_in_raw2_callback(DEVCB_##_devcb); ///************************************************************************* @@ -99,22 +99,22 @@ public: // construction/destruction zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_rtc_clock(device_t &device, int rtc_clock) { downcast(device).m_rtc_clock = rtc_clock; } - static void set_rtc_clock(device_t &device, const XTAL &rtc_clock) { set_rtc_clock(device, rtc_clock.value()); } - template static devcb_base &set_out_ipl1l_callback(device_t &device, Object &&cb) { return downcast(device).m_out_ipl1l_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_baudx4_callback(device_t &device, Object &&cb) { return downcast(device).m_out_baudx4_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_comdata_callback(device_t &device, Object &&cb) { return downcast(device).m_out_comdata_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_txd1_callback(device_t &device, Object &&cb) { return downcast(device).m_out_txd1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_txd2_callback(device_t &device, Object &&cb) { return downcast(device).m_out_txd2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_netout_callback(device_t &device, Object &&cb) { return downcast(device).m_out_netout_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_mdselck_callback(device_t &device, Object &&cb) { return downcast(device).m_out_mdselck_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_mdseld_callback(device_t &device, Object &&cb) { return downcast(device).m_out_mdseld_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_mdrdw_callback(device_t &device, Object &&cb) { return downcast(device).m_out_mdrdw_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_erase_callback(device_t &device, Object &&cb) { return downcast(device).m_out_erase_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_raw1_callback(device_t &device, Object &&cb) { return downcast(device).m_out_raw1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_raw1_callback(device_t &device, Object &&cb) { return downcast(device).m_in_raw1_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_out_raw2_callback(device_t &device, Object &&cb) { return downcast(device).m_out_raw2_cb.set_callback(std::forward(cb)); } - template static devcb_base &set_in_raw2_callback(device_t &device, Object &&cb) { return downcast(device).m_in_raw2_cb.set_callback(std::forward(cb)); } + void set_rtc_clock(int rtc_clock) { m_rtc_clock = rtc_clock; } + void set_rtc_clock(const XTAL &rtc_clock) { set_rtc_clock(rtc_clock.value()); } + template devcb_base &set_out_ipl1l_callback(Object &&cb) { return m_out_ipl1l_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_baudx4_callback(Object &&cb) { return m_out_baudx4_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_comdata_callback(Object &&cb) { return m_out_comdata_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_txd1_callback(Object &&cb) { return m_out_txd1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_txd2_callback(Object &&cb) { return m_out_txd2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_netout_callback(Object &&cb) { return m_out_netout_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_mdselck_callback(Object &&cb) { return m_out_mdselck_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_mdseld_callback(Object &&cb) { return m_out_mdseld_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_mdrdw_callback(Object &&cb) { return m_out_mdrdw_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_erase_callback(Object &&cb) { return m_out_erase_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_raw1_callback(Object &&cb) { return m_out_raw1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_in_raw1_callback(Object &&cb) { return m_in_raw1_cb.set_callback(std::forward(cb)); } + template devcb_base &set_out_raw2_callback(Object &&cb) { return m_out_raw2_cb.set_callback(std::forward(cb)); } + template devcb_base &set_in_raw2_callback(Object &&cb) { return m_in_raw2_cb.set_callback(std::forward(cb)); } DECLARE_READ8_MEMBER( rtc_r ); DECLARE_WRITE8_MEMBER( rtc_w ); diff --git a/src/mame/video/atarimo.cpp b/src/mame/video/atarimo.cpp index f2893be0376..35a63f30a38 100644 --- a/src/mame/video/atarimo.cpp +++ b/src/mame/video/atarimo.cpp @@ -153,27 +153,6 @@ atari_motion_objects_device::atari_motion_objects_device(const machine_config &m { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void atari_motion_objects_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// set_config: Set the tag of the -// sound CPU -//------------------------------------------------- - -void atari_motion_objects_device::set_config(const atari_motion_objects_config &config) -{ - static_cast(*this) = config; -} - - //------------------------------------------------- // draw: Render the motion objects to the // destination bitmap. diff --git a/src/mame/video/atarimo.h b/src/mame/video/atarimo.h index f9de759a5d4..44e60b5ea06 100644 --- a/src/mame/video/atarimo.h +++ b/src/mame/video/atarimo.h @@ -86,8 +86,8 @@ public: atari_motion_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_config(const atari_motion_objects_config &config); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_config(const atari_motion_objects_config &config) { static_cast(*this) = config; } // getters int bank() const { return m_bank; } diff --git a/src/mame/video/atarirle.cpp b/src/mame/video/atarirle.cpp index 7897ef20042..5c54a2a785d 100644 --- a/src/mame/video/atarirle.cpp +++ b/src/mame/video/atarirle.cpp @@ -75,17 +75,6 @@ atari_rle_objects_device::atari_rle_objects_device(const machine_config &mconfig } -//------------------------------------------------- -// set_config: Set the tag of the -// sound CPU -//------------------------------------------------- - -void atari_rle_objects_device::set_config(const atari_rle_objects_config &config) -{ - static_cast(*this) = config; -} - - //------------------------------------------------- // control_write: Write handler for MO control // bits. diff --git a/src/mame/video/atarirle.h b/src/mame/video/atarirle.h index a75cc336d79..b186da631fa 100644 --- a/src/mame/video/atarirle.h +++ b/src/mame/video/atarirle.h @@ -81,7 +81,7 @@ public: atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - void set_config(const atari_rle_objects_config &config); + void set_config(const atari_rle_objects_config &config) { static_cast(*this) = config; } // control handlers DECLARE_WRITE8_MEMBER(control_write); diff --git a/src/mame/video/avgdvg.cpp b/src/mame/video/avgdvg.cpp index 3b9e9db4392..7e711db10e3 100644 --- a/src/mame/video/avgdvg.cpp +++ b/src/mame/video/avgdvg.cpp @@ -43,16 +43,6 @@ * *************************************/ -void avgdvg_device::set_flip_x(int flip) -{ - flip_x = flip; -} - -void avgdvg_device::set_flip_y(int flip) -{ - flip_y = flip; -} - void avgdvg_device::apply_flipping(int *x, int *y) { if (flip_x) @@ -1462,11 +1452,6 @@ void dvg_device::device_start() register_state(); } -void avgdvg_device::set_vector_tag(const char *tag) -{ - m_vector.set_tag(tag); -} - avgdvg_device::avgdvg_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_vector(*this, finder_base::DUMMY_TAG) diff --git a/src/mame/video/avgdvg.h b/src/mame/video/avgdvg.h index 98bcba69f6e..812dc290740 100644 --- a/src/mame/video/avgdvg.h +++ b/src/mame/video/avgdvg.h @@ -16,7 +16,7 @@ class avgdvg_device : public device_t { public: - void set_vector_tag(const char *tag); + void set_vector_tag(const char *tag) { m_vector.set_tag(tag); } DECLARE_CUSTOM_INPUT_MEMBER(done_r); DECLARE_WRITE8_MEMBER(go_w); @@ -26,8 +26,8 @@ public: DECLARE_WRITE16_MEMBER(reset_word_w); /* Tempest and Quantum use this capability */ - void set_flip_x(int flip); - void set_flip_y(int flip); + void set_flip_x(int flip) { flip_x = flip; } + void set_flip_y(int flip) { flip_y = flip; } TIMER_CALLBACK_MEMBER(vg_set_halt_callback); TIMER_CALLBACK_MEMBER(run_state_machine); diff --git a/src/mame/video/decbac06.cpp b/src/mame/video/decbac06.cpp index 87f43a58d4a..5e56f533083 100644 --- a/src/mame/video/decbac06.cpp +++ b/src/mame/video/decbac06.cpp @@ -93,16 +93,6 @@ deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char * } } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void deco_bac06_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - void deco_bac06_device::device_start() { if(!m_gfxdecode->started()) @@ -134,13 +124,6 @@ void deco_bac06_device::device_reset() { } -void deco_bac06_device::set_gfx_region_wide(int region8x8, int region16x16, int wide) -{ - m_gfxregion8x8 = region8x8; - m_gfxregion16x16 = region16x16; - m_wide = wide; -} - void deco_bac06_device::set_flip_screen(bool flip) { if (m_flip_screen != flip) diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h index 6fc4b8ae98b..7b7e19a0d8f 100644 --- a/src/mame/video/decbac06.h +++ b/src/mame/video/decbac06.h @@ -23,8 +23,13 @@ public: deco_bac06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_gfx_region_wide(int region8x8, int region16x16, int wide); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region_wide(int region8x8, int region16x16, int wide) + { + m_gfxregion8x8 = region8x8; + m_gfxregion16x16 = region16x16; + m_wide = wide; + } void disable_8x8() { m_supports_8x8 = false; } void disable_16x16() { m_supports_16x16 = false; } void disable_rc_scroll() { m_supports_rc_scroll = false; } diff --git a/src/mame/video/deckarn.cpp b/src/mame/video/deckarn.cpp index 5d5b18e8c32..91186d1f57b 100644 --- a/src/mame/video/deckarn.cpp +++ b/src/mame/video/deckarn.cpp @@ -6,11 +6,6 @@ #include "emu.h" #include "deckarn.h" -void deco_karnovsprites_device::set_gfx_region(int region) -{ - m_gfxregion = region; -} - DEFINE_DEVICE_TYPE(DECO_KARNOVSPRITES, deco_karnovsprites_device, "deco_karnovsprites", "DECO Karnov Sprites") deco_karnovsprites_device::deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -20,16 +15,6 @@ deco_karnovsprites_device::deco_karnovsprites_device(const machine_config &mconf { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void deco_karnovsprites_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - void deco_karnovsprites_device::device_start() { m_flip_screen = false; diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h index a9c5b62d51e..ef76cffd402 100644 --- a/src/mame/video/deckarn.h +++ b/src/mame/video/deckarn.h @@ -15,8 +15,8 @@ public: void set_flip_screen(bool flip) { m_flip_screen = flip; } // configuration - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int region); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int region) { m_gfxregion = region; } protected: virtual void device_start() override; diff --git a/src/mame/video/decmxc06.cpp b/src/mame/video/decmxc06.cpp index f61b3fbbde4..76e15e189cc 100644 --- a/src/mame/video/decmxc06.cpp +++ b/src/mame/video/decmxc06.cpp @@ -41,11 +41,6 @@ todo: #include "decmxc06.h" #include "screen.h" -void deco_mxc06_device::set_gfx_region(int region) -{ - m_gfxregion = region; -} - DEFINE_DEVICE_TYPE(DECO_MXC06, deco_mxc06_device, "deco_mxc06", "DECO MXC06 Sprite") @@ -58,17 +53,6 @@ deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char * { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void deco_mxc06_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - /* this implementation was originally from Mad Motor */ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int pri_mask, int pri_val, int col_mask ) { diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index 154092813ac..95c8046d874 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -12,8 +12,8 @@ public: deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int region); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int region) { m_gfxregion = region; } void set_ram_size(int size) { m_ramsize = size; } void set_gfxregion(int region) { m_gfxregion = region; }; diff --git a/src/mame/video/deco16ic.cpp b/src/mame/video/deco16ic.cpp index afe0cf7e797..6223c46350b 100644 --- a/src/mame/video/deco16ic.cpp +++ b/src/mame/video/deco16ic.cpp @@ -206,16 +206,6 @@ deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void deco16ic_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 382d56c16c3..7906cb364a5 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -33,8 +33,8 @@ public: ~deco16ic_device() {} // configuration - void set_gfxdecode_tag(const char *tag); - void set_palette_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } +// void set_palette_tag(const char *tag); void set_bank1_callback(deco16_bank_cb_delegate callback) { m_bank1_cb = callback; } void set_bank2_callback(deco16_bank_cb_delegate callback) { m_bank2_cb = callback; } void set_split(int split) { m_split = split; } diff --git a/src/mame/video/deco_ace.cpp b/src/mame/video/deco_ace.cpp index bc360fba624..9fa582c0d68 100644 --- a/src/mame/video/deco_ace.cpp +++ b/src/mame/video/deco_ace.cpp @@ -73,16 +73,6 @@ deco_ace_device::deco_ace_device(const machine_config &mconfig, const char *tag, { } -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void deco_ace_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/deco_ace.h b/src/mame/video/deco_ace.h index e43f00ad5ff..b1ed3547a27 100644 --- a/src/mame/video/deco_ace.h +++ b/src/mame/video/deco_ace.h @@ -27,7 +27,7 @@ public: deco_ace_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_palette_tag(const char *tag); + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } DECLARE_READ32_MEMBER( buffered_palette_r ); DECLARE_READ16_MEMBER( buffered_palette16_r ); diff --git a/src/mame/video/deco_zoomspr.cpp b/src/mame/video/deco_zoomspr.cpp index c8266df83e6..d63941c62a4 100644 --- a/src/mame/video/deco_zoomspr.cpp +++ b/src/mame/video/deco_zoomspr.cpp @@ -21,17 +21,6 @@ deco_zoomspr_device::deco_zoomspr_device(const machine_config &mconfig, const ch { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void deco_zoomspr_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - void deco_zoomspr_device::device_start() { } diff --git a/src/mame/video/deco_zoomspr.h b/src/mame/video/deco_zoomspr.h index 306bc718b21..b26d54c3feb 100644 --- a/src/mame/video/deco_zoomspr.h +++ b/src/mame/video/deco_zoomspr.h @@ -11,7 +11,7 @@ class deco_zoomspr_device : public device_t public: deco_zoomspr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void dragngun_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint32_t *spritedata, uint32_t* dragngun_sprite_layout_0_ram, uint32_t* dragngun_sprite_layout_1_ram, uint32_t* dragngun_sprite_lookup_0_ram, uint32_t* dragngun_sprite_lookup_1_ram, uint32_t dragngun_sprite_ctrl, bitmap_ind8 &pri_bitmap, bitmap_rgb32 &temp_bitmap); diff --git a/src/mame/video/decocomn.cpp b/src/mame/video/decocomn.cpp index a22444754ac..b8c7955a106 100644 --- a/src/mame/video/decocomn.cpp +++ b/src/mame/video/decocomn.cpp @@ -22,16 +22,6 @@ decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag, { } -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void decocomn_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/decocomn.h b/src/mame/video/decocomn.h index 7dc5f0ebabb..77c19e42023 100644 --- a/src/mame/video/decocomn.h +++ b/src/mame/video/decocomn.h @@ -23,7 +23,7 @@ public: decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_palette_tag(const char *tag); + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } DECLARE_WRITE16_MEMBER( buffered_palette_w ); DECLARE_WRITE16_MEMBER( palette_dma_w ); diff --git a/src/mame/video/decodmd1.cpp b/src/mame/video/decodmd1.cpp index bb676f75e84..09bfa6049da 100644 --- a/src/mame/video/decodmd1.cpp +++ b/src/mame/video/decodmd1.cpp @@ -266,11 +266,6 @@ void decodmd_type1_device::device_reset() m_frameswap = false; } -void decodmd_type1_device::set_gfxregion(const char *tag) -{ - m_gfxtag = tag; -} - uint32_t decodmd_type1_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { uint8_t ptr = 0; diff --git a/src/mame/video/decodmd1.h b/src/mame/video/decodmd1.h index 4c2624655a4..f94fb3da776 100644 --- a/src/mame/video/decodmd1.h +++ b/src/mame/video/decodmd1.h @@ -45,7 +45,7 @@ public: DECLARE_WRITE_LINE_MEMBER(rowclock_w); DECLARE_WRITE_LINE_MEMBER(test_w); - void set_gfxregion(const char *tag); + void set_gfxregion(const char *tag) { m_gfxtag = tag; } void decodmd1_io_map(address_map &map); void decodmd1_map(address_map &map); diff --git a/src/mame/video/decodmd2.cpp b/src/mame/video/decodmd2.cpp index f86e4d256c3..8aa6de58523 100644 --- a/src/mame/video/decodmd2.cpp +++ b/src/mame/video/decodmd2.cpp @@ -187,8 +187,3 @@ void decodmd_type2_device::device_reset() m_rambank->set_entry(0); m_busy = false; } - -void decodmd_type2_device::set_gfxregion(const char *tag) -{ - m_gfxtag = tag; -} diff --git a/src/mame/video/decodmd2.h b/src/mame/video/decodmd2.h index 0d0d69d1a2b..c2fd8701f1b 100644 --- a/src/mame/video/decodmd2.h +++ b/src/mame/video/decodmd2.h @@ -35,7 +35,7 @@ public: DECLARE_READ8_MEMBER(status_r); DECLARE_WRITE8_MEMBER(status_w); - void set_gfxregion(const char *tag); + void set_gfxregion(const char *tag) { m_gfxtag = tag; } void decodmd2_map(address_map &map); protected: diff --git a/src/mame/video/decodmd3.cpp b/src/mame/video/decodmd3.cpp index 75bcac915e9..b2db6eda1ee 100644 --- a/src/mame/video/decodmd3.cpp +++ b/src/mame/video/decodmd3.cpp @@ -183,8 +183,3 @@ void decodmd_type3_device::device_reset() m_rombank->configure_entry(0, &ROM[0]); m_rombank->set_entry(0); } - -void decodmd_type3_device::set_gfxregion(const char *tag) -{ - m_gfxtag = tag; -} diff --git a/src/mame/video/decodmd3.h b/src/mame/video/decodmd3.h index cc67b26a41c..e077c8a6a90 100644 --- a/src/mame/video/decodmd3.h +++ b/src/mame/video/decodmd3.h @@ -33,7 +33,7 @@ public: DECLARE_WRITE16_MEMBER(crtc_register_w); DECLARE_READ16_MEMBER(crtc_status_r); - void set_gfxregion(const char *tag); + void set_gfxregion(const char *tag) { m_gfxtag = tag; } void decodmd3_map(address_map &map); protected: diff --git a/src/mame/video/decospr.cpp b/src/mame/video/decospr.cpp index 7f0f66fe2dc..ba893bf3726 100644 --- a/src/mame/video/decospr.cpp +++ b/src/mame/video/decospr.cpp @@ -139,12 +139,6 @@ DECOSPR_COLOUR_CB_MEMBER(decospr_device::default_col_cb) return (col >> 9) & 0x1f; } -void decospr_device::set_gfx_region(int gfxregion) -{ - m_gfxregion = gfxregion; -// printf("decospr_device::set_gfx_region()\n"); -} - DEFINE_DEVICE_TYPE(DECO_SPRITE, decospr_device, "decospr", "DECO 52 Sprite") decospr_device::decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -163,16 +157,6 @@ decospr_device::decospr_device(const machine_config &mconfig, const char *tag, d m_col_cb = decospr_col_cb_delegate(FUNC(decospr_device::default_col_cb), this); } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void decospr_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - void decospr_device::device_start() { m_pri_cb.bind_relative_to(*owner()); diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index 38489ae631d..f1a2922ed97 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -20,8 +20,8 @@ public: decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int gfxregion); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int gfxregion) { m_gfxregion = gfxregion; } void set_pri_callback(decospr_pri_cb_delegate callback) { m_pri_cb = callback; } void set_col_callback(decospr_col_cb_delegate callback) { m_col_cb = callback; } void set_is_bootleg(bool is_bootleg) { m_is_bootleg = is_bootleg; } diff --git a/src/mame/video/decrmc3.cpp b/src/mame/video/decrmc3.cpp index 35dba63dd22..cf7faeb23ab 100644 --- a/src/mame/video/decrmc3.cpp +++ b/src/mame/video/decrmc3.cpp @@ -29,34 +29,6 @@ deco_rmc3_device::deco_rmc3_device(const machine_config &mconfig, const char *ta } -//************************************************************************** -// INITIALIZATION AND CONFIGURATION -//************************************************************************** - -void deco_rmc3_device::set_init(deco_rmc3_palette_init_delegate init) -{ - m_init = init; -} - - -void deco_rmc3_device::set_entries(u32 entries) -{ - m_entries = entries; -} - - -void deco_rmc3_device::set_indirect_entries(u32 entries) -{ - m_indirect_entries = entries; -} - -void deco_rmc3_device::set_prom_region(const char *region) -{ - m_prom_region.set_tag(region); -} - - - //************************************************************************** // GENERIC WRITE HANDLERS //************************************************************************** diff --git a/src/mame/video/decrmc3.h b/src/mame/video/decrmc3.h index 2f7a850f86b..01714719d27 100644 --- a/src/mame/video/decrmc3.h +++ b/src/mame/video/decrmc3.h @@ -62,12 +62,12 @@ public: deco_rmc3_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration - void set_init(deco_rmc3_palette_init_delegate init); - void set_membits(int membits); - void set_endianness(endianness_t endianness); - void set_entries(u32 entries); - void set_indirect_entries(u32 entries); - void set_prom_region(const char *region); + void set_init(deco_rmc3_palette_init_delegate init) { m_init = init; } +// void set_membits(int membits); +// void set_endianness(endianness_t endianness); + void set_entries(u32 entries) { m_entries = entries; } + void set_indirect_entries(u32 entries) { m_indirect_entries = entries; } + void set_prom_region(const char *region) { m_prom_region.set_tag(region); } // palette RAM accessors memory_array &basemem() { return m_paletteram; } diff --git a/src/mame/video/dooyong.cpp b/src/mame/video/dooyong.cpp index e1d3986687a..7dc8c1f5a62 100644 --- a/src/mame/video/dooyong.cpp +++ b/src/mame/video/dooyong.cpp @@ -35,16 +35,6 @@ dooyong_tilemap_device_base::dooyong_tilemap_device_base( { } -void dooyong_tilemap_device_base::set_gfxdecode_tag(char const *tag) -{ - m_gfxdecode.set_tag(tag); -} - -void dooyong_tilemap_device_base::set_gfxnum(int gfxnum) -{ - m_gfxnum = gfxnum; -} - void dooyong_tilemap_device_base::draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority) { m_tilemap->draw(screen, dest, cliprect, flags, priority); @@ -83,28 +73,6 @@ dooyong_rom_tilemap_device::dooyong_rom_tilemap_device( { } -void dooyong_rom_tilemap_device::set_tilerom_tag(char const *tag) -{ - m_tilerom.set_tag(tag); -} - -void dooyong_rom_tilemap_device::set_tilerom_offset(int offset) -{ - m_tilerom_offset = offset; -} - -void dooyong_rom_tilemap_device::set_transparent_pen(unsigned pen) -{ - m_transparent_pen = pen; -} - -void dooyong_rom_tilemap_device::set_primella_code_bits(unsigned bits) -{ - m_primella_code_mask = (1U << bits) - 1U; - m_primella_color_mask = ((1U << 14) - 1) & ~m_primella_code_mask; - m_primella_color_shift = bits; -} - WRITE8_MEMBER(dooyong_rom_tilemap_device::ctrl_w) { offset &= 0x07U; @@ -210,16 +178,6 @@ rshark_rom_tilemap_device::rshark_rom_tilemap_device(machine_config const &mconf m_rows = 32; } -void rshark_rom_tilemap_device::set_colorrom_tag(char const *tag) -{ - m_colorrom.set_tag(tag); -} - -void rshark_rom_tilemap_device::set_colorrom_offset(int offset) -{ - m_colorrom_offset = offset; -} - void rshark_rom_tilemap_device::device_start() { dooyong_rom_tilemap_device::device_start(); diff --git a/src/mame/video/dooyong.h b/src/mame/video/dooyong.h index 1fc8287e213..787b788eeec 100644 --- a/src/mame/video/dooyong.h +++ b/src/mame/video/dooyong.h @@ -42,8 +42,8 @@ DECLARE_DEVICE_TYPE(DOOYONG_RAM_TILEMAP, dooyong_ram_tilemap_device) class dooyong_tilemap_device_base : public device_t { public: - void set_gfxdecode_tag(char const *tag); - void set_gfxnum(int gfxnum); + void set_gfxdecode_tag(char const *tag) { m_gfxdecode.set_tag(tag); } + void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; } void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority); @@ -71,10 +71,15 @@ class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base public: dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); - void set_tilerom_tag(char const *tag); - void set_tilerom_offset(int offset); - void set_transparent_pen(unsigned pen); - void set_primella_code_bits(unsigned bits); + void set_tilerom_tag(char const *tag) { m_tilerom.set_tag(tag); } + void set_tilerom_offset(int offset) { m_tilerom_offset = offset; } + void set_transparent_pen(unsigned pen) { m_transparent_pen = pen; } + void set_primella_code_bits(unsigned bits) + { + m_primella_code_mask = (1U << bits) - 1U; + m_primella_color_mask = ((1U << 14) - 1) & ~m_primella_code_mask; + m_primella_color_shift = bits; + } DECLARE_WRITE8_MEMBER(ctrl_w); @@ -111,8 +116,8 @@ class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device public: rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); - void set_colorrom_tag(char const *tag); - void set_colorrom_offset(int offset); + void set_colorrom_tag(char const *tag) { m_colorrom.set_tag(tag); } + void set_colorrom_offset(int offset) { m_colorrom_offset = offset; } protected: virtual void device_start() override; diff --git a/src/mame/video/fuukifg.cpp b/src/mame/video/fuukifg.cpp index 3f70fbfda1c..16a615750b4 100644 --- a/src/mame/video/fuukifg.cpp +++ b/src/mame/video/fuukifg.cpp @@ -16,12 +16,6 @@ fuukivid_device::fuukivid_device(const machine_config &mconfig, const char *tag, { } -void fuukivid_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - void fuukivid_device::device_start() { m_sprram = make_unique_clear(0x2000 / 2); diff --git a/src/mame/video/fuukifg.h b/src/mame/video/fuukifg.h index 365b4b00fc7..209de2bde9c 100644 --- a/src/mame/video/fuukifg.h +++ b/src/mame/video/fuukifg.h @@ -13,7 +13,7 @@ public: fuukivid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip_screen, uint32_t* tilebank); std::unique_ptr m_sprram; diff --git a/src/mame/video/igs017_igs031.cpp b/src/mame/video/igs017_igs031.cpp index 3008f50a63c..9af3e93b9c2 100644 --- a/src/mame/video/igs017_igs031.cpp +++ b/src/mame/video/igs017_igs031.cpp @@ -105,12 +105,6 @@ uint16_t igs017_igs031_device::palette_callback_straight(uint16_t bgr) } -void igs017_igs031_device::set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate newtilecb) -{ - m_palette_scramble_cb = newtilecb; -} - - void igs017_igs031_device::device_start() { m_palette_scramble_cb.bind_relative_to(*owner()); diff --git a/src/mame/video/igs017_igs031.h b/src/mame/video/igs017_igs031.h index 3a5b27e0546..1c8d2a372f6 100644 --- a/src/mame/video/igs017_igs031.h +++ b/src/mame/video/igs017_igs031.h @@ -24,7 +24,7 @@ public: igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate newtilecb); + void set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate newtilecb) { m_palette_scramble_cb = newtilecb; } void set_text_reverse_bits() { diff --git a/src/mame/video/k001005.cpp b/src/mame/video/k001005.cpp index aa2c9f4f455..dabed4b5966 100644 --- a/src/mame/video/k001005.cpp +++ b/src/mame/video/k001005.cpp @@ -1461,8 +1461,3 @@ void k001005_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect ) { m_renderer->draw(bitmap, cliprect); } - -void k001005_device::set_texel_chip(const char *tag) -{ - m_k001006_tag = tag; -} diff --git a/src/mame/video/k001005.h b/src/mame/video/k001005.h index e20dcd811d8..1dc6cd745d9 100644 --- a/src/mame/video/k001005.h +++ b/src/mame/video/k001005.h @@ -104,7 +104,7 @@ class k001005_device : public device_t, public device_video_interface public: k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_texel_chip(const char *tag); + void set_texel_chip(const char *tag) { m_k001006_tag = tag; } void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect); void swap_buffers(); diff --git a/src/mame/video/k007121.cpp b/src/mame/video/k007121.cpp index c3ce1110827..e5bae691d41 100644 --- a/src/mame/video/k007121.cpp +++ b/src/mame/video/k007121.cpp @@ -347,13 +347,3 @@ void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre source += inc; } } - -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k007121_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} diff --git a/src/mame/video/k007121.h b/src/mame/video/k007121.h index b02fa78804c..21ea8d1bb68 100644 --- a/src/mame/video/k007121.h +++ b/src/mame/video/k007121.h @@ -11,7 +11,7 @@ class k007121_device : public device_t public: k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_palette_tag(const char *tag); + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } uint8_t ctrlram_r(int offset); DECLARE_WRITE8_MEMBER( ctrl_w ); diff --git a/src/mame/video/k007342.cpp b/src/mame/video/k007342.cpp index 37d09eea145..337013abae6 100644 --- a/src/mame/video/k007342.cpp +++ b/src/mame/video/k007342.cpp @@ -56,16 +56,6 @@ k007342_device::k007342_device(const machine_config &mconfig, const char *tag, d { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k007342_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/k007342.h b/src/mame/video/k007342.h index 734ab40fc97..684796ca463 100644 --- a/src/mame/video/k007342.h +++ b/src/mame/video/k007342.h @@ -14,7 +14,7 @@ public: k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; } void set_callback(k007342_delegate callback) { m_callback = callback; } diff --git a/src/mame/video/k007420.cpp b/src/mame/video/k007420.cpp index db5a1052cc5..f90b8551c07 100644 --- a/src/mame/video/k007420.cpp +++ b/src/mame/video/k007420.cpp @@ -248,13 +248,3 @@ void k007420_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre } #endif } - -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k007420_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} diff --git a/src/mame/video/k007420.h b/src/mame/video/k007420.h index 50c19d0a5ef..37fda922a6f 100644 --- a/src/mame/video/k007420.h +++ b/src/mame/video/k007420.h @@ -13,7 +13,7 @@ class k007420_device : public device_t public: k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_palette_tag(const char *tag); + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } void set_bank_limit(int limit) { m_banklimit = limit; } void set_callback(k007420_delegate callback) { m_callback = callback; } diff --git a/src/mame/video/k051960.cpp b/src/mame/video/k051960.cpp index 96339beec43..bf78ecdfceb 100644 --- a/src/mame/video/k051960.cpp +++ b/src/mame/video/k051960.cpp @@ -166,15 +166,6 @@ void k051960_device::set_plane_order(int order) } } -//------------------------------------------------- -// set_screen_tag - set screen we are attached to -//------------------------------------------------- - -void k051960_device::set_screen_tag(const char *tag) -{ - m_screen.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/k051960.h b/src/mame/video/k051960.h index 047d9f084fc..83e8c8485b8 100644 --- a/src/mame/video/k051960.h +++ b/src/mame/video/k051960.h @@ -62,7 +62,7 @@ public: // static configuration void set_k051960_callback(k051960_cb_delegate callback) { m_k051960_cb = callback; } void set_plane_order(int order); - void set_screen_tag(const char *tag); + void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } /* The callback is passed: diff --git a/src/mame/video/k052109.cpp b/src/mame/video/k052109.cpp index f8c4b45e519..bdb6d4fb6c1 100644 --- a/src/mame/video/k052109.cpp +++ b/src/mame/video/k052109.cpp @@ -275,16 +275,6 @@ void k052109_device::device_reset() } } -//------------------------------------------------- -// set_screen_tag - set screen we are attached to -//------------------------------------------------- - -void k052109_device::set_screen_tag(const char *tag) -{ - m_screen.set_tag(tag); -} - - /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ diff --git a/src/mame/video/k052109.h b/src/mame/video/k052109.h index 355b8ba26bd..ee28d8fbd87 100644 --- a/src/mame/video/k052109.h +++ b/src/mame/video/k052109.h @@ -39,7 +39,7 @@ public: void set_k052109_callback(k052109_cb_delegate callback) { m_k052109_cb = callback; } void set_ram(bool ram); - void set_screen_tag(const char *tag); + void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } /* The callback is passed: diff --git a/src/mame/video/k053250.cpp b/src/mame/video/k053250.cpp index 1aa7165253b..b47518911a5 100644 --- a/src/mame/video/k053250.cpp +++ b/src/mame/video/k053250.cpp @@ -15,12 +15,6 @@ k053250_device::k053250_device(const machine_config &mconfig, const char *tag, d { } -void k053250_device::set_offsets(int offx, int offy) -{ - m_offx = offx; - m_offy = offy; -} - void k053250_device::unpack_nibbles() { m_unpacked_rom.resize(m_rom.length()*2); diff --git a/src/mame/video/k053250.h b/src/mame/video/k053250.h index c0f54a4d0bd..2faee31c6d9 100644 --- a/src/mame/video/k053250.h +++ b/src/mame/video/k053250.h @@ -23,7 +23,11 @@ class k053250_device : public device_t, public: k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_offsets(int offx, int offy); + void set_offsets(int offx, int offy) + { + m_offx = offx; + m_offy = offy; + } DECLARE_READ16_MEMBER(reg_r); DECLARE_WRITE16_MEMBER(reg_w); diff --git a/src/mame/video/k053250_ps.cpp b/src/mame/video/k053250_ps.cpp index 64e9b497aa6..3c4fce4022d 100644 --- a/src/mame/video/k053250_ps.cpp +++ b/src/mame/video/k053250_ps.cpp @@ -49,12 +49,6 @@ k053250ps_device::k053250ps_device(const machine_config &mconfig, const char *ta { } -void k053250ps_device::set_offsets(int offx, int offy) -{ - m_offx = offx; - m_offy = offy; -} - void k053250ps_device::unpack_nibbles() { m_unpacked_rom.resize(m_rom.length()*2); diff --git a/src/mame/video/k053250_ps.h b/src/mame/video/k053250_ps.h index b0a2a9a1da1..ebc16089ce7 100644 --- a/src/mame/video/k053250_ps.h +++ b/src/mame/video/k053250_ps.h @@ -26,7 +26,11 @@ class k053250ps_device : public device_t, public: k053250ps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_offsets(int offx, int offy); + void set_offsets(int offx, int offy) + { + m_offx = offx; + m_offy = offy; + } template devcb_base &set_dmairq_cb(_cb cb) { return m_dmairq_cb.set_callback(cb); } DECLARE_READ16_MEMBER(reg_r); diff --git a/src/mame/video/kan_pand.cpp b/src/mame/video/kan_pand.cpp index 30105a001ff..c3852d9e674 100644 --- a/src/mame/video/kan_pand.cpp +++ b/src/mame/video/kan_pand.cpp @@ -65,16 +65,6 @@ kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, cons { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void kaneko_pandora_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/kan_pand.h b/src/mame/video/kan_pand.h index 54df95d044d..0fb809f7678 100644 --- a/src/mame/video/kan_pand.h +++ b/src/mame/video/kan_pand.h @@ -24,7 +24,7 @@ public: kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfx_region = gfxregion; } void set_offsets(int x_offset, int y_offset) { diff --git a/src/mame/video/kaneko_grap2.cpp b/src/mame/video/kaneko_grap2.cpp index d84c6d40c29..2095fcd772b 100644 --- a/src/mame/video/kaneko_grap2.cpp +++ b/src/mame/video/kaneko_grap2.cpp @@ -24,22 +24,6 @@ kaneko_grap2_device::kaneko_grap2_device(const machine_config &mconfig, const ch } -void kaneko_grap2_device::set_chipnum(int chipnum) -{ - m_chipnum = chipnum; -} - -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void kaneko_grap2_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - - void kaneko_grap2_device::device_start() { m_framebuffer = make_unique_clear(0x80000/2); diff --git a/src/mame/video/kaneko_grap2.h b/src/mame/video/kaneko_grap2.h index 44a5f50ee5c..88a2d010514 100644 --- a/src/mame/video/kaneko_grap2.h +++ b/src/mame/video/kaneko_grap2.h @@ -30,8 +30,8 @@ public: int m_chipnum; // used to decide where we write the palette - void set_chipnum(int chipnum); - void set_palette_tag(const char *tag); + void set_chipnum(int chipnum) { m_chipnum = chipnum; } + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } DECLARE_READ16_MEMBER(galpani3_regs1_r); DECLARE_WRITE16_MEMBER(galpani3_regs1_go_w); diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index 281edcb2a97..27e468340b8 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -63,16 +63,6 @@ kaneko16_sprite_device::kaneko16_sprite_device( m_priority.sprite[3] = 8; // above all } -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void kaneko16_sprite_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - void kaneko16_sprite_device::device_start() { m_first_sprite = std::make_unique(0x400); @@ -94,27 +84,6 @@ void kaneko16_sprite_device::device_reset() m_sprite_flipy = 0; } -void kaneko16_sprite_device::set_priorities(int pri0, int pri1, int pri2, int pri3) -{ - m_priority.sprite[0] = pri0; - m_priority.sprite[1] = pri1; - m_priority.sprite[2] = pri2; - m_priority.sprite[3] = pri3; -} - - -void kaneko16_sprite_device::set_fliptype(int fliptype) -{ - m_sprite_fliptype = fliptype; -} - -void kaneko16_sprite_device::set_offsets(int xoffs, int yoffs) -{ - m_sprite_xoffs = xoffs; - m_sprite_yoffs = yoffs; -} - - /*************************************************************************** Sprites Drawing diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index cf4ec0d4f25..92217f13125 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -35,10 +35,20 @@ class kaneko16_sprite_device : public device_t, public device_video_interface { public: // configuration - void set_gfxdecode_tag(const char *tag); - void set_fliptype(int fliptype); - void set_offsets(int xoffs, int yoffs); - void set_priorities(int pri0, int pri1, int pri2, int pri3); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_fliptype(int fliptype) { m_sprite_fliptype = fliptype; } + void set_offsets(int xoffs, int yoffs) + { + m_sprite_xoffs = xoffs; + m_sprite_yoffs = yoffs; + } + void set_priorities(int pri0, int pri1, int pri2, int pri3) + { + m_priority.sprite[0] = pri0; + m_priority.sprite[1] = pri1; + m_priority.sprite[2] = pri2; + m_priority.sprite[3] = pri3; + } // (legacy) used in the bitmap clear functions virtual int get_sprite_type(void) =0; diff --git a/src/mame/video/kaneko_tmap.cpp b/src/mame/video/kaneko_tmap.cpp index e8cb2976901..4a155defad7 100644 --- a/src/mame/video/kaneko_tmap.cpp +++ b/src/mame/video/kaneko_tmap.cpp @@ -103,34 +103,6 @@ kaneko_view2_tilemap_device::kaneko_view2_tilemap_device(const machine_config &m m_invert_flip = 0; } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void kaneko_view2_tilemap_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - -void kaneko_view2_tilemap_device::set_gfx_region(int region) -{ - m_tilebase = region; -} - -void kaneko_view2_tilemap_device::set_offset(int dx, int dy, int xdim, int ydim) -{ - m_dx = dx; - m_dy = dy; - m_xdim = xdim; - m_ydim = ydim; -} - -void kaneko_view2_tilemap_device::set_invert_flip(int invert_flip) -{ - m_invert_flip = invert_flip; -} - void kaneko_view2_tilemap_device::get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) { uint16_t code_hi = m_vram[_N_][ 2 * tile_index + 0]; diff --git a/src/mame/video/kaneko_tmap.h b/src/mame/video/kaneko_tmap.h index 8a7b56f6e4f..1ba76f73c82 100644 --- a/src/mame/video/kaneko_tmap.h +++ b/src/mame/video/kaneko_tmap.h @@ -13,10 +13,16 @@ public: kaneko_view2_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int region); - void set_offset(int dx, int dy, int xdim, int ydim); - void set_invert_flip(int invert_flip); // for fantasia (bootleg) + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int region) { m_tilebase = region; } + void set_offset(int dx, int dy, int xdim, int ydim) + { + m_dx = dx; + m_dy = dy; + m_xdim = xdim; + m_ydim = ydim; + } + void set_invert_flip(int invert_flip) { m_invert_flip = invert_flip; } // for fantasia (bootleg) void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); void kaneko16_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _N_); diff --git a/src/mame/video/mb60553.cpp b/src/mame/video/mb60553.cpp index a81cbea96f7..c9676a60f29 100644 --- a/src/mame/video/mb60553.cpp +++ b/src/mame/video/mb60553.cpp @@ -57,18 +57,6 @@ void mb60553_zooming_tilemap_device::device_reset() } -void mb60553_zooming_tilemap_device::set_gfx_region(int gfxregion) -{ - m_gfx_region = gfxregion; -} - -void mb60553_zooming_tilemap_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - - /*** Fujitsu MB60553 (screen tilemap) **********************************************/ /* diff --git a/src/mame/video/mb60553.h b/src/mame/video/mb60553.h index c245f0f072e..6de1d4ed662 100644 --- a/src/mame/video/mb60553.h +++ b/src/mame/video/mb60553.h @@ -11,8 +11,8 @@ class mb60553_zooming_tilemap_device : public device_t { public: - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int gfxregion); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int gfxregion) { m_gfx_region = gfxregion; } mb60553_zooming_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/video/ms1_tmap.cpp b/src/mame/video/ms1_tmap.cpp index ad5034765ca..0523e64664c 100644 --- a/src/mame/video/ms1_tmap.cpp +++ b/src/mame/video/ms1_tmap.cpp @@ -56,27 +56,6 @@ megasys1_tilemap_device::megasys1_tilemap_device(const machine_config &mconfig, { } -void megasys1_tilemap_device::set_8x8_scroll_factor(int scroll_factor) -{ - m_8x8_scroll_factor = scroll_factor; -} - -void megasys1_tilemap_device::set_16x16_scroll_factor(int scroll_factor) -{ - m_16x16_scroll_factor = scroll_factor; -} - -void megasys1_tilemap_device::set_bits_per_color_code(int bits) -{ - m_bits_per_color_code = bits; -} - -void megasys1_tilemap_device::set_colorbase(uint16_t colorbase) -{ - m_colorbase = colorbase; -} - - /************************************* * diff --git a/src/mame/video/ms1_tmap.h b/src/mame/video/ms1_tmap.h index 75331ab4062..a66dea660ac 100644 --- a/src/mame/video/ms1_tmap.h +++ b/src/mame/video/ms1_tmap.h @@ -48,10 +48,10 @@ public: megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_8x8_scroll_factor(int scroll_factor); - void set_16x16_scroll_factor(int scroll_factor); - void set_bits_per_color_code(int bits); - void set_colorbase(uint16_t colorbase); + void set_8x8_scroll_factor(int scroll_factor) { m_8x8_scroll_factor = scroll_factor; } + void set_16x16_scroll_factor(int scroll_factor) { m_16x16_scroll_factor = scroll_factor; } + void set_bits_per_color_code(int bits) { m_bits_per_color_code = bits; } + void set_colorbase(uint16_t colorbase) { m_colorbase = colorbase; } // memory handlers DECLARE_WRITE16_MEMBER(write); diff --git a/src/mame/video/pc080sn.cpp b/src/mame/video/pc080sn.cpp index 800be22ed24..4dce648768c 100644 --- a/src/mame/video/pc080sn.cpp +++ b/src/mame/video/pc080sn.cpp @@ -73,16 +73,6 @@ pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, d } } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void pc080sn_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/pc080sn.h b/src/mame/video/pc080sn.h index 28379eb62d0..2d2dfd60740 100644 --- a/src/mame/video/pc080sn.h +++ b/src/mame/video/pc080sn.h @@ -11,7 +11,7 @@ public: pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } void set_yinvert(int y_inv) { m_y_invert = y_inv; } void set_dblwidth(int dblwidth) { m_dblwidth = dblwidth; } diff --git a/src/mame/video/pc090oj.cpp b/src/mame/video/pc090oj.cpp index a1c86229bf6..9dbb902f727 100644 --- a/src/mame/video/pc090oj.cpp +++ b/src/mame/video/pc090oj.cpp @@ -89,26 +89,6 @@ pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, d { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void pc090oj_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void pc090oj_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/pc090oj.h b/src/mame/video/pc090oj.h index 271aca88436..a7b3677506d 100644 --- a/src/mame/video/pc090oj.h +++ b/src/mame/video/pc090oj.h @@ -11,8 +11,8 @@ public: pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_palette_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } void set_usebuffer(int use_buf) { m_use_buffer = use_buf; } void set_offsets(int x_offset, int y_offset) diff --git a/src/mame/video/segaic16.cpp b/src/mame/video/segaic16.cpp index b80c90f981f..69250c997ab 100644 --- a/src/mame/video/segaic16.cpp +++ b/src/mame/video/segaic16.cpp @@ -389,23 +389,6 @@ segaic16_video_device::segaic16_video_device(const machine_config &mconfig, cons m_pagelatch_cb = segaic16_video_pagelatch_delegate(FUNC(segaic16_video_device::tilemap_16b_fill_latch), this); } -void segaic16_video_device::set_pagelatch_cb(segaic16_video_pagelatch_delegate newtilecb) -{ - m_pagelatch_cb = newtilecb; -} - - -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void segaic16_video_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - void segaic16_video_device::device_start() { if(!m_gfxdecode->started()) diff --git a/src/mame/video/segaic16.h b/src/mame/video/segaic16.h index 2dc319482e7..8415c570cc9 100644 --- a/src/mame/video/segaic16.h +++ b/src/mame/video/segaic16.h @@ -102,8 +102,8 @@ public: segaic16_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_pagelatch_cb(segaic16_video_pagelatch_delegate newtilecb); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_pagelatch_cb(segaic16_video_pagelatch_delegate newtilecb) { m_pagelatch_cb = newtilecb; } uint8_t m_display_enable; optional_shared_ptr m_tileram; diff --git a/src/mame/video/segaic24.cpp b/src/mame/video/segaic24.cpp index c41c0f182fe..18095909b1b 100644 --- a/src/mame/video/segaic24.cpp +++ b/src/mame/video/segaic24.cpp @@ -32,11 +32,6 @@ segas24_tile_device::segas24_tile_device(const machine_config &mconfig, const ch } -void segas24_tile_device::set_tile_mask(uint16_t _tile_mask) -{ - tile_mask = _tile_mask; -} - const gfx_layout segas24_tile_device::char_layout = { 8, 8, SYS24_TILES, diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h index e62c4db5272..a3b94dbf759 100644 --- a/src/mame/video/segaic24.h +++ b/src/mame/video/segaic24.h @@ -32,7 +32,7 @@ public: segas24_tile_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_tile_mask(uint16_t tile_mask); + void set_tile_mask(uint16_t _tile_mask) { tile_mask = _tile_mask; } DECLARE_READ16_MEMBER(tile_r); DECLARE_WRITE16_MEMBER(tile_w); diff --git a/src/mame/video/seta001.cpp b/src/mame/video/seta001.cpp index 320d73d70af..a1f38143a87 100644 --- a/src/mame/video/seta001.cpp +++ b/src/mame/video/seta001.cpp @@ -38,16 +38,6 @@ seta001_device::seta001_device(const machine_config &mconfig, const char *tag, d { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void seta001_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - void seta001_device::device_start() { // chukatai draws a column on the left from uninitialized RAM which causes garbage in a debug build diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h index 804e027587e..b83194fad66 100644 --- a/src/mame/video/seta001.h +++ b/src/mame/video/seta001.h @@ -18,7 +18,7 @@ public: seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfxbank_callback(gfxbank_cb_delegate callback) { m_gfxbank_cb = callback; } DECLARE_WRITE8_MEMBER( spritebgflag_w8 ); diff --git a/src/mame/video/snk68_spr.cpp b/src/mame/video/snk68_spr.cpp index d7521cf5171..7181022d130 100644 --- a/src/mame/video/snk68_spr.cpp +++ b/src/mame/video/snk68_spr.cpp @@ -22,27 +22,6 @@ void snk68_spr_device::tile_callback_noindirect(int &tile, int& fx, int& fy, int { } - -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void snk68_spr_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - -void snk68_spr_device::set_tile_indirect_cb(snk68_tile_indirection_delegate newtilecb) -{ - m_newtilecb = newtilecb; -} - -void snk68_spr_device::set_no_partial() -{ - m_partialupdates = 0; -} - void snk68_spr_device::device_start() { // bind our handler diff --git a/src/mame/video/snk68_spr.h b/src/mame/video/snk68_spr.h index b60066c1b97..09b037b1b4e 100644 --- a/src/mame/video/snk68_spr.h +++ b/src/mame/video/snk68_spr.h @@ -23,9 +23,9 @@ public: snk68_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration - void set_gfxdecode_tag(const char *tag); - void set_tile_indirect_cb(snk68_tile_indirection_delegate newtilecb); - void set_no_partial(); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_tile_indirect_cb(snk68_tile_indirection_delegate newtilecb) { m_newtilecb = newtilecb; } + void set_no_partial() { m_partialupdates = 0; } DECLARE_READ16_MEMBER(spriteram_r); DECLARE_WRITE16_MEMBER(spriteram_w); diff --git a/src/mame/video/st0020.cpp b/src/mame/video/st0020.cpp index 93b4df4da78..bdeea2a0ea1 100644 --- a/src/mame/video/st0020.cpp +++ b/src/mame/video/st0020.cpp @@ -35,18 +35,6 @@ st0020_device::st0020_device(const machine_config &mconfig, const char *tag, dev m_is_jclub2 = 0; } - -void st0020_device::set_is_st0032(int is_st0032) -{ - m_is_st0032 = is_st0032; -} - -void st0020_device::set_is_jclub2(int is_jclub2) -{ - m_is_jclub2 = is_jclub2; -} - - void st0020_device::device_reset() { m_gfxram_bank = 0; diff --git a/src/mame/video/st0020.h b/src/mame/video/st0020.h index 4b170e4e85f..307be9b54f3 100644 --- a/src/mame/video/st0020.h +++ b/src/mame/video/st0020.h @@ -12,8 +12,8 @@ public: st0020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_is_st0032(int is_st0032); - void set_is_jclub2(int is_jclub2); + void set_is_st0032(int is_st0032) { m_is_st0032 = is_st0032; } + void set_is_jclub2(int is_jclub2) { m_is_jclub2 = is_jclub2; } void update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bool update_visible_area); diff --git a/src/mame/video/tc0080vco.cpp b/src/mame/video/tc0080vco.cpp index ac991fc4212..646aa08527e 100644 --- a/src/mame/video/tc0080vco.cpp +++ b/src/mame/video/tc0080vco.cpp @@ -110,16 +110,6 @@ tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *ta { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void tc0080vco_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0080vco.h b/src/mame/video/tc0080vco.h index 344d26010e6..39ebf0e7d5d 100644 --- a/src/mame/video/tc0080vco.h +++ b/src/mame/video/tc0080vco.h @@ -11,7 +11,7 @@ public: tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfx_region(int gfxnum) { m_gfxnum = gfxnum; } void set_tx_region(int txnum) { m_txnum = txnum; } void set_offsets(int x_offset, int y_offset) diff --git a/src/mame/video/tc0100scn.cpp b/src/mame/video/tc0100scn.cpp index 12c3373454d..9b7ad0fac2b 100644 --- a/src/mame/video/tc0100scn.cpp +++ b/src/mame/video/tc0100scn.cpp @@ -184,26 +184,6 @@ tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *ta { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void tc0100scn_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void tc0100scn_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0100scn.h b/src/mame/video/tc0100scn.h index a0399a2a031..d8a689a9716 100644 --- a/src/mame/video/tc0100scn.h +++ b/src/mame/video/tc0100scn.h @@ -11,8 +11,8 @@ public: tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); - void set_palette_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } void set_tx_region(int txregion) { m_txnum = txregion; } void set_multiscr_xoffs(int xoffs) { m_multiscrn_xoffs = xoffs; } diff --git a/src/mame/video/tc0110pcr.cpp b/src/mame/video/tc0110pcr.cpp index 2b746aa3e3f..e4743abc7af 100644 --- a/src/mame/video/tc0110pcr.cpp +++ b/src/mame/video/tc0110pcr.cpp @@ -29,16 +29,6 @@ tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *ta { } -//------------------------------------------------- -// set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void tc0110pcr_device::set_palette_tag(const char *tag) -{ - m_palette.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0110pcr.h b/src/mame/video/tc0110pcr.h index a682cfba091..42b5efd301a 100644 --- a/src/mame/video/tc0110pcr.h +++ b/src/mame/video/tc0110pcr.h @@ -19,7 +19,7 @@ public: void restore_colors(); - void set_palette_tag(const char *tag); + void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } protected: // device-level overrides diff --git a/src/mame/video/tc0180vcu.cpp b/src/mame/video/tc0180vcu.cpp index e51d34370db..aee01a7a7db 100644 --- a/src/mame/video/tc0180vcu.cpp +++ b/src/mame/video/tc0180vcu.cpp @@ -27,16 +27,6 @@ tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *ta { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void tc0180vcu_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0180vcu.h b/src/mame/video/tc0180vcu.h index d3cd188f64c..da21205f946 100644 --- a/src/mame/video/tc0180vcu.h +++ b/src/mame/video/tc0180vcu.h @@ -11,7 +11,7 @@ public: tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_bg_colorbase(int color) { m_bg_color_base = color; } void set_fg_colorbase(int color) { m_fg_color_base = color; } void set_tx_colorbase(int color) { m_tx_color_base = color; } diff --git a/src/mame/video/tc0280grd.cpp b/src/mame/video/tc0280grd.cpp index 60a18b9c310..70713f7cdc3 100644 --- a/src/mame/video/tc0280grd.cpp +++ b/src/mame/video/tc0280grd.cpp @@ -36,17 +36,6 @@ tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *ta { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void tc0280grd_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0280grd.h b/src/mame/video/tc0280grd.h index 629ed2ea211..5d4841e12e6 100644 --- a/src/mame/video/tc0280grd.h +++ b/src/mame/video/tc0280grd.h @@ -11,7 +11,7 @@ public: tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } DECLARE_READ16_MEMBER( tc0280grd_word_r ); diff --git a/src/mame/video/tc0480scp.cpp b/src/mame/video/tc0480scp.cpp index 0ead80e157f..6731b655d2e 100644 --- a/src/mame/video/tc0480scp.cpp +++ b/src/mame/video/tc0480scp.cpp @@ -182,16 +182,6 @@ tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *ta } } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void tc0480scp_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/tc0480scp.h b/src/mame/video/tc0480scp.h index 03e9dc48b08..9e578de02d8 100644 --- a/src/mame/video/tc0480scp.h +++ b/src/mame/video/tc0480scp.h @@ -11,7 +11,7 @@ public: tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; } void set_tx_region(int txregion) { m_txnum = txregion; } void set_col_base(int col) { m_col_base = col; } diff --git a/src/mame/video/tecmo_mix.cpp b/src/mame/video/tecmo_mix.cpp index 7de58739f22..e89423232c2 100644 --- a/src/mame/video/tecmo_mix.cpp +++ b/src/mame/video/tecmo_mix.cpp @@ -42,47 +42,6 @@ void tecmo_mix_device::device_reset() { } - - -void tecmo_mix_device::set_mixer_shifts(int sprpri_shift, int sprbln_shift, int sprcol_shift) -{ - m_sprpri_shift = sprpri_shift; - m_sprbln_shift = sprbln_shift; - m_sprcol_shift = sprcol_shift; -} - -void tecmo_mix_device::set_blendcols(int bgblend_comp, int fgblend_comp, int txblend_comp, int spblend_comp) -{ - m_bgblend_comp = bgblend_comp; - m_fgblend_comp = fgblend_comp; - m_txblend_comp = txblend_comp; - m_spblend_comp = spblend_comp; -} - -void tecmo_mix_device::set_regularcols(int bgregular_comp, int fgregular_comp, int txregular_comp, int spregular_comp) -{ - m_bgregular_comp = bgregular_comp; - m_fgregular_comp = fgregular_comp; - m_txregular_comp = txregular_comp; - m_spregular_comp = spregular_comp; -} - -void tecmo_mix_device::set_blendsource(int spblend_source, int fgblend_source) -{ - m_spblend_source = spblend_source; - m_fgblend_source = fgblend_source; -} - -void tecmo_mix_device::set_revspritetile() -{ - m_revspritetile = 3; -} - -void tecmo_mix_device::set_bgpen(int bgpen) -{ - m_bgpen = bgpen; -} - uint32_t tecmo_mix_device::sum_colors(const pen_t *pal, int c1_idx, int c2_idx) { const pen_t c1 = pal[c1_idx]; diff --git a/src/mame/video/tecmo_mix.h b/src/mame/video/tecmo_mix.h index 09799ed9a15..bf5cdeebd28 100644 --- a/src/mame/video/tecmo_mix.h +++ b/src/mame/video/tecmo_mix.h @@ -13,12 +13,33 @@ public: tecmo_mix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, palette_device &palette, bitmap_ind16* bitmap_bg, bitmap_ind16* bitmap_fg, bitmap_ind16* bitmap_tx, bitmap_ind16* bitmap_sp); - void set_mixer_shifts(int sprpri_shift, int sprbln_shift, int sprcol_shift); - void set_blendcols(int bgblend_comp, int fgblend_comp, int txblend_comp, int spblend_comp); - void set_regularcols(int bgregular_comp, int fgregular_comp, int txregular_comp, int spregular_comp); - void set_blendsource(int spblend_source, int fgblend_source); - void set_revspritetile(); - void set_bgpen(int bgpen); + void set_mixer_shifts(int sprpri_shift, int sprbln_shift, int sprcol_shift) + { + m_sprpri_shift = sprpri_shift; + m_sprbln_shift = sprbln_shift; + m_sprcol_shift = sprcol_shift; + } + void set_blendcols(int bgblend_comp, int fgblend_comp, int txblend_comp, int spblend_comp) + { + m_bgblend_comp = bgblend_comp; + m_fgblend_comp = fgblend_comp; + m_txblend_comp = txblend_comp; + m_spblend_comp = spblend_comp; + } + void set_regularcols(int bgregular_comp, int fgregular_comp, int txregular_comp, int spregular_comp) + { + m_bgregular_comp = bgregular_comp; + m_fgregular_comp = fgregular_comp; + m_txregular_comp = txregular_comp; + m_spregular_comp = spregular_comp; + } + void set_blendsource(int spblend_source, int fgblend_source) + { + m_spblend_source = spblend_source; + m_fgblend_source = fgblend_source; + } + void set_revspritetile() { m_revspritetile = 3; } + void set_bgpen(int bgpen) { m_bgpen = bgpen; } protected: virtual void device_start() override; diff --git a/src/mame/video/tecmo_spr.cpp b/src/mame/video/tecmo_spr.cpp index 2807fdd4e12..8a779ceb10a 100644 --- a/src/mame/video/tecmo_spr.cpp +++ b/src/mame/video/tecmo_spr.cpp @@ -35,22 +35,6 @@ void tecmo_spr_device::device_reset() } -void tecmo_spr_device::set_gfx_region(int gfxregion) -{ - m_gfxregion = gfxregion; -} - -void tecmo_spr_device::set_bootleg(int bootleg) -{ - m_bootleg = bootleg; -} - -void tecmo_spr_device::set_yoffset(int yoffset) -{ - m_yoffset = yoffset; -} - - static const uint8_t layout[8][8] = { { 0, 1, 4, 5, 16, 17, 20, 21 }, diff --git a/src/mame/video/tecmo_spr.h b/src/mame/video/tecmo_spr.h index e20d8c918b8..1bbf1308fe9 100644 --- a/src/mame/video/tecmo_spr.h +++ b/src/mame/video/tecmo_spr.h @@ -11,9 +11,9 @@ class tecmo_spr_device : public device_t { public: tecmo_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_gfx_region(int gfxregion); - void set_bootleg(int bootleg); - void set_yoffset(int yoffset); + void set_gfx_region(int gfxregion) { m_gfxregion = gfxregion; } + void set_bootleg(int bootleg) { m_bootleg = bootleg; } + void set_yoffset(int yoffset) { m_yoffset = yoffset; } // gaiden.c / spbactn.c / tecmo16.c sprites void gaiden_draw_sprites(screen_device &screen, gfxdecode_device *gfxdecode, const rectangle &cliprect, uint16_t* spriteram, int sprite_sizey, int spr_offset_y, int flip_screen, bitmap_ind16 &sprite_bitmap); diff --git a/src/mame/video/toaplan_scu.cpp b/src/mame/video/toaplan_scu.cpp index 8a73847085e..cb75a21e237 100644 --- a/src/mame/video/toaplan_scu.cpp +++ b/src/mame/video/toaplan_scu.cpp @@ -35,12 +35,6 @@ toaplan_scu_device::toaplan_scu_device(const machine_config &mconfig, const char { } -void toaplan_scu_device::set_xoffsets(int xoffs, int xoffs_flipped) -{ - m_xoffs = xoffs; - m_xoffs_flipped = xoffs_flipped; -} - void toaplan_scu_device::device_start() { } diff --git a/src/mame/video/toaplan_scu.h b/src/mame/video/toaplan_scu.h index 1096747f038..e860c66df53 100644 --- a/src/mame/video/toaplan_scu.h +++ b/src/mame/video/toaplan_scu.h @@ -13,7 +13,11 @@ public: toaplan_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_xoffsets(int xoffs, int xoffs_flipped); + void set_xoffsets(int xoffs, int xoffs_flipped) + { + m_xoffs = xoffs; + m_xoffs_flipped = xoffs_flipped; + } void draw_sprites_to_tempbitmap(const rectangle &cliprect, uint16_t* spriteram, uint32_t bytes ); void copy_sprites_from_tempbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); diff --git a/src/mame/video/vs920a.cpp b/src/mame/video/vs920a.cpp index 23a61c540bc..02c7911f315 100644 --- a/src/mame/video/vs920a.cpp +++ b/src/mame/video/vs920a.cpp @@ -61,19 +61,6 @@ void vs920a_text_tilemap_device::device_reset() { } - -void vs920a_text_tilemap_device::set_gfx_region(int gfxregion) -{ - m_gfx_region = gfxregion; -} - -void vs920a_text_tilemap_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - - TILE_GET_INFO_MEMBER(vs920a_text_tilemap_device::get_tile_info) { int data; diff --git a/src/mame/video/vs920a.h b/src/mame/video/vs920a.h index b20d18e8c10..b32412dc497 100644 --- a/src/mame/video/vs920a.h +++ b/src/mame/video/vs920a.h @@ -9,8 +9,8 @@ class vs920a_text_tilemap_device : public device_t { public: - void set_gfxdecode_tag(const char *tag); - void set_gfx_region(int gfxregion); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_gfx_region(int gfxregion) { m_gfx_region = gfxregion; } vs920a_text_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/video/vsystem_spr.cpp b/src/mame/video/vsystem_spr.cpp index 85c7cbcfd81..b0a2e11eba6 100644 --- a/src/mame/video/vsystem_spr.cpp +++ b/src/mame/video/vsystem_spr.cpp @@ -81,61 +81,11 @@ vsystem_spr_device::vsystem_spr_device(const machine_config &mconfig, const char { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void vsystem_spr_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - uint32_t vsystem_spr_device::tile_callback_noindirect(uint32_t tile) { return tile; } - -void vsystem_spr_device::set_tile_indirect_cb(vsystem_tile_indirection_delegate newtilecb) -{ - m_newtilecb = newtilecb; -} - - -void vsystem_spr_device::set_offsets(int xoffs, int yoffs) -{ - m_xoffs = xoffs; - m_yoffs = yoffs; -} - -void vsystem_spr_device::set_pdraw(bool pdraw) -{ - m_pdraw = pdraw; -} - -void vsystem_spr_device::set_gfx_region(int gfx_region) -{ - m_gfx_region = gfx_region; -} - -void vsystem_spr_device::CG10103_set_pal_base(int pal_base) -{ - m_pal_base = pal_base; -} - - -void vsystem_spr_device::set_pal_mask(int pal_mask) -{ - m_pal_mask = pal_mask; -} - -void vsystem_spr_device::CG10103_set_transpen(int transpen) -{ - m_transpen = transpen; -} - - void vsystem_spr_device::device_start() { // bind our handler diff --git a/src/mame/video/vsystem_spr.h b/src/mame/video/vsystem_spr.h index 073800d3108..50d7f2d9e69 100644 --- a/src/mame/video/vsystem_spr.h +++ b/src/mame/video/vsystem_spr.h @@ -32,14 +32,18 @@ class vsystem_spr_device : public device_t { public: // configuration - void set_gfxdecode_tag(const char *tag); - void set_offsets(int xoffs, int yoffs); - void set_pdraw(bool pdraw); - void set_tile_indirect_cb(vsystem_tile_indirection_delegate newtilecb); - void set_gfx_region(int gfx_region); - void CG10103_set_pal_base(int pal_base); - void set_pal_mask(int pal_mask); - void CG10103_set_transpen(int transpen); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_offsets(int xoffs, int yoffs) + { + m_xoffs = xoffs; + m_yoffs = yoffs; + } + void set_pdraw(bool pdraw) { m_pdraw = pdraw; } + void set_tile_indirect_cb(vsystem_tile_indirection_delegate newtilecb) { m_newtilecb = newtilecb; } + void set_gfx_region(int gfx_region) { m_gfx_region = gfx_region; } + void CG10103_set_pal_base(int pal_base) { m_pal_base = pal_base; } + void set_pal_mask(int pal_mask) { m_pal_mask = pal_mask; } + void CG10103_set_transpen(int transpen) { m_transpen = transpen; } vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/video/vsystem_spr2.cpp b/src/mame/video/vsystem_spr2.cpp index 1f8be9e675e..408016822a8 100644 --- a/src/mame/video/vsystem_spr2.cpp +++ b/src/mame/video/vsystem_spr2.cpp @@ -41,38 +41,6 @@ vsystem_spr2_device::vsystem_spr2_device(const machine_config &mconfig, const ch { } -//------------------------------------------------- -// set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void vsystem_spr2_device::set_gfxdecode_tag(const char *tag) -{ - m_gfxdecode.set_tag(tag); -} - - -void vsystem_spr2_device::set_tile_indirect_cb(vsystem_tile2_indirection_delegate newtilecb) -{ - m_newtilecb = newtilecb; -} - -void vsystem_spr2_device::set_pritype(int pritype) -{ - m_pritype = pritype; -} - -void vsystem_spr2_device::set_gfx_region(int gfx_region) -{ - m_gfx_region = gfx_region; -} - -void vsystem_spr2_device::set_offsets(int xoffs, int yoffs) -{ - m_xoffs = xoffs; - m_yoffs = yoffs; -} - uint32_t vsystem_spr2_device::tile_callback_noindirect(uint32_t tile) { return tile; diff --git a/src/mame/video/vsystem_spr2.h b/src/mame/video/vsystem_spr2.h index 876a82230ee..d0948307a0b 100644 --- a/src/mame/video/vsystem_spr2.h +++ b/src/mame/video/vsystem_spr2.h @@ -21,11 +21,15 @@ class vsystem_spr2_device : public device_t { public: // configuration - void set_gfxdecode_tag(const char *tag); - void set_tile_indirect_cb(vsystem_tile2_indirection_delegate newtilecb); - void set_pritype(int pritype); - void set_gfx_region(int gfx_region); - void set_offsets(int xoffs, int yoffs); + void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + void set_tile_indirect_cb(vsystem_tile2_indirection_delegate newtilecb) { m_newtilecb = newtilecb; } + void set_pritype(int pritype) { m_pritype = pritype; } + void set_gfx_region(int gfx_region) { m_gfx_region = gfx_region; } + void set_offsets(int xoffs, int yoffs) + { + m_xoffs = xoffs; + m_yoffs = yoffs; + } vsystem_spr2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); -- cgit v1.2.3