summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2019-11-01 00:47:41 +1100
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2019-11-01 00:47:41 +1100
commit6f4c1f6e5b2525ac8b700b3a0754f5e99c4223e1 (patch) (github)
tree4b0e0ac5cf1c3a7fd518a7d8f4d12f39291b2629
parent0be348c7fbc8c0478f724ba098dabeb9eb3aab8c (diff)
downloadmame-6f4c1f6e5b2525ac8b700b3a0754f5e99c4223e1.tar.bz2
mame-6f4c1f6e5b2525ac8b700b3a0754f5e99c4223e1.zip
Spring cleaning:
* Changed emu_fatalerror to use util::string_format semantics * Fixed some incorrectly marked up stuff in build scripts * Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now) * Fixed memory leaks in Xbox USB * There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it * Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave) * Got rid of device_slot_card_interface as it wasn't providing value * Added a helper template to reduce certain kinds of boilerplate in slots/buses * Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
-rw-r--r--scripts/build/complay.py4
-rw-r--r--scripts/src/bus.lua2
-rw-r--r--scripts/src/sound.lua2
-rw-r--r--src/devices/bus/a1bus/a1bus.cpp16
-rw-r--r--src/devices/bus/a1bus/a1bus.h7
-rw-r--r--src/devices/bus/a2bus/a2bus.cpp18
-rw-r--r--src/devices/bus/a2bus/a2bus.h8
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.cpp7
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.h8
-rw-r--r--src/devices/bus/a2gameio/gameio.cpp8
-rw-r--r--src/devices/bus/a2gameio/gameio.h8
-rw-r--r--src/devices/bus/a7800/a78_slot.cpp10
-rw-r--r--src/devices/bus/a7800/a78_slot.h2
-rw-r--r--src/devices/bus/a800/a800_slot.cpp19
-rw-r--r--src/devices/bus/a800/a800_slot.h4
-rw-r--r--src/devices/bus/a800/a8sio.cpp9
-rw-r--r--src/devices/bus/a800/a8sio.h5
-rw-r--r--src/devices/bus/abcbus/abcbus.cpp6
-rw-r--r--src/devices/bus/abcbus/abcbus.h39
-rw-r--r--src/devices/bus/abckb/abckb.cpp32
-rw-r--r--src/devices/bus/abckb/abckb.h6
-rw-r--r--src/devices/bus/acorn/bus.cpp24
-rw-r--r--src/devices/bus/acorn/bus.h5
-rw-r--r--src/devices/bus/adam/exp.cpp15
-rw-r--r--src/devices/bus/adam/exp.h5
-rw-r--r--src/devices/bus/adamnet/adamnet.cpp12
-rw-r--r--src/devices/bus/adamnet/adamnet.h23
-rw-r--r--src/devices/bus/amiga/keyboard/keyboard.cpp6
-rw-r--r--src/devices/bus/amiga/keyboard/keyboard.h4
-rw-r--r--src/devices/bus/amiga/zorro/zorro.cpp2
-rw-r--r--src/devices/bus/amiga/zorro/zorro.h8
-rw-r--r--src/devices/bus/apf/slot.cpp15
-rw-r--r--src/devices/bus/apf/slot.h4
-rw-r--r--src/devices/bus/apricot/expansion/expansion.cpp6
-rw-r--r--src/devices/bus/apricot/expansion/expansion.h4
-rw-r--r--src/devices/bus/apricot/keyboard/keyboard.cpp18
-rw-r--r--src/devices/bus/apricot/keyboard/keyboard.h5
-rw-r--r--src/devices/bus/arcadia/slot.cpp12
-rw-r--r--src/devices/bus/arcadia/slot.h4
-rw-r--r--src/devices/bus/astrocde/accessory.cpp33
-rw-r--r--src/devices/bus/astrocde/accessory.h5
-rw-r--r--src/devices/bus/astrocde/ctrl.cpp48
-rw-r--r--src/devices/bus/astrocde/ctrl.h61
-rw-r--r--src/devices/bus/astrocde/exp.cpp10
-rw-r--r--src/devices/bus/astrocde/exp.h12
-rw-r--r--src/devices/bus/astrocde/ram.cpp20
-rw-r--r--src/devices/bus/astrocde/ram.h8
-rw-r--r--src/devices/bus/astrocde/slot.cpp12
-rw-r--r--src/devices/bus/astrocde/slot.h4
-rw-r--r--src/devices/bus/ata/atadev.cpp12
-rw-r--r--src/devices/bus/ata/atadev.h8
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.cpp31
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.h6
-rw-r--r--src/devices/bus/bbc/analogue/analogue.cpp26
-rw-r--r--src/devices/bus/bbc/analogue/analogue.h6
-rw-r--r--src/devices/bus/bbc/exp/exp.cpp31
-rw-r--r--src/devices/bus/bbc/exp/exp.h6
-rw-r--r--src/devices/bus/bbc/fdc/fdc.cpp30
-rw-r--r--src/devices/bus/bbc/fdc/fdc.h6
-rw-r--r--src/devices/bus/bbc/joyport/joyport.cpp33
-rw-r--r--src/devices/bus/bbc/joyport/joyport.h6
-rw-r--r--src/devices/bus/bbc/rom/slot.cpp6
-rw-r--r--src/devices/bus/bbc/rom/slot.h4
-rw-r--r--src/devices/bus/bbc/tube/tube.cpp30
-rw-r--r--src/devices/bus/bbc/tube/tube.h6
-rw-r--r--src/devices/bus/bbc/userport/userport.cpp17
-rw-r--r--src/devices/bus/bbc/userport/userport.h5
-rw-r--r--src/devices/bus/bml3/bml3bus.cpp45
-rw-r--r--src/devices/bus/bml3/bml3bus.h62
-rw-r--r--src/devices/bus/bml3/bml3kanji.cpp5
-rw-r--r--src/devices/bus/bml3/bml3mp1802.cpp13
-rw-r--r--src/devices/bus/bml3/bml3mp1805.cpp9
-rw-r--r--src/devices/bus/bw2/exp.cpp9
-rw-r--r--src/devices/bus/bw2/exp.h4
-rw-r--r--src/devices/bus/c64/exp.cpp21
-rw-r--r--src/devices/bus/c64/exp.h5
-rw-r--r--src/devices/bus/c64/fcc.cpp2
-rw-r--r--src/devices/bus/cbm2/exp.cpp24
-rw-r--r--src/devices/bus/cbm2/exp.h5
-rw-r--r--src/devices/bus/cbm2/user.cpp9
-rw-r--r--src/devices/bus/cbm2/user.h5
-rw-r--r--src/devices/bus/cbmiec/c1541.cpp2
-rw-r--r--src/devices/bus/cbmiec/c1571.cpp2
-rw-r--r--src/devices/bus/cbmiec/cbmiec.cpp2
-rw-r--r--src/devices/bus/cbmiec/cbmiec.h2
-rw-r--r--src/devices/bus/centronics/ctronics.cpp6
-rw-r--r--src/devices/bus/centronics/ctronics.h5
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.cpp12
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.h5
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.cpp14
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.h5
-rw-r--r--src/devices/bus/chanf/slot.cpp12
-rw-r--r--src/devices/bus/chanf/slot.h6
-rw-r--r--src/devices/bus/coco/cococart.cpp14
-rw-r--r--src/devices/bus/coco/cococart.h7
-rw-r--r--src/devices/bus/coco/dragon_fdc.cpp8
-rw-r--r--src/devices/bus/coleco/cartridge/exp.cpp6
-rw-r--r--src/devices/bus/coleco/cartridge/exp.h4
-rw-r--r--src/devices/bus/coleco/controller/ctrl.cpp6
-rw-r--r--src/devices/bus/coleco/controller/ctrl.h4
-rw-r--r--src/devices/bus/compis/graphics.cpp6
-rw-r--r--src/devices/bus/compis/graphics.h6
-rw-r--r--src/devices/bus/comx35/exp.cpp6
-rw-r--r--src/devices/bus/comx35/exp.h5
-rw-r--r--src/devices/bus/cpc/cpcexp.cpp20
-rw-r--r--src/devices/bus/cpc/cpcexp.h6
-rw-r--r--src/devices/bus/crvision/slot.cpp12
-rw-r--r--src/devices/bus/crvision/slot.h9
-rw-r--r--src/devices/bus/dmv/dmvbus.cpp9
-rw-r--r--src/devices/bus/dmv/dmvbus.h133
-rw-r--r--src/devices/bus/dmv/k012.cpp8
-rw-r--r--src/devices/bus/dmv/k012.h1
-rw-r--r--src/devices/bus/dmv/k210.cpp5
-rw-r--r--src/devices/bus/dmv/k220.cpp5
-rw-r--r--src/devices/bus/dmv/k220.h1
-rw-r--r--src/devices/bus/dmv/k230.cpp17
-rw-r--r--src/devices/bus/dmv/k230.h1
-rw-r--r--src/devices/bus/dmv/k801.cpp5
-rw-r--r--src/devices/bus/dmv/k801.h2
-rw-r--r--src/devices/bus/dmv/k803.cpp11
-rw-r--r--src/devices/bus/dmv/k803.h1
-rw-r--r--src/devices/bus/dmv/k806.cpp7
-rw-r--r--src/devices/bus/dmv/k806.h1
-rw-r--r--src/devices/bus/ecbbus/ecbbus.cpp17
-rw-r--r--src/devices/bus/ecbbus/ecbbus.h46
-rw-r--r--src/devices/bus/econet/econet.cpp2
-rw-r--r--src/devices/bus/econet/econet.h2
-rw-r--r--src/devices/bus/einstein/pipe/pipe.cpp14
-rw-r--r--src/devices/bus/einstein/pipe/pipe.h5
-rw-r--r--src/devices/bus/einstein/userport/userport.cpp14
-rw-r--r--src/devices/bus/einstein/userport/userport.h5
-rw-r--r--src/devices/bus/ekara/slot.cpp12
-rw-r--r--src/devices/bus/ekara/slot.h4
-rw-r--r--src/devices/bus/electron/cart/slot.cpp14
-rw-r--r--src/devices/bus/electron/cart/slot.h11
-rw-r--r--src/devices/bus/electron/exp.cpp6
-rw-r--r--src/devices/bus/electron/exp.h4
-rw-r--r--src/devices/bus/ep64/exp.cpp30
-rw-r--r--src/devices/bus/ep64/exp.h6
-rw-r--r--src/devices/bus/epson_sio/epson_sio.cpp15
-rw-r--r--src/devices/bus/epson_sio/epson_sio.h10
-rw-r--r--src/devices/bus/gamate/slot.cpp12
-rw-r--r--src/devices/bus/gamate/slot.h4
-rw-r--r--src/devices/bus/gameboy/gb_slot.cpp18
-rw-r--r--src/devices/bus/gameboy/gb_slot.h10
-rw-r--r--src/devices/bus/gamegear/ggext.cpp8
-rw-r--r--src/devices/bus/gamegear/ggext.h5
-rw-r--r--src/devices/bus/gba/gba_slot.cpp8
-rw-r--r--src/devices/bus/gba/gba_slot.h8
-rw-r--r--src/devices/bus/generic/slot.cpp118
-rw-r--r--src/devices/bus/generic/slot.h152
-rw-r--r--src/devices/bus/gio64/gio64.cpp4
-rw-r--r--src/devices/bus/gio64/gio64.h2
-rw-r--r--src/devices/bus/hexbus/hexbus.cpp13
-rw-r--r--src/devices/bus/hexbus/hexbus.h19
-rw-r--r--src/devices/bus/hp80_io/82937.cpp5
-rw-r--r--src/devices/bus/hp80_io/82937.h2
-rw-r--r--src/devices/bus/hp80_io/hp80_io.cpp43
-rw-r--r--src/devices/bus/hp80_io/hp80_io.h20
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.cpp14
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.h13
-rw-r--r--src/devices/bus/hp9825_optroms/hp9825_optrom.cpp16
-rw-r--r--src/devices/bus/hp9825_optroms/hp9825_optrom.h15
-rw-r--r--src/devices/bus/hp9845_io/98032.cpp51
-rw-r--r--src/devices/bus/hp9845_io/98032.h18
-rw-r--r--src/devices/bus/hp9845_io/98034.cpp5
-rw-r--r--src/devices/bus/hp9845_io/98034.h2
-rw-r--r--src/devices/bus/hp9845_io/98035.cpp5
-rw-r--r--src/devices/bus/hp9845_io/98035.h2
-rw-r--r--src/devices/bus/hp9845_io/98046.cpp13
-rw-r--r--src/devices/bus/hp9845_io/98046.h2
-rw-r--r--src/devices/bus/hp9845_io/hp9845_io.cpp55
-rw-r--r--src/devices/bus/hp9845_io/hp9845_io.h22
-rw-r--r--src/devices/bus/hp9845_io/hp9885.cpp3
-rw-r--r--src/devices/bus/hp9845_io/hp9885.h2
-rw-r--r--src/devices/bus/hp_dio/hp_dio.cpp2
-rw-r--r--src/devices/bus/hp_dio/hp_dio.h11
-rw-r--r--src/devices/bus/hp_hil/hp_hil.cpp10
-rw-r--r--src/devices/bus/hp_hil/hp_hil.h9
-rw-r--r--src/devices/bus/hp_optroms/hp_optrom.cpp118
-rw-r--r--src/devices/bus/hp_optroms/hp_optrom.h13
-rw-r--r--src/devices/bus/ieee488/c2031.cpp2
-rw-r--r--src/devices/bus/ieee488/hp9122c.cpp5
-rw-r--r--src/devices/bus/ieee488/ieee488.cpp2
-rw-r--r--src/devices/bus/ieee488/ieee488.h2
-rw-r--r--src/devices/bus/imi7000/imi7000.cpp13
-rw-r--r--src/devices/bus/imi7000/imi7000.h57
-rw-r--r--src/devices/bus/intellec4/intellec4.cpp19
-rw-r--r--src/devices/bus/intellec4/intellec4.h13
-rw-r--r--src/devices/bus/interpro/keyboard/keyboard.cpp6
-rw-r--r--src/devices/bus/interpro/keyboard/keyboard.h4
-rw-r--r--src/devices/bus/interpro/mouse/mouse.cpp14
-rw-r--r--src/devices/bus/interpro/mouse/mouse.h5
-rw-r--r--src/devices/bus/interpro/sr/sr.h8
-rw-r--r--src/devices/bus/intv/ecs.cpp10
-rw-r--r--src/devices/bus/intv/slot.cpp12
-rw-r--r--src/devices/bus/intv/slot.h4
-rw-r--r--src/devices/bus/intv_ctrl/ctrl.cpp17
-rw-r--r--src/devices/bus/intv_ctrl/ctrl.h10
-rw-r--r--src/devices/bus/intv_ctrl/ecs_ctrl.cpp36
-rw-r--r--src/devices/bus/intv_ctrl/ecs_ctrl.h14
-rw-r--r--src/devices/bus/iq151/iq151.cpp8
-rw-r--r--src/devices/bus/iq151/iq151.h13
-rw-r--r--src/devices/bus/isa/isa.cpp2
-rw-r--r--src/devices/bus/isa/isa.h2
-rw-r--r--src/devices/bus/isbx/isbx.cpp11
-rw-r--r--src/devices/bus/isbx/isbx.h6
-rw-r--r--src/devices/bus/jakks_gamekey/slot.cpp12
-rw-r--r--src/devices/bus/jakks_gamekey/slot.h4
-rw-r--r--src/devices/bus/kc/d002.cpp48
-rw-r--r--src/devices/bus/kc/kc.cpp28
-rw-r--r--src/devices/bus/kc/kc.h14
-rw-r--r--src/devices/bus/lpci/pci.cpp8
-rw-r--r--src/devices/bus/lpci/pci.h4
-rw-r--r--src/devices/bus/m5/slot.cpp15
-rw-r--r--src/devices/bus/m5/slot.h9
-rw-r--r--src/devices/bus/macpds/macpds.cpp2
-rw-r--r--src/devices/bus/macpds/macpds.h5
-rw-r--r--src/devices/bus/megadrive/md_slot.cpp6
-rw-r--r--src/devices/bus/megadrive/md_slot.h4
-rw-r--r--src/devices/bus/midi/midi.cpp12
-rw-r--r--src/devices/bus/midi/midi.h5
-rw-r--r--src/devices/bus/msx_cart/cartridge.cpp2
-rw-r--r--src/devices/bus/msx_cart/cartridge.h2
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.cpp17
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.h14
-rw-r--r--src/devices/bus/mtx/exp.cpp30
-rw-r--r--src/devices/bus/mtx/exp.h21
-rw-r--r--src/devices/bus/nasbus/avc.cpp4
-rw-r--r--src/devices/bus/nasbus/nasbus.cpp30
-rw-r--r--src/devices/bus/nasbus/nasbus.h32
-rw-r--r--src/devices/bus/neogeo/slot.cpp6
-rw-r--r--src/devices/bus/neogeo/slot.h12
-rw-r--r--src/devices/bus/neogeo_ctrl/ctrl.cpp24
-rw-r--r--src/devices/bus/neogeo_ctrl/ctrl.h24
-rw-r--r--src/devices/bus/neogeo_ctrl/dial.cpp35
-rw-r--r--src/devices/bus/neogeo_ctrl/dial.h5
-rw-r--r--src/devices/bus/neogeo_ctrl/irrmaze.cpp12
-rw-r--r--src/devices/bus/neogeo_ctrl/irrmaze.h4
-rw-r--r--src/devices/bus/neogeo_ctrl/joystick.cpp4
-rw-r--r--src/devices/bus/neogeo_ctrl/joystick.h4
-rw-r--r--src/devices/bus/neogeo_ctrl/kizuna4p.cpp4
-rw-r--r--src/devices/bus/neogeo_ctrl/kizuna4p.h4
-rw-r--r--src/devices/bus/nes/aladdin.cpp6
-rw-r--r--src/devices/bus/nes/aladdin.h10
-rw-r--r--src/devices/bus/nes/datach.cpp10
-rw-r--r--src/devices/bus/nes/datach.h10
-rw-r--r--src/devices/bus/nes/karastudio.cpp19
-rw-r--r--src/devices/bus/nes/karastudio.h4
-rw-r--r--src/devices/bus/nes/nes_slot.cpp6
-rw-r--r--src/devices/bus/nes/nes_slot.h4
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.cpp10
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.h10
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.cpp6
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.h4
-rw-r--r--src/devices/bus/newbrain/exp.cpp7
-rw-r--r--src/devices/bus/newbrain/exp.h4
-rw-r--r--src/devices/bus/nubus/nubus.cpp2
-rw-r--r--src/devices/bus/nubus/nubus.h2
-rw-r--r--src/devices/bus/odyssey2/slot.cpp9
-rw-r--r--src/devices/bus/odyssey2/slot.h9
-rw-r--r--src/devices/bus/oricext/jasmin.cpp62
-rw-r--r--src/devices/bus/oricext/jasmin.h8
-rw-r--r--src/devices/bus/oricext/microdisc.cpp56
-rw-r--r--src/devices/bus/oricext/microdisc.h9
-rw-r--r--src/devices/bus/oricext/oricext.cpp47
-rw-r--r--src/devices/bus/oricext/oricext.h11
-rw-r--r--src/devices/bus/pc1512/mouse.cpp6
-rw-r--r--src/devices/bus/pc1512/mouse.h11
-rw-r--r--src/devices/bus/pc_joy/pc_joy.cpp6
-rw-r--r--src/devices/bus/pc_joy/pc_joy.h4
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.cpp7
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.h9
-rw-r--r--src/devices/bus/pce/pce_slot.cpp12
-rw-r--r--src/devices/bus/pce/pce_slot.h10
-rw-r--r--src/devices/bus/pet/cass.cpp6
-rw-r--r--src/devices/bus/pet/cass.h4
-rw-r--r--src/devices/bus/pet/exp.cpp35
-rw-r--r--src/devices/bus/pet/exp.h6
-rw-r--r--src/devices/bus/pet/user.cpp2
-rw-r--r--src/devices/bus/pet/user.h5
-rw-r--r--src/devices/bus/plus4/c1551.cpp14
-rw-r--r--src/devices/bus/plus4/exp.cpp34
-rw-r--r--src/devices/bus/plus4/exp.h6
-rw-r--r--src/devices/bus/pofo/ccm.cpp10
-rw-r--r--src/devices/bus/pofo/ccm.h4
-rw-r--r--src/devices/bus/pofo/exp.cpp6
-rw-r--r--src/devices/bus/pofo/exp.h4
-rw-r--r--src/devices/bus/psi_kbd/psi_kbd.cpp8
-rw-r--r--src/devices/bus/psi_kbd/psi_kbd.h6
-rw-r--r--src/devices/bus/psx/ctlrport.cpp23
-rw-r--r--src/devices/bus/psx/ctlrport.h7
-rw-r--r--src/devices/bus/psx/parallel.cpp16
-rw-r--r--src/devices/bus/psx/parallel.h13
-rw-r--r--src/devices/bus/ql/exp.cpp21
-rw-r--r--src/devices/bus/ql/exp.h5
-rw-r--r--src/devices/bus/ql/rom.cpp19
-rw-r--r--src/devices/bus/ql/rom.h5
-rw-r--r--src/devices/bus/rs232/rs232.cpp6
-rw-r--r--src/devices/bus/rs232/rs232.h4
-rw-r--r--src/devices/bus/s100/s100.cpp15
-rw-r--r--src/devices/bus/s100/s100.h8
-rw-r--r--src/devices/bus/sat_ctrl/ctrl.cpp9
-rw-r--r--src/devices/bus/sat_ctrl/ctrl.h6
-rw-r--r--src/devices/bus/saturn/sat_slot.cpp7
-rw-r--r--src/devices/bus/saturn/sat_slot.h4
-rw-r--r--src/devices/bus/sbus/sbus.cpp15
-rw-r--r--src/devices/bus/sbus/sbus.h8
-rw-r--r--src/devices/bus/scsi/scsi.cpp10
-rw-r--r--src/devices/bus/scsi/scsi.h5
-rw-r--r--src/devices/bus/scv/slot.cpp12
-rw-r--r--src/devices/bus/scv/slot.h4
-rw-r--r--src/devices/bus/sega8/sega8_slot.cpp6
-rw-r--r--src/devices/bus/sega8/sega8_slot.h4
-rw-r--r--src/devices/bus/sg1000_exp/sg1000exp.cpp8
-rw-r--r--src/devices/bus/sg1000_exp/sg1000exp.h4
-rw-r--r--src/devices/bus/sg1000_exp/sk1100prn.cpp8
-rw-r--r--src/devices/bus/sg1000_exp/sk1100prn.h4
-rw-r--r--src/devices/bus/sgikbd/sgikbd.cpp20
-rw-r--r--src/devices/bus/sgikbd/sgikbd.h5
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.cpp2
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.h2
-rw-r--r--src/devices/bus/sms_exp/smsexp.cpp8
-rw-r--r--src/devices/bus/sms_exp/smsexp.h5
-rw-r--r--src/devices/bus/snes/snes_slot.cpp2
-rw-r--r--src/devices/bus/snes/snes_slot.h8
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.cpp8
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.h8
-rw-r--r--src/devices/bus/spc1000/exp.cpp8
-rw-r--r--src/devices/bus/spc1000/exp.h4
-rw-r--r--src/devices/bus/spectrum/exp.cpp30
-rw-r--r--src/devices/bus/spectrum/exp.h12
-rw-r--r--src/devices/bus/ss50/interface.cpp28
-rw-r--r--src/devices/bus/ss50/interface.h14
-rw-r--r--src/devices/bus/sunkbd/sunkbd.cpp27
-rw-r--r--src/devices/bus/sunkbd/sunkbd.h5
-rw-r--r--src/devices/bus/sunmouse/sunmouse.cpp27
-rw-r--r--src/devices/bus/sunmouse/sunmouse.h5
-rw-r--r--src/devices/bus/svi3x8/expander/expander.cpp14
-rw-r--r--src/devices/bus/svi3x8/expander/expander.h5
-rw-r--r--src/devices/bus/svi3x8/expander/sv601.cpp14
-rw-r--r--src/devices/bus/svi3x8/expander/sv602.cpp2
-rw-r--r--src/devices/bus/svi3x8/slot/slot.cpp39
-rw-r--r--src/devices/bus/svi3x8/slot/slot.h25
-rw-r--r--src/devices/bus/tanbus/tanbus.cpp17
-rw-r--r--src/devices/bus/tanbus/tanbus.h11
-rw-r--r--src/devices/bus/ti8x/ti8x.cpp6
-rw-r--r--src/devices/bus/ti8x/ti8x.h4
-rw-r--r--src/devices/bus/ti99/colorbus/colorbus.cpp8
-rw-r--r--src/devices/bus/ti99/colorbus/colorbus.h9
-rw-r--r--src/devices/bus/ti99/joyport/joyport.cpp11
-rw-r--r--src/devices/bus/ti99/joyport/joyport.h8
-rw-r--r--src/devices/bus/ti99/peb/peribox.cpp6
-rw-r--r--src/devices/bus/ti99/peb/peribox.h5
-rw-r--r--src/devices/bus/tiki100/8088.cpp6
-rw-r--r--src/devices/bus/tiki100/exp.cpp33
-rw-r--r--src/devices/bus/tiki100/exp.h28
-rw-r--r--src/devices/bus/tmc600/euro.cpp28
-rw-r--r--src/devices/bus/tmc600/euro.h43
-rw-r--r--src/devices/bus/tvc/tvc.cpp6
-rw-r--r--src/devices/bus/tvc/tvc.h5
-rw-r--r--src/devices/bus/uts_kbd/uts_kbd.cpp6
-rw-r--r--src/devices/bus/uts_kbd/uts_kbd.h4
-rw-r--r--src/devices/bus/vboy/slot.cpp14
-rw-r--r--src/devices/bus/vboy/slot.h4
-rw-r--r--src/devices/bus/vc4000/slot.cpp6
-rw-r--r--src/devices/bus/vc4000/slot.h6
-rw-r--r--src/devices/bus/vcs/vcs_slot.cpp13
-rw-r--r--src/devices/bus/vcs/vcs_slot.h4
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.cpp2
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.h14
-rw-r--r--src/devices/bus/vectrex/slot.cpp14
-rw-r--r--src/devices/bus/vectrex/slot.h4
-rw-r--r--src/devices/bus/vic10/exp.cpp39
-rw-r--r--src/devices/bus/vic10/exp.h6
-rw-r--r--src/devices/bus/vic20/exp.cpp21
-rw-r--r--src/devices/bus/vic20/exp.h5
-rw-r--r--src/devices/bus/vidbrain/exp.cpp44
-rw-r--r--src/devices/bus/vidbrain/exp.h15
-rw-r--r--src/devices/bus/vip/byteio.cpp8
-rw-r--r--src/devices/bus/vip/byteio.h5
-rw-r--r--src/devices/bus/vip/exp.cpp6
-rw-r--r--src/devices/bus/vip/exp.h5
-rw-r--r--src/devices/bus/vme/vme.cpp12
-rw-r--r--src/devices/bus/vme/vme.h2
-rw-r--r--src/devices/bus/vsmile/vsmile_ctrl.cpp41
-rw-r--r--src/devices/bus/vsmile/vsmile_ctrl.h5
-rw-r--r--src/devices/bus/vsmile/vsmile_slot.cpp6
-rw-r--r--src/devices/bus/vsmile/vsmile_slot.h10
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.cpp15
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.h7
-rw-r--r--src/devices/bus/vtech/memexp/memexp.cpp13
-rw-r--r--src/devices/bus/vtech/memexp/memexp.h7
-rw-r--r--src/devices/bus/wangpc/wangpc.cpp27
-rw-r--r--src/devices/bus/wangpc/wangpc.h34
-rw-r--r--src/devices/bus/wswan/slot.cpp18
-rw-r--r--src/devices/bus/wswan/slot.h4
-rw-r--r--src/devices/bus/x68k/x68kexp.cpp17
-rw-r--r--src/devices/bus/x68k/x68kexp.h12
-rw-r--r--src/devices/bus/z88/z88.cpp6
-rw-r--r--src/devices/bus/z88/z88.h4
-rw-r--r--src/devices/cpu/alto2/a2emu.cpp14
-rw-r--r--src/devices/cpu/alto2/a2ram.cpp22
-rw-r--r--src/devices/cpu/alto2/alto2cpu.cpp32
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h14
-rw-r--r--src/devices/imagedev/floppy.cpp1
-rw-r--r--src/devices/imagedev/floppy.h3
-rw-r--r--src/devices/imagedev/mfmhd.cpp1
-rw-r--r--src/devices/imagedev/mfmhd.h3
-rw-r--r--src/devices/machine/ataflash.cpp9
-rw-r--r--src/devices/machine/ataflash.h2
-rw-r--r--src/devices/machine/linflash.cpp6
-rw-r--r--src/devices/machine/linflash.h5
-rw-r--r--src/devices/machine/netlist.cpp2
-rw-r--r--src/devices/machine/nscsi_bus.cpp13
-rw-r--r--src/devices/machine/nscsi_bus.h6
-rw-r--r--src/devices/machine/pccard.cpp67
-rw-r--r--src/devices/machine/pccard.h11
-rw-r--r--src/devices/machine/smioc.cpp2
-rw-r--r--src/emu/dislot.cpp59
-rw-r--r--src/emu/dislot.h142
-rw-r--r--src/emu/emucore.cpp74
-rw-r--r--src/emu/emucore.h46
-rw-r--r--src/emu/emufwd.h2
-rw-r--r--src/emu/image.cpp16
-rw-r--r--src/emu/machine.cpp2
-rw-r--r--src/emu/main.h24
-rw-r--r--src/emu/mconfig.cpp134
-rw-r--r--src/emu/mconfig.h96
-rw-r--r--src/emu/render.cpp9
-rw-r--r--src/emu/romload.cpp28
-rw-r--r--src/emu/schedule.cpp26
-rw-r--r--src/emu/validity.cpp4
-rw-r--r--src/frontend/mame/cheat.cpp9
-rw-r--r--src/frontend/mame/clifront.cpp34
-rw-r--r--src/frontend/mame/info.cpp2
-rw-r--r--src/mame/audio/s11c_bg.cpp2
-rw-r--r--src/mame/audio/taito_zm.cpp2
-rw-r--r--src/mame/audio/wpcsnd.cpp2
-rw-r--r--src/mame/drivers/40love.cpp2
-rw-r--r--src/mame/drivers/adam.cpp34
-rw-r--r--src/mame/drivers/airbustr.cpp2
-rw-r--r--src/mame/drivers/airraid.cpp2
-rw-r--r--src/mame/drivers/ajax.cpp2
-rw-r--r--src/mame/drivers/alphatpx.cpp6
-rw-r--r--src/mame/drivers/amspdwy.cpp2
-rw-r--r--src/mame/drivers/amstrad.cpp6
-rw-r--r--src/mame/drivers/angelkds.cpp2
-rw-r--r--src/mame/drivers/apollo.cpp8
-rw-r--r--src/mame/drivers/apple2.cpp2
-rw-r--r--src/mame/drivers/apple2e.cpp2
-rw-r--r--src/mame/drivers/apple2gs.cpp2
-rw-r--r--src/mame/drivers/apple3.cpp2
-rw-r--r--src/mame/drivers/arabian.cpp2
-rw-r--r--src/mame/drivers/arcadia.cpp2
-rw-r--r--src/mame/drivers/argus.cpp6
-rw-r--r--src/mame/drivers/arkanoid.cpp2
-rw-r--r--src/mame/drivers/artmagic.cpp2
-rw-r--r--src/mame/drivers/astrohome.cpp2
-rw-r--r--src/mame/drivers/asuka.cpp10
-rw-r--r--src/mame/drivers/at.cpp14
-rw-r--r--src/mame/drivers/attache.cpp6
-rw-r--r--src/mame/drivers/avigo.cpp2
-rw-r--r--src/mame/drivers/balsente.cpp2
-rw-r--r--src/mame/drivers/baraduke.cpp2
-rw-r--r--src/mame/drivers/battlane.cpp2
-rw-r--r--src/mame/drivers/bbc.cpp18
-rw-r--r--src/mame/drivers/bebox.cpp2
-rw-r--r--src/mame/drivers/bfm_sc2.cpp4
-rw-r--r--src/mame/drivers/bigevglf.cpp2
-rw-r--r--src/mame/drivers/bking.cpp2
-rw-r--r--src/mame/drivers/bladestl.cpp2
-rw-r--r--src/mame/drivers/blueprnt.cpp2
-rw-r--r--src/mame/drivers/bml3.cpp25
-rw-r--r--src/mame/drivers/bnstars.cpp2
-rw-r--r--src/mame/drivers/bublbobl.cpp4
-rw-r--r--src/mame/drivers/bwing.cpp2
-rw-r--r--src/mame/drivers/c128.cpp24
-rw-r--r--src/mame/drivers/c64.cpp15
-rw-r--r--src/mame/drivers/cabal.cpp2
-rw-r--r--src/mame/drivers/cave.cpp2
-rw-r--r--src/mame/drivers/cbm2.cpp13
-rw-r--r--src/mame/drivers/cedar_magnet.cpp2
-rw-r--r--src/mame/drivers/chaknpop.cpp2
-rw-r--r--src/mame/drivers/champbas.cpp8
-rw-r--r--src/mame/drivers/chihiro.cpp26
-rw-r--r--src/mame/drivers/chinagat.cpp6
-rw-r--r--src/mame/drivers/chqflag.cpp2
-rw-r--r--src/mame/drivers/cischeat.cpp4
-rw-r--r--src/mame/drivers/cloak.cpp2
-rw-r--r--src/mame/drivers/cmi.cpp3
-rw-r--r--src/mame/drivers/cntsteer.cpp5
-rw-r--r--src/mame/drivers/cobra.cpp2
-rw-r--r--src/mame/drivers/combatsc.cpp4
-rw-r--r--src/mame/drivers/concept.cpp2
-rw-r--r--src/mame/drivers/contra.cpp2
-rw-r--r--src/mame/drivers/crgolf.cpp2
-rw-r--r--src/mame/drivers/cubeqst.cpp2
-rw-r--r--src/mame/drivers/cyberbal.cpp2
-rw-r--r--src/mame/drivers/cybertnk.cpp2
-rw-r--r--src/mame/drivers/dai.cpp2
-rw-r--r--src/mame/drivers/darius.cpp2
-rw-r--r--src/mame/drivers/dassault.cpp4
-rw-r--r--src/mame/drivers/dblewing.cpp2
-rw-r--r--src/mame/drivers/ddayjlc.cpp2
-rw-r--r--src/mame/drivers/ddragon.cpp6
-rw-r--r--src/mame/drivers/ddribble.cpp2
-rw-r--r--src/mame/drivers/deadang.cpp2
-rw-r--r--src/mame/drivers/dec0.cpp8
-rw-r--r--src/mame/drivers/dec8.cpp12
-rw-r--r--src/mame/drivers/deco32.cpp4
-rw-r--r--src/mame/drivers/deco_ld.cpp2
-rw-r--r--src/mame/drivers/decocass.cpp2
-rw-r--r--src/mame/drivers/dectalk.cpp2
-rw-r--r--src/mame/drivers/digel804.cpp2
-rw-r--r--src/mame/drivers/divebomb.cpp2
-rw-r--r--src/mame/drivers/djboy.cpp2
-rw-r--r--src/mame/drivers/dmndrby.cpp2
-rw-r--r--src/mame/drivers/dmv.cpp2
-rw-r--r--src/mame/drivers/dogfgt.cpp2
-rw-r--r--src/mame/drivers/dpb7000.cpp2
-rw-r--r--src/mame/drivers/drmicro.cpp2
-rw-r--r--src/mame/drivers/dynduke.cpp2
-rw-r--r--src/mame/drivers/eolith.cpp2
-rw-r--r--src/mame/drivers/eprom.cpp6
-rw-r--r--src/mame/drivers/equites.cpp5
-rw-r--r--src/mame/drivers/esripsys.cpp2
-rw-r--r--src/mame/drivers/europc.cpp2
-rw-r--r--src/mame/drivers/exelv.cpp4
-rw-r--r--src/mame/drivers/exidy.cpp4
-rw-r--r--src/mame/drivers/exprraid.cpp2
-rw-r--r--src/mame/drivers/exterm.cpp2
-rw-r--r--src/mame/drivers/exzisus.cpp2
-rw-r--r--src/mame/drivers/f1gp.cpp4
-rw-r--r--src/mame/drivers/fantland.cpp2
-rw-r--r--src/mame/drivers/fidel_card.cpp2
-rw-r--r--src/mame/drivers/fidel_eag68k.cpp2
-rw-r--r--src/mame/drivers/firefox.cpp2
-rw-r--r--src/mame/drivers/firetrap.cpp2
-rw-r--r--src/mame/drivers/flkatck.cpp2
-rw-r--r--src/mame/drivers/flower.cpp2
-rw-r--r--src/mame/drivers/flstory.cpp2
-rw-r--r--src/mame/drivers/fm7.cpp15
-rw-r--r--src/mame/drivers/gaelco.cpp6
-rw-r--r--src/mame/drivers/gaelco2.cpp1
-rw-r--r--src/mame/drivers/gaelco3d.cpp2
-rw-r--r--src/mame/drivers/gal3.cpp2
-rw-r--r--src/mame/drivers/galaga.cpp8
-rw-r--r--src/mame/drivers/gamecom.cpp2
-rw-r--r--src/mame/drivers/gaplus.cpp2
-rw-r--r--src/mame/drivers/gladiatr.cpp4
-rw-r--r--src/mame/drivers/glass.cpp1
-rw-r--r--src/mame/drivers/gradius3.cpp2
-rw-r--r--src/mame/drivers/grchamp.cpp2
-rw-r--r--src/mame/drivers/gsword.cpp4
-rw-r--r--src/mame/drivers/gticlub.cpp4
-rw-r--r--src/mame/drivers/gyruss.cpp2
-rw-r--r--src/mame/drivers/harddriv.cpp8
-rw-r--r--src/mame/drivers/hazeltin.cpp2
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp6
-rw-r--r--src/mame/drivers/homedata.cpp8
-rw-r--r--src/mame/drivers/hornet.cpp2
-rw-r--r--src/mame/drivers/hp9825.cpp2
-rw-r--r--src/mame/drivers/hvyunit.cpp2
-rw-r--r--src/mame/drivers/ikki.cpp3
-rw-r--r--src/mame/drivers/imds2.cpp2
-rw-r--r--src/mame/drivers/imolagp.cpp2
-rw-r--r--src/mame/drivers/intv.cpp4
-rw-r--r--src/mame/drivers/itech32.cpp2
-rw-r--r--src/mame/drivers/jackal.cpp2
-rw-r--r--src/mame/drivers/jedi.cpp2
-rw-r--r--src/mame/drivers/jpmimpct.cpp4
-rw-r--r--src/mame/drivers/junior.cpp2
-rw-r--r--src/mame/drivers/jupace.cpp2
-rw-r--r--src/mame/drivers/kc.cpp114
-rw-r--r--src/mame/drivers/kenseim.cpp2
-rw-r--r--src/mame/drivers/kickgoal.cpp2
-rw-r--r--src/mame/drivers/kim1.cpp2
-rw-r--r--src/mame/drivers/kingdrby.cpp2
-rw-r--r--src/mame/drivers/kingobox.cpp4
-rw-r--r--src/mame/drivers/konamigx.cpp2
-rw-r--r--src/mame/drivers/ksayakyu.cpp2
-rw-r--r--src/mame/drivers/kyugo.cpp2
-rw-r--r--src/mame/drivers/ladyfrog.cpp2
-rw-r--r--src/mame/drivers/lasso.cpp2
-rw-r--r--src/mame/drivers/lastbank.cpp2
-rw-r--r--src/mame/drivers/liberate.cpp6
-rw-r--r--src/mame/drivers/lisa.cpp2
-rw-r--r--src/mame/drivers/lockon.cpp2
-rw-r--r--src/mame/drivers/lsasquad.cpp4
-rw-r--r--src/mame/drivers/lviv.cpp2
-rw-r--r--src/mame/drivers/lynx.cpp2
-rw-r--r--src/mame/drivers/m68705prg.cpp2
-rw-r--r--src/mame/drivers/mac.cpp6
-rw-r--r--src/mame/drivers/mac128.cpp2
-rw-r--r--src/mame/drivers/macpci.cpp2
-rw-r--r--src/mame/drivers/magmax.cpp2
-rw-r--r--src/mame/drivers/mappy.cpp6
-rw-r--r--src/mame/drivers/markham.cpp2
-rw-r--r--src/mame/drivers/matmania.cpp4
-rw-r--r--src/mame/drivers/mbc55x.cpp4
-rw-r--r--src/mame/drivers/meadows.cpp4
-rw-r--r--src/mame/drivers/megadriv.cpp12
-rw-r--r--src/mame/drivers/megaphx.cpp2
-rw-r--r--src/mame/drivers/megaplay.cpp2
-rw-r--r--src/mame/drivers/megasys1.cpp2
-rw-r--r--src/mame/drivers/megazone.cpp2
-rw-r--r--src/mame/drivers/mephisto_polgar.cpp2
-rw-r--r--src/mame/drivers/mexico86.cpp2
-rw-r--r--src/mame/drivers/micro3d.cpp2
-rw-r--r--src/mame/drivers/microvsn.cpp2
-rw-r--r--src/mame/drivers/mikromik.cpp2
-rw-r--r--src/mame/drivers/mindset.cpp2
-rw-r--r--src/mame/drivers/missb2.cpp2
-rw-r--r--src/mame/drivers/mlanding.cpp2
-rw-r--r--src/mame/drivers/model2.cpp2
-rw-r--r--src/mame/drivers/model3.cpp2
-rw-r--r--src/mame/drivers/mpu4vid.cpp2
-rw-r--r--src/mame/drivers/mrflea.cpp2
-rw-r--r--src/mame/drivers/ms32.cpp2
-rw-r--r--src/mame/drivers/msx.cpp6
-rw-r--r--src/mame/drivers/mystwarr.cpp2
-rw-r--r--src/mame/drivers/mz3500.cpp2
-rw-r--r--src/mame/drivers/n64.cpp2
-rw-r--r--src/mame/drivers/namcond1.cpp2
-rw-r--r--src/mame/drivers/namcos1.cpp2
-rw-r--r--src/mame/drivers/namcos12.cpp6
-rw-r--r--src/mame/drivers/namcos2.cpp16
-rw-r--r--src/mame/drivers/namcos21.cpp2
-rw-r--r--src/mame/drivers/namcos21_c67.cpp2
-rw-r--r--src/mame/drivers/namcos21_de.cpp2
-rw-r--r--src/mame/drivers/namcos22.cpp2
-rw-r--r--src/mame/drivers/namcos23.cpp6
-rw-r--r--src/mame/drivers/namcos86.cpp2
-rw-r--r--src/mame/drivers/nascom1.cpp20
-rw-r--r--src/mame/drivers/nc.cpp2
-rw-r--r--src/mame/drivers/ncd68k.cpp76
-rw-r--r--src/mame/drivers/neogeo.cpp43
-rw-r--r--src/mame/drivers/nightgal.cpp2
-rw-r--r--src/mame/drivers/ninjaw.cpp4
-rw-r--r--src/mame/drivers/nova2001.cpp4
-rw-r--r--src/mame/drivers/novag_savant.cpp2
-rw-r--r--src/mame/drivers/nss.cpp2
-rw-r--r--src/mame/drivers/nwk-tr.cpp2
-rw-r--r--src/mame/drivers/nycaptor.cpp6
-rw-r--r--src/mame/drivers/odyssey2.cpp8
-rw-r--r--src/mame/drivers/opwolf.cpp4
-rw-r--r--src/mame/drivers/oric.cpp2
-rw-r--r--src/mame/drivers/overdriv.cpp2
-rw-r--r--src/mame/drivers/p2000t.cpp2
-rw-r--r--src/mame/drivers/pacland.cpp2
-rw-r--r--src/mame/drivers/palm.cpp2
-rw-r--r--src/mame/drivers/pandoras.cpp2
-rw-r--r--src/mame/drivers/paranoia.cpp2
-rw-r--r--src/mame/drivers/pc.cpp6
-rw-r--r--src/mame/drivers/pc1512.cpp4
-rw-r--r--src/mame/drivers/pc8801.cpp4
-rw-r--r--src/mame/drivers/pce.cpp4
-rw-r--r--src/mame/drivers/pcw.cpp4
-rw-r--r--src/mame/drivers/pcw16.cpp2
-rw-r--r--src/mame/drivers/pitnrun.cpp2
-rw-r--r--src/mame/drivers/plus4.cpp7
-rw-r--r--src/mame/drivers/plygonet.cpp2
-rw-r--r--src/mame/drivers/pmd85.cpp2
-rw-r--r--src/mame/drivers/pocketc.cpp2
-rw-r--r--src/mame/drivers/pokemini.cpp2
-rw-r--r--src/mame/drivers/polepos.cpp4
-rw-r--r--src/mame/drivers/popper.cpp2
-rw-r--r--src/mame/drivers/prof80.cpp10
-rw-r--r--src/mame/drivers/progolf.cpp2
-rw-r--r--src/mame/drivers/ps2.cpp4
-rw-r--r--src/mame/drivers/ps2sony.cpp2
-rw-r--r--src/mame/drivers/psychic5.cpp4
-rw-r--r--src/mame/drivers/qix.cpp6
-rw-r--r--src/mame/drivers/quasar.cpp2
-rw-r--r--src/mame/drivers/qvt102.cpp6
-rw-r--r--src/mame/drivers/r9751.cpp2
-rw-r--r--src/mame/drivers/raiden.cpp2
-rw-r--r--src/mame/drivers/rastan.cpp2
-rw-r--r--src/mame/drivers/rbisland.cpp4
-rw-r--r--src/mame/drivers/retofinv.cpp2
-rw-r--r--src/mame/drivers/rollext.cpp2
-rw-r--r--src/mame/drivers/rungun.cpp2
-rw-r--r--src/mame/drivers/rvoice.cpp2
-rw-r--r--src/mame/drivers/s11b.cpp2
-rw-r--r--src/mame/drivers/segahang.cpp2
-rw-r--r--src/mame/drivers/segajw.cpp2
-rw-r--r--src/mame/drivers/segaorun.cpp2
-rw-r--r--src/mame/drivers/segas16b.cpp2
-rw-r--r--src/mame/drivers/segas24.cpp2
-rw-r--r--src/mame/drivers/segaxbd.cpp2
-rw-r--r--src/mame/drivers/segaybd.cpp2
-rw-r--r--src/mame/drivers/seibuspi.cpp2
-rw-r--r--src/mame/drivers/seicross.cpp2
-rw-r--r--src/mame/drivers/sfcbox.cpp2
-rw-r--r--src/mame/drivers/sfkick.cpp2
-rw-r--r--src/mame/drivers/shanghai.cpp2
-rw-r--r--src/mame/drivers/shangkid.cpp2
-rw-r--r--src/mame/drivers/shougi.cpp2
-rw-r--r--src/mame/drivers/sidearms.cpp2
-rw-r--r--src/mame/drivers/simple_st0016.cpp2
-rw-r--r--src/mame/drivers/skykid.cpp2
-rw-r--r--src/mame/drivers/slapfght.cpp6
-rw-r--r--src/mame/drivers/slapshot.cpp4
-rw-r--r--src/mame/drivers/sms.cpp10
-rw-r--r--src/mame/drivers/sms_bootleg.cpp2
-rw-r--r--src/mame/drivers/smsmcorp.cpp2
-rw-r--r--src/mame/drivers/snes.cpp4
-rw-r--r--src/mame/drivers/snesb.cpp2
-rw-r--r--src/mame/drivers/snk.cpp12
-rw-r--r--src/mame/drivers/socrates.cpp4
-rw-r--r--src/mame/drivers/softbox.cpp2
-rw-r--r--src/mame/drivers/sothello.cpp2
-rw-r--r--src/mame/drivers/spacefb.cpp2
-rw-r--r--src/mame/drivers/spdheat.cpp2
-rw-r--r--src/mame/drivers/spec128.cpp2
-rw-r--r--src/mame/drivers/spectrum.cpp2
-rw-r--r--src/mame/drivers/speglsht.cpp2
-rw-r--r--src/mame/drivers/sprcros2.cpp2
-rw-r--r--src/mame/drivers/srmp5.cpp2
-rw-r--r--src/mame/drivers/sshangha.cpp2
-rw-r--r--src/mame/drivers/ssv.cpp6
-rw-r--r--src/mame/drivers/stfight.cpp2
-rw-r--r--src/mame/drivers/suna16.cpp8
-rw-r--r--src/mame/drivers/superchs.cpp2
-rw-r--r--src/mame/drivers/supracan.cpp3
-rw-r--r--src/mame/drivers/system1.cpp2
-rw-r--r--src/mame/drivers/taito_b.cpp34
-rw-r--r--src/mame/drivers/taito_h.cpp6
-rw-r--r--src/mame/drivers/taito_l.cpp8
-rw-r--r--src/mame/drivers/taito_x.cpp8
-rw-r--r--src/mame/drivers/taito_z.cpp14
-rw-r--r--src/mame/drivers/taitoair.cpp2
-rw-r--r--src/mame/drivers/taitojc.cpp2
-rw-r--r--src/mame/drivers/taitopjc.cpp2
-rw-r--r--src/mame/drivers/taitosj.cpp2
-rw-r--r--src/mame/drivers/taitotz.cpp2
-rw-r--r--src/mame/drivers/tandy1t.cpp4
-rw-r--r--src/mame/drivers/tankbust.cpp2
-rw-r--r--src/mame/drivers/tapatune.cpp2
-rw-r--r--src/mame/drivers/targeth.cpp1
-rw-r--r--src/mame/drivers/tatsumi.cpp6
-rw-r--r--src/mame/drivers/taxidriv.cpp2
-rw-r--r--src/mame/drivers/tbowl.cpp2
-rw-r--r--src/mame/drivers/tceptor.cpp2
-rw-r--r--src/mame/drivers/tecmo16.cpp2
-rw-r--r--src/mame/drivers/tehkanwc.cpp2
-rw-r--r--src/mame/drivers/thedeep.cpp2
-rw-r--r--src/mame/drivers/thunderj.cpp2
-rw-r--r--src/mame/drivers/tigeroad.cpp2
-rw-r--r--src/mame/drivers/tiki100.cpp6
-rw-r--r--src/mame/drivers/timelimt.cpp2
-rw-r--r--src/mame/drivers/timex.cpp2
-rw-r--r--src/mame/drivers/tispellb.cpp2
-rw-r--r--src/mame/drivers/tk2000.cpp2
-rw-r--r--src/mame/drivers/tmc600.cpp2
-rw-r--r--src/mame/drivers/tnzs.cpp2
-rw-r--r--src/mame/drivers/toaplan1.cpp18
-rw-r--r--src/mame/drivers/toaplan2.cpp16
-rw-r--r--src/mame/drivers/tomcat.cpp2
-rw-r--r--src/mame/drivers/tosh1000.cpp2
-rw-r--r--src/mame/drivers/tourvis.cpp2
-rw-r--r--src/mame/drivers/tp84.cpp2
-rw-r--r--src/mame/drivers/triforce.cpp2
-rw-r--r--src/mame/drivers/trs80.cpp4
-rw-r--r--src/mame/drivers/tubep.cpp2
-rw-r--r--src/mame/drivers/turbo.cpp2
-rw-r--r--src/mame/drivers/tvcapcom.cpp2
-rw-r--r--src/mame/drivers/twin16.cpp6
-rw-r--r--src/mame/drivers/twincobr.cpp2
-rw-r--r--src/mame/drivers/uapce.cpp2
-rw-r--r--src/mame/drivers/ultraman.cpp2
-rw-r--r--src/mame/drivers/undrfire.cpp2
-rw-r--r--src/mame/drivers/unichamp.cpp2
-rw-r--r--src/mame/drivers/v1050.cpp4
-rw-r--r--src/mame/drivers/vastar.cpp2
-rw-r--r--src/mame/drivers/vcombat.cpp2
-rw-r--r--src/mame/drivers/vic10.cpp7
-rw-r--r--src/mame/drivers/vicdual.cpp2
-rw-r--r--src/mame/drivers/vidbrain.cpp2
-rw-r--r--src/mame/drivers/volfied.cpp2
-rw-r--r--src/mame/drivers/vsnes.cpp2
-rw-r--r--src/mame/drivers/vtech2.cpp2
-rw-r--r--src/mame/drivers/wangpc.cpp12
-rw-r--r--src/mame/drivers/wardner.cpp2
-rw-r--r--src/mame/drivers/wecleman.cpp4
-rw-r--r--src/mame/drivers/wgp.cpp4
-rw-r--r--src/mame/drivers/wheelfir.cpp2
-rw-r--r--src/mame/drivers/witch.cpp2
-rw-r--r--src/mame/drivers/wrally.cpp1
-rw-r--r--src/mame/drivers/wswan.cpp2
-rw-r--r--src/mame/drivers/wyvernf0.cpp2
-rw-r--r--src/mame/drivers/x68k.cpp2
-rw-r--r--src/mame/drivers/xain.cpp2
-rw-r--r--src/mame/drivers/xexex.cpp2
-rw-r--r--src/mame/drivers/xorworld.cpp2
-rw-r--r--src/mame/drivers/xxmissio.cpp2
-rw-r--r--src/mame/drivers/z100.cpp4
-rw-r--r--src/mame/drivers/zaccaria.cpp2
-rw-r--r--src/mame/drivers/zerozone.cpp2
-rw-r--r--src/mame/drivers/zn.cpp2
-rw-r--r--src/mame/drivers/zr107.cpp4
-rw-r--r--src/mame/includes/adam.h2
-rw-r--r--src/mame/includes/kc.h2
-rw-r--r--src/mame/includes/prof80.h2
-rw-r--r--src/mame/includes/tiki100.h2
-rw-r--r--src/mame/includes/tmc600.h4
-rw-r--r--src/mame/includes/vidbrain.h2
-rw-r--r--src/mame/includes/xbox_pci.h4
-rw-r--r--src/mame/includes/xbox_usb.h56
-rw-r--r--src/mame/machine/gaelco_ds5002fp.cpp2
-rw-r--r--src/mame/machine/imds2ioc.cpp2
-rw-r--r--src/mame/machine/k573cass.cpp166
-rw-r--r--src/mame/machine/k573cass.h14
-rw-r--r--src/mame/machine/mega32x.cpp2
-rw-r--r--src/mame/machine/megacd.cpp2
-rw-r--r--src/mame/machine/xbox.cpp2
-rw-r--r--src/mame/machine/xbox_pci.cpp4
-rw-r--r--src/mame/machine/xbox_usb.cpp211
-rw-r--r--src/mame/machine/zs01.cpp12
-rw-r--r--src/mame/machine/zs01.h5
-rw-r--r--src/mame/video/decodmd1.cpp2
-rw-r--r--src/mame/video/decodmd2.cpp2
-rw-r--r--src/mame/video/decodmd3.cpp2
824 files changed, 3682 insertions, 4453 deletions
diff --git a/scripts/build/complay.py b/scripts/build/complay.py
index 72bdcfa01c8..ce760185015 100644
--- a/scripts/build/complay.py
+++ b/scripts/build/complay.py
@@ -649,14 +649,14 @@ if __name__ == '__main__':
varname = base
varname = 'layout_' + re.sub('[^0-9A-Za-z_]', '_', varname)
- comp_type = 1
+ comp_type = 'internal_layout::compression::ZLIB'
try:
dst = open(dstfile,'w') if dstfile is not None else BlackHole()
dst.write('static const unsigned char %s_data[] = {\n' % (varname))
byte_count, comp_size = compressLayout(srcfile, lambda x: dst.write(x), zlib.compressobj())
dst.write('};\n\n')
dst.write('const internal_layout %s = {\n' % (varname))
- dst.write('\t%d, sizeof(%s_data), %d, %s_data\n' % (byte_count, varname, comp_type, varname))
+ dst.write('\t%d, sizeof(%s_data), %s, %s_data\n' % (byte_count, varname, comp_type, varname))
dst.write('};\n')
dst.close()
except XmlError:
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 53623267c55..f97b1b4fea5 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -3842,7 +3842,7 @@ end
---------------------------------------------------
--
---@src/devices/bus/hp_optroms/hp_optrom.h,BUSES["HP_OPTROM"] = true
+--@src/devices/bus/hp9825_optroms/hp9825_optrom.h,BUSES["HP9825_OPTROM"] = true
---------------------------------------------------
if (BUSES["HP9825_OPTROM"]~=null) then
diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua
index 6f83f86aae3..752b8af30e6 100644
--- a/scripts/src/sound.lua
+++ b/scripts/src/sound.lua
@@ -1448,7 +1448,7 @@ end
---------------------------------------------------
-- Intelligent Designs DAVE
---@src/devices/sound/dave.h,MACHINES["DAVE"] = true
+--@src/devices/sound/dave.h,SOUNDS["DAVE"] = true
---------------------------------------------------
if (SOUNDS["DAVE"]~=null) then
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp
index 1dee51c40b2..bdb34f81846 100644
--- a/src/devices/bus/a1bus/a1bus.cpp
+++ b/src/devices/bus/a1bus/a1bus.cpp
@@ -30,7 +30,7 @@ a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, const char *
a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_a1bus_card_interface>(mconfig, *this)
, m_a1bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -39,13 +39,6 @@ a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, device_type
// device_start - device-specific startup
//-------------------------------------------------
-void a1bus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_a1bus_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_a1bus_card_interface\n", card->tag(), card->name());
-}
-
void a1bus_slot_device::device_resolve_objects()
{
device_a1bus_card_interface *const a1bus_card(dynamic_cast<device_a1bus_card_interface *>(get_card_device()));
@@ -55,9 +48,6 @@ void a1bus_slot_device::device_resolve_objects()
void a1bus_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_a1bus_card_interface *>(card))
- throw emu_fatalerror("a1bus_slot_device: card device %s (%s) does not implement device_a1bus_card_interface\n", card->tag(), card->name());
}
@@ -164,7 +154,7 @@ WRITE_LINE_MEMBER( a1bus_device::nmi_w ) { m_out_nmi_cb(state); }
//-------------------------------------------------
device_a1bus_card_interface::device_a1bus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "a1bus")
, m_a1bus_finder(device, finder_base::DUMMY_TAG), m_a1bus(nullptr)
, m_a1bus_slottag(nullptr), m_next(nullptr)
{
@@ -187,8 +177,6 @@ void device_a1bus_card_interface::interface_validity_check(validity_checker &val
void device_a1bus_card_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (!m_a1bus)
{
m_a1bus = m_a1bus_finder;
diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h
index 7970f150719..32345620b86 100644
--- a/src/devices/bus/a1bus/a1bus.h
+++ b/src/devices/bus/a1bus/a1bus.h
@@ -17,8 +17,9 @@
//**************************************************************************
class a1bus_device;
+class device_a1bus_card_interface;
-class a1bus_slot_device : public device_t, public device_slot_interface
+class a1bus_slot_device : public device_t, public device_single_card_slot_interface<device_a1bus_card_interface>
{
public:
// construction/destruction
@@ -38,7 +39,6 @@ protected:
a1bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -50,7 +50,6 @@ protected:
DECLARE_DEVICE_TYPE(A1BUS_SLOT, a1bus_slot_device)
-class device_a1bus_card_interface;
// ======================> a1bus_device
class a1bus_device : public device_t
{
@@ -99,7 +98,7 @@ DECLARE_DEVICE_TYPE(A1BUS, a1bus_device)
// ======================> device_a1bus_card_interface
// class representing interface-specific live a1bus card
-class device_a1bus_card_interface : public device_slot_card_interface
+class device_a1bus_card_interface : public device_interface
{
friend class a1bus_device;
public:
diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp
index 7adcaf368a7..ae5dbf82643 100644
--- a/src/devices/bus/a2bus/a2bus.cpp
+++ b/src/devices/bus/a2bus/a2bus.cpp
@@ -94,7 +94,7 @@ a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, const char *
a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_a2bus_card_interface>(mconfig, *this)
, m_a2bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -103,25 +103,15 @@ a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, device_type
// device_start - device-specific startup
//-------------------------------------------------
-void a2bus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_a2bus_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_a2bus_card_interface\n", card->tag(), card->name());
-}
-
void a2bus_slot_device::device_resolve_objects()
{
- device_a2bus_card_interface *const a2bus_card(dynamic_cast<device_a2bus_card_interface *>(get_card_device()));
+ device_a2bus_card_interface *const a2bus_card = get_card_device();
if (a2bus_card)
a2bus_card->set_a2bus(m_a2bus, tag());
}
void a2bus_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_a2bus_card_interface *>(card))
- throw emu_fatalerror("a2bus_slot_device: card device %s (%s) does not implement device_a2bus_card_interface\n", card->tag(), card->name());
}
//**************************************************************************
@@ -280,7 +270,7 @@ WRITE_LINE_MEMBER( a2bus_device::nmi_w ) { m_out_nmi_cb(state); }
//-------------------------------------------------
device_a2bus_card_interface::device_a2bus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "a2bus")
, m_a2bus_finder(device, finder_base::DUMMY_TAG), m_a2bus(nullptr)
, m_a2bus_slottag(nullptr), m_slot(-1), m_next(nullptr)
{
@@ -303,8 +293,6 @@ void device_a2bus_card_interface::interface_validity_check(validity_checker &val
void device_a2bus_card_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (!m_a2bus)
{
m_a2bus = m_a2bus_finder;
diff --git a/src/devices/bus/a2bus/a2bus.h b/src/devices/bus/a2bus/a2bus.h
index 3e63104f86c..1c7d94bbcdc 100644
--- a/src/devices/bus/a2bus/a2bus.h
+++ b/src/devices/bus/a2bus/a2bus.h
@@ -33,8 +33,9 @@ static constexpr uint32_t A2BUS_7M_CLOCK = 7159090;
//**************************************************************************
class a2bus_device;
+class device_a2bus_card_interface;
-class a2bus_slot_device : public device_t, public device_slot_interface
+class a2bus_slot_device : public device_t, public device_single_card_slot_interface<device_a2bus_card_interface>
{
public:
// construction/destruction
@@ -59,7 +60,6 @@ protected:
a2bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -71,8 +71,6 @@ protected:
DECLARE_DEVICE_TYPE(A2BUS_SLOT, a2bus_slot_device)
-class device_a2bus_card_interface;
-
// ======================> a2bus_device
class a2bus_device : public device_t
{
@@ -133,7 +131,7 @@ DECLARE_DEVICE_TYPE(A2BUS, a2bus_device)
// ======================> device_a2bus_card_interface
// class representing interface-specific live a2bus card
-class device_a2bus_card_interface : public device_slot_card_interface
+class device_a2bus_card_interface : public device_interface
{
friend class a2bus_device;
public:
diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp
index 5fab40ba9ae..7ad4f91c628 100644
--- a/src/devices/bus/a2bus/a2eauxslot.cpp
+++ b/src/devices/bus/a2bus/a2eauxslot.cpp
@@ -32,15 +32,14 @@ a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, co
a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_a2eauxslot_card_interface>(mconfig, *this)
, m_a2eauxslot(*this, finder_base::DUMMY_TAG)
{
}
void a2eauxslot_slot_device::device_resolve_objects()
{
- device_a2eauxslot_card_interface *dev = dynamic_cast<device_a2eauxslot_card_interface *>(get_card_device());
-
+ device_a2eauxslot_card_interface *const dev = get_card_device();
if (dev)
dev->set_a2eauxslot_device(m_a2eauxslot.target());
}
@@ -132,7 +131,7 @@ WRITE_LINE_MEMBER( a2eauxslot_device::nmi_w ) { m_out_nmi_cb(state); }
//-------------------------------------------------
device_a2eauxslot_card_interface::device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "a2eaux"),
m_a2eauxslot(nullptr),
m_slot(0), m_next(nullptr)
{
diff --git a/src/devices/bus/a2bus/a2eauxslot.h b/src/devices/bus/a2bus/a2eauxslot.h
index 4351bc6112a..4dde6277169 100644
--- a/src/devices/bus/a2bus/a2eauxslot.h
+++ b/src/devices/bus/a2bus/a2eauxslot.h
@@ -21,9 +21,11 @@
//**************************************************************************
class a2eauxslot_device;
+class device_a2eauxslot_card_interface;
+
class a2eauxslot_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_a2eauxslot_card_interface>
{
public:
// construction/destruction
@@ -55,8 +57,6 @@ protected:
DECLARE_DEVICE_TYPE(A2EAUXSLOT_SLOT, a2eauxslot_slot_device)
-class device_a2eauxslot_card_interface;
-
// ======================> a2eauxslot_device
class a2eauxslot_device : public device_t
{
@@ -101,7 +101,7 @@ DECLARE_DEVICE_TYPE(A2EAUXSLOT, a2eauxslot_device)
// ======================> device_a2eauxslot_card_interface
// class representing interface-specific live a2eauxslot card
-class device_a2eauxslot_card_interface : public device_slot_card_interface
+class device_a2eauxslot_card_interface : public device_interface
{
friend class a2eauxslot_device;
public:
diff --git a/src/devices/bus/a2gameio/gameio.cpp b/src/devices/bus/a2gameio/gameio.cpp
index 4f9b7bd9b58..7704d4ff382 100644
--- a/src/devices/bus/a2gameio/gameio.cpp
+++ b/src/devices/bus/a2gameio/gameio.cpp
@@ -63,7 +63,7 @@ DEFINE_DEVICE_TYPE(APPLE2_GAMEIO, apple2_gameio_device, "a2gameio", "Apple II Ga
apple2_gameio_device::apple2_gameio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, APPLE2_GAMEIO, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_a2gameio_interface>(mconfig, *this)
, m_intf(nullptr)
{
}
@@ -83,12 +83,12 @@ void apple2_gameio_device::default_options(device_slot_interface &slot)
void apple2_gameio_device::device_config_complete()
{
- m_intf = dynamic_cast<device_a2gameio_interface *>(get_card_device());
+ m_intf = get_card_device();
}
void apple2_gameio_device::device_resolve_objects()
{
- if (m_intf != nullptr)
+ if (m_intf)
m_intf->m_connector = this;
}
@@ -207,7 +207,7 @@ WRITE_LINE_MEMBER(apple2_gameio_device::strobe_w)
//**************************************************************************
device_a2gameio_interface::device_a2gameio_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "a2gameio")
, m_connector(nullptr)
{
}
diff --git a/src/devices/bus/a2gameio/gameio.h b/src/devices/bus/a2gameio/gameio.h
index e2bc7e512ea..e160fc7aa1e 100644
--- a/src/devices/bus/a2gameio/gameio.h
+++ b/src/devices/bus/a2gameio/gameio.h
@@ -21,7 +21,7 @@ class device_a2gameio_interface;
// ======================> apple2_gameio_device
-class apple2_gameio_device : public device_t, public device_slot_interface
+class apple2_gameio_device : public device_t, public device_single_card_slot_interface<device_a2gameio_interface>
{
public:
// construction/destruction
@@ -82,14 +82,16 @@ private:
// ======================> device_a2gameio_interface
-class device_a2gameio_interface : public device_slot_card_interface
+class device_a2gameio_interface : public device_interface
{
friend class apple2_gameio_device;
+public:
+ virtual ~device_a2gameio_interface();
+
protected:
// construction/destruction
device_a2gameio_interface(const machine_config &mconfig, device_t &device);
- virtual ~device_a2gameio_interface();
// optional input overrides
virtual u8 pdl0_r() { return 0; }
diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp
index e33048ec40c..0d2182a5e84 100644
--- a/src/devices/bus/a7800/a78_slot.cpp
+++ b/src/devices/bus/a7800/a78_slot.cpp
@@ -41,11 +41,11 @@ DEFINE_DEVICE_TYPE(A78_CART_SLOT, a78_cart_slot_device, "a78_cart_slot", "Atari
//-------------------------------------------------
device_a78_cart_interface::device_a78_cart_interface (const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0),
- m_base_rom(0x8000),
- m_bank_mask(0)
+ : device_interface(device, "a78cart")
+ , m_rom(nullptr)
+ , m_rom_size(0)
+ , m_base_rom(0x8000)
+ , m_bank_mask(0)
{
}
diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h
index 4b091161bf1..3704c9a3356 100644
--- a/src/devices/bus/a7800/a78_slot.h
+++ b/src/devices/bus/a7800/a78_slot.h
@@ -42,7 +42,7 @@ enum
// ======================> device_a78_cart_interface
-class device_a78_cart_interface : public device_slot_card_interface
+class device_a78_cart_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp
index 9307efaf209..dbb587ae9f7 100644
--- a/src/devices/bus/a800/a800_slot.cpp
+++ b/src/devices/bus/a800/a800_slot.cpp
@@ -22,9 +22,11 @@
#include "emu.h"
-#include "hashfile.h"
#include "a800_slot.h"
+#include "hashfile.h"
+
+
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
@@ -38,11 +40,11 @@ DEFINE_DEVICE_TYPE(XEGS_CART_SLOT, xegs_cart_slot_device, "xegs_cart_slot", "
// device_vcs_cart_interface - constructor
//-------------------------------------------------
-device_a800_cart_interface::device_a800_cart_interface (const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0),
- m_bank_mask(0)
+device_a800_cart_interface::device_a800_cart_interface (const machine_config &mconfig, device_t &device) :
+ device_interface(device, "a800cart"),
+ m_rom(nullptr),
+ m_rom_size(0),
+ m_bank_mask(0)
{
}
@@ -104,7 +106,8 @@ void device_a800_cart_interface::nvram_alloc(uint32_t size)
a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0)
+ device_single_card_slot_interface<device_a800_cart_interface>(mconfig, *this),
+ m_cart(nullptr), m_type(0)
{
}
@@ -148,7 +151,7 @@ xegs_cart_slot_device::~xegs_cart_slot_device()
void a800_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_a800_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h
index cb31b6eacc2..41ef5b6c211 100644
--- a/src/devices/bus/a800/a800_slot.h
+++ b/src/devices/bus/a800/a800_slot.h
@@ -48,7 +48,7 @@ enum
// ======================> device_a800_cart_interface
-class device_a800_cart_interface : public device_slot_card_interface
+class device_a800_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -87,7 +87,7 @@ protected:
class a800_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_a800_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/a800/a8sio.cpp b/src/devices/bus/a800/a8sio.cpp
index 45fdb47ba45..cf975d7b50a 100644
--- a/src/devices/bus/a800/a8sio.cpp
+++ b/src/devices/bus/a800/a8sio.cpp
@@ -53,7 +53,7 @@ DEFINE_DEVICE_TYPE(A8SIO, a8sio_device, "a8sio", "Atari 8 bit SIO Slot")
a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, A8SIO, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_a8sio_card_interface>(mconfig, *this)
, m_out_clock_in_cb(*this)
, m_out_data_in_cb(*this)
, m_out_proceed_cb(*this)
@@ -71,12 +71,9 @@ a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, devic
void a8sio_device::device_resolve_objects()
{
- m_device = dynamic_cast<device_a8sio_card_interface *>(get_card_device());
-
+ m_device = get_card_device();
if (m_device)
- {
m_device->set_a8sio_device(this);
- }
// resolve callbacks
m_out_clock_in_cb.resolve_safe();
@@ -166,7 +163,7 @@ WRITE_LINE_MEMBER( a8sio_device::interrupt_w )
//-------------------------------------------------
device_a8sio_card_interface::device_a8sio_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "a8sio")
, m_a8sio(nullptr)
{
}
diff --git a/src/devices/bus/a800/a8sio.h b/src/devices/bus/a800/a8sio.h
index 842c26bf99d..eaf2a7a7784 100644
--- a/src/devices/bus/a800/a8sio.h
+++ b/src/devices/bus/a800/a8sio.h
@@ -39,8 +39,7 @@ void a8sio_cards(device_slot_interface &device);
class device_a8sio_card_interface;
-class a8sio_device : public device_t,
- public device_slot_interface
+class a8sio_device : public device_t, public device_single_card_slot_interface<device_a8sio_card_interface>
{
public:
// construction/destruction
@@ -94,7 +93,7 @@ protected:
DECLARE_DEVICE_TYPE(A8SIO, a8sio_device)
-class device_a8sio_card_interface : public device_slot_card_interface
+class device_a8sio_card_interface : public device_interface
{
friend class a8sio_device;
public:
diff --git a/src/devices/bus/abcbus/abcbus.cpp b/src/devices/bus/abcbus/abcbus.cpp
index e34f51ac729..ee946c632db 100644
--- a/src/devices/bus/abcbus/abcbus.cpp
+++ b/src/devices/bus/abcbus/abcbus.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(ABCBUS_SLOT, abcbus_slot_device, "abcbus_slot", "ABCBUS slot"
//-------------------------------------------------
device_abcbus_card_interface::device_abcbus_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "abcbus")
{
m_slot = dynamic_cast<abcbus_slot_device *>(device.owner());
}
@@ -40,7 +40,7 @@ device_abcbus_card_interface::device_abcbus_card_interface(const machine_config
abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ABCBUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_abcbus_card_interface>(mconfig, *this),
m_write_irq(*this),
m_write_nmi(*this),
m_write_rdy(*this),
@@ -62,7 +62,7 @@ abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char
void abcbus_slot_device::device_start()
{
- m_card = dynamic_cast<device_abcbus_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
diff --git a/src/devices/bus/abcbus/abcbus.h b/src/devices/bus/abcbus/abcbus.h
index 2388fbc73cf..5779cfead42 100644
--- a/src/devices/bus/abcbus/abcbus.h
+++ b/src/devices/bus/abcbus/abcbus.h
@@ -118,35 +118,35 @@
class abcbus_slot_device;
-class device_abcbus_card_interface : public device_slot_card_interface
+class device_abcbus_card_interface : public device_interface
{
public:
// required operation overrides
virtual void abcbus_cs(uint8_t data) = 0;
// optional operation overrides
- virtual uint8_t abcbus_inp() { return 0xff; };
- virtual void abcbus_out(uint8_t data) { };
- virtual uint8_t abcbus_stat() { return 0xff; };
- virtual void abcbus_c1(uint8_t data) { };
- virtual void abcbus_c2(uint8_t data) { };
- virtual void abcbus_c3(uint8_t data) { };
- virtual void abcbus_c4(uint8_t data) { };
+ virtual uint8_t abcbus_inp() { return 0xff; }
+ virtual void abcbus_out(uint8_t data) { }
+ virtual uint8_t abcbus_stat() { return 0xff; }
+ virtual void abcbus_c1(uint8_t data) { }
+ virtual void abcbus_c2(uint8_t data) { }
+ virtual void abcbus_c3(uint8_t data) { }
+ virtual void abcbus_c4(uint8_t data) { }
// optional operation overrides for ABC 80
- virtual uint8_t abcbus_xmemfl(offs_t offset) { return 0xff; };
- virtual void abcbus_xmemw(offs_t offset, uint8_t data) { };
+ virtual uint8_t abcbus_xmemfl(offs_t offset) { return 0xff; }
+ virtual void abcbus_xmemw(offs_t offset, uint8_t data) { }
// optional operation overrides for ABC 1600
virtual int abcbus_csb() { return 1; }
- virtual uint8_t abcbus_ops() { return 0xff; };
- virtual void abcbus_tren(int state) { };
- virtual void abcbus_prac(int state) { };
- virtual uint8_t abcbus_exp() { return 0xff; };
- virtual int abcbus_xcsb2() { return 1; };
- virtual int abcbus_xcsb3() { return 1; };
- virtual int abcbus_xcsb4() { return 1; };
- virtual int abcbus_xcsb5() { return 1; };
+ virtual uint8_t abcbus_ops() { return 0xff; }
+ virtual void abcbus_tren(int state) { }
+ virtual void abcbus_prac(int state) { }
+ virtual uint8_t abcbus_exp() { return 0xff; }
+ virtual int abcbus_xcsb2() { return 1; }
+ virtual int abcbus_xcsb3() { return 1; }
+ virtual int abcbus_xcsb4() { return 1; }
+ virtual int abcbus_xcsb5() { return 1; }
protected:
// construction/destruction
@@ -161,7 +161,7 @@ protected:
// ======================> abcbus_slot_device
class abcbus_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_abcbus_card_interface>
{
public:
// construction/destruction
@@ -245,7 +245,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override { if (m_card) get_card_device()->reset(); }
devcb_write_line m_write_irq;
devcb_write_line m_write_nmi;
diff --git a/src/devices/bus/abckb/abckb.cpp b/src/devices/bus/abckb/abckb.cpp
index f851deeffb8..32af6f47178 100644
--- a/src/devices/bus/abckb/abckb.cpp
+++ b/src/devices/bus/abckb/abckb.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(ABC_KEYBOARD_PORT, abc_keyboard_port_device, "abc_keyboard_po
//-------------------------------------------------
abc_keyboard_interface::abc_keyboard_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "abckb")
{
m_slot = dynamic_cast<abc_keyboard_port_device *>(device.owner());
}
@@ -45,7 +45,7 @@ abc_keyboard_interface::abc_keyboard_interface(const machine_config &mconfig, de
abc_keyboard_port_device::abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ABC_KEYBOARD_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<abc_keyboard_interface>(mconfig, *this),
m_out_rx_handler(*this),
m_out_trxc_handler(*this),
m_out_keydown_handler(*this), m_card(nullptr)
@@ -54,27 +54,12 @@ abc_keyboard_port_device::abc_keyboard_port_device(const machine_config &mconfig
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void abc_keyboard_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<abc_keyboard_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement abc_keyboard_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void abc_keyboard_port_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<abc_keyboard_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement abc_keyboard_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_out_rx_handler.resolve_safe();
@@ -84,15 +69,6 @@ void abc_keyboard_port_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void abc_keyboard_port_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// write_rx -
//-------------------------------------------------
@@ -108,7 +84,7 @@ WRITE_LINE_MEMBER( abc_keyboard_port_device::write_rx )
WRITE_LINE_MEMBER( abc_keyboard_port_device::txd_w )
{
- if (m_card != nullptr)
+ if (m_card)
m_card->txd_w(state);
}
diff --git a/src/devices/bus/abckb/abckb.h b/src/devices/bus/abckb/abckb.h
index d7ab8b6162a..63b8b2c799e 100644
--- a/src/devices/bus/abckb/abckb.h
+++ b/src/devices/bus/abckb/abckb.h
@@ -18,7 +18,7 @@
class abc_keyboard_interface;
-class abc_keyboard_port_device : public device_t, public device_slot_interface
+class abc_keyboard_port_device : public device_t, public device_single_card_slot_interface<abc_keyboard_interface>
{
public:
// construction/destruction
@@ -48,9 +48,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
devcb_write_line m_out_rx_handler;
devcb_write_line m_out_trxc_handler;
@@ -60,7 +58,7 @@ protected:
};
-class abc_keyboard_interface : public device_slot_card_interface
+class abc_keyboard_interface : public device_interface
{
public:
virtual void txd_w(int state) { }
diff --git a/src/devices/bus/acorn/bus.cpp b/src/devices/bus/acorn/bus.cpp
index 2ecb509c30f..9bbbf1e7fac 100644
--- a/src/devices/bus/acorn/bus.cpp
+++ b/src/devices/bus/acorn/bus.cpp
@@ -28,36 +28,20 @@ DEFINE_DEVICE_TYPE(ACORN_BUS_SLOT, acorn_bus_slot_device, "acorn_bus_slot", "Aco
//-------------------------------------------------
acorn_bus_slot_device::acorn_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ACORN_BUS_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_acorn_bus_interface>(mconfig, *this)
, m_bus(*this, finder_base::DUMMY_TAG)
{
}
//-------------------------------------------------
-// device_validity_check - device-specific checks
-//-------------------------------------------------
-
-void acorn_bus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_acorn_bus_interface *>(card))
- osd_printf_error("acorn_bus_slot_device: card device %s (%s) does not implement device_acorn_bus_interface\n", card->tag(), card->name());
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void acorn_bus_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card)
- {
- device_acorn_bus_interface *const intf(dynamic_cast<device_acorn_bus_interface *>(card));
- if (!intf)
- throw emu_fatalerror("acorn_bus_slot_device: card device %s (%s) does not implement device_acorn_bus_interface\n", card->tag(), card->name());
+ device_acorn_bus_interface *const intf(get_card_device());
+ if (intf)
intf->set_acorn_bus(*m_bus);
- }
// tell acorn bus that there is one slot with the specified tag
m_bus->add_slot(*this);
@@ -132,7 +116,7 @@ WRITE_LINE_MEMBER(acorn_bus_device::nmi_w) { m_out_nmi_cb(state); }
//-------------------------------------------------
device_acorn_bus_interface::device_acorn_bus_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "acornbus")
, m_bus(nullptr)
{
}
diff --git a/src/devices/bus/acorn/bus.h b/src/devices/bus/acorn/bus.h
index 149da10d447..02adc30a8a9 100644
--- a/src/devices/bus/acorn/bus.h
+++ b/src/devices/bus/acorn/bus.h
@@ -26,7 +26,7 @@ class device_acorn_bus_interface;
// TYPE DEFINITIONS
//**************************************************************************
-class acorn_bus_slot_device : public device_t, public device_slot_interface
+class acorn_bus_slot_device : public device_t, public device_single_card_slot_interface<device_acorn_bus_interface>
{
public:
// construction/destruction
@@ -44,7 +44,6 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
// configuration
@@ -96,7 +95,7 @@ DECLARE_DEVICE_TYPE(ACORN_BUS, acorn_bus_device)
// ======================> device_acorn_bus_interface
// class representing interface-specific live acorn bus card
-class device_acorn_bus_interface : public device_slot_card_interface
+class device_acorn_bus_interface : public device_interface
{
public:
friend class acorn_bus_device;
diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp
index 4555ed961eb..a6c8b777402 100644
--- a/src/devices/bus/adam/exp.cpp
+++ b/src/devices/bus/adam/exp.cpp
@@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE(ADAM_EXPANSION_SLOT, adam_expansion_slot_device, "adam_expans
//-------------------------------------------------
device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "adamexp"),
m_rom(*this, "rom")
{
m_slot = dynamic_cast<adam_expansion_slot_device *>(device.owner());
@@ -54,7 +54,7 @@ device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_inter
adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ADAM_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_adam_expansion_slot_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_write_irq(*this), m_card(nullptr)
{
@@ -67,7 +67,7 @@ adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mco
void adam_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_adam_expansion_slot_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
@@ -75,15 +75,6 @@ void adam_expansion_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void adam_expansion_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// call_load -
//-------------------------------------------------
diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h
index 618bc3d365a..52a492f7901 100644
--- a/src/devices/bus/adam/exp.h
+++ b/src/devices/bus/adam/exp.h
@@ -31,7 +31,7 @@
class device_adam_expansion_slot_card_interface;
class adam_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_adam_expansion_slot_card_interface>,
public device_image_interface
{
public:
@@ -60,7 +60,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// image-level overrides
virtual image_init_result call_load() override;
@@ -87,7 +86,7 @@ protected:
// ======================> device_adam_expansion_slot_card_interface
-class device_adam_expansion_slot_card_interface : public device_slot_card_interface
+class device_adam_expansion_slot_card_interface : public device_interface
{
friend class adam_expansion_slot_device;
diff --git a/src/devices/bus/adamnet/adamnet.cpp b/src/devices/bus/adamnet/adamnet.cpp
index 7e45a72adca..69b25ce30e7 100644
--- a/src/devices/bus/adamnet/adamnet.cpp
+++ b/src/devices/bus/adamnet/adamnet.cpp
@@ -28,8 +28,8 @@ DEFINE_DEVICE_TYPE(ADAMNET_SLOT, adamnet_slot_device, "adamnet_slot", "ADAMnet s
// device_adamnet_card_interface - constructor
//-------------------------------------------------
-device_adamnet_card_interface::device_adamnet_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+device_adamnet_card_interface::device_adamnet_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "adamnet"),
m_bus(nullptr)
{
}
@@ -54,7 +54,8 @@ device_adamnet_card_interface::~device_adamnet_card_interface()
//-------------------------------------------------
adamnet_slot_device::adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ADAMNET_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_bus(nullptr)
+ device_single_card_slot_interface<device_adamnet_card_interface>(mconfig, *this),
+ m_bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -65,9 +66,8 @@ adamnet_slot_device::adamnet_slot_device(const machine_config &mconfig, const ch
void adamnet_slot_device::device_start()
{
- m_bus = machine().device<adamnet_device>(ADAMNET_TAG);
- device_adamnet_card_interface *dev = dynamic_cast<device_adamnet_card_interface *>(get_card_device());
- if (dev) m_bus->add_device(get_card_device());
+ device_adamnet_card_interface *dev = get_card_device();
+ if (dev) m_bus->add_device(&dev->device());
}
diff --git a/src/devices/bus/adamnet/adamnet.h b/src/devices/bus/adamnet/adamnet.h
index 51fc46a38dd..a064ce24f2f 100644
--- a/src/devices/bus/adamnet/adamnet.h
+++ b/src/devices/bus/adamnet/adamnet.h
@@ -15,13 +15,6 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define ADAMNET_TAG "adamnet"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -74,14 +67,18 @@ private:
// ======================> adamnet_slot_device
class adamnet_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_adamnet_card_interface>
{
public:
+ // configuration
+ template <typename T> void set_bus(T &&tag) { m_bus.set_tag(std::forward<T>(tag)); }
+
// construction/destruction
- template <typename T>
- adamnet_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ template <typename T, typename U>
+ adamnet_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bus, U &&opts, char const *dflt)
: adamnet_slot_device(mconfig, tag, owner, (uint32_t)0)
{
+ set_bus(std::forward<T>(bus));
option_reset();
opts(*this);
set_default_option(dflt);
@@ -89,18 +86,18 @@ public:
}
adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
// device-level overrides
virtual void device_start() override;
-protected:
// configuration
- adamnet_device *m_bus;
+ required_device<adamnet_device> m_bus;
};
// ======================> device_adamnet_card_interface
-class device_adamnet_card_interface : public device_slot_card_interface
+class device_adamnet_card_interface : public device_interface
{
friend class adamnet_device;
diff --git a/src/devices/bus/amiga/keyboard/keyboard.cpp b/src/devices/bus/amiga/keyboard/keyboard.cpp
index d60ad3256a2..4e0bed0650e 100644
--- a/src/devices/bus/amiga/keyboard/keyboard.cpp
+++ b/src/devices/bus/amiga/keyboard/keyboard.cpp
@@ -34,7 +34,7 @@ template class device_finder<device_amiga_keyboard_interface, true>;
amiga_keyboard_bus_device::amiga_keyboard_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, AMIGA_KEYBOARD_INTERFACE, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_amiga_keyboard_interface>(mconfig, *this),
m_kbd(nullptr),
m_kclk_handler(*this), m_kdat_handler(*this), m_krst_handler(*this)
{
@@ -55,7 +55,7 @@ amiga_keyboard_bus_device::~amiga_keyboard_bus_device()
void amiga_keyboard_bus_device::device_start()
{
// get connected keyboard
- m_kbd = dynamic_cast<device_amiga_keyboard_interface *>(get_card_device());
+ m_kbd = get_card_device();
// resolve callbacks
m_kclk_handler.resolve_safe();
@@ -91,7 +91,7 @@ WRITE_LINE_MEMBER( amiga_keyboard_bus_device::kdat_in_w )
//-------------------------------------------------
device_amiga_keyboard_interface::device_amiga_keyboard_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "amigakbd")
{
m_host = dynamic_cast<amiga_keyboard_bus_device *>(device.owner());
}
diff --git a/src/devices/bus/amiga/keyboard/keyboard.h b/src/devices/bus/amiga/keyboard/keyboard.h
index 3458ab56912..fef26d40388 100644
--- a/src/devices/bus/amiga/keyboard/keyboard.h
+++ b/src/devices/bus/amiga/keyboard/keyboard.h
@@ -27,7 +27,7 @@ class device_amiga_keyboard_interface;
// ======================> amiga_keyboard_bus_device
-class amiga_keyboard_bus_device : public device_t, public device_slot_interface
+class amiga_keyboard_bus_device : public device_t, public device_single_card_slot_interface<device_amiga_keyboard_interface>
{
public:
// construction/destruction
@@ -71,7 +71,7 @@ private:
// ======================> device_amiga_keyboard_interface
-class device_amiga_keyboard_interface : public device_slot_card_interface
+class device_amiga_keyboard_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/amiga/zorro/zorro.cpp b/src/devices/bus/amiga/zorro/zorro.cpp
index b4f06507d55..e1c37ceee61 100644
--- a/src/devices/bus/amiga/zorro/zorro.cpp
+++ b/src/devices/bus/amiga/zorro/zorro.cpp
@@ -273,7 +273,7 @@ void zorro2_device::fc_w(int code)
//-------------------------------------------------
device_zorro_card_interface::device_zorro_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "zorro"),
m_zorro(nullptr)
{
}
diff --git a/src/devices/bus/amiga/zorro/zorro.h b/src/devices/bus/amiga/zorro/zorro.h
index 4ad72da638b..bebe256ef2e 100644
--- a/src/devices/bus/amiga/zorro/zorro.h
+++ b/src/devices/bus/amiga/zorro/zorro.h
@@ -172,15 +172,15 @@ public:
set_fixed(false);
}
- // device-level overrides
- virtual void device_start() override;
-
// inline configuration
template <class T> void set_zorro_slot(T &&zorro_tag) { m_zorro_bus.set_tag(zorro_tag); }
protected:
zorro_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ // device-level overrides
+ virtual void device_start() override;
+
// configuration
required_device<zorro_device> m_zorro_bus;
};
@@ -319,7 +319,7 @@ DECLARE_DEVICE_TYPE(ZORRO2, zorro2_device)
// ======================> base zorro card interface
-class device_zorro_card_interface : public device_slot_card_interface
+class device_zorro_card_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/apf/slot.cpp b/src/devices/bus/apf/slot.cpp
index 871c43e4655..cf4e3b86c4e 100644
--- a/src/devices/bus/apf/slot.cpp
+++ b/src/devices/bus/apf/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(APF_CART_SLOT, apf_cart_slot_device, "apf_cart_slot", "APF Ca
// device_apf_cart_interface - constructor
//-------------------------------------------------
-device_apf_cart_interface::device_apf_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_apf_cart_interface::device_apf_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "apfcart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -75,8 +75,9 @@ void device_apf_cart_interface::ram_alloc(uint32_t size)
apf_cart_slot_device::apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, APF_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
- m_type(APF_STD), m_cart(nullptr)
+ device_single_card_slot_interface<device_apf_cart_interface>(mconfig, *this),
+ m_type(APF_STD),
+ m_cart(nullptr)
{
}
@@ -95,7 +96,7 @@ apf_cart_slot_device::~apf_cart_slot_device()
void apf_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_apf_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h
index 3678124c3e9..9a02839f3e4 100644
--- a/src/devices/bus/apf/slot.h
+++ b/src/devices/bus/apf/slot.h
@@ -21,7 +21,7 @@ enum
// ======================> device_apf_cart_interface
-class device_apf_cart_interface : public device_slot_card_interface
+class device_apf_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -55,7 +55,7 @@ protected:
class apf_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_apf_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/apricot/expansion/expansion.cpp b/src/devices/bus/apricot/expansion/expansion.cpp
index 5a89c9a8868..0949e1ae781 100644
--- a/src/devices/bus/apricot/expansion/expansion.cpp
+++ b/src/devices/bus/apricot/expansion/expansion.cpp
@@ -27,7 +27,7 @@ apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_confi
apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_single_card_slot_interface<device_apricot_expansion_card_interface>(mconfig, *this)
{
}
@@ -37,7 +37,7 @@ apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_confi
void apricot_expansion_slot_device::device_start()
{
- device_apricot_expansion_card_interface *dev = dynamic_cast<device_apricot_expansion_card_interface *>(get_card_device());
+ device_apricot_expansion_card_interface *dev = get_card_device();
if (dev)
{
@@ -136,7 +136,7 @@ void apricot_expansion_bus_device::install_ram(offs_t addrstart, offs_t addrend,
//-------------------------------------------------
device_apricot_expansion_card_interface::device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "apricotexp"),
m_bus(nullptr),
m_next(nullptr)
{
diff --git a/src/devices/bus/apricot/expansion/expansion.h b/src/devices/bus/apricot/expansion/expansion.h
index 93c529f24e3..f5a1994861d 100644
--- a/src/devices/bus/apricot/expansion/expansion.h
+++ b/src/devices/bus/apricot/expansion/expansion.h
@@ -57,7 +57,7 @@ class device_apricot_expansion_card_interface;
// ======================> apricot_expansion_slot_device
-class apricot_expansion_slot_device : public device_t, public device_slot_interface
+class apricot_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_apricot_expansion_card_interface>
{
public:
// construction/destruction
@@ -151,7 +151,7 @@ DECLARE_DEVICE_TYPE(APRICOT_EXPANSION_BUS, apricot_expansion_bus_device)
// ======================> device_apricot_expansion_card_interface
-class device_apricot_expansion_card_interface : public device_slot_card_interface
+class device_apricot_expansion_card_interface : public device_interface
{
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/apricot/keyboard/keyboard.cpp b/src/devices/bus/apricot/keyboard/keyboard.cpp
index 6f502ae7c76..4a87d6b0493 100644
--- a/src/devices/bus/apricot/keyboard/keyboard.cpp
+++ b/src/devices/bus/apricot/keyboard/keyboard.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(APRICOT_KEYBOARD_INTERFACE, apricot_keyboard_bus_device, "apr
apricot_keyboard_bus_device::apricot_keyboard_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, APRICOT_KEYBOARD_INTERFACE, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_apricot_keyboard_interface>(mconfig, *this),
m_kbd(nullptr),
m_in_handler(*this)
{
@@ -49,28 +49,20 @@ apricot_keyboard_bus_device::~apricot_keyboard_bus_device()
void apricot_keyboard_bus_device::device_start()
{
// get connected keyboard
- m_kbd = dynamic_cast<device_apricot_keyboard_interface *>(get_card_device());
+ m_kbd = get_card_device();
// resolve callbacks
m_in_handler.resolve_safe();
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void apricot_keyboard_bus_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// host to module interface
//-------------------------------------------------
WRITE_LINE_MEMBER( apricot_keyboard_bus_device::out_w )
{
- if (m_kbd)
- m_kbd->out_w(state);
+ if (m_kbd)
+ m_kbd->out_w(state);
}
@@ -83,7 +75,7 @@ WRITE_LINE_MEMBER( apricot_keyboard_bus_device::out_w )
//-------------------------------------------------
device_apricot_keyboard_interface::device_apricot_keyboard_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "apricotkbd")
{
m_host = dynamic_cast<apricot_keyboard_bus_device *>(device.owner());
}
diff --git a/src/devices/bus/apricot/keyboard/keyboard.h b/src/devices/bus/apricot/keyboard/keyboard.h
index 9395dac4855..e19605b2459 100644
--- a/src/devices/bus/apricot/keyboard/keyboard.h
+++ b/src/devices/bus/apricot/keyboard/keyboard.h
@@ -42,7 +42,7 @@ class device_apricot_keyboard_interface;
// ======================> apricot_keyboard_bus_device
-class apricot_keyboard_bus_device : public device_t, public device_slot_interface
+class apricot_keyboard_bus_device : public device_t, public device_single_card_slot_interface<device_apricot_keyboard_interface>
{
public:
// construction/destruction
@@ -70,7 +70,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
private:
device_apricot_keyboard_interface *m_kbd;
@@ -80,7 +79,7 @@ private:
// ======================> device_apricot_keyboard_interface
-class device_apricot_keyboard_interface : public device_slot_card_interface
+class device_apricot_keyboard_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp
index fed92bee9cd..19d2b1459f8 100644
--- a/src/devices/bus/arcadia/slot.cpp
+++ b/src/devices/bus/arcadia/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(EA2001_CART_SLOT, arcadia_cart_slot_device, "arcadia_cart_slo
// device_arcadia_cart_interface - constructor
//-------------------------------------------------
-device_arcadia_cart_interface::device_arcadia_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_arcadia_cart_interface::device_arcadia_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "arcadiacart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -65,7 +65,7 @@ void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag)
arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, EA2001_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_arcadia_cart_interface>(mconfig, *this),
m_type(ARCADIA_STD), m_cart(nullptr)
{
}
@@ -85,7 +85,7 @@ arcadia_cart_slot_device::~arcadia_cart_slot_device()
void arcadia_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_arcadia_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h
index 1269fe95e7e..6d34b209dec 100644
--- a/src/devices/bus/arcadia/slot.h
+++ b/src/devices/bus/arcadia/slot.h
@@ -20,7 +20,7 @@ enum
// ======================> device_arcadia_cart_interface
-class device_arcadia_cart_interface : public device_slot_card_interface
+class device_arcadia_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -46,7 +46,7 @@ protected:
class arcadia_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_arcadia_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/astrocde/accessory.cpp b/src/devices/bus/astrocde/accessory.cpp
index fe7727b855d..fb047e660d8 100644
--- a/src/devices/bus/astrocde/accessory.cpp
+++ b/src/devices/bus/astrocde/accessory.cpp
@@ -19,7 +19,7 @@ DEFINE_DEVICE_TYPE(ASTROCADE_ACCESSORY_PORT, astrocade_accessory_port_device, "a
//**************************************************************************
device_astrocade_accessory_interface::device_astrocade_accessory_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "astrocadeacc")
, m_port(dynamic_cast<astrocade_accessory_port_device *>(device.owner()))
{
}
@@ -30,8 +30,6 @@ device_astrocade_accessory_interface::~device_astrocade_accessory_interface()
void device_astrocade_accessory_interface::interface_validity_check(validity_checker &valid) const
{
- device_slot_card_interface::interface_validity_check(valid);
-
if (device().owner() && !m_port)
{
osd_printf_error("Owner device %s (%s) is not an astrocade_accessory_port_device\n", device().owner()->tag(), device().owner()->name());
@@ -40,8 +38,6 @@ void device_astrocade_accessory_interface::interface_validity_check(validity_che
void device_astrocade_accessory_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (m_port && !m_port->started())
throw device_missing_dependencies();
}
@@ -53,7 +49,7 @@ void device_astrocade_accessory_interface::interface_pre_start()
astrocade_accessory_port_device::astrocade_accessory_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ASTROCADE_ACCESSORY_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_astrocade_accessory_interface>(mconfig, *this)
, m_ltpen(0)
, m_ltpen_handler(*this)
, m_screen(*this, finder_base::DUMMY_TAG)
@@ -65,38 +61,17 @@ astrocade_accessory_port_device::~astrocade_accessory_port_device()
{
}
-void astrocade_accessory_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_astrocade_accessory_interface *>(card))
- {
- osd_printf_error("Card device %s (%s) does not implement device_astrocade_accessory_interface\n", card->tag(), card->name());
- }
-}
-
void astrocade_accessory_port_device::device_resolve_objects()
{
- device_astrocade_accessory_interface *const card(dynamic_cast<device_astrocade_accessory_interface *>(get_card_device()));
- if (card)
- {
- m_device = card;
+ m_device = get_card_device();
+ if (m_device)
m_device->set_screen(m_screen);
- }
m_ltpen_handler.resolve_safe();
}
void astrocade_accessory_port_device::device_start()
{
- device_t *const card(get_card_device());
- if (card)
- {
- if (!m_device)
- {
- throw emu_fatalerror("astrocade_accessory_port_device: card device %s (%s) does not implement device_astrocade_accessory_interface\n", card->tag(), card->name());
- }
- }
-
save_item(NAME(m_ltpen));
m_ltpen = 0;
diff --git a/src/devices/bus/astrocde/accessory.h b/src/devices/bus/astrocde/accessory.h
index d745e464cd2..5386cd1362a 100644
--- a/src/devices/bus/astrocde/accessory.h
+++ b/src/devices/bus/astrocde/accessory.h
@@ -21,7 +21,7 @@ class device_astrocade_accessory_interface;
// ======================> astrocade_accessory_port_device
-class astrocade_accessory_port_device : public device_t, public device_slot_interface
+class astrocade_accessory_port_device : public device_t, public device_single_card_slot_interface<device_astrocade_accessory_interface>
{
public:
// construction/destruction
@@ -42,7 +42,6 @@ public:
protected:
// device_t implementation
- virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -59,7 +58,7 @@ private:
// ======================> device_astrocade_accessory_interface
-class device_astrocade_accessory_interface : public device_slot_card_interface
+class device_astrocade_accessory_interface : public device_interface
{
public:
virtual ~device_astrocade_accessory_interface();
diff --git a/src/devices/bus/astrocde/ctrl.cpp b/src/devices/bus/astrocde/ctrl.cpp
index 89cd60ca6a5..b33c8aebb49 100644
--- a/src/devices/bus/astrocde/ctrl.cpp
+++ b/src/devices/bus/astrocde/ctrl.cpp
@@ -19,7 +19,7 @@ DEFINE_DEVICE_TYPE(ASTROCADE_CTRL_PORT, astrocade_ctrl_port_device, "astrocade_c
//**************************************************************************
device_astrocade_ctrl_interface::device_astrocade_ctrl_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "astrocadectrl")
, m_port(dynamic_cast<astrocade_ctrl_port_device *>(device.owner()))
{
}
@@ -30,8 +30,6 @@ device_astrocade_ctrl_interface::~device_astrocade_ctrl_interface()
void device_astrocade_ctrl_interface::interface_validity_check(validity_checker &valid) const
{
- device_slot_card_interface::interface_validity_check(valid);
-
if (device().owner() && !m_port)
{
osd_printf_error("Owner device %s (%s) is not an astrocade_ctrl_port_device\n", device().owner()->tag(), device().owner()->name());
@@ -40,12 +38,19 @@ void device_astrocade_ctrl_interface::interface_validity_check(validity_checker
void device_astrocade_ctrl_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (m_port && !m_port->started())
throw device_missing_dependencies();
}
+WRITE_LINE_MEMBER( device_astrocade_ctrl_interface::write_ltpen )
+{
+ if (m_port->m_ltpen != state)
+ {
+ m_port->m_ltpen = state;
+ m_port->m_ltpen_handler(state);
+ }
+}
+
//**************************************************************************
// Bally Astrocade controller port
@@ -53,7 +58,7 @@ void device_astrocade_ctrl_interface::interface_pre_start()
astrocade_ctrl_port_device::astrocade_ctrl_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ASTROCADE_CTRL_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_astrocade_ctrl_interface>(mconfig, *this)
, m_ltpen(0)
, m_ltpen_handler(*this)
, m_device(nullptr)
@@ -64,35 +69,15 @@ astrocade_ctrl_port_device::~astrocade_ctrl_port_device()
{
}
-void astrocade_ctrl_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_astrocade_ctrl_interface *>(card))
- {
- osd_printf_error("Card device %s (%s) does not implement device_astrocade_ctrl_interface\n", card->tag(), card->name());
- }
-}
-
void astrocade_ctrl_port_device::device_resolve_objects()
{
- device_astrocade_ctrl_interface *const card(dynamic_cast<device_astrocade_ctrl_interface *>(get_card_device()));
- if (card)
- m_device = card;
+ m_device = get_card_device();
m_ltpen_handler.resolve_safe();
}
void astrocade_ctrl_port_device::device_start()
{
- device_t *const card(get_card_device());
- if (card)
- {
- if (!m_device)
- {
- throw emu_fatalerror("astrocade_ctrl_port_device: card device %s (%s) does not implement device_astrocade_ctrl_interface\n", card->tag(), card->name());
- }
- }
-
save_item(NAME(m_ltpen));
m_ltpen = 0;
@@ -100,15 +85,6 @@ void astrocade_ctrl_port_device::device_start()
m_ltpen_handler(0);
}
-uint8_t astrocade_ctrl_port_device::read_handle()
-{
- return m_device ? m_device->read_handle() : 0;
-}
-
-uint8_t astrocade_ctrl_port_device::read_knob()
-{
- return m_device ? m_device->read_knob() : 0;
-}
#include "joy.h"
#include "cassette.h"
diff --git a/src/devices/bus/astrocde/ctrl.h b/src/devices/bus/astrocde/ctrl.h
index 0cc34ea4dcc..0273b4a80fd 100644
--- a/src/devices/bus/astrocde/ctrl.h
+++ b/src/devices/bus/astrocde/ctrl.h
@@ -10,16 +10,42 @@
FORWARD DECLARATIONS
***************************************************************************/
-class device_astrocade_ctrl_interface;
+class astrocade_ctrl_port_device;
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
+// ======================> device_astrocade_ctrl_interface
+
+class device_astrocade_ctrl_interface : public device_interface
+{
+public:
+ virtual ~device_astrocade_ctrl_interface();
+
+ virtual uint8_t read_handle() { return 0; }
+ virtual uint8_t read_knob() { return 0; }
+
+protected:
+ device_astrocade_ctrl_interface(machine_config const &mconfig, device_t &device);
+
+ // device_interface implementation
+ virtual void interface_validity_check(validity_checker &valid) const override ATTR_COLD;
+ virtual void interface_pre_start() override;
+
+ DECLARE_WRITE_LINE_MEMBER( write_ltpen );
+
+private:
+ astrocade_ctrl_port_device *const m_port;
+
+ friend class astrocade_ctrl_port_device;
+};
+
+
// ======================> astrocade_ctrl_port_device
-class astrocade_ctrl_port_device : public device_t, public device_slot_interface
+class astrocade_ctrl_port_device : public device_t, public device_single_card_slot_interface<device_astrocade_ctrl_interface>
{
public:
// construction/destruction
@@ -37,12 +63,11 @@ public:
auto ltpen_handler() { return m_ltpen_handler.bind(); }
- uint8_t read_handle();
- uint8_t read_knob();
+ uint8_t read_handle() { return m_device ? m_device->read_handle() : 0; }
+ uint8_t read_knob() { return m_device ? m_device->read_knob() : 0; }
protected:
// device_t implementation
- virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -56,32 +81,6 @@ private:
};
-// ======================> device_astrocade_ctrl_interface
-
-class device_astrocade_ctrl_interface : public device_slot_card_interface
-{
-public:
- virtual ~device_astrocade_ctrl_interface();
-
- virtual uint8_t read_handle() { return 0; }
- virtual uint8_t read_knob() { return 0; }
-
- DECLARE_WRITE_LINE_MEMBER( write_ltpen ) { m_port->m_ltpen = state; m_port->m_ltpen_handler(state); }
-
-protected:
- device_astrocade_ctrl_interface(machine_config const &mconfig, device_t &device);
-
- // device_interface implementation
- virtual void interface_validity_check(validity_checker &valid) const override ATTR_COLD;
- virtual void interface_pre_start() override;
-
-private:
- astrocade_ctrl_port_device *const m_port;
-
- friend class astrocade_ctrl_port_device;
-};
-
-
/***************************************************************************
FUNCTIONS
***************************************************************************/
diff --git a/src/devices/bus/astrocde/exp.cpp b/src/devices/bus/astrocde/exp.cpp
index 9fe3c9f3fda..c0e20a57f88 100644
--- a/src/devices/bus/astrocde/exp.cpp
+++ b/src/devices/bus/astrocde/exp.cpp
@@ -17,13 +17,13 @@
DEFINE_DEVICE_TYPE(ASTROCADE_EXP_SLOT, astrocade_exp_device, "astrocade_exp", "Bally Astrocade expansion")
-device_astrocade_card_interface::device_astrocade_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_astrocade_exp_interface::device_astrocade_exp_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "astrocadeexp")
{
}
-device_astrocade_card_interface::~device_astrocade_card_interface()
+device_astrocade_exp_interface::~device_astrocade_exp_interface()
{
}
@@ -37,7 +37,7 @@ device_astrocade_card_interface::~device_astrocade_card_interface()
//-------------------------------------------------
astrocade_exp_device::astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ASTROCADE_EXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_astrocade_exp_interface>(mconfig, *this),
m_card_mounted(false), m_card(nullptr)
{
}
@@ -57,7 +57,7 @@ astrocade_exp_device::~astrocade_exp_device()
void astrocade_exp_device::device_start()
{
- m_card = dynamic_cast<device_astrocade_card_interface *>(get_card_device());
+ m_card = get_card_device();
if (m_card)
m_card_mounted = true;
}
diff --git a/src/devices/bus/astrocde/exp.h b/src/devices/bus/astrocde/exp.h
index a01db130974..b26bb51d03e 100644
--- a/src/devices/bus/astrocde/exp.h
+++ b/src/devices/bus/astrocde/exp.h
@@ -3,13 +3,13 @@
#ifndef MAME_BUS_ASTROCADE_EXP_H
#define MAME_BUS_ASTROCADE_EXP_H
-// ======================> device_astrocade_card_interface
+// ======================> device_astrocade_exp_interface
-class device_astrocade_card_interface : public device_slot_card_interface
+class device_astrocade_exp_interface : public device_interface
{
public:
// construction/destruction
- virtual ~device_astrocade_card_interface();
+ virtual ~device_astrocade_exp_interface();
// reading and writing
virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
@@ -18,13 +18,13 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_io) { }
protected:
- device_astrocade_card_interface(const machine_config &mconfig, device_t &device);
+ device_astrocade_exp_interface(const machine_config &mconfig, device_t &device);
};
// ======================> astrocade_exp_device
-class astrocade_exp_device : public device_t, public device_slot_interface
+class astrocade_exp_device : public device_t, public device_single_card_slot_interface<device_astrocade_exp_interface>
{
public:
// construction/destruction
@@ -53,7 +53,7 @@ public:
protected:
bool m_card_mounted;
- device_astrocade_card_interface* m_card;
+ device_astrocade_exp_interface* m_card;
};
// device type definition
diff --git a/src/devices/bus/astrocde/ram.cpp b/src/devices/bus/astrocde/ram.cpp
index 8f20b0256fa..54664617be6 100644
--- a/src/devices/bus/astrocde/ram.cpp
+++ b/src/devices/bus/astrocde/ram.cpp
@@ -70,7 +70,7 @@ DEFINE_DEVICE_TYPE(ASTROCADE_RL64RAM, astrocade_rl64ram_device, "astroca
astrocade_blueram_4k_device::astrocade_blueram_4k_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_astrocade_card_interface(mconfig, *this)
+ , device_astrocade_exp_interface(mconfig, *this)
, m_write_prot(*this, "RAM_PROTECT")
, m_ramio(*this, "ramio")
, m_cassette(*this, "cassette")
@@ -93,23 +93,23 @@ astrocade_blueram_32k_device::astrocade_blueram_32k_device(const machine_config
}
astrocade_viper_sys1_device::astrocade_viper_sys1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ASTROCADE_VIPER_SYS1, tag, owner, clock),
- device_astrocade_card_interface(mconfig, *this),
- m_write_prot(*this, "RAM_PROTECT")
+ : device_t(mconfig, ASTROCADE_VIPER_SYS1, tag, owner, clock)
+ , device_astrocade_exp_interface(mconfig, *this)
+ , m_write_prot(*this, "RAM_PROTECT")
{
}
astrocade_whiteram_device::astrocade_whiteram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ASTROCADE_WHITERAM, tag, owner, clock),
- device_astrocade_card_interface(mconfig, *this),
- m_write_prot(*this, "RAM_PROTECT")
+ : device_t(mconfig, ASTROCADE_WHITERAM, tag, owner, clock)
+ , device_astrocade_exp_interface(mconfig, *this)
+ , m_write_prot(*this, "RAM_PROTECT")
{
}
astrocade_rl64ram_device::astrocade_rl64ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ASTROCADE_RL64RAM, tag, owner, clock),
- device_astrocade_card_interface(mconfig, *this),
- m_write_prot(*this, "RAM_PROTECT")
+ : device_t(mconfig, ASTROCADE_RL64RAM, tag, owner, clock)
+ , device_astrocade_exp_interface(mconfig, *this)
+ , m_write_prot(*this, "RAM_PROTECT")
{
}
diff --git a/src/devices/bus/astrocde/ram.h b/src/devices/bus/astrocde/ram.h
index ee5ed884ef4..5c15029fb26 100644
--- a/src/devices/bus/astrocde/ram.h
+++ b/src/devices/bus/astrocde/ram.h
@@ -12,7 +12,7 @@
// ======================> astrocade_blueram_4k_device
-class astrocade_blueram_4k_device : public device_t, public device_astrocade_card_interface
+class astrocade_blueram_4k_device : public device_t, public device_astrocade_exp_interface
{
public:
// construction/destruction
@@ -69,7 +69,7 @@ public:
// ======================> astrocade_viper_sys1_device
-class astrocade_viper_sys1_device : public device_t, public device_astrocade_card_interface
+class astrocade_viper_sys1_device : public device_t, public device_astrocade_exp_interface
{
public:
// construction/destruction
@@ -93,7 +93,7 @@ private:
// ======================> astrocade_whiteram_device
-class astrocade_whiteram_device : public device_t, public device_astrocade_card_interface
+class astrocade_whiteram_device : public device_t, public device_astrocade_exp_interface
{
public:
// construction/destruction
@@ -117,7 +117,7 @@ private:
// ======================> astrocade_rl64ram_device
-class astrocade_rl64ram_device : public device_t, public device_astrocade_card_interface
+class astrocade_rl64ram_device : public device_t, public device_astrocade_exp_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/astrocde/slot.cpp b/src/devices/bus/astrocde/slot.cpp
index 2aa78be98d9..15135e08af1 100644
--- a/src/devices/bus/astrocde/slot.cpp
+++ b/src/devices/bus/astrocde/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(ASTROCADE_CART_SLOT, astrocade_cart_slot_device, "astrocade_c
// device_astrocade_cart_interface - constructor
//-------------------------------------------------
-device_astrocade_cart_interface::device_astrocade_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_astrocade_cart_interface::device_astrocade_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "astrocadecart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -65,7 +65,7 @@ void device_astrocade_cart_interface::rom_alloc(uint32_t size, const char *tag)
astrocade_cart_slot_device::astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ASTROCADE_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_astrocade_cart_interface>(mconfig, *this),
m_type(ASTROCADE_STD), m_cart(nullptr)
{
}
@@ -85,7 +85,7 @@ astrocade_cart_slot_device::~astrocade_cart_slot_device()
void astrocade_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_astrocade_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h
index 419f4672985..9c9654eb3b4 100644
--- a/src/devices/bus/astrocde/slot.h
+++ b/src/devices/bus/astrocde/slot.h
@@ -26,7 +26,7 @@ enum
// ======================> device_astrocade_cart_interface
-class device_astrocade_cart_interface : public device_slot_card_interface
+class device_astrocade_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -52,7 +52,7 @@ protected:
class astrocade_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_astrocade_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/ata/atadev.cpp b/src/devices/bus/ata/atadev.cpp
index 609674d79f3..b5873fd2a6e 100644
--- a/src/devices/bus/ata/atadev.cpp
+++ b/src/devices/bus/ata/atadev.cpp
@@ -18,7 +18,7 @@
//-------------------------------------------------
device_ata_interface::device_ata_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "ata"),
m_irq_handler(device),
m_dmarq_handler(device),
m_dasp_handler(device),
@@ -38,10 +38,10 @@ DEFINE_DEVICE_TYPE(ATA_SLOT, ata_slot_device, "ata_slot", "ATA Connector")
// ata_slot_device - constructor
//-------------------------------------------------
-ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ATA_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_dev(nullptr)
+ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, ATA_SLOT, tag, owner, clock),
+ device_single_card_slot_interface<device_ata_interface>(mconfig, *this),
+ m_dev(nullptr)
{
}
@@ -53,7 +53,7 @@ ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag,
void ata_slot_device::device_config_complete()
{
- m_dev = dynamic_cast<device_ata_interface *>(get_card_device());
+ m_dev = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/ata/atadev.h b/src/devices/bus/ata/atadev.h
index 40904b9b7b5..41832a8d22a 100644
--- a/src/devices/bus/ata/atadev.h
+++ b/src/devices/bus/ata/atadev.h
@@ -18,12 +18,10 @@
class ata_interface_device;
-class device_ata_interface : public device_slot_card_interface
+class device_ata_interface : public device_interface
{
friend class abstract_ata_interface_device;
public:
- device_ata_interface(const machine_config &mconfig, device_t &device);
-
virtual uint16_t read_dma() = 0;
virtual uint16_t read_cs0(offs_t offset, uint16_t mem_mask = 0xffff) = 0;
virtual uint16_t read_cs1(offs_t offset, uint16_t mem_mask = 0xffff) = 0;
@@ -38,6 +36,8 @@ public:
virtual DECLARE_WRITE_LINE_MEMBER(write_pdiag) = 0;
protected:
+ device_ata_interface(const machine_config &mconfig, device_t &device);
+
devcb_write_line m_irq_handler;
devcb_write_line m_dmarq_handler;
devcb_write_line m_dasp_handler;
@@ -47,7 +47,7 @@ protected:
// ======================> ata_slot_device
class ata_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_ata_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
index 6b23371d580..59969850649 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
@@ -26,8 +26,8 @@ DEFINE_DEVICE_TYPE(BBC_1MHZBUS_SLOT, bbc_1mhzbus_slot_device, "bbc_1mhzbus_slot"
// device_bbc_1mhzbus_interface - constructor
//-------------------------------------------------
-device_bbc_1mhzbus_interface::device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_1mhzbus_interface::device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbc1mhzbus")
{
m_slot = dynamic_cast<bbc_1mhzbus_slot_device *>(device.owner());
}
@@ -43,7 +43,7 @@ device_bbc_1mhzbus_interface::device_bbc_1mhzbus_interface(const machine_config
bbc_1mhzbus_slot_device::bbc_1mhzbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_1MHZBUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_1mhzbus_interface>(mconfig, *this),
m_card(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this)
@@ -52,27 +52,12 @@ bbc_1mhzbus_slot_device::bbc_1mhzbus_slot_device(const machine_config &mconfig,
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void bbc_1mhzbus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_1mhzbus_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_1mhzbus_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_1mhzbus_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_bbc_1mhzbus_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_bbc_1mhzbus_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
@@ -81,14 +66,6 @@ void bbc_1mhzbus_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_1mhzbus_slot_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// read
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
index 80e48425973..302348b6822 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h
@@ -87,7 +87,7 @@
class device_bbc_1mhzbus_interface;
-class bbc_1mhzbus_slot_device : public device_t, public device_slot_interface
+class bbc_1mhzbus_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_1mhzbus_interface>
{
public:
// construction/destruction
@@ -117,9 +117,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_1mhzbus_interface *m_card;
@@ -131,7 +129,7 @@ private:
// ======================> device_bbc_1mhzbus_interface
-class device_bbc_1mhzbus_interface : public device_slot_card_interface
+class device_bbc_1mhzbus_interface : public device_interface
{
public:
virtual uint8_t fred_r(offs_t offset) { return 0xff; }
diff --git a/src/devices/bus/bbc/analogue/analogue.cpp b/src/devices/bus/bbc/analogue/analogue.cpp
index facc1a827bc..7a5059dd3b4 100644
--- a/src/devices/bus/bbc/analogue/analogue.cpp
+++ b/src/devices/bus/bbc/analogue/analogue.cpp
@@ -26,8 +26,8 @@ DEFINE_DEVICE_TYPE(BBC_ANALOGUE_SLOT, bbc_analogue_slot_device, "bbc_analogue_sl
// device_bbc_analogue_interface - constructor
//-------------------------------------------------
-device_bbc_analogue_interface::device_bbc_analogue_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_analogue_interface::device_bbc_analogue_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbcanalogue")
{
m_slot = dynamic_cast<bbc_analogue_slot_device *>(device.owner());
}
@@ -43,30 +43,20 @@ device_bbc_analogue_interface::device_bbc_analogue_interface(const machine_confi
bbc_analogue_slot_device::bbc_analogue_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_ANALOGUE_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_analogue_interface>(mconfig, *this),
m_card(nullptr),
m_lpstb_handler(*this)
{
}
-void bbc_analogue_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_analogue_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_analogue_interface\n", carddev->tag(), carddev->name());
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_analogue_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_bbc_analogue_interface *>(get_card_device());
- if (carddev && !m_card)
- osd_printf_error("Card device %s (%s) does not implement device_bbc_analogue_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_lpstb_handler.resolve_safe();
@@ -88,14 +78,6 @@ uint8_t bbc_analogue_slot_device::pb_r()
return 0x30;
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_analogue_slot_device::device_reset()
-{
-}
-
//-------------------------------------------------
// SLOT_INTERFACE( bbc_analogue_devices )
diff --git a/src/devices/bus/bbc/analogue/analogue.h b/src/devices/bus/bbc/analogue/analogue.h
index d8aec89e012..60d890b591c 100644
--- a/src/devices/bus/bbc/analogue/analogue.h
+++ b/src/devices/bus/bbc/analogue/analogue.h
@@ -41,7 +41,7 @@
class device_bbc_analogue_interface;
-class bbc_analogue_slot_device : public device_t, public device_slot_interface
+class bbc_analogue_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_analogue_interface>
{
public:
// construction/destruction
@@ -67,9 +67,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_analogue_interface *m_card;
@@ -80,7 +78,7 @@ private:
// ======================> device_bbc_analogue_interface
-class device_bbc_analogue_interface : public device_slot_card_interface
+class device_bbc_analogue_interface : public device_interface
{
public:
virtual uint8_t ch_r(int channel) { return 0x00; };
diff --git a/src/devices/bus/bbc/exp/exp.cpp b/src/devices/bus/bbc/exp/exp.cpp
index 25f19746b72..8bbc78889d7 100644
--- a/src/devices/bus/bbc/exp/exp.cpp
+++ b/src/devices/bus/bbc/exp/exp.cpp
@@ -26,8 +26,8 @@ DEFINE_DEVICE_TYPE(BBC_EXP_SLOT, bbc_exp_slot_device, "bbc_exp_slot", "BBC Maste
// device_bbc_exp_interface - constructor
//-------------------------------------------------
-device_bbc_exp_interface::device_bbc_exp_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_exp_interface::device_bbc_exp_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbcexp")
{
m_slot = dynamic_cast<bbc_exp_slot_device *>(device.owner());
}
@@ -43,7 +43,7 @@ device_bbc_exp_interface::device_bbc_exp_interface(const machine_config &mconfig
bbc_exp_slot_device::bbc_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_EXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_exp_interface>(mconfig, *this),
m_card(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this),
@@ -54,27 +54,12 @@ bbc_exp_slot_device::bbc_exp_slot_device(const machine_config &mconfig, const ch
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void bbc_exp_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_exp_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_exp_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_exp_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_bbc_exp_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_bbc_exp_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
@@ -86,14 +71,6 @@ void bbc_exp_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_exp_slot_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// read
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/exp/exp.h b/src/devices/bus/bbc/exp/exp.h
index ef1a0174b1a..f7d695b59a5 100644
--- a/src/devices/bus/bbc/exp/exp.h
+++ b/src/devices/bus/bbc/exp/exp.h
@@ -51,7 +51,7 @@
class device_bbc_exp_interface;
-class bbc_exp_slot_device : public device_t, public device_slot_interface
+class bbc_exp_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_exp_interface>
{
public:
// construction/destruction
@@ -94,9 +94,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_exp_interface *m_card;
@@ -111,7 +109,7 @@ private:
// ======================> device_bbc_exp_interface
-class device_bbc_exp_interface : public device_slot_card_interface
+class device_bbc_exp_interface : public device_interface
{
public:
virtual uint8_t fred_r(offs_t offset) { return 0xff; }
diff --git a/src/devices/bus/bbc/fdc/fdc.cpp b/src/devices/bus/bbc/fdc/fdc.cpp
index 2269bb3370a..6c9e4b152c4 100644
--- a/src/devices/bus/bbc/fdc/fdc.cpp
+++ b/src/devices/bus/bbc/fdc/fdc.cpp
@@ -25,8 +25,8 @@ DEFINE_DEVICE_TYPE(BBC_FDC_SLOT, bbc_fdc_slot_device, "bbc_fdc_slot", "BBC Micro
// device_bbc_fdc_interface - constructor
//-------------------------------------------------
-device_bbc_fdc_interface::device_bbc_fdc_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_fdc_interface::device_bbc_fdc_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbcfdc")
{
m_slot = dynamic_cast<bbc_fdc_slot_device *>(device.owner());
}
@@ -42,7 +42,7 @@ device_bbc_fdc_interface::device_bbc_fdc_interface(const machine_config &mconfig
bbc_fdc_slot_device::bbc_fdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_FDC_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_fdc_interface>(mconfig, *this),
m_card(nullptr),
m_intrq_cb(*this),
m_drq_cb(*this)
@@ -51,26 +51,12 @@ bbc_fdc_slot_device::bbc_fdc_slot_device(const machine_config &mconfig, const ch
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void bbc_fdc_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_fdc_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_fdc_interface\n", carddev->tag(), carddev->name());
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_fdc_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_bbc_fdc_interface *>(get_card_device());
- if (carddev && !m_card)
- osd_printf_error("Card device %s (%s) does not implement device_bbc_fdc_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_intrq_cb.resolve_safe();
@@ -78,14 +64,6 @@ void bbc_fdc_slot_device::device_start()
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_fdc_slot_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// read
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/fdc/fdc.h b/src/devices/bus/bbc/fdc/fdc.h
index 3264172a25d..2662919edbd 100644
--- a/src/devices/bus/bbc/fdc/fdc.h
+++ b/src/devices/bus/bbc/fdc/fdc.h
@@ -21,7 +21,7 @@
class device_bbc_fdc_interface;
-class bbc_fdc_slot_device : public device_t, public device_slot_interface
+class bbc_fdc_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_fdc_interface>
{
public:
// construction/destruction
@@ -49,9 +49,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_fdc_interface *m_card;
@@ -63,7 +61,7 @@ private:
// ======================> device_bbc_fdc_interface
-class device_bbc_fdc_interface : public device_slot_card_interface
+class device_bbc_fdc_interface : public device_interface
{
public:
virtual uint8_t read(offs_t offset) { return 0xff; }
diff --git a/src/devices/bus/bbc/joyport/joyport.cpp b/src/devices/bus/bbc/joyport/joyport.cpp
index 0c1bae50ee2..79f285b0670 100644
--- a/src/devices/bus/bbc/joyport/joyport.cpp
+++ b/src/devices/bus/bbc/joyport/joyport.cpp
@@ -25,8 +25,8 @@ DEFINE_DEVICE_TYPE(BBC_JOYPORT_SLOT, bbc_joyport_slot_device, "bbc_joyport_slot"
// device_bbc_joyport_interface - constructor
//-------------------------------------------------
-device_bbc_joyport_interface::device_bbc_joyport_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_joyport_interface::device_bbc_joyport_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbcjoyport")
{
m_slot = dynamic_cast<bbc_joyport_slot_device *>(device.owner());
}
@@ -42,7 +42,7 @@ device_bbc_joyport_interface::device_bbc_joyport_interface(const machine_config
bbc_joyport_slot_device::bbc_joyport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_JOYPORT_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface(mconfig, *this),
m_device(nullptr),
m_cb1_handler(*this),
m_cb2_handler(*this)
@@ -51,43 +51,20 @@ bbc_joyport_slot_device::bbc_joyport_slot_device(const machine_config &mconfig,
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void bbc_joyport_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_joyport_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_joyport_interface\n", carddev->tag(), carddev->name());
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_joyport_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_device = dynamic_cast<device_bbc_joyport_interface *>(carddev);
- if (carddev && !m_device)
- fatalerror("Card device %s (%s) does not implement device_bbc_joyport_interface\n", carddev->tag(), carddev->name());
+ m_device = get_card_device();
- // resolve callbacks
+ // resolve callbacks
m_cb1_handler.resolve_safe();
m_cb2_handler.resolve_safe();
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_joyport_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// pb_r
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/joyport/joyport.h b/src/devices/bus/bbc/joyport/joyport.h
index 6abda62633d..e2d44111995 100644
--- a/src/devices/bus/bbc/joyport/joyport.h
+++ b/src/devices/bus/bbc/joyport/joyport.h
@@ -41,7 +41,7 @@
class device_bbc_joyport_interface;
-class bbc_joyport_slot_device : public device_t, public device_slot_interface
+class bbc_joyport_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_joyport_interface>
{
public:
// construction/destruction
@@ -69,9 +69,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_joyport_interface *m_device;
@@ -83,7 +81,7 @@ private:
// ======================> device_bbc_joyport_interface
-class device_bbc_joyport_interface : public device_slot_card_interface
+class device_bbc_joyport_interface : public device_interface
{
public:
virtual uint8_t pb_r() { return 0xff; }
diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp
index e421a1c520e..4a284661155 100644
--- a/src/devices/bus/bbc/rom/slot.cpp
+++ b/src/devices/bus/bbc/rom/slot.cpp
@@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE(BBC_ROMSLOT32, bbc_romslot32_device, "bbc_romslot32", "BBC Mi
//-------------------------------------------------
device_bbc_rom_interface::device_bbc_rom_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "bbcrom")
, m_rom(nullptr)
, m_rom_size(0)
{
@@ -84,7 +84,7 @@ void device_bbc_rom_interface::nvram_alloc(uint32_t size)
bbc_romslot_device::bbc_romslot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_bbc_rom_interface>(mconfig, *this)
, m_cart(nullptr)
{
}
@@ -105,7 +105,7 @@ bbc_romslot32_device::bbc_romslot32_device(const machine_config &mconfig, const
void bbc_romslot_device::device_start()
{
- m_cart = dynamic_cast<device_bbc_rom_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/bbc/rom/slot.h b/src/devices/bus/bbc/rom/slot.h
index bb60c90d600..0dfa2980a9e 100644
--- a/src/devices/bus/bbc/rom/slot.h
+++ b/src/devices/bus/bbc/rom/slot.h
@@ -26,7 +26,7 @@ class device_bbc_rom_interface;
class bbc_romslot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_bbc_rom_interface>
{
public:
// image-level overrides
@@ -109,7 +109,7 @@ public:
// ======================> device_bbc_rom_interface
-class device_bbc_rom_interface : public device_slot_card_interface
+class device_bbc_rom_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp
index 602ea3c845a..6fa9dc700f6 100644
--- a/src/devices/bus/bbc/tube/tube.cpp
+++ b/src/devices/bus/bbc/tube/tube.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(BBC_TUBE_SLOT, bbc_tube_slot_device, "bbc_tube_slot", "BBC Mi
//-------------------------------------------------
device_bbc_tube_interface::device_bbc_tube_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "bbctube")
{
m_slot = dynamic_cast<bbc_tube_slot_device *>(device.owner());
}
@@ -44,7 +44,7 @@ device_bbc_tube_interface::device_bbc_tube_interface(const machine_config &mconf
bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_TUBE_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_tube_interface>(mconfig, *this),
m_card(nullptr),
m_irq_handler(*this)
{
@@ -52,27 +52,12 @@ bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void bbc_tube_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_bbc_tube_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_bbc_tube_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_tube_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_bbc_tube_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_bbc_tube_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
@@ -80,15 +65,6 @@ void bbc_tube_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_tube_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// host_r
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/tube/tube.h b/src/devices/bus/bbc/tube/tube.h
index e0d66907cb6..531d6458800 100644
--- a/src/devices/bus/bbc/tube/tube.h
+++ b/src/devices/bus/bbc/tube/tube.h
@@ -47,7 +47,7 @@
class device_bbc_tube_interface;
-class bbc_tube_slot_device : public device_t, public device_slot_interface
+class bbc_tube_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_tube_interface>
{
public:
// construction/destruction
@@ -73,9 +73,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_tube_interface *m_card;
@@ -86,7 +84,7 @@ private:
// ======================> device_bbc_tube_interface
-class device_bbc_tube_interface : public device_slot_card_interface
+class device_bbc_tube_interface : public device_interface
{
public:
// reading and writing
diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp
index 85a846544ed..2e6c8184c14 100644
--- a/src/devices/bus/bbc/userport/userport.cpp
+++ b/src/devices/bus/bbc/userport/userport.cpp
@@ -26,8 +26,8 @@ DEFINE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_slot_device, "bbc_userport_sl
// device_bbc_userport_interface - constructor
//-------------------------------------------------
-device_bbc_userport_interface::device_bbc_userport_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_bbc_userport_interface::device_bbc_userport_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bbcuserport")
{
m_slot = dynamic_cast<bbc_userport_slot_device *>(device.owner());
}
@@ -53,7 +53,7 @@ device_bbc_userport_interface::~device_bbc_userport_interface()
bbc_userport_slot_device::bbc_userport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BBC_USERPORT_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_bbc_userport_interface>(mconfig, *this),
m_device(nullptr),
m_cb1_handler(*this),
m_cb2_handler(*this)
@@ -68,7 +68,7 @@ bbc_userport_slot_device::bbc_userport_slot_device(const machine_config &mconfig
void bbc_userport_slot_device::device_start()
{
- m_device = dynamic_cast<device_bbc_userport_interface *>(get_card_device());
+ m_device = get_card_device();
// resolve callbacks
m_cb1_handler.resolve_safe();
@@ -77,15 +77,6 @@ void bbc_userport_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void bbc_userport_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// pb_r
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h
index e3040283a5a..c0a0b560eac 100644
--- a/src/devices/bus/bbc/userport/userport.h
+++ b/src/devices/bus/bbc/userport/userport.h
@@ -41,7 +41,7 @@
class device_bbc_userport_interface;
-class bbc_userport_slot_device : public device_t, public device_slot_interface
+class bbc_userport_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_userport_interface>
{
public:
// construction/destruction
@@ -70,7 +70,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
device_bbc_userport_interface *m_device;
@@ -82,7 +81,7 @@ private:
// ======================> device_bbc_userport_interface
-class device_bbc_userport_interface : public device_slot_card_interface
+class device_bbc_userport_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp
index 9acb1b9acb5..fb2dee6a65f 100644
--- a/src/devices/bus/bml3/bml3bus.cpp
+++ b/src/devices/bus/bml3/bml3bus.cpp
@@ -66,7 +66,9 @@ bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, const ch
bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_bml3bus_tag(nullptr), m_bml3bus_slottag(nullptr)
+ device_single_card_slot_interface<device_bml3bus_card_interface>(mconfig, *this),
+ m_bml3bus(*this, finder_base::DUMMY_TAG),
+ m_bml3bus_slottag(nullptr)
{
}
@@ -76,9 +78,9 @@ bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, device_t
void bml3bus_slot_device::device_start()
{
- device_bml3bus_card_interface *dev = dynamic_cast<device_bml3bus_card_interface *>(get_card_device());
-
- if (dev) dev->set_bml3bus_tag(m_bml3bus_tag, m_bml3bus_slottag);
+ device_bml3bus_card_interface *const dev = get_card_device();
+ if (dev)
+ dev->set_bml3bus(*m_bml3bus, m_bml3bus_slottag);
}
//**************************************************************************
@@ -145,9 +147,9 @@ device_bml3bus_card_interface *bml3bus_device::get_bml3bus_card(int slot)
return m_device_list[slot];
}
-void bml3bus_device::add_bml3bus_card(int slot, device_bml3bus_card_interface *card)
+void bml3bus_device::add_bml3bus_card(int slot, device_bml3bus_card_interface &card)
{
- m_device_list[slot] = card;
+ m_device_list[slot] = &card;
}
void bml3bus_device::set_nmi_line(int state)
@@ -183,10 +185,10 @@ WRITE_LINE_MEMBER( bml3bus_device::firq_w ) { m_out_firq_cb(state); }
// device_bml3bus_card_interface - constructor
//-------------------------------------------------
-device_bml3bus_card_interface::device_bml3bus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_bml3bus(nullptr),
- m_bml3bus_tag(nullptr), m_bml3bus_slottag(nullptr), m_slot(0), m_next(nullptr)
+device_bml3bus_card_interface::device_bml3bus_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bml3bus"),
+ m_bml3bus(nullptr),
+ m_slot(0)
{
}
@@ -199,18 +201,23 @@ device_bml3bus_card_interface::~device_bml3bus_card_interface()
{
}
-void device_bml3bus_card_interface::set_bml3bus_device()
+void device_bml3bus_card_interface::interface_pre_start()
{
- // extract the slot number from the last digit of the slot tag
- int tlen = strlen(m_bml3bus_slottag);
+ if (!m_bml3bus)
+ throw device_missing_dependencies();
+}
+
+void device_bml3bus_card_interface::set_bml3bus(bml3bus_device &bus, const char *slottag)
+{
+ assert(!m_bml3bus);
- m_slot = (m_bml3bus_slottag[tlen-1] - '1');
+ // extract the slot number from the last digit of the slot tag
+ int tlen = strlen(slottag);
+ m_slot = (slottag[tlen - 1] - '1');
if (m_slot < 0 || m_slot >= BML3BUS_MAX_SLOTS)
- {
- fatalerror("Slot %x out of range for Hitachi MB-6890 Bus\n", m_slot);
- }
+ fatalerror("Slot %d out of range for Hitachi MB-6890 Bus\n", m_slot);
- m_bml3bus = dynamic_cast<bml3bus_device *>(device().machine().device(m_bml3bus_tag));
- m_bml3bus->add_bml3bus_card(m_slot, this);
+ m_bml3bus = &bus;
+ m_bml3bus->add_bml3bus_card(m_slot, *this);
}
diff --git a/src/devices/bus/bml3/bml3bus.h b/src/devices/bus/bml3/bml3bus.h
index 2132d376041..6e17408aca3 100644
--- a/src/devices/bus/bml3/bml3bus.h
+++ b/src/devices/bus/bml3/bml3bus.h
@@ -22,46 +22,54 @@
//**************************************************************************
class bml3bus_device;
+class device_bml3bus_card_interface;
+
class bml3bus_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_bml3bus_card_interface>
{
public:
// construction/destruction
- template <typename T>
- bml3bus_slot_device(machine_config const &mconfig, const char *tag, device_t *owner, const char *nbtag, T &&opts, const char *dflt)
+ template <typename T, typename U>
+ bml3bus_slot_device(machine_config const &mconfig, const char *tag, device_t *owner, T &&nbtag, U &&opts, const char *dflt)
: bml3bus_slot_device(mconfig, tag, owner, (uint32_t)0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
- set_bml3bus_slot(nbtag, tag);
+ set_bml3bus_slot(std::forward<T>(nbtag), tag);
}
bml3bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- // device-level overrides
- virtual void device_start() override;
-
// inline configuration
- void set_bml3bus_slot(const char *tag, const char *slottag) { m_bml3bus_tag = tag; m_bml3bus_slottag = slottag; }
+ template <typename T>
+ void set_bml3bus_slot(T &&tag, const char *slottag)
+ {
+ m_bml3bus.set_tag(std::forward<T>(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);
+ // device-level overrides
+ virtual void device_start() override;
+
// configuration
- const char *m_bml3bus_tag, *m_bml3bus_slottag;
+ required_device<bml3bus_device> m_bml3bus;
+ const char *m_bml3bus_slottag;
};
// device type definition
DECLARE_DEVICE_TYPE(BML3BUS_SLOT, bml3bus_slot_device)
-class device_bml3bus_card_interface;
// ======================> bml3bus_device
class bml3bus_device : public device_t
{
+ friend class device_bml3bus_card_interface;
public:
// construction/destruction
bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -72,19 +80,12 @@ public:
auto irq_callback() { return m_out_irq_cb.bind(); }
auto firq_callback() { return m_out_firq_cb.bind(); }
- void add_bml3bus_card(int slot, device_bml3bus_card_interface *card);
device_bml3bus_card_interface *get_bml3bus_card(int slot);
- void set_nmi_line(int state);
- void set_irq_line(int state);
- void set_firq_line(int state);
-
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( firq_w );
- address_space &space() const { return *m_space; }
-
protected:
bml3bus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -92,6 +93,14 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
+ void add_bml3bus_card(int slot, device_bml3bus_card_interface &card);
+
+ address_space &space() const { return *m_space; }
+
+ void set_nmi_line(int state);
+ void set_irq_line(int state);
+ void set_firq_line(int state);
+
// internal state
required_address_space m_space;
@@ -109,16 +118,20 @@ DECLARE_DEVICE_TYPE(BML3BUS, bml3bus_device)
// ======================> device_bml3bus_card_interface
// class representing interface-specific live bml3bus card
-class device_bml3bus_card_interface : public device_slot_card_interface
+class device_bml3bus_card_interface : public device_interface
{
friend class bml3bus_device;
public:
// construction/destruction
virtual ~device_bml3bus_card_interface();
- device_bml3bus_card_interface *next() const { return m_next; }
+ // inline configuration
+ void set_bml3bus(bml3bus_device &bus, const char *slottag);
+
+protected:
+ virtual void interface_pre_start() override;
- void set_bml3bus_device();
+ address_space &space() { return m_bml3bus->space(); }
void raise_slot_nmi() { m_bml3bus->set_nmi_line(ASSERT_LINE); }
void lower_slot_nmi() { m_bml3bus->set_nmi_line(CLEAR_LINE); }
@@ -127,16 +140,11 @@ public:
void raise_slot_firq() { m_bml3bus->set_firq_line(ASSERT_LINE); }
void lower_slot_firq() { m_bml3bus->set_firq_line(CLEAR_LINE); }
- // inline configuration
- 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);
- bml3bus_device *m_bml3bus;
- const char *m_bml3bus_tag, *m_bml3bus_slottag;
+private:
+ bml3bus_device *m_bml3bus;
int m_slot;
- device_bml3bus_card_interface *m_next;
};
#endif // MAME_BUS_BML3_BML3BUS_H
diff --git a/src/devices/bus/bml3/bml3kanji.cpp b/src/devices/bus/bml3/bml3kanji.cpp
index ff1b3a9fae7..585cbd93069 100644
--- a/src/devices/bus/bml3/bml3kanji.cpp
+++ b/src/devices/bus/bml3/bml3kanji.cpp
@@ -72,13 +72,10 @@ bml3bus_kanji_device::bml3bus_kanji_device(const machine_config &mconfig, const
void bml3bus_kanji_device::device_start()
{
- // set_bml3bus_device makes m_slot valid
- set_bml3bus_device();
-
m_rom = memregion(KANJI_ROM_REGION)->base();
// install into memory
- address_space &space_prg = m_bml3bus->space();
+ address_space &space_prg = space();
space_prg.install_readwrite_handler(0xff75, 0xff76, read8_delegate(*this, FUNC(bml3bus_kanji_device::bml3_kanji_r)), write8_delegate(*this, FUNC(bml3bus_kanji_device::bml3_kanji_w)));
}
diff --git a/src/devices/bus/bml3/bml3mp1802.cpp b/src/devices/bus/bml3/bml3mp1802.cpp
index 76c96a43040..22c84884f68 100644
--- a/src/devices/bus/bml3/bml3mp1802.cpp
+++ b/src/devices/bus/bml3/bml3mp1802.cpp
@@ -32,8 +32,8 @@ WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w )
{
if (state)
{
- m_bml3bus->set_nmi_line(ASSERT_LINE);
- m_bml3bus->set_nmi_line(CLEAR_LINE);
+ raise_slot_nmi();
+ lower_slot_nmi();
}
}
@@ -63,8 +63,8 @@ void bml3bus_mp1802_device::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, m_floppy0, mp1802_floppies, "dd", floppy_image_device::default_floppy_formats);
FLOPPY_CONNECTOR(config, m_floppy1, mp1802_floppies, "dd", floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppy2, mp1802_floppies, "", floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppy3, mp1802_floppies, "", floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppy2, mp1802_floppies, nullptr, floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppy3, mp1802_floppies, nullptr, floppy_image_device::default_floppy_formats);
}
//-------------------------------------------------
@@ -125,13 +125,10 @@ bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, cons
void bml3bus_mp1802_device::device_start()
{
- // set_bml3bus_device makes m_slot valid
- set_bml3bus_device();
-
m_rom = memregion(MP1802_ROM_REGION)->base();
// install into memory
- address_space &space_prg = m_bml3bus->space();
+ address_space &space_prg = space();
space_prg.install_readwrite_handler(0xff00, 0xff03, read8sm_delegate(*m_fdc, FUNC(mb8866_device::read)), write8sm_delegate(*m_fdc, FUNC(mb8866_device::write)));
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(*this, FUNC(bml3bus_mp1802_device::bml3_mp1802_r)), write8_delegate(*this, FUNC(bml3bus_mp1802_device::bml3_mp1802_w)));
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
diff --git a/src/devices/bus/bml3/bml3mp1805.cpp b/src/devices/bus/bml3/bml3mp1805.cpp
index 1b3bfb1d6b1..f581b75d76e 100644
--- a/src/devices/bus/bml3/bml3mp1805.cpp
+++ b/src/devices/bus/bml3/bml3mp1805.cpp
@@ -34,8 +34,8 @@ WRITE_LINE_MEMBER( bml3bus_mp1805_device::bml3_mc6843_intrq_w )
{
if (state)
{
- m_bml3bus->set_nmi_line(ASSERT_LINE);
- m_bml3bus->set_nmi_line(CLEAR_LINE);
+ raise_slot_nmi();
+ lower_slot_nmi();
}
}
@@ -149,13 +149,10 @@ bml3bus_mp1805_device::bml3bus_mp1805_device(const machine_config &mconfig, cons
void bml3bus_mp1805_device::device_start()
{
- // set_bml3bus_device makes m_slot valid
- set_bml3bus_device();
-
m_rom = memregion(MP1805_ROM_REGION)->base();
// install into memory
- address_space &space_prg = m_bml3bus->space();
+ address_space &space_prg = space();
space_prg.install_readwrite_handler(0xff18, 0xff1f, read8_delegate(*m_mc6843, FUNC(mc6843_device::read)), write8_delegate(*m_mc6843, FUNC(mc6843_device::write)));
space_prg.install_readwrite_handler(0xff20, 0xff20, read8_delegate(*this, FUNC(bml3bus_mp1805_device::bml3_mp1805_r)), write8_delegate(*this, FUNC(bml3bus_mp1805_device::bml3_mp1805_w)));
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
diff --git a/src/devices/bus/bw2/exp.cpp b/src/devices/bus/bw2/exp.cpp
index 50f776b066e..030170d488c 100644
--- a/src/devices/bus/bw2/exp.cpp
+++ b/src/devices/bus/bw2/exp.cpp
@@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(BW2_EXPANSION_SLOT, bw2_expansion_slot_device, "bw2_expansion
// device_bw2_expansion_slot_interface - constructor
//-------------------------------------------------
-device_bw2_expansion_slot_interface::device_bw2_expansion_slot_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_bw2_expansion_slot_interface::device_bw2_expansion_slot_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "bw2exp")
{
m_slot = dynamic_cast<bw2_expansion_slot_device *>(device.owner());
}
@@ -54,7 +54,8 @@ device_bw2_expansion_slot_interface::~device_bw2_expansion_slot_interface()
bw2_expansion_slot_device::bw2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BW2_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+ device_single_card_slot_interface<device_bw2_expansion_slot_interface>(mconfig, *this),
+ m_cart(nullptr)
{
}
@@ -74,7 +75,7 @@ bw2_expansion_slot_device::~bw2_expansion_slot_device()
void bw2_expansion_slot_device::device_start()
{
- m_cart = dynamic_cast<device_bw2_expansion_slot_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/bw2/exp.h b/src/devices/bus/bw2/exp.h
index d37e5c66879..dfb5924351b 100644
--- a/src/devices/bus/bw2/exp.h
+++ b/src/devices/bus/bw2/exp.h
@@ -58,7 +58,7 @@
class device_bw2_expansion_slot_interface;
class bw2_expansion_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_bw2_expansion_slot_interface>
{
public:
// construction/destruction
@@ -97,7 +97,7 @@ protected:
// ======================> device_bw2_expansion_slot_interface
// class representing interface-specific live bw2_expansion card
-class device_bw2_expansion_slot_interface : public device_slot_card_interface
+class device_bw2_expansion_slot_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp
index 2a996728adf..3c5663db036 100644
--- a/src/devices/bus/c64/exp.cpp
+++ b/src/devices/bus/c64/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(C64_EXPANSION_SLOT, c64_expansion_slot_device, "c64_expansion
//-------------------------------------------------
device_c64_expansion_card_interface::device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "c64exp"),
m_roml(*this, "roml"),
m_romh(*this, "romh"),
m_romx(*this, "romx"),
@@ -60,7 +60,7 @@ device_c64_expansion_card_interface::~device_c64_expansion_card_interface()
c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C64_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_c64_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_read_dma_cd(*this),
m_write_dma_cd(*this),
@@ -73,27 +73,12 @@ c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconf
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void c64_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_c64_expansion_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_c64_expansion_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void c64_expansion_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_c64_expansion_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_c64_expansion_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_read_dma_cd.resolve_safe(0);
diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h
index 8a719688b4e..d75cebfa42e 100644
--- a/src/devices/bus/c64/exp.h
+++ b/src/devices/bus/c64/exp.h
@@ -50,7 +50,7 @@
class device_c64_expansion_card_interface;
class c64_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_c64_expansion_card_interface>,
public device_image_interface
{
public:
@@ -96,7 +96,6 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
virtual void device_reset() override;
@@ -133,7 +132,7 @@ protected:
// ======================> device_c64_expansion_card_interface
-class device_c64_expansion_card_interface : public device_slot_card_interface
+class device_c64_expansion_card_interface : public device_interface
{
friend class c64_expansion_slot_device;
diff --git a/src/devices/bus/c64/fcc.cpp b/src/devices/bus/c64/fcc.cpp
index dc1668c0eab..7960074d663 100644
--- a/src/devices/bus/c64/fcc.cpp
+++ b/src/devices/bus/c64/fcc.cpp
@@ -45,7 +45,7 @@ void c64_final_chesscard_device::device_add_mconfig(machine_config &config)
M65SC02(config, m_maincpu, 5_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &c64_final_chesscard_device::c64_fcc_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ //config.set_perfect_quantum(m_maincpu); FIXME: not safe in a slot device - add barriers
GENERIC_LATCH_8(config, m_mainlatch).data_pending_callback().set(FUNC(c64_final_chesscard_device::mainlatch_int));
GENERIC_LATCH_8(config, m_sublatch).data_pending_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
diff --git a/src/devices/bus/cbm2/exp.cpp b/src/devices/bus/cbm2/exp.cpp
index bcc2a654060..92c865006f7 100644
--- a/src/devices/bus/cbm2/exp.cpp
+++ b/src/devices/bus/cbm2/exp.cpp
@@ -35,11 +35,11 @@ DEFINE_DEVICE_TYPE(CBM2_EXPANSION_SLOT, cbm2_expansion_slot_device, "cbm2_expans
// device_cbm2_expansion_card_interface - constructor
//-------------------------------------------------
-device_cbm2_expansion_card_interface::device_cbm2_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_bank1(*this, "bank1"),
- m_bank2(*this, "bank2"),
- m_bank3(*this, "bank3")
+device_cbm2_expansion_card_interface::device_cbm2_expansion_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "cbm2exp"),
+ m_bank1(*this, "bank1"),
+ m_bank2(*this, "bank2"),
+ m_bank3(*this, "bank3")
{
m_slot = dynamic_cast<cbm2_expansion_slot_device *>(device.owner());
}
@@ -65,7 +65,7 @@ device_cbm2_expansion_card_interface::~device_cbm2_expansion_card_interface()
cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CBM2_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_cbm2_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_card(nullptr)
{
@@ -78,9 +78,10 @@ cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mco
void cbm2_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_cbm2_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
// inherit bus clock
+ // FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
if (clock() == 0)
{
cbm2_expansion_slot_device *root = machine().device<cbm2_expansion_slot_device>(CBM2_EXPANSION_SLOT_TAG);
@@ -91,15 +92,6 @@ void cbm2_expansion_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void cbm2_expansion_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// call_load -
//-------------------------------------------------
diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h
index 4d905225299..68bbbb8b00b 100644
--- a/src/devices/bus/cbm2/exp.h
+++ b/src/devices/bus/cbm2/exp.h
@@ -49,7 +49,7 @@
class device_cbm2_expansion_card_interface;
class cbm2_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_cbm2_expansion_card_interface>,
public device_image_interface
{
public:
@@ -75,7 +75,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// image-level overrides
virtual image_init_result call_load() override;
@@ -100,7 +99,7 @@ protected:
// ======================> device_cbm2_expansion_card_interface
-class device_cbm2_expansion_card_interface : public device_slot_card_interface
+class device_cbm2_expansion_card_interface : public device_interface
{
friend class cbm2_expansion_slot_device;
diff --git a/src/devices/bus/cbm2/user.cpp b/src/devices/bus/cbm2/user.cpp
index eefb9c4d591..5dc12567096 100644
--- a/src/devices/bus/cbm2/user.cpp
+++ b/src/devices/bus/cbm2/user.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(CBM2_USER_PORT, cbm2_user_port_device, "cbm2_user_port", "CBM
//-------------------------------------------------
device_cbm2_user_port_interface::device_cbm2_user_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig,device)
+ device_interface(device, "cbm2user")
{
m_slot = dynamic_cast<cbm2_user_port_device *>(device.owner());
}
@@ -45,11 +45,12 @@ device_cbm2_user_port_interface::device_cbm2_user_port_interface(const machine_c
cbm2_user_port_device::cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CBM2_USER_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_cbm2_user_port_interface>(mconfig, *this),
m_write_irq(*this),
m_write_sp(*this),
m_write_cnt(*this),
- m_write_flag(*this), m_card(nullptr)
+ m_write_flag(*this),
+ m_card(nullptr)
{
}
@@ -60,7 +61,7 @@ cbm2_user_port_device::cbm2_user_port_device(const machine_config &mconfig, cons
void cbm2_user_port_device::device_start()
{
- m_card = dynamic_cast<device_cbm2_user_port_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
diff --git a/src/devices/bus/cbm2/user.h b/src/devices/bus/cbm2/user.h
index 6bb6bba33c6..4a49807118d 100644
--- a/src/devices/bus/cbm2/user.h
+++ b/src/devices/bus/cbm2/user.h
@@ -39,7 +39,7 @@ class cbm2_user_port_device;
// ======================> device_cbm2_user_port_interface
// class representing interface-specific live cbm2_expansion card
-class device_cbm2_user_port_interface : public device_slot_card_interface
+class device_cbm2_user_port_interface : public device_interface
{
public:
virtual uint8_t cbm2_d1_r() { return 0xff; }
@@ -67,8 +67,7 @@ protected:
// ======================> cbm2_user_port_device
-class cbm2_user_port_device : public device_t,
- public device_slot_interface
+class cbm2_user_port_device : public device_t, public device_single_card_slot_interface<device_cbm2_user_port_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/cbmiec/c1541.cpp b/src/devices/bus/cbmiec/c1541.cpp
index af5d0e7f213..9b378aca0ab 100644
--- a/src/devices/bus/cbmiec/c1541.cpp
+++ b/src/devices/bus/cbmiec/c1541.cpp
@@ -962,7 +962,7 @@ void c1541_base_t::device_add_mconfig(machine_config &config)
{
M6502(config, m_maincpu, XTAL(16'000'000)/16);
m_maincpu->set_addrmap(AS_PROGRAM, &c1541_base_t::c1541_mem);
- config.m_perfect_cpu_quantum = subtag(M6502_TAG);
+ //config.set_perfect_quantum(m_maincpu); FIXME: not safe in a slot device - add barriers
VIA6522(config, m_via0, XTAL(16'000'000)/16);
m_via0->readpa_handler().set(FUNC(c1541_base_t::via0_pa_r));
diff --git a/src/devices/bus/cbmiec/c1571.cpp b/src/devices/bus/cbmiec/c1571.cpp
index 0b4112ffd3e..dc0bae13ed3 100644
--- a/src/devices/bus/cbmiec/c1571.cpp
+++ b/src/devices/bus/cbmiec/c1571.cpp
@@ -598,7 +598,7 @@ void c1571_device::add_base_mconfig(machine_config &config)
{
M6502(config, m_maincpu, 16_MHz_XTAL / 16);
m_maincpu->set_addrmap(AS_PROGRAM, &c1571_device::c1571_mem);
- config.m_perfect_cpu_quantum = subtag(M6502_TAG);
+ //config.set_perfect_quantum(m_maincpu); FIXME: not safe in a slot device - add barriers
VIA6522(config, m_via0, 16_MHz_XTAL / 16);
m_via0->readpa_handler().set(FUNC(c1571_device::via0_pa_r));
diff --git a/src/devices/bus/cbmiec/cbmiec.cpp b/src/devices/bus/cbmiec/cbmiec.cpp
index c9a04f863e2..1512397aa15 100644
--- a/src/devices/bus/cbmiec/cbmiec.cpp
+++ b/src/devices/bus/cbmiec/cbmiec.cpp
@@ -223,7 +223,7 @@ DEFINE_DEVICE_TYPE(CBM_IEC_SLOT, cbm_iec_slot_device, "cbm_iec_slot", "CBM IEC s
//-------------------------------------------------
device_cbm_iec_interface::device_cbm_iec_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device), m_next(nullptr), m_bus(nullptr), m_slot(nullptr)
+ : device_interface(device, "cbmiec"), m_next(nullptr), m_bus(nullptr), m_slot(nullptr)
{
}
diff --git a/src/devices/bus/cbmiec/cbmiec.h b/src/devices/bus/cbmiec/cbmiec.h
index ceb03d44948..fef583d3a6f 100644
--- a/src/devices/bus/cbmiec/cbmiec.h
+++ b/src/devices/bus/cbmiec/cbmiec.h
@@ -157,7 +157,7 @@ protected:
// ======================> device_cbm_iec_interface
-class device_cbm_iec_interface : public device_slot_card_interface
+class device_cbm_iec_interface : public device_interface
{
friend class cbm_iec_device;
diff --git a/src/devices/bus/centronics/ctronics.cpp b/src/devices/bus/centronics/ctronics.cpp
index 53d5ab7cb4a..1dda2343bc6 100644
--- a/src/devices/bus/centronics/ctronics.cpp
+++ b/src/devices/bus/centronics/ctronics.cpp
@@ -13,8 +13,8 @@
DEFINE_DEVICE_TYPE(CENTRONICS, centronics_device, "centronics", "Centronics")
-centronics_device::centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, CENTRONICS, tag, owner, clock),
+centronics_device::centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, CENTRONICS, tag, owner, clock),
device_slot_interface(mconfig, *this),
m_strobe_handler(*this),
m_data0_handler(*this),
@@ -116,7 +116,7 @@ WRITE_LINE_MEMBER( centronics_device::write_select_in ) { if (m_dev) m_dev->inpu
// class device_centronics_peripheral_interface
device_centronics_peripheral_interface::device_centronics_peripheral_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "centronics")
{
m_slot = dynamic_cast<centronics_device *>(device.owner());
}
diff --git a/src/devices/bus/centronics/ctronics.h b/src/devices/bus/centronics/ctronics.h
index 7189c465e98..aba15b34a4b 100644
--- a/src/devices/bus/centronics/ctronics.h
+++ b/src/devices/bus/centronics/ctronics.h
@@ -18,8 +18,7 @@ DECLARE_DEVICE_TYPE(CENTRONICS, centronics_device)
class device_centronics_peripheral_interface;
-class centronics_device : public device_t,
- public device_slot_interface
+class centronics_device : public device_t, public device_slot_interface
{
friend class device_centronics_peripheral_interface;
@@ -106,7 +105,7 @@ private:
};
-class device_centronics_peripheral_interface : public device_slot_card_interface
+class device_centronics_peripheral_interface : public device_interface
{
friend class centronics_device;
diff --git a/src/devices/bus/cgenie/expansion/expansion.cpp b/src/devices/bus/cgenie/expansion/expansion.cpp
index 3a7665f7c2b..d35d75401bd 100644
--- a/src/devices/bus/cgenie/expansion/expansion.cpp
+++ b/src/devices/bus/cgenie/expansion/expansion.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(CG_EXP_SLOT, cg_exp_slot_device, "cg_exp_slot", "Colour Genie
cg_exp_slot_device::cg_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CG_EXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_cg_exp_interface>(mconfig, *this),
m_program(*this, finder_base::DUMMY_TAG, -1),
m_io(*this, finder_base::DUMMY_TAG, -1),
m_cart(nullptr),
@@ -59,14 +59,6 @@ void cg_exp_slot_device::device_start()
m_reset_handler.resolve_safe();
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void cg_exp_slot_device::device_reset()
-{
-}
-
//**************************************************************************
// CARTRIDGE INTERFACE
@@ -77,7 +69,7 @@ void cg_exp_slot_device::device_reset()
//-------------------------------------------------
device_cg_exp_interface::device_cg_exp_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "cgenieexp")
{
m_slot = dynamic_cast<cg_exp_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/cgenie/expansion/expansion.h b/src/devices/bus/cgenie/expansion/expansion.h
index 3f61b275c19..5d128128fa8 100644
--- a/src/devices/bus/cgenie/expansion/expansion.h
+++ b/src/devices/bus/cgenie/expansion/expansion.h
@@ -49,7 +49,7 @@
class device_cg_exp_interface;
-class cg_exp_slot_device : public device_t, public device_slot_interface
+class cg_exp_slot_device : public device_t, public device_single_card_slot_interface<device_cg_exp_interface>
{
public:
// construction/destruction
@@ -83,7 +83,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
device_cg_exp_interface *m_cart;
@@ -94,7 +93,7 @@ private:
};
// class representing interface-specific live expansion device
-class device_cg_exp_interface : public device_slot_card_interface
+class device_cg_exp_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/cgenie/parallel/parallel.cpp b/src/devices/bus/cgenie/parallel/parallel.cpp
index a5072e094ee..27a5bba5a3a 100644
--- a/src/devices/bus/cgenie/parallel/parallel.cpp
+++ b/src/devices/bus/cgenie/parallel/parallel.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(CG_PARALLEL_SLOT, cg_parallel_slot_device, "cg_parallel_slot"
cg_parallel_slot_device::cg_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CG_PARALLEL_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_cg_parallel_interface>(mconfig, *this),
m_cart(nullptr)
{
}
@@ -48,15 +48,7 @@ cg_parallel_slot_device::~cg_parallel_slot_device()
void cg_parallel_slot_device::device_start()
{
- m_cart = dynamic_cast<device_cg_parallel_interface *>(get_card_device());
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void cg_parallel_slot_device::device_reset()
-{
+ m_cart = get_card_device();
}
@@ -102,7 +94,7 @@ WRITE8_MEMBER( cg_parallel_slot_device::pb_w )
//-------------------------------------------------
device_cg_parallel_interface::device_cg_parallel_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "cgeniepar")
{
m_slot = dynamic_cast<cg_parallel_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/cgenie/parallel/parallel.h b/src/devices/bus/cgenie/parallel/parallel.h
index b31f8c749f4..cf96a4faaef 100644
--- a/src/devices/bus/cgenie/parallel/parallel.h
+++ b/src/devices/bus/cgenie/parallel/parallel.h
@@ -33,7 +33,7 @@
class device_cg_parallel_interface;
-class cg_parallel_slot_device : public device_t, public device_slot_interface
+class cg_parallel_slot_device : public device_t, public device_single_card_slot_interface<device_cg_parallel_interface>
{
public:
// construction/destruction
@@ -59,13 +59,12 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
device_cg_parallel_interface *m_cart;
};
// class representing interface-specific live parallel device
-class device_cg_parallel_interface : public device_slot_card_interface
+class device_cg_parallel_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/chanf/slot.cpp b/src/devices/bus/chanf/slot.cpp
index d9e1a27d399..ae0b5f6096b 100644
--- a/src/devices/bus/chanf/slot.cpp
+++ b/src/devices/bus/chanf/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(CHANF_CART_SLOT, channelf_cart_slot_device, "chanf_cart_slot"
// device_channelf_cart_interface - constructor
//-------------------------------------------------
-device_channelf_cart_interface::device_channelf_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_channelf_cart_interface::device_channelf_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "chanfcart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -75,7 +75,7 @@ void device_channelf_cart_interface::ram_alloc(uint32_t size)
channelf_cart_slot_device::channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CHANF_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_channelf_cart_interface>(mconfig, *this),
m_type(CF_CHESS), m_cart(nullptr)
{
}
@@ -95,7 +95,7 @@ channelf_cart_slot_device::~channelf_cart_slot_device()
void channelf_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_channelf_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h
index d2f9654e8cd..810f326782b 100644
--- a/src/devices/bus/chanf/slot.h
+++ b/src/devices/bus/chanf/slot.h
@@ -25,7 +25,7 @@ enum
// ======================> device_channelf_cart_interface
-class device_channelf_cart_interface : public device_slot_card_interface
+class device_channelf_cart_interface : public device_interface
{
public:
// device_channelf_cart_interface/destruction
@@ -35,7 +35,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; }
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_ram) { }
- virtual DECLARE_WRITE8_MEMBER(write_bank) {}
+ virtual DECLARE_WRITE8_MEMBER(write_bank) { }
void rom_alloc(uint32_t size, const char *tag);
void ram_alloc(uint32_t size);
@@ -60,7 +60,7 @@ protected:
class channelf_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_channelf_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp
index 990cbde61c4..c97c770eea7 100644
--- a/src/devices/bus/coco/cococart.cpp
+++ b/src/devices/bus/coco/cococart.cpp
@@ -76,7 +76,7 @@ DEFINE_DEVICE_TYPE(COCOCART_SLOT, cococart_slot_device, "cococart_slot", "CoCo C
//-------------------------------------------------
cococart_slot_device::cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COCOCART_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_cococart_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_cart_callback(*this),
m_nmi_callback(*this),
@@ -123,7 +123,7 @@ void cococart_slot_device::device_start()
m_halt_callback.resolve();
m_halt_line.callback = &m_halt_callback;
- m_cart = dynamic_cast<device_cococart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
@@ -273,8 +273,8 @@ void cococart_slot_device::set_line_timer(coco_cartridge_line &line, cococart_sl
{
// calculate delay; delay dependant on cycles per second
attotime delay = (line.delay != 0)
- ? clocks_to_attotime(line.delay)
- : attotime::zero;
+ ? clocks_to_attotime(line.delay)
+ : attotime::zero;
line.timer[line.timer_index]->adjust(delay, (int) value);
line.timer_index = (line.timer_index + 1) % TIMER_POOL;
@@ -483,7 +483,7 @@ template class device_finder<device_cococart_interface, true>;
//-------------------------------------------------
device_cococart_interface::device_cococart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "cococart")
, m_owning_slot(nullptr)
, m_host(nullptr)
{
@@ -507,8 +507,8 @@ void device_cococart_interface::interface_config_complete()
{
m_owning_slot = dynamic_cast<cococart_slot_device *>(device().owner());
m_host = m_owning_slot
- ? dynamic_cast<device_cococart_host_interface *>(m_owning_slot->owner())
- : nullptr;
+ ? dynamic_cast<device_cococart_host_interface *>(m_owning_slot->owner())
+ : nullptr;
}
diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h
index bcee3d2990a..560f4c53ec6 100644
--- a/src/devices/bus/coco/cococart.h
+++ b/src/devices/bus/coco/cococart.h
@@ -30,7 +30,7 @@ typedef delegate<void (uint8_t *)> cococart_base_update_delegate;
class device_cococart_interface;
class cococart_slot_device final : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_cococart_interface>,
public device_image_interface
{
public:
@@ -159,7 +159,7 @@ public:
// ======================> device_cococart_interface
-class device_cococart_interface : public device_slot_card_interface
+class device_cococart_interface : public device_interface
{
public:
// construction/destruction
@@ -176,11 +176,10 @@ public:
void set_cart_base_update(cococart_base_update_delegate update);
virtual memory_region* get_cart_memregion();
-
+protected:
virtual void interface_config_complete() override;
virtual void interface_pre_start() override;
-protected:
device_cococart_interface(const machine_config &mconfig, device_t &device);
void cart_base_changed(void);
diff --git a/src/devices/bus/coco/dragon_fdc.cpp b/src/devices/bus/coco/dragon_fdc.cpp
index 48ab81501a5..a064d4e386f 100644
--- a/src/devices/bus/coco/dragon_fdc.cpp
+++ b/src/devices/bus/coco/dragon_fdc.cpp
@@ -155,8 +155,8 @@ void dragon_fdc_device_base::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, m_floppies[0], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, m_floppies[1], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, nullptr, dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, nullptr, dragon_fdc_device_base::floppy_formats).enable_sound(true);
}
@@ -166,8 +166,8 @@ void premier_fdc_device_base::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, m_floppies[0], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, m_floppies[1], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, nullptr, dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, nullptr, dragon_fdc_device_base::floppy_formats).enable_sound(true);
}
diff --git a/src/devices/bus/coleco/cartridge/exp.cpp b/src/devices/bus/coleco/cartridge/exp.cpp
index eaf3f144322..0cc3e3db90e 100644
--- a/src/devices/bus/coleco/cartridge/exp.cpp
+++ b/src/devices/bus/coleco/cartridge/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(COLECOVISION_CARTRIDGE_SLOT, colecovision_cartridge_slot_devi
//-------------------------------------------------
device_colecovision_cartridge_interface::device_colecovision_cartridge_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "colecocart"),
m_rom(nullptr),
m_rom_size(0)
{
@@ -55,7 +55,7 @@ void device_colecovision_cartridge_interface::rom_alloc(size_t size)
colecovision_cartridge_slot_device::colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COLECOVISION_CARTRIDGE_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_colecovision_cartridge_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_card(nullptr)
{
@@ -68,7 +68,7 @@ colecovision_cartridge_slot_device::colecovision_cartridge_slot_device(const mac
void colecovision_cartridge_slot_device::device_start()
{
- m_card = dynamic_cast<device_colecovision_cartridge_interface *>(get_card_device());
+ m_card = get_card_device();
}
diff --git a/src/devices/bus/coleco/cartridge/exp.h b/src/devices/bus/coleco/cartridge/exp.h
index 4da9d2d1d00..1634007414f 100644
--- a/src/devices/bus/coleco/cartridge/exp.h
+++ b/src/devices/bus/coleco/cartridge/exp.h
@@ -48,7 +48,7 @@
class device_colecovision_cartridge_interface;
class colecovision_cartridge_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_colecovision_cartridge_interface>,
public device_image_interface
{
public:
@@ -94,7 +94,7 @@ protected:
// ======================> device_colecovision_cartridge_interface
-class device_colecovision_cartridge_interface : public device_slot_card_interface
+class device_colecovision_cartridge_interface : public device_interface
{
friend class colecovision_cartridge_slot_device;
diff --git a/src/devices/bus/coleco/controller/ctrl.cpp b/src/devices/bus/coleco/controller/ctrl.cpp
index 330c7c71551..80b5968eb03 100644
--- a/src/devices/bus/coleco/controller/ctrl.cpp
+++ b/src/devices/bus/coleco/controller/ctrl.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(COLECOVISION_CONTROL_PORT, colecovision_control_port_device,
//-------------------------------------------------
device_colecovision_control_port_interface::device_colecovision_control_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "colecoctrl"),
m_common0(1),
m_common1(1)
{
@@ -47,7 +47,7 @@ device_colecovision_control_port_interface::device_colecovision_control_port_int
colecovision_control_port_device::colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COLECOVISION_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_colecovision_control_port_interface>(mconfig, *this),
m_device(nullptr),
m_write_irq(*this)
{
@@ -60,7 +60,7 @@ colecovision_control_port_device::colecovision_control_port_device(const machine
void colecovision_control_port_device::device_start()
{
- m_device = dynamic_cast<device_colecovision_control_port_interface *>(get_card_device());
+ m_device = get_card_device();
m_write_irq.resolve_safe();
}
diff --git a/src/devices/bus/coleco/controller/ctrl.h b/src/devices/bus/coleco/controller/ctrl.h
index 3460dec0b7d..fd79acaed46 100644
--- a/src/devices/bus/coleco/controller/ctrl.h
+++ b/src/devices/bus/coleco/controller/ctrl.h
@@ -23,7 +23,7 @@ class colecovision_control_port_device;
// ======================> device_colecovision_control_port_interface
-class device_colecovision_control_port_interface : public device_slot_card_interface
+class device_colecovision_control_port_interface : public device_interface
{
public:
virtual uint8_t joy_r() { return 0xff; }
@@ -44,7 +44,7 @@ protected:
// ======================> colecovision_control_port_device
class colecovision_control_port_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_colecovision_control_port_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/compis/graphics.cpp b/src/devices/bus/compis/graphics.cpp
index ec8db616003..ad9291dee65 100644
--- a/src/devices/bus/compis/graphics.cpp
+++ b/src/devices/bus/compis/graphics.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(COMPIS_GRAPHICS_SLOT, compis_graphics_slot_device, "compisgfx
//-------------------------------------------------
device_compis_graphics_card_interface::device_compis_graphics_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "compisgfx")
{
m_slot = dynamic_cast<compis_graphics_slot_device *>(device.owner());
}
@@ -40,7 +40,7 @@ device_compis_graphics_card_interface::device_compis_graphics_card_interface(con
compis_graphics_slot_device::compis_graphics_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COMPIS_GRAPHICS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_compis_graphics_card_interface>(mconfig, *this),
m_write_dma_request(*this),
m_card(nullptr)
{
@@ -53,7 +53,7 @@ compis_graphics_slot_device::compis_graphics_slot_device(const machine_config &m
void compis_graphics_slot_device::device_start()
{
- m_card = dynamic_cast<device_compis_graphics_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_dma_request.resolve_safe();
diff --git a/src/devices/bus/compis/graphics.h b/src/devices/bus/compis/graphics.h
index 0f3f2b104b1..3f0c8e41cb9 100644
--- a/src/devices/bus/compis/graphics.h
+++ b/src/devices/bus/compis/graphics.h
@@ -21,7 +21,7 @@
class compis_graphics_slot_device;
-class device_compis_graphics_card_interface : public device_slot_card_interface
+class device_compis_graphics_card_interface : public device_interface
{
public:
virtual uint8_t mcs0_r(offs_t offset) { return 0xff; }
@@ -45,8 +45,7 @@ protected:
// ======================> compis_graphics_slot_device
-class compis_graphics_slot_device : public device_t,
- public device_slot_interface
+class compis_graphics_slot_device : public device_t, public device_single_card_slot_interface<device_compis_graphics_card_interface>
{
public:
// construction/destruction
@@ -81,7 +80,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override { if (m_card) get_card_device()->reset(); }
devcb_write_line m_write_dma_request;
diff --git a/src/devices/bus/comx35/exp.cpp b/src/devices/bus/comx35/exp.cpp
index 75036fb6ea8..6931eecfda0 100644
--- a/src/devices/bus/comx35/exp.cpp
+++ b/src/devices/bus/comx35/exp.cpp
@@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE(COMX_EXPANSION_SLOT, comx_expansion_slot_device, "comx_expans
//-------------------------------------------------
device_comx_expansion_card_interface::device_comx_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "comxexp"),
m_ds(1)
{
m_slot = dynamic_cast<comx_expansion_slot_device *>(device.owner());
@@ -45,7 +45,7 @@ device_comx_expansion_card_interface::device_comx_expansion_card_interface(const
comx_expansion_slot_device::comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COMX_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_comx_expansion_card_interface>(mconfig, *this),
m_write_irq(*this), m_card(nullptr)
{
}
@@ -57,7 +57,7 @@ comx_expansion_slot_device::comx_expansion_slot_device(const machine_config &mco
void comx_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_comx_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
diff --git a/src/devices/bus/comx35/exp.h b/src/devices/bus/comx35/exp.h
index 1facb388037..75ff26f77ce 100644
--- a/src/devices/bus/comx35/exp.h
+++ b/src/devices/bus/comx35/exp.h
@@ -42,8 +42,7 @@
class device_comx_expansion_card_interface;
-class comx_expansion_slot_device : public device_t,
- public device_slot_interface
+class comx_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_comx_expansion_card_interface>
{
public:
// construction/destruction
@@ -90,7 +89,7 @@ protected:
// ======================> device_comx_expansion_card_interface
// class representing interface-specific live comx_expansion card
-class device_comx_expansion_card_interface : public device_slot_card_interface
+class device_comx_expansion_card_interface : public device_interface
{
friend class comx_expansion_slot_device;
diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp
index 3f9f04e89ea..c9093884661 100644
--- a/src/devices/bus/cpc/cpcexp.cpp
+++ b/src/devices/bus/cpc/cpcexp.cpp
@@ -25,7 +25,7 @@ DEFINE_DEVICE_TYPE(CPC_EXPANSION_SLOT, cpc_expansion_slot_device, "cpc_expansion
device_cpc_expansion_card_interface::device_cpc_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+ : device_interface(device, "cpcexp")
, m_rom_sel(0)
{
}
@@ -43,7 +43,7 @@ device_cpc_expansion_card_interface::~device_cpc_expansion_card_interface()
cpc_expansion_slot_device::cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, CPC_EXPANSION_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_cpc_expansion_card_interface>(mconfig, *this)
, m_cpu(*this, finder_base::DUMMY_TAG)
, m_out_irq_cb(*this)
, m_out_nmi_cb(*this)
@@ -64,7 +64,7 @@ cpc_expansion_slot_device::~cpc_expansion_slot_device()
void cpc_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_cpc_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_out_irq_cb.resolve_safe();
@@ -83,22 +83,14 @@ void cpc_expansion_slot_device::device_start()
void cpc_expansion_slot_device::device_config_complete()
{
// for passthrough connectors, use the parent slot's CPU tag
- if ((m_cpu.finder_tag() == finder_base::DUMMY_TAG) && (dynamic_cast<device_cpc_expansion_card_interface *>(owner()) != nullptr))
+ if ((m_cpu.finder_tag() == finder_base::DUMMY_TAG) && dynamic_cast<device_cpc_expansion_card_interface *>(owner()))
{
- auto parent = dynamic_cast<cpc_expansion_slot_device *>(owner()->owner());
- if (parent != nullptr)
+ auto const parent = dynamic_cast<cpc_expansion_slot_device *>(owner()->owner());
+ if (parent)
m_cpu.set_tag(parent->m_cpu);
}
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void cpc_expansion_slot_device::device_reset()
-{
-}
-
WRITE_LINE_MEMBER( cpc_expansion_slot_device::irq_w ) { m_out_irq_cb(state); }
WRITE_LINE_MEMBER( cpc_expansion_slot_device::nmi_w ) { m_out_nmi_cb(state); }
diff --git a/src/devices/bus/cpc/cpcexp.h b/src/devices/bus/cpc/cpcexp.h
index 51796dc7edd..78deae19827 100644
--- a/src/devices/bus/cpc/cpcexp.h
+++ b/src/devices/bus/cpc/cpcexp.h
@@ -56,7 +56,7 @@
// ======================> device_cpc_expansion_card_interface
// class representing interface-specific live cpc_expansion card
-class device_cpc_expansion_card_interface : public device_slot_card_interface
+class device_cpc_expansion_card_interface : public device_interface
{
public:
enum
@@ -88,8 +88,7 @@ private:
// ======================> cpc_expansion_slot_device
-class cpc_expansion_slot_device : public device_t,
- public device_slot_interface
+class cpc_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_cpc_expansion_card_interface>
{
public:
// construction/destruction
@@ -130,7 +129,6 @@ protected:
// device-level overrides
virtual void device_config_complete() override;
virtual void device_start() override;
- virtual void device_reset() override;
required_device<cpu_device> m_cpu;
diff --git a/src/devices/bus/crvision/slot.cpp b/src/devices/bus/crvision/slot.cpp
index a0398840f00..068e5b056ab 100644
--- a/src/devices/bus/crvision/slot.cpp
+++ b/src/devices/bus/crvision/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(CRVISION_CART_SLOT, crvision_cart_slot_device, "crvision_cart
// device_crvision_cart_interface - constructor
//-------------------------------------------------
-device_crvision_cart_interface::device_crvision_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_crvision_cart_interface::device_crvision_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "crvisioncart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -65,7 +65,7 @@ void device_crvision_cart_interface::rom_alloc(uint32_t size, const char *tag)
crvision_cart_slot_device::crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CRVISION_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_crvision_cart_interface>(mconfig, *this),
m_type(CRV_4K), m_cart(nullptr)
{
}
@@ -85,7 +85,7 @@ crvision_cart_slot_device::~crvision_cart_slot_device()
void crvision_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_crvision_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h
index 0dff9f8636f..1f0452e9625 100644
--- a/src/devices/bus/crvision/slot.h
+++ b/src/devices/bus/crvision/slot.h
@@ -29,7 +29,7 @@ enum
// ======================> device_crvision_cart_interface
-class device_crvision_cart_interface : public device_slot_card_interface
+class device_crvision_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -56,7 +56,7 @@ protected:
class crvision_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_crvision_cart_interface>
{
public:
// construction/destruction
@@ -72,9 +72,6 @@ public:
crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~crvision_cart_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override {}
@@ -99,6 +96,8 @@ public:
virtual DECLARE_READ8_MEMBER(read_rom80);
protected:
+ // device-level overrides
+ virtual void device_start() override;
int m_type;
device_crvision_cart_interface* m_cart;
diff --git a/src/devices/bus/dmv/dmvbus.cpp b/src/devices/bus/dmv/dmvbus.cpp
index ff003cda7d1..3b828de41a1 100644
--- a/src/devices/bus/dmv/dmvbus.cpp
+++ b/src/devices/bus/dmv/dmvbus.cpp
@@ -173,8 +173,9 @@ DEFINE_DEVICE_TYPE(DMVCART_SLOT, dmvcart_slot_device, "dmvcart_slot", "Decision
// device_dmvslot_interface - constructor
//-------------------------------------------------
-device_dmvslot_interface::device_dmvslot_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_dmvslot_interface::device_dmvslot_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "dmvbus"),
+ m_bus(dynamic_cast<dmvcart_slot_device *>(device.owner()))
{
}
@@ -197,7 +198,7 @@ device_dmvslot_interface::~device_dmvslot_interface()
//-------------------------------------------------
dmvcart_slot_device::dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, DMVCART_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_dmvslot_interface>(mconfig, *this),
m_prog_read_cb(*this),
m_prog_write_cb(*this),
m_out_int_cb(*this),
@@ -224,7 +225,7 @@ dmvcart_slot_device::~dmvcart_slot_device()
void dmvcart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_dmvslot_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_prog_read_cb.resolve_safe(0);
diff --git a/src/devices/bus/dmv/dmvbus.h b/src/devices/bus/dmv/dmvbus.h
index b6a41c5b852..24c55fdb512 100644
--- a/src/devices/bus/dmv/dmvbus.h
+++ b/src/devices/bus/dmv/dmvbus.h
@@ -16,47 +16,13 @@
TYPE DEFINITIONS
***************************************************************************/
-// ======================> device_dmvslot_interface
-
-class device_dmvslot_interface : public device_slot_card_interface
-{
-public:
- // construction/destruction
- virtual ~device_dmvslot_interface();
-
- virtual bool read(offs_t offset, uint8_t &data) { return false; }
- virtual bool write(offs_t offset, uint8_t data) { return false; }
- virtual void io_read(int ifsel, offs_t offset, uint8_t &data) { }
- virtual void io_write(int ifsel, offs_t offset, uint8_t data) { }
-
- // slot 1
- virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data) { }
- virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data) { }
-
- // slot 7 and 7A
- virtual bool av16bit() { return false; }
- virtual void hold_w(int state) { }
- virtual void switch16_w(int state) { }
- virtual void timint_w(int state) { }
- virtual void keyint_w(int state) { }
- virtual void busint_w(int state) { }
- virtual void flexint_w(int state) { }
- virtual void irq2_w(int state) { }
- virtual void irq2a_w(int state) { }
- virtual void irq3_w(int state) { }
- virtual void irq4_w(int state) { }
- virtual void irq5_w(int state) { }
- virtual void irq6_w(int state) { }
-
-protected:
- device_dmvslot_interface(const machine_config &mconfig, device_t &device);
-};
+class device_dmvslot_interface;
// ======================> dmvcart_slot_device
class dmvcart_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_dmvslot_interface>
{
public:
// construction/destruction
@@ -80,30 +46,31 @@ public:
template <typename T> void set_memspace(T &&tag, int spacenum) { m_memspace.set_tag(std::forward<T>(tag), spacenum); }
template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
+ // reading and writing
+ bool read(offs_t offset, uint8_t &data);
+ bool write(offs_t offset, uint8_t data);
+ void ram_read(uint8_t cas, offs_t offset, uint8_t &data);
+ void ram_write(uint8_t cas, offs_t offset, uint8_t data);
+ void io_read(int ifsel, offs_t offset, uint8_t &data);
+ void io_write(int ifsel, offs_t offset, uint8_t data);
+ void hold_w(int state);
+ void switch16_w(int state);
+ void timint_w(int state);
+ void keyint_w(int state);
+ void busint_w(int state);
+ void flexint_w(int state);
+ void irq2_w(int state);
+ void irq2a_w(int state);
+ void irq3_w(int state);
+ void irq4_w(int state);
+ void irq5_w(int state);
+ void irq6_w(int state);
+ bool av16bit();
+
+protected:
// device-level overrides
virtual void device_start() override;
- // reading and writing
- virtual bool read(offs_t offset, uint8_t &data);
- virtual bool write(offs_t offset, uint8_t data);
- virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data);
- virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data);
- virtual void io_read(int ifsel, offs_t offset, uint8_t &data);
- virtual void io_write(int ifsel, offs_t offset, uint8_t data);
- virtual void hold_w(int state);
- virtual void switch16_w(int state);
- virtual void timint_w(int state);
- virtual void keyint_w(int state);
- virtual void busint_w(int state);
- virtual void flexint_w(int state);
- virtual void irq2_w(int state);
- virtual void irq2a_w(int state);
- virtual void irq3_w(int state);
- virtual void irq4_w(int state);
- virtual void irq5_w(int state);
- virtual void irq6_w(int state);
- virtual bool av16bit();
-
// internal state
devcb_read8 m_prog_read_cb;
devcb_write8 m_prog_write_cb;
@@ -115,6 +82,58 @@ public:
required_address_space m_iospace;
device_dmvslot_interface* m_cart;
+
+ friend class device_dmvslot_interface;
+};
+
+
+// ======================> device_dmvslot_interface
+
+class device_dmvslot_interface : public device_interface
+{
+public:
+ // construction/destruction
+ virtual ~device_dmvslot_interface();
+
+ virtual bool read(offs_t offset, uint8_t &data) { return false; }
+ virtual bool write(offs_t offset, uint8_t data) { return false; }
+ virtual void io_read(int ifsel, offs_t offset, uint8_t &data) { }
+ virtual void io_write(int ifsel, offs_t offset, uint8_t data) { }
+
+ // slot 1
+ virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data) { }
+ virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data) { }
+
+ // slot 7 and 7A
+ virtual bool av16bit() { return false; }
+ virtual void hold_w(int state) { }
+ virtual void switch16_w(int state) { }
+ virtual void timint_w(int state) { }
+ virtual void keyint_w(int state) { }
+ virtual void busint_w(int state) { }
+ virtual void flexint_w(int state) { }
+ virtual void irq2_w(int state) { }
+ virtual void irq2a_w(int state) { }
+ virtual void irq3_w(int state) { }
+ virtual void irq4_w(int state) { }
+ virtual void irq5_w(int state) { }
+ virtual void irq6_w(int state) { }
+
+protected:
+ device_dmvslot_interface(const machine_config &mconfig, device_t &device);
+
+ address_space &memspace() { return *m_bus->m_memspace; }
+ address_space &iospace() { return *m_bus->m_iospace; }
+
+ template <typename... T> uint8_t prog_read(T &&... args) { return m_bus->m_prog_read_cb(std::forward<T>(args)...); }
+ template <typename... T> void prog_write(T &&... args) { m_bus->m_prog_write_cb(std::forward<T>(args)...); }
+
+ void out_int(int state) { m_bus->m_out_int_cb(state); }
+ void out_irq(int state) { m_bus->m_out_irq_cb(state); }
+ void out_thold(int state) { m_bus->m_out_thold_cb(state); }
+
+private:
+ dmvcart_slot_device *m_bus;
};
diff --git a/src/devices/bus/dmv/k012.cpp b/src/devices/bus/dmv/k012.cpp
index 9b2e9e220f9..71c4f4aa402 100644
--- a/src/devices/bus/dmv/k012.cpp
+++ b/src/devices/bus/dmv/k012.cpp
@@ -49,7 +49,6 @@ dmv_k012_device::dmv_k012_device(const machine_config &mconfig, device_type type
: device_t(mconfig, type, tag, owner, clock)
, device_dmvslot_interface( mconfig, *this )
, m_hdc(*this, "hdc")
- , m_bus(*this, DEVICE_SELF_OWNER)
, m_jumpers(*this, "JUMPERS")
{
}
@@ -95,7 +94,7 @@ ioport_constructor dmv_k012_device::device_input_ports() const
void dmv_k012_device::device_add_mconfig(machine_config &config)
{
WD1000(config, m_hdc, 20_MHz_XTAL / 4); // WD1010
- m_hdc->intrq_wr_callback().set(FUNC(dmv_k012_device::hdc_intrq_w));
+ m_hdc->intrq_wr_callback().set(FUNC(dmv_k012_device::out_int));
// default drive is 10MB (306,4,17)
HARDDISK(config, "hdc:0", 0);
@@ -115,8 +114,3 @@ void dmv_k012_device::io_write(int ifsel, offs_t offset, uint8_t data)
if ((1 << ifsel) == m_jumpers->read() && !(offset & 0x08))
m_hdc->write(machine().dummy_space(), offset, data);
}
-
-WRITE_LINE_MEMBER(dmv_k012_device::hdc_intrq_w)
-{
- m_bus->m_out_irq_cb(state);
-}
diff --git a/src/devices/bus/dmv/k012.h b/src/devices/bus/dmv/k012.h
index 9eac3e5a79f..b450b5f125b 100644
--- a/src/devices/bus/dmv/k012.h
+++ b/src/devices/bus/dmv/k012.h
@@ -42,7 +42,6 @@ protected:
private:
required_device<wd1000_device> m_hdc;
- required_device<dmvcart_slot_device> m_bus;
required_ioport m_jumpers;
};
diff --git a/src/devices/bus/dmv/k210.cpp b/src/devices/bus/dmv/k210.cpp
index f7f9dcc5aaf..23a5da77a53 100644
--- a/src/devices/bus/dmv/k210.cpp
+++ b/src/devices/bus/dmv/k210.cpp
@@ -36,7 +36,7 @@ dmv_k210_device::dmv_k210_device(const machine_config &mconfig, const char *tag,
, m_centronics(*this, "centronics")
, m_cent_data_in(*this, "cent_data_in")
, m_cent_data_out(*this, "cent_data_out")
- , m_bus(nullptr), m_clk1_timer(nullptr), m_portb(0), m_portc(0)
+ , m_clk1_timer(nullptr), m_portb(0), m_portc(0)
{
}
@@ -47,7 +47,6 @@ dmv_k210_device::dmv_k210_device(const machine_config &mconfig, const char *tag,
void dmv_k210_device::device_start()
{
m_clk1_timer = timer_alloc(0, nullptr);
- m_bus = static_cast<dmvcart_slot_device*>(owner());
// register for state saving
save_item(NAME(m_portb));
@@ -156,7 +155,7 @@ WRITE8_MEMBER( dmv_k210_device::portc_w )
m_centronics->write_init(!BIT(data, 1));
m_centronics->write_autofd(!BIT(data, 2));
m_centronics->write_ack(BIT(data, 6));
- m_bus->m_out_irq_cb(BIT(data, 3));
+ out_irq(BIT(data, 3));
}
WRITE_LINE_MEMBER( dmv_k210_device::cent_ack_w ) { if (state) m_portb |= 0x04; else m_portb &= ~0x04; m_ppi->pc6_w(state); }
diff --git a/src/devices/bus/dmv/k220.cpp b/src/devices/bus/dmv/k220.cpp
index 9251d453e57..d157130ce8e 100644
--- a/src/devices/bus/dmv/k220.cpp
+++ b/src/devices/bus/dmv/k220.cpp
@@ -123,7 +123,6 @@ DEFINE_DEVICE_TYPE(DMV_K220, dmv_k220_device, "dmv_k220", "K220 diagnostic")
dmv_k220_device::dmv_k220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, DMV_K220, tag, owner, clock)
, device_dmvslot_interface(mconfig, *this)
- , m_bus(*this, DEVICE_SELF_OWNER)
, m_pit(*this, "pit8253")
, m_ppi(*this, "ppi8255")
, m_ram(*this, "ram")
@@ -139,7 +138,7 @@ dmv_k220_device::dmv_k220_device(const machine_config &mconfig, const char *tag,
void dmv_k220_device::device_start()
{
- address_space &space = *m_bus->m_iospace;
+ address_space &space = iospace();
space.install_readwrite_handler(0x08, 0x0b, read8sm_delegate(*m_pit, FUNC(pit8253_device::read)), write8sm_delegate(*m_pit, FUNC(pit8253_device::write)), 0);
space.install_readwrite_handler(0x0c, 0x0f, read8sm_delegate(*m_ppi, FUNC(i8255_device::read)), write8sm_delegate(*m_ppi, FUNC(i8255_device::write)), 0);
@@ -157,6 +156,8 @@ void dmv_k220_device::device_start()
void dmv_k220_device::device_reset()
{
// active the correct layout
+ // FIXME: this is a very bad idea - you have no idea what view the user has loaded externally or from other devices,
+ // and it won't allow selected view to be saved/restored correctly
machine().render().first_target()->set_view(1);
}
diff --git a/src/devices/bus/dmv/k220.h b/src/devices/bus/dmv/k220.h
index 08f88e0d6e9..21b23a4981a 100644
--- a/src/devices/bus/dmv/k220.h
+++ b/src/devices/bus/dmv/k220.h
@@ -45,7 +45,6 @@ private:
DECLARE_WRITE_LINE_MEMBER(write_out1);
DECLARE_WRITE_LINE_MEMBER(write_out2);
- required_device<dmvcart_slot_device> m_bus;
required_device<pit8253_device> m_pit;
required_device<i8255_device> m_ppi;
required_memory_region m_ram;
diff --git a/src/devices/bus/dmv/k230.cpp b/src/devices/bus/dmv/k230.cpp
index 8c1d6e43ac3..b661ed95abf 100644
--- a/src/devices/bus/dmv/k230.cpp
+++ b/src/devices/bus/dmv/k230.cpp
@@ -100,7 +100,6 @@ dmv_k230_device::dmv_k230_device(const machine_config &mconfig, device_type type
, device_dmvslot_interface(mconfig, *this)
, m_maincpu(*this, "maincpu")
, m_rom(*this, "rom")
- , m_bus(*this, DEVICE_SELF_OWNER)
, m_switch16(0)
, m_hold(0)
{
@@ -148,7 +147,7 @@ void dmv_k230_device::device_start()
void dmv_k234_device::device_start()
{
dmv_k230_device::device_start();
- m_bus->m_iospace->install_readwrite_handler(0xd8, 0xdf, read8_delegate(*this, FUNC(dmv_k234_device::snr_r)), write8_delegate(*this, FUNC(dmv_k234_device::snr_w)), 0);
+ iospace().install_readwrite_handler(0xd8, 0xdf, read8_delegate(*this, FUNC(dmv_k234_device::snr_r)), write8_delegate(*this, FUNC(dmv_k234_device::snr_w)), 0);
// register for state saving
save_item(NAME(m_snr));
@@ -255,22 +254,22 @@ READ8_MEMBER(dmv_k230_device::rom_r)
READ8_MEMBER( dmv_k230_device::io_r )
{
- return m_bus->m_iospace->read_byte(offset);
+ return iospace().read_byte(offset);
}
WRITE8_MEMBER( dmv_k230_device::io_w )
{
- m_bus->m_iospace->write_byte(offset, data);
+ iospace().write_byte(offset, data);
}
READ8_MEMBER( dmv_k230_device::program_r )
{
- return m_bus->m_prog_read_cb(space, offset);
+ return prog_read(space, offset);
}
WRITE8_MEMBER( dmv_k230_device::program_w )
{
- m_bus->m_prog_write_cb(space, offset, data);
+ prog_write(space, offset, data);
}
void dmv_k234_device::hold_w(int state)
@@ -285,7 +284,7 @@ void dmv_k234_device::switch16_w(int state)
{
m_snr = CLEAR_LINE;
m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
- m_bus->m_out_thold_cb(CLEAR_LINE);
+ out_thold(CLEAR_LINE);
m_switch16 = state;
}
}
@@ -295,7 +294,7 @@ READ8_MEMBER( dmv_k234_device::snr_r )
m_snr = ASSERT_LINE;
m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_maincpu->reset();
- m_bus->m_out_thold_cb(ASSERT_LINE);
+ out_thold(ASSERT_LINE);
return 0xff;
}
@@ -305,5 +304,5 @@ WRITE8_MEMBER( dmv_k234_device::snr_w )
m_snr = ASSERT_LINE;
m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_maincpu->reset();
- m_bus->m_out_thold_cb(ASSERT_LINE);
+ out_thold(ASSERT_LINE);
}
diff --git a/src/devices/bus/dmv/k230.h b/src/devices/bus/dmv/k230.h
index 3b9cfbce674..ebf8a868ae3 100644
--- a/src/devices/bus/dmv/k230.h
+++ b/src/devices/bus/dmv/k230.h
@@ -52,7 +52,6 @@ protected:
required_device<cpu_device> m_maincpu;
optional_memory_region m_rom;
- required_device<dmvcart_slot_device> m_bus;
int m_switch16;
int m_hold;
diff --git a/src/devices/bus/dmv/k801.cpp b/src/devices/bus/dmv/k801.cpp
index a05d1fe1d02..2e632ca5c95 100644
--- a/src/devices/bus/dmv/k801.cpp
+++ b/src/devices/bus/dmv/k801.cpp
@@ -86,7 +86,7 @@ dmv_k801_device::dmv_k801_device(const machine_config &mconfig, device_type type
device_dmvslot_interface( mconfig, *this ),
m_epci(*this, "epci"),
m_rs232(*this, "rs232"),
- m_dsw(*this, "DSW"), m_bus(nullptr)
+ m_dsw(*this, "DSW")
{
}
@@ -129,7 +129,6 @@ dmv_k213_device::dmv_k213_device(const machine_config &mconfig, const char *tag,
void dmv_k801_device::device_start()
{
- m_bus = static_cast<dmvcart_slot_device*>(owner());
}
//-------------------------------------------------
@@ -204,7 +203,7 @@ ioport_constructor dmv_k213_device::device_input_ports() const
WRITE_LINE_MEMBER(dmv_k801_device::epci_irq_w)
{
- m_bus->m_out_irq_cb(state);
+ out_irq(state);
}
void dmv_k801_device::io_read(int ifsel, offs_t offset, uint8_t &data)
diff --git a/src/devices/bus/dmv/k801.h b/src/devices/bus/dmv/k801.h
index d5a99380b17..13fe57ddd38 100644
--- a/src/devices/bus/dmv/k801.h
+++ b/src/devices/bus/dmv/k801.h
@@ -46,8 +46,6 @@ protected:
private:
DECLARE_WRITE_LINE_MEMBER(epci_irq_w);
-
- dmvcart_slot_device * m_bus;
};
diff --git a/src/devices/bus/dmv/k803.cpp b/src/devices/bus/dmv/k803.cpp
index 88918644a3a..d2a72f22441 100644
--- a/src/devices/bus/dmv/k803.cpp
+++ b/src/devices/bus/dmv/k803.cpp
@@ -45,11 +45,12 @@ DEFINE_DEVICE_TYPE(DMV_K803, dmv_k803_device, "dmv_k803", "K803 RTC")
// dmv_k803_device - constructor
//-------------------------------------------------
-dmv_k803_device::dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, DMV_K803, tag, owner, clock),
+dmv_k803_device::dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, DMV_K803, tag, owner, clock),
device_dmvslot_interface( mconfig, *this ),
m_rtc(*this, "rtc"),
- m_dsw(*this, "DSW"), m_bus(nullptr), m_latch(0), m_rtc_int(0)
+ m_dsw(*this, "DSW"),
+ m_latch(0), m_rtc_int(0)
{
}
@@ -59,8 +60,6 @@ dmv_k803_device::dmv_k803_device(const machine_config &mconfig, const char *tag,
void dmv_k803_device::device_start()
{
- m_bus = static_cast<dmvcart_slot_device*>(owner());
-
// register for state saving
save_item(NAME(m_latch));
save_item(NAME(m_rtc_int));
@@ -129,5 +128,5 @@ WRITE_LINE_MEMBER(dmv_k803_device::rtc_irq_w)
void dmv_k803_device::update_int()
{
bool state = ((m_latch & 0x80) && m_rtc_int);
- m_bus->m_out_int_cb(state ? ASSERT_LINE : CLEAR_LINE);
+ out_int(state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/devices/bus/dmv/k803.h b/src/devices/bus/dmv/k803.h
index 7f1693e9f71..60a8cd91ced 100644
--- a/src/devices/bus/dmv/k803.h
+++ b/src/devices/bus/dmv/k803.h
@@ -42,7 +42,6 @@ private:
required_device<mm58167_device> m_rtc;
required_ioport m_dsw;
- dmvcart_slot_device * m_bus;
uint8_t m_latch;
int m_rtc_int;
};
diff --git a/src/devices/bus/dmv/k806.cpp b/src/devices/bus/dmv/k806.cpp
index 87a0002c091..959e1468990 100644
--- a/src/devices/bus/dmv/k806.cpp
+++ b/src/devices/bus/dmv/k806.cpp
@@ -71,7 +71,6 @@ dmv_k806_device::dmv_k806_device(const machine_config &mconfig, const char *tag,
, m_mouse_buttons(*this, "MOUSE")
, m_mouse_x(*this, "MOUSEX")
, m_mouse_y(*this, "MOUSEY")
- , m_bus(nullptr)
{
}
@@ -81,8 +80,6 @@ dmv_k806_device::dmv_k806_device(const machine_config &mconfig, const char *tag,
void dmv_k806_device::device_start()
{
- m_bus = static_cast<dmvcart_slot_device*>(owner());
-
// register for state saving
save_item(NAME(m_mouse.phase));
save_item(NAME(m_mouse.x));
@@ -153,7 +150,7 @@ void dmv_k806_device::io_write(int ifsel, offs_t offset, uint8_t data)
if (BIT(jumpers, ifsel) && ((!BIT(offset, 3) && BIT(jumpers, 5)) || (BIT(offset, 3) && BIT(jumpers, 6))))
{
m_mcu->upi41_master_w(machine().dummy_space(), offset & 1, data);
- m_bus->m_out_int_cb(CLEAR_LINE);
+ out_int(CLEAR_LINE);
}
}
@@ -185,7 +182,7 @@ READ_LINE_MEMBER( dmv_k806_device::portt1_r )
WRITE8_MEMBER( dmv_k806_device::port2_w )
{
- m_bus->m_out_int_cb((data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ out_int((data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
/*-------------------------------------------------------------------
diff --git a/src/devices/bus/dmv/k806.h b/src/devices/bus/dmv/k806.h
index d7e4036dd65..3b90f7442a8 100644
--- a/src/devices/bus/dmv/k806.h
+++ b/src/devices/bus/dmv/k806.h
@@ -51,7 +51,6 @@ private:
required_ioport m_mouse_buttons;
required_ioport m_mouse_x;
required_ioport m_mouse_y;
- dmvcart_slot_device * m_bus;
struct
{
diff --git a/src/devices/bus/ecbbus/ecbbus.cpp b/src/devices/bus/ecbbus/ecbbus.cpp
index c5499f1fb6c..d222573cdf4 100644
--- a/src/devices/bus/ecbbus/ecbbus.cpp
+++ b/src/devices/bus/ecbbus/ecbbus.cpp
@@ -29,8 +29,9 @@ DEFINE_DEVICE_TYPE(ECBBUS_SLOT, ecbbus_slot_device, "ecbbus_slot", "ECB bus slot
ecbbus_slot_device::ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ECBBUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_bus_tag(nullptr), m_bus_num(0), m_bus(nullptr)
+ device_single_card_slot_interface<device_ecbbus_card_interface>(mconfig, *this),
+ m_bus(*this, finder_base::DUMMY_TAG),
+ m_bus_num(0)
{
}
@@ -41,9 +42,9 @@ ecbbus_slot_device::ecbbus_slot_device(const machine_config &mconfig, const char
void ecbbus_slot_device::device_start()
{
- m_bus = machine().device<ecbbus_device>(m_bus_tag);
- device_ecbbus_card_interface *dev = dynamic_cast<device_ecbbus_card_interface *>(get_card_device());
- if (dev) m_bus->add_card(dev, m_bus_num);
+ device_ecbbus_card_interface *const dev = get_card_device();
+ if (dev)
+ m_bus->add_card(*dev, m_bus_num);
}
@@ -65,7 +66,7 @@ DEFINE_DEVICE_TYPE(ECBBUS, ecbbus_device, "ecbbus", "ECB bus")
//-------------------------------------------------
device_ecbbus_card_interface::device_ecbbus_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "ecbbus")
{
m_slot = dynamic_cast<ecbbus_slot_device *>(device.owner());
}
@@ -105,9 +106,9 @@ void ecbbus_device::device_start()
// add_card - add ECB bus card
//-------------------------------------------------
-void ecbbus_device::add_card(device_ecbbus_card_interface *card, int pos)
+void ecbbus_device::add_card(device_ecbbus_card_interface &card, int pos)
{
- m_ecbbus_device[pos] = card;
+ m_ecbbus_device[pos] = &card;
}
diff --git a/src/devices/bus/ecbbus/ecbbus.h b/src/devices/bus/ecbbus/ecbbus.h
index c14f1c53de4..21ee9eb2bd3 100644
--- a/src/devices/bus/ecbbus/ecbbus.h
+++ b/src/devices/bus/ecbbus/ecbbus.h
@@ -50,34 +50,28 @@
//**************************************************************************
-// CONSTANTS
+// TYPE DEFINITIONS
//**************************************************************************
-#define ECBBUS_TAG "ecbbus"
-
+class device_ecbbus_card_interface;
+class ecbbus_device;
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
// ======================> ecbbus_slot_device
-class ecbbus_device;
-
-class ecbbus_slot_device : public device_t,
- public device_slot_interface
+class ecbbus_slot_device : public device_t, public device_single_card_slot_interface<device_ecbbus_card_interface>
{
public:
// construction/destruction
- template <typename T>
- ecbbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, int num, T &&opts, char const *dflt)
+ template <typename T, typename U>
+ ecbbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bustag, int num, U &&opts, char const *dflt)
: ecbbus_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
- set_ecbbus_slot(ECBBUS_TAG, num);
+ set_ecbbus_slot(std::forward<T>(bustag), num);
}
ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -86,13 +80,16 @@ public:
virtual void device_start() override;
// inline configuration
- void set_ecbbus_slot(const char *tag, int num) { m_bus_tag = tag; m_bus_num = num; }
+ template <typename T> void set_ecbbus_slot(T &&tag, int num)
+ {
+ m_bus.set_tag(std::forward<T>(tag));
+ m_bus_num = num;
+ }
private:
// configuration
- const char *m_bus_tag;
+ required_device<ecbbus_device> m_bus;
int m_bus_num;
- ecbbus_device *m_bus;
};
@@ -100,11 +97,6 @@ private:
DECLARE_DEVICE_TYPE(ECBBUS_SLOT, ecbbus_slot_device)
-// ======================> ecbbus_interface
-
-class device_ecbbus_card_interface;
-
-
// ======================> ecbbus_device
class ecbbus_device : public device_t
@@ -116,7 +108,7 @@ public:
auto irq_wr_callback() { return m_write_irq.bind(); }
auto nmi_wr_callback() { return m_write_nmi.bind(); }
- void add_card(device_ecbbus_card_interface *card, int pos);
+ void add_card(device_ecbbus_card_interface &card, int pos);
DECLARE_READ8_MEMBER( mem_r );
DECLARE_WRITE8_MEMBER( mem_w );
@@ -148,16 +140,16 @@ DECLARE_DEVICE_TYPE(ECBBUS, ecbbus_device)
// ======================> device_ecbbus_card_interface
// class representing interface-specific live ecbbus card
-class device_ecbbus_card_interface : public device_slot_card_interface
+class device_ecbbus_card_interface : public device_interface
{
friend class ecbbus_device;
public:
// optional operation overrides
- virtual uint8_t ecbbus_mem_r(offs_t offset) { return 0; };
- virtual void ecbbus_mem_w(offs_t offset, uint8_t data) { };
- virtual uint8_t ecbbus_io_r(offs_t offset) { return 0; };
- virtual void ecbbus_io_w(offs_t offset, uint8_t data) { };
+ virtual uint8_t ecbbus_mem_r(offs_t offset) { return 0; }
+ virtual void ecbbus_mem_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t ecbbus_io_r(offs_t offset) { return 0; }
+ virtual void ecbbus_io_w(offs_t offset, uint8_t data) { }
protected:
// construction/destruction
diff --git a/src/devices/bus/econet/econet.cpp b/src/devices/bus/econet/econet.cpp
index c027614f317..f87850fe133 100644
--- a/src/devices/bus/econet/econet.cpp
+++ b/src/devices/bus/econet/econet.cpp
@@ -40,7 +40,7 @@ DEFINE_DEVICE_TYPE(ECONET_SLOT, econet_slot_device, "econet_slot", "Econet stati
//-------------------------------------------------
device_econet_interface::device_econet_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device), m_econet(nullptr), m_address(0), m_next(nullptr)
+ device_interface(device, "econet"), m_econet(nullptr), m_address(0), m_next(nullptr)
{
}
diff --git a/src/devices/bus/econet/econet.h b/src/devices/bus/econet/econet.h
index baecd8df67a..1aab9da8095 100644
--- a/src/devices/bus/econet/econet.h
+++ b/src/devices/bus/econet/econet.h
@@ -112,7 +112,7 @@ private:
// ======================> device_econet_interface
-class device_econet_interface : public device_slot_card_interface
+class device_econet_interface : public device_interface
{
friend class econet_device;
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/einstein/pipe/pipe.cpp b/src/devices/bus/einstein/pipe/pipe.cpp
index d521d146325..f54092e9587 100644
--- a/src/devices/bus/einstein/pipe/pipe.cpp
+++ b/src/devices/bus/einstein/pipe/pipe.cpp
@@ -32,7 +32,7 @@ DEFINE_DEVICE_TYPE(TATUNG_PIPE, tatung_pipe_device, "tatung_pipe", "Tatung Pipe
tatung_pipe_device::tatung_pipe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, TATUNG_PIPE, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_tatung_pipe_interface>(mconfig, *this),
m_program(*this, finder_base::DUMMY_TAG, -1),
m_io(*this, finder_base::DUMMY_TAG, -1),
m_card(nullptr),
@@ -79,7 +79,7 @@ void tatung_pipe_device::device_config_complete()
void tatung_pipe_device::device_start()
{
// get inserted module
- m_card = dynamic_cast<device_tatung_pipe_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_int_handler.resolve_safe();
@@ -88,14 +88,6 @@ void tatung_pipe_device::device_start()
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void tatung_pipe_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// host to module interface
//-------------------------------------------------
@@ -115,7 +107,7 @@ WRITE_LINE_MEMBER( tatung_pipe_device::host_int_w )
//-------------------------------------------------
device_tatung_pipe_interface::device_tatung_pipe_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "tatungpipe")
{
m_slot = dynamic_cast<tatung_pipe_device *>(device.owner());
}
diff --git a/src/devices/bus/einstein/pipe/pipe.h b/src/devices/bus/einstein/pipe/pipe.h
index f0c32bd0043..7b2a2fdcbad 100644
--- a/src/devices/bus/einstein/pipe/pipe.h
+++ b/src/devices/bus/einstein/pipe/pipe.h
@@ -51,7 +51,7 @@
class device_tatung_pipe_interface;
-class tatung_pipe_device : public device_t, public device_slot_interface
+class tatung_pipe_device : public device_t, public device_single_card_slot_interface<device_tatung_pipe_interface>
{
friend class device_tatung_pipe_interface;
public:
@@ -88,7 +88,6 @@ protected:
// device-level overrides
virtual void device_config_complete() override;
virtual void device_start() override;
- virtual void device_reset() override;
required_address_space m_program;
required_address_space m_io;
@@ -102,7 +101,7 @@ private:
};
// class representing interface-specific live pipe device
-class device_tatung_pipe_interface : public device_slot_card_interface
+class device_tatung_pipe_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/einstein/userport/userport.cpp b/src/devices/bus/einstein/userport/userport.cpp
index 419c24d94d4..4869c5a5cae 100644
--- a/src/devices/bus/einstein/userport/userport.cpp
+++ b/src/devices/bus/einstein/userport/userport.cpp
@@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE(EINSTEIN_USERPORT, einstein_userport_device, "einstein_userpo
einstein_userport_device::einstein_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, EINSTEIN_USERPORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_einstein_userport_interface>(mconfig, *this),
m_card(nullptr),
m_bstb_handler(*this)
{
@@ -54,15 +54,7 @@ void einstein_userport_device::device_start()
// resolve callbacks
m_bstb_handler.resolve_safe();
- m_card = dynamic_cast<device_einstein_userport_interface *>(get_card_device());
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void einstein_userport_device::device_reset()
-{
+ m_card = get_card_device();
}
@@ -100,7 +92,7 @@ WRITE_LINE_MEMBER( einstein_userport_device::brdy_w )
//-------------------------------------------------
device_einstein_userport_interface::device_einstein_userport_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "einsteinuser")
{
m_slot = dynamic_cast<einstein_userport_device *>(device.owner());
}
diff --git a/src/devices/bus/einstein/userport/userport.h b/src/devices/bus/einstein/userport/userport.h
index f5bd8dcfeb3..215fc9e6812 100644
--- a/src/devices/bus/einstein/userport/userport.h
+++ b/src/devices/bus/einstein/userport/userport.h
@@ -32,7 +32,7 @@ class device_einstein_userport_interface;
// supported devices
void einstein_userport_cards(device_slot_interface &device);
-class einstein_userport_device : public device_t, public device_slot_interface
+class einstein_userport_device : public device_t, public device_single_card_slot_interface<device_einstein_userport_interface>
{
public:
// construction/destruction
@@ -61,7 +61,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
device_einstein_userport_interface *m_card;
@@ -70,7 +69,7 @@ private:
};
// class representing interface-specific live userport device
-class device_einstein_userport_interface : public device_slot_card_interface
+class device_einstein_userport_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/ekara/slot.cpp b/src/devices/bus/ekara/slot.cpp
index 5140e3f28ab..2b4673f9db9 100644
--- a/src/devices/bus/ekara/slot.cpp
+++ b/src/devices/bus/ekara/slot.cpp
@@ -18,10 +18,10 @@ DEFINE_DEVICE_TYPE(EKARA_CART_SLOT, ekara_cart_slot_device, "ekara_cart_slot", "
// device_ekara_cart_interface - constructor
//-------------------------------------------------
-device_ekara_cart_interface::device_ekara_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_ekara_cart_interface::device_ekara_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "ekaracart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -57,7 +57,7 @@ void device_ekara_cart_interface::rom_alloc(uint32_t size, const char *tag)
ekara_cart_slot_device::ekara_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, EKARA_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_ekara_cart_interface>(mconfig, *this),
m_type(EKARA_PLAIN),
m_cart(nullptr)
{
@@ -77,7 +77,7 @@ ekara_cart_slot_device::~ekara_cart_slot_device()
void ekara_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_ekara_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/ekara/slot.h b/src/devices/bus/ekara/slot.h
index 945a5175d4b..2b6043b24ef 100644
--- a/src/devices/bus/ekara/slot.h
+++ b/src/devices/bus/ekara/slot.h
@@ -23,7 +23,7 @@ enum
// ======================> device_ekara_cart_interface
-class device_ekara_cart_interface : public device_slot_card_interface
+class device_ekara_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -62,7 +62,7 @@ protected:
class ekara_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_ekara_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/electron/cart/slot.cpp b/src/devices/bus/electron/cart/slot.cpp
index f8682b9c654..5cc48bad238 100644
--- a/src/devices/bus/electron/cart/slot.cpp
+++ b/src/devices/bus/electron/cart/slot.cpp
@@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(ELECTRON_CARTSLOT, electron_cartslot_device, "electron_cartsl
//-------------------------------------------------
device_electron_cart_interface::device_electron_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "electroncart"),
m_rom(nullptr),
m_rom_size(0)
{
@@ -92,7 +92,7 @@ void device_electron_cart_interface::nvram_alloc(uint32_t size)
electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ELECTRON_CARTSLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_electron_cart_interface>(mconfig, *this),
m_cart(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this)
@@ -105,21 +105,13 @@ electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig
void electron_cartslot_device::device_start()
{
- m_cart = dynamic_cast<device_electron_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
m_nmi_handler.resolve_safe();
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void electron_cartslot_device::device_reset()
-{
-}
-
//-------------------------------------------------
// call load
diff --git a/src/devices/bus/electron/cart/slot.h b/src/devices/bus/electron/cart/slot.h
index d31bc16258c..e0fc2666136 100644
--- a/src/devices/bus/electron/cart/slot.h
+++ b/src/devices/bus/electron/cart/slot.h
@@ -116,7 +116,7 @@ class device_electron_cart_interface;
class electron_cartslot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_electron_cart_interface>
{
public:
// construction/destruction
@@ -136,10 +136,6 @@ public:
auto irq_handler() { return m_irq_handler.bind(); }
auto nmi_handler() { return m_nmi_handler.bind(); }
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
@@ -165,6 +161,9 @@ public:
DECLARE_WRITE_LINE_MEMBER(nmi_w) { m_nmi_handler(state); }
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
device_electron_cart_interface *m_cart;
private:
@@ -175,7 +174,7 @@ private:
// ======================> device_electron_cart_interface
-class device_electron_cart_interface : public device_slot_card_interface
+class device_electron_cart_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/electron/exp.cpp b/src/devices/bus/electron/exp.cpp
index d2cd0abc824..8c6c4644b45 100644
--- a/src/devices/bus/electron/exp.cpp
+++ b/src/devices/bus/electron/exp.cpp
@@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(ELECTRON_EXPANSION_SLOT, electron_expansion_slot_device, "ele
//-------------------------------------------------
device_electron_expansion_interface::device_electron_expansion_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "electronexp")
{
m_slot = dynamic_cast<electron_expansion_slot_device *>(device.owner());
}
@@ -42,7 +42,7 @@ device_electron_expansion_interface::device_electron_expansion_interface(const m
electron_expansion_slot_device::electron_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ELECTRON_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_electron_expansion_interface>(mconfig, *this),
m_card(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this)
@@ -56,7 +56,7 @@ electron_expansion_slot_device::electron_expansion_slot_device(const machine_con
void electron_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_electron_expansion_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
diff --git a/src/devices/bus/electron/exp.h b/src/devices/bus/electron/exp.h
index a3bfc045b3a..2026d95aa09 100644
--- a/src/devices/bus/electron/exp.h
+++ b/src/devices/bus/electron/exp.h
@@ -98,7 +98,7 @@ AC RETURNS (pins 3,4) - adaptor. A total of 6W may be drawn from these lines as
class device_electron_expansion_interface;
-class electron_expansion_slot_device : public device_t, public device_slot_interface
+class electron_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_electron_expansion_interface>
{
public:
// construction/destruction
@@ -138,7 +138,7 @@ private:
// ======================> device_electron_expansion_interface
-class device_electron_expansion_interface : public device_slot_card_interface
+class device_electron_expansion_interface : public device_interface
{
public:
virtual uint8_t expbus_r(offs_t offset) { return 0xff; }
diff --git a/src/devices/bus/ep64/exp.cpp b/src/devices/bus/ep64/exp.cpp
index c241fb68c08..ebd423cfc7f 100644
--- a/src/devices/bus/ep64/exp.cpp
+++ b/src/devices/bus/ep64/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(EP64_EXPANSION_BUS_SLOT, ep64_expansion_bus_slot_device, "ep6
//-------------------------------------------------
device_ep64_expansion_bus_card_interface::device_ep64_expansion_bus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "ep64exp")
{
m_slot = dynamic_cast<ep64_expansion_bus_slot_device *>(device.owner());
}
@@ -45,7 +45,7 @@ device_ep64_expansion_bus_card_interface::device_ep64_expansion_bus_card_interfa
ep64_expansion_bus_slot_device::ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, EP64_EXPANSION_BUS_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_ep64_expansion_bus_card_interface>(mconfig, *this)
, m_write_irq(*this)
, m_write_nmi(*this)
, m_write_wait(*this)
@@ -57,27 +57,12 @@ ep64_expansion_bus_slot_device::ep64_expansion_bus_slot_device(const machine_con
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void ep64_expansion_bus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_ep64_expansion_bus_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_ep64_expansion_bus_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ep64_expansion_bus_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_ep64_expansion_bus_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_ep64_expansion_bus_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
@@ -87,15 +72,6 @@ void ep64_expansion_bus_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void ep64_expansion_bus_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// SLOT_INTERFACE( ep64_expansion_bus_cards )
//-------------------------------------------------
diff --git a/src/devices/bus/ep64/exp.h b/src/devices/bus/ep64/exp.h
index 88d3b4e61b9..354d6f0691e 100644
--- a/src/devices/bus/ep64/exp.h
+++ b/src/devices/bus/ep64/exp.h
@@ -59,7 +59,7 @@ void ep64_expansion_bus_cards(device_slot_interface &device);
class device_ep64_expansion_bus_card_interface;
class ep64_expansion_bus_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_ep64_expansion_bus_card_interface>
{
friend class device_ep64_expansion_bus_card_interface;
@@ -90,9 +90,7 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
private:
devcb_write_line m_write_irq;
@@ -108,7 +106,7 @@ private:
// ======================> device_ep64_expansion_bus_card_interface
-class device_ep64_expansion_bus_card_interface : public device_slot_card_interface
+class device_ep64_expansion_bus_card_interface : public device_interface
{
protected:
// construction/destruction
diff --git a/src/devices/bus/epson_sio/epson_sio.cpp b/src/devices/bus/epson_sio/epson_sio.cpp
index 32a572bb45d..adb75b853b7 100644
--- a/src/devices/bus/epson_sio/epson_sio.cpp
+++ b/src/devices/bus/epson_sio/epson_sio.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(EPSON_SIO, epson_sio_device, "epson_sio", "EPSON SIO port")
//-------------------------------------------------
device_epson_sio_interface::device_epson_sio_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "epsonsio")
{
m_slot = dynamic_cast<epson_sio_device *>(device.owner());
}
@@ -55,7 +55,7 @@ device_epson_sio_interface::~device_epson_sio_interface()
epson_sio_device::epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, EPSON_SIO, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_epson_sio_interface>(mconfig, *this),
m_cart(nullptr),
m_write_rx(*this),
m_write_pin(*this)
@@ -78,22 +78,13 @@ epson_sio_device::~epson_sio_device()
void epson_sio_device::device_start()
{
- m_cart = dynamic_cast<device_epson_sio_interface *>(get_card_device());
+ m_cart = get_card_device();
m_write_rx.resolve_safe();
m_write_pin.resolve_safe();
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void epson_sio_device::device_reset()
-{
-}
-
-
WRITE_LINE_MEMBER( epson_sio_device::tx_w )
{
if (m_cart != nullptr)
diff --git a/src/devices/bus/epson_sio/epson_sio.h b/src/devices/bus/epson_sio/epson_sio.h
index 5d93c42ba74..99bf6bce7a3 100644
--- a/src/devices/bus/epson_sio/epson_sio.h
+++ b/src/devices/bus/epson_sio/epson_sio.h
@@ -21,8 +21,7 @@ class device_epson_sio_interface;
// supported devices
void epson_sio_devices(device_slot_interface &device);
-class epson_sio_device : public device_t,
- public device_slot_interface
+class epson_sio_device : public device_t, public device_single_card_slot_interface<device_epson_sio_interface>
{
public:
// construction/destruction
@@ -53,7 +52,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
device_epson_sio_interface *m_cart;
@@ -64,14 +62,14 @@ private:
// class representing interface-specific live sio device
-class device_epson_sio_interface : public device_slot_card_interface
+class device_epson_sio_interface : public device_interface
{
public:
// construction/destruction
virtual ~device_epson_sio_interface();
- virtual void tx_w(int state) { };
- virtual void pout_w(int state) { };
+ virtual void tx_w(int state) { }
+ virtual void pout_w(int state) { }
protected:
device_epson_sio_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/gamate/slot.cpp b/src/devices/bus/gamate/slot.cpp
index 40a1c7fdfaa..cbeb5eae03b 100644
--- a/src/devices/bus/gamate/slot.cpp
+++ b/src/devices/bus/gamate/slot.cpp
@@ -18,10 +18,10 @@ DEFINE_DEVICE_TYPE(GAMATE_CART_SLOT, gamate_cart_slot_device, "gamate_cart_slot"
// device_gamate_cart_interface - constructor
//-------------------------------------------------
-device_gamate_cart_interface::device_gamate_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_gamate_cart_interface::device_gamate_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "gamatecart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -57,7 +57,7 @@ void device_gamate_cart_interface::rom_alloc(uint32_t size, const char *tag)
gamate_cart_slot_device::gamate_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, GAMATE_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface(mconfig, *this),
m_type(GAMATE_PLAIN),
m_cart(nullptr)
{
@@ -77,7 +77,7 @@ gamate_cart_slot_device::~gamate_cart_slot_device()
void gamate_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_gamate_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/gamate/slot.h b/src/devices/bus/gamate/slot.h
index 3606ac32c69..d8f02e617e7 100644
--- a/src/devices/bus/gamate/slot.h
+++ b/src/devices/bus/gamate/slot.h
@@ -21,7 +21,7 @@ enum
// ======================> device_gamate_cart_interface
-class device_gamate_cart_interface : public device_slot_card_interface
+class device_gamate_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -47,7 +47,7 @@ protected:
class gamate_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_gamate_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp
index a72eedc24d5..31d11e59dcf 100644
--- a/src/devices/bus/gameboy/gb_slot.cpp
+++ b/src/devices/bus/gameboy/gb_slot.cpp
@@ -36,13 +36,13 @@ DEFINE_DEVICE_TYPE(MEGADUCK_CART_SLOT, megaduck_cart_slot_device, "megaduck_cart
// device_gb_cart_interface - constructor
//-------------------------------------------------
-device_gb_cart_interface::device_gb_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0), m_ram_bank(0), m_latch_bank(0), m_latch_bank2(0),
- has_rumble(false),
- has_timer(false),
- has_battery(false)
+device_gb_cart_interface::device_gb_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "gbcart"),
+ m_rom(nullptr),
+ m_rom_size(0), m_ram_bank(0), m_latch_bank(0), m_latch_bank2(0),
+ has_rumble(false),
+ has_timer(false),
+ has_battery(false)
{
}
@@ -140,7 +140,7 @@ void device_gb_cart_interface::ram_map_setup(uint8_t banks)
gb_cart_slot_device_base::gb_cart_slot_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_gb_cart_interface>(mconfig, *this),
m_type(GB_MBC_UNKNOWN),
m_cart(nullptr)
{
@@ -170,7 +170,7 @@ gb_cart_slot_device_base::~gb_cart_slot_device_base()
void gb_cart_slot_device_base::device_start()
{
- m_cart = dynamic_cast<device_gb_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h
index 5f420c60823..8119a2f4861 100644
--- a/src/devices/bus/gameboy/gb_slot.h
+++ b/src/devices/bus/gameboy/gb_slot.h
@@ -51,7 +51,7 @@ enum
// ======================> device_gb_cart_interface
-class device_gb_cart_interface : public device_slot_card_interface
+class device_gb_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -109,15 +109,12 @@ protected:
class gb_cart_slot_device_base : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_gb_cart_interface>
{
public:
// construction/destruction
virtual ~gb_cart_slot_device_base();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
@@ -154,6 +151,9 @@ public:
protected:
gb_cart_slot_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ // device-level overrides
+ virtual void device_start() override;
+
int m_type;
device_gb_cart_interface* m_cart;
};
diff --git a/src/devices/bus/gamegear/ggext.cpp b/src/devices/bus/gamegear/ggext.cpp
index 99d464e87b7..dad471f1f9b 100644
--- a/src/devices/bus/gamegear/ggext.cpp
+++ b/src/devices/bus/gamegear/ggext.cpp
@@ -31,8 +31,8 @@ DEFINE_DEVICE_TYPE(GG_EXT_PORT, gg_ext_port_device, "gg_ext_port", "Game Gear EX
// device_gg_ext_port_interface - constructor
//-------------------------------------------------
-device_gg_ext_port_interface::device_gg_ext_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_gg_ext_port_interface::device_gg_ext_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "gamegearext")
{
m_port = dynamic_cast<gg_ext_port_device *>(device.owner());
}
@@ -58,7 +58,7 @@ device_gg_ext_port_interface::~device_gg_ext_port_interface()
gg_ext_port_device::gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, GG_EXT_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_gg_ext_port_interface>(mconfig, *this),
m_screen(*this, finder_base::DUMMY_TAG),
m_device(nullptr),
m_th_pin_handler(*this)
@@ -81,7 +81,7 @@ gg_ext_port_device::~gg_ext_port_device()
void gg_ext_port_device::device_start()
{
- m_device = dynamic_cast<device_gg_ext_port_interface *>(get_card_device());
+ m_device = get_card_device();
m_th_pin_handler.resolve_safe();
}
diff --git a/src/devices/bus/gamegear/ggext.h b/src/devices/bus/gamegear/ggext.h
index f2145e694fd..04d802eca02 100644
--- a/src/devices/bus/gamegear/ggext.h
+++ b/src/devices/bus/gamegear/ggext.h
@@ -24,7 +24,7 @@
class device_gg_ext_port_interface;
-class gg_ext_port_device : public device_t, public device_slot_interface
+class gg_ext_port_device : public device_t, public device_single_card_slot_interface<device_gg_ext_port_interface>
{
public:
// construction/destruction
@@ -84,7 +84,7 @@ private:
// ======================> device_gg_ext_port_interface
// class representing interface-specific live sms_expansion card
-class device_gg_ext_port_interface : public device_slot_card_interface
+class device_gg_ext_port_interface : public device_interface
{
public:
// construction/destruction
@@ -106,5 +106,4 @@ DECLARE_DEVICE_TYPE(GG_EXT_PORT, gg_ext_port_device)
void gg_ext_port_devices(device_slot_interface &device);
-
#endif // MAME_BUS_GAMEGEAR_GGEXT_H
diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp
index c99376e02e4..4510800c8e7 100644
--- a/src/devices/bus/gba/gba_slot.cpp
+++ b/src/devices/bus/gba/gba_slot.cpp
@@ -478,10 +478,10 @@ DEFINE_DEVICE_TYPE(GBA_CART_SLOT, gba_cart_slot_device, "gba_cart_slot", "Game B
// device_gba_cart_interface - constructor
//-------------------------------------------------
-device_gba_cart_interface::device_gba_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
- , m_rom(nullptr)
- , m_rom_size(0)
+device_gba_cart_interface::device_gba_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "gbacart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h
index b26891c6589..c308afe530c 100644
--- a/src/devices/bus/gba/gba_slot.h
+++ b/src/devices/bus/gba/gba_slot.h
@@ -36,7 +36,7 @@ enum
// ======================> device_gba_cart_interface
-class device_gba_cart_interface : public device_slot_card_interface
+class device_gba_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -97,9 +97,6 @@ public:
gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~gba_cart_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
@@ -133,8 +130,9 @@ public:
virtual DECLARE_WRITE32_MEMBER(write_tilt) { if (m_cart) m_cart->write_tilt(space, offset, data, mem_mask); }
virtual DECLARE_WRITE32_MEMBER(write_mapper) { if (m_cart) m_cart->write_mapper(space, offset, data, mem_mask); }
-
protected:
+ // device-level overrides
+ virtual void device_start() override;
int m_type;
device_gba_cart_interface* m_cart;
diff --git a/src/devices/bus/generic/slot.cpp b/src/devices/bus/generic/slot.cpp
index 9d2f6294ab2..c892d07f3fe 100644
--- a/src/devices/bus/generic/slot.cpp
+++ b/src/devices/bus/generic/slot.cpp
@@ -24,6 +24,10 @@
#include "emu.h"
#include "slot.h"
+#define VERBOSE 1
+#include "logmacro.h"
+
+
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
@@ -32,63 +36,89 @@ DEFINE_DEVICE_TYPE(GENERIC_SOCKET, generic_socket_device, "generic_socket", "Gen
DEFINE_DEVICE_TYPE(GENERIC_CARTSLOT, generic_cartslot_device, "generic_cartslot", "Generic Cartridge Slot")
-//-------------------------------------------------
-// device_generic_cart_interface - constructor
-//-------------------------------------------------
+//**************************************************************************
+// device_generic_cart_interface
+//**************************************************************************
-device_generic_cart_interface::device_generic_cart_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+device_generic_cart_interface::device_generic_cart_interface(machine_config const &mconfig, device_t &device) :
+ device_interface(device, "genslot"),
+ m_region(*this, DEVICE_SELF),
+ m_ram(),
m_rom(nullptr),
- m_rom_size(0),
- m_region(*this, DEVICE_SELF)
+ m_rom_size(0)
{
}
+device_generic_cart_interface::~device_generic_cart_interface()
+{
+}
-//-------------------------------------------------
-// ~device_generic_cart_interface - destructor
-//-------------------------------------------------
+u8 device_generic_cart_interface::read_rom(offs_t offset)
+{
+ return 0xff;
+}
-device_generic_cart_interface::~device_generic_cart_interface()
+u16 device_generic_cart_interface::read16_rom(offs_t offset, u16 mem_mask)
{
+ return 0xffff;
}
-//-------------------------------------------------
-// rom_alloc - alloc the space for the cart
-//-------------------------------------------------
+u32 device_generic_cart_interface::read32_rom(offs_t offset, u32 mem_mask)
+{
+ return 0xffffffff;
+}
-void device_generic_cart_interface::rom_alloc(size_t size, int width, endianness_t endian, const char *tag)
+u8 device_generic_cart_interface::read_ram(offs_t offset)
{
- if (m_rom == nullptr)
- {
- m_rom = device().machine().memory().region_alloc(std::string(tag).append(GENERIC_ROM_REGION_TAG).c_str(), size, width, endian)->base();
- m_rom_size = size;
- }
+ return 0xff;
}
+void device_generic_cart_interface::write_ram(offs_t offset, u8 data)
+{
+}
-//-------------------------------------------------
-// ram_alloc - alloc the space for the ram
-//-------------------------------------------------
+void device_generic_cart_interface::rom_alloc(u32 size, int width, endianness_t endian, char const *tag)
+{
+ if (m_rom)
+ {
+ throw emu_fatalerror(
+ "%s: Request to allocate ROM when already allocated (allocated size %u, requested size %u)\n",
+ device().tag(),
+ m_rom_size,
+ size);
+ }
+
+ std::string fulltag(tag);
+ fulltag.append(GENERIC_ROM_REGION_TAG);
+ device().logerror("Allocating %u byte ROM region with tag '%s' (width %d)\n", size, fulltag, width);
+ m_rom = device().machine().memory().region_alloc(fulltag.c_str(), size, width, endian)->base();
+ m_rom_size = size;
+}
-void device_generic_cart_interface::ram_alloc(uint32_t size)
+void device_generic_cart_interface::ram_alloc(u32 size)
{
+ if (!m_ram.empty())
+ {
+ throw emu_fatalerror(
+ "%s: Request to allocate RAM when already allocated (allocated size %u, requested size %u)\n",
+ device().tag(),
+ m_ram.size(),
+ size);
+ }
+
+ device().logerror("Allocating %u bytes of RAM\n", size);
m_ram.resize(size);
}
-
//**************************************************************************
-// LIVE DEVICE
+// generic_slot_device
//**************************************************************************
-//-------------------------------------------------
-// generic_slot_device - constructor
-//-------------------------------------------------
-generic_slot_device::generic_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+generic_slot_device::generic_slot_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) :
device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_generic_cart_interface>(mconfig, *this),
m_interface(nullptr),
m_default_card("rom"),
m_extensions("bin"),
@@ -111,21 +141,13 @@ generic_cartslot_device::generic_cartslot_device(const machine_config &mconfig,
{
}
-//-------------------------------------------------
-// generic_slot_device - destructor
-//-------------------------------------------------
-
generic_slot_device::~generic_slot_device()
{
}
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
void generic_slot_device::device_start()
{
- m_cart = dynamic_cast<device_generic_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
m_device_image_load.resolve();
m_device_image_unload.resolve();
}
@@ -143,7 +165,7 @@ image_init_result generic_slot_device::call_load()
return m_device_image_load(*this);
else
{
- uint32_t len = common_get_size("rom");
+ u32 len = common_get_size("rom");
rom_alloc(len, m_width, m_endianness);
common_load_rom(get_rom_base(), len, "rom");
@@ -189,7 +211,7 @@ std::string generic_slot_device::get_default_card_software(get_default_card_soft
for fullpath and for softlist
-------------------------------------------------*/
-uint32_t generic_slot_device::common_get_size(const char *region)
+u32 generic_slot_device::common_get_size(char const *region)
{
// if we are loading from softlist, you have to specify a region
assert(!loaded_through_softlist() || (region != nullptr));
@@ -202,7 +224,7 @@ uint32_t generic_slot_device::common_get_size(const char *region)
for fullpath and for softlist
-------------------------------------------------*/
-void generic_slot_device::common_load_rom(uint8_t *ROM, uint32_t len, const char *region)
+void generic_slot_device::common_load_rom(u8 *ROM, u32 len, char const *region)
{
// basic sanity check
assert((ROM != nullptr) && (len > 0));
@@ -220,7 +242,7 @@ void generic_slot_device::common_load_rom(uint8_t *ROM, uint32_t len, const char
read_rom
-------------------------------------------------*/
-uint8_t generic_slot_device::read_rom(offs_t offset)
+u8 generic_slot_device::read_rom(offs_t offset)
{
if (m_cart)
return m_cart->read_rom(offset);
@@ -232,7 +254,7 @@ uint8_t generic_slot_device::read_rom(offs_t offset)
read16_rom
-------------------------------------------------*/
-uint16_t generic_slot_device::read16_rom(offs_t offset, uint16_t mem_mask)
+u16 generic_slot_device::read16_rom(offs_t offset, u16 mem_mask)
{
if (m_cart)
return m_cart->read16_rom(offset, mem_mask);
@@ -244,7 +266,7 @@ uint16_t generic_slot_device::read16_rom(offs_t offset, uint16_t mem_mask)
read32_rom
-------------------------------------------------*/
-uint32_t generic_slot_device::read32_rom(offs_t offset, uint32_t mem_mask)
+u32 generic_slot_device::read32_rom(offs_t offset, u32 mem_mask)
{
if (m_cart)
return m_cart->read32_rom(offset, mem_mask);
@@ -256,7 +278,7 @@ uint32_t generic_slot_device::read32_rom(offs_t offset, uint32_t mem_mask)
read_ram
-------------------------------------------------*/
-uint8_t generic_slot_device::read_ram(offs_t offset)
+u8 generic_slot_device::read_ram(offs_t offset)
{
if (m_cart)
return m_cart->read_ram(offset);
@@ -268,7 +290,7 @@ uint8_t generic_slot_device::read_ram(offs_t offset)
write_ram
-------------------------------------------------*/
-void generic_slot_device::write_ram(offs_t offset, uint8_t data)
+void generic_slot_device::write_ram(offs_t offset, u8 data)
{
if (m_cart)
m_cart->write_ram(offset, data);
diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h
index 9df3bf44a76..5704347e826 100644
--- a/src/devices/bus/generic/slot.h
+++ b/src/devices/bus/generic/slot.h
@@ -12,47 +12,44 @@
TYPE DEFINITIONS
***************************************************************************/
-
-// ======================> device_generic_cart_interface
-
-class device_generic_cart_interface : public device_slot_card_interface
+class device_generic_cart_interface : public device_interface
{
public:
// construction/destruction
virtual ~device_generic_cart_interface();
// reading and writing
- virtual uint8_t read_rom(offs_t offset) { return 0xff; }
- virtual uint16_t read16_rom(offs_t offset, uint16_t mem_mask) { return 0xffff; }
- virtual uint32_t read32_rom(offs_t offset, uint32_t mem_mask) { return 0xffffffff; }
+ virtual u8 read_rom(offs_t offset);
+ virtual u16 read16_rom(offs_t offset, u16 mem_mask);
+ virtual u32 read32_rom(offs_t offset, u32 mem_mask);
- virtual uint8_t read_ram(offs_t offset) { return 0xff; }
- virtual void write_ram(offs_t offset, uint8_t data) {}
+ virtual u8 read_ram(offs_t offset);
+ virtual void write_ram(offs_t offset, u8 data);
- virtual void rom_alloc(size_t size, int width, endianness_t end, const char *tag);
- virtual void ram_alloc(uint32_t size);
+ virtual void rom_alloc(u32 size, int width, endianness_t end, char const *tag);
+ virtual void ram_alloc(u32 size);
- uint8_t* get_rom_base() { return m_rom; }
- uint32_t get_rom_size() { return m_rom_size; }
+ u8 *get_rom_base() { return m_rom; }
+ u32 get_rom_size() { return m_rom_size; }
- uint8_t* get_region_base() { if (m_region.found()) return m_region->base(); return nullptr; }
- uint32_t get_region_size() { if (m_region.found()) return m_region->bytes(); return 0; }
+ u8 *get_region_base() { return m_region.found() ? m_region->base() : nullptr; }
+ u32 get_region_size() { return m_region.found() ? m_region->bytes() : 0U; }
- uint8_t* get_ram_base() { return &m_ram[0]; }
- uint32_t get_ram_size() { return m_ram.size(); }
+ u8 *get_ram_base() { return &m_ram[0]; }
+ u32 get_ram_size() { return m_ram.size(); }
void save_ram() { device().save_item(NAME(m_ram)); }
protected:
- device_generic_cart_interface(const machine_config &mconfig, device_t &device);
-
- // internal state
- uint8_t *m_rom;
- uint32_t m_rom_size;
- std::vector<uint8_t> m_ram;
+ device_generic_cart_interface(machine_config const &mconfig, device_t &device);
// this replaces m_rom for non-user configurable carts!
optional_memory_region m_region;
+
+ // internal state
+ std::vector<u8> m_ram;
+ u8 *m_rom;
+ u32 m_rom_size;
};
@@ -67,37 +64,30 @@ enum
-// ======================> generic_slot_device
-
class generic_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_generic_cart_interface>
{
public:
- // construction/destruction
- generic_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual ~generic_slot_device();
template <typename... T> void set_device_load(T &&... args) { m_device_image_load.set(std::forward<T>(args)...); }
template <typename... T> void set_device_unload(T &&... args) { m_device_image_unload.set(std::forward<T>(args)...); }
- void set_interface(const char * interface) { m_interface = interface; }
- void set_default_card(const char * def) { m_default_card = def; }
- void set_extensions(const char * exts) { m_extensions = exts; }
+ void set_interface(char const *interface) { m_interface = interface; }
+ void set_default_card(char const *def) { m_default_card = def; }
+ void set_extensions(char const *exts) { m_extensions = exts; }
void set_must_be_loaded(bool mandatory) { m_must_be_loaded = mandatory; }
void set_width(int width) { m_width = width; }
void set_endian(endianness_t end) { m_endianness = end; }
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
- virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+ virtual software_list_loader const &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
- uint32_t common_get_size(const char *region);
- void common_load_rom(uint8_t *ROM, uint32_t len, const char *region);
+ u32 common_get_size(char const *region);
+ void common_load_rom(u8 *ROM, u32 len, char const *region);
virtual iodevice_t image_type() const override { return IO_CARTSLOT; }
virtual bool is_readable() const override { return true; }
@@ -105,58 +95,59 @@ public:
virtual bool is_creatable() const override { return false; }
virtual bool must_be_loaded() const override { return m_must_be_loaded; }
virtual bool is_reset_on_load() const override { return true; }
- virtual const char *image_interface() const override { return m_interface; }
- virtual const char *file_extensions() const override { return m_extensions; }
+ virtual char const *image_interface() const override { return m_interface; }
+ virtual char const *file_extensions() const override { return m_extensions; }
// slot interface overrides
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
// reading and writing
- virtual uint8_t read_rom(offs_t offset);
- virtual uint16_t read16_rom(offs_t offset, uint16_t mem_mask = 0xffff);
- virtual uint32_t read32_rom(offs_t offset, uint32_t mem_mask = 0xffffffff);
+ virtual u8 read_rom(offs_t offset);
+ virtual u16 read16_rom(offs_t offset, u16 mem_mask = 0xffff);
+ virtual u32 read32_rom(offs_t offset, u32 mem_mask = 0xffffffff);
- virtual uint8_t read_ram(offs_t offset);
- virtual void write_ram(offs_t offset, uint8_t data);
+ virtual u8 read_ram(offs_t offset);
+ virtual void write_ram(offs_t offset, u8 data);
- virtual void rom_alloc(size_t size, int width, endianness_t end) { if (m_cart) m_cart->rom_alloc(size, width, end, tag()); }
- virtual void ram_alloc(uint32_t size) { if (m_cart) m_cart->ram_alloc(size); }
+ virtual void rom_alloc(u32 size, int width, endianness_t end) { if (m_cart) m_cart->rom_alloc(size, width, end, tag()); }
+ virtual void ram_alloc(u32 size) { if (m_cart) m_cart->ram_alloc(size); }
- uint8_t* get_rom_base()
+ u8* get_rom_base()
{
- if (m_cart)
- {
- if (!user_loadable())
- return m_cart->get_region_base();
- else
- return m_cart->get_rom_base();
- }
- return nullptr;
+ if (!m_cart)
+ return nullptr;
+ else if (!user_loadable())
+ return m_cart->get_region_base();
+ else
+ return m_cart->get_rom_base();
}
- uint32_t get_rom_size()
+ u32 get_rom_size()
{
- if (m_cart)
- {
- if (!user_loadable())
- return m_cart->get_region_size();
- else
- return m_cart->get_rom_size();
- }
- return 0;
+ if (!m_cart)
+ return 0U;
+ else if (!user_loadable())
+ return m_cart->get_region_size();
+ else
+ return m_cart->get_rom_size();
}
- uint8_t* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; }
+ u8 *get_ram_base() { return m_cart ? m_cart->get_ram_base() : nullptr; }
void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
protected:
- const char *m_interface;
- const char *m_default_card;
- const char *m_extensions;
- bool m_must_be_loaded;
- int m_width;
+ generic_slot_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
+
+ // device-level overrides
+ virtual void device_start() override ATTR_COLD;
+
+ char const *m_interface;
+ char const *m_default_card;
+ char const *m_extensions;
+ bool m_must_be_loaded;
+ int m_width;
endianness_t m_endianness;
- device_generic_cart_interface *m_cart;
- load_delegate m_device_image_load;
+ device_generic_cart_interface *m_cart;
+ load_delegate m_device_image_load;
unload_delegate m_device_image_unload;
};
@@ -164,8 +155,8 @@ class generic_socket_device : public generic_slot_device
{
public:
template <typename T>
- generic_socket_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *intf, const char *exts = nullptr)
- : generic_socket_device(mconfig, tag, owner, (uint32_t)0)
+ generic_socket_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *intf, char const *exts = nullptr)
+ : generic_socket_device(mconfig, tag, owner, u32(0))
{
opts(*this);
set_fixed(false);
@@ -174,7 +165,7 @@ public:
set_extensions(exts);
}
- generic_socket_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ generic_socket_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
virtual iodevice_t image_type() const override { return IO_ROM; }
};
@@ -183,8 +174,8 @@ class generic_cartslot_device : public generic_slot_device
{
public:
template <typename T>
- generic_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *intf, const char *exts = nullptr)
- : generic_cartslot_device(mconfig, tag, owner, (uint32_t)0)
+ generic_cartslot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *intf, char const *exts = nullptr)
+ : generic_cartslot_device(mconfig, tag, owner, u32(0))
{
opts(*this);
set_fixed(false);
@@ -193,7 +184,7 @@ public:
set_extensions(exts);
}
- generic_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ generic_cartslot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
virtual iodevice_t image_type() const override { return IO_CARTSLOT; }
};
@@ -203,9 +194,4 @@ public:
DECLARE_DEVICE_TYPE(GENERIC_SOCKET, generic_socket_device)
DECLARE_DEVICE_TYPE(GENERIC_CARTSLOT, generic_cartslot_device)
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
- ***************************************************************************/
-
#endif // MAME_BUS_GENERIC_SLOT_H
diff --git a/src/devices/bus/gio64/gio64.cpp b/src/devices/bus/gio64/gio64.cpp
index ba35bb38c9d..dfc3016b9a7 100644
--- a/src/devices/bus/gio64/gio64.cpp
+++ b/src/devices/bus/gio64/gio64.cpp
@@ -140,7 +140,7 @@ void gio64_device::add_gio64_card(gio64_slot_device::slot_type_t slot_type, devi
device_gio64_card_interface::device_gio64_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sgigio64")
, m_gio64(nullptr)
, m_gio64_slottag(nullptr)
, m_slot_type(gio64_slot_device::GIO64_SLOT_COUNT)
@@ -157,8 +157,6 @@ void device_gio64_card_interface::interface_validity_check(validity_checker &val
void device_gio64_card_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (!m_gio64)
{
fatalerror("Can't find SGI GIO64 device\n");
diff --git a/src/devices/bus/gio64/gio64.h b/src/devices/bus/gio64/gio64.h
index dd2c77aefc6..829c4e7c857 100644
--- a/src/devices/bus/gio64/gio64.h
+++ b/src/devices/bus/gio64/gio64.h
@@ -61,7 +61,7 @@ DECLARE_DEVICE_TYPE(GIO64_SLOT, gio64_slot_device)
// class representing interface-specific live GIO64 card
-class device_gio64_card_interface : public device_slot_card_interface
+class device_gio64_card_interface : public device_interface
{
friend class gio64_device;
public:
diff --git a/src/devices/bus/hexbus/hexbus.cpp b/src/devices/bus/hexbus/hexbus.cpp
index 6b6f19b7d98..768910752a2 100644
--- a/src/devices/bus/hexbus/hexbus.cpp
+++ b/src/devices/bus/hexbus/hexbus.cpp
@@ -161,16 +161,23 @@ DEFINE_DEVICE_TYPE_NS(HEXBUS, bus::hexbus, hexbus_device, "hexbus", "Hexbus co
namespace bus { namespace hexbus {
+device_hexbus_interface::device_hexbus_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "hexbus")
+{
+}
+
+
hexbus_device::hexbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HEXBUS, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_next_dev(nullptr)
+ device_single_card_slot_interface<device_hexbus_interface>(mconfig, *this),
+ m_next_dev(nullptr),
+ m_chain_element(nullptr)
{
}
void hexbus_device::device_start()
{
- m_next_dev = dynamic_cast<device_hexbus_interface *>(get_card_device());
+ m_next_dev = get_card_device();
}
/*
diff --git a/src/devices/bus/hexbus/hexbus.h b/src/devices/bus/hexbus/hexbus.h
index ca961a39d17..3db73cdb8ea 100644
--- a/src/devices/bus/hexbus/hexbus.h
+++ b/src/devices/bus/hexbus/hexbus.h
@@ -39,15 +39,14 @@ class hexbus_chained_device;
Interface for a device that connects to the Hexbus
********************************************************************/
-class device_hexbus_interface : public device_slot_card_interface
+class device_hexbus_interface : public device_interface
{
public:
- virtual uint8_t bus_read(int dir) =0;
- virtual void bus_write(int dir, uint8_t data) =0;
+ virtual uint8_t bus_read(int dir) = 0;
+ virtual void bus_write(int dir, uint8_t data) = 0;
protected:
- device_hexbus_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device) { }
+ device_hexbus_interface(const machine_config &mconfig, device_t &device);
};
/********************************************************************
@@ -58,13 +57,13 @@ class hexbus_chained_device : public device_t, public device_hexbus_interface
{
friend class hexbus_device;
-public:
+protected:
hexbus_chained_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- virtual void device_start() override;
-protected:
void set_outbound_hexbus(hexbus_device *outbound) { m_hexbus_outbound = outbound; }
+ virtual void device_start() override;
+
// Link to the inbound Hexbus (if not null, see Oso chip)
hexbus_device *m_hexbus_inbound;
@@ -90,7 +89,7 @@ protected:
uint8_t hexbus_read();
// Callback for changes on the hexbus
- virtual void hexbus_value_changed(uint8_t data) { };
+ virtual void hexbus_value_changed(uint8_t data) { }
// Levels of the lines at this device. 0 means pull down, 1 means release.
uint8_t m_myvalue;
@@ -105,7 +104,7 @@ protected:
Connector to the Hexbus, offers a slot for Hexbus-chained devices
********************************************************************/
-class hexbus_device : public device_t, public device_slot_interface
+class hexbus_device : public device_t, public device_single_card_slot_interface<device_hexbus_interface>
{
public:
template <typename U>
diff --git a/src/devices/bus/hp80_io/82937.cpp b/src/devices/bus/hp80_io/82937.cpp
index c150b6d36fa..6e145bb3baf 100644
--- a/src/devices/bus/hp80_io/82937.cpp
+++ b/src/devices/bus/hp80_io/82937.cpp
@@ -56,7 +56,8 @@ constexpr unsigned P1_NDAC_BIT = 1;
constexpr unsigned P1_NRFD_BIT = 0;
hp82937_io_card_device::hp82937_io_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp80_io_card_device(mconfig , HP82937_IO_CARD , tag , owner , clock),
+ : device_t(mconfig , HP82937_IO_CARD , tag , owner , clock),
+ device_hp80_io_interface(mconfig, *this),
m_cpu(*this , "cpu"),
m_translator(*this , "xlator"),
m_sw1(*this , "sw1"),
@@ -243,8 +244,6 @@ void hp82937_io_card_device::device_start()
void hp82937_io_card_device::device_reset()
{
- hp80_io_card_device::device_reset();
-
m_latch = 0;
m_updating = false;
update_signals();
diff --git a/src/devices/bus/hp80_io/82937.h b/src/devices/bus/hp80_io/82937.h
index dabafa22f6e..aa4f49b079f 100644
--- a/src/devices/bus/hp80_io/82937.h
+++ b/src/devices/bus/hp80_io/82937.h
@@ -18,7 +18,7 @@
#include "bus/ieee488/ieee488.h"
#include "machine/1mb5.h"
-class hp82937_io_card_device : public hp80_io_card_device
+class hp82937_io_card_device : public device_t, public device_hp80_io_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/hp80_io/hp80_io.cpp b/src/devices/bus/hp80_io/hp80_io.cpp
index 8004ce06bd4..6124a15b80d 100644
--- a/src/devices/bus/hp80_io/hp80_io.cpp
+++ b/src/devices/bus/hp80_io/hp80_io.cpp
@@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(HP80_IO_SLOT, hp80_io_slot_device, "hp80_io_slot", "HP80 I/O
// +-------------------+
hp80_io_slot_device::hp80_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HP80_IO_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_hp80_io_interface>(mconfig, *this),
m_irl_cb_func(*this),
m_halt_cb_func(*this),
m_slot_no(0)
@@ -54,7 +54,7 @@ WRITE_LINE_MEMBER(hp80_io_slot_device::halt_w)
void hp80_io_slot_device::inten()
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->inten();
@@ -63,7 +63,7 @@ void hp80_io_slot_device::inten()
void hp80_io_slot_device::clear_service()
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->clear_service();
@@ -72,7 +72,7 @@ void hp80_io_slot_device::clear_service()
void hp80_io_slot_device::install_read_write_handlers(address_space& space)
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->install_read_write_handlers(space , get_base_addr());
@@ -81,7 +81,7 @@ void hp80_io_slot_device::install_read_write_handlers(address_space& space)
uint8_t hp80_io_slot_device::get_sc() const
{
- const hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ const device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
return card->get_sc();
@@ -92,7 +92,7 @@ uint8_t hp80_io_slot_device::get_sc() const
uint16_t hp80_io_slot_device::get_base_addr() const
{
- const hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ const device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
uint16_t addr = ((uint16_t)(card->get_sc() - HP80_IO_FIRST_SC) << 1) | 0xff50;
@@ -102,44 +102,43 @@ uint16_t hp80_io_slot_device::get_base_addr() const
}
}
-// +-------------------+
-// |hp80_io_card_device|
-// +-------------------+
-uint8_t hp80_io_card_device::get_sc() const
+// +------------------------+
+// |device_hp80_io_interface|
+// +------------------------+
+uint8_t device_hp80_io_interface::get_sc() const
{
return m_select_code_port->read() + HP80_IO_FIRST_SC;
}
-void hp80_io_card_device::inten()
+void device_hp80_io_interface::inten()
{
}
-void hp80_io_card_device::clear_service()
+void device_hp80_io_interface::clear_service()
{
}
-hp80_io_card_device::hp80_io_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this),
+device_hp80_io_interface::device_hp80_io_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "hp80io"),
m_select_code_port(*this , "SC")
{
}
-hp80_io_card_device::~hp80_io_card_device()
+device_hp80_io_interface::~device_hp80_io_interface()
{
}
-WRITE_LINE_MEMBER(hp80_io_card_device::irl_w)
+WRITE_LINE_MEMBER(device_hp80_io_interface::irl_w)
{
- LOG("irl_w card=%d\n" , state);
- hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(owner());
+ if (VERBOSE & LOG_GENERAL) device().logerror("irl_w card=%d\n" , state);
+ hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(device().owner());
slot->irl_w(state);
}
-WRITE_LINE_MEMBER(hp80_io_card_device::halt_w)
+WRITE_LINE_MEMBER(device_hp80_io_interface::halt_w)
{
- LOG("halt_w card=%d\n" , state);
- hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(owner());
+ if (VERBOSE & LOG_GENERAL) device().logerror("halt_w card=%d\n" , state);
+ hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(device().owner());
slot->halt_w(state);
}
diff --git a/src/devices/bus/hp80_io/hp80_io.h b/src/devices/bus/hp80_io/hp80_io.h
index 1e51bf9b8b8..31028d97cdb 100644
--- a/src/devices/bus/hp80_io/hp80_io.h
+++ b/src/devices/bus/hp80_io/hp80_io.h
@@ -30,8 +30,10 @@
void hp80_io_slot_devices(device_slot_interface &device);
+class device_hp80_io_interface;
+
class hp80_io_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp80_io_interface>
{
public:
// construction/destruction
@@ -50,9 +52,6 @@ public:
// configuration helpers
void set_slot_no(unsigned slot_no) { m_slot_no = slot_no; }
- // device-level overrides
- virtual void device_start() override;
-
// Callback setups
auto irl_cb() { return m_irl_cb_func.bind(); }
auto halt_cb() { return m_halt_cb_func.bind(); }
@@ -70,16 +69,21 @@ public:
void inten();
void clear_service();
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
devcb_write8 m_irl_cb_func;
devcb_write8 m_halt_cb_func;
unsigned m_slot_no;
};
-class hp80_io_card_device : public device_t,
- public device_slot_card_interface
+class device_hp80_io_interface : public device_interface
{
public:
+ virtual ~device_hp80_io_interface();
+
// SC getter
uint8_t get_sc() const;
@@ -89,9 +93,7 @@ public:
virtual void clear_service();
protected:
- // construction/destruction
- hp80_io_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp80_io_card_device();
+ device_hp80_io_interface(const machine_config &mconfig, device_t &device);
required_ioport m_select_code_port;
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.cpp b/src/devices/bus/hp80_optroms/hp80_optrom.cpp
index 1816f0c0244..ab6dec10a53 100644
--- a/src/devices/bus/hp80_optroms/hp80_optrom.cpp
+++ b/src/devices/bus/hp80_optroms/hp80_optrom.cpp
@@ -19,12 +19,20 @@
DEFINE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device, "hp80_optrom_cart", "HP80 optional ROM cartridge")
DEFINE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device, "hp80_optrom_slot", "HP80 optional ROM slot")
+// +----------------------------+
+// |device_hp80_optrom_interface|
+// +----------------------------+
+device_hp80_optrom_interface::device_hp80_optrom_interface(const machine_config &config, device_t &device) :
+ device_interface(device, "hp80optrom")
+{
+}
+
// +-----------------------+
// |hp80_optrom_cart_device|
// +-----------------------+
hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this)
+ device_hp80_optrom_interface(mconfig, *this)
{
}
@@ -39,7 +47,7 @@ hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig,
hp80_optrom_slot_device::hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HP80_OPTROM_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_hp80_optrom_interface>(mconfig, *this),
m_cart(nullptr),
m_select_code(0)
{
@@ -59,7 +67,7 @@ void hp80_optrom_slot_device::install_read_handler(address_space& space)
void hp80_optrom_slot_device::device_start()
{
- m_cart = dynamic_cast<hp80_optrom_cart_device *>(get_card_device());
+ m_cart = get_card_device();
}
image_init_result hp80_optrom_slot_device::call_load()
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.h b/src/devices/bus/hp80_optroms/hp80_optrom.h
index 33bd800027c..267e3110290 100644
--- a/src/devices/bus/hp80_optroms/hp80_optrom.h
+++ b/src/devices/bus/hp80_optroms/hp80_optrom.h
@@ -20,8 +20,13 @@ static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
void hp80_optrom_slot_devices(device_slot_interface &device);
-class hp80_optrom_cart_device : public device_t,
- public device_slot_card_interface
+class device_hp80_optrom_interface : public device_interface
+{
+protected:
+ device_hp80_optrom_interface(const machine_config &mconfig, device_t &device);
+};
+
+class hp80_optrom_cart_device : public device_t, public device_hp80_optrom_interface
{
public:
// construction/destruction
@@ -36,7 +41,7 @@ protected:
class hp80_optrom_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp80_optrom_interface>
{
public:
// construction/destruction
@@ -75,7 +80,7 @@ protected:
// slot interface overrides
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
- hp80_optrom_cart_device *m_cart;
+ device_hp80_optrom_interface *m_cart;
uint8_t m_select_code;
};
diff --git a/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp b/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp
index 56e1758ebe0..a94f5d484bf 100644
--- a/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp
+++ b/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp
@@ -37,6 +37,14 @@ constexpr std::array<struct optrom_region , 8> region_tab =
{ 0x5c00 ,0x2000 , "rom5c00" }
}};
+// +------------------------------+
+// |device_hp9825_optrom_interface|
+// +------------------------------+
+device_hp9825_optrom_interface::device_hp9825_optrom_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "hp9825optrom")
+{
+}
+
// +-------------------------+
// |hp9825_optrom_cart_device|
// +-------------------------+
@@ -47,7 +55,7 @@ hp9825_optrom_cart_device::hp9825_optrom_cart_device(const machine_config &mconf
hp9825_optrom_cart_device::hp9825_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_card_interface(mconfig, *this)
+ , device_hp9825_optrom_interface(mconfig, *this)
{
}
@@ -62,7 +70,7 @@ hp9825_optrom_slot_device::hp9825_optrom_slot_device(machine_config const &mconf
hp9825_optrom_slot_device::hp9825_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, HP9825_OPTROM_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_hp9825_optrom_interface>(mconfig, *this)
, m_cart(nullptr)
, m_rom_limit(0xffffU)
, m_loaded_regions(0)
@@ -115,12 +123,12 @@ void hp9825_optrom_slot_device::install_rw_handlers(address_space *space_r , add
void hp9825_optrom_slot_device::device_add_mconfig(machine_config &config)
{
- ADDRESS_MAP_BANK(config , m_bank).set_options(ENDIANNESS_BIG , 16 , 13 , 0x400).set_shift(-1);
+ ADDRESS_MAP_BANK(config, m_bank).set_options(ENDIANNESS_BIG, 16, 13, 0x400).set_shift(-1);
}
void hp9825_optrom_slot_device::device_start()
{
- m_cart = dynamic_cast<hp9825_optrom_cart_device *>(get_card_device());
+ m_cart = get_card_device();
}
image_init_result hp9825_optrom_slot_device::call_load()
diff --git a/src/devices/bus/hp9825_optroms/hp9825_optrom.h b/src/devices/bus/hp9825_optroms/hp9825_optrom.h
index 127710c8340..458e17809c6 100644
--- a/src/devices/bus/hp9825_optroms/hp9825_optrom.h
+++ b/src/devices/bus/hp9825_optroms/hp9825_optrom.h
@@ -12,11 +12,16 @@
#pragma once
-#include "softlist_dev.h"
#include "machine/bankdev.h"
+#include "softlist_dev.h"
+
+class device_hp9825_optrom_interface : public device_interface
+{
+public:
+ device_hp9825_optrom_interface(const machine_config &mconfig, device_t &device);
+};
-class hp9825_optrom_cart_device : public device_t,
- public device_slot_card_interface
+class hp9825_optrom_cart_device : public device_t, public device_hp9825_optrom_interface
{
public:
// construction/destruction
@@ -31,7 +36,7 @@ protected:
class hp9825_optrom_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp9825_optrom_interface>
{
public:
// construction/destruction
@@ -65,7 +70,7 @@ protected:
// slot interface overrides
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
- hp9825_optrom_cart_device *m_cart;
+ device_hp9825_optrom_interface *m_cart;
offs_t m_rom_limit;
unsigned m_loaded_regions;
address_space *m_space_r;
diff --git a/src/devices/bus/hp9845_io/98032.cpp b/src/devices/bus/hp9845_io/98032.cpp
index 221d4e9e176..558f6a60890 100644
--- a/src/devices/bus/hp9845_io/98032.cpp
+++ b/src/devices/bus/hp9845_io/98032.cpp
@@ -47,8 +47,9 @@ DEFINE_DEVICE_TYPE(HP98032_GPIO_LOOPBACK , hp98032_gpio_loopback_device , "hp980
// +----------------------+
hp98032_io_card_device::hp98032_io_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp9845_io_card_device(mconfig , HP98032_IO_CARD , tag , owner , clock)
- , m_gpio(*this , "gpio")
+ : device_t(mconfig, HP98032_IO_CARD, tag, owner, clock)
+ , device_hp9845_io_interface(mconfig, *this)
+ , m_gpio(*this, "gpio")
{
}
@@ -348,7 +349,7 @@ void hp98032_io_card_device::latch_input_LSB()
hp98032_gpio_slot_device::hp98032_gpio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig , HP98032_GPIO_SLOT , tag , owner , clock)
- , device_slot_interface(mconfig , *this)
+ , device_single_card_slot_interface<device_hp98032_gpio_interface>(mconfig , *this)
, m_pflg_handler(*this)
, m_psts_handler(*this)
, m_eir_handler(*this)
@@ -366,7 +367,7 @@ hp98032_gpio_slot_device::~hp98032_gpio_slot_device()
uint16_t hp98032_gpio_slot_device::get_jumpers() const
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
return card->get_jumpers();
} else {
@@ -376,7 +377,7 @@ uint16_t hp98032_gpio_slot_device::get_jumpers() const
uint16_t hp98032_gpio_slot_device::input_r() const
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
return card->input_r();
} else {
@@ -386,7 +387,7 @@ uint16_t hp98032_gpio_slot_device::input_r() const
uint8_t hp98032_gpio_slot_device::ext_status_r() const
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
return card->ext_status_r();
} else {
@@ -396,7 +397,7 @@ uint8_t hp98032_gpio_slot_device::ext_status_r() const
void hp98032_gpio_slot_device::output_w(uint16_t data)
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
card->output_w(data);
}
@@ -404,7 +405,7 @@ void hp98032_gpio_slot_device::output_w(uint16_t data)
void hp98032_gpio_slot_device::ext_control_w(uint8_t data)
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
card->ext_control_w(data);
}
@@ -427,7 +428,7 @@ WRITE_LINE_MEMBER(hp98032_gpio_slot_device::eir_w)
WRITE_LINE_MEMBER(hp98032_gpio_slot_device::pctl_w)
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
card->pctl_w(state);
}
@@ -435,7 +436,7 @@ WRITE_LINE_MEMBER(hp98032_gpio_slot_device::pctl_w)
WRITE_LINE_MEMBER(hp98032_gpio_slot_device::io_w)
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
card->io_w(state);
}
@@ -443,7 +444,7 @@ WRITE_LINE_MEMBER(hp98032_gpio_slot_device::io_w)
WRITE_LINE_MEMBER(hp98032_gpio_slot_device::preset_w)
{
- hp98032_gpio_card_device *card = downcast<hp98032_gpio_card_device*>(get_card_device());
+ device_hp98032_gpio_interface *card = get_card_device();
if (card != nullptr) {
card->preset_w(state);
}
@@ -466,35 +467,34 @@ void hp98032_gpio_slot_device::device_reset()
}
}
-// +------------------------+
-// |hp98032_gpio_card_device|
-// +------------------------+
+// +-----------------------------+
+// |device_hp98032_gpio_interface|
+// +-----------------------------+
-hp98032_gpio_card_device::hp98032_gpio_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig , type , tag , owner , clock)
- , device_slot_card_interface(mconfig , *this)
+device_hp98032_gpio_interface::device_hp98032_gpio_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "hp98032gpio")
{
}
-hp98032_gpio_card_device::~hp98032_gpio_card_device()
+device_hp98032_gpio_interface::~device_hp98032_gpio_interface()
{
}
-WRITE_LINE_MEMBER(hp98032_gpio_card_device::pflg_w)
+WRITE_LINE_MEMBER(device_hp98032_gpio_interface::pflg_w)
{
- hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(owner());
+ hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(device().owner());
slot->pflg_w(state);
}
-WRITE_LINE_MEMBER(hp98032_gpio_card_device::psts_w)
+WRITE_LINE_MEMBER(device_hp98032_gpio_interface::psts_w)
{
- hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(owner());
+ hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(device().owner());
slot->psts_w(state);
}
-WRITE_LINE_MEMBER(hp98032_gpio_card_device::eir_w)
+WRITE_LINE_MEMBER(device_hp98032_gpio_interface::eir_w)
{
- hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(owner());
+ hp98032_gpio_slot_device *slot = downcast<hp98032_gpio_slot_device*>(device().owner());
slot->eir_w(state);
}
@@ -503,7 +503,8 @@ WRITE_LINE_MEMBER(hp98032_gpio_card_device::eir_w)
// +----------------------------+
hp98032_gpio_loopback_device::hp98032_gpio_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp98032_gpio_card_device(mconfig, HP98032_GPIO_LOOPBACK, tag, owner, clock)
+ : device_t(mconfig, HP98032_GPIO_LOOPBACK, tag, owner, clock)
+ , device_hp98032_gpio_interface(mconfig, *this)
{
}
diff --git a/src/devices/bus/hp9845_io/98032.h b/src/devices/bus/hp9845_io/98032.h
index 94013ca589f..4eaa33ec786 100644
--- a/src/devices/bus/hp9845_io/98032.h
+++ b/src/devices/bus/hp9845_io/98032.h
@@ -14,9 +14,11 @@
#pragma once
#include "hp9845_io.h"
+
+class device_hp98032_gpio_interface;
class hp98032_gpio_slot_device;
-class hp98032_io_card_device : public hp9845_io_card_device
+class hp98032_io_card_device : public device_t, public device_hp9845_io_interface
{
public:
// construction/destruction
@@ -61,7 +63,7 @@ private:
// The GPIO interface of HP98032 cards
class hp98032_gpio_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp98032_gpio_interface>
{
public:
// construction/destruction
@@ -134,10 +136,11 @@ private:
};
// A device connected to GPIO port of HP98032
-class hp98032_gpio_card_device : public device_t,
- public device_slot_card_interface
+class device_hp98032_gpio_interface : public device_interface
{
public:
+ virtual ~device_hp98032_gpio_interface();
+
virtual uint16_t get_jumpers() const = 0;
virtual uint16_t input_r() const = 0;
virtual uint8_t ext_status_r() const = 0;
@@ -148,9 +151,7 @@ public:
virtual DECLARE_WRITE_LINE_MEMBER(preset_w) = 0;
protected:
- // construction/destruction
- hp98032_gpio_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp98032_gpio_card_device();
+ device_hp98032_gpio_interface(const machine_config &mconfig, device_t &device);
DECLARE_WRITE_LINE_MEMBER(pflg_w);
DECLARE_WRITE_LINE_MEMBER(psts_w);
@@ -158,7 +159,7 @@ protected:
};
// GPIO loopback connector for HP98032
-class hp98032_gpio_loopback_device : public hp98032_gpio_card_device
+class hp98032_gpio_loopback_device : public device_t, public device_hp98032_gpio_interface
{
public:
// construction/destruction
@@ -178,6 +179,7 @@ protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
+
private:
uint16_t m_output;
uint8_t m_ext_control;
diff --git a/src/devices/bus/hp9845_io/98034.cpp b/src/devices/bus/hp9845_io/98034.cpp
index 388e10c469f..57ba7a57191 100644
--- a/src/devices/bus/hp9845_io/98034.cpp
+++ b/src/devices/bus/hp9845_io/98034.cpp
@@ -29,7 +29,8 @@
#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
hp98034_io_card_device::hp98034_io_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp9845_io_card_device(mconfig , HP98034_IO_CARD , tag , owner , clock),
+ : device_t(mconfig , HP98034_IO_CARD , tag , owner , clock),
+ device_hp9845_io_interface(mconfig, *this),
m_cpu(*this , "np"),
m_sw1(*this , "sw1"),
m_ieee488(*this , IEEE488_TAG)
@@ -102,8 +103,6 @@ void hp98034_io_card_device::device_start()
void hp98034_io_card_device::device_reset()
{
- hp9845_io_card_device::device_reset();
-
m_idr = 0;
m_odr = 0;
m_force_flg = false;
diff --git a/src/devices/bus/hp9845_io/98034.h b/src/devices/bus/hp9845_io/98034.h
index 16cf334894b..aeb7e6d5de4 100644
--- a/src/devices/bus/hp9845_io/98034.h
+++ b/src/devices/bus/hp9845_io/98034.h
@@ -17,7 +17,7 @@
#include "cpu/nanoprocessor/nanoprocessor.h"
#include "bus/ieee488/ieee488.h"
-class hp98034_io_card_device : public hp9845_io_card_device
+class hp98034_io_card_device : public device_t, public device_hp9845_io_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/hp9845_io/98035.cpp b/src/devices/bus/hp9845_io/98035.cpp
index 891ff92a167..ca57e6a1014 100644
--- a/src/devices/bus/hp9845_io/98035.cpp
+++ b/src/devices/bus/hp9845_io/98035.cpp
@@ -143,7 +143,8 @@ static const uint8_t dec_2_seven_segs[] = {
};
hp98035_io_card_device::hp98035_io_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp9845_io_card_device(mconfig , HP98035_IO_CARD , tag , owner , clock),
+ : device_t(mconfig , HP98035_IO_CARD , tag , owner , clock),
+ device_hp9845_io_interface(mconfig, *this),
device_rtc_interface(mconfig , *this),
m_cpu(*this , "np")
{
@@ -191,8 +192,6 @@ void hp98035_io_card_device::device_start()
void hp98035_io_card_device::device_reset()
{
- hp9845_io_card_device::device_reset();
-
m_idr_full = false;
m_idr = 0;
m_odr = 0;
diff --git a/src/devices/bus/hp9845_io/98035.h b/src/devices/bus/hp9845_io/98035.h
index 40f91883406..7cad3122a55 100644
--- a/src/devices/bus/hp9845_io/98035.h
+++ b/src/devices/bus/hp9845_io/98035.h
@@ -17,7 +17,7 @@
#include "cpu/nanoprocessor/nanoprocessor.h"
#include "dirtc.h"
-class hp98035_io_card_device : public hp9845_io_card_device, public device_rtc_interface
+class hp98035_io_card_device : public device_t, public device_hp9845_io_interface, public device_rtc_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/hp9845_io/98046.cpp b/src/devices/bus/hp9845_io/98046.cpp
index 6a45a83e3df..16222939e8a 100644
--- a/src/devices/bus/hp9845_io/98046.cpp
+++ b/src/devices/bus/hp9845_io/98046.cpp
@@ -65,11 +65,12 @@ enum {
DEFINE_DEVICE_TYPE(HP98046_IO_CARD, hp98046_io_card_device , "hp98046" , "HP98046 card")
hp98046_io_card_device::hp98046_io_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp9845_io_card_device(mconfig , HP98046_IO_CARD , tag , owner , clock)
- , m_cpu(*this , "cpu")
- , m_sio(*this , "sio")
- , m_rs232(*this , "rs232")
- , m_loopback_en(*this , "loop")
+ : device_t(mconfig, HP98046_IO_CARD, tag, owner, clock)
+ , device_hp9845_io_interface(mconfig, *this)
+ , m_cpu(*this, "cpu")
+ , m_sio(*this, "sio")
+ , m_rs232(*this, "rs232")
+ , m_loopback_en(*this, "loop")
{
}
@@ -194,7 +195,7 @@ void hp98046_io_card_device::device_add_mconfig(machine_config &config)
m_rs232->dcd_handler().set(FUNC(hp98046_io_card_device::rs232_dcd_w));
m_rs232->dsr_handler().set(FUNC(hp98046_io_card_device::rs232_dsr_w));
m_rs232->cts_handler().set(FUNC(hp98046_io_card_device::rs232_cts_w));
- config.m_minimum_quantum = attotime::from_hz(5000);
+ config.set_maximum_quantum(attotime::from_hz(5000));
}
static INPUT_PORTS_START(hp98046_port)
diff --git a/src/devices/bus/hp9845_io/98046.h b/src/devices/bus/hp9845_io/98046.h
index 7b6f9f1669d..c58b72fd857 100644
--- a/src/devices/bus/hp9845_io/98046.h
+++ b/src/devices/bus/hp9845_io/98046.h
@@ -18,7 +18,7 @@
#include "machine/z80sio.h"
#include "bus/rs232/rs232.h"
-class hp98046_io_card_device : public hp9845_io_card_device
+class hp98046_io_card_device : public device_t, public device_hp9845_io_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/hp9845_io/hp9845_io.cpp b/src/devices/bus/hp9845_io/hp9845_io.cpp
index a8e1d43c8bc..efb9124c317 100644
--- a/src/devices/bus/hp9845_io/hp9845_io.cpp
+++ b/src/devices/bus/hp9845_io/hp9845_io.cpp
@@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(HP9845_IO_SLOT, hp9845_io_slot_device, "hp98x5_io_slot", "HP9
// +---------------------+
hp9845_io_slot_device::hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HP9845_IO_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_hp9845_io_interface>(mconfig, *this),
m_irq_cb_func(*this),
m_sts_cb_func(*this),
m_flg_cb_func(*this),
@@ -55,10 +55,10 @@ void hp9845_io_slot_device::device_start()
m_flg_nextsc_cb_func.resolve_safe();
m_dmar_cb_func.resolve_safe();
- hp9845_io_card_device *card = dynamic_cast<hp9845_io_card_device*>(get_card_device());
+ device_hp9845_io_interface *card = get_card_device();
if (card != nullptr) {
- card->set_slot_device(this);
+ card->set_slot_device(*this);
}
}
@@ -99,11 +99,11 @@ WRITE_LINE_MEMBER(hp9845_io_slot_device::dmar_w)
int hp9845_io_slot_device::get_rw_handlers(read16_delegate& rhandler , write16_delegate& whandler)
{
- hp9845_io_card_device *card = dynamic_cast<hp9845_io_card_device*>(get_card_device());
+ device_hp9845_io_interface *card = get_card_device();
if (card) {
- rhandler = read16_delegate(*card, FUNC(hp9845_io_card_device::reg_r));
- whandler = write16_delegate(*card, FUNC(hp9845_io_card_device::reg_w));
+ rhandler = read16_delegate(*card, FUNC(device_hp9845_io_interface::reg_r));
+ whandler = write16_delegate(*card, FUNC(device_hp9845_io_interface::reg_w));
return card->get_sc();
} else {
return -1;
@@ -112,7 +112,7 @@ int hp9845_io_slot_device::get_rw_handlers(read16_delegate& rhandler , write16_d
bool hp9845_io_slot_device::has_dual_sc() const
{
- hp9845_io_card_device *card = dynamic_cast<hp9845_io_card_device*>(get_card_device());
+ device_hp9845_io_interface *card = get_card_device();
if (card) {
return card->has_dual_sc();
@@ -121,79 +121,84 @@ bool hp9845_io_slot_device::has_dual_sc() const
}
}
-// +---------------------+
-// |hp9845_io_card_device|
-// +---------------------+
-void hp9845_io_card_device::set_slot_device(hp9845_io_slot_device* dev)
+// +--------------------------+
+// |device_hp9845_io_interface|
+// +--------------------------+
+void device_hp9845_io_interface::set_slot_device(hp9845_io_slot_device &dev)
{
- m_slot_dev = dev;
+ m_slot_dev = &dev;
}
-uint8_t hp9845_io_card_device::get_sc()
+uint8_t device_hp9845_io_interface::get_sc()
{
return m_select_code_port->read() + HP9845_IO_FIRST_SC;
}
-bool hp9845_io_card_device::has_dual_sc() const
+bool device_hp9845_io_interface::has_dual_sc() const
{
return false;
}
-hp9845_io_card_device::hp9845_io_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this),
+device_hp9845_io_interface::device_hp9845_io_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "hp9845io"),
m_slot_dev(nullptr),
m_select_code_port(*this , "SC")
{
}
-hp9845_io_card_device::~hp9845_io_card_device()
+device_hp9845_io_interface::~device_hp9845_io_interface()
+{
+}
+
+void device_hp9845_io_interface::interface_pre_start()
{
+ if (!m_slot_dev)
+ throw device_missing_dependencies();
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::irq_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::irq_w)
{
if (m_slot_dev) {
m_slot_dev->irq_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::sts_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::sts_w)
{
if (m_slot_dev) {
m_slot_dev->sts_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::flg_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::flg_w)
{
if (m_slot_dev) {
m_slot_dev->flg_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::irq_nextsc_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::irq_nextsc_w)
{
if (m_slot_dev) {
m_slot_dev->irq_nextsc_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::sts_nextsc_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::sts_nextsc_w)
{
if (m_slot_dev) {
m_slot_dev->sts_nextsc_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::flg_nextsc_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::flg_nextsc_w)
{
if (m_slot_dev) {
m_slot_dev->flg_nextsc_w(state);
}
}
-WRITE_LINE_MEMBER(hp9845_io_card_device::dmar_w)
+WRITE_LINE_MEMBER(device_hp9845_io_interface::dmar_w)
{
if (m_slot_dev) {
m_slot_dev->dmar_w(state);
diff --git a/src/devices/bus/hp9845_io/hp9845_io.h b/src/devices/bus/hp9845_io/hp9845_io.h
index b3018f7edf8..75a786afde0 100644
--- a/src/devices/bus/hp9845_io/hp9845_io.h
+++ b/src/devices/bus/hp9845_io/hp9845_io.h
@@ -31,17 +31,16 @@
PORT_CONFSETTING(10 , "11")\
PORT_CONFSETTING(11 , "12")
+class device_hp9845_io_interface;
+
class hp9845_io_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp9845_io_interface>
{
public:
// construction/destruction
hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~hp9845_io_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// Callback setups
auto irq() { return m_irq_cb_func.bind(); }
auto sts() { return m_sts_cb_func.bind(); }
@@ -66,6 +65,10 @@ public:
bool has_dual_sc() const;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
devcb_write_line m_irq_cb_func;
devcb_write_line m_sts_cb_func;
@@ -76,11 +79,10 @@ private:
devcb_write_line m_dmar_cb_func;
};
-class hp9845_io_card_device : public device_t,
- public device_slot_card_interface
+class device_hp9845_io_interface : public device_interface
{
public:
- void set_slot_device(hp9845_io_slot_device* dev);
+ void set_slot_device(hp9845_io_slot_device &dev);
virtual DECLARE_READ16_MEMBER(reg_r) = 0;
virtual DECLARE_WRITE16_MEMBER(reg_w) = 0;
@@ -92,8 +94,10 @@ public:
protected:
// construction/destruction
- hp9845_io_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp9845_io_card_device();
+ device_hp9845_io_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_hp9845_io_interface();
+
+ virtual void interface_pre_start() override;
hp9845_io_slot_device *m_slot_dev;
required_ioport m_select_code_port;
diff --git a/src/devices/bus/hp9845_io/hp9885.cpp b/src/devices/bus/hp9845_io/hp9885.cpp
index e3b407d2976..f54b4973c44 100644
--- a/src/devices/bus/hp9845_io/hp9885.cpp
+++ b/src/devices/bus/hp9845_io/hp9885.cpp
@@ -225,7 +225,8 @@ enum : unsigned {
};
hp9885_device::hp9885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp98032_gpio_card_device(mconfig , HP9885 , tag , owner , clock)
+ : device_t(mconfig , HP9885 , tag , owner , clock)
+ , device_hp98032_gpio_interface(mconfig, *this)
, m_drive_connector{*this , "floppy"}
{
}
diff --git a/src/devices/bus/hp9845_io/hp9885.h b/src/devices/bus/hp9845_io/hp9885.h
index edb705c2504..be3c56d3128 100644
--- a/src/devices/bus/hp9845_io/hp9885.h
+++ b/src/devices/bus/hp9845_io/hp9885.h
@@ -17,7 +17,7 @@
#include "imagedev/floppy.h"
#include "machine/fdc_pll.h"
-class hp9885_device : public hp98032_gpio_card_device
+class hp9885_device : public device_t, public device_hp98032_gpio_interface
{
public:
hp9885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp
index c2cbfa8e941..d37ebb3a34c 100644
--- a/src/devices/bus/hp_dio/hp_dio.cpp
+++ b/src/devices/bus/hp_dio/hp_dio.cpp
@@ -300,7 +300,7 @@ void device_dio16_card_interface::set_bus(dio16_device &bus)
//**************************************************************************
device_dio16_card_interface::device_dio16_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "hpdio"),
m_dio_dev(nullptr), m_next(nullptr)
{
}
diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h
index ee680b08d4b..6344f95b3a8 100644
--- a/src/devices/bus/hp_dio/hp_dio.h
+++ b/src/devices/bus/hp_dio/hp_dio.h
@@ -17,13 +17,13 @@
#pragma once
-namespace bus {
- namespace hp_dio {
+namespace bus { namespace hp_dio {
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
+class device_dio16_card_interface;
class dio16_device;
class dio16_slot_device : public device_t, public device_slot_interface
@@ -57,7 +57,6 @@ protected:
required_device<dio16_device> m_dio;
};
-class device_dio16_card_interface;
// ======================> dio16_device
class dio16_device : public device_t
{
@@ -162,7 +161,7 @@ protected:
// ======================> device_dio16_card_interface
// class representing interface-specific live dio16 card
-class device_dio16_card_interface : public device_slot_card_interface
+class device_dio16_card_interface : public device_interface
{
friend class dio16_device;
template <class ElementType> friend class simple_list;
@@ -280,8 +279,8 @@ protected:
dio32_device &dio() { assert(m_dio_dev); return downcast<dio32_device &>(*m_dio_dev); }
};
-} // namespace bus::hp_dio
-} // namespace bus
+
+} } // namespace bus::hp_dio
// device type definition
DECLARE_DEVICE_TYPE_NS(DIO16_SLOT, bus::hp_dio, dio16_slot_device)
diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp
index 2e8a904c97b..8d03d40c224 100644
--- a/src/devices/bus/hp_hil/hp_hil.cpp
+++ b/src/devices/bus/hp_hil/hp_hil.cpp
@@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE(HP_HIL_SLOT, hp_hil_slot_device, "hp_hil_slot", "HP-HIL Slot"
//-------------------------------------------------
hp_hil_slot_device::hp_hil_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, HP_HIL_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_hp_hil_interface>(mconfig, *this)
, m_mlc(*this, finder_base::DUMMY_TAG)
{
}
@@ -39,7 +39,7 @@ hp_hil_slot_device::hp_hil_slot_device(const machine_config &mconfig, const char
void hp_hil_slot_device::device_start()
{
- device_hp_hil_interface *dev = dynamic_cast<device_hp_hil_interface *>(get_card_device());
+ device_hp_hil_interface *dev = get_card_device();
if (dev)
dev->set_hp_hil_mlc(*m_mlc);
}
@@ -57,13 +57,13 @@ DEFINE_DEVICE_TYPE(HP_HIL_MLC, hp_hil_mlc_device, "hp_hil_mlc", "HP-HIL Master L
//-------------------------------------------------
hp_hil_mlc_device::hp_hil_mlc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, HP_HIL_MLC, tag, owner, clock)
+ , m_loop(1)
, int_cb(*this)
, nmi_cb(*this)
{
- m_loop = 1;
}
-void hp_hil_mlc_device::add_hp_hil_device( device_hp_hil_interface *device )
+void hp_hil_mlc_device::add_hp_hil_device(device_hp_hil_interface *device)
{
m_device_list.append(*device);
}
@@ -242,7 +242,7 @@ WRITE_LINE_MEMBER(hp_hil_mlc_device::ap_w)
//-------------------------------------------------
device_hp_hil_interface::device_hp_hil_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "hphil")
, m_hp_hil_mlc(nullptr)
, m_next(nullptr)
{
diff --git a/src/devices/bus/hp_hil/hp_hil.h b/src/devices/bus/hp_hil/hp_hil.h
index 7ec8335a8fb..d8d9f90e536 100644
--- a/src/devices/bus/hp_hil/hp_hil.h
+++ b/src/devices/bus/hp_hil/hp_hil.h
@@ -79,10 +79,11 @@
// TYPE DEFINITIONS
//**************************************************************************
+class device_hp_hil_interface;
class hp_hil_mlc_device;
-class hp_hil_slot_device : public device_t, public device_slot_interface
+class hp_hil_slot_device : public device_t, public device_single_card_slot_interface<device_hp_hil_interface>
{
public:
// construction/destruction
@@ -111,9 +112,7 @@ protected:
DECLARE_DEVICE_TYPE(HP_HIL_SLOT, hp_hil_slot_device)
-class device_hp_hil_interface;
-
-class hp_hil_mlc_device : public device_t
+class hp_hil_mlc_device : public device_t
{
public:
// construction/destruction
@@ -153,7 +152,7 @@ DECLARE_DEVICE_TYPE(HP_HIL_MLC, hp_hil_mlc_device)
// ======================> device_hp_hil_interface
-class device_hp_hil_interface : public device_slot_card_interface
+class device_hp_hil_interface : public device_interface
{
friend class hp_hil_mlc_device;
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/hp_optroms/hp_optrom.cpp b/src/devices/bus/hp_optroms/hp_optrom.cpp
index fc54a168c83..5c19c089111 100644
--- a/src/devices/bus/hp_optroms/hp_optrom.cpp
+++ b/src/devices/bus/hp_optroms/hp_optrom.cpp
@@ -16,12 +16,20 @@
DEFINE_DEVICE_TYPE(HP_OPTROM_CART, hp_optrom_cart_device, "hp_optrom_cart", "HP9845 optional ROM cartridge")
DEFINE_DEVICE_TYPE(HP_OPTROM_SLOT, hp_optrom_slot_device, "hp_optrom_slot", "HP9845 optional ROM slot")
+// +--------------------------+
+// |device_hp_optrom_interface|
+// +--------------------------+
+device_hp_optrom_interface::device_hp_optrom_interface(const machine_config &config, device_t &device) :
+ device_interface(device, "hpoptrom")
+{
+}
+
// +---------------------+
// |hp_optrom_cart_device|
// +---------------------+
hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this)
+ device_hp_optrom_interface(mconfig, *this)
{
}
@@ -36,7 +44,7 @@ hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, cons
hp_optrom_slot_device::hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HP_OPTROM_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_hp_optrom_interface>(mconfig, *this),
m_cart(nullptr),
m_base_addr(0),
m_end_addr(0)
@@ -53,63 +61,63 @@ hp_optrom_slot_device::~hp_optrom_slot_device()
void hp_optrom_slot_device::device_start()
{
- m_cart = dynamic_cast<hp_optrom_cart_device *>(get_card_device());
+ m_cart = get_card_device();
}
image_init_result hp_optrom_slot_device::call_load()
{
- logerror("hp_optrom: call_load\n");
- if (m_cart == nullptr || !loaded_through_softlist()) {
- logerror("hp_optrom: must be loaded from sw list\n");
- return image_init_result::FAIL;
- }
-
- const char *base_feature = get_feature("base");
- if (base_feature == nullptr) {
- logerror("hp_optrom: no 'base' feature\n");
- return image_init_result::FAIL;
- }
-
- offs_t base_addr;
- if (base_feature[ 0 ] != '0' || base_feature[ 1 ] != 'x' || sscanf(&base_feature[ 2 ] , "%x" , &base_addr) != 1) {
- logerror("hp_optrom: can't parse 'base' feature\n");
- return image_init_result::FAIL;
- }
-
- // Valid BSC values for ROMs on LPU drawer: 0x07 0x0b .... 0x3b
- // Valid BSC values for ROMs on PPU drawer: 0x09 0x0d .... 0x3d
- // (BSC is field in bits 16..21 of base address)
- // Bit 15 of base address must be 0
- // Base address must be multiple of 0x1000
- if ((base_addr & ~0x3f7000UL) != 0 || ((base_addr & 0x30000) != 0x10000 && (base_addr & 0x30000) != 0x30000) || base_addr < 0x70000) {
- logerror("hp_optrom: illegal base address (%x)\n" , base_addr);
- return image_init_result::FAIL;
- }
-
- auto length = get_software_region_length("rom") / 2;
-
- if (length < 0x1000 || length > 0x8000 || (length & 0xfff) != 0 || ((base_addr & 0x7000) + length) > 0x8000) {
- logerror("hp_optrom: illegal region length (%x)\n" , length);
- return image_init_result::FAIL;
- }
-
- offs_t end_addr = base_addr + length - 1;
- logerror("hp_optrom: base_addr = %06x end_addr = %06x\n" , base_addr , end_addr);
-
- m_content.resize(length * 2);
- uint8_t *buffer = m_content.data();
- memcpy(buffer , get_software_region("rom") , length * 2);
-
- // Install ROM in address space of every CPU
- for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
- logerror("hp_optrom: install in %s AS\n" , cpu.tag());
- cpu.space(AS_PROGRAM).install_rom(base_addr , end_addr , buffer);
- }
-
- m_base_addr = base_addr;
- m_end_addr = end_addr;
-
- return image_init_result::PASS;
+ logerror("hp_optrom: call_load\n");
+ if (m_cart == nullptr || !loaded_through_softlist()) {
+ logerror("hp_optrom: must be loaded from sw list\n");
+ return image_init_result::FAIL;
+ }
+
+ const char *base_feature = get_feature("base");
+ if (base_feature == nullptr) {
+ logerror("hp_optrom: no 'base' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ offs_t base_addr;
+ if (base_feature[ 0 ] != '0' || base_feature[ 1 ] != 'x' || sscanf(&base_feature[ 2 ] , "%x" , &base_addr) != 1) {
+ logerror("hp_optrom: can't parse 'base' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ // Valid BSC values for ROMs on LPU drawer: 0x07 0x0b .... 0x3b
+ // Valid BSC values for ROMs on PPU drawer: 0x09 0x0d .... 0x3d
+ // (BSC is field in bits 16..21 of base address)
+ // Bit 15 of base address must be 0
+ // Base address must be multiple of 0x1000
+ if ((base_addr & ~0x3f7000UL) != 0 || ((base_addr & 0x30000) != 0x10000 && (base_addr & 0x30000) != 0x30000) || base_addr < 0x70000) {
+ logerror("hp_optrom: illegal base address (%x)\n" , base_addr);
+ return image_init_result::FAIL;
+ }
+
+ auto length = get_software_region_length("rom") / 2;
+
+ if (length < 0x1000 || length > 0x8000 || (length & 0xfff) != 0 || ((base_addr & 0x7000) + length) > 0x8000) {
+ logerror("hp_optrom: illegal region length (%x)\n" , length);
+ return image_init_result::FAIL;
+ }
+
+ offs_t end_addr = base_addr + length - 1;
+ logerror("hp_optrom: base_addr = %06x end_addr = %06x\n" , base_addr , end_addr);
+
+ m_content.resize(length * 2);
+ uint8_t *buffer = m_content.data();
+ memcpy(buffer , get_software_region("rom") , length * 2);
+
+ // Install ROM in address space of every CPU
+ for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
+ logerror("hp_optrom: install in %s AS\n" , cpu.tag());
+ cpu.space(AS_PROGRAM).install_rom(base_addr , end_addr , buffer);
+ }
+
+ m_base_addr = base_addr;
+ m_end_addr = end_addr;
+
+ return image_init_result::PASS;
}
void hp_optrom_slot_device::call_unload()
diff --git a/src/devices/bus/hp_optroms/hp_optrom.h b/src/devices/bus/hp_optroms/hp_optrom.h
index 9b507ba64eb..67b85cfc9aa 100644
--- a/src/devices/bus/hp_optroms/hp_optrom.h
+++ b/src/devices/bus/hp_optroms/hp_optrom.h
@@ -16,8 +16,13 @@
#include "softlist_dev.h"
-class hp_optrom_cart_device : public device_t,
- public device_slot_card_interface
+class device_hp_optrom_interface : public device_interface
+{
+protected:
+ device_hp_optrom_interface(const machine_config &mconfig, device_t &device);
+};
+
+class hp_optrom_cart_device : public device_t, public device_hp_optrom_interface
{
public:
// construction/destruction
@@ -32,7 +37,7 @@ protected:
class hp_optrom_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_hp_optrom_interface>
{
public:
// construction/destruction
@@ -60,7 +65,7 @@ protected:
// slot interface overrides
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
- hp_optrom_cart_device *m_cart;
+ device_hp_optrom_interface *m_cart;
std::vector<uint8_t> m_content;
offs_t m_base_addr;
offs_t m_end_addr;
diff --git a/src/devices/bus/ieee488/c2031.cpp b/src/devices/bus/ieee488/c2031.cpp
index fe488bde1f4..20abb161352 100644
--- a/src/devices/bus/ieee488/c2031.cpp
+++ b/src/devices/bus/ieee488/c2031.cpp
@@ -298,7 +298,7 @@ void c2031_device::device_add_mconfig(machine_config &config)
{
M6502(config, m_maincpu, XTAL(16'000'000)/16);
m_maincpu->set_addrmap(AS_PROGRAM, &c2031_device::c2031_mem);
- config.m_perfect_cpu_quantum = subtag(M6502_TAG);
+ //config.set_perfect_quantum(m_maincpu); FIXME: not safe in a slot device - add barriers
VIA6522(config, m_via0, XTAL(16'000'000)/16);
m_via0->readpa_handler().set(FUNC(c2031_device::via0_pa_r));
diff --git a/src/devices/bus/ieee488/hp9122c.cpp b/src/devices/bus/ieee488/hp9122c.cpp
index 808deae2069..9217d9eda76 100644
--- a/src/devices/bus/ieee488/hp9122c.cpp
+++ b/src/devices/bus/ieee488/hp9122c.cpp
@@ -381,9 +381,8 @@ void hp9122c_device::device_add_mconfig(machine_config &config)
MC6809(config, m_cpu, XTAL(8'000'000));
m_cpu->set_addrmap(AS_PROGRAM, &hp9122c_device::cpu_map);
- // without this flag, 'DMA' transfer via SYNC instruction
- // will not work
- config.m_perfect_cpu_quantum = subtag("cpu");
+ // without this flag, 'DMA' transfer via SYNC instruction will not work
+ //config.set_perfect_quantum(m_cpu); FIXME: not safe in a slot device - add barriers
MB8876(config, m_fdc, 8_MHz_XTAL / 4);
m_fdc->intrq_wr_callback().set(FUNC(hp9122c_device::fdc_intrq_w));
diff --git a/src/devices/bus/ieee488/ieee488.cpp b/src/devices/bus/ieee488/ieee488.cpp
index 6228136e1cd..77a5650333a 100644
--- a/src/devices/bus/ieee488/ieee488.cpp
+++ b/src/devices/bus/ieee488/ieee488.cpp
@@ -41,7 +41,7 @@ DEFINE_DEVICE_TYPE(IEEE488_SLOT, ieee488_slot_device, "ieee488_slot", "IEEE-488
//-------------------------------------------------
device_ieee488_interface::device_ieee488_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device), m_bus(nullptr), m_slot(nullptr), m_next(nullptr)
+ : device_interface(device, "ieee488"), m_bus(nullptr), m_slot(nullptr), m_next(nullptr)
{
}
diff --git a/src/devices/bus/ieee488/ieee488.h b/src/devices/bus/ieee488/ieee488.h
index cb29783d294..d960d17bacf 100644
--- a/src/devices/bus/ieee488/ieee488.h
+++ b/src/devices/bus/ieee488/ieee488.h
@@ -209,7 +209,7 @@ protected:
// ======================> device_ieee488_interface
-class device_ieee488_interface : public device_slot_card_interface
+class device_ieee488_interface : public device_interface
{
friend class ieee488_device;
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/imi7000/imi7000.cpp b/src/devices/bus/imi7000/imi7000.cpp
index f96e32d3da5..3c9e417867b 100644
--- a/src/devices/bus/imi7000/imi7000.cpp
+++ b/src/devices/bus/imi7000/imi7000.cpp
@@ -37,7 +37,8 @@ DEFINE_DEVICE_TYPE(IMI7000_SLOT, imi7000_slot_device, "imi7000_slot", "IMI7000 s
//-------------------------------------------------
device_imi7000_interface::device_imi7000_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device), m_slot(nullptr)
+ : device_interface(device, "imi7000bus")
+ , m_slot(nullptr)
{
}
@@ -53,7 +54,7 @@ device_imi7000_interface::device_imi7000_interface(const machine_config &mconfig
imi7000_slot_device::imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, IMI7000_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_imi7000_interface>(mconfig, *this)
, m_card(nullptr)
{
}
@@ -79,10 +80,18 @@ void imi7000_slot_device::device_start()
imi7000_bus_device::imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, IMI7000_BUS, tag, owner, clock)
+ , m_units(*this, "%u", 0U)
{
}
+void imi7000_bus_device::device_add_mconfig(machine_config &config)
+{
+ for (auto &unit : m_units)
+ IMI7000_SLOT(config, unit, imi7000_devices, nullptr);
+}
+
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/imi7000/imi7000.h b/src/devices/bus/imi7000/imi7000.h
index 38de3341ae5..c1cf590091c 100644
--- a/src/devices/bus/imi7000/imi7000.h
+++ b/src/devices/bus/imi7000/imi7000.h
@@ -36,77 +36,68 @@ void imi7000_devices(device_slot_interface &device);
DECLARE_DEVICE_TYPE(IMI7000_BUS, imi7000_bus_device)
DECLARE_DEVICE_TYPE(IMI7000_SLOT, imi7000_slot_device)
-//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define IMI7000_BUS_TAG "imi7000"
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-class imi7000_slot_device;
class device_imi7000_interface;
-// ======================> imi7000_bus_device
+// ======================> imi7000_slot_device
-class imi7000_bus_device : public device_t
+class imi7000_slot_device : public device_t, public device_single_card_slot_interface<device_imi7000_interface>
{
public:
// construction/destruction
- imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
-
- template <typename T, typename U, typename V, typename W>
- static void add_config(machine_config &config, T &&_def_slot1, U &&_def_slot2, V &&_def_slot3, W &&_def_slot4)
+ template <typename T>
+ imi7000_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : imi7000_slot_device(mconfig, tag, owner, (uint32_t)0)
{
- IMI7000_BUS(config, IMI7000_BUS_TAG);
- IMI7000_SLOT(config, IMI7000_BUS_TAG":0", imi7000_devices, std::forward<T>(_def_slot1));
- IMI7000_SLOT(config, IMI7000_BUS_TAG":1", imi7000_devices, std::forward<U>(_def_slot2));
- IMI7000_SLOT(config, IMI7000_BUS_TAG":2", imi7000_devices, std::forward<V>(_def_slot3));
- IMI7000_SLOT(config, IMI7000_BUS_TAG":3", imi7000_devices, std::forward<W>(_def_slot4));
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
}
+ imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
- imi7000_slot_device *m_unit[4];
+ device_imi7000_interface *m_card;
};
-// ======================> imi7000_slot_device
+// ======================> imi7000_bus_device
-class imi7000_slot_device : public device_t,
- public device_slot_interface
+class imi7000_bus_device : public device_t
{
public:
// construction/destruction
- template <typename T>
- imi7000_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
- : imi7000_slot_device(mconfig, tag, owner, (uint32_t)0)
+ imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+
+ template <typename T, typename U, typename V, typename W>
+ void set_slot_default_options(T &&def1, U &&def2, V &&def3, W &&def4)
{
- option_reset();
- opts(*this);
- set_default_option(dflt);
- set_fixed(false);
+ subdevice<imi7000_slot_device>(m_units[0].finder_tag())->set_default_option(std::forward<T>(def1));
+ subdevice<imi7000_slot_device>(m_units[1].finder_tag())->set_default_option(std::forward<U>(def2));
+ subdevice<imi7000_slot_device>(m_units[2].finder_tag())->set_default_option(std::forward<V>(def3));
+ subdevice<imi7000_slot_device>(m_units[3].finder_tag())->set_default_option(std::forward<W>(def4));
}
- imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
- device_imi7000_interface *m_card;
+ required_device_array<imi7000_slot_device, 4> m_units;
};
// ======================> device_imi7000_interface
-class device_imi7000_interface : public device_slot_card_interface
+class device_imi7000_interface : public device_interface
{
friend class imi7000_slot_device;
diff --git a/src/devices/bus/intellec4/intellec4.cpp b/src/devices/bus/intellec4/intellec4.cpp
index c3742062454..07b42f3ae52 100644
--- a/src/devices/bus/intellec4/intellec4.cpp
+++ b/src/devices/bus/intellec4/intellec4.cpp
@@ -19,7 +19,7 @@ namespace bus { namespace intellec4 {
univ_slot_device::univ_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, INTELLEC4_UNIV_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_univ_card_interface>(mconfig, *this)
, m_bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -29,29 +29,18 @@ univ_slot_device::univ_slot_device(machine_config const &mconfig, char const *ta
device_t implementation
----------------------------------*/
-void univ_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_univ_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_univ_card_interface\n", card->tag(), card->name());
-}
-
void univ_slot_device::device_resolve_objects()
{
- device_univ_card_interface *const univ_card(dynamic_cast<device_univ_card_interface *>(get_card_device()));
+ device_univ_card_interface *const univ_card(get_card_device());
if (univ_card)
univ_card->set_bus(*m_bus);
}
void univ_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_univ_card_interface *>(card))
- throw emu_fatalerror("univ_slot_device: card device %s (%s) does not implement device_univ_card_interface\n", card->tag(), card->name());
}
-
/***********************************************************************
BUS DEVICE
***********************************************************************/
@@ -248,7 +237,7 @@ void univ_bus_device::set_user_reset(unsigned index, int state)
***********************************************************************/
device_univ_card_interface::device_univ_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "intellec4")
, m_bus(nullptr)
, m_index(~unsigned(0))
{
@@ -257,8 +246,6 @@ device_univ_card_interface::device_univ_card_interface(const machine_config &mco
void device_univ_card_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (!m_bus)
throw device_missing_dependencies();
}
diff --git a/src/devices/bus/intellec4/intellec4.h b/src/devices/bus/intellec4/intellec4.h
index 68fa8a8080a..8ae65f94487 100644
--- a/src/devices/bus/intellec4/intellec4.h
+++ b/src/devices/bus/intellec4/intellec4.h
@@ -121,7 +121,7 @@ class univ_bus_device;
class device_univ_card_interface;
-class univ_slot_device : public device_t, public device_slot_interface
+class univ_slot_device : public device_t, public device_single_card_slot_interface<device_univ_card_interface>
{
public:
template <typename T, typename U>
@@ -138,9 +138,8 @@ public:
protected:
// device_t implementation
- virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
- virtual void device_resolve_objects() override;
- virtual void device_start() override;
+ virtual void device_resolve_objects() override ATTR_COLD;
+ virtual void device_start() override ATTR_COLD;
private:
required_device<univ_bus_device> m_bus;
@@ -183,7 +182,7 @@ public:
protected:
// device_t implementation
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
private:
// helpers for cards
@@ -211,7 +210,7 @@ private:
};
-class device_univ_card_interface : public device_slot_card_interface
+class device_univ_card_interface : public device_interface
{
protected:
friend class univ_slot_device;
@@ -220,7 +219,7 @@ protected:
device_univ_card_interface(const machine_config &mconfig, device_t &device);
// device_interface implementation
- void interface_pre_start() override;
+ void interface_pre_start() override ATTR_COLD;
address_space &rom_space() { return *m_bus->m_rom_space; }
address_space &rom_ports_space() { return *m_bus->m_rom_ports_space; }
diff --git a/src/devices/bus/interpro/keyboard/keyboard.cpp b/src/devices/bus/interpro/keyboard/keyboard.cpp
index 10b0a038d9e..2e31ee7e258 100644
--- a/src/devices/bus/interpro/keyboard/keyboard.cpp
+++ b/src/devices/bus/interpro/keyboard/keyboard.cpp
@@ -11,7 +11,7 @@ DEFINE_DEVICE_TYPE(INTERPRO_KEYBOARD_PORT, interpro_keyboard_port_device, "inter
interpro_keyboard_port_device::interpro_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, INTERPRO_KEYBOARD_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_interpro_keyboard_port_interface>(mconfig, *this)
, m_rxd_handler(*this)
, m_dev(nullptr)
{
@@ -19,7 +19,7 @@ interpro_keyboard_port_device::interpro_keyboard_port_device(machine_config cons
void interpro_keyboard_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_interpro_keyboard_port_interface *>(get_card_device());
+ m_dev = get_card_device();
}
void interpro_keyboard_port_device::device_start()
@@ -34,7 +34,7 @@ WRITE_LINE_MEMBER(interpro_keyboard_port_device::write_txd)
}
device_interpro_keyboard_port_interface::device_interpro_keyboard_port_interface(machine_config const &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "interprokbd")
, m_port(dynamic_cast<interpro_keyboard_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/interpro/keyboard/keyboard.h b/src/devices/bus/interpro/keyboard/keyboard.h
index 05c672a0ad7..a51c254d7f8 100644
--- a/src/devices/bus/interpro/keyboard/keyboard.h
+++ b/src/devices/bus/interpro/keyboard/keyboard.h
@@ -7,7 +7,7 @@
class device_interpro_keyboard_port_interface;
-class interpro_keyboard_port_device : public device_t, public device_slot_interface
+class interpro_keyboard_port_device : public device_t, public device_single_card_slot_interface<device_interpro_keyboard_port_interface>
{
friend class device_interpro_keyboard_port_interface;
@@ -40,7 +40,7 @@ private:
device_interpro_keyboard_port_interface *m_dev;
};
-class device_interpro_keyboard_port_interface : public device_slot_card_interface
+class device_interpro_keyboard_port_interface : public device_interface
{
friend class interpro_keyboard_port_device;
diff --git a/src/devices/bus/interpro/mouse/mouse.cpp b/src/devices/bus/interpro/mouse/mouse.cpp
index ff13d7da8b2..835bcd1f68d 100644
--- a/src/devices/bus/interpro/mouse/mouse.cpp
+++ b/src/devices/bus/interpro/mouse/mouse.cpp
@@ -38,7 +38,7 @@ INPUT_PORTS_END
interpro_mouse_port_device::interpro_mouse_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, INTERPRO_MOUSE_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_interpro_mouse_port_interface>(mconfig, *this)
, m_state_func(*this)
, m_device(nullptr)
{
@@ -46,15 +46,7 @@ interpro_mouse_port_device::interpro_mouse_port_device(machine_config const &mco
void interpro_mouse_port_device::device_config_complete()
{
- m_device = dynamic_cast<device_interpro_mouse_port_interface *>(get_card_device());
-}
-
-void interpro_mouse_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
-
- if (card && !dynamic_cast<device_interpro_mouse_port_interface *>(card))
- osd_printf_error("Device %s (%s) does not implement device_interpro_mouse_port_interface\n", card->tag(), card->name());
+ m_device = get_card_device();
}
void interpro_mouse_port_device::device_start()
@@ -63,7 +55,7 @@ void interpro_mouse_port_device::device_start()
}
device_interpro_mouse_port_interface::device_interpro_mouse_port_interface(machine_config const &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "interpromouse")
, m_port(dynamic_cast<interpro_mouse_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/interpro/mouse/mouse.h b/src/devices/bus/interpro/mouse/mouse.h
index edcec942322..f10019605cb 100644
--- a/src/devices/bus/interpro/mouse/mouse.h
+++ b/src/devices/bus/interpro/mouse/mouse.h
@@ -7,7 +7,7 @@
class device_interpro_mouse_port_interface;
-class interpro_mouse_port_device : public device_t, public device_slot_interface
+class interpro_mouse_port_device : public device_t, public device_single_card_slot_interface<device_interpro_mouse_port_interface>
{
friend class device_interpro_mouse_port_interface;
@@ -29,7 +29,6 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
virtual void device_config_complete() override;
@@ -39,7 +38,7 @@ private:
device_interpro_mouse_port_interface *m_device;
};
-class device_interpro_mouse_port_interface : public device_slot_card_interface
+class device_interpro_mouse_port_interface : public device_interface
{
friend class interpro_mouse_port_device;
diff --git a/src/devices/bus/interpro/sr/sr.h b/src/devices/bus/interpro/sr/sr.h
index feb8724547e..ef9d01d2f29 100644
--- a/src/devices/bus/interpro/sr/sr.h
+++ b/src/devices/bus/interpro/sr/sr.h
@@ -120,7 +120,7 @@ private:
required_device<cbus_bus_device> m_bus;
};
-class device_cbus_card_interface : public device_slot_card_interface
+class device_cbus_card_interface : public device_interface
{
protected:
friend class cbus_slot_device;
@@ -133,7 +133,7 @@ public:
protected:
device_cbus_card_interface(const machine_config &mconfig, device_t &device, const char *idprom_region = "idprom")
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "interprocbus")
, m_bus(nullptr)
, m_idprom_region(idprom_region)
{
@@ -232,7 +232,7 @@ private:
required_device<srx_bus_device> m_bus;
};
-class device_srx_card_interface : public device_slot_card_interface
+class device_srx_card_interface : public device_interface
{
protected:
friend class srx_slot_device;
@@ -245,7 +245,7 @@ public:
protected:
device_srx_card_interface(const machine_config &mconfig, device_t &device, const char *idprom_region = "idprom")
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "interprosrx")
, m_bus(nullptr)
, m_idprom_region(idprom_region)
{
diff --git a/src/devices/bus/intv/ecs.cpp b/src/devices/bus/intv/ecs.cpp
index 6fd321af36b..50d52a85c77 100644
--- a/src/devices/bus/intv/ecs.cpp
+++ b/src/devices/bus/intv/ecs.cpp
@@ -28,8 +28,8 @@
DEFINE_DEVICE_TYPE(INTV_ROM_ECS, intv_ecs_device, "intv_ecs", "Intellivision ECS Expansion")
-intv_ecs_device::intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : intv_rom_device(mconfig, INTV_ROM_ECS, tag, owner, clock),
+intv_ecs_device::intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ intv_rom_device(mconfig, INTV_ROM_ECS, tag, owner, clock),
m_snd(*this, "ay8914"),
m_subslot(*this, "subslot"),
m_voice_enabled(false),
@@ -99,9 +99,9 @@ void intv_ecs_device::device_add_mconfig(machine_config &config)
SPEAKER(config, "mono_ecs").front_center();
AY8914(config, m_snd, XTAL(3'579'545)/2);
- m_snd->port_a_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portA_r));
- m_snd->port_b_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portB_r));
- m_snd->port_a_write_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portA_w));
+ m_snd->port_a_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::porta_r));
+ m_snd->port_b_read_callback().set("ctrl_port", FUNC(intvecs_control_port_device::portb_r));
+ m_snd->port_a_write_callback().set("ctrl_port", FUNC(intvecs_control_port_device::porta_w));
m_snd->add_route(ALL_OUTPUTS, "mono_ecs", 0.33);
INTVECS_CONTROL_PORT(config, "ctrl_port", intvecs_control_port_devices, "keybd");
diff --git a/src/devices/bus/intv/slot.cpp b/src/devices/bus/intv/slot.cpp
index 0c4ddae593a..0adca238eb1 100644
--- a/src/devices/bus/intv/slot.cpp
+++ b/src/devices/bus/intv/slot.cpp
@@ -96,10 +96,10 @@ DEFINE_DEVICE_TYPE(INTV_CART_SLOT, intv_cart_slot_device, "intv_cart_slot", "Int
// device_intv_cart_interface - constructor
//-------------------------------------------------
-device_intv_cart_interface::device_intv_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_intv_cart_interface::device_intv_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "intvcart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -147,7 +147,7 @@ void device_intv_cart_interface::ram_alloc(uint32_t size)
intv_cart_slot_device::intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, INTV_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_intv_cart_interface>(mconfig, *this),
m_type(INTV_STD),
m_cart(nullptr)
{
@@ -168,7 +168,7 @@ intv_cart_slot_device::~intv_cart_slot_device()
void intv_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_intv_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h
index ec79b148375..eb97337e622 100644
--- a/src/devices/bus/intv/slot.h
+++ b/src/devices/bus/intv/slot.h
@@ -32,7 +32,7 @@ enum
// ======================> device_intv_cart_interface
-class device_intv_cart_interface : public device_slot_card_interface
+class device_intv_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -94,7 +94,7 @@ protected:
class intv_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_intv_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/intv_ctrl/ctrl.cpp b/src/devices/bus/intv_ctrl/ctrl.cpp
index 122c98cf2ed..287789296a9 100644
--- a/src/devices/bus/intv_ctrl/ctrl.cpp
+++ b/src/devices/bus/intv_ctrl/ctrl.cpp
@@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(INTV_CONTROL_PORT, intv_control_port_device, "intv_control_po
// device_intv_control_port_interface - constructor
//-------------------------------------------------
-device_intv_control_port_interface::device_intv_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_intv_control_port_interface::device_intv_control_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "intvctrl")
{
m_port = dynamic_cast<intv_control_port_device *>(device.owner());
}
@@ -53,7 +53,7 @@ device_intv_control_port_interface::~device_intv_control_port_interface()
intv_control_port_device::intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, INTV_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_intv_control_port_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -74,16 +74,7 @@ intv_control_port_device::~intv_control_port_device()
void intv_control_port_device::device_start()
{
- m_device = dynamic_cast<device_intv_control_port_interface *>(get_card_device());
-}
-
-
-uint8_t intv_control_port_device::read_ctrl()
-{
- uint8_t data = 0;
- if (m_device)
- data |= m_device->read_ctrl();
- return data;
+ m_device = get_card_device();
}
diff --git a/src/devices/bus/intv_ctrl/ctrl.h b/src/devices/bus/intv_ctrl/ctrl.h
index 1cf3968f933..b68d6bbba7d 100644
--- a/src/devices/bus/intv_ctrl/ctrl.h
+++ b/src/devices/bus/intv_ctrl/ctrl.h
@@ -20,13 +20,13 @@ class intv_control_port_device;
// ======================> device_intv_control_port_interface
-class device_intv_control_port_interface : public device_slot_card_interface
+class device_intv_control_port_interface : public device_interface
{
public:
// construction/destruction
virtual ~device_intv_control_port_interface();
- virtual uint8_t read_ctrl() { return 0; };
+ virtual uint8_t read_ctrl() { return 0; }
protected:
device_intv_control_port_interface(const machine_config &mconfig, device_t &device);
@@ -36,8 +36,7 @@ protected:
// ======================> intv_control_port_device
-class intv_control_port_device : public device_t,
- public device_slot_interface
+class intv_control_port_device : public device_t, public device_single_card_slot_interface<device_intv_control_port_interface>
{
public:
// construction/destruction
@@ -54,8 +53,7 @@ public:
intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~intv_control_port_device();
- DECLARE_READ8_MEMBER( ctrl_r ) { return read_ctrl(); }
- uint8_t read_ctrl();
+ uint8_t ctrl_r() { return m_device ? m_device->read_ctrl() : 0; }
protected:
// device-level overrides
diff --git a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp
index 3f6afda5f4b..ef873489015 100644
--- a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp
+++ b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp
@@ -41,8 +41,8 @@ DEFINE_DEVICE_TYPE(INTVECS_CONTROL_PORT, intvecs_control_port_device, "intvecs_c
// device_intvecs_control_port_interface - constructor
//-------------------------------------------------
-device_intvecs_control_port_interface::device_intvecs_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_intvecs_control_port_interface::device_intvecs_control_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "intvecsctrl")
{
m_port = dynamic_cast<intvecs_control_port_device *>(device.owner());
}
@@ -67,7 +67,8 @@ device_intvecs_control_port_interface::~device_intvecs_control_port_interface()
intvecs_control_port_device::intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, INTVECS_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_device(nullptr)
+ device_single_card_slot_interface<device_intvecs_control_port_interface>(mconfig, *this),
+ m_device(nullptr)
{
}
@@ -87,30 +88,7 @@ intvecs_control_port_device::~intvecs_control_port_device()
void intvecs_control_port_device::device_start()
{
- m_device = dynamic_cast<device_intvecs_control_port_interface *>(get_card_device());
-}
-
-
-uint8_t intvecs_control_port_device::read_portA()
-{
- uint8_t data = 0;
- if (m_device)
- data |= m_device->read_portA();
- return data;
-}
-
-uint8_t intvecs_control_port_device::read_portB()
-{
- uint8_t data = 0;
- if (m_device)
- data |= m_device->read_portB();
- return data;
-}
-
-void intvecs_control_port_device::write_portA(uint8_t data)
-{
- if (m_device)
- m_device->write_portA(data);
+ m_device = get_card_device();
}
@@ -170,12 +148,12 @@ void intvecs_ctrls_device::device_reset()
uint8_t intvecs_ctrls_device::read_portA()
{
- return m_hand1->read_ctrl();
+ return m_hand1->ctrl_r();
}
uint8_t intvecs_ctrls_device::read_portB()
{
- return m_hand2->read_ctrl();
+ return m_hand2->ctrl_r();
}
//-------------------------------------------------
diff --git a/src/devices/bus/intv_ctrl/ecs_ctrl.h b/src/devices/bus/intv_ctrl/ecs_ctrl.h
index 8a723c64949..77fdfc72a92 100644
--- a/src/devices/bus/intv_ctrl/ecs_ctrl.h
+++ b/src/devices/bus/intv_ctrl/ecs_ctrl.h
@@ -23,7 +23,7 @@ class intvecs_control_port_device;
// ======================> device_intvecs_control_port_interface
-class device_intvecs_control_port_interface : public device_slot_card_interface
+class device_intvecs_control_port_interface : public device_interface
{
public:
// construction/destruction
@@ -41,8 +41,7 @@ protected:
// ======================> intvecs_control_port_device
-class intvecs_control_port_device : public device_t,
- public device_slot_interface
+class intvecs_control_port_device : public device_t, public device_single_card_slot_interface<device_intvecs_control_port_interface>
{
public:
// construction/destruction
@@ -59,16 +58,13 @@ public:
intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~intvecs_control_port_device();
- DECLARE_READ8_MEMBER( portA_r ) { return read_portA(); }
- DECLARE_READ8_MEMBER( portB_r ) { return read_portB(); }
- DECLARE_WRITE8_MEMBER( portA_w ) { return write_portA(data); }
+ uint8_t porta_r() { return m_device ? m_device->read_portA() : 0; }
+ uint8_t portb_r() { return m_device ? m_device->read_portB() : 0; }
+ void porta_w(uint8_t data) { if (m_device) m_device->write_portA(data); }
protected:
// device-level overrides
virtual void device_start() override;
- uint8_t read_portA();
- uint8_t read_portB();
- void write_portA(uint8_t data);
device_intvecs_control_port_interface *m_device;
};
diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp
index 58db5dde6ba..cd57efa1c77 100644
--- a/src/devices/bus/iq151/iq151.cpp
+++ b/src/devices/bus/iq151/iq151.cpp
@@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE(IQ151CART_SLOT, iq151cart_slot_device, "iq151cart_slot", "IQ1
//-------------------------------------------------
device_iq151cart_interface::device_iq151cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "iq151cart")
, m_screen(nullptr)
{
}
@@ -55,7 +55,7 @@ device_iq151cart_interface::~device_iq151cart_interface()
//-------------------------------------------------
iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, IQ151CART_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_iq151cart_interface>(mconfig, *this)
, device_image_interface(mconfig, *this)
, m_out_irq0_cb(*this)
, m_out_irq1_cb(*this)
@@ -83,9 +83,9 @@ iq151cart_slot_device::~iq151cart_slot_device()
void iq151cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_iq151cart_interface *>(get_card_device());
+ m_cart = get_card_device();
if (m_cart)
- m_cart->set_screen_device(m_screen);
+ m_cart->set_screen_device(*m_screen);
// resolve callbacks
m_out_irq0_cb.resolve_safe();
diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h
index 306fef47ee6..25d18c1a454 100644
--- a/src/devices/bus/iq151/iq151.h
+++ b/src/devices/bus/iq151/iq151.h
@@ -56,7 +56,7 @@
// ======================> device_iq151cart_interface
-class device_iq151cart_interface : public device_slot_card_interface
+class device_iq151cart_interface : public device_interface
{
public:
// construction/destruction
@@ -68,7 +68,7 @@ public:
virtual void io_read(offs_t offset, uint8_t &data) { }
virtual void io_write(offs_t offset, uint8_t data) { }
virtual uint8_t* get_cart_base() { return nullptr; }
- virtual void set_screen_device(screen_device *screen) { m_screen = screen; }
+ virtual void set_screen_device(screen_device &screen) { m_screen = &screen; }
// video update
virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { }
@@ -82,7 +82,7 @@ protected:
// ======================> iq151cart_slot_device
class iq151cart_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_iq151cart_interface>,
public device_image_interface
{
public:
@@ -108,9 +108,6 @@ public:
auto out_irq4_callback() { return m_out_irq4_cb.bind(); }
auto out_drq_callback() { return m_out_drq_cb.bind(); }
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -134,6 +131,10 @@ public:
virtual void io_write(offs_t offset, uint8_t data);
virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
devcb_write_line m_out_irq0_cb;
devcb_write_line m_out_irq1_cb;
devcb_write_line m_out_irq2_cb;
diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp
index 92ead5df95b..5d56e949380 100644
--- a/src/devices/bus/isa/isa.cpp
+++ b/src/devices/bus/isa/isa.cpp
@@ -428,7 +428,7 @@ void isa8_device::nmi()
//-------------------------------------------------
device_isa8_card_interface::device_isa8_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "isa"),
m_isa(nullptr), m_isa_dev(nullptr), m_next(nullptr)
{
}
diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h
index fff65de82f6..7994f4c892a 100644
--- a/src/devices/bus/isa/isa.h
+++ b/src/devices/bus/isa/isa.h
@@ -232,7 +232,7 @@ DECLARE_DEVICE_TYPE(ISA8, isa8_device)
// ======================> device_isa8_card_interface
// class representing interface-specific live isa8 card
-class device_isa8_card_interface : public device_slot_card_interface
+class device_isa8_card_interface : public device_interface
{
friend class isa8_device;
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/isbx/isbx.cpp b/src/devices/bus/isbx/isbx.cpp
index ae3754e6d62..373d147cadd 100644
--- a/src/devices/bus/isbx/isbx.cpp
+++ b/src/devices/bus/isbx/isbx.cpp
@@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(ISBX_SLOT, isbx_slot_device, "isbx_slot", "iSBX bus slot")
// device_isbx_card_interface - constructor
//-------------------------------------------------
-device_isbx_card_interface::device_isbx_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_isbx_card_interface::device_isbx_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "isbxbus")
{
m_slot = dynamic_cast<isbx_slot_device *>(device.owner());
}
@@ -40,11 +40,12 @@ device_isbx_card_interface::device_isbx_card_interface(const machine_config &mco
isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ISBX_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_isbx_card_interface>(mconfig, *this),
m_write_mintr0(*this),
m_write_mintr1(*this),
m_write_mdrqt(*this),
- m_write_mwait(*this), m_card(nullptr)
+ m_write_mwait(*this),
+ m_card(nullptr)
{
}
@@ -55,7 +56,7 @@ isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *ta
void isbx_slot_device::device_start()
{
- m_card = dynamic_cast<device_isbx_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_mintr0.resolve_safe();
diff --git a/src/devices/bus/isbx/isbx.h b/src/devices/bus/isbx/isbx.h
index 0535e461cd7..af9c51aa842 100644
--- a/src/devices/bus/isbx/isbx.h
+++ b/src/devices/bus/isbx/isbx.h
@@ -44,7 +44,7 @@
class isbx_slot_device;
-class device_isbx_card_interface : public device_slot_card_interface
+class device_isbx_card_interface : public device_interface
{
public:
virtual uint8_t mcs0_r(offs_t offset) { return 0xff; }
@@ -70,8 +70,7 @@ protected:
// ======================> isbx_slot_device
-class isbx_slot_device : public device_t,
- public device_slot_interface
+class isbx_slot_device : public device_t, public device_single_card_slot_interface<device_isbx_card_interface>
{
public:
// construction/destruction
@@ -115,7 +114,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override { if (m_card) get_card_device()->reset(); }
devcb_write_line m_write_mintr0;
devcb_write_line m_write_mintr1;
diff --git a/src/devices/bus/jakks_gamekey/slot.cpp b/src/devices/bus/jakks_gamekey/slot.cpp
index 6a5196875b1..f8f385b1a58 100644
--- a/src/devices/bus/jakks_gamekey/slot.cpp
+++ b/src/devices/bus/jakks_gamekey/slot.cpp
@@ -18,10 +18,10 @@ DEFINE_DEVICE_TYPE(JAKKS_GAMEKEY_SLOT, jakks_gamekey_slot_device, "jakks_gamekey
// device_jakks_gamekey_interface - constructor
//-------------------------------------------------
-device_jakks_gamekey_interface::device_jakks_gamekey_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_jakks_gamekey_interface::device_jakks_gamekey_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "jakksgamekey"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -57,7 +57,7 @@ void device_jakks_gamekey_interface::rom_alloc(uint32_t size, const char *tag)
jakks_gamekey_slot_device::jakks_gamekey_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, JAKKS_GAMEKEY_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_jakks_gamekey_interface>(mconfig, *this),
m_type(JAKKS_GAMEKEY_PLAIN),
m_cart(nullptr)
{
@@ -77,7 +77,7 @@ jakks_gamekey_slot_device::~jakks_gamekey_slot_device()
void jakks_gamekey_slot_device::device_start()
{
- m_cart = dynamic_cast<device_jakks_gamekey_interface *>(get_card_device());
+ m_cart = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/jakks_gamekey/slot.h b/src/devices/bus/jakks_gamekey/slot.h
index 8fd0961aad8..c9d07629b43 100644
--- a/src/devices/bus/jakks_gamekey/slot.h
+++ b/src/devices/bus/jakks_gamekey/slot.h
@@ -21,7 +21,7 @@ enum
// ======================> device_jakks_gamekey_interface
-class device_jakks_gamekey_interface : public device_slot_card_interface
+class device_jakks_gamekey_interface : public device_interface
{
public:
// construction/destruction
@@ -50,7 +50,7 @@ protected:
class jakks_gamekey_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_jakks_gamekey_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/kc/d002.cpp b/src/devices/bus/kc/d002.cpp
index 03dc9fb8f3b..288d2278578 100644
--- a/src/devices/bus/kc/d002.cpp
+++ b/src/devices/bus/kc/d002.cpp
@@ -11,6 +11,8 @@
#include "emu.h"
#include "d002.h"
+#include "machine/input_merger.h"
+
#include "ram.h"
#include "rom.h"
#include "d004.h"
@@ -111,33 +113,39 @@ void kc_d002_device::device_reset()
void kc_d002_device::device_add_mconfig(machine_config &config)
{
+ INPUT_MERGER_ANY_HIGH(config, "irq").output_handler().set(FUNC(kc_d002_device::out_irq_w));
+ INPUT_MERGER_ANY_HIGH(config, "nmi").output_handler().set(FUNC(kc_d002_device::out_nmi_w));
+ INPUT_MERGER_ANY_HIGH(config, "halt").output_handler().set(FUNC(kc_d002_device::out_halt_w));
+
KCCART_SLOT(config, m_expansions[0], kc85_cart, nullptr);
- m_expansions[0]->set_next_slot("m4");
- m_expansions[0]->irq().set(FUNC(kc_d002_device::out_irq_w));
- m_expansions[0]->nmi().set(FUNC(kc_d002_device::out_nmi_w));
- m_expansions[0]->halt().set(FUNC(kc_d002_device::out_halt_w));
+ m_expansions[0]->set_next_slot(m_expansions[1]);
+ m_expansions[0]->irq().set("irq", FUNC(input_merger_device::in_w<0>));
+ m_expansions[0]->nmi().set("nmi", FUNC(input_merger_device::in_w<0>));
+ m_expansions[0]->halt().set("halt", FUNC(input_merger_device::in_w<0>));
+
KCCART_SLOT(config, m_expansions[1], kc85_cart, nullptr);
- m_expansions[1]->set_next_slot("m8");
- m_expansions[1]->irq().set(FUNC(kc_d002_device::out_irq_w));
- m_expansions[1]->nmi().set(FUNC(kc_d002_device::out_nmi_w));
- m_expansions[1]->halt().set(FUNC(kc_d002_device::out_halt_w));
+ m_expansions[1]->set_next_slot(m_expansions[2]);
+ m_expansions[1]->irq().set("irq", FUNC(input_merger_device::in_w<1>));
+ m_expansions[1]->nmi().set("nmi", FUNC(input_merger_device::in_w<1>));
+ m_expansions[1]->halt().set("halt", FUNC(input_merger_device::in_w<1>));
+
KCCART_SLOT(config, m_expansions[2], kc85_cart, nullptr);
- m_expansions[2]->set_next_slot("mc");
- m_expansions[2]->irq().set(FUNC(kc_d002_device::out_irq_w));
- m_expansions[2]->nmi().set(FUNC(kc_d002_device::out_nmi_w));
- m_expansions[2]->halt().set(FUNC(kc_d002_device::out_halt_w));
+ m_expansions[2]->set_next_slot(m_expansions[3]);
+ m_expansions[2]->irq().set("irq", FUNC(input_merger_device::in_w<2>));
+ m_expansions[2]->nmi().set("nmi", FUNC(input_merger_device::in_w<2>));
+ m_expansions[2]->halt().set("halt", FUNC(input_merger_device::in_w<2>));
+
KCCART_SLOT(config, m_expansions[3], kc85_cart, nullptr);
- m_expansions[3]->set_next_slot("exp");
- m_expansions[3]->irq().set(FUNC(kc_d002_device::out_irq_w));
- m_expansions[3]->nmi().set(FUNC(kc_d002_device::out_nmi_w));
- m_expansions[3]->halt().set(FUNC(kc_d002_device::out_halt_w));
+ m_expansions[3]->set_next_slot(m_expansions[4]);
+ m_expansions[3]->irq().set("irq", FUNC(input_merger_device::in_w<3>));
+ m_expansions[3]->nmi().set("nmi", FUNC(input_merger_device::in_w<3>));
+ m_expansions[3]->halt().set("halt", FUNC(input_merger_device::in_w<3>));
// expansion interface
KCCART_SLOT(config, m_expansions[4], kc85_exp, nullptr);
- m_expansions[4]->set_next_slot(nullptr);
- m_expansions[4]->irq().set(FUNC(kc_d002_device::out_irq_w));
- m_expansions[4]->nmi().set(FUNC(kc_d002_device::out_nmi_w));
- m_expansions[4]->halt().set(FUNC(kc_d002_device::out_halt_w));
+ m_expansions[4]->irq().set("irq", FUNC(input_merger_device::in_w<4>));
+ m_expansions[4]->nmi().set("nmi", FUNC(input_merger_device::in_w<4>));
+ m_expansions[4]->halt().set("halt", FUNC(input_merger_device::in_w<4>));
}
//-------------------------------------------------
diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp
index aa9e75e1951..39262d0fc76 100644
--- a/src/devices/bus/kc/kc.cpp
+++ b/src/devices/bus/kc/kc.cpp
@@ -38,7 +38,7 @@
VCC 28 57 NC
NC 29 58 NC
- Slots are organized into a chain (MEI -> MEO) , the first module that
+ Slots are organized into a chain (MEI -> MEO), the first module that
decode the address on bus, clear the MEO line for disable other modules
with less priority.
@@ -107,7 +107,8 @@
#include "emu.h"
#include "kc.h"
-#define LOG 0
+//#define VERBOSE 1
+#include "logmacro.h"
/***************************************************************************
@@ -131,7 +132,7 @@ DEFINE_DEVICE_TYPE(KCCART_SLOT, kccart_slot_device, "kccart_slot", "KC85 Cartrid
//-------------------------------------------------
device_kcexp_interface::device_kcexp_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "kcexp")
{
}
@@ -159,11 +160,12 @@ kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, const char *
kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_kcexp_interface>(mconfig, *this),
m_out_irq_cb(*this),
m_out_nmi_cb(*this),
m_out_halt_cb(*this),
- m_cart(nullptr), m_next_slot_tag(nullptr), m_next_slot(nullptr)
+ m_cart(nullptr),
+ m_next_slot(*this, finder_base::DUMMY_TAG)
{
}
@@ -175,14 +177,22 @@ kcexp_slot_device::~kcexp_slot_device()
{
}
+
+void kcexp_slot_device::device_validity_check(validity_checker &valid) const
+{
+ std::pair<device_t &, char const *> const next_target(m_next_slot.finder_target());
+ if ((next_target.second != finder_base::DUMMY_TAG) && !m_next_slot)
+ osd_printf_error("Next slot device %s relative to %s not found", next_target.second, next_target.first.tag());
+}
+
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void kcexp_slot_device::device_start()
{
- m_cart = dynamic_cast<device_kcexp_interface *>(get_card_device());
- m_next_slot = m_next_slot_tag ? owner()->subdevice<kcexp_slot_device>(m_next_slot_tag) : nullptr;
+ m_cart = get_card_device();
// resolve callbacks
m_out_irq_cb.resolve_safe();
@@ -262,7 +272,7 @@ void kcexp_slot_device::io_write(offs_t offset, uint8_t data)
WRITE_LINE_MEMBER( kcexp_slot_device::mei_w )
{
- if (LOG) logerror("KCEXP '%s': %s MEI line\n", tag(), state != CLEAR_LINE ? "ASSERT": "CLEAR");
+ LOG("KCEXP: %s MEI line\n", state != CLEAR_LINE ? "ASSERT": "CLEAR");
if (m_cart)
m_cart->mei_w(state);
@@ -274,7 +284,7 @@ WRITE_LINE_MEMBER( kcexp_slot_device::mei_w )
WRITE_LINE_MEMBER( kcexp_slot_device::meo_w )
{
- if (LOG) logerror("KCEXP '%s': %s MEO line\n", tag(), state != CLEAR_LINE ? "ASSERT": "CLEAR");
+ LOG("KCEXP: %s MEO line\n", state != CLEAR_LINE ? "ASSERT": "CLEAR");
if (m_next_slot)
m_next_slot->mei_w(state);
diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h
index 0c14a8ef5d3..7125d73d2ef 100644
--- a/src/devices/bus/kc/kc.h
+++ b/src/devices/bus/kc/kc.h
@@ -21,7 +21,7 @@
// ======================> device_kcexp_interface
-class device_kcexp_interface : public device_slot_card_interface
+class device_kcexp_interface : public device_interface
{
public:
// construction/destruction
@@ -43,8 +43,7 @@ protected:
// ======================> kcexp_slot_device
-class kcexp_slot_device : public device_t,
- public device_slot_interface
+class kcexp_slot_device : public device_t, public device_single_card_slot_interface<device_kcexp_interface>
{
public:
// construction/destruction
@@ -65,7 +64,7 @@ public:
auto halt() { return m_out_halt_cb.bind(); }
// inline configuration
- void set_next_slot(const char *next_module_tag) { m_next_slot_tag = next_module_tag; }
+ template <typename T> void set_next_slot(T &&next_module_tag) { m_next_slot.set_tag(std::forward<T>(next_module_tag)); }
// reading and writing
virtual uint8_t module_id_r();
@@ -85,18 +84,17 @@ protected:
kcexp_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
+ virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
device_kcexp_interface* m_cart;
- const char* m_next_slot_tag;
- kcexp_slot_device* m_next_slot;
+ optional_device<kcexp_slot_device> m_next_slot;
};
// ======================> kccart_slot_device
-class kccart_slot_device : public kcexp_slot_device,
- public device_image_interface
+class kccart_slot_device : public kcexp_slot_device, public device_image_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/lpci/pci.cpp b/src/devices/bus/lpci/pci.cpp
index 1a772f3bef6..3c2f6b2a990 100644
--- a/src/devices/bus/lpci/pci.cpp
+++ b/src/devices/bus/lpci/pci.cpp
@@ -312,8 +312,8 @@ void pci_bus_device::device_reset()
// pci_device_interface - constructor
//-------------------------------------------------
-pci_device_interface::pci_device_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+pci_device_interface::pci_device_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "lpci"),
m_pci_bus(nullptr)
{
}
@@ -332,7 +332,7 @@ DEFINE_DEVICE_TYPE(PCI_CONNECTOR, pci_connector_device, "pci_connector", "PCI de
pci_connector_device::pci_connector_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PCI_CONNECTOR, tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_single_card_slot_interface<pci_device_interface>(mconfig, *this)
{
}
@@ -346,5 +346,5 @@ void pci_connector_device::device_start()
pci_device_interface *pci_connector_device::get_device()
{
- return dynamic_cast<pci_device_interface *>(get_card_device());
+ return get_card_device();
}
diff --git a/src/devices/bus/lpci/pci.h b/src/devices/bus/lpci/pci.h
index 7f93875fcfb..db14beec790 100644
--- a/src/devices/bus/lpci/pci.h
+++ b/src/devices/bus/lpci/pci.h
@@ -21,7 +21,7 @@ class pci_bus_device;
// ======================> pci_device_interface
-class pci_device_interface : public device_slot_card_interface
+class pci_device_interface : public device_interface
{
public:
// construction/destruction
@@ -41,7 +41,7 @@ protected:
};
class pci_connector_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<pci_device_interface>
{
public:
template <typename T>
diff --git a/src/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp
index cdfb88466e1..ff3d47e9b95 100644
--- a/src/devices/bus/m5/slot.cpp
+++ b/src/devices/bus/m5/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(M5_CART_SLOT, m5_cart_slot_device, "m5_cart_slot", "M5 Cartri
// device_m5_cart_interface - constructor
//-------------------------------------------------
-device_m5_cart_interface::device_m5_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_m5_cart_interface::device_m5_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "m5cart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -75,8 +75,9 @@ void device_m5_cart_interface::ram_alloc(uint32_t size)
m5_cart_slot_device::m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, M5_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
- m_type(M5_STD), m_cart(nullptr)
+ device_single_card_slot_interface(mconfig, *this),
+ m_type(M5_STD),
+ m_cart(nullptr)
{
}
@@ -95,7 +96,7 @@ m5_cart_slot_device::~m5_cart_slot_device()
void m5_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_m5_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/m5/slot.h b/src/devices/bus/m5/slot.h
index e2a835238b9..1a626edcdb8 100644
--- a/src/devices/bus/m5/slot.h
+++ b/src/devices/bus/m5/slot.h
@@ -28,7 +28,7 @@ enum
// ======================> device_m5_cart_interface
-class device_m5_cart_interface : public device_slot_card_interface
+class device_m5_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -62,7 +62,7 @@ protected:
class m5_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_m5_cart_interface>
{
public:
// construction/destruction
@@ -79,9 +79,6 @@ public:
m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~m5_cart_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override {}
@@ -109,6 +106,8 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_ram);
protected:
+ // device-level overrides
+ virtual void device_start() override;
int m_type;
device_m5_cart_interface* m_cart;
diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp
index 8773f453093..fb264fac214 100644
--- a/src/devices/bus/macpds/macpds.cpp
+++ b/src/devices/bus/macpds/macpds.cpp
@@ -136,7 +136,7 @@ void macpds_device::set_irq_line(int line, int state)
//-------------------------------------------------
device_macpds_card_interface::device_macpds_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "macpds"),
m_macpds(nullptr),
m_macpds_tag(nullptr), m_macpds_slottag(nullptr), m_next(nullptr)
{
diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h
index 2354549afd5..9cd5a550a5e 100644
--- a/src/devices/bus/macpds/macpds.h
+++ b/src/devices/bus/macpds/macpds.h
@@ -20,8 +20,7 @@
class macpds_device;
-class macpds_slot_device : public device_t,
- public device_slot_interface
+class macpds_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
@@ -100,7 +99,7 @@ DECLARE_DEVICE_TYPE(MACPDS, macpds_device)
// ======================> device_macpds_card_interface
// class representing interface-specific live macpds card
-class device_macpds_card_interface : public device_slot_card_interface
+class device_macpds_card_interface : public device_interface
{
friend class macpds_device;
template <class ElememtType> friend class simple_list;
diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp
index 26afaf888cc..698723897b7 100644
--- a/src/devices/bus/megadrive/md_slot.cpp
+++ b/src/devices/bus/megadrive/md_slot.cpp
@@ -64,7 +64,7 @@ DEFINE_DEVICE_TYPE(COPERA_CART_SLOT, copera_cart_slot_device, "copera_cart_slot"
//-------------------------------------------------
device_md_cart_interface::device_md_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device), m_nvram_start(0), m_nvram_end(0), m_nvram_active(0), m_nvram_readonly(0), m_nvram_handlers_installed(0),
+ : device_interface(device, "mdcart"), m_nvram_start(0), m_nvram_end(0), m_nvram_active(0), m_nvram_readonly(0), m_nvram_handlers_installed(0),
m_rom(nullptr),
m_rom_size(0)
{
@@ -163,7 +163,7 @@ uint32_t device_md_cart_interface::get_padded_size(uint32_t size)
base_md_cart_slot_device::base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_md_cart_interface>(mconfig, *this),
m_type(SEGA_STD), m_cart(nullptr),
m_must_be_loaded(1)
{
@@ -198,7 +198,7 @@ base_md_cart_slot_device::~base_md_cart_slot_device()
void base_md_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_md_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h
index e891e5a1edb..988a60c1df2 100644
--- a/src/devices/bus/megadrive/md_slot.h
+++ b/src/devices/bus/megadrive/md_slot.h
@@ -89,7 +89,7 @@ enum
// ======================> device_md_cart_interface
-class device_md_cart_interface : public device_slot_card_interface
+class device_md_cart_interface : public device_interface
{
friend class base_md_cart_slot_device;
public:
@@ -148,7 +148,7 @@ protected:
class base_md_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_md_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/midi/midi.cpp b/src/devices/bus/midi/midi.cpp
index ca87636e6e6..cff94bfe159 100644
--- a/src/devices/bus/midi/midi.cpp
+++ b/src/devices/bus/midi/midi.cpp
@@ -5,9 +5,9 @@
DEFINE_DEVICE_TYPE(MIDI_PORT, midi_port_device, "midi_port", "MIDI port")
-midi_port_device::midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MIDI_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+midi_port_device::midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, MIDI_PORT, tag, owner, clock),
+ device_single_card_slot_interface<device_midi_port_interface>(mconfig, *this),
m_rxd(0),
m_rxd_handler(*this),
m_dev(nullptr)
@@ -20,7 +20,7 @@ midi_port_device::~midi_port_device()
void midi_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_midi_port_interface *>(get_card_device());
+ m_dev = get_card_device();
}
void midi_port_device::device_start()
@@ -34,8 +34,8 @@ WRITE_LINE_MEMBER( midi_port_device::write_txd )
m_dev->input_txd(state);
}
-device_midi_port_interface::device_midi_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_midi_port_interface::device_midi_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "midi")
{
m_port = dynamic_cast<midi_port_device *>(device.owner());
}
diff --git a/src/devices/bus/midi/midi.h b/src/devices/bus/midi/midi.h
index 162d2d7545e..cdd89a84b6d 100644
--- a/src/devices/bus/midi/midi.h
+++ b/src/devices/bus/midi/midi.h
@@ -8,8 +8,7 @@
class device_midi_port_interface;
-class midi_port_device : public device_t,
- public device_slot_interface
+class midi_port_device : public device_t, public device_single_card_slot_interface<device_midi_port_interface>
{
friend class device_midi_port_interface;
@@ -47,7 +46,7 @@ private:
device_midi_port_interface *m_dev;
};
-class device_midi_port_interface : public device_slot_card_interface
+class device_midi_port_interface : public device_interface
{
friend class midi_port_device;
diff --git a/src/devices/bus/msx_cart/cartridge.cpp b/src/devices/bus/msx_cart/cartridge.cpp
index 3a3af30d191..967732b3ae3 100644
--- a/src/devices/bus/msx_cart/cartridge.cpp
+++ b/src/devices/bus/msx_cart/cartridge.cpp
@@ -73,7 +73,7 @@ void msx_cart(device_slot_interface &device)
msx_cart_interface::msx_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "msxcart")
, m_exp(nullptr)
{
}
diff --git a/src/devices/bus/msx_cart/cartridge.h b/src/devices/bus/msx_cart/cartridge.h
index 529d2f0a081..73759baf544 100644
--- a/src/devices/bus/msx_cart/cartridge.h
+++ b/src/devices/bus/msx_cart/cartridge.h
@@ -12,7 +12,7 @@ void msx_yamaha_60pin(device_slot_interface &device); // 60 pin expansion slot
class msx_slot_cartridge_device;
-class msx_cart_interface : public device_slot_card_interface
+class msx_cart_interface : public device_interface
{
friend class msx_slot_cartridge_device;
diff --git a/src/devices/bus/msx_cart/msx_audio_kb.cpp b/src/devices/bus/msx_cart/msx_audio_kb.cpp
index 68303c56667..aba915ed718 100644
--- a/src/devices/bus/msx_cart/msx_audio_kb.cpp
+++ b/src/devices/bus/msx_cart/msx_audio_kb.cpp
@@ -7,9 +7,15 @@
DEFINE_DEVICE_TYPE(MSX_AUDIO_KBDC_PORT, msx_audio_kbdc_port_device, "msx_audio_kbdc_port", "MSX Audio keyboard connector port")
+msx_audio_kb_port_interface::msx_audio_kb_port_interface(machine_config const &mconfig, device_t &device)
+ : device_interface(device, "msxaudiokb")
+{
+}
+
+
msx_audio_kbdc_port_device::msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, MSX_AUDIO_KBDC_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<msx_audio_kb_port_interface>(mconfig, *this)
, m_keyboard(nullptr)
{
}
@@ -17,26 +23,23 @@ msx_audio_kbdc_port_device::msx_audio_kbdc_port_device(const machine_config &mco
void msx_audio_kbdc_port_device::device_start()
{
- m_keyboard = dynamic_cast<msx_audio_kb_port_interface *>(get_card_device());
+ m_keyboard = get_card_device();
}
void msx_audio_kbdc_port_device::write(uint8_t data)
{
if (m_keyboard)
- {
m_keyboard->write(data);
- }
}
uint8_t msx_audio_kbdc_port_device::read()
{
if (m_keyboard)
- {
return m_keyboard->read();
- }
- return 0xff;
+ else
+ return 0xff;
}
diff --git a/src/devices/bus/msx_cart/msx_audio_kb.h b/src/devices/bus/msx_cart/msx_audio_kb.h
index 93a2d026214..ecab5732c98 100644
--- a/src/devices/bus/msx_cart/msx_audio_kb.h
+++ b/src/devices/bus/msx_cart/msx_audio_kb.h
@@ -7,7 +7,7 @@
DECLARE_DEVICE_TYPE(MSX_AUDIO_KBDC_PORT, msx_audio_kbdc_port_device)
-class msx_audio_kb_port_interface : public device_slot_card_interface
+class msx_audio_kb_port_interface : public device_interface
{
public:
virtual uint8_t read() { return 0xff; }
@@ -15,11 +15,11 @@ public:
protected:
// construction/destruction
- using device_slot_card_interface::device_slot_card_interface;
+ msx_audio_kb_port_interface(machine_config const &mconfig, device_t &device);
};
-class msx_audio_kbdc_port_device : public device_t, public device_slot_interface
+class msx_audio_kbdc_port_device : public device_t, public device_single_card_slot_interface<msx_audio_kb_port_interface>
{
public:
// construction/destruction
@@ -34,20 +34,18 @@ public:
}
msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
-
// Physical connection simply consists of 8 input and 8 output lines split across 2 connectors
void write(uint8_t data);
uint8_t read();
-
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
msx_audio_kb_port_interface *m_keyboard;
};
void msx_audio_keyboards(device_slot_interface &device);
-
#endif // MAME_BUS_MSX_CART_MSX_AUDIO_KB_H
diff --git a/src/devices/bus/mtx/exp.cpp b/src/devices/bus/mtx/exp.cpp
index 1bfd5068679..58071cd1a38 100644
--- a/src/devices/bus/mtx/exp.cpp
+++ b/src/devices/bus/mtx/exp.cpp
@@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(MTX_EXP_SLOT, mtx_exp_slot_device, "mtx_exp_slot", "MTX expan
//-------------------------------------------------
device_mtx_exp_interface::device_mtx_exp_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "mtxexp")
{
m_slot = dynamic_cast<mtx_exp_slot_device *>(device.owner());
}
@@ -42,10 +42,9 @@ device_mtx_exp_interface::device_mtx_exp_interface(const machine_config &mconfig
mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, MTX_EXP_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_mtx_exp_interface>(mconfig, *this)
, m_program(*this, finder_base::DUMMY_TAG, -1)
, m_io(*this, finder_base::DUMMY_TAG, -1)
- , m_card(nullptr)
, m_busreq_handler(*this)
, m_int_handler(*this)
, m_nmi_handler(*this)
@@ -54,27 +53,11 @@ mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const ch
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void mtx_exp_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_mtx_exp_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_mtx_exp_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mtx_exp_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_mtx_exp_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_mtx_exp_interface\n", carddev->tag(), carddev->name());
-
// resolve callbacks
m_busreq_handler.resolve_safe();
m_int_handler.resolve_safe();
@@ -83,15 +66,6 @@ void mtx_exp_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void mtx_exp_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// SLOT_INTERFACE( mtx_exp_devices )
//-------------------------------------------------
diff --git a/src/devices/bus/mtx/exp.h b/src/devices/bus/mtx/exp.h
index d4e05f2f9c9..2d1cf583f16 100644
--- a/src/devices/bus/mtx/exp.h
+++ b/src/devices/bus/mtx/exp.h
@@ -21,8 +21,9 @@
class device_mtx_exp_interface;
-class mtx_exp_slot_device : public device_t, public device_slot_interface
+class mtx_exp_slot_device : public device_t, public device_single_card_slot_interface<device_mtx_exp_interface>
{
+ friend class device_mtx_exp_interface;
public:
// construction/destruction
template <typename T>
@@ -45,23 +46,20 @@ public:
auto int_handler() { return m_int_handler.bind(); }
auto nmi_handler() { return m_nmi_handler.bind(); }
+ // for the card to use
DECLARE_WRITE_LINE_MEMBER( busreq_w ) { m_busreq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
- // address spaces we are attached to
- required_address_space m_program;
- required_address_space m_io;
-
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
- virtual void device_reset() override;
-
- device_mtx_exp_interface *m_card;
private:
+ // address spaces we are attached to
+ required_address_space m_program;
+ required_address_space m_io;
+
devcb_write_line m_busreq_handler;
devcb_write_line m_int_handler;
devcb_write_line m_nmi_handler;
@@ -70,13 +68,12 @@ private:
// ======================> device_mtx_exp_interface
-class device_mtx_exp_interface : public device_slot_card_interface
+class device_mtx_exp_interface : public device_interface
{
-public:
+protected:
// construction/destruction
device_mtx_exp_interface(const machine_config &mconfig, device_t &device);
-protected:
address_space &program_space() { return *m_slot->m_program; }
address_space &io_space() { return *m_slot->m_io; }
diff --git a/src/devices/bus/nasbus/avc.cpp b/src/devices/bus/nasbus/avc.cpp
index e25e6164f75..8f06a7c0e45 100644
--- a/src/devices/bus/nasbus/avc.cpp
+++ b/src/devices/bus/nasbus/avc.cpp
@@ -131,13 +131,13 @@ WRITE8_MEMBER( nascom_avc_device::control_w )
// page video ram in?
if (((m_control & 0x07) == 0) && (data & 0x07))
{
- m_nasbus->ram_disable_w(0);
+ ram_disable_w(0);
program_space().install_readwrite_handler(0x8000, 0xbfff, read8_delegate(*this, FUNC(nascom_avc_device::vram_r)), write8_delegate(*this, FUNC(nascom_avc_device::vram_w)));
}
else if ((data & 0x07) == 0)
{
program_space().unmap_readwrite(0x8000, 0xbfff);
- m_nasbus->ram_disable_w(1);
+ ram_disable_w(1);
}
m_control = data;
diff --git a/src/devices/bus/nasbus/nasbus.cpp b/src/devices/bus/nasbus/nasbus.cpp
index ed6cf27bc7a..2d19290161c 100644
--- a/src/devices/bus/nasbus/nasbus.cpp
+++ b/src/devices/bus/nasbus/nasbus.cpp
@@ -29,7 +29,8 @@ nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, const char
nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_nasbus_card_interface>(mconfig, *this)
+ , m_bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -39,13 +40,9 @@ nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, device_typ
void nasbus_slot_device::device_start()
{
- device_nasbus_card_interface *dev = dynamic_cast<device_nasbus_card_interface *>(get_card_device());
-
+ device_nasbus_card_interface *const dev = get_card_device();
if (dev)
- {
- nasbus_device *m_nasbus = downcast<nasbus_device *>(owner()->subdevice(NASBUS_TAG));
- m_nasbus->add_card(dev);
- }
+ m_bus->add_card(*dev);
}
@@ -98,10 +95,10 @@ void nasbus_device::device_reset()
// add_card - add new card to our bus
//-------------------------------------------------
-void nasbus_device::add_card(device_nasbus_card_interface *card)
+void nasbus_device::add_card(device_nasbus_card_interface &card)
{
- card->set_nasbus_device(this);
- m_dev.append(*card);
+ card.set_nasbus_device(*this);
+ m_dev.append(card);
}
// callbacks from slot device to the host
@@ -117,7 +114,7 @@ WRITE_LINE_MEMBER( nasbus_device::ram_disable_w ) { m_ram_disable_handler(state)
//-------------------------------------------------
device_nasbus_card_interface::device_nasbus_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "nasbus"),
m_nasbus(nullptr),
m_next(nullptr)
{
@@ -131,7 +128,14 @@ device_nasbus_card_interface::~device_nasbus_card_interface()
{
}
-void device_nasbus_card_interface::set_nasbus_device(nasbus_device *nasbus)
+void device_nasbus_card_interface::set_nasbus_device(nasbus_device &nasbus)
+{
+ m_nasbus = &nasbus;
+}
+
+
+void device_nasbus_card_interface::interface_pre_start()
{
- m_nasbus = nasbus;
+ if (!m_nasbus)
+ throw device_missing_dependencies();
}
diff --git a/src/devices/bus/nasbus/nasbus.h b/src/devices/bus/nasbus/nasbus.h
index c2c11e2db9a..04e1c3942f7 100644
--- a/src/devices/bus/nasbus/nasbus.h
+++ b/src/devices/bus/nasbus/nasbus.h
@@ -95,41 +95,41 @@
//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
-#define NASBUS_TAG "nasbus"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// forward declaration
class device_nasbus_card_interface;
+class nasbus_device;
// ======================> nasbus_slot_device
-class nasbus_slot_device : public device_t, public device_slot_interface
+class nasbus_slot_device : public device_t, public device_single_card_slot_interface<device_nasbus_card_interface>
{
public:
// construction/destruction
- template <typename T>
- nasbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ template <typename T, typename U>
+ nasbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bus, U &&opts, char const *dflt)
: nasbus_slot_device(mconfig, tag, owner, (uint32_t)0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
+ set_bus(std::forward<T>(bus));
}
nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T> void set_bus(T &&tag) { m_bus.set_tag(std::forward<T>(tag)); }
+
protected:
nasbus_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_start() override;
+
+private:
+ required_device<nasbus_device> m_bus;
};
// device type definition
@@ -147,7 +147,7 @@ public:
auto ram_disable() { return m_ram_disable_handler.bind(); }
- void add_card(device_nasbus_card_interface *card);
+ void add_card(device_nasbus_card_interface &card);
template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); }
template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); }
@@ -174,26 +174,30 @@ DECLARE_DEVICE_TYPE(NASBUS, nasbus_device)
// ======================> device_nasbus_interface
-class device_nasbus_card_interface : public device_slot_card_interface
+class device_nasbus_card_interface : public device_interface
{
template <class ElementType> friend class simple_list;
public:
// construction/destruction
virtual ~device_nasbus_card_interface();
- void set_nasbus_device(nasbus_device *nasbus);
+ void set_nasbus_device(nasbus_device &nasbus);
device_nasbus_card_interface *next() const { return m_next; }
protected:
device_nasbus_card_interface(const machine_config &mconfig, device_t &device);
+ virtual void interface_pre_start() override;
+
+ DECLARE_WRITE_LINE_MEMBER( ram_disable_w ) { m_nasbus->ram_disable_w(state); }
+
address_space &program_space() { return *m_nasbus->m_program; }
address_space &io_space() { return *m_nasbus->m_io; }
+private:
nasbus_device *m_nasbus;
-private:
device_nasbus_card_interface *m_next;
};
diff --git a/src/devices/bus/neogeo/slot.cpp b/src/devices/bus/neogeo/slot.cpp
index 9a01c1b1196..a15fb9eab5d 100644
--- a/src/devices/bus/neogeo/slot.cpp
+++ b/src/devices/bus/neogeo/slot.cpp
@@ -20,8 +20,8 @@ DEFINE_DEVICE_TYPE(NEOGEO_CART_SLOT, neogeo_cart_slot_device, "neogeo_cart_slot"
// device_neogeo_cart_interface - constructor
//-------------------------------------------------
-device_neogeo_cart_interface::device_neogeo_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+device_neogeo_cart_interface::device_neogeo_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "neogeocart"),
m_region_rom(*this, "^maincpu"),
m_region_fixed(*this, "^fixed"),
m_region_audio(*this, "^audiocpu"),
@@ -100,7 +100,7 @@ void device_neogeo_cart_interface::optimize_sprites(uint8_t* region_sprites, uin
neogeo_cart_slot_device::neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) :
device_t(mconfig, NEOGEO_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_neogeo_cart_interface>(mconfig, *this),
m_cart(nullptr)
{
}
diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h
index b5be4c5e901..9d948b68c40 100644
--- a/src/devices/bus/neogeo/slot.h
+++ b/src/devices/bus/neogeo/slot.h
@@ -85,7 +85,7 @@ enum
#define DECRYPT_ALL_PARAMS \
uint8_t* cpuregion, uint32_t cpuregion_size,uint8_t* spr_region, uint32_t spr_region_size,uint8_t* fix_region, uint32_t fix_region_size,uint8_t* ym_region, uint32_t ym_region_size,uint8_t* ymdelta_region, uint32_t ymdelta_region_size,uint8_t* audiocpu_region, uint32_t audio_region_size, uint8_t* audiocrypt_region, uint32_t audiocrypt_region_size
-class device_neogeo_cart_interface : public device_slot_card_interface
+class device_neogeo_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -93,17 +93,17 @@ public:
// reading from ROM
virtual DECLARE_READ16_MEMBER(rom_r) { return 0xffff; }
- virtual DECLARE_WRITE16_MEMBER(banksel_w) { };
+ virtual DECLARE_WRITE16_MEMBER(banksel_w) { }
virtual DECLARE_READ16_MEMBER(ram_r) { return 0xffff; }
- virtual DECLARE_WRITE16_MEMBER(ram_w) { };
+ virtual DECLARE_WRITE16_MEMBER(ram_w) { }
virtual DECLARE_READ16_MEMBER(protection_r) { return 0xffff; }
- virtual DECLARE_WRITE16_MEMBER(protection_w) { };
+ virtual DECLARE_WRITE16_MEMBER(protection_w) { }
virtual DECLARE_READ16_MEMBER(addon_r) { return 0xffff; }
virtual uint32_t get_bank_base(uint16_t sel) { return 0; }
virtual uint32_t get_special_bank() { return 0; }
virtual uint16_t get_helper() { return 0; }
- virtual void decrypt_all(DECRYPT_ALL_PARAMS) { };
+ virtual void decrypt_all(DECRYPT_ALL_PARAMS) { }
virtual int get_fixed_bank_type() { return 0; }
void rom_alloc(uint32_t size) { m_rom.resize(size/sizeof(uint16_t)); }
@@ -186,7 +186,7 @@ protected:
class neogeo_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_neogeo_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/neogeo_ctrl/ctrl.cpp b/src/devices/bus/neogeo_ctrl/ctrl.cpp
index 023d28adaf8..6a1ed888075 100644
--- a/src/devices/bus/neogeo_ctrl/ctrl.cpp
+++ b/src/devices/bus/neogeo_ctrl/ctrl.cpp
@@ -43,8 +43,8 @@ DEFINE_DEVICE_TYPE(NEOGEO_CTRL_EDGE_CONNECTOR, neogeo_ctrl_edge_port_device, "ne
// device_neogeo_control_port_interface - constructor
//-------------------------------------------------
-device_neogeo_control_port_interface::device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_neogeo_control_port_interface::device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "neogeoctrl")
{
m_port = dynamic_cast<neogeo_control_port_device *>(device.owner());
}
@@ -62,8 +62,8 @@ device_neogeo_control_port_interface::~device_neogeo_control_port_interface()
// device_neogeo_ctrl_edge_interface - constructor
//-------------------------------------------------
-device_neogeo_ctrl_edge_interface::device_neogeo_ctrl_edge_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_neogeo_ctrl_edge_interface::device_neogeo_ctrl_edge_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "neogeoedge")
{
m_port = dynamic_cast<neogeo_ctrl_edge_port_device *>(device.owner());
}
@@ -88,7 +88,7 @@ device_neogeo_ctrl_edge_interface::~device_neogeo_ctrl_edge_interface()
neogeo_control_port_device::neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, NEOGEO_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_neogeo_control_port_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -109,7 +109,7 @@ neogeo_control_port_device::~neogeo_control_port_device()
void neogeo_control_port_device::device_start()
{
- m_device = dynamic_cast<device_neogeo_control_port_interface *>(get_card_device());
+ m_device = get_card_device();
}
@@ -137,7 +137,7 @@ void neogeo_control_port_device::write_ctrlsel(uint8_t data)
neogeo_ctrl_edge_port_device::neogeo_ctrl_edge_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, NEOGEO_CTRL_EDGE_CONNECTOR, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_neogeo_ctrl_edge_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -158,18 +158,18 @@ neogeo_ctrl_edge_port_device::~neogeo_ctrl_edge_port_device()
void neogeo_ctrl_edge_port_device::device_start()
{
- m_device = dynamic_cast<device_neogeo_ctrl_edge_interface *>(get_card_device());
+ m_device = get_card_device();
}
-READ8_MEMBER(neogeo_ctrl_edge_port_device::in0_r)
+uint8_t neogeo_ctrl_edge_port_device::in0_r()
{
- return m_device ? m_device->in0_r(space, offset, mem_mask) : 0xff;
+ return m_device ? m_device->in0_r() : 0xff;
}
-READ8_MEMBER(neogeo_ctrl_edge_port_device::in1_r)
+uint8_t neogeo_ctrl_edge_port_device::in1_r()
{
- return m_device ? m_device->in1_r(space, offset, mem_mask) : 0xff;
+ return m_device ? m_device->in1_r() : 0xff;
}
uint8_t neogeo_ctrl_edge_port_device::read_start_sel()
diff --git a/src/devices/bus/neogeo_ctrl/ctrl.h b/src/devices/bus/neogeo_ctrl/ctrl.h
index bfe568d9b7e..99918b325ce 100644
--- a/src/devices/bus/neogeo_ctrl/ctrl.h
+++ b/src/devices/bus/neogeo_ctrl/ctrl.h
@@ -18,9 +18,8 @@
class neogeo_control_port_device;
class neogeo_ctrl_edge_port_device;
-// ======================> device_neogeo_control_port_interface
-class device_neogeo_control_port_interface : public device_slot_card_interface
+class device_neogeo_control_port_interface : public device_interface
{
public:
// construction/destruction
@@ -36,9 +35,8 @@ protected:
neogeo_control_port_device *m_port;
};
-// ======================> neogeo_control_port_device
-class neogeo_control_port_device : public device_t, public device_slot_interface
+class neogeo_control_port_device : public device_t, public device_single_card_slot_interface<device_neogeo_control_port_interface>
{
public:
// construction/destruction
@@ -57,7 +55,6 @@ public:
uint8_t read_ctrl();
uint8_t read_start_sel();
void write_ctrlsel(uint8_t data);
- DECLARE_READ8_MEMBER( ctrl_r ) { return read_ctrl(); }
protected:
// device-level overrides
@@ -67,17 +64,15 @@ protected:
};
-// ======================> device_neogeo_ctrl_edge_interface
-
-class device_neogeo_ctrl_edge_interface : public device_slot_card_interface
+class device_neogeo_ctrl_edge_interface : public device_interface
{
public:
// construction/destruction
virtual ~device_neogeo_ctrl_edge_interface();
virtual uint8_t read_start_sel() { return 0xff; }
- virtual DECLARE_READ8_MEMBER( in0_r ) { return 0xff; }
- virtual DECLARE_READ8_MEMBER( in1_r ) { return 0xff; }
+ virtual uint8_t in0_r() { return 0xff; }
+ virtual uint8_t in1_r() { return 0xff; }
virtual void write_ctrlsel(uint8_t data) { }
protected:
@@ -86,9 +81,8 @@ protected:
neogeo_ctrl_edge_port_device *m_port;
};
-// ======================> neogeo_ctrl_edge_port_device
-class neogeo_ctrl_edge_port_device : public device_t, public device_slot_interface
+class neogeo_ctrl_edge_port_device : public device_t, public device_single_card_slot_interface<device_neogeo_ctrl_edge_interface>
{
public:
// construction/destruction
@@ -105,8 +99,8 @@ public:
virtual ~neogeo_ctrl_edge_port_device();
uint8_t read_start_sel();
- DECLARE_READ8_MEMBER( in0_r );
- DECLARE_READ8_MEMBER( in1_r );
+ uint8_t in0_r();
+ uint8_t in1_r();
void write_ctrlsel(uint8_t data);
protected:
@@ -117,7 +111,6 @@ protected:
};
-// device type definition
DECLARE_DEVICE_TYPE(NEOGEO_CONTROL_PORT, neogeo_control_port_device)
DECLARE_DEVICE_TYPE(NEOGEO_CTRL_EDGE_CONNECTOR, neogeo_ctrl_edge_port_device)
@@ -127,5 +120,4 @@ void neogeo_arc_edge(device_slot_interface &device);
void neogeo_arc_edge_fixed(device_slot_interface &device);
void neogeo_arc_pin15(device_slot_interface &device);
-
#endif // MAME_BUS_NEOGEO_CTRL_CTRL_H
diff --git a/src/devices/bus/neogeo_ctrl/dial.cpp b/src/devices/bus/neogeo_ctrl/dial.cpp
index 9f4bd75066d..6ee2a75840c 100644
--- a/src/devices/bus/neogeo_ctrl/dial.cpp
+++ b/src/devices/bus/neogeo_ctrl/dial.cpp
@@ -22,7 +22,7 @@ static INPUT_PORTS_START( neogeo_dial )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
- PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* note it needs it from 0x80 when using paddle */
+ PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // note it needs it from 0x80 when using paddle
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
@@ -31,7 +31,7 @@ static INPUT_PORTS_START( neogeo_dial )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
- PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* note it needs it from 0x80 when using paddle */
+ PORT_BIT( 0x90, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // note it needs it from 0x80 when using paddle
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
@@ -84,17 +84,8 @@ neogeo_dial_device::neogeo_dial_device(const machine_config &mconfig, const char
void neogeo_dial_device::device_start()
{
- save_item(NAME(m_ctrl_sel));
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void neogeo_dial_device::device_reset()
-{
m_ctrl_sel = 0;
+ save_item(NAME(m_ctrl_sel));
}
@@ -102,30 +93,18 @@ void neogeo_dial_device::device_reset()
// in0_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_dial_device::in0_r)
+uint8_t neogeo_dial_device::in0_r()
{
- uint8_t res = 0;
- if (m_ctrl_sel & 0x01)
- res = m_joy1->read();
- else
- res = m_dial1->read();
-
- return res;
+ return BIT(m_ctrl_sel, 0) ? m_joy1->read() : m_dial1->read();
}
//-------------------------------------------------
// in1_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_dial_device::in1_r)
+uint8_t neogeo_dial_device::in1_r()
{
- uint8_t res = 0;
- if (m_ctrl_sel & 0x01)
- res = m_joy2->read();
- else
- res = m_dial2->read();
-
- return res;
+ return BIT(m_ctrl_sel, 0) ? m_joy2->read() : m_dial2->read();
}
//-------------------------------------------------
diff --git a/src/devices/bus/neogeo_ctrl/dial.h b/src/devices/bus/neogeo_ctrl/dial.h
index e532d11d195..676e1b51316 100644
--- a/src/devices/bus/neogeo_ctrl/dial.h
+++ b/src/devices/bus/neogeo_ctrl/dial.h
@@ -32,11 +32,10 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// device_neogeo_control_port_interface overrides
- virtual DECLARE_READ8_MEMBER( in0_r ) override;
- virtual DECLARE_READ8_MEMBER( in1_r ) override;
+ virtual uint8_t in0_r() override;
+ virtual uint8_t in1_r() override;
virtual void write_ctrlsel(uint8_t data) override;
virtual uint8_t read_start_sel() override;
diff --git a/src/devices/bus/neogeo_ctrl/irrmaze.cpp b/src/devices/bus/neogeo_ctrl/irrmaze.cpp
index d6020244ca7..59374e6f99a 100644
--- a/src/devices/bus/neogeo_ctrl/irrmaze.cpp
+++ b/src/devices/bus/neogeo_ctrl/irrmaze.cpp
@@ -86,22 +86,16 @@ void neogeo_irrmaze_device::device_start()
// in0_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_irrmaze_device::in0_r)
+uint8_t neogeo_irrmaze_device::in0_r()
{
- uint8_t res = 0;
- if (m_ctrl_sel & 0x01)
- res = m_ty->read();
- else
- res = m_tx->read();
-
- return res;
+ return BIT(m_ctrl_sel, 0) ? m_ty->read() : m_tx->read();
}
//-------------------------------------------------
// in1_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_irrmaze_device::in1_r)
+uint8_t neogeo_irrmaze_device::in1_r()
{
return m_buttons->read();
}
diff --git a/src/devices/bus/neogeo_ctrl/irrmaze.h b/src/devices/bus/neogeo_ctrl/irrmaze.h
index bc00b4eeb2e..78a00801f8c 100644
--- a/src/devices/bus/neogeo_ctrl/irrmaze.h
+++ b/src/devices/bus/neogeo_ctrl/irrmaze.h
@@ -31,8 +31,8 @@ protected:
virtual void device_start() override;
// device_neogeo_control_port_interface overrides
- virtual DECLARE_READ8_MEMBER( in0_r ) override;
- virtual DECLARE_READ8_MEMBER( in1_r ) override;
+ virtual uint8_t in0_r() override;
+ virtual uint8_t in1_r() override;
virtual uint8_t read_start_sel() override;
virtual void write_ctrlsel(uint8_t data) override;
diff --git a/src/devices/bus/neogeo_ctrl/joystick.cpp b/src/devices/bus/neogeo_ctrl/joystick.cpp
index 045e593895c..f38dba81127 100644
--- a/src/devices/bus/neogeo_ctrl/joystick.cpp
+++ b/src/devices/bus/neogeo_ctrl/joystick.cpp
@@ -190,7 +190,7 @@ void neogeo_joy_ac_device::device_start()
// in0_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_joy_ac_device::in0_r)
+uint8_t neogeo_joy_ac_device::in0_r()
{
return m_joy[0]->read();
}
@@ -199,7 +199,7 @@ READ8_MEMBER(neogeo_joy_ac_device::in0_r)
// in1_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_joy_ac_device::in1_r)
+uint8_t neogeo_joy_ac_device::in1_r()
{
return m_joy[1]->read();
}
diff --git a/src/devices/bus/neogeo_ctrl/joystick.h b/src/devices/bus/neogeo_ctrl/joystick.h
index bf07ec90b9b..b817e672ca3 100644
--- a/src/devices/bus/neogeo_ctrl/joystick.h
+++ b/src/devices/bus/neogeo_ctrl/joystick.h
@@ -56,8 +56,8 @@ protected:
virtual void device_start() override;
// device_neogeo_ctrl_edge_interface overrides
- virtual DECLARE_READ8_MEMBER( in0_r ) override;
- virtual DECLARE_READ8_MEMBER( in1_r ) override;
+ virtual uint8_t in0_r() override;
+ virtual uint8_t in1_r() override;
virtual uint8_t read_start_sel() override;
private:
diff --git a/src/devices/bus/neogeo_ctrl/kizuna4p.cpp b/src/devices/bus/neogeo_ctrl/kizuna4p.cpp
index 4ef3e3d78fe..ccc08ef61ed 100644
--- a/src/devices/bus/neogeo_ctrl/kizuna4p.cpp
+++ b/src/devices/bus/neogeo_ctrl/kizuna4p.cpp
@@ -119,7 +119,7 @@ void neogeo_kizuna4p_device::device_start()
// in0_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_kizuna4p_device::in0_r)
+uint8_t neogeo_kizuna4p_device::in0_r()
{
return m_joy[BIT(m_ctrl_sel, 0) << 1]->read() & ~(BIT(m_ctrl_sel, 2) << (BIT(m_ctrl_sel, 0) | 4));
}
@@ -128,7 +128,7 @@ READ8_MEMBER(neogeo_kizuna4p_device::in0_r)
// in1_r
//-------------------------------------------------
-READ8_MEMBER(neogeo_kizuna4p_device::in1_r)
+uint8_t neogeo_kizuna4p_device::in1_r()
{
return m_joy[(BIT(m_ctrl_sel, 0) << 1) | 1]->read() & ~(BIT(m_ctrl_sel, 2) << (BIT(m_ctrl_sel, 0) | 4));
}
diff --git a/src/devices/bus/neogeo_ctrl/kizuna4p.h b/src/devices/bus/neogeo_ctrl/kizuna4p.h
index c48f0078a81..404055cdec6 100644
--- a/src/devices/bus/neogeo_ctrl/kizuna4p.h
+++ b/src/devices/bus/neogeo_ctrl/kizuna4p.h
@@ -32,8 +32,8 @@ protected:
virtual void device_start() override;
// device_neogeo_control_port_interface overrides
- virtual DECLARE_READ8_MEMBER( in0_r ) override;
- virtual DECLARE_READ8_MEMBER( in1_r ) override;
+ virtual uint8_t in0_r() override;
+ virtual uint8_t in1_r() override;
virtual uint8_t read_start_sel() override;
virtual void write_ctrlsel(uint8_t data) override;
diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp
index db57b61ff00..27f6c975201 100644
--- a/src/devices/bus/nes/aladdin.cpp
+++ b/src/devices/bus/nes/aladdin.cpp
@@ -39,7 +39,7 @@
//-------------------------------------------------
aladdin_cart_interface::aladdin_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "aladdincart")
, m_rom(nullptr)
, m_rom_size(0)
, m_lobank(0)
@@ -69,7 +69,7 @@ DEFINE_DEVICE_TYPE(NES_ALADDIN_SLOT, nes_aladdin_slot_device, "nes_ade_slot", "N
nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NES_ALADDIN_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<aladdin_cart_interface>(mconfig, *this)
, m_cart(nullptr)
{
}
@@ -81,7 +81,7 @@ nes_aladdin_slot_device::~nes_aladdin_slot_device()
void nes_aladdin_slot_device::device_start()
{
- m_cart = dynamic_cast<aladdin_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
uint8_t nes_aladdin_slot_device::read(offs_t offset)
diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h
index 9014bf6969a..05072f8504b 100644
--- a/src/devices/bus/nes/aladdin.h
+++ b/src/devices/bus/nes/aladdin.h
@@ -17,7 +17,7 @@
// ======================> aladdin_cart_interface
-class aladdin_cart_interface : public device_slot_card_interface
+class aladdin_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -45,7 +45,7 @@ class nes_aladdin_device;
class nes_aladdin_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<aladdin_cart_interface>
{
friend class nes_aladdin_device;
public:
@@ -63,9 +63,6 @@ public:
nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_aladdin_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -86,6 +83,9 @@ public:
void write_prg(uint32_t offset, uint8_t data) { if (m_cart) m_cart->write_prg(offset, data); }
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
aladdin_cart_interface* m_cart;
};
diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp
index 5262b6d927a..c767830bd5a 100644
--- a/src/devices/bus/nes/datach.cpp
+++ b/src/devices/bus/nes/datach.cpp
@@ -42,7 +42,7 @@
//-------------------------------------------------
datach_cart_interface::datach_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "datachcart")
, m_i2cmem(*this, "i2cmem")
, m_rom(nullptr), m_bank(0)
{
@@ -69,7 +69,7 @@ DEFINE_DEVICE_TYPE(NES_DATACH_SLOT, nes_datach_slot_device, "nes_datach_slot", "
nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NES_DATACH_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<datach_cart_interface>(mconfig, *this)
, m_cart(nullptr)
{
}
@@ -81,15 +81,15 @@ nes_datach_slot_device::~nes_datach_slot_device()
void nes_datach_slot_device::device_start()
{
- m_cart = dynamic_cast<datach_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
uint8_t nes_datach_slot_device::read(offs_t offset)
{
if (m_cart)
return m_cart->read(offset);
-
- return 0xff;
+ else
+ return 0xff;
}
image_init_result nes_datach_slot_device::call_load()
diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h
index 81865baa69f..a5693c78108 100644
--- a/src/devices/bus/nes/datach.h
+++ b/src/devices/bus/nes/datach.h
@@ -18,7 +18,7 @@
// ======================> datach_cart_interface
-class datach_cart_interface : public device_slot_card_interface
+class datach_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -47,7 +47,7 @@ class nes_datach_device;
class nes_datach_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<datach_cart_interface>
{
friend class nes_datach_device;
public:
@@ -64,9 +64,6 @@ public:
nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_datach_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -87,6 +84,9 @@ public:
void write_prg_bank(uint8_t bank) { if (m_cart) m_cart->write_prg_bank(bank); }
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
datach_cart_interface* m_cart;
};
diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp
index fc98a658213..158af1ed2df 100644
--- a/src/devices/bus/nes/karastudio.cpp
+++ b/src/devices/bus/nes/karastudio.cpp
@@ -36,8 +36,7 @@
#else
#define VERBOSE 0
#endif
-
-#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
+#include "logmacro.h"
//-----------------------------------------
@@ -51,7 +50,7 @@
//-------------------------------------------------
kstudio_cart_interface::kstudio_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "kstudiocart")
, m_rom(nullptr), m_bank(0)
{
}
@@ -74,7 +73,7 @@ DEFINE_DEVICE_TYPE(NES_KSEXPANSION_SLOT, nes_kstudio_slot_device, "nes_ks_slot",
nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NES_KSEXPANSION_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<kstudio_cart_interface>(mconfig, *this)
, m_cart(nullptr)
{
}
@@ -86,15 +85,15 @@ nes_kstudio_slot_device::~nes_kstudio_slot_device()
void nes_kstudio_slot_device::device_start()
{
- m_cart = dynamic_cast<kstudio_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
uint8_t nes_kstudio_slot_device::read(offs_t offset)
{
if (m_cart)
return m_cart->read(offset);
-
- return 0xff;
+ else
+ return 0xff;
}
image_init_result nes_kstudio_slot_device::call_load()
@@ -227,13 +226,13 @@ void nes_karaokestudio_device::pcb_reset()
uint8_t nes_karaokestudio_device::read_m(offs_t offset)
{
- LOG_MMC(("karaoke studio read_m, offset: %04x\n", offset));
+ LOG("karaoke studio read_m, offset: %04x\n", offset);
return m_mic_ipt->read();
}
uint8_t nes_karaokestudio_device::read_h(offs_t offset)
{
- LOG_MMC(("karaoke studio read_h, offset: %04x\n", offset));
+ LOG("karaoke studio read_h, offset: %04x\n", offset);
// this shall be the proper code, but it's a bit slower, so we access directly the subcart below
//return m_subslot->read(offset);
@@ -249,7 +248,7 @@ uint8_t nes_karaokestudio_device::read_h(offs_t offset)
void nes_karaokestudio_device::write_h(offs_t offset, uint8_t data)
{
- LOG_MMC(("karaoke studio write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("karaoke studio write_h, offset: %04x, data: %02x\n", offset, data);
// bit3 1 = M ROM (main unit), 0=E ROM (expansion)
// HACK(?): currently it is not clear how the unit acknowledges the presence of the expansion
// cart (when expansion is present, code keeps switching both from the expansion rom and from
diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h
index fcb481f046e..faaf8ecedbb 100644
--- a/src/devices/bus/nes/karastudio.h
+++ b/src/devices/bus/nes/karastudio.h
@@ -17,7 +17,7 @@
// ======================> kstudio_cart_interface
-class kstudio_cart_interface : public device_slot_card_interface
+class kstudio_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -44,7 +44,7 @@ class nes_karaokestudio_device;
class nes_kstudio_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<kstudio_cart_interface>
{
friend class nes_karaokestudio_device;
public:
diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp
index ab8235ccc55..74fd6e541d4 100644
--- a/src/devices/bus/nes/nes_slot.cpp
+++ b/src/devices/bus/nes/nes_slot.cpp
@@ -107,7 +107,7 @@ DEFINE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device, "nes_cart_slot", "NES Ca
//-------------------------------------------------
device_nes_cart_interface::device_nes_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "nescart")
, m_prg(nullptr)
, m_vrom(nullptr)
, m_ciram(nullptr)
@@ -779,7 +779,7 @@ void device_nes_cart_interface::nes_banks_restore()
nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NES_CART_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_nes_cart_interface>(mconfig, *this)
, m_crc_hack(0)
, m_cart(nullptr)
, m_pcb_id(NO_BOARD)
@@ -801,7 +801,7 @@ nes_cart_slot_device::~nes_cart_slot_device()
void nes_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_nes_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index f26c526b360..4a55430c074 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -159,7 +159,7 @@ enum
// ======================> device_nes_cart_interface
-class device_nes_cart_interface : public device_slot_card_interface
+class device_nes_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -348,7 +348,7 @@ public:
class nes_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_nes_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp
index 23c81894666..04dc3219716 100644
--- a/src/devices/bus/nes/sunsoft_dcs.cpp
+++ b/src/devices/bus/nes/sunsoft_dcs.cpp
@@ -35,7 +35,7 @@
//-------------------------------------------------
ntb_cart_interface::ntb_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "ntbcart")
, m_rom(nullptr)
{
}
@@ -53,7 +53,7 @@ DEFINE_DEVICE_TYPE(NES_NTB_SLOT, nes_ntb_slot_device, "nes_ntb_slot", "NES NTB C
nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NES_NTB_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<ntb_cart_interface>(mconfig, *this)
, m_cart(nullptr)
{
}
@@ -65,15 +65,15 @@ nes_ntb_slot_device::~nes_ntb_slot_device()
void nes_ntb_slot_device::device_start()
{
- m_cart = dynamic_cast<ntb_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
uint8_t nes_ntb_slot_device::read(offs_t offset)
{
if (m_cart)
return m_cart->read(offset);
-
- return 0xff;
+ else
+ return 0xff;
}
diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h
index 51a11b22ae4..ba96e6333be 100644
--- a/src/devices/bus/nes/sunsoft_dcs.h
+++ b/src/devices/bus/nes/sunsoft_dcs.h
@@ -17,7 +17,7 @@
// ======================> ntb_cart_interface
-class ntb_cart_interface : public device_slot_card_interface
+class ntb_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -41,7 +41,7 @@ class nes_sunsoft_dcs_device;
class nes_ntb_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<ntb_cart_interface>
{
friend class nes_sunsoft_dcs_device;
public:
@@ -59,9 +59,6 @@ public:
nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_ntb_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -81,6 +78,9 @@ public:
virtual uint8_t read(offs_t offset);
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
ntb_cart_interface* m_cart;
};
diff --git a/src/devices/bus/nes_ctrl/ctrl.cpp b/src/devices/bus/nes_ctrl/ctrl.cpp
index 239ea58233b..7ef1da0850f 100644
--- a/src/devices/bus/nes_ctrl/ctrl.cpp
+++ b/src/devices/bus/nes_ctrl/ctrl.cpp
@@ -77,7 +77,7 @@ DEFINE_DEVICE_TYPE(NES_CONTROL_PORT, nes_control_port_device, "nes_control_port"
//-------------------------------------------------
device_nes_control_port_interface::device_nes_control_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "nesctrl")
{
m_port = dynamic_cast<nes_control_port_device *>(device.owner());
}
@@ -103,7 +103,7 @@ device_nes_control_port_interface::~device_nes_control_port_interface()
nes_control_port_device::nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, NES_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_nes_control_port_interface>(mconfig, *this),
m_screen(*this, finder_base::DUMMY_TAG),
m_device(nullptr)
{
@@ -125,7 +125,7 @@ nes_control_port_device::~nes_control_port_device()
void nes_control_port_device::device_start()
{
- m_device = dynamic_cast<device_nes_control_port_interface *>(get_card_device());
+ m_device = get_card_device();
}
diff --git a/src/devices/bus/nes_ctrl/ctrl.h b/src/devices/bus/nes_ctrl/ctrl.h
index bc013f5eca3..7991a549c93 100644
--- a/src/devices/bus/nes_ctrl/ctrl.h
+++ b/src/devices/bus/nes_ctrl/ctrl.h
@@ -28,7 +28,7 @@ class nes_control_port_device;
// ======================> device_nes_control_port_interface
-class device_nes_control_port_interface : public device_slot_card_interface
+class device_nes_control_port_interface : public device_interface
{
public:
// construction/destruction
@@ -49,7 +49,7 @@ protected:
// ======================> nes_control_port_device
class nes_control_port_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_nes_control_port_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/newbrain/exp.cpp b/src/devices/bus/newbrain/exp.cpp
index a1a9e2210ed..66f7d9d302a 100644
--- a/src/devices/bus/newbrain/exp.cpp
+++ b/src/devices/bus/newbrain/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(NEWBRAIN_EXPANSION_SLOT, newbrain_expansion_slot_device, "new
//-------------------------------------------------
device_newbrain_expansion_slot_interface::device_newbrain_expansion_slot_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig,device)
+ device_interface(device, "newbrainexp")
{
m_slot = dynamic_cast<newbrain_expansion_slot_device *>(device.owner());
}
@@ -45,7 +45,8 @@ device_newbrain_expansion_slot_interface::device_newbrain_expansion_slot_interfa
newbrain_expansion_slot_device::newbrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, NEWBRAIN_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_card(nullptr)
+ device_single_card_slot_interface<device_newbrain_expansion_slot_interface>(mconfig, *this),
+ m_card(nullptr)
{
}
@@ -56,7 +57,7 @@ newbrain_expansion_slot_device::newbrain_expansion_slot_device(const machine_con
void newbrain_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_newbrain_expansion_slot_interface *>(get_card_device());
+ m_card = get_card_device();
}
diff --git a/src/devices/bus/newbrain/exp.h b/src/devices/bus/newbrain/exp.h
index e9e56c1bd66..e8293a9c540 100644
--- a/src/devices/bus/newbrain/exp.h
+++ b/src/devices/bus/newbrain/exp.h
@@ -58,7 +58,7 @@
class device_newbrain_expansion_slot_interface;
class newbrain_expansion_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_newbrain_expansion_slot_interface>
{
public:
// construction/destruction
@@ -93,7 +93,7 @@ protected:
// ======================> device_newbrain_expansion_slot_interface
// class representing interface-specific live newbrain_expansion card
-class device_newbrain_expansion_slot_interface : public device_slot_card_interface
+class device_newbrain_expansion_slot_interface : public device_interface
{
public:
// memory access
diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp
index 9aac443a2c2..118d7f50f1a 100644
--- a/src/devices/bus/nubus/nubus.cpp
+++ b/src/devices/bus/nubus/nubus.cpp
@@ -232,7 +232,7 @@ WRITE_LINE_MEMBER( nubus_device::irqe_w ) { m_out_irqe_cb(state); }
//-------------------------------------------------
device_nubus_card_interface::device_nubus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "nubus"),
m_nubus(nullptr),
m_nubus_tag(nullptr), m_nubus_slottag(nullptr), m_slot(0), m_next(nullptr)
{
diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h
index a1b9496fcf8..874a37bcf82 100644
--- a/src/devices/bus/nubus/nubus.h
+++ b/src/devices/bus/nubus/nubus.h
@@ -113,7 +113,7 @@ DECLARE_DEVICE_TYPE(NUBUS, nubus_device)
// ======================> device_nubus_card_interface
// class representing interface-specific live nubus card
-class device_nubus_card_interface : public device_slot_card_interface
+class device_nubus_card_interface : public device_interface
{
friend class nubus_device;
template <class ElementType> friend class simple_list;
diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp
index 417bb27a38b..574b93ec01b 100644
--- a/src/devices/bus/odyssey2/slot.cpp
+++ b/src/devices/bus/odyssey2/slot.cpp
@@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(O2_CART_SLOT, o2_cart_slot_device, "o2_cart_slot", "Odyssey 2
//-------------------------------------------------
device_o2_cart_interface::device_o2_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "odyssey2cart")
, m_rom(nullptr)
, m_rom_size(0)
{
@@ -75,8 +75,9 @@ void device_o2_cart_interface::ram_alloc(uint32_t size)
o2_cart_slot_device::o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, O2_CART_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
- , m_type(O2_STD), m_cart(nullptr)
+ , device_single_card_slot_interface<device_o2_cart_interface>(mconfig, *this)
+ , m_type(O2_STD)
+ , m_cart(nullptr)
{
}
@@ -95,7 +96,7 @@ o2_cart_slot_device::~o2_cart_slot_device()
void o2_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_o2_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h
index bfb10c025bd..b0271e0e610 100644
--- a/src/devices/bus/odyssey2/slot.h
+++ b/src/devices/bus/odyssey2/slot.h
@@ -26,7 +26,7 @@ enum
// ======================> device_o2_cart_interface
-class device_o2_cart_interface : public device_slot_card_interface
+class device_o2_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -61,7 +61,7 @@ protected:
class o2_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_o2_cart_interface>
{
public:
// construction/destruction
@@ -78,9 +78,6 @@ public:
o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~o2_cart_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override { }
@@ -109,6 +106,8 @@ public:
void write_bank(int bank) { if (m_cart) m_cart->write_bank(bank); }
protected:
+ // device-level overrides
+ virtual void device_start() override;
int m_type;
device_o2_cart_interface* m_cart;
diff --git a/src/devices/bus/oricext/jasmin.cpp b/src/devices/bus/oricext/jasmin.cpp
index bff09d06026..1ba77f6579f 100644
--- a/src/devices/bus/oricext/jasmin.cpp
+++ b/src/devices/bus/oricext/jasmin.cpp
@@ -4,14 +4,14 @@
#include "jasmin.h"
#include "formats/oric_dsk.h"
-DEFINE_DEVICE_TYPE(JASMIN, jasmin_device, "jasmin", "Jasmin floppy drive interface")
+DEFINE_DEVICE_TYPE(ORIC_JASMIN, oric_jasmin_device, "oric_jasmin", "Jasmin floppy drive interface")
ROM_START( jasmin )
ROM_REGION( 0x800, "jasmin", 0 )
ROM_LOAD("jasmin.rom", 0, 0x800, CRC(37220e89) SHA1(70e59b8abd67092f050462abc6cb5271e4c15f01) )
ROM_END
-FLOPPY_FORMATS_MEMBER( jasmin_device::floppy_formats )
+FLOPPY_FORMATS_MEMBER( oric_jasmin_device::floppy_formats )
FLOPPY_ORIC_DSK_FORMAT
FLOPPY_FORMATS_END
@@ -22,17 +22,18 @@ static void jasmin_floppies(device_slot_interface &device)
INPUT_PORTS_START( jasmin )
PORT_START("JASMIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Boot") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHANGED_MEMBER(DEVICE_SELF, jasmin_device, boot_pressed, 0)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Boot") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHANGED_MEMBER(DEVICE_SELF, oric_jasmin_device, boot_pressed, 0)
INPUT_PORTS_END
-void jasmin_device::map(address_map &map)
+void oric_jasmin_device::map(address_map &map)
{
map(0x3f4, 0x3f7).rw("fdc", FUNC(wd1770_device::read), FUNC(wd1770_device::write));
map(0x3f8, 0x3ff).w(m_fdlatch, FUNC(ls259_device::write_d0));
}
-jasmin_device::jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- oricext_device(mconfig, JASMIN, tag, owner, clock),
+oric_jasmin_device::oric_jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, ORIC_JASMIN, tag, owner, clock),
+ device_oricext_interface(mconfig, *this),
m_fdc(*this, "fdc"),
m_fdlatch(*this, "fdlatch"),
m_floppies(*this, "fdc:%u", 0U),
@@ -41,48 +42,47 @@ jasmin_device::jasmin_device(const machine_config &mconfig, const char *tag, dev
{
}
-jasmin_device::~jasmin_device()
+oric_jasmin_device::~oric_jasmin_device()
{
}
-void jasmin_device::device_start()
+void oric_jasmin_device::device_start()
{
- oricext_device::device_start();
- cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, &jasmin_device::map);
+ cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, &oric_jasmin_device::map);
}
-const tiny_rom_entry *jasmin_device::device_rom_region() const
+const tiny_rom_entry *oric_jasmin_device::device_rom_region() const
{
return ROM_NAME( jasmin );
}
-void jasmin_device::device_add_mconfig(machine_config &config)
+void oric_jasmin_device::device_add_mconfig(machine_config &config)
{
WD1770(config, m_fdc, 8_MHz_XTAL);
- m_fdc->drq_wr_callback().set(FUNC(oricext_device::irq_w));
+ m_fdc->drq_wr_callback().set(FUNC(oric_jasmin_device::irq_w));
- FLOPPY_CONNECTOR(config, "fdc:0", jasmin_floppies, "3dsdd", jasmin_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:1", jasmin_floppies, nullptr, jasmin_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:2", jasmin_floppies, nullptr, jasmin_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:3", jasmin_floppies, nullptr, jasmin_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:0", jasmin_floppies, "3dsdd", oric_jasmin_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", jasmin_floppies, nullptr, oric_jasmin_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:2", jasmin_floppies, nullptr, oric_jasmin_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:3", jasmin_floppies, nullptr, oric_jasmin_device::floppy_formats);
LS259(config, m_fdlatch); // U14
- m_fdlatch->q_out_cb<0>().set(FUNC(jasmin_device::side_sel_w));
+ m_fdlatch->q_out_cb<0>().set(FUNC(oric_jasmin_device::side_sel_w));
m_fdlatch->q_out_cb<1>().set(m_fdc, FUNC(wd1770_device::mr_w));
- m_fdlatch->q_out_cb<2>().set(FUNC(jasmin_device::ram_access_w));
- m_fdlatch->q_out_cb<3>().set(FUNC(jasmin_device::rom_access_w));
- m_fdlatch->q_out_cb<4>().set(FUNC(jasmin_device::select_w));
- m_fdlatch->q_out_cb<5>().set(FUNC(jasmin_device::select_w));
- m_fdlatch->q_out_cb<6>().set(FUNC(jasmin_device::select_w));
- m_fdlatch->q_out_cb<7>().set(FUNC(jasmin_device::select_w));
+ m_fdlatch->q_out_cb<2>().set(FUNC(oric_jasmin_device::ram_access_w));
+ m_fdlatch->q_out_cb<3>().set(FUNC(oric_jasmin_device::rom_access_w));
+ m_fdlatch->q_out_cb<4>().set(FUNC(oric_jasmin_device::select_w));
+ m_fdlatch->q_out_cb<5>().set(FUNC(oric_jasmin_device::select_w));
+ m_fdlatch->q_out_cb<6>().set(FUNC(oric_jasmin_device::select_w));
+ m_fdlatch->q_out_cb<7>().set(FUNC(oric_jasmin_device::select_w));
}
-ioport_constructor jasmin_device::device_input_ports() const
+ioport_constructor oric_jasmin_device::device_input_ports() const
{
return INPUT_PORTS_NAME( jasmin );
}
-void jasmin_device::remap()
+void oric_jasmin_device::remap()
{
if(m_fdlatch->q3_r()) {
if(m_fdlatch->q2_r()) {
@@ -119,7 +119,7 @@ void jasmin_device::remap()
}
}
-INPUT_CHANGED_MEMBER(jasmin_device::boot_pressed)
+INPUT_CHANGED_MEMBER(oric_jasmin_device::boot_pressed)
{
if(newval) {
m_fdlatch->write_bit(3, 1);
@@ -127,23 +127,23 @@ INPUT_CHANGED_MEMBER(jasmin_device::boot_pressed)
}
}
-WRITE_LINE_MEMBER(jasmin_device::side_sel_w)
+WRITE_LINE_MEMBER(oric_jasmin_device::side_sel_w)
{
if(m_cur_floppy)
m_cur_floppy->ss_w(state);
}
-WRITE_LINE_MEMBER(jasmin_device::ram_access_w)
+WRITE_LINE_MEMBER(oric_jasmin_device::ram_access_w)
{
remap();
}
-WRITE_LINE_MEMBER(jasmin_device::rom_access_w)
+WRITE_LINE_MEMBER(oric_jasmin_device::rom_access_w)
{
remap();
}
-WRITE_LINE_MEMBER(jasmin_device::select_w)
+WRITE_LINE_MEMBER(oric_jasmin_device::select_w)
{
m_cur_floppy = nullptr;
for(int i=0; i != 4; i++)
diff --git a/src/devices/bus/oricext/jasmin.h b/src/devices/bus/oricext/jasmin.h
index a9c6fe78ba9..43823b788f1 100644
--- a/src/devices/bus/oricext/jasmin.h
+++ b/src/devices/bus/oricext/jasmin.h
@@ -10,13 +10,13 @@
#include "machine/74259.h"
#include "machine/wd_fdc.h"
-DECLARE_DEVICE_TYPE(JASMIN, jasmin_device)
+DECLARE_DEVICE_TYPE(ORIC_JASMIN, oric_jasmin_device)
-class jasmin_device : public oricext_device
+class oric_jasmin_device : public device_t, public device_oricext_interface
{
public:
- jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~jasmin_device();
+ oric_jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~oric_jasmin_device();
DECLARE_INPUT_CHANGED_MEMBER(boot_pressed);
diff --git a/src/devices/bus/oricext/microdisc.cpp b/src/devices/bus/oricext/microdisc.cpp
index a5e4bb4d889..a3f92c23c52 100644
--- a/src/devices/bus/oricext/microdisc.cpp
+++ b/src/devices/bus/oricext/microdisc.cpp
@@ -4,14 +4,14 @@
#include "microdisc.h"
#include "formats/oric_dsk.h"
-DEFINE_DEVICE_TYPE(MICRODISC, microdisc_device, "microdisc", "Microdisc floppy drive interface")
+DEFINE_DEVICE_TYPE(ORIC_MICRODISC, oric_microdisc_device, "oric_microdisc", "Microdisc floppy drive interface")
ROM_START( microdisc )
ROM_REGION( 0x2000, "microdisc", 0 )
ROM_LOAD ("microdis.rom", 0, 0x02000, CRC(a9664a9c) SHA1(0d2ef6e67322f48f4b7e08d8bbe68827e2074561) )
ROM_END
-FLOPPY_FORMATS_MEMBER( microdisc_device::floppy_formats )
+FLOPPY_FORMATS_MEMBER( oric_microdisc_device::floppy_formats )
FLOPPY_ORIC_DSK_FORMAT
FLOPPY_FORMATS_END
@@ -20,28 +20,28 @@ static void microdisc_floppies(device_slot_interface &device)
device.option_add("3dsdd", FLOPPY_3_DSDD);
}
-void microdisc_device::map(address_map &map)
+void oric_microdisc_device::map(address_map &map)
{
map(0x310, 0x313).rw("fdc", FUNC(fd1793_device::read), FUNC(fd1793_device::write));
- map(0x314, 0x314).rw(FUNC(microdisc_device::port_314_r), FUNC(microdisc_device::port_314_w));
- map(0x318, 0x318).r(FUNC(microdisc_device::port_318_r));
+ map(0x314, 0x314).rw(FUNC(oric_microdisc_device::port_314_r), FUNC(oric_microdisc_device::port_314_w));
+ map(0x318, 0x318).r(FUNC(oric_microdisc_device::port_318_r));
}
-microdisc_device::microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- oricext_device(mconfig, MICRODISC, tag, owner, clock),
+oric_microdisc_device::oric_microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, OR