summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar wilbertpol <wilbertpol@users.noreply.github.com>2018-03-03 18:18:08 +0100
committerGravatarGravatar Vas Crabb <cuavas@users.noreply.github.com>2018-03-04 04:18:08 +1100
commit3b923d59ccb8d2d8e386392518450006f8e644fe (patch) (github)
tree73c48568e76d69edbde9f96a3f57d173dd05a747
parent25472091b626bd01ef47f11389a4b2ebe0fc0008 (diff)
downloadmame-3b923d59ccb8d2d8e386392518450006f8e644fe.tar.bz2
mame-3b923d59ccb8d2d8e386392518450006f8e644fe.zip
destaticify initializations (nw) (#3289)
* destaticify initializations (nw) * fix this->set_screen (nw)
-rw-r--r--src/devices/bus/a1bus/a1bus.cpp21
-rw-r--r--src/devices/bus/a1bus/a1bus.h20
-rw-r--r--src/devices/bus/a2bus/a2bus.cpp22
-rw-r--r--src/devices/bus/a2bus/a2bus.h24
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.cpp22
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.h18
-rw-r--r--src/devices/bus/a2bus/a2mcms.cpp2
-rw-r--r--src/devices/bus/a2bus/a2mcms.h2
-rw-r--r--src/devices/bus/a800/a8sio.cpp16
-rw-r--r--src/devices/bus/a800/a8sio.h14
-rw-r--r--src/devices/bus/abckb/abckb.h12
-rw-r--r--src/devices/bus/adam/exp.h4
-rw-r--r--src/devices/bus/amiga/keyboard/keyboard.h17
-rw-r--r--src/devices/bus/amiga/zorro/zorro.cpp17
-rw-r--r--src/devices/bus/amiga/zorro/zorro.h58
-rw-r--r--src/devices/bus/apricot/expansion/expansion.cpp20
-rw-r--r--src/devices/bus/apricot/expansion/expansion.h43
-rw-r--r--src/devices/bus/apricot/keyboard/keyboard.h5
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.h11
-rw-r--r--src/devices/bus/bbc/fdc/fdc.h10
-rw-r--r--src/devices/bus/bbc/tube/tube.h5
-rw-r--r--src/devices/bus/bbc/userport/userport.h10
-rw-r--r--src/devices/bus/bml3/bml3bus.cpp22
-rw-r--r--src/devices/bus/bml3/bml3bus.h24
-rw-r--r--src/devices/bus/c64/exp.h24
-rw-r--r--src/devices/bus/cbm2/user.h16
-rw-r--r--src/devices/bus/centronics/ctronics.h68
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.h17
-rw-r--r--src/devices/bus/coco/cococart.h12
-rw-r--r--src/devices/bus/coleco/ctrl.h4
-rw-r--r--src/devices/bus/comx35/exp.h4
-rw-r--r--src/devices/bus/cpc/cpcexp.h20
-rw-r--r--src/devices/bus/dmv/dmvbus.h20
-rw-r--r--src/devices/bus/ecbbus/ecbbus.cpp12
-rw-r--r--src/devices/bus/ecbbus/ecbbus.h12
-rw-r--r--src/devices/bus/econet/econet.cpp11
-rw-r--r--src/devices/bus/econet/econet.h12
-rw-r--r--src/devices/bus/einstein/pipe/pipe.h17
-rw-r--r--src/devices/bus/einstein/userport/userport.h5
-rw-r--r--src/devices/bus/electron/cart/slot.h11
-rw-r--r--src/devices/bus/electron/exp.h11
-rw-r--r--src/devices/bus/ep64/exp.h16
-rw-r--r--src/devices/bus/gamegear/ggext.h8
-rw-r--r--src/devices/bus/generic/slot.h8
-rw-r--r--src/devices/bus/hp80_io/hp80_io.h14
-rw-r--r--src/devices/bus/hp9845_io/hp9845_io.h12
-rw-r--r--src/devices/bus/hp_dio/hp_dio.cpp30
-rw-r--r--src/devices/bus/hp_dio/hp_dio.h32
-rw-r--r--src/devices/bus/hp_hil/hp_hil.cpp16
-rw-r--r--src/devices/bus/hp_hil/hp_hil.h14
-rw-r--r--src/devices/bus/ieee488/c2040fdc.h12
-rw-r--r--src/devices/bus/ieee488/c8050fdc.h16
-rw-r--r--src/devices/bus/intellec4/intellec4.cpp50
-rw-r--r--src/devices/bus/intellec4/intellec4.h50
-rw-r--r--src/devices/bus/interpro/keyboard/keyboard.h4
-rw-r--r--src/devices/bus/interpro/sr/sr.cpp10
-rw-r--r--src/devices/bus/interpro/sr/sr.h14
-rw-r--r--src/devices/bus/iq151/iq151.h24
-rw-r--r--src/devices/bus/isa/gus.h44
-rw-r--r--src/devices/bus/isa/hdc.h8
-rw-r--r--src/devices/bus/isa/isa.cpp37
-rw-r--r--src/devices/bus/isa/isa.h94
-rw-r--r--src/devices/bus/kc/kc.cpp7
-rw-r--r--src/devices/bus/kc/kc.h24
-rw-r--r--src/devices/bus/lpci/i82371sb.h4
-rw-r--r--src/devices/bus/lpci/i82439tx.h8
-rw-r--r--src/devices/bus/lpci/mpc105.h8
-rw-r--r--src/devices/bus/macpds/macpds.cpp22
-rw-r--r--src/devices/bus/macpds/macpds.h12
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.cpp2
-rw-r--r--src/devices/bus/midi/midi.h4
-rw-r--r--src/devices/bus/msx_cart/yamaha.cpp2
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.h8
-rw-r--r--src/devices/bus/msx_slot/cartridge.h6
-rw-r--r--src/devices/bus/msx_slot/disk.h64
-rw-r--r--src/devices/bus/msx_slot/fs4600.cpp9
-rw-r--r--src/devices/bus/msx_slot/fs4600.h6
-rw-r--r--src/devices/bus/msx_slot/music.h8
-rw-r--r--src/devices/bus/msx_slot/panasonic08.cpp9
-rw-r--r--src/devices/bus/msx_slot/panasonic08.h6
-rw-r--r--src/devices/bus/msx_slot/ram.h4
-rw-r--r--src/devices/bus/msx_slot/ram_mm.h8
-rw-r--r--src/devices/bus/msx_slot/rom.cpp9
-rw-r--r--src/devices/bus/msx_slot/rom.h6
-rw-r--r--src/devices/bus/msx_slot/slot.cpp15
-rw-r--r--src/devices/bus/msx_slot/slot.h10
-rw-r--r--src/devices/bus/msx_slot/sony08.cpp9
-rw-r--r--src/devices/bus/msx_slot/sony08.h6
-rw-r--r--src/devices/bus/nasbus/nasbus.cpp7
-rw-r--r--src/devices/bus/nasbus/nasbus.h9
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.h4
-rw-r--r--src/devices/bus/nubus/nubus.cpp22
-rw-r--r--src/devices/bus/nubus/nubus.h36
-rw-r--r--src/devices/bus/nubus/nubus_48gc.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_m2video.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_spec8.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.cpp2
-rw-r--r--src/devices/bus/nubus/pds30_30hr.cpp2
-rw-r--r--src/devices/bus/nubus/pds30_cb264.cpp2
-rw-r--r--src/devices/bus/nubus/pds30_mc30.cpp2
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.cpp2
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.cpp2
-rw-r--r--src/devices/bus/oricext/oricext.h4
-rw-r--r--src/devices/bus/pc1512/mouse.h16
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.cpp15
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.h14
-rw-r--r--src/devices/bus/pet/cass.h4
-rw-r--r--src/devices/bus/pet/user.h76
-rw-r--r--src/devices/bus/plus4/exp.h16
-rw-r--r--src/devices/bus/pofo/exp.h12
-rw-r--r--src/devices/bus/psi_kbd/psi_kbd.h11
-rw-r--r--src/devices/bus/psx/ctlrport.h8
-rw-r--r--src/devices/bus/ql/exp.h16
-rw-r--r--src/devices/bus/rs232/rs232.h28
-rw-r--r--src/devices/bus/s100/s100.h68
-rw-r--r--src/devices/bus/scsi/scsi.h68
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.cpp2
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.h8
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.h8
-rw-r--r--src/devices/bus/spectrum/exp.h11
-rw-r--r--src/devices/bus/ss50/interface.h8
-rw-r--r--src/devices/bus/sunkbd/sunkbd.h4
-rw-r--r--src/devices/bus/svi3x8/expander/expander.h41
-rw-r--r--src/devices/bus/svi3x8/slot/slot.cpp11
-rw-r--r--src/devices/bus/svi3x8/slot/slot.h21
-rw-r--r--src/devices/bus/ti8x/ti8x.h10
-rw-r--r--src/devices/bus/ti99/gromport/gromport.h14
-rw-r--r--src/devices/bus/ti99/internal/998board.h25
-rw-r--r--src/devices/bus/ti99/internal/datamux.h7
-rw-r--r--src/devices/bus/ti99/internal/evpcconn.h7
-rw-r--r--src/devices/bus/ti99/internal/genboard.h8
-rw-r--r--src/devices/bus/ti99/internal/ioport.h8
-rw-r--r--src/devices/bus/ti99/joyport/joyport.h4
-rw-r--r--src/devices/bus/ti99/peb/peribox.h16
-rw-r--r--src/devices/bus/ti99x/990_dk.h7
-rw-r--r--src/devices/bus/ti99x/990_hd.h4
-rw-r--r--src/devices/bus/ti99x/990_tap.h7
-rw-r--r--src/devices/bus/tiki100/exp.h20
-rw-r--r--src/devices/bus/tvc/tvc.h8
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.h4
-rw-r--r--src/devices/bus/vic10/exp.h16
-rw-r--r--src/devices/bus/vic20/exp.h12
-rw-r--r--src/devices/bus/vidbrain/exp.h4
-rw-r--r--src/devices/bus/vip/exp.h12
-rw-r--r--src/devices/bus/vme/vme.cpp40
-rw-r--r--src/devices/bus/vme/vme.h22
-rw-r--r--src/devices/bus/vtech/memexp/memexp.h17
-rw-r--r--src/devices/bus/wangpc/wangpc.cpp7
-rw-r--r--src/devices/bus/wangpc/wangpc.h44
-rw-r--r--src/devices/bus/x68k/x68kexp.h16
-rw-r--r--src/devices/bus/z88/z88.h4
-rw-r--r--src/devices/cpu/adsp2100/adsp2100.h16
-rw-r--r--src/devices/cpu/amis2000/amis2000.h30
-rw-r--r--src/devices/cpu/apexc/apexc.h18
-rw-r--r--src/devices/cpu/arm/arm.h4
-rw-r--r--src/devices/cpu/arm7/arm7.h8
-rw-r--r--src/devices/cpu/arm7/lpc210x.h3
-rw-r--r--src/devices/cpu/avr8/avr8.h4
-rw-r--r--src/devices/cpu/ccpu/ccpu.h10
-rw-r--r--src/devices/cpu/cop400/cop400.h60
-rw-r--r--src/devices/cpu/cosmac/cosmac.h40
-rw-r--r--src/devices/cpu/cubeqcpu/cubeqcpu.h22
-rw-r--r--src/devices/cpu/dsp32/dsp32.h4
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.h42
-rw-r--r--src/devices/cpu/esrip/esrip.h20
-rw-r--r--src/devices/cpu/h8/h83002.h8
-rw-r--r--src/devices/cpu/h8/h8_sci.h8
-rw-r--r--src/devices/cpu/hcd62121/hcd62121.h24
-rw-r--r--src/devices/cpu/hd61700/hd61700.h28
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.h50
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.h8
-rw-r--r--src/devices/cpu/i386/i386.h10
-rw-r--r--src/devices/cpu/i8085/i8085.h24
-rw-r--r--src/devices/cpu/i8089/i8089.h6
-rw-r--r--src/devices/cpu/i86/i186.cpp4
-rw-r--r--src/devices/cpu/i86/i186.h16
-rw-r--r--src/devices/cpu/i86/i286.h8
-rw-r--r--src/devices/cpu/i86/i86.h22
-rw-r--r--src/devices/cpu/jaguar/jaguar.h6
-rw-r--r--src/devices/cpu/lc8670/lc8670.h20
-rw-r--r--src/devices/cpu/lh5801/lh5801.h6
-rw-r--r--src/devices/cpu/lr35902/lr35902.h14
-rw-r--r--src/devices/cpu/m6502/m5074x.h32
-rw-r--r--src/devices/cpu/m6502/m6502.h4
-rw-r--r--src/devices/cpu/m6502/xavix.h4
-rw-r--r--src/devices/cpu/m6800/m6801.h10
-rw-r--r--src/devices/cpu/m6805/m68705.h22
-rw-r--r--src/devices/cpu/m6805/m68hc05.h29
-rw-r--r--src/devices/cpu/m6809/konami.h4
-rw-r--r--src/devices/cpu/m6809/m6809.h6
-rw-r--r--src/devices/cpu/mb86233/mb86233.h18
-rw-r--r--src/devices/cpu/mb88xx/mb88xx.h46
-rw-r--r--src/devices/cpu/mc68hc11/mc68hc11.h12
-rw-r--r--src/devices/cpu/mcs40/mcs40.h90
-rw-r--r--src/devices/cpu/mcs48/mcs48.h38
-rw-r--r--src/devices/cpu/mcs51/mcs51.h42
-rw-r--r--src/devices/cpu/melps4/melps4.h44
-rw-r--r--src/devices/cpu/mips/mips3.h12
-rw-r--r--src/devices/cpu/mips/r3000.h38
-rw-r--r--src/devices/cpu/mn10200/mn10200.h28
-rw-r--r--src/devices/cpu/nanoprocessor/nanoprocessor.h8
-rw-r--r--src/devices/cpu/nec/v25.h34
-rw-r--r--src/devices/cpu/nec/v53.cpp2
-rw-r--r--src/devices/cpu/nec/v53.h116
-rw-r--r--src/devices/cpu/patinhofeio/patinhofeio_cpu.h18
-rw-r--r--src/devices/cpu/pdp1/pdp1.h4
-rw-r--r--src/devices/cpu/pdp1/tx0.h42
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.h39
-rw-r--r--src/devices/cpu/powerpc/ppc.h6
-rw-r--r--src/devices/cpu/pps4/pps4.h14
-rw-r--r--src/devices/cpu/psx/dma.h6
-rw-r--r--src/devices/cpu/psx/irq.h6
-rw-r--r--src/devices/cpu/psx/psx.cpp5
-rw-r--r--src/devices/cpu/psx/psx.h28
-rw-r--r--src/devices/cpu/psx/rcnt.h14
-rw-r--r--src/devices/cpu/psx/sio.h22
-rw-r--r--src/devices/cpu/rsp/rsp.h20
-rw-r--r--src/devices/cpu/s2650/s2650.h14
-rw-r--r--src/devices/cpu/saturn/saturn.h34
-rw-r--r--src/devices/cpu/sc61860/sc61860.h34
-rw-r--r--src/devices/cpu/scmp/scmp.h26
-rw-r--r--src/devices/cpu/scudsp/scudsp.h12
-rw-r--r--src/devices/cpu/sh/sh2.h16
-rw-r--r--src/devices/cpu/sh/sh4.h48
-rw-r--r--src/devices/cpu/sharc/sharc.h6
-rw-r--r--src/devices/cpu/sm510/sm500.h6
-rw-r--r--src/devices/cpu/sm510/sm510.h44
-rw-r--r--src/devices/cpu/sm8500/sm8500.h10
-rw-r--r--src/devices/cpu/sparc/sparc.h4
-rw-r--r--src/devices/cpu/superfx/superfx.h6
-rw-r--r--src/devices/cpu/t11/t11.h10
-rw-r--r--src/devices/cpu/tlcs90/tlcs90.h46
-rw-r--r--src/devices/cpu/tlcs900/900tbl.hxx2796
-rw-r--r--src/devices/cpu/tlcs900/tlcs900.h962
-rw-r--r--src/devices/cpu/tms1000/tms0270.h14
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.h22
-rw-r--r--src/devices/cpu/tms32010/tms32010.h6
-rw-r--r--src/devices/cpu/tms32025/tms32025.h26
-rw-r--r--src/devices/cpu/tms32031/tms32031.h16
-rw-r--r--src/devices/cpu/tms34010/tms34010.h34
-rw-r--r--src/devices/cpu/tms7000/tms7000.h26
-rw-r--r--src/devices/cpu/tms9900/tms9900.h14
-rw-r--r--src/devices/cpu/tms9900/tms9995.h20
-rw-r--r--src/devices/cpu/tms9900/tms99com.h14
-rw-r--r--src/devices/cpu/ucom4/ucom4.h48
-rw-r--r--src/devices/cpu/upd7725/upd7725.h44
-rw-r--r--src/devices/cpu/upd7810/upd7810.h102
-rw-r--r--src/devices/cpu/z8/z8.h28
-rw-r--r--src/devices/cpu/z80/kl5c80a12.h2
-rw-r--r--src/devices/cpu/z80/tmpz84c011.h58
-rw-r--r--src/devices/cpu/z80/tmpz84c015.h104
-rw-r--r--src/devices/cpu/z80/z80.h12
-rw-r--r--src/devices/cpu/z80/z80daisy.cpp13
-rw-r--r--src/devices/cpu/z80/z80daisy.h4
-rw-r--r--src/devices/cpu/z80/z80daisy_generic.cpp10
-rw-r--r--src/devices/cpu/z80/z80daisy_generic.h9
-rw-r--r--src/devices/cpu/z8000/z8000.h4
-rw-r--r--src/devices/imagedev/bitbngr.h8
-rw-r--r--src/devices/imagedev/cassette.h16
-rw-r--r--src/devices/imagedev/chd_cd.h4
-rw-r--r--src/devices/imagedev/diablo.h12
-rw-r--r--src/devices/imagedev/flopdrv.h8
-rw-r--r--src/devices/imagedev/harddriv.h12
-rw-r--r--src/devices/imagedev/midiin.h4
-rw-r--r--src/devices/imagedev/printer.h4
-rw-r--r--src/devices/imagedev/snapquik.h6
-rw-r--r--src/devices/machine/1mb5.h16
-rw-r--r--src/devices/machine/53c7xx.h12
-rw-r--r--src/devices/machine/53c810.h12
-rw-r--r--src/devices/machine/64h156.h12
-rw-r--r--src/devices/machine/6522via.h32
-rw-r--r--src/devices/machine/6525tpi.h36
-rw-r--r--src/devices/machine/6532riot.h20
-rw-r--r--src/devices/machine/68153bim.h28
-rw-r--r--src/devices/machine/6821pia.h44
-rw-r--r--src/devices/machine/68230pit.h48
-rw-r--r--src/devices/machine/68307.h18
-rw-r--r--src/devices/machine/68340.h51
-rw-r--r--src/devices/machine/6840ptm.h18
-rw-r--r--src/devices/machine/6850acia.h12
-rw-r--r--src/devices/machine/68561mpcc.h33
-rw-r--r--src/devices/machine/7200fifo.h16
-rw-r--r--src/devices/machine/7400.h16
-rw-r--r--src/devices/machine/7404.h24
-rw-r--r--src/devices/machine/74123.h28
-rw-r--r--src/devices/machine/74145.h40
-rw-r--r--src/devices/machine/74148.h4
-rw-r--r--src/devices/machine/74153.h11
-rw-r--r--src/devices/machine/74157.h12
-rw-r--r--src/devices/machine/74161.h24
-rw-r--r--src/devices/machine/74165.h12
-rw-r--r--src/devices/machine/74166.h11
-rw-r--r--src/devices/machine/74175.h48
-rw-r--r--src/devices/machine/74259.h22
-rw-r--r--src/devices/machine/7474.h8
-rw-r--r--src/devices/machine/8042kbdc.h24
-rw-r--r--src/devices/machine/82s129.h30
-rw-r--r--src/devices/machine/8364_paula.h11
-rw-r--r--src/devices/machine/8530scc.h4
-rw-r--r--src/devices/machine/aakart.h8
-rw-r--r--src/devices/machine/adc0808.h44
-rw-r--r--src/devices/machine/adc083x.h6
-rw-r--r--src/devices/machine/adc0844.h52
-rw-r--r--src/devices/machine/adc1038.h8
-rw-r--r--src/devices/machine/adc1213x.h4
-rw-r--r--src/devices/machine/akiko.h35
-rw-r--r--src/devices/machine/am53cf96.h4
-rw-r--r--src/devices/machine/am9513.h18
-rw-r--r--src/devices/machine/am9517a.h46
-rw-r--r--src/devices/machine/am9519.h4
-rw-r--r--src/devices/machine/amigafdc.h20
-rw-r--r--src/devices/machine/applefdc.h4
-rw-r--r--src/devices/machine/at45dbxx.h4
-rw-r--r--src/devices/machine/at_keybc.h24
-rw-r--r--src/devices/machine/ataintf.h12
-rw-r--r--src/devices/machine/atmel_arm_aic.h4
-rw-r--r--src/devices/machine/ay31015.h64
-rw-r--r--src/devices/machine/bankdev.h18
-rw-r--r--src/devices/machine/cdp1852.h16
-rw-r--r--src/devices/machine/cdp1871.h52
-rw-r--r--src/devices/machine/cdp1879.h4
-rw-r--r--src/devices/machine/clock.h4
-rw-r--r--src/devices/machine/com8116.h12
-rw-r--r--src/devices/machine/cr511b.h35
-rw-r--r--src/devices/machine/cs4031.cpp24
-rw-r--r--src/devices/machine/cs4031.h16
-rw-r--r--src/devices/machine/cs8221.cpp18
-rw-r--r--src/devices/machine/cs8221.h12
-rw-r--r--src/devices/machine/cxd1095.h36
-rw-r--r--src/devices/machine/dmac.h41
-rw-r--r--src/devices/machine/dp8390.h24
-rw-r--r--src/devices/machine/ds1315.h5
-rw-r--r--src/devices/machine/ds1386.h12
-rw-r--r--src/devices/machine/ds2404.cpp36
-rw-r--r--src/devices/machine/ds2404.h12
-rw-r--r--src/devices/machine/ds75161a.h64
-rw-r--r--src/devices/machine/e05a03.h20
-rw-r--r--src/devices/machine/e05a30.h36
-rw-r--r--src/devices/machine/eeprom.cpp57
-rw-r--r--src/devices/machine/eeprom.h24
-rw-r--r--src/devices/machine/eeprompar.cpp14
-rw-r--r--src/devices/machine/eeprompar.h6
-rw-r--r--src/devices/machine/eepromser.cpp38
-rw-r--r--src/devices/machine/eepromser.h17
-rw-r--r--src/devices/machine/f3853.h4
-rw-r--r--src/devices/machine/fga002.h20
-rw-r--r--src/devices/machine/gayle.cpp10
-rw-r--r--src/devices/machine/gayle.h33
-rw-r--r--src/devices/machine/gen_latch.h11
-rw-r--r--src/devices/machine/genpc.cpp6
-rw-r--r--src/devices/machine/genpc.h18
-rw-r--r--src/devices/machine/hd63450.h72
-rw-r--r--src/devices/machine/hd64610.h8
-rw-r--r--src/devices/machine/hdc92x4.h24
-rw-r--r--src/devices/machine/hp_taco.h14
-rw-r--r--src/devices/machine/i2cmem.h28
-rw-r--r--src/devices/machine/i7220.h12
-rw-r--r--src/devices/machine/i80130.h24
-rw-r--r--src/devices/machine/i8087.h12
-rw-r--r--src/devices/machine/i8155.h28
-rw-r--r--src/devices/machine/i8212.h16
-rw-r--r--src/devices/machine/i8214.h8
-rw-r--r--src/devices/machine/i82371sb.h4
-rw-r--r--src/devices/machine/i8243.h10
-rw-r--r--src/devices/machine/i8251.h30
-rw-r--r--src/devices/machine/i8255.h32
-rw-r--r--src/devices/machine/i82586.h4
-rw-r--r--src/devices/machine/i8271.h16
-rw-r--r--src/devices/machine/i8279.h28
-rw-r--r--src/devices/machine/i8355.h16
-rw-r--r--src/devices/machine/idectrl.h40
-rw-r--r--src/devices/machine/ie15_kbd.h4
-rw-r--r--src/devices/machine/im6402.h24
-rw-r--r--src/devices/machine/input_merger.h5
-rw-r--r--src/devices/machine/ins8154.h20
-rw-r--r--src/devices/machine/ins8250.h24
-rw-r--r--src/devices/machine/jvsdev.cpp6
-rw-r--r--src/devices/machine/jvsdev.h4
-rw-r--r--src/devices/machine/k033906.h4
-rw-r--r--src/devices/machine/k053252.cpp7
-rw-r--r--src/devices/machine/k053252.h28
-rw-r--r--src/devices/machine/k056230.h8
-rw-r--r--src/devices/machine/kb3600.h52
-rw-r--r--src/devices/machine/keyboard.h4
-rw-r--r--src/devices/machine/kr2376.h4
-rw-r--r--src/devices/machine/laserdsc.cpp94
-rw-r--r--src/devices/machine/laserdsc.h64
-rw-r--r--src/devices/machine/latch.h19
-rw-r--r--src/devices/machine/latch8.h48
-rw-r--r--src/devices/machine/legscsi.h4
-rw-r--r--src/devices/machine/lh5810.h24
-rw-r--r--src/devices/machine/mb8421.h10
-rw-r--r--src/devices/machine/mb87078.h4
-rw-r--r--src/devices/machine/mb8795.h16
-rw-r--r--src/devices/machine/mb89352.h8
-rw-r--r--src/devices/machine/mb89363b.h50
-rw-r--r--src/devices/machine/mc14411.h34
-rw-r--r--src/devices/machine/mc146818.h4
-rw-r--r--src/devices/machine/mc2661.h42
-rw-r--r--src/devices/machine/mc68328.h100
-rw-r--r--src/devices/machine/mc6843.h4
-rw-r--r--src/devices/machine/mc6846.h24
-rw-r--r--src/devices/machine/mc6852.h24
-rw-r--r--src/devices/machine/mc6854.h20
-rw-r--r--src/devices/machine/mc68681.cpp13
-rw-r--r--src/devices/machine/mc68681.h36
-rw-r--r--src/devices/machine/mc68901.h54
-rw-r--r--src/devices/machine/mccs1850.h12
-rw-r--r--src/devices/machine/meters.h4
-rw-r--r--src/devices/machine/microtch.h8
-rw-r--r--src/devices/machine/mm5740.h40
-rw-r--r--src/devices/machine/mm58167.h4
-rw-r--r--src/devices/machine/mm58274c.h8
-rw-r--r--src/devices/machine/mm74c922.h32
-rw-r--r--src/devices/machine/mos6526.h36
-rw-r--r--src/devices/machine/mos6529.h32
-rw-r--r--src/devices/machine/mos6530.h16
-rw-r--r--src/devices/machine/mos6530n.h92
-rw-r--r--src/devices/machine/mos6551.h24
-rw-r--r--src/devices/machine/mos8722.h20
-rw-r--r--src/devices/machine/msm58321.h30
-rw-r--r--src/devices/machine/msm6242.h4
-rw-r--r--src/devices/machine/msm6253.h30
-rw-r--r--src/devices/machine/myb3k_kbd.h6
-rw-r--r--src/devices/machine/ncr5380.h4
-rw-r--r--src/devices/machine/ncr5380n.h10
-rw-r--r--src/devices/machine/ncr5390.h10
-rw-r--r--src/devices/machine/ncr539x.h8
-rw-r--r--src/devices/machine/netlist.cpp75
-rw-r--r--src/devices/machine/netlist.h40
-rw-r--r--src/devices/machine/nsc810.h32
-rw-r--r--src/devices/machine/nvram.cpp25
-rw-r--r--src/devices/machine/nvram.h26
-rw-r--r--src/devices/machine/pc_fdc.h8
-rw-r--r--src/devices/machine/pc_lpt.h6
-rw-r--r--src/devices/machine/pci-ide.h4
-rw-r--r--src/devices/machine/pci9050.h8
-rw-r--r--src/devices/machine/pckeybrd.h16
-rw-r--r--src/devices/machine/pdc.h8
-rw-r--r--src/devices/machine/phi.h43
-rw-r--r--src/devices/machine/pic8259.h12
-rw-r--r--src/devices/machine/pit8253.h32
-rw-r--r--src/devices/machine/pla.h28
-rw-r--r--src/devices/machine/r10696.h8
-rw-r--r--src/devices/machine/r10788.h4
-rw-r--r--src/devices/machine/ra17xx.h12
-rw-r--r--src/devices/machine/ram.h14
-rw-r--r--src/devices/machine/rf5c296.h6
-rw-r--r--src/devices/machine/ripple_counter.cpp13
-rw-r--r--src/devices/machine/ripple_counter.h16
-rw-r--r--src/devices/machine/rp5c01.h8
-rw-r--r--src/devices/machine/rp5c15.h8
-rw-r--r--src/devices/machine/rstbuf.h10
-rw-r--r--src/devices/machine/rtc4543.h4
-rw-r--r--src/devices/machine/rtc65271.h4
-rw-r--r--src/devices/machine/s2636.h25
-rw-r--r--src/devices/machine/s3c2400.cpp10
-rw-r--r--src/devices/machine/s3c2400.h46
-rw-r--r--src/devices/machine/s3c2410.cpp10
-rw-r--r--src/devices/machine/s3c2410.h62
-rw-r--r--src/devices/machine/s3c2440.cpp11
-rw-r--r--src/devices/machine/s3c2440.h62
-rw-r--r--src/devices/machine/s3c44b0.h28
-rw-r--r--src/devices/machine/scnxx562.h69
-rw-r--r--src/devices/machine/sega_scu.cpp7
-rw-r--r--src/devices/machine/sega_scu.h2
-rw-r--r--src/devices/machine/smartmed.h117
-rw-r--r--src/devices/machine/smc91c9x.h8
-rw-r--r--src/devices/machine/smpc.cpp16
-rw-r--r--src/devices/machine/smpc.h97
-rw-r--r--src/devices/machine/steppers.h43
-rw-r--r--src/devices/machine/tc009xlvc.cpp11
-rw-r--r--src/devices/machine/tc009xlvc.h6
-rw-r--r--src/devices/machine/te7750.h55
-rw-r--r--src/devices/machine/terminal.h5
-rw-r--r--src/devices/machine/ticket.cpp30
-rw-r--r--src/devices/machine/ticket.h17
-rw-r--r--src/devices/machine/timekpr.h8
-rw-r--r--src/devices/machine/timer.cpp91
-rw-r--r--src/devices/machine/timer.h51
-rw-r--r--src/devices/machine/tmc0430.h16
-rw-r--r--src/devices/machine/tmp68301.h12
-rw-r--r--src/devices/machine/tms1024.h16
-rw-r--r--src/devices/machine/tms5501.h16
-rw-r--r--src/devices/machine/tms6100.h4
-rw-r--r--src/devices/machine/tms9901.h42
-rw-r--r--src/devices/machine/tms9902.h16
-rw-r--r--src/devices/machine/tube.h16
-rw-r--r--src/devices/machine/upd4701.h20
-rw-r--r--src/devices/machine/upd7002.h8
-rw-r--r--src/devices/machine/upd71071.h46
-rw-r--r--src/devices/machine/upd765.h18
-rw-r--r--src/devices/machine/vrc4373.cpp5
-rw-r--r--src/devices/machine/vrc4373.h4
-rw-r--r--src/devices/machine/vt82c496.h8
-rw-r--r--src/devices/machine/watchdog.cpp25
-rw-r--r--src/devices/machine/watchdog.h8
-rw-r--r--src/devices/machine/wd11c00_17.h44
-rw-r--r--src/devices/machine/wd2010.h60
-rw-r--r--src/devices/machine/wd33c93.h4
-rw-r--r--src/devices/machine/wd7600.cpp24
-rw-r--r--src/devices/machine/wd7600.h16
-rw-r--r--src/devices/machine/wd_fdc.h20
-rw-r--r--src/devices/machine/x2212.cpp11
-rw-r--r--src/devices/machine/x2212.h6
-rw-r--r--src/devices/machine/ym2148.h18
-rw-r--r--src/devices/machine/ym3802.h10
-rw-r--r--src/devices/machine/z80ctc.h16
-rw-r--r--src/devices/machine/z80dart.h75
-rw-r--r--src/devices/machine/z80dma.h28
-rw-r--r--src/devices/machine/z80pio.h28
-rw-r--r--src/devices/machine/z80scc.h65
-rw-r--r--src/devices/machine/z80sio.h54
-rw-r--r--src/devices/machine/z80sti.h42
-rw-r--r--src/devices/machine/z8536.h28
-rw-r--r--src/emu/devcpu.cpp11
-rw-r--r--src/emu/devcpu.h4
-rw-r--r--src/emu/device.cpp12
-rw-r--r--src/emu/device.h48
-rw-r--r--src/emu/diexec.cpp58
-rw-r--r--src/emu/diexec.h38
-rw-r--r--src/emu/digfx.cpp31
-rw-r--r--src/emu/digfx.h10
-rw-r--r--src/emu/diimage.h10
-rw-r--r--src/emu/dioutput.h8
-rw-r--r--src/emu/dirom.cpp9
-rw-r--r--src/emu/dirom.h4
-rw-r--r--src/emu/dislot.cpp40
-rw-r--r--src/emu/dislot.h38
-rw-r--r--src/emu/disound.cpp34
-rw-r--r--src/emu/disound.h17
-rw-r--r--src/emu/divideo.cpp15
-rw-r--r--src/emu/divideo.h6
-rw-r--r--src/emu/emupal.cpp63
-rw-r--r--src/emu/emupal.h72
-rw-r--r--src/emu/mconfig.cpp4
-rw-r--r--src/emu/screen.cpp153
-rw-r--r--src/emu/screen.h81
-rw-r--r--src/emu/softlist_dev.cpp24
-rw-r--r--src/emu/softlist_dev.h8
-rw-r--r--src/emu/speaker.cpp14
-rw-r--r--src/emu/speaker.h4
-rw-r--r--src/emu/tilemap.cpp81
-rw-r--r--src/emu/tilemap.h43
-rw-r--r--src/emu/validity.cpp4
-rw-r--r--src/mame/drivers/asst128.cpp2
-rw-r--r--src/mame/drivers/at.cpp8
-rw-r--r--src/mame/drivers/europc.cpp6
-rw-r--r--src/mame/drivers/ksys573.cpp2
-rw-r--r--src/mame/drivers/m24.cpp2
-rw-r--r--src/mame/drivers/microvsn.cpp30
-rw-r--r--src/mame/drivers/milton6805.cpp4
-rw-r--r--src/mame/drivers/mtouchxl.cpp18
-rw-r--r--src/mame/drivers/next.cpp2
-rw-r--r--src/mame/drivers/pc.cpp16
-rw-r--r--src/mame/drivers/rainbow.cpp2
-rw-r--r--src/mame/drivers/saturn.cpp10
-rw-r--r--src/mame/drivers/stv.cpp4
-rw-r--r--src/mame/drivers/tandy1t.cpp12
-rw-r--r--src/mame/drivers/tosh1000.cpp6
-rw-r--r--src/mame/drivers/tv990.cpp2
-rw-r--r--src/mame/includes/apollo.h8
-rw-r--r--src/mame/machine/at.cpp2
-rw-r--r--src/mame/machine/fd1094.cpp2
-rw-r--r--src/mame/machine/iteagle_fpga.cpp2
-rw-r--r--src/mame/machine/psxcd.cpp2
-rw-r--r--src/mame/machine/teleprinter.h2
-rw-r--r--src/mame/video/k051316.cpp8
-rw-r--r--src/mame/video/k051960.cpp6
-rw-r--r--src/mame/video/k052109.cpp4
-rw-r--r--src/mame/video/k053244_k053245.cpp4
574 files changed, 6862 insertions, 8616 deletions
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp
index d1f0bbd7fe0..0b90ed0b000 100644
--- a/src/devices/bus/a1bus/a1bus.cpp
+++ b/src/devices/bus/a1bus/a1bus.cpp
@@ -36,13 +36,6 @@ a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, device_type
{
}
-void a1bus_slot_device::static_set_a1bus_slot(device_t &device, const char *tag, const char *slottag)
-{
- a1bus_slot_device &a1bus_card = dynamic_cast<a1bus_slot_device &>(device);
- a1bus_card.m_a1bus_tag = tag;
- a1bus_card.m_a1bus_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -51,7 +44,7 @@ void a1bus_slot_device::device_start()
{
device_a1bus_card_interface *dev = dynamic_cast<device_a1bus_card_interface *>(get_card_device());
- if (dev) device_a1bus_card_interface::static_set_a1bus_tag(*dev, m_a1bus_tag, m_a1bus_slottag);
+ if (dev) dev->set_a1bus_tag(m_a1bus_tag, m_a1bus_slottag);
}
//**************************************************************************
@@ -60,12 +53,6 @@ void a1bus_slot_device::device_start()
DEFINE_DEVICE_TYPE(A1BUS, a1bus_device, "a1bus", "Apple I Bus")
-void a1bus_device::static_set_cputag(device_t &device, const char *tag)
-{
- a1bus_device &a1bus = downcast<a1bus_device &>(device);
- a1bus.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -181,12 +168,6 @@ device_a1bus_card_interface::~device_a1bus_card_interface()
{
}
-void device_a1bus_card_interface::static_set_a1bus_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_a1bus_card_interface &a1bus_card = dynamic_cast<device_a1bus_card_interface &>(device);
- a1bus_card.m_a1bus_tag = tag;
- a1bus_card.m_a1bus_slottag = slottag;
-}
void device_a1bus_card_interface::set_a1bus_device()
{
diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h
index 320a2d9bc80..c380a5fe46d 100644
--- a/src/devices/bus/a1bus/a1bus.h
+++ b/src/devices/bus/a1bus/a1bus.h
@@ -17,25 +17,25 @@
//**************************************************************************
#define MCFG_A1BUS_CPU(_cputag) \
- a1bus_device::static_set_cputag(*device, _cputag);
+ downcast<a1bus_device &>(*device).set_cputag(_cputag);
#define MCFG_A1BUS_OUT_IRQ_CB(_devcb) \
- devcb = &a1bus_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a1bus_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_A1BUS_OUT_NMI_CB(_devcb) \
- devcb = &a1bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a1bus_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_A1BUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, A1BUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- a1bus_slot_device::static_set_a1bus_slot(*device, _nbtag, _tag);
+ downcast<a1bus_slot_device &>(*device).set_a1bus_slot(_nbtag, _tag);
#define MCFG_A1BUS_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_A1BUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- device_a1bus_card_interface::static_set_a1bus_tag(*device, _nbtag, _tag);
+ downcast<device_a1bus_card_interface &>(*device).set_a1bus_tag(_nbtag, _tag);
//**************************************************************************
// TYPE DEFINITIONS
@@ -51,7 +51,7 @@ public:
a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_a1bus_slot(device_t &device, const char *tag, const char *slottag);
+ void set_a1bus_slot(const char *tag, const char *slottag) { m_a1bus_tag = tag; m_a1bus_slottag = slottag; }
protected:
a1bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -76,9 +76,9 @@ public:
a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<a1bus_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<a1bus_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
void add_a1bus_card(device_a1bus_card_interface *card);
device_a1bus_card_interface *get_a1bus_card();
@@ -136,7 +136,7 @@ public:
void install_bank(offs_t start, offs_t end, char *tag, uint8_t *data);
// inline configuration
- static void static_set_a1bus_tag(device_t &device, const char *tag, const char *slottag);
+ void set_a1bus_tag(const char *tag, const char *slottag) { m_a1bus_tag = tag; m_a1bus_slottag = slottag; }
protected:
device_a1bus_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp
index bd1f1fdfe3a..a279ce3a9d6 100644
--- a/src/devices/bus/a2bus/a2bus.cpp
+++ b/src/devices/bus/a2bus/a2bus.cpp
@@ -100,13 +100,6 @@ a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, device_type
{
}
-void a2bus_slot_device::static_set_a2bus_slot(device_t &device, const char *tag, const char *slottag)
-{
- a2bus_slot_device &a2bus_card = dynamic_cast<a2bus_slot_device &>(device);
- a2bus_card.m_a2bus_tag = tag;
- a2bus_card.m_a2bus_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -115,7 +108,7 @@ void a2bus_slot_device::device_start()
{
device_a2bus_card_interface *dev = dynamic_cast<device_a2bus_card_interface *>(get_card_device());
- if (dev) device_a2bus_card_interface::static_set_a2bus_tag(*dev, m_a2bus_tag, m_a2bus_slottag);
+ if (dev) dev->set_a2bus_tag(m_a2bus_tag, m_a2bus_slottag);
}
//**************************************************************************
@@ -124,12 +117,6 @@ void a2bus_slot_device::device_start()
DEFINE_DEVICE_TYPE(A2BUS, a2bus_device, "a2bus", "Apple II Bus")
-void a2bus_device::static_set_cputag(device_t &device, const char *tag)
-{
- a2bus_device &a2bus = downcast<a2bus_device &>(device);
- a2bus.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -304,13 +291,6 @@ device_a2bus_card_interface::~device_a2bus_card_interface()
{
}
-void device_a2bus_card_interface::static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_a2bus_card_interface &a2bus_card = dynamic_cast<device_a2bus_card_interface &>(device);
- a2bus_card.m_a2bus_tag = tag;
- a2bus_card.m_a2bus_slottag = slottag;
-}
-
void device_a2bus_card_interface::interface_pre_start()
{
if (!m_a2bus)
diff --git a/src/devices/bus/a2bus/a2bus.h b/src/devices/bus/a2bus/a2bus.h
index cf02e2099f9..e008bfcb15c 100644
--- a/src/devices/bus/a2bus/a2bus.h
+++ b/src/devices/bus/a2bus/a2bus.h
@@ -28,28 +28,28 @@
//**************************************************************************
#define MCFG_A2BUS_CPU(_cputag) \
- a2bus_device::static_set_cputag(*device, _cputag);
+ downcast<a2bus_device &>(*device).set_cputag(_cputag);
#define MCFG_A2BUS_OUT_IRQ_CB(_devcb) \
- devcb = &a2bus_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a2bus_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_A2BUS_OUT_NMI_CB(_devcb) \
- devcb = &a2bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a2bus_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_A2BUS_OUT_INH_CB(_devcb) \
- devcb = &a2bus_device::set_out_inh_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a2bus_device &>(*device).set_out_inh_callback(DEVCB_##_devcb);
#define MCFG_A2BUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, A2BUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- a2bus_slot_device::static_set_a2bus_slot(*device, _nbtag, _tag);
+ downcast<a2bus_slot_device &>(*device).set_a2bus_slot(_nbtag, _tag);
#define MCFG_A2BUS_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_A2BUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- device_a2bus_card_interface::static_set_a2bus_tag(*device, _nbtag, _tag);
+ dynamic_cast<device_a2bus_card_interface &>(*device).set_a2bus_tag(_nbtag, _tag);
// 7M = XTAL(14'318'181) / 2 or XTAL(28'636'363) / 4 (for IIgs)
static constexpr uint32_t A2BUS_7M_CLOCK = 7159090;
@@ -68,7 +68,7 @@ public:
a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_a2bus_slot(device_t &device, const char *tag, const char *slottag);
+ void set_a2bus_slot(const char *tag, const char *slottag) { m_a2bus_tag = tag; m_a2bus_slottag = slottag; }
protected:
a2bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -95,10 +95,10 @@ public:
a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<a2bus_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<a2bus_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_inh_callback(device_t &device, Object &&cb) { return downcast<a2bus_device &>(device).m_out_inh_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_inh_callback(Object &&cb) { return m_out_inh_cb.set_callback(std::forward<Object>(cb)); }
void add_a2bus_card(int slot, device_a2bus_card_interface *card);
device_a2bus_card_interface *get_a2bus_card(int slot);
@@ -188,7 +188,7 @@ public:
void slot_dma_write_no_space(uint16_t offset, uint8_t data) { m_a2bus->dma_nospace_w(offset, data); }
// inline configuration
- static void static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag);
+ void set_a2bus_tag(const char *tag, const char *slottag) { m_a2bus_tag = tag; m_a2bus_slottag = slottag; }
protected:
device_a2bus_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp
index 7e3ba7ca8e3..6885d528128 100644
--- a/src/devices/bus/a2bus/a2eauxslot.cpp
+++ b/src/devices/bus/a2bus/a2eauxslot.cpp
@@ -38,13 +38,6 @@ a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, de
{
}
-void a2eauxslot_slot_device::static_set_a2eauxslot_slot(device_t &device, const char *tag, const char *slottag)
-{
- a2eauxslot_slot_device &a2eauxslot_card = dynamic_cast<a2eauxslot_slot_device &>(device);
- a2eauxslot_card.m_a2eauxslot_tag = tag;
- a2eauxslot_card.m_a2eauxslot_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -53,7 +46,7 @@ void a2eauxslot_slot_device::device_start()
{
device_a2eauxslot_card_interface *dev = dynamic_cast<device_a2eauxslot_card_interface *>(get_card_device());
- if (dev) device_a2eauxslot_card_interface::static_set_a2eauxslot_tag(*dev, m_a2eauxslot_tag, m_a2eauxslot_slottag);
+ if (dev) dev->set_a2eauxslot_tag(m_a2eauxslot_tag, m_a2eauxslot_slottag);
}
//**************************************************************************
@@ -62,12 +55,6 @@ void a2eauxslot_slot_device::device_start()
DEFINE_DEVICE_TYPE(A2EAUXSLOT, a2eauxslot_device, "a2eauxslot", "Apple IIe AUX Bus")
-void a2eauxslot_device::static_set_cputag(device_t &device, const char *tag)
-{
- a2eauxslot_device &a2eauxslot = downcast<a2eauxslot_device &>(device);
- a2eauxslot.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -167,13 +154,6 @@ device_a2eauxslot_card_interface::~device_a2eauxslot_card_interface()
{
}
-void device_a2eauxslot_card_interface::static_set_a2eauxslot_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_a2eauxslot_card_interface &a2eauxslot_card = dynamic_cast<device_a2eauxslot_card_interface &>(device);
- a2eauxslot_card.m_a2eauxslot_tag = tag;
- a2eauxslot_card.m_a2eauxslot_slottag = slottag;
-}
-
void device_a2eauxslot_card_interface::set_a2eauxslot_device()
{
m_a2eauxslot = dynamic_cast<a2eauxslot_device *>(device().machine().device(m_a2eauxslot_tag));
diff --git a/src/devices/bus/a2bus/a2eauxslot.h b/src/devices/bus/a2bus/a2eauxslot.h
index efc7917221d..2101f5cfc6b 100644
--- a/src/devices/bus/a2bus/a2eauxslot.h
+++ b/src/devices/bus/a2bus/a2eauxslot.h
@@ -20,18 +20,18 @@
//**************************************************************************
#define MCFG_A2EAUXSLOT_CPU(_cputag) \
- a2eauxslot_device::static_set_cputag(*device, _cputag);
+ downcast<a2eauxslot_device &>(*device).set_cputag(_cputag);
#define MCFG_A2EAUXSLOT_OUT_IRQ_CB(_devcb) \
- devcb = &a2eauxslot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a2eauxslot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_A2EAUXSLOT_OUT_NMI_CB(_devcb) \
- devcb = &a2eauxslot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a2eauxslot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_A2EAUXSLOT_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, A2EAUXSLOT_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- a2eauxslot_slot_device::static_set_a2eauxslot_slot(*device, _nbtag, _tag);
+ downcast<a2eauxslot_slot_device &>(*device).set_a2eauxslot_slot(_nbtag, _tag);
#define MCFG_A2EAUXSLOT_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
@@ -52,7 +52,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_a2eauxslot_slot(device_t &device, const char *tag, const char *slottag);
+ void set_a2eauxslot_slot(const char *tag, const char *slottag) { m_a2eauxslot_tag = tag; m_a2eauxslot_slottag = slottag; }
protected:
a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -75,9 +75,9 @@ public:
a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<a2eauxslot_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<a2eauxslot_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
void add_a2eauxslot_card(device_a2eauxslot_card_interface *card);
device_a2eauxslot_card_interface *get_a2eauxslot_card();
@@ -136,7 +136,7 @@ public:
void lower_slot_nmi() { m_a2eauxslot->set_nmi_line(CLEAR_LINE); }
// inline configuration
- static void static_set_a2eauxslot_tag(device_t &device, const char *tag, const char *slottag);
+ void set_a2eauxslot_tag(const char *tag, const char *slottag) { m_a2eauxslot_tag = tag; m_a2eauxslot_slottag = slottag; }
protected:
device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/a2bus/a2mcms.cpp b/src/devices/bus/a2bus/a2mcms.cpp
index e3e8260a98c..2a7912a6a84 100644
--- a/src/devices/bus/a2bus/a2mcms.cpp
+++ b/src/devices/bus/a2bus/a2mcms.cpp
@@ -39,7 +39,7 @@ DEFINE_DEVICE_TYPE(A2BUS_MCMS2, a2bus_mcms2_device, "a2mcms2", "Mountain Compute
#define ENGINE_TAG "engine"
#define MCFG_MCMS_IRQ_CALLBACK(_cb) \
- devcb = &mcms_device::set_irq_cb(*device, DEVCB_##_cb);
+ devcb = &downcast<mcms_device &>(*device).set_irq_cb(DEVCB_##_cb);
/***************************************************************************
FUNCTION PROTOTYPES
diff --git a/src/devices/bus/a2bus/a2mcms.h b/src/devices/bus/a2bus/a2mcms.h
index 2a2a469049d..f1026d97afd 100644
--- a/src/devices/bus/a2bus/a2mcms.h
+++ b/src/devices/bus/a2bus/a2mcms.h
@@ -33,7 +33,7 @@ public:
void set_bus_device(a2bus_mcms1_device *pDev) { m_pBusDevice = pDev; }
- template<class _Object> static devcb_base &set_irq_cb(device_t &device, _Object wr) { return downcast<mcms_device &>(device).m_write_irq.set_callback(wr); }
+ template<class Object> devcb_base &set_irq_cb(Object &&wr) { return m_write_irq.set_callback(std::forward<Object>(wr)); }
devcb_write_line m_write_irq;
protected:
diff --git a/src/devices/bus/a800/a8sio.cpp b/src/devices/bus/a800/a8sio.cpp
index cfbef3b47e4..0d5d248c11e 100644
--- a/src/devices/bus/a800/a8sio.cpp
+++ b/src/devices/bus/a800/a8sio.cpp
@@ -59,13 +59,6 @@ a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, device_type
{
}
-void a8sio_slot_device::static_set_a8sio_slot(device_t &device, const char *tag, const char *slottag)
-{
- a8sio_slot_device &a8sio_ext = dynamic_cast<a8sio_slot_device &>(device);
- a8sio_ext.m_a8sio_tag = tag;
- a8sio_ext.m_a8sio_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -76,7 +69,7 @@ void a8sio_slot_device::device_start()
if (dev)
{
- device_a8sio_card_interface::static_set_a8sio_tag(*dev, m_a8sio_tag, m_a8sio_slottag);
+ dev->set_a8sio_tag(m_a8sio_tag, m_a8sio_slottag);
}
}
@@ -191,13 +184,6 @@ device_a8sio_card_interface::~device_a8sio_card_interface()
{
}
-void device_a8sio_card_interface::static_set_a8sio_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_a8sio_card_interface &a8sio_card = dynamic_cast<device_a8sio_card_interface &>(device);
- a8sio_card.m_a8sio_tag = tag;
- a8sio_card.m_a8sio_slottag = slottag;
-}
-
void device_a8sio_card_interface::set_a8sio_device()
{
m_a8sio = dynamic_cast<a8sio_device *>(device().machine().device(m_a8sio_tag));
diff --git a/src/devices/bus/a800/a8sio.h b/src/devices/bus/a800/a8sio.h
index 31d853ec633..a9a1b4eec8b 100644
--- a/src/devices/bus/a800/a8sio.h
+++ b/src/devices/bus/a800/a8sio.h
@@ -43,10 +43,10 @@
#define MCFG_A8SIO_SLOT_ADD(_nbtag, _tag, _def_slot) \
MCFG_DEVICE_ADD(_tag, A8SIO_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(a8sio_cards, _def_slot, false) \
- a8sio_slot_device::static_set_a8sio_slot(*device, _nbtag, _tag);
+ downcast<a8sio_slot_device &>(*device).set_a8sio_slot(_nbtag, _tag);
#define MCFG_A8SIO_DATA_IN_CB(_devcb) \
- devcb = &a8sio_device::set_data_in_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<a8sio_device &>(*device).set_data_in_callback(DEVCB_##_devcb);
class a8sio_slot_device : public device_t,
@@ -57,7 +57,7 @@ public:
a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_a8sio_slot(device_t &device, const char *tag, const char *slottag);
+ void set_a8sio_slot(const char *tag, const char *slottag) { m_a8sio_tag = tag; m_a8sio_slottag = slottag; }
protected:
a8sio_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -84,9 +84,9 @@ public:
a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- template <class Object> static devcb_base &set_clock_in_callback(device_t &device, Object &&cb) { return downcast<a8sio_device &>(device).m_out_clock_in_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data_in_callback(device_t &device, Object &&cb) { return downcast<a8sio_device &>(device).m_out_data_in_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_audio_in_callback(device_t &device, Object &&cb) { return downcast<a8sio_device &>(device).m_out_audio_in_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_clock_in_callback(Object &&cb) { return m_out_clock_in_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data_in_callback(Object &&cb) { return m_out_data_in_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_audio_in_callback(Object &&cb) { return m_out_audio_in_cb.set_callback(std::forward<Object>(cb)); }
void add_a8sio_card(device_a8sio_card_interface *card);
device_a8sio_card_interface *get_a8sio_card();
@@ -129,7 +129,7 @@ public:
void set_a8sio_device();
// inline configuration
- static void static_set_a8sio_tag(device_t &device, const char *tag, const char *slottag);
+ void set_a8sio_tag(const char *tag, const char *slottag) { m_a8sio_tag = tag; m_a8sio_slottag = slottag; }
virtual DECLARE_WRITE_LINE_MEMBER( motor_w );
diff --git a/src/devices/bus/abckb/abckb.h b/src/devices/bus/abckb/abckb.h
index c876e261a2f..73c62ac6a0e 100644
--- a/src/devices/bus/abckb/abckb.h
+++ b/src/devices/bus/abckb/abckb.h
@@ -23,13 +23,13 @@
MCFG_DEVICE_SLOT_INTERFACE(abc_keyboard_devices, _def_slot, false)
#define MCFG_ABC_KEYBOARD_OUT_RX_HANDLER(_devcb) \
- devcb = &abc_keyboard_port_device::set_out_rx_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<abc_keyboard_port_device &>(*device).set_out_rx_handler(DEVCB_##_devcb);
#define MCFG_ABC_KEYBOARD_OUT_TRXC_HANDLER(_devcb) \
- devcb = &abc_keyboard_port_device::set_out_trxc_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<abc_keyboard_port_device &>(*device).set_out_trxc_handler(DEVCB_##_devcb);
#define MCFG_ABC_KEYBOARD_OUT_KEYDOWN_HANDLER(_devcb) \
- devcb = &abc_keyboard_port_device::set_out_keydown_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<abc_keyboard_port_device &>(*device).set_out_keydown_handler(DEVCB_##_devcb);
@@ -45,9 +45,9 @@ public:
// construction/destruction
abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_out_rx_handler(device_t &device, Object &&cb) { return downcast<abc_keyboard_port_device &>(device).m_out_rx_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_trxc_handler(device_t &device, Object &&cb) { return downcast<abc_keyboard_port_device &>(device).m_out_trxc_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_keydown_handler(device_t &device, Object &&cb) { return downcast<abc_keyboard_port_device &>(device).m_out_keydown_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rx_handler(Object &&cb) { return m_out_rx_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_trxc_handler(Object &&cb) { return m_out_trxc_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_keydown_handler(Object &&cb) { return m_out_keydown_handler.set_callback(std::forward<Object>(cb)); }
// computer interface
DECLARE_WRITE_LINE_MEMBER( txd_w );
diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h
index 6a856faa826..e59ea191ab4 100644
--- a/src/devices/bus/adam/exp.h
+++ b/src/devices/bus/adam/exp.h
@@ -34,7 +34,7 @@
#define MCFG_ADAM_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &adam_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<adam_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
@@ -55,7 +55,7 @@ public:
adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~adam_expansion_slot_device() { }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<adam_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2);
diff --git a/src/devices/bus/amiga/keyboard/keyboard.h b/src/devices/bus/amiga/keyboard/keyboard.h
index 4066ebd9d53..d78d1bcc6cd 100644
--- a/src/devices/bus/amiga/keyboard/keyboard.h
+++ b/src/devices/bus/amiga/keyboard/keyboard.h
@@ -28,13 +28,13 @@
MCFG_DEVICE_SLOT_INTERFACE(amiga_keyboard_devices, _def_slot, false)
#define MCFG_AMIGA_KEYBOARD_KCLK_HANDLER(_devcb) \
- devcb = &amiga_keyboard_bus_device::set_kclk_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<amiga_keyboard_bus_device &>(*device).set_kclk_handler(DEVCB_##_devcb);
#define MCFG_AMIGA_KEYBOARD_KDAT_HANDLER(_devcb) \
- devcb = &amiga_keyboard_bus_device::set_kdat_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<amiga_keyboard_bus_device &>(*device).set_kdat_handler(DEVCB_##_devcb);
#define MCFG_AMIGA_KEYBOARD_KRST_HANDLER(_devcb) \
- devcb = &amiga_keyboard_bus_device::set_krst_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<amiga_keyboard_bus_device &>(*device).set_krst_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -53,14 +53,9 @@ public:
virtual ~amiga_keyboard_bus_device();
// callbacks
- template <class Object> static devcb_base &set_kclk_handler(device_t &device, Object &&cb)
- { return downcast<amiga_keyboard_bus_device &>(device).m_kclk_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_kdat_handler(device_t &device, Object &&cb)
- { return downcast<amiga_keyboard_bus_device &>(device).m_kdat_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_krst_handler(device_t &device, Object &&cb)
- { return downcast<amiga_keyboard_bus_device &>(device).m_krst_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_kclk_handler(Object &&cb) { return m_kclk_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_kdat_handler(Object &&cb) { return m_kdat_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_krst_handler(Object &&cb) { return m_krst_handler.set_callback(std::forward<Object>(cb)); }
// called from keyboard
DECLARE_WRITE_LINE_MEMBER(kclk_w) { m_kclk_handler(state); }
diff --git a/src/devices/bus/amiga/zorro/zorro.cpp b/src/devices/bus/amiga/zorro/zorro.cpp
index 0e29f13893f..fec5d745015 100644
--- a/src/devices/bus/amiga/zorro/zorro.cpp
+++ b/src/devices/bus/amiga/zorro/zorro.cpp
@@ -34,13 +34,6 @@ zorro_slot_device::zorro_slot_device(const machine_config &mconfig, device_type
{
}
-void zorro_slot_device::set_zorro_slot(device_t &device, device_t *owner, const char *zorro_tag)
-{
- zorro_slot_device &zorro_card = dynamic_cast<zorro_slot_device &>(device);
- zorro_card.m_owner = owner;
- zorro_card.m_zorro_tag = zorro_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -76,16 +69,6 @@ zorro_device::zorro_device(const machine_config &mconfig, device_type type, cons
}
//-------------------------------------------------
-// set_cputag - set cpu we are attached to
-//-------------------------------------------------
-
-void zorro_device::set_cputag(device_t &device, const char *tag)
-{
- zorro_device &zorro = downcast<zorro_device &>(device);
- zorro.m_cputag = tag;
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/amiga/zorro/zorro.h b/src/devices/bus/amiga/zorro/zorro.h
index 38c172ead49..02ece4b59a4 100644
--- a/src/devices/bus/amiga/zorro/zorro.h
+++ b/src/devices/bus/amiga/zorro/zorro.h
@@ -159,59 +159,59 @@
#define MCFG_ZORRO_SLOT_ADD(_zorrotag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, ZORRO_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- zorro_slot_device::set_zorro_slot(*device, this, _zorrotag);
+ downcast<zorro_slot_device &>(*device).set_zorro_slot(this, _zorrotag);
// ======================> expansion slot
#define MCFG_EXPANSION_SLOT_ADD(_cputag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(EXP_SLOT_TAG, EXP_SLOT, 0) \
device_t *temp = device; \
- zorro_device::set_cputag(*device, _cputag); \
+ downcast<zorro_device &>(*device).set_cputag(_cputag); \
MCFG_ZORRO_SLOT_ADD(EXP_SLOT_TAG, "slot", _slot_intf, _def_slot) \
device = temp;
// callbacks
#define MCFG_EXPANSION_SLOT_OVR_HANDLER(_devcb) \
- devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_ovr_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_SLOT_INT2_HANDLER(_devcb) \
- devcb = &zorro_device::set_int2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_int2_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_SLOT_INT6_HANDLER(_devcb) \
- devcb = &zorro_device::set_int6_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_int6_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_SLOT_IPL_HANDLER(_devcb) \
- devcb = &exp_slot_device::set_ipl_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<exp_slot_device &>(*device).set_ipl_handler(DEVCB_##_devcb);
// ======================> zorro 2 bus
#define MCFG_ZORRO2_ADD(_cputag) \
MCFG_DEVICE_ADD(ZORROBUS_TAG, ZORRO2, 0) \
- zorro_device::set_cputag(*device, _cputag);
+ downcast<zorro_device &>(*device).set_cputag(_cputag);
#define MCFG_ZORRO2_SLOT_ADD(_tag, _slot_intf, _def_slot) \
MCFG_ZORRO_SLOT_ADD(ZORROBUS_TAG, _tag, _slot_intf, _def_slot)
#define MCFG_ZORRO2_OVR_HANDLER(_devcb) \
- devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_ovr_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_INT2_HANDLER(_devcb) \
- devcb = &zorro_device::set_int2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_int2_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_INT6_HANDLER(_devcb) \
- devcb = &zorro_device::set_int6_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro_device &>(*device).set_int6_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_EINT1_HANDLER(_devcb) \
- devcb = &zorro2_device::set_eint1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro2_device &>(*device).set_eint1_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_EINT4_HANDLER(_devcb) \
- devcb = &zorro2_device::set_eint4_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro2_device &>(*device).set_eint4_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_EINT5_HANDLER(_devcb) \
- devcb = &zorro2_device::set_eint5_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro2_device &>(*device).set_eint5_handler(DEVCB_##_devcb);
#define MCFG_ZORRO2_EINT7_HANDLER(_devcb) \
- devcb = &zorro2_device::set_eint7_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<zorro2_device &>(*device).set_eint7_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -235,7 +235,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void set_zorro_slot(device_t &device, device_t *owner, const char *zorro_tag);
+ void set_zorro_slot(device_t *owner, const char *zorro_tag) { m_owner = owner; m_zorro_tag = zorro_tag; }
protected:
zorro_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -252,15 +252,12 @@ DECLARE_DEVICE_TYPE(ZORRO_SLOT, zorro_slot_device)
class zorro_device : public device_t
{
public:
- // static configuration helpers
- static void set_cputag(device_t &device, const char *tag);
+ // configuration helpers
+ void set_cputag(const char *tag) { m_cputag = tag; }
- template <class Object> static devcb_base &set_int2_handler(device_t &device, Object &&cb)
- { return downcast<zorro_device &>(device).m_int2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_int6_handler(device_t &device, Object &&cb)
- { return downcast<zorro_device &>(device).m_int6_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ovr_handler(device_t &device, Object &&cb)
- { return downcast<zorro_device &>(device).m_ovr_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int2_handler(Object &&cb) { return m_int2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int6_handler(Object &&cb) { return m_int6_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ovr_handler(Object &&cb) { return m_ovr_handler.set_callback(std::forward<Object>(cb)); }
virtual void add_card(device_zorro_card_interface *card) = 0;
@@ -300,8 +297,7 @@ public:
// construction/destruction
exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_ipl_handler(device_t &device, Object &&cb)
- { return downcast<exp_slot_device &>(device).m_ipl_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ipl_handler(Object &&cb) { return m_ipl_handler.set_callback(std::forward<Object>(cb)); }
// the expansion slot can only have a single card
virtual void add_card(device_zorro_card_interface *card) override;
@@ -337,14 +333,10 @@ public:
zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~zorro2_device();
- template <class Object> static devcb_base &set_eint1_handler(device_t &device, Object &&cb)
- { return downcast<zorro2_device &>(device).m_eint1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_eint4_handler(device_t &device, Object &&cb)
- { return downcast<zorro2_device &>(device).m_eint4_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_eint5_handler(device_t &device, Object &&cb)
- { return downcast<zorro2_device &>(device).m_eint5_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_eint7_handler(device_t &device, Object &&cb)
- { return downcast<zorro2_device &>(device).m_eint7_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_eint1_handler(Object &&cb) { return m_eint1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_eint4_handler(Object &&cb) { return m_eint4_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_eint5_handler(Object &&cb) { return m_eint5_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_eint7_handler(Object &&cb) { return m_eint7_handler.set_callback(std::forward<Object>(cb)); }
// the zorro2 bus supports multiple cards
virtual void add_card(device_zorro_card_interface *card) override;
diff --git a/src/devices/bus/apricot/expansion/expansion.cpp b/src/devices/bus/apricot/expansion/expansion.cpp
index b5717d320a5..a7b04ca3cb7 100644
--- a/src/devices/bus/apricot/expansion/expansion.cpp
+++ b/src/devices/bus/apricot/expansion/expansion.cpp
@@ -121,26 +121,6 @@ void apricot_expansion_bus_device::add_card(device_apricot_expansion_card_interf
m_dev.append(*card);
}
-//-------------------------------------------------
-// set_cpu_tag - set cpu we are attached to
-//-------------------------------------------------
-
-void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag)
-{
- apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
- bus.m_cpu_tag = tag;
-}
-
-//-------------------------------------------------
-// set_iop_tag - set iop we are attached to
-//-------------------------------------------------
-
-void apricot_expansion_bus_device::set_iop_tag(device_t &device, device_t *owner, const char *tag)
-{
- apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
- bus.m_iop_tag = tag;
-}
-
// callbacks from slot device to the host
WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma1_w ) { m_dma1_handler(state); }
WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma2_w ) { m_dma2_handler(state); }
diff --git a/src/devices/bus/apricot/expansion/expansion.h b/src/devices/bus/apricot/expansion/expansion.h
index 72746b7160e..21b991ed810 100644
--- a/src/devices/bus/apricot/expansion/expansion.h
+++ b/src/devices/bus/apricot/expansion/expansion.h
@@ -54,32 +54,32 @@
#define MCFG_EXPANSION_ADD(_tag, _cpu_tag) \
MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_BUS, 0) \
- apricot_expansion_bus_device::set_cpu_tag(*device, this, _cpu_tag);
+ downcast<apricot_expansion_bus_device &>(*device).set_cpu_tag(this, _cpu_tag);
#define MCFG_EXPANSION_IOP_ADD(_tag) \
- apricot_expansion_bus_device::set_iop_tag(*device, this, _tag);
+ downcast<apricot_expansion_bus_device &>(*device).set_iop_tag(this, _tag);
#define MCFG_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_EXPANSION_DMA1_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_dma1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_dma1_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_DMA2_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_dma2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_dma2_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_EXT1_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_ext1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_ext1_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_EXT2_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_ext2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_ext2_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_INT2_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_int2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_int2_handler(DEVCB_##_devcb);
#define MCFG_EXPANSION_INT3_HANDLER(_devcb) \
- devcb = &apricot_expansion_bus_device::set_int3_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_expansion_bus_device &>(*device).set_int3_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -118,27 +118,16 @@ public:
apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~apricot_expansion_bus_device();
- template <class Object> static devcb_base &set_dma1_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_dma1_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_dma2_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_dma2_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ext1_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_ext1_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ext2_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_ext2_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_int2_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_int2_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_int3_handler(device_t &device, Object &&cb)
- { return downcast<apricot_expansion_bus_device &>(device).m_int3_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma1_handler(Object &&cb) { return m_dma1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma2_handler(Object &&cb) { return m_dma2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ext1_handler(Object &&cb) { return m_ext1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ext2_handler(Object &&cb) { return m_ext2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int2_handler(Object &&cb) { return m_int2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int3_handler(Object &&cb) { return m_int3_handler.set_callback(std::forward<Object>(cb)); }
// inline configuration
- static void set_cpu_tag(device_t &device, device_t *owner, const char *tag);
- static void set_iop_tag(device_t &device, device_t *owner, const char *tag);
+ void set_cpu_tag(device_t *owner, const char *tag) { m_cpu_tag = tag; }
+ void set_iop_tag(device_t *owner, const char *tag) { m_iop_tag = tag; }
void add_card(device_apricot_expansion_card_interface *card);
diff --git a/src/devices/bus/apricot/keyboard/keyboard.h b/src/devices/bus/apricot/keyboard/keyboard.h
index e7cc28ef584..97896e87a33 100644
--- a/src/devices/bus/apricot/keyboard/keyboard.h
+++ b/src/devices/bus/apricot/keyboard/keyboard.h
@@ -43,7 +43,7 @@
MCFG_DEVICE_SLOT_INTERFACE(apricot_keyboard_devices, _def_slot, false)
#define MCFG_APRICOT_KEYBOARD_IN_HANDLER(_devcb) \
- devcb = &apricot_keyboard_bus_device::set_in_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<apricot_keyboard_bus_device &>(*device).set_in_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -62,8 +62,7 @@ public:
virtual ~apricot_keyboard_bus_device();
// callbacks
- template <class Object> static devcb_base &set_in_handler(device_t &device, Object &&cb)
- { return downcast<apricot_keyboard_bus_device &>(device).m_in_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_in_handler(Object &&cb) { return m_in_handler.set_callback(std::forward<Object>(cb)); }
// called from keyboard
DECLARE_WRITE_LINE_MEMBER( in_w ) { m_in_handler(state); }
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
index d2d3a3c6765..de83f89632c 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
@@ -100,10 +100,10 @@
MCFG_BBC_1MHZBUS_SLOT_NMI_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, bbc_1mhzbus_slot_device, nmi_w))
#define MCFG_BBC_1MHZBUS_SLOT_IRQ_HANDLER(_devcb) \
- devcb = &bbc_1mhzbus_slot_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_1mhzbus_slot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_BBC_1MHZBUS_SLOT_NMI_HANDLER(_devcb) \
- devcb = &bbc_1mhzbus_slot_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_1mhzbus_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -122,11 +122,8 @@ public:
virtual ~bbc_1mhzbus_slot_device();
// callbacks
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
- { return downcast<bbc_1mhzbus_slot_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<bbc_1mhzbus_slot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( rst_w );
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
diff --git a/src/devices/bus/bbc/fdc/fdc.h b/src/devices/bus/bbc/fdc/fdc.h
index 81f515000b1..2472b5582be 100644
--- a/src/devices/bus/bbc/fdc/fdc.h
+++ b/src/devices/bus/bbc/fdc/fdc.h
@@ -22,10 +22,10 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed)
#define MCFG_BBC_FDC_SLOT_INTRQ_HANDLER(_devcb) \
- devcb = &bbc_fdc_slot_device::set_intrq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_fdc_slot_device &>(*device).set_intrq_handler(DEVCB_##_devcb);
#define MCFG_BBC_FDC_SLOT_DRQ_HANDLER(_devcb) \
- devcb = &bbc_fdc_slot_device::set_drq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_fdc_slot_device &>(*device).set_drq_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -44,10 +44,8 @@ public:
virtual ~bbc_fdc_slot_device();
// callbacks
- template <class Object> static devcb_base &set_intrq_handler(device_t &device, Object &&cb)
- { return downcast<bbc_fdc_slot_device &>(device).m_intrq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq_handler(device_t &device, Object &&cb)
- { return downcast<bbc_fdc_slot_device &>(device).m_drq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_intrq_handler(Object &&cb) { return m_intrq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq_handler(Object &&cb) { return m_drq_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( intrq_w ) { m_intrq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( drq_w) { m_drq_handler(state); }
diff --git a/src/devices/bus/bbc/tube/tube.h b/src/devices/bus/bbc/tube/tube.h
index 34137594026..7a7d4351e1c 100644
--- a/src/devices/bus/bbc/tube/tube.h
+++ b/src/devices/bus/bbc/tube/tube.h
@@ -54,7 +54,7 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_BBC_TUBE_SLOT_IRQ_HANDLER(_devcb) \
- devcb = &bbc_tube_slot_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_tube_slot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -74,8 +74,7 @@ public:
virtual ~bbc_tube_slot_device();
// callbacks
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
- { return downcast<bbc_tube_slot_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( host_r );
DECLARE_WRITE8_MEMBER( host_w );
diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h
index 632ad412f63..de2f8c4c8ff 100644
--- a/src/devices/bus/bbc/userport/userport.h
+++ b/src/devices/bus/bbc/userport/userport.h
@@ -41,10 +41,10 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_BBC_USERPORT_CB1_HANDLER(_devcb) \
- devcb = &bbc_userport_slot_device::set_cb1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_userport_slot_device &>(*device).set_cb1_handler(DEVCB_##_devcb);
#define MCFG_BBC_USERPORT_CB2_HANDLER(_devcb) \
- devcb = &bbc_userport_slot_device::set_cb2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<bbc_userport_slot_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -62,10 +62,8 @@ public:
bbc_userport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
- template <class Object> static devcb_base &set_cb1_handler(device_t &device, Object &&cb)
- { return downcast<bbc_userport_slot_device &>(device).m_cb1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cb2_handler(device_t &device, Object &&cb)
- { return downcast<bbc_userport_slot_device &>(device).m_cb2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cb1_handler(Object &&cb) { return m_cb1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cb2_handler(Object &&cb) { return m_cb2_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); }
diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp
index 5eed3140a52..e1ff1ad39ab 100644
--- a/src/devices/bus/bml3/bml3bus.cpp
+++ b/src/devices/bus/bml3/bml3bus.cpp
@@ -70,13 +70,6 @@ bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, device_t
{
}
-void bml3bus_slot_device::static_set_bml3bus_slot(device_t &device, const char *tag, const char *slottag)
-{
- bml3bus_slot_device &bml3bus_card = dynamic_cast<bml3bus_slot_device &>(device);
- bml3bus_card.m_bml3bus_tag = tag;
- bml3bus_card.m_bml3bus_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -85,7 +78,7 @@ void bml3bus_slot_device::device_start()
{
device_bml3bus_card_interface *dev = dynamic_cast<device_bml3bus_card_interface *>(get_card_device());
- if (dev) device_bml3bus_card_interface::static_set_bml3bus_tag(*dev, m_bml3bus_tag, m_bml3bus_slottag);
+ if (dev) dev->set_bml3bus_tag(m_bml3bus_tag, m_bml3bus_slottag);
}
//**************************************************************************
@@ -94,12 +87,6 @@ void bml3bus_slot_device::device_start()
DEFINE_DEVICE_TYPE(BML3BUS, bml3bus_device, "bml3bus", "Hitachi MB-6890 Bus")
-void bml3bus_device::static_set_cputag(device_t &device, const char *tag)
-{
- bml3bus_device &bml3bus = downcast<bml3bus_device &>(device);
- bml3bus.m_maincpu.set_tag(tag);
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -212,13 +199,6 @@ device_bml3bus_card_interface::~device_bml3bus_card_interface()
{
}
-void device_bml3bus_card_interface::static_set_bml3bus_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_bml3bus_card_interface &bml3bus_card = dynamic_cast<device_bml3bus_card_interface &>(device);
- bml3bus_card.m_bml3bus_tag = tag;
- bml3bus_card.m_bml3bus_slottag = slottag;
-}
-
void device_bml3bus_card_interface::set_bml3bus_device()
{
// extract the slot number from the last digit of the slot tag
diff --git a/src/devices/bus/bml3/bml3bus.h b/src/devices/bus/bml3/bml3bus.h
index bd1de270af2..b18642b44ac 100644
--- a/src/devices/bus/bml3/bml3bus.h
+++ b/src/devices/bus/bml3/bml3bus.h
@@ -21,27 +21,27 @@
//**************************************************************************
#define MCFG_BML3BUS_CPU(_cputag) \
- bml3bus_device::static_set_cputag(*device, "^" _cputag);
+ downcast<bml3bus_device &>(*device).set_cputag("^" _cputag);
#define MCFG_BML3BUS_OUT_NMI_CB(_devcb) \
- devcb = &bml3bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<bml3bus_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_BML3BUS_OUT_IRQ_CB(_devcb) \
- devcb = &bml3bus_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<bml3bus_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_BML3BUS_OUT_FIRQ_CB(_devcb) \
- devcb = &bml3bus_device::set_out_firq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<bml3bus_device &>(*device).set_out_firq_callback(DEVCB_##_devcb);
#define MCFG_BML3BUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, BML3BUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- bml3bus_slot_device::static_set_bml3bus_slot(*device, _nbtag, _tag);
+ downcast<bml3bus_slot_device &>(*device).set_bml3bus_slot(_nbtag, _tag);
#define MCFG_BML3BUS_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_BML3BUS_ONBOARD_ADD(_nbtag, _tag, _dev_type) \
MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
- device_bml3bus_card_interface::static_set_bml3bus_tag(*device, _nbtag, _tag);
+ downcast<device_bml3bus_card_interface &>(*device).set_bml3bus_tag(_nbtag, _tag);
//**************************************************************************
@@ -61,7 +61,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_bml3bus_slot(device_t &device, const char *tag, const char *slottag);
+ void set_bml3bus_slot(const char *tag, const char *slottag) { m_bml3bus_tag = tag; m_bml3bus_slottag = slottag; }
protected:
bml3bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -83,10 +83,10 @@ public:
bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<bml3bus_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<bml3bus_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_firq_callback(device_t &device, Object &&cb) { return downcast<bml3bus_device &>(device).m_out_firq_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_maincpu.set_tag(tag); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_firq_callback(Object &&cb) { return m_out_firq_cb.set_callback(std::forward<Object>(cb)); }
void add_bml3bus_card(int slot, device_bml3bus_card_interface *card);
device_bml3bus_card_interface *get_bml3bus_card(int slot);
@@ -145,7 +145,7 @@ public:
void lower_slot_firq() { m_bml3bus->set_firq_line(CLEAR_LINE); }
// inline configuration
- static void static_set_bml3bus_tag(device_t &device, const char *tag, const char *slottag);
+ void set_bml3bus_tag(const char *tag, const char *slottag) { m_bml3bus_tag = tag; m_bml3bus_slottag = slottag; }
protected:
device_bml3bus_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h
index 655c619c139..46c4101aabf 100644
--- a/src/devices/bus/c64/exp.h
+++ b/src/devices/bus/c64/exp.h
@@ -68,22 +68,22 @@
#define MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &c64_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(_write) \
- devcb = &c64_expansion_slot_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(_write) \
- devcb = &c64_expansion_slot_device::set_reset_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_reset_wr_callback(DEVCB_##_write);
#define MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(_read) \
- devcb = &c64_expansion_slot_device::set_cd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_cd_rd_callback(DEVCB_##_read);
#define MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(_write) \
- devcb = &c64_expansion_slot_device::set_cd_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_cd_wr_callback(DEVCB_##_write);
#define MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(_write) \
- devcb = &c64_expansion_slot_device::set_dma_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c64_expansion_slot_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
@@ -103,12 +103,12 @@ public:
// construction/destruction
c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_write_nmi.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_reset_wr_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_write_reset.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cd_rd_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_read_dma_cd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cd_wr_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_write_dma_cd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_wr_callback(device_t &device, Object &&cb) { return downcast<c64_expansion_slot_device &>(device).m_write_dma.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_wr_callback(Object &&cb) { return m_write_reset.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cd_rd_callback(Object &&cb) { return m_read_dma_cd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cd_wr_callback(Object &&cb) { return m_write_dma_cd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_wr_callback(Object &&cb) { return m_write_dma.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2);
diff --git a/src/devices/bus/cbm2/user.h b/src/devices/bus/cbm2/user.h
index 9c764d7315b..3802879e822 100644
--- a/src/devices/bus/cbm2/user.h
+++ b/src/devices/bus/cbm2/user.h
@@ -48,16 +48,16 @@
#define MCFG_CBM2_USER_PORT_IRQ_CALLBACK(_write) \
- devcb = &cbm2_user_port_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cbm2_user_port_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_CBM2_USER_PORT_SP_CALLBACK(_write) \
- devcb = &cbm2_user_port_device::set_sp_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cbm2_user_port_device &>(*device).set_sp_wr_callback(DEVCB_##_write);
#define MCFG_CBM2_USER_PORT_CNT_CALLBACK(_write) \
- devcb = &cbm2_user_port_device::set_cnt_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cbm2_user_port_device &>(*device).set_cnt_wr_callback(DEVCB_##_write);
#define MCFG_CBM2_USER_PORT_FLAG_CALLBACK(_write) \
- devcb = &cbm2_user_port_device::set_flag_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cbm2_user_port_device &>(*device).set_flag_wr_callback(DEVCB_##_write);
@@ -105,10 +105,10 @@ public:
// construction/destruction
cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<cbm2_user_port_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sp_wr_callback(device_t &device, Object &&cb) { return downcast<cbm2_user_port_device &>(device).m_write_sp.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cnt_wr_callback(device_t &device, Object &&cb) { return downcast<cbm2_user_port_device &>(device).m_write_cnt.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_flag_wr_callback(device_t &device, Object &&cb) { return downcast<cbm2_user_port_device &>(device).m_write_flag.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sp_wr_callback(Object &&cb) { return m_write_sp.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cnt_wr_callback(Object &&cb) { return m_write_cnt.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_flag_wr_callback(Object &&cb) { return m_write_flag.set_callback(std::forward<Object>(cb)); }
// computer interface
DECLARE_READ8_MEMBER( d1_r ) { uint8_t data = 0xff; if (m_card != nullptr) data = m_card->cbm2_d1_r(space, offset); return data; }
diff --git a/src/devices/bus/centronics/ctronics.h b/src/devices/bus/centronics/ctronics.h
index 62c1cf5a94e..5d8a24d5793 100644
--- a/src/devices/bus/centronics/ctronics.h
+++ b/src/devices/bus/centronics/ctronics.h
@@ -19,55 +19,55 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_CENTRONICS_STROBE_HANDLER(_devcb) \
- devcb = &centronics_device::set_strobe_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_strobe_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA0_HANDLER(_devcb) \
- devcb = &centronics_device::set_data0_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data0_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA1_HANDLER(_devcb) \
- devcb = &centronics_device::set_data1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data1_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA2_HANDLER(_devcb) \
- devcb = &centronics_device::set_data2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data2_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA3_HANDLER(_devcb) \
- devcb = &centronics_device::set_data3_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data3_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA4_HANDLER(_devcb) \
- devcb = &centronics_device::set_data4_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data4_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA5_HANDLER(_devcb) \
- devcb = &centronics_device::set_data5_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data5_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA6_HANDLER(_devcb) \
- devcb = &centronics_device::set_data6_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data6_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_DATA7_HANDLER(_devcb) \
- devcb = &centronics_device::set_data7_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_data7_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_ACK_HANDLER(_devcb) \
- devcb = &centronics_device::set_ack_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_ack_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_BUSY_HANDLER(_devcb) \
- devcb = &centronics_device::set_busy_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_busy_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_PERROR_HANDLER(_devcb) \
- devcb = &centronics_device::set_perror_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_perror_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_SELECT_HANDLER(_devcb) \
- devcb = &centronics_device::set_select_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_select_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_AUTOFD_HANDLER(_devcb) \
- devcb = &centronics_device::set_autofd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_autofd_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_FAULT_HANDLER(_devcb) \
- devcb = &centronics_device::set_fault_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_fault_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_INIT_HANDLER(_devcb) \
- devcb = &centronics_device::set_init_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_init_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_SELECT_IN_HANDLER(_devcb) \
- devcb = &centronics_device::set_select_in_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<centronics_device &>(*device).set_select_in_handler(DEVCB_##_devcb);
#define MCFG_CENTRONICS_OUTPUT_LATCH_ADD(_tag, _centronics_tag) \
MCFG_DEVICE_ADD(_tag, OUTPUT_LATCH, 0) \
@@ -102,23 +102,23 @@ class centronics_device : public device_t,
public:
centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_strobe_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_strobe_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data0_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data0_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data1_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data2_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data3_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data3_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data4_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data4_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data5_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data5_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data6_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data6_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data7_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_data7_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ack_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_ack_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_busy_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_busy_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_perror_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_perror_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_select_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_select_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_autofd_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_autofd_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_fault_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_fault_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_init_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_init_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_select_in_handler(device_t &device, Object &&cb) { return downcast<centronics_device &>(device).m_select_in_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_strobe_handler(Object &&cb) { return m_strobe_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data0_handler(Object &&cb) { return m_data0_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data1_handler(Object &&cb) { return m_data1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data2_handler(Object &&cb) { return m_data2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data3_handler(Object &&cb) { return m_data3_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data4_handler(Object &&cb) { return m_data4_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data5_handler(Object &&cb) { return m_data5_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data6_handler(Object &&cb) { return m_data6_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data7_handler(Object &&cb) { return m_data7_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ack_handler(Object &&cb) { return m_ack_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_busy_handler(Object &&cb) { return m_busy_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_perror_handler(Object &&cb) { return m_perror_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_select_handler(Object &&cb) { return m_select_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_autofd_handler(Object &&cb) { return m_autofd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_fault_handler(Object &&cb) { return m_fault_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_init_handler(Object &&cb) { return m_init_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_select_in_handler(Object &&cb) { return m_select_in_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_strobe );
DECLARE_WRITE_LINE_MEMBER( write_data0 );
diff --git a/src/devices/bus/cgenie/expansion/expansion.h b/src/devices/bus/cgenie/expansion/expansion.h
index 6c752efb331..cc7a6b04828 100644
--- a/src/devices/bus/cgenie/expansion/expansion.h
+++ b/src/devices/bus/cgenie/expansion/expansion.h
@@ -50,13 +50,13 @@
MCFG_DEVICE_SLOT_INTERFACE(cg_exp_slot_carts, nullptr, false)
#define MCFG_CG_EXP_SLOT_INT_HANDLER(_devcb) \
- devcb = &cg_exp_slot_device::set_int_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<cg_exp_slot_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_CG_EXP_SLOT_NMI_HANDLER(_devcb) \
- devcb = &cg_exp_slot_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<cg_exp_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
#define MCFG_CG_EXP_SLOT_RESET_HANDLER(_devcb) \
- devcb = &cg_exp_slot_device::set_reset_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<cg_exp_slot_device &>(*device).set_reset_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -76,14 +76,9 @@ public:
void set_io_space(address_space *io);
// callbacks
- template <class Object> static devcb_base &set_int_handler(device_t &device, Object &&cb)
- { return downcast<cg_exp_slot_device &>(device).m_int_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<cg_exp_slot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_reset_handler(device_t &device, Object &&cb)
- { return downcast<cg_exp_slot_device &>(device).m_reset_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h
index 395ea2471dd..440630e05a3 100644
--- a/src/devices/bus/coco/cococart.h
+++ b/src/devices/bus/coco/cococart.h
@@ -26,13 +26,13 @@
typedef delegate<void (uint8_t *)> cococart_base_update_delegate;
#define MCFG_COCO_CARTRIDGE_CART_CB(_devcb) \
- devcb = &cococart_slot_device::static_set_cart_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cococart_slot_device &>(*device).set_cart_callback(DEVCB_##_devcb);
#define MCFG_COCO_CARTRIDGE_NMI_CB(_devcb) \
- devcb = &cococart_slot_device::static_set_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cococart_slot_device &>(*device).set_nmi_callback(DEVCB_##_devcb);
#define MCFG_COCO_CARTRIDGE_HALT_CB(_devcb) \
- devcb = &cococart_slot_device::static_set_halt_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cococart_slot_device &>(*device).set_halt_callback(DEVCB_##_devcb);
// ======================> cococart_slot_device
@@ -63,9 +63,9 @@ public:
// construction/destruction
cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_cart_callback(device_t &device, Object &&cb) { return downcast<cococart_slot_device &>(device).m_cart_callback.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_nmi_callback(device_t &device, Object &&cb) { return downcast<cococart_slot_device &>(device).m_nmi_callback.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_halt_callback(device_t &device, Object &&cb) { return downcast<cococart_slot_device &>(device).m_halt_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cart_callback(Object &&cb) { return m_cart_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_callback(Object &&cb) { return m_nmi_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_halt_callback(Object &&cb) { return m_halt_callback.set_callback(std::forward<Object>(cb)); }
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/bus/coleco/ctrl.h b/src/devices/bus/coleco/ctrl.h
index df39b41944c..75d1610e698 100644
--- a/src/devices/bus/coleco/ctrl.h
+++ b/src/devices/bus/coleco/ctrl.h
@@ -27,7 +27,7 @@
#define MCFG_COLECOVISION_CONTROL_PORT_IRQ_CALLBACK(_write) \
- devcb = &colecovision_control_port_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<colecovision_control_port_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
@@ -68,7 +68,7 @@ public:
colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<colecovision_control_port_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t read() { uint8_t data = 0xff; if (exists()) data = m_device->joy_r(); return data; }
diff --git a/src/devices/bus/comx35/exp.h b/src/devices/bus/comx35/exp.h
index c52b7eee849..fb5831e31fe 100644
--- a/src/devices/bus/comx35/exp.h
+++ b/src/devices/bus/comx35/exp.h
@@ -57,7 +57,7 @@
#define MCFG_COMX_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &comx_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<comx_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
@@ -76,7 +76,7 @@ public:
// construction/destruction
comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<comx_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
uint8_t mrd_r(address_space &space, offs_t offset, int *extrom);
void mwr_w(address_space &space, offs_t offset, uint8_t data);
diff --git a/src/devices/bus/cpc/cpcexp.h b/src/devices/bus/cpc/cpcexp.h
index 0f99ea051aa..0633ffd4c6b 100644
--- a/src/devices/bus/cpc/cpcexp.h
+++ b/src/devices/bus/cpc/cpcexp.h
@@ -60,19 +60,19 @@
//**************************************************************************
#define MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(_devcb) \
- devcb = &cpc_expansion_slot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cpc_expansion_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(_devcb) \
- devcb = &cpc_expansion_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cpc_expansion_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_CPC_EXPANSION_SLOT_OUT_RESET_CB(_devcb) \
- devcb = &cpc_expansion_slot_device::set_out_reset_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cpc_expansion_slot_device &>(*device).set_out_reset_callback(DEVCB_##_devcb);
#define MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(_devcb) \
- devcb = &cpc_expansion_slot_device::set_out_romdis_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cpc_expansion_slot_device &>(*device).set_out_romdis_callback(DEVCB_##_devcb);
#define MCFG_CPC_EXPANSION_SLOT_ROM_SELECT(_devcb) \
- devcb = &cpc_expansion_slot_device::set_out_rom_select_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cpc_expansion_slot_device &>(*device).set_out_rom_select_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -121,11 +121,11 @@ public:
cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~cpc_expansion_slot_device();
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<cpc_expansion_slot_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<cpc_expansion_slot_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_reset_callback(device_t &device, Object &&cb) { return downcast<cpc_expansion_slot_device &>(device).m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_romdis_callback(device_t &device, Object &&cb) { return downcast<cpc_expansion_slot_device &>(device).m_out_romdis_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rom_select_callback(device_t &device, Object &&cb) { return downcast<cpc_expansion_slot_device &>(device).m_out_rom_select.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_reset_callback(Object &&cb) { return m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_romdis_callback(Object &&cb) { return m_out_romdis_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rom_select_callback(Object &&cb) { return m_out_rom_select.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
diff --git a/src/devices/bus/dmv/dmvbus.h b/src/devices/bus/dmv/dmvbus.h
index 62a1d7254b9..2c683ef7a31 100644
--- a/src/devices/bus/dmv/dmvbus.h
+++ b/src/devices/bus/dmv/dmvbus.h
@@ -62,11 +62,11 @@ public:
dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~dmvcart_slot_device();
- template <class Object> static devcb_base &set_prog_read_callback(device_t &device, Object &&cb) { return downcast<dmvcart_slot_device &>(device).m_prog_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_prog_write_callback(device_t &device, Object &&cb) { return downcast<dmvcart_slot_device &>(device).m_prog_write_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_int_callback(device_t &device, Object &&cb) { return downcast<dmvcart_slot_device &>(device).m_out_int_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<dmvcart_slot_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_thold_callback(device_t &device, Object &&cb) { return downcast<dmvcart_slot_device &>(device).m_out_thold_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_prog_read_callback(Object &&cb) { return m_prog_read_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_prog_write_callback(Object &&cb) { return m_prog_write_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_thold_callback(Object &&cb) { return m_out_thold_cb.set_callback(std::forward<Object>(cb)); }
// device-level overrides
virtual void device_start() override;
@@ -111,16 +111,16 @@ DECLARE_DEVICE_TYPE(DMVCART_SLOT, dmvcart_slot_device)
***************************************************************************/
#define MCFG_DMVCART_SLOT_PROGRAM_READWRITE_CB(_read_devcb, _write_devcb) \
- devcb = &dmvcart_slot_device::set_prog_read_callback(*device, DEVCB_##_read_devcb); \
- devcb = &dmvcart_slot_device::set_prog_write_callback(*device, DEVCB_##_write_devcb);
+ devcb = &downcast<dmvcart_slot_device &>(*device).set_prog_read_callback(DEVCB_##_read_devcb); \
+ devcb = &downcast<dmvcart_slot_device &>(*device).set_prog_write_callback(DEVCB_##_write_devcb);
#define MCFG_DMVCART_SLOT_OUT_INT_CB(_devcb) \
- devcb = &dmvcart_slot_device::set_out_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dmvcart_slot_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
#define MCFG_DMVCART_SLOT_OUT_IRQ_CB(_devcb) \
- devcb = &dmvcart_slot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dmvcart_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_DMVCART_SLOT_OUT_THOLD_CB(_devcb) \
- devcb = &dmvcart_slot_device::set_out_thold_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dmvcart_slot_device &>(*device).set_out_thold_callback(DEVCB_##_devcb);
#endif // MAME_BUS_DMV_DMVBUS_H
diff --git a/src/devices/bus/ecbbus/ecbbus.cpp b/src/devices/bus/ecbbus/ecbbus.cpp
index 7649dea491a..625f2e46086 100644
--- a/src/devices/bus/ecbbus/ecbbus.cpp
+++ b/src/devices/bus/ecbbus/ecbbus.cpp
@@ -36,18 +36,6 @@ ecbbus_slot_device::ecbbus_slot_device(const machine_config &mconfig, const char
//-------------------------------------------------
-// static_set_ecbbus_slot -
-//-------------------------------------------------
-
-void ecbbus_slot_device::static_set_ecbbus_slot(device_t &device, const char *tag, int num)
-{
- ecbbus_slot_device &ecbbus_card = dynamic_cast<ecbbus_slot_device &>(device);
- ecbbus_card.m_bus_tag = tag;
- ecbbus_card.m_bus_num = num;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/ecbbus/ecbbus.h b/src/devices/bus/ecbbus/ecbbus.h
index 9a4943e0a19..442486c052c 100644
--- a/src/devices/bus/ecbbus/ecbbus.h
+++ b/src/devices/bus/ecbbus/ecbbus.h
@@ -66,14 +66,14 @@
#define MCFG_ECBBUS_SLOT_ADD(_num, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, ECBBUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- ecbbus_slot_device::static_set_ecbbus_slot(*device, ECBBUS_TAG, _num);
+ downcast<ecbbus_slot_device &>(*device).set_ecbbus_slot(ECBBUS_TAG, _num);
#define MCFG_ECBBUS_IRQ_CALLBACK(_write) \
- devcb = &ecbbus_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ecbbus_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_ECBBUS_NMI_CALLBACK(_write) \
- devcb = &ecbbus_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ecbbus_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
@@ -96,7 +96,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_ecbbus_slot(device_t &device, const char *tag, int num);
+ void set_ecbbus_slot(const char *tag, int num) { m_bus_tag = tag; m_bus_num = num; }
private:
// configuration
@@ -123,8 +123,8 @@ public:
// construction/destruction
ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<ecbbus_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<ecbbus_device &>(device).m_write_nmi.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
void add_card(device_ecbbus_card_interface *card, int pos);
diff --git a/src/devices/bus/econet/econet.cpp b/src/devices/bus/econet/econet.cpp
index e4acfe3c3d6..2b9b961af88 100644
--- a/src/devices/bus/econet/econet.cpp
+++ b/src/devices/bus/econet/econet.cpp
@@ -63,17 +63,6 @@ econet_slot_device::econet_slot_device(const machine_config &mconfig, const char
//-------------------------------------------------
-// static_set_slot -
-//-------------------------------------------------
-
-void econet_slot_device::static_set_slot(device_t &device, int address)
-{
- econet_slot_device &econet_card = dynamic_cast<econet_slot_device &>(device);
- econet_card.m_address = address;
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/econet/econet.h b/src/devices/bus/econet/econet.h
index e02a5b74e4a..9bed6727da0 100644
--- a/src/devices/bus/econet/econet.h
+++ b/src/devices/bus/econet/econet.h
@@ -32,14 +32,14 @@
#define MCFG_ECONET_SLOT_ADD(_tag, _num, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, ECONET_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- econet_slot_device::static_set_slot(*device, _num);
+ downcast<econet_slot_device &>(*device).set_slot(_num);
#define MCFG_ECONET_CLK_CALLBACK(_write) \
- devcb = &econet_device::set_clk_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<econet_device &>(*device).set_clk_wr_callback(DEVCB_##_write);
#define MCFG_ECONET_DATA_CALLBACK(_write) \
- devcb = &econet_device::set_data_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<econet_device &>(*device).set_data_wr_callback(DEVCB_##_write);
@@ -57,8 +57,8 @@ public:
// construction/destruction
econet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_clk_wr_callback(device_t &device, Object &&cb) { return downcast<econet_device &>(device).m_write_clk.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data_wr_callback(device_t &device, Object &&cb) { return downcast<econet_device &>(device).m_write_data.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_clk_wr_callback(Object &&cb) { return m_write_clk.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward<Object>(cb)); }
void add_device(device_t *target, int address);
@@ -121,7 +121,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_slot(device_t &device, int address);
+ void set_slot(int address) { m_address = address; }
private:
// configuration
diff --git a/src/devices/bus/einstein/pipe/pipe.h b/src/devices/bus/einstein/pipe/pipe.h
index 02be494cb2e..222ebe18e0c 100644
--- a/src/devices/bus/einstein/pipe/pipe.h
+++ b/src/devices/bus/einstein/pipe/pipe.h
@@ -54,13 +54,13 @@
MCFG_DEVICE_SLOT_INTERFACE(tatung_pipe_cards, nullptr, false)
#define MCFG_TATUNG_PIPE_INT_HANDLER(_devcb) \
- devcb = &tatung_pipe_device::set_int_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<tatung_pipe_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_TATUNG_PIPE_NMI_HANDLER(_devcb) \
- devcb = &tatung_pipe_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<tatung_pipe_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
#define MCFG_TATUNG_PIPE_RESET_HANDLER(_devcb) \
- devcb = &tatung_pipe_device::set_reset_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<tatung_pipe_device &>(*device).set_reset_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -81,14 +81,9 @@ public:
void set_io_space(address_space *io);
// callbacks
- template <class Object> static devcb_base &set_int_handler(device_t &device, Object &&cb)
- { return downcast<tatung_pipe_device &>(device).m_int_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<tatung_pipe_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_reset_handler(device_t &device, Object &&cb)
- { return downcast<tatung_pipe_device &>(device).m_reset_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); }
// called from host
DECLARE_WRITE_LINE_MEMBER( host_int_w );
diff --git a/src/devices/bus/einstein/userport/userport.h b/src/devices/bus/einstein/userport/userport.h
index 59301644aa3..ea00d229b08 100644
--- a/src/devices/bus/einstein/userport/userport.h
+++ b/src/devices/bus/einstein/userport/userport.h
@@ -32,7 +32,7 @@
MCFG_DEVICE_SLOT_INTERFACE(einstein_userport_cards, nullptr, false)
#define MCFG_EINSTEIN_USERPORT_BSTB_HANDLER(_devcb) \
- devcb = &einstein_userport_device::set_bstb_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<einstein_userport_device &>(*device).set_bstb_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -49,8 +49,7 @@ public:
virtual ~einstein_userport_device();
// callbacks
- template <class Object> static devcb_base &set_bstb_handler(device_t &device, Object &&cb)
- { return downcast<einstein_userport_device &>(device).m_bstb_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_bstb_handler(Object &&cb) { return m_bstb_handler.set_callback(std::forward<Object>(cb)); }
// called from card device
DECLARE_WRITE_LINE_MEMBER( bstb_w ) { m_bstb_handler(state); }
diff --git a/src/devices/bus/electron/cart/slot.h b/src/devices/bus/electron/cart/slot.h
index 06d573ccbd1..533c4bb4555 100644
--- a/src/devices/bus/electron/cart/slot.h
+++ b/src/devices/bus/electron/cart/slot.h
@@ -110,10 +110,10 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_ELECTRON_CARTSLOT_IRQ_HANDLER(_devcb) \
- devcb = &electron_cartslot_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<electron_cartslot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_ELECTRON_CARTSLOT_NMI_HANDLER(_devcb) \
- devcb = &electron_cartslot_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<electron_cartslot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -134,11 +134,8 @@ public:
virtual ~electron_cartslot_device();
// callbacks
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
- { return downcast<electron_cartslot_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<electron_cartslot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/bus/electron/exp.h b/src/devices/bus/electron/exp.h
index f03ced0bd16..db6d7c46248 100644
--- a/src/devices/bus/electron/exp.h
+++ b/src/devices/bus/electron/exp.h
@@ -111,10 +111,10 @@ AC RETURNS (pins 3,4) - adaptor. A total of 6W may be drawn from these lines as
MCFG_ELECTRON_EXPANSION_SLOT_NMI_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, electron_expansion_slot_device, nmi_w))
#define MCFG_ELECTRON_EXPANSION_SLOT_IRQ_HANDLER(_devcb) \
- devcb = &electron_expansion_slot_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<electron_expansion_slot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_ELECTRON_EXPANSION_SLOT_NMI_HANDLER(_devcb) \
- devcb = &electron_expansion_slot_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<electron_expansion_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -133,11 +133,8 @@ public:
virtual ~electron_expansion_slot_device();
// callbacks
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
- { return downcast<electron_expansion_slot_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<electron_expansion_slot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
uint8_t expbus_r(address_space &space, offs_t offset, uint8_t data);
void expbus_w(address_space &space, offs_t offset, uint8_t data);
diff --git a/src/devices/bus/ep64/exp.h b/src/devices/bus/ep64/exp.h
index 5655e6c0e64..f870455996c 100644
--- a/src/devices/bus/ep64/exp.h
+++ b/src/devices/bus/ep64/exp.h
@@ -68,16 +68,16 @@
MCFG_DEVICE_SLOT_INTERFACE(ep64_expansion_bus_cards, _def_slot, false)
#define MCFG_EP64_EXPANSION_BUS_SLOT_DAVE(_tag) \
- ep64_expansion_bus_slot_device::static_set_dave_tag(*device, "^" _tag);
+ downcast<ep64_expansion_bus_slot_device &>(*device).set_dave_tag("^" _tag);
#define MCFG_EP64_EXPANSION_BUS_SLOT_IRQ_CALLBACK(_write) \
- devcb = &ep64_expansion_bus_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ep64_expansion_bus_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_EP64_EXPANSION_BUS_SLOT_NMI_CALLBACK(_write) \
- devcb = &ep64_expansion_bus_slot_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ep64_expansion_bus_slot_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_EP64_EXPANSION_BUS_SLOT_WAIT_CALLBACK(_write) \
- devcb = &ep64_expansion_bus_slot_device::set_wait_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ep64_expansion_bus_slot_device &>(*device).set_wait_wr_callback(DEVCB_##_write);
@@ -98,10 +98,10 @@ public:
// construction/destruction
ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_dave_tag(device_t &device, const char* tag) { downcast<ep64_expansion_bus_slot_device &>(device).m_dave.set_tag(tag); }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<ep64_expansion_bus_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<ep64_expansion_bus_slot_device &>(device).m_write_nmi.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_wait_wr_callback(device_t &device, Object &&cb) { return downcast<ep64_expansion_bus_slot_device &>(device).m_write_wait.set_callback(std::forward<Object>(cb)); }
+ void set_dave_tag(const char* tag) { m_dave.set_tag(tag); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wait_wr_callback(Object &&cb) { return m_write_wait.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_write_irq(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_write_nmi(state); }
diff --git a/src/devices/bus/gamegear/ggext.h b/src/devices/bus/gamegear/ggext.h
index 64ac953b3f4..d89323000b6 100644
--- a/src/devices/bus/gamegear/ggext.h
+++ b/src/devices/bus/gamegear/ggext.h
@@ -30,11 +30,11 @@
#define MCFG_GG_EXT_PORT_TH_INPUT_HANDLER(_devcb) \
- devcb = &gg_ext_port_device::set_th_input_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gg_ext_port_device &>(*device).set_th_input_handler(DEVCB_##_devcb);
#define MCFG_GG_EXT_PORT_PIXEL_HANDLER(_devcb) \
- devcb = &gg_ext_port_device::set_pixel_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gg_ext_port_device &>(*device).set_pixel_handler(DEVCB_##_devcb);
@@ -55,9 +55,9 @@ public:
virtual ~gg_ext_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_th_input_handler(device_t &device, Object &&cb) { return downcast<gg_ext_port_device &>(device).m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_th_input_handler(Object &&cb) { return m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_pixel_handler(device_t &device, Object &&cb) { return downcast<gg_ext_port_device &>(device).m_pixel_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pixel_handler(Object &&cb) { return m_pixel_handler.set_callback(std::forward<Object>(cb)); }
// Currently, only the support for SMS Controller Adaptor is emulated,
// for when SMS Compatibility mode is enabled. In that mode, the 10 pins
diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h
index fada3158273..154be4db5ae 100644
--- a/src/devices/bus/generic/slot.h
+++ b/src/devices/bus/generic/slot.h
@@ -86,10 +86,10 @@ enum
static_cast<generic_slot_device *>(device)->set_extensions(_ext);
#define MCFG_GENERIC_LOAD(_class, _method) \
- generic_slot_device::static_set_device_load(*device, device_image_load_delegate(&DEVICE_IMAGE_LOAD_NAME(_class,_method), this));
+ downcast<generic_slot_device &>(*device).set_device_load(device_image_load_delegate(&DEVICE_IMAGE_LOAD_NAME(_class,_method), this));
#define MCFG_GENERIC_UNLOAD(_class, _method) \
- generic_slot_device::static_set_device_unload(*device, device_image_func_delegate(&DEVICE_IMAGE_UNLOAD_NAME(_class,_method), this));
+ downcast<generic_slot_device &>(*device).set_device_unload(device_image_func_delegate(&DEVICE_IMAGE_UNLOAD_NAME(_class,_method), this));
@@ -104,8 +104,8 @@ public:
generic_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual ~generic_slot_device();
- static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_load = callback; }
- static void static_set_device_unload(device_t &device, device_image_func_delegate callback) { downcast<generic_slot_device &>(device).m_device_image_unload = callback; }
+ template <typename Object> void set_device_load(Object &&cb) { m_device_image_load = std::forward<Object>(cb); }
+ template <typename Object> void set_device_unload(Object &&cb) { m_device_image_unload = std::forward<Object>(cb); }
void set_interface(const char * interface) { m_interface = interface; }
void set_default_card(const char * def) { m_default_card = def; }
diff --git a/src/devices/bus/hp80_io/hp80_io.h b/src/devices/bus/hp80_io/hp80_io.h
index 64430f8b6b4..96cc40f562e 100644
--- a/src/devices/bus/hp80_io/hp80_io.h
+++ b/src/devices/bus/hp80_io/hp80_io.h
@@ -16,13 +16,13 @@
#define MCFG_HP80_IO_SLOT_ADD(_tag , _idx) \
MCFG_DEVICE_ADD(_tag, HP80_IO_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(hp80_io_slot_devices, nullptr, false) \
- hp80_io_slot_device::set_slot_no(*device , _idx);
+ downcast<hp80_io_slot_device &>(*device).set_slot_no(_idx);
#define MCFG_HP80_IO_IRL_CB(_devcb) \
- devcb = &hp80_io_slot_device::set_irl_cb_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp80_io_slot_device &>(*device).set_irl_cb_func(DEVCB_##_devcb);
#define MCFG_HP80_IO_HALT_CB(_devcb) \
- devcb = &hp80_io_slot_device::set_halt_cb_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp80_io_slot_device &>(*device).set_halt_cb_func(DEVCB_##_devcb);
#define HP80_IO_FIRST_SC 3 // Lowest SC used by I/O cards
@@ -46,15 +46,15 @@ public:
hp80_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~hp80_io_slot_device();
- // static configuration helpers
- static void set_slot_no(device_t &device, unsigned slot_no) { downcast<hp80_io_slot_device &>(device).m_slot_no = slot_no; }
+ // configuration helpers
+ void set_slot_no(unsigned slot_no) { m_slot_no = slot_no; }
// device-level overrides
virtual void device_start() override;
// Callback setups
- template <class Object> static devcb_base &set_irl_cb_func(device_t &device, Object &&cb) { return downcast<hp80_io_slot_device &>(device).m_irl_cb_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_halt_cb_func(device_t &device, Object &&cb) { return downcast<hp80_io_slot_device &>(device).m_halt_cb_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irl_cb_func(Object &&cb) { return m_irl_cb_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_halt_cb_func(Object &&cb) { return m_halt_cb_func.set_callback(std::forward<Object>(cb)); }
// SC getter
uint8_t get_sc() const;
diff --git a/src/devices/bus/hp9845_io/hp9845_io.h b/src/devices/bus/hp9845_io/hp9845_io.h
index 2c960a405de..d2ee55b6d39 100644
--- a/src/devices/bus/hp9845_io/hp9845_io.h
+++ b/src/devices/bus/hp9845_io/hp9845_io.h
@@ -19,13 +19,13 @@
MCFG_DEVICE_SLOT_INTERFACE(hp9845_io_slot_devices, nullptr, false)
#define MCFG_HP9845_IO_IRQ_CB(_devcb) \
- devcb = &hp9845_io_slot_device::set_irq_cb_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp9845_io_slot_device &>(*device).set_irq_cb_func(DEVCB_##_devcb);
#define MCFG_HP9845_IO_STS_CB(_devcb) \
- devcb = &hp9845_io_slot_device::set_sts_cb_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp9845_io_slot_device &>(*device).set_sts_cb_func(DEVCB_##_devcb);
#define MCFG_HP9845_IO_FLG_CB(_devcb) \
- devcb = &hp9845_io_slot_device::set_flg_cb_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp9845_io_slot_device &>(*device).set_flg_cb_func(DEVCB_##_devcb);
#define HP9845_IO_FIRST_SC 1 // Lowest SC used by I/O cards
@@ -57,9 +57,9 @@ public:
virtual void device_start() override;
// Callback setups
- template <class Object> static devcb_base &set_irq_cb_func(device_t &device, Object &&cb) { return downcast<hp9845_io_slot_device &>(device).m_irq_cb_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sts_cb_func(device_t &device, Object &&cb) { return downcast<hp9845_io_slot_device &>(device).m_sts_cb_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_flg_cb_func(device_t &device, Object &&cb) { return downcast<hp9845_io_slot_device &>(device).m_flg_cb_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_cb_func(Object &&cb) { return m_irq_cb_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sts_cb_func(Object &&cb) { return m_sts_cb_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_flg_cb_func(Object &&cb) { return m_flg_cb_func.set_callback(std::forward<Object>(cb)); }
// irq/sts/flg signal handlers
void irq_w(uint8_t sc , int state);
diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp
index 6948beed7e9..76e7f58b545 100644
--- a/src/devices/bus/hp_dio/hp_dio.cpp
+++ b/src/devices/bus/hp_dio/hp_dio.cpp
@@ -34,13 +34,6 @@ dio16_slot_device::dio16_slot_device(const machine_config &mconfig, device_type
{
}
-void dio16_slot_device::static_set_dio16_slot(device_t &device, device_t *owner, const char *dio_tag)
-{
- dio16_slot_device &dio_card = dynamic_cast<dio16_slot_device &>(device);
- dio_card.m_owner = owner;
- dio_card.m_dio_tag = dio_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -55,7 +48,7 @@ void dio16_slot_device::device_start()
fatalerror("DIO32 device in DIO16 slot\n");
}
- if (dev) device_dio16_card_interface::static_set_diobus(*dev,m_owner->subdevice(m_dio_tag));
+ if (dev) dev->set_diobus(m_owner->subdevice(m_dio_tag));
}
@@ -78,13 +71,6 @@ dio32_slot_device::dio32_slot_device(const machine_config &mconfig, const char *
{
}
-void dio32_slot_device::static_set_dio32_slot(device_t &device, device_t *owner, const char *dio_tag)
-{
- dio32_slot_device &dio_card = dynamic_cast<dio32_slot_device &>(device);
- dio_card.m_owner = owner;
- dio_card.m_dio_tag = dio_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -92,7 +78,7 @@ void dio32_slot_device::static_set_dio32_slot(device_t &device, device_t *owner,
void dio32_slot_device::device_start()
{
device_dio16_card_interface *dev = dynamic_cast<device_dio16_card_interface *>(get_card_device());
- if (dev) device_dio16_card_interface::static_set_diobus(*dev,m_owner->subdevice(m_dio_tag));
+ if (dev) dev->set_diobus(m_owner->subdevice(m_dio_tag));
}
@@ -102,12 +88,6 @@ void dio32_slot_device::device_start()
DEFINE_DEVICE_TYPE(DIO16, dio16_device, "dio16", "16-bit DIO bus")
-void dio16_device::static_set_cputag(device_t &device, const char *tag)
-{
- dio16_device &dio = downcast<dio16_device &>(device);
- dio.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -230,12 +210,6 @@ device_dio16_card_interface::~device_dio16_card_interface()
{
}
-void device_dio16_card_interface::static_set_diobus(device_t &device, device_t *dio_device)
-{
- device_dio16_card_interface &dio_card = dynamic_cast<device_dio16_card_interface &>(device);
- dio_card.m_dio_dev = dio_device;
-}
-
void device_dio16_card_interface::set_dio_device()
{
m_dio = dynamic_cast<dio16_device *>(m_dio_dev);
diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h
index 5e048b7360d..dd8efada7ba 100644
--- a/src/devices/bus/hp_dio/hp_dio.h
+++ b/src/devices/bus/hp_dio/hp_dio.h
@@ -22,29 +22,29 @@
//**************************************************************************
#define MCFG_DIO16_CPU(_cputag) \
- dio16_device::static_set_cputag(*device, _cputag);
+ downcast<dio16_device &>(*device).set_cputag(_cputag);
#define MCFG_DIO16_SLOT_ADD(_diotag, _tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, DIO16_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed) \
- dio16_slot_device::static_set_dio16_slot(*device, this, _diotag);
+ downcast<dio16_slot_device &>(*device).set_dio16_slot(this, _diotag);
#define MCFG_DIO32_CPU(_cputag) \
- dio32_device::static_set_cputag(*device, _cputag);
+ downcast<dio32_device &>(*device).set_cputag(_cputag);
#define MCFG_DIO32_SLOT_ADD(_diotag, _tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, DIO32_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed) \
- dio32_slot_device::static_set_dio32_slot(*device, this, _diotag);
+ downcast<dio32_slot_device &>(*device).set_dio32_slot(this, _diotag);
#define MCFG_ISA_OUT_IRQ3_CB(_devcb) \
- devcb = &dio16_device::set_out_irq3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dio16_device &>(*device).set_out_irq3_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ4_CB(_devcb) \
- devcb = &dio16_device::set_out_irq4_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dio16_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ5_CB(_devcb) \
- devcb = &dio16_device::set_out_irq5_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dio16_device &>(*device).set_out_irq5_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ6_CB(_devcb) \
- devcb = &dio16_device::set_out_irq6_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<dio16_device &>(*device).set_out_irq6_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -63,7 +63,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_dio16_slot(device_t &device, device_t *owner, const char *dio_tag);
+ void set_dio16_slot(device_t *owner, const char *dio_tag) { m_owner = owner; m_dio_tag = dio_tag; }
protected:
dio16_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -84,11 +84,11 @@ public:
// construction/destruction
dio16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_irq3_callback(device_t &device, Object &&cb) { return downcast<dio16_device &>(device).m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq4_callback(device_t &device, Object &&cb) { return downcast<dio16_device &>(device).m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq5_callback(device_t &device, Object &&cb) { return downcast<dio16_device &>(device).m_out_irq5_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq6_callback(device_t &device, Object &&cb) { return downcast<dio16_device &>(device).m_out_irq6_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_out_irq3_callback(Object &&cb) { return m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq5_callback(Object &&cb) { return m_out_irq5_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq6_callback(Object &&cb) { return m_out_irq6_cb.set_callback(std::forward<Object>(cb)); }
void install_memory(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler);
@@ -155,7 +155,7 @@ public:
void set_dio_device();
// inline configuration
- static void static_set_diobus(device_t &device, device_t *dio_device);
+ void set_diobus(device_t *dio_device) { m_dio_dev = dio_device; }
public:
device_dio16_card_interface(const machine_config &mconfig, device_t &device);
@@ -178,7 +178,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_dio32_slot(device_t &device, device_t *owner, const char *dio_tag);
+ void set_dio32_slot(device_t *owner, const char *dio_tag) { m_owner = owner; m_dio_tag = dio_tag; }
};
diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp
index 1e6d343f17a..d1e20ec163e 100644
--- a/src/devices/bus/hp_hil/hp_hil.cpp
+++ b/src/devices/bus/hp_hil/hp_hil.cpp
@@ -44,13 +44,6 @@ hp_hil_slot_device::hp_hil_slot_device(const machine_config &mconfig, const char
}
-void hp_hil_slot_device::static_set_hp_hil_slot(device_t &device, device_t *owner, const char *mlc_tag)
-{
- hp_hil_slot_device &hp_hil = dynamic_cast<hp_hil_slot_device &>(device);
- hp_hil.m_owner = owner;
- hp_hil.m_mlc_tag = mlc_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -59,7 +52,7 @@ void hp_hil_slot_device::device_start()
{
device_hp_hil_interface *dev = dynamic_cast<device_hp_hil_interface *>(get_card_device());
- if (dev) device_hp_hil_interface::static_set_hp_hil_mlc(*dev,m_owner->subdevice(m_mlc_tag));
+ if (dev) dev->set_hp_hil_mlc(m_owner->subdevice(m_mlc_tag));
}
@@ -265,13 +258,6 @@ device_hp_hil_interface::~device_hp_hil_interface()
}
-void device_hp_hil_interface::static_set_hp_hil_mlc(device_t &device, device_t *mlc_device)
-{
- device_hp_hil_interface &hp_hil = dynamic_cast<device_hp_hil_interface &>(device);
- hp_hil.m_hp_hil_mlc_dev = mlc_device;
-}
-
-
void device_hp_hil_interface::set_hp_hil_mlc_device()
{
m_hp_hil_mlc = dynamic_cast<hp_hil_mlc_device *>(m_hp_hil_mlc_dev);
diff --git a/src/devices/bus/hp_hil/hp_hil.h b/src/devices/bus/hp_hil/hp_hil.h
index fe4e8bf9e27..f4cdbb5a771 100644
--- a/src/devices/bus/hp_hil/hp_hil.h
+++ b/src/devices/bus/hp_hil/hp_hil.h
@@ -82,15 +82,15 @@
//**************************************************************************
#define MCFG_HP_HIL_INT_CALLBACK(_devcb) \
- devcb = &hp_hil_mlc_device::set_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hp_hil_mlc_device &>(*device).set_int_callback(DEVCB_##_devcb);
#define MCFG_HP_HIL_NMI_CALLBACK(_devcb) \
- devcb = &hp_hil_mlc_device::set_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hp_hil_mlc_device &>(*device).set_nmi_callback(DEVCB_##_devcb);
#define MCFG_HP_HIL_SLOT_ADD(_mlc_tag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, HP_HIL_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- hp_hil_slot_device::static_set_hp_hil_slot(*device, this, _mlc_tag);
+ downcast<hp_hil_slot_device &>(*device).set_hp_hil_slot(this, _mlc_tag);
//**************************************************************************
// TYPE DEFINITIONS
@@ -107,7 +107,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_hp_hil_slot(device_t &device, device_t *owner, const char *mlc_tag);
+ void set_hp_hil_slot(device_t *owner, const char *mlc_tag) { m_owner = owner; m_mlc_tag = mlc_tag; }
protected:
// configuration
@@ -129,8 +129,8 @@ public:
hp_hil_mlc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~hp_hil_mlc_device() { m_device_list.detach_all(); }
- template <class Object> static devcb_base &set_int_callback(device_t &device, Object &&cb) { return downcast<hp_hil_mlc_device &>(device).int_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_callback(device_t &device, Object &&cb) { return downcast<hp_hil_mlc_device &>(device).nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return int_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_callback(Object &&cb) { return nmi_cb.set_callback(std::forward<Object>(cb)); }
void add_hp_hil_device(device_hp_hil_interface *device);
bool get_int(void) { return m_r3 & 1; }
@@ -176,7 +176,7 @@ public:
void set_hp_hil_mlc_device();
// inline configuration
- static void static_set_hp_hil_mlc(device_t &device, device_t *mlc_device);
+ void set_hp_hil_mlc(device_t *mlc_device) { m_hp_hil_mlc_dev = mlc_device; }
virtual bool hil_write(uint16_t *data) { return true; };
int device_id() { return m_device_id; };
diff --git a/src/devices/bus/ieee488/c2040fdc.h b/src/devices/bus/ieee488/c2040fdc.h
index bbbd799182c..1c552c1c508 100644
--- a/src/devices/bus/ieee488/c2040fdc.h
+++ b/src/devices/bus/ieee488/c2040fdc.h
@@ -24,13 +24,13 @@
//**************************************************************************
#define MCFG_C2040_SYNC_CALLBACK(_write) \
- devcb = &c2040_fdc_device::set_sync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c2040_fdc_device &>(*device).set_sync_wr_callback(DEVCB_##_write);
#define MCFG_C2040_READY_CALLBACK(_write) \
- devcb = &c2040_fdc_device::set_ready_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c2040_fdc_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
#define MCFG_C2040_ERROR_CALLBACK(_write) \
- devcb = &c2040_fdc_device::set_error_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c2040_fdc_device &>(*device).set_error_wr_callback(DEVCB_##_write);
@@ -46,9 +46,9 @@ public:
// construction/destruction
c2040_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_sync_wr_callback(device_t &device, Object &&cb) { return downcast<c2040_fdc_device &>(device).m_write_sync.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ready_wr_callback(device_t &device, Object &&cb) { return downcast<c2040_fdc_device &>(device).m_write_ready.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_error_wr_callback(device_t &device, Object &&cb) { return downcast<c2040_fdc_device &>(device).m_write_error.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sync_wr_callback(Object &&cb) { return m_write_sync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ready_wr_callback(Object &&cb) { return m_write_ready.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_error_wr_callback(Object &&cb) { return m_write_error.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/bus/ieee488/c8050fdc.h b/src/devices/bus/ieee488/c8050fdc.h
index 733100327ba..9bae3891284 100644
--- a/src/devices/bus/ieee488/c8050fdc.h
+++ b/src/devices/bus/ieee488/c8050fdc.h
@@ -23,16 +23,16 @@
//**************************************************************************
#define MCFG_C8050_SYNC_CALLBACK(_write) \
- devcb = &c8050_fdc_device::set_sync_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c8050_fdc_device &>(*device).set_sync_wr_callback(DEVCB_##_write);
#define MCFG_C8050_READY_CALLBACK(_write) \
- devcb = &c8050_fdc_device::set_ready_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c8050_fdc_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
#define MCFG_C8050_BRDY_CALLBACK(_write) \
- devcb = &c8050_fdc_device::set_brdy_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c8050_fdc_device &>(*device).set_brdy_wr_callback(DEVCB_##_write);
#define MCFG_C8050_ERROR_CALLBACK(_write) \
- devcb = &c8050_fdc_device::set_error_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<c8050_fdc_device &>(*device).set_error_wr_callback(DEVCB_##_write);
@@ -48,10 +48,10 @@ public:
// construction/destruction
c8050_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_sync_wr_callback(device_t &device, Object &&cb) { return downcast<c8050_fdc_device &>(device).m_write_sync.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ready_wr_callback(device_t &device, Object &&cb) { return downcast<c8050_fdc_device &>(device).m_write_ready.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_brdy_wr_callback(device_t &device, Object &&cb) { return downcast<c8050_fdc_device &>(device).m_write_brdy.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_error_wr_callback(device_t &device, Object &&cb) { return downcast<c8050_fdc_device &>(device).m_write_error.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sync_wr_callback(Object &&cb) { return m_write_sync.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ready_wr_callback(Object &&cb) { return m_write_ready.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_brdy_wr_callback(Object &&cb) { return m_write_brdy.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_error_wr_callback(Object &&cb) { return m_write_error.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/bus/intellec4/intellec4.cpp b/src/devices/bus/intellec4/intellec4.cpp
index 7034d4c7b27..17b2df413e0 100644
--- a/src/devices/bus/intellec4/intellec4.cpp
+++ b/src/devices/bus/intellec4/intellec4.cpp
@@ -26,16 +26,6 @@ univ_slot_device::univ_slot_device(machine_config const &mconfig, char const *ta
/*----------------------------------
- configuration helpers
-----------------------------------*/
-
-void univ_slot_device::set_bus_tag(device_t &device, char const *tag)
-{
- downcast<univ_slot_device &>(device).m_bus.set_tag(tag);
-}
-
-
-/*----------------------------------
device_t implementation
----------------------------------*/
@@ -88,46 +78,6 @@ univ_bus_device::univ_bus_device(machine_config const &mconfig, char const *tag,
/*----------------------------------
- address space configuration
-----------------------------------*/
-
-void univ_bus_device::set_rom_space(device_t &device, char const *tag, int space)
-{
- univ_bus_device &bus(downcast<univ_bus_device &>(device));
- bus.m_rom_device.set_tag(tag);
- bus.m_rom_space = space;
-}
-
-void univ_bus_device::set_rom_ports_space(device_t &device, char const *tag, int space)
-{
- univ_bus_device &bus(downcast<univ_bus_device &>(device));
- bus.m_rom_ports_device.set_tag(tag);
- bus.m_rom_ports_space = space;
-}
-
-void univ_bus_device::set_memory_space(device_t &device, char const *tag, int space)
-{
- univ_bus_device &bus(downcast<univ_bus_device &>(device));
- bus.m_memory_device.set_tag(tag);
- bus.m_memory_space = space;
-}
-
-void univ_bus_device::set_status_space(device_t &device, char const *tag, int space)
-{
- univ_bus_device &bus(downcast<univ_bus_device &>(device));
- bus.m_status_device.set_tag(tag);
- bus.m_status_space = space;
-}
-
-void univ_bus_device::set_ram_ports_space(device_t &device, char const *tag, int space)
-{
- univ_bus_device &bus(downcast<univ_bus_device &>(device));
- bus.m_ram_ports_device.set_tag(tag);
- bus.m_ram_ports_space = space;
-}
-
-
-/*----------------------------------
input lines
----------------------------------*/
diff --git a/src/devices/bus/intellec4/intellec4.h b/src/devices/bus/intellec4/intellec4.h
index c5e323ccb77..b88cc3d57ed 100644
--- a/src/devices/bus/intellec4/intellec4.h
+++ b/src/devices/bus/intellec4/intellec4.h
@@ -115,40 +115,40 @@ to implement the card in both systems.
#define MCFG_INTELLEC4_UNIV_SLOT_ADD(bus_tag, slot_tag, clock, slot_intf, def_slot) \
- MCFG_DEVICE_ADD(slot_tag, INTELLEC4_UNIV_SLOT, clock) \
- MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) \
- bus::intellec4::univ_slot_device::set_bus_tag(*device, "^" bus_tag);
+ MCFG_DEVICE_ADD(slot_tag, INTELLEC4_UNIV_SLOT, clock) \
+ MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) \
+ downcast<bus::intellec4::univ_slot_device &>(*device).set_bus_tag("^" bus_tag);
#define MCFG_INTELLEC4_UNIV_SLOT_REMOVE(slot_tag) \
- MCFG_DEVICE_REMOVE(slot_tag)
+ MCFG_DEVICE_REMOVE(slot_tag)
#define MCFG_INTELLEC4_UNIV_BUS_ROM_SPACE(tag, space) \
- bus::intellec4::univ_bus_device::set_rom_space(*device, "^" tag, space);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_rom_space("^" tag, space);
#define MCFG_INTELLEC4_UNIV_BUS_ROM_PORTS_SPACE(tag, space) \
- bus::intellec4::univ_bus_device::set_rom_ports_space(*device, "^" tag, space);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_rom_ports_space("^" tag, space);
#define MCFG_INTELLEC4_UNIV_BUS_MEMORY_SPACE(tag, space) \
- bus::intellec4::univ_bus_device::set_memory_space(*device, "^" tag, space);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_memory_space("^" tag, space);
#define MCFG_INTELLEC4_UNIV_BUS_STATUS_SPACE(tag, space) \
- bus::intellec4::univ_bus_device::set_status_space(*device, "^" tag, space);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_status_space("^" tag, space);
#define MCFG_INTELLEC4_UNIV_BUS_RAM_PORTS_SPACE(tag, space) \
- bus::intellec4::univ_bus_device::set_ram_ports_space(*device, "^" tag, space);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_ram_ports_space("^" tag, space);
#define MCFG_INTELLEC4_UNIV_BUS_TEST_CB(obj) \
- bus::intellec4::univ_bus_device::set_test_out_cb(*device, DEVCB_##obj);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_test_out_cb(DEVCB_##obj);
#define MCFG_INTELLEC4_UNIV_BUS_STOP_CB(obj) \
- bus::intellec4::univ_bus_device::set_stop_out_cb(*device, DEVCB_##obj);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_stop_out_cb(DEVCB_##obj);
#define MCFG_INTELLEC4_UNIV_BUS_RESET_4002_CB(obj) \
- bus::intellec4::univ_bus_device::set_reset_4002_out_cb(*device, DEVCB_##obj);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_reset_4002_out_cb(DEVCB_##obj);
#define MCFG_INTELLEC4_UNIV_BUS_USER_RESET_CB(obj) \
- bus::intellec4::univ_bus_device::set_user_reset_out_cb(*device, DEVCB_##obj);
+ downcast<bus::intellec4::univ_bus_device &>(*device).set_user_reset_out_cb(DEVCB_##obj);
namespace bus { namespace intellec4 {
@@ -162,7 +162,7 @@ class univ_slot_device : public device_t, public device_slot_interface
{
public:
// configuration helpers
- static void set_bus_tag(device_t &device, char const *bus_tag);
+ void set_bus_tag(char const *bus_tag) { m_bus.set_tag(bus_tag); }
univ_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
@@ -182,21 +182,17 @@ public:
friend class device_univ_card_interface;
// address space configuration
- static void set_rom_space(device_t &device, char const *tag, int space);
- static void set_rom_ports_space(device_t &device, char const *tag, int space);
- static void set_memory_space(device_t &device, char const *tag, int space);
- static void set_status_space(device_t &device, char const *tag, int space);
- static void set_ram_ports_space(device_t &device, char const *tag, int space);
+ void set_rom_space(char const *tag, int space) { m_rom_device.set_tag(tag); m_rom_space = space; }
+ void set_rom_ports_space(char const *tag, int space) { m_rom_ports_device.set_tag(tag); m_rom_ports_space = space; }
+ void set_memory_space(char const *tag, int space) { m_memory_device.set_tag(tag); m_memory_space = space; }
+ void set_status_space(char const *tag, int space) { m_status_device.set_tag(tag); m_status_space = space; }
+ void set_ram_ports_space(char const *tag, int space) { m_ram_ports_device.set_tag(tag); m_ram_ports_space = space; }
// callback configuration
- template <typename Obj> static devcb_base &set_stop_out_cb(device_t &device, Obj &&cb)
- { return downcast<univ_bus_device &>(device).m_stop_out_cb.set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_test_out_cb(device_t &device, Obj &&cb)
- { return downcast<univ_bus_device &>(device).m_test_out_cb.set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_reset_4002_out_cb(device_t &device, Obj &&cb)
- { return downcast<univ_bus_device &>(device).m_reset_4002_out_cb.set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_user_reset_out_cb(device_t &device, Obj &&cb)
- { return downcast<univ_bus_device &>(device).m_user_reset_out_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_stop_out_cb(Obj &&cb) { return m_stop_out_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_test_out_cb(Obj &&cb) { return m_test_out_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_reset_4002_out_cb(Obj &&cb) { return m_reset_4002_out_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_user_reset_out_cb(Obj &&cb) { return m_user_reset_out_cb.set_callback(std::forward<Obj>(cb)); }
univ_bus_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/bus/interpro/keyboard/keyboard.h b/src/devices/bus/interpro/keyboard/keyboard.h
index ca3b1a2eb82..c9def1e6a42 100644
--- a/src/devices/bus/interpro/keyboard/keyboard.h
+++ b/src/devices/bus/interpro/keyboard/keyboard.h
@@ -10,7 +10,7 @@
MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false)
#define MCFG_INTERPRO_KEYBOARD_RXD_HANDLER(cb) \
- devcb = &interpro_keyboard_port_device::set_rxd_handler(*device, DEVCB_##cb);
+ devcb = &downcast<interpro_keyboard_port_device &>(*device).set_rxd_handler(DEVCB_##cb);
class device_interpro_keyboard_port_interface;
@@ -23,7 +23,7 @@ public:
virtual ~interpro_keyboard_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_rxd_handler(device_t &device, Object &&cb) { return downcast<interpro_keyboard_port_device &>(device).m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxd_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(write_txd);
diff --git a/src/devices/bus/interpro/sr/sr.cpp b/src/devices/bus/interpro/sr/sr.cpp
index 29fc59c8294..dda3c7f13b8 100644
--- a/src/devices/bus/interpro/sr/sr.cpp
+++ b/src/devices/bus/interpro/sr/sr.cpp
@@ -280,7 +280,7 @@ void sr_slot_device::device_start()
device_sr_card_interface *dev = dynamic_cast<device_sr_card_interface *>(get_card_device());
if (dev)
- device_sr_card_interface::static_set_sr_tag(*dev, m_sr_tag, m_sr_slot_tag);
+ dev->set_sr_tag(m_sr_tag, m_sr_slot_tag);
}
DEFINE_DEVICE_TYPE(SR, sr_device, "sr", "InterPro SR bus")
@@ -338,14 +338,6 @@ device_sr_card_interface::~device_sr_card_interface()
{
}
-void device_sr_card_interface::static_set_sr_tag(device_t &device, const char *tag, const char *slot_tag)
-{
- device_sr_card_interface &sr_card = dynamic_cast<device_sr_card_interface &>(device);
-
- sr_card.m_sr_tag = tag;
- sr_card.m_sr_slot_tag = slot_tag;
-}
-
void device_sr_card_interface::set_sr_device()
{
// get a reference to the bus
diff --git a/src/devices/bus/interpro/sr/sr.h b/src/devices/bus/interpro/sr/sr.h
index 02b2734d05d..c4a03c42aa5 100644
--- a/src/devices/bus/interpro/sr/sr.h
+++ b/src/devices/bus/interpro/sr/sr.h
@@ -7,13 +7,13 @@
#pragma once
#define MCFG_SR_OUT_IRQ0_CB(_devcb) \
- devcb = &sr_device::set_out_irq0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sr_device &>(*device).set_out_irq0_callback(DEVCB_##_devcb);
#define MCFG_SR_OUT_IRQ1_CB(_devcb) \
- devcb = &sr_device::set_out_irq1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sr_device &>(*device).set_out_irq1_callback(DEVCB_##_devcb);
#define MCFG_SR_OUT_IRQ2_CB(_devcb) \
- devcb = &sr_device::set_out_irq2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<sr_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
#define MCFG_SR_SLOT_ADD(_srtag, _tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, SR_SLOT, 0) \
@@ -56,9 +56,9 @@ public:
sr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// inline configuration
- template <class Object> static devcb_base &set_out_irq0_callback(device_t &device, Object &&cb) { return downcast<sr_device &>(device).m_out_irq0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq1_callback(device_t &device, Object &&cb) { return downcast<sr_device &>(device).m_out_irq1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq2_callback(device_t &device, Object &&cb) { return downcast<sr_device &>(device).m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq0_callback(Object &&cb) { return m_out_irq0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq1_callback(Object &&cb) { return m_out_irq1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
void set_memory(const char *const tag, const int main_spacenum, const int io_spacenum);
@@ -121,7 +121,7 @@ public:
void irq(int status);
// inline configuration
- static void static_set_sr_tag(device_t &device, const char *tag, const char *slot_tag);
+ void set_sr_tag(const char *tag, const char *slot_tag) { m_sr_tag = tag; m_sr_slot_tag = slot_tag; }
protected:
device_sr_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h
index 649f397d2b9..67dff9df198 100644
--- a/src/devices/bus/iq151/iq151.h
+++ b/src/devices/bus/iq151/iq151.h
@@ -86,12 +86,12 @@ public:
iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~iq151cart_slot_device();
- template <class Object> static devcb_base &set_out_irq0_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_irq0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq1_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_irq1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq2_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq3_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq4_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq_callback(device_t &device, Object &&cb) { return downcast<iq151cart_slot_device &>(device).m_out_drq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq0_callback(Object &&cb) { return m_out_irq0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq1_callback(Object &&cb) { return m_out_irq1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq3_callback(Object &&cb) { return m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq_callback(Object &&cb) { return m_out_drq_cb.set_callback(std::forward<Object>(cb)); }
// device-level overrides
virtual void device_start() override;
@@ -139,21 +139,21 @@ DECLARE_DEVICE_TYPE(IQ151CART_SLOT, iq151cart_slot_device)
***************************************************************************/
#define MCFG_IQ151CART_SLOT_OUT_IRQ0_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_irq0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_irq0_callback(DEVCB_##_devcb);
#define MCFG_IQ151CART_SLOT_OUT_IRQ1_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_irq1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_irq1_callback(DEVCB_##_devcb);
#define MCFG_IQ151CART_SLOT_OUT_IRQ2_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_irq2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
#define MCFG_IQ151CART_SLOT_OUT_IRQ3_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_irq3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_irq3_callback(DEVCB_##_devcb);
#define MCFG_IQ151CART_SLOT_OUT_IRQ4_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_irq4_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
#define MCFG_IQ151CART_SLOT_OUT_DRQ_CB(_devcb) \
- devcb = &iq151cart_slot_device::set_out_drq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<iq151cart_slot_device &>(*device).set_out_drq_callback(DEVCB_##_devcb);
#endif // MAME_BUS_IQ151_IQ151_H
diff --git a/src/devices/bus/isa/gus.h b/src/devices/bus/isa/gus.h
index 7c3bdcea91a..09f86e0b091 100644
--- a/src/devices/bus/isa/gus.h
+++ b/src/devices/bus/isa/gus.h
@@ -46,37 +46,37 @@
#include "machine/6850acia.h"
#define MCFG_GF1_TXIRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_txirq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_txirq_handler(DEVCB_##_devcb);
#define MCFG_GF1_RXIRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_rxirq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_rxirq_handler(DEVCB_##_devcb);
#define MCFG_GF1_WAVE_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_wave_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_wave_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_RAMP_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_ramp_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_ramp_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_TIMER1_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_timer1_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_timer1_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_TIMER2_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_timer2_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_timer2_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_SB_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_sb_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_sb_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_DMA_IRQ_HANDLER(_devcb) \
- devcb = &gf1_device::set_dma_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_dma_irq_handler(DEVCB_##_devcb);
#define MCFG_GF1_DRQ1_HANDLER(_devcb) \
- devcb = &gf1_device::set_drq1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_drq1_handler(DEVCB_##_devcb);
#define MCFG_GF1_DRQ2_HANDLER(_devcb) \
- devcb = &gf1_device::set_drq2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_drq2_handler(DEVCB_##_devcb);
#define MCFG_GF1_NMI_HANDLER(_devcb) \
- devcb = &gf1_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<gf1_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -112,17 +112,17 @@ public:
// construction/destruction
gf1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_txirq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_txirq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rxirq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_rxirq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_wave_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_wave_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ramp_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_ramp_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_timer1_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_timer1_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_timer2_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_timer2_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sb_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_sb_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_irq_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_dma_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq1_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_drq1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq2_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_drq2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb) { return downcast<gf1_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_txirq_handler(Object &&cb) { return m_txirq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxirq_handler(Object &&cb) { return m_rxirq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wave_irq_handler(Object &&cb) { return m_wave_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ramp_irq_handler(Object &&cb) { return m_ramp_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_timer1_irq_handler(Object &&cb) { return m_timer1_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_timer2_irq_handler(Object &&cb) { return m_timer2_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sb_irq_handler(Object &&cb) { return m_sb_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_irq_handler(Object &&cb) { return m_dma_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq1_handler(Object &&cb) { return m_drq1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq2_handler(Object &&cb) { return m_drq2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
// current IRQ/DMA channel getters
uint8_t gf1_irq() { if(m_gf1_irq != 0) return m_gf1_irq; else return m_midi_irq; } // workaround for win95 loading dumb values
diff --git a/src/devices/bus/isa/hdc.h b/src/devices/bus/isa/hdc.h
index b8b325f1c6d..a935fe9288d 100644
--- a/src/devices/bus/isa/hdc.h
+++ b/src/devices/bus/isa/hdc.h
@@ -20,10 +20,10 @@
// XT HD controller device
#define MCFG_XTHDC_IRQ_HANDLER(_devcb) \
- devcb = &xt_hdc_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<xt_hdc_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_XTHDC_DRQ_HANDLER(_devcb) \
- devcb = &xt_hdc_device::set_drq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<xt_hdc_device &>(*device).set_drq_handler(DEVCB_##_devcb);
class xt_hdc_device :
public device_t
@@ -32,8 +32,8 @@ public:
// construction/destruction
xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<xt_hdc_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq_handler(device_t &device, Object &&cb) { return downcast<xt_hdc_device &>(device).m_drq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq_handler(Object &&cb) { return m_drq_handler.set_callback(std::forward<Object>(cb)); }
int dack_r();
int dack_rs();
diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp
index 68d0ce971d8..91907e4a9f8 100644
--- a/src/devices/bus/isa/isa.cpp
+++ b/src/devices/bus/isa/isa.cpp
@@ -35,13 +35,6 @@ isa8_slot_device::isa8_slot_device(const machine_config &mconfig, device_type ty
{
}
-void isa8_slot_device::static_set_isa8_slot(device_t &device, device_t *owner, const char *isa_tag)
-{
- isa8_slot_device &isa_card = dynamic_cast<isa8_slot_device &>(device);
- isa_card.m_owner = owner;
- isa_card.m_isa_tag = isa_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -53,7 +46,7 @@ void isa8_slot_device::device_start()
if (get_card_device() && get_card_device()->interface(intf))
fatalerror("ISA16 device in ISA8 slot\n");
- if (dev) device_isa8_card_interface::static_set_isabus(*dev,m_owner->subdevice(m_isa_tag));
+ if (dev) dev->set_isabus(m_owner->subdevice(m_isa_tag));
}
@@ -76,13 +69,6 @@ isa16_slot_device::isa16_slot_device(const machine_config &mconfig, const char *
{
}
-void isa16_slot_device::static_set_isa16_slot(device_t &device, device_t *owner, const char *isa_tag)
-{
- isa16_slot_device &isa_card = dynamic_cast<isa16_slot_device &>(device);
- isa_card.m_owner = owner;
- isa_card.m_isa_tag = isa_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -90,7 +76,7 @@ void isa16_slot_device::static_set_isa16_slot(device_t &device, device_t *owner,
void isa16_slot_device::device_start()
{
device_isa8_card_interface *dev = dynamic_cast<device_isa8_card_interface *>(get_card_device());
- if (dev) device_isa8_card_interface::static_set_isabus(*dev,m_owner->subdevice(m_isa_tag));
+ if (dev) dev->set_isabus(m_owner->subdevice(m_isa_tag));
}
@@ -100,19 +86,6 @@ void isa16_slot_device::device_start()
DEFINE_DEVICE_TYPE(ISA8, isa8_device, "isa8", "8-bit ISA bus")
-void isa8_device::static_set_cputag(device_t &device, const char *tag)
-{
- isa8_device &isa = downcast<isa8_device &>(device);
- isa.m_maincpu.set_tag(tag);
-}
-
-void isa8_device::static_set_custom_spaces(device_t &device)
-{
- isa8_device &isa = downcast<isa8_device &>(device);
-
- isa.m_allocspaces = true;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -427,12 +400,6 @@ void device_isa8_card_interface::eop_w(int state)
{
}
-void device_isa8_card_interface::static_set_isabus(device_t &device, device_t *isa_device)
-{
- device_isa8_card_interface &isa_card = dynamic_cast<device_isa8_card_interface &>(device);
- isa_card.m_isa_dev = isa_device;
-}
-
void device_isa8_card_interface::set_isa_device()
{
m_isa = dynamic_cast<isa8_device *>(m_isa_dev);
diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h
index 1cbf755e4a4..a8046423e61 100644
--- a/src/devices/bus/isa/isa.h
+++ b/src/devices/bus/isa/isa.h
@@ -74,80 +74,80 @@
//**************************************************************************
#define MCFG_ISA8_CPU(_cputag) \
- isa8_device::static_set_cputag(*device, _cputag);
+ downcast<isa8_device &>(*device).set_cputag(_cputag);
// include this in a driver to have ISA allocate it's own address spaces (e.g. non-x86)
#define MCFG_ISA8_BUS_CUSTOM_SPACES() \
- isa8_device::static_set_custom_spaces(*device);
+ downcast<isa8_device &>(*device).set_custom_spaces();
#define MCFG_ISA8_SLOT_ADD(_isatag, _tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, ISA8_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed) \
- isa8_slot_device::static_set_isa8_slot(*device, this, _isatag);
+ downcast<isa8_slot_device &>(*device).set_isa8_slot(this, _isatag);
#define MCFG_ISA16_CPU(_cputag) \
- isa8_device::static_set_cputag(*device, _cputag);
+ downcast<isa8_device &>(*device).set_cputag(_cputag);
#define MCFG_ISA16_BUS_CUSTOM_SPACES() \
- isa8_device::static_set_custom_spaces(*device);
+ downcast<isa8_device &>(*device).set_custom_spaces();
#define MCFG_ISA16_SLOT_ADD(_isatag, _tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, ISA16_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed) \
- isa16_slot_device::static_set_isa16_slot(*device, this, _isatag);
+ downcast<isa16_slot_device &>(*device).set_isa16_slot(this, _isatag);
#define MCFG_ISA_BUS_IOCHCK(_iochck) \
devcb = &downcast<isa8_device *>(device)->set_iochck_callback(DEVCB_##_iochck);
#define MCFG_ISA_OUT_IRQ2_CB(_devcb) \
- devcb = &isa8_device::set_out_irq2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ3_CB(_devcb) \
- devcb = &isa8_device::set_out_irq3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq3_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ4_CB(_devcb) \
- devcb = &isa8_device::set_out_irq4_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ5_CB(_devcb) \
- devcb = &isa8_device::set_out_irq5_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq5_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ6_CB(_devcb) \
- devcb = &isa8_device::set_out_irq6_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq6_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ7_CB(_devcb) \
- devcb = &isa8_device::set_out_irq7_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_irq7_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ1_CB(_devcb) \
- devcb = &isa8_device::set_out_drq1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_drq1_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ2_CB(_devcb) \
- devcb = &isa8_device::set_out_drq2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_drq2_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ3_CB(_devcb) \
- devcb = &isa8_device::set_out_drq3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa8_device &>(*device).set_out_drq3_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ10_CB(_devcb) \
- devcb = &isa16_device::set_out_irq10_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_irq10_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ11_CB(_devcb) \
- devcb = &isa16_device::set_out_irq11_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_irq11_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ12_CB(_devcb) \
- devcb = &isa16_device::set_out_irq12_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_irq12_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ14_CB(_devcb) \
- devcb = &isa16_device::set_out_irq14_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_irq14_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_IRQ15_CB(_devcb) \
- devcb = &isa16_device::set_out_irq15_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_irq15_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ0_CB(_devcb) \
- devcb = &isa16_device::set_out_drq0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_drq0_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ5_CB(_devcb) \
- devcb = &isa16_device::set_out_drq5_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_drq5_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ6_CB(_devcb) \
- devcb = &isa16_device::set_out_drq6_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_drq6_callback(DEVCB_##_devcb);
#define MCFG_ISA_OUT_DRQ7_CB(_devcb) \
- devcb = &isa16_device::set_out_drq7_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<isa16_device &>(*device).set_out_drq7_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -167,7 +167,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_isa8_slot(device_t &device, device_t *owner, const char *isa_tag);
+ void set_isa8_slot(device_t *owner, const char *isa_tag) { m_owner = owner; m_isa_tag = isa_tag; }
protected:
isa8_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -197,18 +197,18 @@ public:
// construction/destruction
isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- static void static_set_custom_spaces(device_t &device);
+ void set_cputag(const char *tag) { m_maincpu.set_tag(tag); }
+ void set_custom_spaces() { m_allocspaces = true; }
template <class Object> devcb_base &set_iochck_callback(Object &&cb) { return m_write_iochck.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq2_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq3_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq4_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq5_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq5_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq6_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq6_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq7_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_irq7_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq1_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_drq1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq2_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_drq2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq3_callback(device_t &device, Object &&cb) { return downcast<isa8_device &>(device).m_out_drq3_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq3_callback(Object &&cb) { return m_out_irq3_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq5_callback(Object &&cb) { return m_out_irq5_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq6_callback(Object &&cb) { return m_out_irq6_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq7_callback(Object &&cb) { return m_out_irq7_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq1_callback(Object &&cb) { return m_out_drq1_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq2_callback(Object &&cb) { return m_out_drq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq3_callback(Object &&cb) { return m_out_drq3_cb.set_callback(std::forward<Object>(cb)); }
// for ISA8, put the 8-bit configs in the primary slots and the 16-bit configs in the secondary
virtual space_config_vector memory_space_config() const override;
@@ -317,7 +317,7 @@ public:
virtual void eop_w(int state);
// inline configuration
- static void static_set_isabus(device_t &device, device_t *isa_device);
+ void set_isabus(device_t *isa_device) { m_isa_dev = isa_device; }
public:
device_isa8_card_interface(const machine_config &mconfig, device_t &device);
@@ -340,7 +340,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_isa16_slot(device_t &device, device_t *owner, const char *isa_tag);
+ void set_isa16_slot(device_t *owner, const char *isa_tag) { m_owner = owner; m_isa_tag = isa_tag; }
};
@@ -354,15 +354,15 @@ public:
// construction/destruction
isa16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_out_irq10_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_irq10_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq11_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_irq11_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq12_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_irq12_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq14_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_irq14_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq15_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_irq15_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq0_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_drq0_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq5_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_drq5_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq6_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_drq6_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_drq7_callback(device_t &device, Object &&cb) { return downcast<isa16_device &>(device).m_out_drq7_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq10_callback(Object &&cb) { return m_out_irq10_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq11_callback(Object &&cb) { return m_out_irq11_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq12_callback(Object &&cb) { return m_out_irq12_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq14_callback(Object &&cb) { return m_out_irq14_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq15_callback(Object &&cb) { return m_out_irq15_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq0_callback(Object &&cb) { return m_out_drq0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq5_callback(Object &&cb) { return m_out_drq5_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq6_callback(Object &&cb) { return m_out_drq6_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_drq7_callback(Object &&cb) { return m_out_drq7_cb.set_callback(std::forward<Object>(cb)); }
void install16_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler);
diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp
index 99da30bb188..aa9e75e1951 100644
--- a/src/devices/bus/kc/kc.cpp
+++ b/src/devices/bus/kc/kc.cpp
@@ -167,13 +167,6 @@ kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, device_type
{
}
-void kcexp_slot_device::static_set_next_slot(device_t &device, const char *next_slot_tag)
-{
- kcexp_slot_device &kc_slot = dynamic_cast<kcexp_slot_device &>(device);
-
- kc_slot.m_next_slot_tag = next_slot_tag;
-}
-
//-------------------------------------------------
// kcexp_slot_device - destructor
//-------------------------------------------------
diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h
index a058a80c9af..083f60e3a66 100644
--- a/src/devices/bus/kc/kc.h
+++ b/src/devices/bus/kc/kc.h
@@ -51,12 +51,12 @@ public:
kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~kcexp_slot_device();
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<kcexp_slot_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<kcexp_slot_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_halt_callback(device_t &device, Object &&cb) { return downcast<kcexp_slot_device &>(device).m_out_halt_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_halt_callback(Object &&cb) { return m_out_halt_cb.set_callback(std::forward<Object>(cb)); }
// inline configuration
- static void static_set_next_slot(device_t &device, const char *next_module_tag);
+ void set_next_slot(const char *next_module_tag) { m_next_slot_tag = next_module_tag; }
// reading and writing
virtual uint8_t module_id_r();
@@ -121,29 +121,29 @@ DECLARE_DEVICE_TYPE(KCCART_SLOT, kccart_slot_device)
***************************************************************************/
#define MCFG_KCEXP_SLOT_OUT_IRQ_CB(_devcb) \
- devcb = &kcexp_slot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kcexp_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_KCEXP_SLOT_OUT_NMI_CB(_devcb) \
- devcb = &kcexp_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kcexp_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_KCEXP_SLOT_OUT_HALT_CB(_devcb) \
- devcb = &kcexp_slot_device::set_out_halt_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kcexp_slot_device &>(*device).set_out_halt_callback(DEVCB_##_devcb);
#define MCFG_KCEXP_SLOT_NEXT_SLOT(_next_slot_tag) \
- kcexp_slot_device::static_set_next_slot(*device, _next_slot_tag);
+ downcast<kcexp_slot_device &>(*device).set_next_slot(_next_slot_tag);
#define MCFG_KCCART_SLOT_OUT_IRQ_CB(_devcb) \
- devcb = &kccart_slot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kccart_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_KCCART_SLOT_OUT_NMI_CB(_devcb) \
- devcb = &kccart_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kccart_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_KCCART_SLOT_OUT_HALT_CB(_devcb) \
- devcb = &kccart_slot_device::set_out_halt_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<kccart_slot_device &>(*device).set_out_halt_callback(DEVCB_##_devcb);
#define MCFG_KCCART_SLOT_NEXT_SLOT(_next_slot_tag) \
- kccart_slot_device::static_set_next_slot(*device, _next_slot_tag);
+ downcast<kccart_slot_device &>(*device).set_next_slot(_next_slot_tag);
// #define MCFG_KC85_EXPANSION_ADD(_tag,_next_slot_tag,_config,_slot_intf,_def_slot)
// MCFG_DEVICE_ADD(_tag, KCEXP_SLOT, 0)
diff --git a/src/devices/bus/lpci/i82371sb.h b/src/devices/bus/lpci/i82371sb.h
index 325934b2e5c..dfb1f5de498 100644
--- a/src/devices/bus/lpci/i82371sb.h
+++ b/src/devices/bus/lpci/i82371sb.h
@@ -24,7 +24,7 @@ public:
// construction/destruction
i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_boot_state_hook(device_t &device, Object &&cb) { return downcast<i82371sb_device &>(device).m_boot_state_hook.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_boot_state_hook(Object &&cb) { return m_boot_state_hook.set_callback(std::forward<Object>(cb)); }
virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override;
virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override;
@@ -52,6 +52,6 @@ private:
DECLARE_DEVICE_TYPE(I82371SB, i82371sb_device)
#define MCFG_I82371SB_BOOT_STATE_HOOK(_devcb) \
- devcb = &i82371sb_device::set_boot_state_hook(*device, DEVCB_##_devcb);
+ devcb = &downcast<i82371sb_device &>(*device).set_boot_state_hook(DEVCB_##_devcb);
#endif // MAME_BUS_LPCI_I82371SB_H
diff --git a/src/devices/bus/lpci/i82439tx.h b/src/devices/bus/lpci/i82439tx.h
index 8853b9b96a6..781ff949089 100644
--- a/src/devices/bus/lpci/i82439tx.h
+++ b/src/devices/bus/lpci/i82439tx.h
@@ -17,10 +17,10 @@
#include "northbridge.h"
#define MCFG_I82439TX_CPU( _tag ) \
- i82439tx_device::static_set_cpu(*device, _tag);
+ downcast<i82439tx_device &>(*device).set_cpu(_tag);
#define MCFG_I82439TX_REGION( _tag ) \
- i82439tx_device::static_set_region(*device, _tag);
+ downcast<i82439tx_device &>(*device).set_region(_tag);
// ======================> i82439tx_device
@@ -30,8 +30,8 @@ public:
// construction/destruction
i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_cpu(device_t &device, const char *tag) { dynamic_cast<i82439tx_device &>(device).m_cpu_tag = tag; }
- static void static_set_region(device_t &device, const char *tag) { dynamic_cast<i82439tx_device &>(device).m_region_tag = tag; }
+ void set_cpu(const char *tag) { m_cpu_tag = tag; }
+ void set_region(const char *tag) { m_region_tag = tag; }
virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override;
virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override;
diff --git a/src/devices/bus/lpci/mpc105.h b/src/devices/bus/lpci/mpc105.h
index 3b3a726c4b1..65ab5a59637 100644
--- a/src/devices/bus/lpci/mpc105.h
+++ b/src/devices/bus/lpci/mpc105.h
@@ -18,10 +18,10 @@
#define MPC105_MEMORYBANK_COUNT 8
#define MCFG_MPC105_CPU( _tag ) \
- mpc105_device::static_set_cpu(*device, _tag);
+ downcast<mpc105_device &>(*device).set_cpu(_tag);
#define MCFG_MPC105_BANK_BASE_DEFAULT( bank_base_default ) \
- mpc105_device::static_set_bank_base_default(*device, bank_base_default);
+ downcast<mpc105_device &>(*device).set_bank_base_default(bank_base_default);
// ======================> mpc105_device
@@ -32,8 +32,8 @@ public:
// construction/destruction
mpc105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_cpu(device_t &device, const char *tag) { dynamic_cast<mpc105_device &>(device).m_cpu_tag = tag; }
- static void static_set_bank_base_default(device_t &device, int bank_base_default) { dynamic_cast<mpc105_device &>(device).m_bank_base_default = bank_base_default; }
+ void set_cpu(const char *tag) { m_cpu_tag = tag; }
+ void set_bank_base_default(int bank_base_default) { m_bank_base_default = bank_base_default; }
virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override;
virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override;
diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp
index 36f6cf90219..e411064d551 100644
--- a/src/devices/bus/macpds/macpds.cpp
+++ b/src/devices/bus/macpds/macpds.cpp
@@ -38,13 +38,6 @@ macpds_slot_device::macpds_slot_device(const machine_config &mconfig, device_typ
{
}
-void macpds_slot_device::static_set_macpds_slot(device_t &device, const char *tag, const char *slottag)
-{
- macpds_slot_device &macpds_card = dynamic_cast<macpds_slot_device &>(device);
- macpds_card.m_macpds_tag = tag;
- macpds_card.m_macpds_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -53,7 +46,7 @@ void macpds_slot_device::device_start()
{
device_macpds_card_interface *dev = dynamic_cast<device_macpds_card_interface *>(get_card_device());
- if (dev) device_macpds_card_interface::static_set_macpds_tag(*dev, m_macpds_tag, m_macpds_slottag);
+ if (dev) dev->set_macpds_tag(m_macpds_tag, m_macpds_slottag);
}
//**************************************************************************
@@ -62,12 +55,6 @@ void macpds_slot_device::device_start()
DEFINE_DEVICE_TYPE(MACPDS, macpds_device, "macpds", "Mac 68000 Processor-Direct Bus")
-void macpds_device::static_set_cputag(device_t &device, const char *tag)
-{
- macpds_device &macpds = downcast<macpds_device &>(device);
- macpds.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -164,13 +151,6 @@ device_macpds_card_interface::~device_macpds_card_interface()
{
}
-void device_macpds_card_interface::static_set_macpds_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_macpds_card_interface &macpds_card = dynamic_cast<device_macpds_card_interface &>(device);
- macpds_card.m_macpds_tag = tag;
- macpds_card.m_macpds_slottag = slottag;
-}
-
void device_macpds_card_interface::set_macpds_device()
{
m_macpds = dynamic_cast<macpds_device *>(device().machine().device(m_macpds_tag));
diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h
index fdd62404fac..7e92ec71087 100644
--- a/src/devices/bus/macpds/macpds.h
+++ b/src/devices/bus/macpds/macpds.h
@@ -21,12 +21,12 @@
#define MCFG_MACPDS_BUS_ADD(_tag, _cputag) \
MCFG_DEVICE_ADD(_tag, MACPDS, 0) \
- macpds_device::static_set_cputag(*device, _cputag);
+ downcast<macpds_device &>(*device).set_cputag(_cputag);
#define MCFG_MACPDS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, MACPDS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- macpds_slot_device::static_set_macpds_slot(*device, _nbtag, _tag);
+ downcast<macpds_slot_device &>(*device).set_macpds_slot(_nbtag, _tag);
#define MCFG_MACPDS_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
@@ -34,7 +34,7 @@
#define MCFG_MACPDS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- device_macpds_card_interface::static_set_macpds_tag(*device, _nbtag, _tag);
+ downcast<device_macpds_card_interface &>(*device).set_macpds_tag(_nbtag, _tag);
#define MCFG_MACPDS_BUS_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
@@ -53,7 +53,7 @@ public:
macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_macpds_slot(device_t &device, const char *tag, const char *slottag);
+ void set_macpds_slot(const char *tag, const char *slottag) { m_macpds_tag = tag; m_macpds_slottag = slottag; }
protected:
macpds_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -79,7 +79,7 @@ public:
macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~macpds_device() { m_device_list.detach_all(); }
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
+ void set_cputag(const char *tag) { m_cputag = tag; }
void add_macpds_card(device_macpds_card_interface *card);
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff);
@@ -125,7 +125,7 @@ public:
void install_rom(device_t *dev, const char *romregion, uint32_t addr);
// inline configuration
- static void static_set_macpds_tag(device_t &device, const char *tag, const char *slottag);
+ void set_macpds_tag(const char *tag, const char *slottag) { m_macpds_tag = tag; m_macpds_slottag = slottag; }
protected:
device_macpds_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp
index cce214a6da1..8fd357afdc1 100644
--- a/src/devices/bus/macpds/pds_tpdfpd.cpp
+++ b/src/devices/bus/macpds/pds_tpdfpd.cpp
@@ -95,7 +95,7 @@ macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig,
m_vram(nullptr), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, SEDISPLAY_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/midi/midi.h b/src/devices/bus/midi/midi.h
index dcae78538f8..52c889efbd7 100644
--- a/src/devices/bus/midi/midi.h
+++ b/src/devices/bus/midi/midi.h
@@ -11,7 +11,7 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_MIDI_RX_HANDLER(_devcb) \
- devcb = &midi_port_device::set_rx_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<midi_port_device &>(*device).set_rx_handler(DEVCB_##_devcb);
class device_midi_port_interface;
@@ -25,7 +25,7 @@ public:
virtual ~midi_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_rx_handler(device_t &device, Object &&cb) { return downcast<midi_port_device &>(device).m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rx_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_txd );
diff --git a/src/devices/bus/msx_cart/yamaha.cpp b/src/devices/bus/msx_cart/yamaha.cpp
index 3bb4f7c63dc..a8c7280fdf9 100644
--- a/src/devices/bus/msx_cart/yamaha.cpp
+++ b/src/devices/bus/msx_cart/yamaha.cpp
@@ -103,7 +103,7 @@ void msx_cart_sfg_device::device_start()
// This should probably moved up in the bus/slot hierarchy for the msx driver
cpu_device *maincpu = machine().device<cpu_device>("maincpu");
- device_execute_interface::static_set_irq_acknowledge_callback(*maincpu, device_irq_acknowledge_delegate(FUNC(msx_cart_sfg_device::irq_callback),this));
+ maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(msx_cart_sfg_device::irq_callback),this));
}
diff --git a/src/devices/bus/msx_slot/bunsetsu.h b/src/devices/bus/msx_slot/bunsetsu.h
index 0e340d98ae1..da26e5350fb 100644
--- a/src/devices/bus/msx_slot/bunsetsu.h
+++ b/src/devices/bus/msx_slot/bunsetsu.h
@@ -14,16 +14,16 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_BUNSETSU, msx_slot_bunsetsu_device)
#define MCFG_MSX_SLOT_BUNSETSU_ADD(_tag, _startpage, _numpages, _region, _offset, _bunsetsu_region_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_BUNSETSU, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_bunsetsu_device::set_bunsetsu_region_tag(*device, "^" _bunsetsu_region_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_bunsetsu_device &>(*device).set_bunsetsu_region_tag("^" _bunsetsu_region_tag);
class msx_slot_bunsetsu_device : public msx_slot_rom_device
{
public:
msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_bunsetsu_region_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_bunsetsu_device &>(device).m_bunsetsu_region.set_tag(tag); }
+ // configuration helpers
+ void set_bunsetsu_region_tag(const char *tag) { m_bunsetsu_region.set_tag(tag); }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h
index 78d6721263d..ff8fbb96fb3 100644
--- a/src/devices/bus/msx_slot/cartridge.h
+++ b/src/devices/bus/msx_slot/cartridge.h
@@ -17,13 +17,13 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_YAMAHA_EXPANSION, msx_slot_yamaha_expansion_device)
#define MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag, _devcb) \
MCFG_DEVICE_ADD(_tag, MSX_SLOT_CARTRIDGE, 0) \
MCFG_DEVICE_SLOT_INTERFACE(msx_cart, nullptr, false) \
- devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<msx_slot_cartridge_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, _devcb, _default) \
MCFG_DEVICE_ADD(_tag, MSX_SLOT_YAMAHA_EXPANSION, 0) \
MCFG_DEVICE_SLOT_INTERFACE(msx_yamaha_60pin, _default, false) \
- devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<msx_slot_cartridge_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class msx_slot_cartridge_device : public device_t
@@ -36,7 +36,7 @@ public:
msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<msx_slot_cartridge_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
// image-level overrides
virtual image_init_result call_load() override;
diff --git a/src/devices/bus/msx_slot/disk.h b/src/devices/bus/msx_slot/disk.h
index 5bb99811c81..698b49b9764 100644
--- a/src/devices/bus/msx_slot/disk.h
+++ b/src/devices/bus/msx_slot/disk.h
@@ -29,58 +29,58 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_DISK6, msx_slot_disk6_device)
#define MCFG_MSX_SLOT_DISK1_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK1, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag);
#define MCFG_MSX_SLOT_DISK2_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK2, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag);
#define MCFG_MSX_SLOT_DISK3_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK3, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag);
#define MCFG_MSX_SLOT_DISK4_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK4, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag);
#define MCFG_MSX_SLOT_DISK5_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag, _floppy2_tag, _floppy3_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK5, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag); \
- msx_slot_disk_device::set_floppy2_tag(*device, _floppy2_tag); \
- msx_slot_disk_device::set_floppy3_tag(*device, _floppy3_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy2_tag(_floppy2_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy3_tag(_floppy3_tag);
#define MCFG_MSX_SLOT_DISK6_ADD(_tag, _startpage, _numpages, _region, _offset, _fdc_tag, _floppy0_tag, _floppy1_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_DISK6, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_disk_device::set_fdc_tag(*device, _fdc_tag); \
- msx_slot_disk_device::set_floppy0_tag(*device, _floppy0_tag); \
- msx_slot_disk_device::set_floppy1_tag(*device, _floppy1_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_disk_device &>(*device).set_fdc_tag(_fdc_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy0_tag(_floppy0_tag); \
+ downcast<msx_slot_disk_device &>(*device).set_floppy1_tag(_floppy1_tag);
class msx_slot_disk_device : public msx_slot_rom_device
{
public:
- // static configuration helpers
- static void set_fdc_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_disk_device &>(device).m_fdc_tag = tag; }
- static void set_floppy0_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_disk_device &>(device).m_floppy0_tag = tag; }
- static void set_floppy1_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_disk_device &>(device).m_floppy1_tag = tag; }
- static void set_floppy2_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_disk_device &>(device).m_floppy2_tag = tag; }
- static void set_floppy3_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_disk_device &>(device).m_floppy3_tag = tag; }
+ // configuration helpers
+ void set_fdc_tag(const char *tag) { m_fdc_tag = tag; }
+ void set_floppy0_tag(const char *tag) { m_floppy0_tag = tag; }
+ void set_floppy1_tag(const char *tag) { m_floppy1_tag = tag; }
+ void set_floppy2_tag(const char *tag) { m_floppy2_tag = tag; }
+ void set_floppy3_tag(const char *tag) { m_floppy3_tag = tag; }
protected:
msx_slot_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/bus/msx_slot/fs4600.cpp b/src/devices/bus/msx_slot/fs4600.cpp
index 7223744203f..3ec7efc74f7 100644
--- a/src/devices/bus/msx_slot/fs4600.cpp
+++ b/src/devices/bus/msx_slot/fs4600.cpp
@@ -32,15 +32,6 @@ MACHINE_CONFIG_START(msx_slot_fs4600_device::device_add_mconfig)
MACHINE_CONFIG_END
-void msx_slot_fs4600_device::set_rom_start(device_t &device, const char *region, uint32_t offset)
-{
- msx_slot_fs4600_device &dev = downcast<msx_slot_fs4600_device &>(device);
-
- dev.m_rom_region.set_tag(region);
- dev.m_region_offset = offset;
-}
-
-
void msx_slot_fs4600_device::device_start()
{
// Sanity checks
diff --git a/src/devices/bus/msx_slot/fs4600.h b/src/devices/bus/msx_slot/fs4600.h
index 59238d786bb..b342b07f3fb 100644
--- a/src/devices/bus/msx_slot/fs4600.h
+++ b/src/devices/bus/msx_slot/fs4600.h
@@ -14,15 +14,15 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_FS4600, msx_slot_fs4600_device)
#define MCFG_MSX_SLOT_FS4600_ADD(_tag, _startpage, _numpages, _region, _offset) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_FS4600, _startpage, _numpages) \
- msx_slot_fs4600_device::set_rom_start(*device, "^" _region, _offset);
+ downcast<msx_slot_fs4600_device &>(*device).set_rom_start("^" _region, _offset);
class msx_slot_fs4600_device : public device_t, public msx_internal_slot_interface
{
public:
msx_slot_fs4600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_rom_start(device_t &device, const char *region, uint32_t offset);
+ // configuration helpers
+ void set_rom_start(const char *region, uint32_t offset) { m_rom_region.set_tag(region); m_region_offset = offset; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/msx_slot/music.h b/src/devices/bus/msx_slot/music.h
index c7e2a7bafb9..3e8b54686c9 100644
--- a/src/devices/bus/msx_slot/music.h
+++ b/src/devices/bus/msx_slot/music.h
@@ -15,16 +15,16 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_MUSIC, msx_slot_music_device)
#define MCFG_MSX_SLOT_MUSIC_ADD(_tag, _startpage, _numpages, _region, _offset, _ym2413_tag) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_MUSIC, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset); \
- msx_slot_music_device::set_ym2413_tag(*device, _ym2413_tag);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset); \
+ downcast<msx_slot_music_device &>(*device).set_ym2413_tag(_ym2413_tag);
class msx_slot_music_device : public msx_slot_rom_device
{
public:
msx_slot_music_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_ym2413_tag(device_t &device, const char *tag) { dynamic_cast<msx_slot_music_device &>(device).m_ym2413_tag = tag; }
+ // configuration helpers
+ void set_ym2413_tag(const char *tag) { m_ym2413_tag = tag; }
virtual DECLARE_READ8_MEMBER(read) override;
diff --git a/src/devices/bus/msx_slot/panasonic08.cpp b/src/devices/bus/msx_slot/panasonic08.cpp
index d16071a08ec..04630982531 100644
--- a/src/devices/bus/msx_slot/panasonic08.cpp
+++ b/src/devices/bus/msx_slot/panasonic08.cpp
@@ -38,15 +38,6 @@ MACHINE_CONFIG_START(msx_slot_panasonic08_device::device_add_mconfig)
MACHINE_CONFIG_END
-void msx_slot_panasonic08_device::set_rom_start(device_t &device, const char *region, uint32_t offset)
-{
- msx_slot_panasonic08_device &dev = downcast<msx_slot_panasonic08_device &>(device);
-
- dev.m_rom_region.set_tag(region);
- dev.m_region_offset = offset;
-}
-
-
void msx_slot_panasonic08_device::device_start()
{
// Sanity checks
diff --git a/src/devices/bus/msx_slot/panasonic08.h b/src/devices/bus/msx_slot/panasonic08.h
index 74e6b3f5575..7b4f62429f5 100644
--- a/src/devices/bus/msx_slot/panasonic08.h
+++ b/src/devices/bus/msx_slot/panasonic08.h
@@ -14,15 +14,15 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_PANASONIC08, msx_slot_panasonic08_device)
#define MCFG_MSX_SLOT_PANASONIC08_ADD(_tag, _startpage, _numpages, _region, _offset) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_PANASONIC08, _startpage, _numpages) \
- msx_slot_panasonic08_device::set_rom_start(*device, "^" _region, _offset);
+ downcast<msx_slot_panasonic08_device &>(*device).set_rom_start("^" _region, _offset);
class msx_slot_panasonic08_device : public device_t, public msx_internal_slot_interface
{
public:
msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_rom_start(device_t &device, const char *region, uint32_t offset);
+ // configuration helpers
+ void set_rom_start(const char *region, uint32_t offset) { m_rom_region.set_tag(region); m_region_offset = offset; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/msx_slot/ram.h b/src/devices/bus/msx_slot/ram.h
index 6b6ea760e8f..17bff978148 100644
--- a/src/devices/bus/msx_slot/ram.h
+++ b/src/devices/bus/msx_slot/ram.h
@@ -9,7 +9,7 @@
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_RAM, _startpage, _numpages)
#define MCFG_MSX_SLOT_RAM_8KB \
- msx_slot_ram_device::force_start_address(*device, 0xe000);
+ downcast<msx_slot_ram_device &>(*device).force_start_address(0xe000);
class msx_slot_ram_device : public device_t,
@@ -18,7 +18,7 @@ class msx_slot_ram_device : public device_t,
public:
msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void force_start_address(device_t &device, uint16_t start) { downcast<msx_slot_ram_device &>(device).m_start_address = start; }
+ void force_start_address(uint16_t start) { m_start_address = start; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/msx_slot/ram_mm.h b/src/devices/bus/msx_slot/ram_mm.h
index 584fc064897..87837909b2d 100644
--- a/src/devices/bus/msx_slot/ram_mm.h
+++ b/src/devices/bus/msx_slot/ram_mm.h
@@ -7,18 +7,18 @@
#define MCFG_MSX_SLOT_RAM_MM_ADD(_tag, _total_size) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_RAM_MM, 0, 4) \
- msx_slot_ram_mm_device::set_total_size(*device, _total_size);
+ downcast<msx_slot_ram_mm_device &>(*device).set_total_size(_total_size);
#define MCFG_MSX_SLOT_RAMM_SET_RAMIO_BITS(_ramio_set_bits) \
- msx_slot_ram_mm_device::set_ramio_set_bits(*device, _ramio_set_bits);
+ downcast<msx_slot_ram_mm_device &>(*device).set_ramio_set_bits(_ramio_set_bits);
class msx_slot_ram_mm_device : public device_t, public msx_internal_slot_interface
{
public:
msx_slot_ram_mm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_total_size(device_t &device, uint32_t total_size) { dynamic_cast<msx_slot_ram_mm_device &>(device).m_total_size = total_size; }
- static void set_ramio_set_bits(device_t &device, uint8_t ramio_set_bits) { dynamic_cast<msx_slot_ram_mm_device &>(device).m_ramio_set_bits = ramio_set_bits; }
+ void set_total_size(uint32_t total_size) { m_total_size = total_size; }
+ void set_ramio_set_bits(uint8_t ramio_set_bits) { m_ramio_set_bits = ramio_set_bits; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/msx_slot/rom.cpp b/src/devices/bus/msx_slot/rom.cpp
index 05805412762..6e80b9551d1 100644
--- a/src/devices/bus/msx_slot/rom.cpp
+++ b/src/devices/bus/msx_slot/rom.cpp
@@ -23,15 +23,6 @@ msx_slot_rom_device::msx_slot_rom_device(const machine_config &mconfig, device_t
}
-void msx_slot_rom_device::set_rom_start(device_t &device, const char *region, uint32_t offset)
-{
- msx_slot_rom_device &dev = downcast<msx_slot_rom_device &>(device);
-
- dev.m_rom_region.set_tag(region);
- dev.m_region_offset = offset;
-}
-
-
void msx_slot_rom_device::device_start()
{
// Sanity checks
diff --git a/src/devices/bus/msx_slot/rom.h b/src/devices/bus/msx_slot/rom.h
index 19081d8d76b..d433cef2c7a 100644
--- a/src/devices/bus/msx_slot/rom.h
+++ b/src/devices/bus/msx_slot/rom.h
@@ -9,7 +9,7 @@
#define MCFG_MSX_SLOT_ROM_ADD(_tag, _startpage, _numpages, _region, _offset) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_ROM, _startpage, _numpages) \
- msx_slot_rom_device::set_rom_start(*device, "^" _region, _offset);
+ downcast<msx_slot_rom_device &>(*device).set_rom_start("^" _region, _offset);
class msx_slot_rom_device : public device_t,
public msx_internal_slot_interface
@@ -17,8 +17,8 @@ class msx_slot_rom_device : public device_t,
public:
msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_rom_start(device_t &device, const char *region, uint32_t offset);
+ // configuration helpers
+ void set_rom_start(const char *region, uint32_t offset) { m_rom_region.set_tag(region); m_region_offset = offset; }
virtual DECLARE_READ8_MEMBER(read) override;
diff --git a/src/devices/bus/msx_slot/slot.cpp b/src/devices/bus/msx_slot/slot.cpp
index 165edba37e0..3b826c87fa2 100644
--- a/src/devices/bus/msx_slot/slot.cpp
+++ b/src/devices/bus/msx_slot/slot.cpp
@@ -19,18 +19,3 @@ msx_internal_slot_interface::msx_internal_slot_interface()
, m_end_address(0)
{
}
-
-void msx_internal_slot_interface::set_start_address(device_t &device, uint32_t start_address)
-{
- msx_internal_slot_interface &dev = dynamic_cast<msx_internal_slot_interface &>(device);
- dev.m_start_address = start_address;
- dev.m_end_address = dev.m_start_address + dev.m_size;
-}
-
-void msx_internal_slot_interface::set_size(device_t &device, uint32_t size)
-{
- msx_internal_slot_interface &dev = dynamic_cast<msx_internal_slot_interface &>(device);
-
- dev.m_size = size;
- dev.m_end_address = dev.m_start_address + dev.m_size;
-}
diff --git a/src/devices/bus/msx_slot/slot.h b/src/devices/bus/msx_slot/slot.h
index 6a2c7f093d9..ad51f0c4f9d 100644
--- a/src/devices/bus/msx_slot/slot.h
+++ b/src/devices/bus/msx_slot/slot.h
@@ -17,8 +17,8 @@ pages; and multiple pieces of rom/ram/components can occur in a single slot.
#define MCFG_MSX_INTERNAL_SLOT_ADD(_tag, _type, _startpage, _numpages) \
MCFG_DEVICE_ADD(_tag, _type, 0) \
- msx_internal_slot_interface::set_start_address(*device, _startpage * 0x4000); \
- msx_internal_slot_interface::set_size(*device, _numpages * 0x4000);
+ dynamic_cast<msx_internal_slot_interface &>(*device).set_start_address(_startpage * 0x4000); \
+ dynamic_cast<msx_internal_slot_interface &>(*device).set_size(_numpages * 0x4000);
class msx_internal_slot_interface
{
@@ -26,9 +26,9 @@ public:
msx_internal_slot_interface();
virtual ~msx_internal_slot_interface() { }
- // static configuration helpers
- static void set_start_address(device_t &device, uint32_t start_address);
- static void set_size(device_t &device, uint32_t size);
+ // configuration helpers
+ void set_start_address(uint32_t start_address) { m_start_address = start_address; m_end_address = m_start_address + m_size; }
+ void set_size(uint32_t size) { m_size = size; m_end_address = m_start_address + m_size; }
virtual DECLARE_READ8_MEMBER(read) { return 0xFF; }
virtual DECLARE_WRITE8_MEMBER(write) { }
diff --git a/src/devices/bus/msx_slot/sony08.cpp b/src/devices/bus/msx_slot/sony08.cpp
index 27ce312bab5..825b74bec6c 100644
--- a/src/devices/bus/msx_slot/sony08.cpp
+++ b/src/devices/bus/msx_slot/sony08.cpp
@@ -35,15 +35,6 @@ MACHINE_CONFIG_START(msx_slot_sony08_device::device_add_mconfig)
MACHINE_CONFIG_END
-void msx_slot_sony08_device::set_rom_start(device_t &device, const char *region, uint32_t offset)
-{
- msx_slot_sony08_device &dev = downcast<msx_slot_sony08_device &>(device);
-
- dev.m_rom_region.set_tag(region);
- dev.m_region_offset = offset;
-}
-
-
void msx_slot_sony08_device::device_start()
{
// Sanity checks
diff --git a/src/devices/bus/msx_slot/sony08.h b/src/devices/bus/msx_slot/sony08.h
index ce34b09b842..383c9b9d3a0 100644
--- a/src/devices/bus/msx_slot/sony08.h
+++ b/src/devices/bus/msx_slot/sony08.h
@@ -14,7 +14,7 @@ extern const device_type MSX_SLOT_SONY08;
#define MCFG_MSX_SLOT_SONY08_ADD(_tag, _startpage, _numpages, _region, _offset) \
MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_SONY08, _startpage, _numpages) \
- msx_slot_sony08_device::set_rom_start(*device, "^" _region, _offset);
+ downcast<msx_slot_sony08_device &>(*device).set_rom_start("^" _region, _offset);
class msx_slot_sony08_device : public device_t,
public msx_internal_slot_interface
@@ -22,8 +22,8 @@ class msx_slot_sony08_device : public device_t,
public:
msx_slot_sony08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- static void set_rom_start(device_t &device, const char *region, uint32_t offset);
+ // configuration helpers
+ void set_rom_start(const char *region, uint32_t offset) { m_rom_region.set_tag(region); m_region_offset = offset; }
virtual DECLARE_READ8_MEMBER(read) override;
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/bus/nasbus/nasbus.cpp b/src/devices/bus/nasbus/nasbus.cpp
index dafe56f68ac..585b1043c07 100644
--- a/src/devices/bus/nasbus/nasbus.cpp
+++ b/src/devices/bus/nasbus/nasbus.cpp
@@ -34,13 +34,6 @@ nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, device_typ
{
}
-void nasbus_slot_device::set_nasbus_slot(device_t &device, device_t *owner, const char *nasbus_tag)
-{
- nasbus_slot_device &nasbus_card = dynamic_cast<nasbus_slot_device &>(device);
- nasbus_card.m_owner = owner;
- nasbus_card.m_nasbus_tag = nasbus_tag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/nasbus/nasbus.h b/src/devices/bus/nasbus/nasbus.h
index 3b553cd66e8..477a737e7f9 100644
--- a/src/devices/bus/nasbus/nasbus.h
+++ b/src/devices/bus/nasbus/nasbus.h
@@ -111,10 +111,10 @@
#define MCFG_NASBUS_SLOT_ADD(_tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, NASBUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- nasbus_slot_device::set_nasbus_slot(*device, this, NASBUS_TAG);
+ downcast<nasbus_slot_device &>(*device).set_nasbus_slot(this, NASBUS_TAG);
#define MCFG_NASBUS_RAM_DISABLE_HANDLER(_devcb) \
- devcb = &nasbus_device::set_ram_disable_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<nasbus_device &>(*device).set_ram_disable_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -132,7 +132,7 @@ public:
// construction/destruction
nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void set_nasbus_slot(device_t &device, device_t *owner, const char *nasbus_tag);
+ void set_nasbus_slot(device_t *owner, const char *nasbus_tag) { m_owner = owner; m_nasbus_tag = nasbus_tag; }
protected:
nasbus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -157,8 +157,7 @@ public:
nasbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nasbus_device();
- template <class Object> static devcb_base &set_ram_disable_handler(device_t &device, Object &&cb)
- { return downcast<nasbus_device &>(device).m_ram_disable_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ram_disable_handler(Object &&cb) { return m_ram_disable_handler.set_callback(std::forward<Object>(cb)); }
void add_card(device_nasbus_card_interface *card);
diff --git a/src/devices/bus/nes_ctrl/ctrl.h b/src/devices/bus/nes_ctrl/ctrl.h
index 5b59ebb5f33..a0ca47d4d36 100644
--- a/src/devices/bus/nes_ctrl/ctrl.h
+++ b/src/devices/bus/nes_ctrl/ctrl.h
@@ -56,7 +56,7 @@ public:
nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_control_port_device();
- static void set_brightpixel_callback(device_t &device, nesctrl_brightpixel_delegate callback) { downcast<nes_control_port_device &>(device).m_brightpixel_cb = callback; }
+ template <typename Object> void set_brightpixel_callback(Object &&cb) { m_brightpixel_cb = std::forward<Object>(cb); }
uint8_t read_bit0();
uint8_t read_bit34();
@@ -90,7 +90,7 @@ DECLARE_DEVICE_TYPE(NES_CONTROL_PORT, nes_control_port_device)
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_NESCTRL_BRIGHTPIXEL_CB(_class, _method) \
- nes_control_port_device::set_brightpixel_callback(*device, nesctrl_brightpixel_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<nes_control_port_device &>(*device).set_brightpixel_callback(nesctrl_brightpixel_delegate(&_class::_method, #_class "::" #_method, this));
SLOT_INTERFACE_EXTERN( nes_control_port1_devices );
diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp
index c4934cda302..5eee5ad79a5 100644
--- a/src/devices/bus/nubus/nubus.cpp
+++ b/src/devices/bus/nubus/nubus.cpp
@@ -38,13 +38,6 @@ nubus_slot_device::nubus_slot_device(const machine_config &mconfig, device_type
{
}
-void nubus_slot_device::static_set_nubus_slot(device_t &device, const char *tag, const char *slottag)
-{
- nubus_slot_device &nubus_card = dynamic_cast<nubus_slot_device &>(device);
- nubus_card.m_nubus_tag = tag;
- nubus_card.m_nubus_slottag = slottag;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -53,7 +46,7 @@ void nubus_slot_device::device_start()
{
device_nubus_card_interface *dev = dynamic_cast<device_nubus_card_interface *>(get_card_device());
- if (dev) device_nubus_card_interface::static_set_nubus_tag(*dev, m_nubus_tag, m_nubus_slottag);
+ if (dev) dev->set_nubus_tag(m_nubus_tag, m_nubus_slottag);
}
//**************************************************************************
@@ -62,12 +55,6 @@ void nubus_slot_device::device_start()
DEFINE_DEVICE_TYPE(NUBUS, nubus_device, "nubus", "NuBus")
-void nubus_device::static_set_cputag(device_t &device, const char *tag)
-{
- nubus_device &nubus = downcast<nubus_device &>(device);
- nubus.m_cputag = tag;
-}
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -266,13 +253,6 @@ device_nubus_card_interface::~device_nubus_card_interface()
{
}
-void device_nubus_card_interface::static_set_nubus_tag(device_t &device, const char *tag, const char *slottag)
-{
- device_nubus_card_interface &nubus_card = dynamic_cast<device_nubus_card_interface &>(device);
- nubus_card.m_nubus_tag = tag;
- nubus_card.m_nubus_slottag = slottag;
-}
-
void device_nubus_card_interface::interface_pre_start()
{
if (!m_nubus)
diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h
index 2f7fc5c359a..011a87a861d 100644
--- a/src/devices/bus/nubus/nubus.h
+++ b/src/devices/bus/nubus/nubus.h
@@ -20,37 +20,37 @@
//**************************************************************************
#define MCFG_NUBUS_CPU(_cputag) \
- nubus_device::static_set_cputag(*device, _cputag);
+ downcast<nubus_device &>(*device).set_cputag(_cputag);
#define MCFG_NUBUS_OUT_IRQ9_CB(_devcb) \
- devcb = &nubus_device::set_out_irq9_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irq9_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_OUT_IRQA_CB(_devcb) \
- devcb = &nubus_device::set_out_irqa_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irqa_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_OUT_IRQB_CB(_devcb) \
- devcb = &nubus_device::set_out_irqb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irqb_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_OUT_IRQC_CB(_devcb) \
- devcb = &nubus_device::set_out_irqc_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irqc_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_OUT_IRQD_CB(_devcb) \
- devcb = &nubus_device::set_out_irqd_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irqd_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_OUT_IRQE_CB(_devcb) \
- devcb = &nubus_device::set_out_irqe_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<nubus_device &>(*device).set_out_irqe_callback(DEVCB_##_devcb);
#define MCFG_NUBUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, NUBUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- nubus_slot_device::static_set_nubus_slot(*device, _nbtag, _tag);
+ downcast<nubus_slot_device &>(*device).set_nubus_slot(_nbtag, _tag);
#define MCFG_NUBUS_SLOT_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_NUBUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
- device_nubus_card_interface::static_set_nubus_tag(*device, _nbtag, _tag);
+ downcast<device_nubus_card_interface &>(*device).set_nubus_tag(_nbtag, _tag);
//**************************************************************************
// TYPE DEFINITIONS
@@ -65,7 +65,7 @@ public:
nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_nubus_slot(device_t &device, const char *tag, const char *slottag);
+ void set_nubus_slot(const char *tag, const char *slottag) { m_nubus_tag = tag; m_nubus_slottag = slottag; }
protected:
nubus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -90,13 +90,13 @@ public:
~nubus_device() { m_device_list.detach_all(); }
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- template <class Object> static devcb_base &set_out_irq9_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irq9_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irqa_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irqa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irqb_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irqb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irqc_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irqc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irqd_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irqd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irqe_callback(device_t &device, Object &&cb) { return downcast<nubus_device &>(device).m_out_irqe_cb.set_callback(std::forward<Object>(cb)); }
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ template <class Object> devcb_base &set_out_irq9_callback(Object &&cb) { return m_out_irq9_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irqa_callback(Object &&cb) { return m_out_irqa_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irqb_callback(Object &&cb) { return m_out_irqb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irqc_callback(Object &&cb) { return m_out_irqc_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irqd_callback(Object &&cb) { return m_out_irqd_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irqe_callback(Object &&cb) { return m_out_irqe_cb.set_callback(std::forward<Object>(cb)); }
void add_nubus_card(device_nubus_card_interface *card);
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff);
@@ -165,7 +165,7 @@ public:
void lower_slot_irq() { nubus().set_irq_line(m_slot, CLEAR_LINE); }
// inline configuration
- static void static_set_nubus_tag(device_t &device, const char *tag, const char *slottag);
+ void set_nubus_tag(const char *tag, const char *slottag) { m_nubus_tag = tag; m_nubus_slottag = slottag; }
protected:
device_nubus_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp
index de2d52fb420..a3696a376ea 100644
--- a/src/devices/bus/nubus/nubus_48gc.cpp
+++ b/src/devices/bus/nubus/nubus_48gc.cpp
@@ -79,7 +79,7 @@ jmfb_device::jmfb_device(const machine_config &mconfig, device_type type, const
m_is824(is824),
m_assembled_tag(util::string_format("%s:%s", tag, GC48_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
diff --git a/src/devices/bus/nubus/nubus_m2hires.cpp b/src/devices/bus/nubus/nubus_m2hires.cpp
index b267ec4ef27..f7830f2f47a 100644
--- a/src/devices/bus/nubus/nubus_m2hires.cpp
+++ b/src/devices/bus/nubus/nubus_m2hires.cpp
@@ -73,7 +73,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, M2HIRES_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/nubus_m2video.cpp b/src/devices/bus/nubus/nubus_m2video.cpp
index 2a1b820cee1..45fa1e8d129 100644
--- a/src/devices/bus/nubus/nubus_m2video.cpp
+++ b/src/devices/bus/nubus/nubus_m2video.cpp
@@ -75,7 +75,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, M2VIDEO_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/nubus_radiustpd.cpp b/src/devices/bus/nubus/nubus_radiustpd.cpp
index 9b6749f92b2..32e66083ae7 100644
--- a/src/devices/bus/nubus/nubus_radiustpd.cpp
+++ b/src/devices/bus/nubus/nubus_radiustpd.cpp
@@ -76,7 +76,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, RADIUSTPD_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/nubus_spec8.cpp b/src/devices/bus/nubus/nubus_spec8.cpp
index 215ad07a1ab..82d7553bc68 100644
--- a/src/devices/bus/nubus/nubus_spec8.cpp
+++ b/src/devices/bus/nubus/nubus_spec8.cpp
@@ -78,7 +78,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device
m_assembled_tag(util::string_format("%s:%s", tag, SPEC8S3_SCREEN_NAME)),
m_vbl_pending(false), m_parameter(0)
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp
index 30012d26e64..9eda2555e87 100644
--- a/src/devices/bus/nubus/nubus_specpdq.cpp
+++ b/src/devices/bus/nubus/nubus_specpdq.cpp
@@ -92,7 +92,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device
m_width(0), m_height(0), m_patofsx(0), m_patofsy(0), m_vram_addr(0), m_vram_src(0),
m_palette(*this, "palette")
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/nubus_wsportrait.cpp b/src/devices/bus/nubus/nubus_wsportrait.cpp
index 095c7aa781e..a88c1cbdb9a 100644
--- a/src/devices/bus/nubus/nubus_wsportrait.cpp
+++ b/src/devices/bus/nubus/nubus_wsportrait.cpp
@@ -76,7 +76,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig,
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, WSPORTRAIT_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/pds30_30hr.cpp b/src/devices/bus/nubus/pds30_30hr.cpp
index b6ae942efb9..4efd30712ef 100644
--- a/src/devices/bus/nubus/pds30_30hr.cpp
+++ b/src/devices/bus/nubus/pds30_30hr.cpp
@@ -76,7 +76,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, XCEED30HR_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp
index 7741308dd6b..37846d2f1eb 100644
--- a/src/devices/bus/nubus/pds30_cb264.cpp
+++ b/src/devices/bus/nubus/pds30_cb264.cpp
@@ -70,7 +70,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, CB264SE30_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp
index 1456c88770a..5c6fa193bf6 100644
--- a/src/devices/bus/nubus/pds30_mc30.cpp
+++ b/src/devices/bus/nubus/pds30_mc30.cpp
@@ -72,7 +72,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, de
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, XCEEDMC30_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp
index d0d73a81a7e..81417b33f44 100644
--- a/src/devices/bus/nubus/pds30_procolor816.cpp
+++ b/src/devices/bus/nubus/pds30_procolor816.cpp
@@ -75,7 +75,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig
m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr),
m_assembled_tag(util::string_format("%s:%s", tag, PROCOLOR816_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp
index 0d1daef83ea..1fcbb1ec3aa 100644
--- a/src/devices/bus/nubus/pds30_sigmalview.cpp
+++ b/src/devices/bus/nubus/pds30_sigmalview.cpp
@@ -70,7 +70,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_typ
m_vram32(nullptr), m_vbl_disable(0), m_toggle(0), m_timer(nullptr), m_protstate(0),
m_assembled_tag(util::string_format("%s:%s", tag, LVIEW_SCREEN_NAME))
{
- static_set_screen(*this, m_assembled_tag.c_str());
+ set_screen(m_assembled_tag.c_str());
}
//-------------------------------------------------
diff --git a/src/devices/bus/oricext/oricext.h b/src/devices/bus/oricext/oricext.h
index 6dc84ed2599..e914ceeefb7 100644
--- a/src/devices/bus/oricext/oricext.h
+++ b/src/devices/bus/oricext/oricext.h
@@ -17,7 +17,7 @@
MCFG_DEVICE_ADD(_tag, ORICEXT_CONNECTOR, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
downcast<oricext_connector *>(device)->set_cputag(_cputag); \
- devcb = &oricext_connector::set_irq_handler(*device, DEVCB_##_irq);
+ devcb = &downcast<oricext_connector &>(*device).set_irq_handler(DEVCB_##_irq);
class oricext_device;
@@ -29,7 +29,7 @@ public:
virtual ~oricext_connector();
void set_cputag(const char *tag);
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<oricext_connector &>(device).irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return irq_handler.set_callback(std::forward<Object>(cb)); }
void irq_w(int state);
protected:
diff --git a/src/devices/bus/pc1512/mouse.h b/src/devices/bus/pc1512/mouse.h
index f94984ab979..36cf22ce9bd 100644
--- a/src/devices/bus/pc1512/mouse.h
+++ b/src/devices/bus/pc1512/mouse.h
@@ -37,16 +37,16 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_PC1512_MOUSE_PORT_X_CB(_write) \
- devcb = &pc1512_mouse_port_device::set_x_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<pc1512_mouse_port_device &>(*device).set_x_wr_callback(DEVCB_##_write);
#define MCFG_PC1512_MOUSE_PORT_Y_CB(_write) \
- devcb = &pc1512_mouse_port_device::set_y_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<pc1512_mouse_port_device &>(*device).set_y_wr_callback(DEVCB_##_write);
#define MCFG_PC1512_MOUSE_PORT_M1_CB(_write) \
- devcb = &pc1512_mouse_port_device::set_m1_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<pc1512_mouse_port_device &>(*device).set_m1_wr_callback(DEVCB_##_write);
#define MCFG_PC1512_MOUSE_PORT_M2_CB(_write) \
- devcb = &pc1512_mouse_port_device::set_m2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<pc1512_mouse_port_device &>(*device).set_m2_wr_callback(DEVCB_##_write);
@@ -81,10 +81,10 @@ public:
pc1512_mouse_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- template <class Object> static devcb_base &set_x_wr_callback(device_t &device, Object &&cb) { return downcast<pc1512_mouse_port_device &>(device).m_write_x.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_y_wr_callback(device_t &device, Object &&cb) { return downcast<pc1512_mouse_port_device &>(device).m_write_y.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_m1_wr_callback(device_t &device, Object &&cb) { return downcast<pc1512_mouse_port_device &>(device).m_write_m1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_m2_wr_callback(device_t &device, Object &&cb) { return downcast<pc1512_mouse_port_device &>(device).m_write_m2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_x_wr_callback(Object &&cb) { return m_write_x.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_y_wr_callback(Object &&cb) { return m_write_y.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_m1_wr_callback(Object &&cb) { return m_write_m1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_m2_wr_callback(Object &&cb) { return m_write_m2.set_callback(std::forward<Object>(cb)); }
// peripheral interface
void x_w(uint8_t data) { m_write_x(data); }
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp
index 7fc1ed0419a..9bd50c1ea5f 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.cpp
+++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp
@@ -38,12 +38,6 @@ pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const ch
}
-void pc_kbdc_slot_device::static_set_pc_kbdc_slot(device_t &device, device_t *kbdc_device)
-{
- pc_kbdc_slot_device &pc_kbdc = dynamic_cast<pc_kbdc_slot_device &>(device);
- pc_kbdc.m_kbdc_device = kbdc_device;
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -54,7 +48,7 @@ void pc_kbdc_slot_device::device_start()
if (pc_kbd)
{
- device_pc_kbd_interface::static_set_pc_kbdc( *pc_kbd, m_kbdc_device );
+ pc_kbd->set_pc_kbdc(m_kbdc_device);
}
}
@@ -219,13 +213,6 @@ WRITE_LINE_MEMBER( device_pc_kbd_interface::data_write )
}
-void device_pc_kbd_interface::static_set_pc_kbdc(device_t &device, device_t *kbdc_device)
-{
- device_pc_kbd_interface &pc_kbd = dynamic_cast<device_pc_kbd_interface &>(device);
- pc_kbd.m_pc_kbdc = dynamic_cast<pc_kbdc_device *>(kbdc_device);
-}
-
-
void device_pc_kbd_interface::set_pc_kbdc_device()
{
if ( m_pc_kbdc )
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.h b/src/devices/bus/pc_kbd/pc_kbdc.h
index f6de3d3a86e..75a17da2d19 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.h
+++ b/src/devices/bus/pc_kbd/pc_kbdc.h
@@ -21,15 +21,15 @@ set the data line and then set the clock line.
//**************************************************************************
#define MCFG_PC_KBDC_OUT_CLOCK_CB(_devcb) \
- devcb = &pc_kbdc_device::set_out_clock_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<pc_kbdc_device &>(*device).set_out_clock_callback(DEVCB_##_devcb);
#define MCFG_PC_KBDC_OUT_DATA_CB(_devcb) \
- devcb = &pc_kbdc_device::set_out_data_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<pc_kbdc_device &>(*device).set_out_data_callback(DEVCB_##_devcb);
#define MCFG_PC_KBDC_SLOT_ADD(_kbdc_tag, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, PC_KBDC_SLOT, 0 ) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- pc_kbdc_slot_device::static_set_pc_kbdc_slot(*device, subdevice(_kbdc_tag) );
+ downcast<pc_kbdc_slot_device &>(*device).set_pc_kbdc_slot(subdevice(_kbdc_tag) );
//**************************************************************************
// TYPE DEFINITIONS
@@ -47,7 +47,7 @@ public:
virtual void device_start() override;
// inline configuration
- static void static_set_pc_kbdc_slot(device_t &device, device_t *kbdc_device);
+ void set_pc_kbdc_slot(device_t *kbdc_device) { m_kbdc_device = kbdc_device; }
protected:
// configuration
@@ -67,8 +67,8 @@ public:
// construction/destruction
pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_out_clock_callback(device_t &device, Object &&cb) { return downcast<pc_kbdc_device &>(device).m_out_clock_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_data_callback(device_t &device, Object &&cb) { return downcast<pc_kbdc_device &>(device).m_out_data_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_clock_callback(Object &&cb) { return m_out_clock_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_data_callback(Object &&cb) { return m_out_data_cb.set_callback(std::forward<Object>(cb)); }
void set_keyboard(device_pc_kbd_interface *keyboard);
@@ -129,7 +129,7 @@ public:
virtual DECLARE_WRITE_LINE_MEMBER( data_write );
// inline configuration
- static void static_set_pc_kbdc(device_t &device, device_t *kbdc_device);
+ void set_pc_kbdc(device_t *kbdc_device) { m_pc_kbdc = dynamic_cast<pc_kbdc_device *>(kbdc_device); }
protected:
pc_kbdc_device *m_pc_kbdc;
diff --git a/src/devices/bus/pet/cass.h b/src/devices/bus/pet/cass.h
index d5c40c37181..c906f83754b 100644
--- a/src/devices/bus/pet/cass.h
+++ b/src/devices/bus/pet/cass.h
@@ -39,7 +39,7 @@
#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _slot_intf, _def_slot, _devcb) \
MCFG_DEVICE_ADD(_tag, PET_DATASSETTE_PORT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- devcb = &pet_datassette_port_device::set_read_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_datassette_port_device &>(*device).set_read_handler(DEVCB_##_devcb);
@@ -59,7 +59,7 @@ public:
virtual ~pet_datassette_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_read_handler(device_t &device, Object &&cb) { return downcast<pet_datassette_port_device &>(device).m_read_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_handler(Object &&cb) { return m_read_handler.set_callback(std::forward<Object>(cb)); }
// computer interface
DECLARE_READ_LINE_MEMBER( read );
diff --git a/src/devices/bus/pet/user.h b/src/devices/bus/pet/user.h
index 52568776882..04034c492e0 100644
--- a/src/devices/bus/pet/user.h
+++ b/src/devices/bus/pet/user.h
@@ -33,61 +33,61 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_PET_USER_PORT_2_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_2_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_3_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_3_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_3_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_4_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_4_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_4_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_5_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_5_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_5_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_6_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_6_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_6_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_7_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_7_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_7_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_8_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_8_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_8_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_9_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_9_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_9_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_10_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_10_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_10_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_B_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_b_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_b_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_C_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_c_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_c_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_D_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_d_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_d_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_E_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_e_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_e_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_F_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_f_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_f_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_H_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_h_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_h_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_J_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_j_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_j_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_K_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_k_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_k_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_L_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_l_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_l_handler(DEVCB_##_devcb);
#define MCFG_PET_USER_PORT_M_HANDLER(_devcb) \
- devcb = &pet_user_port_device::set_m_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<pet_user_port_device &>(*device).set_m_handler(DEVCB_##_devcb);
DECLARE_DEVICE_TYPE(PET_USER_PORT, pet_user_port_device)
@@ -102,25 +102,25 @@ class pet_user_port_device : public device_t,
public:
pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_2_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_3_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_3_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_4_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_4_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_5_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_5_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_6_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_6_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_7_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_7_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_8_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_8_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_9_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_9_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_10_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_10_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_b_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_b_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_c_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_c_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_d_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_d_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_e_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_e_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_f_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_f_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_h_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_h_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_j_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_j_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_k_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_k_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_l_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_l_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_m_handler(device_t &device, Object &&cb) { return downcast<pet_user_port_device &>(device).m_m_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_2_handler(Object &&cb) { return m_2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_3_handler(Object &&cb) { return m_3_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_4_handler(Object &&cb) { return m_4_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_5_handler(Object &&cb) { return m_5_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_6_handler(Object &&cb) { return m_6_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_7_handler(Object &&cb) { return m_7_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_8_handler(Object &&cb) { return m_8_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_9_handler(Object &&cb) { return m_9_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_10_handler(Object &&cb) { return m_10_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_b_handler(Object &&cb) { return m_b_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_c_handler(Object &&cb) { return m_c_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_d_handler(Object &&cb) { return m_d_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_e_handler(Object &&cb) { return m_e_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_f_handler(Object &&cb) { return m_f_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_h_handler(Object &&cb) { return m_h_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_j_handler(Object &&cb) { return m_j_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_k_handler(Object &&cb) { return m_k_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_l_handler(Object &&cb) { return m_l_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_m_handler(Object &&cb) { return m_m_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_2 );
DECLARE_WRITE_LINE_MEMBER( write_3 );
diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h
index 20cf09c65ad..4a4d583dd5b 100644
--- a/src/devices/bus/plus4/exp.h
+++ b/src/devices/bus/plus4/exp.h
@@ -67,16 +67,16 @@
#define MCFG_PLUS4_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &plus4_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<plus4_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_PLUS4_EXPANSION_SLOT_CD_INPUT_CALLBACK(_read) \
- devcb = &plus4_expansion_slot_device::set_cd_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<plus4_expansion_slot_device &>(*device).set_cd_rd_callback(DEVCB_##_read);
#define MCFG_PLUS4_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(_write) \
- devcb = &plus4_expansion_slot_device::set_cd_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<plus4_expansion_slot_device &>(*device).set_cd_wr_callback(DEVCB_##_write);
#define MCFG_PLUS4_EXPANSION_SLOT_AEC_CALLBACK(_write) \
- devcb = &plus4_expansion_slot_device::set_aec_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<plus4_expansion_slot_device &>(*device).set_aec_wr_callback(DEVCB_##_write);
@@ -96,10 +96,10 @@ public:
// construction/destruction
plus4_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<plus4_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cd_rd_callback(device_t &device, Object &&cb) { return downcast<plus4_expansion_slot_device &>(device).m_read_dma_cd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cd_wr_callback(device_t &device, Object &&cb) { return downcast<plus4_expansion_slot_device &>(device).m_write_dma_cd.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_aec_wr_callback(device_t &device, Object &&cb) { return downcast<plus4_expansion_slot_device &>(device).m_write_aec.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cd_rd_callback(Object &&cb) { return m_read_dma_cd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cd_wr_callback(Object &&cb) { return m_write_dma_cd.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_aec_wr_callback(Object &&cb) { return m_write_aec.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h
index 2adcddb16f3..fadf724b68f 100644
--- a/src/devices/bus/pofo/exp.h
+++ b/src/devices/bus/pofo/exp.h
@@ -64,13 +64,13 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(_write) \
- devcb = &portfolio_expansion_slot_device::set_eint_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<portfolio_expansion_slot_device &>(*device).set_eint_wr_callback(DEVCB_##_write);
#define MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(_write) \
- devcb = &portfolio_expansion_slot_device::set_nmio_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<portfolio_expansion_slot_device &>(*device).set_nmio_wr_callback(DEVCB_##_write);
#define MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK(_write) \
- devcb = &portfolio_expansion_slot_device::set_wake_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<portfolio_expansion_slot_device &>(*device).set_wake_wr_callback(DEVCB_##_write);
@@ -117,9 +117,9 @@ public:
// construction/destruction
portfolio_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_eint_wr_callback(device_t &device, Object &&cb) { return downcast<portfolio_expansion_slot_device &>(device).m_write_eint.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmio_wr_callback(device_t &device, Object &&cb) { return downcast<portfolio_expansion_slot_device &>(device).m_write_nmio.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_wake_wr_callback(device_t &device, Object &&cb) { return downcast<portfolio_expansion_slot_device &>(device).m_write_wake.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_eint_wr_callback(Object &&cb) { return m_write_eint.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmio_wr_callback(Object &&cb) { return m_write_nmio.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wake_wr_callback(Object &&cb) { return m_write_wake.set_callback(std::forward<Object>(cb)); }
// computer interface
bool nmd1_r() { return (m_card != nullptr) ? m_card->nmd1() : 1; }
diff --git a/src/devices/bus/psi_kbd/psi_kbd.h b/src/devices/bus/psi_kbd/psi_kbd.h
index d042ad5e444..2381ccc97be 100644
--- a/src/devices/bus/psi_kbd/psi_kbd.h
+++ b/src/devices/bus/psi_kbd/psi_kbd.h
@@ -40,10 +40,10 @@
MCFG_DEVICE_SLOT_INTERFACE(psi_keyboard_devices, _def_slot, false)
#define MCFG_PSI_KEYBOARD_RX_HANDLER(_devcb) \
- devcb = &psi_keyboard_bus_device::set_rx_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<psi_keyboard_bus_device &>(*device).set_rx_handler(DEVCB_##_devcb);
#define MCFG_PSI_KEYBOARD_KEY_STROBE_HANDLER(_devcb) \
- devcb = &psi_keyboard_bus_device::set_key_strobe_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<psi_keyboard_bus_device &>(*device).set_key_strobe_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -62,11 +62,8 @@ public:
virtual ~psi_keyboard_bus_device();
// callbacks
- template <class Object> static devcb_base &set_rx_handler(device_t &device, Object &&cb)
- { return downcast<psi_keyboard_bus_device &>(device).m_rx_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_key_strobe_handler(device_t &device, Object &&cb)
- { return downcast<psi_keyboard_bus_device &>(device).m_key_strobe_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rx_handler(Object &&cb) { return m_rx_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_key_strobe_handler(Object &&cb) { return m_key_strobe_handler.set_callback(std::forward<Object>(cb)); }
// called from keyboard
DECLARE_WRITE_LINE_MEMBER( rx_w ) { m_rx_handler(state); }
diff --git a/src/devices/bus/psx/ctlrport.h b/src/devices/bus/psx/ctlrport.h
index 531c32a27dc..55c8d4473d3 100644
--- a/src/devices/bus/psx/ctlrport.h
+++ b/src/devices/bus/psx/ctlrport.h
@@ -82,10 +82,10 @@ private:
};
#define MCFG_PSX_CONTROLLER_PORTS_DSR_HANDLER(_devcb) \
- devcb = &psxcontrollerports_device::set_dsr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<psxcontrollerports_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
#define MCFG_PSX_CONTROLLER_PORTS_RXD_HANDLER(_devcb) \
- devcb = &psxcontrollerports_device::set_rxd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<psxcontrollerports_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
class psxcontrollerports_device : public device_t
{
@@ -94,8 +94,8 @@ public:
void ack();
- template <class Object> static devcb_base &set_dsr_handler(device_t &device, Object &&cb) { return downcast<psxcontrollerports_device &>(device).m_dsr_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rxd_handler(device_t &device, Object &&cb) { return downcast<psxcontrollerports_device &>(device).m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dsr_handler(Object &&cb) { return m_dsr_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxd_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(write_sck);
DECLARE_WRITE_LINE_MEMBER(write_dtr);
diff --git a/src/devices/bus/ql/exp.h b/src/devices/bus/ql/exp.h
index 43c6c6e7edc..bdb9e98808a 100644
--- a/src/devices/bus/ql/exp.h
+++ b/src/devices/bus/ql/exp.h
@@ -59,16 +59,16 @@
#define MCFG_QL_EXPANSION_SLOT_IPL0L_CALLBACK(_write) \
- devcb = &ql_expansion_slot_device::set_ipl0l_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ql_expansion_slot_device &>(*device).set_ipl0l_wr_callback(DEVCB_##_write);
#define MCFG_QL_EXPANSION_SLOT_IPL1L_CALLBACK(_write) \
- devcb = &ql_expansion_slot_device::set_ipl1l_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ql_expansion_slot_device &>(*device).set_ipl1l_wr_callback(DEVCB_##_write);
#define MCFG_QL_EXPANSION_SLOT_BERRL_CALLBACK(_write) \
- devcb = &ql_expansion_slot_device::set_berrl_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ql_expansion_slot_device &>(*device).set_berrl_wr_callback(DEVCB_##_write);
#define MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(_write) \
- devcb = &ql_expansion_slot_device::set_extintl_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<ql_expansion_slot_device &>(*device).set_extintl_wr_callback(DEVCB_##_write);
@@ -107,10 +107,10 @@ public:
// construction/destruction
ql_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_ipl0l_wr_callback(device_t &device, Object &&cb) { return downcast<ql_expansion_slot_device &>(device).m_write_ipl0l.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ipl1l_wr_callback(device_t &device, Object &&cb) { return downcast<ql_expansion_slot_device &>(device).m_write_ipl1l.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_berrl_wr_callback(device_t &device, Object &&cb) { return downcast<ql_expansion_slot_device &>(device).m_write_berrl.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_extintl_wr_callback(device_t &device, Object &&cb) { return downcast<ql_expansion_slot_device &>(device).m_write_extintl.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ipl0l_wr_callback(Object &&cb) { return m_write_ipl0l.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ipl1l_wr_callback(Object &&cb) { return m_write_ipl1l.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_berrl_wr_callback(Object &&cb) { return m_write_berrl.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_extintl_wr_callback(Object &&cb) { return m_write_extintl.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t read(address_space &space, offs_t offset, uint8_t data) { if (m_card) data = m_card->read(space, offset, data); return data; }
diff --git a/src/devices/bus/rs232/rs232.h b/src/devices/bus/rs232/rs232.h
index adc121694ef..dbd372418d2 100644
--- a/src/devices/bus/rs232/rs232.h
+++ b/src/devices/bus/rs232/rs232.h
@@ -11,25 +11,25 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_RS232_RXD_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_rxd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_rxd_handler(DEVCB_##_devcb);
#define MCFG_RS232_DCD_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_dcd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_dcd_handler(DEVCB_##_devcb);
#define MCFG_RS232_DSR_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_dsr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_dsr_handler(DEVCB_##_devcb);
#define MCFG_RS232_RI_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_ri_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_ri_handler(DEVCB_##_devcb);
#define MCFG_RS232_CTS_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_cts_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_cts_handler(DEVCB_##_devcb);
#define MCFG_RS232_RXC_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_rxc_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_rxc_handler(DEVCB_##_devcb);
#define MCFG_RS232_TXC_HANDLER(_devcb) \
- devcb = &rs232_port_device::set_txc_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<rs232_port_device &>(*device).set_txc_handler(DEVCB_##_devcb);
#define RS232_BAUD_110 (0x00)
#define RS232_BAUD_150 (0x01)
@@ -126,13 +126,13 @@ public:
virtual ~rs232_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_rxd_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_rxd_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dcd_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_dcd_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dsr_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_dsr_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ri_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_ri_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cts_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_cts_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rxc_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_rxc_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_txc_handler(device_t &device, Object &&cb) { return downcast<rs232_port_device &>(device).m_txc_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxd_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dcd_handler(Object &&cb) { return m_dcd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dsr_handler(Object &&cb) { return m_dsr_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ri_handler(Object &&cb) { return m_ri_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cts_handler(Object &&cb) { return m_cts_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxc_handler(Object &&cb) { return m_rxc_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_txc_handler(Object &&cb) { return m_txc_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_txd );
DECLARE_WRITE_LINE_MEMBER( write_dtr );
diff --git a/src/devices/bus/s100/s100.h b/src/devices/bus/s100/s100.h
index 406876ec20f..99fe0891261 100644
--- a/src/devices/bus/s100/s100.h
+++ b/src/devices/bus/s100/s100.h
@@ -77,55 +77,55 @@
#define MCFG_S100_IRQ_CALLBACK(_write) \
- devcb = &s100_bus_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_S100_NMI_CALLBACK(_write) \
- devcb = &s100_bus_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI0_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi0_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi0_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI1_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi1_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi1_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI2_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi2_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI3_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi3_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi3_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI4_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi4_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi4_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI5_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi5_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi5_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI6_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi6_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi6_wr_callback(DEVCB_##_write);
#define MCFG_S100_VI7_CALLBACK(_write) \
- devcb = &s100_bus_device::set_vi7_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_vi7_wr_callback(DEVCB_##_write);
#define MCFG_S100_DMA0_CALLBACK(_write) \
- devcb = &s100_bus_device::set_dma0_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_dma0_wr_callback(DEVCB_##_write);
#define MCFG_S100_DMA1_CALLBACK(_write) \
- devcb = &s100_bus_device::set_dma1_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_dma1_wr_callback(DEVCB_##_write);
#define MCFG_S100_DMA2_CALLBACK(_write) \
- devcb = &s100_bus_device::set_dma2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_dma2_wr_callback(DEVCB_##_write);
#define MCFG_S100_DMA3_CALLBACK(_write) \
- devcb = &s100_bus_device::set_dma3_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_dma3_wr_callback(DEVCB_##_write);
#define MCFG_S100_RDY_CALLBACK(_write) \
- devcb = &s100_bus_device::set_rdy_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_rdy_wr_callback(DEVCB_##_write);
#define MCFG_S100_HOLD_CALLBACK(_write) \
- devcb = &s100_bus_device::set_hold_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_hold_wr_callback(DEVCB_##_write);
#define MCFG_S100_ERROR_CALLBACK(_write) \
- devcb = &s100_bus_device::set_error_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<s100_bus_device &>(*device).set_error_wr_callback(DEVCB_##_write);
@@ -201,23 +201,23 @@ public:
s100_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~s100_bus_device() { m_device_list.detach_all(); }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_nmi.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi0_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi1_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi2_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi3_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi4_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi4.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi5_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi5.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi6_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi6.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_vi7_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_vi7.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma0_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_dma0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma1_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_dma1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma2_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_dma2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma3_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_dma3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rdy_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_rdy.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_hold_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_hold.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_error_wr_callback(device_t &device, Object &&cb) { return downcast<s100_bus_device &>(device).m_write_error.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi0_wr_callback(Object &&cb) { return m_write_vi0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi1_wr_callback(Object &&cb) { return m_write_vi1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi2_wr_callback(Object &&cb) { return m_write_vi2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi3_wr_callback(Object &&cb) { return m_write_vi3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi4_wr_callback(Object &&cb) { return m_write_vi4.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi5_wr_callback(Object &&cb) { return m_write_vi5.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi6_wr_callback(Object &&cb) { return m_write_vi6.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vi7_wr_callback(Object &&cb) { return m_write_vi7.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma0_wr_callback(Object &&cb) { return m_write_dma0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma1_wr_callback(Object &&cb) { return m_write_dma1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma2_wr_callback(Object &&cb) { return m_write_dma2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma3_wr_callback(Object &&cb) { return m_write_dma3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rdy_wr_callback(Object &&cb) { return m_write_rdy.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_hold_wr_callback(Object &&cb) { return m_write_hold.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_error_wr_callback(Object &&cb) { return m_write_error.set_callback(std::forward<Object>(cb)); }
void add_card(device_s100_card_interface *card);
diff --git a/src/devices/bus/scsi/scsi.h b/src/devices/bus/scsi/scsi.h
index b6e15cecc02..3685a86cddc 100644
--- a/src/devices/bus/scsi/scsi.h
+++ b/src/devices/bus/scsi/scsi.h
@@ -18,55 +18,55 @@
#define SCSI_PORT_DEVICE7 "7"
#define MCFG_SCSI_BSY_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_bsy_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_bsy_handler(DEVCB_##_devcb);
#define MCFG_SCSI_SEL_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_sel_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_sel_handler(DEVCB_##_devcb);
#define MCFG_SCSI_CD_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_cd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_cd_handler(DEVCB_##_devcb);
#define MCFG_SCSI_IO_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_io_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_io_handler(DEVCB_##_devcb);
#define MCFG_SCSI_MSG_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_msg_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_msg_handler(DEVCB_##_devcb);
#define MCFG_SCSI_REQ_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_req_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_req_handler(DEVCB_##_devcb);
#define MCFG_SCSI_ACK_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_ack_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_ack_handler(DEVCB_##_devcb);
#define MCFG_SCSI_ATN_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_atn_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_atn_handler(DEVCB_##_devcb);
#define MCFG_SCSI_RST_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_rst_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_rst_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA0_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data0_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data0_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA1_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data1_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA2_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data2_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA3_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data3_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data3_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA4_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data4_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data4_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA5_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data5_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data5_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA6_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data6_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data6_handler(DEVCB_##_devcb);
#define MCFG_SCSI_DATA7_HANDLER(_devcb) \
- devcb = &scsi_port_device::set_data7_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<scsi_port_device &>(*device).set_data7_handler(DEVCB_##_devcb);
#define MCFG_SCSI_OUTPUT_LATCH_ADD(_tag, scsi_port_tag) \
MCFG_DEVICE_ADD(_tag, OUTPUT_LATCH, 0) \
@@ -100,23 +100,23 @@ public:
// construction/destruction
scsi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_bsy_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_bsy_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sel_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_sel_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cd_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_cd_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_io_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_io_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_msg_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_msg_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_req_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_req_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ack_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_ack_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_atn_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_atn_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rst_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_rst_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data0_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data0_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data1_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data2_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data3_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data3_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data4_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data4_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data5_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data5_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data6_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data6_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_data7_handler(device_t &device, Object &&cb) { return downcast<scsi_port_device &>(device).m_data7_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_bsy_handler(Object &&cb) { return m_bsy_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sel_handler(Object &&cb) { return m_sel_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cd_handler(Object &&cb) { return m_cd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_io_handler(Object &&cb) { return m_io_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_msg_handler(Object &&cb) { return m_msg_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_req_handler(Object &&cb) { return m_req_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ack_handler(Object &&cb) { return m_ack_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_atn_handler(Object &&cb) { return m_atn_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rst_handler(Object &&cb) { return m_rst_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data0_handler(Object &&cb) { return m_data0_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data1_handler(Object &&cb) { return m_data1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data2_handler(Object &&cb) { return m_data2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data3_handler(Object &&cb) { return m_data3_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data4_handler(Object &&cb) { return m_data4_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data5_handler(Object &&cb) { return m_data5_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data6_handler(Object &&cb) { return m_data6_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_data7_handler(Object &&cb) { return m_data7_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_bsy );
DECLARE_WRITE_LINE_MEMBER( write_sel );
diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp
index 1782a75a689..1e41556710d 100644
--- a/src/devices/bus/sms_ctrl/lphaser.cpp
+++ b/src/devices/bus/sms_ctrl/lphaser.cpp
@@ -93,7 +93,7 @@ sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig,
{
// Workaround for failed validation that occurs when running on a driver
// with Sega Scope emulation, which adds 2 screens (left/right lenses).
- static_set_screen(*this, ":screen");
+ set_screen(":screen");
}
diff --git a/src/devices/bus/sms_ctrl/smsctrl.h b/src/devices/bus/sms_ctrl/smsctrl.h
index f1dd5404408..71cfa2059c4 100644
--- a/src/devices/bus/sms_ctrl/smsctrl.h
+++ b/src/devices/bus/sms_ctrl/smsctrl.h
@@ -27,11 +27,11 @@
#define MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(_devcb) \
- devcb = &sms_control_port_device::set_th_input_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<sms_control_port_device &>(*device).set_th_input_handler(DEVCB_##_devcb);
#define MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(_devcb) \
- devcb = &sms_control_port_device::set_pixel_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<sms_control_port_device &>(*device).set_pixel_handler(DEVCB_##_devcb);
@@ -52,9 +52,9 @@ public:
virtual ~sms_control_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_th_input_handler(device_t &device, Object &&cb) { return downcast<sms_control_port_device &>(device).m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_th_input_handler(Object &&cb) { return m_th_pin_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_pixel_handler(device_t &device, Object &&cb) { return downcast<sms_control_port_device &>(device).m_pixel_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pixel_handler(Object &&cb) { return m_pixel_handler.set_callback(std::forward<Object>(cb)); }
// Physical DE-9 connector interface
diff --git a/src/devices/bus/snes_ctrl/ctrl.h b/src/devices/bus/snes_ctrl/ctrl.h
index 943388e3fa0..1e23d1a5ae4 100644
--- a/src/devices/bus/snes_ctrl/ctrl.h
+++ b/src/devices/bus/snes_ctrl/ctrl.h
@@ -52,8 +52,8 @@ public:
snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~snes_control_port_device();
- static void set_onscreen_callback(device_t &device, snesctrl_onscreen_delegate callback) { downcast<snes_control_port_device &>(device).m_onscreen_cb = callback; }
- static void set_gunlatch_callback(device_t &device, snesctrl_gunlatch_delegate callback) { downcast<snes_control_port_device &>(device).m_gunlatch_cb = callback; }
+ template <typename Object> void set_onscreen_callback(Object &&cb) { m_onscreen_cb = std::forward<Object>(cb); }
+ template <typename Object> void set_gunlatch_callback(Object &&cb) { m_gunlatch_cb = std::forward<Object>(cb); }
uint8_t read_pin4();
uint8_t read_pin5();
@@ -88,10 +88,10 @@ DECLARE_DEVICE_TYPE(SNES_CONTROL_PORT, snes_control_port_device)
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
#define MCFG_SNESCTRL_ONSCREEN_CB(_class, _method) \
- snes_control_port_device::set_onscreen_callback(*device, snesctrl_onscreen_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<snes_control_port_device &>(*device).set_onscreen_callback(snesctrl_onscreen_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_SNESCTRL_GUNLATCH_CB(_class, _method) \
- snes_control_port_device::set_gunlatch_callback(*device, snesctrl_gunlatch_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<snes_control_port_device &>(*device).set_gunlatch_callback(snesctrl_gunlatch_delegate(&_class::_method, #_class "::" #_method, this));
SLOT_INTERFACE_EXTERN( snes_control_port_devices );
diff --git a/src/devices/bus/spectrum/exp.h b/src/devices/bus/spectrum/exp.h
index 0c522d88bb0..1110a3e7021 100644
--- a/src/devices/bus/spectrum/exp.h
+++ b/src/devices/bus/spectrum/exp.h
@@ -66,10 +66,10 @@
MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, nmi_w))
#define MCFG_SPECTRUM_EXPANSION_SLOT_IRQ_HANDLER(_devcb) \
- devcb = &spectrum_expansion_slot_device::set_irq_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<spectrum_expansion_slot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(_devcb) \
- devcb = &spectrum_expansion_slot_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<spectrum_expansion_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -88,11 +88,8 @@ public:
virtual ~spectrum_expansion_slot_device();
// callbacks
- template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
- { return downcast<spectrum_expansion_slot_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<spectrum_expansion_slot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( mreq_r );
DECLARE_WRITE8_MEMBER( mreq_w );
diff --git a/src/devices/bus/ss50/interface.h b/src/devices/bus/ss50/interface.h
index 2e35b0abf2f..2dd6f5c48b2 100644
--- a/src/devices/bus/ss50/interface.h
+++ b/src/devices/bus/ss50/interface.h
@@ -20,10 +20,10 @@
MCFG_DEVICE_SLOT_INTERFACE(ss50_##_slot_intf, _def_slot, false)
#define MCFG_SS50_INTERFACE_IRQ_CALLBACK(_devcb) \
- devcb = &ss50_interface_port_device::set_irq_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<ss50_interface_port_device &>(*device).set_irq_cb(DEVCB_##_devcb);
#define MCFG_SS50_INTERFACE_FIRQ_CALLBACK(_devcb) \
- devcb = &ss50_interface_port_device::set_firq_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<ss50_interface_port_device &>(*device).set_firq_cb(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -43,8 +43,8 @@ public:
ss50_interface_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// static configuration
- template<class Object> static devcb_base &set_irq_cb(device_t &device, Object &&object) { return downcast<ss50_interface_port_device &>(device).m_irq_cb.set_callback(std::forward<Object>(object)); }
- template<class Object> static devcb_base &set_firq_cb(device_t &device, Object &&object) { return downcast<ss50_interface_port_device &>(device).m_firq_cb.set_callback(std::forward<Object>(object)); }
+ template<class Object> devcb_base &set_irq_cb(Object &&object) { return m_irq_cb.set_callback(std::forward<Object>(object)); }
+ template<class Object> devcb_base &set_firq_cb(Object &&object) { return m_firq_cb.set_callback(std::forward<Object>(object)); }
// memory accesses
DECLARE_READ8_MEMBER(read);
diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h
index e1ea42198ef..9693e95cd4e 100644
--- a/src/devices/bus/sunkbd/sunkbd.h
+++ b/src/devices/bus/sunkbd/sunkbd.h
@@ -12,7 +12,7 @@
MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false)
#define MCFG_SUNKBD_RXD_HANDLER(cb) \
- devcb = &sun_keyboard_port_device::set_rxd_handler(*device, DEVCB_##cb);
+ devcb = &downcast<sun_keyboard_port_device &>(*device).set_rxd_handler(DEVCB_##cb);
class device_sun_keyboard_port_interface;
@@ -27,7 +27,7 @@ public:
virtual ~sun_keyboard_port_device();
// static configuration helpers
- template <class Object> static devcb_base &set_rxd_handler(device_t &device, Object &&cb) { return downcast<sun_keyboard_port_device &>(device).m_rxd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxd_handler(Object &&cb) { return m_rxd_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( write_txd );
diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h
index 262d2a8ea77..28320d7012f 100644
--- a/src/devices/bus/svi3x8/expander/expander.h
+++ b/src/devices/bus/svi3x8/expander/expander.h
@@ -49,25 +49,25 @@
MCFG_DEVICE_ADD(_tag, SVI_EXPANDER, 0) \
MCFG_DEVICE_SLOT_INTERFACE(svi_expander_modules, nullptr, false)
#define MCFG_SVI_EXPANDER_INT_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_int_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_ROMDIS_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_romdis_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_romdis_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_RAMDIS_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_ramdis_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_ramdis_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_CTRL1_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_ctrl1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_ctrl1_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_CTRL2_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_ctrl2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_ctrl2_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_EXCSR_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_excsr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_excsr_handler(DEVCB_##_devcb);
#define MCFG_SVI_EXPANDER_EXCSW_HANDLER(_devcb) \
- devcb = &svi_expander_device::set_excsw_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_expander_device &>(*device).set_excsw_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -86,26 +86,13 @@ public:
virtual ~svi_expander_device();
// callbacks
- template <class Object> static devcb_base &set_int_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_int_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_romdis_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_romdis_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ramdis_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ctrl1_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_ctrl1_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ctrl2_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_ctrl2_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_excsr_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_excsr_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_excsw_handler(device_t &device, Object &&cb)
- { return downcast<svi_expander_device &>(device).m_excsw_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_romdis_handler(Object &&cb) { return m_romdis_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ramdis_handler(Object &&cb) { return m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ctrl1_handler(Object &&cb) { return m_ctrl1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ctrl2_handler(Object &&cb) { return m_ctrl2_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_excsr_handler(Object &&cb) { return m_excsr_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_excsw_handler(Object &&cb) { return m_excsw_handler.set_callback(std::forward<Object>(cb)); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp
index c8e35ec9c92..c345d864f4b 100644
--- a/src/devices/bus/svi3x8/slot/slot.cpp
+++ b/src/devices/bus/svi3x8/slot/slot.cpp
@@ -212,17 +212,6 @@ svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag,
}
//-------------------------------------------------
-// set_bus - set owner bus tag
-//-------------------------------------------------
-
-void svi_slot_device::set_bus(device_t &device, device_t *owner, const char *bus_tag)
-{
- svi_slot_device &card = dynamic_cast<svi_slot_device &>(device);
- card.m_owner = owner;
- card.m_bus_tag = bus_tag;
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h
index 722f9aa0c8d..84764b1dc4f 100644
--- a/src/devices/bus/svi3x8/slot/slot.h
+++ b/src/devices/bus/svi3x8/slot/slot.h
@@ -51,16 +51,16 @@
#define MCFG_SVI_SLOT_ADD(_tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, SVI_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- svi_slot_device::set_bus(*device, this, "slotbus");
+ downcast<svi_slot_device &>(*device).set_bus(this, "slotbus");
#define MCFG_SVI_SLOT_INT_HANDLER(_devcb) \
- devcb = &svi_slot_bus_device::set_int_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_slot_bus_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_SVI_SLOT_ROMDIS_HANDLER(_devcb) \
- devcb = &svi_slot_bus_device::set_romdis_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_slot_bus_device &>(*device).set_romdis_handler(DEVCB_##_devcb);
#define MCFG_SVI_SLOT_RAMDIS_HANDLER(_devcb) \
- devcb = &svi_slot_bus_device::set_ramdis_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<svi_slot_bus_device &>(*device).set_ramdis_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -79,14 +79,9 @@ public:
virtual ~svi_slot_bus_device();
// callbacks
- template <class Object> static devcb_base &set_int_handler(device_t &device, Object &&cb)
- { return downcast<svi_slot_bus_device &>(device).m_int_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_romdis_handler(device_t &device, Object &&cb)
- { return downcast<svi_slot_bus_device &>(device).m_romdis_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_ramdis_handler(device_t &device, Object &&cb)
- { return downcast<svi_slot_bus_device &>(device).m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_romdis_handler(Object &&cb) { return m_romdis_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ramdis_handler(Object &&cb) { return m_ramdis_handler.set_callback(std::forward<Object>(cb)); }
void add_card(device_svi_slot_interface *card);
@@ -130,7 +125,7 @@ public:
svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void set_bus(device_t &device, device_t *owner, const char *bus_tag);
+ void set_bus(device_t *owner, const char *bus_tag) { m_owner = owner; m_bus_tag = bus_tag; }
protected:
// device-level overrides
diff --git a/src/devices/bus/ti8x/ti8x.h b/src/devices/bus/ti8x/ti8x.h
index 67ddad75747..91b86806885 100644
--- a/src/devices/bus/ti8x/ti8x.h
+++ b/src/devices/bus/ti8x/ti8x.h
@@ -47,10 +47,10 @@ DECLARE_DEVICE_TYPE(TI8X_LINK_PORT, ti8x_link_port_device)
MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false)
#define MCFG_TI8X_LINK_TIP_HANDLER(cb) \
- devcb = &ti8x_link_port_device::set_tip_handler(*device, DEVCB_##cb);
+ devcb = &downcast<ti8x_link_port_device &>(*device).set_tip_handler(DEVCB_##cb);
#define MCFG_TI8X_LINK_RING_HANDLER(cb) \
- devcb = &ti8x_link_port_device::set_ring_handler(*device, DEVCB_##cb);
+ devcb = &downcast<ti8x_link_port_device &>(*device).set_ring_handler(DEVCB_##cb);
class device_ti8x_link_port_interface;
@@ -62,10 +62,8 @@ public:
ti8x_link_port_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
// static configuration helpers
- template <class Object> static devcb_base &set_tip_handler(device_t &device, Object &&cb)
- { return downcast<ti8x_link_port_device &>(device).m_tip_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ring_handler(device_t &device, Object &&cb)
- { return downcast<ti8x_link_port_device &>(device).m_ring_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_tip_handler(Object &&cb) { return m_tip_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ring_handler(Object &&cb) { return m_ring_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(tip_w);
DECLARE_WRITE_LINE_MEMBER(ring_w);
diff --git a/src/devices/bus/ti99/gromport/gromport.h b/src/devices/bus/ti99/gromport/gromport.h
index 7a67aac4bd0..1206b231ce8 100644
--- a/src/devices/bus/ti99/gromport/gromport.h
+++ b/src/devices/bus/ti99/gromport/gromport.h
@@ -38,10 +38,10 @@ public:
DECLARE_WRITE8_MEMBER(set_gromlines); // Combined GROM select lines
DECLARE_WRITE_LINE_MEMBER(gclock_in);
- static void set_mask(device_t &device, int mask) { downcast<gromport_device &>(device).m_mask = mask; }
+ void set_mask(int mask) { m_mask = mask; }
- template <class Object> static devcb_base &static_set_ready_callback(device_t &device, Object &&cb) { return downcast<gromport_device &>(device).m_console_ready.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_reset_callback(device_t &device, Object &&cb) { return downcast<gromport_device &>(device).m_console_reset.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ready_callback(Object &&cb) { return m_console_ready.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_callback(Object &&cb) { return m_console_reset.set_callback(std::forward<Object>(cb)); }
void cartridge_inserted();
bool is_grom_idle();
@@ -97,19 +97,19 @@ SLOT_INTERFACE_EXTERN(gromport8);
#define MCFG_GROMPORT4_ADD( _tag ) \
MCFG_DEVICE_ADD(_tag, TI99_GROMPORT, 0) \
- bus::ti99::gromport::gromport_device::set_mask(*device, 0x1fff); \
+ downcast<bus::ti99::gromport::gromport_device &>(*device).set_mask(0x1fff); \
MCFG_DEVICE_SLOT_INTERFACE(gromport4, "single", false)
#define MCFG_GROMPORT8_ADD( _tag ) \
MCFG_DEVICE_ADD(_tag, TI99_GROMPORT, 0) \
- bus::ti99::gromport::gromport_device::set_mask(*device, 0x3fff); \
+ downcast<bus::ti99::gromport::gromport_device &>(*device).set_mask(0x3fff); \
MCFG_DEVICE_SLOT_INTERFACE(gromport8, "single", false)
#define MCFG_GROMPORT_READY_HANDLER( _ready ) \
- devcb = &bus::ti99::gromport::gromport_device::static_set_ready_callback( *device, DEVCB_##_ready );
+ devcb = &downcast<bus::ti99::gromport::gromport_device &>(*device).set_ready_callback(DEVCB_##_ready);
#define MCFG_GROMPORT_RESET_HANDLER( _reset ) \
- devcb = &bus::ti99::gromport::gromport_device::static_set_reset_callback( *device, DEVCB_##_reset );
+ devcb = &downcast<bus::ti99::gromport::gromport_device &>(*device).set_reset_callback(DEVCB_##_reset);
DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT, bus::ti99::gromport, gromport_device)
diff --git a/src/devices/bus/ti99/internal/998board.h b/src/devices/bus/ti99/internal/998board.h
index 1787c0f9cec..526fad8bf44 100644
--- a/src/devices/bus/ti99/internal/998board.h
+++ b/src/devices/bus/ti99/internal/998board.h
@@ -522,20 +522,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( holda_line );
- template<class _Object> static devcb_base &set_ready_wr_callback(device_t &device, _Object object)
- {
- return downcast<mainboard8_device &>(device).m_ready.set_callback(object);
- }
-
- template<class _Object> static devcb_base &set_reset_wr_callback(device_t &device, _Object object)
- {
- return downcast<mainboard8_device &>(device).m_console_reset.set_callback(object);
- }
-
- template<class _Object> static devcb_base &set_hold_wr_callback(device_t &device, _Object object)
- {
- return downcast<mainboard8_device &>(device).m_hold_line.set_callback(object);
- }
+ template<class Object> devcb_base &set_ready_wr_callback(Object &&cb) { return m_ready.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_reset_wr_callback(Object &&cb) { return m_console_reset.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_hold_wr_callback(Object &&cb) { return m_hold_line.set_callback(std::forward<Object>(cb)); }
void set_paddress(int address);
@@ -649,16 +638,16 @@ private:
} } } // end namespace bus::ti99::internal
#define MCFG_MAINBOARD8_READY_CALLBACK(_write) \
- devcb = &bus::ti99::internal::mainboard8_device::set_ready_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<bus::ti99::internal::mainboard8_device &>(*device).set_ready_wr_callback(DEVCB_##_write);
#define MCFG_MAINBOARD8_RESET_CALLBACK(_write) \
- devcb = &bus::ti99::internal::mainboard8_device::set_reset_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<bus::ti99::internal::mainboard8_device &>(*device).set_reset_wr_callback(DEVCB_##_write);
#define MCFG_MAINBOARD8_HOLD_CALLBACK(_write) \
- devcb = &bus::ti99::internal::mainboard8_device::set_hold_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<bus::ti99::internal::mainboard8_device &>(*device).set_hold_wr_callback(DEVCB_##_write);
#define MCFG_OSO_INT_CALLBACK(_int) \
- devcb = &bus::ti99::internal::oso_device::set_int_callback(*device, DEVCB##_int);
+ devcb = &downcast<bus::ti99::internal::oso_device &>(*device).set_int_callback(DEVCB##_int);
DECLARE_DEVICE_TYPE_NS(TI99_MAINBOARD8, bus::ti99::internal, mainboard8_device)
DECLARE_DEVICE_TYPE_NS(TI99_VAQUERRO, bus::ti99::internal, vaquerro_device)
diff --git a/src/devices/bus/ti99/internal/datamux.h b/src/devices/bus/ti99/internal/datamux.h
index 9d09f3e4c17..d864ee98c53 100644
--- a/src/devices/bus/ti99/internal/datamux.h
+++ b/src/devices/bus/ti99/internal/datamux.h
@@ -43,10 +43,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( gromclk_in );
- template <class Object> static devcb_base &static_set_ready_callback(device_t &device, Object &&cb)
- {
- return downcast<datamux_device &>(device).m_ready.set_callback(std::forward<Object>(cb));
- }
+ template <class Object> devcb_base &set_ready_callback(Object &&cb) { return m_ready.set_callback(std::forward<Object>(cb)); }
protected:
/* Constructor */
@@ -141,7 +138,7 @@ private:
/******************************************************************************/
#define MCFG_DMUX_READY_HANDLER( _intcallb ) \
- devcb = &bus::ti99::internal::datamux_device::static_set_ready_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<bus::ti99::internal::datamux_device &>(*device).set_ready_callback(DEVCB_##_intcallb);
} } } // end namespace bus::ti99::internal
diff --git a/src/devices/bus/ti99/internal/evpcconn.h b/src/devices/bus/ti99/internal/evpcconn.h
index 4bd95f8f179..9f1af61ccf9 100644
--- a/src/devices/bus/ti99/internal/evpcconn.h
+++ b/src/devices/bus/ti99/internal/evpcconn.h
@@ -21,10 +21,7 @@ class evpc_clock_connector : public device_t
public:
evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class _Object> static devcb_base &static_set_vdpint_callback(device_t &device, _Object object)
- {
- return downcast<evpc_clock_connector &>(device).m_vdpint.set_callback(object);
- }
+ template<class Object> devcb_base &set_vdpint_callback(Object &&cb) { return m_vdpint.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( vclock_line );
void device_start() override;
@@ -40,6 +37,6 @@ DECLARE_DEVICE_TYPE_NS(TI99_EVPCCONN, bus::ti99::internal, evpc_clock_connector)
#define MCFG_ADD_EVPC_CONNECTOR( _tag, _vdpint ) \
MCFG_DEVICE_ADD(_tag, TI99_EVPCCONN, 0) \
- devcb = &bus::ti99::internal::evpc_clock_connector::static_set_vdpint_callback( *device, DEVCB_##_vdpint );
+ devcb = &downcast<bus::ti99::internal::evpc_clock_connector &>(*device).set_vdpint_callback(DEVCB_##_vdpint);
#endif // MAME_BUS_TI99_INTERNAL_EVPCCONN_H
diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h
index 80101fb2de8..26e6766adef 100644
--- a/src/devices/bus/ti99/internal/genboard.h
+++ b/src/devices/bus/ti99/internal/genboard.h
@@ -63,7 +63,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( clock_control );
uint8_t get_recent_key();
- template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb) { return downcast<geneve_keyboard_device &>(device).m_interrupt.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_interrupt.set_callback(std::forward<Object>(cb)); }
protected:
void device_start() override;
@@ -109,7 +109,7 @@ private:
};
#define MCFG_GENEVE_KBINT_HANDLER( _intcallb ) \
- devcb = &bus::ti99::internal::geneve_keyboard_device::static_set_int_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<bus::ti99::internal::geneve_keyboard_device &>(*device).set_int_callback(DEVCB_##_intcallb);
/*****************************************************************************/
@@ -138,7 +138,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( pfm_select_msb );
DECLARE_WRITE_LINE_MEMBER( pfm_output_enable );
- template <class Object> static devcb_base &static_set_ready_callback(device_t &device, Object &&cb) { return downcast<geneve_mapper_device &>(device).m_ready.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ready_callback(Object &&cb) { return m_ready.set_callback(std::forward<Object>(cb)); }
protected:
void device_start() override;
@@ -222,7 +222,7 @@ private:
};
#define MCFG_GENEVE_READY_HANDLER( _intcallb ) \
- devcb = &bus::ti99::internal::geneve_mapper_device::static_set_ready_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<bus::ti99::internal::geneve_mapper_device &>(*device).set_ready_callback(DEVCB_##_intcallb);
} } } // end namespace bus::ti99::internal
diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h
index 91caf5a34a0..f63518705d4 100644
--- a/src/devices/bus/ti99/internal/ioport.h
+++ b/src/devices/bus/ti99/internal/ioport.h
@@ -59,8 +59,8 @@ class ioport_device : public device_t, public device_slot_interface
public:
ioport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class _Object> static devcb_base &static_set_extint_callback(device_t &device, _Object object) { return downcast<ioport_device &>(device).m_console_extint.set_callback(object); }
- template<class _Object> static devcb_base &static_set_ready_callback(device_t &device, _Object object) { return downcast<ioport_device &>(device).m_console_ready.set_callback(object); }
+ template<class Object> devcb_base &set_extint_callback(Object &&cb) { return m_console_extint.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_ready_callback(Object &&cb) { return m_console_ready.set_callback(std::forward<Object>(cb)); }
// Methods called from the console
DECLARE_READ8Z_MEMBER( readz );
@@ -99,9 +99,9 @@ SLOT_INTERFACE_EXTERN(ti99_io_port_ev);
MCFG_DEVICE_SLOT_INTERFACE(ti99_io_port_ev, "peb", false)
#define MCFG_IOPORT_EXTINT_HANDLER( _extint ) \
- devcb = &bus::ti99::internal::ioport_device::static_set_extint_callback( *device, DEVCB_##_extint );
+ devcb = &downcast<bus::ti99::internal::ioport_device &>(*device).set_extint_callback(DEVCB_##_extint);
#define MCFG_IOPORT_READY_HANDLER( _ready ) \
- devcb = &bus::ti99::internal::ioport_device::static_set_ready_callback( *device, DEVCB_##_ready );
+ devcb = &downcast<bus::ti99::internal::ioport_device &>(*device).set_ready_callback(DEVCB_##_ready);
#endif /* __TI99IOPORT__ */
diff --git a/src/devices/bus/ti99/joyport/joyport.h b/src/devices/bus/ti99/joyport/joyport.h
index 44afd9f5fea..bf3f5bcf1f3 100644
--- a/src/devices/bus/ti99/joyport/joyport.h
+++ b/src/devices/bus/ti99/joyport/joyport.h
@@ -55,7 +55,7 @@ public:
void set_interrupt(int state);
void pulse_clock();
- template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb) { return downcast<joyport_device &>(device).m_interrupt.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_interrupt.set_callback(std::forward<Object>(cb)); }
protected:
void device_start() override;
@@ -75,7 +75,7 @@ SLOT_INTERFACE_EXTERN(ti99_joystick_port_gen);
DECLARE_DEVICE_TYPE_NS(TI99_JOYPORT, bus::ti99::joyport, joyport_device)
#define MCFG_JOYPORT_INT_HANDLER( _intcallb ) \
- devcb = &bus::ti99::joyport::joyport_device::static_set_int_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<bus::ti99::joyport::joyport_device &>(*device).set_int_callback(DEVCB_##_intcallb);
#define MCFG_GENEVE_JOYPORT_ADD( _tag ) \
MCFG_DEVICE_ADD(_tag, TI99_JOYPORT, 0) \
diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h
index bd6dda9be7c..00be0795d10 100644
--- a/src/devices/bus/ti99/peb/peribox.h
+++ b/src/devices/bus/ti99/peb/peribox.h
@@ -34,10 +34,10 @@ class peribox_device : public bus::ti99::internal::ioport_attached_device
public:
peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_inta_callback(device_t &device, Object &&cb) { return downcast<peribox_device &>(device).m_slot1_inta.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_intb_callback(device_t &device, Object &&cb) { return downcast<peribox_device &>(device).m_slot1_intb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_ready_callback(device_t &device, Object &&cb) { return downcast<peribox_device &>(device).m_slot1_ready.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_lcp_callback(device_t &device, Object &&cb) { return downcast<peribox_device &>(device).m_slot1_lcp.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_inta_callback(Object &&cb) { return m_slot1_inta.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_intb_callback(Object &&cb) { return m_slot1_intb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ready_callback(Object &&cb) { return m_slot1_ready.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lcp_callback(Object &&cb) { return m_slot1_lcp.set_callback(std::forward<Object>(cb)); }
// Next eight methods are called from the console
DECLARE_READ8Z_MEMBER(readz) override;
@@ -238,16 +238,16 @@ private:
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _default, false)
#define MCFG_PERIBOX_INTA_HANDLER( _inta ) \
- devcb = &bus::ti99::peb::peribox_device::static_set_inta_callback( *device, DEVCB_##_inta );
+ devcb = &downcast<bus::ti99::peb::peribox_device &>(*device).set_inta_callback(DEVCB_##_inta);
#define MCFG_PERIBOX_INTB_HANDLER( _intb ) \
- devcb = &bus::ti99::peb::peribox_device::static_set_intb_callback( *device, DEVCB_##_intb );
+ devcb = &downcast<bus::ti99::peb::peribox_device &>(*device).set_intb_callback(DEVCB_##_intb);
#define MCFG_PERIBOX_READY_HANDLER( _ready ) \
- devcb = &bus::ti99::peb::peribox_device::static_set_ready_callback( *device, DEVCB_##_ready );
+ devcb = &downcast<bus::ti99::peb::peribox_device &>(*device).set_ready_callback(DEVCB_##_ready);
#define MCFG_PERIBOX_LCP_HANDLER( _lcp ) \
- devcb = &bus::ti99::peb::peribox_device::static_set_lcp_callback( *device, DEVCB_##_lcp );
+ devcb = &downcast<bus::ti99::peb::peribox_device &>(*device).set_lcp_callback(DEVCB_##_lcp);
} } } // end namespace bus::ti99::peb
diff --git a/src/devices/bus/ti99x/990_dk.h b/src/devices/bus/ti99x/990_dk.h
index 97c00ef21d5..79bebc674d6 100644
--- a/src/devices/bus/ti99x/990_dk.h
+++ b/src/devices/bus/ti99x/990_dk.h
@@ -18,10 +18,7 @@ public:
DECLARE_READ8_MEMBER( cru_r );
DECLARE_WRITE8_MEMBER( cru_w );
- template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb)
- {
- return downcast<fd800_legacy_device &>(device).m_int_line.set_callback(std::forward<Object>(cb));
- }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_int_line.set_callback(std::forward<Object>(cb)); }
private:
enum buf_mode_t
@@ -72,6 +69,6 @@ private:
// LEGACY_FLOPPY_OPTIONS_EXTERN(fd800);
#define MCFG_FD800_INT_HANDLER( _intcallb ) \
- devcb = &fd800_legacy_device::static_set_int_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<fd800_legacy_device &>(*device).set_int_callback(DEVCB_##_intcallb);
#endif // MAME_BUS_TI99X_990_DK_H
diff --git a/src/devices/bus/ti99x/990_hd.h b/src/devices/bus/ti99x/990_hd.h
index fdeaac0ea88..57f0f55fa27 100644
--- a/src/devices/bus/ti99x/990_hd.h
+++ b/src/devices/bus/ti99x/990_hd.h
@@ -15,7 +15,7 @@ class ti990_hdc_device : public device_t
public:
ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb) { return downcast<ti990_hdc_device &>(device).m_interrupt_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_interrupt_callback.set_callback(std::forward<Object>(cb)); }
DECLARE_READ16_MEMBER(read);
DECLARE_WRITE16_MEMBER(write);
@@ -75,7 +75,7 @@ private:
};
#define MCFG_TI990_HDC_INT_CALLBACK( _write ) \
- devcb = &ti990_hdc_device::static_set_int_callback( *device, DEVCB_##_write );
+ devcb = &downcast<ti990_hdc_device &>(*device).set_int_callback(DEVCB_##_write);
DECLARE_DEVICE_TYPE(TI990_HDC, ti990_hdc_device)
diff --git a/src/devices/bus/ti99x/990_tap.h b/src/devices/bus/ti99x/990_tap.h
index 256d71da134..a86725dd079 100644
--- a/src/devices/bus/ti99x/990_tap.h
+++ b/src/devices/bus/ti99x/990_tap.h
@@ -14,10 +14,7 @@ class tap_990_device : public device_t
{
public:
tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_int_callback(device_t &device, Object &&cb)
- {
- return downcast<tap_990_device &>(device).m_int_line.set_callback(std::forward<Object>(cb));
- }
+ template <class Object> devcb_base &set_int_callback(Object &&cb) { return m_int_line.set_callback(std::forward<Object>(cb)); }
DECLARE_READ16_MEMBER( read );
DECLARE_WRITE16_MEMBER( write );
@@ -64,6 +61,6 @@ private:
};
#define MCFG_TI990_TAPE_INT_HANDLER( _intcallb ) \
- devcb = &tap_990_device::static_set_int_callback( *device, DEVCB_##_intcallb );
+ devcb = &downcast<tap_990_device &>(*device).set_int_callback(DEVCB_##_intcallb);
#endif // MAME_BUS_TI99X_990_TAP_H
diff --git a/src/devices/bus/tiki100/exp.h b/src/devices/bus/tiki100/exp.h
index 9ae56520527..78b2dceaa9f 100644
--- a/src/devices/bus/tiki100/exp.h
+++ b/src/devices/bus/tiki100/exp.h
@@ -39,19 +39,19 @@
#define MCFG_TIKI100_BUS_IRQ_CALLBACK(_write) \
- devcb = &tiki100_bus_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tiki100_bus_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_TIKI100_BUS_NMI_CALLBACK(_write) \
- devcb = &tiki100_bus_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tiki100_bus_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_TIKI100_BUS_BUSRQ_CALLBACK(_write) \
- devcb = &tiki100_bus_device::set_busrq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tiki100_bus_device &>(*device).set_busrq_wr_callback(DEVCB_##_write);
#define MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(_read) \
- devcb = &tiki100_bus_device::set_mrq_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<tiki100_bus_device &>(*device).set_mrq_rd_callback(DEVCB_##_read);
#define MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(_write) \
- devcb = &tiki100_bus_device::set_mrq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<tiki100_bus_device &>(*device).set_mrq_wr_callback(DEVCB_##_write);
@@ -142,11 +142,11 @@ public:
tiki100_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~tiki100_bus_device() { m_device_list.detach_all(); }
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<tiki100_bus_device &>(device).m_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<tiki100_bus_device &>(device).m_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_busrq_wr_callback(device_t &device, Object &&cb) { return downcast<tiki100_bus_device &>(device).m_busrq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_mrq_rd_callback(device_t &device, Object &&cb) { return downcast<tiki100_bus_device &>(device).m_in_mrq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_mrq_wr_callback(device_t &device, Object &&cb) { return downcast<tiki100_bus_device &>(device).m_out_mrq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_busrq_wr_callback(Object &&cb) { return m_busrq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_mrq_rd_callback(Object &&cb) { return m_in_mrq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_mrq_wr_callback(Object &&cb) { return m_out_mrq_cb.set_callback(std::forward<Object>(cb)); }
void add_card(device_tiki100bus_card_interface *card);
diff --git a/src/devices/bus/tvc/tvc.h b/src/devices/bus/tvc/tvc.h
index c3e3ea44cf8..9fd9db95e14 100644
--- a/src/devices/bus/tvc/tvc.h
+++ b/src/devices/bus/tvc/tvc.h
@@ -94,8 +94,8 @@ public:
tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~tvcexp_slot_device();
- template <class Object> static devcb_base &set_out_irq_callback(device_t &device, Object &&cb) { return downcast<tvcexp_slot_device &>(device).m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<tvcexp_slot_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
// reading and writing
virtual uint8_t id_r();
@@ -125,9 +125,9 @@ DECLARE_DEVICE_TYPE(TVCEXP_SLOT, tvcexp_slot_device)
***************************************************************************/
#define MCFG_TVCEXP_SLOT_OUT_IRQ_CB(_devcb) \
- devcb = &tvcexp_slot_device::set_out_irq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tvcexp_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
#define MCFG_TVCEXP_SLOT_OUT_NMI_CB(_devcb) \
- devcb = &tvcexp_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<tvcexp_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#endif // MAME_BUS_TVC_TVC_H
diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h
index bc018839989..972dab7ec5e 100644
--- a/src/devices/bus/vcs_ctrl/ctrl.h
+++ b/src/devices/bus/vcs_ctrl/ctrl.h
@@ -27,7 +27,7 @@
#define MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(_write) \
- devcb = &vcs_control_port_device::set_trigger_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vcs_control_port_device &>(*device).set_trigger_wr_callback(DEVCB_##_write);
@@ -70,7 +70,7 @@ public:
vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
- template <class Object> static devcb_base &set_trigger_wr_callback(device_t &device, Object &&cb) { return downcast<vcs_control_port_device &>(device).m_write_trigger.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_trigger_wr_callback(Object &&cb) { return m_write_trigger.set_callback(std::forward<Object>(cb)); }
// computer interface
diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h
index 56fe43d5ef9..dc63a62a936 100644
--- a/src/devices/bus/vic10/exp.h
+++ b/src/devices/bus/vic10/exp.h
@@ -58,16 +58,16 @@
#define MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &vic10_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic10_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_VIC10_EXPANSION_SLOT_RES_CALLBACK(_write) \
- devcb = &vic10_expansion_slot_device::set_res_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic10_expansion_slot_device &>(*device).set_res_wr_callback(DEVCB_##_write);
#define MCFG_VIC10_EXPANSION_SLOT_CNT_CALLBACK(_write) \
- devcb = &vic10_expansion_slot_device::set_cnt_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic10_expansion_slot_device &>(*device).set_cnt_wr_callback(DEVCB_##_write);
#define MCFG_VIC10_EXPANSION_SLOT_SP_CALLBACK(_write) \
- devcb = &vic10_expansion_slot_device::set_sp_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic10_expansion_slot_device &>(*device).set_sp_wr_callback(DEVCB_##_write);
#define MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACKS(_irq, _res) \
@@ -94,10 +94,10 @@ public:
// construction/destruction
vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<vic10_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_res_wr_callback(device_t &device, Object &&cb) { return downcast<vic10_expansion_slot_device &>(device).m_write_res.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_cnt_wr_callback(device_t &device, Object &&cb) { return downcast<vic10_expansion_slot_device &>(device).m_write_cnt.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sp_wr_callback(device_t &device, Object &&cb) { return downcast<vic10_expansion_slot_device &>(device).m_write_sp.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_res_wr_callback(Object &&cb) { return m_write_res.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_cnt_wr_callback(Object &&cb) { return m_write_cnt.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sp_wr_callback(Object &&cb) { return m_write_sp.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram);
diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h
index 559d55f90a0..695db050936 100644
--- a/src/devices/bus/vic20/exp.h
+++ b/src/devices/bus/vic20/exp.h
@@ -63,13 +63,13 @@
#define MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
- devcb = &vic20_expansion_slot_device::set_irq_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic20_expansion_slot_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(_write) \
- devcb = &vic20_expansion_slot_device::set_nmi_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic20_expansion_slot_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);
#define MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(_write) \
- devcb = &vic20_expansion_slot_device::set_res_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vic20_expansion_slot_device &>(*device).set_res_wr_callback(DEVCB_##_write);
@@ -89,9 +89,9 @@ public:
// construction/destruction
vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<vic20_expansion_slot_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_nmi_wr_callback(device_t &device, Object &&cb) { return downcast<vic20_expansion_slot_device &>(device).m_write_nmi.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_res_wr_callback(device_t &device, Object &&cb) { return downcast<vic20_expansion_slot_device &>(device).m_write_res.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_res_wr_callback(Object &&cb) { return m_write_res.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h
index 23ae2108d3e..60d1f90ec32 100644
--- a/src/devices/bus/vidbrain/exp.h
+++ b/src/devices/bus/vidbrain/exp.h
@@ -60,7 +60,7 @@
#define MCFG_VIDEOBRAIN_EXPANSION_SLOT_EXTRES_CALLBACK(_write) \
- devcb = &videobrain_expansion_slot_device::set_extres_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<videobrain_expansion_slot_device &>(*device).set_extres_wr_callback(DEVCB_##_write);
@@ -112,7 +112,7 @@ public:
// construction/destruction
videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_extres_wr_callback(device_t &device, Object &&cb) { return downcast<videobrain_expansion_slot_device &>(device).m_write_extres.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_extres_wr_callback(Object &&cb) { return m_write_extres.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t bo_r(address_space &space, offs_t offset, int cs1, int cs2);
diff --git a/src/devices/bus/vip/exp.h b/src/devices/bus/vip/exp.h
index 9e49ad4b98c..4e864fc0430 100644
--- a/src/devices/bus/vip/exp.h
+++ b/src/devices/bus/vip/exp.h
@@ -57,13 +57,13 @@
#define MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(_write) \
- devcb = &vip_expansion_slot_device::set_int_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vip_expansion_slot_device &>(*device).set_int_wr_callback(DEVCB_##_write);
#define MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(_write) \
- devcb = &vip_expansion_slot_device::set_dma_out_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vip_expansion_slot_device &>(*device).set_dma_out_wr_callback(DEVCB_##_write);
#define MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(_write) \
- devcb = &vip_expansion_slot_device::set_dma_in_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<vip_expansion_slot_device &>(*device).set_dma_in_wr_callback(DEVCB_##_write);
@@ -82,9 +82,9 @@ public:
// construction/destruction
vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_int_wr_callback(device_t &device, Object &&cb) { return downcast<vip_expansion_slot_device &>(device).m_write_int.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_out_wr_callback(device_t &device, Object &&cb) { return downcast<vip_expansion_slot_device &>(device).m_write_dma_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_in_wr_callback(device_t &device, Object &&cb) { return downcast<vip_expansion_slot_device &>(device).m_write_dma_in.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_wr_callback(Object &&cb) { return m_write_int.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_out_wr_callback(Object &&cb) { return m_write_dma_out.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_in_wr_callback(Object &&cb) { return m_write_dma_in.set_callback(std::forward<Object>(cb)); }
// computer interface
uint8_t program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh);
diff --git a/src/devices/bus/vme/vme.cpp b/src/devices/bus/vme/vme.cpp
index 5f4bf5d20a9..d7d549bb34c 100644
--- a/src/devices/bus/vme/vme.cpp
+++ b/src/devices/bus/vme/vme.cpp
@@ -117,22 +117,21 @@ vme_slot_device::vme_slot_device(const machine_config &mconfig, device_type type
}
//-------------------------------------------------
-// static_update_vme_chains
+// update_vme_chains
//-------------------------------------------------
-void vme_slot_device::static_update_vme_chains(device_t &device, uint32_t slot_nbr)
+void vme_slot_device::update_vme_chains(uint32_t slot_nbr)
{
- LOG("%s %s - %d\n", FUNCNAME, device.tag(), slot_nbr);
+ LOG("%s %s - %d\n", FUNCNAME, tag(), slot_nbr);
}
//-------------------------------------------------
-// static_set_vme_slot
+// set_vme_slot
//-------------------------------------------------
-void vme_slot_device::static_set_vme_slot(device_t &device, const char *tag, const char *slottag)
+void vme_slot_device::set_vme_slot(const char *tag, const char *slottag)
{
LOG("%s %s - %s\n", FUNCNAME, tag, slottag);
- vme_slot_device &vme_card = dynamic_cast<vme_slot_device&>(device);
- vme_card.m_vme_tag = tag;
- vme_card.m_vme_slottag = slottag;
+ m_vme_tag = tag;
+ m_vme_slottag = slottag;
}
//-------------------------------------------------
@@ -144,7 +143,7 @@ void vme_slot_device::device_start()
LOG("%s %s - %s:%s\n", tag(), FUNCNAME, m_vme_tag, m_vme_slottag);
if (dev)
{
- device_vme_card_interface::static_set_vme_tag(*dev, m_vme_tag, m_vme_slottag);
+ dev->set_vme_tag(m_vme_tag, m_vme_slottag);
}
// m_card = dynamic_cast<device_vme_card_interface *>(get_card_device());
@@ -212,22 +211,14 @@ device_memory_interface::space_config_vector vme_device::memory_space_config() c
};
}
-// static_set_cputag - used to be able to lookup the CPU owning this VME bus
-void vme_device::static_set_cputag(device_t &device, const char *tag)
-{
- vme_device &vme = downcast<vme_device &>(device);
- vme.m_cputag = tag;
-}
-
-// static_set_use_owner_spaces - disables use of the memory interface and use the address spaces
+// set_use_owner_spaces - disables use of the memory interface and use the address spaces
// of the owner instead. This is useful for VME buses where no address modifiers or arbitration is
// being used and gives some gain in performance.
-void vme_device::static_use_owner_spaces(device_t &device)
+void vme_device::use_owner_spaces()
{
- LOG("%s %s\n", device.tag(), FUNCNAME);
- vme_device &vme = downcast<vme_device &>(device);
+ LOG("%s %s\n", tag(), FUNCNAME);
- vme.m_allocspaces = false;
+ m_allocspaces = false;
}
vme_device::vme_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -418,12 +409,11 @@ device_vme_card_interface::~device_vme_card_interface()
LOG("%s %s\n", m_device->tag(), FUNCNAME);
}
-void device_vme_card_interface::static_set_vme_tag(device_t &device, const char *tag, const char *slottag)
+void device_vme_card_interface::set_vme_tag(const char *tag, const char *slottag)
{
LOG("%s %s\n", tag, FUNCNAME);
- device_vme_card_interface &vme_card = dynamic_cast<device_vme_card_interface &>(device);
- vme_card.m_vme_tag = tag;
- vme_card.m_vme_slottag = slottag;
+ m_vme_tag = tag;
+ m_vme_slottag = slottag;
}
void device_vme_card_interface::set_vme_device()
diff --git a/src/devices/bus/vme/vme.h b/src/devices/bus/vme/vme.h
index 354a1f38978..7fd1a24f9c8 100644
--- a/src/devices/bus/vme/vme.h
+++ b/src/devices/bus/vme/vme.h
@@ -59,7 +59,7 @@
// Callbacks to the board from the VME bus comes through here
#define MCFG_VME_J1_CB(_devcb) \
- devcb = &vme_slot_device::static_set_vme_j1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<vme_slot_device &>(*device).set_vme_j1_callback(DEVCB_##_devcb);
//SLOT_INTERFACE_EXTERN(vme_slot1); // Disabled until we know how to combine a board driver and a slot device.
SLOT_INTERFACE_EXTERN(vme_slots);
@@ -91,10 +91,10 @@ public:
// construction/destruction
vme_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_vme_j1_callback(device_t &device, Object &&cb) { return downcast<vme_slot_device &>(device).m_vme_j1_callback.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_vme_j1_callback(Object &&cb) { return m_vme_j1_callback.set_callback(std::forward<Object>(cb)); }
- static void static_set_vme_slot(device_t &device, const char *tag, const char *slottag);
- static void static_update_vme_chains(device_t &device, uint32_t slot_nbr);
+ void set_vme_slot(const char *tag, const char *slottag);
+ void update_vme_chains(uint32_t slot_nbr);
virtual DECLARE_READ8_MEMBER(read8);
virtual DECLARE_WRITE8_MEMBER(write8);
@@ -124,10 +124,10 @@ DECLARE_DEVICE_TYPE(VME, vme_device)
MCFG_DEVICE_ADD(_tag, VME, 0)
#define MCFG_VME_CPU(_cputag) \
- vme_device::static_set_cputag(*device, _cputag);
+ downcast<vme_device &>(*device).set_cputag(_cputag);
#define MCFG_VME_BUS_OWNER_SPACES() \
- vme_device::static_use_owner_spaces(*device);
+ downcast<vme_device &>(*device).use_owner_spaces();
class vme_card_interface;
@@ -139,8 +139,8 @@ public:
~vme_device();
// inline configuration
- static void static_set_cputag(device_t &device, const char *tag);
- static void static_use_owner_spaces(device_t &device);
+ void set_cputag(const char *tag) { m_cputag = tag; }
+ void use_owner_spaces();
virtual space_config_vector memory_space_config() const override;
@@ -219,7 +219,7 @@ class device_vme_card_interface : public device_slot_card_interface
template <class ElementType> friend class simple_list;
public:
// inline configuration
- static void static_set_vme_tag(device_t &device, const char *tag, const char *slottag);
+ void set_vme_tag(const char *tag, const char *slottag);
// construction/destruction
virtual ~device_vme_card_interface();
@@ -245,8 +245,8 @@ private:
{ std::string stag = "slot" + std::to_string(_slotnbr); \
MCFG_DEVICE_ADD(stag.c_str(), VME_SLOT, 0); \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false); \
- vme_slot_device::static_set_vme_slot(*device, _tag, stag.c_str()); \
- vme_slot_device::static_update_vme_chains(*device, _slotnbr); \
+ downcast<vme_slot_device &>(*device).set_vme_slot(_tag, stag.c_str()); \
+ downcast<vme_slot_device &>(*device).update_vme_chains(_slotnbr); \
}
#define MCFG_VME_SLOT_REMOVE(_tag) \
diff --git a/src/devices/bus/vtech/memexp/memexp.h b/src/devices/bus/vtech/memexp/memexp.h
index 692f10c819a..91737e003bc 100644
--- a/src/devices/bus/vtech/memexp/memexp.h
+++ b/src/devices/bus/vtech/memexp/memexp.h
@@ -47,13 +47,13 @@
MCFG_DEVICE_SLOT_INTERFACE(vtech_memexp_carts, nullptr, false)
#define MCFG_MEMEXP_SLOT_INT_HANDLER(_devcb) \
- devcb = &vtech_memexp_device::set_int_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<vtech_memexp_device &>(*device).set_int_handler(DEVCB_##_devcb);
#define MCFG_MEMEXP_SLOT_NMI_HANDLER(_devcb) \
- devcb = &vtech_memexp_device::set_nmi_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<vtech_memexp_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
#define MCFG_MEMEXP_SLOT_RESET_HANDLER(_devcb) \
- devcb = &vtech_memexp_device::set_reset_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<vtech_memexp_device &>(*device).set_reset_handler(DEVCB_##_devcb);
//**************************************************************************
@@ -74,14 +74,9 @@ public:
void set_io_space(address_space *io);
// callbacks
- template <class Object> static devcb_base &set_int_handler(device_t &device, Object &&cb)
- { return downcast<vtech_memexp_slot_device &>(device).m_int_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
- { return downcast<vtech_memexp_slot_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_reset_handler(device_t &device, Object &&cb)
- { return downcast<vtech_memexp_slot_device &>(device).m_reset_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); }
// called from cart device
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
diff --git a/src/devices/bus/wangpc/wangpc.cpp b/src/devices/bus/wangpc/wangpc.cpp
index 8344178ca8d..b7acf07f94c 100644
--- a/src/devices/bus/wangpc/wangpc.cpp
+++ b/src/devices/bus/wangpc/wangpc.cpp
@@ -35,13 +35,6 @@ wangpcbus_slot_device::wangpcbus_slot_device(const machine_config &mconfig, cons
{
}
-void wangpcbus_slot_device::static_set_wangpcbus_slot(device_t &device, int sid)
-{
- wangpcbus_slot_device &wangpcbus_card = dynamic_cast<wangpcbus_slot_device &>(device);
- wangpcbus_card.m_sid = sid;
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/wangpc/wangpc.h b/src/devices/bus/wangpc/wangpc.h
index 740c7e5ed53..b39c79f12f2 100644
--- a/src/devices/bus/wangpc/wangpc.h
+++ b/src/devices/bus/wangpc/wangpc.h
@@ -35,38 +35,38 @@
#define MCFG_WANGPC_BUS_SLOT_ADD(_tag, _sid, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, WANGPC_BUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- wangpcbus_slot_device::static_set_wangpcbus_slot(*device, _sid);
+ downcast<wangpcbus_slot_device &>(*device).set_wangpcbus_slot(_sid);
#define MCFG_WANGPC_BUS_IRQ2_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq2_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IRQ3_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq3_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq3_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IRQ4_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq4_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq4_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IRQ5_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq5_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq5_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IRQ6_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq6_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq6_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IRQ7_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_irq7_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_irq7_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_DRQ1_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_drq1_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_drq1_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_DRQ2_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_drq2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_drq2_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_DRQ3_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_drq3_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_drq3_wr_callback(DEVCB_##_write);
#define MCFG_WANGPC_BUS_IOERROR_CALLBACK(_write) \
- devcb = &wangpcbus_device::set_ioerror_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<wangpcbus_device &>(*device).set_ioerror_wr_callback(DEVCB_##_write);
//**************************************************************************
@@ -84,7 +84,7 @@ public:
wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- static void static_set_wangpcbus_slot(device_t &device, int sid);
+ void set_wangpcbus_slot(int sid) { m_sid = sid; }
protected:
// device-level overrides
@@ -113,16 +113,16 @@ public:
wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~wangpcbus_device() { m_device_list.detach_all(); }
- template <class Object> static devcb_base &set_irq2_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq3_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq4_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq4.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq5_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq5.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq6_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq6.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_irq7_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_irq7.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq1_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_drq1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq2_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_drq2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_drq3_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_drq3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ioerror_wr_callback(device_t &device, Object &&cb) { return downcast<wangpcbus_device &>(device).m_write_ioerror.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq2_wr_callback(Object &&cb) { return m_write_irq2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq3_wr_callback(Object &&cb) { return m_write_irq3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq4_wr_callback(Object &&cb) { return m_write_irq4.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq5_wr_callback(Object &&cb) { return m_write_irq5.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq6_wr_callback(Object &&cb) { return m_write_irq6.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_irq7_wr_callback(Object &&cb) { return m_write_irq7.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq1_wr_callback(Object &&cb) { return m_write_drq1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq2_wr_callback(Object &&cb) { return m_write_drq2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_drq3_wr_callback(Object &&cb) { return m_write_drq3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ioerror_wr_callback(Object &&cb) { return m_write_ioerror.set_callback(std::forward<Object>(cb)); }
void add_card(device_wangpcbus_card_interface *card, int sid);
diff --git a/src/devices/bus/x68k/x68kexp.h b/src/devices/bus/x68k/x68kexp.h
index bc26bda26d4..3b0a0080e1e 100644
--- a/src/devices/bus/x68k/x68kexp.h
+++ b/src/devices/bus/x68k/x68kexp.h
@@ -78,16 +78,16 @@
//**************************************************************************
#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ2_CB(_devcb) \
- devcb = &x68k_expansion_slot_device::set_out_irq2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<x68k_expansion_slot_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ4_CB(_devcb) \
- devcb = &x68k_expansion_slot_device::set_out_irq4_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<x68k_expansion_slot_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
#define MCFG_X68K_EXPANSION_SLOT_OUT_NMI_CB(_devcb) \
- devcb = &x68k_expansion_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<x68k_expansion_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
#define MCFG_X68K_EXPANSION_SLOT_OUT_RESET_CB(_devcb) \
- devcb = &x68k_expansion_slot_device::set_out_reset_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<x68k_expansion_slot_device &>(*device).set_out_reset_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -126,10 +126,10 @@ public:
x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~x68k_expansion_slot_device();
- template <class Object> static devcb_base &set_out_irq2_callback(device_t &device, Object &&cb) { return downcast<x68k_expansion_slot_device &>(device).m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_irq4_callback(device_t &device, Object &&cb) { return downcast<x68k_expansion_slot_device &>(device).m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_nmi_callback(device_t &device, Object &&cb) { return downcast<x68k_expansion_slot_device &>(device).m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_reset_callback(device_t &device, Object &&cb) { return downcast<x68k_expansion_slot_device &>(device).m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_reset_callback(Object &&cb) { return m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER( irq2_w );
diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h
index 477b98eca7c..8481c3e7780 100644
--- a/src/devices/bus/z88/z88.h
+++ b/src/devices/bus/z88/z88.h
@@ -93,7 +93,7 @@ public:
z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~z88cart_slot_device();
- template <class Object> static devcb_base &set_out_flp_callback(device_t &device, Object &&cb) { return downcast<z88cart_slot_device &>(device).m_out_flp_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_flp_callback(Object &&cb) { return m_out_flp_cb.set_callback(std::forward<Object>(cb)); }
// image-level overrides
virtual image_init_result call_load() override;
@@ -140,6 +140,6 @@ DECLARE_DEVICE_TYPE(Z88CART_SLOT, z88cart_slot_device)
***************************************************************************/
#define MCFG_Z88CART_SLOT_OUT_FLP_CB(_devcb) \
- devcb = &z88cart_slot_device::set_out_flp_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<z88cart_slot_device &>(*device).set_out_flp_callback(DEVCB_##_devcb);
#endif // MAME_BUS_Z88_Z88_H
diff --git a/src/devices/cpu/adsp2100/adsp2100.h b/src/devices/cpu/adsp2100/adsp2100.h
index 4b2cbcd98a8..9a7d8561621 100644
--- a/src/devices/cpu/adsp2100/adsp2100.h
+++ b/src/devices/cpu/adsp2100/adsp2100.h
@@ -181,16 +181,16 @@ enum
//**************************************************************************
#define MCFG_ADSP21XX_SPORT_RX_CB(_devcb) \
- devcb = &adsp21xx_device::set_sport_rx_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<adsp21xx_device &>(*device).set_sport_rx_callback(DEVCB_##_devcb);
#define MCFG_ADSP21XX_SPORT_TX_CB(_devcb) \
- devcb = &adsp21xx_device::set_sport_tx_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<adsp21xx_device &>(*device).set_sport_tx_callback(DEVCB_##_devcb);
#define MCFG_ADSP21XX_TIMER_FIRED_CB(_devcb) \
- devcb = &adsp21xx_device::set_timer_fired_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<adsp21xx_device &>(*device).set_timer_fired_callback(DEVCB_##_devcb);
#define MCFG_ADSP21XX_DMOVLAY_CB(_devcb) \
- devcb = &adsp21xx_device::set_dmovlay_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<adsp21xx_device &>(*device).set_dmovlay_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -204,10 +204,10 @@ public:
virtual ~adsp21xx_device();
// inline configuration helpers
- template <class Object> static devcb_base &set_sport_rx_callback(device_t &device, Object &&cb) { return downcast<adsp21xx_device &>(device).m_sport_rx_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sport_tx_callback(device_t &device, Object &&cb) { return downcast<adsp21xx_device &>(device).m_sport_tx_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_timer_fired_callback(device_t &device, Object &&cb) { return downcast<adsp21xx_device &>(device).m_timer_fired_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dmovlay_callback(device_t &device, Object &&cb) { return downcast<adsp21xx_device &>(device).m_dmovlay_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sport_rx_callback(Object &&cb) { return m_sport_rx_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sport_tx_callback(Object &&cb) { return m_sport_tx_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_timer_fired_callback(Object &&cb) { return m_timer_fired_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dmovlay_callback(Object &&cb) { return m_dmovlay_cb.set_callback(std::forward<Object>(cb)); }
// public interfaces
void load_boot_data(uint8_t *srcdata, uint32_t *dstdata);
diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h
index 3dfa68262ba..b592bdd9466 100644
--- a/src/devices/cpu/amis2000/amis2000.h
+++ b/src/devices/cpu/amis2000/amis2000.h
@@ -14,43 +14,43 @@
// generic input pins (4 bits each)
#define MCFG_AMI_S2000_READ_K_CB(_devcb) \
- devcb = &amis2000_base_device::set_read_k_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_read_k_callback(DEVCB_##_devcb);
#define MCFG_AMI_S2000_READ_I_CB(_devcb) \
- devcb = &amis2000_base_device::set_read_i_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_read_i_callback(DEVCB_##_devcb);
// 8-bit external databus coupled as input/output pins
#define MCFG_AMI_S2000_READ_D_CB(_devcb) \
- devcb = &amis2000_base_device::set_read_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_read_d_callback(DEVCB_##_devcb);
#define MCFG_AMI_S2000_WRITE_D_CB(_devcb) \
- devcb = &amis2000_base_device::set_write_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_write_d_callback(DEVCB_##_devcb);
// 13-bit external address bus coupled as output pins
#define MCFG_AMI_S2000_WRITE_A_CB(_devcb) \
- devcb = &amis2000_base_device::set_write_a_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_write_a_callback(DEVCB_##_devcb);
// F_out pin (only for S2152)
#define MCFG_AMI_S2152_FOUT_CB(_devcb) \
- devcb = &amis2000_base_device::set_write_f_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<amis2000_base_device &>(*device).set_write_f_callback(DEVCB_##_devcb);
// S2000 has a hardcoded 7seg table, that (unlike S2200) is officially
// uncustomizable, but wildfire proves to be an exception to that rule.
#define MCFG_AMI_S2000_7SEG_DECODER(_ptr) \
- amis2000_base_device::set_7seg_table(*device, _ptr);
+ downcast<amis2000_base_device &>(*device).set_7seg_table(_ptr);
class amis2000_base_device : public cpu_device
{
public:
- // static configuration helpers
- template <class Object> static devcb_base &set_read_k_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_read_k.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_i_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_read_i.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_d_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_read_d.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_d_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_write_d.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_a_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_write_a.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_f_callback(device_t &device, Object &&cb) { return downcast<amis2000_base_device &>(device).m_write_f.set_callback(std::forward<Object>(cb)); }
- static void set_7seg_table(device_t &device, const u8 *ptr) { downcast<amis2000_base_device &>(device).m_7seg_table = ptr; }
+ // configuration helpers
+ template <class Object> devcb_base &set_read_k_callback(Object &&cb) { return m_read_k.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_i_callback(Object &&cb) { return m_read_i.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_a_callback(Object &&cb) { return m_write_a.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_f_callback(Object &&cb) { return m_write_f.set_callback(std::forward<Object>(cb)); }
+ void set_7seg_table(const u8 *ptr) { m_7seg_table = ptr; }
void data_64x4(address_map &map);
void data_80x4(address_map &map);
diff --git a/src/devices/cpu/apexc/apexc.h b/src/devices/cpu/apexc/apexc.h
index 46b45e7bc2c..daa42e8ddd8 100644
--- a/src/devices/cpu/apexc/apexc.h
+++ b/src/devices/cpu/apexc/apexc.h
@@ -7,10 +7,10 @@
#pragma once
#define MCFG_APEXC_TAPE_READ_CB(_devcb) \
- devcb = &apexc_cpu_device::set_tape_read_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<apexc_cpu_device &>(*device).set_tape_read_cb(DEVCB_##_devcb);
#define MCFG_APEXC_TAPE_PUNCH_CB(_devcb) \
- devcb = &apexc_cpu_device::set_tape_punch_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<apexc_cpu_device &>(*device).set_tape_punch_cb(DEVCB_##_devcb);
enum
{
@@ -28,17 +28,9 @@ public:
// construction/destruction
apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration
- template<class Object>
- static devcb_base &set_tape_read_cb(device_t &device, Object &&object)
- {
- return downcast<apexc_cpu_device &>(device).m_tape_read_cb.set_callback(std::forward<Object>(object));
- }
- template<class Object>
- static devcb_base &set_tape_punch_cb(device_t &device, Object &&object)
- {
- return downcast<apexc_cpu_device &>(device).m_tape_punch_cb.set_callback(std::forward<Object>(object));
- }
+ // configuration
+ template<class Object> devcb_base &set_tape_read_cb(Object &&object) { return m_tape_read_cb.set_callback(std::forward<Object>(object)); }
+ template<class Object> devcb_base &set_tape_punch_cb(Object &&object) { return m_tape_punch_cb.set_callback(std::forward<Object>(object)); }
protected:
// device-level overrides
diff --git a/src/devices/cpu/arm/arm.h b/src/devices/cpu/arm/arm.h
index 3cfb1386fa9..e1795f0594d 100644
--- a/src/devices/cpu/arm/arm.h
+++ b/src/devices/cpu/arm/arm.h
@@ -17,7 +17,7 @@
***************************************************************************************************/
#define MCFG_ARM_COPRO(_type) \
- arm_cpu_device::set_copro_type(*device, arm_cpu_device::copro_type::_type);
+ downcast<arm_cpu_device &>(*device).set_copro_type(arm_cpu_device::copro_type::_type);
class arm_cpu_device : public cpu_device
@@ -32,7 +32,7 @@ public:
// construction/destruction
arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_copro_type(device_t &device, copro_type type) { downcast<arm_cpu_device &>(device).m_copro_type = type; }
+ void set_copro_type(copro_type type) { m_copro_type = type; }
protected:
enum
diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h
index a1b4dc04a25..def6bed007b 100644
--- a/src/devices/cpu/arm7/arm7.h
+++ b/src/devices/cpu/arm7/arm7.h
@@ -34,7 +34,7 @@
#define ARM7_MAX_HOTSPOTS 16
#define MCFG_ARM_HIGH_VECTORS() \
- arm7_cpu_device::set_high_vectors(*device);
+ downcast<arm7_cpu_device &>(*device).set_high_vectors();
/***************************************************************************
@@ -57,11 +57,7 @@ public:
// construction/destruction
arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_high_vectors(device_t &device)
- {
- arm7_cpu_device &dev = downcast<arm7_cpu_device &>(device);
- dev.m_vectorbase = 0xffff0000;
- }
+ void set_high_vectors() { m_vectorbase = 0xffff0000; }
protected:
enum
diff --git a/src/devices/cpu/arm7/lpc210x.h b/src/devices/cpu/arm7/lpc210x.h
index fa5a20999d0..afcc4a57795 100644
--- a/src/devices/cpu/arm7/lpc210x.h
+++ b/src/devices/cpu/arm7/lpc210x.h
@@ -23,9 +23,6 @@ class lpc210x_device : public arm7_cpu_device
public:
lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
- // static configuration helpers
-
-
DECLARE_READ32_MEMBER(arm_E01FC088_r);
DECLARE_READ32_MEMBER(flash_r);
DECLARE_WRITE32_MEMBER(flash_w);
diff --git a/src/devices/cpu/avr8/avr8.h b/src/devices/cpu/avr8/avr8.h
index 344c9ca317b..b898f4efc34 100644
--- a/src/devices/cpu/avr8/avr8.h
+++ b/src/devices/cpu/avr8/avr8.h
@@ -64,7 +64,7 @@
//**************************************************************************
#define MCFG_CPU_AVR8_EEPROM(_tag) \
- avr8_device::set_eeprom_tag(*device, "^" _tag);
+ downcast<avr8_device &>(*device).set_eeprom_tag("^" _tag);
//**************************************************************************
@@ -80,7 +80,7 @@ class avr8_device : public cpu_device
{
public:
// inline configuration helpers
- static void set_eeprom_tag(device_t &device, const char *tag) { downcast<avr8_device &>(device).m_eeprom.set_tag(tag); }
+ void set_eeprom_tag(const char *tag) { m_eeprom.set_tag(tag); }
// fuse configs
void set_low_fuses(uint8_t byte);
diff --git a/src/devices/cpu/ccpu/ccpu.h b/src/devices/cpu/ccpu/ccpu.h
index 4cad4d66965..6510250e233 100644
--- a/src/devices/cpu/ccpu/ccpu.h
+++ b/src/devices/cpu/ccpu/ccpu.h
@@ -23,10 +23,10 @@
#define MCFG_CCPU_EXTERNAL_FUNC(_devcb) \
- ccpu_cpu_device::set_external_func(*device, DEVCB_##_devcb);
+ downcast<ccpu_cpu_device &>(*device).set_external_func(DEVCB_##_devcb);
#define MCFG_CCPU_VECTOR_FUNC(d) \
- ccpu_cpu_device::set_vector_func(*device, d);
+ downcast<ccpu_cpu_device &>(*device).set_vector_func(d);
class ccpu_cpu_device : public cpu_device
@@ -53,9 +53,9 @@ public:
// construction/destruction
ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_external_func(device_t &device, Object &&cb) { return downcast<ccpu_cpu_device &>(device).m_external_input.set_callback(std::forward<Object>(cb)); }
- static void set_vector_func(device_t &device, vector_delegate callback) { downcast<ccpu_cpu_device &>(device).m_vector_callback = callback; }
+ // configuration helpers
+ template <class Object> devcb_base &set_external_func(Object &&cb) { return m_external_input.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> void set_vector_func(Object &&cb) { m_vector_callback = std::forward<Object>(cb); }
DECLARE_READ8_MEMBER( read_jmi );
void wdt_timer_trigger();
diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h
index 3630c2c41b7..643f6129fe1 100644
--- a/src/devices/cpu/cop400/cop400.h
+++ b/src/devices/cpu/cop400/cop400.h
@@ -17,40 +17,40 @@
// L pins: 8-bit bi-directional
#define MCFG_COP400_READ_L_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_l_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_l_callback(DEVCB_##_devcb);
#define MCFG_COP400_WRITE_L_CB(_devcb) \
- devcb = &cop400_cpu_device::set_write_l_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_write_l_callback(DEVCB_##_devcb);
// output state when pins are in tri-state, default 0
#define MCFG_COP400_READ_L_TRISTATE_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_l_tristate_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_l_tristate_callback(DEVCB_##_devcb);
// G pins: 4-bit bi-directional
#define MCFG_COP400_READ_G_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_g_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_g_callback(DEVCB_##_devcb);
#define MCFG_COP400_WRITE_G_CB(_devcb) \
- devcb = &cop400_cpu_device::set_write_g_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_write_g_callback(DEVCB_##_devcb);
// D outputs: 4-bit general purpose output
#define MCFG_COP400_WRITE_D_CB(_devcb) \
- devcb = &cop400_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_write_d_callback(DEVCB_##_devcb);
// IN inputs: 4-bit general purpose input
#define MCFG_COP400_READ_IN_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_in_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_in_callback(DEVCB_##_devcb);
// SI/SO lines: serial in/out or counter/gen.purpose
#define MCFG_COP400_READ_SI_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_si_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
#define MCFG_COP400_WRITE_SO_CB(_devcb) \
- devcb = &cop400_cpu_device::set_write_so_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
// SK output line: logic-controlled clock or gen.purpose
#define MCFG_COP400_WRITE_SK_CB(_devcb) \
- devcb = &cop400_cpu_device::set_write_sk_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_write_sk_callback(DEVCB_##_devcb);
// CKI/CKO lines: only CKO input here
#define MCFG_COP400_READ_CKO_CB(_devcb) \
- devcb = &cop400_cpu_device::set_read_cko_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<cop400_cpu_device &>(*device).set_read_cko_callback(DEVCB_##_devcb);
/***************************************************************************
@@ -112,9 +112,9 @@ enum cop400_cko_bond {
#define MCFG_COP400_CONFIG(_cki, _cko, _microbus) \
- cop400_cpu_device::set_cki(*device, _cki); \
- cop400_cpu_device::set_cko(*device, _cko); \
- cop400_cpu_device::set_microbus(*device, _microbus);
+ downcast<cop400_cpu_device &>(*device).set_cki(_cki); \
+ downcast<cop400_cpu_device &>(*device).set_cko(_cko); \
+ downcast<cop400_cpu_device &>(*device).set_microbus(_microbus);
class cop400_cpu_device : public cpu_device
@@ -122,22 +122,22 @@ class cop400_cpu_device : public cpu_device
public:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
- // static configuration helpers
- template<class _Object> static devcb_base &set_read_l_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_l.set_callback(object); }
- template<class _Object> static devcb_base &set_read_l_tristate_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_l_tristate.set_callback(object); }
- template<class _Object> static devcb_base &set_write_l_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_l.set_callback(object); }
- template<class _Object> static devcb_base &set_read_g_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_g.set_callback(object); }
- template<class _Object> static devcb_base &set_write_g_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_g.set_callback(object); }
- template<class _Object> static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_d.set_callback(object); }
- template<class _Object> static devcb_base &set_read_in_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_in.set_callback(object); }
- template<class _Object> static devcb_base &set_read_si_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_si.set_callback(object); }
- template<class _Object> static devcb_base &set_write_so_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_so.set_callback(object); }
- template<class _Object> static devcb_base &set_write_sk_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_write_sk.set_callback(object); }
- template<class _Object> static devcb_base &set_read_cko_callback(device_t &device, _Object object) { return downcast<cop400_cpu_device &>(device).m_read_cko.set_callback(object); }
-
- static void set_cki(device_t &device, cop400_cki_bond cki) { downcast<cop400_cpu_device &>(device).m_cki = cki; }
- static void set_cko(device_t &device, cop400_cko_bond cko) { downcast<cop400_cpu_device &>(device).m_cko = cko; }
- static void set_microbus(device_t &device, bool has_microbus) { downcast<cop400_cpu_device &>(device).m_has_microbus = has_microbus; }
+ // configuration helpers
+ template<class Object> devcb_base &set_read_l_callback(Object &&cb) { return m_read_l.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_read_l_tristate_callback(Object &&cb) { return m_read_l_tristate.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_write_l_callback(Object &&cb) { return m_write_l.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_read_g_callback(Object &&cb) { return m_read_g.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_write_g_callback(Object &&cb) { return m_write_g.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_read_in_callback(Object &&cb) { return m_read_in.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_read_si_callback(Object &&cb) { return m_read_si.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_write_so_callback(Object &&cb) { return m_write_so.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_write_sk_callback(Object &&cb) { return m_write_sk.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_read_cko_callback(Object &&cb) { return m_read_cko.set_callback(std::forward<Object>(cb)); }
+
+ void set_cki(cop400_cki_bond cki) { m_cki = cki; }
+ void set_cko(cop400_cko_bond cko) { m_cko = cko; }
+ void set_microbus(bool has_microbus) { m_has_microbus = has_microbus; }
DECLARE_READ8_MEMBER( microbus_rd );
DECLARE_WRITE8_MEMBER( microbus_wr );
diff --git a/src/devices/cpu/cosmac/cosmac.h b/src/devices/cpu/cosmac/cosmac.h
index 515dde74d45..161b3ea7d5c 100644
--- a/src/devices/cpu/cosmac/cosmac.h
+++ b/src/devices/cpu/cosmac/cosmac.h
@@ -88,34 +88,34 @@
//**************************************************************************
#define MCFG_COSMAC_WAIT_CALLBACK(_read) \
- devcb = &cosmac_device::set_wait_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_wait_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_CLEAR_CALLBACK(_read) \
- devcb = &cosmac_device::set_clear_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_clear_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_EF1_CALLBACK(_read) \
- devcb = &cosmac_device::set_ef1_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_ef1_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_EF2_CALLBACK(_read) \
- devcb = &cosmac_device::set_ef2_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_ef2_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_EF3_CALLBACK(_read) \
- devcb = &cosmac_device::set_ef3_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_ef3_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_EF4_CALLBACK(_read) \
- devcb = &cosmac_device::set_ef4_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_ef4_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_Q_CALLBACK(_write) \
- devcb = &cosmac_device::set_q_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cosmac_device &>(*device).set_q_wr_callback(DEVCB_##_write);
#define MCFG_COSMAC_DMAR_CALLBACK(_read) \
- devcb = &cosmac_device::set_dma_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<cosmac_device &>(*device).set_dma_rd_callback(DEVCB_##_read);
#define MCFG_COSMAC_DMAW_CALLBACK(_write) \
- devcb = &cosmac_device::set_dma_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cosmac_device &>(*device).set_dma_wr_callback(DEVCB_##_write);
#define MCFG_COSMAC_SC_CALLBACK(_write) \
- devcb = &cosmac_device::set_sc_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<cosmac_device &>(*device).set_sc_wr_callback(DEVCB_##_write);
@@ -193,16 +193,16 @@ public:
};
- template <class Object> static devcb_base &set_wait_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_wait.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_clear_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_clear.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ef1_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_ef1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ef2_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_ef2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ef3_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_ef3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ef4_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_ef4.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_q_wr_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_write_q.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_rd_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_read_dma.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dma_wr_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_write_dma.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_sc_wr_callback(device_t &device, Object &&cb) { return downcast<cosmac_device &>(device).m_write_sc.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_wait_rd_callback(Object &&cb) { return m_read_wait.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_clear_rd_callback(Object &&cb) { return m_read_clear.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ef1_rd_callback(Object &&cb) { return m_read_ef1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ef2_rd_callback(Object &&cb) { return m_read_ef2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ef3_rd_callback(Object &&cb) { return m_read_ef3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ef4_rd_callback(Object &&cb) { return m_read_ef4.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_q_wr_callback(Object &&cb) { return m_write_q.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_rd_callback(Object &&cb) { return m_read_dma.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dma_wr_callback(Object &&cb) { return m_write_dma.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_sc_wr_callback(Object &&cb) { return m_write_sc.set_callback(std::forward<Object>(cb)); }
// public interfaces
offs_t get_memory_address();
diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.h b/src/devices/cpu/cubeqcpu/cubeqcpu.h
index 46b3235c6be..90f5b5250c0 100644
--- a/src/devices/cpu/cubeqcpu/cubeqcpu.h
+++ b/src/devices/cpu/cubeqcpu/cubeqcpu.h
@@ -18,16 +18,16 @@
#define MCFG_CQUESTSND_CONFIG(_dac_w, _sound_tag) \
- cquestsnd_cpu_device::set_dac_w(*device, DEVCB_##_dac_w); \
- cquestsnd_cpu_device::set_sound_region(*device, _sound_tag);
+ downcast<cquestsnd_cpu_device &>(*device).set_dac_w(DEVCB_##_dac_w); \
+ downcast<cquestsnd_cpu_device &>(*device).set_sound_region(_sound_tag);
#define MCFG_CQUESTROT_CONFIG(_linedata_w) \
- cquestrot_cpu_device::set_linedata_w(*device, DEVCB_##_linedata_w );
+ downcast<cquestrot_cpu_device &>(*device).set_linedata_w(DEVCB_##_linedata_w );
#define MCFG_CQUESTLIN_CONFIG(_linedata_r) \
- cquestlin_cpu_device::set_linedata_r(*device, DEVCB_##_linedata_r );
+ downcast<cquestlin_cpu_device &>(*device).set_linedata_r(DEVCB_##_linedata_r );
/***************************************************************************
@@ -40,9 +40,9 @@ public:
// construction/destruction
cquestsnd_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_dac_w(device_t &device, Object &&cb) { return downcast<cquestsnd_cpu_device &>(device).m_dac_w.set_callback(std::forward<Object>(cb)); }
- static void set_sound_region(device_t &device, const char *tag) { downcast<cquestsnd_cpu_device &>(device).m_sound_region_tag = tag; }
+ // configuration helpers
+ template <class Object> devcb_base &set_dac_w(Object &&cb) { return m_dac_w.set_callback(std::forward<Object>(cb)); }
+ void set_sound_region(const char *tag) { m_sound_region_tag = tag; }
DECLARE_WRITE16_MEMBER(sndram_w);
DECLARE_READ16_MEMBER(sndram_r);
@@ -131,8 +131,8 @@ public:
// construction/destruction
cquestrot_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_linedata_w(device_t &device, Object &&cb) { return downcast<cquestrot_cpu_device &>(device).m_linedata_w.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_linedata_w(Object &&cb) { return m_linedata_w.set_callback(std::forward<Object>(cb)); }
DECLARE_READ16_MEMBER(linedata_r);
DECLARE_WRITE16_MEMBER(rotram_w);
@@ -243,8 +243,8 @@ public:
// construction/destruction
cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_linedata_r(device_t &device, Object &&cb) { return downcast<cquestlin_cpu_device &>(device).m_linedata_r.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_linedata_r(Object &&cb) { return m_linedata_r.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE16_MEMBER( linedata_w );
void cubeqcpu_swap_line_banks();
diff --git a/src/devices/cpu/dsp32/dsp32.h b/src/devices/cpu/dsp32/dsp32.h
index 8f8ad369736..1a091fb1c95 100644
--- a/src/devices/cpu/dsp32/dsp32.h
+++ b/src/devices/cpu/dsp32/dsp32.h
@@ -31,7 +31,7 @@ const int DSP32_OUTPUT_PDF = 0x02;
//**************************************************************************
#define MCFG_DSP32C_OUTPUT_CALLBACK(_write) \
- devcb = &dsp32c_device::set_output_pins_callback(*device, DEVCB_##_write);
+ devcb = &downcast<dsp32c_device &>(*device).set_output_pins_callback(DEVCB_##_write);
// ======================> dsp32c_device
@@ -41,7 +41,7 @@ public:
// construction/destruction
dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_output_pins_callback(device_t &device, Object &&cb) { return downcast<dsp32c_device &>(device).m_output_pins_changed.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_output_pins_callback(Object &&cb) { return m_output_pins_changed.set_callback(std::forward<Object>(cb)); }
// public interfaces
diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h
index d6e35ab2fbf..7e9c4d0f91b 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.h
+++ b/src/devices/cpu/e0c6200/e0c6s46.h
@@ -16,7 +16,7 @@
// 5 4-bit R output ports
#define MCFG_E0C6S46_WRITE_R_CB(R, _devcb) \
- devcb = &e0c6s46_device::set_write_r##R##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<e0c6s46_device &>(*device).set_write_r##R##_callback(DEVCB_##_devcb);
enum
{
@@ -29,9 +29,9 @@ enum
// 4 4-bit P I/O ports
#define MCFG_E0C6S46_READ_P_CB(R, _devcb) \
- devcb = &hmcs40_cpu_device::set_read_r##P##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hmcs40_cpu_device &>(*device).set_read_r##P##_callback(DEVCB_##_devcb);
#define MCFG_E0C6S46_WRITE_P_CB(R, _devcb) \
- devcb = &e0c6s46_device::set_write_r##P##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<e0c6s46_device &>(*device).set_write_r##P##_callback(DEVCB_##_devcb);
enum
{
@@ -57,7 +57,7 @@ enum
// lcd driver
#define MCFG_E0C6S46_PIXEL_UPDATE_CB(_class, _method) \
- e0c6s46_device::static_set_pixel_update_cb(*device, e0c6s46_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<e0c6s46_device &>(*device).set_pixel_update_cb(e0c6s46_device::pixel_update_delegate(&_class::_method, #_class "::" #_method, this));
#define E0C6S46_PIXEL_UPDATE(name) void name(bitmap_ind16 &bitmap, const rectangle &cliprect, int contrast, int seg, int com, int state)
@@ -69,23 +69,23 @@ public:
e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_write_r0_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_r0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r1_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_r1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r2_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_r2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r3_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_r3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r4_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_r4.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_read_p0_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_read_p0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_p1_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_read_p1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_p2_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_read_p2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_p3_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_read_p3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_p0_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_p0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_p1_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_p1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_p2_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_p2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_p3_callback(device_t &device, Object &&cb) { return downcast<e0c6s46_device &>(device).m_write_p3.set_callback(std::forward<Object>(cb)); }
-
- static void static_set_pixel_update_cb(device_t &device, pixel_update_delegate &&cb) { downcast<e0c6s46_device &>(device).m_pixel_update_cb = std::move(cb); }
+ // configuration helpers
+ template <class Object> devcb_base &set_write_r0_callback(Object &&cb) { return m_write_r0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r1_callback(Object &&cb) { return m_write_r1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r2_callback(Object &&cb) { return m_write_r2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r3_callback(Object &&cb) { return m_write_r3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r4_callback(Object &&cb) { return m_write_r4.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_read_p0_callback(Object &&cb) { return m_read_p0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_p1_callback(Object &&cb) { return m_read_p1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_p2_callback(Object &&cb) { return m_read_p2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_p3_callback(Object &&cb) { return m_read_p3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_p0_callback(Object &&cb) { return m_write_p0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_p1_callback(Object &&cb) { return m_write_p1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_p2_callback(Object &&cb) { return m_write_p2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_p3_callback(Object &&cb) { return m_write_p3.set_callback(std::forward<Object>(cb)); }
+
+ template <typename Object> void set_pixel_update_cb(Object &&cb) { m_pixel_update_cb = std::forward<Object>(cb); }
DECLARE_READ8_MEMBER(io_r);
DECLARE_WRITE8_MEMBER(io_w);
diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h
index 13320e82a12..d913861cb01 100644
--- a/src/devices/cpu/esrip/esrip.h
+++ b/src/devices/cpu/esrip/esrip.h
@@ -20,19 +20,19 @@
#define ESRIP_DRAW(name) int name(int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank)
#define MCFG_ESRIP_FDT_R_CALLBACK(_read) \
- devcb = &esrip_device::static_set_fdt_r_callback(*device, DEVCB_##_read);
+ devcb = &downcast<esrip_device &>(*device).set_fdt_r_callback(DEVCB_##_read);
#define MCFG_ESRIP_FDT_W_CALLBACK(_write) \
- devcb = &esrip_device::static_set_fdt_w_callback(*device, DEVCB_##_write);
+ devcb = &downcast<esrip_device &>(*device).set_fdt_w_callback(DEVCB_##_write);
#define MCFG_ESRIP_STATUS_IN_CALLBACK(_read) \
- devcb = &esrip_device::static_set_status_in_callback(*device, DEVCB_##_read);
+ devcb = &downcast<esrip_device &>(*device).set_status_in_callback(DEVCB_##_read);
#define MCFG_ESRIP_DRAW_CALLBACK_OWNER(_class, _method) \
- esrip_device::static_set_draw_callback(*device, esrip_device::draw_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<esrip_device &>(*device).set_draw_callback(esrip_device::draw_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_ESRIP_LBRM_PROM(_tag) \
- esrip_device::static_lbrm_prom(*device, _tag);
+ downcast<esrip_device &>(*device).lbrm_prom(_tag);
//**************************************************************************
@@ -54,11 +54,11 @@ public:
esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- template <class Object> static devcb_base &static_set_fdt_r_callback(device_t &device, Object &&cb) { return downcast<esrip_device &>(device).m_fdt_r.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_fdt_w_callback(device_t &device, Object &&cb) { return downcast<esrip_device &>(device).m_fdt_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_status_in_callback(device_t &device, Object &&cb) { return downcast<esrip_device &>(device).m_status_in.set_callback(std::forward<Object>(cb)); }
- static void static_set_draw_callback(device_t &device, draw_delegate func) { downcast<esrip_device &>(device).m_draw = func; }
- static void static_lbrm_prom(device_t &device, const char *name) { downcast<esrip_device &>(device).m_lbrm_prom = name; }
+ template <class Object> devcb_base &set_fdt_r_callback(Object &&cb) { return m_fdt_r.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_fdt_w_callback(Object &&cb) { return m_fdt_w.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_status_in_callback(Object &&cb) { return m_status_in.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> void set_draw_callback(Object &&cb) { m_draw = std::forward<Object>(cb); }
+ void lbrm_prom(const char *name) { m_lbrm_prom = name; }
// public interfaces
uint8_t get_rip_status();
diff --git a/src/devices/cpu/h8/h83002.h b/src/devices/cpu/h8/h83002.h
index 613611c92ba..457e604aa21 100644
--- a/src/devices/cpu/h8/h83002.h
+++ b/src/devices/cpu/h8/h83002.h
@@ -26,16 +26,16 @@
#include "h8_watchdog.h"
#define MCFG_H83002_TEND0_CALLBACK(_devcb) \
- devcb = &h83002_device::set_tend0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<h83002_device &>(*device).set_tend0_callback(DEVCB_##_devcb);
#define MCFG_H83002_TEND1_CALLBACK(_devcb) \
- devcb = &h83002_device::set_tend1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<h83002_device &>(*device).set_tend1_callback(DEVCB_##_devcb);
class h83002_device : public h8h_device {
public:
h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class _Object> static devcb_base &set_tend0_callback(device_t &device, _Object object) { return downcast<h83002_device&>(device).tend0_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_tend1_callback(device_t &device, _Object object) { return downcast<h83002_device&>(device).tend1_cb.set_callback(object); }
+ template<class Object> devcb_base &set_tend0_callback(Object &&cb) { return tend0_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_tend1_callback(Object &&cb) { return tend1_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER(syscr_r);
DECLARE_WRITE8_MEMBER(syscr_w);
diff --git a/src/devices/cpu/h8/h8_sci.h b/src/devices/cpu/h8/h8_sci.h
index ea13f1f65a2..3c2db4147df 100644
--- a/src/devices/cpu/h8/h8_sci.h
+++ b/src/devices/cpu/h8/h8_sci.h
@@ -25,10 +25,10 @@
downcast<h8_sci_device *>(device)->set_external_clock_period(_period);
#define MCFG_H8_SCI_TX_CALLBACK(_devcb) \
- devcb = &h8_sci_device::set_tx_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<h8_sci_device &>(*device).set_tx_cb(DEVCB_##_devcb);
#define MCFG_H8_SCI_CLK_CALLBACK(_devcb) \
- devcb = &h8_sci_device::set_clk_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<h8_sci_device &>(*device).set_clk_cb(DEVCB_##_devcb);
class h8_sci_device : public device_t {
public:
@@ -54,8 +54,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(rx_w);
DECLARE_WRITE_LINE_MEMBER(clk_w);
- template <class Object> static devcb_base &set_tx_cb(device_t &device, Object &&cb) { return downcast<h8_sci_device &>(device).tx_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_clk_cb(device_t &device, Object &&cb) { return downcast<h8_sci_device &>(device).clk_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_tx_cb(Object &&cb) { return tx_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_clk_cb(Object &&cb) { return clk_cb.set_callback(std::forward<Object>(cb)); }
uint64_t internal_update(uint64_t current_time);
diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h
index 1b7fb74feba..def79f44681 100644
--- a/src/devices/cpu/hcd62121/hcd62121.h
+++ b/src/devices/cpu/hcd62121/hcd62121.h
@@ -6,12 +6,12 @@
#pragma once
-#define MCFG_HCD62121_KOL_CB(_devcb) devcb = &hcd62121_cpu_device::set_kol_callback(*device, DEVCB_##_devcb);
-#define MCFG_HCD62121_KOH_CB(_devcb) devcb = &hcd62121_cpu_device::set_koh_callback(*device, DEVCB_##_devcb);
-#define MCFG_HCD62121_PORT_CB(_devcb) devcb = &hcd62121_cpu_device::set_port_callback(*device, DEVCB_##_devcb);
-#define MCFG_HCD62121_OPT_CB(_devcb) devcb = &hcd62121_cpu_device::set_opt_callback(*device, DEVCB_##_devcb);
-#define MCFG_HCD62121_KI_CB(_devcb) devcb = &hcd62121_cpu_device::set_ki_callback(*device, DEVCB_##_devcb);
-#define MCFG_HCD62121_IN0_CB(_devcb) devcb = &hcd62121_cpu_device::set_in0_callback(*device, DEVCB_##_devcb);
+#define MCFG_HCD62121_KOL_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_kol_callback(DEVCB_##_devcb);
+#define MCFG_HCD62121_KOH_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_koh_callback(DEVCB_##_devcb);
+#define MCFG_HCD62121_PORT_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_port_callback(DEVCB_##_devcb);
+#define MCFG_HCD62121_OPT_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_opt_callback(DEVCB_##_devcb);
+#define MCFG_HCD62121_KI_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_ki_callback(DEVCB_##_devcb);
+#define MCFG_HCD62121_IN0_CB(_devcb) devcb = &downcast<hcd62121_cpu_device &>(*device).set_in0_callback(DEVCB_##_devcb);
class hcd62121_cpu_device : public cpu_device
@@ -20,12 +20,12 @@ public:
// construction/destruction
hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_kol_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_kol_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_koh_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_koh_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_port_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_port_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_opt_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_opt_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ki_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_ki_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_in0_callback(device_t &device, Object &&cb) { return downcast<hcd62121_cpu_device &>(device).m_in0_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_kol_callback(Object &&cb) { return m_kol_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_koh_callback(Object &&cb) { return m_koh_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_port_callback(Object &&cb) { return m_port_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_opt_callback(Object &&cb) { return m_opt_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ki_callback(Object &&cb) { return m_ki_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_in0_callback(Object &&cb) { return m_in0_cb.set_callback(std::forward<Object>(cb)); }
protected:
enum
diff --git a/src/devices/cpu/hd61700/hd61700.h b/src/devices/cpu/hd61700/hd61700.h
index 12da10dece3..971de2fb179 100644
--- a/src/devices/cpu/hd61700/hd61700.h
+++ b/src/devices/cpu/hd61700/hd61700.h
@@ -16,25 +16,25 @@
//**************************************************************************
#define MCFG_HD61700_LCD_CTRL_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_lcd_ctrl_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_lcd_ctrl_callback(DEVCB_##_devcb);
#define MCFG_HD61700_LCD_WRITE_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_lcd_write_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_lcd_write_callback(DEVCB_##_devcb);
#define MCFG_HD61700_LCD_READ_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_lcd_read_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_lcd_read_callback(DEVCB_##_devcb);
#define MCFG_HD61700_KB_WRITE_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_kb_write_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_kb_write_callback(DEVCB_##_devcb);
#define MCFG_HD61700_KB_READ_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_kb_read_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_kb_read_callback(DEVCB_##_devcb);
#define MCFG_HD61700_PORT_WRITE_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_port_write_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_port_write_callback(DEVCB_##_devcb);
#define MCFG_HD61700_PORT_READ_CB(_devcb) \
- devcb = &hd61700_cpu_device::set_port_read_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hd61700_cpu_device &>(*device).set_port_read_callback(DEVCB_##_devcb);
//**************************************************************************
@@ -61,13 +61,13 @@ public:
// construction/destruction
hd61700_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock);
- template<class _Object> static devcb_base &set_lcd_ctrl_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_lcd_ctrl_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_lcd_write_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_lcd_write_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_lcd_read_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_lcd_read_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_kb_write_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_kb_write_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_kb_read_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_kb_read_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_port_write_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_port_write_cb.set_callback(object); }
- template<class _Object> static devcb_base &set_port_read_callback(device_t &device, _Object object) { return downcast<hd61700_cpu_device &>(device).m_port_read_cb.set_callback(object); }
+ template<class Object> devcb_base &set_lcd_ctrl_callback(Object &&cb) { return m_lcd_ctrl_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_lcd_write_callback(Object &&cb) { return m_lcd_write_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_lcd_read_callback(Object &&cb) { return m_lcd_read_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_kb_write_callback(Object &&cb) { return m_kb_write_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_kb_read_callback(Object &&cb) { return m_kb_read_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_port_write_callback(Object &&cb) { return m_port_write_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_port_read_callback(Object &&cb) { return m_port_read_cb.set_callback(std::forward<Object>(cb)); }
protected:
// device-level overrides
diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h
index c91b2a99102..4ea6b8f5eeb 100644
--- a/src/devices/cpu/hmcs40/hmcs40.h
+++ b/src/devices/cpu/hmcs40/hmcs40.h
@@ -16,15 +16,15 @@
// max 8 4-bit R ports
#define MCFG_HMCS40_READ_R_CB(R, _devcb) \
- devcb = &hmcs40_cpu_device::set_read_r##R##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hmcs40_cpu_device &>(*device).set_read_r##R##_callback(DEVCB_##_devcb);
#define MCFG_HMCS40_WRITE_R_CB(R, _devcb) \
- devcb = &hmcs40_cpu_device::set_write_r##R##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hmcs40_cpu_device &>(*device).set_write_r##R##_callback(DEVCB_##_devcb);
// 16-bit discrete
#define MCFG_HMCS40_READ_D_CB(_devcb) \
- devcb = &hmcs40_cpu_device::set_read_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hmcs40_cpu_device &>(*device).set_read_d_callback(DEVCB_##_devcb);
#define MCFG_HMCS40_WRITE_D_CB(_devcb) \
- devcb = &hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<hmcs40_cpu_device &>(*device).set_write_d_callback(DEVCB_##_devcb);
enum
{
@@ -105,27 +105,27 @@ public:
PORT_R7X
};
- // static configuration helpers
- template <class Object> static devcb_base &set_read_r0_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r1_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r2_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r3_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r4_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r4.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r5_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r5.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r6_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r6.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r7_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_r7.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_write_r0_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r1_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r2_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r3_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r4_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r4.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r5_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r5.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r6_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r6.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r7_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_r7.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_read_d_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_read_d.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_d_callback(device_t &device, Object &&cb) { return downcast<hmcs40_cpu_device &>(device).m_write_d.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_read_r0_callback(Object &&cb) { return m_read_r0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r1_callback(Object &&cb) { return m_read_r1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r2_callback(Object &&cb) { return m_read_r2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r3_callback(Object &&cb) { return m_read_r3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r4_callback(Object &&cb) { return m_read_r4.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r5_callback(Object &&cb) { return m_read_r5.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r6_callback(Object &&cb) { return m_read_r6.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r7_callback(Object &&cb) { return m_read_r7.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_write_r0_callback(Object &&cb) { return m_write_r0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r1_callback(Object &&cb) { return m_write_r1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r2_callback(Object &&cb) { return m_write_r2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r3_callback(Object &&cb) { return m_write_r3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r4_callback(Object &&cb) { return m_write_r4.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r5_callback(Object &&cb) { return m_write_r5.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r6_callback(Object &&cb) { return m_write_r6.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r7_callback(Object &&cb) { return m_write_r7.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); }
protected:
enum
diff --git a/src/devices/cpu/hphybrid/hphybrid.h b/src/devices/cpu/hphybrid/hphybrid.h
index bd362d710ee..63360d0bfdd 100644
--- a/src/devices/cpu/hphybrid/hphybrid.h
+++ b/src/devices/cpu/hphybrid/hphybrid.h
@@ -41,11 +41,11 @@
// Set boot mode of 5061-3001: either normal (false) or as in HP9845 system (true)
#define MCFG_HPHYBRID_SET_9845_BOOT(_mode) \
- hp_5061_3001_cpu_device::set_boot_mode_static(*device, _mode);
+ downcast<hp_5061_3001_cpu_device &>(*device).set_boot_mode(_mode);
// PA changed callback
#define MCFG_HPHYBRID_PA_CHANGED(_devcb) \
- devcb = &hp_hybrid_cpu_device::set_pa_changed_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp_hybrid_cpu_device &>(*device).set_pa_changed_func(DEVCB_##_devcb);
class hp_hybrid_cpu_device : public cpu_device
{
@@ -57,7 +57,7 @@ public:
uint8_t pa_r() const;
- template <class Object> static devcb_base &set_pa_changed_func(device_t &device, Object &&cb) { return downcast<hp_hybrid_cpu_device &>(device).m_pa_changed_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pa_changed_func(Object &&cb) { return m_pa_changed_func.set_callback(std::forward<Object>(cb)); }
protected:
hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t addrwidth);
@@ -161,7 +161,7 @@ class hp_5061_3001_cpu_device : public hp_hybrid_cpu_device
public:
hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_boot_mode_static(device_t &device, bool mode) { downcast<hp_5061_3001_cpu_device &>(device).m_boot_mode = mode; }
+ void set_boot_mode(bool mode) { m_boot_mode = mode; }
protected:
virtual void device_start() override;
diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h
index 5c56d292280..b0f0ba0fa5b 100644
--- a/src/devices/cpu/i386/i386.h
+++ b/src/devices/cpu/i386/i386.h
@@ -26,10 +26,10 @@
#define MCFG_I386_SMIACT(_devcb) \
- devcb = &i386_device::set_smiact(*device, DEVCB_##_devcb);
+ devcb = &downcast<i386_device &>(*device).set_smiact(DEVCB_##_devcb);
#define MCFG_I486_FERR_HANDLER(_devcb) \
- devcb = &i386_device::set_ferr(*device, DEVCB_##_devcb);
+ devcb = &downcast<i386_device &>(*device).set_ferr(DEVCB_##_devcb);
#define X86_NUM_CPUS 4
@@ -39,9 +39,9 @@ public:
// construction/destruction
i386_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_smiact(device_t &device, Object &&cb) { return downcast<i386_device &>(device).m_smiact.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ferr(device_t &device, Object &&cb) { return downcast<i386_device &>(device).m_ferr_handler.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_smiact(Object &&cb) { return m_smiact.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_ferr(Object &&cb) { return m_ferr_handler.set_callback(std::forward<Object>(cb)); }
uint64_t debug_segbase(symbol_table &table, int params, const uint64_t *param);
uint64_t debug_seglimit(symbol_table &table, int params, const uint64_t *param);
diff --git a/src/devices/cpu/i8085/i8085.h b/src/devices/cpu/i8085/i8085.h
index b4ab5901c1f..2da4c89acd1 100644
--- a/src/devices/cpu/i8085/i8085.h
+++ b/src/devices/cpu/i8085/i8085.h
@@ -18,25 +18,25 @@
// STATUS changed callback
#define MCFG_I8085A_STATUS(_devcb) \
- devcb = &i8085a_cpu_device::set_out_status_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8085a_cpu_device &>(*device).set_out_status_func(DEVCB_##_devcb);
// INTE changed callback
#define MCFG_I8085A_INTE(_devcb) \
- devcb = &i8085a_cpu_device::set_out_inte_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8085a_cpu_device &>(*device).set_out_inte_func(DEVCB_##_devcb);
// SID changed callback (8085A only)
#define MCFG_I8085A_SID(_devcb) \
- devcb = &i8085a_cpu_device::set_in_sid_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8085a_cpu_device &>(*device).set_in_sid_func(DEVCB_##_devcb);
// SOD changed callback (8085A only)
#define MCFG_I8085A_SOD(_devcb) \
- devcb = &i8085a_cpu_device::set_out_sod_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<i8085a_cpu_device &>(*device).set_out_sod_func(DEVCB_##_devcb);
// CLK rate callback (8085A only)
#define MCFG_I8085A_CLK_OUT_DEVICE(_tag) \
- i8085a_cpu_device::static_set_clk_out(*device, clock_update_delegate(FUNC(device_t::set_unscaled_clock), _tag, (device_t *)nullptr));
+ downcast<i8085a_cpu_device &>(*device).set_clk_out(clock_update_delegate(FUNC(device_t::set_unscaled_clock), _tag, (device_t *)nullptr));
#define MCFG_I8085A_CLK_OUT_CUSTOM(_class, _func) \
- i8085a_cpu_device::static_set_clk_out(*device, clock_update_delegate(&_class::_func, #_class "::" _func, owner));
+ downcast<i8085a_cpu_device &>(*device).set_clk_out(clock_update_delegate(&_class::_func, #_class "::" _func, owner));
class i8085a_cpu_device : public cpu_device
@@ -65,12 +65,12 @@ public:
// construction/destruction
i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_out_status_func(device_t &device, Object &&cb) { return downcast<i8085a_cpu_device &>(device).m_out_status_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_inte_func(device_t &device, Object &&cb) { return downcast<i8085a_cpu_device &>(device).m_out_inte_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_in_sid_func(device_t &device, Object &&cb) { return downcast<i8085a_cpu_device &>(device).m_in_sid_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_sod_func(device_t &device, Object &&cb) { return downcast<i8085a_cpu_device &>(device).m_out_sod_func.set_callback(std::forward<Object>(cb)); }
- static void static_set_clk_out(device_t &device, clock_update_delegate &&clk_out) { downcast<i8085a_cpu_device &>(device).m_clk_out_func = std::move(clk_out); }
+ // configuration helpers
+ template <class Object> devcb_base &set_out_status_func(Object &&cb) { return m_out_status_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_inte_func(Object &&cb) { return m_out_inte_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_in_sid_func(Object &&cb) { return m_in_sid_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_sod_func(Object &&cb) { return m_out_sod_func.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> void set_clk_out(Object &&cb) { m_clk_out_func = std::forward<Object>(cb); }
protected:
i8085a_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int cputype);
diff --git a/src/devices/cpu/i8089/i8089.h b/src/devices/cpu/i8089/i8089.h
index 1659afd54d9..df72f847b85 100644
--- a/src/devices/cpu/i8089/i8089.h
+++ b/src/devices/cpu/i8089/i8089.h
@@ -23,7 +23,7 @@
//**************************************************************************
#define MCFG_I8089_DATA_WIDTH(_data_width) \
- i8089_device::set_data_width(*device, _data_width);
+ downcast<i8089_device &>(*device).set_data_width(_data_width);
#define MCFG_I8089_SINTR1(_sintr1) \
devcb = &downcast<i8089_device *>(device)->set_sintr1_callback(DEVCB_##_sintr1);
@@ -53,8 +53,8 @@ public:
template <class Object> devcb_base &set_sintr1_callback(Object &&sintr1) { return m_write_sintr1.set_callback(std::forward<Object>(sintr1)); }
template <class Object> devcb_base &set_sintr2_callback(Object &&sintr2) { return m_write_sintr2.set_callback(std::forward<Object>(sintr2)); }
- // static configuration helpers
- static void set_data_width(device_t &device, uint8_t data_width) { downcast<i8089_device &>(device).m_data_width = data_width; }
+ // configuration helpers
+ void set_data_width(uint8_t data_width) { m_data_width = data_width; }
// input lines
DECLARE_WRITE_LINE_MEMBER( ca_w );
diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp
index 6bb679a3300..558a36cb912 100644
--- a/src/devices/cpu/i86/i186.cpp
+++ b/src/devices/cpu/i86/i186.cpp
@@ -126,7 +126,7 @@ i80188_cpu_device::i80188_cpu_device(const machine_config &mconfig, const char *
{
memcpy(m_timing, m_i80186_timing, sizeof(m_i80186_timing));
m_fetch_xor = 0;
- static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
+ set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
}
i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -134,7 +134,7 @@ i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char *
{
memcpy(m_timing, m_i80186_timing, sizeof(m_i80186_timing));
m_fetch_xor = BYTE_XOR_LE(0);
- static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
+ set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
}
i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int data_bus_size)
diff --git a/src/devices/cpu/i86/i186.h b/src/devices/cpu/i86/i186.h
index ec7acac9bea..7ebb6e1bc4b 100644
--- a/src/devices/cpu/i86/i186.h
+++ b/src/devices/cpu/i86/i186.h
@@ -16,10 +16,10 @@ public:
// construction/destruction
i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &static_set_read_slave_ack_callback(device_t &device, Object &&cb) { return downcast<i80186_cpu_device &>(device).m_read_slave_ack_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_chip_select_callback(device_t &device, Object &&cb) { return downcast<i80186_cpu_device &>(device).m_out_chip_select_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_tmrout0_handler(device_t &device, Object &&cb) { return downcast<i80186_cpu_device &>(device).m_out_tmrout0_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_tmrout1_handler(device_t &device, Object &&cb) { return downcast<i80186_cpu_device &>(device).m_out_tmrout1_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_slave_ack_callback(Object &&cb) { return m_read_slave_ack_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_chip_select_callback(Object &&cb) { return m_out_chip_select_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_tmrout0_handler(Object &&cb) { return m_out_tmrout0_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_tmrout1_handler(Object &&cb) { return m_out_tmrout1_func.set_callback(std::forward<Object>(cb)); }
IRQ_CALLBACK_MEMBER(int_callback);
DECLARE_WRITE_LINE_MEMBER(drq0_w) { if(state) drq_callback(0); m_dma[0].drq_state = state; }
@@ -153,15 +153,15 @@ public:
};
#define MCFG_80186_IRQ_SLAVE_ACK(_devcb) \
- devcb = &i80186_cpu_device::static_set_read_slave_ack_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<i80186_cpu_device &>(*device).set_read_slave_ack_callback(DEVCB_##_devcb);
#define MCFG_80186_CHIP_SELECT_CB(_devcb) \
- devcb = &i80186_cpu_device::static_set_chip_select_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<i80186_cpu_device &>(*device).set_chip_select_callback(DEVCB_##_devcb);
#define MCFG_80186_TMROUT0_HANDLER(_devcb) \
- devcb = &i80186_cpu_device::static_set_tmrout0_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<i80186_cpu_device &>(*device).set_tmrout0_handler(DEVCB_##_devcb);
#define MCFG_80186_TMROUT1_HANDLER(_devcb) \
- devcb = &i80186_cpu_device::static_set_tmrout1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<i80186_cpu_device &>(*device).set_tmrout1_handler(DEVCB_##_devcb);
#endif // MAME_CPU_I86_I186_H
diff --git a/src/devices/cpu/i86/i286.h b/src/devices/cpu/i86/i286.h
index 8136b0128ce..dbf5e245673 100644
--- a/src/devices/cpu/i86/i286.h
+++ b/src/devices/cpu/i86/i286.h
@@ -72,8 +72,8 @@ public:
virtual space_config_vector memory_space_config() const override;
typedef delegate<uint32_t (bool)> a20_cb;
- static void static_set_a20_callback(device_t &device, a20_cb object) { downcast<i80286_cpu_device &>(device).m_a20_callback = object; }
- template <class Object> static devcb_base &static_set_shutdown_callback(device_t &device, Object &&cb) { return downcast<i80286_cpu_device &>(device).m_out_shutdown_func.set_callback(std::forward<Object>(cb)); }
+ template <typename Object> void set_a20_callback(Object &&cb) { m_a20_callback = std::forward<Object>(cb); }
+ template <class Object> devcb_base &set_shutdown_callback(Object &&cb) { return m_out_shutdown_func.set_callback(std::forward<Object>(cb)); }
protected:
virtual void execute_run() override;
@@ -162,9 +162,9 @@ private:
};
#define MCFG_80286_A20(_class, _a20_cb) \
- i80286_cpu_device::static_set_a20_callback(*device, i80286_cpu_device::a20_cb(&_class::_a20_cb, this));
+ downcast<i80286_cpu_device &>(*device).set_a20_callback(i80286_cpu_device::a20_cb(&_class::_a20_cb, this));
#define MCFG_80286_SHUTDOWN(_devcb) \
- devcb = &i80286_cpu_device::static_set_shutdown_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<i80286_cpu_device &>(*device).set_shutdown_callback(DEVCB_##_devcb);
#endif // MAME_CPU_I86_I286_H
diff --git a/src/devices/cpu/i86/i86.h b/src/devices/cpu/i86/i86.h
index d0bfd9b8782..3376a37f3b8 100644
--- a/src/devices/cpu/i86/i86.h
+++ b/src/devices/cpu/i86/i86.h
@@ -17,10 +17,10 @@ DECLARE_DEVICE_TYPE(I8088, i8088_cpu_device)
#define MCFG_I8086_LOCK_HANDLER(_write) \
- devcb = &i8086_common_cpu_device::set_lock_handler(*device, DEVCB_##_write);
+ devcb = &downcast<i8086_common_cpu_device &>(*device).set_lock_handler(DEVCB_##_write);
#define MCFG_I8086_IF_HANDLER(_write) \
- devcb = &i8086_cpu_device::set_if_handler(*device, DEVCB_##_write);
+ devcb = &downcast<i8086_cpu_device &>(*device).set_if_handler(DEVCB_##_write);
#define MCFG_I8086_STACK_MAP(map) \
MCFG_DEVICE_ADDRESS_MAP(i8086_cpu_device::AS_STACK, map)
@@ -32,10 +32,10 @@ DECLARE_DEVICE_TYPE(I8088, i8088_cpu_device)
MCFG_DEVICE_ADDRESS_MAP(i8086_cpu_device::AS_EXTRA, map)
#define MCFG_I8086_ESC_OPCODE_HANDLER(_write) \
- devcb = &i8086_cpu_device::set_esc_opcode_handler(*device, DEVCB_##_write);
+ devcb = &downcast<i8086_cpu_device &>(*device).set_esc_opcode_handler(DEVCB_##_write);
#define MCFG_I8086_ESC_DATA_HANDLER(_write) \
- devcb = &i8086_cpu_device::set_esc_data_handler(*device, DEVCB_##_write);
+ devcb = &downcast<i8086_cpu_device &>(*device).set_esc_data_handler(DEVCB_##_write);
enum
{
@@ -49,8 +49,7 @@ enum
class i8086_common_cpu_device : public cpu_device, public i386_disassembler::config
{
public:
- template <class Object> static devcb_base &set_lock_handler(device_t &device, Object &&cb)
- { return downcast<i8086_common_cpu_device &>(device).m_lock_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_lock_handler(Object &&cb) { return m_lock_handler.set_callback(std::forward<Object>(cb)); }
protected:
enum
@@ -367,14 +366,9 @@ public:
// device_memory_interface overrides
virtual space_config_vector memory_space_config() const override;
- template <class Object> static devcb_base &set_if_handler(device_t &device, Object &&cb)
- { return downcast<i8086_cpu_device &>(device).m_out_if_func.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_esc_opcode_handler(device_t &device, Object &&cb)
- { return downcast<i8086_cpu_device &>(device).m_esc_opcode_handler.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_esc_data_handler(device_t &device, Object &&cb)
- { return downcast<i8086_cpu_device &>(device).m_esc_data_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_if_handler(Object &&cb) { return m_out_if_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_esc_opcode_handler(Object &&cb) { return m_esc_opcode_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_esc_data_handler(Object &&cb) { return m_esc_data_handler.set_callback(std::forward<Object>(cb)); }
protected:
i8086_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int data_bus_size);
diff --git a/src/devices/cpu/jaguar/jaguar.h b/src/devices/cpu/jaguar/jaguar.h
index ac7f406621d..cb88c8a5d41 100644
--- a/src/devices/cpu/jaguar/jaguar.h
+++ b/src/devices/cpu/jaguar/jaguar.h
@@ -65,7 +65,7 @@ enum
***************************************************************************/
#define MCFG_JAGUAR_IRQ_HANDLER(_devcb) \
- devcb = &jaguar_cpu_device::set_int_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<jaguar_cpu_device &>(*device).set_int_func(DEVCB_##_devcb);
/***************************************************************************
@@ -95,8 +95,8 @@ public:
// construction/destruction
~jaguar_cpu_device();
- // static configuration helpers
- template <class Object> static devcb_base &set_int_func(device_t &device, Object &&cb) { return downcast<jaguar_cpu_device &>(device).m_cpu_interrupt.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_int_func(Object &&cb) { return m_cpu_interrupt.set_callback(std::forward<Object>(cb)); }
virtual DECLARE_WRITE32_MEMBER(ctrl_w) = 0;
virtual DECLARE_READ32_MEMBER(ctrl_r) = 0;
diff --git a/src/devices/cpu/lc8670/lc8670.h b/src/devices/cpu/lc8670/lc8670.h
index 3286c3b1504..3944c864a4a 100644
--- a/src/devices/cpu/lc8670/lc8670.h
+++ b/src/devices/cpu/lc8670/lc8670.h
@@ -45,14 +45,14 @@ enum
//**************************************************************************
#define MCFG_LC8670_SET_CLOCK_SOURCES(_sub_clock, _rc_clock, _cf_clock) \
- lc8670_cpu_device::static_set_cpu_clock(*device, lc8670_cpu_device::clock_source::SUB, _sub_clock); \
- lc8670_cpu_device::static_set_cpu_clock(*device, lc8670_cpu_device::clock_source::RC, _rc_clock); \
- lc8670_cpu_device::static_set_cpu_clock(*device, lc8670_cpu_device::clock_source::CF, _cf_clock);
+ downcast<lc8670_cpu_device &>(*device).set_cpu_clock(lc8670_cpu_device::clock_source::SUB, _sub_clock); \
+ downcast<lc8670_cpu_device &>(*device).set_cpu_clock(lc8670_cpu_device::clock_source::RC, _rc_clock); \
+ downcast<lc8670_cpu_device &>(*device).set_cpu_clock(lc8670_cpu_device::clock_source::CF, _cf_clock);
#define MCFG_LC8670_BANKSWITCH_CB(_devcb) \
- devcb = &lc8670_cpu_device::static_set_bankswitch_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<lc8670_cpu_device &>(*device).set_bankswitch_cb(DEVCB_##_devcb);
#define MCFG_LC8670_LCD_UPDATE_CB(_cb) \
- lc8670_cpu_device::static_set_lcd_update_cb(*device, _cb);
+ downcast<lc8670_cpu_device &>(*device).set_lcd_update_cb(_cb);
// ======================> lc8670_cpu_device
@@ -83,11 +83,11 @@ public:
DECLARE_READ8_MEMBER(xram_r);
DECLARE_WRITE8_MEMBER(xram_w);
- // static configuration helpers
- static void static_set_cpu_clock(device_t &device, clock_source source, uint32_t clock) { downcast<lc8670_cpu_device &>(device).m_clocks[unsigned(source)] = clock; }
- static void static_set_cpu_clock(device_t &device, clock_source source, const XTAL &clock) { static_set_cpu_clock(device, source, clock.value()); }
- static void static_set_lcd_update_cb(device_t &device, lcd_update cb) { downcast<lc8670_cpu_device &>(device).m_lcd_update_func = cb; }
- template <class Object> static devcb_base & static_set_bankswitch_cb(device_t &device, Object &&cb) { return downcast<lc8670_cpu_device &>(device).m_bankswitch_func.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ void set_cpu_clock(clock_source source, uint32_t clock) { m_clocks[unsigned(source)] = clock; }
+ void set_cpu_clock(clock_source source, const XTAL &clock) { set_cpu_clock(source, clock.value()); }
+ template <typename Object> void set_lcd_update_cb(Object &&cb) { m_lcd_update_func = std::forward<Object>(cb); }
+ template <class Object> devcb_base &set_bankswitch_cb(Object &&cb) { return m_bankswitch_func.set_callback(std::forward<Object>(cb)); }
void lc8670_internal_map(address_map &map);
protected:
diff --git a/src/devices/cpu/lh5801/lh5801.h b/src/devices/cpu/lh5801/lh5801.h
index 2981bda7d0f..679e2e90fa4 100644
--- a/src/devices/cpu/lh5801/lh5801.h
+++ b/src/devices/cpu/lh5801/lh5801.h
@@ -61,7 +61,7 @@ enum
#define MCFG_LH5801_IN(_devcb) \
- devcb = &lh5801_cpu_device::set_in_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<lh5801_cpu_device &>(*device).set_in_func(DEVCB_##_devcb);
class lh5801_cpu_device : public cpu_device
@@ -70,8 +70,8 @@ public:
// construction/destruction
lh5801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_in_func(device_t &device, Object &&cb) { return downcast<lh5801_cpu_device &>(device).m_in_func.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_in_func(Object &&cb) { return m_in_func.set_callback(std::forward<Object>(cb)); }
protected:
// device-level overrides
diff --git a/src/devices/cpu/lr35902/lr35902.h b/src/devices/cpu/lr35902/lr35902.h
index 0d33bbbe548..d3743209e76 100644
--- a/src/devices/cpu/lr35902/lr35902.h
+++ b/src/devices/cpu/lr35902/lr35902.h
@@ -7,19 +7,19 @@
#define MCFG_LR35902_TIMER_CB(_devcb) \
- devcb = &lr35902_cpu_device::set_timer_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<lr35902_cpu_device &>(*device).set_timer_cb(DEVCB_##_devcb);
// The first release of this CPU has a bug where the programcounter
// is not incremented properly after an interrupt after the halt opcode.
// This was fixed in a newer revision.
#define MCFG_LR35902_HALT_BUG \
- lr35902_cpu_device::set_halt_bug(*device);
+ downcast<lr35902_cpu_device &>(*device).set_halt_bug(true);
// The GameBoy has a bug where OAM data gets corrupted if you inc/dec
// a 16-bit register in the $fe** region.
// note: oldval is in hiword, newval is in loword
#define MCFG_LR35902_INCDEC16_CB(_devcb) \
- devcb = &lr35902_cpu_device::set_incdec16_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<lr35902_cpu_device &>(*device).set_incdec16_cb(DEVCB_##_devcb);
enum
@@ -39,10 +39,10 @@ public:
// construction/destruction
lr35902_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock);
- // static configuration helpers
- template<class _Object> static devcb_base &set_timer_cb(device_t &device, _Object object) { return downcast<lr35902_cpu_device &>(device).m_timer_func.set_callback(object); }
- template<class _Object> static devcb_base &set_incdec16_cb(device_t &device, _Object object) { return downcast<lr35902_cpu_device &>(device).m_incdec16_func.set_callback(object); }
- static void set_halt_bug(device_t &device) { downcast<lr35902_cpu_device &>(device).m_has_halt_bug = true; }
+ // configuration helpers
+ template<class Object> devcb_base &set_timer_cb(Object &&cb) { return m_timer_func.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_incdec16_cb(Object &&cb) { return m_incdec16_func.set_callback(std::forward<Object>(cb)); }
+ void set_halt_bug(bool has_halt_bug) { m_has_halt_bug = has_halt_bug; }
uint8_t get_speed();
void set_speed(uint8_t speed_request);
diff --git a/src/devices/cpu/m6502/m5074x.h b/src/devices/cpu/m6502/m5074x.h
index c9f7ddb4ba6..2782d09f2d7 100644
--- a/src/devices/cpu/m6502/m5074x.h
+++ b/src/devices/cpu/m6502/m5074x.h
@@ -20,28 +20,28 @@
//**************************************************************************
#define MCFG_M5074X_PORT0_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p0_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<m5074x_device &>(*device).set_p0_rd_callback(DEVCB_##_read);
#define MCFG_M5074X_PORT1_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p1_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<m5074x_device &>(*device).set_p1_rd_callback(DEVCB_##_read);
#define MCFG_M5074X_PORT2_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p2_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<m5074x_device &>(*device).set_p2_rd_callback(DEVCB_##_read);
#define MCFG_M5074X_PORT3_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p3_rd_callback(*device, DEVCB_##_read);
+ devcb = &downcast<m5074x_device &>(*device).set_p3_rd_callback(DEVCB_##_read);
#define MCFG_M5074X_PORT0_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p0_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<m5074x_device &>(*device).set_p0_wr_callback(DEVCB_##_write);
#define MCFG_M5074X_PORT1_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p1_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<m5074x_device &>(*device).set_p1_wr_callback(DEVCB_##_write);
#define MCFG_M5074X_PORT2_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p2_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<m5074x_device &>(*device).set_p2_wr_callback(DEVCB_##_write);
#define MCFG_M5074X_PORT3_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p3_wr_callback(*device, DEVCB_##_write);
+ devcb = &downcast<m5074x_device &>(*device).set_p3_wr_callback(DEVCB_##_write);
//**************************************************************************
// TYPE DEFINITIONS
@@ -73,14 +73,14 @@ class m5074x_device : public m740_device
public:
const address_space_config m_program_config;
- template<class _Object> static devcb_base &set_p0_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p0.set_callback(object); }
- template<class _Object> static devcb_base &set_p1_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p1.set_callback(object); }
- template<class _Object> static devcb_base &set_p2_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p2.set_callback(object); }
- template<class _Object> static devcb_base &set_p3_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p3.set_callback(object); }
- template<class _Object> static devcb_base &set_p0_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p0.set_callback(object); }
- template<class _Object> static devcb_base &set_p1_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p1.set_callback(object); }
- template<class _Object> static devcb_base &set_p2_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p2.set_callback(object); }
- template<class _Object> static devcb_base &set_p3_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p3.set_callback(object); }
+ template<class Object> devcb_base &set_p0_rd_callback(Object &&cb) { return read_p0.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p1_rd_callback(Object &&cb) { return read_p1.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p2_rd_callback(Object &&cb) { return read_p2.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p3_rd_callback(Object &&cb) { return read_p3.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p0_wr_callback(Object &&cb) { return write_p0.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p1_wr_callback(Object &&cb) { return write_p1.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p2_wr_callback(Object &&cb) { return write_p2.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_p3_wr_callback(Object &&cb) { return write_p3.set_callback(std::forward<Object>(cb)); }
devcb_read8 read_p0, read_p1, read_p2, read_p3;
devcb_write8 write_p0, write_p1, write_p2, write_p3;
diff --git a/src/devices/cpu/m6502/m6502.h b/src/devices/cpu/m6502/m6502.h
index ab44415ca5a..18c0bdb5c3b 100644
--- a/src/devices/cpu/m6502/m6502.h
+++ b/src/devices/cpu/m6502/m6502.h
@@ -15,7 +15,7 @@
downcast<m6502_device *>(device)->disable_direct();
#define MCFG_M6502_SYNC_CALLBACK(_cb) \
- devcb = &m6502_device::set_sync_callback(*device, DEVCB_##_cb);
+ devcb = &downcast<m6502_device &>(*device).set_sync_callback(DEVCB_##_cb);
class m6502_device : public cpu_device {
public:
@@ -31,7 +31,7 @@ public:
bool get_sync() const { return sync; }
void disable_direct() { direct_disabled = true; }
- template<class _Object> static devcb_base &set_sync_callback(device_t &device, _Object object) { return downcast<m6502_device &>(device).sync_w.set_callback(object); }
+ template<class Object> devcb_base &set_sync_callback(Object &&cb) { return sync_w.set_callback(std::forward<Object>(cb)); }
devcb_write_line sync_w;
diff --git a/src/devices/cpu/m6502/xavix.h b/src/devices/cpu/m6502/xavix.h
index e58a355b35d..67014209aa0 100644
--- a/src/devices/cpu/m6502/xavix.h
+++ b/src/devices/cpu/m6502/xavix.h
@@ -13,7 +13,7 @@
#include "m6502.h"
#define MCFG_XAVIX_VECTOR_CALLBACK(_class, _method) \
- xavix_device::set_vector_callback(*device, xavix_device::xavix_interrupt_vector_delegate(&_class::_method, #_class "::" #_method, this));
+ downcast<xavix_device &>(*device).set_vector_callback(xavix_device::xavix_interrupt_vector_delegate(&_class::_method, #_class "::" #_method, this));
class xavix_device : public m6502_device {
public:
@@ -33,7 +33,7 @@ public:
typedef device_delegate<uint8_t (int which, int half)> xavix_interrupt_vector_delegate;
- static void set_vector_callback(device_t &device, xavix_interrupt_vector_delegate &&cb) { downcast<xavix_device &>(device).m_vector_callback = std::move(cb); }
+ template <typename Object> void set_vector_callback(Object &&cb) { m_vector_callback = std::forward<Object>(cb); }
#undef O
diff --git a/src/devices/cpu/m6800/m6801.h b/src/devices/cpu/m6800/m6801.h
index 08a75439827..154c6220ce1 100644
--- a/src/devices/cpu/m6800/m6801.h
+++ b/src/devices/cpu/m6800/m6801.h
@@ -52,9 +52,9 @@ enum
#define MCFG_M6801_SC2(_devcb) \
- devcb = &m6801_cpu_device::set_out_sc2_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<m6801_cpu_device &>(*device).set_out_sc2_func(DEVCB_##_devcb);
#define MCFG_M6801_SER_TX(_devcb) \
- devcb = &m6801_cpu_device::set_out_sertx_func(*device, DEVCB_##_devcb);
+ devcb = &downcast<m6801_cpu_device &>(*device).set_out_sertx_func(DEVCB_##_devcb);
class m6801_cpu_device : public m6800_cpu_device
@@ -62,9 +62,9 @@ class m6801_cpu_device : public m6800_cpu_device
public:
m6801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template<class _Object> static devcb_base &set_out_sc2_func(device_t &device, _Object object) { return downcast<m6801_cpu_device &>(device).m_out_sc2_func.set_callback(object); }
- template<class _Object> static devcb_base &set_out_sertx_func(device_t &device, _Object object) { return downcast<m6801_cpu_device &>(device).m_out_sertx_func.set_callback(object); }
+ // configuration helpers
+ template<class Object> devcb_base &set_out_sc2_func(Object &&cb) { return m_out_sc2_func.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_sertx_func(Object &&cb) { return m_out_sertx_func.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( m6801_io_r );
DECLARE_WRITE8_MEMBER( m6801_io_w );
diff --git a/src/devices/cpu/m6805/m68705.h b/src/devices/cpu/m6805/m68705.h
index a93b32902df..888dfdc23d1 100644
--- a/src/devices/cpu/m6805/m68705.h
+++ b/src/devices/cpu/m6805/m68705.h
@@ -25,35 +25,33 @@ DECLARE_DEVICE_TYPE(M68705U3, m68705u3_device)
// ======================> m68705_device
#define MCFG_M68705_PORTA_R_CB(obj) \
- devcb = &m68705_device::set_port_cb_r<0>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_r<0>(DEVCB_##obj);
#define MCFG_M68705_PORTB_R_CB(obj) \
- devcb = &m68705_device::set_port_cb_r<1>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_r<1>(DEVCB_##obj);
#define MCFG_M68705_PORTC_R_CB(obj) \
- devcb = &m68705_device::set_port_cb_r<2>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_r<2>(DEVCB_##obj);
#define MCFG_M68705_PORTD_R_CB(obj) \
- devcb = &m68705_device::set_port_cb_r<3>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_r<3>(DEVCB_##obj);
#define MCFG_M68705_PORTA_W_CB(obj) \
- devcb = &m68705_device::set_port_cb_w<0>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_w<0>(DEVCB_##obj);
#define MCFG_M68705_PORTB_W_CB(obj) \
- devcb = &m68705_device::set_port_cb_w<1>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_w<1>(DEVCB_##obj);
#define MCFG_M68705_PORTC_W_CB(obj) \
- devcb = &m68705_device::set_port_cb_w<2>(*device, DEVCB_##obj);
+ devcb = &downcast<m68705_device &>(*device).set_port_cb_w<2>(DEVCB_##obj);
class m68705_device : public m6805_base_device, public device_nvram_interface
{
public:
- // static configuration helpers
- template<std::size_t N, typename Object> static devcb_base &set_port_cb_r(device_t &device, Object &&obj)
- { return downcast<m68705_device &>(device).m_port_cb_r[N].set_callback(std::forward<Object>(obj)); }
- template<std::size_t N, typename Object> static devcb_base &set_port_cb_w(device_t &device, Object &&obj)
- { return downcast<m68705_device &>(device).m_port_cb_w[N].set_callback(std::forward<Object>(obj)); }
+ // configuration helpers
+ template<std::size_t N, typename Object> devcb_base &set_port_cb_r(Object &&obj) { return m_port_cb_r[N].set_callback(std::forward<Object>(obj)); }
+ template<std::size_t N, typename Object> devcb_base &set_port_cb_w(Object &&obj) { return m_port_cb_w[N].set_callback(std::forward<Object>(obj)); }
protected:
// state index constants
diff --git a/src/devices/cpu/m6805/m68hc05.h b/src/devices/cpu/m6805/m68hc05.h
index 772df2a4689..4190ad9a91c 100644
--- a/src/devices/cpu/m6805/m68hc05.h
+++ b/src/devices/cpu/m6805/m68hc05.h
@@ -26,43 +26,40 @@ DECLARE_DEVICE_TYPE(M68HC705C8A, m68hc705c8a_device)
// ======================> m68hc05_device
#define MCFG_M68HC05_PORTA_R_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_r<0>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_r<0>(DEVCB_##obj);
#define MCFG_M68HC05_PORTB_R_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_r<1>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_r<1>(DEVCB_##obj);
#define MCFG_M68HC05_PORTC_R_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_r<2>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_r<2>(DEVCB_##obj);
#define MCFG_M68HC05_PORTD_R_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_r<3>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_r<3>(DEVCB_##obj);
#define MCFG_M68HC05_PORTA_W_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_w<0>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_w<0>(DEVCB_##obj);
#define MCFG_M68HC05_PORTB_W_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_w<1>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_w<1>(DEVCB_##obj);
#define MCFG_M68HC05_PORTC_W_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_w<2>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_w<2>(DEVCB_##obj);
#define MCFG_M68HC05_PORTD_W_CB(obj) \
- devcb = &m68hc05_device::set_port_cb_w<3>(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_port_cb_w<3>(DEVCB_##obj);
#define MCFG_M68HC05_TCMP_CB(obj) \
- devcb = &m68hc05_device::set_tcmp_cb(*device, DEVCB_##obj);
+ devcb = &downcast<m68hc05_device &>(*device).set_tcmp_cb(DEVCB_##obj);
class m68hc05_device : public m6805_base_device
{
public:
- // static configuration helpers
- template<std::size_t N, typename Object> static devcb_base &set_port_cb_r(device_t &device, Object &&obj)
- { return downcast<m68hc05_device &>(device).m_port_cb_r[N].set_callback(std::forward<Object>(obj)); }
- template<std::size_t N, typename Object> static devcb_base &set_port_cb_w(device_t &device, Object &&obj)
- { return downcast<m68hc05_device &>(device).m_port_cb_w[N].set_callback(std::forward<Object>(obj)); }
- template<typename Object> static devcb_base &set_tcmp_cb(device_t &device, Object &&obj)
- { return downcast<m68hc05_device &>(device).m_tcmp_cb.set_callback(std::forward<Object>(obj)); }
+ // configuration helpers
+ template<std::size_t N, typename Object> devcb_base &set_port_cb_r(Object &&obj) { return m_port_cb_r[N].set_callback(std::forward<Object>(obj)); }
+ template<std::size_t N, typename Object> devcb_base &set_port_cb_w(Object &&obj) { return m_port_cb_w[N].set_callback(std::forward<Object>(obj)); }
+ template<typename Object> devcb_base &set_tcmp_cb(Object &&obj) { return m_tcmp_cb.set_callback(std::forward<Object>(obj)); }
protected:
// state index constants
diff --git a/src/devices/cpu/m6809/konami.h b/src/devices/cpu/m6809/konami.h
index 216b007302a..e53c86e4fb2 100644
--- a/src/devices/cpu/m6809/konami.h
+++ b/src/devices/cpu/m6809/konami.h
@@ -21,7 +21,7 @@
//**************************************************************************
#define MCFG_KONAMICPU_LINE_CB(_devcb) \
- devcb = &konami_cpu_device::set_line_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<konami_cpu_device &>(*device).set_line_callback(DEVCB_##_devcb);
// device type definition
@@ -36,7 +36,7 @@ public:
konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- template<class _Object> static devcb_base &set_line_callback(device_t &device, _Object object) { return downcast<konami_cpu_device &>(device).m_set_lines.set_callback(object); }
+ template<class Object> devcb_base &set_line_callback(Object &&cb) { return m_set_lines.set_callback(std::forward<Object>(cb)); }
protected:
// device-level overrides
diff --git a/src/devices/cpu/m6809/m6809.h b/src/devices/cpu/m6809/m6809.h
index 675ec9e2317..bffa63f8a7c 100644
--- a/src/devices/cpu/m6809/m6809.h
+++ b/src/devices/cpu/m6809/m6809.h
@@ -306,7 +306,7 @@ public:
// MC6809E has LIC line to indicate opcode/data fetch
#define MCFG_MC6809E_LIC_CB(_devcb) \
- devcb = &mc6809e_device::set_lic_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mc6809e_device &>(*device).set_lic_cb(DEVCB_##_devcb);
class mc6809e_device : public m6809_base_device
@@ -315,8 +315,8 @@ public:
// construction/destruction
mc6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template<class _Object> static devcb_base &set_lic_cb(device_t &device, _Object object) { return downcast<mc6809e_device &>(device).m_lic_func.set_callback(object); }
+ // configuration helpers
+ template<class Object> devcb_base &set_lic_cb(Object &&cb) { return m_lic_func.set_callback(std::forward<Object>(cb)); }
};
// ======================> m6809_device (LEGACY)
diff --git a/src/devices/cpu/mb86233/mb86233.h b/src/devices/cpu/mb86233/mb86233.h
index 49ba58d7ea8..70e3a66dfd5 100644
--- a/src/devices/cpu/mb86233/mb86233.h
+++ b/src/devices/cpu/mb86233/mb86233.h
@@ -7,13 +7,13 @@
#define MCFG_MB86233_FIFO_READ_CB(_devcb) \
- devcb = &mb86233_cpu_device::set_fifo_read_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb86233_cpu_device &>(*device).set_fifo_read_cb(DEVCB_##_devcb);
#define MCFG_MB86233_FIFO_READ_OK_CB(_devcb) \
- devcb = &mb86233_cpu_device::set_fifo_read_ok_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb86233_cpu_device &>(*device).set_fifo_read_ok_cb(DEVCB_##_devcb);
#define MCFG_MB86233_FIFO_WRITE_CB(_devcb) \
- devcb = &mb86233_cpu_device::set_fifo_write_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb86233_cpu_device &>(*device).set_fifo_write_cb(DEVCB_##_devcb);
#define MCFG_MB86233_TABLE_REGION(_region) \
- mb86233_cpu_device::set_tablergn(*device, _region);
+ downcast<mb86233_cpu_device &>(*device).set_tablergn(_region);
class mb86233_cpu_device : public cpu_device
@@ -22,11 +22,11 @@ public:
// construction/destruction
mb86233_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> static devcb_base &set_fifo_read_cb(device_t &device, Object &&cb) { return downcast<mb86233_cpu_device &>(device).m_fifo_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_fifo_read_ok_cb(device_t &device, Object &&cb) { return downcast<mb86233_cpu_device &>(device).m_fifo_read_ok_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_fifo_write_cb(device_t &device, Object &&cb) { return downcast<mb86233_cpu_device &>(device).m_fifo_write_cb.set_callback(std::forward<Object>(cb)); }
- static void set_tablergn(device_t &device, const char *tablergn) { downcast<mb86233_cpu_device &>(device).m_tablergn = tablergn; }
+ // configuration helpers
+ template <class Object> devcb_base &set_fifo_read_cb(Object &&cb) { return m_fifo_read_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_fifo_read_ok_cb(Object &&cb) { return m_fifo_read_ok_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_fifo_write_cb(Object &&cb) { return m_fifo_write_cb.set_callback(std::forward<Object>(cb)); }
+ void set_tablergn(const char *tablergn) { m_tablergn = tablergn; }
protected:
// register enumeration
diff --git a/src/devices/cpu/mb88xx/mb88xx.h b/src/devices/cpu/mb88xx/mb88xx.h
index e9e7c5567eb..b5dd5fe79fc 100644
--- a/src/devices/cpu/mb88xx/mb88xx.h
+++ b/src/devices/cpu/mb88xx/mb88xx.h
@@ -54,51 +54,51 @@
// K (K3-K0): input-only port
#define MCFG_MB88XX_READ_K_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_k_callback(DEVCB_##_devcb);
// O (O7-O4 = OH, O3-O0 = OL): output through PLA
#define MCFG_MB88XX_WRITE_O_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_o_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_o_callback(DEVCB_##_devcb);
// P (P3-P0): output-only port
#define MCFG_MB88XX_WRITE_P_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_p_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_p_callback(DEVCB_##_devcb);
// R0 (R3-R0): input/output port
#define MCFG_MB88XX_READ_R0_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_r_callback(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_r_callback(0, DEVCB_##_devcb);
#define MCFG_MB88XX_WRITE_R0_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_r_callback(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_r_callback(0, DEVCB_##_devcb);
// R1 (R7-R4): input/output port
#define MCFG_MB88XX_READ_R1_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_r_callback(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_r_callback(1, DEVCB_##_devcb);
#define MCFG_MB88XX_WRITE_R1_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_r_callback(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_r_callback(1, DEVCB_##_devcb);
// R2 (R11-R8): input/output port
#define MCFG_MB88XX_READ_R2_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_r_callback(*device, 2, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_r_callback(2, DEVCB_##_devcb);
#define MCFG_MB88XX_WRITE_R2_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_r_callback(*device, 2, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_r_callback(2, DEVCB_##_devcb);
// R3 (R15-R12): input/output port
#define MCFG_MB88XX_READ_R3_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_r_callback(*device, 3, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_r_callback(3, DEVCB_##_devcb);
#define MCFG_MB88XX_WRITE_R3_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_r_callback(*device, 3, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_r_callback(3, DEVCB_##_devcb);
// SI: serial input
#define MCFG_MB88XX_READ_SI_CB(_devcb) \
- devcb = &mb88_cpu_device::set_read_si_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_read_si_callback(DEVCB_##_devcb);
// SO: serial output
#define MCFG_MB88XX_WRITE_SO_CB(_devcb) \
- devcb = &mb88_cpu_device::set_write_so_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mb88_cpu_device &>(*device).set_write_so_callback(DEVCB_##_devcb);
// Configure 32 byte PLA; if nullptr (default) assume direct output
#define MCFG_MB88XX_OUTPUT_PLA(_pla) \
- mb88_cpu_device::set_pla(*device, _pla);
+ downcast<mb88_cpu_device &>(*device).set_pla(_pla);
/***************************************************************************
REGISTER ENUMERATION
@@ -125,15 +125,15 @@ enum
class mb88_cpu_device : public cpu_device
{
public:
- // static configuration helpers
- template <class Object> static devcb_base &set_read_k_callback(device_t &device, Object &&cb) { return downcast<mb88_cpu_device &>(device).m_read_k.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_o_callback(device_t &device, Object &&cb) { return downcast<mb88_cpu_device &>(device).m_write_o.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_p_callback(device_t &device, Object &&cb) { return downcast<mb88_cpu_device &>(device).m_write_p.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_r_callback(device_t &device, int n, Object &&cb) { assert(n >= 0 && n < 4); return downcast<mb88_cpu_device &>(device).m_read_r[n].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_r_callback(device_t &device, int n, Object &&cb) { assert(n >= 0 && n < 4); return downcast<mb88_cpu_device &>(device).m_write_r[n].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_si_callback(device_t &device, Object &&cb) { return downcast<mb88_cpu_device &>(device).m_read_si.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_so_callback(device_t &device, Object &&cb) { return downcast<mb88_cpu_device &>(device).m_write_so.set_callback(std::forward<Object>(cb)); }
- static void set_pla(device_t &device, uint8_t *pla) { downcast<mb88_cpu_device &>(device).m_PLA = pla; }
+ // configuration helpers
+ template <class Object> devcb_base &set_read_k_callback(Object &&cb) { return m_read_k.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_o_callback(Object &&cb) { return m_write_o.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_p_callback(Object &&cb) { return m_write_p.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_r_callback(int n, Object &&cb) { assert(n >= 0 && n < 4); return m_read_r[n].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_r_callback(int n, Object &&cb) { assert(n >= 0 && n < 4); return m_write_r[n].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_si_callback(Object &&cb) { return m_read_si.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_so_callback(Object &&cb) { return m_write_so.set_callback(std::forward<Object>(cb)); }
+ void set_pla(uint8_t *pla) { m_PLA = pla; }
DECLARE_WRITE_LINE_MEMBER( clock_w );
diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h
index 35b0cb98170..e22c7f53197 100644
--- a/src/devices/cpu/mc68hc11/mc68hc11.h
+++ b/src/devices/cpu/mc68hc11/mc68hc11.h
@@ -33,9 +33,9 @@ DECLARE_DEVICE_TYPE(MC68HC11, mc68hc11_cpu_device)
#define MCFG_MC68HC11_CONFIG(_has_extended_io, _internal_ram_size, _init_value) \
- mc68hc11_cpu_device::set_has_extended_io(*device, _has_extended_io); \
- mc68hc11_cpu_device::set_internal_ram_size(*device, _internal_ram_size); \
- mc68hc11_cpu_device::set_init_value(*device, _init_value);
+ downcast<mc68hc11_cpu_device &>(*device).set_has_extended_io(_has_extended_io); \
+ downcast<mc68hc11_cpu_device &>(*device).set_internal_ram_size(_internal_ram_size); \
+ downcast<mc68hc11_cpu_device &>(*device).set_init_value(_init_value);
class mc68hc11_cpu_device : public cpu_device
@@ -45,10 +45,10 @@ public:
mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// I/O enable flag
- static void set_has_extended_io(device_t &device, int has_extended_io) { downcast<mc68hc11_cpu_device &>(device).m_has_extended_io = has_extended_io; }
- static void set_internal_ram_size(device_t &device, int internal_ram_size) { downcast<mc68hc11_cpu_device &>(device).m_internal_ram_size = internal_ram_size; }
+ void set_has_extended_io(int has_extended_io) { m_has_extended_io = has_extended_io; }
+ void set_internal_ram_size(int internal_ram_size) { m_internal_ram_size = internal_ram_size; }
// default value for INIT register
- static void set_init_value(device_t &device, int init_value) { downcast<mc68hc11_cpu_device &>(device).m_init_value = init_value; }
+ void set_init_value(int init_value) { m_init_value = init_value; }
protected:
// device-level overrides
diff --git a/src/devices/cpu/mcs40/mcs40.h b/src/devices/cpu/mcs40/mcs40.h
index 3a7605fc366..177425fff0f 100644
--- a/src/devices/cpu/mcs40/mcs40.h
+++ b/src/devices/cpu/mcs40/mcs40.h
@@ -48,31 +48,31 @@ enum
MCFG_DEVICE_ADDRESS_MAP(i4004_cpu_device::AS_PROGRAM_MEMORY, map)
#define MCFG_I4004_BUS_CYCLE_CB(obj) \
- i4004_cpu_device::set_bus_cycle_cb(*device, (MCS40CB_##obj));
+ downcast<i4004_cpu_device &>(*device).set_bus_cycle_cb((MCS40CB_##obj));
#define MCFG_I4004_SYNC_CB(obj) \
- devcb = &i4004_cpu_device::set_sync_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_sync_cb(DEVCB_##obj);
#define MCFG_I4004_CM_ROM_CB(obj) \
- devcb = &i4004_cpu_device::set_cm_rom_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_cm_rom_cb(DEVCB_##obj);
#define MCFG_I4004_CM_RAM0_CB(obj) \
- devcb = &i4004_cpu_device::set_cm_ram_cb<0>(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_cm_ram_cb<0>(DEVCB_##obj);
#define MCFG_I4004_CM_RAM1_CB(obj) \
- devcb = &i4004_cpu_device::set_cm_ram_cb<1>(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_cm_ram_cb<1>(DEVCB_##obj);
#define MCFG_I4004_CM_RAM2_CB(obj) \
- devcb = &i4004_cpu_device::set_cm_ram_cb<2>(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_cm_ram_cb<2>(DEVCB_##obj);
#define MCFG_I4004_CM_RAM3_CB(obj) \
- devcb = &i4004_cpu_device::set_cm_ram_cb<3>(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_cm_ram_cb<3>(DEVCB_##obj);
#define MCFG_I4004_4289_PM_CB(obj) \
- devcb = &i4004_cpu_device::set_4289_pm_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_4289_pm_cb(DEVCB_##obj);
#define MCFG_I4004_4289_F_L_CB(obj) \
- devcb = &i4004_cpu_device::set_4289_f_l_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4004_cpu_device &>(*device).set_4289_f_l_cb(DEVCB_##obj);
#define MCFG_I4040_ROM_MAP(map) \
@@ -94,40 +94,40 @@ enum
MCFG_DEVICE_ADDRESS_MAP(i4040_cpu_device::AS_PROGRAM_MEMORY, map)
#define MCFG_I4040_BUS_CYCLE_CB(obj) \
- i4040_cpu_device::set_bus_cycle_cb(*device, (MCS40CB_##obj));
+ downcast<i4040_cpu_device &>(*device).set_bus_cycle_cb((MCS40CB_##obj));
#define MCFG_I4040_SYNC_CB(obj) \
- devcb = &i4040_cpu_device::set_sync_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_sync_cb(DEVCB_##obj);
#define MCFG_I4040_CM_ROM0_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_rom_cb<0>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_rom_cb<0>(DEVCB_##obj);
#define MCFG_I4040_CM_ROM1_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_rom_cb<1>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_rom_cb<1>(DEVCB_##obj);
#define MCFG_I4040_CM_RAM0_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_ram_cb<0>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_ram_cb<0>(DEVCB_##obj);
#define MCFG_I4040_CM_RAM1_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_ram_cb<1>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_ram_cb<1>(DEVCB_##obj);
#define MCFG_I4040_CM_RAM2_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_ram_cb<2>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_ram_cb<2>(DEVCB_##obj);
#define MCFG_I4040_CM_RAM3_CB(obj) \
- devcb = &i4040_cpu_device::set_cm_ram_cb<3>(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cm_ram_cb<3>(DEVCB_##obj);
#define MCFG_I4040_CY_CB(obj) \
- devcb = &i4040_cpu_device::set_cy_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_cy_cb(DEVCB_##obj);
#define MCFG_I4040_STP_ACK_CB(obj) \
- devcb = &i4040_cpu_device::set_stp_ack_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_stp_ack_cb(DEVCB_##obj);
#define MCFG_I4040_4289_PM_CB(obj) \
- devcb = &i4040_cpu_device::set_4289_pm_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_4289_pm_cb(DEVCB_##obj);
#define MCFG_I4040_4289_F_L_CB(obj) \
- devcb = &i4040_cpu_device::set_4289_f_l_cb(*device, DEVCB_##obj);
+ devcb = &downcast<i4040_cpu_device &>(*device).set_4289_f_l_cb(DEVCB_##obj);
@@ -152,12 +152,9 @@ public:
typedef device_delegate<void (phase step, u8 sync, u8 data)> bus_cycle_delegate;
// configuration helpers
- template <typename Obj> static void set_bus_cycle_cb(device_t &device, Obj &&cb)
- { downcast<mcs40_cpu_device_base &>(device).m_bus_cycle_cb = std::forward<Obj>(cb); }
- template <typename Obj> static devcb_base &set_4289_pm_cb(device_t &device, Obj &&cb)
- { return downcast<mcs40_cpu_device_base &>(device).m_4289_pm_cb.set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_4289_f_l_cb(device_t &device, Obj &&cb)
- { return downcast<mcs40_cpu_device_base &>(device).m_4289_f_l_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> void set_bus_cycle_cb(Obj &&cb) { m_bus_cycle_cb = std::forward<Obj>(cb); }
+ template <typename Obj> devcb_base &set_4289_pm_cb(Obj &&cb) { return m_4289_pm_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_4289_f_l_cb(Obj &&cb) { return m_4289_f_l_cb.set_callback(std::forward<Obj>(cb)); }
// chip select outputs
u8 get_cm_rom() const { return m_cm_rom; }
@@ -241,16 +238,11 @@ protected:
void set_stp(int state);
// configuration helpers
- template <typename Obj> devcb_base &set_sync_cb(Obj &&cb)
- { return m_sync_cb.set_callback(std::forward<Obj>(cb)); }
- template <unsigned N, typename Obj> devcb_base &set_cm_rom_cb(Obj &&cb)
- { return m_cm_rom_cb[N].set_callback(std::forward<Obj>(cb)); }
- template <unsigned N, typename Obj> devcb_base &set_cm_ram_cb(Obj &&cb)
- { return m_cm_ram_cb[N].set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> devcb_base &set_cy_cb(Obj &&cb)
- { return m_cy_cb.set_callback(std::forward<Obj>(cb)); }
- template <typename Obj> devcb_base &set_stp_ack_cb(Obj &&cb)
- { return m_stp_ack_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_sync_cb(Obj &&cb) { return m_sync_cb.set_callback(std::forward<Obj>(cb)); }
+ template <unsigned N, typename Obj> devcb_base &set_cm_rom_cb(Obj &&cb) { return m_cm_rom_cb[N].set_callback(std::forward<Obj>(cb)); }
+ template <unsigned N, typename Obj> devcb_base &set_cm_ram_cb(Obj &&cb) { return m_cm_ram_cb[N].set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_cy_cb(Obj &&cb) { return m_cy_cb.set_callback(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_stp_ack_cb(Obj &&cb) { return m_stp_ack_cb.set_callback(std::forward<Obj>(cb)); }
private:
enum
@@ -357,12 +349,9 @@ class i4004_cpu_device : public mcs40_cpu_device_base
{
public:
// configuration helpers
- template <typename Obj> static devcb_base &set_sync_cb(device_t &device, Obj &&cb)
- { return downcast<i4004_cpu_device &>(device).set_sync_cb(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_cm_rom_cb(device_t &device, Obj &&cb)
- { return downcast<i4004_cpu_device &>(device).set_cm_rom_cb<0>(std::forward<Obj>(cb)); }
- template <unsigned N, typename Obj> static devcb_base &set_cm_ram_cb(device_t &device, Obj &&cb)
- { return downcast<i4004_cpu_device &>(device).set_cm_ram_cb<N>(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_sync_cb(Obj &&cb) { return mcs40_cpu_device_base::set_sync_cb(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_cm_rom_cb(Obj &&cb) { return set_cm_rom_cb<0>(std::forward<Obj>(cb)); }
+ template <unsigned N, typename Obj> devcb_base &set_cm_ram_cb(Obj &&cb) { return mcs40_cpu_device_base::set_cm_ram_cb<N>(std::forward<Obj>(cb)); }
i4004_cpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
@@ -393,16 +382,11 @@ class i4040_cpu_device : public i4004_cpu_device
{
public:
// configuration helpers
- template <typename Obj> static devcb_base &set_sync_cb(device_t &device, Obj &&cb)
- { return downcast<i4040_cpu_device &>(device).set_sync_cb(std::forward<Obj>(cb)); }
- template <unsigned N, typename Obj> static devcb_base &set_cm_rom_cb(device_t &device, Obj &&cb)
- { return downcast<i4040_cpu_device &>(device).set_cm_rom_cb<N>(std::forward<Obj>(cb)); }
- template <unsigned N, typename Obj> static devcb_base &set_cm_ram_cb(device_t &device, Obj &&cb)
- { return downcast<i4040_cpu_device &>(device).set_cm_ram_cb<N>(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_cy_cb(device_t &device, Obj &&cb)
- { return downcast<i4040_cpu_device &>(device).set_cy_cb(std::forward<Obj>(cb)); }
- template <typename Obj> static devcb_base &set_stp_ack_cb(device_t &device, Obj &&cb)
- { return downcast<i4040_cpu_device &>(device).set_stp_ack_cb(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_sync_cb(Obj &&cb) { return i4004_cpu_device::set_sync_cb(std::forward<Obj>(cb)); }
+ template <unsigned N, typename Obj> devcb_base &set_cm_rom_cb(Obj &&cb) { return set_cm_rom_cb<N>(std::forward<Obj>(cb)); }
+ template <unsigned N, typename Obj> devcb_base &set_cm_ram_cb(Obj &&cb) { return set_cm_ram_cb<N>(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_cy_cb(Obj &&cb) { return i4004_cpu_device::set_cy_cb(std::forward<Obj>(cb)); }
+ template <typename Obj> devcb_base &set_stp_ack_cb(Obj &&cb) { return i4004_cpu_device::set_stp_ack_cb(std::forward<Obj>(cb)); }
i4040_cpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h
index 464d3e010e1..58dc676219e 100644
--- a/src/devices/cpu/mcs48/mcs48.h
+++ b/src/devices/cpu/mcs48/mcs48.h
@@ -69,33 +69,33 @@ enum
#define MCFG_MCS48_PORT_P1_IN_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_port_in_cb(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_port_in_cb(0, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_P1_OUT_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_port_out_cb(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_port_out_cb(0, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_P2_IN_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_port_in_cb(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_port_in_cb(1, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_P2_OUT_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_port_out_cb(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_port_out_cb(1, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_T0_IN_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_test_in_cb(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_test_in_cb(0, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_T0_CLK_DEVICE(_tag) \
- mcs48_cpu_device::set_t0_clk_cb(*device, clock_update_delegate(FUNC(device_t::set_unscaled_clock), _tag, (device_t *)nullptr));
+ downcast<mcs48_cpu_device &>(*device).set_t0_clk_cb(clock_update_delegate(FUNC(device_t::set_unscaled_clock), _tag, (device_t *)nullptr));
#define MCFG_MCS48_PORT_T0_CLK_CUSTOM(_class, _func) \
- mcs48_cpu_device::set_t0_clk_cb(*device, clock_update_delegate(&_class::_func, #_class "::" _func, owner));
+ downcast<mcs48_cpu_device &>(*device).set_t0_clk_cb(clock_update_delegate(&_class::_func, #_class "::" _func, owner));
#define MCFG_MCS48_PORT_T1_IN_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_test_in_cb(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_test_in_cb(1, DEVCB_##_devcb);
#define MCFG_MCS48_PORT_BUS_IN_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_bus_in_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_bus_in_cb(DEVCB_##_devcb);
#define MCFG_MCS48_PORT_BUS_OUT_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_bus_out_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_bus_out_cb(DEVCB_##_devcb);
// PROG line to 8243 expander
#define MCFG_MCS48_PORT_PROG_OUT_CB(_devcb) \
- devcb = &mcs48_cpu_device::set_prog_out_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mcs48_cpu_device &>(*device).set_prog_out_cb(DEVCB_##_devcb);
/***************************************************************************
@@ -141,14 +141,14 @@ public:
EXPANDER_OP_AND = 3
};
- // static configuration
- template <class Object> static devcb_base &set_port_in_cb(device_t &device, int n, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_port_in_cb[n].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_port_out_cb(device_t &device, int n, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_port_out_cb[n].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_bus_in_cb(device_t &device, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_bus_in_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_bus_out_cb(device_t &device, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_bus_out_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_test_in_cb(device_t &device, int n, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_test_in_cb[n].set_callback(std::forward<Object>(cb)); }
- static void set_t0_clk_cb(device_t &device, clock_update_delegate &&func) { downcast<mcs48_cpu_device &>(device).m_t0_clk_func = std::move(func); }
- template <class Object> static devcb_base &set_prog_out_cb(device_t &device, Object &&cb) { return downcast<mcs48_cpu_device &>(device).m_prog_out_cb.set_callback(std::forward<Object>(cb)); }
+ // configuration
+ template <class Object> devcb_base &set_port_in_cb(int n, Object &&cb) { return m_port_in_cb[n].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_port_out_cb(int n, Object &&cb) { return m_port_out_cb[n].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_bus_in_cb(Object &&cb) { return m_bus_in_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_bus_out_cb(Object &&cb) { return m_bus_out_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_test_in_cb(int n, Object &&cb) { return m_test_in_cb[n].set_callback(std::forward<Object>(cb)); }
+ template <typename Object> void set_t0_clk_cb(Object &&cb) { m_t0_clk_func = std::forward<Object>(cb); }
+ template <class Object> devcb_base &set_prog_out_cb(Object &&cb) { return m_prog_out_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER(p1_r);
DECLARE_READ8_MEMBER(p2_r);
diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h
index e19c38f2a7b..2f4c096c04e 100644
--- a/src/devices/cpu/mcs51/mcs51.h
+++ b/src/devices/cpu/mcs51/mcs51.h
@@ -33,30 +33,30 @@
#define MCFG_MCS51_PORT_P0_IN_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_in_cb(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_in_cb(0, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P0_OUT_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_out_cb(*device, 0, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_out_cb(0, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P1_IN_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_in_cb(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_in_cb(1, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P1_OUT_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_out_cb(*device, 1, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_out_cb(1, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P2_IN_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_in_cb(*device, 2, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_in_cb(2, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P2_OUT_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_out_cb(*device, 2, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_out_cb(2, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P3_IN_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_in_cb(*device, 3, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_in_cb(3, DEVCB_##_devcb);
#define MCFG_MCS51_PORT_P3_OUT_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_port_out_cb(*device, 3, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_port_out_cb(3, DEVCB_##_devcb);
#define MCFG_MCS51_SERIAL_RX_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_serial_rx_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_serial_rx_cb(DEVCB_##_devcb);
#define MCFG_MCS51_SERIAL_TX_CB(_devcb) \
- devcb = &mcs51_cpu_device::set_serial_tx_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<mcs51_cpu_device &>(*device).set_serial_tx_cb(DEVCB_##_devcb);
enum
@@ -84,21 +84,21 @@ enum
*/
#define MCFG_MCS51_PORT1_CONFIG(_forced_inputs) \
- mcs51_cpu_device::set_port_forced_input(*device, 1, _forced_inputs);
+ downcast<mcs51_cpu_device &>(*device).set_port_forced_input(1, _forced_inputs);
#define MCFG_MCS51_PORT2_CONFIG(_forced_inputs) \
- mcs51_cpu_device::set_port_forced_input(*device, 2, _forced_inputs);
+ downcast<mcs51_cpu_device &>(*device).set_port_forced_input(2, _forced_inputs);
#define MCFG_MCS51_PORT3_CONFIG(_forced_inputs) \
- mcs51_cpu_device::set_port_forced_input(*device, 3, _forced_inputs);
+ downcast<mcs51_cpu_device &>(*device).set_port_forced_input(3, _forced_inputs);
class mcs51_cpu_device : public cpu_device
{
public:
// configuration helpers
- template<class Object> static devcb_base &set_port_in_cb(device_t &device, int n, Object &&cb) { return downcast<mcs51_cpu_device &>(device).m_port_in_cb[n].set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_port_out_cb(device_t &device, int n, Object &&cb) { return downcast<mcs51_cpu_device &>(device).m_port_out_cb[n].set_callback(std::forward<Object>(cb)); }
- static void set_port_forced_input(device_t &device, uint8_t port, uint8_t forced_input) { downcast<mcs51_cpu_device &>(device).m_forced_inputs[port] = forced_input; }
- template<class Object> static devcb_base &set_serial_rx_cb(device_t &device, Object &&cb) { return downcast<mcs51_cpu_device &>(device).m_serial_rx_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_serial_tx_cb(device_t &device, Object &&cb) { return downcast<mcs51_cpu_device &>(device).m_serial_tx_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_port_in_cb(int n, Object &&cb) { return m_port_in_cb[n].set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_port_out_cb(int n, Object &&cb) { return m_port_out_cb[n].set_callback(std::forward<Object>(cb)); }
+ void set_port_forced_input(uint8_t port, uint8_t forced_input) { m_forced_inputs[port] = forced_input; }
+ template<class Object> devcb_base &set_serial_rx_cb(Object &&cb) { return m_serial_rx_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_serial_tx_cb(Object &&cb) { return m_serial_tx_cb.set_callback(std::forward<Object>(cb)); }
void data_7bit(address_map &map);
void data_8bit(address_map &map);
@@ -527,9 +527,9 @@ public:
// construction/destruction
ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void set_mcon(device_t &device, uint8_t mcon) { downcast<ds5002fp_device &>(device).m_ds5002fp.mcon = mcon; }
- static void set_rpctl(device_t &device, uint8_t rpctl) { downcast<ds5002fp_device &>(device).m_ds5002fp.rpctl = rpctl; }
- static void set_crc(device_t &device, uint8_t crc) { downcast<ds5002fp_device &>(device).m_ds5002fp.crc = crc; }
+ void set_mcon(uint8_t mcon) { m_ds5002fp.mcon = mcon; }
+ void set_rpctl(uint8_t rpctl) { m_ds5002fp.rpctl = rpctl; }
+ void set_crc(uint8_t crc) { m_ds5002fp.crc = crc; }
// device_nvram_interface overrides
virtual void nvram_default() override;
diff --git a/src/devices/cpu/melps4/melps4.h b/src/devices/cpu/melps4/melps4.h
index c268d74e508..ae11114aecf 100644
--- a/src/devices/cpu/melps4/melps4.h
+++ b/src/devices/cpu/melps4/melps4.h
@@ -16,37 +16,37 @@
// K input or A/D input port, up to 16 pins
#define MCFG_MELPS4_READ_K_CB(_devcb) \
- devcb = &melps4_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_read_k_callback(DEVCB_##_devcb);
// D discrete I/O port, up to 16 pins - offset 0-15 for bit, 16 for all pins clear
#define MCFG_MELPS4_READ_D_CB(_devcb) \
- devcb = &melps4_cpu_device::set_read_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_read_d_callback(DEVCB_##_devcb);
#define MCFG_MELPS4_WRITE_D_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_d_callback(DEVCB_##_devcb);
// 8-bit S generic I/O port
#define MCFG_MELPS4_READ_S_CB(_devcb) \
- devcb = &melps4_cpu_device::set_read_s_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_read_s_callback(DEVCB_##_devcb);
#define MCFG_MELPS4_WRITE_S_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_s_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_s_callback(DEVCB_##_devcb);
// 4-bit F generic I/O port
#define MCFG_MELPS4_READ_F_CB(_devcb) \
- devcb = &melps4_cpu_device::set_read_f_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_read_f_callback(DEVCB_##_devcb);
#define MCFG_MELPS4_WRITE_F_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_f_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_f_callback(DEVCB_##_devcb);
// 4-bit G generic output port
#define MCFG_MELPS4_WRITE_G_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_g_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_g_callback(DEVCB_##_devcb);
// 1-bit U generic output port
#define MCFG_MELPS4_WRITE_U_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_u_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_u_callback(DEVCB_##_devcb);
// T timer I/O pin (use execute_set_input for reads)
#define MCFG_MELPS4_WRITE_T_CB(_devcb) \
- devcb = &melps4_cpu_device::set_write_t_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<melps4_cpu_device &>(*device).set_write_t_callback(DEVCB_##_devcb);
#define MELPS4_PORTD_CLR 16
@@ -100,18 +100,18 @@ enum
class melps4_cpu_device : public cpu_device
{
public:
- // static configuration helpers
- template <class Object> static devcb_base &set_read_k_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_read_k.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_d_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_read_d.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_s_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_read_s.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_f_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_read_f.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_write_d_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_d.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_s_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_s.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_f_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_f.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_g_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_g.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_u_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_u.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_t_callback(device_t &device, Object &&cb) { return downcast<melps4_cpu_device &>(device).m_write_t.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_read_k_callback(Object &&cb) { return m_read_k.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_s_callback(Object &&cb) { return m_read_s.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_f_callback(Object &&cb) { return m_read_f.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_s_callback(Object &&cb) { return m_write_s.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_f_callback(Object &&cb) { return m_write_f.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_g_callback(Object &&cb) { return m_write_g.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_u_callback(Object &&cb) { return m_write_u.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_t_callback(Object &&cb) { return m_write_t.set_callback(std::forward<Object>(cb)); }
protected:
// construction/destruction
diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h
index dd0bac966d9..e207dd23469 100644
--- a/src/devices/cpu/mips/mips3.h
+++ b/src/devices/cpu/mips/mips3.h
@@ -238,13 +238,13 @@ struct compiler_state
#define MIPS3_MAX_TLB_ENTRIES 48
#define MCFG_MIPS3_ICACHE_SIZE(_size) \
- mips3_device::set_icache_size(*device, _size);
+ downcast<mips3_device &>(*device).set_icache_size(_size);
#define MCFG_MIPS3_DCACHE_SIZE(_size) \
- mips3_device::set_dcache_size(*device, _size);
+ downcast<mips3_device &>(*device).set_dcache_size(_size);
#define MCFG_MIPS3_SYSTEM_CLOCK(_clock) \
- mips3_device::set_system_clock(*device, _clock);
+ downcast<mips3_device &>(*device).set_system_clock(_clock);
class mips3_frontend;
@@ -277,9 +277,9 @@ public:
// construction/destruction
mips3_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, mips3_flavor flavor, endianness_t endiannes);
- static void set_icache_size(device_t &device, size_t icache_size) { downcast<mips3_device &>(device).c_icache_size = icache_size; }
- static void set_dcache_size(device_t &device, size_t dcache_size) { downcast<mips3_device &>(device).c_dcache_size = dcache_size; }
- static void set_system_clock(device_t &device, uint32_t system_clock) { downcast<mips3_device &>(device).c_system_clock = system_clock; }
+ void set_icache_size(size_t icache_size) { c_icache_size = icache_size; }
+ void set_dcache_size(size_t dcache_size) { c_dcache_size = dcache_size; }
+ void set_system_clock(uint32_t system_clock) { c_system_clock = system_clock; }
TIMER_CALLBACK_MEMBER(compare_int_callback);
diff --git a/src/devices/cpu/mips/r3000.h b/src/devices/cpu/mips/r3000.h
index a5f9998a23c..9af401484d2 100644
--- a/src/devices/cpu/mips/r3000.h
+++ b/src/devices/cpu/mips/r3000.h
@@ -19,19 +19,19 @@
***************************************************************************/
#define MCFG_R3000_ENDIANNESS(_endianness) \
- r3000_device::static_set_endianness(*device, _endianness);
+ downcast<r3000_device &>(*device).set_endianness(_endianness);
#define MCFG_R3000_BRCOND0_INPUT(_devcb) \
- devcb = &r3000_device::static_set_brcond0_input(*device, DEVCB_##_devcb);
+ devcb = &downcast<r3000_device &>(*device).set_brcond0_input(DEVCB_##_devcb);
#define MCFG_R3000_BRCOND1_INPUT(_devcb) \
- devcb = &r3000_device::static_set_brcond1_input(*device, DEVCB_##_devcb);
+ devcb = &downcast<r3000_device &>(*device).set_brcond1_input(DEVCB_##_devcb);
#define MCFG_R3000_BRCOND2_INPUT(_devcb) \
- devcb = &r3000_device::static_set_brcond2_input(*device, DEVCB_##_devcb);
+ devcb = &downcast<r3000_device &>(*device).set_brcond2_input(DEVCB_##_devcb);
#define MCFG_R3000_BRCOND3_INPUT(_devcb) \
- devcb = &r3000_device::static_set_brcond3_input(*device, DEVCB_##_devcb);
+ devcb = &downcast<r3000_device &>(*device).set_brcond3_input(DEVCB_##_devcb);
/***************************************************************************
@@ -73,30 +73,12 @@ public:
virtual ~r3000_device();
// inline configuration helpers
- static void static_set_endianness(device_t &device, endianness_t endianness)
- {
- downcast<r3000_device &>(device).m_endianness = endianness;
- }
-
- template <class Object> static devcb_base &static_set_brcond0_input(device_t &device, Object &&cb)
- {
- return downcast<r3000_device &>(device).m_in_brcond0.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &static_set_brcond1_input(device_t &device, Object &&cb)
- {
- return downcast<r3000_device &>(device).m_in_brcond1.set_callback(std::forward<Object>(cb));
- }
-
- template <class Object> static devcb_base &static_set_brcond2_input(device_t &device, Object &&cb)
- {
- return downcast<r3000_device &>(device).m_in_brcond2.set_callback(std::forward<Object>(cb));
- }
+ void set_endianness(endianness_t endianness) { m_endianness = endianness; }
- template <class Object> static devcb_base &static_set_brcond3_input(device_t &device, Object &&cb)
- {
- return downcast<r3000_device &>(device).m_in_brcond3.set_callback(std::forward<Object>(cb));
- }
+ template <class Object> devcb_base &set_brcond0_input(Object &&cb) { return m_in_brcond0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_brcond1_input(Object &&cb) { return m_in_brcond1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_brcond2_input(Object &&cb) { return m_in_brcond2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_brcond3_input(Object &&cb) { return m_in_brcond3.set_callback(std::forward<Object>(cb)); }
protected:
enum chip_type
diff --git a/src/devices/cpu/mn10200/mn10200.h b/src/devices/cpu/mn10200/mn10200.h
index f3b496611bb..aadeff37281 100644
--- a/src/devices/cpu/mn10200/mn10200.h
+++ b/src/devices/cpu/mn10200/mn10200.h
@@ -15,9 +15,9 @@
// port setup
#define MCFG_MN10200_READ_PORT_CB(X, _devcb) \
- devcb = &mn10200_device::set_read_port##X##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mn10200_device &>(*device).set_read_port##X##_callback(DEVCB_##_devcb);
#define MCFG_MN10200_WRITE_PORT_CB(X, _devcb) \
- devcb = &mn10200_device::set_write_port##X##_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<mn10200_device &>(*device).set_write_port##X##_callback(DEVCB_##_devcb);
enum
{
@@ -42,18 +42,18 @@ enum
class mn10200_device : public cpu_device
{
public:
- // static configuration helpers
- template <class Object> static devcb_base &set_read_port0_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_read_port0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_port1_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_read_port1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_port2_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_read_port2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_port3_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_read_port3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_port4_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_read_port4.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_write_port0_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_write_port0.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_port1_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_write_port1.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_port2_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_write_port2.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_port3_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_write_port3.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_write_port4_callback(device_t &device, Object &&cb) { return downcast<mn10200_device &>(device).m_write_port4.set_callback(std::forward<Object>(cb)); }
+ // configuration helpers
+ template <class Object> devcb_base &set_read_port0_callback(Object &&cb) { return m_read_port0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_port1_callback(Object &&cb) { return m_read_port1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_port2_callback(Object &&cb) { return m_read_port2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_port3_callback(Object &&cb) { return m_read_port3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_port4_callback(Object &&cb) { return m_read_port4.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_write_port0_callback(Object &&cb) { return m_write_port0.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_port1_callback(Object &&cb) { return m_write_port1.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_port2_callback(Object &&cb) { return m_write_port2.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_port3_callback(Object &&cb) { return m_write_port3.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_write_port4_callback(Object &&cb) { return m_write_port4.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER(io_control_r);
DECLARE_WRITE8_MEMBER(io_control_w);
diff --git a/src/devices/cpu/nanoprocessor/nanoprocessor.h b/src/devices/cpu/nanoprocessor/nanoprocessor.h
index 98b717e6c07..1a8c820e748 100644
--- a/src/devices/cpu/nanoprocessor/nanoprocessor.h
+++ b/src/devices/cpu/nanoprocessor/nanoprocessor.h
@@ -62,20 +62,20 @@ constexpr unsigned HP_NANO_IE_DC = 7; // DC line used as interrupt enable/ma
// DC0 is in bit 0, DC1 in bit 1 and so on.
// Keep in mind that DC7 usually masks the interrupt signal.
#define MCFG_HP_NANO_DC_CHANGED(_devcb) \
- devcb = &hp_nanoprocessor_device::set_dc_changed_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp_nanoprocessor_device &>(*device).set_dc_changed_func(DEVCB_##_devcb);
// Callback to read the input state of DC lines
// All lines that are not in input are to be reported at "1"
#define MCFG_HP_NANO_READ_DC_CB(_devcb) \
- devcb = &hp_nanoprocessor_device::set_read_dc_func(*device , DEVCB_##_devcb);
+ devcb = &downcast<hp_nanoprocessor_device &>(*device).set_read_dc_func(DEVCB_##_devcb);
class hp_nanoprocessor_device : public cpu_device
{
public:
hp_nanoprocessor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_dc_changed_func(device_t &device, Object &&cb) { return downcast<hp_nanoprocessor_device &>(device).m_dc_changed_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_read_dc_func(device_t &device, Object &&cb) { return downcast<hp_nanoprocessor_device &>(device).m_read_dc_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dc_changed_func(Object &&cb) { return m_dc_changed_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_read_dc_func(Object &&cb) { return m_read_dc_func.set_callback(std::forward<Object>(cb)); }
// device_execute_interface overrides
virtual uint32_t execute_min_cycles() const override { return 2; }
diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h
index cda729e88ef..b796bed3b67 100644
--- a/src/devices/cpu/nec/v25.h
+++ b/src/devices/cpu/nec/v25.h
@@ -23,45 +23,45 @@ enum
#define MCFG_V25_CONFIG(_table) \
- v25_common_device::set_decryption_table(*device, _table);
+ downcast<v25_common_device &>(*device).set_decryption_table(_table);
#define MCFG_V25_PORT_PT_READ_CB(_devcb) \
- devcb = &v25_common_device::set_pt_in_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_pt_in_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P0_READ_CB(_devcb) \
- devcb = &v25_common_device::set_p0_in_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p0_in_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P1_READ_CB(_devcb) \
- devcb = &v25_common_device::set_p1_in_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p1_in_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P2_READ_CB(_devcb) \
- devcb = &v25_common_device::set_p2_in_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p2_in_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P0_WRITE_CB(_devcb) \
- devcb = &v25_common_device::set_p0_out_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p0_out_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P1_WRITE_CB(_devcb) \
- devcb = &v25_common_device::set_p1_out_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p1_out_cb(DEVCB_##_devcb);
#define MCFG_V25_PORT_P2_WRITE_CB(_devcb) \
- devcb = &v25_common_device::set_p2_out_cb(*device, DEVCB_##_devcb);
+ devcb = &downcast<v25_common_device &>(*device).set_p2_out_cb(DEVCB_##_devcb);
class v25_common_device : public cpu_device
{
public:
- // static configuration helpers
- static void set_decryption_table(device_t &device, const uint8_t *decryption_table) { downcast<v25_common_device &>(device).m_v25v35_decryptiontable = decryption_table; }
+ // configuration helpers
+ void set_decryption_table(const uint8_t *decryption_table) { m_v25v35_decryptiontable = decryption_table; }
- template <class Object> static devcb_base & set_pt_in_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_pt_in.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p0_in_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p0_in.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p1_in_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p1_in.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p2_in_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p2_in.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_pt_in_cb(Object &&cb) { return m_pt_in.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p0_in_cb(Object &&cb) { return m_p0_in.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p1_in_cb(Object &&cb) { return m_p1_in.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p2_in_cb(Object &&cb) { return m_p2_in.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p0_out_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p0_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p1_out_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p1_out.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base & set_p2_out_cb(device_t &device, Object &&cb) { return downcast<v25_common_device &>(device).m_p2_out.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p0_out_cb(Object &&cb) { return m_p0_out.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p1_out_cb(Object &&cb) { return m_p1_out.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_p2_out_cb(Object &&cb) { return m_p2_out.set_callback(std::forward<Object>(cb)); }
TIMER_CALLBACK_MEMBER(v25_timer_callback);
diff --git a/src/devices/cpu/nec/v53.cpp b/src/devices/cpu/nec/v53.cpp
index 0e91bb64614..018613af230 100644
--- a/src/devices/cpu/nec/v53.cpp
+++ b/src/devices/cpu/nec/v53.cpp
@@ -228,7 +228,7 @@ void v53_base_device::device_start()
m_out_dack_2_cb.resolve_safe();
m_out_dack_3_cb.resolve_safe();
- static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(pic8259_device::inta_cb), (pic8259_device*)m_v53icu));
+ set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pic8259_device::inta_cb), (pic8259_device*)m_v53icu));
}
void v53_base_device::install_peripheral_io()
diff --git a/src/devices/cpu/nec/v53.h b/src/devices/cpu/nec/v53.h
index 1c45a3cbc89..dfecbfb5f04 100644
--- a/src/devices/cpu/nec/v53.h
+++ b/src/devices/cpu/nec/v53.h
@@ -16,94 +16,94 @@
// SCU
#define MCFG_V53_SCU_TXD_HANDLER(_devcb) \
- devcb = &v53_base_device::set_txd_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_txd_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_DTR_HANDLER(_devcb) \
- devcb = &v53_base_device::set_dtr_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_dtr_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_RTS_HANDLER(_devcb) \
- devcb = &v53_base_device::set_rts_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_rts_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_RXRDY_HANDLER(_devcb) \
- devcb = &v53_base_device::set_rxrdy_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_rxrdy_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_TXRDY_HANDLER(_devcb) \
- devcb = &v53_base_device::set_txrdy_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_txrdy_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_TXEMPTY_HANDLER(_devcb) \
- devcb = &v53_base_device::set_txempty_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_txempty_handler(DEVCB_##_devcb);
#define MCFG_V53_SCU_SYNDET_HANDLER(_devcb) \
- devcb = &v53_base_device::set_syndet_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_syndet_handler(DEVCB_##_devcb);
// TCU
#define MCFG_V53_TCU_CLK0(_clk) \
- v53_base_device::set_clk0(*device, _clk);
+ downcast<v53_base_device &>(*device).set_clk0(_clk);
#define MCFG_V53_TCU_CLK1(_clk) \
- v53_base_device::set_clk1(*device, _clk);
+ downcast<v53_base_device &>(*device).set_clk1(_clk);
#define MCFG_V53_TCU_CLK2(_clk) \
- v53_base_device::set_clk2(*device, _clk);
+ downcast<v53_base_device &>(*device).set_clk2(_clk);
#define MCFG_V53_TCU_OUT0_HANDLER(_devcb) \
- devcb = &v53_base_device::set_out0_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out0_handler(DEVCB_##_devcb);
#define MCFG_V53_TCU_OUT1_HANDLER(_devcb) \
- devcb = &v53_base_device::set_out1_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out1_handler(DEVCB_##_devcb);
#define MCFG_V53_TCU_OUT2_HANDLER(_devcb) \
- devcb = &v53_base_device::set_out2_handler(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out2_handler(DEVCB_##_devcb);
// DMAU
#define MCFG_V53_DMAU_OUT_HREQ_CB(_devcb) \
- devcb = &v53_base_device::set_out_hreq_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_hreq_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_EOP_CB(_devcb) \
- devcb = &v53_base_device::set_out_eop_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_eop_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_IN_MEMR_CB(_devcb) \
- devcb = &v53_base_device::set_in_memr_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_in_memr_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_MEMW_CB(_devcb) \
- devcb = &v53_base_device::set_out_memw_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_memw_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_IN_IOR_0_CB(_devcb) \
- devcb = &v53_base_device::set_in_ior_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_in_ior_0_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_IN_IOR_1_CB(_devcb) \
- devcb = &v53_base_device::set_in_ior_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_in_ior_1_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_IN_IOR_2_CB(_devcb) \
- devcb = &v53_base_device::set_in_ior_2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_in_ior_2_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_IN_IOR_3_CB(_devcb) \
- devcb = &v53_base_device::set_in_ior_3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_in_ior_3_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_IOW_0_CB(_devcb) \
- devcb = &v53_base_device::set_out_iow_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_iow_0_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_IOW_1_CB(_devcb) \
- devcb = &v53_base_device::set_out_iow_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_iow_1_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_IOW_2_CB(_devcb) \
- devcb = &v53_base_device::set_out_iow_2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_iow_2_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_IOW_3_CB(_devcb) \
- devcb = &v53_base_device::set_out_iow_3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_iow_3_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_DACK_0_CB(_devcb) \
- devcb = &v53_base_device::set_out_dack_0_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_dack_0_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_DACK_1_CB(_devcb) \
- devcb = &v53_base_device::set_out_dack_1_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_dack_1_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_DACK_2_CB(_devcb) \
- devcb = &v53_base_device::set_out_dack_2_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_dack_2_callback(DEVCB_##_devcb);
#define MCFG_V53_DMAU_OUT_DACK_3_CB(_devcb) \
- devcb = &v53_base_device::set_out_dack_3_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<v53_base_device &>(*device).set_out_dack_3_callback(DEVCB_##_devcb);
@@ -135,13 +135,13 @@ public:
// SCU
DECLARE_READ8_MEMBER(scu_simk_r);
DECLARE_WRITE8_MEMBER(scu_simk_w);
- template <class Object> static devcb_base &set_txd_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_txd_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_dtr_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_dtr_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rts_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_rts_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_rxrdy_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_rxrdy_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_txrdy_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_txrdy_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_txempty_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_txempty_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_syndet_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_syndet_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_txd_handler(Object &&cb) { return m_txd_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_dtr_handler(Object &&cb) { return m_dtr_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rts_handler(Object &&cb) { return m_rts_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rxrdy_handler(Object &&cb) { return m_rxrdy_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_txrdy_handler(Object &&cb) { return m_txrdy_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_txempty_handler(Object &&cb) { return m_txempty_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_syndet_handler(Object &&cb) { return m_syndet_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(scu_txd_trampoline_cb) { m_txd_handler(state); }
DECLARE_WRITE_LINE_MEMBER(scu_dtr_trampoline_cb) { m_dtr_handler(state); }
DECLARE_WRITE_LINE_MEMBER(scu_rts_trampoline_cb) { m_rts_handler(state); }
@@ -158,33 +158,33 @@ public:
DECLARE_READ8_MEMBER(tmu_tst2_r);
DECLARE_WRITE8_MEMBER(tmu_tct2_w);
DECLARE_WRITE8_MEMBER(tmu_tmd_w);
-// static void set_clk0(device_t &device, double clk0) { downcast<v53_base_device &>(device).m_clk0 = clk0; }
-// static void set_clk1(device_t &device, double clk1) { downcast<v53_base_device &>(device).m_clk1 = clk1; }
-// static void set_clk2(device_t &device, double clk2) { downcast<v53_base_device &>(device).m_clk2 = clk2; }
- template <class Object> static devcb_base &set_out0_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out0_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out1_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out2_handler(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out2_handler.set_callback(std::forward<Object>(cb)); }
+// void set_clk0(double clk0) { m_clk0 = clk0; }
+// void set_clk1(double clk1) { m_clk1 = clk1; }
+// void set_clk2(double clk2) { m_clk2 = clk2; }
+ template <class Object> devcb_base &set_out0_handler(Object &&cb) { return m_out0_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out1_handler(Object &&cb) { return m_out1_handler.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out2_handler(Object &&cb) { return m_out2_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(tcu_out0_trampoline_cb){ m_out0_handler(state); }
DECLARE_WRITE_LINE_MEMBER(tcu_out1_trampoline_cb){ m_out1_handler(state); }
DECLARE_WRITE_LINE_MEMBER(tcu_out2_trampoline_cb){ m_out2_handler(state); }
// DMAU
- template<class Object> static devcb_base &set_out_hreq_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_hreq_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_eop_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_eop_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_in_memr_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_in_memr_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_memw_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_memw_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_in_ior_0_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_in_ior_0_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_in_ior_1_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_in_ior_1_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_in_ior_2_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_in_ior_2_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_in_ior_3_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_in_ior_3_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_iow_0_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_iow_0_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_iow_1_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_iow_1_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_iow_2_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_iow_2_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_iow_3_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_iow_3_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_dack_0_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_dack_0_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_dack_1_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_dack_1_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_dack_2_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_dack_2_cb.set_callback(std::forward<Object>(cb)); }
- template<class Object> static devcb_base &set_out_dack_3_callback(device_t &device, Object &&cb) { return downcast<v53_base_device &>(device).m_out_dack_3_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_hreq_callback(Object &&cb) { return m_out_hreq_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_eop_callback(Object &&cb) { return m_out_eop_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_in_memr_callback(Object &&cb) { return m_in_memr_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_memw_callback(Object &&cb) { return m_out_memw_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_in_ior_0_callback(Object &&cb) { return m_in_ior_0_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_in_ior_1_callback(Object &&cb) { return m_in_ior_1_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_in_ior_2_callback(Object &&cb) { return m_in_ior_2_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_in_ior_3_callback(Object &&cb) { return m_in_ior_3_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_iow_0_callback(Object &&cb) { return m_out_iow_0_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_iow_1_callback(Object &&cb) { return m_out_iow_1_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_iow_2_callback(Object &&cb) { return m_out_iow_2_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_iow_3_callback(Object &&cb) { return m_out_iow_3_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_dack_0_callback(Object &&cb) { return m_out_dack_0_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_dack_1_callback(Object &&cb) { return m_out_dack_1_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_dack_2_callback(Object &&cb) { return m_out_dack_2_cb.set_callback(std::forward<Object>(cb)); }
+ template<class Object> devcb_base &set_out_dack_3_callback(Object &&cb) { return m_out_dack_3_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_WRITE_LINE_MEMBER(dreq0_w);
DECLARE_WRITE_LINE_MEMBER(dreq1_w);
diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
index 26bf4298ad1..0450b2ea314 100644
--- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
+++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
@@ -6,13 +6,13 @@
#pragma once
#define MCFG_PATINHO_RC_READ_CB(_devcb) \
- devcb = &patinho_feio_cpu_device::set_rc_read_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<patinho_feio_cpu_device &>(*device).set_rc_read_callback(DEVCB_##_devcb);
#define MCFG_PATINHO_BUTTONS_READ_CB(_devcb) \
- devcb = &patinho_feio_cpu_device::set_buttons_read_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<patinho_feio_cpu_device &>(*device).set_buttons_read_callback(DEVCB_##_devcb);
#define MCFG_PATINHO_IODEV_READ_CB(devnumber, _devcb) \
- devcb = &patinho_feio_cpu_device::set_iodev_read_callback(*device, devnumber, DEVCB_##_devcb);
+ devcb = &downcast<patinho_feio_cpu_device &>(*device).set_iodev_read_callback(devnumber, DEVCB_##_devcb);
#define MCFG_PATINHO_IODEV_WRITE_CB(devnumber, _devcb) \
- devcb = &patinho_feio_cpu_device::set_iodev_write_callback(*device, devnumber, DEVCB_##_devcb);
+ devcb = &downcast<patinho_feio_cpu_device &>(*device).set_iodev_write_callback(devnumber, DEVCB_##_devcb);
/* register IDs */
enum
@@ -53,11 +53,11 @@ public:
// construction/destruction
patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock);
- template <class Object> static devcb_base &set_rc_read_callback(device_t &device, Object &&cb) { return downcast<patinho_feio_cpu_device &>(device).m_rc_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_buttons_read_callback(device_t &device, Object &&cb) { return downcast<patinho_feio_cpu_device &>(device).m_buttons_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_iodev_read_callback(device_t &device, int devnumber, Object &&cb) { return downcast<patinho_feio_cpu_device &>(device).m_iodev_read_cb[devnumber].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_iodev_write_callback(device_t &device, int devnumber, Object &&cb) { return downcast<patinho_feio_cpu_device &>(device).m_iodev_write_cb[devnumber].set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_iodev_status_callback(device_t &device, int devnumber, Object &&cb) { return downcast<patinho_feio_cpu_device &>(device).m_iodev_status_cb[devnumber].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_rc_read_callback(Object &&cb) { return m_rc_read_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_buttons_read_callback(Object &&cb) { return m_buttons_read_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_iodev_read_callback(int devnumber, Object &&cb) { return m_iodev_read_cb[devnumber].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_iodev_write_callback(int devnumber, Object &&cb) { return m_iodev_write_cb[devnumber].set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_iodev_status_callback(int devnumber, Object &&cb) { return m_iodev_status_cb[devnumber].set_callback(std::forward<Object>(cb)); }
void transfer_byte_from_external_device(uint8_t channel, uint8_t data);
void set_iodev_status(uint8_t channel, bool status) { m_iodev_status[channel] = status; }
diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h
index 5a2df5fd91e..a64b23f5c69 100644
--- a/src/devices/cpu/pdp1/pdp1.h
+++ b/src/devices/cpu/pdp1/pdp1.h
@@ -83,7 +83,7 @@ public:
// construction/destruction
pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- static void static_set_reset_param(device_t &device, const pdp1_reset_param_t *param) { downcast<pdp1_device &>(device).m_reset_param = param; }
+ void set_reset_param(const pdp1_reset_param_t *param) { m_reset_param = param; }
void pulse_start_clear();
void io_complete() { m_ios = 1; }
@@ -200,7 +200,7 @@ DECLARE_DEVICE_TYPE(PDP1, pdp1_device)
#define MCFG_PDP1_RESET_PARAM(_param) \
- pdp1_device::static_set_reset_param(*device, &(_param));
+ downcast<pdp1_device &>(*device).set_reset_param(&(_param));
#endif // MAME_CPU_PDP1_PDP1_H
diff --git a/src/devices/cpu/pdp1/tx0.h b/src/devices/cpu/pdp1/tx0.h
index e9174a46413..7c69bf40649 100644
--- a/src/devices/cpu/pdp1/tx0.h
+++ b/src/devices/cpu/pdp1/tx0.h
@@ -22,32 +22,32 @@ enum
#define MCFG_TX0_CONFIG(_cpy_devcb, _r1l_devcb, _dis_devcb, _r3l_devcb, _prt_devcb, _rsv_devcb, _p6h_devcb, _p7h_devcb, _sel_devcb, _res_devcb) \
- tx0_device::set_cpy_cb(*device, DEVCB_##_cpy_devcb); \
- tx0_device::set_r1l_cb(*device, DEVCB_##_r1l_devcb); \
- tx0_device::set_dis_cb(*device, DEVCB_##_dis_devcb); \