summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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, ORIC_MICRODISC, tag, owner, clock),
+ device_oricext_interface(mconfig, *this),
fdc(*this, "fdc"), microdisc_rom(nullptr), port_314(0), intrq_state(false), drq_state(false), hld_state(false)
{
}
-microdisc_device::~microdisc_device()
+oric_microdisc_device::~oric_microdisc_device()
{
}
-void microdisc_device::device_start()
+void oric_microdisc_device::device_start()
{
- oricext_device::device_start();
microdisc_rom = device().machine().root_device().memregion(this->subtag("microdisc").c_str())->base();
- cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, &microdisc_device::map);
+ cpu->space(AS_PROGRAM).install_device(0x0000, 0xffff, *this, &oric_microdisc_device::map);
for(int i=0; i<4; i++) {
char name[32];
@@ -51,7 +51,7 @@ void microdisc_device::device_start()
intrq_state = drq_state = hld_state = false;
}
-void microdisc_device::device_reset()
+void oric_microdisc_device::device_reset()
{
port_314 = 0x00;
irq_w(false);
@@ -63,26 +63,26 @@ void microdisc_device::device_reset()
ram[0xe000] = 0x42;
}
-const tiny_rom_entry *microdisc_device::device_rom_region() const
+const tiny_rom_entry *oric_microdisc_device::device_rom_region() const
{
return ROM_NAME( microdisc );
}
-void microdisc_device::device_add_mconfig(machine_config &config)
+void oric_microdisc_device::device_add_mconfig(machine_config &config)
{
FD1793(config, fdc, 8_MHz_XTAL / 8);
- fdc->intrq_wr_callback().set(FUNC(microdisc_device::fdc_irq_w));
- fdc->drq_wr_callback().set(FUNC(microdisc_device::fdc_drq_w));
- fdc->hld_wr_callback().set(FUNC(microdisc_device::fdc_hld_w));
+ fdc->intrq_wr_callback().set(FUNC(oric_microdisc_device::fdc_irq_w));
+ fdc->drq_wr_callback().set(FUNC(oric_microdisc_device::fdc_drq_w));
+ fdc->hld_wr_callback().set(FUNC(oric_microdisc_device::fdc_hld_w));
fdc->set_force_ready(true);
- FLOPPY_CONNECTOR(config, "fdc:0", microdisc_floppies, "3dsdd", microdisc_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:1", microdisc_floppies, nullptr, microdisc_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:2", microdisc_floppies, nullptr, microdisc_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:3", microdisc_floppies, nullptr, microdisc_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:0", microdisc_floppies, "3dsdd", oric_microdisc_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:2", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:3", microdisc_floppies, nullptr, oric_microdisc_device::floppy_formats);
}
-void microdisc_device::remap()
+void oric_microdisc_device::remap()
{
if(port_314 & P_ROMDIS) {
bank_c000_r->set_base(rom+0x0000);
@@ -108,7 +108,7 @@ void microdisc_device::remap()
}
}
-WRITE8_MEMBER(microdisc_device::port_314_w)
+WRITE8_MEMBER(oric_microdisc_device::port_314_w)
{
port_314 = data;
remap();
@@ -122,28 +122,28 @@ WRITE8_MEMBER(microdisc_device::port_314_w)
irq_w(intrq_state && (port_314 & P_IRQEN));
}
-READ8_MEMBER(microdisc_device::port_314_r)
+READ8_MEMBER(oric_microdisc_device::port_314_r)
{
return (intrq_state && (port_314 & P_IRQEN)) ? 0x7f : 0xff;
}
-READ8_MEMBER(microdisc_device::port_318_r)
+READ8_MEMBER(oric_microdisc_device::port_318_r)
{
return drq_state ? 0x7f : 0xff;
}
-WRITE_LINE_MEMBER(microdisc_device::fdc_irq_w)
+WRITE_LINE_MEMBER(oric_microdisc_device::fdc_irq_w)
{
intrq_state = state;
irq_w(intrq_state && (port_314 & P_IRQEN));
}
-WRITE_LINE_MEMBER(microdisc_device::fdc_drq_w)
+WRITE_LINE_MEMBER(oric_microdisc_device::fdc_drq_w)
{
drq_state = state;
}
-WRITE_LINE_MEMBER(microdisc_device::fdc_hld_w)
+WRITE_LINE_MEMBER(oric_microdisc_device::fdc_hld_w)
{
logerror("hld %d\n", state);
hld_state = state;
diff --git a/src/devices/bus/oricext/microdisc.h b/src/devices/bus/oricext/microdisc.h
index a5f97151f0d..648e1651310 100644
--- a/src/devices/bus/oricext/microdisc.h
+++ b/src/devices/bus/oricext/microdisc.h
@@ -7,14 +7,13 @@
#include "imagedev/floppy.h"
#include "machine/wd_fdc.h"
-DECLARE_DEVICE_TYPE(MICRODISC, microdisc_device)
+DECLARE_DEVICE_TYPE(ORIC_MICRODISC, oric_microdisc_device)
-class microdisc_device : public oricext_device
+class oric_microdisc_device : public device_t, public device_oricext_interface
{
public:
- microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~microdisc_device();
-
+ oric_microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~oric_microdisc_device();
protected:
enum {
diff --git a/src/devices/bus/oricext/oricext.cpp b/src/devices/bus/oricext/oricext.cpp
index 8f1204d0f57..48dbb7c6a28 100644
--- a/src/devices/bus/oricext/oricext.cpp
+++ b/src/devices/bus/oricext/oricext.cpp
@@ -7,11 +7,11 @@
DEFINE_DEVICE_TYPE(ORICEXT_CONNECTOR, oricext_connector, "oricext_connector", "ORIC extension connector")
-oricext_connector::oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ORICEXT_CONNECTOR, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
- , irq_handler(*this)
- , cputag(nullptr)
+oricext_connector::oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, ORICEXT_CONNECTOR, tag, owner, clock),
+ device_single_card_slot_interface<device_oricext_interface>(mconfig, *this),
+ irq_handler(*this),
+ cputag(nullptr)
{
}
@@ -36,14 +36,13 @@ void oricext_connector::irq_w(int state)
void oricext_connector::device_config_complete()
{
- oricext_device *dev = dynamic_cast<oricext_device *>(get_card_device());
+ device_oricext_interface *dev = get_card_device();
if(dev)
dev->set_cputag(cputag);
}
-oricext_device::oricext_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_oricext_interface::device_oricext_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "oricext"),
cputag(nullptr),
cpu(nullptr),
connector(nullptr),
@@ -58,35 +57,35 @@ oricext_device::oricext_device(const machine_config &mconfig, device_type type,
{
}
-void oricext_device::set_cputag(const char *tag)
+void device_oricext_interface::set_cputag(const char *tag)
{
cputag = tag;
}
-void oricext_device::device_start()
+void device_oricext_interface::interface_pre_start()
{
- cpu = machine().device<m6502_device>(cputag);
- connector = downcast<oricext_connector *>(owner());
- bank_c000_r = membank(":bank_c000_r");
- bank_e000_r = membank(":bank_e000_r");
- bank_f800_r = membank(":bank_f800_r");
- bank_c000_w = membank(":bank_c000_w");
- bank_e000_w = membank(":bank_e000_w");
- bank_f800_w = membank(":bank_f800_w");
- rom = (uint8_t *)machine().root_device().memregion(cputag)->base();
- ram = (uint8_t *)memshare(":ram")->ptr();
+ cpu = device().machine().device<m6502_device>(cputag);
+ connector = downcast<oricext_connector *>(device().owner());
+ bank_c000_r = device().membank(":bank_c000_r");
+ bank_e000_r = device().membank(":bank_e000_r");
+ bank_f800_r = device().membank(":bank_f800_r");
+ bank_c000_w = device().membank(":bank_c000_w");
+ bank_e000_w = device().membank(":bank_e000_w");
+ bank_f800_w = device().membank(":bank_f800_w");
+ rom = (uint8_t *)device().machine().root_device().memregion(cputag)->base();
+ ram = (uint8_t *)device().memshare(":ram")->ptr();
memset(junk_read, 0xff, sizeof(junk_read));
memset(junk_write, 0x00, sizeof(junk_write));
}
-WRITE_LINE_MEMBER(oricext_device::irq_w)
+WRITE_LINE_MEMBER(device_oricext_interface::irq_w)
{
connector->irq_w(state);
}
void oricext_intf(device_slot_interface &device)
{
- device.option_add("jasmin", JASMIN);
- device.option_add("microdisc", MICRODISC);
+ device.option_add("jasmin", ORIC_JASMIN);
+ device.option_add("microdisc", ORIC_MICRODISC);
}
diff --git a/src/devices/bus/oricext/oricext.h b/src/devices/bus/oricext/oricext.h
index 067d1f611c7..8cfb67aa8e5 100644
--- a/src/devices/bus/oricext/oricext.h
+++ b/src/devices/bus/oricext/oricext.h
@@ -13,9 +13,9 @@
#include "cpu/m6502/m6502.h"
-class oricext_device;
+class device_oricext_interface;
-class oricext_connector: public device_t, public device_slot_interface
+class oricext_connector: public device_t, public device_single_card_slot_interface<device_oricext_interface>
{
public:
template <typename T>
@@ -44,17 +44,16 @@ protected:
const char *cputag;
};
-class oricext_device : public device_t,
- public device_slot_card_interface
+class device_oricext_interface : public device_interface
{
public:
void set_cputag(const char *tag);
DECLARE_WRITE_LINE_MEMBER(irq_w);
protected:
- oricext_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ device_oricext_interface(const machine_config &mconfig, device_t &device);
- virtual void device_start() override;
+ virtual void interface_pre_start() override;
const char *cputag;
m6502_device *cpu;
diff --git a/src/devices/bus/pc1512/mouse.cpp b/src/devices/bus/pc1512/mouse.cpp
index 882284e89d2..f1d92ce4df5 100644
--- a/src/devices/bus/pc1512/mouse.cpp
+++ b/src/devices/bus/pc1512/mouse.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(PC1512_MOUSE, pc1512_mouse_device, "pc1512_mouse",
//-------------------------------------------------
device_pc1512_mouse_port_interface::device_pc1512_mouse_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "pc1512mouse")
{
m_port = dynamic_cast<pc1512_mouse_port_device *>(device.owner());
}
@@ -46,7 +46,7 @@ device_pc1512_mouse_port_interface::device_pc1512_mouse_port_interface(const mac
pc1512_mouse_port_device::pc1512_mouse_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PC1512_MOUSE_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pc1512_mouse_port_interface>(mconfig, *this),
m_write_x(*this),
m_write_y(*this),
m_write_m1(*this),
@@ -68,7 +68,7 @@ pc1512_mouse_device::pc1512_mouse_device(const machine_config &mconfig, const ch
void pc1512_mouse_port_device::device_start()
{
- m_device = dynamic_cast<device_pc1512_mouse_port_interface *>(get_card_device());
+ m_device = get_card_device();
// resolve callbacks
m_write_x.resolve_safe();
diff --git a/src/devices/bus/pc1512/mouse.h b/src/devices/bus/pc1512/mouse.h
index 9c71eb4d89d..8b2215fe1c0 100644
--- a/src/devices/bus/pc1512/mouse.h
+++ b/src/devices/bus/pc1512/mouse.h
@@ -27,13 +27,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define PC1512_MOUSE_PORT_TAG "mous"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -42,7 +35,7 @@ class pc1512_mouse_port_device;
// ======================> device_pc1512_mouse_port_interface
-class device_pc1512_mouse_port_interface : public device_slot_card_interface
+class device_pc1512_mouse_port_interface : public device_interface
{
public:
// construction/destruction
@@ -57,7 +50,7 @@ protected:
// ======================> pc1512_mouse_port_device
-class pc1512_mouse_port_device : public device_t, public device_slot_interface
+class pc1512_mouse_port_device : public device_t, public device_single_card_slot_interface<device_pc1512_mouse_port_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/pc_joy/pc_joy.cpp b/src/devices/bus/pc_joy/pc_joy.cpp
index 3e59be3a86c..670382bebab 100644
--- a/src/devices/bus/pc_joy/pc_joy.cpp
+++ b/src/devices/bus/pc_joy/pc_joy.cpp
@@ -16,7 +16,7 @@ DEFINE_DEVICE_TYPE(PC_JOY, pc_joy_device, "pc_joy", "PC joystick port")
pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PC_JOY, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pc_joy_interface>(mconfig, *this),
m_dev(nullptr)
{
option_reset();
@@ -45,11 +45,11 @@ WRITE8_MEMBER ( pc_joy_device::joy_port_w )
void pc_joy_device::device_config_complete()
{
- m_dev = dynamic_cast<device_pc_joy_interface *>(get_card_device());
+ m_dev = get_card_device();
}
device_pc_joy_interface::device_pc_joy_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "pcjoy")
{
}
diff --git a/src/devices/bus/pc_joy/pc_joy.h b/src/devices/bus/pc_joy/pc_joy.h
index 66729b76fc4..d66636c3ad5 100644
--- a/src/devices/bus/pc_joy/pc_joy.h
+++ b/src/devices/bus/pc_joy/pc_joy.h
@@ -16,7 +16,7 @@
void pc_joysticks(device_slot_interface &device);
-class device_pc_joy_interface : public device_slot_card_interface
+class device_pc_joy_interface : public device_interface
{
public:
virtual ~device_pc_joy_interface();
@@ -32,7 +32,7 @@ protected:
device_pc_joy_interface(const machine_config &mconfig, device_t &device);
};
-class pc_joy_device : public device_t, public device_slot_interface
+class pc_joy_device : public device_t, public device_single_card_slot_interface<device_pc_joy_interface>
{
public:
pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp
index 0b308b57f96..2ab863b01dc 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.cpp
+++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp
@@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE(PC_KBDC_SLOT, pc_kbdc_slot_device, "pc_kbdc_slot", "PC keyboa
//-------------------------------------------------
pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PC_KBDC_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pc_kbd_interface>(mconfig, *this),
m_kbdc_device(nullptr)
{
}
@@ -48,8 +48,7 @@ pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const ch
void pc_kbdc_slot_device::device_start()
{
- device_pc_kbd_interface *pc_kbd = dynamic_cast<device_pc_kbd_interface *>(get_card_device());
-
+ device_pc_kbd_interface *const pc_kbd = get_card_device();
if (pc_kbd)
pc_kbd->set_pc_kbdc(m_kbdc_device);
}
@@ -189,7 +188,7 @@ WRITE_LINE_MEMBER(pc_kbdc_device::data_write_from_kb)
//-------------------------------------------------
device_pc_kbd_interface::device_pc_kbd_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "pckbd")
, m_pc_kbdc(nullptr)
, m_pc_kbdc_tag(nullptr)
{
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.h b/src/devices/bus/pc_kbd/pc_kbdc.h
index 34161c23c5a..1b4ab50dd56 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.h
+++ b/src/devices/bus/pc_kbd/pc_kbdc.h
@@ -20,9 +20,11 @@ set the data line and then set the clock line.
// TYPE DEFINITIONS
//**************************************************************************
+class device_pc_kbd_interface;
+
class pc_kbdc_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_pc_kbd_interface>
{
public:
// construction/destruction
@@ -53,8 +55,6 @@ protected:
DECLARE_DEVICE_TYPE(PC_KBDC_SLOT, pc_kbdc_slot_device)
-class device_pc_kbd_interface;
-
class pc_kbdc_device : public device_t
{
public:
@@ -103,7 +103,7 @@ DECLARE_DEVICE_TYPE(PC_KBDC, pc_kbdc_device)
// ======================> device_pc_pbd_interface
-class device_pc_kbd_interface : public device_slot_card_interface
+class device_pc_kbd_interface : public device_interface
{
friend class pc_kbdc_device;
public:
@@ -131,5 +131,4 @@ protected:
};
-
#endif // MAME_BUS_PC_KBD_PC_KBDC_H
diff --git a/src/devices/bus/pce/pce_slot.cpp b/src/devices/bus/pce/pce_slot.cpp
index ea49389206b..70ab09e23c1 100644
--- a/src/devices/bus/pce/pce_slot.cpp
+++ b/src/devices/bus/pce/pce_slot.cpp
@@ -29,10 +29,10 @@ DEFINE_DEVICE_TYPE(PCE_CART_SLOT, pce_cart_slot_device, "pce_cart_slot", "PCE/TG
// device_pce_cart_interface - constructor
//-------------------------------------------------
-device_pce_cart_interface::device_pce_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_pce_cart_interface::device_pce_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "pcecart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -138,7 +138,7 @@ void device_pce_cart_interface::rom_map_setup(uint32_t size)
pce_cart_slot_device::pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PCE_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pce_cart_interface>(mconfig, *this),
m_interface("pce_cart"),
m_type(PCE_STD), m_cart(nullptr)
{
@@ -159,7 +159,7 @@ pce_cart_slot_device::~pce_cart_slot_device()
void pce_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_pce_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h
index 53d690cc4ce..6605666ae20 100644
--- a/src/devices/bus/pce/pce_slot.h
+++ b/src/devices/bus/pce/pce_slot.h
@@ -27,7 +27,7 @@ enum
// ======================> device_pce_cart_interface
-class device_pce_cart_interface : public device_slot_card_interface
+class device_pce_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -62,7 +62,7 @@ protected:
class pce_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_pce_cart_interface>
{
public:
// construction/destruction
@@ -80,9 +80,6 @@ public:
pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~pce_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;
@@ -110,6 +107,9 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_cart);
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
const char *m_interface;
int m_type;
device_pce_cart_interface *m_cart;
diff --git a/src/devices/bus/pet/cass.cpp b/src/devices/bus/pet/cass.cpp
index 52b501b68b4..301633e6d73 100644
--- a/src/devices/bus/pet/cass.cpp
+++ b/src/devices/bus/pet/cass.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(PET_DATASSETTE_PORT, pet_datassette_port_device, "pet_datasse
//-------------------------------------------------
device_pet_datassette_port_interface::device_pet_datassette_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+ : device_interface(device, "petcass")
{
m_slot = dynamic_cast<pet_datassette_port_device *>(device.owner());
}
@@ -54,7 +54,7 @@ device_pet_datassette_port_interface::~device_pet_datassette_port_interface()
pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PET_DATASSETTE_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pet_datassette_port_interface>(mconfig, *this),
m_read_handler(*this), m_cart(nullptr)
{
}
@@ -75,7 +75,7 @@ pet_datassette_port_device::~pet_datassette_port_device()
void pet_datassette_port_device::device_start()
{
- m_cart = dynamic_cast<device_pet_datassette_port_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_read_handler.resolve_safe();
diff --git a/src/devices/bus/pet/cass.h b/src/devices/bus/pet/cass.h
index babfdf2058d..a6a6eac11f9 100644
--- a/src/devices/bus/pet/cass.h
+++ b/src/devices/bus/pet/cass.h
@@ -39,7 +39,7 @@
class device_pet_datassette_port_interface;
-class pet_datassette_port_device : public device_t, public device_slot_interface
+class pet_datassette_port_device : public device_t, public device_single_card_slot_interface<device_pet_datassette_port_interface>
{
public:
template <typename T>
@@ -80,7 +80,7 @@ protected:
// ======================> device_pet_datassette_port_interface
// class representing interface-specific live c64_expansion card
-class device_pet_datassette_port_interface : public device_slot_card_interface
+class device_pet_datassette_port_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/pet/exp.cpp b/src/devices/bus/pet/exp.cpp
index 07aa7155b93..aef8c5dfbf4 100644
--- a/src/devices/bus/pet/exp.cpp
+++ b/src/devices/bus/pet/exp.cpp
@@ -37,7 +37,8 @@ DEFINE_DEVICE_TYPE(PET_EXPANSION_SLOT, pet_expansion_slot_device, "pet_expansion
pet_expansion_slot_device::pet_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PET_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_card(nullptr),
+ device_single_card_slot_interface<device_pet_expansion_card_interface>(mconfig, *this),
+ m_card(nullptr),
m_read_dma(*this),
m_write_dma(*this)
{
@@ -58,7 +59,7 @@ pet_expansion_slot_device::~pet_expansion_slot_device()
//-------------------------------------------------
device_pet_expansion_card_interface::device_pet_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "petexp")
{
m_slot = dynamic_cast<pet_expansion_slot_device *>(device.owner());
}
@@ -74,27 +75,12 @@ device_pet_expansion_card_interface::~device_pet_expansion_card_interface()
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void pet_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_pet_expansion_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_pet_expansion_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pet_expansion_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_pet_expansion_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_pet_expansion_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_read_dma.resolve_safe(0);
@@ -103,15 +89,6 @@ void pet_expansion_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void pet_expansion_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// norom_r - NO ROM read
//-------------------------------------------------
@@ -127,10 +104,8 @@ int pet_expansion_slot_device::norom_r(offs_t offset, int sel)
uint8_t pet_expansion_slot_device::read(offs_t offset, uint8_t data, int &sel)
{
- if (m_card != nullptr)
- {
+ if (m_card)
data = m_card->pet_bd_r(offset, data, sel);
- }
return data;
}
diff --git a/src/devices/bus/pet/exp.h b/src/devices/bus/pet/exp.h
index 39309b65f4c..d3adf1e9262 100644
--- a/src/devices/bus/pet/exp.h
+++ b/src/devices/bus/pet/exp.h
@@ -32,7 +32,7 @@
class device_pet_expansion_card_interface;
class pet_expansion_slot_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_pet_expansion_card_interface>
{
public:
template <typename T>
@@ -86,9 +86,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_pet_expansion_card_interface *m_card;
@@ -99,7 +97,7 @@ protected:
// ======================> device_pet_expansion_card_interface
-class device_pet_expansion_card_interface : public device_slot_card_interface
+class device_pet_expansion_card_interface : public device_interface
{
friend class pet_expansion_slot_device;
diff --git a/src/devices/bus/pet/user.cpp b/src/devices/bus/pet/user.cpp
index d0f889db0b6..574c6c9afe9 100644
--- a/src/devices/bus/pet/user.cpp
+++ b/src/devices/bus/pet/user.cpp
@@ -110,7 +110,7 @@ WRITE_LINE_MEMBER( pet_user_port_device::write_m ) { if (m_card != nullptr) m_ca
// class device_pet_user_port_interface
device_pet_user_port_interface::device_pet_user_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+ : device_interface(device, "petuser")
{
m_slot = dynamic_cast<pet_user_port_device *>(device.owner());
}
diff --git a/src/devices/bus/pet/user.h b/src/devices/bus/pet/user.h
index 51e5b6f3efe..4a6a64c3081 100644
--- a/src/devices/bus/pet/user.h
+++ b/src/devices/bus/pet/user.h
@@ -31,8 +31,7 @@ DECLARE_DEVICE_TYPE(PET_USER_PORT, pet_user_port_device)
class device_pet_user_port_interface;
-class pet_user_port_device : public device_t,
- public device_slot_interface
+class pet_user_port_device : public device_t, public device_slot_interface
{
friend class device_pet_user_port_interface;
@@ -118,7 +117,7 @@ private:
};
-class device_pet_user_port_interface : public device_slot_card_interface
+class device_pet_user_port_interface : public device_interface
{
friend class pet_user_port_device;
diff --git a/src/devices/bus/plus4/c1551.cpp b/src/devices/bus/plus4/c1551.cpp
index 333dea55fb0..4f9b60cc163 100644
--- a/src/devices/bus/plus4/c1551.cpp
+++ b/src/devices/bus/plus4/c1551.cpp
@@ -16,8 +16,6 @@
//**************************************************************************
#define M6510T_TAG "u2"
-#define M6523_0_TAG "u3"
-#define M6523_1_TAG "ci_u2"
#define C64H156_TAG "u6"
#define PLA_TAG "u1"
@@ -341,15 +339,15 @@ void c1551_device::device_add_mconfig(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &c1551_device::c1551_mem);
m_maincpu->read_callback().set(FUNC(c1551_device::port_r));
m_maincpu->write_callback().set(FUNC(c1551_device::port_w));
- config.m_perfect_cpu_quantum = subtag(M6510T_TAG);
+ //config.set_perfect_quantum(m_maincpu); FIXME: not safe in a slot device - add barriers
PLS100(config, m_pla);
TPI6525(config, m_tpi0, 0);
m_tpi0->in_pa_cb().set(FUNC(c1551_device::tcbm_data_r));
m_tpi0->out_pa_cb().set(FUNC(c1551_device::tcbm_data_w));
- m_tpi0->in_pb_cb().set(C64H156_TAG, FUNC(c64h156_device::yb_r));
- m_tpi0->out_pb_cb().set(C64H156_TAG, FUNC(c64h156_device::yb_w));
+ m_tpi0->in_pb_cb().set(m_ga, FUNC(c64h156_device::yb_r));
+ m_tpi0->out_pb_cb().set(m_ga, FUNC(c64h156_device::yb_w));
m_tpi0->in_pc_cb().set(FUNC(c1551_device::tpi0_pc_r));
m_tpi0->out_pc_cb().set(FUNC(c1551_device::tpi0_pc_w));
@@ -361,7 +359,7 @@ void c1551_device::device_add_mconfig(machine_config &config)
m_tpi1->out_pc_cb().set(FUNC(c1551_device::tpi1_pc_w));
C64H156(config, m_ga, XTAL(16'000'000));
- m_ga->byte_callback().set(C64H156_TAG, FUNC(c64h156_device::atni_w));
+ m_ga->byte_callback().set(m_ga, FUNC(c64h156_device::atni_w));
floppy_connector &connector(FLOPPY_CONNECTOR(config, C64H156_TAG":0", 0));
connector.option_add("525ssqd", FLOPPY_525_SSQD);
@@ -413,8 +411,8 @@ c1551_device::c1551_device(const machine_config &mconfig, const char *tag, devic
: device_t(mconfig, C1551, tag, owner, clock)
, device_plus4_expansion_card_interface(mconfig, *this)
, m_maincpu(*this, M6510T_TAG)
- , m_tpi0(*this, M6523_0_TAG)
- , m_tpi1(*this, M6523_1_TAG)
+ , m_tpi0(*this, "u3")
+ , m_tpi1(*this, "ci_u2")
, m_ga(*this, C64H156_TAG)
, m_pla(*this, PLA_TAG)
, m_floppy(*this, C64H156_TAG":0:525ssqd")
diff --git a/src/devices/bus/plus4/exp.cpp b/src/devices/bus/plus4/exp.cpp
index 83e8ad4277a..5ca28efd81d 100644
--- a/src/devices/bus/plus4/exp.cpp
+++ b/src/devices/bus/plus4/exp.cpp
@@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE(PLUS4_EXPANSION_SLOT, plus4_expansion_slot_device, "plus4_exp
//-------------------------------------------------
device_plus4_expansion_card_interface::device_plus4_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "plus4exp"),
m_c1l(*this, "c1l"),
m_c1h(*this, "c1h"),
m_c2l(*this, "c2l"),
@@ -70,38 +70,24 @@ device_plus4_expansion_card_interface::~device_plus4_expansion_card_interface()
plus4_expansion_slot_device::plus4_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PLUS4_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_plus4_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_write_irq(*this),
m_read_dma_cd(*this),
m_write_dma_cd(*this),
- m_write_aec(*this), m_card(nullptr)
+ m_write_aec(*this),
+ m_card(nullptr)
{
}
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void plus4_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_plus4_expansion_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_plus4_expansion_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void plus4_expansion_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_plus4_expansion_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_plus4_expansion_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
@@ -110,6 +96,7 @@ void plus4_expansion_slot_device::device_start()
m_write_aec.resolve_safe();
// inherit bus clock
+ // FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
if (clock() == 0)
{
plus4_expansion_slot_device *root = machine().device<plus4_expansion_slot_device>(PLUS4_EXPANSION_SLOT_TAG);
@@ -120,15 +107,6 @@ void plus4_expansion_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void plus4_expansion_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// call_load -
//-------------------------------------------------
diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h
index 9f625442d99..7ef8b3f4080 100644
--- a/src/devices/bus/plus4/exp.h
+++ b/src/devices/bus/plus4/exp.h
@@ -58,7 +58,7 @@
class device_plus4_expansion_card_interface;
class plus4_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_plus4_expansion_card_interface>,
public device_image_interface
{
public:
@@ -92,9 +92,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;
// image-level overrides
virtual image_init_result call_load() override;
@@ -124,7 +122,7 @@ protected:
// ======================> device_plus4_expansion_card_interface
-class device_plus4_expansion_card_interface : public device_slot_card_interface
+class device_plus4_expansion_card_interface : public device_interface
{
friend class plus4_expansion_slot_device;
diff --git a/src/devices/bus/pofo/ccm.cpp b/src/devices/bus/pofo/ccm.cpp
index 9562ddfecd6..11e90cc852c 100644
--- a/src/devices/bus/pofo/ccm.cpp
+++ b/src/devices/bus/pofo/ccm.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(PORTFOLIO_MEMORY_CARD_SLOT, portfolio_memory_card_slot_device
//-------------------------------------------------
device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "pofoccm"),
m_rom(*this, "rom"),
m_nvram(*this, "nvram")
{
@@ -47,7 +47,7 @@ device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_i
portfolio_memory_card_slot_device::portfolio_memory_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PORTFOLIO_MEMORY_CARD_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_portfolio_memory_card_slot_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_card(nullptr)
{
@@ -60,7 +60,7 @@ portfolio_memory_card_slot_device::portfolio_memory_card_slot_device(const machi
void portfolio_memory_card_slot_device::device_start()
{
- m_card = dynamic_cast<device_portfolio_memory_card_slot_interface *>(get_card_device());
+ m_card = get_card_device();
}
@@ -73,13 +73,9 @@ image_init_result portfolio_memory_card_slot_device::call_load()
if (m_card)
{
if (!loaded_through_softlist())
- {
fread(m_card->m_rom, length());
- }
else
- {
load_software_region("rom", m_card->m_rom);
- }
}
return image_init_result::PASS;
diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h
index 42bfcb4356d..974489ff1bf 100644
--- a/src/devices/bus/pofo/ccm.h
+++ b/src/devices/bus/pofo/ccm.h
@@ -68,7 +68,7 @@
class portfolio_memory_card_slot_device;
-class device_portfolio_memory_card_slot_interface : public device_slot_card_interface
+class device_portfolio_memory_card_slot_interface : public device_interface
{
friend class portfolio_memory_card_slot_device;
@@ -92,7 +92,7 @@ protected:
// ======================> portfolio_memory_card_slot_device
class portfolio_memory_card_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_portfolio_memory_card_slot_interface>,
public device_image_interface
{
public:
diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp
index f8a892fbe6c..8dc14ecfd03 100644
--- a/src/devices/bus/pofo/exp.cpp
+++ b/src/devices/bus/pofo/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(PORTFOLIO_EXPANSION_SLOT, portfolio_expansion_slot_device, "p
//-------------------------------------------------
device_portfolio_expansion_slot_interface::device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig,device)
+ device_interface(device, "pofoexp")
{
m_slot = dynamic_cast<portfolio_expansion_slot_device *>(device.owner());
}
@@ -49,7 +49,7 @@ WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::wake_w ) { m_slot-
portfolio_expansion_slot_device::portfolio_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PORTFOLIO_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_portfolio_expansion_slot_interface>(mconfig, *this),
m_write_eint(*this),
m_write_nmio(*this),
m_write_wake(*this),
@@ -64,7 +64,7 @@ portfolio_expansion_slot_device::portfolio_expansion_slot_device(const machine_c
void portfolio_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_portfolio_expansion_slot_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_eint.resolve_safe();
diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h
index 2206d5af2fe..f760ce694c3 100644
--- a/src/devices/bus/pofo/exp.h
+++ b/src/devices/bus/pofo/exp.h
@@ -62,7 +62,7 @@
class portfolio_expansion_slot_device;
-class device_portfolio_expansion_slot_interface : public device_slot_card_interface
+class device_portfolio_expansion_slot_interface : public device_interface
{
public:
virtual bool nmd1() { return 1; }
@@ -91,7 +91,7 @@ protected:
// ======================> portfolio_expansion_slot_device
-class portfolio_expansion_slot_device : public device_t, public device_slot_interface
+class portfolio_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_portfolio_expansion_slot_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/psi_kbd/psi_kbd.cpp b/src/devices/bus/psi_kbd/psi_kbd.cpp
index 36a29518213..1ba3a0e2620 100644
--- a/src/devices/bus/psi_kbd/psi_kbd.cpp
+++ b/src/devices/bus/psi_kbd/psi_kbd.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(PSI_KEYBOARD_INTERFACE, psi_keyboard_bus_device, "psi_kbd", "
psi_keyboard_bus_device::psi_keyboard_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PSI_KEYBOARD_INTERFACE, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_psi_keyboard_interface>(mconfig, *this),
m_kbd(nullptr),
m_rx_handler(*this),
m_key_strobe_handler(*this),
@@ -52,7 +52,7 @@ psi_keyboard_bus_device::~psi_keyboard_bus_device()
void psi_keyboard_bus_device::device_start()
{
// get connected keyboard
- m_kbd = dynamic_cast<device_psi_keyboard_interface *>(get_card_device());
+ m_kbd = get_card_device();
// resolve callbacks
m_rx_handler.resolve_safe();
@@ -65,7 +65,7 @@ void psi_keyboard_bus_device::device_start()
void psi_keyboard_bus_device::device_reset()
{
- m_key_data = 0xff;
+ m_key_data = 0xff; // FIXME: dumb port devices shouldn't mess with data - the keyboard should push this if lines change state on reset
}
//-------------------------------------------------
@@ -88,7 +88,7 @@ WRITE_LINE_MEMBER( psi_keyboard_bus_device::tx_w )
//-------------------------------------------------
device_psi_keyboard_interface::device_psi_keyboard_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "psikbd")
{
m_host = dynamic_cast<psi_keyboard_bus_device *>(device.owner());
}
diff --git a/src/devices/bus/psi_kbd/psi_kbd.h b/src/devices/bus/psi_kbd/psi_kbd.h
index 39aaa84d9d3..74957943fad 100644
--- a/src/devices/bus/psi_kbd/psi_kbd.h
+++ b/src/devices/bus/psi_kbd/psi_kbd.h
@@ -41,7 +41,7 @@ class device_psi_keyboard_interface;
// ======================> psi_keyboard_bus_device
-class psi_keyboard_bus_device : public device_t, public device_slot_interface
+class psi_keyboard_bus_device : public device_t, public device_single_card_slot_interface<device_psi_keyboard_interface>
{
public:
// construction/destruction
@@ -85,13 +85,13 @@ private:
// ======================> device_psi_keyboard_interface
-class device_psi_keyboard_interface : public device_slot_card_interface
+class device_psi_keyboard_interface : public device_interface
{
public:
// construction/destruction
virtual ~device_psi_keyboard_interface();
- virtual void tx_w(int state) {};
+ virtual void tx_w(int state) { }
protected:
device_psi_keyboard_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/psx/ctlrport.cpp b/src/devices/bus/psx/ctlrport.cpp
index 05aae5c5b72..c043ac1bab0 100644
--- a/src/devices/bus/psx/ctlrport.cpp
+++ b/src/devices/bus/psx/ctlrport.cpp
@@ -13,7 +13,7 @@ DEFINE_DEVICE_TYPE(PSX_STANDARD_CONTROLLER, psx_standard_controller_device, "psx
psx_controller_port_device::psx_controller_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PSX_CONTROLLER_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_psx_controller_interface>(mconfig, *this),
m_tx(false),
m_dev(nullptr),
m_card(*this, "card")
@@ -22,7 +22,7 @@ psx_controller_port_device::psx_controller_port_device(const machine_config &mco
void psx_controller_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_psx_controller_interface *>(get_card_device());
+ m_dev = get_card_device();
}
void psx_controller_port_device::device_add_mconfig(machine_config &config)
@@ -98,7 +98,8 @@ void psxcontrollerports_device::ack()
}
device_psx_controller_interface::device_psx_controller_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device), m_odata(0), m_idata(0), m_bit(0), m_count(0), m_memcard(false), m_clock(false), m_sel(false),
+ device_interface(device, "psxctrl"),
+ m_odata(0), m_idata(0), m_bit(0), m_count(0), m_memcard(false), m_clock(false), m_sel(false),
m_ack(true), m_rx(false), m_ack_timer(nullptr), m_owner(nullptr)
{
}
@@ -107,6 +108,13 @@ device_psx_controller_interface::~device_psx_controller_interface()
{
}
+void device_psx_controller_interface::interface_pre_start()
+{
+ m_owner = dynamic_cast<psx_controller_port_device *>(device().owner());
+ if (!m_ack_timer)
+ m_ack_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_psx_controller_interface::ack_timer), this));
+}
+
void device_psx_controller_interface::interface_pre_reset()
{
m_bit = 0;
@@ -121,10 +129,9 @@ void device_psx_controller_interface::interface_pre_reset()
m_owner->ack();
}
-void device_psx_controller_interface::interface_pre_start()
+void device_psx_controller_interface::interface_post_stop()
{
- m_owner = dynamic_cast<psx_controller_port_device *>(device().owner());
- m_ack_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_psx_controller_interface::ack_timer), this));
+ m_ack_timer = nullptr;
}
void device_psx_controller_interface::ack_timer(void *ptr, int param)
@@ -132,13 +139,13 @@ void device_psx_controller_interface::ack_timer(void *ptr, int param)
m_ack = param;
m_owner->ack();
- if(!param)
+ if (!param)
m_ack_timer->adjust(attotime::from_usec(2), 1);
}
void device_psx_controller_interface::do_pad()
{
- if(!m_bit)
+ if (!m_bit)
{
if(!m_count)
m_odata = 0xff;
diff --git a/src/devices/bus/psx/ctlrport.h b/src/devices/bus/psx/ctlrport.h
index 2058cf4868c..d3578eb9b3a 100644
--- a/src/devices/bus/psx/ctlrport.h
+++ b/src/devices/bus/psx/ctlrport.h
@@ -16,7 +16,7 @@ DECLARE_DEVICE_TYPE(PSX_STANDARD_CONTROLLER, psx_standard_controller_device)
class psx_controller_port_device;
-class device_psx_controller_interface : public device_slot_card_interface
+class device_psx_controller_interface : public device_interface
{
friend class psx_multitap_device;
public:
@@ -31,8 +31,9 @@ public:
protected:
device_psx_controller_interface(const machine_config &mconfig, device_t &device);
- virtual void interface_pre_reset() override;
virtual void interface_pre_start() override;
+ virtual void interface_pre_reset() override;
+ virtual void interface_post_stop() override;
enum
{
@@ -104,7 +105,7 @@ private:
};
class psx_controller_port_device : public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<device_psx_controller_interface>
{
public:
template <typename T>
diff --git a/src/devices/bus/psx/parallel.cpp b/src/devices/bus/psx/parallel.cpp
index b7947e11921..a2ad629fa8e 100644
--- a/src/devices/bus/psx/parallel.cpp
+++ b/src/devices/bus/psx/parallel.cpp
@@ -24,8 +24,8 @@ DEFINE_DEVICE_TYPE(PSX_PARALLEL_SLOT, psx_parallel_slot_device, "psx_parallel_sl
// psx_parallel_interface - constructor
//-------------------------------------------------
-psx_parallel_interface::psx_parallel_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+psx_parallel_interface::psx_parallel_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "psxparallel")
{
}
@@ -48,7 +48,7 @@ psx_parallel_interface::~psx_parallel_interface()
psx_parallel_slot_device::psx_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PSX_PARALLEL_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<psx_parallel_interface>(mconfig, *this),
m_card(nullptr)
{
}
@@ -67,15 +67,7 @@ psx_parallel_slot_device::~psx_parallel_slot_device()
void psx_parallel_slot_device::device_start()
{
- m_card = dynamic_cast<psx_parallel_interface *>(get_card_device());
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void psx_parallel_slot_device::device_reset()
-{
+ m_card = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/psx/parallel.h b/src/devices/bus/psx/parallel.h
index fc478149547..66635b3da6d 100644
--- a/src/devices/bus/psx/parallel.h
+++ b/src/devices/bus/psx/parallel.h
@@ -14,7 +14,7 @@
class psx_parallel_interface;
-class psx_parallel_slot_device : public device_t, public device_slot_interface
+class psx_parallel_slot_device : public device_t, public device_single_card_slot_interface<psx_parallel_interface>
{
public:
// construction/destruction
@@ -33,25 +33,20 @@ public:
DECLARE_READ16_MEMBER(exp_r);
DECLARE_WRITE16_MEMBER(exp_w);
- const bool hascard() const
- {
- return bool(m_card);
- };
+ bool hascard() const { return bool(m_card); }
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
-
- psx_parallel_interface *m_card;
private:
+ psx_parallel_interface *m_card;
};
// ======================> psx_parallel_interface
-class psx_parallel_interface : public device_slot_card_interface
+class psx_parallel_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/ql/exp.cpp b/src/devices/bus/ql/exp.cpp
index 433f8e257ff..aadb3905b86 100644
--- a/src/devices/bus/ql/exp.cpp
+++ b/src/devices/bus/ql/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(QL_EXPANSION_SLOT, ql_expansion_slot_device, "ql_expansion_sl
//-------------------------------------------------
device_ql_expansion_card_interface::device_ql_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "qlexp"),
m_slot(dynamic_cast<ql_expansion_slot_device *>(device.owner())),
m_romoeh(0)
{
@@ -37,8 +37,6 @@ device_ql_expansion_card_interface::device_ql_expansion_card_interface(const mac
void device_ql_expansion_card_interface::interface_post_start()
{
- device_slot_card_interface::interface_post_start();
-
device().save_item(NAME(m_romoeh));
}
@@ -54,11 +52,12 @@ void device_ql_expansion_card_interface::interface_post_start()
ql_expansion_slot_device::ql_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, QL_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_ql_expansion_card_interface>(mconfig, *this),
m_write_ipl0l(*this),
m_write_ipl1l(*this),
m_write_berrl(*this),
- m_write_extintl(*this), m_card(nullptr)
+ m_write_extintl(*this),
+ m_card(nullptr)
{
}
@@ -67,13 +66,6 @@ ql_expansion_slot_device::ql_expansion_slot_device(const machine_config &mconfig
// device_start - device-specific startup
//-------------------------------------------------
-void ql_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_ql_expansion_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_ql_expansion_card_interface\n", card->tag(), card->name());
-}
-
void ql_expansion_slot_device::device_resolve_objects()
{
// resolve callbacks
@@ -82,14 +74,11 @@ void ql_expansion_slot_device::device_resolve_objects()
m_write_berrl.resolve_safe();
m_write_extintl.resolve_safe();
- m_card = dynamic_cast<device_ql_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
}
void ql_expansion_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !m_card)
- throw emu_fatalerror("ql_expansion_slot_device: card device %s (%s) does not implement device_ql_expansion_card_interface\n", card->tag(), card->name());
}
diff --git a/src/devices/bus/ql/exp.h b/src/devices/bus/ql/exp.h
index 43e8a7b77d5..31948566bfd 100644
--- a/src/devices/bus/ql/exp.h
+++ b/src/devices/bus/ql/exp.h
@@ -56,7 +56,7 @@
class ql_expansion_slot_device;
-class device_ql_expansion_card_interface : public device_slot_card_interface
+class device_ql_expansion_card_interface : public device_interface
{
friend class ql_expansion_slot_device;
@@ -79,7 +79,7 @@ protected:
// ======================> ql_expansion_slot_device
-class ql_expansion_slot_device : public device_t, public device_slot_interface
+class ql_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_ql_expansion_card_interface>
{
public:
// construction/destruction
@@ -112,7 +112,6 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
diff --git a/src/devices/bus/ql/rom.cpp b/src/devices/bus/ql/rom.cpp
index 28bc29d00f4..0c84eadd6b6 100644
--- a/src/devices/bus/ql/rom.cpp
+++ b/src/devices/bus/ql/rom.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(QL_ROM_CARTRIDGE_SLOT, ql_rom_cartridge_slot_device, "ql_rom_
//-------------------------------------------------
device_ql_rom_cartridge_card_interface::device_ql_rom_cartridge_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "qlrom"),
m_rom(*this, "rom"),
m_slot(dynamic_cast<ql_rom_cartridge_slot_device *>(device.owner())),
m_romoeh(0)
@@ -47,8 +47,6 @@ device_ql_rom_cartridge_card_interface::~device_ql_rom_cartridge_card_interface(
void device_ql_rom_cartridge_card_interface::interface_post_start()
{
- device_slot_card_interface::interface_post_start();
-
device().save_item(NAME(m_romoeh));
}
@@ -64,7 +62,7 @@ void device_ql_rom_cartridge_card_interface::interface_post_start()
ql_rom_cartridge_slot_device::ql_rom_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, QL_ROM_CARTRIDGE_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_ql_rom_cartridge_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this), m_card(nullptr)
{
}
@@ -73,24 +71,13 @@ ql_rom_cartridge_slot_device::ql_rom_cartridge_slot_device(const machine_config
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-
-void ql_rom_cartridge_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_ql_rom_cartridge_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_ql_rom_cartridge_card_interface\n", card->tag(), card->name());
-}
-
void ql_rom_cartridge_slot_device::device_resolve_objects()
{
- m_card = dynamic_cast<device_ql_rom_cartridge_card_interface *>(get_card_device());
+ m_card = get_card_device();
}
void ql_rom_cartridge_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !m_card)
- throw emu_fatalerror("ql_rom_cartridge_slot_device: card device %s (%s) does not implement device_ql_rom_cartridge_card_interface\n", card->tag(), card->name());
}
diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h
index 0c8ec4a6bca..de2a680b2b0 100644
--- a/src/devices/bus/ql/rom.h
+++ b/src/devices/bus/ql/rom.h
@@ -41,7 +41,7 @@
class ql_rom_cartridge_slot_device;
-class device_ql_rom_cartridge_card_interface : public device_slot_card_interface
+class device_ql_rom_cartridge_card_interface : public device_interface
{
friend class ql_rom_cartridge_slot_device;
@@ -69,7 +69,7 @@ protected:
// ======================> ql_rom_cartridge_slot_device
class ql_rom_cartridge_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_ql_rom_cartridge_card_interface>,
public device_image_interface
{
public:
@@ -92,7 +92,6 @@ public:
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
diff --git a/src/devices/bus/rs232/rs232.cpp b/src/devices/bus/rs232/rs232.cpp
index 1c71fc9afca..bb1f69c35cd 100644
--- a/src/devices/bus/rs232/rs232.cpp
+++ b/src/devices/bus/rs232/rs232.cpp
@@ -51,7 +51,7 @@ rs232_port_device::rs232_port_device(const machine_config &mconfig, const char *
rs232_port_device::rs232_port_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_rs232_port_interface>(mconfig, *this),
m_rxd(0),
m_dcd(0),
m_dsr(0),
@@ -78,7 +78,7 @@ rs232_port_device::~rs232_port_device()
void rs232_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_rs232_port_interface *>(get_card_device());
+ m_dev = get_card_device();
}
void rs232_port_device::device_resolve_objects()
@@ -153,7 +153,7 @@ WRITE_LINE_MEMBER( rs232_port_device::write_spds )
}
device_rs232_port_interface::device_rs232_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "rs232")
{
m_port = dynamic_cast<rs232_port_device *>(device.owner());
}
diff --git a/src/devices/bus/rs232/rs232.h b/src/devices/bus/rs232/rs232.h
index 907afbf3091..2ba7d61c53e 100644
--- a/src/devices/bus/rs232/rs232.h
+++ b/src/devices/bus/rs232/rs232.h
@@ -95,7 +95,7 @@
class device_rs232_port_interface;
-class rs232_port_device : public device_t, public device_slot_interface
+class rs232_port_device : public device_t, public device_single_card_slot_interface<device_rs232_port_interface>
{
friend class device_rs232_port_interface;
@@ -167,7 +167,7 @@ private:
device_rs232_port_interface *m_dev;
};
-class device_rs232_port_interface : public device_slot_card_interface
+class device_rs232_port_interface : public device_interface
{
friend class rs232_port_device;
diff --git a/src/devices/bus/s100/s100.cpp b/src/devices/bus/s100/s100.cpp
index 23333ce500f..67a5df55124 100644
--- a/src/devices/bus/s100/s100.cpp
+++ b/src/devices/bus/s100/s100.cpp
@@ -28,19 +28,25 @@ DEFINE_DEVICE_TYPE(S100_SLOT, s100_slot_device, "s100_slot", "S100 slot")
//-------------------------------------------------
device_s100_card_interface::device_s100_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "s100bus"),
m_bus(nullptr),
m_next(nullptr)
{
}
+void device_s100_card_interface::interface_pre_start()
+{
+ if (!m_bus)
+ throw device_missing_dependencies();
+}
+
//-------------------------------------------------
// s100_slot_device - constructor
//-------------------------------------------------
s100_slot_device::s100_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, S100_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_s100_card_interface>(mconfig, *this),
m_bus(*this, DEVICE_SELF_OWNER)
{
}
@@ -52,8 +58,9 @@ s100_slot_device::s100_slot_device(const machine_config &mconfig, const char *ta
void s100_slot_device::device_start()
{
- device_s100_card_interface *dev = dynamic_cast<device_s100_card_interface *>(get_card_device());
- if (dev) m_bus->add_card(dev);
+ device_s100_card_interface *const dev = get_card_device();
+ if (dev)
+ m_bus->add_card(dev);
}
diff --git a/src/devices/bus/s100/s100.h b/src/devices/bus/s100/s100.h
index cbaefb802a4..ae10f4e70bc 100644
--- a/src/devices/bus/s100/s100.h
+++ b/src/devices/bus/s100/s100.h
@@ -75,7 +75,7 @@ class s100_bus_device;
// ======================> device_s100_card_interface
-class device_s100_card_interface : public device_slot_card_interface
+class device_s100_card_interface : public device_interface
{
friend class s100_bus_device;
template <class ElementType> friend class simple_list;
@@ -122,6 +122,8 @@ protected:
// construction/destruction
device_s100_card_interface(const machine_config &mconfig, device_t &device);
+ virtual void interface_pre_start() override;
+
s100_bus_device *m_bus;
private:
@@ -213,7 +215,7 @@ private:
// ======================> s100_slot_device
-class s100_slot_device : public device_t, public device_slot_interface
+class s100_slot_device : public device_t, public device_single_card_slot_interface<device_s100_card_interface>
{
public:
// construction/destruction
@@ -228,6 +230,8 @@ public:
}
s100_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:
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/bus/sat_ctrl/ctrl.cpp b/src/devices/bus/sat_ctrl/ctrl.cpp
index ebe435655ab..aeff9244cc8 100644
--- a/src/devices/bus/sat_ctrl/ctrl.cpp
+++ b/src/devices/bus/sat_ctrl/ctrl.cpp
@@ -36,8 +36,8 @@ DEFINE_DEVICE_TYPE(SATURN_CONTROL_PORT, saturn_control_port_device, "saturn_cont
// device_saturn_control_port_interface - constructor
//-------------------------------------------------
-device_saturn_control_port_interface::device_saturn_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_saturn_control_port_interface::device_saturn_control_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "saturnctrl")
{
m_port = dynamic_cast<saturn_control_port_device *>(device.owner());
}
@@ -62,7 +62,8 @@ device_saturn_control_port_interface::~device_saturn_control_port_interface()
saturn_control_port_device::saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SATURN_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this), m_device(nullptr)
+ device_single_card_slot_interface<device_saturn_control_port_interface>(mconfig, *this),
+ m_device(nullptr)
{
}
@@ -82,7 +83,7 @@ saturn_control_port_device::~saturn_control_port_device()
void saturn_control_port_device::device_start()
{
- m_device = dynamic_cast<device_saturn_control_port_interface *>(get_card_device());
+ m_device = get_card_device();
}
diff --git a/src/devices/bus/sat_ctrl/ctrl.h b/src/devices/bus/sat_ctrl/ctrl.h
index 6e18936f782..d17bed9b067 100644
--- a/src/devices/bus/sat_ctrl/ctrl.h
+++ b/src/devices/bus/sat_ctrl/ctrl.h
@@ -6,7 +6,6 @@
**********************************************************************/
-
#ifndef MAME_BUS_SAT_CTRL_CTRL_H
#define MAME_BUS_SAT_CTRL_CTRL_H
@@ -21,7 +20,7 @@ class saturn_control_port_device;
// ======================> device_saturn_control_port_interface
-class device_saturn_control_port_interface : public device_slot_card_interface
+class device_saturn_control_port_interface : public device_interface
{
public:
// construction/destruction
@@ -41,8 +40,7 @@ protected:
// ======================> saturn_control_port_device
-class saturn_control_port_device : public device_t,
- public device_slot_interface
+class saturn_control_port_device : public device_t, public device_single_card_slot_interface<device_saturn_control_port_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/saturn/sat_slot.cpp b/src/devices/bus/saturn/sat_slot.cpp
index defdd4d025b..a7357681958 100644
--- a/src/devices/bus/saturn/sat_slot.cpp
+++ b/src/devices/bus/saturn/sat_slot.cpp
@@ -37,7 +37,7 @@ DEFINE_DEVICE_TYPE(SATURN_CART_SLOT, sat_cart_slot_device, "sat_cart_slot", "Sat
//-------------------------------------------------
device_sat_cart_interface::device_sat_cart_interface(const machine_config &mconfig, device_t &device, int cart_type) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "saturncart"),
m_cart_type(cart_type),
m_rom(nullptr),
m_rom_size(0)
@@ -105,7 +105,8 @@ void device_sat_cart_interface::dram1_alloc(uint32_t size)
sat_cart_slot_device::sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SATURN_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+ device_single_card_slot_interface<device_sat_cart_interface>(mconfig, *this),
+ m_cart(nullptr)
{
}
@@ -124,7 +125,7 @@ sat_cart_slot_device::~sat_cart_slot_device()
void sat_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_sat_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h
index 63a9ae0dbca..51f8ef3a2aa 100644
--- a/src/devices/bus/saturn/sat_slot.h
+++ b/src/devices/bus/saturn/sat_slot.h
@@ -13,7 +13,7 @@
// ======================> device_sat_cart_interface
-class device_sat_cart_interface : public device_slot_card_interface
+class device_sat_cart_interface : public device_interface
{
public:
virtual ~device_sat_cart_interface();
@@ -63,7 +63,7 @@ protected:
class sat_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_sat_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/sbus/sbus.cpp b/src/devices/bus/sbus/sbus.cpp
index 8409d8a2598..67ef9571fe3 100644
--- a/src/devices/bus/sbus/sbus.cpp
+++ b/src/devices/bus/sbus/sbus.cpp
@@ -42,7 +42,7 @@ sbus_slot_device::sbus_slot_device(const machine_config &mconfig, const char *ta
sbus_slot_device::sbus_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_sbus_card_interface>(mconfig, *this)
, m_sbus(*this, finder_base::DUMMY_TAG)
, m_slot(-1)
{
@@ -52,24 +52,17 @@ void sbus_slot_device::device_validity_check(validity_checker &valid) const
{
if (m_slot < 0 || m_slot > 2)
osd_printf_error("Slot %d out of range for Sun SBus\n", m_slot);
-
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_sbus_card_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_sbus_card_interface\n", card->tag(), card->name());
}
void sbus_slot_device::device_resolve_objects()
{
- device_sbus_card_interface *const sbus_card(dynamic_cast<device_sbus_card_interface *>(get_card_device()));
+ device_sbus_card_interface *const sbus_card(get_card_device());
if (sbus_card)
sbus_card->set_sbus(m_sbus, m_slot);
}
void sbus_slot_device::device_start()
{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_sbus_card_interface *>(card))
- throw emu_fatalerror("sbus_slot_device: card device %s (%s) does not implement device_sbus_card_interface\n", card->tag(), card->name());
}
@@ -170,7 +163,7 @@ void sbus_device::set_irq_line(int state, int line)
device_sbus_card_interface::device_sbus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sbus")
, m_sbus_finder(device, finder_base::DUMMY_TAG)
, m_sbus(nullptr)
, m_slot(-1)
@@ -190,8 +183,6 @@ void device_sbus_card_interface::interface_validity_check(validity_checker &vali
void device_sbus_card_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (!m_sbus)
{
m_sbus = m_sbus_finder;
diff --git a/src/devices/bus/sbus/sbus.h b/src/devices/bus/sbus/sbus.h
index 29d2e2c26bb..fdd33ff1d6b 100644
--- a/src/devices/bus/sbus/sbus.h
+++ b/src/devices/bus/sbus/sbus.h
@@ -14,9 +14,11 @@
#include "cpu/sparc/sparc.h"
#include "machine/bankdev.h"
+class device_sbus_card_interface;
class sbus_device;
-class sbus_slot_device : public device_t, public device_slot_interface
+
+class sbus_slot_device : public device_t, public device_single_card_slot_interface<device_sbus_card_interface>
{
public:
// construction/destruction
@@ -52,8 +54,6 @@ protected:
DECLARE_DEVICE_TYPE(SBUS_SLOT, sbus_slot_device)
-class device_sbus_card_interface;
-
class sbus_device : public device_t,
public device_memory_interface
{
@@ -125,7 +125,7 @@ DECLARE_DEVICE_TYPE(SBUS, sbus_device)
// class representing interface-specific live sbus card
-class device_sbus_card_interface : public device_slot_card_interface
+class device_sbus_card_interface : public device_interface
{
friend class sbus_device;
public:
diff --git a/src/devices/bus/scsi/scsi.cpp b/src/devices/bus/scsi/scsi.cpp
index 5997266b84d..a4477483766 100644
--- a/src/devices/bus/scsi/scsi.cpp
+++ b/src/devices/bus/scsi/scsi.cpp
@@ -4,8 +4,8 @@
#include "emu.h"
#include "scsi.h"
-scsi_port_device::scsi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SCSI_PORT, tag, owner, clock),
+scsi_port_device::scsi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, SCSI_PORT, tag, owner, clock),
m_bsy_handler(*this),
m_sel_handler(*this),
m_cd_handler(*this),
@@ -673,7 +673,7 @@ DEFINE_DEVICE_TYPE(SCSI_PORT, scsi_port_device, "scsi", "SCSI Port")
scsi_port_slot_device::scsi_port_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SCSI_PORT_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<scsi_port_interface>(mconfig, *this),
m_dev(nullptr),
m_bsy(0),
m_sel(0),
@@ -706,8 +706,8 @@ void scsi_port_slot_device::device_start()
DEFINE_DEVICE_TYPE(SCSI_PORT_SLOT, scsi_port_slot_device, "scsi_slot", "SCSI Connector")
-scsi_port_interface::scsi_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+scsi_port_interface::scsi_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "scsi")
{
m_slot = dynamic_cast<scsi_port_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/scsi/scsi.h b/src/devices/bus/scsi/scsi.h
index 66ddae370d6..07e64d5f102 100644
--- a/src/devices/bus/scsi/scsi.h
+++ b/src/devices/bus/scsi/scsi.h
@@ -168,8 +168,7 @@ DECLARE_DEVICE_TYPE(SCSI_PORT, scsi_port_device)
class scsi_port_interface;
-class scsi_port_slot_device : public device_t,
- public device_slot_interface
+class scsi_port_slot_device : public device_t, public device_single_card_slot_interface<scsi_port_interface>
{
friend class scsi_port_device;
friend class scsi_port_interface;
@@ -210,7 +209,7 @@ protected:
DECLARE_DEVICE_TYPE(SCSI_PORT_SLOT, scsi_port_slot_device)
-class scsi_port_interface : public device_slot_card_interface
+class scsi_port_interface : public device_interface
{
public:
virtual ~scsi_port_interface();
diff --git a/src/devices/bus/scv/slot.cpp b/src/devices/bus/scv/slot.cpp
index c95f872089a..3144fe30089 100644
--- a/src/devices/bus/scv/slot.cpp
+++ b/src/devices/bus/scv/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(SCV_CART_SLOT, scv_cart_slot_device, "scv_cart_slot", "SCV Ca
// device_scv_cart_interface - constructor
//-------------------------------------------------
-device_scv_cart_interface::device_scv_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_scv_cart_interface::device_scv_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "scvcart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -75,7 +75,7 @@ void device_scv_cart_interface::ram_alloc(uint32_t size)
scv_cart_slot_device::scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SCV_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_scv_cart_interface>(mconfig, *this),
m_type(SCV_8K), m_cart(nullptr)
{
}
@@ -95,7 +95,7 @@ scv_cart_slot_device::~scv_cart_slot_device()
void scv_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_scv_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h
index 357c593c404..93c874c4d42 100644
--- a/src/devices/bus/scv/slot.h
+++ b/src/devices/bus/scv/slot.h
@@ -28,7 +28,7 @@ enum
// ======================> device_scv_cart_interface
-class device_scv_cart_interface : public device_slot_card_interface
+class device_scv_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -62,7 +62,7 @@ protected:
class scv_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_scv_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp
index 4af1059cb74..caf1e6bb9d0 100644
--- a/src/devices/bus/sega8/sega8_slot.cpp
+++ b/src/devices/bus/sega8/sega8_slot.cpp
@@ -60,7 +60,7 @@ DEFINE_DEVICE_TYPE(SG1000_CARD_SLOT, sg1000_card_slot_device, "sg1000_card
//-------------------------------------------------
device_sega8_cart_interface::device_sega8_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sega8cart")
, m_rom(nullptr)
, m_rom_size(0)
, m_rom_page_count(0)
@@ -120,7 +120,7 @@ void device_sega8_cart_interface::ram_alloc(uint32_t size)
sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_card)
: device_t(mconfig, type, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_sega8_cart_interface>(mconfig, *this)
, m_type(SEGA8_BASE_ROM)
, m_is_card(is_card)
, m_cart(nullptr)
@@ -198,7 +198,7 @@ sega8_cart_slot_device::~sega8_cart_slot_device()
void sega8_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_sega8_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h
index 9e1236076ae..12d7244e0f8 100644
--- a/src/devices/bus/sega8/sega8_slot.h
+++ b/src/devices/bus/sega8/sega8_slot.h
@@ -44,7 +44,7 @@ DECLARE_DEVICE_TYPE(SEGA8_CARD_SLOT, sega8_card_slot_device)
// ======================> device_sega8_cart_interface
-class device_sega8_cart_interface : public device_slot_card_interface
+class device_sega8_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -107,7 +107,7 @@ protected:
class sega8_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_sega8_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/sg1000_exp/sg1000exp.cpp b/src/devices/bus/sg1000_exp/sg1000exp.cpp
index 09e6e826515..f245586d88a 100644
--- a/src/devices/bus/sg1000_exp/sg1000exp.cpp
+++ b/src/devices/bus/sg1000_exp/sg1000exp.cpp
@@ -31,8 +31,8 @@ DEFINE_DEVICE_TYPE(SG1000_EXPANSION_SLOT, sg1000_expansion_slot_device, "sg1000_
// device_sg1000_expansion_slot_interface - constructor
//-------------------------------------------------
-device_sg1000_expansion_slot_interface::device_sg1000_expansion_slot_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_sg1000_expansion_slot_interface::device_sg1000_expansion_slot_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "sg1000exp")
{
}
@@ -57,7 +57,7 @@ device_sg1000_expansion_slot_interface::~device_sg1000_expansion_slot_interface(
sg1000_expansion_slot_device::sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SG1000_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_sg1000_expansion_slot_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -78,7 +78,7 @@ sg1000_expansion_slot_device::~sg1000_expansion_slot_device()
void sg1000_expansion_slot_device::device_start()
{
- m_device = dynamic_cast<device_sg1000_expansion_slot_interface *>(get_card_device());
+ m_device = get_card_device();
}
diff --git a/src/devices/bus/sg1000_exp/sg1000exp.h b/src/devices/bus/sg1000_exp/sg1000exp.h
index c132b48d9dd..aab9f766656 100644
--- a/src/devices/bus/sg1000_exp/sg1000exp.h
+++ b/src/devices/bus/sg1000_exp/sg1000exp.h
@@ -23,7 +23,7 @@
class device_sg1000_expansion_slot_interface;
-class sg1000_expansion_slot_device : public device_t, public device_slot_interface
+class sg1000_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_sg1000_expansion_slot_interface>
{
public:
// construction/destruction
@@ -57,7 +57,7 @@ private:
// ======================> device_sg1000_expansion_slot_interface
// class representing interface-specific live sg1000_expansion card
-class device_sg1000_expansion_slot_interface : public device_slot_card_interface
+class device_sg1000_expansion_slot_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/sg1000_exp/sk1100prn.cpp b/src/devices/bus/sg1000_exp/sk1100prn.cpp
index b902ce3992f..8f80306588b 100644
--- a/src/devices/bus/sg1000_exp/sk1100prn.cpp
+++ b/src/devices/bus/sg1000_exp/sk1100prn.cpp
@@ -30,8 +30,8 @@ DEFINE_DEVICE_TYPE(SK1100_PRINTER_PORT, sk1100_printer_port_device, "sk1100_prin
// device_sk1100_printer_port_interface - constructor
//-------------------------------------------------
-device_sk1100_printer_port_interface::device_sk1100_printer_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_sk1100_printer_port_interface::device_sk1100_printer_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "sk1000prn")
{
}
@@ -56,7 +56,7 @@ device_sk1100_printer_port_interface::~device_sk1100_printer_port_interface()
sk1100_printer_port_device::sk1100_printer_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
device_t(mconfig, SK1100_PRINTER_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_sk1100_printer_port_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -77,7 +77,7 @@ sk1100_printer_port_device::~sk1100_printer_port_device()
void sk1100_printer_port_device::device_start()
{
- m_device = dynamic_cast<device_sk1100_printer_port_interface *>(get_card_device());
+ m_device = get_card_device();
}
WRITE_LINE_MEMBER(sk1100_printer_port_device::data_w)
diff --git a/src/devices/bus/sg1000_exp/sk1100prn.h b/src/devices/bus/sg1000_exp/sk1100prn.h
index b926f311f29..8e1988102c8 100644
--- a/src/devices/bus/sg1000_exp/sk1100prn.h
+++ b/src/devices/bus/sg1000_exp/sk1100prn.h
@@ -23,7 +23,7 @@
class device_sk1100_printer_port_interface;
-class sk1100_printer_port_device : public device_t, public device_slot_interface
+class sk1100_printer_port_device : public device_t, public device_single_card_slot_interface<device_sk1100_printer_port_interface>
{
public:
// construction/destruction
@@ -59,7 +59,7 @@ private:
// ======================> device_sk1100_printer_port_interface
// class representing interface-specific live sk1100_printer_port peripheral
-class device_sk1100_printer_port_interface : public device_slot_card_interface
+class device_sk1100_printer_port_interface : public device_interface
{
friend class sk1100_printer_port_device;
public:
diff --git a/src/devices/bus/sgikbd/sgikbd.cpp b/src/devices/bus/sgikbd/sgikbd.cpp
index 4ad2d1f925a..478a65243b5 100644
--- a/src/devices/bus/sgikbd/sgikbd.cpp
+++ b/src/devices/bus/sgikbd/sgikbd.cpp
@@ -21,7 +21,7 @@ sgi_keyboard_port_device::sgi_keyboard_port_device(machine_config const &mconfig
sgi_keyboard_port_device::sgi_keyboard_port_device(machine_config const &mconfig, device_type type, char const *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_sgi_keyboard_port_interface>(mconfig, *this)
, m_rxd(0)
, m_rxd_handler(*this)
, m_dev(nullptr)
@@ -34,16 +34,7 @@ sgi_keyboard_port_device::~sgi_keyboard_port_device()
void sgi_keyboard_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_sgi_keyboard_port_interface *>(get_card_device());
-}
-
-void sgi_keyboard_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_sgi_keyboard_port_interface *>(card))
- {
- logerror("Card device %s (%s) does not implement device_sgi_keyboard_port_interface\n", card->tag(), card->name());
- }
+ m_dev = get_card_device();
}
void sgi_keyboard_port_device::device_resolve_objects()
@@ -53,11 +44,6 @@ void sgi_keyboard_port_device::device_resolve_objects()
void sgi_keyboard_port_device::device_start()
{
- if (get_card_device() && !m_dev)
- {
- throw emu_fatalerror("Card device %s (%s) does not implement device_sgi_keyboard_port_interface\n", get_card_device()->tag(), get_card_device()->name());
- }
-
save_item(NAME(m_rxd));
m_rxd = 1;
@@ -71,7 +57,7 @@ WRITE_LINE_MEMBER(sgi_keyboard_port_device::write_txd)
}
device_sgi_keyboard_port_interface::device_sgi_keyboard_port_interface(machine_config const &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sgikbd")
, m_port(dynamic_cast<sgi_keyboard_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/sgikbd/sgikbd.h b/src/devices/bus/sgikbd/sgikbd.h
index 1aa87bd43ad..bf64fd34b6a 100644
--- a/src/devices/bus/sgikbd/sgikbd.h
+++ b/src/devices/bus/sgikbd/sgikbd.h
@@ -9,7 +9,7 @@
class device_sgi_keyboard_port_interface;
-class sgi_keyboard_port_device : public device_t, public device_slot_interface
+class sgi_keyboard_port_device : public device_t, public device_single_card_slot_interface<device_sgi_keyboard_port_interface>
{
friend class device_sgi_keyboard_port_interface;
@@ -37,7 +37,6 @@ protected:
sgi_keyboard_port_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock);
virtual void device_config_complete() override;
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -50,7 +49,7 @@ private:
};
-class device_sgi_keyboard_port_interface : public device_slot_card_interface
+class device_sgi_keyboard_port_interface : public device_interface
{
friend class sgi_keyboard_port_device;
diff --git a/src/devices/bus/sms_ctrl/smsctrl.cpp b/src/devices/bus/sms_ctrl/smsctrl.cpp
index a2c117dcb74..cec153b863e 100644
--- a/src/devices/bus/sms_ctrl/smsctrl.cpp
+++ b/src/devices/bus/sms_ctrl/smsctrl.cpp
@@ -39,7 +39,7 @@ DEFINE_DEVICE_TYPE(SMS_CONTROL_PORT, sms_control_port_device, "sms_control_port"
//-------------------------------------------------
device_sms_control_port_interface::device_sms_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+ : device_interface(device, "smsctrl")
{
m_port = dynamic_cast<sms_control_port_device *>(device.owner());
}
diff --git a/src/devices/bus/sms_ctrl/smsctrl.h b/src/devices/bus/sms_ctrl/smsctrl.h
index c237543e5d6..cee1daa0cb9 100644
--- a/src/devices/bus/sms_ctrl/smsctrl.h
+++ b/src/devices/bus/sms_ctrl/smsctrl.h
@@ -83,7 +83,7 @@ private:
// ======================> device_sms_control_port_interface
// class representing interface-specific live sms_expansion card
-class device_sms_control_port_interface : public device_slot_card_interface
+class device_sms_control_port_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/sms_exp/smsexp.cpp b/src/devices/bus/sms_exp/smsexp.cpp
index f7c4b12c159..0d330f888b6 100644
--- a/src/devices/bus/sms_exp/smsexp.cpp
+++ b/src/devices/bus/sms_exp/smsexp.cpp
@@ -31,8 +31,8 @@ DEFINE_DEVICE_TYPE(SMS_EXPANSION_SLOT, sms_expansion_slot_device, "sms_expansion
// device_sms_expansion_slot_interface - constructor
//-------------------------------------------------
-device_sms_expansion_slot_interface::device_sms_expansion_slot_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_sms_expansion_slot_interface::device_sms_expansion_slot_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "smsexp")
{
}
@@ -57,7 +57,7 @@ device_sms_expansion_slot_interface::~device_sms_expansion_slot_interface()
sms_expansion_slot_device::sms_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SMS_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_sms_expansion_slot_interface>(mconfig, *this),
m_device(nullptr)
{
}
@@ -78,7 +78,7 @@ sms_expansion_slot_device::~sms_expansion_slot_device()
void sms_expansion_slot_device::device_start()
{
- m_device = dynamic_cast<device_sms_expansion_slot_interface *>(get_card_device());
+ m_device = get_card_device();
}
diff --git a/src/devices/bus/sms_exp/smsexp.h b/src/devices/bus/sms_exp/smsexp.h
index 6933b9a9df8..1169bf3f58a 100644
--- a/src/devices/bus/sms_exp/smsexp.h
+++ b/src/devices/bus/sms_exp/smsexp.h
@@ -22,7 +22,7 @@
// ======================> device_sms_expansion_slot_interface
// class representing interface-specific live sms_expansion card
-class device_sms_expansion_slot_interface : public device_slot_card_interface
+class device_sms_expansion_slot_interface : public device_interface
{
public:
// construction/destruction
@@ -44,8 +44,7 @@ protected:
// ======================> sms_expansion_slot_device
-class sms_expansion_slot_device : public device_t,
- public device_slot_interface
+class sms_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_sms_expansion_slot_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp
index 97ce2e80018..d97e08e16d0 100644
--- a/src/devices/bus/snes/snes_slot.cpp
+++ b/src/devices/bus/snes/snes_slot.cpp
@@ -69,7 +69,7 @@ DEFINE_DEVICE_TYPE(SNS_BSX_CART_SLOT, sns_bsx_cart_slot_device, "sns_bsx_c
//-------------------------------------------------
device_sns_cart_interface::device_sns_cart_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "snescart"),
m_rom(nullptr),
m_rom_size(0),
m_slot(nullptr)
diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h
index 4708c124e15..0df0fd14e10 100644
--- a/src/devices/bus/snes/snes_slot.h
+++ b/src/devices/bus/snes/snes_slot.h
@@ -104,7 +104,7 @@ class base_sns_cart_slot_device;
// ======================> device_sns_cart_interface
-class device_sns_cart_interface : public device_slot_card_interface
+class device_sns_cart_interface : public device_interface
{
friend class base_sns_cart_slot_device;
@@ -173,9 +173,6 @@ public:
auto irq_callback() { return m_irq_callback.bind(); }
auto open_bus_callback() { return m_open_bus_callback.bind(); }
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
@@ -231,6 +228,9 @@ public:
device_sns_cart_interface* m_cart;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
base_sns_cart_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
private:
diff --git a/src/devices/bus/snes_ctrl/ctrl.cpp b/src/devices/bus/snes_ctrl/ctrl.cpp
index c628a049b8c..68e69ee0a8b 100644
--- a/src/devices/bus/snes_ctrl/ctrl.cpp
+++ b/src/devices/bus/snes_ctrl/ctrl.cpp
@@ -35,8 +35,8 @@ DEFINE_DEVICE_TYPE(SNES_CONTROL_PORT, snes_control_port_device, "snes_control_po
// device_snes_control_port_interface - constructor
//-------------------------------------------------
-device_snes_control_port_interface::device_snes_control_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_snes_control_port_interface::device_snes_control_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "snesctrl")
{
m_port = dynamic_cast<snes_control_port_device *>(device.owner());
}
@@ -61,7 +61,7 @@ device_snes_control_port_interface::~device_snes_control_port_interface()
snes_control_port_device::snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SNES_CONTROL_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_snes_control_port_interface>(mconfig, *this),
m_onscreen_cb(*this),
m_gunlatch_cb(*this),
m_device(nullptr)
@@ -84,7 +84,7 @@ snes_control_port_device::~snes_control_port_device()
void snes_control_port_device::device_start()
{
- m_device = dynamic_cast<device_snes_control_port_interface *>(get_card_device());
+ m_device = get_card_device();
m_onscreen_cb.resolve();
m_gunlatch_cb.resolve();
}
diff --git a/src/devices/bus/snes_ctrl/ctrl.h b/src/devices/bus/snes_ctrl/ctrl.h
index cfcc8f03de9..b6e6ddc869e 100644
--- a/src/devices/bus/snes_ctrl/ctrl.h
+++ b/src/devices/bus/snes_ctrl/ctrl.h
@@ -20,11 +20,9 @@ class snes_control_port_device;
// ======================> device_snes_control_port_interface
-class device_snes_control_port_interface : public device_slot_card_interface
+class device_snes_control_port_interface : public device_interface
{
public:
- // construction/destruction
- device_snes_control_port_interface(const machine_config &mconfig, device_t &device);
virtual ~device_snes_control_port_interface();
virtual uint8_t read_pin4() { return 0; }
@@ -34,6 +32,8 @@ public:
virtual void port_poll() { }
protected:
+ device_snes_control_port_interface(const machine_config &mconfig, device_t &device);
+
snes_control_port_device *m_port;
};
@@ -43,7 +43,7 @@ protected:
// ======================> snes_control_port_device
-class snes_control_port_device : public device_t, public device_slot_interface
+class snes_control_port_device : public device_t, public device_single_card_slot_interface<device_snes_control_port_interface>
{
public:
typedef device_delegate<bool (int16_t x, int16_t y)> onscreen_delegate;
diff --git a/src/devices/bus/spc1000/exp.cpp b/src/devices/bus/spc1000/exp.cpp
index 5a987845a43..c786894c154 100644
--- a/src/devices/bus/spc1000/exp.cpp
+++ b/src/devices/bus/spc1000/exp.cpp
@@ -17,8 +17,8 @@
DEFINE_DEVICE_TYPE(SPC1000_EXP_SLOT, spc1000_exp_device, "spc1000_exp", "Samsung SPC-1000 expansion")
-device_spc1000_card_interface::device_spc1000_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_spc1000_card_interface::device_spc1000_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "spc1000exp")
{
}
@@ -37,7 +37,7 @@ device_spc1000_card_interface::~device_spc1000_card_interface()
//-------------------------------------------------
spc1000_exp_device::spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SPC1000_EXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_spc1000_card_interface>(mconfig, *this),
m_card(nullptr)
{
}
@@ -57,7 +57,7 @@ spc1000_exp_device::~spc1000_exp_device()
void spc1000_exp_device::device_start()
{
- m_card = dynamic_cast<device_spc1000_card_interface *>(get_card_device());
+ m_card = get_card_device();
}
/*-------------------------------------------------
diff --git a/src/devices/bus/spc1000/exp.h b/src/devices/bus/spc1000/exp.h
index d10fe516401..ca6960809a1 100644
--- a/src/devices/bus/spc1000/exp.h
+++ b/src/devices/bus/spc1000/exp.h
@@ -7,7 +7,7 @@
// ======================> device_spc1000_card_interface
-class device_spc1000_card_interface : public device_slot_card_interface
+class device_spc1000_card_interface : public device_interface
{
public:
// construction/destruction
@@ -24,7 +24,7 @@ protected:
// ======================> spc1000_exp_device
-class spc1000_exp_device : public device_t, public device_slot_interface
+class spc1000_exp_device : public device_t, public device_single_card_slot_interface<device_spc1000_card_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/spectrum/exp.cpp b/src/devices/bus/spectrum/exp.cpp
index 6092f87d9ce..e8890d824b9 100644
--- a/src/devices/bus/spectrum/exp.cpp
+++ b/src/devices/bus/spectrum/exp.cpp
@@ -25,8 +25,8 @@ DEFINE_DEVICE_TYPE(SPECTRUM_EXPANSION_SLOT, spectrum_expansion_slot_device, "spe
// device_spectrum_expansion_interface - constructor
//-------------------------------------------------
-device_spectrum_expansion_interface::device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_spectrum_expansion_interface::device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "spectrumexp")
{
m_slot = dynamic_cast<spectrum_expansion_slot_device *>(device.owner());
}
@@ -42,7 +42,7 @@ device_spectrum_expansion_interface::device_spectrum_expansion_interface(const m
spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SPECTRUM_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_spectrum_expansion_interface>(mconfig, *this),
m_card(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this)
@@ -51,26 +51,12 @@ spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_con
//-------------------------------------------------
-// device_validity_check - device-specific checks
-//-------------------------------------------------
-
-void spectrum_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_spectrum_expansion_interface *>(card))
- osd_printf_error("Card device %s (%s) does not implement device_spectrum_expansion_interface\n", card->tag(), card->name());
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void spectrum_expansion_slot_device::device_start()
{
- device_t *const card_device(get_card_device());
- m_card = dynamic_cast<device_spectrum_expansion_interface *>(card_device);
- if (card_device && !m_card)
- throw emu_fatalerror("spectrum_expansion_slot_device: card device %s (%s) does not implement device_spectrum_expansion_interface\n", card_device->tag(), card_device->name());
+ m_card = get_card_device();
// resolve callbacks
m_irq_handler.resolve_safe();
@@ -78,14 +64,6 @@ void spectrum_expansion_slot_device::device_start()
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void spectrum_expansion_slot_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// romcs
//-------------------------------------------------
diff --git a/src/devices/bus/spectrum/exp.h b/src/devices/bus/spectrum/exp.h
index 5de81d4ae43..c17b88f0a9b 100644
--- a/src/devices/bus/spectrum/exp.h
+++ b/src/devices/bus/spectrum/exp.h
@@ -53,7 +53,7 @@
class device_spectrum_expansion_interface;
-class spectrum_expansion_slot_device : public device_t, public device_slot_interface
+class spectrum_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_spectrum_expansion_interface>
{
public:
// construction/destruction
@@ -89,9 +89,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_spectrum_expansion_interface *m_card;
@@ -103,12 +101,9 @@ private:
// ======================> device_spectrum_expansion_interface
-class device_spectrum_expansion_interface : public device_slot_card_interface
+class device_spectrum_expansion_interface : public device_interface
{
public:
- // construction/destruction
- device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device);
-
// reading and writing
virtual void pre_opcode_fetch(offs_t offset) { };
virtual void post_opcode_fetch(offs_t offset) { };
@@ -121,6 +116,9 @@ public:
virtual DECLARE_READ_LINE_MEMBER(romcs) { return 0; }
protected:
+ // construction/destruction
+ device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device);
+
spectrum_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/ss50/interface.cpp b/src/devices/bus/ss50/interface.cpp
index ea0da186afd..a3100585a76 100644
--- a/src/devices/bus/ss50/interface.cpp
+++ b/src/devices/bus/ss50/interface.cpp
@@ -103,12 +103,12 @@ DEFINE_DEVICE_TYPE(SS50_INTERFACE, ss50_interface_port_device, "ss50_interface",
// ss50_interface_port_device - construction
//-------------------------------------------------
-ss50_interface_port_device::ss50_interface_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : device_t(mconfig, SS50_INTERFACE, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_irq_cb(*this),
- m_firq_cb(*this),
- m_card(nullptr)
+ss50_interface_port_device::ss50_interface_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
+ device_t(mconfig, SS50_INTERFACE, tag, owner, clock),
+ device_single_card_slot_interface<ss50_card_interface>(mconfig, *this),
+ m_irq_cb(*this),
+ m_firq_cb(*this),
+ m_card(nullptr)
{
}
@@ -120,12 +120,10 @@ ss50_interface_port_device::ss50_interface_port_device(const machine_config &mco
void ss50_interface_port_device::device_resolve_objects()
{
- logerror("Resolving objects...\n");
-
m_irq_cb.resolve_safe();
m_firq_cb.resolve_safe();
- m_card = dynamic_cast<ss50_card_interface *>(get_card_device());
+ m_card = get_card_device();
if (m_card != nullptr)
m_card->m_slot = this;
}
@@ -214,10 +212,16 @@ template class device_finder<ss50_card_interface, true>;
// ss50_card_interface - construction
//-------------------------------------------------
-ss50_card_interface::ss50_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_slot(nullptr)
+ss50_card_interface::ss50_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "ss50card"),
+ m_slot(nullptr)
+{
+}
+
+void ss50_card_interface::interface_pre_start()
{
+ if (!m_slot)
+ throw device_missing_dependencies();
}
void ss50_default_2rs_devices(device_slot_interface &device)
diff --git a/src/devices/bus/ss50/interface.h b/src/devices/bus/ss50/interface.h
index 0be5f422c98..28e8f82c8c9 100644
--- a/src/devices/bus/ss50/interface.h
+++ b/src/devices/bus/ss50/interface.h
@@ -6,10 +6,10 @@
**********************************************************************/
-#pragma once
+#ifndef MAME_BUS_SS50_INTERFACE_H
+#define MAME_BUS_SS50_INTERFACE_H
-#ifndef MAME_DEVICES_BUS_SS50_INTERFACE_H
-#define MAME_DEVICES_BUS_SS50_INTERFACE_H
+#pragma once
//**************************************************************************
@@ -21,7 +21,7 @@ class ss50_card_interface;
// ======================> ss50_interface_port_device
-class ss50_interface_port_device : public device_t, public device_slot_interface
+class ss50_interface_port_device : public device_t, public device_single_card_slot_interface<ss50_card_interface>
{
friend class ss50_card_interface;
@@ -70,7 +70,7 @@ private:
// ======================> ss50_card_interface
-class ss50_card_interface : public device_slot_card_interface
+class ss50_card_interface : public device_interface
{
friend class ss50_interface_port_device;
@@ -94,6 +94,8 @@ protected:
DECLARE_WRITE_LINE_MEMBER(write_firq) { m_slot->m_firq_cb(state); }
private:
+ virtual void interface_pre_start() override;
+
ss50_interface_port_device *m_slot;
};
@@ -104,4 +106,4 @@ DECLARE_DEVICE_TYPE(SS50_INTERFACE, ss50_interface_port_device)
void ss50_default_2rs_devices(device_slot_interface &device);
//void ss50_default_4rs_devices(device_slot_interface &device);
-#endif
+#endif // MAME_BUS_SS50_INTERFACE_H
diff --git a/src/devices/bus/sunkbd/sunkbd.cpp b/src/devices/bus/sunkbd/sunkbd.cpp
index 82152b5f905..1d0b62df3fd 100644
--- a/src/devices/bus/sunkbd/sunkbd.cpp
+++ b/src/devices/bus/sunkbd/sunkbd.cpp
@@ -120,7 +120,7 @@ sun_keyboard_port_device::sun_keyboard_port_device(
device_t *owner,
uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_sun_keyboard_port_interface>(mconfig, *this)
, m_rxd(0)
, m_rxd_handler(*this)
, m_dev(nullptr)
@@ -135,20 +135,7 @@ sun_keyboard_port_device::~sun_keyboard_port_device()
void sun_keyboard_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_sun_keyboard_port_interface *>(get_card_device());
-}
-
-
-void sun_keyboard_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_sun_keyboard_port_interface *>(card))
- {
- osd_printf_error(
- "Card device %s (%s) does not implement device_sun_keyboard_port_interface\n",
- card->tag(),
- card->name());
- }
+ m_dev = get_card_device();
}
@@ -160,14 +147,6 @@ void sun_keyboard_port_device::device_resolve_objects()
void sun_keyboard_port_device::device_start()
{
- if (get_card_device() && !m_dev)
- {
- throw emu_fatalerror(
- "Card device %s (%s) does not implement device_sun_keyboard_port_interface\n",
- get_card_device()->tag(),
- get_card_device()->name());
- }
-
save_item(NAME(m_rxd));
m_rxd = 1;
@@ -185,7 +164,7 @@ WRITE_LINE_MEMBER( sun_keyboard_port_device::write_txd )
device_sun_keyboard_port_interface::device_sun_keyboard_port_interface(machine_config const &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sunkbd")
, m_port(dynamic_cast<sun_keyboard_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h
index 532193cbf0d..8a210025912 100644
--- a/src/devices/bus/sunkbd/sunkbd.h
+++ b/src/devices/bus/sunkbd/sunkbd.h
@@ -11,7 +11,7 @@
class device_sun_keyboard_port_interface;
-class sun_keyboard_port_device : public device_t, public device_slot_interface
+class sun_keyboard_port_device : public device_t, public device_single_card_slot_interface<device_sun_keyboard_port_interface>
{
friend class device_sun_keyboard_port_interface;
@@ -39,7 +39,6 @@ protected:
sun_keyboard_port_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock);
virtual void device_config_complete() override;
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -52,7 +51,7 @@ private:
};
-class device_sun_keyboard_port_interface : public device_slot_card_interface
+class device_sun_keyboard_port_interface : public device_interface
{
friend class sun_keyboard_port_device;
diff --git a/src/devices/bus/sunmouse/sunmouse.cpp b/src/devices/bus/sunmouse/sunmouse.cpp
index 9b59529c54a..035a01cc7d7 100644
--- a/src/devices/bus/sunmouse/sunmouse.cpp
+++ b/src/devices/bus/sunmouse/sunmouse.cpp
@@ -97,7 +97,7 @@ sun_mouse_port_device::sun_mouse_port_device(
device_t *owner,
uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_sun_mouse_port_interface>(mconfig, *this)
, m_rxd(0)
, m_rxd_handler(*this)
, m_dev(nullptr)
@@ -112,20 +112,7 @@ sun_mouse_port_device::~sun_mouse_port_device()
void sun_mouse_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_sun_mouse_port_interface *>(get_card_device());
-}
-
-
-void sun_mouse_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_sun_mouse_port_interface *>(card))
- {
- osd_printf_error(
- "Card device %s (%s) does not implement device_sun_mouse_port_interface\n",
- card->tag(),
- card->name());
- }
+ m_dev = get_card_device();
}
@@ -139,14 +126,6 @@ void sun_mouse_port_device::device_resolve_objects()
void sun_mouse_port_device::device_start()
{
- if (get_card_device() && !m_dev)
- {
- throw emu_fatalerror(
- "Card device %s (%s) does not implement device_sun_mouse_port_interface\n",
- get_card_device()->tag(),
- get_card_device()->name());
- }
-
save_item(NAME(m_rxd));
if (!m_dev)
@@ -163,7 +142,7 @@ WRITE_LINE_MEMBER( sun_mouse_port_device::write_txd )
device_sun_mouse_port_interface::device_sun_mouse_port_interface(machine_config const &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "sunmouse")
, m_port(dynamic_cast<sun_mouse_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/sunmouse/sunmouse.h b/src/devices/bus/sunmouse/sunmouse.h
index ff7dd9ca86a..e665529bdfe 100644
--- a/src/devices/bus/sunmouse/sunmouse.h
+++ b/src/devices/bus/sunmouse/sunmouse.h
@@ -11,7 +11,7 @@
class device_sun_mouse_port_interface;
-class sun_mouse_port_device : public device_t, public device_slot_interface
+class sun_mouse_port_device : public device_t, public device_single_card_slot_interface<device_sun_mouse_port_interface>
{
friend class device_sun_mouse_port_interface;
@@ -39,7 +39,6 @@ protected:
sun_mouse_port_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock);
virtual void device_config_complete() override;
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_resolve_objects() override;
virtual void device_start() override;
@@ -52,7 +51,7 @@ private:
};
-class device_sun_mouse_port_interface : public device_slot_card_interface
+class device_sun_mouse_port_interface : public device_interface
{
friend class sun_mouse_port_device;
diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp
index e9653827fcf..ea1fab43f93 100644
--- a/src/devices/bus/svi3x8/expander/expander.cpp
+++ b/src/devices/bus/svi3x8/expander/expander.cpp
@@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(SVI_EXPANDER, svi_expander_device, "svi_expander", "SVI 318/3
svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SVI_EXPANDER, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_svi_expander_interface>(mconfig, *this),
m_module(nullptr),
m_int_handler(*this),
m_romdis_handler(*this),
@@ -56,7 +56,7 @@ svi_expander_device::~svi_expander_device()
void svi_expander_device::device_start()
{
// get inserted module
- m_module = dynamic_cast<device_svi_expander_interface *>(get_card_device());
+ m_module = get_card_device();
// resolve callbacks
m_int_handler.resolve_safe();
@@ -69,14 +69,6 @@ void svi_expander_device::device_start()
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void svi_expander_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// host to module interface
//-------------------------------------------------
@@ -148,7 +140,7 @@ WRITE_LINE_MEMBER( svi_expander_device::bk32_w )
//-------------------------------------------------
device_svi_expander_interface::device_svi_expander_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "svi3x8exp")
{
m_expander = dynamic_cast<svi_expander_device *>(device.owner());
}
diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h
index cc7e75f6332..f7bba16eba3 100644
--- a/src/devices/bus/svi3x8/expander/expander.h
+++ b/src/devices/bus/svi3x8/expander/expander.h
@@ -48,7 +48,7 @@ class device_svi_expander_interface;
// ======================> svi_expander_device
-class svi_expander_device : public device_t, public device_slot_interface
+class svi_expander_device : public device_t, public device_single_card_slot_interface<device_svi_expander_interface>
{
public:
// construction/destruction
@@ -98,7 +98,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
private:
device_svi_expander_interface *m_module;
@@ -115,7 +114,7 @@ private:
// ======================> device_svi_expander_interface
-class device_svi_expander_interface : public device_slot_card_interface
+class device_svi_expander_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/svi3x8/expander/sv601.cpp b/src/devices/bus/svi3x8/expander/sv601.cpp
index aec81c79ae6..662f3cb0c2e 100644
--- a/src/devices/bus/svi3x8/expander/sv601.cpp
+++ b/src/devices/bus/svi3x8/expander/sv601.cpp
@@ -26,13 +26,13 @@ void sv601_device::device_add_mconfig(machine_config &config)
m_slotbus->int_handler().set(FUNC(sv601_device::int_w));
m_slotbus->romdis_handler().set(FUNC(sv601_device::romdis_w));
m_slotbus->ramdis_handler().set(FUNC(sv601_device::ramdis_w));
- SVI_SLOT(config, "0", svi_slot_cards, nullptr);
- SVI_SLOT(config, "1", svi_slot_cards, nullptr);
- SVI_SLOT(config, "2", svi_slot_cards, nullptr);
- SVI_SLOT(config, "3", svi_slot_cards, nullptr);
- SVI_SLOT(config, "4", svi_slot_cards, nullptr);
- SVI_SLOT(config, "5", svi_slot_cards, nullptr);
- SVI_SLOT(config, "6", svi_slot_cards, nullptr);
+ SVI_SLOT(config, "0", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "1", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "2", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "3", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "4", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "5", m_slotbus, svi_slot_cards, nullptr);
+ SVI_SLOT(config, "6", m_slotbus, svi_slot_cards, nullptr);
}
diff --git a/src/devices/bus/svi3x8/expander/sv602.cpp b/src/devices/bus/svi3x8/expander/sv602.cpp
index 25624a83e9a..1f5d0c0d352 100644
--- a/src/devices/bus/svi3x8/expander/sv602.cpp
+++ b/src/devices/bus/svi3x8/expander/sv602.cpp
@@ -26,7 +26,7 @@ void sv602_device::device_add_mconfig(machine_config &config)
m_slotbus->int_handler().set(FUNC(sv602_device::int_w));
m_slotbus->romdis_handler().set(FUNC(sv602_device::romdis_w));
m_slotbus->ramdis_handler().set(FUNC(sv602_device::ramdis_w));
- SVI_SLOT(config, "0", sv602_slot_cards, nullptr);
+ SVI_SLOT(config, "0", m_slotbus, sv602_slot_cards, nullptr);
}
diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp
index eb2137ce629..7397414a0d6 100644
--- a/src/devices/bus/svi3x8/slot/slot.cpp
+++ b/src/devices/bus/svi3x8/slot/slot.cpp
@@ -50,21 +50,13 @@ void svi_slot_bus_device::device_start()
}
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void svi_slot_bus_device::device_reset()
-{
-}
-
-//-------------------------------------------------
// add_card - add new card to our bus
//-------------------------------------------------
-void svi_slot_bus_device::add_card(device_svi_slot_interface *card)
+void svi_slot_bus_device::add_card(device_svi_slot_interface &card)
{
- card->set_bus_device(this);
- m_dev.append(*card);
+ card.set_bus_device(*this);
+ m_dev.append(card);
}
//-------------------------------------------------
@@ -206,7 +198,8 @@ DEFINE_DEVICE_TYPE(SVI_SLOT, svi_slot_device, "svislot", "SVI Slot")
svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, SVI_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_svi_slot_interface>(mconfig, *this)
+ , m_bus(*this, finder_base::DUMMY_TAG)
{
}
@@ -216,21 +209,9 @@ svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag,
void svi_slot_device::device_start()
{
- device_svi_slot_interface *dev = dynamic_cast<device_svi_slot_interface *>(get_card_device());
-
+ device_svi_slot_interface *dev = get_card_device();
if (dev)
- {
- svi_slot_bus_device *bus = downcast<svi_slot_bus_device *>(owner()->subdevice(SVIBUS_TAG));
- bus->add_card(dev);
- }
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void svi_slot_device::device_reset()
-{
+ m_bus->add_card(*dev);
}
@@ -243,7 +224,7 @@ void svi_slot_device::device_reset()
//-------------------------------------------------
device_svi_slot_interface::device_svi_slot_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "svi3x8slot"),
m_bus(nullptr),
m_next(nullptr)
{
@@ -261,7 +242,7 @@ device_svi_slot_interface::~device_svi_slot_interface()
// set_bus_device - set bus we are attached to
//-------------------------------------------------
-void device_svi_slot_interface::set_bus_device(svi_slot_bus_device *bus)
+void device_svi_slot_interface::set_bus_device(svi_slot_bus_device &bus)
{
- m_bus = bus;
+ m_bus = &bus;
}
diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h
index 756f17658fd..bba55731a88 100644
--- a/src/devices/bus/svi3x8/slot/slot.h
+++ b/src/devices/bus/svi3x8/slot/slot.h
@@ -40,12 +40,6 @@
#pragma once
-//**************************************************************************
-// CONSTANTS / MACROS
-//**************************************************************************
-
-#define SVIBUS_TAG "slot_bux"
-
//**************************************************************************
// TYPE DEFINITIONS
@@ -67,7 +61,7 @@ public:
auto romdis_handler() { return m_romdis_handler.bind(); }
auto ramdis_handler() { return m_ramdis_handler.bind(); }
- void add_card(device_svi_slot_interface *card);
+ void add_card(device_svi_slot_interface &card);
// from slot
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); };
@@ -88,7 +82,6 @@ public:
private:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
simple_list<device_svi_slot_interface> m_dev;
@@ -102,29 +95,31 @@ DECLARE_DEVICE_TYPE(SVI_SLOT_BUS, svi_slot_bus_device)
// ======================> svi_slot_device
-class svi_slot_device : public device_t, public device_slot_interface
+class svi_slot_device : public device_t, public device_single_card_slot_interface<device_svi_slot_interface>
{
public:
// construction/destruction
- template <typename T>
- svi_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ template <typename T, typename U>
+ svi_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bus, U &&opts, char const *dflt)
: svi_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
+ set_bus(std::forward<T>(bus));
}
svi_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:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// configuration
- const char *m_bus_tag;
+ required_device<svi_slot_bus_device> m_bus;
};
// device type definition
@@ -132,14 +127,14 @@ DECLARE_DEVICE_TYPE(SVI_SLOT, svi_slot_device)
// ======================> svi_slot_device
-class device_svi_slot_interface : public device_slot_card_interface
+class device_svi_slot_interface : public device_interface
{
template <class ElementType> friend class simple_list;
public:
// construction/destruction
virtual ~device_svi_slot_interface();
- void set_bus_device(svi_slot_bus_device *bus);
+ void set_bus_device(svi_slot_bus_device &bus);
device_svi_slot_interface *next() const { return m_next; }
diff --git a/src/devices/bus/tanbus/tanbus.cpp b/src/devices/bus/tanbus/tanbus.cpp
index c7d36a1a578..b84d625c80f 100644
--- a/src/devices/bus/tanbus/tanbus.cpp
+++ b/src/devices/bus/tanbus/tanbus.cpp
@@ -28,29 +28,18 @@ DEFINE_DEVICE_TYPE(TANBUS_SLOT, tanbus_slot_device, "tanbus_slot", "Microtan Bus
//-------------------------------------------------
tanbus_slot_device::tanbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TANBUS_SLOT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_tanbus_interface>(mconfig, *this)
, m_tanbus(*this, DEVICE_SELF_OWNER)
{
}
//-------------------------------------------------
-// device_validity_check - device-specific checks
-//-------------------------------------------------
-
-void tanbus_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_tanbus_interface *>(card))
- osd_printf_error("tanbus_slot_device: card device %s (%s) does not implement device_tanbus_interface\n", card->tag(), card->name());
-}
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void tanbus_slot_device::device_start()
{
- device_tanbus_interface *dev = dynamic_cast<device_tanbus_interface *>(get_card_device());
+ device_tanbus_interface *const dev = get_card_device();
if (dev) m_tanbus->add_card(dev, m_bus_num);
}
@@ -200,7 +189,7 @@ void tanbus_device::write(offs_t offset, uint8_t data)
//-------------------------------------------------
device_tanbus_interface::device_tanbus_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "tanbus")
, m_tanbus(nullptr)
, m_page(0)
, m_next(nullptr)
diff --git a/src/devices/bus/tanbus/tanbus.h b/src/devices/bus/tanbus/tanbus.h
index 315f2d1b1d8..f5823a6df34 100644
--- a/src/devices/bus/tanbus/tanbus.h
+++ b/src/devices/bus/tanbus/tanbus.h
@@ -25,7 +25,7 @@ class device_tanbus_interface;
// TYPE DEFINITIONS
//**************************************************************************
-class tanbus_slot_device : public device_t, public device_slot_interface
+class tanbus_slot_device : public device_t, public device_single_card_slot_interface<device_tanbus_interface>
{
public:
// construction/destruction
@@ -37,16 +37,15 @@ public:
opts(*this);
set_default_option(dflt);
set_fixed(false);
- set_tanbus_slot(tag, num);
+ set_tanbus_slot(num);
}
tanbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- void set_tanbus_slot(const char *tag, int num) { m_bus_num = num; }
+ void set_tanbus_slot(int num) { m_bus_num = num; }
protected:
// device-level overrides
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
private:
@@ -116,7 +115,7 @@ DECLARE_DEVICE_TYPE(TANBUS, tanbus_device)
// ======================> device_tanbus_interface
-class device_tanbus_interface : public device_slot_card_interface
+class device_tanbus_interface : public device_interface
{
friend class tanbus_device;
template <class ElementType> friend class simple_list;
@@ -127,7 +126,7 @@ public:
// bus access
virtual uint8_t read(offs_t offset, int inhrom, int inhram, int be) { return 0xff; }
virtual void write(offs_t offset, uint8_t data, int inhrom, int inhram, int be) { }
- virtual void set_inhibit_lines(offs_t offset, int &inhram, int &inhrom) { };
+ virtual void set_inhibit_lines(offs_t offset, int &inhram, int &inhrom) { }
protected:
device_tanbus_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/ti8x/ti8x.cpp b/src/devices/bus/ti8x/ti8x.cpp
index 1490c76755b..842b9e98678 100644
--- a/src/devices/bus/ti8x/ti8x.cpp
+++ b/src/devices/bus/ti8x/ti8x.cpp
@@ -37,7 +37,7 @@ ti8x_link_port_device::ti8x_link_port_device(
device_t *owner,
uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_ti8x_link_port_interface>(mconfig, *this)
, m_tip_handler(*this)
, m_ring_handler(*this)
, m_dev(nullptr)
@@ -88,7 +88,7 @@ void ti8x_link_port_device::device_start()
void ti8x_link_port_device::device_config_complete()
{
- m_dev = dynamic_cast<device_ti8x_link_port_interface *>(get_card_device());
+ m_dev = get_card_device();
}
@@ -96,7 +96,7 @@ void ti8x_link_port_device::device_config_complete()
device_ti8x_link_port_interface::device_ti8x_link_port_interface(
machine_config const &mconfig,
device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "ti8xlink")
, m_port(dynamic_cast<ti8x_link_port_device *>(device.owner()))
{
}
diff --git a/src/devices/bus/ti8x/ti8x.h b/src/devices/bus/ti8x/ti8x.h
index e81a4fc5a9e..759b3523eb1 100644
--- a/src/devices/bus/ti8x/ti8x.h
+++ b/src/devices/bus/ti8x/ti8x.h
@@ -45,7 +45,7 @@ DECLARE_DEVICE_TYPE(TI8X_LINK_PORT, ti8x_link_port_device)
class device_ti8x_link_port_interface;
-class ti8x_link_port_device : public device_t, public device_slot_interface
+class ti8x_link_port_device : public device_t, public device_single_card_slot_interface<device_ti8x_link_port_interface>
{
public:
template <typename T>
@@ -92,7 +92,7 @@ private:
};
-class device_ti8x_link_port_interface : public device_slot_card_interface
+class device_ti8x_link_port_interface : public device_interface
{
public:
DECLARE_WRITE_LINE_MEMBER(output_tip)
diff --git a/src/devices/bus/ti99/colorbus/colorbus.cpp b/src/devices/bus/ti99/colorbus/colorbus.cpp
index 0fe5411c9a7..a54b41c9f70 100644
--- a/src/devices/bus/ti99/colorbus/colorbus.cpp
+++ b/src/devices/bus/ti99/colorbus/colorbus.cpp
@@ -28,7 +28,7 @@ namespace bus { namespace ti99 { namespace colorbus {
v9938_colorbus_device::v9938_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, V9938_COLORBUS, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_v9938_colorbus_interface>(mconfig, *this),
m_v9938(*owner, TI_VDP_TAG),
m_extra_button(*this)
{
@@ -57,6 +57,12 @@ void v9938_colorbus_device::device_start()
/*****************************************************************************/
+device_v9938_colorbus_interface::device_v9938_colorbus_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "v9938colorbus"),
+ m_colorbus(nullptr)
+{
+}
+
void device_v9938_colorbus_interface::interface_config_complete()
{
m_colorbus = dynamic_cast<v9938_colorbus_device*>(device().owner());
diff --git a/src/devices/bus/ti99/colorbus/colorbus.h b/src/devices/bus/ti99/colorbus/colorbus.h
index d0139e4b736..844d214d2b3 100644
--- a/src/devices/bus/ti99/colorbus/colorbus.h
+++ b/src/devices/bus/ti99/colorbus/colorbus.h
@@ -25,19 +25,20 @@ class v9938_colorbus_device;
/********************************************************************
Common parent class of all devices attached to the color bus
********************************************************************/
-class device_v9938_colorbus_interface : public device_slot_card_interface
+class device_v9938_colorbus_interface : public device_interface
{
protected:
- using device_slot_card_interface::device_slot_card_interface;
+ device_v9938_colorbus_interface(const machine_config &mconfig, device_t &device);
virtual void interface_config_complete() override;
- v9938_colorbus_device* m_colorbus = nullptr;
+
+ v9938_colorbus_device* m_colorbus;
};
/********************************************************************
Color bus port
********************************************************************/
-class v9938_colorbus_device : public device_t, public device_slot_interface
+class v9938_colorbus_device : public device_t, public device_single_card_slot_interface<device_v9938_colorbus_interface>
{
public:
template <typename U>
diff --git a/src/devices/bus/ti99/joyport/joyport.cpp b/src/devices/bus/ti99/joyport/joyport.cpp
index 1a39c0d6dfa..38e3eccbf3a 100644
--- a/src/devices/bus/ti99/joyport/joyport.cpp
+++ b/src/devices/bus/ti99/joyport/joyport.cpp
@@ -44,10 +44,17 @@ DEFINE_DEVICE_TYPE_NS(TI99_JOYPORT, bus::ti99::joyport, joyport_device, "ti99_jo
namespace bus { namespace ti99 { namespace joyport {
+device_ti99_joyport_interface::device_ti99_joyport_interface(const machine_config &config, device_t &device)
+ : device_interface(device, "ti99joyport"),
+ m_joyport(nullptr)
+{
+}
+
joyport_device::joyport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TI99_JOYPORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_interrupt(*this), m_connected(nullptr)
+ device_single_card_slot_interface<device_ti99_joyport_interface>(mconfig, *this),
+ m_interrupt(*this),
+ m_connected(nullptr)
{
}
diff --git a/src/devices/bus/ti99/joyport/joyport.h b/src/devices/bus/ti99/joyport/joyport.h
index 4011efaaf70..5b8ede166c4 100644
--- a/src/devices/bus/ti99/joyport/joyport.h
+++ b/src/devices/bus/ti99/joyport/joyport.h
@@ -36,7 +36,7 @@ class joyport_device;
/********************************************************************
Common parent class of all devices attached to the joystick port
********************************************************************/
-class device_ti99_joyport_interface : public device_slot_card_interface
+class device_ti99_joyport_interface : public device_interface
{
public:
virtual uint8_t read_dev() = 0;
@@ -44,16 +44,16 @@ public:
virtual void pulse_clock() { }
protected:
- using device_slot_card_interface::device_slot_card_interface;
+ device_ti99_joyport_interface(const machine_config &mconfig, device_t &device);
virtual void interface_config_complete() override;
- joyport_device* m_joyport = nullptr;
+ joyport_device* m_joyport;
};
/********************************************************************
Joystick port
********************************************************************/
-class joyport_device : public device_t, public device_slot_interface
+class joyport_device : public device_t, public device_single_card_slot_interface<device_ti99_joyport_interface>
{
public:
template <typename U>
diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp
index b75a15a49ed..3c93f44e536 100644
--- a/src/devices/bus/ti99/peb/peribox.cpp
+++ b/src/devices/bus/ti99/peb/peribox.cpp
@@ -639,7 +639,7 @@ void peribox_sg_device::device_add_mconfig(machine_config &config)
peribox_slot_device::peribox_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, TI99_PERIBOX_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_ti99_peribox_card_interface>(mconfig, *this),
m_card(nullptr),
m_slotnumber(0)
{
@@ -699,7 +699,7 @@ void peribox_slot_device::device_start()
void peribox_slot_device::device_config_complete()
{
- m_card = dynamic_cast<device_ti99_peribox_card_interface *>(get_card_device());
+ m_card = get_card_device();
peribox_device *peb = dynamic_cast<peribox_device*>(owner());
if (peb)
peb->set_slot_loaded(m_slotnumber, m_card ? this : nullptr);
@@ -736,7 +736,7 @@ WRITE_LINE_MEMBER( peribox_slot_device::set_ready )
/***************************************************************************/
device_ti99_peribox_card_interface::device_ti99_peribox_card_interface(const machine_config &mconfig, device_t &device):
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "ti99peb"),
m_selected(false),
m_cru_base(0),
m_select_mask(0),
diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h
index 405ded3338e..7444745f3d9 100644
--- a/src/devices/bus/ti99/peb/peribox.h
+++ b/src/devices/bus/ti99/peb/peribox.h
@@ -170,7 +170,7 @@ protected:
The parent class for all expansion cards.
******************************************************************************/
-class device_ti99_peribox_card_interface : public device_slot_card_interface
+class device_ti99_peribox_card_interface : public device_interface
{
friend class peribox_slot_device;
@@ -186,7 +186,6 @@ public:
void set_senilb(int state) { m_senilb = state; }
protected:
- using device_slot_card_interface::device_slot_card_interface;
device_ti99_peribox_card_interface(const machine_config &mconfig, device_t &device);
virtual void interface_config_complete() override;
@@ -212,7 +211,7 @@ protected:
A single slot in the box.
******************************************************************************/
-class peribox_slot_device : public device_t, public device_slot_interface
+class peribox_slot_device : public device_t, public device_single_card_slot_interface<device_ti99_peribox_card_interface>
{
friend class peribox_device;
public:
diff --git a/src/devices/bus/tiki100/8088.cpp b/src/devices/bus/tiki100/8088.cpp
index 0a940fcbc2c..c9be41c8ae0 100644
--- a/src/devices/bus/tiki100/8088.cpp
+++ b/src/devices/bus/tiki100/8088.cpp
@@ -52,7 +52,7 @@ const tiny_rom_entry *tiki100_8088_device::device_rom_region() const
void tiki100_8088_device::i8088_mem(address_map &map)
{
map(0x00000, 0xbffff).ram();
- map(0xc0000, 0xcffff).rw(":" TIKI100_BUS_TAG, FUNC(tiki100_bus_device::exin_mrq_r), FUNC(tiki100_bus_device::exin_mrq_w));
+ //map(0xc0000, 0xcffff).rw(m_bus, FUNC(tiki100_bus_device::exin_mrq_r), FUNC(tiki100_bus_device::exin_mrq_w)); don't have m_bus until start
map(0xff000, 0xfffff).rom().region(I8088_TAG, 0);
}
@@ -99,6 +99,10 @@ tiki100_8088_device::tiki100_8088_device(const machine_config &mconfig, const ch
void tiki100_8088_device::device_start()
{
+ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(
+ 0xc0000, 0xcffff,
+ read8sm_delegate(*m_bus, FUNC(tiki100_bus_device::exin_mrq_r)),
+ write8sm_delegate(*m_bus, FUNC(tiki100_bus_device::exin_mrq_w)));
}
diff --git a/src/devices/bus/tiki100/exp.cpp b/src/devices/bus/tiki100/exp.cpp
index 2d3dfc22031..fee968f40d7 100644
--- a/src/devices/bus/tiki100/exp.cpp
+++ b/src/devices/bus/tiki100/exp.cpp
@@ -29,9 +29,9 @@ DEFINE_DEVICE_TYPE(TIKI100_BUS_SLOT, tiki100_bus_slot_device, "tiki100bus_slot",
tiki100_bus_slot_device::tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, TIKI100_BUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_tiki100bus_card_interface>(mconfig, *this),
device_z80daisy_interface(mconfig, *this),
- m_bus(nullptr),
+ m_bus(*this, finder_base::DUMMY_TAG),
m_card(nullptr)
{
}
@@ -43,13 +43,9 @@ tiki100_bus_slot_device::tiki100_bus_slot_device(const machine_config &mconfig,
void tiki100_bus_slot_device::device_start()
{
- m_bus = machine().device<tiki100_bus_device>(TIKI100_BUS_TAG);
- device_tiki100bus_card_interface *dev = dynamic_cast<device_tiki100bus_card_interface *>(get_card_device());
- if (dev)
- {
- m_bus->add_card(dev);
- m_card = dev;
- }
+ m_card = get_card_device();
+ if (m_card)
+ m_bus->add_card(*m_card);
}
@@ -87,11 +83,11 @@ void tiki100_bus_device::device_start()
// add_card - add card
//-------------------------------------------------
-void tiki100_bus_device::add_card(device_tiki100bus_card_interface *card)
+void tiki100_bus_device::add_card(device_tiki100bus_card_interface &card)
{
- m_device_list.append(*card);
+ m_device_list.append(card);
- card->m_bus = this;
+ card.m_bus = this;
}
@@ -189,13 +185,22 @@ WRITE_LINE_MEMBER( tiki100_bus_device::busak_w )
//-------------------------------------------------
device_tiki100bus_card_interface::device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device), m_bus(nullptr),
- m_busak(CLEAR_LINE), m_next(nullptr)
+ device_interface(device, "tiki100bus"),
+ m_bus(nullptr),
+ m_busak(CLEAR_LINE),
+ m_next(nullptr)
{
m_slot = dynamic_cast<tiki100_bus_slot_device *>(device.owner());
}
+void device_tiki100bus_card_interface::interface_pre_start()
+{
+ if (!m_bus)
+ throw device_missing_dependencies();
+}
+
+
//-------------------------------------------------
// SLOT_INTERFACE( tiki100_cards )
//-------------------------------------------------
diff --git a/src/devices/bus/tiki100/exp.h b/src/devices/bus/tiki100/exp.h
index 9b0375daaa9..7625971a47d 100644
--- a/src/devices/bus/tiki100/exp.h
+++ b/src/devices/bus/tiki100/exp.h
@@ -19,13 +19,6 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define TIKI100_BUS_TAG "tiki100bus"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -37,7 +30,7 @@ class tiki100_bus_slot_device;
// ======================> device_tiki100bus_card_interface
-class device_tiki100bus_card_interface : public device_slot_card_interface
+class device_tiki100bus_card_interface : public device_interface
{
friend class tiki100_bus_device;
template <class ElementType> friend class simple_list;
@@ -64,7 +57,9 @@ protected:
// construction/destruction
device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device);
- tiki100_bus_device *m_bus;
+ virtual void interface_pre_start() override;
+
+ tiki100_bus_device *m_bus;
tiki100_bus_slot_device *m_slot;
int m_busak;
@@ -76,27 +71,30 @@ private:
// ======================> tiki100_bus_slot_device
class tiki100_bus_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_tiki100bus_card_interface>,
public device_z80daisy_interface
{
public:
// construction/destruction
- template <typename T>
- tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ template <typename T, typename U>
+ tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&bus, U &&opts, const char *dflt)
: tiki100_bus_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
+ set_bus(std::forward<T>(bus));
}
tiki100_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ template <typename T> void set_bus(T &&tag) { m_bus.set_tag(std::forward<T>(tag)); }
+
+protected:
// device-level overrides
virtual void device_start() override;
-protected:
// device_z80daisy_interface overrides
virtual int z80daisy_irq_state() override { return get_card_device() ? m_card->z80daisy_irq_state() : 0; }
virtual int z80daisy_irq_ack() override { return get_card_device() ? m_card->z80daisy_irq_ack() : 0; }
@@ -104,7 +102,7 @@ protected:
private:
// configuration
- tiki100_bus_device *m_bus;
+ required_device<tiki100_bus_device> m_bus;
device_tiki100bus_card_interface *m_card;
};
@@ -128,7 +126,7 @@ public:
auto mrq_rd_callback() { return m_in_mrq_cb.bind(); }
auto mrq_wr_callback() { return m_out_mrq_cb.bind(); }
- void add_card(device_tiki100bus_card_interface *card);
+ void add_card(device_tiki100bus_card_interface &card);
// computer interface
uint8_t mrq_r(offs_t offset, uint8_t data, bool &mdis);
diff --git a/src/devices/bus/tmc600/euro.cpp b/src/devices/bus/tmc600/euro.cpp
index aae96b0591a..9da4cf80227 100644
--- a/src/devices/bus/tmc600/euro.cpp
+++ b/src/devices/bus/tmc600/euro.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- Telercas Telmac TMC-600 euro bus emulation
+ Telercas Telmac TMC-600 Eurobus emulation
**********************************************************************/
@@ -15,7 +15,7 @@
// GLOBAL VARIABLES
//**************************************************************************
-DEFINE_DEVICE_TYPE(TMC600_EURO_BUS_SLOT, tmc600_euro_bus_slot_t, "tmc600_euro_bus_slot", "TMC-600 euro bus slot")
+DEFINE_DEVICE_TYPE(TMC600_EUROBUS_SLOT, tmc600_eurobus_slot_device, "tmc600_eurobus_slot", "Telmac Eurobus slot")
@@ -24,23 +24,23 @@ DEFINE_DEVICE_TYPE(TMC600_EURO_BUS_SLOT, tmc600_euro_bus_slot_t, "tmc600_euro_bu
//**************************************************************************
//-------------------------------------------------
-// device_tmc600_euro_bus_card_interface - constructor
+// device_tmc600_eurobus_card_interface - constructor
//-------------------------------------------------
-device_tmc600_euro_bus_card_interface::device_tmc600_euro_bus_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_tmc600_eurobus_card_interface::device_tmc600_eurobus_card_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "telmaceurobus")
{
- m_slot = dynamic_cast<tmc600_euro_bus_slot_t *>(device.owner());
+ m_slot = dynamic_cast<tmc600_eurobus_slot_device *>(device.owner());
}
//-------------------------------------------------
-// tmc600_euro_bus_slot_t - constructor
+// tmc600_eurobus_slot_device - constructor
//-------------------------------------------------
-tmc600_euro_bus_slot_t::tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, TMC600_EURO_BUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this)
+tmc600_eurobus_slot_device::tmc600_eurobus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, TMC600_EUROBUS_SLOT, tag, owner, clock),
+ device_single_card_slot_interface<device_tmc600_eurobus_card_interface>(mconfig, *this)
{
}
@@ -49,17 +49,17 @@ tmc600_euro_bus_slot_t::tmc600_euro_bus_slot_t(const machine_config &mconfig, co
// device_start - device-specific startup
//-------------------------------------------------
-void tmc600_euro_bus_slot_t::device_start()
+void tmc600_eurobus_slot_device::device_start()
{
- m_card = dynamic_cast<device_tmc600_euro_bus_card_interface *>(get_card_device());
+ m_card = get_card_device();
}
//-------------------------------------------------
-// SLOT_INTERFACE( tmc600_euro_bus_cards )
+// SLOT_INTERFACE( tmc600_eurobus_cards )
//-------------------------------------------------
-void tmc600_euro_bus_cards(device_slot_interface &device)
+void tmc600_eurobus_cards(device_slot_interface &device)
{
//device.option_add("tmc710", TMC710); // 5-way expander
//device.option_add("tmc720", TMC720); // 5-way expander (new model)
diff --git a/src/devices/bus/tmc600/euro.h b/src/devices/bus/tmc600/euro.h
index 51a4e435f2f..c63fe2f3793 100644
--- a/src/devices/bus/tmc600/euro.h
+++ b/src/devices/bus/tmc600/euro.h
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- Telercas Telmac TMC-600 euro bus emulation
+ Telercas Telmac TMC-600 Eurobus emulation
**********************************************************************
@@ -50,44 +50,34 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define TMC600_EURO_BUS_TAG "bus"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> device_tmc600_euro_bus_card_interface
+// ======================> device_tmc600_eurobus_card_interface
-class tmc600_euro_bus_slot_t;
+class tmc600_eurobus_slot_device;
-class device_tmc600_euro_bus_card_interface : public device_slot_card_interface
+class device_tmc600_eurobus_card_interface : public device_interface
{
-public:
-
protected:
// construction/destruction
- device_tmc600_euro_bus_card_interface(const machine_config &mconfig, device_t &device);
+ device_tmc600_eurobus_card_interface(const machine_config &mconfig, device_t &device);
- tmc600_euro_bus_slot_t *m_slot;
+ tmc600_eurobus_slot_device *m_slot;
- friend class tmc600_euro_bus_slot_t;
+ friend class tmc600_eurobus_slot_device;
};
-// ======================> tmc600_euro_bus_slot_t
+// ======================> tmc600_eurobus_slot_device
-class tmc600_euro_bus_slot_t : public device_t,
- public device_slot_interface
+class tmc600_eurobus_slot_device : public device_t, public device_single_card_slot_interface<device_tmc600_eurobus_card_interface>
{
public:
// construction/destruction
template <typename T>
- tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
- : tmc600_euro_bus_slot_t(mconfig, tag, owner, 0)
+ tmc600_eurobus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt)
+ : tmc600_eurobus_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
@@ -95,25 +85,24 @@ public:
set_fixed(false);
}
- tmc600_euro_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ tmc600_eurobus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override { if (m_card) get_card_device()->reset(); }
- device_tmc600_euro_bus_card_interface *m_card;
+ device_tmc600_eurobus_card_interface *m_card;
};
// device type definition
-DECLARE_DEVICE_TYPE(TMC600_EURO_BUS_SLOT, tmc600_euro_bus_slot_t)
+DECLARE_DEVICE_TYPE(TMC600_EUROBUS_SLOT, tmc600_eurobus_slot_device)
-void tmc600_euro_bus_cards(device_slot_interface &device);
+void tmc600_eurobus_cards(device_slot_interface &device);
-typedef device_type_iterator<tmc600_euro_bus_slot_t> tmc600_euro_bus_slot_t_iterator;
+typedef device_type_iterator<tmc600_eurobus_slot_device> tmc600_eurobus_slot_iterator;
#endif // MAME_DEVICES_TMC600_EURO_H
diff --git a/src/devices/bus/tvc/tvc.cpp b/src/devices/bus/tvc/tvc.cpp
index 0f165e0395f..f73e5e4e8db 100644
--- a/src/devices/bus/tvc/tvc.cpp
+++ b/src/devices/bus/tvc/tvc.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(TVCEXP_SLOT, tvcexp_slot_device, "tvcexp_slot", "TVC64 Expans
//-------------------------------------------------
device_tvcexp_interface::device_tvcexp_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "tvc64exp")
{
}
@@ -53,7 +53,7 @@ device_tvcexp_interface::~device_tvcexp_interface()
//-------------------------------------------------
tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, TVCEXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_tvcexp_interface>(mconfig, *this),
m_out_irq_cb(*this),
m_out_nmi_cb(*this),
m_cart(nullptr)
@@ -74,7 +74,7 @@ tvcexp_slot_device::~tvcexp_slot_device()
void tvcexp_slot_device::device_start()
{
- m_cart = dynamic_cast<device_tvcexp_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_out_irq_cb.resolve_safe();
diff --git a/src/devices/bus/tvc/tvc.h b/src/devices/bus/tvc/tvc.h
index 09ba7b35ffd..51db38c1096 100644
--- a/src/devices/bus/tvc/tvc.h
+++ b/src/devices/bus/tvc/tvc.h
@@ -65,7 +65,7 @@
// ======================> device_tvcexp_interface
-class device_tvcexp_interface : public device_slot_card_interface
+class device_tvcexp_interface : public device_interface
{
public:
// construction/destruction
@@ -86,8 +86,7 @@ protected:
// ======================> tvcexp_slot_device
-class tvcexp_slot_device : public device_t,
- public device_slot_interface
+class tvcexp_slot_device : public device_t, public device_single_card_slot_interface<device_tvcexp_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/uts_kbd/uts_kbd.cpp b/src/devices/bus/uts_kbd/uts_kbd.cpp
index d652dbfca80..8a379b69f0c 100644
--- a/src/devices/bus/uts_kbd/uts_kbd.cpp
+++ b/src/devices/bus/uts_kbd/uts_kbd.cpp
@@ -39,7 +39,7 @@ DEFINE_DEVICE_TYPE(UTS_KEYBOARD, uts_keyboard_port_device, "uts_kbd", "UTS Keybo
uts_keyboard_port_device::uts_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, UTS_KEYBOARD, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_uts_keyboard_interface>(mconfig, *this)
, m_rxd_callback(*this)
, m_kbd(nullptr)
{
@@ -47,7 +47,7 @@ uts_keyboard_port_device::uts_keyboard_port_device(const machine_config &mconfig
void uts_keyboard_port_device::device_config_complete()
{
- m_kbd = dynamic_cast<device_uts_keyboard_interface *>(get_card_device());
+ m_kbd = get_card_device();
}
void uts_keyboard_port_device::device_resolve_objects()
@@ -64,7 +64,7 @@ void uts_keyboard_port_device::device_start()
//**************************************************************************
device_uts_keyboard_interface::device_uts_keyboard_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "utskbd")
, m_port(device, DEVICE_SELF_OWNER)
{
}
diff --git a/src/devices/bus/uts_kbd/uts_kbd.h b/src/devices/bus/uts_kbd/uts_kbd.h
index 7cfff95c0fe..c0d6d9b0824 100644
--- a/src/devices/bus/uts_kbd/uts_kbd.h
+++ b/src/devices/bus/uts_kbd/uts_kbd.h
@@ -21,7 +21,7 @@ class device_uts_keyboard_interface;
// ======================> uts_keyboard_port_device
-class uts_keyboard_port_device : public device_t, public device_slot_interface
+class uts_keyboard_port_device : public device_t, public device_single_card_slot_interface<device_uts_keyboard_interface>
{
friend class device_uts_keyboard_interface;
@@ -63,7 +63,7 @@ private:
// ======================> device_uts_keyboard_interface
-class device_uts_keyboard_interface : public device_slot_card_interface
+class device_uts_keyboard_interface : public device_interface
{
friend class uts_keyboard_port_device;
diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp
index 6ed81901d12..cf0c667e880 100644
--- a/src/devices/bus/vboy/slot.cpp
+++ b/src/devices/bus/vboy/slot.cpp
@@ -25,11 +25,11 @@ DEFINE_DEVICE_TYPE(VBOY_CART_SLOT, vboy_cart_slot_device, "vboy_cart_slot", "Nin
// device_vboy_cart_interface - constructor
//-------------------------------------------------
-device_vboy_cart_interface::device_vboy_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0),
- m_rom_mask(0)
+device_vboy_cart_interface::device_vboy_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "vboycart"),
+ m_rom(nullptr),
+ m_rom_size(0),
+ m_rom_mask(0)
{
}
@@ -77,7 +77,7 @@ void device_vboy_cart_interface::eeprom_alloc(uint32_t size)
vboy_cart_slot_device::vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VBOY_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vboy_cart_interface>(mconfig, *this),
m_type(VBOY_STD),
m_cart(nullptr)
{
@@ -98,7 +98,7 @@ vboy_cart_slot_device::~vboy_cart_slot_device()
void vboy_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_vboy_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h
index 547f09b8523..e1f2716ace5 100644
--- a/src/devices/bus/vboy/slot.h
+++ b/src/devices/bus/vboy/slot.h
@@ -23,7 +23,7 @@ enum
// ======================> device_vboy_cart_interface
-class device_vboy_cart_interface : public device_slot_card_interface
+class device_vboy_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -58,7 +58,7 @@ protected:
class vboy_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_vboy_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp
index 892213c5aef..12d76e74894 100644
--- a/src/devices/bus/vc4000/slot.cpp
+++ b/src/devices/bus/vc4000/slot.cpp
@@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE(H21_CART_SLOT, h21_cart_slot_device, "h21_cart_slot",
//-------------------------------------------------
device_vc4000_cart_interface::device_vc4000_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "vc4000cart")
, m_rom(nullptr)
, m_rom_size(0)
{
@@ -86,7 +86,7 @@ vc4000_cart_slot_device::vc4000_cart_slot_device(
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_vc4000_cart_interface>(mconfig, *this)
, m_type(VC4000_STD)
, m_cart(nullptr)
{
@@ -107,7 +107,7 @@ vc4000_cart_slot_device::~vc4000_cart_slot_device()
void vc4000_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_vc4000_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
//-------------------------------------------------
diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h
index 2ad52b2c7e0..237253b5c42 100644
--- a/src/devices/bus/vc4000/slot.h
+++ b/src/devices/bus/vc4000/slot.h
@@ -20,7 +20,7 @@ enum
// ======================> device_vc4000_cart_interface
-class device_vc4000_cart_interface : public device_slot_card_interface
+class device_vc4000_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -30,7 +30,7 @@ public:
virtual uint8_t read_rom(offs_t offset) { return 0xff; }
virtual uint8_t extra_rom(offs_t offset) { return 0xff; }
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
- virtual void write_ram(offs_t offset, uint8_t data) {}
+ virtual void write_ram(offs_t offset, uint8_t data) { }
void rom_alloc(uint32_t size, const char *tag);
void ram_alloc(uint32_t size);
@@ -55,7 +55,7 @@ protected:
class vc4000_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_vc4000_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/vcs/vcs_slot.cpp b/src/devices/bus/vcs/vcs_slot.cpp
index ec1c653be2a..a88d6cb58f7 100644
--- a/src/devices/bus/vcs/vcs_slot.cpp
+++ b/src/devices/bus/vcs/vcs_slot.cpp
@@ -29,10 +29,10 @@ DEFINE_DEVICE_TYPE(VCS_CART_SLOT, vcs_cart_slot_device, "vcs_cart_slot", "Atari
// device_vcs_cart_interface - constructor
//-------------------------------------------------
-device_vcs_cart_interface::device_vcs_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_vcs_cart_interface::device_vcs_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "vcscart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -80,7 +80,8 @@ void device_vcs_cart_interface::ram_alloc(uint32_t size)
vcs_cart_slot_device::vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VCS_CART_SLOT, 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_vcs_cart_interface>(mconfig, *this),
+ m_cart(nullptr), m_type(0)
{
}
@@ -99,7 +100,7 @@ vcs_cart_slot_device::~vcs_cart_slot_device()
void vcs_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_vcs_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h
index 6e2cf9ce793..4ab70d65e0c 100644
--- a/src/devices/bus/vcs/vcs_slot.h
+++ b/src/devices/bus/vcs/vcs_slot.h
@@ -47,7 +47,7 @@ enum
// ======================> device_vcs_cart_interface
-class device_vcs_cart_interface : public device_slot_card_interface
+class device_vcs_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -85,7 +85,7 @@ protected:
class vcs_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_vcs_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/vcs_ctrl/ctrl.cpp b/src/devices/bus/vcs_ctrl/ctrl.cpp
index 57cdad8f4ba..c1d462b8e84 100644
--- a/src/devices/bus/vcs_ctrl/ctrl.cpp
+++ b/src/devices/bus/vcs_ctrl/ctrl.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(VCS_CONTROL_PORT, vcs_control_port_device, "vcs_control_port"
//-------------------------------------------------
device_vcs_control_port_interface::device_vcs_control_port_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "vcsctrl")
{
m_port = dynamic_cast<vcs_control_port_device *>(device.owner());
}
diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h
index 574a7dc3ae8..db9d1eebf3b 100644
--- a/src/devices/bus/vcs_ctrl/ctrl.h
+++ b/src/devices/bus/vcs_ctrl/ctrl.h
@@ -24,22 +24,22 @@ class vcs_control_port_device;
// ======================> device_vcs_control_port_interface
-class device_vcs_control_port_interface : public device_slot_card_interface
+class device_vcs_control_port_interface : public device_interface
{
public:
- // construction/destruction
- device_vcs_control_port_interface(const machine_config &mconfig, device_t &device);
virtual ~device_vcs_control_port_interface() { }
- virtual uint8_t vcs_joy_r() { return 0xff; };
- virtual uint8_t vcs_pot_x_r() { return 0xff; };
- virtual uint8_t vcs_pot_y_r() { return 0xff; };
- virtual void vcs_joy_w(uint8_t data) { };
+ virtual uint8_t vcs_joy_r() { return 0xff; }
+ virtual uint8_t vcs_pot_x_r() { return 0xff; }
+ virtual uint8_t vcs_pot_y_r() { return 0xff; }
+ virtual void vcs_joy_w(uint8_t data) { }
virtual bool has_pot_x() { return false; }
virtual bool has_pot_y() { return false; }
protected:
+ device_vcs_control_port_interface(const machine_config &mconfig, device_t &device);
+
vcs_control_port_device *m_port;
};
diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp
index 43f39178a49..15095b5b285 100644
--- a/src/devices/bus/vectrex/slot.cpp
+++ b/src/devices/bus/vectrex/slot.cpp
@@ -25,10 +25,10 @@ DEFINE_DEVICE_TYPE(VECTREX_CART_SLOT, vectrex_cart_slot_device, "vectrex_cart_sl
// device_vectrex_cart_interface - constructor
//-------------------------------------------------
-device_vectrex_cart_interface::device_vectrex_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0)
+device_vectrex_cart_interface::device_vectrex_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "vectrexcart"),
+ m_rom(nullptr),
+ m_rom_size(0)
{
}
@@ -65,7 +65,7 @@ void device_vectrex_cart_interface::rom_alloc(uint32_t size, const char *tag)
vectrex_cart_slot_device::vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VECTREX_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vectrex_cart_interface>(mconfig, *this),
m_type(VECTREX_STD),
m_vec3d(VEC3D_NONE),
m_cart(nullptr)
@@ -87,7 +87,7 @@ vectrex_cart_slot_device::~vectrex_cart_slot_device()
void vectrex_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_vectrex_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
@@ -124,7 +124,7 @@ static int vectrex_get_pcb_id(const char *slot)
static const char *vectrex_get_slot(int type)
{
- for (auto & elem : slot_list)
+ for (auto &elem : slot_list)
{
if (elem.pcb_id == type)
return elem.slot_option;
diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h
index f779bf5d514..a65b4cbb1ba 100644
--- a/src/devices/bus/vectrex/slot.h
+++ b/src/devices/bus/vectrex/slot.h
@@ -32,7 +32,7 @@ enum
// ======================> device_vectrex_cart_interface
-class device_vectrex_cart_interface : public device_slot_card_interface
+class device_vectrex_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -60,7 +60,7 @@ protected:
class vectrex_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_vectrex_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp
index 26ad1980448..a4f677c4ff1 100644
--- a/src/devices/bus/vic10/exp.cpp
+++ b/src/devices/bus/vic10/exp.cpp
@@ -28,11 +28,11 @@ DEFINE_DEVICE_TYPE(VIC10_EXPANSION_SLOT, vic10_expansion_slot_device, "vic10_exp
// device_vic10_expansion_card_interface - constructor
//-------------------------------------------------
-device_vic10_expansion_card_interface::device_vic10_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device),
- m_lorom(*this, "lorom"),
- m_exram(*this, "exram"),
- m_uprom(*this, "uprom")
+device_vic10_expansion_card_interface::device_vic10_expansion_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "vic10exp"),
+ m_lorom(*this, "lorom"),
+ m_exram(*this, "exram"),
+ m_uprom(*this, "uprom")
{
m_slot = dynamic_cast<vic10_expansion_slot_device *>(device.owner());
}
@@ -58,7 +58,7 @@ device_vic10_expansion_card_interface::~device_vic10_expansion_card_interface()
vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIC10_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vic10_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_write_irq(*this),
m_write_res(*this),
@@ -70,27 +70,12 @@ vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &m
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void vic10_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_vic10_expansion_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_vic10_expansion_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vic10_expansion_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_vic10_expansion_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_vic10_expansion_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
@@ -99,6 +84,7 @@ void vic10_expansion_slot_device::device_start()
m_write_sp.resolve_safe();
// inherit bus clock
+ // FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
if (clock() == 0)
{
vic10_expansion_slot_device *root = machine().device<vic10_expansion_slot_device>(VIC10_EXPANSION_SLOT_TAG);
@@ -109,15 +95,6 @@ void vic10_expansion_slot_device::device_start()
//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void vic10_expansion_slot_device::device_reset()
-{
-}
-
-
-//-------------------------------------------------
// call_load -
//-------------------------------------------------
diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h
index 710b25bbd49..a6ece5b9f5f 100644
--- a/src/devices/bus/vic10/exp.h
+++ b/src/devices/bus/vic10/exp.h
@@ -57,7 +57,7 @@
class device_vic10_expansion_card_interface;
class vic10_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_vic10_expansion_card_interface>,
public device_image_interface
{
public:
@@ -92,9 +92,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;
// image-level overrides
virtual image_init_result call_load() override;
@@ -125,7 +123,7 @@ protected:
// ======================> device_vic10_expansion_card_interface
// class representing interface-specific live vic10_expansion card
-class device_vic10_expansion_card_interface : public device_slot_card_interface
+class device_vic10_expansion_card_interface : public device_interface
{
friend class vic10_expansion_slot_device;
diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp
index 1b634cd0321..7751ff4bc81 100644
--- a/src/devices/bus/vic20/exp.cpp
+++ b/src/devices/bus/vic20/exp.cpp
@@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(VIC20_EXPANSION_SLOT, vic20_expansion_slot_device, "vic20_exp
//-------------------------------------------------
device_vic20_expansion_card_interface::device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
+ : device_interface(device, "vic20exp"),
m_blk1(*this, "blk1"),
m_blk2(*this, "blk2"),
m_blk3(*this, "blk3"),
@@ -59,7 +59,7 @@ device_vic20_expansion_card_interface::~device_vic20_expansion_card_interface()
vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIC20_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vic20_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_write_irq(*this),
m_write_nmi(*this),
@@ -70,27 +70,12 @@ vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &m
//-------------------------------------------------
-// device_validity_check -
-//-------------------------------------------------
-
-void vic20_expansion_slot_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<device_vic20_expansion_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement device_vic20_expansion_card_interface\n", carddev->tag(), carddev->name());
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vic20_expansion_slot_device::device_start()
{
- device_t *const carddev = get_card_device();
- m_card = dynamic_cast<device_vic20_expansion_card_interface *>(carddev);
- if (carddev && !m_card)
- fatalerror("Card device %s (%s) does not implement device_vic20_expansion_card_interface\n", carddev->tag(), carddev->name());
+ m_card = get_card_device();
// resolve callbacks
m_write_irq.resolve_safe();
diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h
index f7e51b0ee57..d0c2cbe50ec 100644
--- a/src/devices/bus/vic20/exp.h
+++ b/src/devices/bus/vic20/exp.h
@@ -56,7 +56,7 @@
class device_vic20_expansion_card_interface;
class vic20_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_vic20_expansion_card_interface>,
public device_image_interface
{
public:
@@ -89,7 +89,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;
@@ -121,7 +120,7 @@ protected:
// ======================> device_vic20_expansion_card_interface
// class representing interface-specific live vic20_expansion card
-class device_vic20_expansion_card_interface : public device_slot_card_interface
+class device_vic20_expansion_card_interface : public device_interface
{
friend class vic20_expansion_slot_device;
diff --git a/src/devices/bus/vidbrain/exp.cpp b/src/devices/bus/vidbrain/exp.cpp
index 808907678cc..9923ab76fbd 100644
--- a/src/devices/bus/vidbrain/exp.cpp
+++ b/src/devices/bus/vidbrain/exp.cpp
@@ -12,14 +12,6 @@
//**************************************************************************
-// MACROS/CONSTANTS
-//**************************************************************************
-
-#define LOG 0
-
-
-
-//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
@@ -36,7 +28,7 @@ DEFINE_DEVICE_TYPE(VIDEOBRAIN_EXPANSION_SLOT, videobrain_expansion_slot_device,
//-------------------------------------------------
device_videobrain_expansion_card_interface::device_videobrain_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "vidbrainexp"),
m_rom_mask(0),
m_ram_mask(0)
{
@@ -89,7 +81,7 @@ uint8_t* device_videobrain_expansion_card_interface::videobrain_ram_pointer(runn
videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIDEOBRAIN_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_videobrain_expansion_card_interface>(mconfig, *this),
device_image_interface(mconfig, *this),
m_write_extres(*this), m_cart(nullptr)
{
@@ -102,7 +94,7 @@ videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine
void videobrain_expansion_slot_device::device_start()
{
- m_cart = dynamic_cast<device_videobrain_expansion_card_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_write_extres.resolve_safe();
@@ -150,36 +142,6 @@ std::string videobrain_expansion_slot_device::get_default_card_software(get_defa
//-------------------------------------------------
-// bo_r - cartridge data read
-//-------------------------------------------------
-
-uint8_t videobrain_expansion_slot_device::bo_r(offs_t offset, int cs1, int cs2)
-{
- uint8_t data = 0;
-
- if (m_cart != nullptr)
- {
- data = m_cart->videobrain_bo_r(offset, cs1, cs2);
- }
-
- return data;
-}
-
-
-//-------------------------------------------------
-// bo_w - cartridge data write
-//-------------------------------------------------
-
-void videobrain_expansion_slot_device::bo_w(offs_t offset, uint8_t data, int cs1, int cs2)
-{
- if (m_cart != nullptr)
- {
- m_cart->videobrain_bo_w(offset, data, cs1, cs2);
- }
-}
-
-
-//-------------------------------------------------
// SLOT_INTERFACE_START( vidbrain_expansion_cards )
//-------------------------------------------------
diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h
index e841df6c32c..934e5a89e2e 100644
--- a/src/devices/bus/vidbrain/exp.h
+++ b/src/devices/bus/vidbrain/exp.h
@@ -43,13 +43,6 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define VIDEOBRAIN_EXPANSION_SLOT_TAG "exp"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -57,7 +50,7 @@ class videobrain_expansion_slot_device;
// ======================> device_videobrain_expansion_card_interface
-class device_videobrain_expansion_card_interface : public device_slot_card_interface
+class device_videobrain_expansion_card_interface : public device_interface
{
friend class videobrain_expansion_slot_device;
@@ -90,7 +83,7 @@ protected:
// ======================> videobrain_expansion_slot_device
class videobrain_expansion_slot_device : public device_t,
- public device_slot_interface,
+ public device_single_card_slot_interface<device_videobrain_expansion_card_interface>,
public device_image_interface
{
public:
@@ -109,8 +102,8 @@ public:
auto extres_wr_callback() { return m_write_extres.bind(); }
// computer interface
- uint8_t bo_r(offs_t offset, int cs1, int cs2);
- void bo_w(offs_t offset, uint8_t data, int cs1, int cs2);
+ uint8_t bo_r(offs_t offset, int cs1, int cs2) { return m_cart ? m_cart->videobrain_bo_r(offset, cs1, cs2) : 0; }
+ void bo_w(offs_t offset, uint8_t data, int cs1, int cs2) { if (m_cart) m_cart->videobrain_bo_w(offset, data, cs1, cs2); }
uint8_t cs1_r(offs_t offset) { return bo_r(offset + 0x1000, 0, 1); }
void cs1_w(offs_t offset, uint8_t data) { bo_w(offset + 0x1000, data, 0, 1); }
diff --git a/src/devices/bus/vip/byteio.cpp b/src/devices/bus/vip/byteio.cpp
index 7b908dad442..83236247ae7 100644
--- a/src/devices/bus/vip/byteio.cpp
+++ b/src/devices/bus/vip/byteio.cpp
@@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(VIP_BYTEIO_PORT, vip_byteio_port_device, "vip_byteio_port", "
// device_vip_byteio_port_interface - constructor
//-------------------------------------------------
-device_vip_byteio_port_interface::device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig,device)
+device_vip_byteio_port_interface::device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "vipbyteio")
{
m_slot = dynamic_cast<vip_byteio_port_device *>(device.owner());
}
@@ -45,7 +45,7 @@ device_vip_byteio_port_interface::device_vip_byteio_port_interface(const machine
vip_byteio_port_device::vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIP_BYTEIO_PORT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vip_byteio_port_interface>(mconfig, *this),
m_write_inst(*this),
m_cart(nullptr)
{
@@ -57,7 +57,7 @@ vip_byteio_port_device::vip_byteio_port_device(const machine_config &mconfig, co
void vip_byteio_port_device::device_start()
{
- m_cart = dynamic_cast<device_vip_byteio_port_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_write_inst.resolve_safe();
diff --git a/src/devices/bus/vip/byteio.h b/src/devices/bus/vip/byteio.h
index f2b12ca49f2..5cca82aea45 100644
--- a/src/devices/bus/vip/byteio.h
+++ b/src/devices/bus/vip/byteio.h
@@ -53,8 +53,7 @@
class device_vip_byteio_port_interface;
-class vip_byteio_port_device : public device_t,
- public device_slot_interface
+class vip_byteio_port_device : public device_t, public device_single_card_slot_interface<device_vip_byteio_port_interface>
{
public:
// construction/destruction
@@ -96,7 +95,7 @@ protected:
// ======================> device_vip_byteio_port_interface
// class representing interface-specific live c64_expansion card
-class device_vip_byteio_port_interface : public device_slot_card_interface
+class device_vip_byteio_port_interface : public device_interface
{
public:
virtual uint8_t vip_in_r() { return 0xff; }
diff --git a/src/devices/bus/vip/exp.cpp b/src/devices/bus/vip/exp.cpp
index 132a4d753ef..f6abf579f18 100644
--- a/src/devices/bus/vip/exp.cpp
+++ b/src/devices/bus/vip/exp.cpp
@@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE(VIP_EXPANSION_SLOT, vip_expansion_slot_device, "vip_expansion
//-------------------------------------------------
device_vip_expansion_card_interface::device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "vipexp")
{
m_slot = dynamic_cast<vip_expansion_slot_device *>(device.owner());
}
@@ -53,7 +53,7 @@ device_vip_expansion_card_interface::device_vip_expansion_card_interface(const m
vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VIP_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vip_expansion_card_interface>(mconfig, *this),
m_write_int(*this),
m_write_dma_out(*this),
m_write_dma_in(*this), m_card(nullptr)
@@ -67,7 +67,7 @@ vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconf
void vip_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_vip_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_write_int.resolve_safe();
diff --git a/src/devices/bus/vip/exp.h b/src/devices/bus/vip/exp.h
index 9073dafee0d..bb9cd203690 100644
--- a/src/devices/bus/vip/exp.h
+++ b/src/devices/bus/vip/exp.h
@@ -54,8 +54,7 @@
class device_vip_expansion_card_interface;
-class vip_expansion_slot_device : public device_t,
- public device_slot_interface
+class vip_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_vip_expansion_card_interface>
{
public:
// construction/destruction
@@ -109,7 +108,7 @@ protected:
// ======================> device_vip_expansion_card_interface
-class device_vip_expansion_card_interface : public device_slot_card_interface
+class device_vip_expansion_card_interface : public device_interface
{
friend class vip_expansion_slot_device;
diff --git a/src/devices/bus/vme/vme.cpp b/src/devices/bus/vme/vme.cpp
index 61ca35c2199..236dd258c73 100644
--- a/src/devices/bus/vme/vme.cpp
+++ b/src/devices/bus/vme/vme.cpp
@@ -455,12 +455,12 @@ void vme_device::install_device(vme_amod_t amod, offs_t start, offs_t end, read3
// Card interface
//
device_vme_card_interface::device_vme_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
- ,m_vme(nullptr)
- ,m_vme_tag(nullptr)
- ,m_vme_slottag(nullptr)
- ,m_slot(0)
- ,m_next(nullptr)
+ : device_interface(device, "vme")
+ , m_vme(nullptr)
+ , m_vme_tag(nullptr)
+ , m_vme_slottag(nullptr)
+ , m_slot(0)
+ , m_next(nullptr)
{
m_device = &device;
LOG("%s %s\n", m_device->tag(), FUNCNAME);
diff --git a/src/devices/bus/vme/vme.h b/src/devices/bus/vme/vme.h
index 2849b07f8b3..0492c2557fd 100644
--- a/src/devices/bus/vme/vme.h
+++ b/src/devices/bus/vme/vme.h
@@ -213,7 +213,7 @@ protected:
// device type definition
DECLARE_DEVICE_TYPE(VME_SLOT, vme_slot_device)
-class device_vme_card_interface : public device_slot_card_interface
+class device_vme_card_interface : public device_interface
{
template <class ElementType> friend class simple_list;
public:
diff --git a/src/devices/bus/vsmile/vsmile_ctrl.cpp b/src/devices/bus/vsmile/vsmile_ctrl.cpp
index a8cbf25278b..478f8c142e6 100644
--- a/src/devices/bus/vsmile/vsmile_ctrl.cpp
+++ b/src/devices/bus/vsmile/vsmile_ctrl.cpp
@@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(VSMILE_CTRL_PORT, vsmile_ctrl_port_device, "vsmile_ctrl_port"
//**************************************************************************
device_vsmile_ctrl_interface::device_vsmile_ctrl_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "vsmilectrl")
, m_port(dynamic_cast<vsmile_ctrl_port_device *>(device.owner()))
{
}
@@ -34,8 +34,6 @@ device_vsmile_ctrl_interface::~device_vsmile_ctrl_interface()
void device_vsmile_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(
@@ -47,8 +45,6 @@ void device_vsmile_ctrl_interface::interface_validity_check(validity_checker &va
void device_vsmile_ctrl_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (m_port && !m_port->started())
throw device_missing_dependencies();
}
@@ -64,7 +60,7 @@ vsmile_ctrl_port_device::vsmile_ctrl_port_device(
device_t *owner,
uint32_t clock)
: device_t(mconfig, VSMILE_CTRL_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_vsmile_ctrl_interface>(mconfig, *this)
, m_rts_cb(*this)
, m_data_cb(*this)
{
@@ -74,23 +70,9 @@ vsmile_ctrl_port_device::~vsmile_ctrl_port_device()
{
}
-void vsmile_ctrl_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_vsmile_ctrl_interface *>(card))
- {
- osd_printf_error(
- "Card device %s (%s) does not implement device_vsmile_ctrl_interface\n",
- card->tag(),
- card->name());
- }
-}
-
void vsmile_ctrl_port_device::device_resolve_objects()
{
- device_vsmile_ctrl_interface *const card(dynamic_cast<device_vsmile_ctrl_interface *>(get_card_device()));
- if (card)
- m_device = card;
+ m_device = get_card_device();;
m_rts_cb.resolve_safe();
m_data_cb.resolve_safe();
@@ -98,21 +80,8 @@ void vsmile_ctrl_port_device::device_resolve_objects()
void vsmile_ctrl_port_device::device_start()
{
- device_t *const card(get_card_device());
- if (card)
- {
- if (!m_device)
- {
- throw emu_fatalerror(
- "vsmile_ctrl_port_device: card device %s (%s) does not implement device_vsmile_ctrl_interface\n",
- card->tag(),
- card->name());
- }
- else
- {
- m_device->select_w(0);
- }
- }
+ if (m_device)
+ m_device->select_w(0);
}
diff --git a/src/devices/bus/vsmile/vsmile_ctrl.h b/src/devices/bus/vsmile/vsmile_ctrl.h
index 66921ce817a..652d4fbe362 100644
--- a/src/devices/bus/vsmile/vsmile_ctrl.h
+++ b/src/devices/bus/vsmile/vsmile_ctrl.h
@@ -19,7 +19,7 @@ class vsmile_ctrl_port_device;
// ======================> device_vsmile_ctrl_interface
-class device_vsmile_ctrl_interface : public device_slot_card_interface
+class device_vsmile_ctrl_interface : public device_interface
{
public:
virtual ~device_vsmile_ctrl_interface();
@@ -48,7 +48,7 @@ private:
// ======================> vsmile_ctrl_port_device
-class vsmile_ctrl_port_device : public device_t, public device_slot_interface
+class vsmile_ctrl_port_device : public device_t, public device_single_card_slot_interface<device_vsmile_ctrl_interface>
{
public:
// configuration
@@ -74,7 +74,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;
diff --git a/src/devices/bus/vsmile/vsmile_slot.cpp b/src/devices/bus/vsmile/vsmile_slot.cpp
index 61d7873b63f..7bc440f541d 100644
--- a/src/devices/bus/vsmile/vsmile_slot.cpp
+++ b/src/devices/bus/vsmile/vsmile_slot.cpp
@@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(VSMILE_CART_SLOT, vsmile_cart_slot_device, "vsmile_cart_slot"
//-------------------------------------------------
device_vsmile_cart_interface::device_vsmile_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "vsmilecart")
, m_rom(nullptr)
, m_rom_size(0)
{
@@ -76,7 +76,7 @@ void device_vsmile_cart_interface::nvram_alloc(uint32_t size)
vsmile_cart_slot_device::vsmile_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VSMILE_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vsmile_cart_interface>(mconfig, *this),
m_type(VSMILE_STD),
m_cart(nullptr)
{
@@ -97,7 +97,7 @@ vsmile_cart_slot_device::~vsmile_cart_slot_device()
void vsmile_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_vsmile_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/vsmile/vsmile_slot.h b/src/devices/bus/vsmile/vsmile_slot.h
index 7d800677214..129c6d356e2 100644
--- a/src/devices/bus/vsmile/vsmile_slot.h
+++ b/src/devices/bus/vsmile/vsmile_slot.h
@@ -22,7 +22,7 @@ enum
// ======================> device_vsmile_cart_interface
-class device_vsmile_cart_interface : public device_slot_card_interface
+class device_vsmile_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -65,7 +65,7 @@ protected:
class vsmile_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_vsmile_cart_interface>
{
public:
// construction/destruction
@@ -81,9 +81,6 @@ public:
vsmile_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~vsmile_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;
@@ -118,6 +115,9 @@ public:
void set_cs2(bool cs2);
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
int m_type;
device_vsmile_cart_interface* m_cart;
};
diff --git a/src/devices/bus/vtech/ioexp/ioexp.cpp b/src/devices/bus/vtech/ioexp/ioexp.cpp
index 897b0dba95b..27a517fabb1 100644
--- a/src/devices/bus/vtech/ioexp/ioexp.cpp
+++ b/src/devices/bus/vtech/ioexp/ioexp.cpp
@@ -29,9 +29,8 @@ DEFINE_DEVICE_TYPE(VTECH_IOEXP_SLOT, vtech_ioexp_slot_device, "vtech_ioexp_slot"
vtech_ioexp_slot_device::vtech_ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VTECH_IOEXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_io(*this, finder_base::DUMMY_TAG, -1),
- m_cart(nullptr)
+ device_single_card_slot_interface<device_vtech_ioexp_interface>(mconfig, *this),
+ m_io(*this, finder_base::DUMMY_TAG, -1)
{
}
@@ -51,14 +50,6 @@ void vtech_ioexp_slot_device::device_start()
{
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void vtech_ioexp_slot_device::device_reset()
-{
-}
-
//**************************************************************************
// CARTRIDGE INTERFACE
@@ -69,7 +60,7 @@ void vtech_ioexp_slot_device::device_reset()
//-------------------------------------------------
device_vtech_ioexp_interface::device_vtech_ioexp_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "vtechioexp")
{
m_slot = dynamic_cast<vtech_ioexp_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/vtech/ioexp/ioexp.h b/src/devices/bus/vtech/ioexp/ioexp.h
index 9a78f861478..354d9fc46a2 100644
--- a/src/devices/bus/vtech/ioexp/ioexp.h
+++ b/src/devices/bus/vtech/ioexp/ioexp.h
@@ -38,7 +38,7 @@
class device_vtech_ioexp_interface;
-class vtech_ioexp_slot_device : public device_t, public device_slot_interface
+class vtech_ioexp_slot_device : public device_t, public device_single_card_slot_interface<device_vtech_ioexp_interface>
{
friend class device_vtech_ioexp_interface;
public:
@@ -59,15 +59,12 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
required_address_space m_io;
-
- device_vtech_ioexp_interface *m_cart;
};
// class representing interface-specific live ioexp device
-class device_vtech_ioexp_interface : public device_slot_card_interface
+class device_vtech_ioexp_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/vtech/memexp/memexp.cpp b/src/devices/bus/vtech/memexp/memexp.cpp
index 90f51da7345..d857ccf3d0b 100644
--- a/src/devices/bus/vtech/memexp/memexp.cpp
+++ b/src/devices/bus/vtech/memexp/memexp.cpp
@@ -29,10 +29,9 @@ DEFINE_DEVICE_TYPE(VTECH_MEMEXP_SLOT, vtech_memexp_slot_device, "vtech_memexp_sl
vtech_memexp_slot_device::vtech_memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VTECH_MEMEXP_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_vtech_memexp_interface>(mconfig, *this),
m_program(*this, finder_base::DUMMY_TAG, -1),
m_io(*this, finder_base::DUMMY_TAG, -1),
- m_cart(nullptr),
m_int_handler(*this),
m_nmi_handler(*this),
m_reset_handler(*this)
@@ -81,14 +80,6 @@ void vtech_memexp_slot_device::device_start()
m_reset_handler.resolve_safe();
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void vtech_memexp_slot_device::device_reset()
-{
-}
-
//**************************************************************************
// CARTRIDGE INTERFACE
@@ -99,7 +90,7 @@ void vtech_memexp_slot_device::device_reset()
//-------------------------------------------------
device_vtech_memexp_interface::device_vtech_memexp_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device)
+ device_interface(device, "vtechmemexp")
{
m_slot = dynamic_cast<vtech_memexp_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/vtech/memexp/memexp.h b/src/devices/bus/vtech/memexp/memexp.h
index ca096075e90..28c7453be4a 100644
--- a/src/devices/bus/vtech/memexp/memexp.h
+++ b/src/devices/bus/vtech/memexp/memexp.h
@@ -45,7 +45,7 @@
class device_vtech_memexp_interface;
-class vtech_memexp_slot_device : public device_t, public device_slot_interface
+class vtech_memexp_slot_device : public device_t, public device_single_card_slot_interface<device_vtech_memexp_interface>
{
friend class device_vtech_memexp_interface;
public:
@@ -78,13 +78,10 @@ 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;
- device_vtech_memexp_interface *m_cart;
-
private:
devcb_write_line m_int_handler;
devcb_write_line m_nmi_handler;
@@ -92,7 +89,7 @@ private:
};
// class representing interface-specific live memexp device
-class device_vtech_memexp_interface : public device_slot_card_interface
+class device_vtech_memexp_interface : public device_interface
{
public:
// construction/destruction
diff --git a/src/devices/bus/wangpc/wangpc.cpp b/src/devices/bus/wangpc/wangpc.cpp
index 540ed94c1b3..7f209465d2d 100644
--- a/src/devices/bus/wangpc/wangpc.cpp
+++ b/src/devices/bus/wangpc/wangpc.cpp
@@ -29,8 +29,8 @@ DEFINE_DEVICE_TYPE(WANGPC_BUS_SLOT, wangpcbus_slot_device, "wangpcbus_slot", "Wa
wangpcbus_slot_device::wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, WANGPC_BUS_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
- m_bus(nullptr),
+ device_single_card_slot_interface<device_wangpcbus_card_interface>(mconfig, *this),
+ m_bus(*this, finder_base::DUMMY_TAG),
m_sid(0)
{
}
@@ -41,9 +41,9 @@ wangpcbus_slot_device::wangpcbus_slot_device(const machine_config &mconfig, cons
void wangpcbus_slot_device::device_start()
{
- m_bus = machine().device<wangpcbus_device>(WANGPC_BUS_TAG);
- device_wangpcbus_card_interface *dev = dynamic_cast<device_wangpcbus_card_interface *>(get_card_device());
- if (dev) m_bus->add_card(dev, m_sid);
+ device_wangpcbus_card_interface *dev = get_card_device();
+ if (dev)
+ m_bus->add_card(*dev, m_sid);
}
@@ -91,12 +91,12 @@ void wangpcbus_device::device_start()
// add_card - add card
//-------------------------------------------------
-void wangpcbus_device::add_card(device_wangpcbus_card_interface *card, int sid)
+void wangpcbus_device::add_card(device_wangpcbus_card_interface &card, int sid)
{
- m_device_list.append(*card);
+ m_device_list.append(card);
- card->m_bus = this;
- card->m_sid = sid;
+ card.m_bus = this;
+ card.m_sid = sid;
}
@@ -242,12 +242,19 @@ WRITE_LINE_MEMBER( wangpcbus_device::tc_w )
//-------------------------------------------------
device_wangpcbus_card_interface::device_wangpcbus_card_interface(const machine_config &mconfig, device_t &device) :
- device_slot_card_interface(mconfig, device), m_bus(nullptr), m_sid(0), m_next(nullptr)
+ device_interface(device, "wangpcbus"), m_bus(nullptr), m_sid(0), m_next(nullptr)
{
m_slot = dynamic_cast<wangpcbus_slot_device *>(device.owner());
}
+void device_wangpcbus_card_interface::interface_pre_start()
+{
+ if (!m_bus)
+ throw device_missing_dependencies();
+}
+
+
//-------------------------------------------------
// SLOT_INTERFACE( wangpc_cards )
//-------------------------------------------------
diff --git a/src/devices/bus/wangpc/wangpc.h b/src/devices/bus/wangpc/wangpc.h
index bb8c7a3c4ac..05ca1908f75 100644
--- a/src/devices/bus/wangpc/wangpc.h
+++ b/src/devices/bus/wangpc/wangpc.h
@@ -18,38 +18,35 @@
//**************************************************************************
-// CONSTANTS
+// TYPE DEFINITIONS
//**************************************************************************
-#define WANGPC_BUS_TAG "wangpcbus"
-
+class device_wangpcbus_card_interface;
+class wangpcbus_device;
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
// ======================> wangpcbus_slot_device
-class wangpcbus_device;
-
-class wangpcbus_slot_device : public device_t, public device_slot_interface
+class wangpcbus_slot_device : public device_t, public device_single_card_slot_interface<device_wangpcbus_card_interface>
{
public:
// construction/destruction
- template <typename T>
- wangpcbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt, int sid)
+ template <typename T, typename U>
+ wangpcbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&bus, U &&opts, char const *dflt, int sid)
: wangpcbus_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
- set_wangpcbus_slot(sid);
+ set_bus(std::forward<T>(bus));
+ set_bus_slot(sid);
}
wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// inline configuration
- void set_wangpcbus_slot(int sid) { m_sid = sid; }
+ template <typename T> void set_bus(T &&tag) { m_bus.set_tag(std::forward<T>(tag)); }
+ void set_bus_slot(int sid) { m_sid = sid; }
protected:
// device-level overrides
@@ -57,7 +54,7 @@ protected:
private:
// configuration
- wangpcbus_device *m_bus;
+ required_device<wangpcbus_device> m_bus;
int m_sid;
};
@@ -66,9 +63,6 @@ private:
DECLARE_DEVICE_TYPE(WANGPC_BUS_SLOT, wangpcbus_slot_device)
-class device_wangpcbus_card_interface;
-
-
// ======================> wangpcbus_device
class wangpcbus_device : public device_t
@@ -89,7 +83,7 @@ public:
auto drq3_wr_callback() { return m_write_drq3.bind(); }
auto ioerror_wr_callback() { return m_write_ioerror.bind(); }
- void add_card(device_wangpcbus_card_interface *card, int sid);
+ void add_card(device_wangpcbus_card_interface &card, int sid);
// computer interface
uint16_t mrdc_r(offs_t offset, uint16_t mem_mask = 0xffff);
@@ -151,7 +145,7 @@ DECLARE_DEVICE_TYPE(WANGPC_BUS, wangpcbus_device)
// ======================> device_wangpcbus_card_interface
// class representing interface-specific live wangpcbus card
-class device_wangpcbus_card_interface : public device_slot_card_interface
+class device_wangpcbus_card_interface : public device_interface
{
friend class wangpcbus_device;
template <class ElementType> friend class simple_list;
@@ -178,6 +172,8 @@ protected:
// construction/destruction
device_wangpcbus_card_interface(const machine_config &mconfig, device_t &device);
+ virtual void interface_pre_start() override;
+
wangpcbus_device *m_bus;
wangpcbus_slot_device *m_slot;
diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp
index 731c0967e1e..fd0c8cdc9fa 100644
--- a/src/devices/bus/wswan/slot.cpp
+++ b/src/devices/bus/wswan/slot.cpp
@@ -25,13 +25,13 @@ DEFINE_DEVICE_TYPE(WS_CART_SLOT, ws_cart_slot_device, "ws_cart_slot", "Wonderswa
// device_ws_cart_interface - constructor
//-------------------------------------------------
-device_ws_cart_interface::device_ws_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),
- m_has_rtc(false),
- m_is_rotated(false)
+device_ws_cart_interface::device_ws_cart_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "wswancart"),
+ m_rom(nullptr),
+ m_rom_size(0),
+ m_bank_mask(0),
+ m_has_rtc(false),
+ m_is_rotated(false)
{
}
@@ -79,7 +79,7 @@ void device_ws_cart_interface::nvram_alloc(uint32_t size)
ws_cart_slot_device::ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, WS_CART_SLOT, tag, owner, clock),
device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_ws_cart_interface>(mconfig, *this),
m_type(WS_STD),
m_cart(nullptr)
{
@@ -100,7 +100,7 @@ ws_cart_slot_device::~ws_cart_slot_device()
void ws_cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_ws_cart_interface *>(get_card_device());
+ m_cart = get_card_device();
}
diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h
index 219a4bb3fe8..b1be84a4f55 100644
--- a/src/devices/bus/wswan/slot.h
+++ b/src/devices/bus/wswan/slot.h
@@ -24,7 +24,7 @@ enum
// ======================> device_ws_cart_interface
-class device_ws_cart_interface : public device_slot_card_interface
+class device_ws_cart_interface : public device_interface
{
public:
// construction/destruction
@@ -68,7 +68,7 @@ protected:
class ws_cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_ws_cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp
index 05fa90e9a0d..398c507802c 100644
--- a/src/devices/bus/x68k/x68kexp.cpp
+++ b/src/devices/bus/x68k/x68kexp.cpp
@@ -19,8 +19,8 @@ DEFINE_DEVICE_TYPE(X68K_EXPANSION_SLOT, x68k_expansion_slot_device, "x68k_expans
//**************************************************************************
-device_x68k_expansion_card_interface::device_x68k_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+device_x68k_expansion_card_interface::device_x68k_expansion_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "x68kexp")
{
}
@@ -47,7 +47,7 @@ uint8_t device_x68k_expansion_card_interface::iack4()
x68k_expansion_slot_device::x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, X68K_EXPANSION_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_x68k_expansion_card_interface>(mconfig, *this),
m_space(*this, finder_base::DUMMY_TAG, -1),
m_out_irq2_cb(*this),
m_out_irq4_cb(*this),
@@ -67,7 +67,7 @@ x68k_expansion_slot_device::~x68k_expansion_slot_device()
void x68k_expansion_slot_device::device_start()
{
- m_card = dynamic_cast<device_x68k_expansion_card_interface *>(get_card_device());
+ m_card = get_card_device();
// resolve callbacks
m_out_irq2_cb.resolve_safe();
@@ -77,15 +77,6 @@ void x68k_expansion_slot_device::device_start()
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void x68k_expansion_slot_device::device_reset()
-{
-}
-
-
WRITE_LINE_MEMBER( x68k_expansion_slot_device::irq2_w ) { m_out_irq2_cb(state); }
WRITE_LINE_MEMBER( x68k_expansion_slot_device::irq4_w ) { m_out_irq4_cb(state); }
WRITE_LINE_MEMBER( x68k_expansion_slot_device::nmi_w ) { m_out_nmi_cb(state); }
diff --git a/src/devices/bus/x68k/x68kexp.h b/src/devices/bus/x68k/x68kexp.h
index a42aa3e2fd3..8b46c8e9cf5 100644
--- a/src/devices/bus/x68k/x68kexp.h
+++ b/src/devices/bus/x68k/x68kexp.h
@@ -68,20 +68,13 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define X68K_EXP_SLOT_TAG "x68kexp"
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> device_x68k_expansion_card_interface
// class representing interface-specific live x68k_expansion card
-class device_x68k_expansion_card_interface : public device_slot_card_interface
+class device_x68k_expansion_card_interface : public device_interface
{
public:
// construction/destruction
@@ -100,7 +93,7 @@ protected:
// ======================> x68k_expansion_slot_device
-class x68k_expansion_slot_device : public device_t, public device_slot_interface
+class x68k_expansion_slot_device : public device_t, public device_single_card_slot_interface<device_x68k_expansion_card_interface>
{
public:
// construction/destruction
@@ -136,7 +129,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
required_address_space m_space;
diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp
index bed0141b012..c65cc3d97a7 100644
--- a/src/devices/bus/z88/z88.cpp
+++ b/src/devices/bus/z88/z88.cpp
@@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE(Z88CART_SLOT, z88cart_slot_device, "z88cart_slot", "Z88 Cartr
//-------------------------------------------------
device_z88cart_interface::device_z88cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "z88cart")
{
}
@@ -58,7 +58,7 @@ device_z88cart_interface::~device_z88cart_interface()
z88cart_slot_device::z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, Z88CART_SLOT, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_z88cart_interface>(mconfig, *this)
, m_out_flp_cb(*this)
, m_cart(nullptr)
, m_flp_timer(nullptr)
@@ -71,7 +71,7 @@ z88cart_slot_device::z88cart_slot_device(const machine_config &mconfig, const ch
void z88cart_slot_device::device_start()
{
- m_cart = dynamic_cast<device_z88cart_interface *>(get_card_device());
+ m_cart = get_card_device();
// resolve callbacks
m_out_flp_cb.resolve_safe();
diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h
index 444eeb3c111..e239a48f8e0 100644
--- a/src/devices/bus/z88/z88.h
+++ b/src/devices/bus/z88/z88.h
@@ -65,7 +65,7 @@
// ======================> device_z88cart_interface
-class device_z88cart_interface : public device_slot_card_interface
+class device_z88cart_interface : public device_interface
{
public:
// construction/destruction
@@ -86,7 +86,7 @@ protected:
class z88cart_slot_device : public device_t,
public device_image_interface,
- public device_slot_interface
+ public device_single_card_slot_interface<device_z88cart_interface>
{
public:
// construction/destruction
diff --git a/src/devices/cpu/alto2/a2emu.cpp b/src/devices/cpu/alto2/a2emu.cpp
index a7ea40a6aca..22aaaadcb68 100644
--- a/src/devices/cpu/alto2/a2emu.cpp
+++ b/src/devices/cpu/alto2/a2emu.cpp
@@ -267,13 +267,13 @@ void alto2_cpu_device::f1_early_emu_block()
CPU_CLR_TASK_WAKEUP(m_task);
LOG((this,LOG_EMU,2, " BLOCK %02o:%s\n", m_task, task_name(m_task)));
#elif 0
- fatal(1, "Emulator task want's to BLOCK.\n" \
- "%s-%04o: r:%02o af:%02o bs:%02o f1:%02o f2:%02o" \
- " t:%o l:%o next:%05o next2:%05o cycle:%lld\n",
- task_name(m_task), m_mpc,
- m_rsel, m_daluf, m_dbs, m_df1, mdf2,
- m_dloadt, m_dloatl, m_next, m_next2,
- ntime() / CPU_MICROCYCLE_TIME);
+ throw emu_fatalerror(1, "Emulator task want's to BLOCK.\n" \
+ "%s-%04o: r:%02o af:%02o bs:%02o f1:%02o f2:%02o" \
+ " t:%o l:%o next:%05o next2:%05o cycle:%lld\n",
+ task_name(m_task), m_mpc,
+ m_rsel, m_daluf, m_dbs, m_df1, mdf2,
+ m_dloadt, m_dloatl, m_next, m_next2,
+ ntime() / CPU_MICROCYCLE_TIME);
#else
/* just ignore (?) */
#endif
diff --git a/src/devices/cpu/alto2/a2ram.cpp b/src/devices/cpu/alto2/a2ram.cpp
index 3aab054871d..a9babb97900 100644
--- a/src/devices/cpu/alto2/a2ram.cpp
+++ b/src/devices/cpu/alto2/a2ram.cpp
@@ -246,7 +246,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_ROM("RAM0", 0);
break;
default:
- fatal(1, "Impossible current mpc %u\n", page);
+ throw emu_fatalerror(1, "Impossible current mpc %u\n", page);
}
break;
@@ -262,7 +262,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_ROM("ROM0", 1);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
case 1: /* ROM1 to ROM0 or RAM0 */
@@ -274,7 +274,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_RAM("ROM1", 0);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
case 2: /* RAM0 to ROM0 or ROM1 */
@@ -286,11 +286,11 @@ void alto2_cpu_device::f1_late_swmode()
branch_ROM("RAM0", 1);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
default:
- fatal(1, "Impossible current mpc %u\n", page);
+ throw emu_fatalerror(1, "Impossible current mpc %u\n", page);
}
break;
@@ -313,7 +313,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_RAM("ROM0", 0);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
case 1: /* RAM0 to ROM0, RAM2, RAM1, RAM1 */
@@ -331,7 +331,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_RAM("RAM0", 1);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
case 2: /* RAM1 to ROM0, RAM2, RAM0, RAM0 */
@@ -349,7 +349,7 @@ void alto2_cpu_device::f1_late_swmode()
branch_RAM("RAM1", 0);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
case 3: /* RAM2 to ROM0, RAM1, RAM0, RAM0 */
@@ -367,15 +367,15 @@ void alto2_cpu_device::f1_late_swmode()
branch_RAM("RAM2", 0);
break;
default:
- fatal(1, "Impossible next %u\n", next);
+ throw emu_fatalerror(1, "Impossible next %u\n", next);
}
break;
default:
- fatal(1, "Impossible current mpc %u\n", page);
+ throw emu_fatalerror(1, "Impossible current mpc %u\n", page);
}
break;
default:
- fatal(1, "Impossible control ROM/RAM config %u (%u CROM pages, %u CRAM pages)\n",
+ throw emu_fatalerror(1, "Impossible control ROM/RAM config %u (%u CROM pages, %u CRAM pages)\n",
m_cram_config, m_ucode_rom_pages, m_ucode_ram_pages);
}
}
diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp
index 57ed58ddc03..bffe5071192 100644
--- a/src/devices/cpu/alto2/alto2cpu.cpp
+++ b/src/devices/cpu/alto2/alto2cpu.cpp
@@ -1093,14 +1093,6 @@ void alto2_cpu_device::execute_set_input(int inputnum, int state)
{
}
-void alto2_cpu_device::fatal(int exitcode, const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- emu_fatalerror error(exitcode, format, ap);
- va_end(ap);
-}
-
/** @brief task names */
const char* alto2_cpu_device::task_name(int task)
{
@@ -1268,42 +1260,42 @@ void alto2_cpu_device::watch_write(uint32_t addr, uint32_t data)
/** @brief fatal exit on unitialized dynamic phase BUS source */
void alto2_cpu_device::bs_early_bad()
{
- fatal(9,"fatal: bad early bus source pointer for task %s, mpc:%05o bs:%s\n",
- task_name(m_task), m_mpc, bs_name(bs()));
+ throw emu_fatalerror(9,"fatal: bad early bus source pointer for task %s, mpc:%05o bs:%s\n",
+ task_name(m_task), m_mpc, bs_name(bs()));
}
/** @brief fatal exit on unitialized latching phase BUS source */
void alto2_cpu_device::bs_late_bad()
{
- fatal(9,"fatal: bad late bus source pointer for task %s, mpc:%05o bs: %s\n",
- task_name(m_task), m_mpc, bs_name(bs()));
+ throw emu_fatalerror(9,"fatal: bad late bus source pointer for task %s, mpc:%05o bs: %s\n",
+ task_name(m_task), m_mpc, bs_name(bs()));
}
/** @brief fatal exit on unitialized dynamic phase F1 function */
void alto2_cpu_device::f1_early_bad()
{
- fatal(9,"fatal: bad early f1 function pointer for task %s, mpc:%05o f1: %s\n",
- task_name(m_task), m_mpc, f1_name(f1()));
+ throw emu_fatalerror(9,"fatal: bad early f1 function pointer for task %s, mpc:%05o f1: %s\n",
+ task_name(m_task), m_mpc, f1_name(f1()));
}
/** @brief fatal exit on unitialized latching phase F1 function */
void alto2_cpu_device::f1_late_bad()
{
- fatal(9,"fatal: bad late f1 function pointer for task %s, mpc:%05o f1: %s\n",
- task_name(m_task), m_mpc, f1_name(f1()));
+ throw emu_fatalerror(9,"fatal: bad late f1 function pointer for task %s, mpc:%05o f1: %s\n",
+ task_name(m_task), m_mpc, f1_name(f1()));
}
/** @brief fatal exit on unitialized dynamic phase F2 function */
void alto2_cpu_device::f2_early_bad()
{
- fatal(9,"fatal: bad early f2 function pointer for task %s, mpc:%05o f2: %s\n",
- task_name(m_task), m_mpc, f2_name(f2()));
+ throw emu_fatalerror(9,"fatal: bad early f2 function pointer for task %s, mpc:%05o f2: %s\n",
+ task_name(m_task), m_mpc, f2_name(f2()));
}
/** @brief fatal exit on unitialized latching phase F2 function */
void alto2_cpu_device::f2_late_bad()
{
- fatal(9,"fatal: bad late f2 function pointer for task %s, mpc:%05o f2: %s\n",
+ throw emu_fatalerror(9,"fatal: bad late f2 function pointer for task %s, mpc:%05o f2: %s\n",
task_name(m_task), m_mpc, f2_name(f2()));
}
@@ -1768,7 +1760,7 @@ void alto2_cpu_device::f1_early_task()
return;
}
}
- fatal(3, "no tasks requesting service\n");
+ throw emu_fatalerror(3, "no tasks requesting service\n");
#endif /* !USE_PRIO_F9318 */
}
diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h
index e0fbc075895..c701ab59a77 100644
--- a/src/devices/cpu/alto2/alto2cpu.h
+++ b/src/devices/cpu/alto2/alto2cpu.h
@@ -235,8 +235,6 @@ protected:
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
private:
- void fatal(int level, const char *format, ...);
-
devcb_read16 m_kb_read_callback;
devcb_write16 m_utilout_callback;
@@ -868,14 +866,14 @@ private:
void hard_reset(); //!< reset the various registers
void soft_reset(); //!< soft reset
- void bs_early_bad(); //! bs dummy early function
- void bs_late_bad(); //! bs dummy late function
+ [[noreturn]] void bs_early_bad(); //! bs dummy early function
+ [[noreturn]] void bs_late_bad(); //! bs dummy late function
- void f1_early_bad(); //! f1 dummy early function
- void f1_late_bad(); //! f1 dummy late function
+ [[noreturn]] void f1_early_bad(); //! f1 dummy early function
+ [[noreturn]] void f1_late_bad(); //! f1 dummy late function
- void f2_early_bad(); //! f2 dummy early function
- void f2_late_bad(); //! f2 dummy late function
+ [[noreturn]] void f2_early_bad(); //! f2 dummy early function
+ [[noreturn]] void f2_late_bad(); //! f2 dummy late function
DECLARE_READ16_MEMBER( noop_r ); //!< read open bus (0177777)
DECLARE_WRITE16_MEMBER( noop_w ); //!< write open bus
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 60058681549..f725845fa0d 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -176,7 +176,6 @@ floppy_image_device *floppy_connector::get_device()
floppy_image_device::floppy_image_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_card_interface(mconfig, *this),
input_format(nullptr),
output_format(nullptr),
image(nullptr),
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index c2380d6d02b..760cdc30a21 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -54,8 +54,7 @@ class floppy_sound_device;
***************************************************************************/
class floppy_image_device : public device_t,
- public device_image_interface,
- public device_slot_card_interface
+ public device_image_interface
{
public:
typedef delegate<image_init_result (floppy_image_device *)> load_cb;
diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp
index 1d6d3574c07..eb953e72eaf 100644
--- a/src/devices/imagedev/mfmhd.cpp
+++ b/src/devices/imagedev/mfmhd.cpp
@@ -309,7 +309,6 @@ std::string mfm_harddisk_device::tts(const attotime &t)
mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: harddisk_image_device(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this),
m_index_timer(nullptr),
m_spinup_timer(nullptr),
m_seek_timer(nullptr),
diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h
index a46dab519b7..2d689a168cb 100644
--- a/src/devices/imagedev/mfmhd.h
+++ b/src/devices/imagedev/mfmhd.h
@@ -48,8 +48,7 @@ private:
running_machine & m_machine;
};
-class mfm_harddisk_device : public harddisk_image_device,
- public device_slot_card_interface
+class mfm_harddisk_device : public harddisk_image_device
{
public:
~mfm_harddisk_device();
diff --git a/src/devices/machine/ataflash.cpp b/src/devices/machine/ataflash.cpp
index 392d07b465e..4ab3099f330 100644
--- a/src/devices/machine/ataflash.cpp
+++ b/src/devices/machine/ataflash.cpp
@@ -5,13 +5,14 @@
DEFINE_DEVICE_TYPE(ATA_FLASH_PCCARD, ata_flash_pccard_device, "ataflash", "ATA Flash PC Card")
-ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- ata_flash_pccard_device(mconfig, ATA_FLASH_PCCARD, tag, owner, clock)
+ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ata_flash_pccard_device(mconfig, ATA_FLASH_PCCARD, tag, owner, clock)
{
}
ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: ide_hdd_device(mconfig, type, tag, owner, clock)
+ , device_pccard_interface(mconfig, *this)
{
}
@@ -80,7 +81,7 @@ READ16_MEMBER( ata_flash_pccard_device::read_reg )
return m_cis[offset];
}
- return pccard_interface::read_reg(space, offset, mem_mask);
+ return device_pccard_interface::read_reg(space, offset, mem_mask);
}
WRITE16_MEMBER( ata_flash_pccard_device::write_reg )
@@ -106,7 +107,7 @@ WRITE16_MEMBER( ata_flash_pccard_device::write_reg )
break;
default:
- pccard_interface::write_reg(space, offset, data, mem_mask);
+ device_pccard_interface::write_reg(space, offset, data, mem_mask);
break;
}
}
diff --git a/src/devices/machine/ataflash.h b/src/devices/machine/ataflash.h
index 4df9e1f0352..9bd5581f0e9 100644
--- a/src/devices/machine/ataflash.h
+++ b/src/devices/machine/ataflash.h
@@ -10,7 +10,7 @@
DECLARE_DEVICE_TYPE(ATA_FLASH_PCCARD, ata_flash_pccard_device)
-class ata_flash_pccard_device : public ide_hdd_device, public pccard_interface
+class ata_flash_pccard_device : public ide_hdd_device, public device_pccard_interface
{
public:
ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/machine/linflash.cpp b/src/devices/machine/linflash.cpp
index 218bd94afa5..5b2d3673857 100644
--- a/src/devices/machine/linflash.cpp
+++ b/src/devices/machine/linflash.cpp
@@ -10,8 +10,8 @@ DEFINE_DEVICE_TYPE(LINEAR_FLASH_PCCARD_64MB, linear_flash_pccard_64mb_device, "l
linear_flash_pccard_device::linear_flash_pccard_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_pccard_interface(mconfig, *this),
device_memory_interface(mconfig, *this),
- device_slot_card_interface(mconfig, *this),
m_space(nullptr)
{
}
@@ -23,9 +23,7 @@ void linear_flash_pccard_device::device_start()
device_memory_interface::space_config_vector linear_flash_pccard_device::memory_space_config() const
{
- return space_config_vector {
- std::make_pair(0, &m_space_config)
- };
+ return space_config_vector{ std::make_pair(0, &m_space_config) };
}
READ16_MEMBER( linear_flash_pccard_device::read_memory )
diff --git a/src/devices/machine/linflash.h b/src/devices/machine/linflash.h
index 1df866825bd..2dac02c75b2 100644
--- a/src/devices/machine/linflash.h
+++ b/src/devices/machine/linflash.h
@@ -9,9 +9,8 @@
#include "machine/pccard.h"
class linear_flash_pccard_device : public device_t,
- public pccard_interface,
- public device_memory_interface,
- public device_slot_card_interface
+ public device_pccard_interface,
+ public device_memory_interface
{
public:
virtual DECLARE_READ16_MEMBER(read_memory) override;
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index fcf94d6e3f7..c6c0083e162 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -1102,7 +1102,7 @@ plib::unique_ptr<netlist::netlist_t> netlist_mame_device::base_validity_check(va
}
catch (emu_fatalerror &err)
{
- osd_printf_error("%s\n", err.string());
+ osd_printf_error("%s\n", err.what());
}
catch (std::exception &err)
{
diff --git a/src/devices/machine/nscsi_bus.cpp b/src/devices/machine/nscsi_bus.cpp
index c2274f49c95..489a5b6f171 100644
--- a/src/devices/machine/nscsi_bus.cpp
+++ b/src/devices/machine/nscsi_bus.cpp
@@ -141,7 +141,7 @@ void nscsi_bus_device::device_resolve_objects()
nscsi_connector::nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, NSCSI_CONNECTOR, tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_single_card_slot_interface<nscsi_slot_card_interface>(mconfig, *this)
{
}
@@ -149,20 +149,13 @@ nscsi_connector::~nscsi_connector()
{
}
-void nscsi_connector::device_validity_check(validity_checker &valid) const
-{
- device_t *const carddev = get_card_device();
- if (carddev && !dynamic_cast<nscsi_slot_card_interface *>(carddev))
- osd_printf_error("Card device %s (%s) does not implement nscsi_slot_card_interface\n", carddev->tag(), carddev->name());
-}
-
void nscsi_connector::device_start()
{
}
nscsi_device *nscsi_connector::get_device()
{
- nscsi_slot_card_interface *connected = dynamic_cast<nscsi_slot_card_interface *>(get_card_device());
+ nscsi_slot_card_interface *const connected = get_card_device();
if (connected)
return connected->device().subdevice<nscsi_device>(connected->m_nscsi.finder_tag());
else
@@ -170,7 +163,7 @@ nscsi_device *nscsi_connector::get_device()
}
nscsi_slot_card_interface::nscsi_slot_card_interface(const machine_config &mconfig, device_t &device, const char *nscsi_tag) :
- device_slot_card_interface(mconfig, device),
+ device_interface(device, "nscsi"),
m_nscsi(device, nscsi_tag)
{
}
diff --git a/src/devices/machine/nscsi_bus.h b/src/devices/machine/nscsi_bus.h
index 6ee65f470c7..60c9f02a3b1 100644
--- a/src/devices/machine/nscsi_bus.h
+++ b/src/devices/machine/nscsi_bus.h
@@ -7,6 +7,7 @@
class nscsi_device;
+class nscsi_slot_card_interface;
class nscsi_bus_device : public device_t
{
@@ -42,7 +43,7 @@ private:
};
class nscsi_connector: public device_t,
- public device_slot_interface
+ public device_single_card_slot_interface<nscsi_slot_card_interface>
{
public:
template <typename T>
@@ -60,11 +61,10 @@ public:
nscsi_device *get_device();
protected:
- virtual void device_validity_check(validity_checker &valid) const override;
virtual void device_start() override;
};
-class nscsi_slot_card_interface : public device_slot_card_interface
+class nscsi_slot_card_interface : public device_interface
{
friend class nscsi_connector;
diff --git a/src/devices/machine/pccard.cpp b/src/devices/machine/pccard.cpp
index 6f8c177ef4e..87ae0b4c8e0 100644
--- a/src/devices/machine/pccard.cpp
+++ b/src/devices/machine/pccard.cpp
@@ -3,79 +3,84 @@
#include "emu.h"
#include "pccard.h"
-READ16_MEMBER( pccard_interface::read_memory )
+//#define VERBOSE 1
+#include "logmacro.h"
+
+
+device_pccard_interface::device_pccard_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "pccard")
+{
+}
+
+READ16_MEMBER( device_pccard_interface::read_memory )
{
- //printf("unhandled memory read %08x %04x\n", offset, mem_mask);
+ if (VERBOSE & LOG_GENERAL)
+ device().logerror("unhandled memory read %08x %04x\n", offset, mem_mask);
return 0xffff;
}
-WRITE16_MEMBER( pccard_interface::write_memory )
+WRITE16_MEMBER( device_pccard_interface::write_memory )
{
- //printf("unhandled memory write %08x %04x %04x\n", offset, data, mem_mask);
+ if (VERBOSE & LOG_GENERAL)
+ device().logerror("unhandled memory write %08x %04x %04x\n", offset, data, mem_mask);
}
-READ16_MEMBER( pccard_interface::read_reg )
+READ16_MEMBER( device_pccard_interface::read_reg )
{
- //printf("unhandled register read %08x %04x\n", offset, mem_mask);
+ if (VERBOSE & LOG_GENERAL)
+ device().logerror("unhandled register read %08x %04x\n", offset, mem_mask);
return 0xffff;
}
-WRITE16_MEMBER( pccard_interface::write_reg )
+WRITE16_MEMBER( device_pccard_interface::write_reg )
{
- //printf("unhandled register write %08x %04x %04x\n", offset, data, mem_mask);
+ if (VERBOSE & LOG_GENERAL)
+ device().logerror("unhandled register write %08x %04x %04x\n", offset, data, mem_mask);
}
DEFINE_DEVICE_TYPE(PCCARD_SLOT, pccard_slot_device, "pccard", "PC Card Slot")
pccard_slot_device::pccard_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PCCARD_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_pccard_interface>(mconfig, *this),
m_pccard(nullptr)
{
}
void pccard_slot_device::device_start()
{
- m_pccard = dynamic_cast<pccard_interface *>(get_card_device());
+ m_pccard = get_card_device();
}
READ_LINE_MEMBER(pccard_slot_device::read_line_inserted)
{
- return m_pccard != nullptr;
+ return m_pccard ? 1 : 0;
}
READ16_MEMBER( pccard_slot_device::read_memory )
{
- if( m_pccard != nullptr )
- {
- return m_pccard->read_memory( space, offset, mem_mask );
- }
-
- return 0xffff;
+ if (m_pccard)
+ return m_pccard->read_memory(space, offset, mem_mask);
+ else
+ return 0xffff;
}
WRITE16_MEMBER( pccard_slot_device::write_memory )
{
- if( m_pccard != nullptr )
- {
- m_pccard->write_memory( space, offset, data, mem_mask );
- }
+ if (m_pccard)
+ m_pccard->write_memory(space, offset, data, mem_mask);
}
READ16_MEMBER( pccard_slot_device::read_reg )
{
- if( m_pccard != nullptr )
- {
- return m_pccard->read_reg( space, offset, mem_mask );
- }
-
- return 0xffff;
+ if (m_pccard)
+ return m_pccard->read_reg(space, offset, mem_mask);
+ else
+ return 0xffff;
}
WRITE16_MEMBER( pccard_slot_device::write_reg )
{
- if( m_pccard != nullptr )
- {
- m_pccard->write_reg( space, offset, data, mem_mask );
- }
+ if (m_pccard)
+ m_pccard->write_reg(space, offset, data, mem_mask);
}
diff --git a/src/devices/machine/pccard.h b/src/devices/machine/pccard.h
index eaef2b92aaa..c223f0587b4 100644
--- a/src/devices/machine/pccard.h
+++ b/src/devices/machine/pccard.h
@@ -6,7 +6,7 @@
#pragma once
-class pccard_interface
+class device_pccard_interface : public device_interface
{
public:
virtual DECLARE_READ16_MEMBER(read_memory);
@@ -14,12 +14,15 @@ public:
virtual DECLARE_WRITE16_MEMBER(write_memory);
virtual DECLARE_WRITE16_MEMBER(write_reg);
- virtual ~pccard_interface() {}
+ virtual ~device_pccard_interface() {}
+
+protected:
+ device_pccard_interface(const machine_config &mconfig, device_t &device);
};
DECLARE_DEVICE_TYPE(PCCARD_SLOT, pccard_slot_device)
-class pccard_slot_device : public device_t, public device_slot_interface
+class pccard_slot_device : public device_t, public device_single_card_slot_interface<device_pccard_interface>
{
public:
template <typename T>
@@ -44,7 +47,7 @@ protected:
private:
// internal state
- pccard_interface *m_pccard;
+ device_pccard_interface *m_pccard;
};
#endif // MAME_MACHINE_PCCARD_H
diff --git a/src/devices/machine/smioc.cpp b/src/devices/machine/smioc.cpp
index 3a426e8405b..65616c82a0a 100644
--- a/src/devices/machine/smioc.cpp
+++ b/src/devices/machine/smioc.cpp
@@ -140,7 +140,7 @@ void smioc_device::device_add_mconfig(machine_config &config)
{
/* CPU - Intel 80C188 */
I80188(config, m_smioccpu, XTAL(20'000'000)); // Clock division unknown
- config.m_minimum_quantum = attotime::from_hz(1000);
+ config.set_maximum_quantum(attotime::from_hz(1000));
m_smioccpu->set_addrmap(AS_PROGRAM, &smioc_device::smioc_mem);
/* DMA */
diff --git a/src/emu/dislot.cpp b/src/emu/dislot.cpp
index e5bb4cff0d3..9e8a5128996 100644
--- a/src/emu/dislot.cpp
+++ b/src/emu/dislot.cpp
@@ -11,10 +11,6 @@
#include "zippath.h"
-// -------------------------------------------------
-// ctor
-// -------------------------------------------------
-
device_slot_interface::device_slot_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "slot"),
m_default_clock(DERIVED_CLOCK(1, 1)),
@@ -24,20 +20,11 @@ device_slot_interface::device_slot_interface(const machine_config &mconfig, devi
{
}
-
-// -------------------------------------------------
-// dtor
-// -------------------------------------------------
-
device_slot_interface::~device_slot_interface()
{
}
-// -------------------------------------------------
-// device_slot_option ctor
-// -------------------------------------------------
-
device_slot_interface::slot_option::slot_option(const char *name, const device_type &devtype, bool selectable) :
m_name(name),
m_devtype(devtype),
@@ -50,44 +37,39 @@ device_slot_interface::slot_option::slot_option(const char *name, const device_t
}
-// -------------------------------------------------
-// option_add
-// -------------------------------------------------
+void device_slot_interface::interface_validity_check(validity_checker &valid) const
+{
+ if (m_default_option && (m_options.find(m_default_option) == m_options.end()))
+ osd_printf_error("Default option '%s' does not correspond to any configured option\n", m_default_option);
+}
+
device_slot_interface::slot_option &device_slot_interface::option_add(const char *name, const device_type &devtype)
{
+ if (!name || !*name)
+ throw emu_fatalerror("slot '%s' attempt to add option without name\n", device().tag());
+
const slot_option *const existing = option(name);
if (existing)
throw emu_fatalerror("slot '%s' duplicate option '%s'\n", device().tag(), name);
- if (m_options.count(name))
- throw tag_add_exception(name);
-
return m_options.emplace(name, std::make_unique<slot_option>(name, devtype, true)).first->second->clock(m_default_clock);
}
-// -------------------------------------------------
-// option_add_internal
-// -------------------------------------------------
-
device_slot_interface::slot_option &device_slot_interface::option_add_internal(const char *name, const device_type &devtype)
{
+ if (!name || !*name)
+ throw emu_fatalerror("slot '%s' attempt to add option without name\n", device().tag());
+
const slot_option *const existing = option(name);
if (existing)
throw emu_fatalerror("slot '%s' duplicate option '%s'\n", device().tag(), name);
- if (m_options.count(name))
- throw tag_add_exception(name);
-
return m_options.emplace(name, std::make_unique<slot_option>(name, devtype, false)).first->second->clock(m_default_clock);
}
-// -------------------------------------------------
-// option
-// -------------------------------------------------
-
device_slot_interface::slot_option *device_slot_interface::config_option(const char *name)
{
auto const search = m_options.find(name);
@@ -98,10 +80,6 @@ device_slot_interface::slot_option *device_slot_interface::config_option(const c
}
-// -------------------------------------------------
-// has_selectable_options
-// -------------------------------------------------
-
bool device_slot_interface::has_selectable_options() const
{
if (!fixed())
@@ -114,10 +92,6 @@ bool device_slot_interface::has_selectable_options() const
}
-// -------------------------------------------------
-// option
-// -------------------------------------------------
-
const device_slot_interface::slot_option *device_slot_interface::option(const char *name) const
{
if (name)
@@ -130,15 +104,6 @@ const device_slot_interface::slot_option *device_slot_interface::option(const ch
}
-device_slot_card_interface::device_slot_card_interface(const machine_config &mconfig, device_t &device)
- : device_interface(device, "slot")
-{
-}
-
-device_slot_card_interface::~device_slot_card_interface()
-{
-}
-
get_default_card_software_hook::get_default_card_software_hook(const std::string &path, std::function<bool(util::core_file &, std::string&)> &&get_hashfile_extrainfo)
: m_get_hashfile_extrainfo(std::move(get_hashfile_extrainfo))
, m_called_get_hashfile_extrainfo(false)
diff --git a/src/emu/dislot.h b/src/emu/dislot.h
index da6a1b0aa3d..a88102f84e5 100644
--- a/src/emu/dislot.h
+++ b/src/emu/dislot.h
@@ -9,13 +9,10 @@
#ifndef MAME_EMU_DISLOT_H
#define MAME_EMU_DISLOT_H
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> get_default_card_software_hook
-
class get_default_card_software_hook
{
// goofy "hook" to pass to device_slot_interface::get_default_card_software
@@ -42,8 +39,7 @@ private:
};
-// ======================> device_slot_interface
-
+/// \brief Base class for configurable slot devices
class device_slot_interface : public device_interface
{
public:
@@ -77,20 +73,88 @@ public:
u32 m_clock;
};
- // construction/destruction
- device_slot_interface(const machine_config &mconfig, device_t &device);
virtual ~device_slot_interface();
+ /// \brief Set whether slot is fixed
+ ///
+ /// Allows a slot to be configured as fixed. Fixed slots can only
+ /// be configured programmatically. Options for fixed slots are not
+ /// user-selectable. By default, slots are not fixed.
+ /// \param [in] fixed True to mark the slot as fixed, or false to
+ /// mark it user-configurable.
+ /// \sa fixed
void set_fixed(bool fixed) { m_fixed = fixed; }
+
+ /// \brief Set the default option
+ ///
+ /// Set the default option the slot. The corresponding card device
+ /// will be loaded if no other option is selected by the user or
+ /// programmatically.
+ /// \param [in] option The name of the default option. This must be
+ /// correspond to an option added using #option_add or
+ /// #option_add_internal, or be nullptr to not load any card
+ /// device by default. The string is not copied and must remain
+ /// valid for the lifetime of the device (or until another default
+ /// option is configured).
+ /// \sa default_option
void set_default_option(const char *option) { m_default_option = option; }
+
+ /// \brief Clear options
+ ///
+ /// This removes all previously added options.
void option_reset() { m_options.clear(); }
- slot_option &option_add(const char *option, const device_type &devtype);
+
+ /// \brief Add a user-selectable option
+ ///
+ /// Adds an option that may be selected by the user via the command
+ /// line or other configureation methods.
+ /// \param [in] option The name used to select the option. This
+ /// will also be used as the tag when instantiating the card. It
+ /// must be a valid device tag, and should be terse but
+ /// descriptive. The string is copied when the option is added.
+ /// \param [in] devtype Device type of the option. The device type
+ /// description is used in the user interface.
+ /// \return A reference to the added option for additional
+ /// configuration.
+ slot_option &option_add(char const *option, const device_type &devtype);
+
+ /// \brief Add an internal option
+ ///
+ /// Adds an option that may only be selected programmatically. This
+ /// is most often used for options used for loading software.
+ /// \param [in] option The name used to select the option. This
+ /// will also be used as the tag when instantiating the card. It
+ /// must be a valid device tag. The string is copied when the
+ /// option is added.
+ /// \param [in] devtype Device type of the option. The device type
+ /// description is used in the user interface.
+ /// \return A reference to the added option for additional
+ /// configuration.
slot_option &option_add_internal(const char *option, const device_type &devtype);
+
void set_option_default_bios(const char *option, const char *default_bios) { config_option(option)->default_bios(default_bios); }
template <typename T> void set_option_machine_config(const char *option, T &&machine_config) { config_option(option)->machine_config(std::forward<T>(machine_config)); }
void set_option_device_input_defaults(const char *option, const input_device_default *default_input) { config_option(option)->input_device_defaults(default_input); }
+
+ /// \brief Returns whether the slot is fixed
+ ///
+ /// Fixed slots can only be configured programmatically. Slots are
+ /// not fixed by default.
+ /// \return True if the slot is fixed, or false if it is
+ /// user-configurable.
+ /// \sa set_fixed
bool fixed() const { return m_fixed; }
+
+ /// \brief Returns true if the slot has user-selectable options
+ ///
+ /// Returns true if the slot is not marked as fixed and has at least
+ /// one user-selectable option (added using #option_add rather than
+ /// #option_add_internal). Returns false if the slot is marked as
+ /// fixed, all options are internal, or there are no options.
+ /// \return True if the slot has user-selectable options, or false
+ /// otherwise.
bool has_selectable_options() const;
+
const char *default_option() const { return m_default_option; }
const std::unordered_map<std::string, std::unique_ptr<slot_option>> &option_list() const { return m_options; }
const slot_option *option(const char *name) const;
@@ -101,30 +165,68 @@ public:
slot_option &option_set(const char *tag, const device_type &devtype) { m_default_option = tag; m_fixed = true; return option_add_internal(tag, devtype); }
protected:
+ device_slot_interface(machine_config const &mconfig, device_t &device);
+ virtual void interface_validity_check(validity_checker &valid) const override ATTR_COLD;
void set_default_clock(u32 clock) { m_default_clock = clock; }
private:
// internal state
- std::unordered_map<std::string,std::unique_ptr<slot_option>> m_options;
+ std::unordered_map<std::string, std::unique_ptr<slot_option>> m_options;
u32 m_default_clock;
- const char *m_default_option;
+ char const *m_default_option;
bool m_fixed;
device_t *m_card_device;
- slot_option *config_option(const char *option);
+ slot_option *config_option(char const *option);
};
-// iterator
-typedef device_interface_iterator<device_slot_interface> slot_interface_iterator;
-
-// ======================> device_slot_card_interface
-class device_slot_card_interface : public device_interface
+/// \brief Base class for slots that accept a single card interface
+///
+/// Performs basic validity checks to ensure the configured card (if
+/// any) implements the required interface.
+template <typename Card>
+class device_single_card_slot_interface : public device_slot_interface
{
public:
- // construction/destruction
- device_slot_card_interface(const machine_config &mconfig, device_t &device);
- virtual ~device_slot_card_interface();
+ Card *get_card_device() const { return dynamic_cast<Card *>(device_slot_interface::get_card_device()); }
+
+protected:
+ device_single_card_slot_interface(machine_config const &mconfig, device_t &device) :
+ device_slot_interface(mconfig, device)
+ {
+ }
+
+ virtual void interface_validity_check(validity_checker &valid) const override ATTR_COLD
+ {
+ device_slot_interface::interface_validity_check(valid);
+ device_t *const card(device_slot_interface::get_card_device());
+ if (card && !dynamic_cast<Card *>(card))
+ {
+ osd_printf_error(
+ "Card device %s (%s) does not implement %s\n",
+ card->tag(),
+ card->name(),
+ typeid(Card).name());
+ }
+ }
+
+ virtual void interface_pre_start() override ATTR_COLD
+ {
+ device_slot_interface::interface_pre_start();
+ device_t *const card(device_slot_interface::get_card_device());
+ if (card && !dynamic_cast<Card *>(card))
+ {
+ throw emu_fatalerror(
+ "slot '%s' card device %s (%s) does not implement %s\n",
+ device().tag(),
+ card->tag(),
+ card->name(),
+ typeid(Card).name());
+ }
+ }
};
-#endif /* MAME_EMU_DISLOT_H */
+typedef device_interface_iterator<device_slot_interface> slot_interface_iterator;
+
+#endif // MAME_EMU_DISLOT_H
diff --git a/src/emu/emucore.cpp b/src/emu/emucore.cpp
index 35256b4f364..689d5fa1c37 100644
--- a/src/emu/emucore.cpp
+++ b/src/emu/emucore.cpp
@@ -14,60 +14,16 @@
const char *const endianness_names[2] = { "little", "big" };
-emu_fatalerror::emu_fatalerror(const char *format, ...) : code(0)
+emu_fatalerror::emu_fatalerror(util::format_argument_pack<std::ostream> const &args)
+ : emu_fatalerror(0, args)
{
- if (format == nullptr)
- {
- text[0] = '\0';
- }
- else
- {
- va_list ap;
- va_start(ap, format);
- vsnprintf(text, sizeof(text), format, ap);
- va_end(ap);
- }
- osd_break_into_debugger(text);
+ osd_break_into_debugger(m_text.c_str());
}
-emu_fatalerror::emu_fatalerror(const char *format, va_list ap) : code(0)
+emu_fatalerror::emu_fatalerror(int _exitcode, util::format_argument_pack<std::ostream> const &args)
+ : m_text(util::string_format(args))
+ , m_code(_exitcode)
{
- if (format == nullptr)
- {
- text[0] = '\0';
- }
- else
- {
- vsnprintf(text, sizeof(text), format, ap);
- }
- osd_break_into_debugger(text);
-}
-
-emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, ...) : code(_exitcode)
-{
- if (format == nullptr)
- {
- text[0] = '\0';
- }
- else
- {
- va_list ap;
- va_start(ap, format);
- vsnprintf(text, sizeof(text), format, ap);
- va_end(ap);
- }
-}
-
-emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, va_list ap) : code(_exitcode)
-{
- if (format == nullptr)
- {
- text[0] = '\0';
- }
- else
- {
- vsnprintf(text, sizeof(text), format, ap);
- }
}
@@ -82,21 +38,3 @@ void report_bad_device_cast(const device_t *dev, const std::type_info &src_type,
throw emu_fatalerror("Error: bad downcast<> or device<>. Tried to convert the device %s (%s) of type %s to a %s, which are incompatible.\n",
dev->tag(), dev->name(), src_type.name(), dst_type.name());
}
-
-void fatalerror(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- emu_fatalerror error(format, ap);
- va_end(ap);
- throw error;
-}
-
-void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- emu_fatalerror error(exitcode, format, ap);
- va_end(ap);
- throw error;
-}
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 92135e7ae84..ef6713c8d8f 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -29,6 +29,7 @@
// standard C++ includes
#include <cassert>
#include <exception>
+#include <string>
#include <type_traits>
#include <typeinfo>
@@ -37,6 +38,7 @@
#include "emualloc.h"
#include "corestr.h"
#include "bitmap.h"
+#include "strformat.h"
#include "emufwd.h"
@@ -247,17 +249,26 @@ class emu_exception : public std::exception { };
class emu_fatalerror : public emu_exception
{
public:
- emu_fatalerror(const char *format, ...) ATTR_PRINTF(2,3);
- emu_fatalerror(const char *format, va_list ap);
- emu_fatalerror(int _exitcode, const char *format, ...) ATTR_PRINTF(3,4);
- emu_fatalerror(int _exitcode, const char *format, va_list ap);
-
- const char *string() const { return text; }
- int exitcode() const { return code; }
+ emu_fatalerror(util::format_argument_pack<std::ostream> const &args);
+ emu_fatalerror(int _exitcode, util::format_argument_pack<std::ostream> const &args);
+
+ template <typename Format, typename... Params>
+ emu_fatalerror(Format const &fmt, Params &&... args)
+ : emu_fatalerror(static_cast<util::format_argument_pack<std::ostream> const &>(util::make_format_argument_pack(fmt, std::forward<Params>(args)...)))
+ {
+ }
+ template <typename Format, typename... Params>
+ emu_fatalerror(int _exitcode, Format const &fmt, Params &&... args)
+ : emu_fatalerror(_exitcode, static_cast<util::format_argument_pack<std::ostream> const &>(util::make_format_argument_pack(fmt, std::forward<Params>(args)...)))
+ {
+ }
+
+ virtual char const *what() const noexcept override { return m_text.c_str(); }
+ int exitcode() const noexcept { return m_code; }
private:
- char text[1024];
- int code;
+ std::string m_text;
+ int m_code;
};
class tag_add_exception
@@ -269,12 +280,13 @@ private:
std::string m_tag;
};
+
//**************************************************************************
// CASTING TEMPLATES
//**************************************************************************
-void report_bad_cast(const std::type_info &src_type, const std::type_info &dst_type);
-void report_bad_device_cast(const device_t *dev, const std::type_info &src_type, const std::type_info &dst_type);
+[[noreturn]] void report_bad_cast(const std::type_info &src_type, const std::type_info &dst_type);
+[[noreturn]] void report_bad_device_cast(const device_t *dev, const std::type_info &src_type, const std::type_info &dst_type);
template <typename Dest, typename Source>
inline std::enable_if_t<std::is_base_of<device_t, Source>::value> report_bad_cast(Source *const src)
@@ -316,15 +328,15 @@ inline Dest downcast(Source &src)
//**************************************************************************
-// FUNCTION PROTOTYPES
+// INLINE FUNCTIONS
//**************************************************************************
-[[noreturn]] void fatalerror(const char *format, ...) ATTR_PRINTF(1,2);
-[[noreturn]] void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...) ATTR_PRINTF(3,4);
+template <typename... T>
+[[noreturn]] inline void fatalerror(T &&... args)
+{
+ throw emu_fatalerror(std::forward<T>(args)...);
+}
-//**************************************************************************
-// INLINE FUNCTIONS
-//**************************************************************************
// convert a series of 32 bits into a float
inline float u2f(u32 v)
diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h
index cb0af700c64..97955067865 100644
--- a/src/emu/emufwd.h
+++ b/src/emu/emufwd.h
@@ -178,7 +178,7 @@ struct ioport_port_live;
class running_machine;
// declared in mconfig.h
-namespace emu { namespace detail { struct machine_config_replace; } }
+namespace emu { namespace detail { class machine_config_replace; } }
class machine_config;
// declared in natkeyboard.h
diff --git a/src/emu/image.cpp b/src/emu/image.cpp
index 3013d03f668..e2cf6d91c83 100644
--- a/src/emu/image.cpp
+++ b/src/emu/image.cpp
@@ -73,11 +73,11 @@ image_manager::image_manager(running_machine &machine)
if (machine.options().write_config())
write_config(machine.options(), nullptr, &machine.system());
- fatalerror_exitcode(machine, EMU_ERR_DEVICE, "Device %s load (-%s %s) failed: %s",
- image.device().name(),
- image.instance_name().c_str(),
- startup_image_name.c_str(),
- image_err.c_str());
+ throw emu_fatalerror(EMU_ERR_DEVICE, "Device %s load (-%s %s) failed: %s",
+ image.device().name(),
+ image.instance_name(),
+ startup_image_name,
+ image_err);
}
}
}
@@ -244,9 +244,9 @@ void image_manager::postdevice_init()
/* unload all images */
unload_all();
- fatalerror_exitcode(machine(), EMU_ERR_DEVICE, "Device %s load failed: %s",
- image.device().name(),
- image_err.c_str());
+ throw emu_fatalerror(EMU_ERR_DEVICE, "Device %s load failed: %s",
+ image.device().name(),
+ image_err);
}
}
/* add a callback for when we shut down */
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 1b00ddfcfd9..331d5a7905a 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -388,7 +388,7 @@ int running_machine::run(bool quiet)
}
catch (emu_fatalerror &fatal)
{
- osd_printf_error("Fatal error: %s\n", fatal.string());
+ osd_printf_error("Fatal error: %s\n", fatal.what());
error = EMU_ERR_FATALERROR;
if (fatal.exitcode() != 0)
error = fatal.exitcode();
diff --git a/src/emu/main.h b/src/emu/main.h
index a62457a1c75..2a088a3995d 100644
--- a/src/emu/main.h
+++ b/src/emu/main.h
@@ -23,19 +23,17 @@
// CONSTANTS
//**************************************************************************
-enum
-{
- EMU_ERR_NONE = 0, /* no error */
- EMU_ERR_FAILED_VALIDITY = 1, /* failed validity checks */
- EMU_ERR_MISSING_FILES = 2, /* missing files */
- EMU_ERR_FATALERROR = 3, /* some other fatal error */
- EMU_ERR_DEVICE = 4, /* device initialization error (MESS-specific) */
- EMU_ERR_NO_SUCH_GAME = 5, /* game was specified but doesn't exist */
- EMU_ERR_INVALID_CONFIG = 6, /* some sort of error in configuration */
- EMU_ERR_IDENT_NONROMS = 7, /* identified all non-ROM files */
- EMU_ERR_IDENT_PARTIAL = 8, /* identified some files but not all */
- EMU_ERR_IDENT_NONE = 9 /* identified no files */
-};
+constexpr int EMU_ERR_NONE = 0; // no error
+constexpr int EMU_ERR_FAILED_VALIDITY = 1; // failed validity checks
+constexpr int EMU_ERR_MISSING_FILES = 2; // missing files
+constexpr int EMU_ERR_FATALERROR = 3; // some other fatal error
+constexpr int EMU_ERR_DEVICE = 4; // device initialization error
+constexpr int EMU_ERR_NO_SUCH_SYSTEM = 5; // system was specified but doesn't exist
+constexpr int EMU_ERR_INVALID_CONFIG = 6; // some sort of error in configuration
+constexpr int EMU_ERR_IDENT_NONROMS = 7; // identified all non-ROM files
+constexpr int EMU_ERR_IDENT_PARTIAL = 8; // identified some files but not all
+constexpr int EMU_ERR_IDENT_NONE = 9; // identified no files
+
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp
index e9533aff7d8..d6385c6d628 100644
--- a/src/emu/mconfig.cpp
+++ b/src/emu/mconfig.cpp
@@ -13,7 +13,9 @@
#include "screen.h"
#include <ctype.h>
+
#include <cstring>
+#include <numeric>
//**************************************************************************
@@ -37,12 +39,13 @@ private:
//-------------------------------------------------
machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
- : m_minimum_quantum(attotime::zero)
- , m_gamedrv(gamedrv)
+ : m_gamedrv(gamedrv)
, m_options(options)
, m_root_device()
, m_default_layouts([] (char const *a, char const *b) { return 0 > std::strcmp(a, b); })
, m_current_device(nullptr)
+ , m_maximum_quantums([] (char const *a, char const *b) { return 0 > std::strcmp(a, b); })
+ , m_perfect_quantum_device(nullptr, "")
{
// add the root device
device_add("root", gamedrv.type, 0);
@@ -117,6 +120,51 @@ machine_config::~machine_config()
//-------------------------------------------------
+// maximum_quantum - get smallest configured
+// maximum quantum
+//-------------------------------------------------
+
+attotime machine_config::maximum_quantum(attotime const &default_quantum) const
+{
+ return std::accumulate(
+ m_maximum_quantums.begin(),
+ m_maximum_quantums.end(),
+ default_quantum,
+ [] (attotime const &lhs, maximum_quantum_map::value_type const &rhs) { return (std::min)(lhs, rhs.second); });
+}
+
+//-------------------------------------------------
+// perfect_quantum_device - get device configured
+// for perfect quantum if any
+//-------------------------------------------------
+
+device_execute_interface *machine_config::perfect_quantum_device() const
+{
+ if (!m_perfect_quantum_device.first)
+ return nullptr;
+
+ device_t *const found(m_perfect_quantum_device.first->subdevice(m_perfect_quantum_device.second.c_str()));
+ if (!found)
+ {
+ throw emu_fatalerror(
+ "Device %s relative to %s specified for perfect interleave is not present!\n",
+ m_perfect_quantum_device.second,
+ m_perfect_quantum_device.first->tag());
+ }
+
+ device_execute_interface *result;
+ if (!found->interface(result))
+ {
+ throw emu_fatalerror("Device %s (%s) specified for perfect interleave does not implement device_execute_interface!\n",
+ found->tag(),
+ found->shortname());
+ }
+
+ return result;
+}
+
+
+//-------------------------------------------------
// set_default_layout - set layout for current
// device
//-------------------------------------------------
@@ -130,6 +178,19 @@ void machine_config::set_default_layout(internal_layout const &layout)
//-------------------------------------------------
+// set_maximum_quantum - set maximum scheduling
+// quantum for current device device
+//-------------------------------------------------
+
+void machine_config::set_maximum_quantum(attotime const &quantum)
+{
+ std::pair<maximum_quantum_map::iterator, bool> const ins(m_maximum_quantums.emplace(current_device().tag(), quantum));
+ if (!ins.second)
+ ins.first->second = quantum;
+}
+
+
+//-------------------------------------------------
// device_add - configuration helper to add a
// new device
//-------------------------------------------------
@@ -288,43 +349,70 @@ device_t &machine_config::replace_device(std::unique_ptr<device_t> &&device, dev
//-------------------------------------------------
-// device_find - configuration helper to
-// locate a device
-//-------------------------------------------------
-
-device_t *machine_config::device_find(device_t *owner, const char *tag)
-{
- // find the original device by relative tag (must exist)
- assert(owner != nullptr);
- device_t *device = owner->subdevice(tag);
- if (device == nullptr)
- throw emu_fatalerror("Unable to find device '%s'\n", tag);
-
- // return the device
- return device;
-}
-
-
-//-------------------------------------------------
// remove_references - globally remove references
// to a device about to be removed from the tree
//-------------------------------------------------
void machine_config::remove_references(device_t &device)
{
- // remove default layouts for subdevices
+ // sanity check
+ if (m_perfect_quantum_device.first == &device)
+ {
+ throw emu_fatalerror(
+ "Removing %s device %s would make the perfect quantum device target invalid\n",
+ device.shortname(),
+ device.tag());
+ }
+
+ // remove default layouts and maximum quantum settings for subdevices
char const *const tag(device.tag());
std::size_t const taglen(std::strlen(tag));
- default_layout_map::iterator it(m_default_layouts.lower_bound(tag));
- while ((m_default_layouts.end() != it) && !std::strncmp(tag, it->first, taglen))
+ for (auto it = m_default_layouts.lower_bound(tag); (m_default_layouts.end() != it) && !std::strncmp(tag, it->first, taglen); )
{
if (!it->first[taglen] || (':' == it->first[taglen]))
it = m_default_layouts.erase(it);
else
++it;
}
+ for (auto it = m_maximum_quantums.lower_bound(tag); (m_maximum_quantums.end() != it) && !std::strncmp(tag, it->first, taglen); )
+ {
+ if (!it->first[taglen] || (':' == it->first[taglen]))
+ it = m_maximum_quantums.erase(it);
+ else
+ ++it;
+ }
// iterate over all devices and remove any references
for (device_t &scan : device_iterator(root_device()))
scan.subdevices().m_tagmap.clear();
}
+
+
+//-------------------------------------------------
+// set_perfect_quantum - set device to base
+// scheduling interval on
+//-------------------------------------------------
+
+void machine_config::set_perfect_quantum(device_t &device, std::string tag)
+{
+ if (!m_current_device)
+ {
+ throw emu_fatalerror(
+ "Perfect quantum device can only be set during configuration (set to %s relative to %s)\n",
+ tag,
+ device.tag());
+ }
+
+ if (m_current_device != m_root_device.get())
+ {
+ throw emu_fatalerror(
+ "Perfect quantum device can only be set by the root device (set to %s relative to %s while configuring %s device %s)\n",
+ tag,
+ device.tag(),
+ m_current_device->shortname(),
+ m_current_device->tag());
+ }
+
+ m_perfect_quantum_device.first = &device;
+ m_perfect_quantum_device.second = std::move(tag);
+}
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index 84d42d94996..af332e7db9c 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -33,17 +33,32 @@
namespace emu { namespace detail {
-struct machine_config_replace { machine_config &config; };
+class machine_config_replace
+{
+public:
+ machine_config_replace(machine_config_replace const &) = default;
+ machine_config &config;
+private:
+ machine_config_replace(machine_config &c) : config(c) { }
+ friend class ::machine_config;
+};
} } // namesapce emu::detail
+/// \brief Internal layout description
+///
+/// Holds the compressed and decompressed data size, compression method,
+/// and a reference to the compressed layout data. Note that copying
+/// the structure will not copy the referenced data.
struct internal_layout
{
+ enum class compression { NONE, ZLIB };
+
size_t decompressed_size;
size_t compressed_size;
- u8 compression_type;
- const u8* data;
+ compression compression_type;
+ u8 const *data;
};
@@ -96,19 +111,68 @@ public:
emu_options &options() const { return m_options; }
device_t *device(const char *tag) const { return root_device().subdevice(tag); }
template <class DeviceClass> DeviceClass *device(const char *tag) const { return downcast<DeviceClass *>(device(tag)); }
+ attotime maximum_quantum(attotime const &default_quantum) const;
+ device_execute_interface *perfect_quantum_device() const;
+
+ /// \brief Apply visitor to internal layouts
+ ///
+ /// Calls the supplied visitor for each device with an internal
+ /// layout. The order of devices is implementation-dependent.
+ /// \param [in] op The visitor. It must provide a function call
+ // operator that can be invoked with two arguments: a reference
+ // to a #device_t and a const reference to an #internal_layout.
template <typename T> void apply_default_layouts(T &&op) const
{
for (std::pair<char const *, internal_layout const *> const &lay : m_default_layouts)
op(*device(lay.first), *lay.second);
}
- // public state
- attotime m_minimum_quantum; // minimum scheduling quantum
- std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling
-
- // configuration methods
+ /// \brief Get a device replacement helper
+ ///
+ /// Pass the result in place of the machine configuration itself to
+ /// replace an existing device.
+ /// \return A device replacement helper to pass to a device type
+ /// when replacing an existing device.
+ emu::detail::machine_config_replace replace() { return emu::detail::machine_config_replace(*this); };
+
+ /// \brief Set internal layout for current device
+ ///
+ /// Set internal layout for current device. Each device in the
+ /// system can have its own internal layout. Tags in the layout
+ /// will be resolved relative to the device. Replaces previously
+ /// set layout if any.
+ /// \param [in] layout Reference to the internal layout description
+ /// structure. Neither the description structure nor the
+ /// compressed data is copied. It is the caller's responsibility
+ /// to ensure both remain valid until layouts and views are
+ /// instantiated.
void set_default_layout(internal_layout const &layout);
+ /// \brief Set maximum scheduling quantum
+ ///
+ /// Set the maximum scheduling quantum required for the current
+ /// device. The smallest maximum quantum requested by a device in
+ /// the system will be used.
+ /// \param [in] quantum Maximum scheduling quantum in attoseconds.
+ void set_maximum_quantum(attotime const &quantum);
+
+ template <typename T>
+ void set_perfect_quantum(T &&tag)
+ {
+ set_perfect_quantum(current_device(), std::forward<T>(tag));
+ }
+ template <class DeviceClass, bool Required>
+ void set_perfect_quantum(device_finder<DeviceClass, Required> const &finder)
+ {
+ std::pair<device_t &, char const *> const target(finder.finder_target());
+ set_perfect_quantum(target.first, target.second);
+ }
+ template <class DeviceClass, bool Required>
+ void set_perfect_quantum(device_finder<DeviceClass, Required> &finder)
+ {
+ set_perfect_quantum(const_cast<device_finder<DeviceClass, Required> const &>(finder));
+ }
+
// helpers during configuration; not for general use
token begin_configuration(device_t &device)
{
@@ -116,7 +180,6 @@ public:
m_current_device = &device;
return token(*this, device);
}
- emu::detail::machine_config_replace replace() { return emu::detail::machine_config_replace{ *this }; };
device_t *device_add(const char *tag, device_type type, u32 clock);
template <typename Creator>
device_t *device_add(const char *tag, Creator &&type, u32 clock)
@@ -162,11 +225,11 @@ public:
return device_replace(tag, std::forward<Creator>(type), clock.value(), std::forward<Params>(args)...);
}
device_t *device_remove(const char *tag);
- device_t *device_find(device_t *owner, const char *tag);
private:
class current_device_stack;
typedef std::map<char const *, internal_layout const *, bool (*)(char const *, char const *)> default_layout_map;
+ typedef std::map<char const *, attotime, bool (*)(char const *, char const *)> maximum_quantum_map;
// internal helpers
std::pair<const char *, device_t *> resolve_owner(const char *tag) const;
@@ -174,13 +237,16 @@ private:
device_t &add_device(std::unique_ptr<device_t> &&device, device_t *owner);
device_t &replace_device(std::unique_ptr<device_t> &&device, device_t &owner, device_t *existing);
void remove_references(device_t &device);
+ void set_perfect_quantum(device_t &device, std::string tag);
// internal state
- game_driver const & m_gamedrv;
- emu_options & m_options;
- std::unique_ptr<device_t> m_root_device;
- default_layout_map m_default_layouts;
- device_t * m_current_device;
+ game_driver const & m_gamedrv;
+ emu_options & m_options;
+ std::unique_ptr<device_t> m_root_device;
+ default_layout_map m_default_layouts;
+ device_t * m_current_device;
+ maximum_quantum_map m_maximum_quantums;
+ std::pair<device_t *, std::string> m_perfect_quantum_device;
};
#endif // MAME_EMU_MCONFIG_H
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 0c598345ea1..55340803345 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -1995,12 +1995,11 @@ bool render_target::load_layout_file(const char *dirname, const internal_layout
z_stream stream;
int zerr;
- /* initialize the stream */
+ // initialize the stream
memset(&stream, 0, sizeof(stream));
stream.next_out = tempout.get();
stream.avail_out = layout_data.decompressed_size;
-
zerr = inflateInit(&stream);
if (zerr != Z_OK)
{
@@ -2008,12 +2007,12 @@ bool render_target::load_layout_file(const char *dirname, const internal_layout
return false;
}
- /* decompress this chunk */
+ // decompress this chunk
stream.next_in = (unsigned char *)layout_data.data;
stream.avail_in = layout_data.compressed_size;
zerr = inflate(&stream, Z_NO_FLUSH);
- /* stop at the end of the stream */
+ // stop at the end of the stream
if (zerr == Z_STREAM_END)
{
// OK
@@ -2024,7 +2023,7 @@ bool render_target::load_layout_file(const char *dirname, const internal_layout
return false;
}
- /* clean up */
+ // clean up
zerr = inflateEnd(&stream);
if (zerr != Z_OK)
{
diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp
index d04d0e308a3..a6610ec6c0c 100644
--- a/src/emu/romload.cpp
+++ b/src/emu/romload.cpp
@@ -471,7 +471,7 @@ void rom_load_manager::display_rom_load_results(bool from_list)
{
/* create the error message and exit fatally */
osd_printf_error("%s", m_errorstring);
- fatalerror_exitcode(machine(), EMU_ERR_MISSING_FILES, "Required files are missing, the machine cannot be run.");
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "Required files are missing, the machine cannot be run.");
}
/* if we had warnings, output them, but continue */
@@ -595,7 +595,7 @@ int rom_load_manager::open_rom_file(const char *regiontag, const rom_entry *romp
}
if (tag5.find_first_of('%') != -1)
- fatalerror("We do not support clones of clones!\n");
+ throw emu_fatalerror("We do not support clones of clones!\n");
// try to load from the available location(s):
// - if we are not using lists, we have regiontag only;
@@ -688,11 +688,11 @@ int rom_load_manager::read_rom_data(const rom_entry *parent_region, const rom_en
/* make sure we only fill within the region space */
if (ROM_GETOFFSET(romp) + numgroups * groupsize + (numgroups - 1) * skip > m_region->bytes())
- fatalerror("Error in RomModule definition: %s out of memory region space\n", ROM_GETNAME(romp));
+ throw emu_fatalerror("Error in RomModule definition: %s out of memory region space\n", ROM_GETNAME(romp));
/* make sure the length was valid */
if (numbytes == 0)
- fatalerror("Error in RomModule definition: %s has an invalid length\n", ROM_GETNAME(romp));
+ throw emu_fatalerror("Error in RomModule definition: %s has an invalid length\n", ROM_GETNAME(romp));
/* special case for simple loads */
if (datamask == 0xff && (groupsize == 1 || !reversed) && skip == 0)
@@ -790,11 +790,11 @@ void rom_load_manager::fill_rom_data(const rom_entry *romp)
// make sure we fill within the region space
if (ROM_GETOFFSET(romp) + numbytes > m_region->bytes())
- fatalerror("Error in RomModule definition: FILL out of memory region space\n");
+ throw emu_fatalerror("Error in RomModule definition: FILL out of memory region space\n");
// make sure the length was valid
if (numbytes == 0)
- fatalerror("Error in RomModule definition: FILL has an invalid length\n");
+ throw emu_fatalerror("Error in RomModule definition: FILL has an invalid length\n");
// for fill bytes, the byte that gets filled is the first byte of the hashdata string
u8 fill_byte = u8(strtol(ROM_GETHASHDATA(romp), nullptr, 0));
@@ -823,20 +823,20 @@ void rom_load_manager::copy_rom_data(const rom_entry *romp)
/* make sure we copy within the region space */
if (ROM_GETOFFSET(romp) + numbytes > m_region->bytes())
- fatalerror("Error in RomModule definition: COPY out of target memory region space\n");
+ throw emu_fatalerror("Error in RomModule definition: COPY out of target memory region space\n");
/* make sure the length was valid */
if (numbytes == 0)
- fatalerror("Error in RomModule definition: COPY has an invalid length\n");
+ throw emu_fatalerror("Error in RomModule definition: COPY has an invalid length\n");
/* make sure the source was valid */
memory_region *region = machine().root_device().memregion(srcrgntag);
if (region == nullptr)
- fatalerror("Error in RomModule definition: COPY from an invalid region\n");
+ throw emu_fatalerror("Error in RomModule definition: COPY from an invalid region\n");
/* make sure we find within the region space */
if (srcoffs + numbytes > region->bytes())
- fatalerror("Error in RomModule definition: COPY out of source memory region space\n");
+ throw emu_fatalerror("Error in RomModule definition: COPY out of source memory region space\n");
/* fill the data */
memcpy(base, region->base() + srcoffs, numbytes);
@@ -856,13 +856,13 @@ void rom_load_manager::process_rom_entries(const char *regiontag, const rom_entr
while (!ROMENTRY_ISREGIONEND(romp))
{
if (ROMENTRY_ISCONTINUE(romp))
- fatalerror("Error in RomModule definition: ROM_CONTINUE not preceded by ROM_LOAD\n");
+ throw emu_fatalerror("Error in RomModule definition: ROM_CONTINUE not preceded by ROM_LOAD\n");
if (ROMENTRY_ISIGNORE(romp))
- fatalerror("Error in RomModule definition: ROM_IGNORE not preceded by ROM_LOAD\n");
+ throw emu_fatalerror("Error in RomModule definition: ROM_IGNORE not preceded by ROM_LOAD\n");
if (ROMENTRY_ISRELOAD(romp))
- fatalerror("Error in RomModule definition: ROM_RELOAD not preceded by ROM_LOAD\n");
+ throw emu_fatalerror("Error in RomModule definition: ROM_RELOAD not preceded by ROM_LOAD\n");
if (ROMENTRY_ISFILL(romp))
{
@@ -1005,7 +1005,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_
}
if (tag5.find_first_of('%') != -1)
- fatalerror("We do not support clones of clones!\n");
+ throw emu_fatalerror("We do not support clones of clones!\n");
// try to load from the available location(s):
// - if we are not using lists, we have locationtag only;
diff --git a/src/emu/schedule.cpp b/src/emu/schedule.cpp
index e2b1497995f..fbe9f667255 100644
--- a/src/emu/schedule.cpp
+++ b/src/emu/schedule.cpp
@@ -756,29 +756,13 @@ void device_scheduler::rebuild_execute_list()
// if we haven't yet set a scheduling quantum, do it now
if (m_quantum_list.empty())
{
- // set the core scheduling quantum
- attotime min_quantum = machine().config().m_minimum_quantum;
-
- // if none specified default to 60Hz
- if (min_quantum.is_zero())
- min_quantum = attotime::from_hz(60);
+ // set the core scheduling quantum, ensuring it's no longer than 60Hz
+ attotime min_quantum = machine().config().maximum_quantum(attotime::from_hz(60));
// if the configuration specifies a device to make perfect, pick that as the minimum
- if (!machine().config().m_perfect_cpu_quantum.empty())
- {
- device_t *device = machine().root_device().subdevice(machine().config().m_perfect_cpu_quantum.c_str());
- if (device == nullptr)
- fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str());
-
- device_execute_interface *exec;
- if (!device->interface(exec))
- fatalerror("Device '%s' specified for perfect interleave is not an executing device!\n", machine().config().m_perfect_cpu_quantum.c_str());
-
- min_quantum = std::min(attotime(0, exec->minimum_quantum()), min_quantum);
- }
-
- // make sure it's no higher than 60Hz
- min_quantum = std::min(min_quantum, attotime::from_hz(60));
+ device_execute_interface *const exec(machine().config().perfect_quantum_device());
+ if (exec)
+ min_quantum = (std::min)(attotime(0, exec->minimum_quantum()), min_quantum);
// inform the timer system of our decision
add_scheduling_quantum(min_quantum, attotime::never);
diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp
index 882da29c1ff..a46639d882e 100644
--- a/src/emu/validity.cpp
+++ b/src/emu/validity.cpp
@@ -238,7 +238,7 @@ bool validity_checker::check_all_matching(const char *string)
// if we failed to match anything, it
if (string && !validated_any)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", string);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", string);
return !(m_errors > 0 || m_warnings > 0);
}
@@ -318,7 +318,7 @@ void validity_checker::validate_one(const game_driver &driver)
}
catch (emu_fatalerror &err)
{
- osd_printf_error("Fatal error %s", err.string());
+ osd_printf_error("Fatal error %s", err.what());
}
// if we had warnings or errors, output
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp
index ae2ca8ebd78..0f8095cefbd 100644
--- a/src/frontend/mame/cheat.cpp
+++ b/src/frontend/mame/cheat.cpp
@@ -310,6 +310,9 @@ bool cheat_parameter::set_next_state()
// CHEAT SCRIPT
//**************************************************************************
+constexpr int cheat_script::script_entry::MAX_ARGUMENTS;
+
+
//-------------------------------------------------
// cheat_script - constructor
//-------------------------------------------------
@@ -1227,7 +1230,7 @@ bool cheat_manager::save_all(const char *filename)
catch (emu_fatalerror const &err)
{
// catch errors and cleanup
- osd_printf_error("%s\n", err.string());
+ osd_printf_error("%s\n", err.what());
cheatfile.remove_on_close();
}
return false;
@@ -1447,7 +1450,7 @@ void cheat_manager::load_cheats(const char *filename)
catch (emu_fatalerror const &err)
{
// just move on to the next cheat
- osd_printf_error("%s\n", err.string());
+ osd_printf_error("%s\n", err.what());
}
}
}
@@ -1455,7 +1458,7 @@ void cheat_manager::load_cheats(const char *filename)
catch (emu_fatalerror const &err)
{
// handle errors cleanly
- osd_printf_error("%s\n", err.string());
+ osd_printf_error("%s\n", err.what());
m_cheatlist.clear();
}
}
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 46c7f9cbe63..82a291539ba 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -219,7 +219,7 @@ void cli_frontend::start_execution(mame_machine_manager *manager, const std::vec
{
// if we failed, check for no command and a system name first; in that case error on the name
if (m_options.command().empty() && mame_options::system(m_options) == nullptr && !m_options.attempted_system_name().empty())
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.attempted_system_name().c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "Unknown system '%s'", m_options.attempted_system_name().c_str());
// otherwise, error on the options
throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "%s", ex.message().c_str());
@@ -258,7 +258,7 @@ void cli_frontend::start_execution(mame_machine_manager *manager, const std::vec
// if we can't find it, give an appropriate error
const game_driver *system = mame_options::system(m_options);
if (system == nullptr && *(m_options.system_name()) != 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "Unknown system '%s'", m_options.system_name());
// otherwise just run the game
m_result = manager->execute();
@@ -282,14 +282,14 @@ int cli_frontend::execute(std::vector<std::string> &args)
// handle exceptions of various types
catch (emu_fatalerror &fatal)
{
- std::string str(fatal.string());
+ std::string str(fatal.what());
strtrimspace(str);
osd_printf_error("%s\n", str);
m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : EMU_ERR_FATALERROR;
// if a game was specified, wasn't a wildcard, and our error indicates this was the
// reason for failure, offer some suggestions
- if (m_result == EMU_ERR_NO_SUCH_GAME
+ if (m_result == EMU_ERR_NO_SUCH_SYSTEM
&& !m_options.attempted_system_name().empty()
&& !core_iswildstr(m_options.attempted_system_name().c_str())
&& mame_options::system(m_options) == nullptr)
@@ -431,7 +431,7 @@ void cli_frontend::listclones(const std::vector<std::string> &args)
{
// see if we match but just weren't a clone
if (original_count == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
else
osd_printf_info("Found %lu match(es) for '%s' but none were clones\n", (unsigned long)drivlist.count(), gamename); // FIXME: this never gets hit
return;
@@ -464,7 +464,7 @@ void cli_frontend::listbrothers(const std::vector<std::string> &args)
// start with a filtered list of drivers; return an error if none found
driver_enumerator initial_drivlist(m_options, gamename);
if (initial_drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// for the final list, start with an empty driver list
driver_enumerator drivlist(m_options);
@@ -608,7 +608,7 @@ void cli_frontend::listsamples(const std::vector<std::string> &args)
// determine which drivers to output; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// iterate over drivers, looking for SAMPLES devices
bool first = true;
@@ -648,7 +648,7 @@ void cli_frontend::listdevices(const std::vector<std::string> &args)
// determine which drivers to output; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// iterate over drivers, looking for SAMPLES devices
bool first = true;
@@ -733,7 +733,7 @@ void cli_frontend::listslots(const std::vector<std::string> &args)
// determine which drivers to output; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// print header
printf("%-16s %-16s %-16s %s\n", "SYSTEM", "SLOT NAME", "SLOT OPTIONS", "SLOT DEVICE NAME");
@@ -801,7 +801,7 @@ void cli_frontend::listmedia(const std::vector<std::string> &args)
// determine which drivers to output; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// print header
printf("%-16s %-16s %-10s %s\n", "SYSTEM", "MEDIA NAME", "(brief)", "IMAGE FILE EXTENSIONS SUPPORTED");
@@ -938,7 +938,7 @@ void cli_frontend::verifyroms(const std::vector<std::string> &args)
for (std::string const &pat : args)
{
if (!*it)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", pat.c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat.c_str());
++it;
}
@@ -1002,7 +1002,7 @@ void cli_frontend::verifysamples(const std::vector<std::string> &args)
// return an error if none found
if (matched == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// if we didn't get anything at all, display a generic end message
if (matched > 0 && correct == 0 && incorrect == 0)
@@ -1215,7 +1215,7 @@ void cli_frontend::listsoftware(const std::vector<std::string> &args)
// determine which drivers to output; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
while (drivlist.next())
{
@@ -1260,7 +1260,7 @@ void cli_frontend::verifysoftware(const std::vector<std::string> &args)
// determine which drivers to process; return an error if none found
driver_enumerator drivlist(m_options, gamename);
if (drivlist.count() == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
media_auditor auditor(drivlist);
util::ovectorstream summary_string;
@@ -1298,7 +1298,7 @@ void cli_frontend::verifysoftware(const std::vector<std::string> &args)
// return an error if none found
if (matched == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", gamename);
// if we didn't get anything at all, display a generic end message
if (matched > 0 && correct == 0 && incorrect == 0)
@@ -1401,7 +1401,7 @@ void cli_frontend::verifysoftlist(const std::vector<std::string> &args)
// return an error if none found
if (matched == 0)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching software lists found for '%s'", gamename);
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching software lists found for '%s'", gamename);
// if we didn't get anything at all, display a generic end message
if (matched > 0 && correct == 0 && incorrect == 0)
@@ -1528,7 +1528,7 @@ template <typename T, typename U> void cli_frontend::apply_action(const std::vec
for (std::string const &pat : args)
{
if (!*it)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching systems found for '%s'", pat.c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat.c_str());
++it;
}
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
index b06453c0958..8ca799874d6 100644
--- a/src/frontend/mame/info.cpp
+++ b/src/frontend/mame/info.cpp
@@ -315,7 +315,7 @@ void info_xml_creator::output(std::ostream &out, const std::vector<std::string>
if (iter != matched.end())
{
int index = iter - matched.begin();
- throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching machines found for '%s'", patterns[index].c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching machines found for '%s'", patterns[index].c_str());
}
}
}
diff --git a/src/mame/audio/s11c_bg.cpp b/src/mame/audio/s11c_bg.cpp
index cdcbb701a76..51f90b38074 100644
--- a/src/mame/audio/s11c_bg.cpp
+++ b/src/mame/audio/s11c_bg.cpp
@@ -62,7 +62,7 @@ void s11c_bg_device::device_add_mconfig(machine_config &config)
{
MC6809E(config, m_cpu, XTAL(8'000'000) / 4); // MC68B09E
m_cpu->set_addrmap(AS_PROGRAM, &s11c_bg_device::s11c_bg_map);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
YM2151(config, m_ym2151, XTAL(3'579'545)); // "3.58 MHz" on schematics and parts list
m_ym2151->irq_handler().set(FUNC(s11c_bg_device::ym2151_irq_w));
diff --git a/src/mame/audio/taito_zm.cpp b/src/mame/audio/taito_zm.cpp
index d4a29135dae..57e07f65afc 100644
--- a/src/mame/audio/taito_zm.cpp
+++ b/src/mame/audio/taito_zm.cpp
@@ -191,7 +191,7 @@ void taito_zoom_device::device_add_mconfig(machine_config &config)
m_soundcpu->write_port<1>().set(FUNC(taito_zoom_device::tms_ctrl_w));
m_soundcpu->set_addrmap(AS_PROGRAM, &taito_zoom_device::taitozoom_mn_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
TMS57002(config, m_tms57002, XTAL(25'000'000)/2);
//m_tms57002->empty_callback().set_inputline(m_soundcpu, MN10200_IRQ1, m_tms57002->empty_r()); /*.invert();*/
diff --git a/src/mame/audio/wpcsnd.cpp b/src/mame/audio/wpcsnd.cpp
index 05abf086a74..9550b0a1578 100644
--- a/src/mame/audio/wpcsnd.cpp
+++ b/src/mame/audio/wpcsnd.cpp
@@ -73,7 +73,7 @@ void wpcsnd_device::device_add_mconfig(machine_config &config)
{
MC6809E(config, m_cpu, XTAL(8'000'000) / 4); // MC68B09E
m_cpu->set_addrmap(AS_PROGRAM, &wpcsnd_device::wpcsnd_map);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
YM2151(config, m_ym2151, 3580000);
m_ym2151->irq_handler().set(FUNC(wpcsnd_device::ym2151_irq_w));
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index 5b370d8ea4a..b58e57c888e 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -690,7 +690,7 @@ void fortyl_state::common(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 18432000/6); /* OK */
- config.m_minimum_quantum = attotime::from_hz(6000); /* high interleave to ensure proper synchronization of CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* high interleave to ensure proper synchronization of CPUs */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/adam.cpp b/src/mame/drivers/adam.cpp
index f9eb9b979e2..9db2280b9be 100644
--- a/src/mame/drivers/adam.cpp
+++ b/src/mame/drivers/adam.cpp
@@ -1042,7 +1042,7 @@ void adam_state::adam(machine_config &config)
m_netcpu->out_p3_cb().set(FUNC(adam_state::m6801_p3_w));
m_netcpu->out_p4_cb().set(FUNC(adam_state::m6801_p4_w));
m_netcpu->out_sc2_cb().set(FUNC(adam_state::os3_w));
- config.m_perfect_cpu_quantum = subtag(M6801_TAG);
+ config.set_perfect_quantum(m_netcpu);
// video hardware
TMS9928A(config, m_vdc, XTAL(10'738'635)).set_screen("screen");
@@ -1058,22 +1058,22 @@ void adam_state::adam(machine_config &config)
//m_psg->ready_cb().set_inputline(m_maincpu, Z80_INPUT_LINE_WAIT).invert();
// devices
- ADAMNET(config, ADAMNET_TAG, 0);
- ADAMNET_SLOT(config, "net1", adamnet_devices, "kb");
- ADAMNET_SLOT(config, "net2", adamnet_devices, "prn");
- ADAMNET_SLOT(config, "net3", adamnet_devices, "ddp");
- ADAMNET_SLOT(config, "net4", adamnet_devices, "fdc");
- ADAMNET_SLOT(config, "net5", adamnet_devices, "fdc").set_option_device_input_defaults("fdc", device_iptdef_drive2);
- ADAMNET_SLOT(config, "net6", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net7", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net8", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net9", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net10", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net11", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net12", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net13", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net14", adamnet_devices, nullptr);
- ADAMNET_SLOT(config, "net15", adamnet_devices, nullptr);
+ ADAMNET(config, m_adamnet, 0);
+ ADAMNET_SLOT(config, "net1", m_adamnet, adamnet_devices, "kb");
+ ADAMNET_SLOT(config, "net2", m_adamnet, adamnet_devices, "prn");
+ ADAMNET_SLOT(config, "net3", m_adamnet, adamnet_devices, "ddp");
+ ADAMNET_SLOT(config, "net4", m_adamnet, adamnet_devices, "fdc");
+ ADAMNET_SLOT(config, "net5", m_adamnet, adamnet_devices, "fdc").set_option_device_input_defaults("fdc", device_iptdef_drive2);
+ ADAMNET_SLOT(config, "net6", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net7", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net8", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net9", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net10", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net11", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net12", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net13", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net14", m_adamnet, adamnet_devices, nullptr);
+ ADAMNET_SLOT(config, "net15", m_adamnet, adamnet_devices, nullptr);
COLECOVISION_CARTRIDGE_SLOT(config, m_cart, colecovision_cartridges, nullptr);
ADAM_EXPANSION_SLOT(config, m_slot1, XTAL(7'159'090)/2, adam_slot1_devices, "adamlink");
diff --git a/src/mame/drivers/airbustr.cpp b/src/mame/drivers/airbustr.cpp
index 448908773d0..9c757d3f2e5 100644
--- a/src/mame/drivers/airbustr.cpp
+++ b/src/mame/drivers/airbustr.cpp
@@ -551,7 +551,7 @@ void airbustr_state::airbustr(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &airbustr_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &airbustr_state::sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(6000); // Palette RAM is filled by sub cpu with data supplied by main cpu
+ config.set_maximum_quantum(attotime::from_hz(6000)); // Palette RAM is filled by sub cpu with data supplied by main cpu
// Maybe a high value is safer in order to avoid glitches
WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */
diff --git a/src/mame/drivers/airraid.cpp b/src/mame/drivers/airraid.cpp
index f8ca047b6fa..24b588d9d04 100644
--- a/src/mame/drivers/airraid.cpp
+++ b/src/mame/drivers/airraid.cpp
@@ -400,7 +400,7 @@ void airraid_state::airraid(machine_config &config)
audiocpu.set_addrmap(AS_OPCODES, &airraid_state::airraid_sound_decrypted_opcodes_map);
audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 0x100);
diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp
index 2d810660aab..1d984639dcc 100644
--- a/src/mame/drivers/ajax.cpp
+++ b/src/mame/drivers/ajax.cpp
@@ -182,7 +182,7 @@ void ajax_state::ajax(machine_config &config)
Z80(config, m_audiocpu, 3579545); /* 3.58 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &ajax_state::ajax_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/alphatpx.cpp b/src/mame/drivers/alphatpx.cpp
index d6bcdc91558..6fe53e44309 100644
--- a/src/mame/drivers/alphatpx.cpp
+++ b/src/mame/drivers/alphatpx.cpp
@@ -1210,7 +1210,7 @@ void alphatp_12_state::alphatp2(machine_config &config)
maincpu.set_addrmap(AS_PROGRAM, &alphatp_12_state::alphatp2_mem);
maincpu.set_addrmap(AS_IO, &alphatp_12_state::alphatp2_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum("maincpu");
I8041A(config, m_kbdmcu, 12.8544_MHz_XTAL / 2);
m_kbdmcu->t0_in_cb().set(FUNC(alphatp_12_state::kbd_matrix_r));
@@ -1288,9 +1288,9 @@ void alphatp_34_state::alphatp3(machine_config &config)
maincpu.set_addrmap(AS_PROGRAM, &alphatp_34_state::alphatp3_mem);
maincpu.set_addrmap(AS_IO, &alphatp_34_state::alphatp3_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum("maincpu");
- I8041A(config, m_kbdmcu, 12.8544_MHz_XTAL /2);
+ I8041A(config, m_kbdmcu, 12.8544_MHz_XTAL / 2);
m_kbdmcu->t0_in_cb().set(FUNC(alphatp_34_state::kbd_matrix_r));
m_kbdmcu->p1_out_cb().set(FUNC(alphatp_34_state::kbd_matrix_w));
m_kbdmcu->p2_in_cb().set(FUNC(alphatp_34_state::kbd_port2_r));
diff --git a/src/mame/drivers/amspdwy.cpp b/src/mame/drivers/amspdwy.cpp
index fa1d73b987d..c25682bca61 100644
--- a/src/mame/drivers/amspdwy.cpp
+++ b/src/mame/drivers/amspdwy.cpp
@@ -258,7 +258,7 @@ void amspdwy_state::amspdwy(machine_config &config)
Z80(config, m_audiocpu, 3000000);
m_audiocpu->set_addrmap(AS_PROGRAM, &amspdwy_state::amspdwy_sound_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/amstrad.cpp b/src/mame/drivers/amstrad.cpp
index 94f51d99d95..349e2a50b81 100644
--- a/src/mame/drivers/amstrad.cpp
+++ b/src/mame/drivers/amstrad.cpp
@@ -914,7 +914,7 @@ void amstrad_state::amstrad_base(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &amstrad_state::amstrad_io);
m_maincpu->set_irq_acknowledge_callback(FUNC(amstrad_state::amstrad_cpu_acknowledge_int));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_START_OVERRIDE(amstrad_state, amstrad )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, amstrad )
@@ -1040,7 +1040,7 @@ void amstrad_state::cpcplus(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &amstrad_state::amstrad_io);
m_maincpu->set_irq_acknowledge_callback(FUNC(amstrad_state::amstrad_cpu_acknowledge_int));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_START_OVERRIDE(amstrad_state, plus )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, plus )
@@ -1119,7 +1119,7 @@ void amstrad_state::gx4000(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &amstrad_state::amstrad_io);
m_maincpu->set_irq_acknowledge_callback(FUNC(amstrad_state::amstrad_cpu_acknowledge_int));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_START_OVERRIDE(amstrad_state, gx4000 )
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state, gx4000 )
diff --git a/src/mame/drivers/angelkds.cpp b/src/mame/drivers/angelkds.cpp
index e0f25bd9269..638202663d2 100644
--- a/src/mame/drivers/angelkds.cpp
+++ b/src/mame/drivers/angelkds.cpp
@@ -541,7 +541,7 @@ void angelkds_state::angelkds(machine_config &config)
ppi1.in_pb_callback().set_ioport("I81");
ppi1.in_pc_callback().set_ioport("I82");
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp
index f0e9366b0c6..c5516e030f4 100644
--- a/src/mame/drivers/apollo.cpp
+++ b/src/mame/drivers/apollo.cpp
@@ -1052,7 +1052,7 @@ void apollo_state::dn3500(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &apollo_state::dn3500_map);
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &apollo_state::cpu_space_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
apollo(config);
@@ -1070,7 +1070,7 @@ void apollo_state::dsp3500(machine_config &config)
M68030(config, m_maincpu, 25000000); /* 25 MHz 68030 */
m_maincpu->set_addrmap(AS_PROGRAM, &apollo_state::dsp3500_map);
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &apollo_state::cpu_space_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
apollo_terminal(config);
@@ -1119,7 +1119,7 @@ void apollo_state::dsp3000(machine_config &config)
M68020PMMU(config, m_maincpu, 12000000); /* 12 MHz */
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &apollo_state::cpu_space_map);
m_maincpu->set_addrmap(AS_PROGRAM, &apollo_state::dsp3000_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
apollo_terminal(config);
@@ -1164,7 +1164,7 @@ void apollo_state::dsp5500(machine_config &config)
M68040(config, m_maincpu, 25000000); /* 25 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &apollo_state::dsp5500_map);
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &apollo_state::cpu_space_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
apollo_terminal(config);
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp
index f24eda24da6..1a60331ceae 100644
--- a/src/mame/drivers/apple2.cpp
+++ b/src/mame/drivers/apple2.cpp
@@ -1276,7 +1276,7 @@ void apple2_state::apple2_common(machine_config &config)
TIMER(config, m_scantimer, 0);
m_scantimer->configure_scanline(FUNC(apple2_state::apple2_interrupt), "screen", 0, 1);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
APPLE2_VIDEO(config, m_video, XTAL(14'318'181)).set_screen(m_screen);
APPLE2_COMMON(config, m_a2common, XTAL(14'318'181));
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp
index 6ba64a2bb6e..5bfcd4c7721 100644
--- a/src/mame/drivers/apple2e.cpp
+++ b/src/mame/drivers/apple2e.cpp
@@ -4226,7 +4226,7 @@ void apple2e_state::apple2e(machine_config &config)
TIMER(config, m_scantimer, 0);
m_scantimer->configure_scanline(FUNC(apple2e_state::apple2_interrupt), "screen", 0, 1);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
APPLE2_VIDEO(config, m_video, XTAL(14'318'181)).set_screen(m_screen);
APPLE2_COMMON(config, m_a2common, XTAL(14'318'181));
diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp
index 78a9622c1c0..1a91c65e713 100644
--- a/src/mame/drivers/apple2gs.cpp
+++ b/src/mame/drivers/apple2gs.cpp
@@ -4536,7 +4536,7 @@ void apple2gs_state::apple2gs(machine_config &config)
m_maincpu->set_dasm_override(FUNC(apple2gs_state::dasm_trampoline));
TIMER(config, m_scantimer, 0);
m_scantimer->configure_scanline(FUNC(apple2gs_state::apple2_interrupt), "screen", 0, 1);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
M50741(config, m_adbmicro, A2GS_MASTER_CLOCK/8);
m_adbmicro->read_p<0>().set(FUNC(apple2gs_state::adbmicro_p0_in));
diff --git a/src/mame/drivers/apple3.cpp b/src/mame/drivers/apple3.cpp
index deedcef9e42..f55b434478c 100644
--- a/src/mame/drivers/apple3.cpp
+++ b/src/mame/drivers/apple3.cpp
@@ -64,7 +64,7 @@ void apple3_state::apple3(machine_config &config)
m_maincpu->sync_cb().set(FUNC(apple3_state::apple3_sync_w));
m_maincpu->set_addrmap(AS_PROGRAM, &apple3_state::apple3_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
input_merger_device &mainirq(INPUT_MERGER_ANY_HIGH(config, "mainirq"));
mainirq.output_handler().set_inputline(m_maincpu, m6502_device::IRQ_LINE);
diff --git a/src/mame/drivers/arabian.cpp b/src/mame/drivers/arabian.cpp
index b667760b5cf..716cfa67eb6 100644
--- a/src/mame/drivers/arabian.cpp
+++ b/src/mame/drivers/arabian.cpp
@@ -375,7 +375,7 @@ void arabian_state::arabian(machine_config &config)
m_mcu->read_r<3>().set(FUNC(arabian_state::mcu_port_r3_r));
m_mcu->write_r<3>().set(FUNC(arabian_state::mcu_port_r3_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/arcadia.cpp b/src/mame/drivers/arcadia.cpp
index aab239326d2..70c0080c646 100644
--- a/src/mame/drivers/arcadia.cpp
+++ b/src/mame/drivers/arcadia.cpp
@@ -479,7 +479,7 @@ void arcadia_state::arcadia(machine_config &config)
m_maincpu->sense_handler().set(FUNC(arcadia_state::vsync_r));
m_maincpu->set_periodic_int(FUNC(arcadia_state::video_line), attotime::from_hz(262*60));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/argus.cpp b/src/mame/drivers/argus.cpp
index ba98379d5c0..f503e2f5fb4 100644
--- a/src/mame/drivers/argus.cpp
+++ b/src/mame/drivers/argus.cpp
@@ -487,7 +487,7 @@ void argus_state::argus(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &argus_state::sound_map_a);
m_audiocpu->set_addrmap(AS_IO, &argus_state::sound_portmap_1);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -526,7 +526,7 @@ void valtric_state::valtric(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &valtric_state::sound_map_a);
m_audiocpu->set_addrmap(AS_IO, &valtric_state::sound_portmap_2);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -571,7 +571,7 @@ void butasan_state::butasan(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &butasan_state::sound_map_b);
m_audiocpu->set_addrmap(AS_IO, &butasan_state::sound_portmap_2);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp
index 8652d093d82..0af2be3c662 100644
--- a/src/mame/drivers/arkanoid.cpp
+++ b/src/mame/drivers/arkanoid.cpp
@@ -1350,7 +1350,7 @@ void arkanoid_state::arkanoid(machine_config &config)
ARKANOID_68705P5(config, m_mcuintf, 12_MHz_XTAL / 4); // verified on PCB
m_mcuintf->portb_r_cb().set(FUNC(arkanoid_state::input_mux_r));
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per second to synchronize between the MCU and the main CPU
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per second to synchronize between the MCU and the main CPU
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index 7ffc6833055..cebde8ce792 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -820,7 +820,7 @@ void artmagic_state::artmagic(machine_config &config)
m_tms->set_shiftreg_in_callback(FUNC(artmagic_state::to_shiftreg));
m_tms->set_shiftreg_out_callback(FUNC(artmagic_state::from_shiftreg));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
EEPROM_2816(config, "eeprom").write_time(attotime::from_usec(1)); // FIXME: false-readback polling should make this unnecessary
diff --git a/src/mame/drivers/astrohome.cpp b/src/mame/drivers/astrohome.cpp
index 947561e662f..dddcea45f54 100644
--- a/src/mame/drivers/astrohome.cpp
+++ b/src/mame/drivers/astrohome.cpp
@@ -184,7 +184,7 @@ void astrocde_home_state::astrocde(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &astrocde_home_state::astrocade_mem);
m_maincpu->set_addrmap(AS_IO, &astrocde_home_state::astrocade_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
MCFG_MACHINE_START_OVERRIDE(astrocde_home_state, astrocde)
diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp
index af14a96f464..09a8402a188 100644
--- a/src/mame/drivers/asuka.cpp
+++ b/src/mame/drivers/asuka.cpp
@@ -822,7 +822,7 @@ void asuka_state::bonzeadv(machine_config &config)
TIMER(config, "cchip_irq_clear").configure_generic(FUNC(asuka_state::cchip_irq_clear_cb));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, "watchdog");
@@ -870,7 +870,7 @@ void asuka_state::asuka(machine_config &config)
Z80(config, m_audiocpu, XTAL(16'000'000)/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &asuka_state::z80_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -937,7 +937,7 @@ void asuka_state::cadash(machine_config &config)
subcpu.set_addrmap(AS_PROGRAM, &asuka_state::cadash_sub_map);
subcpu.set_addrmap(AS_IO, &asuka_state::cadash_sub_io);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -993,7 +993,7 @@ void asuka_state::mofflott(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &asuka_state::z80_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -1056,7 +1056,7 @@ void asuka_state::eto(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &asuka_state::cadash_z80_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index 70edc599b38..279836c16aa 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -464,13 +464,13 @@ void at_vrom_fix_state::machine_start()
void at_state::cfg_single_1200K(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("525hd");
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
void at_state::cfg_single_360K(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("525dd");
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
static void pci_devices(device_slot_interface &device)
@@ -488,7 +488,7 @@ void at_state::ibm5170(machine_config &config)
maincpu.shutdown_callback().set("mb", FUNC(at_mb_device::shutdown));
AT_MB(config, m_mb, 0);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
m_mb->at_softlists(config);
@@ -593,7 +593,7 @@ void at_state::at386(machine_config &config)
AT_MB(config, m_mb, 0).at_softlists(config);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -768,7 +768,7 @@ void at_vrom_fix_state::megapcpla(machine_config &config)
AT_MB(config, m_mb, 0).at_softlists(config);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -800,7 +800,7 @@ void at_state::ficpio2(machine_config &config)
maincpu.set_irq_acknowledge_callback("mb:pic8259_master", FUNC(pic8259_device::inta_cb));
AT_MB(config, m_mb, 0).at_softlists(config);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ds12885_device &rtc(DS12885(config.replace(), "mb:rtc"));
rtc.irq().set("mb:pic8259_slave", FUNC(pic8259_device::ir0_w)); // this is in :mb
@@ -843,7 +843,7 @@ void at_state::comportiii(machine_config &config)
maincpu.shutdown_callback().set("mb", FUNC(at_mb_device::shutdown));
AT_MB(config, m_mb, 0).at_softlists(config);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
// FIXME: determine ISA bus clock
ISA16_SLOT(config, "board1", 0, "mb:isabus", pc_isa16_cards, "fdc", true).set_option_machine_config("fdc", cfg_single_1200K);
diff --git a/src/mame/drivers/attache.cpp b/src/mame/drivers/attache.cpp
index 090677ccf6e..c0038c6a572 100644
--- a/src/mame/drivers/attache.cpp
+++ b/src/mame/drivers/attache.cpp
@@ -1128,7 +1128,7 @@ void attache_state::attache(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &attache_state::attache_io);
m_maincpu->set_daisy_config(attache_daisy_chain);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER, rgb_t::green()));
screen.set_raw(12.324_MHz_XTAL, 784, 0, 640, 262, 0, 240);
@@ -1205,12 +1205,12 @@ void attache816_state::attache816(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &attache816_state::attache_io);
m_maincpu->set_daisy_config(attache_daisy_chain);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
I8086(config, m_extcpu, 24_MHz_XTAL / 3);
m_extcpu->set_addrmap(AS_PROGRAM, &attache816_state::attache_x86_map);
m_extcpu->set_addrmap(AS_IO, &attache816_state::attache_x86_io);
- config.m_perfect_cpu_quantum = subtag("extcpu");
+ config.set_perfect_quantum(m_extcpu);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER, rgb_t::green()));
screen.set_raw(12.324_MHz_XTAL, 784, 0, 640, 262, 0, 240);
diff --git a/src/mame/drivers/avigo.cpp b/src/mame/drivers/avigo.cpp
index a3942391265..7488b860100 100644
--- a/src/mame/drivers/avigo.cpp
+++ b/src/mame/drivers/avigo.cpp
@@ -755,7 +755,7 @@ void avigo_state::avigo(machine_config &config)
Z80(config, m_maincpu, 4000000);
m_maincpu->set_addrmap(AS_PROGRAM, &avigo_state::avigo_mem);
m_maincpu->set_addrmap(AS_IO, &avigo_state::avigo_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
NS16550(config, m_uart, XTAL(1'843'200));
m_uart->out_tx_callback().set(m_serport, FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp
index 2da3342872b..96dc660c8b4 100644
--- a/src/mame/drivers/balsente.cpp
+++ b/src/mame/drivers/balsente.cpp
@@ -1419,7 +1419,7 @@ void balsente_state::shrike(machine_config &config)
M68000(config, m_68k, 8000000);
m_68k->set_addrmap(AS_PROGRAM, &balsente_state::shrike68k_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
}
diff --git a/src/mame/drivers/baraduke.cpp b/src/mame/drivers/baraduke.cpp
index 2bcdb32d38c..b6fe401ccfa 100644
--- a/src/mame/drivers/baraduke.cpp
+++ b/src/mame/drivers/baraduke.cpp
@@ -376,7 +376,7 @@ void baraduke_state::baraduke(machine_config &config)
m_mcu->in_p2_cb().set_constant(0xff); /* leds won't work otherwise */
m_mcu->out_p2_cb().set(FUNC(baraduke_state::baraduke_lamps_w)); /* lamps */
- config.m_minimum_quantum = attotime::from_hz(6000); /* we need heavy synch */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* we need heavy synch */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/battlane.cpp b/src/mame/drivers/battlane.cpp
index 943394da42d..56ba430372c 100644
--- a/src/mame/drivers/battlane.cpp
+++ b/src/mame/drivers/battlane.cpp
@@ -282,7 +282,7 @@ void battlane_state::battlane(machine_config &config)
MC6809E(config, m_subcpu, 1500000);
m_subcpu->set_addrmap(AS_PROGRAM, &battlane_state::battlane_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp
index 761a78a0f9b..9f9f270e524 100644
--- a/src/mame/drivers/bbc.cpp
+++ b/src/mame/drivers/bbc.cpp
@@ -829,7 +829,7 @@ void bbc_state::bbca(machine_config &config)
M6502(config, m_maincpu, 16_MHz_XTAL / 8);
m_maincpu->set_addrmap(AS_PROGRAM, &bbc_state::bbca_mem);
m_maincpu->set_periodic_int(FUNC(bbc_state::bbcb_keyscan), attotime::from_hz(1000)); /* scan keyboard */
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, M6502_IRQ_LINE);
@@ -1081,7 +1081,7 @@ void bbc_state::torchh10(machine_config &config)
{
torchf(config);
/* fdc */
- m_i8271->subdevice<floppy_connector>("1")->set_default_option("");
+ m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* 10MB HDD */
@@ -1092,7 +1092,7 @@ void bbc_state::torchh21(machine_config &config)
{
torchf(config);
/* fdc */
- m_i8271->subdevice<floppy_connector>("1")->set_default_option("");
+ m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* 21MB HDD */
@@ -1162,7 +1162,7 @@ void bbcbp_state::abc110(machine_config &config)
{
bbcbp(config);
/* fdc */
- m_wd1770->subdevice<floppy_connector>("1")->set_default_option("");
+ m_wd1770->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* Acorn Z80 co-processor */
m_tube->set_default_option("z80");
@@ -1184,7 +1184,7 @@ void bbcbp_state::acw443(machine_config &config)
{
bbcbp(config);
/* fdc */
- m_wd1770->subdevice<floppy_connector>("1")->set_default_option("");
+ m_wd1770->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* 32016 co-processor */
//m_tube->set_default_option("32016");
@@ -1211,7 +1211,7 @@ void bbcbp_state::abc310(machine_config &config)
{
bbcbp(config);
/* fdc */
- m_wd1770->subdevice<floppy_connector>("1")->set_default_option("");
+ m_wd1770->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* Acorn 80286 co-processor */
m_tube->set_default_option("80286");
@@ -1317,7 +1317,7 @@ void bbcm_state::bbcm(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &bbcm_state::bbcm_mem);
m_maincpu->set_addrmap(AS_OPCODES, &bbcm_state::bbcm_fetch);
m_maincpu->set_periodic_int(FUNC(bbc_state::bbcb_keyscan), attotime::from_hz(1000)); /* scan keyboard */
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ADDRESS_MAP_BANK(config, m_bankdev).set_map(&bbcm_state::bbcm_bankdev).set_options(ENDIANNESS_LITTLE, 8, 16, 0x0400);
@@ -1608,8 +1608,8 @@ void bbcm_state::cfa3000(machine_config &config)
bbcm(config);
/* fdc */
- m_wd1770->subdevice<floppy_connector>("0")->set_default_option("");
- m_wd1770->subdevice<floppy_connector>("1")->set_default_option("");
+ m_wd1770->subdevice<floppy_connector>("0")->set_default_option(nullptr);
+ m_wd1770->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* keyboard */
m_userport->set_default_option("cfa3000kbd");
diff --git a/src/mame/drivers/bebox.cpp b/src/mame/drivers/bebox.cpp
index 31e6187d35d..f5a8a05ec49 100644
--- a/src/mame/drivers/bebox.cpp
+++ b/src/mame/drivers/bebox.cpp
@@ -146,7 +146,7 @@ pci_connector_device &bebox_state::add_pci_slot(machine_config &config, const ch
void bebox_state::bebox_peripherals(machine_config &config)
{
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
PIT8254(config, m_pit8254, 0);
m_pit8254->set_clk<0>(4772720/4); /* heartbeat IRQ */
diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp
index e035ee6c95a..404c53eb117 100644
--- a/src/mame/drivers/bfm_sc2.cpp
+++ b/src/mame/drivers/bfm_sc2.cpp
@@ -2282,7 +2282,7 @@ void bfm_sc2_vid_state::scorpion2_vid(machine_config &config)
MC6809(config, m_maincpu, MASTER_CLOCK); // MC68B09P (2 MHz bus)
m_maincpu->set_addrmap(AS_PROGRAM, &bfm_sc2_vid_state::memmap_vid); // setup scorpion2 board memorymap
m_maincpu->set_periodic_int(FUNC(bfm_sc2_vid_state::timer_irq), attotime::from_hz(1000)); // generate 1000 IRQ's per second
- config.m_minimum_quantum = attotime::from_hz(960); // needed for serial communication !!
+ config.set_maximum_quantum(attotime::from_hz(960)); // needed for serial communication !!
WATCHDOG_TIMER(config, "watchdog").set_time(PERIOD_OF_555_MONOSTABLE(120000,100e-9));
@@ -3808,7 +3808,7 @@ void bfm_sc2_awp_state::scorpion3(machine_config &config)
/* machine driver for scorpion2 board + matrix board */
void bfm_sc2_dmd_state::scorpion2_dm01(machine_config &config)
{
- config.m_minimum_quantum = attotime::from_hz(960); // needed for serial communication !!
+ config.set_maximum_quantum(attotime::from_hz(960)); // needed for serial communication !!
MC6809(config, m_maincpu, MASTER_CLOCK); // MC68B09P (2 MHz bus)
m_maincpu->set_addrmap(AS_PROGRAM, &bfm_sc2_dmd_state::memmap_no_vid);
m_maincpu->set_periodic_int(FUNC(bfm_sc2_dmd_state::timer_irq), attotime::from_hz(1000));
diff --git a/src/mame/drivers/bigevglf.cpp b/src/mame/drivers/bigevglf.cpp
index b1db2003440..ce0aa3614f9 100644
--- a/src/mame/drivers/bigevglf.cpp
+++ b/src/mame/drivers/bigevglf.cpp
@@ -405,7 +405,7 @@ void bigevglf_state::bigevglf(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 2000000); /* ??? */
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - interleaving is forced on the fly */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - interleaving is forced on the fly */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp
index 8eaa3814e21..da97855d14c 100644
--- a/src/mame/drivers/bking.cpp
+++ b/src/mame/drivers/bking.cpp
@@ -452,7 +452,7 @@ void bking_state::bking3(machine_config &config)
MCFG_MACHINE_START_OVERRIDE(bking_state,bking3)
MCFG_MACHINE_RESET_OVERRIDE(bking_state,bking3)
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
}
diff --git a/src/mame/drivers/bladestl.cpp b/src/mame/drivers/bladestl.cpp
index 490a09ffc21..94ebb553f50 100644
--- a/src/mame/drivers/bladestl.cpp
+++ b/src/mame/drivers/bladestl.cpp
@@ -313,7 +313,7 @@ void bladestl_state::bladestl(machine_config &config)
MC6809E(config, m_audiocpu, XTAL(24'000'000) / 16);
m_audiocpu->set_addrmap(AS_PROGRAM, &bladestl_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/blueprnt.cpp b/src/mame/drivers/blueprnt.cpp
index b99d4516e5b..54b7007b4c5 100644
--- a/src/mame/drivers/blueprnt.cpp
+++ b/src/mame/drivers/blueprnt.cpp
@@ -359,7 +359,7 @@ void blueprnt_state::blueprnt(machine_config &config)
m_audiocpu->set_periodic_int(FUNC(blueprnt_state::irq0_line_hold), attotime::from_hz(4*60)); // IRQs connected to 32V
// NMIs are caused by the main CPU
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp
index b7d5bafe055..2132ee2a9cc 100644
--- a/src/mame/drivers/bml3.cpp
+++ b/src/mame/drivers/bml3.cpp
@@ -970,22 +970,21 @@ void bml3_state::bml3_common(machine_config &config)
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
/* slot devices */
- bml3bus_device &bus(BML3BUS(config, "bml3bus", 0));
- bus.set_space(m_maincpu, AS_PROGRAM);
- bus.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
- bus.irq_callback().set_inputline(m_maincpu, M6809_IRQ_LINE);
- bus.firq_callback().set_inputline(m_maincpu, M6809_FIRQ_LINE);
- /* Default to MP-1805 disk (3" or 5.25" SS/SD), as our MB-6892 ROM dump includes
- the MP-1805 ROM.
+ BML3BUS(config, m_bml3bus, 0);
+ m_bml3bus->set_space(m_maincpu, AS_PROGRAM);
+ m_bml3bus->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_bml3bus->irq_callback().set_inputline(m_maincpu, M6809_IRQ_LINE);
+ m_bml3bus->firq_callback().set_inputline(m_maincpu, M6809_FIRQ_LINE);
+ /* Default to MP-1805 disk (3" or 5.25" SS/SD), as our MB-6892 ROM dump includes the MP-1805 ROM.
User may want to switch this to MP-1802 (5.25" DS/DD).
Note it isn't feasible to use both, as they each place boot ROM at F800.
*/
- BML3BUS_SLOT(config, "sl1", "bml3bus", bml3_cards, "bml3mp1805");
- BML3BUS_SLOT(config, "sl2", "bml3bus", bml3_cards, nullptr);
- BML3BUS_SLOT(config, "sl3", "bml3bus", bml3_cards, nullptr);
- BML3BUS_SLOT(config, "sl4", "bml3bus", bml3_cards, nullptr);
- BML3BUS_SLOT(config, "sl5", "bml3bus", bml3_cards, nullptr);
- BML3BUS_SLOT(config, "sl6", "bml3bus", bml3_cards, "bml3kanji");
+ BML3BUS_SLOT(config, "sl1", m_bml3bus, bml3_cards, "bml3mp1805");
+ BML3BUS_SLOT(config, "sl2", m_bml3bus, bml3_cards, nullptr);
+ BML3BUS_SLOT(config, "sl3", m_bml3bus, bml3_cards, nullptr);
+ BML3BUS_SLOT(config, "sl4", m_bml3bus, bml3_cards, nullptr);
+ BML3BUS_SLOT(config, "sl5", m_bml3bus, bml3_cards, nullptr);
+ BML3BUS_SLOT(config, "sl6", m_bml3bus, bml3_cards, "bml3kanji");
}
void bml3_state::bml3(machine_config &config)
diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp
index dd1f1a6c771..70422cf4541 100644
--- a/src/mame/drivers/bnstars.cpp
+++ b/src/mame/drivers/bnstars.cpp
@@ -853,7 +853,7 @@ void bnstars_state::bnstars(machine_config &config)
Z80(config, m_audiocpu, 4000000); // Unverified; it's possibly higher than 4MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &bnstars_state::bnstars_sound_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_bnstars);
diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp
index 87704cf3b5c..6c83bed34f2 100644
--- a/src/mame/drivers/bublbobl.cpp
+++ b/src/mame/drivers/bublbobl.cpp
@@ -863,7 +863,7 @@ void bublbobl_state::tokio(machine_config &config)
TAITO68705_MCU(config, "bmcu", MAIN_XTAL/8); // 3 Mhz
- config.m_perfect_cpu_quantum = subtag("maincpu"); // is this necessary?
+ config.set_perfect_quantum(m_maincpu); // is this necessary?
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // 74LS393, counts 128 vblanks before firing watchdog; same circuit as taitosj uses
@@ -972,7 +972,7 @@ void bublbobl_state::bublbobl_nomcu(machine_config &config)
Z80(config, m_audiocpu, MAIN_XTAL/8); // 3 MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &bublbobl_state::sound_map); // IRQs are triggered by the YM2203
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128); // 74LS393, counts 128 vblanks before firing watchdog; same circuit as taitosj uses
diff --git a/src/mame/drivers/bwing.cpp b/src/mame/drivers/bwing.cpp
index b7c493e2dc9..3b1b4570df8 100644
--- a/src/mame/drivers/bwing.cpp
+++ b/src/mame/drivers/bwing.cpp
@@ -377,7 +377,7 @@ void bwing_state::bwing(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &bwing_state::bwp3_io_map);
m_audiocpu->set_periodic_int(FUNC(bwing_state::bwp3_interrupt), attotime::from_hz(1000));
- config.m_minimum_quantum = attotime::from_hz(18000); // high enough?
+ config.set_maximum_quantum(attotime::from_hz(18000)); // high enough?
ADDRESS_MAP_BANK(config, "vrambank").set_map(&bwing_state::bank_map).set_options(ENDIANNESS_BIG, 8, 15, 0x2000);
diff --git a/src/mame/drivers/c128.cpp b/src/mame/drivers/c128.cpp
index 0aaf87a0966..f3502b4caf2 100644
--- a/src/mame/drivers/c128.cpp
+++ b/src/mame/drivers/c128.cpp
@@ -34,42 +34,36 @@
#include "video/mc6845.h"
#include "video/mos6566.h"
-#define Z80A_TAG "u10"
#define M8502_TAG "u6"
#define MOS8563_TAG "u22"
#define MOS8564_TAG "u21"
#define MOS8566_TAG "u21"
-#define MOS6581_TAG "u5"
-#define MOS6526_1_TAG "u1"
-#define MOS6526_2_TAG "u4"
#define MOS8721_TAG "u11"
-#define MOS8722_TAG "u7"
#define SCREEN_VIC_TAG "screen"
#define SCREEN_VDC_TAG "screen80"
#define CONTROL1_TAG "joy1"
#define CONTROL2_TAG "joy2"
-#define PET_USER_PORT_TAG "user"
class c128_state : public driver_device
{
public:
c128_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
- m_maincpu(*this, Z80A_TAG),
+ m_maincpu(*this, "u10"),
m_subcpu(*this, M8502_TAG),
m_nmi(*this, "nmi"),
- m_mmu(*this, MOS8722_TAG),
+ m_mmu(*this, "u7"),
m_pla(*this, MOS8721_TAG),
m_vdc(*this, MOS8563_TAG),
m_vic(*this, MOS8564_TAG),
- m_sid(*this, MOS6581_TAG),
- m_cia1(*this, MOS6526_1_TAG),
- m_cia2(*this, MOS6526_2_TAG),
+ m_sid(*this, "u5"),
+ m_cia1(*this, "u1"),
+ m_cia2(*this, "u4"),
m_iec(*this, CBM_IEC_TAG),
m_joy1(*this, CONTROL1_TAG),
m_joy2(*this, CONTROL2_TAG),
m_exp(*this, "exp"),
- m_user(*this, PET_USER_PORT_TAG),
+ m_user(*this, "user"),
m_ram(*this, RAM_TAG),
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
m_from(*this, "from"),
@@ -1638,7 +1632,6 @@ void c128_state::ntsc(machine_config &config)
Z80(config, m_maincpu, XTAL(14'318'181)*2/3.5/2);
m_maincpu->set_addrmap(AS_PROGRAM, &c128_state::z80_mem);
m_maincpu->set_addrmap(AS_IO, &c128_state::z80_io);
- config.m_perfect_cpu_quantum = subtag(Z80A_TAG);
M8502(config, m_subcpu, XTAL(14'318'181)*2/3.5/8);
m_subcpu->disable_cache(); // address decoding is 100% dynamic, no RAM/ROM banks
@@ -1646,7 +1639,7 @@ void c128_state::ntsc(machine_config &config)
m_subcpu->write_callback().set(FUNC(c128_state::cpu_w));
m_subcpu->set_pulls(0x07, 0x20);
m_subcpu->set_addrmap(AS_PROGRAM, &c128_state::m8502_mem);
- config.m_perfect_cpu_quantum = subtag(M8502_TAG);
+ config.set_perfect_quantum(m_subcpu);
input_merger_device &irq(INPUT_MERGER_ANY_HIGH(config, "irq"));
irq.output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
@@ -1825,7 +1818,6 @@ void c128_state::pal(machine_config &config)
Z80(config, m_maincpu, XTAL(17'734'472)*2/4.5/2);
m_maincpu->set_addrmap(AS_PROGRAM, &c128_state::z80_mem);
m_maincpu->set_addrmap(AS_IO, &c128_state::z80_io);
- config.m_perfect_cpu_quantum = subtag(Z80A_TAG);
M8502(config, m_subcpu, XTAL(17'734'472)*2/4.5/8);
m_subcpu->disable_cache(); // address decoding is 100% dynamic, no RAM/ROM banks
@@ -1833,7 +1825,7 @@ void c128_state::pal(machine_config &config)
m_subcpu->write_callback().set(FUNC(c128_state::cpu_w));
m_subcpu->set_pulls(0x07, 0x20);
m_subcpu->set_addrmap(AS_PROGRAM, &c128_state::m8502_mem);
- config.m_perfect_cpu_quantum = subtag(M8502_TAG);
+ config.set_perfect_quantum(m_subcpu);
input_merger_device &irq(INPUT_MERGER_ANY_HIGH(config, "irq"));
irq.output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/c64.cpp b/src/mame/drivers/c64.cpp
index da55973cb2e..417b8799f94 100644
--- a/src/mame/drivers/c64.cpp
+++ b/src/mame/drivers/c64.cpp
@@ -34,7 +34,6 @@
#include "sound/mos6581.h"
#include "video/mos6566.h"
-#define M6510_TAG "u7"
#define MOS6567_TAG "u19"
#define MOS6569_TAG "u19"
#define MOS6581_TAG "u18"
@@ -51,7 +50,7 @@ class c64_state : public driver_device
public:
c64_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
- m_maincpu(*this, M6510_TAG),
+ m_maincpu(*this, "u7"),
m_nmi(*this, "nmi"),
m_pla(*this, PLA_TAG),
m_vic(*this, MOS6569_TAG),
@@ -1447,7 +1446,7 @@ void c64_state::ntsc(machine_config &config)
m_maincpu->write_callback().set(FUNC(c64_state::cpu_w));
m_maincpu->set_pulls(0x17, 0xc8);
m_maincpu->set_dasm_override(FUNC(c64_state::dasm_override));
- config.m_perfect_cpu_quantum = subtag(M6510_TAG);
+ config.set_perfect_quantum(m_maincpu);
input_merger_device &irq(INPUT_MERGER_ANY_HIGH(config, "irq"));
irq.output_handler().set_inputline(m_maincpu, m6510_device::IRQ_LINE);
@@ -1457,7 +1456,7 @@ void c64_state::ntsc(machine_config &config)
// video hardware
mos6567_device &mos6567(MOS6567(config, MOS6567_TAG, XTAL(14'318'181)/14));
- mos6567.set_cpu(M6510_TAG);
+ mos6567.set_cpu(m_maincpu);
mos6567.irq_callback().set("irq", FUNC(input_merger_device::in_w<1>));
mos6567.set_screen(SCREEN_TAG);
mos6567.set_addrmap(0, &c64_state::vic_videoram_map);
@@ -1619,7 +1618,7 @@ void c64_state::pal(machine_config &config)
m_maincpu->write_callback().set(FUNC(c64_state::cpu_w));
m_maincpu->set_pulls(0x17, 0xc8);
m_maincpu->set_dasm_override(FUNC(c64_state::dasm_override));
- config.m_perfect_cpu_quantum = subtag(M6510_TAG);
+ config.set_perfect_quantum(m_maincpu);
input_merger_device &irq(INPUT_MERGER_ANY_HIGH(config, "irq"));
irq.output_handler().set_inputline(m_maincpu, m6510_device::IRQ_LINE);
@@ -1629,7 +1628,7 @@ void c64_state::pal(machine_config &config)
// video hardware
mos6569_device &mos6569(MOS6569(config, MOS6569_TAG, XTAL(17'734'472)/18));
- mos6569.set_cpu(M6510_TAG);
+ mos6569.set_cpu(m_maincpu);
mos6569.irq_callback().set("irq", FUNC(input_merger_device::in_w<1>));
mos6569.set_screen(SCREEN_TAG);
mos6569.set_addrmap(0, &c64_state::vic_videoram_map);
@@ -1767,7 +1766,7 @@ void c64gs_state::pal_gs(machine_config &config)
m_maincpu->write_callback().set(FUNC(c64gs_state::cpu_w));
m_maincpu->set_pulls(0x07, 0xc0);
m_maincpu->set_dasm_override(FUNC(c64_state::dasm_override));
- config.m_perfect_cpu_quantum = subtag(M6510_TAG);
+ config.set_perfect_quantum(m_maincpu);
input_merger_device &irq(INPUT_MERGER_ANY_HIGH(config, "irq"));
irq.output_handler().set_inputline(m_maincpu, m6510_device::IRQ_LINE);
@@ -1777,7 +1776,7 @@ void c64gs_state::pal_gs(machine_config &config)
// video hardware
mos8565_device &mos8565(MOS8565(config, MOS6569_TAG, XTAL(17'734'472)/18));
- mos8565.set_cpu(M6510_TAG);
+ mos8565.set_cpu(m_maincpu);
mos8565.irq_callback().set("irq", FUNC(input_merger_device::in_w<1>));
mos8565.set_screen(SCREEN_TAG);
mos8565.set_addrmap(0, &c64_state::vic_videoram_map);
diff --git a/src/mame/drivers/cabal.cpp b/src/mame/drivers/cabal.cpp
index 3b8ecee8592..07d91102288 100644
--- a/src/mame/drivers/cabal.cpp
+++ b/src/mame/drivers/cabal.cpp
@@ -590,7 +590,7 @@ void cabal_state::cabalbl(machine_config &config)
adpcm_2.set_addrmap(AS_IO, &cabal_state::cabalbl_talk2_portmap);
adpcm_2.set_periodic_int(FUNC(cabal_state::irq0_line_hold), attotime::from_hz(8000));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_START_OVERRIDE(cabal_state,cabalbl)
MCFG_MACHINE_RESET_OVERRIDE(cabal_state,cabalbl)
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index 49fcd7371fc..ecf26c46e4f 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -2491,7 +2491,7 @@ void cave_state::sailormn(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_state::sailormn_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_state::sailormn_sound_portmap);
-// config.m_minimum_quantum = attotime::from_hz(600);
+// config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(cave_state,sailormn)
EEPROM_93C46_16BIT(config, m_eeprom);
diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp
index cdfe8850ea5..317a5047c9d 100644
--- a/src/mame/drivers/cbm2.cpp
+++ b/src/mame/drivers/cbm2.cpp
@@ -37,7 +37,6 @@
#include "video/mc6845.h"
#include "video/mos6566.h"
-#define M6509_TAG "u13"
#define PLA1_TAG "u78"
#define PLA2_TAG "u88"
#define MOS6567_TAG "u23"
@@ -67,7 +66,7 @@ class cbm2_state : public driver_device
public:
cbm2_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
- m_maincpu(*this, M6509_TAG),
+ m_maincpu(*this, "u13"),
m_pla1(*this, PLA1_TAG),
m_crtc(*this, MC68B45_TAG),
m_palette(*this, "palette"),
@@ -2251,13 +2250,13 @@ void p500_state::p500_ntsc(machine_config &config)
M6509(config, m_maincpu, XTAL(14'318'181)/14);
m_maincpu->disable_cache(); // address decoding is 100% dynamic, no RAM/ROM banks
m_maincpu->set_addrmap(AS_PROGRAM, &p500_state::p500_mem);
- config.m_perfect_cpu_quantum = subtag(M6509_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, m6509_device::IRQ_LINE);
// video hardware
mos6567_device &mos6567(MOS6567(config, MOS6567_TAG, XTAL(14'318'181)/14));
- mos6567.set_cpu(M6509_TAG);
+ mos6567.set_cpu(m_maincpu);
mos6567.irq_callback().set("mainirq", FUNC(input_merger_device::in_w<0>));
mos6567.set_screen(SCREEN_TAG);
mos6567.set_addrmap(0, &p500_state::vic_videoram_map);
@@ -2385,13 +2384,13 @@ void p500_state::p500_pal(machine_config &config)
M6509(config, m_maincpu, XTAL(17'734'472)/18);
m_maincpu->disable_cache(); // address decoding is 100% dynamic, no RAM/ROM banks
m_maincpu->set_addrmap(AS_PROGRAM, &p500_state::p500_mem);
- config.m_perfect_cpu_quantum = subtag(M6509_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, m6509_device::IRQ_LINE);
// video hardware
mos6569_device &mos6569(MOS6569(config, MOS6569_TAG, XTAL(17'734'472)/18));
- mos6569.set_cpu(M6509_TAG);
+ mos6569.set_cpu(m_maincpu);
mos6569.irq_callback().set("mainirq", FUNC(input_merger_device::in_w<0>));
mos6569.set_screen(SCREEN_TAG);
mos6569.set_addrmap(0, &p500_state::vic_videoram_map);
@@ -2516,7 +2515,7 @@ void cbm2_state::cbm2lp_ntsc(machine_config &config)
M6509(config, m_maincpu, XTAL(18'000'000)/9);
m_maincpu->disable_cache(); // address decoding is 100% dynamic, no RAM/ROM banks
m_maincpu->set_addrmap(AS_PROGRAM, &cbm2_state::cbm2_mem);
- config.m_perfect_cpu_quantum = subtag(M6509_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, m6509_device::IRQ_LINE);
diff --git a/src/mame/drivers/cedar_magnet.cpp b/src/mame/drivers/cedar_magnet.cpp
index ef1eae39cea..a4f3271358a 100644
--- a/src/mame/drivers/cedar_magnet.cpp
+++ b/src/mame/drivers/cedar_magnet.cpp
@@ -813,7 +813,7 @@ void cedar_magnet_state::cedar_magnet(machine_config &config)
CEDAR_MAGNET_FLOP(config, "flop", 0);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
}
diff --git a/src/mame/drivers/chaknpop.cpp b/src/mame/drivers/chaknpop.cpp
index 01feb17a84e..35e562ca90d 100644
--- a/src/mame/drivers/chaknpop.cpp
+++ b/src/mame/drivers/chaknpop.cpp
@@ -370,7 +370,7 @@ void chaknpop_state::chaknpop(machine_config &config)
m_maincpu->set_vblank_int("screen", FUNC(chaknpop_state::irq0_line_hold));
TAITO68705_MCU(config, m_bmcu, XTAL(18'000'000) / 6); // Verified on PCB
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index fdd72fad564..5068d265c6e 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -536,7 +536,7 @@ void champbas_state::talbot(machine_config &config)
m_mainlatch->q_out_cb<7>().set(FUNC(champbas_state::mcu_switch_w));
ALPHA_8201(config, m_alpha_8201, XTAL(18'432'000)/6/8);
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 0x10);
@@ -618,7 +618,7 @@ void champbas_state::champbasj(machine_config &config)
m_mainlatch->q_out_cb<7>().set(FUNC(champbas_state::mcu_switch_w));
ALPHA_8201(config, m_alpha_8201, XTAL(18'432'000)/6/8); // note: 8302 rom on champbb2 (same device!)
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
}
@@ -689,7 +689,7 @@ void exctsccr_state::exctsccr(machine_config &config)
exc_snd_irq.set_start_delay(attotime::from_hz(75));
ALPHA_8201(config, m_alpha_8201, XTAL(18'432'000)/6/8); // note: 8302 rom, or 8303 on exctscc2 (same device!)
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 0x10);
@@ -747,7 +747,7 @@ void exctsccr_state::exctsccrb(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &exctsccr_state::champbas_sound_map);
ALPHA_8201(config, m_alpha_8201, XTAL(18'432'000)/6/8); // champbasj 8201 on pcb, though unused
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 0x10);
diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp
index 9b789fcb629..d4de95909e8 100644
--- a/src/mame/drivers/chihiro.cpp
+++ b/src/mame/drivers/chihiro.cpp
@@ -511,11 +511,11 @@ int jvs_master::received_packet(uint8_t *buffer)
DECLARE_DEVICE_TYPE(OHCI_HLEAN2131QC, ohci_hlean2131qc_device)
-class ohci_hlean2131qc_device : public device_t, public ohci_function, public device_slot_card_interface
+class ohci_hlean2131qc_device : public device_t, public device_usb_ohci_function_interface
{
public:
ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void initialize(running_machine &machine) override;
+ void initialize() override;
int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override;
int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) override;
void set_region_base(uint8_t *data);
@@ -569,11 +569,11 @@ DEFINE_DEVICE_TYPE(OHCI_HLEAN2131QC, ohci_hlean2131qc_device, "ohci_hlean2131qc"
DECLARE_DEVICE_TYPE(OHCI_HLEAN2131SC, ohci_hlean2131sc_device)
-class ohci_hlean2131sc_device : public device_t, public ohci_function, public device_slot_card_interface
+class ohci_hlean2131sc_device : public device_t, public device_usb_ohci_function_interface
{
public:
ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void initialize(running_machine &machine) override;
+ void initialize() override;
int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override;
int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) override;
void set_region_base(uint8_t *data);
@@ -876,8 +876,7 @@ const uint8_t ohci_hlean2131qc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0
ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, OHCI_HLEAN2131QC, tag, owner, clock)
- , ohci_function()
- , device_slot_card_interface(mconfig, *this)
+ , device_usb_ohci_function_interface(mconfig, *this)
, m_jvs_master(*this, "^^^^jvs_master")
{
maximum_send = 0;
@@ -889,9 +888,9 @@ ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig,
jvs.buffer_out_packets = 0;
}
-void ohci_hlean2131qc_device::initialize(running_machine &machine)
+void ohci_hlean2131qc_device::initialize()
{
- ohci_function::initialize(machine);
+ device_usb_ohci_function_interface::initialize();
add_device_descriptor(devdesc);
add_configuration_descriptor(condesc);
add_interface_descriptor(intdesc);
@@ -1184,7 +1183,7 @@ void ohci_hlean2131qc_device::process_jvs_packet()
void ohci_hlean2131qc_device::device_start()
{
- initialize(machine());
+ initialize();
if (region_tag)
set_region_base(memregion(region_tag)->base() + region_offset);
}
@@ -1205,8 +1204,7 @@ const uint8_t ohci_hlean2131sc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0
ohci_hlean2131sc_device::ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, OHCI_HLEAN2131SC, tag, owner, clock)
- , ohci_function()
- , device_slot_card_interface(mconfig, *this)
+ , device_usb_ohci_function_interface(mconfig, *this)
{
region = nullptr;
region_tag = nullptr;
@@ -1227,9 +1225,9 @@ void ohci_hlean2131sc_device::set_region(const char *_region_tag, int _region_of
region_offset = _region_offset;
}
-void ohci_hlean2131sc_device::initialize(running_machine &machine)
+void ohci_hlean2131sc_device::initialize()
{
- ohci_function::initialize(machine);
+ device_usb_ohci_function_interface::initialize();
add_device_descriptor(devdesc);
add_configuration_descriptor(condesc);
add_interface_descriptor(intdesc);
@@ -1516,7 +1514,7 @@ void ohci_hlean2131sc_device::process_packet()
void ohci_hlean2131sc_device::device_start()
{
- initialize(machine());
+ initialize();
if (region_tag)
set_region_base(memregion(region_tag)->base() + region_offset);
}
diff --git a/src/mame/drivers/chinagat.cpp b/src/mame/drivers/chinagat.cpp
index 82ee3379f5d..6b9b2080801 100644
--- a/src/mame/drivers/chinagat.cpp
+++ b/src/mame/drivers/chinagat.cpp
@@ -758,7 +758,7 @@ void chinagat_state::chinagat(machine_config &config)
Z80(config, m_soundcpu, XTAL(3'579'545)); /* 3.579545 MHz */
m_soundcpu->set_addrmap(AS_PROGRAM, &chinagat_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* heavy interleaving to sync up sprite<->main cpu's */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* heavy interleaving to sync up sprite<->main cpu's */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -805,7 +805,7 @@ void chinagat_state::saiyugoub1(machine_config &config)
mcu.p1_out_cb().set(FUNC(chinagat_state::saiyugoub1_adpcm_rom_addr_w));
mcu.p2_out_cb().set(FUNC(chinagat_state::saiyugoub1_adpcm_control_w));
- config.m_minimum_quantum = attotime::from_hz(6000); /* heavy interleaving to sync up sprite<->main cpu's */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* heavy interleaving to sync up sprite<->main cpu's */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -846,7 +846,7 @@ void chinagat_state::saiyugoub2(machine_config &config)
Z80(config, m_soundcpu, XTAL(3'579'545)); /* 3.579545 MHz oscillator */
m_soundcpu->set_addrmap(AS_PROGRAM, &chinagat_state::ym2203c_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* heavy interleaving to sync up sprite<->main cpu's */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* heavy interleaving to sync up sprite<->main cpu's */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/chqflag.cpp b/src/mame/drivers/chqflag.cpp
index 0a55ecf795d..d5a94d0f287 100644
--- a/src/mame/drivers/chqflag.cpp
+++ b/src/mame/drivers/chqflag.cpp
@@ -327,7 +327,7 @@ void chqflag_state::chqflag(machine_config &config)
ADDRESS_MAP_BANK(config, m_bank1000).set_map(&chqflag_state::bank1000_map).set_options(ENDIANNESS_BIG, 8, 13, 0x1000);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp
index aca6f21c8cc..0dffc3ef63e 100644
--- a/src/mame/drivers/cischeat.cpp
+++ b/src/mame/drivers/cischeat.cpp
@@ -1934,7 +1934,7 @@ void cischeat_state::bigrun(machine_config &config)
// timing set by the YM irqhandler
// m_soundcpu->set_periodic_int(FUNC(cischeat_state::irq4_line_hold), attotime::from_hz(16*30));
- config.m_minimum_quantum = attotime::from_hz(1200);
+ config.set_maximum_quantum(attotime::from_hz(1200));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -2051,7 +2051,7 @@ void cischeat_state::f1gpstr2(machine_config &config)
M68000(config, m_cpu5, 10000000);
m_cpu5->set_addrmap(AS_PROGRAM, &cischeat_state::f1gpstr2_io_map);
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
}
diff --git a/src/mame/drivers/cloak.cpp b/src/mame/drivers/cloak.cpp
index 12380e6dfde..3a9606f1cbb 100644
--- a/src/mame/drivers/cloak.cpp
+++ b/src/mame/drivers/cloak.cpp
@@ -324,7 +324,7 @@ void cloak_state::cloak(machine_config &config)
m_slave->set_addrmap(AS_PROGRAM, &cloak_state::slave_map);
m_slave->set_periodic_int(FUNC(cloak_state::irq0_line_hold), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(1000);
+ config.set_maximum_quantum(attotime::from_hz(1000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp
index db1adbf9dd8..db105420969 100644
--- a/src/mame/drivers/cmi.cpp
+++ b/src/mame/drivers/cmi.cpp
@@ -1626,12 +1626,11 @@ void cmi_state::cmi2x(machine_config &config)
MC6809E(config, m_maincpu1, Q209_CPU_CLOCK);
m_maincpu1->set_addrmap(AS_PROGRAM, &cmi_state::maincpu1_map);
m_maincpu1->set_irq_acknowledge_callback(FUNC(cmi_state::cpu1_interrupt_callback));
- config.m_perfect_cpu_quantum = subtag("maincpu1");
+ config.set_perfect_quantum(m_maincpu1);
MC6809E(config, m_maincpu2, Q209_CPU_CLOCK);
m_maincpu2->set_addrmap(AS_PROGRAM, &cmi_state::maincpu2_map);
m_maincpu2->set_irq_acknowledge_callback(FUNC(cmi_state::cpu2_interrupt_callback));
- config.m_perfect_cpu_quantum = subtag("maincpu2");
M68000(config, m_midicpu, 20_MHz_XTAL / 2);
m_midicpu->set_addrmap(AS_PROGRAM, &cmi_state::midicpu_map);
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp
index 1323717d2ae..7865876e996 100644
--- a/src/mame/drivers/cntsteer.cpp
+++ b/src/mame/drivers/cntsteer.cpp
@@ -1004,8 +1004,7 @@ void cntsteer_state::cntsteer(machine_config &config)
screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI); // ?
screen.screen_vblank().append(FUNC(cntsteer_state::subcpu_vblank_irq)); // ?
- config.m_perfect_cpu_quantum = subtag("maincpu");
- config.m_perfect_cpu_quantum = subtag("subcpu");
+ config.set_perfect_quantum(m_subcpu);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cntsteer);
PALETTE(config, m_palette, FUNC(cntsteer_state::cntsteer_palette), 256);
@@ -1042,7 +1041,7 @@ void cntsteer_state::zerotrgt(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &cntsteer_state::sound_map);
m_audiocpu->set_periodic_int(FUNC(cntsteer_state::sound_interrupt), attotime::from_hz(480));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(cntsteer_state,zerotrgt)
MCFG_MACHINE_RESET_OVERRIDE(cntsteer_state,zerotrgt)
diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp
index adc7b603c27..3c2339d98b8 100644
--- a/src/mame/drivers/cobra.cpp
+++ b/src/mame/drivers/cobra.cpp
@@ -3295,7 +3295,7 @@ void cobra_state::cobra(machine_config &config)
m_gfxcpu->set_bus_frequency(XTAL(66'666'700)); /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
m_gfxcpu->set_addrmap(AS_PROGRAM, &cobra_state::cobra_gfx_map);
- config.m_minimum_quantum = attotime::from_hz(15005);
+ config.set_maximum_quantum(attotime::from_hz(15005));
PCI_BUS_LEGACY(config, m_legacy_pci, 0, 0);
m_legacy_pci->set_device(0, FUNC(cobra_state::mpc106_pci_r), FUNC(cobra_state::mpc106_pci_w));
diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp
index 24c92c6fc82..6a8ba7d7c92 100644
--- a/src/mame/drivers/combatsc.cpp
+++ b/src/mame/drivers/combatsc.cpp
@@ -710,7 +710,7 @@ void combatsc_state::combatsc(machine_config &config)
Z80(config, m_audiocpu, 3579545); /* 3.579545 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &combatsc_state::combatsc_sound_map);
- config.m_minimum_quantum = attotime::from_hz(1200);
+ config.set_maximum_quantum(attotime::from_hz(1200));
MCFG_MACHINE_START_OVERRIDE(combatsc_state,combatsc)
@@ -762,7 +762,7 @@ void combatsc_state::combatscb(machine_config &config)
Z80(config, m_audiocpu, 3579545); /* 3.579545 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &combatsc_state::combatscb_sound_map);
- config.m_minimum_quantum = attotime::from_hz(1200);
+ config.set_maximum_quantum(attotime::from_hz(1200));
MCFG_MACHINE_START_OVERRIDE(combatsc_state,combatscb)
diff --git a/src/mame/drivers/concept.cpp b/src/mame/drivers/concept.cpp
index ebd7edca544..be1c48b03b1 100644
--- a/src/mame/drivers/concept.cpp
+++ b/src/mame/drivers/concept.cpp
@@ -213,7 +213,7 @@ void concept_state::concept(machine_config &config)
M68000(config, m_maincpu, 16.364_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &concept_state::concept_memmap);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/contra.cpp b/src/mame/drivers/contra.cpp
index 4c13d4b0a6e..085acf4903b 100644
--- a/src/mame/drivers/contra.cpp
+++ b/src/mame/drivers/contra.cpp
@@ -215,7 +215,7 @@ void contra_state::contra(machine_config &config)
MC6809E(config, m_audiocpu, XTAL(24'000'000)/8); /* 3000000? (HD68B09EP) */
m_audiocpu->set_addrmap(AS_PROGRAM, &contra_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* enough for the sound CPU to read all commands */
/* video hardware */
diff --git a/src/mame/drivers/crgolf.cpp b/src/mame/drivers/crgolf.cpp
index e44dcaa034b..b576db312ed 100644
--- a/src/mame/drivers/crgolf.cpp
+++ b/src/mame/drivers/crgolf.cpp
@@ -476,7 +476,7 @@ void crgolf_state::crgolf(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &crgolf_state::sound_map);
m_audiocpu->set_vblank_int("screen", FUNC(crgolf_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
ls259_device &mainlatch(LS259(config, "mainlatch")); // 1H
mainlatch.q_out_cb<3>().set(FUNC(crgolf_state::color_select_w));
diff --git a/src/mame/drivers/cubeqst.cpp b/src/mame/drivers/cubeqst.cpp
index 02b404339d9..86b0ff13303 100644
--- a/src/mame/drivers/cubeqst.cpp
+++ b/src/mame/drivers/cubeqst.cpp
@@ -542,7 +542,7 @@ void cubeqst_state::cubeqst(machine_config &config)
m_soundcpu->dac_w().set(FUNC(cubeqst_state::sound_dac_w));
m_soundcpu->set_sound_region("soundproms");
- config.m_minimum_quantum = attotime::from_hz(48000);
+ config.set_maximum_quantum(attotime::from_hz(48000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index dc1bb096aa3..90ebdc47c27 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -409,7 +409,7 @@ void cyberbal_state::cyberbal_base(machine_config &config)
m_daccpu->set_addrmap(AS_PROGRAM, &cyberbal_state::sound_68k_map);
m_daccpu->set_periodic_int(FUNC(cyberbal_state::sound_68k_irq_gen), attotime::from_hz(10000));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/cybertnk.cpp b/src/mame/drivers/cybertnk.cpp
index 87dd4c34787..ea23f66f52d 100644
--- a/src/mame/drivers/cybertnk.cpp
+++ b/src/mame/drivers/cybertnk.cpp
@@ -833,7 +833,7 @@ void cybertnk_state::cybertnk(machine_config &config)
Z80(config, m_audiocpu, XTAL(3'579'545));
m_audiocpu->set_addrmap(AS_PROGRAM, &cybertnk_state::sound_mem);
- config.m_minimum_quantum = attotime::from_hz(60000); //arbitrary value, needed to get the communication to work
+ config.set_maximum_quantum(attotime::from_hz(60000)); //arbitrary value, needed to get the communication to work
/* video hardware */
config.set_default_layout(layout_dualhsxs);
diff --git a/src/mame/drivers/dai.cpp b/src/mame/drivers/dai.cpp
index cf083900922..7bc2af9a8e2 100644
--- a/src/mame/drivers/dai.cpp
+++ b/src/mame/drivers/dai.cpp
@@ -194,7 +194,7 @@ void dai_state::dai(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &dai_state::dai_mem);
m_maincpu->set_addrmap(AS_IO, &dai_state::dai_io);
m_maincpu->set_irq_acknowledge_callback(FUNC(dai_state::int_ack));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
PIT8253(config, m_pit, 0);
m_pit->set_clk<0>(2000000);
diff --git a/src/mame/drivers/darius.cpp b/src/mame/drivers/darius.cpp
index 6f73450b235..89067a67306 100644
--- a/src/mame/drivers/darius.cpp
+++ b/src/mame/drivers/darius.cpp
@@ -705,7 +705,7 @@ void darius_state::darius(machine_config &config)
m_adpcm->set_addrmap(AS_PROGRAM, &darius_state::darius_sound2_map);
m_adpcm->set_addrmap(AS_IO, &darius_state::darius_sound2_io_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame ? */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame ? */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp
index 4795bae0eda..0097d2fe67d 100644
--- a/src/mame/drivers/dassault.cpp
+++ b/src/mame/drivers/dassault.cpp
@@ -538,8 +538,8 @@ void dassault_state::dassault(machine_config &config)
m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
-// config.m_minimum_quantum = attotime::from_hz(8400); /* 140 CPU slices per frame */
- config.m_perfect_cpu_quantum = subtag("maincpu"); // I was seeing random lockups.. let's see if this helps
+// config.set_maximum_quantum(attotime::from_hz(8400)); /* 140 CPU slices per frame */
+ config.set_perfect_quantum(m_maincpu); // I was seeing random lockups.. let's see if this helps
mb8421_mb8431_16_device &sharedram(MB8421_MB8431_16BIT(config, "sharedram"));
sharedram.intl_callback().set_inputline("maincpu", M68K_IRQ_5);
diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp
index 4b9230db575..53febd006ad 100644
--- a/src/mame/drivers/dblewing.cpp
+++ b/src/mame/drivers/dblewing.cpp
@@ -352,7 +352,7 @@ void dblewing_state::dblewing(machine_config &config)
INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline(m_audiocpu, 0);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp
index 0f3523be9e8..37903e032fa 100644
--- a/src/mame/drivers/ddayjlc.cpp
+++ b/src/mame/drivers/ddayjlc.cpp
@@ -609,7 +609,7 @@ void ddayjlc_state::ddayjlc(machine_config &config)
Z80(config, m_audiocpu, 12000000/4);
m_audiocpu->set_addrmap(AS_PROGRAM, &ddayjlc_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp
index d9f13ffd2b0..01f72a7197b 100644
--- a/src/mame/drivers/ddragon.cpp
+++ b/src/mame/drivers/ddragon.cpp
@@ -954,7 +954,7 @@ void ddragon_state::ddragon(machine_config &config)
MC6809(config, m_soundcpu, MAIN_CLOCK / 2); /* HD68A09P, 6 MHz / 4 internally */
m_soundcpu->set_addrmap(AS_PROGRAM, &ddragon_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(60000); /* heavy interleaving to sync up sprite<->main CPUs */
+ config.set_maximum_quantum(attotime::from_hz(60000)); /* heavy interleaving to sync up sprite<->main CPUs */
MCFG_MACHINE_START_OVERRIDE(ddragon_state,ddragon)
MCFG_MACHINE_RESET_OVERRIDE(ddragon_state,ddragon)
@@ -1025,7 +1025,7 @@ void ddragon_state::ddragon6809(machine_config &config)
MC6809E(config, m_soundcpu, MAIN_CLOCK / 8); /* 1.5 MHz */
m_soundcpu->set_addrmap(AS_PROGRAM, &ddragon_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(60000); /* heavy interleaving to sync up sprite<->main CPUs */
+ config.set_maximum_quantum(attotime::from_hz(60000)); /* heavy interleaving to sync up sprite<->main CPUs */
MCFG_MACHINE_START_OVERRIDE(ddragon_state,ddragon)
MCFG_MACHINE_RESET_OVERRIDE(ddragon_state,ddragon)
@@ -1076,7 +1076,7 @@ void ddragon_state::ddragon2(machine_config &config)
Z80(config, m_soundcpu, 3579545);
m_soundcpu->set_addrmap(AS_PROGRAM, &ddragon_state::dd2_sound_map);
- config.m_minimum_quantum = attotime::from_hz(60000); /* heavy interleaving to sync up sprite<->main CPUs */
+ config.set_maximum_quantum(attotime::from_hz(60000)); /* heavy interleaving to sync up sprite<->main CPUs */
MCFG_MACHINE_START_OVERRIDE(ddragon_state,ddragon)
MCFG_MACHINE_RESET_OVERRIDE(ddragon_state,ddragon)
diff --git a/src/mame/drivers/ddribble.cpp b/src/mame/drivers/ddribble.cpp
index e632afca03c..0d2a055b07e 100644
--- a/src/mame/drivers/ddribble.cpp
+++ b/src/mame/drivers/ddribble.cpp
@@ -269,7 +269,7 @@ void ddribble_state::ddribble(machine_config &config)
mc6809e_device &cpu2(MC6809E(config, "cpu2", XTAL(18'432'000)/12)); /* verified on pcb */
cpu2.set_addrmap(AS_PROGRAM, &ddribble_state::cpu2_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* we need heavy synch */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* we need heavy synch */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/deadang.cpp b/src/mame/drivers/deadang.cpp
index 4668803308a..69d4f137a3b 100644
--- a/src/mame/drivers/deadang.cpp
+++ b/src/mame/drivers/deadang.cpp
@@ -371,7 +371,7 @@ void deadang_state::deadang(machine_config &config)
SEI80BU(config, "sei80bu", 0).set_device_rom_tag("audiocpu");
- config.m_minimum_quantum = attotime::from_hz(60); // the game stops working with higher interleave rates..
+ config.set_maximum_quantum(attotime::from_hz(60)); // the game stops working with higher interleave rates..
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index 8d7304198ad..8c7050aa4e3 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -2045,7 +2045,7 @@ void dec0_state::birdtry(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &dec0_state::dec0_tb_map);
// needs a tight sync with the mcu
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
i8751_device &mcu(I8751(config, m_mcu, XTAL(8'000'000)));
mcu.port_in_cb<0>().set(FUNC(dec0_state::dec0_mcu_port0_r));
@@ -2076,7 +2076,7 @@ void dec0_state::robocop(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &dec0_state::robocop_sub_map);
m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
- config.m_minimum_quantum = attotime::from_hz(3000); /* Interleave between HuC6280 & 68000 */
+ config.set_maximum_quantum(attotime::from_hz(3000)); /* Interleave between HuC6280 & 68000 */
/* video hardware */
m_screen->set_screen_update(FUNC(dec0_state::screen_update_robocop));
@@ -2102,7 +2102,7 @@ void dec0_state::hippodrm(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &dec0_state::hippodrm_sub_map);
m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
- config.m_minimum_quantum = attotime::from_hz(300); /* Interleave between H6280 & 68000 */
+ config.set_maximum_quantum(attotime::from_hz(300)); /* Interleave between H6280 & 68000 */
/* video hardware */
m_screen->set_screen_update(FUNC(dec0_state::screen_update_hippodrm));
@@ -2118,7 +2118,7 @@ void dec0_state::ffantasybl(machine_config &config)
// m_subcpu->set_addrmap(AS_PROGRAM, &dec0_state::hippodrm_sub_map);
// m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
-// config.m_minimum_quantum = attotime::from_hz(300); /* Interleave between H6280 & 68000 */
+// config.set_maximum_quantum(attotime::from_hz(300)); /* Interleave between H6280 & 68000 */
/* video hardware */
m_screen->set_screen_update(FUNC(dec0_state::screen_update_hippodrm));
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index 09927ceef9a..700c205cbf1 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -1904,7 +1904,7 @@ void dec8_state::lastmisn(machine_config &config)
m_mcu->port_out_cb<2>().set(FUNC(dec8_state::shackled_mcu_to_main_w));
m_mcu->port_in_cb<3>().set_ioport("I8751");
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
INPUT_MERGER_ANY_LOW(config, "coin").output_handler().set(FUNC(dec8_state::shackled_coin_irq));
@@ -1963,8 +1963,8 @@ void dec8_state::shackled(machine_config &config)
m_mcu->port_out_cb<2>().set(FUNC(dec8_state::shackled_mcu_to_main_w));
m_mcu->port_in_cb<3>().set_ioport("I8751");
-// config.m_minimum_quantum = attotime::from_hz(100000);
- config.m_perfect_cpu_quantum = subtag("maincpu"); // needs heavy sync, otherwise one of the two CPUs will miss an IRQ and cause the game to hang
+// config.set_maximum_quantum(attotime::from_hz(100000));
+ config.set_perfect_quantum(m_maincpu); // needs heavy sync, otherwise one of the two CPUs will miss an IRQ and cause the game to hang
INPUT_MERGER_ANY_LOW(config, "coin").output_handler().set(FUNC(dec8_state::shackled_coin_irq));
@@ -2194,7 +2194,7 @@ void dec8_state::csilver(machine_config &config)
M6502(config, m_audiocpu, XTAL(12'000'000)/8); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &dec8_state::csilver_s_map); /* NMIs are caused by the main CPU */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram);
@@ -2249,7 +2249,7 @@ void dec8_state::oscar(machine_config &config)
DECO_222(config, m_audiocpu, XTAL(12'000'000)/8); // IC labeled "C10707-1"
m_audiocpu->set_addrmap(AS_PROGRAM, &dec8_state::oscar_s_map); /* NMIs are caused by the main CPU */
- config.m_minimum_quantum = attotime::from_hz(2400); /* 40 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(2400)); /* 40 CPU slices per frame */
INPUT_MERGER_ANY_LOW(config, "coin").output_handler().set(FUNC(dec8_state::oscar_coin_irq)); // 1S1588 x3 (D1-D3) + RCDM-I5
@@ -2308,7 +2308,7 @@ void dec8_state::srdarwin(machine_config &config)
m_mcu->port_out_cb<2>().set(FUNC(dec8_state::srdarwin_mcu_to_main_w));
m_mcu->port_in_cb<3>().set_ioport("I8751");
- config.m_perfect_cpu_quantum = subtag("maincpu"); /* needed for stability with emulated MCU or sometimes commands get missed and game crashes at bosses */
+ config.set_perfect_quantum(m_maincpu); /* needed for stability with emulated MCU or sometimes commands get missed and game crashes at bosses */
/* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram);
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index 15467e651c0..0a1ec977be0 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -2176,7 +2176,7 @@ void dragngun_state::lockload(machine_config &config)
m_deco_irq->vblank_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<1>));
m_deco_irq->lightgun_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<2>));
- config.m_minimum_quantum = attotime::from_hz(6000); /* to improve main<->audio comms */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* to improve main<->audio comms */
EEPROM_93C46_16BIT(config, m_eeprom);
@@ -2332,7 +2332,7 @@ void nslasher_state::nslasher(machine_config &config)
INPUT_MERGER_ANY_HIGH(config, "sound_irq_merger").output_handler().set_inputline("audiocpu", INPUT_LINE_IRQ0);
- config.m_minimum_quantum = attotime::from_hz(6000); /* to improve main<->audio comms */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* to improve main<->audio comms */
EEPROM_93C46_16BIT(config, m_eeprom);
diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp
index eaf854cb359..4bd6956bff9 100644
--- a/src/mame/drivers/deco_ld.cpp
+++ b/src/mame/drivers/deco_ld.cpp
@@ -471,7 +471,7 @@ void deco_ld_state::rblaster(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &deco_ld_state::rblaster_sound_map);
m_audiocpu->set_periodic_int(FUNC(deco_ld_state::sound_interrupt), attotime::from_hz(640));
-// config.m_minimum_quantum = attotime::from_hz(6000);
+// config.set_maximum_quantum(attotime::from_hz(6000));
SONY_LDP1000(config, m_laserdisc, 0);
m_laserdisc->set_overlay(256, 256, FUNC(deco_ld_state::screen_update_rblaster));
diff --git a/src/mame/drivers/decocass.cpp b/src/mame/drivers/decocass.cpp
index d33582d19e4..ff4197d2a33 100644
--- a/src/mame/drivers/decocass.cpp
+++ b/src/mame/drivers/decocass.cpp
@@ -966,7 +966,7 @@ void decocass_state::decocass(machine_config &config)
m_mcu->p2_in_cb().set(FUNC(decocass_state::i8041_p2_r));
m_mcu->p2_out_cb().set(FUNC(decocass_state::i8041_p2_w));
- config.m_minimum_quantum = attotime::from_hz(4200); /* interleave CPUs */
+ config.set_maximum_quantum(attotime::from_hz(4200)); /* interleave CPUs */
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/dectalk.cpp b/src/mame/drivers/dectalk.cpp
index 87b4fe182cc..8351036a2b0 100644
--- a/src/mame/drivers/dectalk.cpp
+++ b/src/mame/drivers/dectalk.cpp
@@ -893,7 +893,7 @@ void dectalk_state::dectalk(machine_config &config)
m_dsp->bio().set(FUNC(dectalk_state::spc_semaphore_r)); //read infifo-has-data-in-it fifo readable status
#ifdef USE_LOOSE_TIMING
- config.m_minimum_quantum = attotime::from_hz(100);
+ config.set_maximum_quantum(attotime::from_hz(100));
#else
config.m_perfect_cpu_quantum = subtag("dsp");
#endif
diff --git a/src/mame/drivers/digel804.cpp b/src/mame/drivers/digel804.cpp
index 86241497f25..f041ebcb882 100644
--- a/src/mame/drivers/digel804.cpp
+++ b/src/mame/drivers/digel804.cpp
@@ -637,7 +637,7 @@ void digel804_state::digel804(machine_config &config)
Z80(config, m_maincpu, 3.6864_MHz_XTAL/2); /* Z80A, X1(aka E0 on schematics): 3.6864Mhz */
m_maincpu->set_addrmap(AS_PROGRAM, &digel804_state::z80_mem_804_1_4);
m_maincpu->set_addrmap(AS_IO, &digel804_state::z80_io_1_4);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ROC10937(config, m_vfd); // RIGHT_TO_LEFT
diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp
index b4c598e5135..48f4a2bc4bd 100644
--- a/src/mame/drivers/divebomb.cpp
+++ b/src/mame/drivers/divebomb.cpp
@@ -400,7 +400,7 @@ void divebomb_state::divebomb(machine_config &config)
m_rozcpu->set_addrmap(AS_PROGRAM, &divebomb_state::divebomb_rozcpu_map);
m_rozcpu->set_addrmap(AS_IO, &divebomb_state::divebomb_rozcpu_iomap);
- config.m_perfect_cpu_quantum = subtag("fgcpu");
+ config.set_perfect_quantum(m_fgcpu);
INPUT_MERGER_ANY_HIGH(config, m_fgcpu_irq).output_handler().set_inputline(m_fgcpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/djboy.cpp b/src/mame/drivers/djboy.cpp
index 39a035f90b1..edd0580fc6b 100644
--- a/src/mame/drivers/djboy.cpp
+++ b/src/mame/drivers/djboy.cpp
@@ -493,7 +493,7 @@ void djboy_state::djboy(machine_config &config)
m_beast->port_in_cb<3>().set(FUNC(djboy_state::beast_p3_r));
m_beast->port_out_cb<3>().set(FUNC(djboy_state::beast_p3_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
GENERIC_LATCH_8(config, m_slavelatch);
diff --git a/src/mame/drivers/dmndrby.cpp b/src/mame/drivers/dmndrby.cpp
index 68a557fdf4a..93be2638d18 100644
--- a/src/mame/drivers/dmndrby.cpp
+++ b/src/mame/drivers/dmndrby.cpp
@@ -547,7 +547,7 @@ void dmndrby_state::dderby(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* verified on schematics */
m_audiocpu->set_addrmap(AS_PROGRAM, &dmndrby_state::dderby_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp
index 4ac34f5f940..64a31db58b6 100644
--- a/src/mame/drivers/dmv.cpp
+++ b/src/mame/drivers/dmv.cpp
@@ -803,7 +803,7 @@ void dmv_state::dmv(machine_config &config)
kbmcu.p1_out_cb().set(FUNC(dmv_state::kb_mcu_port1_w)); // bit 1 data to kb
kbmcu.p2_out_cb().set(FUNC(dmv_state::kb_mcu_port2_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
DMV_KEYBOARD(config, m_keyboard, 0);
diff --git a/src/mame/drivers/dogfgt.cpp b/src/mame/drivers/dogfgt.cpp
index 63c4326567d..2932100f5b8 100644
--- a/src/mame/drivers/dogfgt.cpp
+++ b/src/mame/drivers/dogfgt.cpp
@@ -237,7 +237,7 @@ void dogfgt_state::dogfgt(machine_config &config)
M6502(config, m_subcpu, 1500000); /* 1.5 MHz ???? */
m_subcpu->set_addrmap(AS_PROGRAM, &dogfgt_state::sub_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/dpb7000.cpp b/src/mame/drivers/dpb7000.cpp
index b57a3857b44..138a47cf9de 100644
--- a/src/mame/drivers/dpb7000.cpp
+++ b/src/mame/drivers/dpb7000.cpp
@@ -1136,7 +1136,7 @@ void dpb7000_state::dpb7000(machine_config &config)
RS232_PORT(config, m_fdd_serial, default_rs232_devices, nullptr);
m_fdd_serial->rxd_handler().set(FUNC(dpb7000_state::fddcpu_debug_rx));
- config.m_perfect_cpu_quantum = subtag("fddcpu");
+ config.set_perfect_quantum(m_fddcpu);
// Filter Card
TDC1008(config, m_filter_cd);
diff --git a/src/mame/drivers/drmicro.cpp b/src/mame/drivers/drmicro.cpp
index 5dff7a2e260..0ce6a473e28 100644
--- a/src/mame/drivers/drmicro.cpp
+++ b/src/mame/drivers/drmicro.cpp
@@ -248,7 +248,7 @@ void drmicro_state::drmicro(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &drmicro_state::io_map);
m_maincpu->set_vblank_int("screen", FUNC(drmicro_state::drmicro_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/dynduke.cpp b/src/mame/drivers/dynduke.cpp
index 48a9cefe1ec..1a84348a6fa 100644
--- a/src/mame/drivers/dynduke.cpp
+++ b/src/mame/drivers/dynduke.cpp
@@ -331,7 +331,7 @@ void dynduke_state::dynduke(machine_config &config)
sei80bu_device &sei80bu(SEI80BU(config, "sei80bu", 0));
sei80bu.set_addrmap(AS_PROGRAM, &dynduke_state::sei80bu_encrypted_full_map);
- config.m_minimum_quantum = attotime::from_hz(3600);
+ config.set_maximum_quantum(attotime::from_hz(3600));
// video hardware
BUFFERED_SPRITERAM16(config, m_spriteram);
diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp
index 32abd745d10..c39c8c23e61 100644
--- a/src/mame/drivers/eolith.cpp
+++ b/src/mame/drivers/eolith.cpp
@@ -558,7 +558,7 @@ void eolith_state::eolith45(machine_config &config)
// for testing sound sync
// config.m_perfect_cpu_quantum = subtag("maincpu");
-// config.m_minimum_quantum = attotime::from_hz(6000);
+// config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp
index 96171d3cde2..1d073519eea 100644
--- a/src/mame/drivers/eprom.cpp
+++ b/src/mame/drivers/eprom.cpp
@@ -375,7 +375,7 @@ void eprom_state::eprom(machine_config &config)
M68000(config, m_extra, ATARI_CLOCK_14MHz/2);
m_extra->set_addrmap(AS_PROGRAM, &eprom_state::extra_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
m_adc->in_callback<0>().set_ioport("ADC0");
@@ -425,7 +425,7 @@ void eprom_state::klaxp(machine_config &config)
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
m_maincpu->set_addrmap(AS_PROGRAM, &eprom_state::main_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
EEPROM_2804(config, "eeprom").lock_after_write(true);
@@ -468,7 +468,7 @@ void eprom_state::guts(machine_config &config)
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
m_maincpu->set_addrmap(AS_PROGRAM, &eprom_state::guts_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
m_adc->in_callback<0>().set_ioport("ADC0");
diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp
index dc9e2e8b818..a6f634c9f35 100644
--- a/src/mame/drivers/equites.cpp
+++ b/src/mame/drivers/equites.cpp
@@ -1168,8 +1168,7 @@ void equites_state::equites(machine_config &config)
common_sound(config);
ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!)
-
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
WATCHDOG_TIMER(config, "watchdog");
@@ -1225,7 +1224,7 @@ void splndrbt_state::splndrbt(machine_config &config)
common_sound(config);
ALPHA_8201(config, m_alpha_8201, 4000000/8); // 8303 or 8304 (same device!)
- config.m_perfect_cpu_quantum = subtag("alpha_8201:mcu");
+ config.set_perfect_quantum("alpha_8201:mcu");
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/esripsys.cpp b/src/mame/drivers/esripsys.cpp
index 40b749ceae8..6c6b0885775 100644
--- a/src/mame/drivers/esripsys.cpp
+++ b/src/mame/drivers/esripsys.cpp
@@ -670,7 +670,7 @@ void esripsys_state::esripsys(machine_config &config)
m_gamecpu->set_addrmap(AS_PROGRAM, &esripsys_state::game_cpu_map);
m_gamecpu->set_vblank_int("screen", FUNC(esripsys_state::esripsys_vblank_irq));
- config.m_perfect_cpu_quantum = subtag("game_cpu");
+ config.set_perfect_quantum(m_gamecpu);
MC6809E(config, m_framecpu, XTAL(8'000'000) / 4);
m_framecpu->set_addrmap(AS_PROGRAM, &esripsys_state::frame_cpu_map);
diff --git a/src/mame/drivers/europc.cpp b/src/mame/drivers/europc.cpp
index aa1bd6efea2..ae73b5331fc 100644
--- a/src/mame/drivers/europc.cpp
+++ b/src/mame/drivers/europc.cpp
@@ -544,7 +544,7 @@ void europc_fdc_device::device_add_mconfig(machine_config &config)
fdc.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
// single built-in 3.5" 720K drive, connector for optional external 3.5" or 5.25" drive
FLOPPY_CONNECTOR(config, "fdc:0", pc_dd_floppies, "35dd", isa8_fdc_device::floppy_formats).set_fixed(true);
- FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, "", isa8_fdc_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, nullptr, isa8_fdc_device::floppy_formats);
}
static void europc_fdc(device_slot_interface &device)
diff --git a/src/mame/drivers/exelv.cpp b/src/mame/drivers/exelv.cpp
index 87648346998..810f49d83e5 100644
--- a/src/mame/drivers/exelv.cpp
+++ b/src/mame/drivers/exelv.cpp
@@ -500,7 +500,7 @@ void exelv_state::exl100(machine_config &config)
subcpu.in_portd().set(FUNC(exelv_state::tms7041_portd_r));
subcpu.out_portd().set(FUNC(exelv_state::tms7041_portd_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
TMS3556(config, m_tms3556);
@@ -554,7 +554,7 @@ void exelv_state::exeltel(machine_config &config)
subcpu.in_portd().set(FUNC(exelv_state::tms7041_portd_r));
subcpu.out_portd().set(FUNC(exelv_state::tms7041_portd_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
TMS3556(config, m_tms3556);
diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp
index 923554137f8..c21b1a10c9b 100644
--- a/src/mame/drivers/exidy.cpp
+++ b/src/mame/drivers/exidy.cpp
@@ -908,7 +908,7 @@ void exidy_state::venture(machine_config &config)
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &exidy_state::venture_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* audio hardware */
pia6821_device &pia(PIA6821(config, "pia", 0));
@@ -943,7 +943,7 @@ void exidy_state::mtrap(machine_config &config)
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &exidy_state::mtrap_map);
- config.m_minimum_quantum = attotime::from_hz(1920);
+ config.set_maximum_quantum(attotime::from_hz(1920));
/* audio hardware */
pia6821_device &pia(PIA6821(config, "pia", 0));
diff --git a/src/mame/drivers/exprraid.cpp b/src/mame/drivers/exprraid.cpp
index 0d3300198cc..86bef728304 100644
--- a/src/mame/drivers/exprraid.cpp
+++ b/src/mame/drivers/exprraid.cpp
@@ -501,7 +501,7 @@ void exprraid_state::exprraid(machine_config &config)
m_slave->set_addrmap(AS_PROGRAM, &exprraid_state::slave_map);
/* IRQs are caused by the YM3526 */
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/exterm.cpp b/src/mame/drivers/exterm.cpp
index efec37848dc..8087f879b44 100644
--- a/src/mame/drivers/exterm.cpp
+++ b/src/mame/drivers/exterm.cpp
@@ -395,7 +395,7 @@ void exterm_state::exterm(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch[0]).data_pending_callback().set_inputline(m_audiocpu, M6502_IRQ_LINE);
GENERIC_LATCH_8(config, m_soundlatch[1]).data_pending_callback().set_inputline(m_audioslave, M6502_IRQ_LINE);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/exzisus.cpp b/src/mame/drivers/exzisus.cpp
index 5b9d2da76b1..6863903338e 100644
--- a/src/mame/drivers/exzisus.cpp
+++ b/src/mame/drivers/exzisus.cpp
@@ -247,7 +247,7 @@ void exzisus_state::exzisus(machine_config &config)
z80_device &audiocpu(Z80(config, "audiocpu", 4000000));
audiocpu.set_addrmap(AS_PROGRAM, &exzisus_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp
index 610726ea419..fe659012122 100644
--- a/src/mame/drivers/f1gp.cpp
+++ b/src/mame/drivers/f1gp.cpp
@@ -375,7 +375,7 @@ void f1gp_state::f1gp(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &f1gp_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &f1gp_state::sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
ACIA6850(config, m_acia, 0);
m_acia->irq_handler().set_inputline("sub", M68K_IRQ_3);
@@ -442,7 +442,7 @@ void f1gp_state::f1gpb(machine_config &config)
sub.set_vblank_int("screen", FUNC(f1gp_state::irq1_line_hold));
/* NO sound CPU */
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
ACIA6850(config, m_acia, 0);
m_acia->irq_handler().set_inputline("sub", M68K_IRQ_3);
diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp
index 21fce64c7a3..4d1dba4c150 100644
--- a/src/mame/drivers/fantland.cpp
+++ b/src/mame/drivers/fantland.cpp
@@ -820,7 +820,7 @@ void fantland_state::fantland(machine_config &config)
m_audiocpu->set_periodic_int(FUNC(fantland_state::fantland_sound_irq), attotime::from_hz(8000));
// NMI when soundlatch is written
- config.m_minimum_quantum = attotime::from_hz(8000); // sound irq must feed the DAC at 8kHz
+ config.set_maximum_quantum(attotime::from_hz(8000)); // sound irq must feed the DAC at 8kHz
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/fidel_card.cpp b/src/mame/drivers/fidel_card.cpp
index 75f154bc7d5..5487f2f1083 100644
--- a/src/mame/drivers/fidel_card.cpp
+++ b/src/mame/drivers/fidel_card.cpp
@@ -565,7 +565,7 @@ void card_state::brc_base(machine_config &config)
Z80(config, m_maincpu, 5_MHz_XTAL/2);
m_maincpu->set_addrmap(AS_PROGRAM, &card_state::main_map);
m_maincpu->set_addrmap(AS_IO, &card_state::main_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
I8041A(config, m_mcu, 5_MHz_XTAL);
m_mcu->p1_out_cb().set(FUNC(card_state::mcu_p1_w));
diff --git a/src/mame/drivers/fidel_eag68k.cpp b/src/mame/drivers/fidel_eag68k.cpp
index 298d1f5e80a..4f2005efd70 100644
--- a/src/mame/drivers/fidel_eag68k.cpp
+++ b/src/mame/drivers/fidel_eag68k.cpp
@@ -660,7 +660,7 @@ void eagv5_state::eagv5(machine_config &config)
// gen_latch syncs on write, but this is still needed with tight cpu comms
// (not that it locks up or anything, but it will calculate moves much slower if timing is off)
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
}
void eag_state::eagv7(machine_config &config)
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index cf7f0999715..5cef1cb90c1 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -644,7 +644,7 @@ void firefox_state::firefox(machine_config &config)
M6502(config, m_audiocpu, MASTER_XTAL/8);
m_audiocpu->set_addrmap(AS_PROGRAM, &firefox_state::audio_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
adc0809_device &adc(ADC0809(config, "adc", MASTER_XTAL/16)); // nominally 900 kHz
adc.in_callback<0>().set_ioport("PITCH");
diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp
index a99e04ede61..088815b8eeb 100644
--- a/src/mame/drivers/firetrap.cpp
+++ b/src/mame/drivers/firetrap.cpp
@@ -577,7 +577,7 @@ void firetrap_state::firetrap(machine_config &config)
m_mcu->port_out_cb<3>().set(FUNC(firetrap_state::mcu_p3_w));
// needs a tight sync with the mcu
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
TIMER(config, "scantimer", 0).configure_scanline(FUNC(firetrap_state::interrupt), "screen", 0, 1);
diff --git a/src/mame/drivers/flkatck.cpp b/src/mame/drivers/flkatck.cpp
index 6867404a04a..a184903a2be 100644
--- a/src/mame/drivers/flkatck.cpp
+++ b/src/mame/drivers/flkatck.cpp
@@ -225,7 +225,7 @@ void flkatck_state::flkatck(machine_config &config)
Z80(config, m_audiocpu, 3.579545_MHz_XTAL); /* NEC D780C-1, 3.579545MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &flkatck_state::flkatck_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/flower.cpp b/src/mame/drivers/flower.cpp
index daf156ea303..405c3f15730 100644
--- a/src/mame/drivers/flower.cpp
+++ b/src/mame/drivers/flower.cpp
@@ -509,7 +509,7 @@ void flower_state::flower(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &flower_state::audio_map);
m_audiocpu->set_periodic_int(FUNC(flower_state::irq0_line_hold), attotime::from_hz(90));
- config.m_perfect_cpu_quantum = subtag("mastercpu");
+ config.set_perfect_quantum(m_mastercpu);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_screen_update(FUNC(flower_state::screen_update));
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index aaef422b2b8..a23c62fc645 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -744,7 +744,7 @@ void flstory_state::common(machine_config &config)
m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), attotime::from_hz(2*60));
/* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index c8243e199f2..30fe9cfb9d9 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -2036,12 +2036,11 @@ void fm7_state::fm7(machine_config &config)
MC6809(config, m_maincpu, 16.128_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &fm7_state::fm7_mem);
m_maincpu->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_irq_ack));
- config.m_perfect_cpu_quantum = subtag("maincpu");
MC6809(config, m_sub, 16.128_MHz_XTAL / 2);
m_sub->set_addrmap(AS_PROGRAM, &fm7_state::fm7_sub_mem);
m_sub->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_sub_irq_ack));
- config.m_perfect_cpu_quantum = subtag("sub");
+ config.set_perfect_quantum(m_sub);
SPEAKER(config, "mono").front_center();
AY8910(config, m_psg, 4.9152_MHz_XTAL / 4).add_route(ALL_OUTPUTS,"mono", 1.00);
@@ -2090,12 +2089,11 @@ void fm7_state::fm8(machine_config &config)
MC6809(config, m_maincpu, 4.9152_MHz_XTAL); // 1.2MHz 68A09
m_maincpu->set_addrmap(AS_PROGRAM, &fm7_state::fm8_mem);
m_maincpu->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_irq_ack));
- config.m_perfect_cpu_quantum = subtag("maincpu");
MC6809(config, m_sub, 16.128_MHz_XTAL / 2);
m_sub->set_addrmap(AS_PROGRAM, &fm7_state::fm7_sub_mem);
m_sub->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_sub_irq_ack));
- config.m_perfect_cpu_quantum = subtag("sub");
+ config.set_perfect_quantum(m_sub);
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
@@ -2138,12 +2136,11 @@ void fm7_state::fm77av(machine_config &config)
MC6809E(config, m_maincpu, 16.128_MHz_XTAL / 8);
m_maincpu->set_addrmap(AS_PROGRAM, &fm7_state::fm77av_mem);
m_maincpu->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_irq_ack));
- config.m_perfect_cpu_quantum = subtag("maincpu");
MC6809E(config, m_sub, 16.128_MHz_XTAL / 8);
m_sub->set_addrmap(AS_PROGRAM, &fm7_state::fm77av_sub_mem);
m_sub->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_sub_irq_ack));
- config.m_perfect_cpu_quantum = subtag("sub");
+ config.set_perfect_quantum(m_sub);
SPEAKER(config, "mono").front_center();
YM2203(config, m_ym, 4.9152_MHz_XTAL / 4);
@@ -2202,12 +2199,11 @@ void fm7_state::fm11(machine_config &config)
MC6809E(config, m_maincpu, 2000000); // 2MHz 68B09E
m_maincpu->set_addrmap(AS_PROGRAM, &fm7_state::fm11_mem);
m_maincpu->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_irq_ack));
- config.m_perfect_cpu_quantum = subtag("maincpu");
MC6809(config, m_sub, 8000000); // 2MHz 68B09
m_sub->set_addrmap(AS_PROGRAM, &fm7_state::fm11_sub_mem);
m_sub->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_sub_irq_ack));
- config.m_perfect_cpu_quantum = subtag("sub");
+ config.set_perfect_quantum(m_sub);
I8088(config, m_x86, 8000000); // 8MHz i8088
m_x86->set_addrmap(AS_PROGRAM, &fm7_state::fm11_x86_mem);
@@ -2259,12 +2255,11 @@ void fm7_state::fm16beta(machine_config &config)
I8086(config, m_maincpu, 8000000); // 8MHz i8086
m_maincpu->set_addrmap(AS_PROGRAM, &fm7_state::fm16_mem);
m_maincpu->set_addrmap(AS_IO, &fm7_state::fm16_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
MC6809(config, m_sub, 8000000);
m_sub->set_irq_acknowledge_callback(FUNC(fm7_state::fm7_sub_irq_ack));
m_sub->set_addrmap(AS_PROGRAM, &fm7_state::fm16_sub_mem);
- config.m_perfect_cpu_quantum = subtag("sub");
+ config.set_perfect_quantum(m_sub);
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
diff --git a/src/mame/drivers/gaelco.cpp b/src/mame/drivers/gaelco.cpp
index 922cdb47320..8c5ea2d5cf2 100644
--- a/src/mame/drivers/gaelco.cpp
+++ b/src/mame/drivers/gaelco.cpp
@@ -646,7 +646,7 @@ void gaelco_state::bigkarnk(machine_config &config)
MC6809E(config, m_audiocpu, XTAL(8'000'000)/4); /* 68B09EP, 2 MHz? */
m_audiocpu->set_addrmap(AS_PROGRAM, &gaelco_state::bigkarnk_snd_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
LS259(config, m_outlatch);
m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)).invert();
@@ -715,7 +715,7 @@ void gaelco_state::squash(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &gaelco_state::squash_map);
m_maincpu->set_vblank_int("screen", FUNC(gaelco_state::irq6_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
LS259(config, m_outlatch); // B8
m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)).invert();
@@ -753,7 +753,7 @@ void gaelco_state::thoop(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &gaelco_state::thoop_map);
m_maincpu->set_vblank_int("screen", FUNC(gaelco_state::irq6_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
LS259(config, m_outlatch); // B8
m_outlatch->q_out_cb<0>().set(FUNC(gaelco_state::coin1_lockout_w)); // not inverted
diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp
index d1b8397cb1b..aec05304c0e 100644
--- a/src/mame/drivers/gaelco2.cpp
+++ b/src/mame/drivers/gaelco2.cpp
@@ -210,6 +210,7 @@ void gaelco2_state::maniacsq_d5002fp(machine_config &config)
{
maniacsq(config);
GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(24'000'000) / 2).set_addrmap(0, &gaelco2_state::mcu_hostmem_map); // clock unknown
+ config.set_perfect_quantum("gaelco_ds5002fp:mcu");
}
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index cb84e65c477..b95f7fe6778 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -916,7 +916,7 @@ void gaelco3d_state::gaelco3d(machine_config &config)
EEPROM_93C66_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
TIMER(config, "adsp_timer").configure_generic(FUNC(gaelco3d_state::adsp_autobuffer_irq));
diff --git a/src/mame/drivers/gal3.cpp b/src/mame/drivers/gal3.cpp
index 36ef19dbc85..e2da6e5432a 100644
--- a/src/mame/drivers/gal3.cpp
+++ b/src/mame/drivers/gal3.cpp
@@ -605,7 +605,7 @@ void gal3_state::gal3(machine_config &config)
m68000_device &psn_b3_cpu(M68000(config, "psn_b3_cpu", 12000000)); // ??
psn_b3_cpu.set_addrmap(AS_PROGRAM, &gal3_state::psn_b1_cpu_map);
*/
- config.m_minimum_quantum = attotime::from_hz(60*8000); /* 8000 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(60*8000)); /* 8000 CPU slices per frame */
NVRAM(config, "nvmem", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp
index e32aa6b07fc..7599628a202 100644
--- a/src/mame/drivers/galaga.cpp
+++ b/src/mame/drivers/galaga.cpp
@@ -1651,7 +1651,7 @@ void bosco_state::bosco(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -1721,7 +1721,7 @@ void galaga_state::galaga(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -1823,7 +1823,7 @@ void xevious_state::xevious(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8);
- config.m_minimum_quantum = attotime::from_hz(60000); /* 1000 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(60000)); /* 1000 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -1931,7 +1931,7 @@ void digdug_state::digdug(machine_config &config)
m_videolatch->q_out_cb<3>().set(FUNC(digdug_state::bg_disable_w));
m_videolatch->q_out_cb<7>().set(FUNC(digdug_state::flip_screen_w));
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
ER2055(config, m_earom);
diff --git a/src/mame/drivers/gamecom.cpp b/src/mame/drivers/gamecom.cpp
index db8c9d155f6..3cef1677970 100644
--- a/src/mame/drivers/gamecom.cpp
+++ b/src/mame/drivers/gamecom.cpp
@@ -264,7 +264,7 @@ void gamecom_state::gamecom(machine_config &config)
m_maincpu->timer_cb().set(FUNC(gamecom_state::gamecom_update_timers));
m_maincpu->set_vblank_int("screen", FUNC(gamecom_state::gamecom_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
//NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp
index b575d8737ab..8c0630c1db3 100644
--- a/src/mame/drivers/gaplus.cpp
+++ b/src/mame/drivers/gaplus.cpp
@@ -526,7 +526,7 @@ void gaplus_base_state::gaplus_base(machine_config &config)
MC6809E(config, m_subcpu2, XTAL(24'576'000) / 16); /* 1.536 MHz */
m_subcpu2->set_addrmap(AS_PROGRAM, &gaplus_base_state::cpu3_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* a high value to ensure proper synchronization of the CPUs */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp
index 4e10db1e31e..48b0e3ae56e 100644
--- a/src/mame/drivers/gladiatr.cpp
+++ b/src/mame/drivers/gladiatr.cpp
@@ -954,7 +954,7 @@ void ppking_state::ppking(machine_config &config)
MC6809(config, m_audiocpu, 12_MHz_XTAL/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &ppking_state::ppking_cpu3_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_RESET_OVERRIDE(ppking_state, ppking)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -1056,7 +1056,7 @@ void gladiatr_state::gladiatr(machine_config &config)
m_csnd->t1_in_cb().set(FUNC(gladiatr_state::csnd_t1_r));
/* lazy way to make polled serial between MCUs work */
- config.m_perfect_cpu_quantum = subtag("ucpu");
+ config.set_perfect_quantum(m_ucpu);
CLOCK(config, "tclk", 12_MHz_XTAL/8/128/2) /* verified on pcb */
.signal_handler().set(FUNC(gladiatr_state::tclk_w));
diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp
index 935c82b1529..b9030b7de37 100644
--- a/src/mame/drivers/glass.cpp
+++ b/src/mame/drivers/glass.cpp
@@ -259,6 +259,7 @@ void glass_state::glass_ds5002fp(machine_config &config)
glass(config);
gaelco_ds5002fp_device &ds5002fp(GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(24'000'000) / 2)); /* verified on pcb */
ds5002fp.set_addrmap(0, &glass_state::mcu_hostmem_map);
+ config.set_perfect_quantum("gaelco_ds5002fp:mcu");
}
ROM_START( glass ) /* Version 1.1 */
diff --git a/src/mame/drivers/gradius3.cpp b/src/mame/drivers/gradius3.cpp
index e2d4a955b6f..cb92013b72e 100644
--- a/src/mame/drivers/gradius3.cpp
+++ b/src/mame/drivers/gradius3.cpp
@@ -272,7 +272,7 @@ void gradius3_state::gradius3(machine_config &config)
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &gradius3_state::gradius3_s_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp
index f81460c0491..7d73f813c80 100644
--- a/src/mame/drivers/grchamp.cpp
+++ b/src/mame/drivers/grchamp.cpp
@@ -756,7 +756,7 @@ void grchamp_state::grchamp(machine_config &config)
m_audiocpu->set_periodic_int(FUNC(grchamp_state::irq0_line_hold), attotime::from_hz((double)SOUND_CLOCK/4/16/16/10/16));
WATCHDOG_TIMER(config, m_watchdog).set_vblank_count(m_screen, 8);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
GFXDECODE(config, m_gfxdecode, m_palette, gfx_grchamp);
diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp
index 33a00ef862d..8ec1b6c680c 100644
--- a/src/mame/drivers/gsword.cpp
+++ b/src/mame/drivers/gsword.cpp
@@ -955,7 +955,7 @@ void gsword_state::gsword(machine_config &config)
CLOCK(config, "tclk", 12'000'000/8/128/2).signal_handler().set([this] (int state) { m_tclk_val = state != 0; });
// lazy way to ensure communication works
- config.m_perfect_cpu_quantum = subtag("mcu1");
+ config.set_perfect_quantum("mcu1");
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -1019,7 +1019,7 @@ void josvolly_state::josvolly(machine_config &config)
ppi.in_pc_callback().set_ioport("IN0"); // START
// the second MCU polls the first MCU's outputs, so it needs tight sync
- config.m_perfect_cpu_quantum = subtag("mcu2");
+ config.set_perfect_quantum("mcu2");
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp
index 5976d5e07e5..50cf2e0339c 100644
--- a/src/mame/drivers/gticlub.cpp
+++ b/src/mame/drivers/gticlub.cpp
@@ -948,7 +948,7 @@ void gticlub_state::gticlub(machine_config &config)
m_dsp->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp->set_addrmap(AS_DATA, &gticlub_state::sharc_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
EEPROM_93C56_16BIT(config, "eeprom");
@@ -1050,7 +1050,7 @@ void gticlub_state::hangplt(machine_config &config)
m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp2->set_addrmap(AS_DATA, &gticlub_state::hangplt_sharc1_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
EEPROM_93C56_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/gyruss.cpp b/src/mame/drivers/gyruss.cpp
index eb714825d9a..198a7707af5 100644
--- a/src/mame/drivers/gyruss.cpp
+++ b/src/mame/drivers/gyruss.cpp
@@ -492,7 +492,7 @@ void gyruss_state::gyruss(machine_config &config)
m_audiocpu_2->p1_out_cb().set(FUNC(gyruss_state::gyruss_dac_w));
m_audiocpu_2->p2_out_cb().set(FUNC(gyruss_state::gyruss_irq_clear_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
ls259_device &mainlatch(LS259(config, "mainlatch")); // 3C
mainlatch.q_out_cb<0>().set(FUNC(gyruss_state::master_nmi_mask_w));
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index ead95b0f795..ea120954021 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -1482,7 +1482,7 @@ void harddriv_state::driver_nomsp(machine_config &config)
m_gsp->set_shiftreg_out_callback(FUNC(harddriv_state::hdgsp_read_from_shiftreg));
m_gsp->set_screen("screen");
- config.m_minimum_quantum = attotime::from_hz(30000);
+ config.set_maximum_quantum(attotime::from_hz(30000));
M48T02(config, m_200e, 0);
@@ -1600,7 +1600,7 @@ void harddriv_state::ds3(machine_config &config)
m_adsp->set_addrmap(AS_PROGRAM, &harddriv_state::ds3_program_map);
m_adsp->set_addrmap(AS_DATA, &harddriv_state::ds3_data_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
ADSP2105(config, m_ds3sdsp, XTAL(10'000'000));
m_ds3sdsp->sport_rx().set(FUNC(harddriv_state::hdds3sdsp_serial_rx_callback));
@@ -2089,14 +2089,14 @@ void harddriv_new_state::racedriv_panorama_machine(machine_config &config)
RACEDRIVC_PANORAMA_SIDE_BOARD(config, "leftpcb", 0);
RACEDRIVC_PANORAMA_SIDE_BOARD(config, "rightpcb", 0);
-// config.m_minimum_quantum = attotime::from_hz(100000);
+// config.set_maximum_quantum(attotime::from_hz(100000));
subdevice<mc68681_device>("mainpcb:duartn68681")->a_tx_cb().set(FUNC(harddriv_new_state::tx_a));
// boots with 'PROGRAM OK' when using standard Hard Drivin' board type (needs 137412-115 slapstic)
subdevice<atari_slapstic_device>("mainpcb:slapstic")->set_chipnum(115);
TIMER(config, "hack_timer").configure_periodic(FUNC(harddriv_new_state::hack_timer), attotime::from_hz(60));
-// config.m_minimum_quantum = attotime::from_hz(60000);
+// config.set_maximum_quantum(attotime::from_hz(60000));
}
// this is an ugly hack, otherwise MAME's core can't seem to handle partial updates if you have multiple screens with different update frequencies.
diff --git a/src/mame/drivers/hazeltin.cpp b/src/mame/drivers/hazeltin.cpp
index 6df6ba1a5b5..827ac527939 100644
--- a/src/mame/drivers/hazeltin.cpp
+++ b/src/mame/drivers/hazeltin.cpp
@@ -699,7 +699,7 @@ void hazl1500_state::hazl1500(machine_config &config)
I8080(config, m_maincpu, XTAL(18'000'000)/9); // 18MHz crystal on schematics, using an i8224 clock gen/driver IC
m_maincpu->set_addrmap(AS_PROGRAM, &hazl1500_state::hazl1500_mem);
m_maincpu->set_addrmap(AS_IO, &hazl1500_state::hazl1500_io);
- config.m_perfect_cpu_quantum = subtag(CPU_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainint").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index a1acddaf38b..67122745788 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -1721,7 +1721,7 @@ void pairmtch_state::pairmtch(machine_config &config)
m_audiocpu->read_r<2>().set(m_soundlatch[0], FUNC(generic_latch_8_device::read));
m_audiocpu->write_d().set(FUNC(pairmtch_state::speaker_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(6, 12);
@@ -2977,7 +2977,7 @@ void eturtles_state::eturtles(machine_config &config)
m_audiocpu->read_l().set(FUNC(eturtles_state::cop_latch_r));
m_audiocpu->read_g().set(FUNC(eturtles_state::cop_ack_r));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
@@ -3099,7 +3099,7 @@ void estargte_state::estargte(machine_config &config)
m_audiocpu->write_d().set(FUNC(eturtles_state::cop_irq_w));
m_audiocpu->read_l().set(FUNC(estargte_state::cop_data_r));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp
index 1f4c4a9020e..8331cef3813 100644
--- a/src/mame/drivers/homedata.cpp
+++ b/src/mame/drivers/homedata.cpp
@@ -1325,7 +1325,7 @@ void homedata_state::reikaids(machine_config &config)
audiocpu.pc_out_cb().set(FUNC(homedata_state::reikaids_upd7807_portc_w));
audiocpu.pt_in_cb().set(m_soundlatch, FUNC(generic_latch_8_device::read));
- config.m_minimum_quantum = attotime::from_hz(30000); // very high interleave required to sync for startup tests
+ config.set_maximum_quantum(attotime::from_hz(30000)); // very high interleave required to sync for startup tests
MCFG_MACHINE_START_OVERRIDE(homedata_state,reikaids)
MCFG_MACHINE_RESET_OVERRIDE(homedata_state,reikaids)
@@ -1384,7 +1384,7 @@ void homedata_state::pteacher(machine_config &config)
audiocpu.pc_out_cb().set(FUNC(homedata_state::pteacher_upd7807_portc_w));
audiocpu.pt_in_cb().set(FUNC(homedata_state::pteacher_keyboard_r));
- config.m_minimum_quantum = attotime::from_hz(6000); // should be enough
+ config.set_maximum_quantum(attotime::from_hz(6000)); // should be enough
MCFG_MACHINE_START_OVERRIDE(homedata_state,pteacher)
MCFG_MACHINE_RESET_OVERRIDE(homedata_state,pteacher)
@@ -1453,7 +1453,7 @@ void homedata_state::mjikaga(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &homedata_state::mjikaga_map);
m_audiocpu->set_addrmap(AS_PROGRAM, &homedata_state::mjikaga_upd7807_map);
- config.m_minimum_quantum = attotime::from_hz(9000); // boost synch a bit more, otherwise the game fails to start
+ config.set_maximum_quantum(attotime::from_hz(9000)); // boost synch a bit more, otherwise the game fails to start
}
static INPUT_PORTS_START( mirderby )
@@ -1579,7 +1579,7 @@ void homedata_state::mirderby(machine_config &config)
cpu1.set_disable();
//cpu1.set_vblank_int("screen", FUNC(homedata_state::mirderby_irq));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp
index f3241347a3c..9a927618eda 100644
--- a/src/mame/drivers/hornet.cpp
+++ b/src/mame/drivers/hornet.cpp
@@ -1150,7 +1150,7 @@ void hornet_state::hornet(machine_config &config)
m_dsp->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp->set_addrmap(AS_DATA, &hornet_state::sharc0_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/hp9825.cpp b/src/mame/drivers/hp9825.cpp
index 021ae268e1b..b90b60d7431 100644
--- a/src/mame/drivers/hp9825.cpp
+++ b/src/mame/drivers/hp9825.cpp
@@ -639,7 +639,7 @@ void hp9825_state::hp9825_base(machine_config &config)
m_cpu->pa_changed_cb().set(m_io_sys , FUNC(hp98x5_io_sys_device::pa_w));
// Needed when 98035 RTC module is connected or time advances at about 1/4 the correct speed (NP misses a lot of 1kHz interrupts)
- config.m_minimum_quantum = attotime::from_hz(5000);
+ config.set_maximum_quantum(attotime::from_hz(5000));
HP98X5_IO_SYS(config , m_io_sys , 0);
m_io_sys->irl().set_inputline(m_cpu, HPHYBRID_IRL);
diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp
index 1802a0edf3b..396d449d205 100644
--- a/src/mame/drivers/hvyunit.cpp
+++ b/src/mame/drivers/hvyunit.cpp
@@ -634,7 +634,7 @@ void hvyunit_state::hvyunit(machine_config &config)
GENERIC_LATCH_8(config, m_slavelatch);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(58);
diff --git a/src/mame/drivers/ikki.cpp b/src/mame/drivers/ikki.cpp
index 7496dec9f9a..d08a5402be5 100644
--- a/src/mame/drivers/ikki.cpp
+++ b/src/mame/drivers/ikki.cpp
@@ -265,8 +265,7 @@ void ikki_state::ikki(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &ikki_state::ikki_cpu2);
m_subcpu->set_periodic_int(FUNC(ikki_state::irq0_line_hold), attotime::from_hz(2*(PIXEL_CLOCK/HTOTAL/VTOTAL)));
- config.m_perfect_cpu_quantum = subtag("maincpu");
-
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp
index e56387de96c..be7837d6272 100644
--- a/src/mame/drivers/imds2.cpp
+++ b/src/mame/drivers/imds2.cpp
@@ -253,7 +253,7 @@ void imds2_state::imds2(machine_config &config)
m_ipccpu->set_addrmap(AS_PROGRAM, &imds2_state::ipc_mem_map);
m_ipccpu->set_addrmap(AS_IO, &imds2_state::ipc_io_map);
m_ipccpu->set_irq_acknowledge_callback("ipcsyspic", FUNC(pic8259_device::inta_cb));
- //config.m_minimum_quantum = attotime::from_hz(100);
+ //config.set_maximum_quantum(attotime::from_hz(100));
PIC8259(config, m_ipcsyspic, 0);
m_ipcsyspic->out_int_callback().set(FUNC(imds2_state::ipc_intr_w));
diff --git a/src/mame/drivers/imolagp.cpp b/src/mame/drivers/imolagp.cpp
index 6be206e3c60..a9c59145341 100644
--- a/src/mame/drivers/imolagp.cpp
+++ b/src/mame/drivers/imolagp.cpp
@@ -524,7 +524,7 @@ void imolagp_state::imolagp(machine_config &config)
m_slavecpu->set_addrmap(AS_PROGRAM, &imolagp_state::imolagp_slave_map);
m_slavecpu->set_addrmap(AS_IO, &imolagp_state::imolagp_slave_io);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
i8255_device &ppi(I8255A(config, "ppi8255", 0));
// mode $91 - ports A & C-lower as input, ports B & C-upper as output
diff --git a/src/mame/drivers/intv.cpp b/src/mame/drivers/intv.cpp
index a1c8e62edac..27586249d85 100644
--- a/src/mame/drivers/intv.cpp
+++ b/src/mame/drivers/intv.cpp
@@ -463,7 +463,7 @@ void intv_state::intv(machine_config &config)
CP1610(config, m_maincpu, XTAL(3'579'545)/4); /* Colorburst/4 */
m_maincpu->set_addrmap(AS_PROGRAM, &intv_state::intv_mem);
m_maincpu->set_vblank_int("screen", FUNC(intv_state::intv_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
STIC(config, m_stic, XTAL(3'579'545));
@@ -542,7 +542,7 @@ void intv_state::intvkbd(machine_config &config)
m_keyboard->set_addrmap(AS_PROGRAM, &intv_state::intvkbd2_mem);
m_keyboard->set_vblank_int("screen", FUNC(intv_state::intv_interrupt2));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
GFXDECODE(config, m_gfxdecode, m_palette, gfx_intvkbd);
diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp
index 3cd7a902dbf..f8b2289da76 100644
--- a/src/mame/drivers/itech32.cpp
+++ b/src/mame/drivers/itech32.cpp
@@ -1739,7 +1739,7 @@ void drivedge_state::drivedge(machine_config &config)
// M6803(config, "comm", 8000000/4); -- network CPU
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
m_screen->screen_vblank().set_nop(); // interrupt not used?
diff --git a/src/mame/drivers/jackal.cpp b/src/mame/drivers/jackal.cpp
index 7b1cbfb2ce1..2c11e8fa7c4 100644
--- a/src/mame/drivers/jackal.cpp
+++ b/src/mame/drivers/jackal.cpp
@@ -366,7 +366,7 @@ void jackal_state::jackal(machine_config &config)
MC6809E(config, m_slavecpu, MASTER_CLOCK/12); // verified on pcb
m_slavecpu->set_addrmap(AS_PROGRAM, &jackal_state::slave_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp
index eb177b62da1..9d0cf14ef59 100644
--- a/src/mame/drivers/jedi.cpp
+++ b/src/mame/drivers/jedi.cpp
@@ -326,7 +326,7 @@ void jedi_state::jedi(machine_config &config)
M6502(config, m_maincpu, JEDI_MAIN_CPU_CLOCK);
m_maincpu->set_addrmap(AS_PROGRAM, &jedi_state::main_map);
- config.m_minimum_quantum = attotime::from_hz(240);
+ config.set_maximum_quantum(attotime::from_hz(240));
X2212(config, "novram12b");
X2212(config, "novram12c");
diff --git a/src/mame/drivers/jpmimpct.cpp b/src/mame/drivers/jpmimpct.cpp
index 20d3f4e0c84..7513719a1c6 100644
--- a/src/mame/drivers/jpmimpct.cpp
+++ b/src/mame/drivers/jpmimpct.cpp
@@ -853,7 +853,7 @@ void jpmimpct_state::jpmimpct(machine_config &config)
m_dsp->set_shiftreg_in_callback(FUNC(jpmimpct_state::to_shiftreg));
m_dsp->set_shiftreg_out_callback(FUNC(jpmimpct_state::from_shiftreg));
- config.m_minimum_quantum = attotime::from_hz(30000);
+ config.set_maximum_quantum(attotime::from_hz(30000));
MCFG_MACHINE_START_OVERRIDE(jpmimpct_state,jpmimpct)
MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,jpmimpct)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -1314,7 +1314,7 @@ void jpmimpct_state::impctawp(machine_config &config)
M68000(config, m_maincpu, 8000000);
m_maincpu->set_addrmap(AS_PROGRAM, &jpmimpct_state::awp68k_program_map);
- config.m_minimum_quantum = attotime::from_hz(30000);
+ config.set_maximum_quantum(attotime::from_hz(30000));
S16LF01(config, m_vfd);
MCFG_MACHINE_START_OVERRIDE(jpmimpct_state,impctawp)
diff --git a/src/mame/drivers/junior.cpp b/src/mame/drivers/junior.cpp
index 8f96880d78f..fc161fa3611 100644
--- a/src/mame/drivers/junior.cpp
+++ b/src/mame/drivers/junior.cpp
@@ -230,7 +230,7 @@ void junior_state::junior(machine_config &config)
/* basic machine hardware */
M6502(config, m_maincpu, 1_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &junior_state::junior_mem);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
/* video hardware */
config.set_default_layout(layout_junior);
diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp
index 842900a6ec3..89fd060eaca 100644
--- a/src/mame/drivers/jupace.cpp
+++ b/src/mame/drivers/jupace.cpp
@@ -759,7 +759,7 @@ void ace_state::ace(machine_config &config)
Z80(config, m_maincpu, XTAL(6'500'000)/2);
m_maincpu->set_addrmap(AS_PROGRAM, &ace_state::ace_mem);
m_maincpu->set_addrmap(AS_IO, &ace_state::ace_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
// video hardware
screen_device &screen(SCREEN(config, SCREEN_TAG, SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/kc.cpp b/src/mame/drivers/kc.cpp
index 439fa3150f1..cdb0069591f 100644
--- a/src/mame/drivers/kc.cpp
+++ b/src/mame/drivers/kc.cpp
@@ -17,6 +17,7 @@
#include "emu.h"
#include "includes/kc.h"
+#include "machine/input_merger.h"
#include "softlist.h"
#include "screen.h"
#include "speaker.h"
@@ -96,6 +97,47 @@ void kc85_exp(device_slot_interface &device)
}
+void kc_state::kc85_slots(machine_config &config)
+{
+ /* devices */
+ QUICKLOAD(config, "quickload", "kcc", attotime::from_seconds(2)).set_load_callback(FUNC(kc_state::quickload_cb));
+
+ CASSETTE(config, m_cassette);
+ m_cassette->set_formats(kc_cassette_formats);
+ m_cassette->set_default_state(CASSETTE_PLAY);
+ m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
+ m_cassette->set_interface("kc_cass");
+
+ INPUT_MERGER_ANY_HIGH(config, "irq").output_handler().set_inputline(m_maincpu, 0);
+ INPUT_MERGER_ANY_HIGH(config, "nmi").output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ INPUT_MERGER_ANY_HIGH(config, "halt").output_handler().set_inputline(m_maincpu, INPUT_LINE_HALT);
+
+ /* cartridge slot */
+ KCCART_SLOT(config, m_expansions[0], kc85_cart, "m011");
+ 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(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>));
+
+ /* expansion interface */
+ KCEXP_SLOT(config, m_expansions[2], kc85_exp, nullptr);
+ 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>));
+
+ /* Software lists */
+ SOFTWARE_LIST(config, "cart_list").set_original("kc_cart");
+ SOFTWARE_LIST(config, "flop_list").set_original("kc_flop");
+ SOFTWARE_LIST(config, "cass_list").set_original("kc_cass");
+}
+
+
void kc_state::kc85_3(machine_config &config)
{
/* basic machine hardware */
@@ -104,7 +146,7 @@ void kc_state::kc85_3(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &kc_state::kc85_3_io);
m_maincpu->set_daisy_config(kc85_daisy_chain);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
Z80PIO(config, m_z80pio, KC85_3_CLOCK);
m_z80pio->out_int_callback().set_inputline(m_maincpu, 0);
@@ -137,39 +179,7 @@ void kc_state::kc85_3(machine_config &config)
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
- /* devices */
- QUICKLOAD(config, "quickload", "kcc", attotime::from_seconds(2)).set_load_callback(FUNC(kc_state::quickload_cb));
-
- CASSETTE(config, m_cassette);
- m_cassette->set_formats(kc_cassette_formats);
- m_cassette->set_default_state(CASSETTE_PLAY);
- m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
- m_cassette->set_interface("kc_cass");
-
- /* cartridge slot */
- KCCART_SLOT(config, m_expansions[0], kc85_cart, "m011");
- m_expansions[0]->set_next_slot("mc");
- m_expansions[0]->irq().set_inputline(m_maincpu, 0);
- m_expansions[0]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[0]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- KCCART_SLOT(config, m_expansions[1], kc85_cart, nullptr);
- m_expansions[1]->set_next_slot("exp");
- m_expansions[1]->irq().set_inputline(m_maincpu, 0);
- m_expansions[1]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[1]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- /* expansion interface */
- KCEXP_SLOT(config, m_expansions[2], kc85_exp, nullptr);
- m_expansions[2]->set_next_slot(nullptr);
- m_expansions[2]->irq().set_inputline(m_maincpu, 0);
- m_expansions[2]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[2]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- /* Software lists */
- SOFTWARE_LIST(config, "cart_list").set_original("kc_cart");
- SOFTWARE_LIST(config, "flop_list").set_original("kc_flop");
- SOFTWARE_LIST(config, "cass_list").set_original("kc_cass");
+ kc85_slots(config);
/* internal ram */
RAM(config, m_ram).set_default_size("16K");
@@ -182,7 +192,7 @@ void kc85_4_state::kc85_4(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &kc85_4_state::kc85_4_mem);
m_maincpu->set_addrmap(AS_IO, &kc85_4_state::kc85_4_io);
m_maincpu->set_daisy_config(kc85_daisy_chain);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
Z80PIO(config, m_z80pio, KC85_4_CLOCK);
m_z80pio->out_int_callback().set_inputline(m_maincpu, 0);
@@ -215,39 +225,7 @@ void kc85_4_state::kc85_4(machine_config &config)
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
- /* devices */
- QUICKLOAD(config, "quickload", "kcc", attotime::from_seconds(2)).set_load_callback(FUNC(kc_state::quickload_cb));
-
- CASSETTE(config, m_cassette);
- m_cassette->set_formats(kc_cassette_formats);
- m_cassette->set_default_state(CASSETTE_PLAY);
- m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
- m_cassette->set_interface("kc_cass");
-
- /* cartridge slot */
- KCCART_SLOT(config, m_expansions[0], kc85_cart, "m011");
- m_expansions[0]->set_next_slot("mc");
- m_expansions[0]->irq().set_inputline(m_maincpu, 0);
- m_expansions[0]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[0]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- KCCART_SLOT(config, m_expansions[1], kc85_cart, nullptr);
- m_expansions[1]->set_next_slot("exp");
- m_expansions[1]->irq().set_inputline(m_maincpu, 0);
- m_expansions[1]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[1]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- /* expansion interface */
- KCEXP_SLOT(config, m_expansions[2], kc85_exp, nullptr);
- m_expansions[2]->set_next_slot(nullptr);
- m_expansions[2]->irq().set_inputline(m_maincpu, 0);
- m_expansions[2]->nmi().set_inputline(m_maincpu, INPUT_LINE_NMI);
- m_expansions[2]->halt().set_inputline(m_maincpu, INPUT_LINE_HALT);
-
- /* Software lists */
- SOFTWARE_LIST(config, "cart_list").set_original("kc_cart");
- SOFTWARE_LIST(config, "flop_list").set_original("kc_flop");
- SOFTWARE_LIST(config, "cass_list").set_original("kc_cass");
+ kc85_slots(config);
/* internal ram */
RAM(config, m_ram).set_default_size("64K");
diff --git a/src/mame/drivers/kenseim.cpp b/src/mame/drivers/kenseim.cpp
index 4bf9f1f66f5..abdaee4e91a 100644
--- a/src/mame/drivers/kenseim.cpp
+++ b/src/mame/drivers/kenseim.cpp
@@ -504,7 +504,7 @@ void kenseim_state::kenseim(machine_config &config)
ppi_x2.in_pe().set_ioport("MOLEB");
ppi_x2.out_pf().set(FUNC(kenseim_state::mb8936_portf_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
}
static INPUT_PORTS_START( kenseim )
diff --git a/src/mame/drivers/kickgoal.cpp b/src/mame/drivers/kickgoal.cpp
index d7c2db20317..c74508becf6 100644
--- a/src/mame/drivers/kickgoal.cpp
+++ b/src/mame/drivers/kickgoal.cpp
@@ -399,7 +399,7 @@ void kickgoal_state::kickgoal(machine_config &config)
m_audiocpu->read_c().set(FUNC(kickgoal_state::soundio_port_c_r));
m_audiocpu->write_c().set(FUNC(kickgoal_state::soundio_port_c_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
EEPROM_93C46_16BIT(config, "eeprom").default_data(kickgoal_default_eeprom_type1, 128);
diff --git a/src/mame/drivers/kim1.cpp b/src/mame/drivers/kim1.cpp
index bbd30ef8a5c..3a5c1ceee3d 100644
--- a/src/mame/drivers/kim1.cpp
+++ b/src/mame/drivers/kim1.cpp
@@ -246,7 +246,7 @@ void kim1_state::kim1(machine_config &config)
// basic machine hardware
M6502(config, m_maincpu, 1000000); /* 1 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &kim1_state::kim1_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
// video hardware
config.set_default_layout(layout_kim1);
diff --git a/src/mame/drivers/kingdrby.cpp b/src/mame/drivers/kingdrby.cpp
index 75da9697672..e6039a808e6 100644
--- a/src/mame/drivers/kingdrby.cpp
+++ b/src/mame/drivers/kingdrby.cpp
@@ -982,7 +982,7 @@ void kingdrby_state::kingdrby(machine_config &config)
m_soundcpu->set_addrmap(AS_IO, &kingdrby_state::sound_io_map);
m_soundcpu->set_periodic_int(FUNC(kingdrby_state::irq0_line_hold), attotime::from_hz(1000)); /* guess, controls ay8910 tempo.*/
- config.m_perfect_cpu_quantum = subtag("master");
+ config.set_perfect_quantum("master");
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/kingobox.cpp b/src/mame/drivers/kingobox.cpp
index 8e620ca8845..370912478d8 100644
--- a/src/mame/drivers/kingobox.cpp
+++ b/src/mame/drivers/kingobox.cpp
@@ -485,7 +485,7 @@ void kingofb_state::kingofb(machine_config &config)
CLOCK(config, "soundnmi", 6000).signal_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- config.m_minimum_quantum = attotime::from_hz(6000); // We really need heavy synching among the processors
+ config.set_maximum_quantum(attotime::from_hz(6000)); // We really need heavy synching among the processors
/* video hardware */
@@ -542,7 +542,7 @@ void kingofb_state::ringking(machine_config &config)
CLOCK(config, "soundnmi", 6000).signal_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- config.m_minimum_quantum = attotime::from_hz(6000); // We really need heavy synching among the processors
+ config.set_maximum_quantum(attotime::from_hz(6000)); // We really need heavy synching among the processors
/* video hardware */
diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp
index 396e66ec69b..bece7338b8b 100644
--- a/src/mame/drivers/konamigx.cpp
+++ b/src/mame/drivers/konamigx.cpp
@@ -1620,7 +1620,7 @@ void konamigx_state::konamigx(machine_config &config)
m_k053252->int2_ack().set(FUNC(konamigx_state::hblank_irq_ack_w));
m_k053252->set_screen("screen");
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(konamigx_state,konamigx)
MCFG_MACHINE_RESET_OVERRIDE(konamigx_state,konamigx)
diff --git a/src/mame/drivers/ksayakyu.cpp b/src/mame/drivers/ksayakyu.cpp
index 2bb6b96cad4..09536e424a2 100644
--- a/src/mame/drivers/ksayakyu.cpp
+++ b/src/mame/drivers/ksayakyu.cpp
@@ -268,7 +268,7 @@ void ksayakyu_state::ksayakyu(machine_config &config)
audiocpu.set_addrmap(AS_PROGRAM, &ksayakyu_state::soundcpu_map);
audiocpu.set_periodic_int(FUNC(ksayakyu_state::irq0_line_hold), attotime::from_hz(60)); //guess, controls music tempo
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
/* video hardware */
diff --git a/src/mame/drivers/kyugo.cpp b/src/mame/drivers/kyugo.cpp
index d0c96f25d20..9852b5cbbd1 100644
--- a/src/mame/drivers/kyugo.cpp
+++ b/src/mame/drivers/kyugo.cpp
@@ -532,7 +532,7 @@ void kyugo_state::kyugo_base(machine_config &config)
m_subcpu->set_addrmap(AS_IO, &kyugo_state::gyrodine_sub_portmap);
m_subcpu->set_periodic_int(FUNC(kyugo_state::irq0_line_hold), attotime::from_hz(4*60));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(kyugo_state::nmi_mask_w));
diff --git a/src/mame/drivers/ladyfrog.cpp b/src/mame/drivers/ladyfrog.cpp
index 8bbe47e89fa..4d3d2b18ea7 100644
--- a/src/mame/drivers/ladyfrog.cpp
+++ b/src/mame/drivers/ladyfrog.cpp
@@ -299,7 +299,7 @@ void ladyfrog_state::ladyfrog(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &ladyfrog_state::ladyfrog_sound_map);
m_audiocpu->set_periodic_int(FUNC(ladyfrog_state::irq0_line_hold), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp
index 2b4be527c75..5e8da97b532 100644
--- a/src/mame/drivers/lasso.cpp
+++ b/src/mame/drivers/lasso.cpp
@@ -501,7 +501,7 @@ void lasso_state::base(machine_config &config)
M6502(config, m_audiocpu, 600000);
m_audiocpu->set_addrmap(AS_PROGRAM, &lasso_state::lasso_audio_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp
index d6403343398..413e868e505 100644
--- a/src/mame/drivers/lastbank.cpp
+++ b/src/mame/drivers/lastbank.cpp
@@ -413,7 +413,7 @@ void lastbank_state::lastbank(machine_config &config)
audiocpu.set_addrmap(AS_IO, &lastbank_state::lastbank_audio_io);
// yes, we have no interrupts
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
//MCFG_MACHINE_START_OVERRIDE(lastbank_state,lastbank)
//MCFG_MACHINE_RESET_OVERRIDE(lastbank_state,lastbank)
diff --git a/src/mame/drivers/liberate.cpp b/src/mame/drivers/liberate.cpp
index ced0d21aa19..0dc6b06c023 100644
--- a/src/mame/drivers/liberate.cpp
+++ b/src/mame/drivers/liberate.cpp
@@ -753,7 +753,7 @@ void liberate_state::liberate_base(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::liberate_sound_map);
m_audiocpu->set_periodic_int(FUNC(liberate_state::nmi_line_pulse), attotime::from_hz(16*60)); /* ??? */
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
MCFG_MACHINE_START_OVERRIDE(liberate_state,liberate)
MCFG_MACHINE_RESET_OVERRIDE(liberate_state,liberate)
@@ -818,7 +818,7 @@ void liberate_state::prosoccr(machine_config &config)
m_audiocpu->set_clock(10000000/8); //xtal is 12 Mhz, divider is unknown
m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::prosoccr_sound_map);
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
subdevice<screen_device>("screen")->set_visarea(1*8, 31*8-1, 0*8, 32*8-1);
subdevice<screen_device>("screen")->set_screen_update(FUNC(liberate_state::screen_update_prosoccr));
@@ -839,7 +839,7 @@ void liberate_state::prosport(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::liberate_sound_map);
m_audiocpu->set_periodic_int(FUNC(liberate_state::nmi_line_pulse), attotime::from_hz(16*60)); /* ??? */
-// config.m_minimum_quantum = attotime::from_hz(12000);
+// config.set_maximum_quantum(attotime::from_hz(12000));
MCFG_MACHINE_START_OVERRIDE(liberate_state,liberate)
MCFG_MACHINE_RESET_OVERRIDE(liberate_state,liberate)
diff --git a/src/mame/drivers/lisa.cpp b/src/mame/drivers/lisa.cpp
index 13f5228c6a6..ab12a6d5a98 100644
--- a/src/mame/drivers/lisa.cpp
+++ b/src/mame/drivers/lisa.cpp
@@ -117,7 +117,7 @@ void lisa_state::lisa(machine_config &config)
M6504(config, m_fdc_cpu, 2000000); /* 16.000 MHz / 8 in when DIS asserted, 16.000 MHz / 9 otherwise (?) */
m_fdc_cpu->set_addrmap(AS_PROGRAM, &lisa_state::lisa_fdc_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
LS259(config, m_latch); // U4E (CPU board)
m_latch->q_out_cb<0>().set(FUNC(lisa_state::diag1_w));
diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp
index abedbe9ead4..8a38382647b 100644
--- a/src/mame/drivers/lockon.cpp
+++ b/src/mame/drivers/lockon.cpp
@@ -477,7 +477,7 @@ void lockon_state::lockon(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &lockon_state::sound_io);
WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12) * 4096);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
m58990_device &adc(M58990(config, "adc", 16_MHz_XTAL / 16));
adc.in_callback<0>().set_ioport("ADC_BANK");
diff --git a/src/mame/drivers/lsasquad.cpp b/src/mame/drivers/lsasquad.cpp
index 08436c78a2d..2328fde0742 100644
--- a/src/mame/drivers/lsasquad.cpp
+++ b/src/mame/drivers/lsasquad.cpp
@@ -568,7 +568,7 @@ void lsasquad_state::lsasquad(machine_config &config)
TAITO68705_MCU(config, m_bmcu, MASTER_CLOCK / 8);
- config.m_minimum_quantum = attotime::from_hz(30000); /* 500 CPU slices per frame - a high value to ensure proper */
+ config.set_maximum_quantum(attotime::from_hz(30000)); /* 500 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
/* main<->sound synchronization depends on this */
@@ -633,7 +633,7 @@ void lsasquad_state::daikaiju(machine_config &config)
TAITO68705_MCU(config, m_bmcu, MASTER_CLOCK / 8);
- config.m_minimum_quantum = attotime::from_hz(30000); /* 500 CPU slices per frame - a high value to ensure proper */
+ config.set_maximum_quantum(attotime::from_hz(30000)); /* 500 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
/* main<->sound synchronization depends on this */
diff --git a/src/mame/drivers/lviv.cpp b/src/mame/drivers/lviv.cpp
index 6ea1c7e75ad..258960825a0 100644
--- a/src/mame/drivers/lviv.cpp
+++ b/src/mame/drivers/lviv.cpp
@@ -426,7 +426,7 @@ void lviv_state::lviv(machine_config &config)
I8080(config, m_maincpu, 2500000);
m_maincpu->set_addrmap(AS_PROGRAM, &lviv_state::mem_map);
m_maincpu->set_addrmap(AS_IO, &lviv_state::io_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
I8255(config, m_ppi[0]);
m_ppi[0]->in_pa_callback().set(FUNC(lviv_state::ppi_0_porta_r));
diff --git a/src/mame/drivers/lynx.cpp b/src/mame/drivers/lynx.cpp
index 272587ffcaa..0a93825049a 100644
--- a/src/mame/drivers/lynx.cpp
+++ b/src/mame/drivers/lynx.cpp
@@ -79,7 +79,7 @@ void lynx_state::lynx(machine_config &config)
/* basic machine hardware */
M65SC02(config, m_maincpu, 4000000); /* vti core, integrated in vlsi, stz, but not bbr bbs */
m_maincpu->set_addrmap(AS_PROGRAM, &lynx_state::lynx_mem);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ADDRESS_MAP_BANK(config, "bank_fc00").set_map(&lynx_state::lynx_fc00_mem).set_options(ENDIANNESS_LITTLE, 8, 9, 0x100);
ADDRESS_MAP_BANK(config, "bank_fd00").set_map(&lynx_state::lynx_fd00_mem).set_options(ENDIANNESS_LITTLE, 8, 9, 0x100);
diff --git a/src/mame/drivers/m68705prg.cpp b/src/mame/drivers/m68705prg.cpp
index 0f4a23fa273..77b080f65a7 100644
--- a/src/mame/drivers/m68705prg.cpp
+++ b/src/mame/drivers/m68705prg.cpp
@@ -229,7 +229,7 @@ INPUT_PORTS_END
void m68705prg_state_base::m68705prg(machine_config &config)
{
- config.m_perfect_cpu_quantum = subtag("mcu");
+ config.set_perfect_quantum("mcu");
GENERIC_SOCKET(config, m_eprom_image, generic_plain_slot, "eprom", "bin,rom");
m_eprom_image->set_device_load(FUNC(m68705prg_state_base::eprom_load));
diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp
index 018bc8d8290..4576c4b34aa 100644
--- a/src/mame/drivers/mac.cpp
+++ b/src/mame/drivers/mac.cpp
@@ -984,7 +984,7 @@ void mac_state::add_egret(machine_config &config, int type)
m_egret->linechange_callback().set(FUNC(mac_state::adb_linechange_w));
m_egret->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
m_egret->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
}
void mac_state::add_cuda(machine_config &config, int type)
@@ -1040,7 +1040,7 @@ void mac_state::mac512ke_base(machine_config &config)
M68000(config, m_maincpu, C7M); /* 7.8336 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::mac512ke_map);
m_maincpu->set_dasm_override(FUNC(mac_state::mac_dasm_override));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(C7M*2, MAC_H_TOTAL, 0, MAC_H_VIS, MAC_V_TOTAL, 0, MAC_V_VIS);
@@ -1174,7 +1174,7 @@ void mac_state::macprtb(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macprtb_map);
m_maincpu->set_dasm_override(FUNC(mac_state::mac_dasm_override));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
add_pb1xx_screen(config);
m_screen->set_screen_update(FUNC(mac_state::screen_update_macprtb));
diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp
index 76d0e6c5ca1..e1558b518d3 100644
--- a/src/mame/drivers/mac128.cpp
+++ b/src/mame/drivers/mac128.cpp
@@ -1349,7 +1349,7 @@ void mac128_state::mac512ke(machine_config &config)
/* basic machine hardware */
M68000(config, m_maincpu, C7M); /* 7.8336 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &mac128_state::mac512ke_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/macpci.cpp b/src/mame/drivers/macpci.cpp
index 19b8e213538..bf347dcfa06 100644
--- a/src/mame/drivers/macpci.cpp
+++ b/src/mame/drivers/macpci.cpp
@@ -139,7 +139,7 @@ void macpci_state::pippin(machine_config &config)
m_cuda->linechange_callback().set(FUNC(macpci_state::cuda_adb_linechange_w));
m_cuda->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
m_cuda->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
}
/* ROM definition */
diff --git a/src/mame/drivers/magmax.cpp b/src/mame/drivers/magmax.cpp
index 0b3aef9ecb9..2e39e219489 100644
--- a/src/mame/drivers/magmax.cpp
+++ b/src/mame/drivers/magmax.cpp
@@ -336,7 +336,7 @@ void magmax_state::magmax(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &magmax_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &magmax_state::sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp
index d3b62a7774f..1847673a668 100644
--- a/src/mame/drivers/mappy.cpp
+++ b/src/mame/drivers/mappy.cpp
@@ -1334,7 +1334,7 @@ void mappy_state::superpac_common(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 8);
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
ls157_device &dipmux(LS157(config, "dipmux"));
dipmux.a_in_callback().set_ioport("DSW2");
@@ -1445,7 +1445,7 @@ void mappy_state::phozon(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 8);
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
NAMCO_58XX(config, m_namcoio[0], 0);
m_namcoio[0]->in_callback<0>().set_ioport("COINS");
@@ -1504,7 +1504,7 @@ void mappy_state::mappy_common(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 8);
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
ls157_device &dipmux(LS157(config, "dipmux"));
dipmux.a_in_callback().set_ioport("DSW2");
diff --git a/src/mame/drivers/markham.cpp b/src/mame/drivers/markham.cpp
index b4c59511bc7..6bf26f788ad 100644
--- a/src/mame/drivers/markham.cpp
+++ b/src/mame/drivers/markham.cpp
@@ -580,7 +580,7 @@ void markham_state::markham(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &markham_state::markham_slave_map);
m_subcpu->set_vblank_int("screen", FUNC(markham_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(CPU_CLOCK/256);
+ config.set_maximum_quantum(attotime::from_hz(CPU_CLOCK/256));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/matmania.cpp b/src/mame/drivers/matmania.cpp
index 4b75f814977..6d8f8f0c62d 100644
--- a/src/mame/drivers/matmania.cpp
+++ b/src/mame/drivers/matmania.cpp
@@ -310,7 +310,7 @@ void matmania_state::matmania(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &matmania_state::matmania_sound_map);
m_audiocpu->set_periodic_int(FUNC(matmania_state::nmi_line_pulse), attotime::from_hz(15*60)); /* ???? */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -350,7 +350,7 @@ void matmania_state::maniach(machine_config &config)
TAITO68705_MCU(config, m_mcu, 1500000*2); /* (don't know really how fast, but it doesn't need to even be this fast) */
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slice per frame - high interleaving to sync main and mcu */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slice per frame - high interleaving to sync main and mcu */
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/mbc55x.cpp b/src/mame/drivers/mbc55x.cpp
index 4cab6e24bae..8389e69c5a4 100644
--- a/src/mame/drivers/mbc55x.cpp
+++ b/src/mame/drivers/mbc55x.cpp
@@ -333,8 +333,8 @@ void mbc55x_state::mbc55x(machine_config &config)
FLOPPY_CONNECTOR(config, m_floppy[0], mbc55x_floppies, "qd", mbc55x_state::floppy_formats);
FLOPPY_CONNECTOR(config, m_floppy[1], mbc55x_floppies, "qd", mbc55x_state::floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppy[2], mbc55x_floppies, "", mbc55x_state::floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppy[3], mbc55x_floppies, "", mbc55x_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppy[2], mbc55x_floppies, nullptr, mbc55x_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppy[3], mbc55x_floppies, nullptr, mbc55x_state::floppy_formats);
/* Software list */
SOFTWARE_LIST(config, "disk_list").set_original("mbc55x");
diff --git a/src/mame/drivers/meadows.cpp b/src/mame/drivers/meadows.cpp
index 54c4d003c0e..424591c3f0b 100644
--- a/src/mame/drivers/meadows.cpp
+++ b/src/mame/drivers/meadows.cpp
@@ -631,7 +631,7 @@ void meadows_state::meadows(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &meadows_state::audio_map);
m_audiocpu->set_periodic_int(FUNC(meadows_state::audio_interrupt), attotime::from_hz((double)5000000/131072));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -691,7 +691,7 @@ void meadows_state::bowl3d(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &meadows_state::audio_map);
m_audiocpu->set_periodic_int(FUNC(meadows_state::audio_interrupt), attotime::from_hz((double)5000000/131072));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp
index 723bd131193..d3da3941779 100644
--- a/src/mame/drivers/megadriv.cpp
+++ b/src/mame/drivers/megadriv.cpp
@@ -749,6 +749,8 @@ void md_cons_state::genesis_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
SOFTWARE_LIST(config, "cd_list").set_original("segacd");
@@ -768,6 +770,8 @@ void md_cons_state::md_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
SOFTWARE_LIST(config, "cd_list").set_original("megacd");
@@ -787,6 +791,8 @@ void md_cons_state::mdj_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
SOFTWARE_LIST(config, "cd_list").set_original("megacdj");
@@ -803,6 +809,8 @@ void md_cons_state::genesis_32x_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd)
@@ -823,6 +831,8 @@ void md_cons_state::md_32x_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd)
@@ -843,6 +853,8 @@ void md_cons_state::mdj_32x_scd(machine_config &config)
m_segacd->set_hostcpu(m_maincpu);
m_segacd->set_screen("megadriv");
+ config.set_perfect_quantum("segacd:segacd_68k"); // perfect sync to the fastest cpu
+
CDROM(config, "cdrom").set_interface("scd_cdrom");
MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd)
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp
index f6b5f253cea..03a671239c1 100644
--- a/src/mame/drivers/megaphx.cpp
+++ b/src/mame/drivers/megaphx.cpp
@@ -395,7 +395,7 @@ void megaphx_state::megaphx(machine_config &config)
pic.read_b().set(FUNC(megaphx_state::pic_portb_r));
pic.write_b().set(FUNC(megaphx_state::pic_portb_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
TTL166(config, m_dsw_shifter[0]);
m_dsw_shifter[0]->data_callback().set_ioport("DSW1");
diff --git a/src/mame/drivers/megaplay.cpp b/src/mame/drivers/megaplay.cpp
index b1a136b3c40..8d7f3e71099 100644
--- a/src/mame/drivers/megaplay.cpp
+++ b/src/mame/drivers/megaplay.cpp
@@ -677,7 +677,7 @@ void mplay_state::megaplay(machine_config &config)
m_bioscpu->set_addrmap(AS_PROGRAM, &mplay_state::megaplay_bios_map);
m_bioscpu->set_addrmap(AS_IO, &mplay_state::megaplay_bios_io_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
cxd1095_device &io1(CXD1095(config, "io1"));
io1.in_porta_cb().set_ioport("DSW0");
diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp
index 0090c681377..130af99e70c 100644
--- a/src/mame/drivers/megasys1.cpp
+++ b/src/mame/drivers/megasys1.cpp
@@ -1705,7 +1705,7 @@ void megasys1_state::system_A(machine_config &config)
M68000(config, m_audiocpu, SOUND_CPU_CLOCK); /* 7MHz verified */
m_audiocpu->set_addrmap(AS_PROGRAM, &megasys1_state::megasys1A_sound_map);
- config.m_minimum_quantum = attotime::from_hz(120000);
+ config.set_maximum_quantum(attotime::from_hz(120000));
MCFG_MACHINE_RESET_OVERRIDE(megasys1_state,megasys1)
diff --git a/src/mame/drivers/megazone.cpp b/src/mame/drivers/megazone.cpp
index 52548698b5e..70c3e70d790 100644
--- a/src/mame/drivers/megazone.cpp
+++ b/src/mame/drivers/megazone.cpp
@@ -309,7 +309,7 @@ void megazone_state::megazone(machine_config &config)
m_daccpu->p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w));
m_daccpu->p2_out_cb().set(FUNC(megazone_state::i8039_irqen_and_status_w));
- config.m_minimum_quantum = attotime::from_hz(900);
+ config.set_maximum_quantum(attotime::from_hz(900));
ls259_device &mainlatch(LS259(config, "mainlatch")); // 13A
mainlatch.q_out_cb<0>().set(FUNC(megazone_state::coin_counter_2_w));
diff --git a/src/mame/drivers/mephisto_polgar.cpp b/src/mame/drivers/mephisto_polgar.cpp
index 363a46e2e4e..838314807c5 100644
--- a/src/mame/drivers/mephisto_polgar.cpp
+++ b/src/mame/drivers/mephisto_polgar.cpp
@@ -331,7 +331,7 @@ void mephisto_risc_state::mrisc(machine_config &config)
maincpu.set_periodic_int(FUNC(mephisto_risc_state::irq0_line_hold), attotime::from_hz(XTAL(10'000'000) / (1 << 14)));
CHESSMACHINE(config, m_chessm, 14'000'000); // Tasc ChessMachine EC PCB, Mephisto manual says 14MHz (no XTAL)
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum("maincpu");
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/mexico86.cpp b/src/mame/drivers/mexico86.cpp
index 85e1b05bd55..60890eebd34 100644
--- a/src/mame/drivers/mexico86.cpp
+++ b/src/mame/drivers/mexico86.cpp
@@ -445,7 +445,7 @@ void mexico86_state::mexico86(machine_config &config)
m_subcpu->set_vblank_int("screen", FUNC(mexico86_state::irq0_line_hold));
/* 100 CPU slices per frame - high value to ensure proper synchronization of the CPUs */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index ed60e443656..9ffdcd847d7 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -354,7 +354,7 @@ void micro3d_state::micro3d(machine_config &config)
mfp.out_tco_cb().set("mfp", FUNC(mc68901_device::tbi_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- config.m_minimum_quantum = attotime::from_hz(3000);
+ config.set_maximum_quantum(attotime::from_hz(3000));
PALETTE(config, m_palette).set_format(palette_device::BRGx_555, 4096);
diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp
index 9f07c04fef1..eb72798d1ab 100644
--- a/src/mame/drivers/microvsn.cpp
+++ b/src/mame/drivers/microvsn.cpp
@@ -648,7 +648,7 @@ void microvision_state::microvision(machine_config &config)
m_tms1100->o().set(FUNC(microvision_state::tms1100_write_o));
m_tms1100->r().set(FUNC(microvision_state::tms1100_write_r));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
screen.set_refresh_hz(60);
diff --git a/src/mame/drivers/mikromik.cpp b/src/mame/drivers/mikromik.cpp
index 043c2c50188..2de5455e601 100644
--- a/src/mame/drivers/mikromik.cpp
+++ b/src/mame/drivers/mikromik.cpp
@@ -435,7 +435,7 @@ void mm1_state::mm1(machine_config &config)
m_maincpu->in_sid_func().set(FUNC(mm1_state::dsra_r));
m_maincpu->out_sod_func().set(KB_TAG, FUNC(mm1_keyboard_device::bell_w));
- config.m_perfect_cpu_quantum = subtag(I8085A_TAG);
+ config.set_perfect_quantum(m_maincpu);
// peripheral hardware
ADDRESS_MAP_BANK(config, m_io);
diff --git a/src/mame/drivers/mindset.cpp b/src/mame/drivers/mindset.cpp
index e886f5003f5..cffba194b09 100644
--- a/src/mame/drivers/mindset.cpp
+++ b/src/mame/drivers/mindset.cpp
@@ -1312,7 +1312,7 @@ static void mindset_modules(device_slot_interface &device)
void mindset_state::mindset(machine_config &config)
{
- config.m_perfect_cpu_quantum = ":syscpu";
+ config.set_perfect_quantum(m_syscpu);
config.set_default_layout(layout_mindset);
I80186(config, m_maincpu, 12_MHz_XTAL); // Divides internally by 2 to produce a clkout of 6MHz
diff --git a/src/mame/drivers/missb2.cpp b/src/mame/drivers/missb2.cpp
index 4cbc681c8db..94fb1414a08 100644
--- a/src/mame/drivers/missb2.cpp
+++ b/src/mame/drivers/missb2.cpp
@@ -481,7 +481,7 @@ void missb2_state::missb2(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &missb2_state::sound_map);
m_audiocpu->set_vblank_int("screen", FUNC(missb2_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
+ config.set_maximum_quantum(attotime::from_hz(6000)); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 128);
diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp
index b4d53d3f304..4023fda0f15 100644
--- a/src/mame/drivers/mlanding.cpp
+++ b/src/mame/drivers/mlanding.cpp
@@ -971,7 +971,7 @@ void mlanding_state::mlanding(machine_config &config)
ciu.set_master_tag(m_maincpu);
ciu.set_slave_tag(m_audiocpu);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TAITOIO_YOKE(config, m_yoke, 0);
diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp
index 5cc7e44f6f3..cac1948c3d2 100644
--- a/src/mame/drivers/model2.cpp
+++ b/src/mame/drivers/model2.cpp
@@ -2809,7 +2809,7 @@ void model2b_state::model2b(machine_config &config)
//m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_HOST);
//m_dsp2->set_addrmap(AS_DATA, &model2b_state::geo_sharc_map);
- config.m_minimum_quantum = attotime::from_hz(18000);
+ config.set_maximum_quantum(attotime::from_hz(18000));
GENERIC_FIFO_U32(config, m_copro_fifo_in, 0);
GENERIC_FIFO_U32(config, m_copro_fifo_out, 0);
diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp
index 5c3becdccf5..1d814bde944 100644
--- a/src/mame/drivers/model3.cpp
+++ b/src/mame/drivers/model3.cpp
@@ -5987,7 +5987,7 @@ void model3_state::model3_10(machine_config &config)
add_base_devices(config);
add_scsi_devices(config);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_START_OVERRIDE(model3_state,model3_10)
MCFG_MACHINE_RESET_OVERRIDE(model3_state,model3_10)
diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp
index 3e22aa97128..d29e1fb6681 100644
--- a/src/mame/drivers/mpu4vid.cpp
+++ b/src/mame/drivers/mpu4vid.cpp
@@ -1300,7 +1300,7 @@ void mpu4vid_state::mpu4_vid(machine_config &config)
m_videocpu->set_addrmap(AS_PROGRAM, &mpu4vid_state::mpu4_68k_map);
m_videocpu->set_reset_callback(FUNC(mpu4vid_state::mpu_video_reset));
-// config.m_minimum_quantum = attotime::from_hz(960);
+// config.set_maximum_quantum(attotime::from_hz(960));
PALETTE(config, m_palette).set_entries(ef9369_device::NUMCOLORS);
diff --git a/src/mame/drivers/mrflea.cpp b/src/mame/drivers/mrflea.cpp
index c9020ed39ec..7253545d3c0 100644
--- a/src/mame/drivers/mrflea.cpp
+++ b/src/mame/drivers/mrflea.cpp
@@ -268,7 +268,7 @@ void mrflea_state::mrflea(machine_config &config)
m_subcpu->set_addrmap(AS_IO, &mrflea_state::mrflea_slave_io_map);
TIMER(config, "scantimer").configure_scanline(FUNC(mrflea_state::mrflea_slave_interrupt), "screen", 0, 1);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
i8255_device &mainppi(I8255(config, "mainppi", 0));
mainppi.in_pb_callback().set("subppi", FUNC(i8255_device::pb_r));
diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp
index ff2ea701a26..2a443b7d5d9 100644
--- a/src/mame/drivers/ms32.cpp
+++ b/src/mame/drivers/ms32.cpp
@@ -1746,7 +1746,7 @@ void ms32_state::ms32(machine_config &config)
Z80(config, m_audiocpu, 8000000); // Z0840008PSC, Clock from notes
m_audiocpu->set_addrmap(AS_PROGRAM, &ms32_state::ms32_sound_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
/* video hardware */
diff --git a/src/mame/drivers/msx.cpp b/src/mame/drivers/msx.cpp
index 9e5aac585d4..e8ec92473e8 100644
--- a/src/mame/drivers/msx.cpp
+++ b/src/mame/drivers/msx.cpp
@@ -1357,7 +1357,7 @@ void msx_state::msx(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &msx_state::msx_memory_map);
m_maincpu->set_addrmap(AS_IO, &msx_state::msx_io_map);
m_maincpu->set_vblank_int("screen", FUNC(msx_state::msx_interrupt)); /* Needed for mouse updates */
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline("maincpu", INPUT_LINE_IRQ0);
@@ -1422,7 +1422,7 @@ void msx2_state::msx2(machine_config &config)
Z80(config, m_maincpu, 21.477272_MHz_XTAL / 6); /* 3.579545 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &msx2_state::msx_memory_map);
m_maincpu->set_addrmap(AS_IO, &msx2_state::msx2_io_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline("maincpu", INPUT_LINE_IRQ0);
@@ -1485,7 +1485,7 @@ void msx2_state::msx2p(machine_config &config)
Z80(config, m_maincpu, 21.477272_MHz_XTAL / 6); /* 3.579545 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &msx2_state::msx_memory_map);
m_maincpu->set_addrmap(AS_IO, &msx2_state::msx2p_io_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline("maincpu", INPUT_LINE_IRQ0);
diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp
index e06b365278c..5bed1b52102 100644
--- a/src/mame/drivers/mystwarr.cpp
+++ b/src/mame/drivers/mystwarr.cpp
@@ -932,7 +932,7 @@ void mystwarr_state::mystwarr(machine_config &config)
Z80(config, m_soundcpu, 8000000);
m_soundcpu->set_addrmap(AS_PROGRAM, &mystwarr_state::mystwarr_sound_map);
- config.m_minimum_quantum = attotime::from_hz(1920);
+ config.set_maximum_quantum(attotime::from_hz(1920));
EEPROM_ER5911_8BIT(config, "eeprom");
diff --git a/src/mame/drivers/mz3500.cpp b/src/mame/drivers/mz3500.cpp
index 53de3d3810d..cbc069208b3 100644
--- a/src/mame/drivers/mz3500.cpp
+++ b/src/mame/drivers/mz3500.cpp
@@ -820,7 +820,7 @@ void mz3500_state::mz3500(machine_config &config)
m_slave->set_addrmap(AS_PROGRAM, &mz3500_state::mz3500_slave_map);
m_slave->set_addrmap(AS_IO, &mz3500_state::mz3500_slave_io);
- config.m_perfect_cpu_quantum = subtag("master");
+ config.set_perfect_quantum(m_master);
i8255_device &ppi(I8255A(config, "i8255"));
ppi.out_pa_callback().set(FUNC(mz3500_state::mz3500_pa_w));
diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp
index 27c787f774b..9735619262c 100644
--- a/src/mame/drivers/n64.cpp
+++ b/src/mame/drivers/n64.cpp
@@ -447,7 +447,7 @@ void n64_mess_state::n64(machine_config &config)
m_rsp->status_set().set(m_rcp_periphs, FUNC(n64_periphs::sp_set_status));
m_rsp->set_addrmap(AS_PROGRAM, &n64_mess_state::rsp_map);
- config.m_minimum_quantum = attotime::from_hz(500000);
+ config.set_maximum_quantum(attotime::from_hz(500000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/namcond1.cpp b/src/mame/drivers/namcond1.cpp
index f86996ee325..4feaa584b22 100644
--- a/src/mame/drivers/namcond1.cpp
+++ b/src/mame/drivers/namcond1.cpp
@@ -379,7 +379,7 @@ void namcond1_state::namcond1(machine_config &config)
m_mcu->set_addrmap(AS_IO, &namcond1_state::nd1h8iomap);
m_mcu->set_vblank_int("screen", FUNC(namcond1_state::mcu_interrupt));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
YGV608(config, m_ygv608, 0);
m_ygv608->vblank_callback().set(FUNC(namcond1_state::vblank_irq_w));
diff --git a/src/mame/drivers/namcos1.cpp b/src/mame/drivers/namcos1.cpp
index 1287ffb2ad5..f6544716c89 100644
--- a/src/mame/drivers/namcos1.cpp
+++ b/src/mame/drivers/namcos1.cpp
@@ -1027,7 +1027,7 @@ void namcos1_state::ns1(machine_config &config)
m_c117->subres_cb().set(FUNC(namcos1_state::subres_w));
// heavy sync required to prevent CPUs from fighting for video RAM access and going into deadlocks
- config.m_minimum_quantum = attotime::from_hz(38400);
+ config.set_maximum_quantum(attotime::from_hz(38400));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp
index 264a663547d..e0ce39f1a64 100644
--- a/src/mame/drivers/namcos12.cpp
+++ b/src/mame/drivers/namcos12.cpp
@@ -1836,7 +1836,7 @@ void namcos12_boothack_state::truckk(machine_config &config)
subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
}
READ16_MEMBER(namcos12_state::iob_p4_r)
@@ -1912,7 +1912,7 @@ void namcos12_boothack_state::technodr(machine_config &config)
subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
}
void namcos12_boothack_state::aplarail(machine_config &config)
@@ -1932,7 +1932,7 @@ void namcos12_boothack_state::aplarail(machine_config &config)
subdevice<h8_sci_device>("iocpu:sci0")->tx_handler().set("sub:sci0", FUNC(h8_sci_device::rx_w));
subdevice<h8_sci_device>("sub:sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
}
static INPUT_PORTS_START( namcos12 )
diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp
index adf6dc37661..e102559892e 100644
--- a/src/mame/drivers/namcos2.cpp
+++ b/src/mame/drivers/namcos2.cpp
@@ -1757,7 +1757,7 @@ void namcos2_state::base_noio(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &namcos2_state::sound_default_am);
m_audiocpu->set_periodic_int(FUNC(namcos2_state::irq0_line_hold), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(12000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(12000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -1822,7 +1822,7 @@ void namcos2_state::assaultp(machine_config &config)
{
base2(config);
- config.m_minimum_quantum = attotime::from_hz(12000*8); /* CPU slices per frame - boosted (along with MCU speed) so that the Mode Select works */
+ config.set_maximum_quantum(attotime::from_hz(12000*8)); /* CPU slices per frame - boosted (along with MCU speed) so that the Mode Select works */
}
void namcos2_state::base3(machine_config &config)
@@ -1851,7 +1851,7 @@ void namcos2_state::gollygho(machine_config &config)
configure_c65_standard(config);
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -1904,7 +1904,7 @@ void namcos2_state::finallap_noio(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &namcos2_state::sound_default_am);
m_audiocpu->set_periodic_int(FUNC(namcos2_state::irq0_line_hold), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -1985,7 +1985,7 @@ void namcos2_state::sgunner(machine_config &config)
configure_c65_standard(config);
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -2038,7 +2038,7 @@ void namcos2_state::sgunner2(machine_config &config)
configure_c68_standard(config);
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -2091,7 +2091,7 @@ void namcos2_state::suzuka8h(machine_config &config)
configure_c68_standard(config);
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -2163,7 +2163,7 @@ void namcos2_state::metlhawk(machine_config &config)
configure_c65_standard(config);
- config.m_minimum_quantum = attotime::from_hz(6000); /* CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp
index 9ab76cc6887..d1adcfca02a 100644
--- a/src/mame/drivers/namcos21.cpp
+++ b/src/mame/drivers/namcos21.cpp
@@ -878,7 +878,7 @@ void namcos21_state::winrun(machine_config &config)
NAMCO_C148(config, m_gpu_intc, 0, "gpu", false);
NAMCO_C139(config, m_sci, 0);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/namcos21_c67.cpp b/src/mame/drivers/namcos21_c67.cpp
index b9d2fda5150..4b05303a602 100644
--- a/src/mame/drivers/namcos21_c67.cpp
+++ b/src/mame/drivers/namcos21_c67.cpp
@@ -796,7 +796,7 @@ void namcos21_c67_state::namcos21(machine_config &config)
NAMCOS21_DSP_C67(config, m_namcos21_dsp_c67, 0);
m_namcos21_dsp_c67->set_renderer_tag("namcos21_3d");
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/namcos21_de.cpp b/src/mame/drivers/namcos21_de.cpp
index f75a54b2abf..cb0f209acb8 100644
--- a/src/mame/drivers/namcos21_de.cpp
+++ b/src/mame/drivers/namcos21_de.cpp
@@ -170,7 +170,7 @@ void namco_de_pcbstack_device::device_add_mconfig(machine_config &config)
NAMCOS21_DSP(config, m_namcos21_dsp, 0);
m_namcos21_dsp->set_renderer_tag("namcos21_3d");
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp
index c354fc475f5..40a8e642693 100644
--- a/src/mame/drivers/namcos22.cpp
+++ b/src/mame/drivers/namcos22.cpp
@@ -3949,7 +3949,7 @@ void namcos22s_state::namcos22s(machine_config &config)
m_mcu->an2_cb().set(FUNC(namcos22s_state::mcu_adc_r<2>));
m_mcu->an3_cb().set(FUNC(namcos22s_state::mcu_adc_r<3>));
TIMER(config, "mcu_irq").configure_scanline(FUNC(namcos22s_state::mcu_irq), "screen", 0, 240);
- config.m_minimum_quantum = attotime::from_hz(9000); // erratic inputs otherwise, probably mcu vs maincpu shareram
+ config.set_maximum_quantum(attotime::from_hz(9000)); // erratic inputs otherwise, probably mcu vs maincpu shareram
config.device_remove("iomcu");
diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp
index 1a3b81ded51..addc1f813fa 100644
--- a/src/mame/drivers/namcos23.cpp
+++ b/src/mame/drivers/namcos23.cpp
@@ -3618,7 +3618,7 @@ void namcos23_state::gorgon(machine_config &config)
m_iocpu->subdevice<h8_sci_device>("sci0")->tx_handler().set("subcpu:sci0", FUNC(h8_sci_device::rx_w));
m_subcpu->subdevice<h8_sci_device>("sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
NAMCO_SETTINGS(config, m_settings, 0);
@@ -3683,7 +3683,7 @@ void namcos23_state::s23(machine_config &config)
m_iocpu->subdevice<h8_sci_device>("sci0")->tx_handler().set("subcpu:sci0", FUNC(h8_sci_device::rx_w));
m_subcpu->subdevice<h8_sci_device>("sci0")->tx_handler().set("iocpu:sci0", FUNC(h8_sci_device::rx_w));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
NAMCO_SETTINGS(config, m_settings, 0);
@@ -3762,7 +3762,7 @@ void namcos23_state::ss23(machine_config &config)
// Timer at 115200*16 for the jvs serial clock
m_subcpu->subdevice<h8_sci_device>("sci0")->set_external_clock_period(attotime::from_hz(JVSCLOCK/8));
- config.m_minimum_quantum = attotime::from_hz(2*115200);
+ config.set_maximum_quantum(attotime::from_hz(2*115200));
NAMCO_SETTINGS(config, m_settings, 0);
diff --git a/src/mame/drivers/namcos86.cpp b/src/mame/drivers/namcos86.cpp
index 130d85a7ecc..fc4cc690188 100644
--- a/src/mame/drivers/namcos86.cpp
+++ b/src/mame/drivers/namcos86.cpp
@@ -1065,7 +1065,7 @@ void namcos86_state::hopmappy(machine_config &config)
m_mcu->out_p2_cb().set(FUNC(namcos86_state::led_w));
m_mcu->set_vblank_int("screen", FUNC(namcos86_state::irq0_line_hold)); /* ??? */
- config.m_minimum_quantum = attotime::from_hz(48000); /* heavy interleaving needed to avoid hangs in rthunder */
+ config.set_maximum_quantum(attotime::from_hz(48000)); /* heavy interleaving needed to avoid hangs in rthunder */
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp
index 26831fe30bd..d3eb65fd42b 100644
--- a/src/mame/drivers/nascom1.cpp
+++ b/src/mame/drivers/nascom1.cpp
@@ -132,7 +132,7 @@ public:
nascom2_state(const machine_config &mconfig, device_type type, const char *tag)
: nascom_state(mconfig, type, tag)
, m_clock(*this, "uart_clock")
- , m_nasbus(*this, NASBUS_TAG)
+ , m_nasbus(*this, "nasbus")
, m_socket1(*this, "socket1")
, m_socket2(*this, "socket2")
, m_lsw1(*this, "lsw1")
@@ -855,14 +855,14 @@ void nascom2_state::nascom2(machine_config &config)
m_socket2->set_device_load(FUNC(nascom2_state::socket2_load));
// nasbus expansion bus
- nasbus_device &nasbus(NASBUS(config, NASBUS_TAG));
- nasbus.ram_disable().set(FUNC(nascom2_state::ram_disable_w));
- nasbus.set_program_space(m_maincpu, AS_PROGRAM);
- nasbus.set_io_space(m_maincpu, AS_IO);
- NASBUS_SLOT(config, "nasbus1", nasbus_slot_cards, nullptr);
- NASBUS_SLOT(config, "nasbus2", nasbus_slot_cards, nullptr);
- NASBUS_SLOT(config, "nasbus3", nasbus_slot_cards, nullptr);
- NASBUS_SLOT(config, "nasbus4", nasbus_slot_cards, nullptr);
+ NASBUS(config, m_nasbus);
+ m_nasbus->ram_disable().set(FUNC(nascom2_state::ram_disable_w));
+ m_nasbus->set_program_space(m_maincpu, AS_PROGRAM);
+ m_nasbus->set_io_space(m_maincpu, AS_IO);
+ NASBUS_SLOT(config, "nasbus1", m_nasbus, nasbus_slot_cards, nullptr);
+ NASBUS_SLOT(config, "nasbus2", m_nasbus, nasbus_slot_cards, nullptr);
+ NASBUS_SLOT(config, "nasbus3", m_nasbus, nasbus_slot_cards, nullptr);
+ NASBUS_SLOT(config, "nasbus4", m_nasbus, nasbus_slot_cards, nullptr);
// software
SOFTWARE_LIST(config, "snap_list").set_original("nascom_snap").set_filter("NASCOM2");
@@ -882,7 +882,7 @@ void nascom2_state::nascom2c(machine_config &config)
m_ram->set_default_size("60K");
- subdevice<nasbus_device>(NASBUS_TAG)->ram_disable().set(FUNC(nascom2_state::ram_disable_cpm_w));
+ m_nasbus->ram_disable().set(FUNC(nascom2_state::ram_disable_cpm_w));
subdevice<nasbus_slot_device>("nasbus1")->set_default_option("floppy");
}
diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp
index 1103ba80a3b..eea21d91613 100644
--- a/src/mame/drivers/nc.cpp
+++ b/src/mame/drivers/nc.cpp
@@ -1381,7 +1381,7 @@ void nc_state::nc_base(machine_config &config)
/* basic machine hardware */
Z80(config, m_maincpu, /*6000000*/ 4606000); /* Russell Marks says this is more accurate */
m_maincpu->set_addrmap(AS_PROGRAM, &nc_state::nc_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
diff --git a/src/mame/drivers/ncd68k.cpp b/src/mame/drivers/ncd68k.cpp
index e1a4e99e3fb..7e4ef1b22cf 100644
--- a/src/mame/drivers/ncd68k.cpp
+++ b/src/mame/drivers/ncd68k.cpp
@@ -505,18 +505,18 @@ void ncd16_state::configure(machine_config &config)
common(config);
m_duart->outport_cb().set(
- [this](u8 data)
- {
- m_serial[0]->write_rts(BIT(data, 0));
- m_serial[1]->write_rts(BIT(data, 1));
- m_serial[0]->write_dtr(BIT(data, 2));
- m_serial[1]->write_dtr(BIT(data, 3));
- m_bert->set_qlc_mode(BIT(data, 5));
-
- // TODO: bit 4 - usually set
- // TODO: bit 6 - usually set
- // TODO: bit 7 - set/cleared continuously
- });
+ [this] (u8 data)
+ {
+ m_serial[0]->write_rts(BIT(data, 0));
+ m_serial[1]->write_rts(BIT(data, 1));
+ m_serial[0]->write_dtr(BIT(data, 2));
+ m_serial[1]->write_dtr(BIT(data, 3));
+ m_bert->set_qlc_mode(BIT(data, 5));
+
+ // TODO: bit 4 - usually set
+ // TODO: bit 6 - usually set
+ // TODO: bit 7 - set/cleared continuously
+ });
}
void ncd17c_state::configure(machine_config &config)
@@ -590,7 +590,7 @@ void ncd19_state::configure(machine_config &config)
void ncd68k_state::common(machine_config &config)
{
// HACK: this makes the ncd16 and ncd19 keyboard work
- config.m_perfect_cpu_quantum = subtag("mcu");
+ config.set_perfect_quantum(m_mcu);
// mcu ports
m_mcu->porta_w().set(FUNC(ncd68k_state::mcu_porta_w));
@@ -604,13 +604,13 @@ void ncd68k_state::common(machine_config &config)
PC_KBDC(config, m_kbd_con, 0);
m_kbd_con->out_clock_cb().set_inputline(m_mcu, M6805_IRQ_LINE).invert();
m_kbd_con->out_data_cb().set(
- [this](int state)
- {
- if (state)
- m_porta_in |= 0x01;
- else
- m_porta_in &= ~0x01;
- });
+ [this] (int state)
+ {
+ if (state)
+ m_porta_in |= 0x01;
+ else
+ m_porta_in &= ~0x01;
+ });
// keyboard port
pc_kbdc_slot_device &kbd(PC_KBDC_SLOT(config, "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL));
@@ -618,30 +618,30 @@ void ncd68k_state::common(machine_config &config)
// mouse and auxiliary ports
RS232_PORT(config, m_serial[0],
- [](device_slot_interface &device)
- {
- default_rs232_devices(device);
- device.option_add("mouse", LOGITECH_HLE_SERIAL_MOUSE);
- },
- "mouse");
+ [] (device_slot_interface &device)
+ {
+ default_rs232_devices(device);
+ device.option_add("mouse", LOGITECH_HLE_SERIAL_MOUSE);
+ },
+ "mouse");
RS232_PORT(config, m_serial[1], default_rs232_devices, nullptr);
// duart outputs
m_duart->a_tx_cb().set(m_serial[0], FUNC(rs232_port_device::write_txd));
m_duart->b_tx_cb().set(m_serial[1], FUNC(rs232_port_device::write_txd));
m_duart->outport_cb().set(
- [this](u8 data)
- {
- m_serial[0]->write_rts(BIT(data, 0));
- m_serial[1]->write_rts(BIT(data, 1));
- m_serial[0]->write_dtr(BIT(data, 2));
- m_serial[1]->write_dtr(BIT(data, 3));
-
- // TODO: bit 4 - usually set
- // TODO: bit 5 - usually clear
- // TODO: bit 6 - usually set
- // TODO: bit 7 - set/cleared continuously
- });
+ [this] (u8 data)
+ {
+ m_serial[0]->write_rts(BIT(data, 0));
+ m_serial[1]->write_rts(BIT(data, 1));
+ m_serial[0]->write_dtr(BIT(data, 2));
+ m_serial[1]->write_dtr(BIT(data, 3));
+
+ // TODO: bit 4 - usually set
+ // TODO: bit 5 - usually clear
+ // TODO: bit 6 - usually set
+ // TODO: bit 7 - set/cleared continuously
+ });
// duart inputs
// FIXME: rts/dsr external loopback test fails - dsr might not be correct?
diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp
index 5f01170e228..0e522a1b3c4 100644
--- a/src/mame/drivers/neogeo.cpp
+++ b/src/mame/drivers/neogeo.cpp
@@ -893,22 +893,22 @@ WRITE8_MEMBER(neogeo_base_state::audio_cpu_enable_nmi_w)
READ16_MEMBER(ngarcade_base_state::in0_edge_r)
{
- return (m_edge->in0_r(space, offset) << 8) | m_dsw->read();
+ return (m_edge->in0_r() << 8) | m_dsw->read();
}
READ16_MEMBER(ngarcade_base_state::in0_edge_joy_r)
{
- return ((m_edge->in0_r(space, offset) & m_ctrl1->ctrl_r(space, offset)) << 8) | m_dsw->read();
+ return ((m_edge->in0_r() & m_ctrl1->read_ctrl()) << 8) | m_dsw->read();
}
READ16_MEMBER(ngarcade_base_state::in1_edge_r)
{
- return (m_edge->in1_r(space, offset) << 8) | 0xff;
+ return (m_edge->in1_r() << 8) | 0xff;
}
READ16_MEMBER(ngarcade_base_state::in1_edge_joy_r)
{
- return ((m_edge->in1_r(space, offset) & m_ctrl2->ctrl_r(space, offset)) << 8) | 0xff;
+ return ((m_edge->in1_r() & m_ctrl2->read_ctrl()) << 8) | 0xff;
}
CUSTOM_INPUT_MEMBER(ngarcade_base_state::startsel_edge_joy_r)
@@ -1737,9 +1737,9 @@ void aes_base_state::aes_base_main_map(address_map &map)
{
base_main_map(map);
- map(0x300000, 0x300000).mirror(0x01fffe).r(m_ctrl1, FUNC(neogeo_control_port_device::ctrl_r));
+ map(0x300000, 0x300000).mirror(0x01fffe).r(m_ctrl1, FUNC(neogeo_control_port_device::read_ctrl));
map(0x320000, 0x320001).mirror(0x01fffe).portr("AUDIO");
- map(0x340000, 0x340000).mirror(0x01fffe).r(m_ctrl2, FUNC(neogeo_control_port_device::ctrl_r));
+ map(0x340000, 0x340000).mirror(0x01fffe).r(m_ctrl2, FUNC(neogeo_control_port_device::read_ctrl));
map(0x380000, 0x380001).mirror(0x01fffe).r(FUNC(aes_base_state::aes_in2_r));
}
@@ -2004,8 +2004,8 @@ void mvs_led_state::mv1(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, false);
cartslot_config(config, 1);
@@ -2019,8 +2019,8 @@ void mvs_led_state::mv1f(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, false);
cartslot_config(config, 1);
@@ -2048,8 +2048,8 @@ void mvs_led_el_state::mv2f(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, false);
cartslot_config(config, 2);
@@ -2065,8 +2065,8 @@ void mvs_led_el_state::mv4f(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, false);
cartslot_config(config, 4);
@@ -2082,8 +2082,8 @@ void mvs_led_el_state::mv6f(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", false);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, false);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, false);
cartslot_config(config, 6);
@@ -2099,8 +2099,8 @@ void mvs_led_state::mv1_fixed(machine_config &config)
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge, "joy", true);
- NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, "", true);
- NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, "", true);
+ NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_arc_pin15, nullptr, true);
+ NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, true);
}
@@ -2736,7 +2736,7 @@ void mvs_led_state::neogeo_mj(machine_config &config)
set_default_bios_tag("japan");
// no joystick panel
- m_edge->set_default_option("");
+ m_edge->set_default_option(nullptr);
m_edge->set_fixed(false);
// P1 mahjong controller
@@ -2778,9 +2778,10 @@ void mvs_led_state::pnyaa(machine_config &config)
void mvs_led_state::popbounc(machine_config &config)
{
- mv1_fixed(config);
+ neogeo_arcade(config);
+ neogeo_mono(config);
- NEOGEO_CTRL_EDGE_CONNECTOR(config.replace(), m_edge, neogeo_arc_edge_fixed, "dial", true);
+ NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge_fixed, "dial", true);
cartslot_fixed(config, "rom");
}
diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp
index 801e60a48b1..8a941df5353 100644
--- a/src/mame/drivers/nightgal.cpp
+++ b/src/mame/drivers/nightgal.cpp
@@ -799,7 +799,7 @@ void nightgal_state::royalqn(machine_config &config)
NSC8105(config, m_subcpu, MASTER_CLOCK / 8);
m_subcpu->set_addrmap(AS_PROGRAM, &nightgal_state::royalqn_nsc_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
JANGOU_BLITTER(config, m_blitter, MASTER_CLOCK/4);
diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp
index ae243f6cd0f..6045f8daf5e 100644
--- a/src/mame/drivers/ninjaw.cpp
+++ b/src/mame/drivers/ninjaw.cpp
@@ -714,7 +714,7 @@ void ninjaw_state::ninjaw(machine_config &config)
// TODO: if CPUs are unsynched then seldomly stages loads up with no enemies
// Let's use a better timer (was 6000 before) based off actual CPU timing.
// Might as well bump the divider in case the bug still occurs before resorting to perfect CPU.
- config.m_minimum_quantum = attotime::from_hz(16000000/1024); /* CPU slices */
+ config.set_maximum_quantum(attotime::from_hz(16000000/1024)); /* CPU slices */
//config.m_perfect_cpu_quantum = subtag("maincpu");
tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
@@ -820,7 +820,7 @@ void ninjaw_state::darius2(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &ninjaw_state::darius2_slave_map);
m_subcpu->set_vblank_int("lscreen", FUNC(ninjaw_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(16000000/1024); /* CPU slices */
+ config.set_maximum_quantum(attotime::from_hz(16000000/1024)); /* CPU slices */
//config.m_perfect_cpu_quantum = subtag("maincpu");
tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
diff --git a/src/mame/drivers/nova2001.cpp b/src/mame/drivers/nova2001.cpp
index d8ebe5cb5d2..1606ab79d3e 100644
--- a/src/mame/drivers/nova2001.cpp
+++ b/src/mame/drivers/nova2001.cpp
@@ -688,7 +688,7 @@ void nova2001_state::ninjakun(machine_config &config)
subcpu.set_addrmap(AS_PROGRAM, &nova2001_state::ninjakun_cpu2_map);
subcpu.set_periodic_int(FUNC(nova2001_state::irq0_line_hold), attotime::from_hz(4*60)); /* ? */
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
MCFG_MACHINE_START_OVERRIDE(nova2001_state,ninjakun)
@@ -766,7 +766,7 @@ void nova2001_state::raiders5(machine_config &config)
subcpu.set_addrmap(AS_PROGRAM, &nova2001_state::raiders5_cpu2_map);
subcpu.set_periodic_int(FUNC(nova2001_state::irq0_line_hold), attotime::from_hz(4*60)); /* ? */
- config.m_minimum_quantum = attotime::from_hz(24000);
+ config.set_maximum_quantum(attotime::from_hz(24000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/novag_savant.cpp b/src/mame/drivers/novag_savant.cpp
index 0d0eb6697f1..b701cfd832d 100644
--- a/src/mame/drivers/novag_savant.cpp
+++ b/src/mame/drivers/novag_savant.cpp
@@ -373,7 +373,7 @@ void savant_state::savant(machine_config &config)
m_psu->write_a().set(FUNC(savant_state::lcd_w));
m_psu->read_b().set(FUNC(savant_state::input_r));
- config.m_perfect_cpu_quantum = subtag("mcu");
+ config.set_perfect_quantum(m_mcu);
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->set_ui_enable(false); // no chesspieces
diff --git a/src/mame/drivers/nss.cpp b/src/mame/drivers/nss.cpp
index a0d1f495d85..0b7ba823977 100644
--- a/src/mame/drivers/nss.cpp
+++ b/src/mame/drivers/nss.cpp
@@ -842,7 +842,7 @@ void nss_state::nss(machine_config &config)
SPC700(config, m_soundcpu, XTAL(24'576'000) / 12);
m_soundcpu->set_addrmap(AS_PROGRAM, &nss_state::spc_mem);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* nss hardware */
Z80(config, m_bioscpu, 4000000);
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp
index 65b86d0310c..0c882968841 100644
--- a/src/mame/drivers/nwk-tr.cpp
+++ b/src/mame/drivers/nwk-tr.cpp
@@ -865,7 +865,7 @@ void nwktr_state::nwktr(machine_config &config)
m_dsp2->set_boot_mode(adsp21062_device::BOOT_MODE_EPROM);
m_dsp2->set_addrmap(AS_DATA, &nwktr_state::sharc1_map);
- config.m_minimum_quantum = attotime::from_hz(9000);
+ config.set_maximum_quantum(attotime::from_hz(9000));
M48T58(config, "m48t58", 0);
diff --git a/src/mame/drivers/nycaptor.cpp b/src/mame/drivers/nycaptor.cpp
index 7a55bf8bd4d..f9d5cd23170 100644
--- a/src/mame/drivers/nycaptor.cpp
+++ b/src/mame/drivers/nycaptor.cpp
@@ -749,7 +749,7 @@ void nycaptor_state::nycaptor(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 2000000);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -821,7 +821,7 @@ void nycaptor_state::cyclshtg(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 2000000);
#endif
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
@@ -888,7 +888,7 @@ void nycaptor_state::bronx(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map);
m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(120);
+ config.set_maximum_quantum(attotime::from_hz(120));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp
index edd3f07a9b8..12f8bfd084a 100644
--- a/src/mame/drivers/odyssey2.cpp
+++ b/src/mame/drivers/odyssey2.cpp
@@ -696,7 +696,7 @@ void odyssey2_state::odyssey2(machine_config &config)
m_maincpu->t0_in_cb().set("cartslot", FUNC(o2_cart_slot_device::t0_read));
m_maincpu->t1_in_cb().set(FUNC(odyssey2_state::t1_read));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -733,7 +733,7 @@ void odyssey2_state::videopac(machine_config &config)
m_maincpu->t0_in_cb().set("cartslot", FUNC(o2_cart_slot_device::t0_read));
m_maincpu->t1_in_cb().set(FUNC(odyssey2_state::t1_read));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -771,7 +771,7 @@ void g7400_state::g7400(machine_config &config)
m_maincpu->t1_in_cb().set(FUNC(g7400_state::t1_read));
m_maincpu->prog_out_cb().set(m_i8243, FUNC(i8243_device::prog_w));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -818,7 +818,7 @@ void g7400_state::odyssey3(machine_config &config)
m_maincpu->t1_in_cb().set(FUNC(g7400_state::t1_read));
m_maincpu->prog_out_cb().set(m_i8243, FUNC(i8243_device::prog_w));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/opwolf.cpp b/src/mame/drivers/opwolf.cpp
index 03159113b4e..36a5af75c02 100644
--- a/src/mame/drivers/opwolf.cpp
+++ b/src/mame/drivers/opwolf.cpp
@@ -908,7 +908,7 @@ void opwolf_state::opwolf(machine_config &config)
TIMER(config, "cchip_irq_clear").configure_generic(FUNC(opwolf_state::cchip_irq_clear_cb));
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_RESET_OVERRIDE(opwolf_state,opwolf)
@@ -984,7 +984,7 @@ void opwolf_state::opwolfb(machine_config &config) /* OSC clocks unknown for the
sub.set_addrmap(AS_PROGRAM, &opwolf_state::opwolfb_sub_z80_map);
sub.set_vblank_int("screen", FUNC(opwolf_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/oric.cpp b/src/mame/drivers/oric.cpp
index 5451f6e1dd9..9dbc6a40e38 100644
--- a/src/mame/drivers/oric.cpp
+++ b/src/mame/drivers/oric.cpp
@@ -789,7 +789,7 @@ void oric_state::oric(machine_config &config, bool add_ext)
M6502(config, m_maincpu, 12_MHz_XTAL / 12);
m_maincpu->set_addrmap(AS_PROGRAM, &oric_state::oric_mem);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp
index b61be4c5beb..a36620e2f82 100644
--- a/src/mame/drivers/overdriv.cpp
+++ b/src/mame/drivers/overdriv.cpp
@@ -341,7 +341,7 @@ void overdriv_state::overdriv(machine_config &config)
/* This might just mean that the video refresh rate is less than */
/* 60 fps, that's how I fixed it for now. */
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
EEPROM_ER5911_16BIT(config, "eeprom").default_data(overdriv_default_eeprom, 128);
diff --git a/src/mame/drivers/p2000t.cpp b/src/mame/drivers/p2000t.cpp
index 743b228ca79..7cf4ae6624b 100644
--- a/src/mame/drivers/p2000t.cpp
+++ b/src/mame/drivers/p2000t.cpp
@@ -256,7 +256,7 @@ void p2000m_state::p2000m(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &p2000m_state::p2000m_mem);
m_maincpu->set_addrmap(AS_IO, &p2000m_state::p2000t_io);
m_maincpu->set_vblank_int("screen", FUNC(p2000m_state::p2000_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/pacland.cpp b/src/mame/drivers/pacland.cpp
index 79d5851b8e1..625dd23e4a0 100644
--- a/src/mame/drivers/pacland.cpp
+++ b/src/mame/drivers/pacland.cpp
@@ -426,7 +426,7 @@ void pacland_state::pacland(machine_config &config)
m_mcu->in_p2_cb().set_constant(0xff); /* leds won't work otherwise */
m_mcu->out_p2_cb().set(FUNC(pacland_state::led_w));
- config.m_minimum_quantum = attotime::from_hz(6000); /* we need heavy synching between the MCU and the CPU */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* we need heavy synching between the MCU and the CPU */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/palm.cpp b/src/mame/drivers/palm.cpp
index a86ccdef4be..b8c3e99a032 100644
--- a/src/mame/drivers/palm.cpp
+++ b/src/mame/drivers/palm.cpp
@@ -189,7 +189,7 @@ void palm_state::palm(machine_config &config)
m_maincpu->in_spim().set(FUNC(palm_state::palm_spim_in));
m_maincpu->spim_xch_trigger().set(FUNC(palm_state::palm_spim_exchange));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
diff --git a/src/mame/drivers/pandoras.cpp b/src/mame/drivers/pandoras.cpp
index 1e1b8090d31..e822b3b8390 100644
--- a/src/mame/drivers/pandoras.cpp
+++ b/src/mame/drivers/pandoras.cpp
@@ -323,7 +323,7 @@ void pandoras_state::pandoras(machine_config &config)
m_mcu->p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w));
m_mcu->p2_out_cb().set(FUNC(pandoras_state::i8039_irqen_and_status_w));
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - needed for correct synchronization of the sound CPUs */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - needed for correct synchronization of the sound CPUs */
ls259_device &mainlatch(LS259(config, "mainlatch")); // C3
mainlatch.q_out_cb<0>().set(FUNC(pandoras_state::cpua_irq_enable_w)); // ENA
diff --git a/src/mame/drivers/paranoia.cpp b/src/mame/drivers/paranoia.cpp
index affe48db73e..0220da15862 100644
--- a/src/mame/drivers/paranoia.cpp
+++ b/src/mame/drivers/paranoia.cpp
@@ -176,7 +176,7 @@ void paranoia_state::paranoia(machine_config &config)
m_maincpu->add_route(0, "lspeaker", 1.00);
m_maincpu->add_route(1, "rspeaker", 1.00);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
i8085a_cpu_device &sub(I8085A(config, "sub", 18000000/3));
sub.set_addrmap(AS_PROGRAM, &paranoia_state::paranoia_8085_map);
diff --git a/src/mame/drivers/pc.cpp b/src/mame/drivers/pc.cpp
index 0461f45a095..7c1094c2313 100644
--- a/src/mame/drivers/pc.cpp
+++ b/src/mame/drivers/pc.cpp
@@ -185,14 +185,14 @@ void pc_state::cfg_single_360K(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("525dd");
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_fixed(true);
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
void pc_state::cfg_single_720K(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("35dd");
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_fixed(true);
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
void pc_state::pccga(machine_config &config)
@@ -797,7 +797,7 @@ void pc_state::olytext30(machine_config &config)
maincpu.set_irq_acknowledge_callback("mb:pic8259", FUNC(pic8259_device::inta_cb));
subdevice<isa8_slot_device>("isa2")->set_option_machine_config("fdc_xt", cfg_single_720K);
- subdevice<isa8_slot_device>("isa3")->set_default_option("");
+ subdevice<isa8_slot_device>("isa3")->set_default_option(nullptr);
subdevice<isa8_slot_device>("isa5")->set_default_option("hdc");
subdevice<ram_device>(RAM_TAG)->set_default_size("768K");
}
diff --git a/src/mame/drivers/pc1512.cpp b/src/mame/drivers/pc1512.cpp
index 3be30bddb8d..f7a018b5099 100644
--- a/src/mame/drivers/pc1512.cpp
+++ b/src/mame/drivers/pc1512.cpp
@@ -1174,7 +1174,7 @@ void pc1512_state::pc1512(machine_config &config)
m_kb->clock_wr_callback().set(FUNC(pc1512_state::kbclk_w));
m_kb->data_wr_callback().set(FUNC(pc1512_state::kbdata_w));
- pc1512_mouse_port_device &mouse(PC1512_MOUSE_PORT(config, PC1512_MOUSE_PORT_TAG, pc1512_mouse_port_devices, "mouse"));
+ pc1512_mouse_port_device &mouse(PC1512_MOUSE_PORT(config, "mous", pc1512_mouse_port_devices, "mouse"));
mouse.x_wr_callback().set(FUNC(pc1512_base_state::mouse_x_w));
mouse.y_wr_callback().set(FUNC(pc1512_base_state::mouse_y_w));
mouse.m1_wr_callback().set(m_kb, FUNC(pc1512_keyboard_device::m1_w));
@@ -1309,7 +1309,7 @@ void pc1640_state::pc1640(machine_config &config)
m_kb->clock_wr_callback().set(FUNC(pc1512_base_state::kbclk_w));
m_kb->data_wr_callback().set(FUNC(pc1512_base_state::kbdata_w));
- pc1512_mouse_port_device &mouse(PC1512_MOUSE_PORT(config, PC1512_MOUSE_PORT_TAG, pc1512_mouse_port_devices, "mouse"));
+ pc1512_mouse_port_device &mouse(PC1512_MOUSE_PORT(config, "mous", pc1512_mouse_port_devices, "mouse"));
mouse.x_wr_callback().set(FUNC(pc1512_base_state::mouse_x_w));
mouse.y_wr_callback().set(FUNC(pc1512_base_state::mouse_y_w));
mouse.m1_wr_callback().set(m_kb, FUNC(pc1512_keyboard_device::m1_w));
diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp
index 3a974bdef71..051fa711d0c 100644
--- a/src/mame/drivers/pc8801.cpp
+++ b/src/mame/drivers/pc8801.cpp
@@ -2354,8 +2354,8 @@ void pc8801_state::pc8801(machine_config &config)
m_fdccpu->set_addrmap(AS_PROGRAM, &pc8801_state::pc8801fdc_mem);
m_fdccpu->set_addrmap(AS_IO, &pc8801_state::pc8801fdc_io);
- //config.m_minimum_quantum = attotime::from_hz(300000);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ //config.set_maximum_quantum(attotime::from_hz(300000));
+ config.set_perfect_quantum(m_maincpu);
i8255_device &d8255_master(I8255(config, "d8255_master"));
d8255_master.in_pa_callback().set("d8255_slave", FUNC(i8255_device::pb_r));
diff --git a/src/mame/drivers/pce.cpp b/src/mame/drivers/pce.cpp
index 974deae34ac..0f5462da29c 100644
--- a/src/mame/drivers/pce.cpp
+++ b/src/mame/drivers/pce.cpp
@@ -317,7 +317,7 @@ void pce_state::pce_common(machine_config &config)
m_maincpu->add_route(0, "lspeaker", 1.00);
m_maincpu->add_route(1, "rspeaker", 1.00);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_START_OVERRIDE(pce_state, pce )
MCFG_MACHINE_RESET_OVERRIDE(pce_state, mess_pce )
@@ -374,7 +374,7 @@ void pce_state::sgx(machine_config &config)
m_maincpu->add_route(0, "lspeaker", 1.00);
m_maincpu->add_route(1, "rspeaker", 1.00);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_START_OVERRIDE(pce_state, pce )
MCFG_MACHINE_RESET_OVERRIDE(pce_state, mess_pce )
diff --git a/src/mame/drivers/pcw.cpp b/src/mame/drivers/pcw.cpp
index 93bb6a14139..370639c1611 100644
--- a/src/mame/drivers/pcw.cpp
+++ b/src/mame/drivers/pcw.cpp
@@ -1266,8 +1266,8 @@ void pcw_state::pcw(machine_config &config)
m_keyboard_mcu->t0_in_cb().set(FUNC(pcw_state::mcu_kb_t0_r));
m_keyboard_mcu->bus_in_cb().set(FUNC(pcw_state::mcu_kb_data_r));
-// config.m_minimum_quantum = attotime::from_hz(50);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+// config.set_maximum_quantum(attotime::from_hz(50));
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/pcw16.cpp b/src/mame/drivers/pcw16.cpp
index 58d7340d28e..f1772001a3b 100644
--- a/src/mame/drivers/pcw16.cpp
+++ b/src/mame/drivers/pcw16.cpp
@@ -1016,7 +1016,7 @@ void pcw16_state::pcw16(machine_config &config)
Z80(config, m_maincpu, 16000000);
m_maincpu->set_addrmap(AS_PROGRAM, &pcw16_state::pcw16_map);
m_maincpu->set_addrmap(AS_IO, &pcw16_state::pcw16_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ns16550_device &uart1(NS16550(config, "ns16550_1", XTAL(1'843'200))); /* TODO: Verify uart model */
uart1.out_tx_callback().set("serport1", FUNC(rs232_port_device::write_txd));
diff --git a/src/mame/drivers/pitnrun.cpp b/src/mame/drivers/pitnrun.cpp
index e60c11f38e2..f050458529b 100644
--- a/src/mame/drivers/pitnrun.cpp
+++ b/src/mame/drivers/pitnrun.cpp
@@ -298,7 +298,7 @@ void pitnrun_state::pitnrun(machine_config &config)
WATCHDOG_TIMER(config, "watchdog");
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/plus4.cpp b/src/mame/drivers/plus4.cpp
index 4ad7ddbb1e4..c03bc5b0fd7 100644
--- a/src/mame/drivers/plus4.cpp
+++ b/src/mame/drivers/plus4.cpp
@@ -34,7 +34,6 @@
#include "sound/mos7360.h"
#include "sound/t6721a.h"
-#define MOS7501_TAG "u2"
#define MOS7360_TAG "u1"
#define MOS6551_TAG "u3"
#define MOS6529_USER_TAG "u5"
@@ -52,7 +51,7 @@ class plus4_state : public driver_device
public:
plus4_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
- m_maincpu(*this, MOS7501_TAG),
+ m_maincpu(*this, "u2"),
m_pla(*this, PLA_TAG),
m_ted(*this, MOS7360_TAG),
m_acia(*this, MOS6551_TAG),
@@ -849,7 +848,7 @@ void plus4_state::plus4(machine_config &config)
m_maincpu->read_callback().set(FUNC(plus4_state::cpu_r));
m_maincpu->write_callback().set(FUNC(plus4_state::cpu_w));
m_maincpu->set_pulls(0x00, 0xc0);
- config.m_perfect_cpu_quantum = subtag(MOS7501_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, m7501_device::IRQ_LINE);
@@ -928,7 +927,7 @@ void plus4_state::plus4(machine_config &config)
m_exp->irq_wr_callback().set("mainirq", FUNC(input_merger_device::in_w<2>));
m_exp->cd_rd_callback().set(FUNC(plus4_state::read));
m_exp->cd_wr_callback().set(FUNC(plus4_state::write));
- m_exp->aec_wr_callback().set_inputline(MOS7501_TAG, INPUT_LINE_HALT);
+ m_exp->aec_wr_callback().set_inputline(m_maincpu, INPUT_LINE_HALT);
QUICKLOAD(config, "quickload", "p00,prg", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(plus4_state::quickload_c16));
diff --git a/src/mame/drivers/plygonet.cpp b/src/mame/drivers/plygonet.cpp
index caba37690bf..ec85d37681a 100644
--- a/src/mame/drivers/plygonet.cpp
+++ b/src/mame/drivers/plygonet.cpp
@@ -565,7 +565,7 @@ void polygonet_state::plygonet(machine_config &config)
Z80(config, m_audiocpu, 8000000);
m_audiocpu->set_addrmap(AS_PROGRAM, &polygonet_state::sound_map);
- config.m_perfect_cpu_quantum = subtag("maincpu"); /* TODO: TEMPORARY! UNTIL A MORE LOCALIZED SYNC CAN BE MADE */
+ config.set_perfect_quantum(m_maincpu); /* TODO: TEMPORARY! UNTIL A MORE LOCALIZED SYNC CAN BE MADE */
EEPROM_ER5911_8BIT(config, m_eeprom);
diff --git a/src/mame/drivers/pmd85.cpp b/src/mame/drivers/pmd85.cpp
index d2d9b5a4bf8..cd048925706 100644
--- a/src/mame/drivers/pmd85.cpp
+++ b/src/mame/drivers/pmd85.cpp
@@ -624,7 +624,7 @@ void pmd85_state::pmd85(machine_config &config, bool with_uart)
I8080(config, m_maincpu, XTAL(18'432'000)/9);
m_maincpu->set_addrmap(AS_PROGRAM, &pmd85_state::pmd85_mem);
m_maincpu->set_addrmap(AS_IO, &pmd85_state::pmd85_io_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/*******************************************************************************
diff --git a/src/mame/drivers/pocketc.cpp b/src/mame/drivers/pocketc.cpp
index 50ba0cb0d7a..32248a0cbf2 100644
--- a/src/mame/drivers/pocketc.cpp
+++ b/src/mame/drivers/pocketc.cpp
@@ -721,7 +721,7 @@ GFXDECODE_END
void pocketc_state::pocketc_base(machine_config &config)
{
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
NVRAM(config, "cpu_nvram", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "ram_nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp
index df99ab5e72b..39ed4cf2eda 100644
--- a/src/mame/drivers/pokemini.cpp
+++ b/src/mame/drivers/pokemini.cpp
@@ -1768,7 +1768,7 @@ void pokemini_state::pokemini(machine_config &config)
MINX(config, m_maincpu, 4000000);
m_maincpu->set_addrmap(AS_PROGRAM, &pokemini_state::pokemini_mem_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
I2CMEM(config, m_i2cmem, 0).set_data_size(0x2000);
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index 58ac0c71d59..96c0da3cf42 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -898,7 +898,7 @@ void polepos_state::polepos(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 16); // 128V clocks the same as VBLANK
- config.m_minimum_quantum = attotime::from_hz(6000); /* some interleaving */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* some interleaving */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
@@ -1007,7 +1007,7 @@ void polepos_state::topracern(machine_config &config)
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 16); // 128V clocks the same as VBLANK
- config.m_minimum_quantum = attotime::from_hz(6000); /* some interleaving */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* some interleaving */
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/popper.cpp b/src/mame/drivers/popper.cpp
index ae442d5eb6c..afcd98b76a1 100644
--- a/src/mame/drivers/popper.cpp
+++ b/src/mame/drivers/popper.cpp
@@ -543,7 +543,7 @@ void popper_state::popper(machine_config &config)
Z80(config, m_subcpu, XTAL(18'432'000)/3/2);
m_subcpu->set_addrmap(AS_PROGRAM, &popper_state::sub_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/prof80.cpp b/src/mame/drivers/prof80.cpp
index 826f8a35665..e9e1c6b917f 100644
--- a/src/mame/drivers/prof80.cpp
+++ b/src/mame/drivers/prof80.cpp
@@ -494,11 +494,11 @@ void prof80_state::prof80(machine_config &config)
// ECB bus
ECBBUS(config, m_ecb);
- ECBBUS_SLOT(config, "ecb_1", 1, ecbbus_cards, "grip21");
- ECBBUS_SLOT(config, "ecb_2", 2, ecbbus_cards, nullptr);
- ECBBUS_SLOT(config, "ecb_3", 3, ecbbus_cards, nullptr);
- ECBBUS_SLOT(config, "ecb_4", 4, ecbbus_cards, nullptr);
- ECBBUS_SLOT(config, "ecb_5", 5, ecbbus_cards, nullptr);
+ ECBBUS_SLOT(config, "ecb_1", m_ecb, 1, ecbbus_cards, "grip21");
+ ECBBUS_SLOT(config, "ecb_2", m_ecb, 2, ecbbus_cards, nullptr);
+ ECBBUS_SLOT(config, "ecb_3", m_ecb, 3, ecbbus_cards, nullptr);
+ ECBBUS_SLOT(config, "ecb_4", m_ecb, 4, ecbbus_cards, nullptr);
+ ECBBUS_SLOT(config, "ecb_5", m_ecb, 5, ecbbus_cards, nullptr);
// V24
RS232_PORT(config, m_rs232a, default_rs232_devices, nullptr);
diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp
index c07a07d0020..5551c4f048e 100644
--- a/src/mame/drivers/progolf.cpp
+++ b/src/mame/drivers/progolf.cpp
@@ -427,7 +427,7 @@ void progolf_state::progolf(machine_config &config)
M6502(config, m_audiocpu, 500000);
m_audiocpu->set_addrmap(AS_PROGRAM, &progolf_state::sound_cpu);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
generic_latch_8_device &soundlatch(GENERIC_LATCH_8(config, "soundlatch"));
soundlatch.data_pending_callback().set_inputline(m_audiocpu, 0);
diff --git a/src/mame/drivers/ps2.cpp b/src/mame/drivers/ps2.cpp
index bdc4e186a31..2358702dbb1 100644
--- a/src/mame/drivers/ps2.cpp
+++ b/src/mame/drivers/ps2.cpp
@@ -98,7 +98,7 @@ void ps2_state::ps2m30286(machine_config &config)
AT_MB(config, m_mb, 0);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
at_softlists(config);
@@ -122,7 +122,7 @@ void ps2_state::ps2386(machine_config &config)
AT_MB(config, m_mb, 0);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
at_softlists(config);
// on board devices
diff --git a/src/mame/drivers/ps2sony.cpp b/src/mame/drivers/ps2sony.cpp
index 6d3bf45ba8b..d4134b558ca 100644
--- a/src/mame/drivers/ps2sony.cpp
+++ b/src/mame/drivers/ps2sony.cpp
@@ -758,7 +758,7 @@ void ps2sony_state::ps2sony(machine_config &config)
SONYPS2_IOP(config, m_iop, XTAL(67'737'600)/2);
m_iop->set_addrmap(AS_PROGRAM, &ps2sony_state::iop_map);
- config.m_perfect_cpu_quantum = subtag("iop");
+ config.set_perfect_quantum(m_iop);
SONYPS2_PAD(config, m_pad[0]);
SONYPS2_PAD(config, m_pad[1]);
diff --git a/src/mame/drivers/psychic5.cpp b/src/mame/drivers/psychic5.cpp
index 888a5dd062c..723f791b6ab 100644
--- a/src/mame/drivers/psychic5.cpp
+++ b/src/mame/drivers/psychic5.cpp
@@ -733,7 +733,7 @@ void psychic5_state::psychic5(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &psychic5_state::psychic5_sound_map);
m_audiocpu->set_addrmap(AS_IO, &psychic5_state::psychic5_soundport_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* Allow time for 2nd cpu to interleave */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* Allow time for 2nd cpu to interleave */
MCFG_MACHINE_START_OVERRIDE(psychic5_state,psychic5)
@@ -781,7 +781,7 @@ void psychic5_state::bombsa(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &psychic5_state::bombsa_sound_map);
m_audiocpu->set_addrmap(AS_IO, &psychic5_state::bombsa_soundport_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_START_OVERRIDE(psychic5_state,bombsa)
diff --git a/src/mame/drivers/qix.cpp b/src/mame/drivers/qix.cpp
index 3f79f330486..e307300eff0 100644
--- a/src/mame/drivers/qix.cpp
+++ b/src/mame/drivers/qix.cpp
@@ -607,9 +607,9 @@ void qix_state::qix_base(machine_config &config)
MC6809E(config, m_maincpu, MAIN_CLOCK_OSC/4/4); /* 1.25 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &qix_state::main_map);
- /* high interleave needed to ensure correct text in service mode */
- /* Zookeeper settings and high score table seem especially sensitive to this */
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ // high interleave needed to ensure correct text in service mode
+ // Zookeeper settings and high score table seem especially sensitive to this
+ config.set_perfect_quantum(m_maincpu);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/quasar.cpp b/src/mame/drivers/quasar.cpp
index c2d192ee433..abc220960fb 100644
--- a/src/mame/drivers/quasar.cpp
+++ b/src/mame/drivers/quasar.cpp
@@ -314,7 +314,7 @@ void quasar_state::quasar(machine_config &config)
soundcpu.t1_in_cb().set(FUNC(quasar_state::audio_t1_r));
soundcpu.p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/qvt102.cpp b/src/mame/drivers/qvt102.cpp
index 833450d2996..ebb8b658c8f 100644
--- a/src/mame/drivers/qvt102.cpp
+++ b/src/mame/drivers/qvt102.cpp
@@ -43,8 +43,8 @@
class qvt102_state : public driver_device
{
public:
- qvt102_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ qvt102_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_irqs(*this, "irqs"),
m_kbdmcu(*this, "kbdmcu"),
@@ -610,7 +610,7 @@ void qvt102_state::qvt102(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &qvt102_state::mem_map);
// needs a tight sync with the keyboard cpu
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, M6800_IRQ_LINE);
diff --git a/src/mame/drivers/r9751.cpp b/src/mame/drivers/r9751.cpp
index f58e35fc041..bcda02f7285 100644
--- a/src/mame/drivers/r9751.cpp
+++ b/src/mame/drivers/r9751.cpp
@@ -978,7 +978,7 @@ void r9751_state::r9751(machine_config &config)
/* basic machine hardware */
M68030(config, m_maincpu, 20000000);
m_maincpu->set_addrmap(AS_PROGRAM, &r9751_state::r9751_mem);
- config.m_minimum_quantum = attotime::from_hz(1000);
+ config.set_maximum_quantum(attotime::from_hz(1000));
/* i/o hardware */
SMIOC(config, m_smioc, 0);
diff --git a/src/mame/drivers/raiden.cpp b/src/mame/drivers/raiden.cpp
index 4644c7dadb2..7b578816954 100644
--- a/src/mame/drivers/raiden.cpp
+++ b/src/mame/drivers/raiden.cpp
@@ -347,7 +347,7 @@ void raiden_state::raiden(machine_config &config)
audiocpu.set_addrmap(AS_PROGRAM, &raiden_state::seibu_sound_map);
audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram);
diff --git a/src/mame/drivers/rastan.cpp b/src/mame/drivers/rastan.cpp
index 355e9235aec..e81fbcb0e75 100644
--- a/src/mame/drivers/rastan.cpp
+++ b/src/mame/drivers/rastan.cpp
@@ -349,7 +349,7 @@ void rastan_state::rastan(machine_config &config)
Z80(config, m_audiocpu, XTAL(16'000'000)/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &rastan_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/rbisland.cpp b/src/mame/drivers/rbisland.cpp
index 7a2610b476a..a7ffd52fc0b 100644
--- a/src/mame/drivers/rbisland.cpp
+++ b/src/mame/drivers/rbisland.cpp
@@ -648,7 +648,7 @@ void rbisland_state::rbisland(machine_config &config)
TIMER(config, m_cchip_irq_clear).configure_generic(FUNC(rbisland_state::cchip_irq_clear_cb));
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -696,7 +696,7 @@ void rbisland_state::jumping(machine_config &config)
Z80(config, m_audiocpu, XTAL(24'000'000)/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &rbisland_state::jumping_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough unless otherwise */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough unless otherwise */
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/retofinv.cpp b/src/mame/drivers/retofinv.cpp
index ae43a4d88f9..cdd9cc85b8b 100644
--- a/src/mame/drivers/retofinv.cpp
+++ b/src/mame/drivers/retofinv.cpp
@@ -424,7 +424,7 @@ void retofinv_state::retofinv(machine_config &config)
TAITO68705_MCU(config, m_68705, XTAL(18'432'000)/6); /* XTAL and divider verified, 3.072 MHz */
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - enough for the sound CPU to read all commands */
LS259(config, m_mainlatch); // IC72 - probably shared between CPUs
m_mainlatch->q_out_cb<0>().set(FUNC(retofinv_state::irq0_ack_w));
diff --git a/src/mame/drivers/rollext.cpp b/src/mame/drivers/rollext.cpp
index ae604a52d6e..e9e6de54676 100644
--- a/src/mame/drivers/rollext.cpp
+++ b/src/mame/drivers/rollext.cpp
@@ -554,7 +554,7 @@ void rollext_state::rollext(machine_config &config)
tms32082_pp_device &pp0(TMS32082_PP(config, "pp0", 60000000));
pp0.set_addrmap(AS_PROGRAM, &rollext_state::memmap);
- config.m_minimum_quantum = attotime::from_hz(100);
+ config.set_maximum_quantum(attotime::from_hz(100));
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp
index fc07c720cb7..3f1fc5317d3 100644
--- a/src/mame/drivers/rungun.cpp
+++ b/src/mame/drivers/rungun.cpp
@@ -397,7 +397,7 @@ void rungun_state::rng(machine_config &config)
Z80(config, m_soundcpu, 8000000);
m_soundcpu->set_addrmap(AS_PROGRAM, &rungun_state::rungun_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000); // higher if sound stutters
+ config.set_maximum_quantum(attotime::from_hz(6000)); // higher if sound stutters
GFXDECODE(config, m_gfxdecode, m_palette, gfx_rungun);
diff --git a/src/mame/drivers/rvoice.cpp b/src/mame/drivers/rvoice.cpp
index b8d8c3e6c93..967605323bf 100644
--- a/src/mame/drivers/rvoice.cpp
+++ b/src/mame/drivers/rvoice.cpp
@@ -369,7 +369,7 @@ void rvoice_state::rvoicepc(machine_config &config)
//hd63701_cpu_device &playercpu(HD63701(config "playercpu", XTAL(7'372'800))); // not dumped yet
//playercpu.set_addrmap(AS_PROGRAM, &rvoice_state::hd63701_slave_mem);
//playercpu.set_addrmap(AS_PROGRAM, &rvoice_state::hd63701_slave_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
mos6551_device &acia(MOS6551(config, "acia65c51", 0));
acia.set_xtal(1.8432_MHz_XTAL);
diff --git a/src/mame/drivers/s11b.cpp b/src/mame/drivers/s11b.cpp
index 939228f6cc3..cf4b8effcb2 100644
--- a/src/mame/drivers/s11b.cpp
+++ b/src/mame/drivers/s11b.cpp
@@ -336,7 +336,7 @@ void s11b_state::s11b(machine_config &config)
/* Add the background music card */
MC6809E(config, m_bgcpu, XTAL(8'000'000) / 4); // MC68B09E
m_bgcpu->set_addrmap(AS_PROGRAM, &s11b_state::s11b_bg_map);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
SPEAKER(config, "bg").front_center();
YM2151(config, m_ym, 3580000);
diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp
index 665da5653f1..3e2d08d1653 100644
--- a/src/mame/drivers/segahang.cpp
+++ b/src/mame/drivers/segahang.cpp
@@ -704,7 +704,7 @@ void segahang_state::shared_base(machine_config &config)
M68000(config, m_subcpu, MASTER_CLOCK_25MHz/4);
m_subcpu->set_addrmap(AS_PROGRAM, &segahang_state::sub_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
I8255(config, m_i8255_1);
m_i8255_1->out_pa_callback().set("soundlatch", FUNC(generic_latch_8_device::write));
diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp
index e25c8f8f578..6eba9fb6db0 100644
--- a/src/mame/drivers/segajw.cpp
+++ b/src/mame/drivers/segajw.cpp
@@ -381,7 +381,7 @@ void segajw_state::segajw(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &segajw_state::segajw_audiocpu_map);
m_audiocpu->set_addrmap(AS_IO, &segajw_state::segajw_audiocpu_io_map);
- config.m_minimum_quantum = attotime::from_hz(2000);
+ config.set_maximum_quantum(attotime::from_hz(2000));
NVRAM(config, "nvram", nvram_device::DEFAULT_NONE);
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index 71a32914c80..2669b2498e3 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -1167,7 +1167,7 @@ void segaorun_state::outrun_base(machine_config &config)
m_soundcpu->set_addrmap(AS_PROGRAM, &segaorun_state::sound_map);
m_soundcpu->set_addrmap(AS_IO, &segaorun_state::sound_portmap);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, m_watchdog);
diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp
index b80a25dd44e..54576497867 100644
--- a/src/mame/drivers/segas16b.cpp
+++ b/src/mame/drivers/segas16b.cpp
@@ -3992,7 +3992,7 @@ void segas16b_state::system16b_i8751(machine_config &config)
m_mcu->port_in_cb<1>().set_ioport("SERVICE");
m_mcu->port_out_cb<1>().set(FUNC(segas16b_state::spin_68k_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
m_screen->screen_vblank().set_inputline(m_mcu, INPUT_LINE_IRQ0);
}
diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp
index d99eef46c24..19ae04fa85b 100644
--- a/src/mame/drivers/segas24.cpp
+++ b/src/mame/drivers/segas24.cpp
@@ -1921,7 +1921,7 @@ void segas24_state::system24(machine_config &config)
M68000(config, m_subcpu, MASTER_CLOCK/2);
m_subcpu->set_addrmap(AS_PROGRAM, &segas24_state::cpu2_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
sega_315_5296_device &io(SEGA_315_5296(config, "io", VIDEO_CLOCK/2));
io.in_pa_callback().set_ioport("P1");
diff --git a/src/mame/drivers/segaxbd.cpp b/src/mame/drivers/segaxbd.cpp
index 18e06a456f5..caf6927064c 100644
--- a/src/mame/drivers/segaxbd.cpp
+++ b/src/mame/drivers/segaxbd.cpp
@@ -1680,7 +1680,7 @@ void segaxbd_state::xboard_base_mconfig(machine_config &config)
NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "backup2", nvram_device::DEFAULT_ALL_0);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MB3773(config, "watchdog");
diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp
index 567d367dca6..3136860a984 100644
--- a/src/mame/drivers/segaybd.cpp
+++ b/src/mame/drivers/segaybd.cpp
@@ -1289,7 +1289,7 @@ void segaybd_state::yboard(machine_config &config)
m_soundcpu->set_addrmap(AS_IO, &segaybd_state::sound_portmap);
NVRAM(config, "backupram", nvram_device::DEFAULT_ALL_0);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MB3773(config, "watchdog"); // IC95
diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp
index e91b737477c..44d6e2cc614 100644
--- a/src/mame/drivers/seibuspi.cpp
+++ b/src/mame/drivers/seibuspi.cpp
@@ -1790,7 +1790,7 @@ void seibuspi_state::spi(machine_config &config)
Z80(config, m_audiocpu, 28.636363_MHz_XTAL / 4); // Z84C0008PEC, 7.159MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &seibuspi_state::spi_soundmap);
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
MCFG_MACHINE_RESET_OVERRIDE(seibuspi_state, spi)
diff --git a/src/mame/drivers/seicross.cpp b/src/mame/drivers/seicross.cpp
index 5bf453541af..6b6e6571f32 100644
--- a/src/mame/drivers/seicross.cpp
+++ b/src/mame/drivers/seicross.cpp
@@ -406,7 +406,7 @@ void seicross_state::no_nvram(machine_config &config)
NSC8105(config, m_mcu, XTAL(18'432'000) / 6); /* ??? */
m_mcu->set_addrmap(AS_PROGRAM, &seicross_state::mcu_no_nvram_map);
- config.m_minimum_quantum = attotime::from_hz(1200); /* 20 CPU slices per frame - a high value to ensure proper */
+ config.set_maximum_quantum(attotime::from_hz(1200)); /* 20 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/sfcbox.cpp b/src/mame/drivers/sfcbox.cpp
index 82bb0cecbbb..fdc7d6f0f17 100644
--- a/src/mame/drivers/sfcbox.cpp
+++ b/src/mame/drivers/sfcbox.cpp
@@ -466,7 +466,7 @@ void sfcbox_state::sfcbox(machine_config &config)
SPC700(config, m_soundcpu, XTAL(24'576'000) / 12);
m_soundcpu->set_addrmap(AS_PROGRAM, &sfcbox_state::spc_mem);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* sfcbox hardware */
Z80180(config, m_bios, XTAL(12'000'000)); /* HD64180RF6X */
diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp
index 1d1400042f2..3baff492897 100644
--- a/src/mame/drivers/sfkick.cpp
+++ b/src/mame/drivers/sfkick.cpp
@@ -597,7 +597,7 @@ void sfkick_state::sfkick(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &sfkick_state::sfkick_map);
m_maincpu->set_addrmap(AS_IO, &sfkick_state::sfkick_io_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
Z80(config, m_soundcpu, MASTER_CLOCK/6);
m_soundcpu->set_addrmap(AS_PROGRAM, &sfkick_state::sfkick_sound_map);
diff --git a/src/mame/drivers/shanghai.cpp b/src/mame/drivers/shanghai.cpp
index 9c842d4e1d8..a1203ce93f4 100644
--- a/src/mame/drivers/shanghai.cpp
+++ b/src/mame/drivers/shanghai.cpp
@@ -477,7 +477,7 @@ void shanghai_state::kothello(machine_config &config)
audiocpu.set_addrmap(AS_PROGRAM, &shanghai_state::kothello_sound_map);
audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb));
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/shangkid.cpp b/src/mame/drivers/shangkid.cpp
index 8c631b7ac43..6f026e94110 100644
--- a/src/mame/drivers/shangkid.cpp
+++ b/src/mame/drivers/shangkid.cpp
@@ -400,7 +400,7 @@ void shangkid_state::chinhero(machine_config &config)
mainlatch.q_out_cb<6>().set(FUNC(shangkid_state::coin_counter_1_w));
mainlatch.q_out_cb<7>().set(FUNC(shangkid_state::coin_counter_2_w));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp
index 51928319502..4926fcdc147 100644
--- a/src/mame/drivers/shougi.cpp
+++ b/src/mame/drivers/shougi.cpp
@@ -391,7 +391,7 @@ void shougi_state::shougi(machine_config &config)
mainlatch.q_out_cb<4>().set(m_alpha_8201, FUNC(alpha_8201_device::bus_dir_w)).invert(); // ALPHA-8201 shared RAM bus direction: 0: mcu, 1: maincpu
mainlatch.q_out_cb<7>().set_nop(); // nothing? connected to +5v via resistor
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 0x10); // assuming it's the same as champbas
diff --git a/src/mame/drivers/sidearms.cpp b/src/mame/drivers/sidearms.cpp
index 5a689b8d816..a0c5f0c73f1 100644
--- a/src/mame/drivers/sidearms.cpp
+++ b/src/mame/drivers/sidearms.cpp
@@ -702,7 +702,7 @@ void sidearms_state::whizz(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &sidearms_state::whizz_sound_map);
m_audiocpu->set_addrmap(AS_IO, &sidearms_state::whizz_io_map);
- config.m_minimum_quantum = attotime::from_hz(60000);
+ config.set_maximum_quantum(attotime::from_hz(60000));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/simple_st0016.cpp b/src/mame/drivers/simple_st0016.cpp
index 3ce47822f9c..b00b95dfa3a 100644
--- a/src/mame/drivers/simple_st0016.cpp
+++ b/src/mame/drivers/simple_st0016.cpp
@@ -498,7 +498,7 @@ void st0016_state::mayjinsn(machine_config &config)
V810(config, m_subcpu, 10000000); //25 Mhz ?
m_subcpu->set_addrmap(AS_PROGRAM, &st0016_state::v810_mem);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
}
void st0016_state::renju(machine_config &config)
diff --git a/src/mame/drivers/skykid.cpp b/src/mame/drivers/skykid.cpp
index 85f79d17059..ee328fd9341 100644
--- a/src/mame/drivers/skykid.cpp
+++ b/src/mame/drivers/skykid.cpp
@@ -434,7 +434,7 @@ void skykid_state::skykid(machine_config &config)
m_mcu->in_p2_cb().set_constant(0xff); /* leds won't work otherwise */
m_mcu->out_p2_cb().set(FUNC(skykid_state::skykid_led_w)); /* lamps */
- config.m_minimum_quantum = attotime::from_hz(6000); /* we need heavy synch */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* we need heavy synch */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp
index a556c08901a..0534bb87727 100644
--- a/src/mame/drivers/slapfght.cpp
+++ b/src/mame/drivers/slapfght.cpp
@@ -906,7 +906,7 @@ void slapfght_state::perfrman(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_state::perfrman_sound_map);
m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(240)); // music speed, verified
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram);
@@ -958,7 +958,7 @@ void slapfght_state::tigerh(machine_config &config)
TAITO68705_MCU_TIGER(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram);
@@ -1044,7 +1044,7 @@ void slapfght_state::slapfigh(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
m_bmcu->aux_strobe_cb().set(FUNC(slapfght_state::scroll_from_mcu_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
BUFFERED_SPRITERAM8(config, m_spriteram);
diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp
index f9c0708d87a..8fd07c58bcc 100644
--- a/src/mame/drivers/slapshot.cpp
+++ b/src/mame/drivers/slapshot.cpp
@@ -414,7 +414,7 @@ void slapshot_state::slapshot(machine_config &config)
z80_device &audiocpu(Z80(config, "audiocpu", 32000000/8)); /* 4 MHz */
audiocpu.set_addrmap(AS_PROGRAM, &slapshot_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0640FIO(config, m_tc0640fio, 0);
m_tc0640fio->read_1_callback().set_ioport("COINS");
@@ -473,7 +473,7 @@ void slapshot_state::opwolf3(machine_config &config)
z80_device &audiocpu(Z80(config, "audiocpu", 32000000/8)); /* 4 MHz */
audiocpu.set_addrmap(AS_PROGRAM, &slapshot_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
adc.eoc_ff_callback().set_inputline("maincpu", 3);
diff --git a/src/mame/drivers/sms.cpp b/src/mame/drivers/sms.cpp
index 436e5c82351..661a7bb27b4 100644
--- a/src/mame/drivers/sms.cpp
+++ b/src/mame/drivers/sms.cpp
@@ -517,7 +517,7 @@ void sms_state::sms_ntsc_base(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
}
/*
@@ -665,7 +665,7 @@ void sms_state::sms_pal_base(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
}
void sms_state::sms2_pal(machine_config &config)
@@ -734,7 +734,7 @@ void sms_state::sms_paln_base(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &sms_state::sms_mem);
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
}
void sms_state::sms3_paln(machine_config &config)
@@ -804,7 +804,7 @@ void sms_state::sms_br_base(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &sms_state::sms_io);
// PAL-M has near the same frequency of NTSC
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
}
void sms_state::sms3_br(machine_config &config)
@@ -952,7 +952,7 @@ void gamegear_state::gamegear(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &gamegear_state::sms_mem);
m_maincpu->set_addrmap(AS_IO, &gamegear_state::gg_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
SCREEN(config, m_main_scr, SCREEN_TYPE_LCD);
diff --git a/src/mame/drivers/sms_bootleg.cpp b/src/mame/drivers/sms_bootleg.cpp
index 86ece08634c..1c3fdd580ae 100644
--- a/src/mame/drivers/sms_bootleg.cpp
+++ b/src/mame/drivers/sms_bootleg.cpp
@@ -280,7 +280,7 @@ void smsbootleg_state::sms_supergame(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &smsbootleg_state::sms_supergame_map);
m_maincpu->set_addrmap(AS_IO, &smsbootleg_state::sms_supergame_io);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/smsmcorp.cpp b/src/mame/drivers/smsmcorp.cpp
index 6839e4c8286..7138dd742c2 100644
--- a/src/mame/drivers/smsmcorp.cpp
+++ b/src/mame/drivers/smsmcorp.cpp
@@ -559,7 +559,7 @@ void smsmfg_state::sms(machine_config &config)
z80_device &soundcpu(Z80(config, "soundcpu", XTAL(16'000'000)/8));
soundcpu.set_addrmap(AS_PROGRAM, &smsmfg_state::sub_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
i8255_device &ppi0(I8255A(config, "ppi8255_0"));
ppi0.out_pa_callback().set(FUNC(smsmfg_state::ppi0_a_w));
diff --git a/src/mame/drivers/snes.cpp b/src/mame/drivers/snes.cpp
index dc12b34e97b..dc622fdbd55 100644
--- a/src/mame/drivers/snes.cpp
+++ b/src/mame/drivers/snes.cpp
@@ -1345,8 +1345,8 @@ void snes_console_state::snes(machine_config &config)
SPC700(config, m_soundcpu, XTAL(24'576'000) / 12);
m_soundcpu->set_addrmap(AS_PROGRAM, &snes_console_state::spc_map);
- //config.m_minimum_quantum = attotime::from_hz(48000);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ //config.set_maximum_quantum(attotime::from_hz(48000));
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp
index 27ff7b6cc57..8d3f6e3e62b 100644
--- a/src/mame/drivers/snesb.cpp
+++ b/src/mame/drivers/snesb.cpp
@@ -764,7 +764,7 @@ void snesb_state::kinstb(machine_config &config)
SPC700(config, m_soundcpu, XTAL(24'576'000) / 12);
m_soundcpu->set_addrmap(AS_PROGRAM, &snesb_state::spc_mem);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index d9a3f6970df..cf511f2d217 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -3622,7 +3622,7 @@ void snk_state::marvins(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &snk_state::marvins_sound_portmap);
m_audiocpu->set_periodic_int(FUNC(snk_state::nmi_line_assert), attotime::from_hz(244)); // schematics show a separate 244Hz timer
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -3684,7 +3684,7 @@ void snk_state::jcross(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &snk_state::jcross_sound_portmap);
m_audiocpu->set_periodic_int(FUNC(snk_state::irq0_line_assert), attotime::from_hz(244)); // Marvin's frequency, sounds ok
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -3755,7 +3755,7 @@ void snk_state::tnk3(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000)/2); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::tnk3_YM3526_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -3848,7 +3848,7 @@ void snk_state::ikari(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000)/2); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_YM3526_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -3905,7 +3905,7 @@ void snk_state::bermudat(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000)/2); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map);
- config.m_minimum_quantum = attotime::from_hz(24000);
+ config.set_maximum_quantum(attotime::from_hz(24000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -3988,7 +3988,7 @@ void snk_state::tdfever(machine_config &config)
Z80(config, m_audiocpu, 4000000);
m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp
index cdc5d4af696..cbabcfb7a09 100644
--- a/src/mame/drivers/socrates.cpp
+++ b/src/mame/drivers/socrates.cpp
@@ -1489,7 +1489,7 @@ void socrates_state::socrates(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &socrates_state::socrates_mem);
m_maincpu->set_addrmap(AS_IO, &socrates_state::socrates_io);
m_maincpu->set_vblank_int("screen", FUNC(socrates_state::assert_irq));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ADDRESS_MAP_BANK(config, "rombank1").set_map(&socrates_state::socrates_rombank_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000);
ADDRESS_MAP_BANK(config, "rambank1").set_map(&socrates_state::socrates_rambank_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000);
@@ -1522,7 +1522,7 @@ void socrates_state::socrates_pal(machine_config &config)
m_maincpu->set_clock(XTAL(26'601'712)/8); // XTAL verified, divider NOT verified; this is a later ASIC so the divider may be different
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
m_screen->set_refresh_hz(50);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
diff --git a/src/mame/drivers/softbox.cpp b/src/mame/drivers/softbox.cpp
index 634bb426a93..1d9d7cb6ef2 100644
--- a/src/mame/drivers/softbox.cpp
+++ b/src/mame/drivers/softbox.cpp
@@ -397,7 +397,7 @@ void softbox_state::softbox(machine_config &config)
HARDDISK(config, "harddisk3", "corvus_hdd");
HARDDISK(config, "harddisk4", "corvus_hdd");
- imi7000_bus_device::add_config(config, "imi5000h", nullptr, nullptr, nullptr);
+ IMI7000_BUS(config, "imi7000").set_slot_default_options("imi5000h", nullptr, nullptr, nullptr);
// software lists
SOFTWARE_LIST(config, "flop_list").set_original("softbox");
diff --git a/src/mame/drivers/sothello.cpp b/src/mame/drivers/sothello.cpp
index a02039dd890..450af20c0c8 100644
--- a/src/mame/drivers/sothello.cpp
+++ b/src/mame/drivers/sothello.cpp
@@ -368,7 +368,7 @@ void sothello_state::sothello(machine_config &config)
MC6809(config, m_subcpu, XTAL(8'000'000)); // divided by 4 internally
m_subcpu->set_addrmap(AS_PROGRAM, &sothello_state::subcpu_mem_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
v9938_device &v9938(V9938(config, "v9938", XTAL(21'477'272)));
diff --git a/src/mame/drivers/spacefb.cpp b/src/mame/drivers/spacefb.cpp
index fb22b3b12a7..4ec3050251c 100644
--- a/src/mame/drivers/spacefb.cpp
+++ b/src/mame/drivers/spacefb.cpp
@@ -344,7 +344,7 @@ void spacefb_state::spacefb(machine_config &config)
m_audiocpu->t0_in_cb().set(FUNC(spacefb_state::audio_t0_r));
m_audiocpu->t1_in_cb().set(FUNC(spacefb_state::audio_t1_r));
- config.m_minimum_quantum = attotime::from_hz(180);
+ config.set_maximum_quantum(attotime::from_hz(180));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/spdheat.cpp b/src/mame/drivers/spdheat.cpp
index 8b8066ee9b6..29d32f4b51b 100644
--- a/src/mame/drivers/spdheat.cpp
+++ b/src/mame/drivers/spdheat.cpp
@@ -689,7 +689,7 @@ void spdheat_state::spdheat(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &spdheat_state::sub_map);
m_subcpu->set_addrmap(AS_IO, &spdheat_state::sub_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
GFXDECODE(config, m_gfxdecode, m_palette0, gfx_spdheat); // TODO?
diff --git a/src/mame/drivers/spec128.cpp b/src/mame/drivers/spec128.cpp
index 30c3cff92b9..79db8d0b487 100644
--- a/src/mame/drivers/spec128.cpp
+++ b/src/mame/drivers/spec128.cpp
@@ -323,7 +323,7 @@ void spectrum_state::spectrum_128(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &spectrum_state::spectrum_128_io);
m_maincpu->set_addrmap(AS_OPCODES, &spectrum_state::spectrum_128_fetch);
m_maincpu->set_vblank_int("screen", FUNC(spectrum_state::spec_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum_128 )
diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp
index 56acc9e4696..07ab5e8ce22 100644
--- a/src/mame/drivers/spectrum.cpp
+++ b/src/mame/drivers/spectrum.cpp
@@ -710,7 +710,7 @@ void spectrum_state::spectrum_common(machine_config &config)
ADDRESS_MAP_BANK(config, m_specmem).set_map(&spectrum_state::spectrum_map).set_options(ENDIANNESS_LITTLE, 8, 16, 0x10000);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum )
diff --git a/src/mame/drivers/speglsht.cpp b/src/mame/drivers/speglsht.cpp
index 468036d75a6..417d9d38c1b 100644
--- a/src/mame/drivers/speglsht.cpp
+++ b/src/mame/drivers/speglsht.cpp
@@ -426,7 +426,7 @@ void speglsht_state::speglsht(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &speglsht_state::speglsht_mem);
m_subcpu->set_vblank_int("screen", FUNC(speglsht_state::irq4_line_assert));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_RESET_OVERRIDE(speglsht_state,speglsht)
/* video hardware */
diff --git a/src/mame/drivers/sprcros2.cpp b/src/mame/drivers/sprcros2.cpp
index 91a6caefa6b..2dc6805389c 100644
--- a/src/mame/drivers/sprcros2.cpp
+++ b/src/mame/drivers/sprcros2.cpp
@@ -467,7 +467,7 @@ void sprcros2_state::sprcros2(machine_config &config)
m_slave_cpu->set_addrmap(AS_IO, &sprcros2_state::slave_io);
m_slave_cpu->set_vblank_int("screen", FUNC(sprcros2_state::slave_vblank_irq));
- config.m_perfect_cpu_quantum = subtag("master_cpu");
+ config.set_perfect_quantum(m_master_cpu);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/srmp5.cpp b/src/mame/drivers/srmp5.cpp
index 8e22cfc6548..050c8520655 100644
--- a/src/mame/drivers/srmp5.cpp
+++ b/src/mame/drivers/srmp5.cpp
@@ -579,7 +579,7 @@ void srmp5_state::srmp5(machine_config &config)
m_soundcpu->set_addrmap(AS_IO, &srmp5_state::st0016_io);
m_soundcpu->set_vblank_int("screen", FUNC(srmp5_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp
index 673de4f8907..6a820da2c52 100644
--- a/src/mame/drivers/sshangha.cpp
+++ b/src/mame/drivers/sshangha.cpp
@@ -421,7 +421,7 @@ void sshangha_state::sshangha(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &sshangha_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
screen_device& screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp
index d06c841ee26..19495b28dce 100644
--- a/src/mame/drivers/ssv.cpp
+++ b/src/mame/drivers/ssv.cpp
@@ -2624,7 +2624,7 @@ void ssv_state::drifto94(machine_config &config)
m_dsp->set_addrmap(AS_PROGRAM, &ssv_state::dsp_prg_map);
m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -2798,7 +2798,7 @@ void ssv_state::stmblade(machine_config &config)
m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map);
/* don't need this, game just does a simple check at boot then the DSP stalls into a tight loop. */
- //config.m_perfect_cpu_quantum = subtag("maincpu");
+ //config.set_perfect_quantum(m_maincpu);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -2907,7 +2907,7 @@ void ssv_state::twineag2(machine_config &config)
m_dsp->set_addrmap(AS_PROGRAM, &ssv_state::dsp_prg_map);
m_dsp->set_addrmap(AS_DATA, &ssv_state::dsp_data_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/stfight.cpp b/src/mame/drivers/stfight.cpp
index aced326840d..114a87388b6 100644
--- a/src/mame/drivers/stfight.cpp
+++ b/src/mame/drivers/stfight.cpp
@@ -476,7 +476,7 @@ void stfight_state::stfight_base(machine_config &config)
m_mcu->portb_w().set(FUNC(stfight_state::stfight_68705_port_b_w));
m_mcu->portc_w().set(FUNC(stfight_state::stfight_68705_port_c_w));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
PALETTE(config, "palette").set_format(palette_device::xBRG_444, 256);
diff --git a/src/mame/drivers/suna16.cpp b/src/mame/drivers/suna16.cpp
index fd7d424ab66..c7f862a76de 100644
--- a/src/mame/drivers/suna16.cpp
+++ b/src/mame/drivers/suna16.cpp
@@ -834,7 +834,7 @@ void suna16_state::bssoccer(machine_config &config)
m_pcm2->set_addrmap(AS_PROGRAM, &suna16_state::bssoccer_pcm_2_map);
m_pcm2->set_addrmap(AS_IO, &suna16_state::bssoccer_pcm_2_io_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(suna16_state,bssoccer)
@@ -898,7 +898,7 @@ void suna16_state::uballoon(machine_config &config)
/* 2nd PCM Z80 missing */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(suna16_state,uballoon)
MCFG_MACHINE_RESET_OVERRIDE(suna16_state,uballoon)
@@ -956,7 +956,7 @@ void suna16_state::sunaq(machine_config &config)
/* 2nd PCM Z80 missing */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(suna16_state,uballoon)
MCFG_MACHINE_RESET_OVERRIDE(suna16_state,uballoon)
@@ -1019,7 +1019,7 @@ void suna16_state::bestbest(machine_config &config)
/* 2nd PCM Z80 missing */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(suna16_state, bestbest)
diff --git a/src/mame/drivers/superchs.cpp b/src/mame/drivers/superchs.cpp
index cb9598c0481..b566d1244fc 100644
--- a/src/mame/drivers/superchs.cpp
+++ b/src/mame/drivers/superchs.cpp
@@ -210,7 +210,7 @@ void superchs_state::superchs(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &superchs_state::superchs_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(superchs_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(480); /* Need to interleave CPU 1 & 3 */
+ config.set_maximum_quantum(attotime::from_hz(480)); /* Need to interleave CPU 1 & 3 */
EEPROM_93C46_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/supracan.cpp b/src/mame/drivers/supracan.cpp
index 8203aae4d12..16665d42813 100644
--- a/src/mame/drivers/supracan.cpp
+++ b/src/mame/drivers/supracan.cpp
@@ -2074,8 +2074,7 @@ void supracan_state::supracan(machine_config &config)
m_soundcpu->set_addrmap(AS_PROGRAM, &supracan_state::supracan_sound_mem);
m_soundcpu->set_vblank_int("screen", FUNC(supracan_state::sound_irq));
- config.m_perfect_cpu_quantum = subtag("maincpu");
- config.m_perfect_cpu_quantum = subtag("soundcpu");
+ config.set_perfect_quantum(m_soundcpu);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(XTAL(10'738'635)/2, 348, 0, 256, 256, 0, 240); /* No idea if this is correct */
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index b970cf7f7e6..58cb939e2e0 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -2173,7 +2173,7 @@ void system1_state::sys1ppi(machine_config &config)
TIMER(config, "soundirq", 0).configure_scanline(FUNC(system1_state::soundirq_gen), "screen", 32, 64);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
I8255A(config, m_ppi8255);
m_ppi8255->out_pa_callback().set(FUNC(system1_state::soundport_w));
diff --git a/src/mame/drivers/taito_b.cpp b/src/mame/drivers/taito_b.cpp
index 9ead813b58a..36954a57171 100644
--- a/src/mame/drivers/taito_b.cpp
+++ b/src/mame/drivers/taito_b.cpp
@@ -1738,7 +1738,7 @@ void taitob_state::rastsag2(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -1792,7 +1792,7 @@ void taitob_state::masterw(machine_config &config)
Z80(config, m_audiocpu, 24_MHz_XTAL / 4); /* 6 MHz Z80B */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::masterw_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
tc0040ioc.read_0_callback().set_ioport("DSWA");
@@ -1863,7 +1863,7 @@ void taitob_state::ashura(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -1917,7 +1917,7 @@ void taitob_state::crimec(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -1971,7 +1971,7 @@ void hitice_state::hitice(machine_config &config)
Z80(config, m_audiocpu, 24_MHz_XTAL / 4); /* 6 MHz Z80B */
m_audiocpu->set_addrmap(AS_PROGRAM, &hitice_state::viofight_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2030,7 +2030,7 @@ void taitob_state::rambo3p(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2084,7 +2084,7 @@ void taitob_state::rambo3(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4MHz verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2138,7 +2138,7 @@ void taitob_state::pbobble(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 2); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -2197,7 +2197,7 @@ void taitob_state::spacedx(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -2256,7 +2256,7 @@ void taitob_state::spacedxo(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2310,7 +2310,7 @@ void taitob_state::qzshowby(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
EEPROM_93C46_16BIT(config, "eeprom");
@@ -2369,7 +2369,7 @@ void taitob_state::viofight(machine_config &config)
Z80(config, m_audiocpu, 24_MHz_XTAL / 4); /* 6 MHz verified */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::viofight_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2428,7 +2428,7 @@ void taitob_state::silentd(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2482,7 +2482,7 @@ void taitob_state::selfeena(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2545,7 +2545,7 @@ void taitob_state::ryujin(machine_config &config)
Z80(config, m_audiocpu, 16_MHz_XTAL / 4); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -2606,7 +2606,7 @@ void taitob_state::sbm(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0510NIO(config, m_tc0510nio, 0);
m_tc0510nio->read_0_callback().set_ioport("DSWA");
@@ -2660,7 +2660,7 @@ void taitob_c_state::realpunc(machine_config &config)
Z80(config, m_audiocpu, 6000000);
m_audiocpu->set_addrmap(AS_PROGRAM, &taitob_c_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0510NIO(config, m_tc0510nio, 0);
m_tc0510nio->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp
index 1abb6acd715..0753d2d71b1 100644
--- a/src/mame/drivers/taito_h.cpp
+++ b/src/mame/drivers/taito_h.cpp
@@ -609,7 +609,7 @@ void taitoh_state::syvalion(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0040IOC(config, m_tc0040ioc, 0);
m_tc0040ioc->read_0_callback().set_ioport("DSWA");
@@ -659,7 +659,7 @@ void taitoh_state::recordbr(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0040IOC(config, m_tc0040ioc, 0);
m_tc0040ioc->read_0_callback().set_ioport("DSWA");
@@ -719,7 +719,7 @@ void taitoh_state::dleague(machine_config &config)
Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
tc0220ioc_device &tc0220ioc(TC0220IOC(config, "tc0220ioc", 0));
tc0220ioc.read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/taito_l.cpp b/src/mame/drivers/taito_l.cpp
index 07dcadbe3c7..ea1f93ea2b9 100644
--- a/src/mame/drivers/taito_l.cpp
+++ b/src/mame/drivers/taito_l.cpp
@@ -1488,7 +1488,7 @@ void fhawk_state::fhawk(machine_config &config)
slave.set_addrmap(AS_PROGRAM, &fhawk_state::fhawk_2_map);
slave.set_vblank_int("screen", FUNC(taitol_state::irq0_line_hold));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_main_cpu);
tc0220ioc_device &tc0220ioc(TC0220IOC(config, "tc0220ioc", 0));
tc0220ioc.read_0_callback().set_ioport("DSWA");
@@ -1553,7 +1553,7 @@ void taitol_2cpu_state::raimais(machine_config &config)
slave.set_addrmap(AS_PROGRAM, &taitol_2cpu_state::raimais_2_map);
slave.set_vblank_int("screen", FUNC(taitol_state::irq0_line_hold));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_main_cpu);
tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
tc0040ioc.read_0_callback().set_ioport("DSWA");
@@ -1596,7 +1596,7 @@ void taitol_2cpu_state::kurikint(machine_config &config)
m_audio_cpu->set_addrmap(AS_PROGRAM, &taitol_2cpu_state::kurikint_2_map);
m_audio_cpu->set_vblank_int("screen", FUNC(taitol_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
tc0040ioc_device &tc0040ioc(TC0040IOC(config, "tc0040ioc", 0));
tc0040ioc.read_0_callback().set_ioport("DSWA");
@@ -1739,7 +1739,7 @@ void taitol_2cpu_state::evilston(machine_config &config)
m_audio_cpu->set_addrmap(AS_PROGRAM, &taitol_2cpu_state::evilston_2_map);
m_audio_cpu->set_vblank_int("screen", FUNC(taitol_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
tc0510nio.read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/taito_x.cpp b/src/mame/drivers/taito_x.cpp
index ad85b76df94..49f5906ad7e 100644
--- a/src/mame/drivers/taito_x.cpp
+++ b/src/mame/drivers/taito_x.cpp
@@ -822,7 +822,7 @@ void taitox_state::superman(machine_config &config)
TIMER(config, "cchip_irq_clear").configure_generic(FUNC(taitox_state::cchip_irq_clear_cb));
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox)
@@ -869,7 +869,7 @@ void taitox_state::daisenpu(machine_config &config)
Z80(config, m_audiocpu, XTAL(16'000'000)/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitox_state::daisenpu_sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox)
@@ -914,7 +914,7 @@ void taitox_state::gigandes(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitox_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox)
@@ -961,7 +961,7 @@ void taitox_state::ballbros(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* 4 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &taitox_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox)
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index 4855ffb9dec..365883db565 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -3282,7 +3282,7 @@ void taitoz_state::enforce(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::enforce_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq6_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0040IOC(config, m_tc0040ioc, 0);
m_tc0040ioc->read_0_callback().set_ioport("DSWA");
@@ -3346,7 +3346,7 @@ void taitoz_state::bshark_base(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::bshark_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -3427,7 +3427,7 @@ void taitoz_state::sci(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::sci_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(3000);
+ config.set_maximum_quantum(attotime::from_hz(3000));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -3493,7 +3493,7 @@ void taitoz_state::nightstr(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::nightstr_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
adc0809_device &adc(ADC0809(config, "adc", 500000)); // clock unknown
adc.eoc_ff_callback().set_inputline("maincpu", 6);
@@ -3567,7 +3567,7 @@ void taitoz_state::aquajack(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::aquajack_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(30000);
+ config.set_maximum_quantum(attotime::from_hz(30000));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -3700,7 +3700,7 @@ void taitoz_state::dblaxle(machine_config &config)
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
// make quantum time to be a multiple of the xtal (fixes road layer stuck on continue)
- config.m_minimum_quantum = attotime::from_hz(XTAL(32'000'000)/1024);
+ config.set_maximum_quantum(attotime::from_hz(XTAL(32'000'000)/1024));
TC0510NIO(config, m_tc0510nio, 0);
m_tc0510nio->read_0_callback().set_ioport("DSWA");
@@ -3767,7 +3767,7 @@ void taitoz_state::racingb(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &taitoz_state::racingb_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
TC0510NIO(config, m_tc0510nio, 0);
m_tc0510nio->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/taitoair.cpp b/src/mame/drivers/taitoair.cpp
index 61970748df6..f9d14be6eee 100644
--- a/src/mame/drivers/taitoair.cpp
+++ b/src/mame/drivers/taitoair.cpp
@@ -687,7 +687,7 @@ void taitoair_state::airsys(machine_config &config)
m_dsp->hold_in_cb().set(FUNC(taitoair_state::dsp_HOLD_signal_r));
m_dsp->hold_ack_out_cb().set(FUNC(taitoair_state::dsp_HOLDA_signal_w));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/taitojc.cpp b/src/mame/drivers/taitojc.cpp
index fcd4f265752..dfc20c5491e 100644
--- a/src/mame/drivers/taitojc.cpp
+++ b/src/mame/drivers/taitojc.cpp
@@ -1100,7 +1100,7 @@ void taitojc_state::taitojc(machine_config &config)
m_dsp->set_addrmap(AS_PROGRAM, &taitojc_state::tms_program_map);
m_dsp->set_addrmap(AS_DATA, &taitojc_state::tms_data_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
EEPROM_93C46_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/taitopjc.cpp b/src/mame/drivers/taitopjc.cpp
index 2f8aa81665f..265f44160b7 100644
--- a/src/mame/drivers/taitopjc.cpp
+++ b/src/mame/drivers/taitopjc.cpp
@@ -797,7 +797,7 @@ void taitopjc_state::taitopjc(machine_config &config)
MN1020012A(config, m_soundcpu, 10000000); /* MN1020819DA sound CPU - NOTE: May have 64kB internal ROM */
m_soundcpu->set_addrmap(AS_PROGRAM, &taitopjc_state::mn10200_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index bd637167fa3..5fc84fca1e8 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -1856,7 +1856,7 @@ void taitosj_state::mcu(machine_config &config)
m_mcu->m68intrq_cb().set(FUNC(taitosj_state::mcu_intrq_w));
m_mcu->busrq_cb().set(FUNC(taitosj_state::mcu_busrq_w));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
}
diff --git a/src/mame/drivers/taitotz.cpp b/src/mame/drivers/taitotz.cpp
index 8d86d78168e..ec05ac2a020 100644
--- a/src/mame/drivers/taitotz.cpp
+++ b/src/mame/drivers/taitotz.cpp
@@ -2596,7 +2596,7 @@ void taitotz_state::taitotz(machine_config &config)
/* MN1020819DA sound CPU */
- config.m_minimum_quantum = attotime::from_hz(120);
+ config.set_maximum_quantum(attotime::from_hz(120));
ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, true));
ata.irq_handler().set(FUNC(taitotz_state::ide_interrupt));
diff --git a/src/mame/drivers/tandy1t.cpp b/src/mame/drivers/tandy1t.cpp
index 432f967a9f4..8af3a78fbdb 100644
--- a/src/mame/drivers/tandy1t.cpp
+++ b/src/mame/drivers/tandy1t.cpp
@@ -645,13 +645,13 @@ void tandy1000_state::cfg_fdc_35(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("35dd");
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_fixed(true);
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
void tandy1000_state::cfg_fdc_525(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_fixed(true);
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
static GFXDECODE_START( gfx_t1000 )
diff --git a/src/mame/drivers/tankbust.cpp b/src/mame/drivers/tankbust.cpp
index 5476548e37b..dc01c97d400 100644
--- a/src/mame/drivers/tankbust.cpp
+++ b/src/mame/drivers/tankbust.cpp
@@ -341,7 +341,7 @@ void tankbust_state::tankbust(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &tankbust_state::map_cpu2);
m_subcpu->set_addrmap(AS_IO, &tankbust_state::port_map_cpu2);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
diff --git a/src/mame/drivers/tapatune.cpp b/src/mame/drivers/tapatune.cpp
index c87b667425f..97af2505ce2 100644
--- a/src/mame/drivers/tapatune.cpp
+++ b/src/mame/drivers/tapatune.cpp
@@ -552,7 +552,7 @@ void tapatune_state::tapatune(machine_config &config)
M68000(config, m_videocpu, XTAL(24'000'000) / 2);
m_videocpu->set_addrmap(AS_PROGRAM, &tapatune_state::video_map);
- config.m_perfect_cpu_quantum = subtag("videocpu");
+ config.set_perfect_quantum(m_videocpu);
hd6845s_device &crtc(HD6845S(config, "crtc", XTAL(24'000'000) / 16));
crtc.set_screen("screen");
diff --git a/src/mame/drivers/targeth.cpp b/src/mame/drivers/targeth.cpp
index 1a2fd35e41a..7a5857d8e0e 100644
--- a/src/mame/drivers/targeth.cpp
+++ b/src/mame/drivers/targeth.cpp
@@ -277,6 +277,7 @@ void targeth_state::targeth(machine_config &config)
gaelco_ds5002fp_device &ds5002fp(GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(24'000'000) / 2));
ds5002fp.set_addrmap(0, &targeth_state::mcu_hostmem_map);
+ config.set_perfect_quantum("gaelco_ds5002fp:mcu");
LS259(config, m_outlatch);
m_outlatch->q_out_cb<2>().set(FUNC(targeth_state::coin1_counter_w));
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index 05d25ff202f..3f1f4469d11 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -882,7 +882,7 @@ void apache3_state::apache3(machine_config &config)
m_subcpu2->set_addrmap(AS_PROGRAM, &apache3_state::apache3_z80_map);
m_subcpu2->set_vblank_int("screen", FUNC(apache3_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
MCFG_MACHINE_RESET_OVERRIDE(apache3_state, apache3)
@@ -942,7 +942,7 @@ void roundup5_state::roundup5(machine_config &config)
Z80(config, m_audiocpu, CLOCK_1 / 4);
m_audiocpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_z80_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
i8255_device &ppi(I8255(config, "ppi"));
ppi.in_pa_callback().set_ioport("IN0");
@@ -1015,7 +1015,7 @@ void cyclwarr_state::cyclwarr(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::sound_map);
// saner sync value (avoids crashing after crediting)
- config.m_minimum_quantum = attotime::from_hz(CLOCK_2 / 1024);
+ config.set_maximum_quantum(attotime::from_hz(CLOCK_2 / 1024));
cxd1095_device &io1(CXD1095(config, "io1"));
io1.in_portb_cb().set_ioport("SERVICE");
diff --git a/src/mame/drivers/taxidriv.cpp b/src/mame/drivers/taxidriv.cpp
index 0afed3f42b1..bc720f2d429 100644
--- a/src/mame/drivers/taxidriv.cpp
+++ b/src/mame/drivers/taxidriv.cpp
@@ -347,7 +347,7 @@ void taxidriv_state::taxidriv(machine_config &config)
audiocpu.set_addrmap(AS_IO, &taxidriv_state::cpu3_port_map);
audiocpu.set_vblank_int("screen", FUNC(taxidriv_state::irq0_line_hold)); /* ??? */
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
i8255_device &ppi0(I8255A(config, "ppi8255_0"));
diff --git a/src/mame/drivers/tbowl.cpp b/src/mame/drivers/tbowl.cpp
index 2aeef2b04a6..1963ecfba4a 100644
--- a/src/mame/drivers/tbowl.cpp
+++ b/src/mame/drivers/tbowl.cpp
@@ -445,7 +445,7 @@ void tbowl_state::tbowl(machine_config &config)
Z80(config, m_audiocpu, 4000000); /* Actual Z80 */
m_audiocpu->set_addrmap(AS_PROGRAM, &tbowl_state::_6206A_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
GFXDECODE(config, m_gfxdecode, m_palette, gfx_tbowl);
diff --git a/src/mame/drivers/tceptor.cpp b/src/mame/drivers/tceptor.cpp
index 103e81d7186..f9ea224dd4e 100644
--- a/src/mame/drivers/tceptor.cpp
+++ b/src/mame/drivers/tceptor.cpp
@@ -331,7 +331,7 @@ void tceptor_state::tceptor(machine_config &config)
HD63701(config, m_mcu, XTAL(49'152'000)/8); // or compatible 6808 with extra instructions
m_mcu->set_addrmap(AS_PROGRAM, &tceptor_state::mcu_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/tecmo16.cpp b/src/mame/drivers/tecmo16.cpp
index a6cd1649785..ccdece3afc2 100644
--- a/src/mame/drivers/tecmo16.cpp
+++ b/src/mame/drivers/tecmo16.cpp
@@ -342,7 +342,7 @@ void tecmo16_state::fstarfrc(machine_config &config)
Z80(config, m_audiocpu, MASTER_CLOCK/6); /* 4MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &tecmo16_state::sound_map);
/* NMIs are triggered by the main CPU */
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram);
diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp
index d7270c31dd7..66566360155 100644
--- a/src/mame/drivers/tehkanwc.cpp
+++ b/src/mame/drivers/tehkanwc.cpp
@@ -681,7 +681,7 @@ void tehkanwc_state::tehkanwc(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &tehkanwc_state::sound_port);
m_audiocpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold));
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp
index 1933eec9b16..e0fcb7c29cb 100644
--- a/src/mame/drivers/thedeep.cpp
+++ b/src/mame/drivers/thedeep.cpp
@@ -347,7 +347,7 @@ void thedeep_state::thedeep(machine_config &config)
/* IRQ by YM2203, NMI by when sound latch written by main cpu */
// needs a tight sync with the mcu
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
// Intel C8751H-88 @ 8 MHz
I8751(config, m_mcu, 8_MHz_XTAL);
diff --git a/src/mame/drivers/thunderj.cpp b/src/mame/drivers/thunderj.cpp
index 53403e0eaa3..99a39eeccac 100644
--- a/src/mame/drivers/thunderj.cpp
+++ b/src/mame/drivers/thunderj.cpp
@@ -255,7 +255,7 @@ void thunderj_state::thunderj(machine_config &config)
WATCHDOG_TIMER(config, "watchdog");
/* perfect synchronization due to shared RAM */
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
GFXDECODE(config, "gfxdecode", "palette", gfx_thunderj);
diff --git a/src/mame/drivers/tigeroad.cpp b/src/mame/drivers/tigeroad.cpp
index dde71784ede..d8b1ee271a0 100644
--- a/src/mame/drivers/tigeroad.cpp
+++ b/src/mame/drivers/tigeroad.cpp
@@ -714,7 +714,7 @@ void tigeroad_state::f1dream_comad(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &tigeroad_state::comad_sound_map);
m_audiocpu->set_addrmap(AS_IO, &tigeroad_state::comad_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(3600);
+ config.set_maximum_quantum(attotime::from_hz(3600));
/* video hardware */
BUFFERED_SPRITERAM16(config, "spriteram");
diff --git a/src/mame/drivers/tiki100.cpp b/src/mame/drivers/tiki100.cpp
index a2bfdd22b00..e5adc75bd1d 100644
--- a/src/mame/drivers/tiki100.cpp
+++ b/src/mame/drivers/tiki100.cpp
@@ -720,9 +720,9 @@ void tiki100_state::tiki100(machine_config &config)
m_exp->busrq_wr_callback().set(FUNC(tiki100_state::busrq_w));
m_exp->mrq_rd_callback().set(FUNC(tiki100_state::mrq_r));
m_exp->mrq_wr_callback().set(FUNC(tiki100_state::mrq_w));
- TIKI100_BUS_SLOT(config, "slot1", tiki100_cards, "8088");
- TIKI100_BUS_SLOT(config, "slot2", tiki100_cards, "hdc");
- TIKI100_BUS_SLOT(config, "slot3", tiki100_cards, nullptr);
+ TIKI100_BUS_SLOT(config, "slot1", m_exp, tiki100_cards, "8088");
+ TIKI100_BUS_SLOT(config, "slot2", m_exp, tiki100_cards, "hdc");
+ TIKI100_BUS_SLOT(config, "slot3", m_exp, tiki100_cards, nullptr);
/* devices */
Z80DART(config, m_dart, 8_MHz_XTAL / 4);
diff --git a/src/mame/drivers/timelimt.cpp b/src/mame/drivers/timelimt.cpp
index c6593f263c0..942bcb502a7 100644
--- a/src/mame/drivers/timelimt.cpp
+++ b/src/mame/drivers/timelimt.cpp
@@ -235,7 +235,7 @@ void timelimt_state::timelimt(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &timelimt_state::sound_io_map);
m_audiocpu->set_vblank_int("screen", FUNC(timelimt_state::irq0_line_hold)); /* ? */
- config.m_minimum_quantum = attotime::from_hz(3000);
+ config.set_maximum_quantum(attotime::from_hz(3000));
ls259_device &mainlatch(LS259(config, "mainlatch")); // IC15
mainlatch.q_out_cb<0>().set(FUNC(timelimt_state::nmi_enable_w));
diff --git a/src/mame/drivers/timex.cpp b/src/mame/drivers/timex.cpp
index f15b772541c..98eadbe3c61 100644
--- a/src/mame/drivers/timex.cpp
+++ b/src/mame/drivers/timex.cpp
@@ -694,7 +694,7 @@ void timex_state::ts2068(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &timex_state::ts2068_mem);
m_maincpu->set_addrmap(AS_IO, &timex_state::ts2068_io);
m_maincpu->set_vblank_int("screen", FUNC(timex_state::spec_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
MCFG_MACHINE_RESET_OVERRIDE(timex_state, ts2068 )
diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp
index c5cac48d6c9..195fe8bbb19 100644
--- a/src/mame/drivers/tispellb.cpp
+++ b/src/mame/drivers/tispellb.cpp
@@ -353,7 +353,7 @@ void tispellb_state::rev1(machine_config &config)
m_subcpu->o().set(FUNC(tispellb_state::sub_write_o));
m_subcpu->r().set(FUNC(tispellb_state::sub_write_r));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(16, 16);
diff --git a/src/mame/drivers/tk2000.cpp b/src/mame/drivers/tk2000.cpp
index 3fb7ead0559..43ec5d7dc57 100644
--- a/src/mame/drivers/tk2000.cpp
+++ b/src/mame/drivers/tk2000.cpp
@@ -582,7 +582,7 @@ void tk2000_state::tk2000(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &tk2000_state::apple2_map);
TIMER(config, "scantimer").configure_scanline(FUNC(tk2000_state::apple2_interrupt), "screen", 0, 1);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
APPLE2_VIDEO(config, m_video, XTAL(14'318'181)).set_screen(m_screen);
diff --git a/src/mame/drivers/tmc600.cpp b/src/mame/drivers/tmc600.cpp
index 3d6a8bcf61a..9de92459107 100644
--- a/src/mame/drivers/tmc600.cpp
+++ b/src/mame/drivers/tmc600.cpp
@@ -298,7 +298,7 @@ void tmc600_state::tmc600(machine_config &config)
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
// expansion bus connector
- TMC600_EURO_BUS_SLOT(config, m_bus, tmc600_euro_bus_cards, nullptr);
+ TMC600_EUROBUS_SLOT(config, m_bus, tmc600_eurobus_cards, nullptr);
// internal RAM
RAM(config, RAM_TAG).set_default_size("8K");
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp
index 6705f45e3ba..a873128fab1 100644
--- a/src/mame/drivers/tnzs.cpp
+++ b/src/mame/drivers/tnzs.cpp
@@ -1542,7 +1542,7 @@ void tnzs_base_state::tnzs_base(machine_config &config)
tnzs_mainbank(config);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* video hardware */
SETA001_SPRITE(config, m_seta001, 0);
diff --git a/src/mame/drivers/toaplan1.cpp b/src/mame/drivers/toaplan1.cpp
index 88ad2105c34..430659b4411 100644
--- a/src/mame/drivers/toaplan1.cpp
+++ b/src/mame/drivers/toaplan1.cpp
@@ -1940,7 +1940,7 @@ void toaplan1_rallybik_state::rallybik(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_rallybik_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_rallybik_state::rallybik_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
ls259_device &coinlatch(LS259(config, "coinlatch")); // 19L
coinlatch.q_out_cb<4>().set(FUNC(toaplan1_rallybik_state::coin_counter_1_w));
@@ -1980,7 +1980,7 @@ void toaplan1_state::truxton(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_state::truxton_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -2010,7 +2010,7 @@ void toaplan1_state::hellfire(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_state::hellfire_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -2040,7 +2040,7 @@ void toaplan1_state::zerowing(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_state::zerowing_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,zerowing)
@@ -2077,7 +2077,7 @@ void toaplan1_demonwld_state::demonwld(machine_config &config)
m_dsp->set_addrmap(AS_IO, &toaplan1_demonwld_state::dsp_io_map);
m_dsp->bio().set(FUNC(toaplan1_demonwld_state::bio_r));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
@@ -2108,7 +2108,7 @@ void toaplan1_samesame_state::samesame(machine_config &config)
audiocpu.set_addrmap(AS_IO, &toaplan1_samesame_state::hd647180_io_map);
audiocpu.in_pd_callback().set(FUNC(toaplan1_samesame_state::cmdavailable_r));
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_samesame_state,zerowing)
@@ -2140,7 +2140,7 @@ void toaplan1_state::outzone(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_state::outzone_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,zerowing)
@@ -2172,7 +2172,7 @@ void toaplan1_state::outzonecv(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan1_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &toaplan1_state::zerowing_sound_io_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,zerowing)
@@ -2206,7 +2206,7 @@ void toaplan1_state::vimana(machine_config &config)
audiocpu.in_pa_callback().set(FUNC(toaplan1_state::vimana_dswb_invert_r)); // note these inputs seem to be inverted, unlike the DSWA ones.
audiocpu.in_pg_callback().set(FUNC(toaplan1_state::vimana_tjump_invert_r)); // note these inputs seem to be inverted, unlike the DSWA ones.
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan1_state,zerowing)
diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp
index d4df4d84480..b12c7805def 100644
--- a/src/mame/drivers/toaplan2.cpp
+++ b/src/mame/drivers/toaplan2.cpp
@@ -3212,7 +3212,7 @@ void toaplan2_state::tekipaki(machine_config &config)
audiocpu.set_addrmap(AS_IO, &toaplan2_state::hd647180_io_map);
audiocpu.in_pa_callback().set(FUNC(toaplan2_state::tekipaki_cmdavailable_r));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
@@ -3254,7 +3254,7 @@ void toaplan2_state::ghox(machine_config &config)
HD647180X(config, m_audiocpu, 10_MHz_XTAL);
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::ghox_hd647180_mem_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,ghox)
@@ -3509,7 +3509,7 @@ void toaplan2_state::pipibibs(machine_config &config)
Z80(config, m_audiocpu, 27_MHz_XTAL/8); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibs_sound_z80_mem);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
@@ -3551,7 +3551,7 @@ void toaplan2_state::pipibibsbl(machine_config &config)
Z80(config, m_audiocpu, 12_MHz_XTAL / 2); // GoldStar Z8400B; clock source and divider unknown
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibs_sound_z80_mem);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
@@ -3921,7 +3921,7 @@ void toaplan2_state::mahoudai(machine_config &config)
Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::raizing_sound_z80_mem);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
@@ -3971,7 +3971,7 @@ void toaplan2_state::bgaregga(machine_config &config)
Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::bgaregga_sound_z80_mem);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,bgaregga)
@@ -4028,7 +4028,7 @@ void toaplan2_state::batrider(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::batrider_sound_z80_mem);
m_audiocpu->set_addrmap(AS_IO, &toaplan2_state::batrider_sound_z80_port);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,bgaregga)
@@ -4092,7 +4092,7 @@ void toaplan2_state::bbakraid(machine_config &config)
m_audiocpu->set_addrmap(AS_IO, &toaplan2_state::bbakraid_sound_z80_port);
m_audiocpu->set_periodic_int(FUNC(toaplan2_state::bbakraid_snd_interrupt), attotime::from_hz(448));
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(toaplan2_state,toaplan2)
diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp
index a7933a14a57..c8b1e3503d5 100644
--- a/src/mame/drivers/tomcat.cpp
+++ b/src/mame/drivers/tomcat.cpp
@@ -343,7 +343,7 @@ void tomcat_state::tomcat(machine_config &config)
// OUTB PB0 - PB7 OUTPUT Speech Data
// IRQ CB connected to IRQ line of 6502
- config.m_minimum_quantum = attotime::from_hz(4000);
+ config.set_maximum_quantum(attotime::from_hz(4000));
LS259(config, m_mainlatch);
m_mainlatch->q_out_cb<0>().set_output("led1").invert();
diff --git a/src/mame/drivers/tosh1000.cpp b/src/mame/drivers/tosh1000.cpp
index 741f31563b8..643ddc26a00 100644
--- a/src/mame/drivers/tosh1000.cpp
+++ b/src/mame/drivers/tosh1000.cpp
@@ -250,7 +250,7 @@ void tosh1000_state::cfg_fdc_35(device_t *device)
{
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_default_option("35dd");
dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:0")).set_fixed(true);
- dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option("");
+ dynamic_cast<device_slot_interface &>(*device->subdevice("fdc:1")).set_default_option(nullptr);
}
void tosh1000_state::tosh1000(machine_config &config)
diff --git a/src/mame/drivers/tourvis.cpp b/src/mame/drivers/tourvis.cpp
index 010719b1e3e..0bacaae49da 100644
--- a/src/mame/drivers/tourvis.cpp
+++ b/src/mame/drivers/tourvis.cpp
@@ -402,7 +402,7 @@ void tourvision_state::tourvision(machine_config &config)
m_maincpu->add_route(0, "lspeaker", 1.00);
m_maincpu->add_route(1, "rspeaker", 1.00);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
I8085A(config, m_subcpu, 18000000/3 /*?*/);
m_subcpu->set_addrmap(AS_PROGRAM, &tourvision_state::tourvision_8085_map);
diff --git a/src/mame/drivers/tp84.cpp b/src/mame/drivers/tp84.cpp
index 78c85607318..11ee5986988 100644
--- a/src/mame/drivers/tp84.cpp
+++ b/src/mame/drivers/tp84.cpp
@@ -341,7 +341,7 @@ void tp84_state::tp84(machine_config &config)
Z80(config, m_audiocpu, XTAL(14'318'181)/4); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &tp84_state::audio_map);
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame - a high value to ensure proper */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
ls259_device &mainlatch(LS259(config, "mainlatch", 0)); // 3B
diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp
index 47842072b49..919c0c10414 100644
--- a/src/mame/drivers/triforce.cpp
+++ b/src/mame/drivers/triforce.cpp
@@ -592,7 +592,7 @@ void triforce_state::triforce_base(machine_config &config)
PPC603(config, m_maincpu, 64000000); /* Correct CPU is a PowerPC 750 (what Apple called "G3") with paired-single vector instructions added */
m_maincpu->set_addrmap(AS_PROGRAM, &triforce_state::gc_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
diff --git a/src/mame/drivers/trs80.cpp b/src/mame/drivers/trs80.cpp
index 6c77c12ecf0..152a18ed283 100644
--- a/src/mame/drivers/trs80.cpp
+++ b/src/mame/drivers/trs80.cpp
@@ -546,8 +546,8 @@ void trs80_state::model1(machine_config &config) // model I, level II
FLOPPY_CONNECTOR(config, "fdc:0", trs80_floppies, "sssd", trs80_state::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "fdc:1", trs80_floppies, "sssd", trs80_state::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, "fdc:2", trs80_floppies, "", trs80_state::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, "fdc:3", trs80_floppies, "", trs80_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, "fdc:2", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, "fdc:3", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
CENTRONICS(config, m_centronics, centronics_devices, "printer");
m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7));
diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp
index 0796a90ba95..b5508786479 100644
--- a/src/mame/drivers/tubep.cpp
+++ b/src/mame/drivers/tubep.cpp
@@ -838,7 +838,7 @@ void tubep_state::tubep(machine_config &config)
NSC8105(config, m_mcu, 6000000); /* 6 MHz Xtal - divided internally ??? */
m_mcu->set_addrmap(AS_PROGRAM, &tubep_state::nsc_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(tubep_state::coin1_counter_w));
diff --git a/src/mame/drivers/turbo.cpp b/src/mame/drivers/turbo.cpp
index 80e6d144308..7836095a08b 100644
--- a/src/mame/drivers/turbo.cpp
+++ b/src/mame/drivers/turbo.cpp
@@ -948,7 +948,7 @@ void turbo_state::buckrog(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &turbo_state::buckrog_cpu2_map);
m_subcpu->set_addrmap(AS_IO, &turbo_state::buckrog_cpu2_portmap);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(turbo_state,buckrog)
I8255(config, m_i8255_0);
diff --git a/src/mame/drivers/tvcapcom.cpp b/src/mame/drivers/tvcapcom.cpp
index d4254f72348..8e010cd477e 100644
--- a/src/mame/drivers/tvcapcom.cpp
+++ b/src/mame/drivers/tvcapcom.cpp
@@ -62,7 +62,7 @@ void tvcapcom_state::tvcapcom(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &tvcapcom_state::gc_map);
m_maincpu->set_disable();
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
diff --git a/src/mame/drivers/twin16.cpp b/src/mame/drivers/twin16.cpp
index 3f9f925f1d8..47b834326ed 100644
--- a/src/mame/drivers/twin16.cpp
+++ b/src/mame/drivers/twin16.cpp
@@ -661,7 +661,7 @@ void twin16_state::twin16(machine_config &config)
Z80(config, m_audiocpu, XTAL(3'579'545));
m_audiocpu->set_addrmap(AS_PROGRAM, &twin16_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, "watchdog");
@@ -703,7 +703,7 @@ void twin16_state::twin16(machine_config &config)
void twin16_state::devilw(machine_config &config)
{
twin16(config);
- config.m_minimum_quantum = attotime::from_hz(60000); // watchdog reset otherwise
+ config.set_maximum_quantum(attotime::from_hz(60000)); // watchdog reset otherwise
}
void fround_state::fround(machine_config &config)
@@ -715,7 +715,7 @@ void fround_state::fround(machine_config &config)
Z80(config, m_audiocpu, XTAL(3'579'545));
m_audiocpu->set_addrmap(AS_PROGRAM, &fround_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/twincobr.cpp b/src/mame/drivers/twincobr.cpp
index 06dbc21765e..c0d46a67623 100644
--- a/src/mame/drivers/twincobr.cpp
+++ b/src/mame/drivers/twincobr.cpp
@@ -665,7 +665,7 @@ void twincobr_state::twincobr(machine_config &config)
m_dsp->set_addrmap(AS_IO, &twincobr_state::dsp_io_map);
m_dsp->bio().set(FUNC(twincobr_state::twincobr_bio_r));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
LS259(config, m_mainlatch);
m_mainlatch->q_out_cb<2>().set(FUNC(twincobr_state::int_enable_w));
diff --git a/src/mame/drivers/uapce.cpp b/src/mame/drivers/uapce.cpp
index 7c400fd56d2..e12a0f34254 100644
--- a/src/mame/drivers/uapce.cpp
+++ b/src/mame/drivers/uapce.cpp
@@ -335,7 +335,7 @@ void uapce_state::uapce(machine_config &config)
z80_device &sub(Z80(config, "sub", 1400000));
sub.set_addrmap(AS_PROGRAM, &uapce_state::z80_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp
index 059da36369f..29e35c0df30 100644
--- a/src/mame/drivers/ultraman.cpp
+++ b/src/mame/drivers/ultraman.cpp
@@ -186,7 +186,7 @@ void ultraman_state::ultraman(machine_config &config)
INPUT_MERGER_ALL_HIGH(config, "soundnmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp
index 197366c9332..69525f6e4e9 100644
--- a/src/mame/drivers/undrfire.cpp
+++ b/src/mame/drivers/undrfire.cpp
@@ -569,7 +569,7 @@ void undrfire_state::cbombers(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &undrfire_state::cbombers_cpub_map);
m_subcpu->set_vblank_int("screen", FUNC(undrfire_state::irq4_line_hold));
- config.m_minimum_quantum = attotime::from_hz(480); /* CPU slices - Need to interleave Cpu's 1 & 3 */
+ config.set_maximum_quantum(attotime::from_hz(480)); /* CPU slices - Need to interleave Cpu's 1 & 3 */
EEPROM_93C46_16BIT(config, "eeprom");
diff --git a/src/mame/drivers/unichamp.cpp b/src/mame/drivers/unichamp.cpp
index 66d3b3870af..55579643f12 100644
--- a/src/mame/drivers/unichamp.cpp
+++ b/src/mame/drivers/unichamp.cpp
@@ -255,7 +255,7 @@ void unichamp_state::unichamp(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &unichamp_state::unichamp_mem);
m_maincpu->bext().set(FUNC(unichamp_state::bext_r));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/v1050.cpp b/src/mame/drivers/v1050.cpp
index b88992449c0..cc335788828 100644
--- a/src/mame/drivers/v1050.cpp
+++ b/src/mame/drivers/v1050.cpp
@@ -1030,11 +1030,9 @@ void v1050_state::v1050(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &v1050_state::v1050_io);
m_maincpu->set_irq_acknowledge_callback(FUNC(v1050_state::v1050_int_ack));
- config.m_perfect_cpu_quantum = subtag(Z80_TAG);
-
M6502(config, m_subcpu, 15.36_MHz_XTAL/16);
m_subcpu->set_addrmap(AS_PROGRAM, &v1050_state::v1050_crt_mem);
- config.m_perfect_cpu_quantum = subtag(M6502_TAG);
+ config.set_perfect_quantum(m_subcpu);
// keyboard HACK
TIMER(config, "keyboard").configure_periodic(FUNC(v1050_state::v1050_keyboard_tick), attotime::from_hz(60));
diff --git a/src/mame/drivers/vastar.cpp b/src/mame/drivers/vastar.cpp
index 454c01aaa57..98d9cfd4801 100644
--- a/src/mame/drivers/vastar.cpp
+++ b/src/mame/drivers/vastar.cpp
@@ -439,7 +439,7 @@ void vastar_common_state::common(machine_config &config)
m_subcpu->set_addrmap(AS_IO, &vastar_common_state::cpu2_port_map);
m_subcpu->set_periodic_int(FUNC(vastar_common_state::irq0_line_hold), attotime::from_hz(242)); /* 4 * vsync_freq(60.58) measured, it is not known yet how long it is asserted so we'll use HOLD_LINE for now */
- config.m_minimum_quantum = attotime::from_hz(600); /* 10 CPU slices per frame - seems enough to ensure proper synchronization of the CPUs */
+ config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - seems enough to ensure proper synchronization of the CPUs */
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(vastar_common_state::nmi_mask_w));
diff --git a/src/mame/drivers/vcombat.cpp b/src/mame/drivers/vcombat.cpp
index 81ebf34076c..ca7f75c7033 100644
--- a/src/mame/drivers/vcombat.cpp
+++ b/src/mame/drivers/vcombat.cpp
@@ -581,7 +581,7 @@ void vcombat_state::vcombat(machine_config &config)
/* Temporary hack for experimenting with timing. */
#if 0
- //config.m_minimum_quantum = attotime::from_hz(1200);
+ //config.set_maximum_quantum(attotime::from_hz(1200));
config.m_perfect_cpu_quantum = subtag("maincpu");
#endif
diff --git a/src/mame/drivers/vic10.cpp b/src/mame/drivers/vic10.cpp
index 68f8d95a13e..3d84931f474 100644
--- a/src/mame/drivers/vic10.cpp
+++ b/src/mame/drivers/vic10.cpp
@@ -23,7 +23,6 @@
#include "sound/mos6581.h"
#include "video/mos6566.h"
-#define M6510_TAG "u3"
#define MOS6566_TAG "u2"
#define MOS6581_TAG "u6"
#define MOS6526_TAG "u9"
@@ -37,7 +36,7 @@ class vic10_state : public driver_device
public:
vic10_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
- m_maincpu(*this, M6510_TAG),
+ m_maincpu(*this, "u3"),
m_vic(*this, MOS6566_TAG),
m_sid(*this, MOS6581_TAG),
m_cia(*this, MOS6526_TAG),
@@ -649,13 +648,13 @@ void vic10_state::vic10(machine_config &config)
m_maincpu->read_callback().set(FUNC(vic10_state::cpu_r));
m_maincpu->write_callback().set(FUNC(vic10_state::cpu_w));
m_maincpu->set_pulls(0x10, 0x20);
- config.m_perfect_cpu_quantum = subtag(M6510_TAG);
+ config.set_perfect_quantum(m_maincpu);
INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, m6510_device::IRQ_LINE);
// video hardware
mos8566_device &mos8566(MOS8566(config, MOS6566_TAG, XTAL(8'000'000)/8));
- mos8566.set_cpu(M6510_TAG);
+ mos8566.set_cpu(m_maincpu);
mos8566.irq_callback().set("mainirq", FUNC(input_merger_device::in_w<1>));
mos8566.set_screen(SCREEN_TAG);
mos8566.set_addrmap(0, &vic10_state::vic_videoram_map);
diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp
index 9c1cda94826..990e0ff8aeb 100644
--- a/src/mame/drivers/vicdual.cpp
+++ b/src/mame/drivers/vicdual.cpp
@@ -2233,7 +2233,7 @@ void carnival_state::carnival(machine_config &config)
/* basic machine hardware */
m_maincpu->set_addrmap(AS_IO, &carnival_state::carnival_io_map);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
/* audio hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/vidbrain.cpp b/src/mame/drivers/vidbrain.cpp
index 71af674ae38..7aa51a7b7ed 100644
--- a/src/mame/drivers/vidbrain.cpp
+++ b/src/mame/drivers/vidbrain.cpp
@@ -427,7 +427,7 @@ void vidbrain_state::vidbrain(machine_config &config)
m_smi->int_req_callback().set_inputline(m_maincpu, F8_INPUT_LINE_INT_REQ);
// cartridge
- VIDEOBRAIN_EXPANSION_SLOT(config, VIDEOBRAIN_EXPANSION_SLOT_TAG, vidbrain_expansion_cards, nullptr);
+ VIDEOBRAIN_EXPANSION_SLOT(config, m_exp, vidbrain_expansion_cards, nullptr);
// software lists
SOFTWARE_LIST(config, "cart_list").set_original("vidbrain");
diff --git a/src/mame/drivers/volfied.cpp b/src/mame/drivers/volfied.cpp
index fd66e5825d5..b4abf90255f 100644
--- a/src/mame/drivers/volfied.cpp
+++ b/src/mame/drivers/volfied.cpp
@@ -237,7 +237,7 @@ void volfied_state::volfied(machine_config &config)
m_cchip->in_ad_callback().set_ioport("F0000D");
m_cchip->out_pb_callback().set(FUNC(volfied_state::counters_w));
- config.m_minimum_quantum = attotime::from_hz(1200);
+ config.set_maximum_quantum(attotime::from_hz(1200));
TIMER(config, m_cchip_irq_clear).configure_generic(FUNC(volfied_state::cchip_irq_clear_cb));
diff --git a/src/mame/drivers/vsnes.cpp b/src/mame/drivers/vsnes.cpp
index 1eb5d61eee5..e324e0cf148 100644
--- a/src/mame/drivers/vsnes.cpp
+++ b/src/mame/drivers/vsnes.cpp
@@ -1837,7 +1837,7 @@ void vsnes_state::vsdual(machine_config &config)
void vsnes_state::vsdual_pi(machine_config &config)
{
vsdual(config);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
// need high level of interleave to keep screens in sync in Balloon Fight.
// however vsmahjng doesn't like perfect interleave? you end up needing to reset it to boot? maybe something in a bad default state? watchdog?
// as the board would always be running in 'perfect interleave' the fact the Mahjong game doesn't work like this needs investigating.
diff --git a/src/mame/drivers/vtech2.cpp b/src/mame/drivers/vtech2.cpp
index 2bcc22a415a..c41a8bf9593 100644
--- a/src/mame/drivers/vtech2.cpp
+++ b/src/mame/drivers/vtech2.cpp
@@ -490,7 +490,7 @@ void vtech2_state::laser350(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &vtech2_state::mem_map);
m_maincpu->set_addrmap(AS_IO, &vtech2_state::io_map);
m_maincpu->set_vblank_int("screen", FUNC(vtech2_state::vtech2_interrupt));
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
ADDRESS_MAP_BANK(config, "banka").set_map(&vtech2_state::m_map350).set_options(ENDIANNESS_LITTLE, 8, 18, 0x4000);
ADDRESS_MAP_BANK(config, "bankb").set_map(&vtech2_state::m_map350).set_options(ENDIANNESS_LITTLE, 8, 18, 0x4000);
diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp
index 4fbc008f3f1..dbe6d36d98f 100644
--- a/src/mame/drivers/wangpc.cpp
+++ b/src/mame/drivers/wangpc.cpp
@@ -70,7 +70,7 @@ public:
m_centronics(*this, CENTRONICS_TAG),
m_cent_data_in(*this, "cent_data_in"),
m_cent_data_out(*this, "cent_data_out"),
- m_bus(*this, WANGPC_BUS_TAG),
+ m_bus(*this, "wangpcbus"),
m_sw(*this, "SW"),
m_led_diagnostic(*this, LED_DIAGNOSTIC),
m_timer2_irq(1),
@@ -1363,11 +1363,11 @@ void wangpc_state::wangpc(machine_config &config)
m_bus->drq2_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq2_w));
m_bus->drq3_wr_callback().set(m_dmac, FUNC(am9517a_device::dreq3_w));
m_bus->ioerror_wr_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
- WANGPC_BUS_SLOT(config, "slot1", wangpc_cards, nullptr, 1);
- WANGPC_BUS_SLOT(config, "slot2", wangpc_cards, "mvc", 2);
- WANGPC_BUS_SLOT(config, "slot3", wangpc_cards, nullptr, 3);
- WANGPC_BUS_SLOT(config, "slot4", wangpc_cards, nullptr, 4);
- WANGPC_BUS_SLOT(config, "slot5", wangpc_cards, nullptr, 5);
+ WANGPC_BUS_SLOT(config, "slot1", m_bus, wangpc_cards, nullptr, 1);
+ WANGPC_BUS_SLOT(config, "slot2", m_bus, wangpc_cards, "mvc", 2);
+ WANGPC_BUS_SLOT(config, "slot3", m_bus, wangpc_cards, nullptr, 3);
+ WANGPC_BUS_SLOT(config, "slot4", m_bus, wangpc_cards, nullptr, 4);
+ WANGPC_BUS_SLOT(config, "slot5", m_bus, wangpc_cards, nullptr, 5);
// internal ram
RAM(config, RAM_TAG).set_default_size("128K");
diff --git a/src/mame/drivers/wardner.cpp b/src/mame/drivers/wardner.cpp
index 860a012324d..95efd91bf72 100644
--- a/src/mame/drivers/wardner.cpp
+++ b/src/mame/drivers/wardner.cpp
@@ -398,7 +398,7 @@ void wardner_state::wardner(machine_config &config)
m_dsp->set_addrmap(AS_IO, &wardner_state::dsp_io_map);
m_dsp->bio().set(FUNC(wardner_state::twincobr_bio_r));
- config.m_minimum_quantum = attotime::from_hz(6000); /* 100 CPU slices per frame */
+ config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame */
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<2>().set(FUNC(wardner_state::int_enable_w));
diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp
index c15e1d40b32..1b2b5e46a53 100644
--- a/src/mame/drivers/wecleman.cpp
+++ b/src/mame/drivers/wecleman.cpp
@@ -1063,7 +1063,7 @@ void wecleman_state::wecleman(machine_config &config)
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &wecleman_state::wecleman_sound_map);
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_START_OVERRIDE(wecleman_state, wecleman)
MCFG_MACHINE_RESET_OVERRIDE(wecleman_state, wecleman)
@@ -1142,7 +1142,7 @@ void wecleman_state::hotchase(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &wecleman_state::hotchase_sound_map);
m_audiocpu->set_periodic_int(FUNC(wecleman_state::hotchase_sound_timer), attotime::from_hz(496));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
MCFG_MACHINE_RESET_OVERRIDE(wecleman_state, hotchase)
MCFG_MACHINE_START_OVERRIDE(wecleman_state, hotchase)
diff --git a/src/mame/drivers/wgp.cpp b/src/mame/drivers/wgp.cpp
index 6d849bc8f0d..18be11575c4 100644
--- a/src/mame/drivers/wgp.cpp
+++ b/src/mame/drivers/wgp.cpp
@@ -871,7 +871,7 @@ void wgp_state::wgp(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &wgp_state::cpu2_map);
m_subcpu->set_vblank_int("screen", FUNC(wgp_state::cpub_interrupt));
- config.m_minimum_quantum = attotime::from_hz(30000);
+ config.set_maximum_quantum(attotime::from_hz(30000));
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -925,7 +925,7 @@ void wgp_state::wgp2(machine_config &config)
{
wgp(config);
- config.m_minimum_quantum = attotime::from_hz(12000);
+ config.set_maximum_quantum(attotime::from_hz(12000));
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(wgp_state, wgp2)
diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp
index 8dfe7f1f130..560c0a889f1 100644
--- a/src/mame/drivers/wheelfir.cpp
+++ b/src/mame/drivers/wheelfir.cpp
@@ -740,7 +740,7 @@ void wheelfir_state::wheelfir(machine_config &config)
M68000(config, m_subcpu, 32000000/2);
m_subcpu->set_addrmap(AS_PROGRAM, &wheelfir_state::wheelfir_sub);
- //config.m_minimum_quantum = attotime::from_hz(12000);
+ //config.set_maximum_quantum(attotime::from_hz(12000));
adc0808_device &adc(ADC0808(config, "adc", 500000)); // unknown clock
adc.eoc_ff_callback().set(FUNC(wheelfir_state::adc_eoc_w));
diff --git a/src/mame/drivers/witch.cpp b/src/mame/drivers/witch.cpp
index 393f322e618..5d7478d21f8 100644
--- a/src/mame/drivers/witch.cpp
+++ b/src/mame/drivers/witch.cpp
@@ -939,7 +939,7 @@ void witch_state::witch(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &witch_state::witch_sub_map);
m_subcpu->set_vblank_int("screen", FUNC(witch_state::irq0_line_assert));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/wrally.cpp b/src/mame/drivers/wrally.cpp
index 2c11a2f5f86..810c7dc07ba 100644
--- a/src/mame/drivers/wrally.cpp
+++ b/src/mame/drivers/wrally.cpp
@@ -270,6 +270,7 @@ void wrally_state::wrally(machine_config &config)
gaelco_ds5002fp_device &ds5002(GAELCO_DS5002FP(config, "gaelco_ds5002fp", XTAL(24'000'000) / 2)); /* verified on pcb */
ds5002.set_addrmap(0, &wrally_state::mcu_hostmem_map);
+ config.set_perfect_quantum("gaelco_ds5002fp:mcu");
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp
index 8234e882520..af411c7fb78 100644
--- a/src/mame/drivers/wswan.cpp
+++ b/src/mame/drivers/wswan.cpp
@@ -141,7 +141,7 @@ void wswan_state::wswan(machine_config &config)
config.set_default_layout(layout_wswan);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
diff --git a/src/mame/drivers/wyvernf0.cpp b/src/mame/drivers/wyvernf0.cpp
index 9dcb260eb8f..772ad7fccbb 100644
--- a/src/mame/drivers/wyvernf0.cpp
+++ b/src/mame/drivers/wyvernf0.cpp
@@ -643,7 +643,7 @@ void wyvernf0_state::wyvernf0(machine_config &config)
TAITO68705_MCU(config, m_bmcu, 48_MHz_XTAL/16); // 3MHz - Clock verified
/* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp
index 01d2c56fe34..3d190dc1d5a 100644
--- a/src/mame/drivers/x68k.cpp
+++ b/src/mame/drivers/x68k.cpp
@@ -1625,7 +1625,7 @@ static void keyboard_devices(device_slot_interface &device)
void x68k_state::x68000_base(machine_config &config)
{
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
/* device hardware */
MC68901(config, m_mfpdev, 16_MHz_XTAL / 4);
diff --git a/src/mame/drivers/xain.cpp b/src/mame/drivers/xain.cpp
index 85cc2e224d2..8e569c4801d 100644
--- a/src/mame/drivers/xain.cpp
+++ b/src/mame/drivers/xain.cpp
@@ -487,7 +487,7 @@ void xain_state::xsleena(machine_config &config)
TAITO68705_MCU(config, m_mcu, MCU_CLOCK);
- config.m_perfect_cpu_quantum = subtag("maincpu");
+ config.set_perfect_quantum(m_maincpu);
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp
index 68f4ed0b716..8c72bbf94f3 100644
--- a/src/mame/drivers/xexex.cpp
+++ b/src/mame/drivers/xexex.cpp
@@ -481,7 +481,7 @@ void xexex_state::xexex(machine_config &config)
Z80(config, m_audiocpu, XTAL(32'000'000)/4); // Z80E 8Mhz
m_audiocpu->set_addrmap(AS_PROGRAM, &xexex_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(1920);
+ config.set_maximum_quantum(attotime::from_hz(1920));
EEPROM_ER5911_8BIT(config, "eeprom");
diff --git a/src/mame/drivers/xorworld.cpp b/src/mame/drivers/xorworld.cpp
index 83969a77bb2..d82992cd4ae 100644
--- a/src/mame/drivers/xorworld.cpp
+++ b/src/mame/drivers/xorworld.cpp
@@ -163,7 +163,7 @@ void xorworld_state::xorworld(machine_config &config)
m_maincpu->set_vblank_int("screen", FUNC(xorworld_state::irq2_line_assert)); // irq 4 or 6
m_maincpu->set_periodic_int(FUNC(xorworld_state::irq6_line_assert), attotime::from_hz(3*60)); //timed irq, unknown timing
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
EEPROM_93C46_16BIT(config, m_eeprom);
diff --git a/src/mame/drivers/xxmissio.cpp b/src/mame/drivers/xxmissio.cpp
index 5d54fc27d26..f55a213efa8 100644
--- a/src/mame/drivers/xxmissio.cpp
+++ b/src/mame/drivers/xxmissio.cpp
@@ -275,7 +275,7 @@ void xxmissio_state::xxmissio(machine_config &config)
m_subcpu->set_addrmap(AS_PROGRAM, &xxmissio_state::map2);
m_subcpu->set_periodic_int(FUNC(xxmissio_state::interrupt_s), attotime::from_hz(2*60));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/z100.cpp b/src/mame/drivers/z100.cpp
index af25f34942e..1236ef20407 100644
--- a/src/mame/drivers/z100.cpp
+++ b/src/mame/drivers/z100.cpp
@@ -852,8 +852,8 @@ void z100_state::z100(machine_config &config)
FLOPPY_CONNECTOR(config, m_floppies[0], z100_floppies, "dd", floppy_image_device::default_floppy_formats);
FLOPPY_CONNECTOR(config, m_floppies[1], z100_floppies, "dd", floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppies[2], z100_floppies, "", floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, m_floppies[3], z100_floppies, "", floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppies[2], z100_floppies, nullptr, floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, m_floppies[3], z100_floppies, nullptr, floppy_image_device::default_floppy_formats);
MC2661(config, m_epci[0], 4.9152_MHz_XTAL); // First 2661-2 serial port (printer)
m_epci[0]->txrdy_handler().set("epci0int", FUNC(input_merger_device::in_w<0>));
diff --git a/src/mame/drivers/zaccaria.cpp b/src/mame/drivers/zaccaria.cpp
index 56d50686bc4..4fd27e18d8d 100644
--- a/src/mame/drivers/zaccaria.cpp
+++ b/src/mame/drivers/zaccaria.cpp
@@ -336,7 +336,7 @@ void zaccaria_state::zaccaria(machine_config &config)
Z80(config, m_maincpu, XTAL(18'432'000)/6); /* verified on pcb */
m_maincpu->set_addrmap(AS_PROGRAM, &zaccaria_state::main_map);
-// config.m_minimum_quantum = attotime::from_hz(1000000);
+// config.set_maximum_quantum(attotime::from_hz(1000000));
WATCHDOG_TIMER(config, "watchdog");
diff --git a/src/mame/drivers/zerozone.cpp b/src/mame/drivers/zerozone.cpp
index 28f87efbf60..dc6358684ad 100644
--- a/src/mame/drivers/zerozone.cpp
+++ b/src/mame/drivers/zerozone.cpp
@@ -187,7 +187,7 @@ void zerozone_state::zerozone(machine_config &config)
Z80(config, m_audiocpu, 1000000); /* 1 MHz ??? */
m_audiocpu->set_addrmap(AS_PROGRAM, &zerozone_state::sound_map);
- config.m_minimum_quantum = attotime::from_hz(600);
+ config.set_maximum_quantum(attotime::from_hz(600));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp
index e13afe82cac..8ac1db8e4f7 100644
--- a/src/mame/drivers/zn.cpp
+++ b/src/mame/drivers/zn.cpp
@@ -2721,7 +2721,7 @@ void zn_state::coh1002msnd(machine_config &config)
IDT7202(config, m_cbaj_fifo[0]); // LH540202
IDT7202(config, m_cbaj_fifo[1]); // "
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
/* sound hardware */
ymz280b_device &ymz(YMZ280B(config, "ymz", XTAL(16'934'400)));
diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp
index be176b00fb5..fe195392abe 100644
--- a/src/mame/drivers/zr107.cpp
+++ b/src/mame/drivers/zr107.cpp
@@ -809,7 +809,7 @@ void midnrun_state::midnrun(machine_config &config)
zr107(config);
m_maincpu->set_addrmap(AS_PROGRAM, &midnrun_state::main_memmap);
- config.m_minimum_quantum = attotime::from_hz(750000); // Very high sync needed to prevent lockups - why?
+ config.set_maximum_quantum(attotime::from_hz(750000)); // Very high sync needed to prevent lockups - why?
/* video hardware */
m_screen->set_screen_update(FUNC(midnrun_state::screen_update));
@@ -825,7 +825,7 @@ void jetwave_state::jetwave(machine_config &config)
zr107(config);
m_maincpu->set_addrmap(AS_PROGRAM, &jetwave_state::main_memmap);
- config.m_minimum_quantum = attotime::from_hz(2000000); // Very high sync needed to prevent lockups - why?
+ config.set_maximum_quantum(attotime::from_hz(2000000)); // Very high sync needed to prevent lockups - why?
/* video hardware */
m_screen->set_screen_update(FUNC(jetwave_state::screen_update));
diff --git a/src/mame/includes/adam.h b/src/mame/includes/adam.h
index 641f62705ea..2c6cb6a39b5 100644
--- a/src/mame/includes/adam.h
+++ b/src/mame/includes/adam.h
@@ -34,7 +34,7 @@ public:
m_vdc(*this, TMS9928A_TAG),
m_psg(*this, SN76489A_TAG),
m_ram(*this, RAM_TAG),
- m_adamnet(*this, ADAMNET_TAG),
+ m_adamnet(*this, "adamnet"),
m_slot1(*this, ADAM_LEFT_EXPANSION_SLOT_TAG),
m_slot2(*this, ADAM_CENTER_EXPANSION_SLOT_TAG),
m_slot3(*this, ADAM_RIGHT_EXPANSION_SLOT_TAG),
diff --git a/src/mame/includes/kc.h b/src/mame/includes/kc.h
index dc9469a6b7c..ef046ffff51 100644
--- a/src/mame/includes/kc.h
+++ b/src/mame/includes/kc.h
@@ -156,6 +156,8 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(kc_scanline);
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb);
+ void kc85_slots(machine_config &config);
+
void kc85_3(machine_config &config);
void kc85_3_io(address_map &map);
void kc85_3_mem(address_map &map);
diff --git a/src/mame/includes/prof80.h b/src/mame/includes/prof80.h
index c62706b051f..a5a35457325 100644
--- a/src/mame/includes/prof80.h
+++ b/src/mame/includes/prof80.h
@@ -40,7 +40,7 @@ public:
, m_fdc(*this, UPD765_TAG)
, m_ram(*this, RAM_TAG)
, m_floppy(*this, UPD765_TAG":%u", 0U)
- , m_ecb(*this, ECBBUS_TAG)
+ , m_ecb(*this, "ecbbus")
, m_rs232a(*this, "rs232a")
, m_rs232b(*this, "rs232b")
, m_flra(*this, "z44")
diff --git a/src/mame/includes/tiki100.h b/src/mame/includes/tiki100.h
index 22ecaee488f..802f8a3bbd4 100644
--- a/src/mame/includes/tiki100.h
+++ b/src/mame/includes/tiki100.h
@@ -57,7 +57,7 @@ public:
m_floppy1(*this, FD1797_TAG":1"),
m_cassette(*this, CASSETTE_TAG),
m_centronics(*this, CENTRONICS_TAG),
- m_exp(*this, TIKI100_BUS_TAG),
+ m_exp(*this, "tiki100bus"),
m_rom(*this, Z80_TAG),
m_prom(*this, "u4"),
m_video_ram(*this, "video_ram"),
diff --git a/src/mame/includes/tmc600.h b/src/mame/includes/tmc600.h
index 00cae978df1..62aa7ee3887 100644
--- a/src/mame/includes/tmc600.h
+++ b/src/mame/includes/tmc600.h
@@ -37,7 +37,7 @@ public:
m_bwio(*this, CDP1852_KB_TAG),
m_cassette(*this, "cassette"),
m_centronics(*this, "centronics"),
- m_bus(*this, TMC600_EURO_BUS_TAG),
+ m_bus(*this, "bus"),
m_ram(*this, RAM_TAG),
m_char_rom(*this, "chargen"),
m_page_ram(*this, "page_ram"),
@@ -55,7 +55,7 @@ private:
required_device<cdp1852_device> m_bwio;
required_device<cassette_image_device> m_cassette;
required_device<centronics_device> m_centronics;
- required_device<tmc600_euro_bus_slot_t> m_bus;
+ required_device<tmc600_eurobus_slot_device> m_bus;
required_device<ram_device> m_ram;
required_region_ptr<uint8_t> m_char_rom;
required_shared_ptr<uint8_t> m_page_ram;
diff --git a/src/mame/includes/vidbrain.h b/src/mame/includes/vidbrain.h
index 4ebe2007b61..cd53edd792d 100644
--- a/src/mame/includes/vidbrain.h
+++ b/src/mame/includes/vidbrain.h
@@ -27,7 +27,7 @@ public:
m_smi(*this, F3853_TAG),
m_uv(*this, UV201_TAG),
m_dac(*this, "dac"),
- m_exp(*this, VIDEOBRAIN_EXPANSION_SLOT_TAG),
+ m_exp(*this, "exp"),
m_io(*this, "IO%02u", 0),
m_uv201_31(*this, "UV201-31"),
m_joy_r(*this, "JOY-R"),
diff --git a/src/mame/includes/xbox_pci.h b/src/mame/includes/xbox_pci.h
index 93d0934aaa7..74f8045fb7c 100644
--- a/src/mame/includes/xbox_pci.h
+++ b/src/mame/includes/xbox_pci.h
@@ -198,7 +198,7 @@ class mcpx_ohci_device : public pci_device {
public:
mcpx_ohci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_hack_callback(std::function<void(void)> hack) { hack_callback = hack; }
- void plug_usb_device(int port, ohci_function *function);
+ void plug_usb_device(int port, device_usb_ohci_function_interface *function);
auto interrupt_handler() { return m_interrupt_handler.bind(); }
@@ -219,7 +219,7 @@ private:
std::function<void(void)> hack_callback;
void ohci_mmio(address_map &map);
struct dev_t {
- ohci_function *dev;
+ device_usb_ohci_function_interface *dev;
int port;
} connecteds[4];
int connecteds_count;
diff --git a/src/mame/includes/xbox_usb.h b/src/mame/includes/xbox_usb.h
index e36fb94bb9f..1e363823a0a 100644
--- a/src/mame/includes/xbox_usb.h
+++ b/src/mame/includes/xbox_usb.h
@@ -328,7 +328,7 @@ struct usb_device_interfac
{
uint8_t *position;
int size;
- std::forward_list<usb_device_interfac_alternate *> alternate_settings;
+ std::forward_list<usb_device_interfac_alternate> alternate_settings;
int selected_alternate;
};
@@ -337,21 +337,21 @@ struct usb_device_configuration
USBStandardConfigurationDescriptor configuration_descriptor;
uint8_t *position;
int size;
- std::forward_list<usb_device_interfac *> interfaces;
+ std::forward_list<usb_device_interfac> interfaces;
};
/*
* OHCI Usb Controller
*/
-class ohci_function; // forward declaration
+class device_usb_ohci_function_interface; // forward declaration
class ohci_usb_controller
{
public:
ohci_usb_controller();
~ohci_usb_controller() {}
- void usb_ohci_plug(int port, ohci_function *function);
+ void usb_ohci_plug(int port, device_usb_ohci_function_interface *function);
void usb_ohci_device_address_changed(int old_address, int new_address);
void set_cpu(cpu_device *cpu) { m_maincpu = cpu; }
void set_timer(emu_timer *timer) { ohcist.timer = timer; }
@@ -377,13 +377,13 @@ private:
struct {
uint32_t hc_regs[256];
struct {
- ohci_function *function;
+ device_usb_ohci_function_interface *function;
int address;
int delay;
} ports[4 + 1];
struct
{
- ohci_function *function;
+ device_usb_ohci_function_interface *function;
int port;
} address[256];
emu_timer *timer;
@@ -405,26 +405,26 @@ private:
* Base class for usb devices
*/
-class ohci_function {
+class device_usb_ohci_function_interface : public device_interface {
public:
- ohci_function();
- virtual void initialize(running_machine &machine);
+ virtual void initialize();
virtual void execute_reset();
- virtual void execute_connect() {};
- virtual void execute_disconnect() {};
+ virtual void execute_connect() {}
+ virtual void execute_disconnect() {}
void set_bus_manager(ohci_usb_controller *usb_bus_manager);
int execute_transfer(int endpoint, int pid, uint8_t *buffer, int size);
protected:
- virtual int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) { return -1; };
- virtual int handle_get_status_request(int endpoint, USBSetupPacket *setup) { return 0; };
- virtual int handle_clear_feature_request(int endpoint, USBSetupPacket *setup) { return 0; };
- virtual int handle_set_feature_request(int endpoint, USBSetupPacket *setup) { return 0; };
- virtual int handle_set_descriptor_request(int endpoint, USBSetupPacket *setup) { return 0; };
- virtual int handle_synch_frame_request(int endpoint, USBSetupPacket *setup) { return 0; };
- virtual void handle_status_stage(int endpoint) { return; };
- virtual int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; };
- virtual int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; };
- virtual int handle_isochronous_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; };
+ device_usb_ohci_function_interface(const machine_config &config, device_t &device);
+ virtual int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) { return -1; }
+ virtual int handle_get_status_request(int endpoint, USBSetupPacket *setup) { return 0; }
+ virtual int handle_clear_feature_request(int endpoint, USBSetupPacket *setup) { return 0; }
+ virtual int handle_set_feature_request(int endpoint, USBSetupPacket *setup) { return 0; }
+ virtual int handle_set_descriptor_request(int endpoint, USBSetupPacket *setup) { return 0; }
+ virtual int handle_synch_frame_request(int endpoint, USBSetupPacket *setup) { return 0; }
+ virtual void handle_status_stage(int endpoint) { return; }
+ virtual int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }
+ virtual int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }
+ virtual int handle_isochronous_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }
void add_device_descriptor(const USBStandardDeviceDescriptor &descriptor);
void add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor);
@@ -452,12 +452,12 @@ protected:
int newaddress;
int address;
int configurationvalue;
- uint8_t *descriptors;
+ std::unique_ptr<uint8_t []> descriptors;
int descriptors_pos;
bool wantstatuscallback;
USBStandardDeviceDescriptor device_descriptor;
- std::forward_list<usb_device_configuration *> configurations;
- std::forward_list<usb_device_string *> device_strings;
+ std::forward_list<usb_device_configuration> configurations;
+ std::forward_list<usb_device_string> device_strings;
usb_device_configuration *latest_configuration;
usb_device_interfac_alternate *latest_alternate;
usb_device_configuration *selected_configuration;
@@ -467,7 +467,7 @@ protected:
* Usb port connector
*/
-class ohci_usb_connector : public device_t, public device_slot_interface
+class ohci_usb_connector : public device_t, public device_single_card_slot_interface<device_usb_ohci_function_interface>
{
public:
template <typename T>
@@ -483,8 +483,6 @@ public:
ohci_usb_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~ohci_usb_connector();
- ohci_function *get_device();
-
protected:
virtual void device_start() override;
};
@@ -497,11 +495,11 @@ DECLARE_DEVICE_TYPE(OHCI_USB_CONNECTOR, ohci_usb_connector)
DECLARE_DEVICE_TYPE(OHCI_GAME_CONTROLLER, ohci_game_controller_device)
-class ohci_game_controller_device : public device_t, public ohci_function, public device_slot_card_interface
+class ohci_game_controller_device : public device_t, public device_usb_ohci_function_interface
{
public:
ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void initialize(running_machine &machine) override;
+ void initialize() override;
int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override;
int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) override;
diff --git a/src/mame/machine/gaelco_ds5002fp.cpp b/src/mame/machine/gaelco_ds5002fp.cpp
index 36f0aab9b11..e7ad699f87b 100644
--- a/src/mame/machine/gaelco_ds5002fp.cpp
+++ b/src/mame/machine/gaelco_ds5002fp.cpp
@@ -44,8 +44,6 @@ void gaelco_ds5002fp_device::device_add_mconfig(machine_config &config)
mcu.set_addrmap(AS_PROGRAM, &gaelco_ds5002fp_device::dallas_rom);
mcu.set_addrmap(AS_IO, &gaelco_ds5002fp_device::dallas_ram);
- config.m_perfect_cpu_quantum = subtag("mcu");
-
NVRAM(config, "sram", nvram_device::DEFAULT_ALL_0);
}
diff --git a/src/mame/machine/imds2ioc.cpp b/src/mame/machine/imds2ioc.cpp
index f74f6c5ab60..63fef276e77 100644
--- a/src/mame/machine/imds2ioc.cpp
+++ b/src/mame/machine/imds2ioc.cpp
@@ -568,7 +568,7 @@ void imds2ioc_device::device_add_mconfig(machine_config &config)
I8080A(config, m_ioccpu, IOC_XTAL_Y2 / 18); // 2.448 MHz but running at 50% (due to wait states & DMA usage of bus)
m_ioccpu->set_addrmap(AS_PROGRAM, &imds2ioc_device::mem_map);
m_ioccpu->set_addrmap(AS_IO, &imds2ioc_device::io_map);
- config.m_minimum_quantum = attotime::from_hz(100);
+ config.set_maximum_quantum(attotime::from_hz(100));
// The IOC CRT hw is a bit complex, as the character clock (CCLK) to i8275
// is varied according to the part of the video frame being scanned and according to
diff --git a/src/mame/machine/k573cass.cpp b/src/mame/machine/k573cass.cpp
index 7991d46cf15..2d1a26d77eb 100644
--- a/src/mame/machine/k573cass.cpp
+++ b/src/mame/machine/k573cass.cpp
@@ -11,7 +11,7 @@
// class konami573_cassette_interface
konami573_cassette_interface::konami573_cassette_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "k573cass")
{
m_slot = dynamic_cast<konami573_cassette_slot_device *>(device.owner());
}
@@ -78,7 +78,7 @@ konami573_cassette_x_device::konami573_cassette_x_device(const machine_config &m
void konami573_cassette_x_device::device_add_mconfig(machine_config &config)
{
- X76F041( config, m_x76f041 );
+ X76F041(config, m_x76f041);
}
void konami573_cassette_x_device::device_start()
@@ -88,22 +88,22 @@ void konami573_cassette_x_device::device_start()
WRITE_LINE_MEMBER(konami573_cassette_x_device::write_line_d0)
{
- m_x76f041->write_sda( state );
+ m_x76f041->write_sda(state);
}
WRITE_LINE_MEMBER(konami573_cassette_x_device::write_line_d1)
{
- m_x76f041->write_scl( state );
+ m_x76f041->write_scl(state);
}
WRITE_LINE_MEMBER(konami573_cassette_x_device::write_line_d2)
{
- m_x76f041->write_cs( state );
+ m_x76f041->write_cs(state);
}
WRITE_LINE_MEMBER(konami573_cassette_x_device::write_line_d3)
{
- m_x76f041->write_rst( state );
+ m_x76f041->write_rst(state);
}
READ_LINE_MEMBER(konami573_cassette_x_device::read_line_secflash_sda)
@@ -123,33 +123,33 @@ konami573_cassette_xi_device::konami573_cassette_xi_device(const machine_config
void konami573_cassette_xi_device::device_add_mconfig(machine_config &config)
{
- X76F041( config, m_x76f041 );
- DS2401( config, m_ds2401 );
- ADC0838( config, m_adc0838 );
+ X76F041(config, m_x76f041);
+ DS2401(config, m_ds2401);
+ ADC0838(config, m_adc0838);
}
WRITE_LINE_MEMBER(konami573_cassette_xi_device::write_line_d0)
{
konami573_cassette_x_device::write_line_d0( state ); // shares line with x76f041 sda
- m_adc0838->cs_write( state );
+ m_adc0838->cs_write(state);
}
WRITE_LINE_MEMBER(konami573_cassette_xi_device::write_line_d1)
{
- konami573_cassette_x_device::write_line_d1( state ); // shares line with x76f041 scl
+ konami573_cassette_x_device::write_line_d1(state); // shares line with x76f041 scl
- m_adc0838->clk_write( state );
+ m_adc0838->clk_write(state);
}
WRITE_LINE_MEMBER(konami573_cassette_xi_device::write_line_d4)
{
- m_ds2401->write( !state );
+ m_ds2401->write(!state);
}
WRITE_LINE_MEMBER(konami573_cassette_xi_device::write_line_d5)
{
- m_adc0838->di_write( state );
+ m_adc0838->di_write(state);
}
READ_LINE_MEMBER(konami573_cassette_xi_device::read_line_ds2401)
@@ -192,7 +192,7 @@ konami573_cassette_y_device::konami573_cassette_y_device(const machine_config &m
void konami573_cassette_y_device::device_add_mconfig(machine_config &config)
{
- X76F100( config, m_x76f100 );
+ X76F100(config, m_x76f100);
}
void konami573_cassette_y_device::device_start()
@@ -216,46 +216,46 @@ READ_LINE_MEMBER(konami573_cassette_y_device::read_line_secflash_sda)
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d0)
{
- m_d0_handler( state );
- m_x76f100->write_sda( state );
+ m_d0_handler(state);
+ m_x76f100->write_sda(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d1)
{
- m_d1_handler( state );
- m_x76f100->write_scl( state );
+ m_d1_handler(state);
+ m_x76f100->write_scl(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d2)
{
- m_d2_handler( state );
- m_x76f100->write_cs( state );
+ m_d2_handler(state);
+ m_x76f100->write_cs(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d3)
{
- m_d3_handler( state );
- m_x76f100->write_rst( state );
+ m_d3_handler(state);
+ m_x76f100->write_rst(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d4)
{
- m_d4_handler( state );
+ m_d4_handler(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d5)
{
- m_d5_handler( state );
+ m_d5_handler(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d6)
{
- m_d6_handler( state );
+ m_d6_handler(state);
}
WRITE_LINE_MEMBER(konami573_cassette_y_device::write_line_d7)
{
- m_d7_handler( state );
+ m_d7_handler(state);
}
@@ -269,15 +269,15 @@ konami573_cassette_yi_device::konami573_cassette_yi_device(const machine_config
void konami573_cassette_yi_device::device_add_mconfig(machine_config &config)
{
- X76F100( config, m_x76f100 );
- DS2401( config, m_ds2401 );
+ X76F100(config, m_x76f100);
+ DS2401(config, m_ds2401);
}
WRITE_LINE_MEMBER(konami573_cassette_yi_device::write_line_d4)
{
- konami573_cassette_y_device::write_line_d4( state );
+ konami573_cassette_y_device::write_line_d4(state);
- m_ds2401->write( !state );
+ m_ds2401->write(!state);
}
READ_LINE_MEMBER(konami573_cassette_yi_device::read_line_ds2401)
@@ -298,8 +298,8 @@ konami573_cassette_zi_device::konami573_cassette_zi_device(const machine_config
void konami573_cassette_zi_device::device_add_mconfig(machine_config &config)
{
- DS2401( config, m_ds2401 );
- ZS01( config, m_zs01 ).set_ds2401_tag( "id" );
+ DS2401(config, m_ds2401);
+ ZS01(config, m_zs01).set_ds2401_tag(m_ds2401);
}
void konami573_cassette_zi_device::device_start()
@@ -309,27 +309,27 @@ void konami573_cassette_zi_device::device_start()
WRITE_LINE_MEMBER(konami573_cassette_zi_device::write_line_d1)
{
- m_zs01->write_scl( state );
+ m_zs01->write_scl(state);
}
WRITE_LINE_MEMBER(konami573_cassette_zi_device::write_line_d2)
{
- m_zs01->write_cs( state );
+ m_zs01->write_cs(state);
}
WRITE_LINE_MEMBER(konami573_cassette_zi_device::write_line_d3)
{
- m_zs01->write_rst( state );
+ m_zs01->write_rst(state);
}
WRITE_LINE_MEMBER(konami573_cassette_zi_device::write_line_d4)
{
- m_ds2401->write( !state );
+ m_ds2401->write(!state);
}
WRITE_LINE_MEMBER(konami573_cassette_zi_device::write_line_zs01_sda)
{
- m_zs01->write_sda( state );
+ m_zs01->write_sda(state);
}
READ_LINE_MEMBER(konami573_cassette_zi_device::read_line_ds2401)
@@ -347,7 +347,7 @@ DEFINE_DEVICE_TYPE(KONAMI573_CASSETTE_SLOT, konami573_cassette_slot_device, "k57
konami573_cassette_slot_device::konami573_cassette_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, KONAMI573_CASSETTE_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<konami573_cassette_interface>(mconfig, *this),
m_dsr_handler(*this)
{
}
@@ -356,117 +356,91 @@ void konami573_cassette_slot_device::device_start()
{
m_dsr_handler.resolve_safe();
- m_dev = dynamic_cast<konami573_cassette_interface *>(get_card_device());
+ m_dev = get_card_device();
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d0)
{
- if( m_dev )
- {
- m_dev->write_line_d0( state );
- }
+ if (m_dev)
+ m_dev->write_line_d0(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d1)
{
- if( m_dev )
- {
- m_dev->write_line_d1( state );
- }
+ if (m_dev)
+ m_dev->write_line_d1(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d2)
{
- if( m_dev )
- {
- m_dev->write_line_d2( state );
- }
+ if (m_dev)
+ m_dev->write_line_d2(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d3)
{
- if( m_dev )
- {
- m_dev->write_line_d3( state );
- }
+ if (m_dev)
+ m_dev->write_line_d3(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d4)
{
- if( m_dev )
- {
- m_dev->write_line_d4( state );
- }
+ if (m_dev)
+ m_dev->write_line_d4(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d5)
{
- if( m_dev )
- {
- m_dev->write_line_d5( state );
- }
+ if (m_dev)
+ m_dev->write_line_d5(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d6)
{
- if( m_dev )
- {
- m_dev->write_line_d6( state );
- }
+ if (m_dev)
+ m_dev->write_line_d6(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_d7)
{
- if( m_dev )
- {
- m_dev->write_line_d7( state );
- }
+ if (m_dev)
+ m_dev->write_line_d7(state);
}
WRITE_LINE_MEMBER(konami573_cassette_slot_device::write_line_zs01_sda)
{
- if( m_dev )
- {
- m_dev->write_line_zs01_sda( state );
- }
+ if (m_dev)
+ m_dev->write_line_zs01_sda(state);
}
READ_LINE_MEMBER(konami573_cassette_slot_device::read_line_ds2401)
{
- if( m_dev )
- {
+ if (m_dev)
return m_dev->read_line_ds2401();
- }
-
- return 0;
+ else
+ return 0;
}
READ_LINE_MEMBER(konami573_cassette_slot_device::read_line_secflash_sda)
{
- if( m_dev )
- {
+ if (m_dev)
return m_dev->read_line_secflash_sda();
- }
-
- return 0;
+ else
+ return 0;
}
READ_LINE_MEMBER(konami573_cassette_slot_device::read_line_adc083x_do)
{
- if( m_dev )
- {
+ if (m_dev)
return m_dev->read_line_adc083x_do();
- }
-
- return 0;
+ else
+ return 0;
}
READ_LINE_MEMBER(konami573_cassette_slot_device::read_line_adc083x_sars)
{
- if( m_dev )
- {
+ if (m_dev)
return m_dev->read_line_adc083x_sars();
- }
-
- return 0;
+ else
+ return 0;
}
diff --git a/src/mame/machine/k573cass.h b/src/mame/machine/k573cass.h
index 30423d5464f..10e756b5922 100644
--- a/src/mame/machine/k573cass.h
+++ b/src/mame/machine/k573cass.h
@@ -21,8 +21,7 @@ DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_SLOT, konami573_cassette_slot_device)
class konami573_cassette_interface;
-class konami573_cassette_slot_device : public device_t,
- public device_slot_interface
+class konami573_cassette_slot_device : public device_t, public device_single_card_slot_interface<konami573_cassette_interface>
{
friend class konami573_cassette_interface;
@@ -54,7 +53,7 @@ private:
konami573_cassette_interface *m_dev;
};
-class konami573_cassette_interface : public device_slot_card_interface
+class konami573_cassette_interface : public device_interface
{
friend class konami573_cassette_slot_device;
@@ -86,8 +85,7 @@ protected:
DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_X, konami573_cassette_x_device)
-class konami573_cassette_x_device: public device_t,
- public konami573_cassette_interface
+class konami573_cassette_x_device: public device_t, public konami573_cassette_interface
{
public:
konami573_cassette_x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -137,8 +135,7 @@ private:
DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_Y, konami573_cassette_y_device)
-class konami573_cassette_y_device: public device_t,
- public konami573_cassette_interface
+class konami573_cassette_y_device: public device_t, public konami573_cassette_interface
{
public:
konami573_cassette_y_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -203,8 +200,7 @@ private:
DECLARE_DEVICE_TYPE(KONAMI573_CASSETTE_ZI, konami573_cassette_zi_device)
-class konami573_cassette_zi_device: public device_t,
- public konami573_cassette_interface
+class konami573_cassette_zi_device: public device_t, public konami573_cassette_interface
{
public:
konami573_cassette_zi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 42072ec8c63..5e92722e481 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -1683,7 +1683,7 @@ const rom_entry *sega_32x_device::device_rom_region() const
// some games appear to dislike 'perfect' levels of interleave, probably due to
// non-emulated cache, ram waitstates and other issues?
#define _32X_INTERLEAVE_LEVEL \
- config.m_minimum_quantum = attotime::from_hz(1800000);
+ config.set_maximum_quantum(attotime::from_hz(1800000));
void sega_32x_device::device_add_mconfig(machine_config &config)
{
diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp
index f9d446cd1eb..8663d430914 100644
--- a/src/mame/machine/megacd.cpp
+++ b/src/mame/machine/megacd.cpp
@@ -320,8 +320,6 @@ void sega_segacd_device::device_add_mconfig(machine_config &config)
m_rfsnd->set_addrmap(0, &sega_segacd_device::segacd_pcm_map);
NVRAM(config, "backupram", nvram_device::DEFAULT_ALL_0);
-
- config.m_perfect_cpu_quantum = subtag("segacd_68k"); // perfect sync to the fastest cpu
}
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index 31e88041bcb..3f3a364b848 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -856,7 +856,7 @@ void xbox_base_state::xbox_base(machine_config &config)
PENTIUM3(config, m_maincpu, 733333333); /* Wrong! family 6 model 8 stepping 10 */
m_maincpu->set_irq_acknowledge_callback(FUNC(xbox_base_state::irq_callback));
- config.m_minimum_quantum = attotime::from_hz(6000);
+ config.set_maximum_quantum(attotime::from_hz(6000));
PCI_ROOT(config, ":pci", 0);
NV2A_HOST(config, ":pci:00.0", 0, m_maincpu);
diff --git a/src/mame/machine/xbox_pci.cpp b/src/mame/machine/xbox_pci.cpp
index b721162951e..876d593f0e9 100644
--- a/src/mame/machine/xbox_pci.cpp
+++ b/src/mame/machine/xbox_pci.cpp
@@ -586,7 +586,7 @@ mcpx_ohci_device::mcpx_ohci_device(const machine_config &mconfig, const char *ta
set_ids(0x10de01c2, 0, 0, 0);
}
-void mcpx_ohci_device::plug_usb_device(int port, ohci_function *function)
+void mcpx_ohci_device::plug_usb_device(int port, device_usb_ohci_function_interface *function)
{
function->set_bus_manager(ohci_usb);
ohci_usb->usb_ohci_plug(port, function);
@@ -631,7 +631,7 @@ void mcpx_ohci_device::device_config_complete()
ohci_usb_connector *conn = downcast<ohci_usb_connector *>(subdevice(id));
if (conn)
{
- ohci_function *func = conn->get_device();
+ device_usb_ohci_function_interface *func = conn->get_card_device();
if (func)
{
connecteds[connecteds_count].dev = func;
diff --git a/src/mame/machine/xbox_usb.cpp b/src/mame/machine/xbox_usb.cpp
index 88c49ea22ce..995c3acc0f9 100644
--- a/src/mame/machine/xbox_usb.cpp
+++ b/src/mame/machine/xbox_usb.cpp
@@ -706,7 +706,7 @@ void ohci_usb_controller::timer(emu_timer &timer, device_timer_id id, int param,
usb_ohci_interrupts();
}
-void ohci_usb_controller::usb_ohci_plug(int port, ohci_function *function)
+void ohci_usb_controller::usb_ohci_plug(int port, device_usb_ohci_function_interface *function)
{
if ((port > 0) && (port <= 4)) {
ohcist.ports[port].function = function;
@@ -853,14 +853,15 @@ void ohci_usb_controller::usb_ohci_device_address_changed(int old_address, int n
* Base class for usb devices
*/
-ohci_function::ohci_function()
+device_usb_ohci_function_interface::device_usb_ohci_function_interface(machine_config const &mconfig, device_t &device)
+ : device_interface(device, "usbohci")
{
}
-void ohci_function::initialize(running_machine &machine)
+void device_usb_ohci_function_interface::initialize()
{
state = DefaultState;
- descriptors = auto_alloc_array(machine, uint8_t, 1024);
+ descriptors = std::make_unique<uint8_t []>(1024);
descriptors_pos = 0;
address = 0;
newaddress = 0;
@@ -881,16 +882,15 @@ void ohci_function::initialize(running_machine &machine)
latest_alternate = nullptr;
}
-void ohci_function::set_bus_manager(ohci_usb_controller *usb_bus_manager)
+void device_usb_ohci_function_interface::set_bus_manager(ohci_usb_controller *usb_bus_manager)
{
busmanager = usb_bus_manager;
}
-void ohci_function::add_device_descriptor(const USBStandardDeviceDescriptor &descriptor)
+void device_usb_ohci_function_interface::add_device_descriptor(const USBStandardDeviceDescriptor &descriptor)
{
- uint8_t *p = descriptors + descriptors_pos;
-
+ uint8_t *const p = &descriptors[descriptors_pos];
p[0] = descriptor.bLength;
p[1] = descriptor.bDescriptorType;
p[2] = descriptor.bcdUSB & 255;
@@ -913,11 +913,9 @@ void ohci_function::add_device_descriptor(const USBStandardDeviceDescriptor &des
memcpy(&device_descriptor, &descriptor, sizeof(USBStandardDeviceDescriptor));
}
-void ohci_function::add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor)
+void device_usb_ohci_function_interface::add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor)
{
- usb_device_configuration *c = new usb_device_configuration;
- uint8_t *p = descriptors + descriptors_pos;
-
+ uint8_t *const p = &descriptors[descriptors_pos];
p[0] = descriptor.bLength;
p[1] = descriptor.bDescriptorType;
p[2] = descriptor.wTotalLength & 255;
@@ -927,23 +925,23 @@ void ohci_function::add_configuration_descriptor(const USBStandardConfigurationD
p[6] = descriptor.iConfiguration;
p[7] = descriptor.bmAttributes;
p[8] = descriptor.MaxPower;
- c->position = p;
- c->size = descriptor.bLength;
descriptors_pos += descriptor.bLength;
- memcpy(&c->configuration_descriptor, &descriptor, sizeof(USBStandardConfigurationDescriptor));
- configurations.push_front(c);
- latest_configuration = c;
+
+ configurations.emplace_front();
+ usb_device_configuration &c(configurations.front());
+ c.position = p;
+ c.size = descriptor.bLength;
+ memcpy(&c.configuration_descriptor, &descriptor, sizeof(USBStandardConfigurationDescriptor));
+ latest_configuration = &c;
latest_alternate = nullptr;
}
-void ohci_function::add_interface_descriptor(const USBStandardInterfaceDescriptor &descriptor)
+void device_usb_ohci_function_interface::add_interface_descriptor(const USBStandardInterfaceDescriptor &descriptor)
{
- usb_device_interfac *ii;
- usb_device_interfac_alternate *aa;
- uint8_t *p = descriptors + descriptors_pos;
-
if (latest_configuration == nullptr)
return;
+
+ uint8_t *const p = &descriptors[descriptors_pos];
p[0] = descriptor.bLength;
p[1] = descriptor.bDescriptorType;
p[2] = descriptor.bInterfaceNumber;
@@ -955,40 +953,44 @@ void ohci_function::add_interface_descriptor(const USBStandardInterfaceDescripto
p[8] = descriptor.iInterface;
descriptors_pos += descriptor.bLength;
latest_configuration->size += descriptor.bLength;
- for (auto i = latest_configuration->interfaces.begin(); i != latest_configuration->interfaces.end(); ++i)
+
+ for (auto &i : latest_configuration->interfaces)
{
- if ((*i)->alternate_settings.front()->interface_descriptor.bInterfaceNumber == descriptor.bInterfaceNumber)
+ if (i.alternate_settings.front().interface_descriptor.bInterfaceNumber == descriptor.bInterfaceNumber)
{
- (*i)->size += descriptor.bLength;
- latest_configuration->interfaces.front()->size += descriptor.bLength;
- aa = new usb_device_interfac_alternate;
- memcpy(&aa->interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
- aa->position = p;
- aa->size = descriptor.bLength;
- (*i)->alternate_settings.push_front(aa);
- latest_alternate = aa;
+ i.size += descriptor.bLength;
+ latest_configuration->interfaces.front().size += descriptor.bLength;
+
+ i.alternate_settings.emplace_front();
+ usb_device_interfac_alternate &aa(i.alternate_settings.front());
+ memcpy(&aa.interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
+ aa.position = p;
+ aa.size = descriptor.bLength;
+ latest_alternate = &aa;
return;
}
}
- ii = new usb_device_interfac;
- aa = new usb_device_interfac_alternate;
- memcpy(&aa->interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
- aa->position = p;
- aa->size = descriptor.bLength;
- ii->position = p;
- ii->size = descriptor.bLength;
- ii->selected_alternate = -1;
- ii->alternate_settings.push_front(aa);
- latest_alternate = aa;
- latest_configuration->interfaces.push_front(ii);
+
+ latest_configuration->interfaces.emplace_front();
+ usb_device_interfac &ii(latest_configuration->interfaces.front());
+ ii.position = p;
+ ii.size = descriptor.bLength;
+ ii.selected_alternate = -1;
+
+ ii.alternate_settings.emplace_front();
+ usb_device_interfac_alternate &aa(ii.alternate_settings.front());
+ memcpy(&aa.interface_descriptor, &descriptor, sizeof(USBStandardInterfaceDescriptor));
+ aa.position = p;
+ aa.size = descriptor.bLength;
+ latest_alternate = &aa;
}
-void ohci_function::add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor)
+void device_usb_ohci_function_interface::add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor)
{
- uint8_t *p = descriptors + descriptors_pos;
-
if (latest_alternate == nullptr)
return;
+
+ uint8_t *const p = &descriptors[descriptors_pos];
p[0] = descriptor.bLength;
p[1] = descriptor.bDescriptorType;
p[2] = descriptor.bEndpointAddress;
@@ -997,49 +999,48 @@ void ohci_function::add_endpoint_descriptor(const USBStandardEndpointDescriptor
p[5] = descriptor.wMaxPacketSize >> 8;
p[6] = descriptor.bInterval;
descriptors_pos += descriptor.bLength;
+
latest_alternate->endpoint_descriptors.push_front(descriptor);
latest_alternate->size += descriptor.bLength;
- latest_configuration->interfaces.front()->size += descriptor.bLength;
+ latest_configuration->interfaces.front().size += descriptor.bLength;
latest_configuration->size += descriptor.bLength;
}
-void ohci_function::add_string_descriptor(const uint8_t *descriptor)
+void device_usb_ohci_function_interface::add_string_descriptor(const uint8_t *descriptor)
{
- usb_device_string *ss;
int len = descriptor[0];
- uint8_t *p = descriptors + descriptors_pos;
-
-
- ss = new usb_device_string;
+ uint8_t *const p = &descriptors[descriptors_pos];
memcpy(p, descriptor, len);
descriptors_pos += len;
- ss->size = len;
- ss->position = p;
- device_strings.push_front(ss);
+
+ device_strings.emplace_front();
+ usb_device_string &ss(device_strings.front());
+ ss.size = len;
+ ss.position = p;
//latest_configuration->size += len;
}
-void ohci_function::select_configuration(int index)
+void device_usb_ohci_function_interface::select_configuration(int index)
{
configurationvalue = index;
- for (auto c = configurations.begin(); c != configurations.end(); ++c)
+ for (auto &c : configurations)
{
- if ((*c)->configuration_descriptor.bConfigurationValue == index)
+ if (c.configuration_descriptor.bConfigurationValue == index)
{
- selected_configuration = *c;
+ selected_configuration = &c;
// by default, activate alternate setting 0 in each interface
- for (auto i = (*c)->interfaces.begin(); i != (*c)->interfaces.end(); ++i)
+ for (auto &i : c.interfaces)
{
- (*i)->selected_alternate = 0;
- for (auto a = (*i)->alternate_settings.begin(); a != (*i)->alternate_settings.end(); ++a)
+ i.selected_alternate = 0;
+ for (auto &a : i.alternate_settings)
{
- if ((*a)->interface_descriptor.bAlternateSetting == 0)
+ if (a.interface_descriptor.bAlternateSetting == 0)
{
// activate the endpoints in interface i alternate setting 0
- for (auto e = (*a)->endpoint_descriptors.begin(); e != (*a)->endpoint_descriptors.end(); ++e)
+ for (auto &e : a.endpoint_descriptors)
{
- endpoints[e->bEndpointAddress].type = e->bmAttributes & 3;
- endpoints[e->bEndpointAddress].remain = 0;
+ endpoints[e.bEndpointAddress].type = e.bmAttributes & 3;
+ endpoints[e.bEndpointAddress].remain = 0;
}
break;
}
@@ -1050,33 +1051,33 @@ void ohci_function::select_configuration(int index)
}
}
-void ohci_function::select_alternate(int interfacei, int index)
+void device_usb_ohci_function_interface::select_alternate(int interfacei, int index)
{
// among all the interfaces in the currently selected configuration, consider interface interfacei
- for (auto i = selected_configuration->interfaces.begin(); i != selected_configuration->interfaces.end(); ++i)
+ for (auto &i : selected_configuration->interfaces)
{
// deactivate the endpoints in the currently selected alternate setting for interface interfacei
- for (auto a = (*i)->alternate_settings.begin(); a != (*i)->alternate_settings.end(); ++a)
+ for (auto &a : i.alternate_settings)
{
- if (((*a)->interface_descriptor.bInterfaceNumber == interfacei) && ((*a)->interface_descriptor.bAlternateSetting == (*i)->selected_alternate))
+ if ((a.interface_descriptor.bInterfaceNumber == interfacei) && (a.interface_descriptor.bAlternateSetting == i.selected_alternate))
{
- for (auto e = (*a)->endpoint_descriptors.begin(); e != (*a)->endpoint_descriptors.end(); ++e)
+ for (auto &e : a.endpoint_descriptors)
{
- endpoints[e->bEndpointAddress].type = -1;
+ endpoints[e.bEndpointAddress].type = -1;
}
break;
}
}
// activate the endpoints in the newly selected alternate setting
- for (auto a = (*i)->alternate_settings.begin(); a != (*i)->alternate_settings.end(); ++a)
+ for (auto &a : i.alternate_settings)
{
- if (((*a)->interface_descriptor.bInterfaceNumber == interfacei) && ((*a)->interface_descriptor.bAlternateSetting == index))
+ if ((a.interface_descriptor.bInterfaceNumber == interfacei) && (a.interface_descriptor.bAlternateSetting == index))
{
- (*i)->selected_alternate = index;
- for (auto e = (*a)->endpoint_descriptors.begin(); e != (*a)->endpoint_descriptors.end(); ++e)
+ i.selected_alternate = index;
+ for (auto &e : a.endpoint_descriptors)
{
- endpoints[e->bEndpointAddress].type = e->bmAttributes & 3;
- endpoints[e->bEndpointAddress].remain = 0;
+ endpoints[e.bEndpointAddress].type = e.bmAttributes & 3;
+ endpoints[e.bEndpointAddress].remain = 0;
}
break;
}
@@ -1084,52 +1085,52 @@ void ohci_function::select_alternate(int interfacei, int index)
}
}
-int ohci_function::find_alternate(int interfacei)
+int device_usb_ohci_function_interface::find_alternate(int interfacei)
{
// find the active alternate setting for interface inteerfacei
- for (auto i = selected_configuration->interfaces.begin(); i != selected_configuration->interfaces.end(); ++i)
+ for (const auto &i : selected_configuration->interfaces)
{
- for (auto a = (*i)->alternate_settings.begin(); a != (*i)->alternate_settings.end(); ++a)
+ for (const auto &a : i.alternate_settings)
{
- if ((*a)->interface_descriptor.bInterfaceNumber == interfacei)
+ if (a.interface_descriptor.bInterfaceNumber == interfacei)
{
- return (*i)->selected_alternate;
+ return i.selected_alternate;
}
}
}
return 0;
}
-uint8_t *ohci_function::position_device_descriptor(int &size)
+uint8_t *device_usb_ohci_function_interface::position_device_descriptor(int &size)
{
size = descriptors_pos; // descriptors[0];
- return descriptors;
+ return &descriptors[0];
}
-uint8_t *ohci_function::position_configuration_descriptor(int index, int &size)
+uint8_t *device_usb_ohci_function_interface::position_configuration_descriptor(int index, int &size)
{
- for (auto c = configurations.begin(); c != configurations.end(); ++c)
+ for (const auto &c : configurations)
{
- if ((*c)->configuration_descriptor.bConfigurationValue == (index + 1))
+ if (c.configuration_descriptor.bConfigurationValue == (index + 1))
{
- size = (*c)->size;
- return (*c)->position;
+ size = c.size;
+ return c.position;
}
}
size = 0;
return nullptr;
}
-uint8_t *ohci_function::position_string_descriptor(int index, int &size)
+uint8_t *device_usb_ohci_function_interface::position_string_descriptor(int index, int &size)
{
int i = 0;
- for (auto s = device_strings.begin(); s != device_strings.end(); ++s)
+ for (const auto &s : device_strings)
{
if (index == i)
{
- size = (*s)->size;
- return (*s)->position;
+ size = s.size;
+ return s.position;
}
i++;
}
@@ -1137,13 +1138,13 @@ uint8_t *ohci_function::position_string_descriptor(int index, int &size)
return nullptr;
}
-void ohci_function::execute_reset()
+void device_usb_ohci_function_interface::execute_reset()
{
address = 0;
newaddress = 0;
}
-int ohci_function::execute_transfer(int endpoint, int pid, uint8_t *buffer, int size)
+int device_usb_ohci_function_interface::execute_transfer(int endpoint, int pid, uint8_t *buffer, int size)
{
int descriptortype, descriptorindex;
@@ -1331,7 +1332,7 @@ DEFINE_DEVICE_TYPE(OHCI_USB_CONNECTOR, ohci_usb_connector, "usb_connector", "Usb
ohci_usb_connector::ohci_usb_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, OHCI_USB_CONNECTOR, tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_single_card_slot_interface<device_usb_ohci_function_interface>(mconfig, *this)
{
}
@@ -1343,11 +1344,6 @@ void ohci_usb_connector::device_start()
{
}
-ohci_function* ohci_usb_connector::get_device()
-{
- return dynamic_cast<ohci_function *>(get_card_device());
-}
-
/*
* Game controller usb device
*/
@@ -1420,8 +1416,7 @@ DEFINE_DEVICE_TYPE(OHCI_GAME_CONTROLLER, ohci_game_controller_device, "ohci_gc",
ohci_game_controller_device::ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, OHCI_GAME_CONTROLLER, tag, owner, clock),
- ohci_function(),
- device_slot_card_interface(mconfig, *this),
+ device_usb_ohci_function_interface(mconfig, *this),
m_ThumbstickLh(*this, "ThumbstickLh"),
m_ThumbstickLv(*this, "ThumbstickLv"),
m_ThumbstickRh(*this, "ThumbstickRh"),
@@ -1439,9 +1434,9 @@ ohci_game_controller_device::ohci_game_controller_device(const machine_config &m
{
}
-void ohci_game_controller_device::initialize(running_machine &machine)
+void ohci_game_controller_device::initialize()
{
- ohci_function::initialize(machine);
+ device_usb_ohci_function_interface::initialize();
add_device_descriptor(devdesc);
add_configuration_descriptor(condesc);
add_interface_descriptor(intdesc);
@@ -1544,7 +1539,7 @@ int ohci_game_controller_device::handle_interrupt_pid(int endpoint, int pid, uin
void ohci_game_controller_device::device_start()
{
- initialize(machine());
+ initialize();
}
ioport_constructor ohci_game_controller_device::device_input_ports() const
diff --git a/src/mame/machine/zs01.cpp b/src/mame/machine/zs01.cpp
index 75a552745b6..3ce573892e5 100644
--- a/src/mame/machine/zs01.cpp
+++ b/src/mame/machine/zs01.cpp
@@ -30,9 +30,10 @@ inline void ATTR_PRINTF( 3, 4 ) zs01_device::verboselog( int n_level, const char
// device type definition
DEFINE_DEVICE_TYPE(ZS01, zs01_device, "zs01", "Konami ZS01 PIC")
-zs01_device::zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock )
- : device_t(mconfig, ZS01, tag, owner, clock),
+zs01_device::zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) :
+ device_t(mconfig, ZS01, tag, owner, clock),
device_nvram_interface(mconfig, *this),
+ m_ds2401(*this, finder_base::DUMMY_TAG),
m_region(*this, DEVICE_SELF),
m_cs( 0 ),
m_rst( 0 ),
@@ -48,11 +49,8 @@ zs01_device::zs01_device( const machine_config &mconfig, const char *tag, device
void zs01_device::device_start()
{
- m_ds2401 = siblingdevice<ds2401_device>(m_ds2401_tag);
- if( m_ds2401 == nullptr )
- {
- logerror( "ds2401 '%s' not found\n", m_ds2401_tag );
- }
+ if( !m_ds2401 )
+ logerror( "ds2401 '%s' not found\n", m_ds2401.finder_tag() );
memset( m_write_buffer, 0, sizeof( m_write_buffer ) );
memset( m_read_buffer, 0, sizeof( m_read_buffer ) );
diff --git a/src/mame/machine/zs01.h b/src/mame/machine/zs01.h
index 19bb82b2296..75b8f40784c 100644
--- a/src/mame/machine/zs01.h
+++ b/src/mame/machine/zs01.h
@@ -27,7 +27,7 @@ public:
zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock );
// inline configuration helpers
- void set_ds2401_tag( const char *ds2401_tag ) { m_ds2401_tag = ds2401_tag; }
+ template <typename T> void set_ds2401_tag( T &&tag ) { m_ds2401.set_tag(std::forward<T>(tag)); }
DECLARE_WRITE_LINE_MEMBER( write_cs );
DECLARE_WRITE_LINE_MEMBER( write_rst );
@@ -73,7 +73,7 @@ private:
};
// internal state
- const char *m_ds2401_tag;
+ optional_device<ds2401_device> m_ds2401;
optional_memory_region m_region;
int m_cs;
@@ -92,7 +92,6 @@ private:
uint8_t m_command_key[ 8 ];
uint8_t m_data_key[ 8 ];
uint8_t m_data[ 4096 ];
- ds2401_device *m_ds2401;
};
diff --git a/src/mame/video/decodmd1.cpp b/src/mame/video/decodmd1.cpp
index e0164ad5c55..c1aced39c53 100644
--- a/src/mame/video/decodmd1.cpp
+++ b/src/mame/video/decodmd1.cpp
@@ -202,7 +202,7 @@ void decodmd_type1_device::device_add_mconfig(machine_config &config)
m_cpu->set_addrmap(AS_PROGRAM, &decodmd_type1_device::decodmd1_map);
m_cpu->set_addrmap(AS_IO, &decodmd_type1_device::decodmd1_io_map);
- config.m_minimum_quantum = attotime::from_hz(50);
+ config.set_maximum_quantum(attotime::from_hz(50));
TIMER(config, "nmi_timer").configure_periodic(FUNC(decodmd_type1_device::dmd_nmi), attotime::from_hz(2000)); // seems a lot
diff --git a/src/mame/video/decodmd2.cpp b/src/mame/video/decodmd2.cpp
index b30d2719bc3..cf4676680b9 100644
--- a/src/mame/video/decodmd2.cpp
+++ b/src/mame/video/decodmd2.cpp
@@ -134,7 +134,7 @@ void decodmd_type2_device::device_add_mconfig(machine_config &config)
MC6809E(config, m_cpu, XTAL(8'000'000) / 4);
m_cpu->set_addrmap(AS_PROGRAM, &decodmd_type2_device::decodmd2_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
TIMER(config, "firq_timer", 0).configure_periodic(FUNC(decodmd_type2_device::dmd_firq), attotime::from_hz(80));
diff --git a/src/mame/video/decodmd3.cpp b/src/mame/video/decodmd3.cpp
index 58979b27770..b2823c17506 100644
--- a/src/mame/video/decodmd3.cpp
+++ b/src/mame/video/decodmd3.cpp
@@ -136,7 +136,7 @@ void decodmd_type3_device::device_add_mconfig(machine_config &config)
M68000(config, m_cpu, XTAL(12'000'000));
m_cpu->set_addrmap(AS_PROGRAM, &decodmd_type3_device::decodmd3_map);
- config.m_minimum_quantum = attotime::from_hz(60);
+ config.set_maximum_quantum(attotime::from_hz(60));
TIMER(config, "irq_timer", 0).configure_periodic(FUNC(decodmd_type3_device::dmd_irq), attotime::from_hz(150));