From e9c1f4a42a6758a6fb75403e28c7dc6cf869081c Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 17 Jun 2023 01:10:05 +1000 Subject: emu/devcb.h: Eliminated the need to call resolve() on callbacks. (#11333) Read callbacks now need a default return value supplied at construction. Replaced isnull() with isunset() which tells you if the callback wasn't configured rather than whether it isn't safe to call. Enabled validation of device callbacks (it seems it was disabled at some point, probably accidentally). Device callbacks and object finders now implement the same interface for resolution. --- src/devices/machine/1mb5.cpp | 5 - src/devices/machine/2812fifo.cpp | 5 - src/devices/machine/40105.cpp | 5 - src/devices/machine/53c7xx.cpp | 21 ++- src/devices/machine/64h156.cpp | 5 - src/devices/machine/6522via.cpp | 55 ++++---- src/devices/machine/6525tpi.cpp | 40 +++--- src/devices/machine/6532riot.cpp | 37 +++--- src/devices/machine/68153bim.cpp | 12 +- src/devices/machine/6821pia.cpp | 108 ++++++---------- src/devices/machine/6821pia.h | 3 +- src/devices/machine/68230pit.cpp | 40 ++---- src/devices/machine/68307.cpp | 8 +- src/devices/machine/68340.cpp | 4 +- src/devices/machine/68340.h | 2 - src/devices/machine/68340sim.cpp | 12 +- src/devices/machine/68340tmu.cpp | 6 - src/devices/machine/68340tmu.h | 1 - src/devices/machine/6840ptm.cpp | 4 - src/devices/machine/6850acia.cpp | 5 - src/devices/machine/68561mpcc.cpp | 8 -- src/devices/machine/7200fifo.cpp | 5 - src/devices/machine/7400.cpp | 2 - src/devices/machine/7404.cpp | 2 - src/devices/machine/74123.cpp | 2 - src/devices/machine/74145.cpp | 3 - src/devices/machine/74148.cpp | 7 +- src/devices/machine/74153.cpp | 4 - src/devices/machine/74157.cpp | 25 ++-- src/devices/machine/74161.cpp | 3 - src/devices/machine/74165.cpp | 6 +- src/devices/machine/74166.cpp | 6 +- src/devices/machine/74175.cpp | 13 -- src/devices/machine/74259.cpp | 17 +-- src/devices/machine/74381.cpp | 4 - src/devices/machine/74543.cpp | 3 - src/devices/machine/7474.cpp | 11 -- src/devices/machine/7474.h | 3 +- src/devices/machine/8042kbdc.cpp | 22 +--- src/devices/machine/82s129.cpp | 6 - src/devices/machine/8364_paula.cpp | 6 +- src/devices/machine/8530scc.cpp | 8 +- src/devices/machine/acorn_ioc.cpp | 18 +-- src/devices/machine/acorn_ioc.h | 5 +- src/devices/machine/acorn_memc.cpp | 6 - src/devices/machine/acorn_memc.h | 5 +- src/devices/machine/acorn_vidc.cpp | 3 - src/devices/machine/adc0804.cpp | 5 +- src/devices/machine/adc0808.cpp | 7 +- src/devices/machine/adc0844.cpp | 22 +--- src/devices/machine/adc0844.h | 5 +- src/devices/machine/aic565.cpp | 15 --- src/devices/machine/aic565.h | 3 +- src/devices/machine/aic580.cpp | 21 +-- src/devices/machine/aic580.h | 3 +- src/devices/machine/aic6250.cpp | 12 +- src/devices/machine/akiko.cpp | 16 +-- src/devices/machine/am25s55x.cpp | 2 - src/devices/machine/am2901b.cpp | 12 -- src/devices/machine/am2910.cpp | 6 - src/devices/machine/am53cf96.cpp | 2 - src/devices/machine/am79c30.cpp | 12 -- src/devices/machine/am79c30.h | 3 +- src/devices/machine/am79c90.cpp | 6 +- src/devices/machine/am9513.cpp | 10 +- src/devices/machine/am9516.cpp | 8 -- src/devices/machine/am9516.h | 4 +- src/devices/machine/am9517a.cpp | 65 ++++------ src/devices/machine/am9519.cpp | 3 - src/devices/machine/amiga_copper.cpp | 3 +- src/devices/machine/amigafdc.cpp | 7 +- src/devices/machine/applefdintf.cpp | 5 - src/devices/machine/applepic.cpp | 14 +- src/devices/machine/applepic.h | 3 +- src/devices/machine/archimedes_keyb.cpp | 1 - src/devices/machine/arm_iomd.cpp | 13 +- src/devices/machine/at45dbxx.cpp | 2 - src/devices/machine/at_keybc.cpp | 18 --- src/devices/machine/at_keybc.h | 2 - src/devices/machine/atmel_arm_aic.cpp | 2 - src/devices/machine/ay31015.cpp | 34 +---- src/devices/machine/ay31015.h | 3 +- src/devices/machine/bacta_datalogger.cpp | 1 - src/devices/machine/bq4847.cpp | 4 - src/devices/machine/bq48x2.cpp | 6 - src/devices/machine/busmouse.cpp | 3 - src/devices/machine/cammu.cpp | 1 - src/devices/machine/cdp1852.cpp | 10 +- src/devices/machine/cdp1871.cpp | 37 ++---- src/devices/machine/cdp1879.cpp | 2 - src/devices/machine/chessmachine.cpp | 3 - src/devices/machine/clock.cpp | 2 - src/devices/machine/com52c50.cpp | 8 -- src/devices/machine/com52c50.h | 3 +- src/devices/machine/com8116.cpp | 7 +- src/devices/machine/cop452.cpp | 4 +- src/devices/machine/cr511b.cpp | 7 - src/devices/machine/cs4031.cpp | 13 +- src/devices/machine/cxd1095.cpp | 10 +- src/devices/machine/cxd1185.cpp | 4 - src/devices/machine/dc7085.cpp | 8 -- src/devices/machine/dimm_spd.cpp | 5 +- src/devices/machine/dl11.cpp | 5 - src/devices/machine/dmac.cpp | 12 +- src/devices/machine/dp8390.cpp | 6 +- src/devices/machine/dp83932c.cpp | 2 - src/devices/machine/dp8573.cpp | 3 - src/devices/machine/ds1315.cpp | 4 +- src/devices/machine/ds1386.cpp | 4 - src/devices/machine/ds75160a.cpp | 6 +- src/devices/machine/ds75161a.cpp | 35 ++--- src/devices/machine/ds8874.cpp | 3 - src/devices/machine/e0516.cpp | 9 +- src/devices/machine/e05a03.cpp | 21 +-- src/devices/machine/e05a30.cpp | 13 -- src/devices/machine/edlc.cpp | 4 - src/devices/machine/eepromser.cpp | 3 - src/devices/machine/exorterm.cpp | 7 - src/devices/machine/exorterm.h | 1 - src/devices/machine/f3853.cpp | 15 +-- src/devices/machine/f3853.h | 4 +- src/devices/machine/f4702.cpp | 16 +-- src/devices/machine/f4702.h | 5 +- src/devices/machine/fdc37c665gt.cpp | 12 -- src/devices/machine/fdc37c93x.cpp | 11 -- src/devices/machine/fga002.cpp | 15 +-- src/devices/machine/fm_scsi.cpp | 3 - src/devices/machine/gayle.cpp | 9 +- src/devices/machine/gen_fifo.cpp | 3 - src/devices/machine/gen_latch.cpp | 1 - src/devices/machine/generalplus_gpl16250soc.cpp | 65 +++++----- src/devices/machine/generalplus_gpl16250soc.h | 28 +--- .../machine/generalplus_gpl16250soc_video.cpp | 6 +- src/devices/machine/genpc.cpp | 16 +-- src/devices/machine/genpc.h | 18 ++- src/devices/machine/gt913_kbd.cpp | 2 - src/devices/machine/hd63450.cpp | 12 +- src/devices/machine/hd64610.cpp | 4 - src/devices/machine/hdc92x4.cpp | 9 +- src/devices/machine/hp_dc100_tape.cpp | 9 +- src/devices/machine/hp_taco.cpp | 4 - src/devices/machine/i7220.cpp | 4 - src/devices/machine/i80130.cpp | 7 - src/devices/machine/i8087.cpp | 2 - src/devices/machine/i8155.cpp | 47 +++---- src/devices/machine/i8212.cpp | 10 +- src/devices/machine/i8214.cpp | 4 - src/devices/machine/i82355.cpp | 13 -- src/devices/machine/i82355.h | 3 +- src/devices/machine/i82357.cpp | 4 - src/devices/machine/i82371sb.cpp | 11 -- src/devices/machine/i82371sb.h | 1 - src/devices/machine/i8243.cpp | 9 +- src/devices/machine/i8251.cpp | 18 --- src/devices/machine/i8251.h | 9 +- src/devices/machine/i8255.cpp | 26 +--- src/devices/machine/i8255.h | 3 +- src/devices/machine/i8257.cpp | 13 +- src/devices/machine/i82586.cpp | 2 - src/devices/machine/i8271.cpp | 5 - src/devices/machine/i8279.cpp | 63 +++------ src/devices/machine/i8279.h | 5 +- src/devices/machine/i8291a.cpp | 144 ++++++++++----------- src/devices/machine/i8355.cpp | 20 +-- src/devices/machine/ibm21s850.cpp | 2 - src/devices/machine/icm7170.cpp | 3 - src/devices/machine/ie15.cpp | 7 - src/devices/machine/ie15.h | 1 - src/devices/machine/ie15_kbd.cpp | 2 - src/devices/machine/im6402.cpp | 6 - src/devices/machine/input_merger.cpp | 1 - src/devices/machine/ins8154.cpp | 21 +-- src/devices/machine/ins8250.cpp | 6 - src/devices/machine/ioptimer.cpp | 9 +- src/devices/machine/k053252.cpp | 6 - src/devices/machine/k056230.cpp | 1 - src/devices/machine/kb3600.cpp | 37 ++---- src/devices/machine/keytronic_l2207.cpp | 1 - src/devices/machine/kr2376.cpp | 12 +- src/devices/machine/latch8.cpp | 14 +- src/devices/machine/ldv1000.cpp | 5 +- src/devices/machine/ldv4200hle.cpp | 2 - src/devices/machine/lh5810.cpp | 12 +- src/devices/machine/m3002.cpp | 12 -- src/devices/machine/m3002.h | 7 +- src/devices/machine/m68sfdc.cpp | 8 +- src/devices/machine/m68sfdc.h | 1 - src/devices/machine/mb8421.h | 17 +-- src/devices/machine/mb87030.cpp | 2 - src/devices/machine/mb87078.cpp | 2 - src/devices/machine/mb8795.cpp | 21 +-- src/devices/machine/mb89363b.cpp | 46 +++---- src/devices/machine/mb89374.cpp | 4 - src/devices/machine/mc14411.cpp | 5 +- src/devices/machine/mc146818.cpp | 3 - src/devices/machine/mc68328.cpp | 86 +++--------- src/devices/machine/mc68328.h | 12 +- src/devices/machine/mc6843.cpp | 1 - src/devices/machine/mc6844.cpp | 20 +-- src/devices/machine/mc6844.h | 4 +- src/devices/machine/mc6846.cpp | 43 ++---- src/devices/machine/mc6852.cpp | 6 - src/devices/machine/mc6854.cpp | 18 +-- src/devices/machine/mc68681.cpp | 16 +-- src/devices/machine/mc68901.cpp | 91 ++++++------- src/devices/machine/mccs1850.cpp | 11 +- src/devices/machine/mdcr.cpp | 2 - src/devices/machine/micomxe1a.cpp | 7 +- src/devices/machine/microtch.cpp | 1 - src/devices/machine/mm5307.cpp | 13 -- src/devices/machine/mm5307.h | 3 +- src/devices/machine/mm5740.cpp | 12 +- src/devices/machine/mm58167.cpp | 2 - src/devices/machine/mm74c922.cpp | 7 +- src/devices/machine/mos6526.cpp | 38 ++---- src/devices/machine/mos6529.cpp | 2 - src/devices/machine/mos6530.cpp | 18 +-- src/devices/machine/mos6530n.cpp | 61 ++++----- src/devices/machine/mos6551.cpp | 7 - src/devices/machine/mos8722.cpp | 12 +- src/devices/machine/mpu401.cpp | 1 - src/devices/machine/msm58321.cpp | 7 - src/devices/machine/msm6242.cpp | 6 +- src/devices/machine/mv_sonora.cpp | 1 - src/devices/machine/nandflash.cpp | 5 - src/devices/machine/nandflash.h | 12 +- src/devices/machine/ncr5380.cpp | 3 - src/devices/machine/ncr5385.cpp | 1 - src/devices/machine/ncr53c90.cpp | 3 - src/devices/machine/ns32081.cpp | 2 +- src/devices/machine/ns32202.cpp | 4 - src/devices/machine/nsc810.cpp | 14 +- src/devices/machine/nscsi_cb.cpp | 35 ++--- src/devices/machine/output_latch.cpp | 8 +- src/devices/machine/output_latch.h | 1 - src/devices/machine/pc_fdc.cpp | 7 +- src/devices/machine/pc_lpt.cpp | 2 - src/devices/machine/pccard.cpp | 6 - src/devices/machine/pcf8573.cpp | 4 - src/devices/machine/pcf8583.cpp | 2 - src/devices/machine/pcf8584.cpp | 17 +-- src/devices/machine/pcf8584.h | 3 +- src/devices/machine/pci-ide.cpp | 2 - src/devices/machine/pci9050.cpp | 8 +- src/devices/machine/pckeybrd.cpp | 7 +- src/devices/machine/pdc.cpp | 6 +- src/devices/machine/phi.cpp | 23 ++-- src/devices/machine/pic8259.cpp | 19 +-- src/devices/machine/pic8259.h | 3 +- src/devices/machine/pit8253.cpp | 1 - src/devices/machine/psion_asic1.cpp | 14 -- src/devices/machine/psion_asic1.h | 1 - src/devices/machine/psion_asic2.cpp | 24 +--- src/devices/machine/psion_asic2.h | 1 - src/devices/machine/psion_asic3.cpp | 14 +- src/devices/machine/psion_asic3.h | 1 - src/devices/machine/psion_asic5.cpp | 12 +- src/devices/machine/psion_asic9.cpp | 21 +-- src/devices/machine/psion_asic9.h | 1 - src/devices/machine/psion_ssd.cpp | 12 -- src/devices/machine/psion_ssd.h | 1 - src/devices/machine/pxa255.cpp | 13 +- src/devices/machine/r10696.cpp | 5 +- src/devices/machine/r10788.cpp | 2 - src/devices/machine/ra17xx.cpp | 5 +- src/devices/machine/ripple_counter.cpp | 18 +-- src/devices/machine/ripple_counter.h | 5 +- src/devices/machine/rp5c01.cpp | 3 - src/devices/machine/rp5c15.cpp | 4 - src/devices/machine/rstbuf.cpp | 12 -- src/devices/machine/rstbuf.h | 3 +- src/devices/machine/rtc4543.cpp | 2 - src/devices/machine/rtc65271.cpp | 7 +- src/devices/machine/s2636.cpp | 2 - src/devices/machine/s3c2400.cpp | 8 +- src/devices/machine/s3c2410.cpp | 10 +- src/devices/machine/s3c2440.cpp | 10 +- src/devices/machine/s3c24xx.hxx | 93 +++---------- src/devices/machine/s3c44b0.cpp | 36 ++---- src/devices/machine/s_smp.cpp | 5 +- src/devices/machine/sa1110.cpp | 4 - src/devices/machine/sa1111.cpp | 7 - src/devices/machine/saa1043.cpp | 2 - src/devices/machine/saa7191.cpp | 12 +- src/devices/machine/scc2698b.cpp | 10 -- src/devices/machine/scc66470.cpp | 30 ++--- src/devices/machine/scc68070.cpp | 31 +---- src/devices/machine/scc68070.h | 5 +- src/devices/machine/scn_pci.cpp | 33 +---- src/devices/machine/scn_pci.h | 6 +- src/devices/machine/scnxx562.cpp | 17 --- src/devices/machine/scoop.cpp | 2 - src/devices/machine/sensorboard.cpp | 16 +-- src/devices/machine/sis5513_ide.cpp | 3 - src/devices/machine/sis950_lpc.cpp | 7 - src/devices/machine/sis950_lpc.h | 1 - src/devices/machine/smartboard.cpp | 7 +- src/devices/machine/smc91c9x.cpp | 2 - src/devices/machine/smioc.cpp | 8 +- src/devices/machine/smpc.cpp | 18 +-- src/devices/machine/spg110.cpp | 23 +--- src/devices/machine/spg110.h | 1 - src/devices/machine/spg110_video.cpp | 2 - src/devices/machine/spg290_cdservo.cpp | 3 - src/devices/machine/spg290_i2c.cpp | 5 +- src/devices/machine/spg290_ppu.cpp | 5 +- src/devices/machine/spg290_timer.cpp | 1 - src/devices/machine/spg2xx.cpp | 29 +---- src/devices/machine/spg2xx_audio.cpp | 6 +- src/devices/machine/spg2xx_io.cpp | 34 +---- src/devices/machine/spg2xx_video.cpp | 12 +- src/devices/machine/spg_renderer.cpp | 4 +- src/devices/machine/spi_sdcard.cpp | 1 - src/devices/machine/spifi3.cpp | 3 - src/devices/machine/steppers.cpp | 3 - src/devices/machine/sun4c_mmu.cpp | 5 +- src/devices/machine/swim3.cpp | 2 - src/devices/machine/swtpc8212.cpp | 7 - src/devices/machine/swtpc8212.h | 1 - src/devices/machine/tdc1008.cpp | 5 - src/devices/machine/te7750.cpp | 11 +- src/devices/machine/ticket.cpp | 2 - src/devices/machine/timekpr.cpp | 2 - src/devices/machine/tmc0430.cpp | 1 - src/devices/machine/tmc208k.cpp | 4 - src/devices/machine/tms1024.cpp | 6 +- src/devices/machine/tms5501.cpp | 8 +- src/devices/machine/tms9901.cpp | 20 +-- src/devices/machine/tms9902.cpp | 5 - src/devices/machine/tms9914.cpp | 122 +++++++++-------- src/devices/machine/tsb12lv01a.cpp | 6 +- src/devices/machine/tube.cpp | 7 - src/devices/machine/ucb1200.cpp | 8 +- src/devices/machine/upc82c710.cpp | 8 -- src/devices/machine/upc82c711.cpp | 12 -- src/devices/machine/upd1990a.cpp | 3 - src/devices/machine/upd4701.cpp | 7 +- src/devices/machine/upd7001.cpp | 14 +- src/devices/machine/upd7001.h | 3 +- src/devices/machine/upd7004.cpp | 7 +- src/devices/machine/upd71071.cpp | 12 +- src/devices/machine/upd765.cpp | 27 +--- src/devices/machine/upd765.h | 5 - src/devices/machine/vic_pl192.cpp | 7 - src/devices/machine/vic_pl192.h | 3 +- src/devices/machine/vrc4373.cpp | 6 +- src/devices/machine/vrender0.cpp | 2 - src/devices/machine/vt8231_isa.cpp | 5 - src/devices/machine/w83977tf.cpp | 11 -- src/devices/machine/wd1000.cpp | 10 +- src/devices/machine/wd1010.cpp | 12 +- src/devices/machine/wd11c00_17.cpp | 18 +-- src/devices/machine/wd2010.cpp | 35 ++--- src/devices/machine/wd33c9x.cpp | 2 - src/devices/machine/wd7600.cpp | 13 +- src/devices/machine/wd_fdc.cpp | 64 +++------ src/devices/machine/wtl3132.cpp | 5 - src/devices/machine/xc1700e.cpp | 4 +- src/devices/machine/ym2148.cpp | 7 +- src/devices/machine/ym3802.cpp | 5 +- src/devices/machine/z8038.cpp | 7 - src/devices/machine/z80ctc.cpp | 14 -- src/devices/machine/z80ctc.h | 7 +- src/devices/machine/z80daisy_generic.cpp | 3 - src/devices/machine/z80dma.cpp | 14 +- src/devices/machine/z80pio.cpp | 13 +- src/devices/machine/z80scc.cpp | 18 --- src/devices/machine/z80scc.h | 25 ++-- src/devices/machine/z80sio.cpp | 18 --- src/devices/machine/z80sio.h | 13 +- src/devices/machine/z80sti.cpp | 12 +- src/devices/machine/z8536.cpp | 15 +-- 372 files changed, 982 insertions(+), 3282 deletions(-) (limited to 'src/devices/machine') diff --git a/src/devices/machine/1mb5.cpp b/src/devices/machine/1mb5.cpp index b03b17bc4d7..f3dacdbe7ba 100644 --- a/src/devices/machine/1mb5.cpp +++ b/src/devices/machine/1mb5.cpp @@ -193,11 +193,6 @@ void hp_1mb5_device::clear_service() void hp_1mb5_device::device_start() { - m_irl_handler.resolve_safe(); - m_halt_handler.resolve_safe(); - m_reset_handler.resolve_safe(); - m_int_handler.resolve_safe(); - save_item(NAME(m_sr)); save_item(NAME(m_cr)); save_item(NAME(m_ib)); diff --git a/src/devices/machine/2812fifo.cpp b/src/devices/machine/2812fifo.cpp index 5944508b94e..ea2bb69a31a 100644 --- a/src/devices/machine/2812fifo.cpp +++ b/src/devices/machine/2812fifo.cpp @@ -191,11 +191,6 @@ void fifo2812_device::write(u8 data) void fifo2812_device::device_resolve_objects() { - m_q_cb.resolve_safe(); - m_ir_cb.resolve_safe(); - m_or_cb.resolve_safe(); - m_flag_cb.resolve_safe(); - m_d = 0U; m_mr = 1U; m_pl = 0U; diff --git a/src/devices/machine/40105.cpp b/src/devices/machine/40105.cpp index 032fc62521d..8e528a83329 100644 --- a/src/devices/machine/40105.cpp +++ b/src/devices/machine/40105.cpp @@ -64,11 +64,6 @@ cmos_40105_device::cmos_40105_device(const machine_config &mconfig, const char * void cmos_40105_device::device_start() { - // resolve callbacks - m_write_dir.resolve_safe(); - m_write_dor.resolve_safe(); - m_write_q.resolve_safe(); - // state saving save_item(NAME(m_d)); save_item(NAME(m_q)); diff --git a/src/devices/machine/53c7xx.cpp b/src/devices/machine/53c7xx.cpp index 754d2714909..21fa52528be 100644 --- a/src/devices/machine/53c7xx.cpp +++ b/src/devices/machine/53c7xx.cpp @@ -87,14 +87,14 @@ DEFINE_DEVICE_TYPE(NCR53C7XX, ncr53c7xx_device, "ncr537xx", "NCR 53C7xx SCSI") // ncr53c7xx_device - constructor/destructor //------------------------------------------------- -ncr53c7xx_device::ncr53c7xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nscsi_device(mconfig, NCR53C7XX, tag, owner, clock), - nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), - device_execute_interface(mconfig, *this), - m_icount(0), - m_irq_handler(*this), - m_host_write(*this), - m_host_read(*this) +ncr53c7xx_device::ncr53c7xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + nscsi_device(mconfig, NCR53C7XX, tag, owner, clock), + nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), + device_execute_interface(mconfig, *this), + m_icount(0), + m_irq_handler(*this), + m_host_write(*this), + m_host_read(*this, 0) { } @@ -108,11 +108,6 @@ void ncr53c7xx_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve line callbacks - m_irq_handler.resolve_safe(); - m_host_read.resolve_safe(0); - m_host_write.resolve_safe(); - m_tm = timer_alloc(FUNC(ncr53c7xx_device::step_timer), this); // The SCRIPTS processor runs at ~2 MIPS so approximate this diff --git a/src/devices/machine/64h156.cpp b/src/devices/machine/64h156.cpp index 8e9ecab1daa..6613b34ab69 100644 --- a/src/devices/machine/64h156.cpp +++ b/src/devices/machine/64h156.cpp @@ -86,11 +86,6 @@ c64h156_device::c64h156_device(const machine_config &mconfig, const char *tag, d void c64h156_device::device_start() { - // resolve callbacks - m_write_atn.resolve_safe(); - m_write_sync.resolve_safe(); - m_write_byte.resolve_safe(); - // allocate timer t_gen = timer_alloc(FUNC(c64h156_device::update_tick), this); diff --git a/src/devices/machine/6522via.cpp b/src/devices/machine/6522via.cpp index 91c4a85c992..68c6185c25f 100644 --- a/src/devices/machine/6522via.cpp +++ b/src/devices/machine/6522via.cpp @@ -169,27 +169,27 @@ void via6522_device::map(address_map &map) // via6522_device - constructor //------------------------------------------------- -via6522_device::via6522_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), - m_in_a_handler(*this), - m_in_b_handler(*this), - m_out_a_handler(*this), - m_out_b_handler(*this), - m_ca2_handler(*this), - m_cb1_handler(*this), - m_cb2_handler(*this), - m_irq_handler(*this), - m_in_a(0xff), - m_in_ca1(0), - m_in_ca2(0), - m_out_ca2(0), - m_in_b(0xff), - m_in_cb1(0), - m_in_cb2(0), - m_pcr(0), - m_acr(0), - m_ier(0), - m_ifr(0) +via6522_device::via6522_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + m_in_a_handler(*this, 0xff), + m_in_b_handler(*this, 0xff), + m_out_a_handler(*this), + m_out_b_handler(*this), + m_ca2_handler(*this), + m_cb1_handler(*this), + m_cb2_handler(*this), + m_irq_handler(*this), + m_in_a(0xff), + m_in_ca1(0), + m_in_ca2(0), + m_out_ca2(0), + m_in_b(0xff), + m_in_cb1(0), + m_in_cb2(0), + m_pcr(0), + m_acr(0), + m_ier(0), + m_ifr(0) { } @@ -240,15 +240,6 @@ w65c22s_device::w65c22s_device(const machine_config &mconfig, const char *tag, d void via6522_device::device_start() { - m_in_a_handler.resolve(); - m_in_b_handler.resolve(); - m_out_a_handler.resolve_safe(); - m_out_b_handler.resolve_safe(); - m_cb1_handler.resolve_safe(); - m_ca2_handler.resolve_safe(); - m_cb2_handler.resolve_safe(); - m_irq_handler.resolve_safe(); - m_t1ll = 0xf3; /* via at 0x9110 in vic20 show these values */ m_t1lh = 0xb5; /* ports are not written by kernel! */ m_t2ll = 0xff; /* taken from vice */ @@ -551,7 +542,7 @@ TIMER_CALLBACK_MEMBER(via6522_device::ca2_tick) uint8_t via6522_device::input_pa() { // HACK: port a in the real 6522 does not mask off the output pins, but you can't trust handlers. - if (!m_in_a_handler.isnull()) + if (!m_in_a_handler.isunset()) return (m_in_a & ~m_ddr_a & m_in_a_handler()) | (m_out_a & m_ddr_a); else return (m_out_a | ~m_ddr_a) & m_in_a; @@ -573,7 +564,7 @@ uint8_t via6522_device::input_pb() uint8_t pb = m_in_b & ~m_ddr_b; /// TODO: REMOVE THIS - if (m_ddr_b != 0xff && !m_in_b_handler.isnull()) + if (m_ddr_b != 0xff && !m_in_b_handler.isunset()) { pb &= m_in_b_handler(); } diff --git a/src/devices/machine/6525tpi.cpp b/src/devices/machine/6525tpi.cpp index 26e75c06bf5..cffb9ba5f50 100644 --- a/src/devices/machine/6525tpi.cpp +++ b/src/devices/machine/6525tpi.cpp @@ -106,14 +106,14 @@ DEFINE_DEVICE_TYPE(TPI6525, tpi6525_device, "tpi6525", "6525 TPI") -tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TPI6525, tag, owner, clock), +tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TPI6525, tag, owner, clock), m_out_irq_cb(*this), - m_in_pa_cb(*this), + m_in_pa_cb(*this, 0xff), m_out_pa_cb(*this), - m_in_pb_cb(*this), + m_in_pb_cb(*this, 0xff), m_out_pb_cb(*this), - m_in_pc_cb(*this), + m_in_pc_cb(*this, 0xff), m_out_pc_cb(*this), m_out_ca_cb(*this), m_out_cb_cb(*this), @@ -144,16 +144,10 @@ tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, d void tpi6525_device::device_start() { - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_in_pa_cb.resolve(); - m_out_pa_cb.resolve_safe(); - m_in_pb_cb.resolve(); - m_out_pb_cb.resolve_safe(); - m_in_pc_cb.resolve(); - m_out_pc_cb.resolve_safe(); - m_out_ca_cb.resolve_safe(); - m_out_cb_cb.resolve_safe(); + /* setup some initial values */ + m_in_a = 0xff; + m_in_b = 0xff; + m_in_c = 0xff; /* register for state saving */ save_item(NAME(m_port_a)); @@ -179,10 +173,6 @@ void tpi6525_device::device_start() void tpi6525_device::device_reset() { - /* setup some initial values */ - m_in_a = 0xff; - m_in_b = 0xff; - m_in_c = 0xff; } @@ -298,7 +288,7 @@ uint8_t tpi6525_device::pa_r() { uint8_t data = m_in_a; - if (!m_in_pa_cb.isnull()) + if (!m_in_pa_cb.isunset()) data = m_in_pa_cb(); data = (data & ~m_ddr_a) | (m_ddr_a & m_port_a); @@ -317,7 +307,7 @@ uint8_t tpi6525_device::pb_r() { uint8_t data = m_in_b; - if (!m_in_pb_cb.isnull()) + if (!m_in_pb_cb.isunset()) data = m_in_pb_cb(); data = (data & ~m_ddr_b) | (m_ddr_b & m_port_b); @@ -336,7 +326,7 @@ uint8_t tpi6525_device::pc_r() { uint8_t data = m_in_c; - if (!m_in_pc_cb.isnull()) + if (!m_in_pc_cb.isunset()) data &= m_in_pc_cb(); data = (data & ~m_ddr_c) | (m_ddr_c & m_port_c); @@ -360,7 +350,7 @@ uint8_t tpi6525_device::read(offs_t offset) case 0: data = m_in_a; - if (!m_in_pa_cb.isnull()) + if (!m_in_pa_cb.isunset()) data &= m_in_pa_cb(0); data = (data & ~m_ddr_a) | (m_ddr_a & m_port_a); @@ -370,7 +360,7 @@ uint8_t tpi6525_device::read(offs_t offset) case 1: data = m_in_b; - if (!m_in_pb_cb.isnull()) + if (!m_in_pb_cb.isunset()) data &= m_in_pb_cb(0); data = (data & ~m_ddr_b) | (m_ddr_b & m_port_b); @@ -395,7 +385,7 @@ uint8_t tpi6525_device::read(offs_t offset) { data = m_in_c; - if (!m_in_pc_cb.isnull()) + if (!m_in_pc_cb.isunset()) data &= m_in_pc_cb(0); data = (data & ~m_ddr_c) | (m_ddr_c & m_port_c); diff --git a/src/devices/machine/6532riot.cpp b/src/devices/machine/6532riot.cpp index daa2e65fc9d..059efe151fc 100644 --- a/src/devices/machine/6532riot.cpp +++ b/src/devices/machine/6532riot.cpp @@ -295,7 +295,7 @@ uint8_t riot6532_device::reg_r(uint8_t offset, bool debugger_access) else { /* call the input callback if it exists */ - if (!(*port->m_in_cb).isnull()) + if (!(*port->m_in_cb).isunset()) { port->m_in = (*port->m_in_cb)(0); @@ -413,21 +413,21 @@ void riot6532_device::pb7_w(int state) { portb_in_set(state ? 0x80 : 0x00, 0x80) // riot6532_device - constructor //------------------------------------------------- -riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, RIOT6532, tag, owner, clock), - m_in_pa_cb(*this), - m_out_pa_cb(*this), - m_in_pb_cb(*this), - m_out_pb_cb(*this), - m_irq_cb(*this), - m_irqstate(0), - m_irqenable(0), - m_irq(CLEAR_LINE), - m_pa7dir(0), - m_pa7prev(0), - m_timershift(0), - m_timerstate(0), - m_timer(nullptr) +riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, RIOT6532, tag, owner, clock), + m_in_pa_cb(*this, 0), + m_out_pa_cb(*this), + m_in_pb_cb(*this, 0), + m_out_pb_cb(*this), + m_irq_cb(*this), + m_irqstate(0), + m_irqenable(0), + m_irq(CLEAR_LINE), + m_pa7dir(0), + m_pa7prev(0), + m_timershift(0), + m_timerstate(0), + m_timer(nullptr) { memset(m_port, 0x00, sizeof(m_port)); } @@ -439,15 +439,10 @@ riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, void riot6532_device::device_start() { /* resolve callbacks */ - m_in_pa_cb.resolve(); m_port[0].m_in_cb = &m_in_pa_cb; - m_out_pa_cb.resolve_safe(); m_port[0].m_out_cb = &m_out_pa_cb; - m_in_pb_cb.resolve(); m_port[1].m_in_cb = &m_in_pb_cb; - m_out_pb_cb.resolve_safe(); m_port[1].m_out_cb = &m_out_pb_cb; - m_irq_cb.resolve_safe(); /* allocate timers */ m_timer = timer_alloc(FUNC(riot6532_device::timer_end), this); diff --git a/src/devices/machine/68153bim.cpp b/src/devices/machine/68153bim.cpp index f00eb88bf10..85758b13b56 100644 --- a/src/devices/machine/68153bim.cpp +++ b/src/devices/machine/68153bim.cpp @@ -86,7 +86,7 @@ bim68153_device::bim68153_device(const machine_config &mconfig, device_type type , m_out_int_cb(*this) , m_out_intal0_cb(*this) , m_out_intal1_cb(*this) - , m_out_iackout_cb(*this) + , m_out_iackout_cb(*this, 0) , m_iackin(ASSERT_LINE) , m_irq_level(0) { @@ -126,11 +126,6 @@ int bim68153_device::get_channel_index(bim68153_channel *ch) void bim68153_device::device_start() { LOG("%s\n", FUNCNAME); - // resolve callbacks - m_out_int_cb.resolve_safe(); - m_out_intal0_cb.resolve_safe(); - m_out_intal1_cb.resolve_safe(); - m_out_iackout_cb.resolve_safe(0); } //------------------------------------------------- @@ -318,7 +313,7 @@ void bim68153_device::write(offs_t offset, uint8_t data) bim68153_channel::bim68153_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68153_CHANNEL, tag, owner, clock) - , m_out_iack_cb(*this) + , m_out_iack_cb(*this, 0) , m_int_state(NONE) , m_control(0) , m_vector(0) @@ -341,9 +336,6 @@ void bim68153_channel::device_start() save_item(NAME(m_control)); save_item(NAME(m_vector)); save_item(NAME(m_int_state)); - - // Resolve callbacks - m_out_iack_cb.resolve_safe(0); } diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp index feae3e965c7..c7233fc5845 100644 --- a/src/devices/machine/6821pia.cpp +++ b/src/devices/machine/6821pia.cpp @@ -45,58 +45,34 @@ DEFINE_DEVICE_TYPE(PIA6821, pia6821_device, "pia6821", "6821 PIA") // pia6821_device - constructor //------------------------------------------------- -pia6821_device::pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, PIA6821, tag, owner, clock), - m_in_a_handler(*this), - m_in_b_handler(*this), - m_in_ca1_handler(*this), - m_in_cb1_handler(*this), - m_in_ca2_handler(*this), - m_out_a_handler(*this), - m_out_b_handler(*this), - m_ts_b_handler(*this), - m_ca2_handler(*this), - m_cb2_handler(*this), - m_irqa_handler(*this), - m_irqb_handler(*this), m_in_a(0), - m_in_ca1(true), m_in_ca2(true), m_out_a(0), m_a_input_overrides_output_mask(0), m_out_ca2(0), m_ddr_a(0), - m_ctl_a(0), m_irq_a1(false), m_irq_a2(false), - m_irq_a_state(0), m_in_b(0), - m_in_cb1(0), m_in_cb2(0), m_out_b(0), m_out_cb2(0), m_last_out_cb2_z(0), m_ddr_b(0), - m_ctl_b(0), m_irq_b1(false), m_irq_b2(false), - m_irq_b_state(0), m_in_a_pushed(false), m_out_a_needs_pulled(false), m_in_ca1_pushed(false), - m_in_ca2_pushed(false), m_out_ca2_needs_pulled(false), m_in_b_pushed(false), m_out_b_needs_pulled(false), - m_in_cb1_pushed(false), m_in_cb2_pushed(false), m_out_cb2_needs_pulled(false), m_logged_port_a_not_connected(false), - m_logged_port_b_not_connected(false), m_logged_ca1_not_connected(false), m_logged_ca2_not_connected(false), - m_logged_cb1_not_connected(false), m_logged_cb2_not_connected(false) +pia6821_device::pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, PIA6821, tag, owner, clock), + m_in_a_handler(*this, 0), + m_in_b_handler(*this, 0), + m_in_ca1_handler(*this, 1), + m_in_cb1_handler(*this, 0), + m_in_ca2_handler(*this, 1), + m_out_a_handler(*this), + m_out_b_handler(*this), + m_ts_b_handler(*this, 0), + m_ca2_handler(*this), + m_cb2_handler(*this), + m_irqa_handler(*this), + m_irqb_handler(*this), m_in_a(0), + m_in_ca1(true), m_in_ca2(true), m_out_a(0), m_a_input_overrides_output_mask(0), m_out_ca2(0), m_ddr_a(0), + m_ctl_a(0), m_irq_a1(false), m_irq_a2(false), + m_irq_a_state(0), m_in_b(0), + m_in_cb1(0), m_in_cb2(0), m_out_b(0), m_out_cb2(0), m_last_out_cb2_z(0), m_ddr_b(0), + m_ctl_b(0), m_irq_b1(false), m_irq_b2(false), + m_irq_b_state(0), m_in_a_pushed(false), m_out_a_needs_pulled(false), m_in_ca1_pushed(false), + m_in_ca2_pushed(false), m_out_ca2_needs_pulled(false), m_in_b_pushed(false), m_out_b_needs_pulled(false), + m_in_cb1_pushed(false), m_in_cb2_pushed(false), m_out_cb2_needs_pulled(false), m_logged_port_a_not_connected(false), + m_logged_port_b_not_connected(false), m_logged_ca1_not_connected(false), m_logged_ca2_not_connected(false), + m_logged_cb1_not_connected(false), m_logged_cb2_not_connected(false) { } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void pia6821_device::device_resolve_objects() -{ - // resolve callbacks - m_in_a_handler.resolve(); - m_in_b_handler.resolve(); - m_in_ca1_handler.resolve(); - m_in_cb1_handler.resolve(); - m_in_ca2_handler.resolve(); - m_out_a_handler.resolve(); - m_out_b_handler.resolve(); - m_ts_b_handler.resolve(); - m_ca2_handler.resolve(); - m_cb2_handler.resolve(); - m_irqa_handler.resolve_safe(); - m_irqb_handler.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -185,13 +161,13 @@ void pia6821_device::device_reset() m_irqb_handler(CLEAR_LINE); // reset port A to internal pullups - if (!m_out_a_handler.isnull()) + if (!m_out_a_handler.isunset()) m_out_a_handler(0xff); - if (!m_ca2_handler.isnull()) + if (!m_ca2_handler.isunset()) m_ca2_handler(1); // reset port B to three-state outputs - if (!m_out_b_handler.isnull() && !m_ts_b_handler.isnull()) + if (!m_out_b_handler.isunset() && !m_ts_b_handler.isunset()) m_out_b_handler(offs_t(0), m_ts_b_handler(), 0); } @@ -232,7 +208,7 @@ uint8_t pia6821_device::get_in_a_value() uint8_t ret; // update the input - if (!m_in_a_handler.isnull()) + if (!m_in_a_handler.isunset()) { port_a_data = m_in_a_handler(0); } @@ -285,7 +261,7 @@ uint8_t pia6821_device::get_in_b_value() uint8_t port_b_data; // update the input - if (!m_in_b_handler.isnull()) + if (!m_in_b_handler.isunset()) { port_b_data = m_in_b_handler(0); } @@ -349,7 +325,7 @@ uint8_t pia6821_device::get_out_b_value() uint8_t ret = m_out_b & m_ddr_b; // input pins are high-impedance - send them as zeros for backwards compatibility - if (m_ddr_b != 0xff && !m_ts_b_handler.isnull()) + if (m_ddr_b != 0xff && !m_ts_b_handler.isunset()) ret |= m_ts_b_handler() & ~m_ddr_b; return ret; @@ -365,7 +341,7 @@ void pia6821_device::set_out_ca2(int data) m_out_ca2 = data; // send to output function - if (!m_ca2_handler.isnull()) + if (!m_ca2_handler.isunset()) { m_ca2_handler(m_out_ca2); } @@ -393,7 +369,7 @@ void pia6821_device::set_out_cb2(int data) m_last_out_cb2_z = z; // send to output function - if (!m_cb2_handler.isnull()) + if (!m_cb2_handler.isunset()) { m_cb2_handler(m_out_cb2); } @@ -511,21 +487,21 @@ uint8_t pia6821_device::control_a_r() if (!machine().side_effects_disabled()) { // update CA1 & CA2 if callback exists, these in turn may update IRQ's - if (!m_in_ca1_handler.isnull()) + if (!m_in_ca1_handler.isunset()) { ca1_w(m_in_ca1_handler()); } - else if(!m_logged_ca1_not_connected && (!m_in_ca1_pushed)) + else if (!m_logged_ca1_not_connected && (!m_in_ca1_pushed)) { logerror("Warning! No CA1 read handler. Assuming pin not connected\n"); m_logged_ca1_not_connected = true; } - if (!m_in_ca2_handler.isnull()) + if (!m_in_ca2_handler.isunset()) { ca2_w(m_in_ca2_handler()); } - else if ( !m_logged_ca2_not_connected && c2_input(m_ctl_a) && !m_in_ca2_pushed) + else if (!m_logged_ca2_not_connected && c2_input(m_ctl_a) && !m_in_ca2_pushed) { logerror("Warning! No CA2 read handler. Assuming pin not connected\n"); m_logged_ca2_not_connected = true; @@ -559,7 +535,7 @@ uint8_t pia6821_device::control_b_r() if (!machine().side_effects_disabled()) { // update CB1 & CB2 if callback exists, these in turn may update IRQ's - if(!m_in_cb1_handler.isnull()) + if(!m_in_cb1_handler.isunset()) { cb1_w(m_in_cb1_handler()); } @@ -636,7 +612,7 @@ void pia6821_device::send_to_out_a_func(const char* message) LOG("PIA %s = %02X DDRA=%02x\n", message, data, m_ddr_a); - if (!m_out_a_handler.isnull()) + if (!m_out_a_handler.isunset()) { m_out_a_handler(offs_t(0), data); } @@ -660,7 +636,7 @@ void pia6821_device::send_to_out_b_func(const char* message) LOG("PIA %s = %02X DDRB=%02x\n", message, data, m_ddr_b); - if (!m_out_b_handler.isnull()) + if (!m_out_b_handler.isunset()) { m_out_b_handler(offs_t(0), data, m_ddr_b); } @@ -786,7 +762,7 @@ void pia6821_device::control_a_w(uint8_t data) else if (ca2_was_output) { LOGSETUP(" - CA2 pulled up as input\n"); - if (!m_ca2_handler.isnull()) + if (!m_ca2_handler.isunset()) m_ca2_handler(1); } @@ -871,7 +847,7 @@ void pia6821_device::write(offs_t offset, uint8_t data) void pia6821_device::set_a_input(uint8_t data) { - if (!m_in_a_handler.isnull()) + if (!m_in_a_handler.isunset()) throw emu_fatalerror("pia6821_device::set_a_input() called when m_in_a_handler set"); LOG("Set PIA input port A = %02X\n", data); @@ -1005,7 +981,7 @@ bool pia6821_device::ca2_output_z() void pia6821_device::portb_w(uint8_t data) { - if (!m_in_b_handler.isnull()) + if (!m_in_b_handler.isunset()) throw emu_fatalerror("pia6821_device::portb_w() called when in_b_func implemented"); LOG("Set PIA input port B = %02X\n", data); diff --git a/src/devices/machine/6821pia.h b/src/devices/machine/6821pia.h index 88c941578b4..28f8e8af925 100644 --- a/src/devices/machine/6821pia.h +++ b/src/devices/machine/6821pia.h @@ -103,8 +103,7 @@ public: int irq_b_state() const { return m_irq_b_state; } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/68230pit.cpp b/src/devices/machine/68230pit.cpp index 30005950805..0577d63ddba 100644 --- a/src/devices/machine/68230pit.cpp +++ b/src/devices/machine/68230pit.cpp @@ -51,11 +51,11 @@ DEFINE_DEVICE_TYPE(PIT68230, pit68230_device, "pit68230", "MC68230 PI/T") pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant) : device_t(mconfig, type, tag, owner, clock) , m_pa_out_cb(*this) - , m_pa_in_cb(*this) + , m_pa_in_cb(*this, 0) , m_pb_out_cb(*this) - , m_pb_in_cb(*this) + , m_pb_in_cb(*this, 0) , m_pc_out_cb(*this) - , m_pc_in_cb(*this) + , m_pc_in_cb(*this, 0) , m_h1_out_cb(*this) , m_h2_out_cb(*this) , m_h3_out_cb(*this) @@ -100,29 +100,9 @@ void pit68230_device::device_start() LOGSETUP("pit68230_device::device_start\n"); // NOTE: - // Not using resolve_safe for the m_px_in_cb's is a temporary way to be able to check + // Not using resolve_safe for the m_px_in_cb's was a temporary way to be able to check // if a handler is installed with isnull(). The safe function installs a dummy default - // handler which disable the isnull() test. TODO: Need a better fix? - - // resolve callbacks Port A - m_pa_out_cb.resolve_safe(); - m_pa_in_cb.resolve(); - - // resolve callbacks Port B - m_pb_out_cb.resolve_safe(); - m_pb_in_cb.resolve(); - - // resolve callbacks Port C - m_pc_out_cb.resolve_safe(); - m_pc_in_cb.resolve(); - - m_h1_out_cb.resolve_safe(); - m_h2_out_cb.resolve_safe(); - m_h3_out_cb.resolve_safe(); - m_h4_out_cb.resolve_safe(); - - m_tirq_out_cb.resolve_safe(); - m_pirq_out_cb.resolve_safe(); + // handler which disabled the isnull() test. TODO: Need a better fix? // Timers pit_timer = timer_alloc(FUNC(pit68230_device::tick_clock), this); @@ -809,7 +789,7 @@ uint8_t pit68230_device::rr_pitreg_pbcr() uint8_t pit68230_device::rr_pitreg_padr() { m_padr &= m_paddr; - if (!m_pa_in_cb.isnull()) + if (!m_pa_in_cb.isunset()) { m_padr |= m_pa_in_cb() & ~m_paddr; } @@ -831,7 +811,7 @@ uint8_t pit68230_device::rr_pitreg_padr() uint8_t pit68230_device::rr_pitreg_pbdr() { m_pbdr &= m_pbddr; - if (!m_pb_in_cb.isnull()) + if (!m_pb_in_cb.isunset()) { m_pbdr |= m_pb_in_cb() & ~m_pbddr; } @@ -848,7 +828,7 @@ uint8_t pit68230_device::rr_pitreg_pbdr() uint8_t pit68230_device::rr_pitreg_pcdr() { m_pcdr &= m_pcddr; - if (!m_pc_in_cb.isnull()) // Port C has alternate functions that may set bits apart from callback + if (!m_pc_in_cb.isunset()) // Port C has alternate functions that may set bits apart from callback { m_pcdr |= m_pc_in_cb() & ~m_pcddr; } @@ -871,7 +851,7 @@ the instantaneous pin level is read and no input latching is performed except at data bus interface. Writes to this address are answered with DTACK, but the data is ignored.*/ uint8_t pit68230_device::rr_pitreg_paar() { - uint8_t ret = m_pa_in_cb.isnull() ? 0 : m_pa_in_cb(); + const uint8_t ret = m_pa_in_cb(); LOGR("%s pit68230_device::rr_pitreg_paar <- %02x\n", tag(), ret); return ret; } @@ -882,7 +862,7 @@ the instantaneous pin level is read and no input latching is performed except at data bus interface.Writes to this address are answered with DTACK, but the data is ignored.*/ uint8_t pit68230_device::rr_pitreg_pbar() { - uint8_t ret = m_pb_in_cb.isnull() ? 0 : m_pb_in_cb(); + const uint8_t ret = m_pb_in_cb(); LOGR("%s pit68230_device::rr_pitreg_pbar <- %02x\n", tag(), ret); return ret; } diff --git a/src/devices/machine/68307.cpp b/src/devices/machine/68307.cpp index 599cdf4bb9b..a950be1fd2b 100644 --- a/src/devices/machine/68307.cpp +++ b/src/devices/machine/68307.cpp @@ -61,7 +61,7 @@ m68307_cpu_device::m68307_cpu_device(const machine_config &mconfig, const char * m_write_irq(*this), m_write_a_tx(*this), m_write_b_tx(*this), - m_read_inport(*this), + m_read_inport(*this, 0), m_write_outport(*this), m_porta_r(*this), m_porta_w(*this), @@ -252,12 +252,6 @@ void m68307_cpu_device::device_start() m_m68307_scrhigh = 0x0007; m_m68307_scrlow = 0xf010; - m_write_irq.resolve_safe(); - m_write_a_tx.resolve_safe(); - m_write_b_tx.resolve_safe(); - m_read_inport.resolve(); - m_write_outport.resolve_safe(); - m_porta_r.set(nullptr); m_porta_w.set(nullptr); m_portb_r.set(nullptr); diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp index 0e21dfeac3e..eb836dd506e 100644 --- a/src/devices/machine/68340.cpp +++ b/src/devices/machine/68340.cpp @@ -229,9 +229,9 @@ m68340_cpu_device::m68340_cpu_device(const machine_config &mconfig, const char * , m_crystal(0) , m_extal(0) , m_pa_out_cb(*this) - , m_pa_in_cb(*this) + , m_pa_in_cb(*this, 0) , m_pb_out_cb(*this) - , m_pb_in_cb(*this) + , m_pb_in_cb(*this, 0) { m_m68340SIM = nullptr; m_m68340DMA = nullptr; diff --git a/src/devices/machine/68340.h b/src/devices/machine/68340.h index 4731da74ac6..4965066548f 100644 --- a/src/devices/machine/68340.h +++ b/src/devices/machine/68340.h @@ -28,10 +28,8 @@ public: auto pb_out_callback() { return m_pb_out_cb.bind(); } auto tout1_out_callback() { return m_timer[0]->m_tout_out_cb.bind(); } - auto tin1_in_callback() { return m_timer[0]->m_tin_in_cb.bind(); } auto tgate1_in_callback() { return m_timer[0]->m_tgate_in_cb.bind(); } auto tout2_out_callback() { return m_timer[1]->m_tout_out_cb.bind(); } - auto tin2_in_callback() { return m_timer[1]->m_tin_in_cb.bind(); } auto tgate2_in_callback() { return m_timer[1]->m_tgate_in_cb.bind(); } uint16_t get_cs(offs_t address); diff --git a/src/devices/machine/68340sim.cpp b/src/devices/machine/68340sim.cpp index 94483e625cc..4ef9a9c28a0 100644 --- a/src/devices/machine/68340sim.cpp +++ b/src/devices/machine/68340sim.cpp @@ -208,7 +208,7 @@ uint8_t m68340_cpu_device::m68340_internal_sim_ports_r(offs_t offset) sim.m_porta &= sim.m_ddra; // TODO: call callback - if (!m_pa_in_cb.isnull()) + if (!m_pa_in_cb.isunset()) { sim.m_porta |= (m_pa_in_cb() & ~sim.m_ddra); } @@ -245,7 +245,7 @@ uint8_t m68340_cpu_device::m68340_internal_sim_ports_r(offs_t offset) sim.m_portb &= sim.m_ddrb; // TODO: call callback - if (!m_pb_in_cb.isnull()) + if (!m_pb_in_cb.isunset()) { sim.m_portb |= (m_pb_in_cb() & ~sim.m_ddrb); } @@ -471,14 +471,6 @@ void m68340_cpu_device::start_68340_sim() LOGCLOCK( " - Clock: %d [0x%08x]\n", clock(), clock()); m_irq_timer = timer_alloc(FUNC(m68340_cpu_device::periodic_interrupt_timer_callback), this); - // resolve callbacks Port A - m_pa_out_cb.resolve_safe(); - m_pa_in_cb.resolve(); - - // resolve callbacks Port B - m_pb_out_cb.resolve_safe(); - m_pb_in_cb.resolve(); - // Setup correct VCO/clock speed based on reset values and crystal assert(m_m68340SIM); m68340_sim &sim = *m_m68340SIM; diff --git a/src/devices/machine/68340tmu.cpp b/src/devices/machine/68340tmu.cpp index 5c39122aac9..281a0226877 100644 --- a/src/devices/machine/68340tmu.cpp +++ b/src/devices/machine/68340tmu.cpp @@ -312,11 +312,6 @@ void mc68340_timer_module_device::device_start() m_timer = timer_alloc(FUNC(mc68340_timer_module_device::timer_callback), this); - // Resolve Timer callbacks - m_tout_out_cb.resolve_safe(); - m_tgate_in_cb.resolve_safe(); - m_tin_in_cb.resolve_safe(); - m_ir = 0x000f; } @@ -517,7 +512,6 @@ void mc68340_timer_module_device::tout_clear() mc68340_timer_module_device::mc68340_timer_module_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68340_TIMER_MODULE, tag, owner, clock) , m_tout_out_cb(*this) - , m_tin_in_cb(*this) , m_tgate_in_cb(*this) { } diff --git a/src/devices/machine/68340tmu.h b/src/devices/machine/68340tmu.h index c450d8003f9..f0f0fd181ef 100644 --- a/src/devices/machine/68340tmu.h +++ b/src/devices/machine/68340tmu.h @@ -47,7 +47,6 @@ protected: emu_timer *m_timer; devcb_write_line m_tout_out_cb; - devcb_write_line m_tin_in_cb; devcb_write_line m_tgate_in_cb; void do_timer_irq(); void do_timer_tick(); diff --git a/src/devices/machine/6840ptm.cpp b/src/devices/machine/6840ptm.cpp index df7c10c6445..0ff2305c307 100644 --- a/src/devices/machine/6840ptm.cpp +++ b/src/devices/machine/6840ptm.cpp @@ -90,10 +90,6 @@ ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, d void ptm6840_device::device_start() { - // resolve callbacks - m_out_cb.resolve_all_safe(); - m_irq_cb.resolve_safe(); - m_timer[0] = timer_alloc(FUNC(ptm6840_device::state_changed), this); m_timer[1] = timer_alloc(FUNC(ptm6840_device::state_changed), this); m_timer[2] = timer_alloc(FUNC(ptm6840_device::state_changed), this); diff --git a/src/devices/machine/6850acia.cpp b/src/devices/machine/6850acia.cpp index 57b8fa74cd7..625f5ba67b5 100644 --- a/src/devices/machine/6850acia.cpp +++ b/src/devices/machine/6850acia.cpp @@ -109,11 +109,6 @@ acia6850_device::acia6850_device(const machine_config &mconfig, device_type type void acia6850_device::device_start() { - // resolve callbacks - m_txd_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - m_irq_handler.resolve_safe(); - save_item(NAME(m_status)); save_item(NAME(m_tdr)); save_item(NAME(m_rdr)); diff --git a/src/devices/machine/68561mpcc.cpp b/src/devices/machine/68561mpcc.cpp index 4ca3b4d7cfe..77bad6bf7a3 100644 --- a/src/devices/machine/68561mpcc.cpp +++ b/src/devices/machine/68561mpcc.cpp @@ -169,14 +169,6 @@ void mpcc_device::device_start() { LOGSETUP("%s\n", FUNCNAME); - // resolve callbacks - m_out_txd_cb.resolve_safe(); - m_out_dtr_cb.resolve_safe(); - m_out_rts_cb.resolve_safe(); - m_out_rtxc_cb.resolve_safe(); - m_out_trxc_cb.resolve_safe(); - m_out_int_cb.resolve_safe(); - // state saving save_item(NAME(m_int_state)); save_item(NAME(m_rsr)); diff --git a/src/devices/machine/7200fifo.cpp b/src/devices/machine/7200fifo.cpp index e9cb45f66a7..6daed3137bc 100644 --- a/src/devices/machine/7200fifo.cpp +++ b/src/devices/machine/7200fifo.cpp @@ -72,11 +72,6 @@ void fifo7200_device::device_start() assert(m_ram_size > 1 && ~m_ram_size & 1); m_buffer.resize(m_ram_size); - // resolve callbacks - m_ef_handler.resolve_safe(); - m_ff_handler.resolve_safe(); - m_hf_handler.resolve_safe(); - // state save save_item(NAME(m_buffer)); save_item(NAME(m_read_ptr)); diff --git a/src/devices/machine/7400.cpp b/src/devices/machine/7400.cpp index 73bad879e73..74631c81007 100644 --- a/src/devices/machine/7400.cpp +++ b/src/devices/machine/7400.cpp @@ -22,8 +22,6 @@ ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, d void ttl7400_device::device_start() { - m_y_func.resolve_all_safe(); - save_item(NAME(m_a)); save_item(NAME(m_b)); save_item(NAME(m_y)); diff --git a/src/devices/machine/7404.cpp b/src/devices/machine/7404.cpp index 3a614a3525a..4ffddf2548a 100644 --- a/src/devices/machine/7404.cpp +++ b/src/devices/machine/7404.cpp @@ -21,8 +21,6 @@ ttl7404_device::ttl7404_device(const machine_config &mconfig, const char *tag, d void ttl7404_device::device_start() { - m_y_func.resolve_all_safe(); - save_item(NAME(m_a)); save_item(NAME(m_y)); } diff --git a/src/devices/machine/74123.cpp b/src/devices/machine/74123.cpp index fb238ee01a8..895d49a4a9e 100644 --- a/src/devices/machine/74123.cpp +++ b/src/devices/machine/74123.cpp @@ -47,8 +47,6 @@ ttl74123_device::ttl74123_device(const machine_config &mconfig, const char *tag, void ttl74123_device::device_start() { - m_output_changed_cb.resolve_safe(); - m_clear_timer = timer_alloc(FUNC(ttl74123_device::clear_callback), this); m_output_timer = timer_alloc(FUNC(ttl74123_device::output_callback), this); diff --git a/src/devices/machine/74145.cpp b/src/devices/machine/74145.cpp index 1ac1a41ffa6..922fa104885 100644 --- a/src/devices/machine/74145.cpp +++ b/src/devices/machine/74145.cpp @@ -73,9 +73,6 @@ ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, void ttl74145_device::device_start() { - /* resolve callbacks */ - m_output_line_cb.resolve_all_safe(); - // register for state saving save_item(NAME(m_number)); } diff --git a/src/devices/machine/74148.cpp b/src/devices/machine/74148.cpp index 61097815db3..44b62d95bc9 100644 --- a/src/devices/machine/74148.cpp +++ b/src/devices/machine/74148.cpp @@ -68,8 +68,6 @@ ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, void ttl74148_device::device_start() { - m_output_cb.resolve_safe(); - save_item(NAME(m_input_lines)); save_item(NAME(m_enable_input)); save_item(NAME(m_output)); @@ -157,9 +155,8 @@ void ttl74148_device::update() /* call callback if any of the outputs changed */ - if (!m_output_cb.isnull() && - ((m_output != m_last_output) || - (m_output_valid != m_last_output_valid) || (m_enable_output != m_last_enable_output))) + if ((m_output != m_last_output) || + (m_output_valid != m_last_output_valid) || (m_enable_output != m_last_enable_output)) { m_last_output = m_output; m_last_output_valid = m_output_valid; diff --git a/src/devices/machine/74153.cpp b/src/devices/machine/74153.cpp index 258933ae547..b13b1ecb53b 100644 --- a/src/devices/machine/74153.cpp +++ b/src/devices/machine/74153.cpp @@ -44,10 +44,6 @@ ttl153_device::ttl153_device(const machine_config &mconfig, const char *tag, dev void ttl153_device::device_start() { - // resolve callbacks - m_za_cb.resolve_safe(); - m_zb_cb.resolve_safe(); - // register for save states save_pointer(NAME(m_s), 2); save_pointer(NAME(m_ia), 4); diff --git a/src/devices/machine/74157.cpp b/src/devices/machine/74157.cpp index d70ba821f04..aea9dbaa532 100644 --- a/src/devices/machine/74157.cpp +++ b/src/devices/machine/74157.cpp @@ -42,8 +42,8 @@ ls157_device::ls157_device(const machine_config &mconfig, const char *tag, devic ls157_device::ls157_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 mask) : device_t(mconfig, type, tag, owner, clock) - , m_a_in_cb(*this) - , m_b_in_cb(*this) + , m_a_in_cb(*this, 0) + , m_b_in_cb(*this, 0) , m_out_cb(*this) , m_data_mask(mask) { @@ -71,11 +71,6 @@ ls157_x2_device::ls157_x2_device(const machine_config &mconfig, const char *tag, void ls157_device::device_start() { - // resolve callbacks - m_a_in_cb.resolve(); - m_b_in_cb.resolve(); - m_out_cb.resolve(); - // register items for save state save_item(NAME(m_a)); save_item(NAME(m_b)); @@ -170,7 +165,7 @@ void ls157_device::write_a_bit(int bit, bool state) else m_a &= ~(1 << bit); - if (!m_strobe && !m_select && !m_out_cb.isnull()) + if (!m_strobe && !m_select && !m_out_cb.isunset()) m_out_cb(m_a); } } @@ -194,7 +189,7 @@ void ls157_device::write_b_bit(int bit, bool state) else m_b &= ~(1 << bit); - if (!m_strobe && m_select && !m_out_cb.isnull()) + if (!m_strobe && m_select && !m_out_cb.isunset()) m_out_cb(m_b); } } @@ -229,7 +224,7 @@ void ls157_device::strobe_w(int state) m_strobe = bool(state); // Clear output when strobe goes high - if (m_strobe && !m_out_cb.isnull()) + if (m_strobe && !m_out_cb.isunset()) m_out_cb(0); else update_output(); @@ -246,12 +241,12 @@ void ls157_device::update_output() { // S high, strobe low: Y1-Y4 = B1-B4 // S low, strobe low: Y1-Y4 = A1-A4 - if (!m_strobe && !m_out_cb.isnull()) + if (!m_strobe && !m_out_cb.isunset()) { if (m_select) - m_out_cb(m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & m_data_mask)); + m_out_cb(m_b_in_cb.isunset() ? m_b : (m_b_in_cb() & m_data_mask)); else - m_out_cb(m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & m_data_mask)); + m_out_cb(m_a_in_cb.isunset() ? m_a : (m_a_in_cb() & m_data_mask)); } } @@ -265,9 +260,9 @@ u8 ls157_device::output_r() if (m_strobe) return 0; else if (m_select) - return m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & m_data_mask); + return m_b_in_cb.isunset() ? m_b : (m_b_in_cb() & m_data_mask); else - return m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & m_data_mask); + return m_a_in_cb.isunset() ? m_a : (m_a_in_cb() & m_data_mask); } diff --git a/src/devices/machine/74161.cpp b/src/devices/machine/74161.cpp index 7bd4e720d20..888cf7f608c 100644 --- a/src/devices/machine/74161.cpp +++ b/src/devices/machine/74161.cpp @@ -65,9 +65,6 @@ void ttl7416x_device::device_start() save_item(NAME(m_pclock)); save_item(NAME(m_p)); save_item(NAME(m_out)); - - m_output_func.resolve_safe(); - m_tc_func.resolve_safe(); } void ttl7416x_device::device_reset() diff --git a/src/devices/machine/74165.cpp b/src/devices/machine/74165.cpp index 7d588525677..706b3f98274 100644 --- a/src/devices/machine/74165.cpp +++ b/src/devices/machine/74165.cpp @@ -39,7 +39,7 @@ void ttl165_device::device_add_mconfig(machine_config &config) ttl165_device::ttl165_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL165, tag, owner, clock), m_timer(*this, "timer"), - m_data_cb(*this), m_qh_cb(*this), + m_data_cb(*this, 0x00), m_qh_cb(*this), m_data(0x00), m_ser(0), m_clk(0), m_shld(0) { @@ -51,10 +51,6 @@ ttl165_device::ttl165_device(const machine_config &mconfig, const char *tag, dev void ttl165_device::device_start() { - // resolve callbacks - m_data_cb.resolve_safe(0x00); - m_qh_cb.resolve_safe(); - // register for save states save_item(NAME(m_data)); save_item(NAME(m_ser)); diff --git a/src/devices/machine/74166.cpp b/src/devices/machine/74166.cpp index a5a32187266..3a2139e6843 100644 --- a/src/devices/machine/74166.cpp +++ b/src/devices/machine/74166.cpp @@ -39,7 +39,7 @@ void ttl166_device::device_add_mconfig(machine_config &config) ttl166_device::ttl166_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL166, tag, owner, clock), m_timer(*this, "timer"), - m_data_cb(*this), m_qh_cb(*this), + m_data_cb(*this, 0x00), m_qh_cb(*this), m_data(0x00), m_ser(0), m_clk(0), m_shld(0) { @@ -51,10 +51,6 @@ ttl166_device::ttl166_device(const machine_config &mconfig, const char *tag, dev void ttl166_device::device_start() { - // resolve callbacks - m_data_cb.resolve_safe(0x00); - m_qh_cb.resolve_safe(); - // register for save states save_item(NAME(m_data)); save_item(NAME(m_ser)); diff --git a/src/devices/machine/74175.cpp b/src/devices/machine/74175.cpp index 48f1eae439a..d3263c9cff3 100644 --- a/src/devices/machine/74175.cpp +++ b/src/devices/machine/74175.cpp @@ -61,11 +61,6 @@ void ttl741745_device::device_start() save_item(NAME(m_q2)); save_item(NAME(m_q3)); save_item(NAME(m_q4)); - - m_q1_func.resolve_safe(); - m_q2_func.resolve_safe(); - m_q3_func.resolve_safe(); - m_q4_func.resolve_safe(); } void ttl741745_device::device_reset() @@ -81,9 +76,6 @@ void ttl74174_device::device_start() save_item(NAME(m_d6)); save_item(NAME(m_q5)); save_item(NAME(m_q6)); - - m_q5_func.resolve_safe(); - m_q6_func.resolve_safe(); } void ttl74175_device::device_start() @@ -92,11 +84,6 @@ void ttl74175_device::device_start() save_item(NAME(m_not_q2)); save_item(NAME(m_not_q3)); save_item(NAME(m_not_q4)); - - m_not_q1_func.resolve_safe(); - m_not_q2_func.resolve_safe(); - m_not_q3_func.resolve_safe(); - m_not_q4_func.resolve_safe(); } void ttl741745_device::init() diff --git a/src/devices/machine/74259.cpp b/src/devices/machine/74259.cpp index 90cafc4210a..4ebecc5ab7e 100644 --- a/src/devices/machine/74259.cpp +++ b/src/devices/machine/74259.cpp @@ -116,10 +116,6 @@ addressable_latch_device::addressable_latch_device(const machine_config &mconfig void addressable_latch_device::device_start() { - // resolve callbacks - m_q_out_cb.resolve_all(); - m_parallel_out_cb.resolve(); - // initial input state m_address = 0; m_data = false; @@ -214,15 +210,13 @@ void addressable_latch_device::update_bit() } // update output line via callback - if (!m_q_out_cb[m_address].isnull()) - m_q_out_cb[m_address](m_data); + m_q_out_cb[m_address](m_data); // update parallel output - if (!m_parallel_out_cb.isnull()) - m_parallel_out_cb(0, m_q, 1 << m_address); + m_parallel_out_cb(0, m_q, 1 << m_address); // do some logging - if (LOG_ALL_WRITES || (LOG_UNDEFINED_WRITES && m_q_out_cb[m_address].isnull() && m_parallel_out_cb.isnull())) + if (LOG_ALL_WRITES || (LOG_UNDEFINED_WRITES && m_q_out_cb[m_address].isunset() && m_parallel_out_cb.isunset())) logerror("Q%d %s at %s\n", m_address, m_data ? "set" : "cleared", machine().describe_context()); } @@ -367,12 +361,11 @@ void addressable_latch_device::clear_outputs(u8 new_q) // return any previously set output lines to clear state for (int bit = 0; bit < 8; bit++) - if (BIT(bits_changed, bit) && !m_q_out_cb[bit].isnull()) + if (BIT(bits_changed, bit)) m_q_out_cb[bit](BIT(new_q, bit)); // update parallel output - if (!m_parallel_out_cb.isnull()) - m_parallel_out_cb(0, new_q, bits_changed); + m_parallel_out_cb(0, new_q, bits_changed); } //************************************************************************** diff --git a/src/devices/machine/74381.cpp b/src/devices/machine/74381.cpp index 65514a414e3..1ce19a17121 100644 --- a/src/devices/machine/74381.cpp +++ b/src/devices/machine/74381.cpp @@ -42,10 +42,6 @@ void sn74s381_device::device_start() save_item(NAME(m_f)); save_item(NAME(m_p)); save_item(NAME(m_g)); - - m_f_out.resolve_safe(); - m_p_out.resolve_safe(); - m_g_out.resolve_safe(); } void sn74s381_device::device_reset() diff --git a/src/devices/machine/74543.cpp b/src/devices/machine/74543.cpp index 643ff829e50..632deaf26a9 100644 --- a/src/devices/machine/74543.cpp +++ b/src/devices/machine/74543.cpp @@ -35,9 +35,6 @@ void ttl74543_device::device_start() save_item(NAME(m_oeba)); save_item(NAME(m_latch)); - - m_output_a.resolve_safe(); - m_output_b.resolve_safe(); } void ttl74543_device::device_reset() diff --git a/src/devices/machine/7474.cpp b/src/devices/machine/7474.cpp index 1952f7fe869..45e21406edc 100644 --- a/src/devices/machine/7474.cpp +++ b/src/devices/machine/7474.cpp @@ -64,17 +64,6 @@ ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, d } -//------------------------------------------------- -// device_resolve_objects - complete setup -//------------------------------------------------- - -void ttl7474_device::device_resolve_objects() -{ - m_output_func.resolve_safe(); - m_comp_output_func.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/7474.h b/src/devices/machine/7474.h index d8082d3e8ac..3bf2f1ee2e7 100644 --- a/src/devices/machine/7474.h +++ b/src/devices/machine/7474.h @@ -70,8 +70,7 @@ public: int output_comp_r(); // NOT strictly the same as !output_r() protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/8042kbdc.cpp b/src/devices/machine/8042kbdc.cpp index 57ae9d44edc..c1891a89f86 100644 --- a/src/devices/machine/8042kbdc.cpp +++ b/src/devices/machine/8042kbdc.cpp @@ -63,13 +63,6 @@ void kbdc8042_device::device_add_mconfig(machine_config &config) void kbdc8042_device::device_start() { - // resolve callbacks - m_system_reset_cb.resolve_safe(); - m_gate_a20_cb.resolve_safe(); - m_input_buffer_full_cb.resolve_safe(); - m_input_buffer_full_mouse_cb.resolve_safe(); - m_output_buffer_empty_cb.resolve_safe(); - m_speaker_cb.resolve_safe(); m_operation_write_state = 0; /* first write to 0x60 might occur before anything can set this */ memset(&m_keyboard, 0x00, sizeof(m_keyboard)); memset(&m_mouse, 0x00, sizeof(m_mouse)); @@ -110,10 +103,7 @@ void kbdc8042_device::at_8042_set_outport(uint8_t data, int initial) uint8_t change = initial ? 0xFF : (m_outport ^ data); m_outport = data; if (change & 0x02) - { - if (!m_gate_a20_cb.isnull()) - m_gate_a20_cb(data & 0x02 ? 1 : 0); - } + m_gate_a20_cb(data & 0x02 ? 1 : 0); } void kbdc8042_device::keyboard_w(int state) @@ -136,16 +126,15 @@ void kbdc8042_device::at_8042_receive(uint8_t data, bool mouse) if (m_interrupttype == KBDC8042_SINGLE) { - if (!m_input_buffer_full_cb.isnull()) - m_input_buffer_full_cb(1); + m_input_buffer_full_cb(1); } else { - if (m_keyboard.received && (m_command & 1) && !m_input_buffer_full_cb.isnull()) + if (m_keyboard.received && (m_command & 1)) { m_input_buffer_full_cb(1); } - if (m_mouse.received && (m_command & 2) && !m_input_buffer_full_mouse_cb.isnull()) + if (m_mouse.received && (m_command & 2)) { m_input_buffer_full_mouse_cb(1); } @@ -470,8 +459,7 @@ void kbdc8042_device::data_w(offs_t offset, uint8_t data) at_8042_clear_keyboard_received(); } m_speaker &= ~0x80; - if (!m_speaker_cb.isnull()) - m_speaker_cb((offs_t)0, m_speaker); + m_speaker_cb(offs_t(0), m_speaker); break; diff --git a/src/devices/machine/82s129.cpp b/src/devices/machine/82s129.cpp index 573d1b2aa65..39df497009c 100644 --- a/src/devices/machine/82s129.cpp +++ b/src/devices/machine/82s129.cpp @@ -50,12 +50,6 @@ void prom82s129_base_device::device_start() save_item(NAME(m_ce2)); save_item(NAME(m_a)); save_item(NAME(m_out)); - - m_out_func.resolve_safe(); - m_o1_func.resolve_safe(); - m_o2_func.resolve_safe(); - m_o3_func.resolve_safe(); - m_o4_func.resolve_safe(); } void prom82s129_base_device::device_reset() diff --git a/src/devices/machine/8364_paula.cpp b/src/devices/machine/8364_paula.cpp index befdb45d7b6..e6be4c878ad 100644 --- a/src/devices/machine/8364_paula.cpp +++ b/src/devices/machine/8364_paula.cpp @@ -47,7 +47,7 @@ DEFINE_DEVICE_TYPE(PAULA_8364, paula_8364_device, "paula_8364", "MOS 8364 \"Paul paula_8364_device::paula_8364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PAULA_8364, tag, owner, clock) , device_sound_interface(mconfig, *this) - , m_chipmem_r(*this) + , m_chipmem_r(*this, 0) , m_int_w(*this) , m_stream(nullptr) { @@ -59,10 +59,6 @@ paula_8364_device::paula_8364_device(const machine_config &mconfig, const char * void paula_8364_device::device_start() { - // resolve callbacks - m_chipmem_r.resolve_safe(0); - m_int_w.resolve_safe(); - // initialize channels for (int i = 0; i < 4; i++) { diff --git a/src/devices/machine/8530scc.cpp b/src/devices/machine/8530scc.cpp index a84bb842e5d..72e438366db 100644 --- a/src/devices/machine/8530scc.cpp +++ b/src/devices/machine/8530scc.cpp @@ -81,8 +81,7 @@ void scc8530_legacy_device::updateirqs() // tell the driver the new IRQ line status if possible LOG("SCC8530 IRQ status => %d\n", irqstat); - if(!intrq_cb.isnull()) - intrq_cb(irqstat); + intrq_cb(irqstat); } } @@ -167,8 +166,6 @@ TIMER_CALLBACK_MEMBER(scc8530_legacy_device::baud_expire) void scc8530_legacy_device::device_start() { - intrq_cb.resolve(); - memset(channel, 0, sizeof(channel)); mode = 0; @@ -214,8 +211,7 @@ void scc8530_legacy_device::set_status(int _status) void scc8530_legacy_device::acknowledge() { - if(!intrq_cb.isnull()) - intrq_cb(0); + intrq_cb(0); } /*------------------------------------------------- diff --git a/src/devices/machine/acorn_ioc.cpp b/src/devices/machine/acorn_ioc.cpp index 08910c880fa..b105eabed7d 100644 --- a/src/devices/machine/acorn_ioc.cpp +++ b/src/devices/machine/acorn_ioc.cpp @@ -25,9 +25,9 @@ DEFINE_DEVICE_TYPE(ACORN_IOC, acorn_ioc_device, "ioc", "Acorn IOC") acorn_ioc_device::acorn_ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ACORN_IOC, tag, owner, clock) , device_serial_interface(mconfig, *this) - , m_peripherals_r(*this) + , m_peripherals_r(*this, 0xffffffff) , m_peripherals_w(*this) - , m_giop_r(*this) + , m_giop_r(*this, 1) , m_giop_w(*this) , m_irq_w(*this) , m_fiq_w(*this) @@ -36,18 +36,6 @@ acorn_ioc_device::acorn_ioc_device(const machine_config &mconfig, const char *ta { } -void acorn_ioc_device::device_resolve_objects() -{ - m_peripherals_r.resolve_all_safe(0xffffffff); - m_peripherals_w.resolve_all_safe(); - m_giop_r.resolve_all_safe(1); - m_giop_w.resolve_all_safe(); - m_irq_w.resolve_safe(); - m_fiq_w.resolve_safe(); - m_kout_w.resolve_safe(); - m_baud_w.resolve(); -} - void acorn_ioc_device::device_start() { for (int i=0; i <4; i++) @@ -173,7 +161,7 @@ void acorn_ioc_device::set_timer(int tmr) case 2: // Baud generator freq = (double)clock() / 8 / (double)(m_timercnt[tmr] + 1); - if (!m_baud_w.isnull()) + if (!m_baud_w.isunset()) m_timers[tmr]->adjust(attotime::from_usec(freq), tmr); break; diff --git a/src/devices/machine/acorn_ioc.h b/src/devices/machine/acorn_ioc.h index 899e6ba3201..d4761e6089a 100644 --- a/src/devices/machine/acorn_ioc.h +++ b/src/devices/machine/acorn_ioc.h @@ -57,12 +57,11 @@ public: void ir_w(int state); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // device_serial_interface overrides + // device_serial_interface implementation virtual void tra_callback() override; virtual void tra_complete() override; virtual void rcv_complete() override; diff --git a/src/devices/machine/acorn_memc.cpp b/src/devices/machine/acorn_memc.cpp index a68fdab7c0b..8056c85d785 100644 --- a/src/devices/machine/acorn_memc.cpp +++ b/src/devices/machine/acorn_memc.cpp @@ -70,12 +70,6 @@ void acorn_memc_device::memc_map_debug_commands(const std::vectoradjust(attotime::zero, 0, attotime::from_hz(clock())); diff --git a/src/devices/machine/adc0844.cpp b/src/devices/machine/adc0844.cpp index bbdafc68aec..1f745041138 100644 --- a/src/devices/machine/adc0844.cpp +++ b/src/devices/machine/adc0844.cpp @@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE(ADC0848, adc0848_device, "adc0848", "ADC0848 A/D Converter") adc0844_device::adc0844_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), m_intr_cb(*this), - m_ch1_cb(*this), m_ch2_cb(*this), m_ch3_cb(*this), m_ch4_cb(*this), + m_ch1_cb(*this, 0xff), m_ch2_cb(*this, 0xff), m_ch3_cb(*this, 0xff), m_ch4_cb(*this, 0xff), m_conversion_timer(nullptr), m_channel(0x0f), m_result(0xff) @@ -49,7 +49,7 @@ adc0844_device::adc0844_device(const machine_config &mconfig, const char *tag, d adc0848_device::adc0848_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc0844_device(mconfig, ADC0848, tag, owner, clock), - m_ch5_cb(*this), m_ch6_cb(*this), m_ch7_cb(*this), m_ch8_cb(*this) + m_ch5_cb(*this, 0xff), m_ch6_cb(*this, 0xff), m_ch7_cb(*this, 0xff), m_ch8_cb(*this, 0xff) { } @@ -59,13 +59,6 @@ adc0848_device::adc0848_device(const machine_config &mconfig, const char *tag, d void adc0844_device::device_start() { - // resolve callbacks - m_intr_cb.resolve_safe(); - m_ch1_cb.resolve_safe(0xff); - m_ch2_cb.resolve_safe(0xff); - m_ch3_cb.resolve_safe(0xff); - m_ch4_cb.resolve_safe(0xff); - // allocate timers m_conversion_timer = timer_alloc(FUNC(adc0844_device::conversion_complete), this); @@ -74,17 +67,6 @@ void adc0844_device::device_start() save_item(NAME(m_result)); } -void adc0848_device::device_start() -{ - adc0844_device::device_start(); - - // resolve callbacks - m_ch5_cb.resolve_safe(0xff); - m_ch6_cb.resolve_safe(0xff); - m_ch7_cb.resolve_safe(0xff); - m_ch8_cb.resolve_safe(0xff); -} - //------------------------------------------------- // clamp - restrict value to 0..255 //------------------------------------------------- diff --git a/src/devices/machine/adc0844.h b/src/devices/machine/adc0844.h index 98ac8b211d4..b1496690e31 100644 --- a/src/devices/machine/adc0844.h +++ b/src/devices/machine/adc0844.h @@ -49,7 +49,7 @@ public: protected: adc0844_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual TIMER_CALLBACK_MEMBER(conversion_complete); @@ -82,9 +82,6 @@ public: virtual void write(u8 data) override; protected: - // device-level overrides - virtual void device_start() override; - virtual TIMER_CALLBACK_MEMBER(conversion_complete) override; private: diff --git a/src/devices/machine/aic565.cpp b/src/devices/machine/aic565.cpp index 34da7f4fd14..dac7d15aa5a 100644 --- a/src/devices/machine/aic565.cpp +++ b/src/devices/machine/aic565.cpp @@ -48,21 +48,6 @@ aic565_device::aic565_device(const machine_config &mconfig, const char *tag, dev } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void aic565_device::device_resolve_objects() -{ - // resolve callbacks - m_hrst_callback.resolve_safe(); - m_srst_callback.resolve_safe(); - m_irq_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/aic565.h b/src/devices/machine/aic565.h index 581a595d77c..3c799453ed5 100644 --- a/src/devices/machine/aic565.h +++ b/src/devices/machine/aic565.h @@ -37,8 +37,7 @@ public: void local_w(offs_t offset, u8 data); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/aic580.cpp b/src/devices/machine/aic580.cpp index db7b202238a..b06d6b1362b 100644 --- a/src/devices/machine/aic580.cpp +++ b/src/devices/machine/aic580.cpp @@ -35,10 +35,10 @@ DEFINE_DEVICE_TYPE(AIC580, aic580_device, "aic580", "AIC-580 DMA Bus Master") aic580_device::aic580_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, AIC580, tag, owner, clock) - , m_bdin_callback(*this) + , m_bdin_callback(*this, 0) , m_bdout_callback(*this) , m_back_callback(*this) - , m_sread_callback(*this) + , m_sread_callback(*this, 0) , m_swrite_callback(*this) , m_dma_mode(0) , m_channel_addr{0} @@ -49,23 +49,6 @@ aic580_device::aic580_device(const machine_config &mconfig, const char *tag, dev } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void aic580_device::device_resolve_objects() -{ - // resolve callbacks - m_bdin_callback.resolve_safe(0); - m_bdout_callback.resolve_safe(); - m_back_callback.resolve_safe(); - m_sread_callback.resolve_safe(0); - m_swrite_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/aic580.h b/src/devices/machine/aic580.h index ea11d412e18..2ac102d4489 100644 --- a/src/devices/machine/aic580.h +++ b/src/devices/machine/aic580.h @@ -37,8 +37,7 @@ public: void breq_w(int state); protected: - // device-specific overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/aic6250.cpp b/src/devices/machine/aic6250.cpp index 9c5fb08cb1c..6f08895ac44 100644 --- a/src/devices/machine/aic6250.cpp +++ b/src/devices/machine/aic6250.cpp @@ -51,9 +51,9 @@ aic6250_device::aic6250_device(const machine_config &mconfig, device_type type, , nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF) , m_int_cb(*this) , m_breq_cb(*this) - , m_port_a_r_cb(*this) + , m_port_a_r_cb(*this, 0xff) , m_port_a_w_cb(*this) - , m_port_b_r_cb(*this) + , m_port_b_r_cb(*this, 0xff) , m_port_b_w_cb(*this) { } @@ -153,14 +153,6 @@ void aic6250_device::write(offs_t offset, u8 data) void aic6250_device::device_start() { - m_int_cb.resolve_safe(); - m_breq_cb.resolve_safe(); - - m_port_a_r_cb.resolve_safe(0xff); - m_port_a_w_cb.resolve_safe(); - m_port_b_r_cb.resolve_safe(0xff); - m_port_b_w_cb.resolve_safe(); - save_item(NAME(m_dma_count)); save_item(NAME(m_int_msk_reg_0)); save_item(NAME(m_offset_cntrl)); diff --git a/src/devices/machine/akiko.cpp b/src/devices/machine/akiko.cpp index 17de79e7d97..8cddc1eefbd 100644 --- a/src/devices/machine/akiko.cpp +++ b/src/devices/machine/akiko.cpp @@ -23,9 +23,11 @@ #include "emu.h" #include "akiko.h" -#include "coreutil.h" + #include "romload.h" +#include "coreutil.h" + #define LOG_WARN (1U << 1) // Show warnings #define LOG_REGS (1U << 2) // Show register r/w #define LOG_CD (1U << 3) // Show CD interactions and commands @@ -93,8 +95,8 @@ akiko_device::akiko_device(const machine_config &mconfig, const char *tag, devic , m_cdrom_toc(nullptr) , m_dma_timer(nullptr) , m_frame_timer(nullptr) - , m_mem_r(*this), m_mem_w(*this), m_int_w(*this) - , m_scl_w(*this), m_sda_r(*this), m_sda_w(*this) + , m_mem_r(*this, 0xffff), m_mem_w(*this), m_int_w(*this) + , m_scl_w(*this), m_sda_r(*this, 1), m_sda_w(*this) { for (int i = 0; i < 8; i++) { @@ -115,14 +117,6 @@ akiko_device::akiko_device(const machine_config &mconfig, const char *tag, devic void akiko_device::device_start() { - // resolve callbacks - m_mem_r.resolve_safe(0xffff); - m_mem_w.resolve_safe(); - m_int_w.resolve_safe(); - m_scl_w.resolve_safe(); - m_sda_r.resolve_safe(1); - m_sda_w.resolve_safe(); - m_c2p_input_index = 0; m_c2p_output_index = 0; diff --git a/src/devices/machine/am25s55x.cpp b/src/devices/machine/am25s55x.cpp index b1624179463..f3073136aad 100644 --- a/src/devices/machine/am25s55x.cpp +++ b/src/devices/machine/am25s55x.cpp @@ -55,8 +55,6 @@ void am25s55x_device::device_start() save_item(NAME(m_x.u)); save_item(NAME(m_y.u)); save_item(NAME(m_s_out.u)); - - m_s.resolve_safe(); } void am25s55x_device::device_reset() diff --git a/src/devices/machine/am2901b.cpp b/src/devices/machine/am2901b.cpp index f1dafdfcffd..601cbf679d9 100644 --- a/src/devices/machine/am2901b.cpp +++ b/src/devices/machine/am2901b.cpp @@ -93,18 +93,6 @@ void am2901b_device::device_start() save_item(NAME(m_f0_out)); save_item(NAME(m_f3_out)); save_item(NAME(m_co_out)); - - m_y.resolve_safe(); - m_g.resolve_safe(); - m_p.resolve_safe(); - m_q0.resolve_safe(); - m_q3.resolve_safe(); - m_ram0.resolve_safe(); - m_ram3.resolve_safe(); - m_ovr.resolve_safe(); - m_f0.resolve_safe(); - m_f3.resolve_safe(); - m_co.resolve_safe(); } void am2901b_device::device_reset() diff --git a/src/devices/machine/am2910.cpp b/src/devices/machine/am2910.cpp index 70fb066deee..70b47c30c68 100644 --- a/src/devices/machine/am2910.cpp +++ b/src/devices/machine/am2910.cpp @@ -63,12 +63,6 @@ void am2910_device::device_start() save_item(NAME(m_d)); save_item(NAME(m_i)); - m_y.resolve_safe(); - m_full.resolve_safe(); - m_pl.resolve_safe(); - m_map.resolve_safe(); - m_vect.resolve_safe(); - if (clock()) m_execute_timer = timer_alloc(FUNC(am2910_device::clock_tick), this); else diff --git a/src/devices/machine/am53cf96.cpp b/src/devices/machine/am53cf96.cpp index 4c70bcb79e7..4e36f028b52 100644 --- a/src/devices/machine/am53cf96.cpp +++ b/src/devices/machine/am53cf96.cpp @@ -155,8 +155,6 @@ void am53cf96_device::device_start() { legacy_scsi_host_adapter::device_start(); - m_irq_handler.resolve_safe(); - memset(scsi_regs, 0, sizeof(scsi_regs)); fptr = 0; diff --git a/src/devices/machine/am79c30.cpp b/src/devices/machine/am79c30.cpp index ed31a517398..9c041d8c383 100644 --- a/src/devices/machine/am79c30.cpp +++ b/src/devices/machine/am79c30.cpp @@ -94,18 +94,6 @@ am79c30a_device::am79c30a_device(const machine_config &mconfig, const char *tag, } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void am79c30a_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/am79c30.h b/src/devices/machine/am79c30.h index 0188b2c9623..43164622000 100644 --- a/src/devices/machine/am79c30.h +++ b/src/devices/machine/am79c30.h @@ -78,8 +78,7 @@ public: void bctb_w(u8 data); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/am79c90.cpp b/src/devices/machine/am79c90.cpp index dfe5573c98f..55506ba36fd 100644 --- a/src/devices/machine/am79c90.cpp +++ b/src/devices/machine/am79c90.cpp @@ -60,7 +60,7 @@ am7990_device_base::am7990_device_base(const machine_config &mconfig, device_typ : device_t(mconfig, type, tag, owner, clock) , device_network_interface(mconfig, *this, 10) , m_intr_out_cb(*this) - , m_dma_in_cb(*this) + , m_dma_in_cb(*this, 0) , m_dma_out_cb(*this) , m_transmit_poll(nullptr) , m_intr_out_state(1) @@ -82,10 +82,6 @@ constexpr attotime am7990_device_base::TX_POLL_PERIOD; void am7990_device_base::device_start() { - m_intr_out_cb.resolve_safe(); - m_dma_in_cb.resolve_safe(0); - m_dma_out_cb.resolve_safe(); - m_transmit_poll = timer_alloc(FUNC(am7990_device_base::transmit_poll), this); m_transmit_poll->adjust(TX_POLL_PERIOD, 0, TX_POLL_PERIOD); diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp index de3a9fd8ff3..1960bac555d 100644 --- a/src/devices/machine/am9513.cpp +++ b/src/devices/machine/am9513.cpp @@ -78,10 +78,6 @@ am9513a_device::am9513a_device(const machine_config &mconfig, const char *tag, d void am9513_device::device_start() { - // Resolve callbacks - m_out_cb.resolve_all_safe(); - m_fout_cb.resolve(); - // Power-on reset m_dpr = 0x1f; m_mmr = 0; @@ -113,7 +109,7 @@ void am9513_device::device_start() for (int f = 0; f < 5; f++) { m_freq_timer[f] = timer_alloc(FUNC(am9513_device::timer_tick), this); - m_freq_timer_selected[f] = (f == 0) ? (m_fout_cb.isnull() ? 0x3e : 0x3f) : 0; + m_freq_timer_selected[f] = (f == 0) ? (m_fout_cb.isunset() ? 0x3e : 0x3f) : 0; m_freq_timer_cycle[f] = 0; } @@ -325,7 +321,7 @@ void am9513_device::set_master_mode(u16 data) if (source >= 11 && source <= 15) { LOGMASKED(LOG_MODE, "FOUT = F%d / %d\n", source - 10, divider); - select_freq_timer(source - 11, 0, !m_fout_cb.isnull(), BIT(divider, 0)); + select_freq_timer(source - 11, 0, !m_fout_cb.isunset(), BIT(divider, 0)); } else if (source >= 6 && source <= 10) LOGMASKED(LOG_MODE, "FOUT = GATE %d / %d\n", source - 5, divider); @@ -1460,7 +1456,7 @@ void am9513_device::fout_tick() m_fout = !m_fout; // Check whether the FOUT gate is on - if (!BIT(m_mmr, 12) && !m_fout_cb.isnull()) + if (!BIT(m_mmr, 12) && !m_fout_cb.isunset()) m_fout_cb(m_fout); // Reload the counter diff --git a/src/devices/machine/am9516.cpp b/src/devices/machine/am9516.cpp index 0311e76d2ee..451a436511c 100644 --- a/src/devices/machine/am9516.cpp +++ b/src/devices/machine/am9516.cpp @@ -200,16 +200,8 @@ void am9516_device::device_start() save_item(STRUCT_MEMBER(m_channel, cmh)); save_item(STRUCT_MEMBER(m_channel, iv)); - m_int.resolve_safe(); - m_eop.resolve_safe(); - for (channel &ch : m_channel) { - ch.flyby_byte_r.resolve_safe(0); - ch.flyby_byte_w.resolve_safe(); - ch.flyby_word_r.resolve_safe(0); - ch.flyby_word_w.resolve_safe(); - ch.cabl = 0; ch.babl = 0; ch.caal = 0; diff --git a/src/devices/machine/am9516.h b/src/devices/machine/am9516.h index e4fc6863ff1..36583cc840f 100644 --- a/src/devices/machine/am9516.h +++ b/src/devices/machine/am9516.h @@ -76,9 +76,9 @@ private: { channel(am9516_device &parent) : udc(parent) - , flyby_byte_r(parent) + , flyby_byte_r(parent, 0) , flyby_byte_w(parent) - , flyby_word_r(parent) + , flyby_word_r(parent, 0) , flyby_word_w(parent) {} diff --git a/src/devices/machine/am9517a.cpp b/src/devices/machine/am9517a.cpp index ac7e6eba19c..c9e8a7b2944 100644 --- a/src/devices/machine/am9517a.cpp +++ b/src/devices/machine/am9517a.cpp @@ -441,42 +441,41 @@ void am9517a_device::end_of_process() //------------------------------------------------- -am9517a_device::am9517a_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_execute_interface(mconfig, *this), - m_icount(0), - m_hack(0), - m_ready(1), - m_command(0), - m_status(0), - m_out_hreq_cb(*this), - m_out_eop_cb(*this), - m_in_memr_cb(*this), - m_out_memw_cb(*this), - m_in_ior_cb(*this), - m_out_iow_cb(*this), - m_out_dack_cb(*this) +am9517a_device::am9517a_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_execute_interface(mconfig, *this), + m_icount(0), + m_hack(0), + m_ready(1), + m_command(0), + m_status(0), + m_out_hreq_cb(*this), + m_out_eop_cb(*this), + m_in_memr_cb(*this, 0), + m_out_memw_cb(*this), + m_in_ior_cb(*this, 0), + m_out_iow_cb(*this), + m_out_dack_cb(*this) { } -am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : am9517a_device(mconfig, AM9517A, tag, owner, clock) +am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + am9517a_device(mconfig, AM9517A, tag, owner, clock) { } -v5x_dmau_device::v5x_dmau_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : am9517a_device(mconfig, V5X_DMAU, tag, owner, clock) - , m_in_mem16r_cb(*this) - , m_out_mem16w_cb(*this) - , m_in_io16r_cb(*this) - , m_out_io16w_cb(*this) - +v5x_dmau_device::v5x_dmau_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + am9517a_device(mconfig, V5X_DMAU, tag, owner, clock), + m_in_mem16r_cb(*this, 0), + m_out_mem16w_cb(*this), + m_in_io16r_cb(*this, 0), + m_out_io16w_cb(*this) { } -pcxport_dmac_device::pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : am9517a_device(mconfig, PCXPORT_DMAC, tag, owner, clock) +pcxport_dmac_device::pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + am9517a_device(mconfig, PCXPORT_DMAC, tag, owner, clock) { } @@ -489,15 +488,6 @@ void am9517a_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_out_hreq_cb.resolve_safe(); - m_out_eop_cb.resolve_safe(); - m_in_memr_cb.resolve_safe(0); - m_out_memw_cb.resolve_safe(); - m_in_ior_cb.resolve_all_safe(0); - m_out_iow_cb.resolve_all_safe(); - m_out_dack_cb.resolve_all_safe(); - for(auto &elem : m_channel) { elem.m_address = 0; @@ -1021,11 +1011,6 @@ void v5x_dmau_device::device_start() am9517a_device::device_start(); m_address_mask = 0x00ffffff; - m_in_mem16r_cb.resolve_safe(0); - m_out_mem16w_cb.resolve_safe(); - m_in_io16r_cb.resolve_all_safe(0); - m_out_io16w_cb.resolve_all_safe(); - m_selected_channel = 0; m_base = 0; diff --git a/src/devices/machine/am9519.cpp b/src/devices/machine/am9519.cpp index 6556616421b..ed0b87f2637 100644 --- a/src/devices/machine/am9519.cpp +++ b/src/devices/machine/am9519.cpp @@ -28,9 +28,6 @@ am9519_device::am9519_device(const machine_config &mconfig, const char *tag, dev void am9519_device::device_start() { - // resolve callbacks - m_out_int_func.resolve_safe(); - // Register save state items save_item(NAME(m_isr)); save_item(NAME(m_irr)); diff --git a/src/devices/machine/amiga_copper.cpp b/src/devices/machine/amiga_copper.cpp index f3e0c249a75..6bc2b916e86 100644 --- a/src/devices/machine/amiga_copper.cpp +++ b/src/devices/machine/amiga_copper.cpp @@ -67,7 +67,7 @@ DEFINE_DEVICE_TYPE(AMIGA_COPPER, amiga_copper_device, "amiga_copper", "Amiga Cop amiga_copper_device::amiga_copper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA_COPPER, tag, owner, clock) , m_host_cpu(*this, finder_base::DUMMY_TAG) - , m_chipmem_r(*this) + , m_chipmem_r(*this, 0) { } @@ -80,7 +80,6 @@ amiga_copper_device::amiga_copper_device(const machine_config &mconfig, const ch void amiga_copper_device::device_start() { m_host_space = &m_host_cpu->space(AS_PROGRAM); - m_chipmem_r.resolve_safe(0); save_item(NAME(m_cdang_setting)); save_item(NAME(m_cdang_min_reg)); diff --git a/src/devices/machine/amigafdc.cpp b/src/devices/machine/amigafdc.cpp index 3f8cb887901..662a80dffe4 100644 --- a/src/devices/machine/amigafdc.cpp +++ b/src/devices/machine/amigafdc.cpp @@ -55,7 +55,7 @@ void amiga_fdc_device::floppy_formats(format_registration &fr) amiga_fdc_device::amiga_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA_FDC, tag, owner, clock) , m_write_index(*this) - , m_read_dma(*this) + , m_read_dma(*this, 0) , m_write_dma(*this) , m_write_dskblk(*this) , m_write_dsksyn(*this) @@ -67,11 +67,6 @@ amiga_fdc_device::amiga_fdc_device(const machine_config &mconfig, const char *ta void amiga_fdc_device::device_start() { - m_write_index.resolve_safe(); - m_read_dma.resolve_safe(0); - m_write_dma.resolve_safe(); - m_write_dskblk.resolve_safe(); - m_write_dsksyn.resolve_safe(); m_leds.resolve(); m_fdc_led.resolve(); diff --git a/src/devices/machine/applefdintf.cpp b/src/devices/machine/applefdintf.cpp index 68a849ba59b..8c30e6a0a8c 100644 --- a/src/devices/machine/applefdintf.cpp +++ b/src/devices/machine/applefdintf.cpp @@ -62,11 +62,6 @@ applefdintf_device::applefdintf_device(const machine_config &mconfig, device_typ void applefdintf_device::device_start() { - m_phases_cb.resolve_safe(); - m_devsel_cb.resolve_safe(); - m_sel35_cb.resolve_safe(); - m_hdsel_cb.resolve_safe(); - m_dat1byte_cb.resolve_safe(); save_item(NAME(m_phases)); save_item(NAME(m_phases_input)); } diff --git a/src/devices/machine/applepic.cpp b/src/devices/machine/applepic.cpp index aa9e958f8fe..feb122140d4 100644 --- a/src/devices/machine/applepic.cpp +++ b/src/devices/machine/applepic.cpp @@ -22,10 +22,10 @@ const std::string_view applepic_device::s_interrupt_names[8] = { "0", "DMA 1", " applepic_device::applepic_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, APPLEPIC, tag, owner, clock) , m_iopcpu(*this, "iopcpu") - , m_prd_callback(*this) + , m_prd_callback(*this, 0) , m_pwr_callback(*this) , m_hint_callback(*this) - , m_gpin_callback(*this) + , m_gpin_callback(*this, 0) , m_gpout_callback(*this) , m_timer1(nullptr) , m_timer_last_expired(attotime::zero) @@ -68,16 +68,6 @@ void applepic_device::device_add_mconfig(machine_config &config) m_iopcpu->set_addrmap(AS_PROGRAM, &applepic_device::internal_map); } -void applepic_device::device_resolve_objects() -{ - // Resolve callbacks - m_prd_callback.resolve_safe(0); - m_pwr_callback.resolve_safe(); - m_hint_callback.resolve_safe(); - m_gpin_callback.resolve_safe(0); - m_gpout_callback.resolve_all_safe(); -} - void applepic_device::device_start() { // Initialize timer diff --git a/src/devices/machine/applepic.h b/src/devices/machine/applepic.h index f43ccb6ddb8..37956492d76 100644 --- a/src/devices/machine/applepic.h +++ b/src/devices/machine/applepic.h @@ -38,9 +38,8 @@ public: void reqb_w(int state); protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/archimedes_keyb.cpp b/src/devices/machine/archimedes_keyb.cpp index 01a2d97a7df..abd2778082b 100644 --- a/src/devices/machine/archimedes_keyb.cpp +++ b/src/devices/machine/archimedes_keyb.cpp @@ -243,7 +243,6 @@ archimedes_keyboard_device::archimedes_keyboard_device(const machine_config &mco void archimedes_keyboard_device::device_resolve_objects() { - m_kout.resolve_safe(); m_leds.resolve(); } diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp index 893399387ea..39b41162734 100644 --- a/src/devices/machine/arm_iomd.cpp +++ b/src/devices/machine/arm_iomd.cpp @@ -141,9 +141,9 @@ arm_iomd_device::arm_iomd_device(const machine_config &mconfig, device_type type , m_host_cpu(*this, finder_base::DUMMY_TAG) , m_vidc(*this, finder_base::DUMMY_TAG) , m_kbdc(*this, finder_base::DUMMY_TAG) - , m_iocr_read_od_cb(*this) + , m_iocr_read_od_cb(*this, 1) , m_iocr_write_od_cb(*this) - , m_iocr_read_id_cb(*this) + , m_iocr_read_id_cb(*this, 1) , m_iocr_write_id_cb(*this) , m_sndcur(0) , m_sndend(0) @@ -206,7 +206,7 @@ void arm7500fe_iomd_device::map(address_map &map) arm7500fe_iomd_device::arm7500fe_iomd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : arm_iomd_device(mconfig, ARM7500FE_IOMD, tag, owner, clock) - , m_iolines_read_cb(*this) + , m_iolines_read_cb(*this, 0xff) , m_iolines_write_cb(*this) { m_id = 0xaa7c; @@ -239,11 +239,6 @@ void arm7500fe_iomd_device::device_add_mconfig(machine_config &config) void arm_iomd_device::device_start() { - m_iocr_read_od_cb.resolve_all_safe(1); - m_iocr_write_od_cb.resolve_all_safe(); - m_iocr_read_id_cb.resolve_safe(1); - m_iocr_write_id_cb.resolve_safe(); - save_item(NAME(m_iocr_ddr)); save_item(NAME(m_video_enable)); save_item(NAME(m_vidinita)); @@ -282,8 +277,6 @@ void arm7500fe_iomd_device::device_start() { arm_iomd_device::device_start(); - m_iolines_read_cb.resolve_safe(0xff); - m_iolines_write_cb.resolve_safe(); save_item(NAME(m_iolines_ddr)); save_item(NAME(m_cpuclk_divider)); diff --git a/src/devices/machine/at45dbxx.cpp b/src/devices/machine/at45dbxx.cpp index 4a130702074..f81c3f746f5 100644 --- a/src/devices/machine/at45dbxx.cpp +++ b/src/devices/machine/at45dbxx.cpp @@ -104,8 +104,6 @@ void at45db041_device::device_start() save_item(NAME(m_pin.wp)); save_item(NAME(m_pin.reset)); save_item(NAME(m_pin.busy)); - - write_so.resolve_safe(); } diff --git a/src/devices/machine/at_keybc.cpp b/src/devices/machine/at_keybc.cpp index 21f26da6255..a7d9ce8b9d4 100644 --- a/src/devices/machine/at_keybc.cpp +++ b/src/devices/machine/at_keybc.cpp @@ -291,15 +291,6 @@ at_kbc_device_base::at_kbc_device_base(machine_config const &mconfig, device_typ { } -void at_kbc_device_base::device_resolve_objects() -{ - m_hot_res_cb.resolve_safe(); - m_gate_a20_cb.resolve_safe(); - m_kbd_irq_cb.resolve_safe(); - m_kbd_clk_cb.resolve_safe(); - m_kbd_data_cb.resolve_safe(); -} - void at_kbc_device_base::device_start() { save_item(NAME(m_hot_res)); @@ -477,15 +468,6 @@ void ps2_keyboard_controller_device::device_add_mconfig(machine_config &config) m_mcu->t1_in_cb().set([this] () { return aux_clk_r(); }); } -void ps2_keyboard_controller_device::device_resolve_objects() -{ - at_kbc_device_base::device_resolve_objects(); - - m_aux_irq_cb.resolve_safe(); - m_aux_clk_cb.resolve_safe(); - m_aux_data_cb.resolve_safe(); -} - void ps2_keyboard_controller_device::device_start() { at_kbc_device_base::device_start(); diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h index 18e5d0b6804..d57ca81f565 100644 --- a/src/devices/machine/at_keybc.h +++ b/src/devices/machine/at_keybc.h @@ -44,7 +44,6 @@ protected: at_kbc_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); // device_t implementation - virtual void device_resolve_objects() override; virtual void device_start() override; // host outputs - use 1 = asserted, 0 = deasserted @@ -126,7 +125,6 @@ protected: // device_t implementation virtual tiny_rom_entry const *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/devices/machine/atmel_arm_aic.cpp b/src/devices/machine/atmel_arm_aic.cpp index 5e80a471477..948c370fbe9 100644 --- a/src/devices/machine/atmel_arm_aic.cpp +++ b/src/devices/machine/atmel_arm_aic.cpp @@ -86,8 +86,6 @@ uint32_t arm_aic_device::firq_vector_r() void arm_aic_device::device_start() { - m_irq_out.resolve_safe(); - save_item(NAME(m_irqs_enabled)); save_item(NAME(m_irqs_pending)); save_item(NAME(m_current_irq_vector)); diff --git a/src/devices/machine/ay31015.cpp b/src/devices/machine/ay31015.cpp index a3cbbe456aa..732470d1b9f 100644 --- a/src/devices/machine/ay31015.cpp +++ b/src/devices/machine/ay31015.cpp @@ -104,8 +104,8 @@ Start bit (low), Bit 0, Bit 1... highest bit, Parity bit (if enabled), 1-2 stop DEFINE_DEVICE_TYPE(AY31015, ay31015_device, "ay31015", "AY-3-1015 UART") DEFINE_DEVICE_TYPE(AY51013, ay51013_device, "ay51013", "AY-5-1013 UART") -ay31015_device::ay31015_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), +ay31015_device::ay31015_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), m_control_reg(0), m_status_reg(0), m_second_stop_bit(0), @@ -120,7 +120,7 @@ ay31015_device::ay31015_device(const machine_config &mconfig, device_type type, m_tx_buffer(0), m_tx_parity(0), m_tx_pulses(0), - m_read_si_cb(*this), + m_read_si_cb(*this, 0), m_write_so_cb(*this), m_write_pe_cb(*this), m_write_fe_cb(*this), @@ -144,25 +144,6 @@ ay51013_device::ay51013_device(const machine_config &mconfig, const char *tag, d { } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void ay31015_device::device_resolve_objects() -{ - m_read_si_cb.resolve(); - m_write_so_cb.resolve(); - - m_write_tbmt_cb.resolve(); - m_write_dav_cb.resolve(); - m_write_or_cb.resolve(); - m_write_fe_cb.resolve(); - m_write_pe_cb.resolve(); - m_write_eoc_cb.resolve(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -208,7 +189,7 @@ void ay31015_device::device_reset() inline uint8_t ay31015_device::get_si() { - if (!m_read_si_cb.isnull()) + if (!m_read_si_cb.isunset()) m_pins[SI] = m_read_si_cb(); return m_pins[SI]; @@ -218,9 +199,7 @@ inline uint8_t ay31015_device::get_si() inline void ay31015_device::set_so( int data ) { m_pins[SO] = data ? 1 : 0; - - if (!m_write_so_cb.isnull()) - m_write_so_cb(m_pins[SO]); + m_write_so_cb(m_pins[SO]); } @@ -231,8 +210,7 @@ inline void ay31015_device::update_status_pin(uint8_t reg_bit, ay31015_device::o if (new_value != m_pins[pin]) { m_pins[pin] = new_value; - if (!write_cb.isnull()) - write_cb(new_value); + write_cb(new_value); } } diff --git a/src/devices/machine/ay31015.h b/src/devices/machine/ay31015.h index 94185a23db9..beaac297765 100644 --- a/src/devices/machine/ay31015.h +++ b/src/devices/machine/ay31015.h @@ -103,8 +103,7 @@ protected: ay31015_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/bacta_datalogger.cpp b/src/devices/machine/bacta_datalogger.cpp index 43f9855bfd9..1b00a051314 100644 --- a/src/devices/machine/bacta_datalogger.cpp +++ b/src/devices/machine/bacta_datalogger.cpp @@ -45,7 +45,6 @@ bacta_datalogger_device::bacta_datalogger_device(const machine_config &mconfig, void bacta_datalogger_device::device_start() { - m_rxd_handler.resolve_safe(); } void bacta_datalogger_device::device_reset() diff --git a/src/devices/machine/bq4847.cpp b/src/devices/machine/bq4847.cpp index ba5dfc3b8f8..af4cbf0c7a9 100644 --- a/src/devices/machine/bq4847.cpp +++ b/src/devices/machine/bq4847.cpp @@ -454,10 +454,6 @@ void bq4847_device::device_start() m_periodic_timer = timer_alloc(FUNC(bq4847_device::periodic_callback), this); m_watchdog_timer = timer_alloc(FUNC(bq4847_device::watchdog_callback), this); - m_int_handler.resolve_safe(); - m_wdo_handler.resolve_safe(); - m_rst_handler.resolve_safe(); - m_wdo_handler(m_wdo_state); m_int_handler(m_int_state); m_rst_handler(m_rst_state); diff --git a/src/devices/machine/bq48x2.cpp b/src/devices/machine/bq48x2.cpp index df14b1c0e41..745f1a28def 100644 --- a/src/devices/machine/bq48x2.cpp +++ b/src/devices/machine/bq48x2.cpp @@ -515,12 +515,6 @@ void bq48x2_device::device_start() // Watchdog timer m_watchdog_timer = timer_alloc(FUNC(bq48x2_device::rtc_watchdog_cb), this); - // Interrupt line - m_interrupt_cb.resolve_safe(); - - // Reset output - m_resetout_cb.resolve_safe(); - m_sram = std::make_unique(m_memsize); // Interrupt enables are cleared on powerup diff --git a/src/devices/machine/busmouse.cpp b/src/devices/machine/busmouse.cpp index 95bf3c3e4dd..285e62051b4 100644 --- a/src/devices/machine/busmouse.cpp +++ b/src/devices/machine/busmouse.cpp @@ -139,9 +139,6 @@ void bus_mouse_device::device_add_mconfig(machine_config &config) void bus_mouse_device::device_start() { - // resolve callbacks - m_write_extint.resolve_safe(); - m_irq_timer = timer_alloc(FUNC(bus_mouse_device::irq_timer_tick), this); } diff --git a/src/devices/machine/cammu.cpp b/src/devices/machine/cammu.cpp index 89c8e929180..38c4bb2a311 100644 --- a/src/devices/machine/cammu.cpp +++ b/src/devices/machine/cammu.cpp @@ -157,7 +157,6 @@ cammu_device::cammu_device(const machine_config &mconfig, device_type type, cons void cammu_device::device_start() { - m_exception_func.resolve(); } void cammu_device::device_reset() diff --git a/src/devices/machine/cdp1852.cpp b/src/devices/machine/cdp1852.cpp index c101e2cacd5..caa4f2517ad 100644 --- a/src/devices/machine/cdp1852.cpp +++ b/src/devices/machine/cdp1852.cpp @@ -41,9 +41,9 @@ enum cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, CDP1852, tag, owner, clock), - m_read_mode(*this), + m_read_mode(*this, 0), m_write_sr(*this), - m_read_data(*this), + m_read_data(*this, 0), m_write_data(*this), m_new_data(false), m_data(0), m_clock_active(true), m_sr(false), m_next_sr(false), @@ -59,12 +59,6 @@ cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, d void cdp1852_device::device_start() { - // resolve callbacks - m_read_mode.resolve_safe(0); - m_write_sr.resolve_safe(); - m_read_data.resolve_safe(0); - m_write_data.resolve_safe(); - // allocate timers m_update_do_timer = timer_alloc(FUNC(cdp1852_device::update_do), this); m_update_sr_timer = timer_alloc(FUNC(cdp1852_device::update_sr), this); diff --git a/src/devices/machine/cdp1871.cpp b/src/devices/machine/cdp1871.cpp index 3e32512c30f..ffe61b7340c 100644 --- a/src/devices/machine/cdp1871.cpp +++ b/src/devices/machine/cdp1871.cpp @@ -98,17 +98,17 @@ const uint8_t cdp1871_device::key_codes[4][11][8] = cdp1871_device::cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1871, tag, owner, clock), - m_read_d1(*this), - m_read_d2(*this), - m_read_d3(*this), - m_read_d4(*this), - m_read_d5(*this), - m_read_d6(*this), - m_read_d7(*this), - m_read_d8(*this), - m_read_d9(*this), - m_read_d10(*this), - m_read_d11(*this), + m_read_d1(*this, 0xff), + m_read_d2(*this, 0xff), + m_read_d3(*this, 0xff), + m_read_d4(*this, 0xff), + m_read_d5(*this, 0xff), + m_read_d6(*this, 0xff), + m_read_d7(*this, 0xff), + m_read_d8(*this, 0xff), + m_read_d9(*this, 0xff), + m_read_d10(*this, 0xff), + m_read_d11(*this, 0xff), m_write_da(*this), m_write_rpt(*this), m_inhibit(false), @@ -133,21 +133,6 @@ cdp1871_device::cdp1871_device(const machine_config &mconfig, const char *tag, d void cdp1871_device::device_start() { - // resolve callbacks - m_read_d1.resolve_safe(0xff); - m_read_d2.resolve_safe(0xff); - m_read_d3.resolve_safe(0xff); - m_read_d4.resolve_safe(0xff); - m_read_d5.resolve_safe(0xff); - m_read_d6.resolve_safe(0xff); - m_read_d7.resolve_safe(0xff); - m_read_d8.resolve_safe(0xff); - m_read_d9.resolve_safe(0xff); - m_read_d10.resolve_safe(0xff); - m_read_d11.resolve_safe(0xff); - m_write_da.resolve_safe(); - m_write_rpt.resolve_safe(); - // set initial values change_output_lines(); diff --git a/src/devices/machine/cdp1879.cpp b/src/devices/machine/cdp1879.cpp index e8230b5b33b..7d843bcbc17 100644 --- a/src/devices/machine/cdp1879.cpp +++ b/src/devices/machine/cdp1879.cpp @@ -39,8 +39,6 @@ void cdp1879_device::device_start() m_clock_timer = timer_alloc(FUNC(cdp1879_device::clock_tick), this); m_clock_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); - m_irq_w.resolve_safe(); - // state saving save_item(NAME(m_regs)); save_item(NAME(m_comparator_state)); diff --git a/src/devices/machine/chessmachine.cpp b/src/devices/machine/chessmachine.cpp index fa201f9b11e..18a6c4f13df 100644 --- a/src/devices/machine/chessmachine.cpp +++ b/src/devices/machine/chessmachine.cpp @@ -59,9 +59,6 @@ chessmachine_device::chessmachine_device(const machine_config &mconfig, const ch void chessmachine_device::device_start() { - // resolve callbacks - m_data_out.resolve_safe(); - // register for savestates save_item(NAME(m_bootrom_enabled)); save_item(NAME(m_latch)); diff --git a/src/devices/machine/clock.cpp b/src/devices/machine/clock.cpp index 4c2ad3afd7a..670dfba09aa 100644 --- a/src/devices/machine/clock.cpp +++ b/src/devices/machine/clock.cpp @@ -34,8 +34,6 @@ clock_device::clock_device(const machine_config &mconfig, const char *tag, devic void clock_device::device_start() { - m_signal_handler.resolve_safe(); - save_item(NAME(m_signal)); save_item(NAME(m_output)); save_item(NAME(m_duty)); diff --git a/src/devices/machine/com52c50.cpp b/src/devices/machine/com52c50.cpp index 89b4e176f85..7f4ad470c01 100644 --- a/src/devices/machine/com52c50.cpp +++ b/src/devices/machine/com52c50.cpp @@ -45,14 +45,6 @@ void com52c50_device::map(address_map &map) map(7, 7).w(FUNC(com52c50_device::tx_buffer_eom_w)); } -void com52c50_device::device_resolve_objects() -{ - m_int1_callback.resolve_safe(); - m_int2_callback.resolve_safe(); - m_rx_dma_callback.resolve_safe(); - m_tx_dma_callback.resolve_safe(); -} - void com52c50_device::device_start() { save_item(NAME(m_int_mask)); diff --git a/src/devices/machine/com52c50.h b/src/devices/machine/com52c50.h index 085a3e0808a..f3e197e803c 100644 --- a/src/devices/machine/com52c50.h +++ b/src/devices/machine/com52c50.h @@ -60,8 +60,7 @@ public: void map(address_map &map); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/com8116.cpp b/src/devices/machine/com8116.cpp index 2205ec46a73..ca268f0ed81 100644 --- a/src/devices/machine/com8116.cpp +++ b/src/devices/machine/com8116.cpp @@ -134,13 +134,8 @@ k1135ab_device::k1135ab_device(const machine_config &mconfig, const char *tag, d void com8116_device::device_start() { - // resolve callbacks - m_fx4_handler.resolve(); - m_fr_handler.resolve_safe(); - m_ft_handler.resolve_safe(); - // allocate timers - if (!m_fx4_handler.isnull()) + if (!m_fx4_handler.isunset()) { m_fx4_timer = timer_alloc(FUNC(com8116_device::fx4_tick), this); m_fx4_timer->adjust(attotime::from_hz((clock() / 4) * 2), 0, attotime::from_hz((clock() / 4)) * 2); diff --git a/src/devices/machine/cop452.cpp b/src/devices/machine/cop452.cpp index e03a1a91aaa..f55c055e301 100644 --- a/src/devices/machine/cop452.cpp +++ b/src/devices/machine/cop452.cpp @@ -20,7 +20,7 @@ DEFINE_DEVICE_TYPE(COP452, cop452_device, "cop452", "National Semiconductor COP452 frequency generator") cop452_device::cop452_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) -: device_t(mconfig, COP452, tag, owner, clock) + : device_t(mconfig, COP452, tag, owner, clock) , m_out_handlers(*this) { } @@ -145,8 +145,6 @@ int cop452_device::do_r() void cop452_device::device_start() { - m_out_handlers.resolve_all_safe(); - m_timers[0] = timer_alloc(FUNC(cop452_device::timer_tick), this); m_timers[1] = timer_alloc(FUNC(cop452_device::timer_tick), this); diff --git a/src/devices/machine/cr511b.cpp b/src/devices/machine/cr511b.cpp index a42d85c03c6..3ac800c1db7 100644 --- a/src/devices/machine/cr511b.cpp +++ b/src/devices/machine/cr511b.cpp @@ -63,13 +63,6 @@ cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, dev void cr511b_device::device_start() { - // resolve callbacks - m_stch_handler.resolve_safe(); - m_sten_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - m_dten_handler.resolve_safe(); - m_scor_handler.resolve_safe(); - m_xaen_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index 77252f66686..36d8b51e322 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -161,7 +161,7 @@ void cs4031_device::device_add_mconfig(machine_config &config) cs4031_device::cs4031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CS4031, tag, owner, clock), - m_read_ior(*this), + m_read_ior(*this, 0), m_write_iow(*this), m_write_tc(*this), m_write_hold(*this), @@ -213,17 +213,6 @@ void cs4031_device::device_start() if (!m_ram_dev->started()) throw device_missing_dependencies(); - // resolve callbacks - m_read_ior.resolve_safe(0); - m_write_iow.resolve_safe(); - m_write_tc.resolve_safe(); - m_write_hold.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_intr.resolve_safe(); - m_write_cpureset.resolve_safe(); - m_write_a20m.resolve_safe(); - m_write_spkr.resolve_safe(); - // register for state saving save_item(NAME(m_dma_eop)); save_item(NAME(m_dma_page)); diff --git a/src/devices/machine/cxd1095.cpp b/src/devices/machine/cxd1095.cpp index 1f78ca628a1..e4998ea7cd1 100644 --- a/src/devices/machine/cxd1095.cpp +++ b/src/devices/machine/cxd1095.cpp @@ -35,7 +35,7 @@ DEFINE_DEVICE_TYPE(CXD1095, cxd1095_device, "cxd1095", "CXD1095 I/O Expander") cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, CXD1095, tag, owner, clock) - , m_input_cb(*this) + , m_input_cb(*this, 0) , m_output_cb(*this) { } @@ -46,10 +46,6 @@ cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, d void cxd1095_device::device_start() { - // resolve callbacks - m_input_cb.resolve_all(); - m_output_cb.resolve_all(); - std::fill(std::begin(m_data_latch), std::end(m_data_latch), 0); // save state @@ -80,7 +76,7 @@ u8 cxd1095_device::read(offs_t offset) input_mask &= 0x0f; // read through callback if port not configured entirely for output - if (input_mask != 0 && !m_input_cb[offset].isnull()) + if (input_mask != 0 && !m_input_cb[offset].isunset()) input_data = m_input_cb[offset](0, input_mask) & input_mask; else if (m_data_dir[offset] == 0xff) logerror("Reading from undefined input port %c\n", 'A' + offset); @@ -111,7 +107,7 @@ void cxd1095_device::write(offs_t offset, u8 data) // send output through callback u8 dataout = data & ~m_data_dir[offset]; - if (!m_output_cb[offset].isnull()) + if (!m_output_cb[offset].isunset()) m_output_cb[offset](0, dataout, ~m_data_dir[offset]); else logerror("Writing %02X to undefined output port %c\n", dataout, 'A' + offset); diff --git a/src/devices/machine/cxd1185.cpp b/src/devices/machine/cxd1185.cpp index 293914fcfee..8b24126b662 100644 --- a/src/devices/machine/cxd1185.cpp +++ b/src/devices/machine/cxd1185.cpp @@ -73,10 +73,6 @@ void cxd1185_device::map(address_map &map) void cxd1185_device::device_start() { - m_irq_out_cb.resolve_safe(); - m_drq_out_cb.resolve_safe(); - m_port_out_cb.resolve_safe(); - save_item(NAME(m_state)); save_item(NAME(m_irq_asserted)); save_item(NAME(m_drq_asserted)); diff --git a/src/devices/machine/dc7085.cpp b/src/devices/machine/dc7085.cpp index ee7d840390a..37156a08494 100644 --- a/src/devices/machine/dc7085.cpp +++ b/src/devices/machine/dc7085.cpp @@ -126,10 +126,6 @@ void dc7085_device::map(address_map &map) void dc7085_device::device_start() { - m_int_cb.resolve_safe(); - m_tx_cb.resolve_all_safe(); - m_dtr_cb.resolve_all_safe(); - save_item(NAME(m_csr)); save_item(NAME(m_tcr)); save_item(NAME(m_msr)); @@ -308,10 +304,6 @@ dc7085_channel::dc7085_channel(machine_config const &mconfig, char const *tag, d void dc7085_channel::device_start() { - m_tx_cb.resolve_safe(); - m_rx_done.resolve_safe(); - m_tx_done.resolve_safe(); - save_item(NAME(m_rx_enabled)); } diff --git a/src/devices/machine/dimm_spd.cpp b/src/devices/machine/dimm_spd.cpp index 510346ac042..b6736e71ade 100644 --- a/src/devices/machine/dimm_spd.cpp +++ b/src/devices/machine/dimm_spd.cpp @@ -39,8 +39,8 @@ constexpr int STATE_WAIT_ACK = 4; // dimm_spd_device - constructor //------------------------------------------------- -dimm_spd_device::dimm_spd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, DIMM_SPD, tag, owner, clock), +dimm_spd_device::dimm_spd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, DIMM_SPD, tag, owner, clock), write_sda(*this) { m_data_offset = 0; @@ -56,7 +56,6 @@ dimm_spd_device::dimm_spd_device(const machine_config &mconfig, const char *tag, void dimm_spd_device::device_start() { - write_sda.resolve_safe(); std::fill(std::begin(m_data), std::end(m_data), 0); m_data[0] = 128; // # of bytes in EEPROM diff --git a/src/devices/machine/dl11.cpp b/src/devices/machine/dl11.cpp index 3e42b3b9c71..ef81cf5911e 100644 --- a/src/devices/machine/dl11.cpp +++ b/src/devices/machine/dl11.cpp @@ -63,11 +63,6 @@ dl11_device::dl11_device(const machine_config &mconfig, const char *tag, device_ void dl11_device::device_start() { - // resolve callbacks - m_write_txd.resolve_safe(); - m_write_rxrdy.resolve_safe(); - m_write_txrdy.resolve_safe(); - // save state save_item(NAME(m_rcsr)); save_item(NAME(m_rbuf)); diff --git a/src/devices/machine/dmac.cpp b/src/devices/machine/dmac.cpp index 8852bc2f4cf..fd939c981c4 100644 --- a/src/devices/machine/dmac.cpp +++ b/src/devices/machine/dmac.cpp @@ -40,9 +40,9 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, const char * m_cfgout_handler(*this), m_int_handler(*this), m_xdack_handler(*this), - m_scsi_read_handler(*this), + m_scsi_read_handler(*this, 0), m_scsi_write_handler(*this), - m_io_read_handler(*this), + m_io_read_handler(*this, 0), m_io_write_handler(*this), m_space(nullptr), m_rom(nullptr), @@ -64,14 +64,6 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, const char * void amiga_dmac_device::device_start() { - // resolve callbacks - m_cfgout_handler.resolve_safe(); - m_int_handler.resolve_safe(); - m_xdack_handler.resolve_safe(); - m_scsi_read_handler.resolve_safe(0); - m_scsi_write_handler.resolve_safe(); - m_io_read_handler.resolve_safe(0); - m_io_write_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/machine/dp8390.cpp b/src/devices/machine/dp8390.cpp index 3790b543acf..493c21f0ca7 100644 --- a/src/devices/machine/dp8390.cpp +++ b/src/devices/machine/dp8390.cpp @@ -25,7 +25,7 @@ dp8390_device::dp8390_device(const machine_config &mconfig, device_type type, co , m_variant(variant) , m_irq_cb(*this) , m_breq_cb(*this) - , m_mem_read_cb(*this) + , m_mem_read_cb(*this, 0) , m_mem_write_cb(*this) , m_reset(0) , m_rdma_active(0) @@ -33,10 +33,6 @@ dp8390_device::dp8390_device(const machine_config &mconfig, device_type type, co } void dp8390_device::device_start() { - m_irq_cb.resolve_safe(); - m_breq_cb.resolve_safe(); - m_mem_read_cb.resolve_safe(0); - m_mem_write_cb.resolve_safe(); } void dp8390_device::stop() { diff --git a/src/devices/machine/dp83932c.cpp b/src/devices/machine/dp83932c.cpp index cb9e4b5eed4..90cb2b9ea21 100644 --- a/src/devices/machine/dp83932c.cpp +++ b/src/devices/machine/dp83932c.cpp @@ -79,8 +79,6 @@ void dp83932c_device::map(address_map &map) void dp83932c_device::device_start() { - m_out_int.resolve(); - m_command = timer_alloc(FUNC(dp83932c_device::command), this); save_item(NAME(m_int_state)); diff --git a/src/devices/machine/dp8573.cpp b/src/devices/machine/dp8573.cpp index 487a4985ca4..32e03645b64 100644 --- a/src/devices/machine/dp8573.cpp +++ b/src/devices/machine/dp8573.cpp @@ -42,9 +42,6 @@ void dp8573_device::device_start() m_timer = timer_alloc(FUNC(dp8573_device::msec_tick), this); m_timer->adjust(attotime::never); - m_intr_cb.resolve_safe(); - m_mfo_cb.resolve_safe(); - std::fill(std::begin(m_ram), std::end(m_ram), 0); m_tscr = 0; diff --git a/src/devices/machine/ds1315.cpp b/src/devices/machine/ds1315.cpp index 283503c21d8..812f39dffba 100644 --- a/src/devices/machine/ds1315.cpp +++ b/src/devices/machine/ds1315.cpp @@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE(DS1315, ds1315_device, "ds1315", "Dallas DS1315 Phantom Time ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS1315, tag, owner, clock), - m_backing_read(*this), + m_backing_read(*this, 0xff), m_mode(), m_count(0) { @@ -46,8 +46,6 @@ ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, dev void ds1315_device::device_start() { - m_backing_read.resolve_safe(0xff); - save_item(NAME(m_count)); save_item(NAME(m_mode)); save_item(NAME(m_raw_data)); diff --git a/src/devices/machine/ds1386.cpp b/src/devices/machine/ds1386.cpp index 6f91625bde4..01d7c6b5906 100644 --- a/src/devices/machine/ds1386.cpp +++ b/src/devices/machine/ds1386.cpp @@ -65,10 +65,6 @@ ds1386_32k_device::ds1386_32k_device(const machine_config &mconfig, const char * void ds1386_device::device_start() { - m_inta_cb.resolve_safe(); - m_intb_cb.resolve_safe(); - m_sqw_cb.resolve_safe(); - m_tod_alarm = 0; m_watchdog_alarm = 0; m_square = 1; diff --git a/src/devices/machine/ds75160a.cpp b/src/devices/machine/ds75160a.cpp index 6caf1fcc046..d4e7f0a4582 100644 --- a/src/devices/machine/ds75160a.cpp +++ b/src/devices/machine/ds75160a.cpp @@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(DS75160A, ds75160a_device, "ds75160a", "DS75160A GPIB Transce ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS75160A, tag, owner, clock), - m_read(*this), + m_read(*this, 0), m_write(*this), m_data(0xff), m_te(0), @@ -44,10 +44,6 @@ ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, void ds75160a_device::device_start() { - // resolve callbacks - m_read.resolve_safe(0); - m_write.resolve_safe(); - // register for state saving save_item(NAME(m_data)); save_item(NAME(m_te)); diff --git a/src/devices/machine/ds75161a.cpp b/src/devices/machine/ds75161a.cpp index 2b54d43b266..e314b84b7ea 100644 --- a/src/devices/machine/ds75161a.cpp +++ b/src/devices/machine/ds75161a.cpp @@ -29,14 +29,14 @@ DEFINE_DEVICE_TYPE(DS75161A, ds75161a_device, "ds75161a", "DS75161A GPIB Transce ds75161a_device::ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS75161A, tag, owner, clock), - m_in_ren_cb(*this), - m_in_ifc_cb(*this), - m_in_ndac_cb(*this), - m_in_nrfd_cb(*this), - m_in_dav_cb(*this), - m_in_eoi_cb(*this), - m_in_atn_cb(*this), - m_in_srq_cb(*this), + m_in_ren_cb(*this, 0), + m_in_ifc_cb(*this, 0), + m_in_ndac_cb(*this, 0), + m_in_nrfd_cb(*this, 0), + m_in_dav_cb(*this, 0), + m_in_eoi_cb(*this, 0), + m_in_atn_cb(*this, 0), + m_in_srq_cb(*this, 0), m_out_ren_cb(*this), m_out_ifc_cb(*this), m_out_ndac_cb(*this), @@ -64,25 +64,6 @@ ds75161a_device::ds75161a_device(const machine_config &mconfig, const char *tag, void ds75161a_device::device_start() { - // resolve callbacks - m_in_ren_cb.resolve_safe(0); - m_in_ifc_cb.resolve_safe(0); - m_in_ndac_cb.resolve_safe(0); - m_in_nrfd_cb.resolve_safe(0); - m_in_dav_cb.resolve_safe(0); - m_in_eoi_cb.resolve_safe(0); - m_in_atn_cb.resolve_safe(0); - m_in_srq_cb.resolve_safe(0); - - m_out_ren_cb.resolve_safe(); - m_out_ifc_cb.resolve_safe(); - m_out_ndac_cb.resolve_safe(); - m_out_nrfd_cb.resolve_safe(); - m_out_dav_cb.resolve_safe(); - m_out_eoi_cb.resolve_safe(); - m_out_atn_cb.resolve_safe(); - m_out_srq_cb.resolve_safe(); - // register for state saving save_item(NAME(m_ren)); save_item(NAME(m_ifc)); diff --git a/src/devices/machine/ds8874.cpp b/src/devices/machine/ds8874.cpp index 97dcce35bea..2b978d15403 100644 --- a/src/devices/machine/ds8874.cpp +++ b/src/devices/machine/ds8874.cpp @@ -36,9 +36,6 @@ ds8874_device::ds8874_device(const machine_config &mconfig, const char *tag, dev void ds8874_device::device_start() { - // resolve callbacks - m_write_output.resolve_safe(); - // zerofill m_data = 0; m_cp = 0; diff --git a/src/devices/machine/e0516.cpp b/src/devices/machine/e0516.cpp index 7cae578ad2b..abf3d181048 100644 --- a/src/devices/machine/e0516.cpp +++ b/src/devices/machine/e0516.cpp @@ -44,7 +44,7 @@ DEFINE_DEVICE_TYPE(E0516, e0516_device, "e0516", "E05-16 RTC") e0516_device::e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, E0516, tag, owner, clock), device_rtc_interface(mconfig, *this), - m_read_outsel(*this), + m_read_outsel(*this, 1), m_write_sec(*this), m_write_min(*this), m_write_hrs(*this), @@ -69,13 +69,6 @@ e0516_device::e0516_device(const machine_config &mconfig, const char *tag, devic void e0516_device::device_start() { - // resolve callbacks - m_read_outsel.resolve_safe(1); - m_write_sec.resolve_safe(); - m_write_min.resolve_safe(); - m_write_hrs.resolve_safe(); - m_write_day.resolve_safe(); - // allocate timers m_timer = timer_alloc(FUNC(e0516_device::timer_tick), this); m_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); diff --git a/src/devices/machine/e05a03.cpp b/src/devices/machine/e05a03.cpp index cd01df5c7b2..a3c70907549 100644 --- a/src/devices/machine/e05a03.cpp +++ b/src/devices/machine/e05a03.cpp @@ -16,22 +16,22 @@ DEFINE_DEVICE_TYPE(E05A03, e05a03_device, "e05a03", "Epson E05A03 Gate Array") -e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, E05A03, tag, owner, clock), +e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, E05A03, tag, owner, clock), m_write_nlq_lp(*this), m_write_pe_lp(*this), m_write_reso(*this), m_write_pe(*this), - m_read_data(*this), + m_read_data(*this, 0), m_shift(0), m_busy_leading(0), m_busy_software(0), m_nlqlp(0), m_cndlp(0), - #if 0 +#if 0 m_pe(0), m_pelp(0), - #endif +#endif m_printhead(0), m_pf_motor(0), m_cr_motor(0) @@ -44,23 +44,16 @@ e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, dev void e05a03_device::device_start() { - /* resolve callbacks */ - m_write_nlq_lp.resolve_safe(); - m_write_pe_lp.resolve_safe(); - m_write_reso.resolve_safe(); - m_write_pe.resolve_safe(); - m_read_data.resolve_safe(0); - /* register for state saving */ save_item(NAME(m_shift)); save_item(NAME(m_busy_leading)); save_item(NAME(m_busy_software)); save_item(NAME(m_nlqlp)); save_item(NAME(m_cndlp)); - #if 0 +#if 0 save_item(NAME(m_pe)); save_item(NAME(m_pelp)); - #endif +#endif save_item(NAME(m_printhead)); save_item(NAME(m_pf_motor)); save_item(NAME(m_cr_motor)); diff --git a/src/devices/machine/e05a30.cpp b/src/devices/machine/e05a30.cpp index a9fc241ebcb..272fd3d2716 100644 --- a/src/devices/machine/e05a30.cpp +++ b/src/devices/machine/e05a30.cpp @@ -43,19 +43,6 @@ e05a30_device::e05a30_device(const machine_config &mconfig, const char *tag, dev void e05a30_device::device_start() { - /* resolve callbacks */ - m_write_printhead.resolve_safe(); - m_write_pf_stepper.resolve_safe(); - m_write_cr_stepper.resolve_safe(); - m_write_ready.resolve_safe(); - m_write_centronics_ack.resolve_safe(); - m_write_centronics_busy.resolve_safe(); - m_write_centronics_perror.resolve_safe(); - m_write_centronics_fault.resolve_safe(); - m_write_centronics_select.resolve_safe(); - m_write_cpu_reset.resolve_safe(); - m_write_ready_led.resolve_safe(); - /* register for state saving */ save_item(NAME(m_printhead)); save_item(NAME(m_pf_stepper)); diff --git a/src/devices/machine/edlc.cpp b/src/devices/machine/edlc.cpp index e97b1d9f91a..5a76d5fd96f 100644 --- a/src/devices/machine/edlc.cpp +++ b/src/devices/machine/edlc.cpp @@ -52,10 +52,6 @@ seeq8003_device::seeq8003_device(machine_config const &mconfig, char const *tag, void seeq8003_device::device_start() { - m_out_int.resolve_safe(); - m_out_rxrdy.resolve_safe(); - m_out_txrdy.resolve_safe(); - save_item(NAME(m_int_state)); save_item(NAME(m_reset_state)); save_item(NAME(m_station_address)); diff --git a/src/devices/machine/eepromser.cpp b/src/devices/machine/eepromser.cpp index 5667a575371..2ba5fcc59be 100644 --- a/src/devices/machine/eepromser.cpp +++ b/src/devices/machine/eepromser.cpp @@ -190,9 +190,6 @@ void eeprom_serial_base_device::device_start() // start the base class eeprom_base_device::device_start(); - // resolve callback - m_do_cb.resolve_safe(); - // save the current state save_item(NAME(m_state)); save_item(NAME(m_cs_state)); diff --git a/src/devices/machine/exorterm.cpp b/src/devices/machine/exorterm.cpp index c5be4b2c547..f6166bc22b0 100644 --- a/src/devices/machine/exorterm.cpp +++ b/src/devices/machine/exorterm.cpp @@ -729,13 +729,6 @@ TIMER_CALLBACK_MEMBER(exorterm155_device::kbd_repeat) -void exorterm155_device::device_resolve_objects() -{ - m_rs232_conn_dtr_handler.resolve_safe(); - m_rs232_conn_rts_handler.resolve_safe(); - m_rs232_conn_txd_handler.resolve_safe(); -} - void exorterm155_device::device_start() { m_online_led.resolve(); diff --git a/src/devices/machine/exorterm.h b/src/devices/machine/exorterm.h index 52a63d7aaf7..45c141a7b95 100644 --- a/src/devices/machine/exorterm.h +++ b/src/devices/machine/exorterm.h @@ -45,7 +45,6 @@ public: protected: exorterm155_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp index 9df44f557bb..87ee05ed19c 100644 --- a/src/devices/machine/f3853.cpp +++ b/src/devices/machine/f3853.cpp @@ -46,7 +46,7 @@ DEFINE_DEVICE_TYPE(F38T56, f38t56_device, "f38t56_psu", "Fairchild F38T56 PSU") f3853_device::f3853_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock), m_int_req_callback(*this), - m_pri_out_callback(*this), + m_pri_out_callback(*this), // TODO: not implemented m_int_daisy_chain_callback(*this), m_int_vector(0), m_prescaler(31), @@ -60,7 +60,7 @@ f3853_device::f3853_device(const machine_config &mconfig, const char *tag, devic f3851_device::f3851_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : f3853_device(mconfig, type, tag, owner, clock), - m_read_port(*this), + m_read_port(*this, 0), m_write_port(*this) { } @@ -88,20 +88,9 @@ f38t56_device::f38t56_device(const machine_config &mconfig, const char *tag, dev void f3853_device::device_resolve_objects() { - m_int_req_callback.resolve_safe(); - m_pri_out_callback.resolve_safe(); // TODO: not implemented m_int_daisy_chain_callback.resolve(); } -void f3851_device::device_resolve_objects() -{ - f3853_device::device_resolve_objects(); - - // 2 I/O ports - m_read_port.resolve_all_safe(0); - m_write_port.resolve_all_safe(); -} - void f3853_device::device_start() { // lookup table for 3851/3853 lfsr timer diff --git a/src/devices/machine/f3853.h b/src/devices/machine/f3853.h index 3b1ed5cab44..16bdde050e2 100644 --- a/src/devices/machine/f3853.h +++ b/src/devices/machine/f3853.h @@ -86,7 +86,7 @@ public: protected: f3853_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; @@ -136,8 +136,6 @@ public: protected: f3851_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - virtual void device_resolve_objects() override; - devcb_read8::array<2> m_read_port; devcb_write8::array<2> m_write_port; }; diff --git a/src/devices/machine/f4702.cpp b/src/devices/machine/f4702.cpp index 0beb7941057..db756c650d3 100644 --- a/src/devices/machine/f4702.cpp +++ b/src/devices/machine/f4702.cpp @@ -78,7 +78,7 @@ DEFINE_DEVICE_TYPE(F4702, f4702_device, "f4702", "Fairchild 4702B Bit Rate Gener f4702_device::f4702_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, F4702, tag, owner, clock) , device_execute_interface(mconfig, *this) - , m_s_callback(*this) + , m_s_callback(*this, 15) , m_z_callback(*this) , m_main_counter(0) , m_div_200_50(0) @@ -92,20 +92,6 @@ f4702_device::f4702_device(const machine_config &mconfig, const char *tag, devic } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void f4702_device::device_resolve_objects() -{ - // resolve callbacks - m_s_callback.resolve_safe(15); - m_z_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/f4702.h b/src/devices/machine/f4702.h index 9d2ff0f16c7..dcafebe5fd0 100644 --- a/src/devices/machine/f4702.h +++ b/src/devices/machine/f4702.h @@ -41,11 +41,10 @@ public: void reset_counters(); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; - // device_execute_interface overrides + // device_execute_interface implementation virtual void execute_run() override; private: diff --git a/src/devices/machine/fdc37c665gt.cpp b/src/devices/machine/fdc37c665gt.cpp index 7dc6916f11b..05a2c2eb446 100644 --- a/src/devices/machine/fdc37c665gt.cpp +++ b/src/devices/machine/fdc37c665gt.cpp @@ -47,18 +47,6 @@ fdc37c665gt_device::fdc37c665gt_device(const machine_config &mconfig, const char void fdc37c665gt_device::device_start() { - m_fintr_callback.resolve_safe(); - m_fdrq_callback.resolve_safe(); - m_pintr1_callback.resolve_safe(); - m_irq3_callback.resolve_safe(); - m_irq4_callback.resolve_safe(); - m_txd1_callback.resolve_safe(); - m_ndtr1_callback.resolve_safe(); - m_nrts1_callback.resolve_safe(); - m_txd2_callback.resolve_safe(); - m_ndtr2_callback.resolve_safe(); - m_nrts2_callback.resolve_safe(); - // Configuration registers and related bits aren't affected by soft resets // Default addresses com_addresses[0] = 0x3f8; diff --git a/src/devices/machine/fdc37c93x.cpp b/src/devices/machine/fdc37c93x.cpp index d1866c8ea7c..313ecbeeedb 100644 --- a/src/devices/machine/fdc37c93x.cpp +++ b/src/devices/machine/fdc37c93x.cpp @@ -982,17 +982,6 @@ void fdc37c93x_device::device_start() m_isa->set_dma_channel(2, this, true); m_isa->set_dma_channel(3, this, true); remap(AS_IO, 0, 0x400); - m_gp20_reset_callback.resolve_safe(); - m_gp25_gatea20_callback.resolve_safe(); - m_irq1_callback.resolve_safe(); - m_irq8_callback.resolve_safe(); - m_irq9_callback.resolve_safe(); - m_txd1_callback.resolve_safe(); - m_ndtr1_callback.resolve_safe(); - m_nrts1_callback.resolve_safe(); - m_txd2_callback.resolve_safe(); - m_ndtr2_callback.resolve_safe(); - m_nrts2_callback.resolve_safe(); } void fdc37c93x_device::device_reset() diff --git a/src/devices/machine/fga002.cpp b/src/devices/machine/fga002.cpp index d39ec5cdd6c..f9683b4f152 100644 --- a/src/devices/machine/fga002.cpp +++ b/src/devices/machine/fga002.cpp @@ -76,10 +76,10 @@ DEFINE_DEVICE_TYPE(FGA002, fga002_device, "fga002", "Force FGA-002") fga002_device::fga002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_out_int_cb(*this) - , m_liack4_cb(*this) - , m_liack5_cb(*this) - , m_liack6_cb(*this) - , m_liack7_cb(*this) + , m_liack4_cb(*this, 0) + , m_liack5_cb(*this, 0) + , m_liack6_cb(*this, 0) + , m_liack7_cb(*this, 0) , m_irq_level(uint8_t(0)) { for (auto & elem : m_int_state) @@ -95,13 +95,6 @@ void fga002_device::device_start() { LOG("%s\n", FUNCNAME); - // resolve callbacks - m_out_int_cb.resolve_safe(); - m_liack4_cb.resolve_safe(0); - m_liack5_cb.resolve_safe(0); - m_liack6_cb.resolve_safe(0); - m_liack7_cb.resolve_safe(0); - // Timers fga_timer = timer_alloc(FUNC(fga002_device::timer_tick), this); diff --git a/src/devices/machine/fm_scsi.cpp b/src/devices/machine/fm_scsi.cpp index d2b8fcd266f..4747f8ab856 100644 --- a/src/devices/machine/fm_scsi.cpp +++ b/src/devices/machine/fm_scsi.cpp @@ -75,9 +75,6 @@ void fmscsi_device::device_start() m_target = 0; m_phase = SCSI_PHASE_BUS_FREE; - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - // allocate read timer m_transfer_timer = timer_alloc(FUNC(fmscsi_device::update_transfer), this); m_phase_timer = timer_alloc(FUNC(fmscsi_device::set_phase), this); diff --git a/src/devices/machine/gayle.cpp b/src/devices/machine/gayle.cpp index 25639bda6c2..bb43e8d5188 100644 --- a/src/devices/machine/gayle.cpp +++ b/src/devices/machine/gayle.cpp @@ -54,7 +54,7 @@ gayle_device::gayle_device(const machine_config &mconfig, const char *tag, devic m_int2_w(*this), m_int6_w(*this), m_rst_w(*this), - m_ide_cs_r_cb(*this), + m_ide_cs_r_cb(*this, 0xffff), m_ide_cs_w_cb(*this), m_gayle_id(0xff), m_gayle_id_count(0) @@ -67,13 +67,6 @@ gayle_device::gayle_device(const machine_config &mconfig, const char *tag, devic void gayle_device::device_start() { - // resolve callbacks - m_int2_w.resolve_safe(); - m_int6_w.resolve_safe(); - m_rst_w.resolve_safe(); - m_ide_cs_r_cb.resolve_all_safe(0xffff); - m_ide_cs_w_cb.resolve_all_safe(); - save_item(NAME(m_gayle_id_count)); save_item(NAME(m_gayle_reg)); save_item(NAME(m_line_state)); diff --git a/src/devices/machine/gen_fifo.cpp b/src/devices/machine/gen_fifo.cpp index 6dd2c3137d4..188c5df4eda 100644 --- a/src/devices/machine/gen_fifo.cpp +++ b/src/devices/machine/gen_fifo.cpp @@ -49,9 +49,6 @@ template void generic_fifo_device_base::clear() template void generic_fifo_device_base::device_start() { - m_empty_cb.resolve_safe(); - m_full_cb.resolve_safe(); - m_sync_empty = timer_alloc(FUNC(generic_fifo_device_base::sync_empty), this); m_sync_full = timer_alloc(FUNC(generic_fifo_device_base::sync_full), this); diff --git a/src/devices/machine/gen_latch.cpp b/src/devices/machine/gen_latch.cpp index a133f6cbdbd..49b57a8bb88 100644 --- a/src/devices/machine/gen_latch.cpp +++ b/src/devices/machine/gen_latch.cpp @@ -45,7 +45,6 @@ generic_latch_base_device::generic_latch_base_device(const machine_config &mconf void generic_latch_base_device::device_start() { - m_data_pending_cb.resolve_safe(); save_item(NAME(m_latch_written)); // synchronization is needed since other devices may not be initialized yet diff --git a/src/devices/machine/generalplus_gpl16250soc.cpp b/src/devices/machine/generalplus_gpl16250soc.cpp index 43e4fcf3940..dc4505ce9ff 100644 --- a/src/devices/machine/generalplus_gpl16250soc.cpp +++ b/src/devices/machine/generalplus_gpl16250soc.cpp @@ -25,6 +25,33 @@ DEFINE_DEVICE_TYPE(GCM394, sunplus_gcm394_device, "gcm394", "GeneralPlus GPL16250 System-on-a-Chip") +sunplus_gcm394_base_device::sunplus_gcm394_base_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock, address_map_constructor internal) : + unsp_20_device(mconfig, type, tag, owner, clock, internal), + device_mixer_interface(mconfig, *this, 2), + m_screen(*this, finder_base::DUMMY_TAG), + m_spg_video(*this, "spgvideo"), + m_spg_audio(*this, "spgaudio"), + m_internalrom(*this, "internal"), + m_mainram(*this, "mainram"), + m_porta_in(*this, 0), + m_portb_in(*this, 0), + m_portc_in(*this, 0), + m_portd_in(*this, 0), + m_porta_out(*this), + m_portb_out(*this), + m_portc_out(*this), + m_portd_out(*this), + m_nand_read_cb(*this, 0), + m_csbase(0x20000), + m_cs_space(nullptr), + m_romtype(0), + m_space_read_cb(*this, 0), + m_space_write_cb(*this), + m_boot_mode(0), + m_cs_callback(*this, DEVICE_SELF, FUNC(sunplus_gcm394_base_device::default_cs_callback)) +{ +} + sunplus_gcm394_device::sunplus_gcm394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sunplus_gcm394_base_device(mconfig, GCM394, tag, owner, clock) { @@ -526,7 +553,6 @@ void sunplus_gcm394_base_device::chipselect_csx_memory_device_control_w(offs_t o logerror("CS%d set to size: %02x (%08x words) md: %01x %s warat: %01x wait: %01x\n", offset, cs_size, (cs_size+1)*0x10000, cs_md, md[cs_md], cs_warat, cs_wait); - m_cs_callback(m_782x[0], m_782x[1], m_782x[2], m_782x[3], m_782x[4]); } @@ -551,8 +577,7 @@ uint16_t sunplus_gcm394_base_device::ioarea_7860_porta_r() void sunplus_gcm394_base_device::ioarea_7860_porta_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7860_porta_w %04x\n", machine().describe_context(), data); - if (m_porta_out) - m_porta_out(data); + m_porta_out(data); } uint16_t sunplus_gcm394_base_device::ioarea_7861_porta_buffer_r() @@ -607,16 +632,13 @@ uint16_t sunplus_gcm394_base_device::ioarea_7869_portb_buffer_r() void sunplus_gcm394_base_device::ioarea_7869_portb_buffer_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7869_portb_buffer_w %04x\n", machine().describe_context(), data); - - if (m_portb_out) // buffer writes must update output state too, beijuehh requires it for banking - m_portb_out(data); + m_portb_out(data); // buffer writes must update output state too, beijuehh requires it for banking } void sunplus_gcm394_base_device::ioarea_7868_portb_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7868_portb_w %04x\n", machine().describe_context(), data); - if (m_portb_out) - m_portb_out(data); + m_portb_out(data); } uint16_t sunplus_gcm394_base_device::ioarea_786a_portb_direction_r() @@ -655,8 +677,7 @@ void sunplus_gcm394_base_device::ioarea_7870_portc_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7870_portc_w %04x\n", machine().describe_context(), data); m_7870 = data; - if (m_portc_out) - m_portc_out(data); + m_portc_out(data); } uint16_t sunplus_gcm394_base_device::ioarea_7871_portc_buffer_r() @@ -707,9 +728,7 @@ void sunplus_gcm394_base_device::ioarea_7878_portd_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7878_portd_w %04x\n", machine().describe_context(), data); //m_7878 = data; - - if (m_portd_out) - m_portd_out(data); + m_portd_out(data); } uint16_t sunplus_gcm394_base_device::ioarea_7879_portd_buffer_r() @@ -721,9 +740,7 @@ uint16_t sunplus_gcm394_base_device::ioarea_7879_portd_buffer_r() void sunplus_gcm394_base_device::ioarea_7879_portd_buffer_w(uint16_t data) { LOGMASKED(LOG_GCM394_IO, "%s:sunplus_gcm394_base_device::ioarea_7879_portd_buffer_w %04x\n", machine().describe_context(), data); - - if (m_portd_out) // buffer writes must update output state too, beijuehh requires it for banking - m_portd_out(data); + m_portd_out(data); // buffer writes must update output state too, beijuehh requires it for banking } @@ -1570,22 +1587,6 @@ void sunplus_gcm394_base_device::device_start() m_cs_callback.resolve(); - m_porta_in.resolve_safe(0); - m_portb_in.resolve_safe(0); - m_portc_in.resolve_safe(0); - m_portd_in.resolve_safe(0); - - m_porta_out.resolve(); - m_portb_out.resolve(); - m_portc_out.resolve(); - m_portd_out.resolve(); - - - m_space_read_cb.resolve_safe(0); - m_space_write_cb.resolve(); - - m_nand_read_cb.resolve_safe(0); - m_unk_timer = timer_alloc(FUNC(sunplus_gcm394_base_device::unknown_tick), this); m_unk_timer->adjust(attotime::never); diff --git a/src/devices/machine/generalplus_gpl16250soc.h b/src/devices/machine/generalplus_gpl16250soc.h index 6fe6c2825da..f50f2eeef60 100644 --- a/src/devices/machine/generalplus_gpl16250soc.h +++ b/src/devices/machine/generalplus_gpl16250soc.h @@ -27,33 +27,6 @@ public: { } - sunplus_gcm394_base_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock, address_map_constructor internal) : - unsp_20_device(mconfig, type, tag, owner, clock, internal), - device_mixer_interface(mconfig, *this, 2), - m_screen(*this, finder_base::DUMMY_TAG), - m_spg_video(*this, "spgvideo"), - m_spg_audio(*this, "spgaudio"), - m_internalrom(*this, "internal"), - m_mainram(*this, "mainram"), - m_porta_in(*this), - m_portb_in(*this), - m_portc_in(*this), - m_portd_in(*this), - m_porta_out(*this), - m_portb_out(*this), - m_portc_out(*this), - m_portd_out(*this), - m_nand_read_cb(*this), - m_csbase(0x20000), - m_cs_space(nullptr), - m_romtype(0), - m_space_read_cb(*this), - m_space_write_cb(*this), - m_boot_mode(0), - m_cs_callback(*this, DEVICE_SELF, FUNC(sunplus_gcm394_base_device::default_cs_callback)) - { - } - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_spg_video->screen_update(screen, bitmap, cliprect); } auto porta_in() { return m_porta_in.bind(); } @@ -95,6 +68,7 @@ public: inline uint16_t get_ram_addr(uint32_t addr) { return m_mainram[addr]; } protected: + sunplus_gcm394_base_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock, address_map_constructor internal); virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/generalplus_gpl16250soc_video.cpp b/src/devices/machine/generalplus_gpl16250soc_video.cpp index 4f971d1ba08..b9bdc02351a 100644 --- a/src/devices/machine/generalplus_gpl16250soc_video.cpp +++ b/src/devices/machine/generalplus_gpl16250soc_video.cpp @@ -33,7 +33,7 @@ gcm394_base_video_device::gcm394_base_video_device(const machine_config &mconfig m_video_irq_cb(*this), m_palette(*this, "palette"), m_gfxdecode(*this, "gfxdecode"), - m_space_read_cb(*this), + m_space_read_cb(*this, 0), m_rowscroll(*this, "^rowscroll"), m_rowzoom(*this, "^rowzoom"), m_alt_extrasprite_hack(0), @@ -200,16 +200,12 @@ void gcm394_base_video_device::decodegfx(const char* tag) void gcm394_base_video_device::device_start() { - m_video_irq_cb.resolve(); - m_maxgfxelement = 0; // debug helper only if (memregion(":maincpu")) decodegfx(":maincpu"); - m_space_read_cb.resolve_safe(0); - m_screenpos_timer = timer_alloc(FUNC(gcm394_base_video_device::screen_pos_reached), this); m_screenpos_timer->adjust(attotime::never); diff --git a/src/devices/machine/genpc.cpp b/src/devices/machine/genpc.cpp index fcb6e5e6349..3dcfc3dc192 100644 --- a/src/devices/machine/genpc.cpp +++ b/src/devices/machine/genpc.cpp @@ -16,6 +16,7 @@ #include "machine/pit8253.h" #include "machine/ram.h" #include "sound/spkrdev.h" + #include "speaker.h" @@ -555,21 +556,6 @@ void ibm5160_mb_device::map(address_map &map) } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void ibm5160_mb_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); - m_nmi_callback.resolve_safe(); - m_kbdclk_callback.resolve_safe(); - m_kbddata_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/genpc.h b/src/devices/machine/genpc.h index bc938e22697..1fa96086c1f 100644 --- a/src/devices/machine/genpc.h +++ b/src/devices/machine/genpc.h @@ -63,11 +63,9 @@ public: protected: ibm5160_mb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // optional information overrides virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; @@ -102,12 +100,12 @@ protected: int m_ppi_portc_switch_high; int m_ppi_speaker; int m_ppi_keyboard_clear; - uint8_t m_ppi_keyb_clock; - uint8_t m_ppi_portb; - uint8_t m_ppi_clock_signal; - uint8_t m_ppi_data_signal; - uint8_t m_ppi_shift_register; - uint8_t m_ppi_shift_enable; + uint8_t m_ppi_keyb_clock; + uint8_t m_ppi_portb; + uint8_t m_ppi_clock_signal; + uint8_t m_ppi_data_signal; + uint8_t m_ppi_shift_register; + uint8_t m_ppi_shift_enable; uint8_t pc_ppi_porta_r(); uint8_t pc_ppi_portc_r(); @@ -152,7 +150,7 @@ public: protected: ibm5150_mb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/machine/gt913_kbd.cpp b/src/devices/machine/gt913_kbd.cpp index ba7a2ff521c..8b086b00626 100644 --- a/src/devices/machine/gt913_kbd.cpp +++ b/src/devices/machine/gt913_kbd.cpp @@ -36,8 +36,6 @@ gt913_kbd_hle_device::gt913_kbd_hle_device(const machine_config &mconfig, const void gt913_kbd_hle_device::device_start() { - m_irq_cb.resolve_safe(); - save_item(NAME(m_status)); save_item(NAME(m_fifo)); save_item(NAME(m_fifo_read)); diff --git a/src/devices/machine/hd63450.cpp b/src/devices/machine/hd63450.cpp index 8afa091fe0d..6cc4ad92fc2 100644 --- a/src/devices/machine/hd63450.cpp +++ b/src/devices/machine/hd63450.cpp @@ -18,7 +18,7 @@ hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, HD63450, tag, owner, clock) , m_irq_callback(*this) , m_dma_end(*this) - , m_dma_read(*this) + , m_dma_read(*this, 0) , m_dma_write(*this) , m_cpu(*this, finder_base::DUMMY_TAG) { @@ -42,12 +42,6 @@ hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, d void hd63450_device::device_start() { - // resolve callbacks - m_irq_callback.resolve_safe(); - m_dma_end.resolve_safe(); - m_dma_read.resolve_all(); - m_dma_write.resolve_all(); - // Initialise timers and registers for (int x = 0; x < 4; x++) m_timer[x] = timer_alloc(FUNC(hd63450_device::dma_transfer_timer), this); @@ -368,7 +362,7 @@ void hd63450_device::single_transfer(int x) if (m_reg[x].ocr & 0x80) // direction: 1 = device -> memory { - if (!m_dma_read[x].isnull()) + if (!m_dma_read[x].isunset()) { data = m_dma_read[x](m_reg[x].mar); if (data == -1) @@ -408,7 +402,7 @@ void hd63450_device::single_transfer(int x) } else // memory -> device { - if (!m_dma_write[x].isnull()) + if (!m_dma_write[x].isunset()) { data = space.read_byte(m_reg[x].mar); m_dma_write[x]((offs_t)m_reg[x].mar,data); diff --git a/src/devices/machine/hd64610.cpp b/src/devices/machine/hd64610.cpp index 13ac2861b63..b1a33bde023 100644 --- a/src/devices/machine/hd64610.cpp +++ b/src/devices/machine/hd64610.cpp @@ -170,10 +170,6 @@ hd64610_device::hd64610_device(const machine_config &mconfig, const char *tag, d void hd64610_device::device_start() { - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_1hz_cb.resolve_safe(); - // allocate timers m_counter_timer = timer_alloc(FUNC(hd64610_device::update_counter), this); m_counter_timer->adjust(attotime::from_hz(clock() / 256), 0, attotime::from_hz(clock() / 256)); diff --git a/src/devices/machine/hdc92x4.cpp b/src/devices/machine/hdc92x4.cpp index b4b19cdf359..1ffe1428a27 100644 --- a/src/devices/machine/hdc92x4.cpp +++ b/src/devices/machine/hdc92x4.cpp @@ -473,7 +473,7 @@ hdc92x4_device::hdc92x4_device(const machine_config &mconfig, device_type type, m_out_dmarq(*this), m_out_dip(*this), m_out_auxbus(*this), - m_in_dma(*this), + m_in_dma(*this, 0), m_out_dma(*this), m_initialized(false) { @@ -4787,13 +4787,6 @@ void hdc92x4_device::reset(int state) void hdc92x4_device::device_start() { - m_out_intrq.resolve_safe(); - m_out_dip.resolve_safe(); - m_out_auxbus.resolve_safe(); - m_out_dmarq.resolve_safe(); - m_out_dma.resolve_safe(); - m_in_dma.resolve_safe(0); - // allocate timers m_timer = timer_alloc(FUNC(hdc92x4_device::gen_timer_expired), this); m_cmd_timer = timer_alloc(FUNC(hdc92x4_device::com_timer_expired), this); diff --git a/src/devices/machine/hp_dc100_tape.cpp b/src/devices/machine/hp_dc100_tape.cpp index ead54b4842c..75e4778f2c5 100644 --- a/src/devices/machine/hp_dc100_tape.cpp +++ b/src/devices/machine/hp_dc100_tape.cpp @@ -78,7 +78,7 @@ hp_dc100_tape_device::hp_dc100_tape_device(const machine_config &mconfig, const , m_tacho_tick_handler(*this) , m_motion_handler(*this) , m_rd_bit_handler(*this) - , m_wr_bit_handler(*this) + , m_wr_bit_handler(*this, 0) , m_unit_name() , m_image() , m_image_dirty(false) @@ -457,13 +457,6 @@ void hp_dc100_tape_device::time_to_next_gap(hti_format_t::tape_pos_t min_gap_siz void hp_dc100_tape_device::device_start() { - m_cart_out_handler.resolve_safe(); - m_hole_handler.resolve_safe(); - m_tacho_tick_handler.resolve_safe(); - m_motion_handler.resolve_safe(); - m_rd_bit_handler.resolve_safe(); - m_wr_bit_handler.resolve_safe(0); - save_item(NAME(m_acceleration)); save_item(NAME(m_slow_set_point)); save_item(NAME(m_fast_set_point)); diff --git a/src/devices/machine/hp_taco.cpp b/src/devices/machine/hp_taco.cpp index b07cbe01e59..d32076311bd 100644 --- a/src/devices/machine/hp_taco.cpp +++ b/src/devices/machine/hp_taco.cpp @@ -560,10 +560,6 @@ void hp_taco_device::device_add_mconfig(machine_config &config) void hp_taco_device::device_start() { LOG("device_start\n"); - m_irq_handler.resolve_safe(); - m_flg_handler.resolve_safe(); - m_sts_handler.resolve_safe(); - save_item(NAME(m_data_reg)); save_item(NAME(m_cmd_reg)); save_item(NAME(m_status_reg)); diff --git a/src/devices/machine/i7220.cpp b/src/devices/machine/i7220.cpp index 405305284cf..aecb95bb16d 100644 --- a/src/devices/machine/i7220.cpp +++ b/src/devices/machine/i7220.cpp @@ -74,10 +74,6 @@ i7220_device::i7220_device(const machine_config &mconfig, const char *tag, devic void i7220_device::device_start() { - // resolve callbacks - intrq_cb.resolve_safe(); - drq_cb.resolve_safe(); - m_bi.tm = timer_alloc(FUNC(i7220_device::general_continue), this); // register for state saving diff --git a/src/devices/machine/i80130.cpp b/src/devices/machine/i80130.cpp index 38fcda0dfa0..09a5edceacf 100644 --- a/src/devices/machine/i80130.cpp +++ b/src/devices/machine/i80130.cpp @@ -144,13 +144,6 @@ i80130_device::i80130_device(const machine_config &mconfig, const char *tag, dev void i80130_device::device_start() { - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_ack.resolve_safe(); - m_write_lir.resolve_safe(); - m_write_systick.resolve_safe(); - m_write_delay.resolve_safe(); - m_write_baud.resolve_safe(); } diff --git a/src/devices/machine/i8087.cpp b/src/devices/machine/i8087.cpp index 93c6e90fe57..17613b1edbe 100644 --- a/src/devices/machine/i8087.cpp +++ b/src/devices/machine/i8087.cpp @@ -196,8 +196,6 @@ void i8087_device::device_start() save_item(NAME(m_sw)); save_item(NAME(m_tw)); - m_int_handler.resolve_safe(); - m_busy_handler.resolve_safe(); m_timer = timer_alloc(FUNC(i8087_device::release_busy), this); build_opcode_table(); } diff --git a/src/devices/machine/i8155.cpp b/src/devices/machine/i8155.cpp index c077b038c0e..7fad5016760 100644 --- a/src/devices/machine/i8155.cpp +++ b/src/devices/machine/i8155.cpp @@ -268,26 +268,26 @@ inline void i8155_device::write_port(int port, uint8_t data) // i8155_device - constructor //------------------------------------------------- -i8155_device::i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : i8155_device(mconfig, I8155, tag, owner, clock) +i8155_device::i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + i8155_device(mconfig, I8155, tag, owner, clock) { } -i8155_device::i8155_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), - m_in_pa_cb(*this), - m_in_pb_cb(*this), - m_in_pc_cb(*this), - m_out_pa_cb(*this), - m_out_pb_cb(*this), - m_out_pc_cb(*this), - m_out_to_cb(*this), - m_command(0), - m_status(0), - m_count_length(0), - m_count_loaded(0), - m_to(0), - m_count_even_phase(false) +i8155_device::i8155_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + m_in_pa_cb(*this, 0), + m_in_pb_cb(*this, 0), + m_in_pc_cb(*this, 0), + m_out_pa_cb(*this), + m_out_pb_cb(*this), + m_out_pc_cb(*this), + m_out_to_cb(*this), + m_command(0), + m_status(0), + m_count_length(0), + m_count_loaded(0), + m_to(0), + m_count_even_phase(false) { } @@ -296,8 +296,8 @@ i8155_device::i8155_device(const machine_config &mconfig, device_type type, cons // i8156_device - constructor //------------------------------------------------- -i8156_device::i8156_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : i8155_device(mconfig, I8156, tag, owner, clock) +i8156_device::i8156_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + i8155_device(mconfig, I8156, tag, owner, clock) { } @@ -308,15 +308,6 @@ i8156_device::i8156_device(const machine_config &mconfig, const char *tag, devic void i8155_device::device_start() { - // resolve callbacks - m_in_pa_cb.resolve_safe(0); - m_in_pb_cb.resolve_safe(0); - m_in_pc_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_out_pb_cb.resolve_safe(); - m_out_pc_cb.resolve_safe(); - m_out_to_cb.resolve_safe(); - // allocate RAM m_ram = make_unique_clear(256); diff --git a/src/devices/machine/i8212.cpp b/src/devices/machine/i8212.cpp index 38b12d39c2a..af3cb72c722 100644 --- a/src/devices/machine/i8212.cpp +++ b/src/devices/machine/i8212.cpp @@ -60,9 +60,9 @@ DEFINE_DEVICE_TYPE(I8212, i8212_device, "i8212", "Intel 8212 I/O Port") i8212_device::i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8212, tag, owner, clock), m_write_int(*this), - m_read_di(*this), + m_read_di(*this, 0), m_write_do(*this), - m_read_md(*this), + m_read_md(*this, 0), m_stb(1), m_data(0) { } @@ -74,12 +74,6 @@ i8212_device::i8212_device(const machine_config &mconfig, const char *tag, devic void i8212_device::device_start() { - // resolve callbacks - m_write_int.resolve_safe(); - m_read_di.resolve_safe(0); - m_write_do.resolve_safe(); - m_read_md.resolve_safe(0); - // register for state saving save_item(NAME(m_stb)); save_item(NAME(m_data)); diff --git a/src/devices/machine/i8214.cpp b/src/devices/machine/i8214.cpp index b5a8c4140be..fa511e32963 100644 --- a/src/devices/machine/i8214.cpp +++ b/src/devices/machine/i8214.cpp @@ -135,10 +135,6 @@ i8214_device::i8214_device(const machine_config &mconfig, const char *tag, devic void i8214_device::device_start() { - // resolve callbacks - m_write_int.resolve_safe(); - m_write_enlg.resolve_safe(); - m_int_dis = 0; m_etlg = 1; diff --git a/src/devices/machine/i82355.cpp b/src/devices/machine/i82355.cpp index 88726f7f04e..b2c5d35abaf 100644 --- a/src/devices/machine/i82355.cpp +++ b/src/devices/machine/i82355.cpp @@ -65,19 +65,6 @@ i82355_device::i82355_device(const machine_config &mconfig, const char *tag, dev } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void i82355_device::device_resolve_objects() -{ - m_eint_callback.resolve_safe(); - m_lint_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/i82355.h b/src/devices/machine/i82355.h index 25cb776d9f7..8d219b36334 100644 --- a/src/devices/machine/i82355.h +++ b/src/devices/machine/i82355.h @@ -32,8 +32,7 @@ public: void local_w(offs_t offset, u8 data); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/i82357.cpp b/src/devices/machine/i82357.cpp index f26790a8cf5..0a044348036 100644 --- a/src/devices/machine/i82357.cpp +++ b/src/devices/machine/i82357.cpp @@ -204,10 +204,6 @@ void i82357_device::map(address_map &map) void i82357_device::device_start() { - m_out_rtc.resolve_safe(); - m_out_nmi.resolve_safe(); - m_out_spkr.resolve_safe(); - m_nmi_check = timer_alloc(FUNC(i82357_device::nmi_check), this); } diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp index ac45c713996..241a8ea8368 100644 --- a/src/devices/machine/i82371sb.cpp +++ b/src/devices/machine/i82371sb.cpp @@ -171,15 +171,6 @@ i82371sb_isa_device::i82371sb_isa_device(const machine_config &mconfig, device_t { } -void i82371sb_isa_device::device_start() -{ - pci_device::device_start(); - m_smi_callback.resolve(); - m_nmi_callback.resolve_safe(); - m_stpclk_callback.resolve_safe(); - m_boot_state_hook.resolve(); -} - void i82371sb_isa_device::device_reset() { pci_device::device_reset(); @@ -1026,8 +1017,6 @@ void i82371sb_ide_device::device_start() status = 0x0280; command = 2; command_mask = 5; - m_irq_pri_callback.resolve(); - m_irq_sec_callback.resolve(); } void i82371sb_ide_device::device_reset() diff --git a/src/devices/machine/i82371sb.h b/src/devices/machine/i82371sb.h index 53700449017..e03dcf16ba8 100644 --- a/src/devices/machine/i82371sb.h +++ b/src/devices/machine/i82371sb.h @@ -71,7 +71,6 @@ protected: virtual void device_add_mconfig(machine_config & config) override; virtual void device_config_complete() override; - virtual void device_start() override; virtual void device_reset() override; virtual void reset_all_mappings() override; diff --git a/src/devices/machine/i8243.cpp b/src/devices/machine/i8243.cpp index bdf49bb9791..ad6ed6d1820 100644 --- a/src/devices/machine/i8243.cpp +++ b/src/devices/machine/i8243.cpp @@ -27,7 +27,7 @@ i8243_device::i8243_device(const machine_config &mconfig, const char *tag, devic : device_t(mconfig, I8243, tag, owner, clock) , m_p{0, 0, 0, 0} , m_p2out(0x0f), m_p2(0x0f), m_opcode(0), m_prog(1), m_cs(0) - , m_readhandler(*this) + , m_readhandler(*this, 0) , m_writehandler(*this) { } @@ -38,9 +38,6 @@ i8243_device::i8243_device(const machine_config &mconfig, const char *tag, devic void i8243_device::device_start() { - m_readhandler.resolve_all(); - m_writehandler.resolve_all(); - save_item(NAME(m_p)); save_item(NAME(m_p2out)); save_item(NAME(m_p2)); @@ -76,7 +73,7 @@ void i8243_device::p2_w(uint8_t data) void i8243_device::output_update(int which) { - if (m_writehandler[which].isnull()) + if (m_writehandler[which].isunset()) logerror("%s: Unconfigured write to P%d (%01X)\n", machine().describe_context(), which + 4, m_p[which]); else m_writehandler[which](m_p[which]); @@ -99,7 +96,7 @@ void i8243_device::prog_w(int state) if ((m_opcode >> 2) == mcs48_cpu_device::EXPANDER_OP_READ) { int which = m_opcode & 3; - if (m_readhandler[which].isnull()) + if (m_readhandler[which].isunset()) logerror("%s: Unconfigured read from P%d\n", machine().describe_context(), which + 4); else m_p[which] = m_readhandler[which](); diff --git a/src/devices/machine/i8251.cpp b/src/devices/machine/i8251.cpp index 502704429b6..76e5a25dab7 100644 --- a/src/devices/machine/i8251.cpp +++ b/src/devices/machine/i8251.cpp @@ -84,24 +84,6 @@ v5x_scu_device::v5x_scu_device(const machine_config &mconfig, const char *tag, d } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void i8251_device::device_resolve_objects() -{ - // resolve callbacks - m_txd_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - m_dtr_handler.resolve_safe(); - m_rxrdy_handler.resolve_safe(); - m_txrdy_handler.resolve_safe(); - m_txempty_handler.resolve_safe(); - m_syndet_handler.resolve_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/i8251.h b/src/devices/machine/i8251.h index 8a6d9517928..127b5ad2629 100644 --- a/src/devices/machine/i8251.h +++ b/src/devices/machine/i8251.h @@ -15,8 +15,7 @@ #include "diserial.h" -class i8251_device : public device_t, - public device_serial_interface +class i8251_device : public device_t, public device_serial_interface { public: // construction/destruction @@ -66,8 +65,7 @@ protected: device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -149,7 +147,7 @@ private: u8 m_data_bits_count; }; -class v5x_scu_device : public i8251_device +class v5x_scu_device : public i8251_device { public: // construction/destruction @@ -159,6 +157,7 @@ public: virtual void write(offs_t offset, uint8_t data) override; protected: + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/i8255.cpp b/src/devices/machine/i8255.cpp index c1db0ed3d03..3d0424da61b 100644 --- a/src/devices/machine/i8255.cpp +++ b/src/devices/machine/i8255.cpp @@ -220,15 +220,15 @@ i8255_device::i8255_device(const machine_config &mconfig, device_type type, cons , m_force_portb_in(is_ams40489) , m_force_portc_out(is_ams40489) , m_dont_clear_output_latches(is_ams40489) - , m_in_pa_cb(*this) - , m_in_pb_cb(*this) - , m_in_pc_cb(*this) + , m_in_pa_cb(*this, 0) + , m_in_pb_cb(*this, 0) + , m_in_pc_cb(*this, 0) , m_out_pa_cb(*this) , m_out_pb_cb(*this) , m_out_pc_cb(*this) - , m_tri_pa_cb(*this) - , m_tri_pb_cb(*this) - , m_tri_pc_cb(*this) + , m_tri_pa_cb(*this, 0xff) + , m_tri_pb_cb(*this, 0xff) + , m_tri_pc_cb(*this, 0xff) , m_control(0) , m_intr{ 0, 0 } { @@ -239,20 +239,6 @@ i8255_device::i8255_device(const machine_config &mconfig, const char *tag, devic { } -void i8255_device::device_resolve_objects() -{ - // resolve callbacks - m_in_pa_cb.resolve_safe(0); - m_in_pb_cb.resolve_safe(0); - m_in_pc_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_out_pb_cb.resolve_safe(); - m_out_pc_cb.resolve_safe(); - m_tri_pa_cb.resolve_safe(0xff); - m_tri_pb_cb.resolve_safe(0xff); - m_tri_pc_cb.resolve_safe(0xff); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h index 2ab0b6c868c..49951af0af9 100644 --- a/src/devices/machine/i8255.h +++ b/src/devices/machine/i8255.h @@ -75,8 +75,7 @@ public: protected: i8255_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_ams40489); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/i8257.cpp b/src/devices/machine/i8257.cpp index c985d615571..d64453fcb19 100644 --- a/src/devices/machine/i8257.cpp +++ b/src/devices/machine/i8257.cpp @@ -269,9 +269,9 @@ i8257_device::i8257_device(const machine_config &mconfig, const char *tag, devic , m_temp(0) , m_out_hrq_cb(*this) , m_out_tc_cb(*this) - , m_in_memr_cb(*this) + , m_in_memr_cb(*this, 0) , m_out_memw_cb(*this) - , m_in_ior_cb(*this) + , m_in_ior_cb(*this, 0) , m_out_iow_cb(*this) , m_out_dack_cb(*this) { @@ -288,15 +288,6 @@ void i8257_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_out_hrq_cb.resolve_safe(); - m_out_tc_cb.resolve_safe(); - m_in_memr_cb.resolve_safe(0); - m_out_memw_cb.resolve_safe(); - m_in_ior_cb.resolve_all_safe(0); - m_out_iow_cb.resolve_all_safe(); - m_out_dack_cb.resolve_all_safe(); - // state saving save_item(NAME(m_msb)); save_item(NAME(m_hreq)); diff --git a/src/devices/machine/i82586.cpp b/src/devices/machine/i82586.cpp index f73c9a15755..543fa2c2ede 100644 --- a/src/devices/machine/i82586.cpp +++ b/src/devices/machine/i82586.cpp @@ -162,8 +162,6 @@ void i82586_base_device::device_start() { m_space = &space(0); - m_out_irq.resolve_safe(); - m_cu_timer = timer_alloc(FUNC(i82586_base_device::cu_execute), this); save_item(NAME(m_cx)); diff --git a/src/devices/machine/i8271.cpp b/src/devices/machine/i8271.cpp index 48d734288f4..420a0dcea9f 100644 --- a/src/devices/machine/i8271.cpp +++ b/src/devices/machine/i8271.cpp @@ -40,11 +40,6 @@ void i8271_device::set_select_lines_connected(bool _select) void i8271_device::device_start() { - intrq_cb.resolve_safe(); - drq_cb.resolve_safe(); - hdl_cb.resolve_safe(); - opt_cb.resolve_safe(); - for(int i=0; i != 2; i++) { char name[2]; flopi[i].tm = timer_alloc(FUNC(i8271_device::floppy_tick), this); diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index 9de96d806e0..16e7c5e64bc 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -99,9 +99,9 @@ i8279_device::i8279_device(const machine_config &mconfig, const char *tag, devic m_out_sl_cb(*this), m_out_disp_cb(*this), m_out_bd_cb(*this), - m_in_rl_cb(*this), - m_in_shift_cb(*this), - m_in_ctrl_cb(*this) + m_in_rl_cb(*this, 0xff), + m_in_shift_cb(*this, 1), + m_in_ctrl_cb(*this, 1) { } @@ -111,14 +111,6 @@ i8279_device::i8279_device(const machine_config &mconfig, const char *tag, devic void i8279_device::device_start() { - /* resolve callbacks */ - m_out_irq_cb.resolve(); - m_out_sl_cb.resolve(); - m_out_disp_cb.resolve(); - m_out_bd_cb.resolve(); - m_in_rl_cb.resolve(); - m_in_shift_cb.resolve(); - m_in_ctrl_cb.resolve(); m_scanclock = clock(); m_timer = timer_alloc(FUNC(i8279_device::timerproc_callback), this); @@ -208,18 +200,11 @@ void i8279_device::clear_display() m_status &= 0x80; // blow away fifo m_s_ram_ptr = 0; // reset sensor pointer m_debounce = 0; // reset debounce logic - set_irq(0); // reset irq + m_out_irq_cb(0); // reset irq } } -void i8279_device::set_irq(bool state) -{ - if ( !m_out_irq_cb.isnull() ) - m_out_irq_cb( state ); -} - - void i8279_device::new_fifo(u8 data) { // see if already overrun @@ -249,7 +234,7 @@ void i8279_device::new_fifo(u8 data) m_status = (m_status & 0xe8) + fifo_size + 1; if (!fifo_size) - set_irq(1); // something just went into fifo, so int + m_out_irq_cb(1); // something just went into fifo, so int } @@ -270,8 +255,6 @@ void i8279_device::timer_mainloop() u8 scanner_mask = BIT(m_cmd[0], 0) ? 3 : BIT(m_cmd[0], 3) ? 15 : 7; bool decoded = BIT(m_cmd[0], 0); u8 kbd_type = (m_cmd[0] & 6) >> 1; - bool shift_key = 1; - bool ctrl_key = 1; bool strobe_pulse = 0; // keyboard @@ -281,12 +264,8 @@ void i8279_device::timer_mainloop() // type 3 = strobed // Get shift keys - if ( !m_in_shift_cb.isnull() ) - shift_key = m_in_shift_cb(); - - if ( !m_in_ctrl_cb.isnull() ) - ctrl_key = m_in_ctrl_cb(); - + bool shift_key = m_in_shift_cb(); + bool ctrl_key = m_in_ctrl_cb(); if (ctrl_key && !m_ctrl_key) strobe_pulse = 1; // low-to-high is a strobe @@ -294,7 +273,7 @@ void i8279_device::timer_mainloop() // Read a row of keys - if ( !m_in_rl_cb.isnull() ) + if ( !m_in_rl_cb.isunset() ) { u8 rl = m_in_rl_cb(0) ^ 0xff; // inverted u8 addr = m_scanner & 7; @@ -354,7 +333,7 @@ void i8279_device::timer_mainloop() if (m_se_mode && !BIT(m_status, 6)) { m_status |= 0x40; - set_irq(1); + m_out_irq_cb(1); } #endif // EMULATE_KEY_LOCKOUT } @@ -381,7 +360,7 @@ void i8279_device::timer_mainloop() m_s_ram[addr] = rl; // IRQ line goes high if a row changes value - set_irq(1); + m_out_irq_cb(1); } break; @@ -397,19 +376,15 @@ void i8279_device::timer_mainloop() m_scanner = (m_scanner + 1) & (decoded ? 3 : 15); - if ( !m_out_sl_cb.isnull() ) - { - // Active low strobed output in decoded mode - if (decoded) - m_out_sl_cb((offs_t)0, (1 << m_scanner) ^ 15); - else - m_out_sl_cb((offs_t)0, m_scanner); - } + // Active low strobed output in decoded mode + if (decoded) + m_out_sl_cb(offs_t(0), (1 << m_scanner) ^ 15); + else + m_out_sl_cb(offs_t(0), m_scanner); // output a digit - if ( !m_out_disp_cb.isnull() ) - m_out_disp_cb((offs_t)0, m_d_ram[m_scanner & scanner_mask] ); + m_out_disp_cb(offs_t(0), m_d_ram[m_scanner & scanner_mask]); } @@ -454,7 +429,7 @@ u8 i8279_device::data_r() } else { - set_irq(0); + m_out_irq_cb(0); } } } @@ -476,7 +451,7 @@ u8 i8279_device::data_r() m_fifo[i-1] = m_fifo[i]; fifo_size--; if (!fifo_size) - set_irq(0); + m_out_irq_cb(0); } break; case 0x28: // overrun @@ -551,7 +526,7 @@ void i8279_device::cmd_w(u8 data) clear_display(); break; case 7: - set_irq(0); + m_out_irq_cb(0); m_se_mode = BIT(data, 4); m_status &= 0xbf; break; diff --git a/src/devices/machine/i8279.h b/src/devices/machine/i8279.h index 56c111a2797..8be33fbb4d0 100644 --- a/src/devices/machine/i8279.h +++ b/src/devices/machine/i8279.h @@ -59,11 +59,9 @@ public: void timer_mainloop(); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - virtual void device_post_load() override { } - virtual void device_clock_changed() override { } TIMER_CALLBACK_MEMBER( timerproc_callback ); @@ -71,7 +69,6 @@ private: void timer_adjust(); void clear_display(); void new_fifo(u8 data); - void set_irq(bool state); devcb_write_line m_out_irq_cb; // IRQ devcb_write8 m_out_sl_cb; // Scanlines SL0-3 diff --git a/src/devices/machine/i8291a.cpp b/src/devices/machine/i8291a.cpp index 3692ba95a28..4316ce3c871 100644 --- a/src/devices/machine/i8291a.cpp +++ b/src/devices/machine/i8291a.cpp @@ -38,73 +38,73 @@ ALLOW_SAVE_TYPE(i8291a_device::acceptor_handshake_state); i8291a_device::i8291a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t{mconfig, I8291A, tag, owner, clock}, - m_int_write_func{*this}, - m_dreq_write_func{*this}, - m_trig_write_func{*this}, - m_eoi_write_func{*this}, - m_dav_write_func{*this}, - m_nrfd_write_func{*this}, - m_ndac_write_func{*this}, - m_srq_write_func{*this}, - m_dio_write_func{*this}, - m_dio_read_func{*this}, - m_din{0}, - m_dout{0}, - m_ints1{0}, - m_ints2{0}, - m_ie1{0}, - m_ie2{0}, - m_address0{0}, - m_address1{0}, - m_eos{0}, - m_spoll_mode{0}, - m_address_mode{0}, - m_address_status{0}, - m_cpt{0}, - m_auxa{0}, - m_auxb{0}, - m_atn{false}, - m_ren{false}, - m_nrfd{false}, - m_ndac{false}, - m_dav{false}, - m_srq{false}, - m_ifc{false}, - m_eoi{false}, - m_dio{0}, - m_nrfd_out{false}, - m_ndac_out{false}, - m_dav_out{false}, - m_srq_out{false}, - m_eoi_out{false}, - m_pon{false}, - m_rdy{false}, - m_lpe{false}, - m_ist{false}, - m_rtl{false}, - m_apt_flag{false}, - m_cpt_flag{false}, - m_din_flag{false}, - m_nba{false}, - m_pp_sense{false}, - m_pp_line{0}, - m_send_eoi{false}, - m_sh_state{source_handshake_state::SIDS}, - m_ah_state{acceptor_handshake_state::AIDS}, - m_t_state{talker_state::TIDS}, - m_tp_state{talker_primary_state::TPIS}, - m_tsp_state{talker_serial_poll_state::SPIS}, - m_l_state{listener_state::LIDS}, - m_lp_state{listener_primary_state::LPIS}, - m_rl_state{remote_local_state::LOCS}, - m_pp_state{parallel_poll_state::PPIS}, - m_dc_state{device_clear_state::DCIS}, - m_dt_state{device_trigger_state::DTIS}, - m_state_changed(false), - m_ignore_ext_signals(false), - m_intr_out(false), - m_dreq_out(false) + device_t{mconfig, I8291A, tag, owner, clock}, + m_int_write_func{*this}, + m_dreq_write_func{*this}, + m_trig_write_func{*this}, + m_eoi_write_func{*this}, + m_dav_write_func{*this}, + m_nrfd_write_func{*this}, + m_ndac_write_func{*this}, + m_srq_write_func{*this}, + m_dio_write_func{*this}, + m_dio_read_func{*this, 0xff}, + m_din{0}, + m_dout{0}, + m_ints1{0}, + m_ints2{0}, + m_ie1{0}, + m_ie2{0}, + m_address0{0}, + m_address1{0}, + m_eos{0}, + m_spoll_mode{0}, + m_address_mode{0}, + m_address_status{0}, + m_cpt{0}, + m_auxa{0}, + m_auxb{0}, + m_atn{false}, + m_ren{false}, + m_nrfd{false}, + m_ndac{false}, + m_dav{false}, + m_srq{false}, + m_ifc{false}, + m_eoi{false}, + m_dio{0}, + m_nrfd_out{false}, + m_ndac_out{false}, + m_dav_out{false}, + m_srq_out{false}, + m_eoi_out{false}, + m_pon{false}, + m_rdy{false}, + m_lpe{false}, + m_ist{false}, + m_rtl{false}, + m_apt_flag{false}, + m_cpt_flag{false}, + m_din_flag{false}, + m_nba{false}, + m_pp_sense{false}, + m_pp_line{0}, + m_send_eoi{false}, + m_sh_state{source_handshake_state::SIDS}, + m_ah_state{acceptor_handshake_state::AIDS}, + m_t_state{talker_state::TIDS}, + m_tp_state{talker_primary_state::TPIS}, + m_tsp_state{talker_serial_poll_state::SPIS}, + m_l_state{listener_state::LIDS}, + m_lp_state{listener_primary_state::LPIS}, + m_rl_state{remote_local_state::LOCS}, + m_pp_state{parallel_poll_state::PPIS}, + m_dc_state{device_clear_state::DCIS}, + m_dt_state{device_trigger_state::DTIS}, + m_state_changed(false), + m_ignore_ext_signals(false), + m_intr_out(false), + m_dreq_out(false) { } @@ -144,16 +144,6 @@ void i8291a_device::device_reset() void i8291a_device::device_start() { - m_int_write_func.resolve_safe(); - m_dreq_write_func.resolve_safe(); - m_dav_write_func.resolve_safe(); - m_nrfd_write_func.resolve_safe(); - m_ndac_write_func.resolve_safe(); - m_eoi_write_func.resolve_safe(); - m_srq_write_func.resolve_safe(); - m_dio_read_func.resolve_safe(0xff); - m_dio_write_func.resolve_safe(); - save_item(NAME(m_din)); save_item(NAME(m_dout)); save_item(NAME(m_ints1)); diff --git a/src/devices/machine/i8355.cpp b/src/devices/machine/i8355.cpp index caa31eb7e1a..501120ae79d 100644 --- a/src/devices/machine/i8355.cpp +++ b/src/devices/machine/i8355.cpp @@ -87,13 +87,13 @@ inline void i8355_device::write_port(int port, u8 data) // i8355_device - constructor //------------------------------------------------- -i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, I8355, tag, owner, clock), - m_in_pa_cb(*this), - m_out_pa_cb(*this), - m_in_pb_cb(*this), - m_out_pb_cb(*this), - m_rom(*this, DEVICE_SELF) +i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, I8355, tag, owner, clock), + m_in_pa_cb(*this, 0), + m_out_pa_cb(*this), + m_in_pb_cb(*this, 0), + m_out_pb_cb(*this), + m_rom(*this, DEVICE_SELF) { } @@ -103,12 +103,6 @@ i8355_device::i8355_device(const machine_config &mconfig, const char *tag, devic void i8355_device::device_start() { - // resolve callbacks - m_in_pa_cb.resolve_safe(0); - m_in_pb_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_out_pb_cb.resolve_safe(); - // register for state saving save_item(NAME(m_output)); save_item(NAME(m_ddr)); diff --git a/src/devices/machine/ibm21s850.cpp b/src/devices/machine/ibm21s850.cpp index 9aa66fbacc6..c77d3077a01 100644 --- a/src/devices/machine/ibm21s850.cpp +++ b/src/devices/machine/ibm21s850.cpp @@ -44,8 +44,6 @@ void ibm21s85x_base_device::device_start() save_item(NAME(m_regs)); m_reset_timer = timer_alloc(FUNC(ibm21s85x_base_device::reset_tick), this); - - m_reset_cb.resolve_safe(); } void ibm21s85x_base_device::device_reset() diff --git a/src/devices/machine/icm7170.cpp b/src/devices/machine/icm7170.cpp index 3abcf04ea38..1dbe8837446 100644 --- a/src/devices/machine/icm7170.cpp +++ b/src/devices/machine/icm7170.cpp @@ -83,9 +83,6 @@ icm7170_device::icm7170_device(const machine_config &mconfig, const char *tag, d void icm7170_device::device_start() { - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_timer = timer_alloc(FUNC(icm7170_device::clock_tick), this); // TODO: frequency should be based on input clock and divisor diff --git a/src/devices/machine/ie15.cpp b/src/devices/machine/ie15.cpp index 613c0c8e56b..9f977fcaa40 100644 --- a/src/devices/machine/ie15.cpp +++ b/src/devices/machine/ie15.cpp @@ -470,13 +470,6 @@ void ie15_device::kbd_sdv(int state) m_kbd_sdv = state; } -void ie15_device::device_resolve_objects() -{ - m_rs232_conn_dtr_handler.resolve_safe(); - m_rs232_conn_rts_handler.resolve_safe(); - m_rs232_conn_txd_handler.resolve_safe(); -} - void ie15_device::device_start() { m_lat_led.resolve(); diff --git a/src/devices/machine/ie15.h b/src/devices/machine/ie15.h index 0d0e3808b6d..eb82cada227 100644 --- a/src/devices/machine/ie15.h +++ b/src/devices/machine/ie15.h @@ -53,7 +53,6 @@ public: protected: ie15_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/ie15_kbd.cpp b/src/devices/machine/ie15_kbd.cpp index dea705a60c2..27a203b46d9 100644 --- a/src/devices/machine/ie15_kbd.cpp +++ b/src/devices/machine/ie15_kbd.cpp @@ -83,8 +83,6 @@ const tiny_rom_entry *ie15_keyboard_device::device_rom_region() const void ie15_keyboard_device::device_start() { - m_keyboard_cb.resolve_safe(); - m_sdv_cb.resolve_safe(); } void ie15_keyboard_device::device_reset() diff --git a/src/devices/machine/im6402.cpp b/src/devices/machine/im6402.cpp index 09c57a4b858..db3521c8d4b 100644 --- a/src/devices/machine/im6402.cpp +++ b/src/devices/machine/im6402.cpp @@ -89,12 +89,6 @@ im6402_device::im6402_device(const machine_config &mconfig, const char *tag, dev void im6402_device::device_start() { - // resolve callbacks - m_write_tro.resolve_safe(); - m_write_dr.resolve_safe(); - m_write_tbre.resolve_safe(); - m_write_tre.resolve_safe(); - // create the timers if (m_rrc > 0) { diff --git a/src/devices/machine/input_merger.cpp b/src/devices/machine/input_merger.cpp index 7424bd6e8fa..51c052fc096 100644 --- a/src/devices/machine/input_merger.cpp +++ b/src/devices/machine/input_merger.cpp @@ -86,7 +86,6 @@ input_merger_device::~input_merger_device() void input_merger_device::device_start() { - m_output_handler.resolve_safe(); save_item(NAME(m_state)); m_state = m_initval; } diff --git a/src/devices/machine/ins8154.cpp b/src/devices/machine/ins8154.cpp index 7183122a3d8..15b65fa03e7 100644 --- a/src/devices/machine/ins8154.cpp +++ b/src/devices/machine/ins8154.cpp @@ -48,9 +48,9 @@ DEFINE_DEVICE_TYPE(INS8154, ins8154_device, "ins8154", "INS8154 RAM I/O") ins8154_device::ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INS8154, tag, owner, clock) - , m_in_a_cb(*this) + , m_in_a_cb(*this, 0xff) , m_out_a_cb(*this) - , m_in_b_cb(*this) + , m_in_b_cb(*this, 0xff) , m_out_b_cb(*this) , m_out_irq_cb(*this) , m_in_a(0), m_in_b(0), m_out_a(0), m_out_b(0), m_mdr(0), m_odra(0), m_odrb(0) @@ -63,13 +63,6 @@ ins8154_device::ins8154_device(const machine_config &mconfig, const char *tag, d void ins8154_device::device_start() { - /* resolve callbacks */ - m_in_a_cb.resolve(); - m_out_a_cb.resolve_safe(); - m_in_b_cb.resolve(); - m_out_b_cb.resolve_safe(); - m_out_irq_cb.resolve_safe(); - /* register for state saving */ save_item(NAME(m_in_a)); save_item(NAME(m_in_b)); @@ -111,14 +104,12 @@ uint8_t ins8154_device::read_io(offs_t offset) switch (offset) { case 0x20: - if (!m_in_a_cb.isnull()) - val = m_in_a_cb(0); + val = m_in_a_cb(0); m_in_a = val; break; case 0x21: - if (!m_in_b_cb.isnull()) - val = m_in_b_cb(0); + val = m_in_b_cb(0); m_in_b = val; break; @@ -126,7 +117,7 @@ uint8_t ins8154_device::read_io(offs_t offset) val = 0; if (offset < 0x08) // Read a bit in Port A { - if (!m_in_a_cb.isnull()) + if (!m_in_a_cb.isunset()) { //val = (m_in_a_cb(0) << (8 - offset)) & 0x80; val = (m_in_a_cb(0) & ~m_odra & (1 << (offset & 0x07))) ? 0x80 : 0x00; @@ -135,7 +126,7 @@ uint8_t ins8154_device::read_io(offs_t offset) } else // Read a bit in Port B { - if (!m_in_b_cb.isnull()) + if (!m_in_b_cb.isunset()) { val = (m_in_b_cb(0) & ~m_odrb & (1 << (offset & 0x07))) ? 0x80 : 0x00; } diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp index 831c3201561..a967713bce9 100644 --- a/src/devices/machine/ins8250.cpp +++ b/src/devices/machine/ins8250.cpp @@ -637,12 +637,6 @@ void ins8250_uart_device::rx_w(int state) void ins8250_uart_device::device_start() { - m_out_tx_cb.resolve_safe(); - m_out_dtr_cb.resolve_safe(); - m_out_rts_cb.resolve_safe(); - m_out_int_cb.resolve_safe(); - m_out_out1_cb.resolve_safe(); - m_out_out2_cb.resolve_safe(); set_tra_rate(0); set_rcv_rate(0); diff --git a/src/devices/machine/ioptimer.cpp b/src/devices/machine/ioptimer.cpp index 54864a00901..62f19d77988 100644 --- a/src/devices/machine/ioptimer.cpp +++ b/src/devices/machine/ioptimer.cpp @@ -36,8 +36,6 @@ iop_timer_device::iop_timer_device(const machine_config &mconfig, const char *ta void iop_timer_device::device_start() { - m_int_cb.resolve_safe(); - if (!m_compare_timer) m_compare_timer = timer_alloc(FUNC(iop_timer_device::compare), this); @@ -79,11 +77,8 @@ void iop_timer_device::update_gate() void iop_timer_device::update_interrupts() { - if (!m_int_cb.isnull()) - { - bool interrupt = m_ienable && ((m_ovf_int && m_ovf_int_enabled) || (m_cmp_int && m_cmp_int_enabled)); - m_int_cb(interrupt); - } + bool interrupt = m_ienable && ((m_ovf_int && m_ovf_int_enabled) || (m_cmp_int && m_cmp_int_enabled)); + m_int_cb(interrupt); } void iop_timer_device::update_compare_timer() diff --git a/src/devices/machine/k053252.cpp b/src/devices/machine/k053252.cpp index 6972d0f5c96..4cf3963b5ef 100644 --- a/src/devices/machine/k053252.cpp +++ b/src/devices/machine/k053252.cpp @@ -86,12 +86,6 @@ k053252_device::k053252_device(const machine_config &mconfig, const char *tag, d void k053252_device::device_start() { - m_int1_en_cb.resolve_safe(); - m_int2_en_cb.resolve_safe(); - m_int1_ack_cb.resolve_safe(); - m_int2_ack_cb.resolve_safe(); - m_int_time_cb.resolve_safe(); - save_item(NAME(m_regs)); save_item(NAME(m_hc)); save_item(NAME(m_hfp)); diff --git a/src/devices/machine/k056230.cpp b/src/devices/machine/k056230.cpp index e3a457f8512..68f1a718197 100644 --- a/src/devices/machine/k056230.cpp +++ b/src/devices/machine/k056230.cpp @@ -42,7 +42,6 @@ k056230_device::k056230_device(const machine_config &mconfig, const char *tag, d void k056230_device::device_start() { - m_irq_cb.resolve_safe(); m_irq_state = CLEAR_LINE; save_item(NAME(m_irq_state)); diff --git a/src/devices/machine/kb3600.cpp b/src/devices/machine/kb3600.cpp index 9be5846e0c8..5ebc9c56e0c 100644 --- a/src/devices/machine/kb3600.cpp +++ b/src/devices/machine/kb3600.cpp @@ -40,17 +40,17 @@ DEFINE_DEVICE_TYPE(AY3600, ay3600_device, "ay3600", "AY-5-3600 Keyboard Encoder" ay3600_device::ay3600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AY3600, tag, owner, clock), - m_read_x0(*this), - m_read_x1(*this), - m_read_x2(*this), - m_read_x3(*this), - m_read_x4(*this), - m_read_x5(*this), - m_read_x6(*this), - m_read_x7(*this), - m_read_x8(*this), - m_read_shift(*this), - m_read_control(*this), + m_read_x0(*this, 0), + m_read_x1(*this, 0), + m_read_x2(*this, 0), + m_read_x3(*this, 0), + m_read_x4(*this, 0), + m_read_x5(*this, 0), + m_read_x6(*this, 0), + m_read_x7(*this, 0), + m_read_x8(*this, 0), + m_read_shift(*this, 0), + m_read_control(*this, 0), m_write_data_ready(*this), m_write_ako(*this) { @@ -66,21 +66,6 @@ ay3600_device::ay3600_device(const machine_config &mconfig, const char *tag, dev void ay3600_device::device_start() { - // resolve callbacks - m_read_x0.resolve_safe(0); - m_read_x1.resolve_safe(0); - m_read_x2.resolve_safe(0); - m_read_x3.resolve_safe(0); - m_read_x4.resolve_safe(0); - m_read_x5.resolve_safe(0); - m_read_x6.resolve_safe(0); - m_read_x7.resolve_safe(0); - m_read_x8.resolve_safe(0); - m_read_shift.resolve_safe(0); - m_read_control.resolve_safe(0); - m_write_data_ready.resolve_safe(); - m_write_ako.resolve_safe(); - // allocate timers m_scan_timer = timer_alloc(FUNC(ay3600_device::perform_scan), this); m_scan_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); diff --git a/src/devices/machine/keytronic_l2207.cpp b/src/devices/machine/keytronic_l2207.cpp index 993a72fa7bf..2cd5db800e0 100644 --- a/src/devices/machine/keytronic_l2207.cpp +++ b/src/devices/machine/keytronic_l2207.cpp @@ -90,7 +90,6 @@ void keytronic_l2207_device::device_resolve_objects() { m_leds.resolve(); m_all_caps.resolve(); - m_ser_out_callback.resolve_safe(); } void keytronic_l2207_device::device_start() diff --git a/src/devices/machine/kr2376.cpp b/src/devices/machine/kr2376.cpp index af0abb4169d..ff2c1d00bec 100644 --- a/src/devices/machine/kr2376.cpp +++ b/src/devices/machine/kr2376.cpp @@ -15,9 +15,9 @@ DEFINE_DEVICE_TYPE(KR2376_12, kr2376_12_device, "kr2376_12", "SMC KR2376-12 K kr2376_device::kr2376_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_read_x(*this), - m_read_shift(*this), - m_read_control(*this), + m_read_x(*this, 0x7ff), + m_read_shift(*this, 0), + m_read_control(*this, 0), m_write_strobe(*this) { } @@ -166,12 +166,6 @@ uint8_t kr2376_12_device::key_codes(int mode, int x, int y) void kr2376_device::device_start() { - /* resolve callbacks */ - m_read_x.resolve_all_safe(0x7ff); - m_read_shift.resolve_safe(0); - m_read_control.resolve_safe(0); - m_write_strobe.resolve_safe(); - /* set initial values */ m_ring11 = 0; m_ring8 = 0; diff --git a/src/devices/machine/latch8.cpp b/src/devices/machine/latch8.cpp index bfccdc48a30..2bb8e1ddbb0 100644 --- a/src/devices/machine/latch8.cpp +++ b/src/devices/machine/latch8.cpp @@ -21,7 +21,7 @@ void latch8_device::update(uint8_t new_val, uint8_t mask) { uint8_t changed = old_val ^ m_value; for (int i = 0; i < 8; i++) - if (BIT(changed, i) && !m_write_cb[i].isnull()) + if (BIT(changed, i)) m_write_cb[i](BIT(m_value, i)); } } @@ -45,7 +45,7 @@ uint8_t latch8_device::read(offs_t offset) { for (int i = 0; i < 8; i++) { - if (!m_read_cb[i].isnull()) + if (!m_read_cb[i].isunset()) res = (res & ~(1 << i)) | (m_read_cb[i]() << i); } } @@ -102,7 +102,7 @@ DEFINE_DEVICE_TYPE(LATCH8, latch8_device, "latch8", "8-bit latch") latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LATCH8, tag, owner, clock) , m_write_cb(*this) - , m_read_cb(*this) + , m_read_cb(*this, 0) , m_value(0) , m_has_write(false) , m_has_read(false) @@ -121,7 +121,7 @@ latch8_device::latch8_device(const machine_config &mconfig, const char *tag, dev void latch8_device::device_validity_check(validity_checker &valid) const { for (int i = 0; i < 8; i++) - if (!m_read_cb[i].isnull() && !m_write_cb[i].isnull()) + if (!m_read_cb[i].isunset() && !m_write_cb[i].isunset()) osd_printf_error("Device %s: Bit %d already has a handler.\n", tag(), i); } @@ -134,17 +134,15 @@ void latch8_device::device_start() // setup nodemap for (auto &cb : m_write_cb) { - if (!cb.isnull()) + if (!cb.isunset()) m_has_write = true; - cb.resolve(); } // setup device read handlers for (auto &cb : m_read_cb) { - if (!cb.isnull()) + if (!cb.isunset()) m_has_read = true; - cb.resolve(); } save_item(NAME(m_value)); diff --git a/src/devices/machine/ldv1000.cpp b/src/devices/machine/ldv1000.cpp index 1432025efd4..5b418d13bf0 100644 --- a/src/devices/machine/ldv1000.cpp +++ b/src/devices/machine/ldv1000.cpp @@ -18,9 +18,10 @@ #include "emu.h" #include "ldv1000.h" + +#include "cpu/z80/z80.h" #include "machine/i8255.h" #include "machine/z80ctc.h" -#include "cpu/z80/z80.h" #include "machine/z80daisy.h" @@ -158,8 +159,6 @@ void pioneer_ldv1000_device::device_start() m_multitimer = timer_alloc(FUNC(pioneer_ldv1000_device::multijump_tick), this); m_vsync_off_timer = timer_alloc(FUNC(pioneer_ldv1000_device::vsync_off), this); m_process_vbi_timer = timer_alloc(FUNC(pioneer_ldv1000_device::process_vbi_data), this); - - m_command_strobe_cb.resolve_safe(); } diff --git a/src/devices/machine/ldv4200hle.cpp b/src/devices/machine/ldv4200hle.cpp index 4727d99cfa4..c95c0f1ec3d 100644 --- a/src/devices/machine/ldv4200hle.cpp +++ b/src/devices/machine/ldv4200hle.cpp @@ -680,8 +680,6 @@ void pioneer_ldv4200hle_device::device_start() // pass through to the parent laserdisc_device::device_start(); - m_serial_tx.resolve_safe(); - // allocate timers m_vbi_fetch = timer_alloc(FUNC(pioneer_ldv4200hle_device::process_vbi_data), this); diff --git a/src/devices/machine/lh5810.cpp b/src/devices/machine/lh5810.cpp index 054a532dff0..8b2602cef8b 100644 --- a/src/devices/machine/lh5810.cpp +++ b/src/devices/machine/lh5810.cpp @@ -50,9 +50,9 @@ DEFINE_DEVICE_TYPE(LH5810, lh5810_device, "lh5810", "LH5810 I/O Port") lh5810_device::lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LH5810, tag, owner, clock) - , m_porta_r_cb(*this) + , m_porta_r_cb(*this, 0) , m_porta_w_cb(*this) - , m_portb_r_cb(*this) + , m_portb_r_cb(*this, 0) , m_portb_w_cb(*this) , m_portc_w_cb(*this) , m_out_int_cb(*this) @@ -67,14 +67,6 @@ lh5810_device::lh5810_device(const machine_config &mconfig, const char *tag, dev void lh5810_device::device_start() { - // resolve callbacks - m_porta_r_cb.resolve_safe(0); - m_porta_w_cb.resolve_safe(); - m_portb_r_cb.resolve_safe(0); - m_portb_w_cb.resolve_safe(); - m_portc_w_cb.resolve_safe(); - m_out_int_cb.resolve_safe(); - // register for state saving save_item(NAME(m_irq)); save_item(NAME(m_reg)); diff --git a/src/devices/machine/m3002.cpp b/src/devices/machine/m3002.cpp index 12c730c1db7..28422b8f488 100644 --- a/src/devices/machine/m3002.cpp +++ b/src/devices/machine/m3002.cpp @@ -64,18 +64,6 @@ m3000_device::m3000_device(const machine_config &mconfig, const char *tag, devic } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void m3002_device::device_resolve_objects() -{ - m_irq_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/m3002.h b/src/devices/machine/m3002.h index 802064b07c8..8f34e5aaa49 100644 --- a/src/devices/machine/m3002.h +++ b/src/devices/machine/m3002.h @@ -50,17 +50,16 @@ public: protected: m3002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_clock_changed() override; - // device_nvram_interface overrides + // device_nvram_interface implementation virtual bool nvram_read(util::read_stream &file) override; virtual bool nvram_write(util::write_stream &file) override; virtual void nvram_default() override; - // device_rtc_interface overrides + // device_rtc_interface implementation virtual bool rtc_feature_y2k() const override { return false; } virtual bool rtc_feature_leap_year() const override { return true; } virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override; diff --git a/src/devices/machine/m68sfdc.cpp b/src/devices/machine/m68sfdc.cpp index d5ac30c4518..b90dec4e996 100644 --- a/src/devices/machine/m68sfdc.cpp +++ b/src/devices/machine/m68sfdc.cpp @@ -64,17 +64,11 @@ ioport_constructor m68sfdc_device::device_input_ports() const return INPUT_PORTS_NAME(m68sfdc); } -void m68sfdc_device::device_resolve_objects() -{ -} - void m68sfdc_device::device_start() { - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - m_timer_head_load = timer_alloc(FUNC(m68sfdc_device::head_load_update), this); m_timer_timeout = timer_alloc(FUNC(m68sfdc_device::timeout_expired), this); + save_item(NAME(m_select_0)); save_item(NAME(m_select_1)); save_item(NAME(m_select_2)); diff --git a/src/devices/machine/m68sfdc.h b/src/devices/machine/m68sfdc.h index 6270e42bc9b..a545c987af1 100644 --- a/src/devices/machine/m68sfdc.h +++ b/src/devices/machine/m68sfdc.h @@ -32,7 +32,6 @@ public: private: virtual void device_start() override; virtual void device_reset() override; - virtual void device_resolve_objects() override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/machine/mb8421.h b/src/devices/machine/mb8421.h index 9d30252538e..7598387e2d8 100644 --- a/src/devices/machine/mb8421.h +++ b/src/devices/machine/mb8421.h @@ -158,20 +158,7 @@ protected: { } - // device-level overrides - - //------------------------------------------------- - // device_resolve_objects - resolve objects that - // may be needed for other devices to set - // initial conditions at start time - //------------------------------------------------- - - virtual void device_resolve_objects() override - { - // resolve callbacks - m_intl_callback.resolve_safe(); - m_intr_callback.resolve_safe(); - } + // device_t implementation //------------------------------------------------- // device_start - device-specific startup @@ -179,7 +166,7 @@ protected: virtual void device_start() override { - m_ram = make_unique_clear(RAM_SIZE); + m_ram = make_unique_clear(RAM_SIZE); // state save save_pointer(NAME(m_ram), RAM_SIZE); diff --git a/src/devices/machine/mb87030.cpp b/src/devices/machine/mb87030.cpp index 61d1b33adab..3c67ad641f4 100644 --- a/src/devices/machine/mb87030.cpp +++ b/src/devices/machine/mb87030.cpp @@ -477,8 +477,6 @@ void mb87030_device::device_start() { m_timer = timer_alloc(FUNC(mb87030_device::timeout), this); m_delay_timer = timer_alloc(FUNC(mb87030_device::delay_timeout), this); - m_irq_handler.resolve_safe(); - m_dreq_handler.resolve_safe(); save_item(NAME(m_bdid)); save_item(NAME(m_sctl)); diff --git a/src/devices/machine/mb87078.cpp b/src/devices/machine/mb87078.cpp index eed6f53297a..5e952c5eab3 100644 --- a/src/devices/machine/mb87078.cpp +++ b/src/devices/machine/mb87078.cpp @@ -91,8 +91,6 @@ mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, d void mb87078_device::device_start() { - m_gain_changed_cb.resolve_safe(); - m_data = 0; m_control = 0; diff --git a/src/devices/machine/mb8795.cpp b/src/devices/machine/mb8795.cpp index 957b53a2655..53e29c00e63 100644 --- a/src/devices/machine/mb8795.cpp +++ b/src/devices/machine/mb8795.cpp @@ -38,19 +38,14 @@ void mb8795_device::check_irq() bool old_irq_rx = irq_rx; irq_tx = txstat & txmask; irq_rx = rxstat & rxmask; - if(irq_tx != old_irq_tx && !irq_tx_cb.isnull()) + if(irq_tx != old_irq_tx) irq_tx_cb(irq_tx); - if(irq_rx != old_irq_rx && !irq_rx_cb.isnull()) + if(irq_rx != old_irq_rx) irq_rx_cb(irq_rx); } void mb8795_device::device_start() { - irq_tx_cb.resolve(); - irq_rx_cb.resolve(); - drq_tx_cb.resolve(); - drq_rx_cb.resolve(); - memset(mac, 0, 6); timer_tx = timer_alloc(FUNC(mb8795_device::tx_update), this); timer_rx = timer_alloc(FUNC(mb8795_device::rx_update), this); @@ -203,8 +198,7 @@ void mb8795_device::tx_dma_w(uint8_t data, bool eof) } drq_tx = false; - if(!drq_tx_cb.isnull()) - drq_tx_cb(drq_tx); + drq_tx_cb(drq_tx); if(eof) { logerror("send packet, dest=%02x.%02x.%02x.%02x.%02x.%02x len=%04x loopback=%s\n", @@ -232,8 +226,7 @@ void mb8795_device::tx_dma_w(uint8_t data, bool eof) void mb8795_device::rx_dma_r(uint8_t &data, bool &eof) { drq_rx = false; - if(!drq_rx_cb.isnull()) - drq_rx_cb(drq_rx); + drq_rx_cb(drq_rx); if(rxlen) { data = rxbuf[0]; @@ -326,15 +319,13 @@ bool mb8795_device::recv_is_multicast() TIMER_CALLBACK_MEMBER(mb8795_device::tx_update) { drq_tx = true; - if(!drq_tx_cb.isnull()) - drq_tx_cb(drq_tx); + drq_tx_cb(drq_tx); } TIMER_CALLBACK_MEMBER(mb8795_device::rx_update) { if(rxlen) { drq_rx = true; - if(!drq_rx_cb.isnull()) - drq_rx_cb(drq_rx); + drq_rx_cb(drq_rx); } } diff --git a/src/devices/machine/mb89363b.cpp b/src/devices/machine/mb89363b.cpp index dae0d4a3372..74c43a1960c 100644 --- a/src/devices/machine/mb89363b.cpp +++ b/src/devices/machine/mb89363b.cpp @@ -83,22 +83,22 @@ DEFINE_DEVICE_TYPE(MB89363B, mb89363b_device, "mb89363b", "Fujitsu MB89363B I/O") -mb89363b_device::mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MB89363B, tag, owner, clock), - m_i8255_a(*this, "i8255_a"), - m_i8255_b(*this, "i8255_b"), - m_in_a_pa_cb(*this), - m_in_a_pb_cb(*this), - m_in_a_pc_cb(*this), - m_out_a_pa_cb(*this), - m_out_a_pb_cb(*this), - m_out_a_pc_cb(*this), - m_in_b_pa_cb(*this), - m_in_b_pb_cb(*this), - m_in_b_pc_cb(*this), - m_out_b_pa_cb(*this), - m_out_b_pb_cb(*this), - m_out_b_pc_cb(*this) +mb89363b_device::mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, MB89363B, tag, owner, clock), + m_i8255_a(*this, "i8255_a"), + m_i8255_b(*this, "i8255_b"), + m_in_a_pa_cb(*this, 0xff), + m_in_a_pb_cb(*this, 0xff), + m_in_a_pc_cb(*this, 0xff), + m_out_a_pa_cb(*this), + m_out_a_pb_cb(*this), + m_out_a_pc_cb(*this), + m_in_b_pa_cb(*this, 0xff), + m_in_b_pb_cb(*this, 0xff), + m_in_b_pc_cb(*this, 0xff), + m_out_b_pa_cb(*this), + m_out_b_pb_cb(*this), + m_out_b_pc_cb(*this) { } @@ -156,20 +156,6 @@ void mb89363b_device::device_add_mconfig(machine_config &config) void mb89363b_device::device_start() { - m_in_a_pa_cb.resolve_safe(0xff); - m_in_a_pb_cb.resolve_safe(0xff); - m_in_a_pc_cb.resolve_safe(0xff); - m_out_a_pa_cb.resolve_safe(); - m_out_a_pb_cb.resolve_safe(); - m_out_a_pc_cb.resolve_safe(); - - m_in_b_pa_cb.resolve_safe(0xff); - m_in_b_pb_cb.resolve_safe(0xff); - m_in_b_pc_cb.resolve_safe(0xff); - m_out_b_pa_cb.resolve_safe(); - m_out_b_pb_cb.resolve_safe(); - m_out_b_pc_cb.resolve_safe(); - } void mb89363b_device::device_reset() diff --git a/src/devices/machine/mb89374.cpp b/src/devices/machine/mb89374.cpp index 7cad4c899d6..a2dacb9c47b 100644 --- a/src/devices/machine/mb89374.cpp +++ b/src/devices/machine/mb89374.cpp @@ -131,10 +131,6 @@ void mb89374_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_po_cb.resolve_all_safe(); - // state saving save_item(NAME(m_irq)); save_item(NAME(m_po)); diff --git a/src/devices/machine/mc14411.cpp b/src/devices/machine/mc14411.cpp index 97f53ca478c..66f53b2ec67 100644 --- a/src/devices/machine/mc14411.cpp +++ b/src/devices/machine/mc14411.cpp @@ -113,7 +113,6 @@ void mc14411_device::device_start() { m_fx_timers[i].timer = timer_alloc(FUNC(mc14411_device::timer_tick), this); m_fx_timers[i].enabled = true; - m_out_fx_cbs[i].resolve(); } save_item(NAME(m_divider)); @@ -168,7 +167,7 @@ void mc14411_device::timer_disable_all() void mc14411_device::arm_timer(int i) { - if (m_out_fx_cbs[i].isnull()) + if (m_out_fx_cbs[i].isunset()) return; int divider = s_counter_divider[i]; if (i < TIMER_F15) @@ -192,7 +191,7 @@ void mc14411_device::device_reset() { // Reset line according to datasheet and remember it for transitions to come m_fx_timers[i].state = !(i < TIMER_F15); - if (!m_out_fx_cbs[i].isnull()) + if (!m_out_fx_cbs[i].isunset()) m_out_fx_cbs[i](m_fx_timers[i].state); } diff --git a/src/devices/machine/mc146818.cpp b/src/devices/machine/mc146818.cpp index dbe5ab11051..a01e5d08427 100644 --- a/src/devices/machine/mc146818.cpp +++ b/src/devices/machine/mc146818.cpp @@ -86,9 +86,6 @@ void mc146818_device::device_start() m_update_timer = timer_alloc(FUNC(mc146818_device::time_tick), this); m_periodic_timer = timer_alloc(FUNC(mc146818_device::periodic_tick), this); - m_write_irq.resolve_safe(); - m_write_sqw.resolve_safe(); - save_pointer(NAME(m_data), data_size()); save_item(NAME(m_index)); save_item(NAME(m_sqw_state)); diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index 99475c5c1ad..8c7bebd9dd8 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -59,16 +59,16 @@ mc68328_base_device::mc68328_base_device(const machine_config &mconfig, device_t , m_out_port_e_cb(*this) , m_out_port_f_cb(*this) , m_out_port_g_cb(*this) - , m_in_port_a_cb(*this) - , m_in_port_b_cb(*this) - , m_in_port_c_cb(*this) - , m_in_port_d_cb(*this) - , m_in_port_e_cb(*this) - , m_in_port_f_cb(*this) - , m_in_port_g_cb(*this) + , m_in_port_a_cb(*this, 0) + , m_in_port_b_cb(*this, 0) + , m_in_port_c_cb(*this, 0) + , m_in_port_d_cb(*this, 0) + , m_in_port_e_cb(*this, 0) + , m_in_port_f_cb(*this, 0) + , m_in_port_g_cb(*this, 0) , m_out_pwm_cb(*this) , m_out_spim_cb(*this) - , m_in_spim_cb(*this) + , m_in_spim_cb(*this, 0) , m_out_flm_cb(*this) , m_out_llp_cb(*this) , m_out_lsclk_cb(*this) @@ -82,9 +82,9 @@ mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, d , m_out_port_j_cb(*this) , m_out_port_k_cb(*this) , m_out_port_m_cb(*this) - , m_in_port_j_cb(*this) - , m_in_port_k_cb(*this) - , m_in_port_m_cb(*this) + , m_in_port_j_cb(*this, 0) + , m_in_port_k_cb(*this, 0) + , m_in_port_m_cb(*this, 0) { m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(mc68328_device::cpu_space_map), this); auto imap = address_map_constructor(FUNC(mc68328_device::internal_map), this); @@ -327,53 +327,9 @@ void mc68328_base_device::device_resolve_objects() { m68000_device::device_resolve_objects(); - m_out_port_a_cb.resolve_all_safe(); - m_out_port_b_cb.resolve_all_safe(); - m_out_port_c_cb.resolve_all_safe(); - m_out_port_d_cb.resolve_all_safe(); - m_out_port_e_cb.resolve_all_safe(); - m_out_port_f_cb.resolve_all_safe(); - m_out_port_g_cb.resolve_all_safe(); - - m_in_port_a_cb.resolve_all(); - m_in_port_b_cb.resolve_all(); - m_in_port_c_cb.resolve_all(); - m_in_port_d_cb.resolve_all(); - m_in_port_e_cb.resolve_all(); - m_in_port_f_cb.resolve_all(); - m_in_port_g_cb.resolve_all(); - - m_out_pwm_cb.resolve_safe(); - - m_out_spim_cb.resolve_safe(); - m_in_spim_cb.resolve_safe(0); - - m_out_flm_cb.resolve_safe(); - m_out_llp_cb.resolve_safe(); - m_out_lsclk_cb.resolve_safe(); - m_out_ld_cb.resolve_safe(); - m_lcd_info_changed_cb.resolve_safe(); } -void mc68328_device::device_resolve_objects() -{ - mc68328_base_device::device_resolve_objects(); - - m_out_port_j_cb.resolve_all_safe(); - m_out_port_k_cb.resolve_all_safe(); - m_out_port_m_cb.resolve_all_safe(); - - m_in_port_j_cb.resolve_all(); - m_in_port_k_cb.resolve_all(); - m_in_port_m_cb.resolve_all(); -} - -void mc68ez328_device::device_resolve_objects() -{ - mc68328_base_device::device_resolve_objects(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -1556,7 +1512,7 @@ u8 mc68328_base_device::padata_r() // 0x401 { data |= m_padata & (1 << i); } - else if (!m_in_port_a_cb[i].isnull()) + else if (!m_in_port_a_cb[i].isunset()) { data |= m_in_port_a_cb[i]() << i; } @@ -1619,7 +1575,7 @@ u8 mc68328_base_device::pbdata_r() // 0x409 { data |= m_pbdata & (1 << i); } - else if (!m_in_port_b_cb[i].isnull()) + else if (!m_in_port_b_cb[i].isunset()) { data |= m_in_port_b_cb[i]() << i; } @@ -1686,7 +1642,7 @@ u8 mc68328_base_device::pcdata_r() // 0x411 { data |= m_pcdata & (1 << i); } - else if (!m_in_port_c_cb[i].isnull()) + else if (!m_in_port_c_cb[i].isunset()) { data |= m_in_port_c_cb[i]() << i; } @@ -1780,7 +1736,7 @@ u8 mc68328_base_device::pddata_r() // 0x419 { data |= m_pddata & (1 << i); } - else if (!m_in_port_d_cb[i].isnull()) + else if (!m_in_port_d_cb[i].isunset()) { data |= m_in_port_d_cb[i]() << i; } @@ -1882,7 +1838,7 @@ u8 mc68328_base_device::pedata_r() // 0x421 { data |= m_pedata & (1 << i); } - else if (!m_in_port_e_cb[i].isnull()) + else if (!m_in_port_e_cb[i].isunset()) { data |= m_in_port_e_cb[i]() << i; } @@ -1961,7 +1917,7 @@ u8 mc68328_base_device::pfdata_r() // 0x429 { data |= m_pfdata & (1 << i); } - else if (!m_in_port_f_cb[i].isnull()) + else if (!m_in_port_f_cb[i].isunset()) { data |= m_in_port_f_cb[i]() << i; } @@ -2040,7 +1996,7 @@ u8 mc68328_base_device::pgdata_r() // 0x431 { data |= m_pgdata & (1 << i); } - else if (!m_in_port_g_cb[i].isnull()) + else if (!m_in_port_g_cb[i].isunset()) { data |= m_in_port_g_cb[i]() << i; } @@ -2119,7 +2075,7 @@ u8 mc68328_device::pjdata_r() // 0x439 { data |= m_pjdata & (1 << i); } - else if (!m_in_port_j_cb[i].isnull()) + else if (!m_in_port_j_cb[i].isunset()) { data |= m_in_port_j_cb[i]() << i; } @@ -2182,7 +2138,7 @@ u8 mc68328_device::pkdata_r() // 0x441 { data |= m_pkdata & (1 << i); } - else if (!m_in_port_k_cb[i].isnull()) + else if (!m_in_port_k_cb[i].isunset()) { data |= m_in_port_k_cb[i]() << i; } @@ -2261,7 +2217,7 @@ u8 mc68328_device::pmdata_r() // 0x449 { data |= m_pmdata & (1 << i); } - else if (!m_in_port_m_cb[i].isnull()) + else if (!m_in_port_m_cb[i].isunset()) { data |= m_in_port_m_cb[i]() << i; } diff --git a/src/devices/machine/mc68328.h b/src/devices/machine/mc68328.h index f53f9961414..b7877e9affc 100644 --- a/src/devices/machine/mc68328.h +++ b/src/devices/machine/mc68328.h @@ -122,18 +122,18 @@ public: auto out_lsclk() { return m_out_lsclk_cb.bind(); } auto out_ld() { return m_out_ld_cb.bind(); } - void irq5_w(int state); - template void set_lcd_info_changed(T &&... args) { m_lcd_info_changed_cb.set(std::forward(args)...); } + void irq5_w(int state); + protected: mc68328_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; @@ -821,8 +821,7 @@ public: template auto in_port_m() { return m_in_port_m_cb[Line].bind(); } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -1055,8 +1054,7 @@ public: mc68ez328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/mc6843.cpp b/src/devices/machine/mc6843.cpp index a961f83fcca..d1df8e4d4ee 100644 --- a/src/devices/machine/mc6843.cpp +++ b/src/devices/machine/mc6843.cpp @@ -17,7 +17,6 @@ mc6843_device::mc6843_device(const machine_config &mconfig, const char *tag, dev void mc6843_device::device_start() { - m_irq.resolve_safe(); m_timer = timer_alloc(FUNC(mc6843_device::update_tick), this); m_floppy = nullptr; diff --git a/src/devices/machine/mc6844.cpp b/src/devices/machine/mc6844.cpp index a88b497a271..1a3aca8d903 100644 --- a/src/devices/machine/mc6844.cpp +++ b/src/devices/machine/mc6844.cpp @@ -84,31 +84,15 @@ mc6844_device::mc6844_device(const machine_config &mconfig, const char *tag, dev , m_out_txak_cb(*this) , m_out_drq1_cb(*this) , m_out_drq2_cb(*this) - , m_in_memr_cb(*this) + , m_in_memr_cb(*this, 0) , m_out_memw_cb(*this) - , m_in_ior_cb(*this) + , m_in_ior_cb(*this, 0) , m_out_iow_cb(*this) , m_state(STATE_S0) , m_icount(0) { } -//------------------------------------------------- -// device_resolve_objects - device-specific setup -//------------------------------------------------- -void mc6844_device::device_resolve_objects() -{ - m_out_int_cb.resolve_safe(); - m_out_txak_cb.resolve_safe(); - m_out_drq1_cb.resolve_safe(); - m_out_drq2_cb.resolve_safe(); - m_in_memr_cb.resolve_safe(0); - m_out_memw_cb.resolve_safe(); - - m_in_ior_cb.resolve_all_safe(0); - m_out_iow_cb.resolve_all_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/mc6844.h b/src/devices/machine/mc6844.h index 10a0454b9a0..7737d700164 100644 --- a/src/devices/machine/mc6844.h +++ b/src/devices/machine/mc6844.h @@ -68,9 +68,7 @@ public: void dgrnt_w(int state) { m_dgrnt = state; trigger(1); } protected: - // device-level overrides - //virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; virtual void execute_run() override; diff --git a/src/devices/machine/mc6846.cpp b/src/devices/machine/mc6846.cpp index 7cacedc9656..26c42d8a5ec 100644 --- a/src/devices/machine/mc6846.cpp +++ b/src/devices/machine/mc6846.cpp @@ -33,8 +33,7 @@ #define PORT \ ((m_pdr & m_ddr) | \ - ((!m_in_port_cb.isnull() ? m_in_port_cb( 0 ) : 0) & \ - ~m_ddr)) + (m_in_port_cb(0) & ~m_ddr)) #define CTO \ ((MODE == 0x30 || (m_tcr & 0x80)) ? m_cto : 0) @@ -48,11 +47,11 @@ DEFINE_DEVICE_TYPE(MC6846, mc6846_device, "mc6846", "MC6846 Programmable Timer") mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6846, tag, owner, clock), - m_out_port_cb(*this), - m_out_cp2_cb(*this), - m_in_port_cb(*this), - m_out_cto_cb(*this), - m_irq_cb(*this) + m_out_port_cb(*this), // 8-bit output + m_out_cp2_cb(*this), // 1-bit output + m_in_port_cb(*this, 0), // CPU read from the outside through chip (8-bit input) + m_out_cto_cb(*this), // asynchronous timer output to output world (1-bit output) + m_irq_cb(*this) // timer interrupt { } @@ -65,18 +64,6 @@ void mc6846_device::device_start() m_interval = timer_alloc(FUNC(mc6846_device::timer_expire), this); m_one_shot = timer_alloc(FUNC(mc6846_device::timer_one_shot), this); - m_out_port_cb.resolve(); /* 8-bit output */ - m_out_cp2_cb.resolve(); /* 1-bit output */ - - /* CPU read from the outside through chip */ - m_in_port_cb.resolve(); /* 8-bit input */ - - /* asynchronous timer output to outside world */ - m_out_cto_cb.resolve(); /* 1-bit output */ - - /* timer interrupt */ - m_irq_cb.resolve(); - save_item(NAME(m_csr)); save_item(NAME(m_pcr)); save_item(NAME(m_ddr)); @@ -155,14 +142,12 @@ inline void mc6846_device::update_irq() if ( cif ) { m_csr |= 0x80; - if ( !m_irq_cb.isnull() ) - m_irq_cb( 1 ); + m_irq_cb( 1 ); } else { m_csr &= ~0x80; - if ( !m_irq_cb.isnull() ) - m_irq_cb( 0 ); + m_irq_cb( 0 ); } } @@ -176,8 +161,7 @@ inline void mc6846_device::update_cto() LOG( "%f: mc6846 CTO set to %i\n", machine().time().as_double(), cto ); m_old_cto = cto; } - if ( !m_out_cto_cb.isnull() ) - m_out_cto_cb( cto ); + m_out_cto_cb( cto ); } @@ -395,8 +379,7 @@ void mc6846_device::write(offs_t offset, uint8_t data) if (data & 0x10) { m_cp2_cpu = (data >> 3) & 1; - if ( !m_out_cp2_cb.isnull() ) - m_out_cp2_cb( m_cp2_cpu ); + m_out_cp2_cb( m_cp2_cpu ); } else logerror( "%s mc6846 acknowledge not implemented\n", machine().describe_context() ); @@ -408,8 +391,7 @@ void mc6846_device::write(offs_t offset, uint8_t data) if ( ! (m_pcr & 0x80) ) { m_ddr = data; - if ( !m_out_port_cb.isnull() ) - m_out_port_cb( (offs_t) 0, m_pdr & m_ddr ); + m_out_port_cb( (offs_t) 0, m_pdr & m_ddr ); } break; @@ -418,8 +400,7 @@ void mc6846_device::write(offs_t offset, uint8_t data) if ( ! (m_pcr & 0x80) ) { m_pdr = data; - if ( !m_out_port_cb.isnull() ) - m_out_port_cb( (offs_t) 0, m_pdr & m_ddr ); + m_out_port_cb( (offs_t) 0, m_pdr & m_ddr ); if ( m_csr1_to_be_cleared && (m_csr & 2) ) { m_csr &= ~2; diff --git a/src/devices/machine/mc6852.cpp b/src/devices/machine/mc6852.cpp index 714e093aed3..af74f26516c 100644 --- a/src/devices/machine/mc6852.cpp +++ b/src/devices/machine/mc6852.cpp @@ -68,12 +68,6 @@ mc6852_device::mc6852_device(const machine_config &mconfig, const char *tag, dev void mc6852_device::device_start() { - // resolve callbacks - m_write_tx_data.resolve_safe(); - m_write_irq.resolve_safe(); - m_write_sm_dtr.resolve_safe(); - m_write_tuf.resolve_safe(); - set_rcv_rate(m_rx_clock); set_tra_rate(m_tx_clock); diff --git a/src/devices/machine/mc6854.cpp b/src/devices/machine/mc6854.cpp index 930326e34f8..1c26764b2a6 100644 --- a/src/devices/machine/mc6854.cpp +++ b/src/devices/machine/mc6854.cpp @@ -186,13 +186,7 @@ mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, dev void mc6854_device::device_start() { - m_out_irq_cb.resolve_safe(); - m_out_rdsr_cb.resolve_safe(); - m_out_tdsr_cb.resolve_safe(); - m_out_txd_cb.resolve(); - m_out_frame_cb.resolve(); - m_out_rts_cb.resolve_safe(); - m_out_dtr_cb.resolve_safe(); + m_out_frame_cb.resolve_safe(); m_ttimer = timer_alloc(FUNC(mc6854_device::tfifo_cb), this); @@ -273,11 +267,8 @@ void mc6854_device::send_bits( uint32_t data, int len, int zi ) m_tones = 0; /* send bits */ - if ( !m_out_txd_cb.isnull() ) - { - for ( i = 0; i < len; i++, data >>= 1 ) - m_out_txd_cb( data & 1 ); - } + for ( i = 0; i < len; i++, data >>= 1 ) + m_out_txd_cb( data & 1 ); /* schedule when to ask the MC6854 for more bits */ expire = m_ttimer ->remaining( ); @@ -434,8 +425,7 @@ TIMER_CALLBACK_MEMBER(mc6854_device::tfifo_cb) m_tstate = 0; m_flen = 0; - if ( !m_out_frame_cb.isnull() ) - m_out_frame_cb( m_frame, len ); + m_out_frame_cb( m_frame, len ); } } diff --git a/src/devices/machine/mc68681.cpp b/src/devices/machine/mc68681.cpp index a2b165cef87..2013235ba12 100644 --- a/src/devices/machine/mc68681.cpp +++ b/src/devices/machine/mc68681.cpp @@ -112,8 +112,8 @@ DEFINE_DEVICE_TYPE(DUART_CHANNEL, duart_channel, "duart_channel", "DUART channel // LIVE DEVICE //************************************************************************** -duart_base_device::duart_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), +duart_base_device::duart_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), m_chanA(*this, CHANA_TAG), m_chanB(*this, CHANB_TAG), m_chanC(*this, CHANC_TAG), @@ -123,7 +123,7 @@ duart_base_device::duart_base_device(const machine_config &mconfig, device_type write_b_tx(*this), write_c_tx(*this), write_d_tx(*this), - read_inport(*this), + read_inport(*this, 0), write_outport(*this), ip3clk(0), ip4clk(0), @@ -200,14 +200,6 @@ void duart_base_device::set_clocks(int clk3, int clk4, int clk5, int clk6) void duart_base_device::device_start() { - write_irq.resolve_safe(); - write_a_tx.resolve_safe(); - write_b_tx.resolve_safe(); - write_c_tx.resolve_safe(); - write_d_tx.resolve_safe(); - read_inport.resolve(); - write_outport.resolve_safe(); - duart_timer = timer_alloc(FUNC(duart_base_device::duart_timer_callback), this); save_item(NAME(ACR)); @@ -622,7 +614,7 @@ uint8_t duart_base_device::read(offs_t offset) break; case 0x0d: /* IP */ - if (!read_inport.isnull()) + if (!read_inport.isunset()) { r = read_inport(); // TODO: go away } diff --git a/src/devices/machine/mc68901.cpp b/src/devices/machine/mc68901.cpp index 830c614e96e..e6e8a1f4695 100644 --- a/src/devices/machine/mc68901.cpp +++ b/src/devices/machine/mc68901.cpp @@ -343,43 +343,43 @@ void mc68901_device::gpio_output() // mc68901_device - constructor //------------------------------------------------- -mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, MC68901, tag, owner, clock), - m_timer_clock(0), - m_out_irq_cb(*this), - m_out_gpio_cb(*this), - m_out_tao_cb(*this), - m_out_tbo_cb(*this), - m_out_tco_cb(*this), - m_out_tdo_cb(*this), - m_out_so_cb(*this), - //m_out_rr_cb(*this), - //m_out_tr_cb(*this), - m_iack_chain_cb(*this), - m_aer(0), - m_ier(0), - m_scr(0), - m_scr_parity(false), - m_transmit_buffer(0), - m_receive_buffer(0), - m_gpio_input(0), - m_gpio_output(0xff), - m_rframe(0), - m_rclk(0), - m_rbits(0), - m_si_scan(0xff), - m_next_rsr(0), - m_rc(true), - m_si(true), - m_last_si(true), - m_rparity(false), - m_osr(0), - m_tclk(0), - m_tbits(0), - m_tc(true), - m_so(false), - m_tparity(false), - m_underrun(false) +mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, MC68901, tag, owner, clock), + m_timer_clock(0), + m_out_irq_cb(*this), + m_out_gpio_cb(*this), + m_out_tao_cb(*this), + m_out_tbo_cb(*this), + m_out_tco_cb(*this), + m_out_tdo_cb(*this), + m_out_so_cb(*this), + //m_out_rr_cb(*this), + //m_out_tr_cb(*this), + m_iack_chain_cb(*this, 0x18), // Spurious IRQ + m_aer(0), + m_ier(0), + m_scr(0), + m_scr_parity(false), + m_transmit_buffer(0), + m_receive_buffer(0), + m_gpio_input(0), + m_gpio_output(0xff), + m_rframe(0), + m_rclk(0), + m_rbits(0), + m_si_scan(0xff), + m_next_rsr(0), + m_rc(true), + m_si(true), + m_last_si(true), + m_rparity(false), + m_osr(0), + m_tclk(0), + m_tbits(0), + m_tc(true), + m_so(false), + m_tparity(false), + m_underrun(false) { } @@ -390,18 +390,6 @@ mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, d void mc68901_device::device_start() { - /* resolve callbacks */ - m_out_irq_cb.resolve_safe(); - m_out_gpio_cb.resolve_safe(); - m_out_tao_cb.resolve_safe(); - m_out_tbo_cb.resolve_safe(); - m_out_tco_cb.resolve_safe(); - m_out_tdo_cb.resolve_safe(); - m_out_so_cb.resolve_safe(); - //m_out_rr_cb.resolve_safe(); - //m_out_tr_cb.resolve_safe(); - m_iack_chain_cb.resolve(); - /* create the timers */ m_timer[TIMER_A] = timer_alloc(FUNC(mc68901_device::timer_count), this); m_timer[TIMER_B] = timer_alloc(FUNC(mc68901_device::timer_count), this); @@ -1051,10 +1039,7 @@ u8 mc68901_device::get_vector() } } - if (!m_iack_chain_cb.isnull()) - return m_iack_chain_cb(); - else - return 0x18; // Spurious irq + return m_iack_chain_cb(); } void mc68901_device::i0_w(int state) { gpio_input(0, state); } diff --git a/src/devices/machine/mccs1850.cpp b/src/devices/machine/mccs1850.cpp index 553b69da808..bec74057501 100644 --- a/src/devices/machine/mccs1850.cpp +++ b/src/devices/machine/mccs1850.cpp @@ -131,8 +131,7 @@ inline void mccs1850_device::check_interrupt() m_ram[REGISTER_STATUS] &= ~STATUS_IT; } - if(!int_cb.isnull()) - int_cb(interrupt); + int_cb(interrupt); } @@ -144,8 +143,7 @@ inline void mccs1850_device::set_pse_line(bool state) { m_pse = state; - if(!pse_cb.isnull()) - pse_cb(m_pse); + pse_cb(m_pse); } @@ -318,11 +316,6 @@ void mccs1850_device::rtc_clock_updated(int year, int month, int day, int day_of void mccs1850_device::device_start() { - // resolve callbacks - int_cb.resolve(); - pse_cb.resolve(); - nuc_cb.resolve(); - // allocate timers m_clock_timer = timer_alloc(FUNC(mccs1850_device::advance_seconds), this); m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); diff --git a/src/devices/machine/mdcr.cpp b/src/devices/machine/mdcr.cpp index a767ccf203f..a4b881a9bd4 100644 --- a/src/devices/machine/mdcr.cpp +++ b/src/devices/machine/mdcr.cpp @@ -101,8 +101,6 @@ mdcr_device::mdcr_device(machine_config const &mconfig, char const *tag, device_ void mdcr_device::device_start() { - m_rdc_cb.resolve_safe(); - m_read_timer = timer_alloc(FUNC(mdcr_device::read_timer_tick), this); m_read_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); diff --git a/src/devices/machine/micomxe1a.cpp b/src/devices/machine/micomxe1a.cpp index ccbbe85774f..0aa0f42367d 100644 --- a/src/devices/machine/micomxe1a.cpp +++ b/src/devices/machine/micomxe1a.cpp @@ -158,8 +158,8 @@ micom_xe_1a_device::micom_xe_1a_device( device_t *owner, u32 clock): device_t(mconfig, MICOM_XE_1A, tag, owner, clock), - m_buttons_callback(*this), - m_analog_callback(*this), + m_buttons_callback(*this, 0xffff), + m_analog_callback(*this, 0x00), m_output_timer(nullptr), m_req(1), m_mode(1), @@ -317,9 +317,6 @@ void micom_xe_1a_device::interface_w(int state) void micom_xe_1a_device::device_start() { - m_buttons_callback.resolve_safe(0xffff); - m_analog_callback.resolve_safe(0x00); - m_output_timer = timer_alloc(FUNC(micom_xe_1a_device::step_output), this); std::fill(std::begin(m_data), std::end(m_data), 0x00); diff --git a/src/devices/machine/microtch.cpp b/src/devices/machine/microtch.cpp index 4f0cacb8d77..987da9e53e2 100644 --- a/src/devices/machine/microtch.cpp +++ b/src/devices/machine/microtch.cpp @@ -242,7 +242,6 @@ void microtouch_device::device_start() set_tra_rate(clock()); set_rcv_rate(clock()); m_out_touch_cb.resolve_safe(1); - m_out_stx_func.resolve_safe(); m_output_valid = false; save_item(NAME(m_output_valid)); diff --git a/src/devices/machine/mm5307.cpp b/src/devices/machine/mm5307.cpp index 30032913ad0..33699a8fada 100644 --- a/src/devices/machine/mm5307.cpp +++ b/src/devices/machine/mm5307.cpp @@ -120,19 +120,6 @@ mm5307ab_device::mm5307ab_device(const machine_config &mconfig, const char *tag, } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void mm5307_device::device_resolve_objects() -{ - // Resolve callback - m_output_cb.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/mm5307.h b/src/devices/machine/mm5307.h index c1e6dad8f89..7ca0789e3c3 100644 --- a/src/devices/machine/mm5307.h +++ b/src/devices/machine/mm5307.h @@ -42,8 +42,7 @@ protected: // base class constructor mm5307_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, const std::array &divisors_x2); - // device-specific overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/mm5740.cpp b/src/devices/machine/mm5740.cpp index feabf787fe0..46c72732fb4 100644 --- a/src/devices/machine/mm5740.cpp +++ b/src/devices/machine/mm5740.cpp @@ -45,9 +45,9 @@ const tiny_rom_entry *mm5740_device::device_rom_region() const mm5740_device::mm5740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MM5740, tag, owner, clock), - m_read_x(*this), - m_read_shift(*this), - m_read_control(*this), + m_read_x(*this, 0x3ff), + m_read_shift(*this, 0), + m_read_control(*this, 0), m_write_data_ready(*this), m_rom(*this, "internal") { @@ -72,12 +72,6 @@ uint32_t mm5740_device::calc_effective_clock_key_debounce(uint32_t capacitance) void mm5740_device::device_start() { - // resolve callbacks - m_read_x.resolve_all_safe(0x3ff); - m_read_shift.resolve_safe(0); - m_read_control.resolve_safe(0); - m_write_data_ready.resolve_safe(); - // allocate timers m_scan_timer = timer_alloc(FUNC(mm5740_device::perform_scan), this); m_scan_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); diff --git a/src/devices/machine/mm58167.cpp b/src/devices/machine/mm58167.cpp index 9363a80c6f4..203b0bf45c4 100644 --- a/src/devices/machine/mm58167.cpp +++ b/src/devices/machine/mm58167.cpp @@ -70,8 +70,6 @@ void mm58167_device::device_start() m_clock_timer = timer_alloc(FUNC(mm58167_device::clock_tick), this); m_clock_timer->adjust(attotime::from_hz(clock() / 32.768f), 0, attotime::from_hz(clock() / 32.768f)); - m_irq_w.resolve_safe(); - // state saving save_item(NAME(m_regs)); save_item(NAME(m_milliseconds)); diff --git a/src/devices/machine/mm74c922.cpp b/src/devices/machine/mm74c922.cpp index add765a1b1e..edcf4093e20 100644 --- a/src/devices/machine/mm74c922.cpp +++ b/src/devices/machine/mm74c922.cpp @@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE(MM74C923, mm74c923_device, "mm74c923", "MM74C923 20-Key Encod mm74c922_device::mm74c922_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int max_y) : device_t(mconfig, type, tag, owner, clock), - m_write_da(*this), m_read_x(*this), m_tristate_data(*this), + m_write_da(*this), m_read_x(*this, (1 << max_y) - 1), m_tristate_data(*this, (1 << max_y) - 1), m_cap_osc(0), m_cap_debounce(0), m_max_y(max_y), m_inhibit(false), @@ -63,11 +63,6 @@ mm74c923_device::mm74c923_device(const machine_config &mconfig, const char *tag, void mm74c922_device::device_start() { - // resolve callbacks - m_write_da.resolve_safe(); - m_read_x.resolve_all_safe((1 << m_max_y) - 1); - m_tristate_data.resolve_safe((1 << m_max_y) - 1); - // set initial values change_output_lines(); diff --git a/src/devices/machine/mos6526.cpp b/src/devices/machine/mos6526.cpp index dc2f57a77be..7140808099e 100644 --- a/src/devices/machine/mos6526.cpp +++ b/src/devices/machine/mos6526.cpp @@ -587,20 +587,20 @@ void mos6526_device::synchronize() // mos6526_device - constructor //------------------------------------------------- -mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant) - : device_t(mconfig, type, tag, owner, clock), - device_execute_interface(mconfig, *this), - m_icount(0), - m_variant(variant), - m_tod_clock(0), - m_write_irq(*this), - m_write_pc(*this), - m_write_cnt(*this), - m_write_sp(*this), - m_read_pa(*this), - m_write_pa(*this), - m_read_pb(*this), - m_write_pb(*this) +mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant) : + device_t(mconfig, type, tag, owner, clock), + device_execute_interface(mconfig, *this), + m_icount(0), + m_variant(variant), + m_tod_clock(0), + m_write_irq(*this), + m_write_pc(*this), + m_write_cnt(*this), + m_write_sp(*this), + m_read_pa(*this, 0xff), + m_write_pa(*this), + m_read_pb(*this, 0xff), + m_write_pb(*this) { } @@ -631,16 +631,6 @@ void mos6526_device::device_start() m_cnt = 1; m_cra = 0; - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_pc.resolve_safe(); - m_write_cnt.resolve_safe(); - m_write_sp.resolve_safe(); - m_read_pa.resolve_safe(0xff); - m_write_pa.resolve_safe(); - m_read_pb.resolve_safe(0xff); - m_write_pb.resolve_safe(); - // allocate timer if (m_tod_clock != 0) { diff --git a/src/devices/machine/mos6529.cpp b/src/devices/machine/mos6529.cpp index 46bbf3bc0b8..fbfe7f067ac 100644 --- a/src/devices/machine/mos6529.cpp +++ b/src/devices/machine/mos6529.cpp @@ -45,8 +45,6 @@ mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, d void mos6529_device::device_start() { - // resolve callbacks - m_p_handler.resolve_all_safe(); } diff --git a/src/devices/machine/mos6530.cpp b/src/devices/machine/mos6530.cpp index 3862b0699e8..da9e5c91b2f 100644 --- a/src/devices/machine/mos6530.cpp +++ b/src/devices/machine/mos6530.cpp @@ -41,12 +41,12 @@ enum DEFINE_DEVICE_TYPE(MOS6530, mos6530_device, "mos6530", "MOS 6530 MIOT") -mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MOS6530, tag, owner, clock), - m_in_pa_cb(*this), - m_out_pa_cb(*this), - m_in_pb_cb(*this), - m_out_pb_cb(*this) +mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, MOS6530, tag, owner, clock), + m_in_pa_cb(*this, 0), + m_out_pa_cb(*this), + m_in_pb_cb(*this, 0), + m_out_pb_cb(*this) { } @@ -59,12 +59,6 @@ void mos6530_device::device_start() /* set static values */ m_clock = clock(); - /* resolve callbacks */ - m_in_pa_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_in_pb_cb.resolve_safe(0); - m_out_pb_cb.resolve_safe(); - /* allocate timers */ m_timer = timer_alloc(FUNC(mos6530_device::end_state), this); diff --git a/src/devices/machine/mos6530n.cpp b/src/devices/machine/mos6530n.cpp index 5a9763c3aa6..a5754b44cd0 100644 --- a/src/devices/machine/mos6530n.cpp +++ b/src/devices/machine/mos6530n.cpp @@ -88,13 +88,13 @@ mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_t m_ram(*this, finder_base::DUMMY_TAG, rsize, ENDIANNESS_LITTLE), m_rom(*this, DEVICE_SELF), m_irq_cb(*this), - m_in8_pa_cb(*this), + m_in8_pa_cb(*this, 0), m_out8_pa_cb(*this), - m_in8_pb_cb(*this), + m_in8_pb_cb(*this, 0), m_out8_pb_cb(*this), - m_in_pa_cb(*this), + m_in_pa_cb(*this, 0), m_out_pa_cb(*this), - m_in_pb_cb(*this), + m_in_pb_cb(*this, 0), m_out_pb_cb(*this), m_pa_in(0xff), m_pa_out(0), @@ -137,17 +137,6 @@ mos6532_new_device::mos6532_new_device(const machine_config &mconfig, const char void mos6530_device_base::device_start() { - // resolve callbacks - m_irq_cb.resolve_safe(); - m_in8_pa_cb.resolve(); - m_out8_pa_cb.resolve(); - m_in8_pb_cb.resolve(); - m_out8_pb_cb.resolve(); - m_in_pa_cb.resolve_all(); - m_out_pa_cb.resolve_all_safe(); - m_in_pb_cb.resolve_all(); - m_out_pb_cb.resolve_all_safe(); - // allocate timer t_gen = timer_alloc(FUNC(mos6530_device_base::update), this); @@ -224,7 +213,7 @@ void mos6530_device_base::update_pa() uint8_t ddr = m_pa_ddr; uint8_t data = (out & ddr) | (ddr ^ 0xff); - if (m_out8_pa_cb.isnull()) + if (m_out8_pa_cb.isunset()) { m_out_pa_cb[0](BIT(data, 0)); m_out_pa_cb[1](BIT(data, 1)); @@ -252,7 +241,7 @@ void mos6530_device_base::update_pb() uint8_t ddr = m_pb_ddr; uint8_t data = (out & ddr) | (ddr ^ 0xff); - if (m_out8_pb_cb.isnull()) + if (m_out8_pb_cb.isunset()) { m_out_pb_cb[0](BIT(data, 0)); m_out_pb_cb[1](BIT(data, 1)); @@ -284,7 +273,7 @@ void mos6530_new_device::update_pb() } } - if (m_out8_pb_cb.isnull()) + if (m_out8_pb_cb.isunset()) { m_out_pb_cb[0](BIT(data, 0)); m_out_pb_cb[1](BIT(data, 1)); @@ -405,16 +394,16 @@ uint8_t mos6530_device_base::pa_data_r() { uint8_t in = 0; - if (m_in8_pa_cb.isnull()) + if (m_in8_pa_cb.isunset()) { - in |= (m_in_pa_cb[0].isnull() ? BIT(m_pa_in, 0) : m_in_pa_cb[0]()); - in |= (m_in_pa_cb[1].isnull() ? BIT(m_pa_in, 1) : m_in_pa_cb[1]()) << 1; - in |= (m_in_pa_cb[2].isnull() ? BIT(m_pa_in, 2) : m_in_pa_cb[2]()) << 2; - in |= (m_in_pa_cb[3].isnull() ? BIT(m_pa_in, 3) : m_in_pa_cb[3]()) << 3; - in |= (m_in_pa_cb[4].isnull() ? BIT(m_pa_in, 4) : m_in_pa_cb[4]()) << 4; - in |= (m_in_pa_cb[5].isnull() ? BIT(m_pa_in, 5) : m_in_pa_cb[5]()) << 5; - in |= (m_in_pa_cb[6].isnull() ? BIT(m_pa_in, 6) : m_in_pa_cb[6]()) << 6; - in |= (m_in_pa_cb[7].isnull() ? BIT(m_pa_in, 7) : m_in_pa_cb[7]()) << 7; + in |= (m_in_pa_cb[0].isunset() ? BIT(m_pa_in, 0) : m_in_pa_cb[0]()); + in |= (m_in_pa_cb[1].isunset() ? BIT(m_pa_in, 1) : m_in_pa_cb[1]()) << 1; + in |= (m_in_pa_cb[2].isunset() ? BIT(m_pa_in, 2) : m_in_pa_cb[2]()) << 2; + in |= (m_in_pa_cb[3].isunset() ? BIT(m_pa_in, 3) : m_in_pa_cb[3]()) << 3; + in |= (m_in_pa_cb[4].isunset() ? BIT(m_pa_in, 4) : m_in_pa_cb[4]()) << 4; + in |= (m_in_pa_cb[5].isunset() ? BIT(m_pa_in, 5) : m_in_pa_cb[5]()) << 5; + in |= (m_in_pa_cb[6].isunset() ? BIT(m_pa_in, 6) : m_in_pa_cb[6]()) << 6; + in |= (m_in_pa_cb[7].isunset() ? BIT(m_pa_in, 7) : m_in_pa_cb[7]()) << 7; } else { @@ -470,16 +459,16 @@ uint8_t mos6530_device_base::pb_data_r() { uint8_t in = 0; - if (m_in8_pb_cb.isnull()) + if (m_in8_pb_cb.isunset()) { - in |= (m_in_pb_cb[0].isnull() ? BIT(m_pb_in, 0) : m_in_pb_cb[0]()); - in |= (m_in_pb_cb[1].isnull() ? BIT(m_pb_in, 1) : m_in_pb_cb[1]()) << 1; - in |= (m_in_pb_cb[2].isnull() ? BIT(m_pb_in, 2) : m_in_pb_cb[2]()) << 2; - in |= (m_in_pb_cb[3].isnull() ? BIT(m_pb_in, 3) : m_in_pb_cb[3]()) << 3; - in |= (m_in_pb_cb[4].isnull() ? BIT(m_pb_in, 4) : m_in_pb_cb[4]()) << 4; - in |= (m_in_pb_cb[5].isnull() ? BIT(m_pb_in, 5) : m_in_pb_cb[5]()) << 5; - in |= (m_in_pb_cb[6].isnull() ? BIT(m_pb_in, 6) : m_in_pb_cb[6]()) << 6; - in |= (m_in_pb_cb[7].isnull() ? BIT(m_pb_in, 7) : m_in_pb_cb[7]()) << 7; + in |= (m_in_pb_cb[0].isunset() ? BIT(m_pb_in, 0) : m_in_pb_cb[0]()); + in |= (m_in_pb_cb[1].isunset() ? BIT(m_pb_in, 1) : m_in_pb_cb[1]()) << 1; + in |= (m_in_pb_cb[2].isunset() ? BIT(m_pb_in, 2) : m_in_pb_cb[2]()) << 2; + in |= (m_in_pb_cb[3].isunset() ? BIT(m_pb_in, 3) : m_in_pb_cb[3]()) << 3; + in |= (m_in_pb_cb[4].isunset() ? BIT(m_pb_in, 4) : m_in_pb_cb[4]()) << 4; + in |= (m_in_pb_cb[5].isunset() ? BIT(m_pb_in, 5) : m_in_pb_cb[5]()) << 5; + in |= (m_in_pb_cb[6].isunset() ? BIT(m_pb_in, 6) : m_in_pb_cb[6]()) << 6; + in |= (m_in_pb_cb[7].isunset() ? BIT(m_pb_in, 7) : m_in_pb_cb[7]()) << 7; } else { diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index 4880c157ee2..c570a746806 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -72,13 +72,6 @@ void mos6551_device::device_add_mconfig(machine_config &config) void mos6551_device::device_start() { - // resolve callbacks - m_irq_handler.resolve_safe(); - m_txd_handler.resolve_safe(); - m_rxc_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - m_dtr_handler.resolve_safe(); - // state saving save_item(NAME(m_control)); save_item(NAME(m_command)); diff --git a/src/devices/machine/mos8722.cpp b/src/devices/machine/mos8722.cpp index a8386e293f7..9683b18ab93 100644 --- a/src/devices/machine/mos8722.cpp +++ b/src/devices/machine/mos8722.cpp @@ -73,9 +73,9 @@ mos8722_device::mos8722_device(const machine_config &mconfig, const char *tag, d device_t(mconfig, MOS8722, tag, owner, clock), m_write_z80en(*this), m_write_fsdir(*this), - m_read_game(*this), - m_read_exrom(*this), - m_read_sense40(*this) + m_read_game(*this, 1), + m_read_exrom(*this, 1), + m_read_sense40(*this, 1) { } @@ -86,12 +86,6 @@ mos8722_device::mos8722_device(const machine_config &mconfig, const char *tag, d void mos8722_device::device_start() { - // resolve callbacks - m_write_z80en.resolve_safe(); - m_write_fsdir.resolve_safe(); - m_read_game.resolve_safe(1); - m_read_exrom.resolve_safe(1); - m_read_sense40.resolve_safe(1); } diff --git a/src/devices/machine/mpu401.cpp b/src/devices/machine/mpu401.cpp index e2959a432a9..a1546a73a2c 100644 --- a/src/devices/machine/mpu401.cpp +++ b/src/devices/machine/mpu401.cpp @@ -126,7 +126,6 @@ mpu401_device::mpu401_device(const machine_config &mconfig, const char *tag, dev void mpu401_device::device_start() { - write_irq.resolve_safe(); m_timer = timer_alloc(FUNC(mpu401_device::serial_tick), this); } diff --git a/src/devices/machine/msm58321.cpp b/src/devices/machine/msm58321.cpp index 288bce2e4a1..ade436a7d11 100644 --- a/src/devices/machine/msm58321.cpp +++ b/src/devices/machine/msm58321.cpp @@ -201,13 +201,6 @@ msm58321_device::msm58321_device(const machine_config &mconfig, const char *tag, void msm58321_device::device_start() { - // resolve callbacks - m_d0_handler.resolve_safe(); - m_d1_handler.resolve_safe(); - m_d2_handler.resolve_safe(); - m_d3_handler.resolve_safe(); - m_busy_handler.resolve_safe(); - // allocate timers m_clock_timer = timer_alloc(FUNC(msm58321_device::clock_tick), this); m_clock_timer->adjust(clocks_to_attotime(32768/1024), 0, clocks_to_attotime(32768/1024)); diff --git a/src/devices/machine/msm6242.cpp b/src/devices/machine/msm6242.cpp index 003436ff496..f4c808db9a6 100644 --- a/src/devices/machine/msm6242.cpp +++ b/src/devices/machine/msm6242.cpp @@ -95,8 +95,6 @@ msm6242_device::msm6242_device(const machine_config &mconfig, device_type type, void msm6242_device::device_start() { - m_out_int_handler.resolve(); - // let's call the timer callback every tick m_timer = timer_alloc(FUNC(msm6242_device::rtc_timer_callback), this); m_timer->adjust(attotime::zero); @@ -174,7 +172,7 @@ void msm6242_device::set_irq(bool active) else m_reg[0] &= 0x0b; - if (!m_out_int_handler.isnull()) + if (!m_out_int_handler.isunset()) m_out_int_handler(active ? ASSERT_LINE : CLEAR_LINE); if (active) @@ -311,7 +309,7 @@ void msm6242_device::update_timer() attotime callback_time = attotime::never; // we only need to call back if the IRQ flag is on, and we have a handler - if (!m_out_int_handler.isnull() && m_irq_flag == 1) + if (!m_out_int_handler.isunset() && m_irq_flag == 1) { switch(m_irq_type) { diff --git a/src/devices/machine/mv_sonora.cpp b/src/devices/machine/mv_sonora.cpp index bab95cccb0f..f51007d9e64 100644 --- a/src/devices/machine/mv_sonora.cpp +++ b/src/devices/machine/mv_sonora.cpp @@ -32,7 +32,6 @@ mac_video_sonora_device::mac_video_sonora_device(const machine_config &mconfig, void mac_video_sonora_device::device_start() { - m_screen_vblank.resolve_safe(); m_vram = nullptr; save_item(NAME(m_vram_offset)); diff --git a/src/devices/machine/nandflash.cpp b/src/devices/machine/nandflash.cpp index 559816e9101..8fdc309a392 100644 --- a/src/devices/machine/nandflash.cpp +++ b/src/devices/machine/nandflash.cpp @@ -174,11 +174,6 @@ void nand_device::device_reset() std::fill_n(m_pagereg.get(), m_page_total_size, 0); } -void nand_device::device_resolve_objects() -{ - m_write_rnb.resolve_safe(); -} - void nand_device::nvram_default() { if (m_region.found()) diff --git a/src/devices/machine/nandflash.h b/src/devices/machine/nandflash.h index 221216ff3a1..ea98e62a3bc 100644 --- a/src/devices/machine/nandflash.h +++ b/src/devices/machine/nandflash.h @@ -17,13 +17,7 @@ public: // construction/destruction nand_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - - virtual void device_resolve_objects() override; - - // device_nvram_interface overrides + // device_nvram_interface implementation virtual void nvram_default() override; virtual bool nvram_read(util::read_stream &file) override; virtual bool nvram_write(util::write_stream &file) override; @@ -62,6 +56,10 @@ protected: nand_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device_t implementation + virtual void device_start() override; + virtual void device_reset() override; + optional_memory_region m_region; uint32_t m_page_data_size; // 256 for a 2MB card, 512 otherwise diff --git a/src/devices/machine/ncr5380.cpp b/src/devices/machine/ncr5380.cpp index bed78dd4784..5259bf3bb4f 100644 --- a/src/devices/machine/ncr5380.cpp +++ b/src/devices/machine/ncr5380.cpp @@ -68,9 +68,6 @@ void ncr5380_device::map(address_map &map) void ncr5380_device::device_start() { - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - // Need to be cleared here so that set_irq/drq called from reset // does not compare with uninitialized m_irq_state = false; diff --git a/src/devices/machine/ncr5385.cpp b/src/devices/machine/ncr5385.cpp index 6c1f4a3bb4e..76448cf620c 100644 --- a/src/devices/machine/ncr5385.cpp +++ b/src/devices/machine/ncr5385.cpp @@ -22,7 +22,6 @@ ncr5385_device::ncr5385_device(const machine_config &mconfig, const char *tag, d void ncr5385_device::device_start() { - m_int.resolve_safe(); } void ncr5385_device::device_reset() diff --git a/src/devices/machine/ncr53c90.cpp b/src/devices/machine/ncr53c90.cpp index a22dd5c70c3..6f73c28b814 100644 --- a/src/devices/machine/ncr53c90.cpp +++ b/src/devices/machine/ncr53c90.cpp @@ -239,9 +239,6 @@ void ncr53c90_device::device_start() save_item(NAME(drq)); save_item(NAME(test_mode)); - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - config = 0; bus_id = 0; select_timeout = 0; diff --git a/src/devices/machine/ns32081.cpp b/src/devices/machine/ns32081.cpp index 7f4e8f6be55..6b16008ffde 100644 --- a/src/devices/machine/ns32081.cpp +++ b/src/devices/machine/ns32081.cpp @@ -628,7 +628,7 @@ void ns32081_device::execute() m_state = STATUS; - if (m_out_scb) + if (!m_out_scb.isunset()) m_complete->adjust(attotime::from_ticks(m_tcy, clock())); } diff --git a/src/devices/machine/ns32202.cpp b/src/devices/machine/ns32202.cpp index 190e2ece5af..008c2c855dc 100644 --- a/src/devices/machine/ns32202.cpp +++ b/src/devices/machine/ns32202.cpp @@ -73,10 +73,6 @@ ns32202_device::ns32202_device(machine_config const &mconfig, char const *tag, d void ns32202_device::device_start() { - m_out_int.resolve_safe(); - m_out_cout.resolve_safe(); - m_out_port.resolve_safe(); - save_item(NAME(m_hvct)); save_item(NAME(m_eltg)); save_item(NAME(m_tpl)); diff --git a/src/devices/machine/nsc810.cpp b/src/devices/machine/nsc810.cpp index a416e6ccca4..fbf4f060800 100644 --- a/src/devices/machine/nsc810.cpp +++ b/src/devices/machine/nsc810.cpp @@ -30,9 +30,9 @@ nsc810_device::nsc810_device(const machine_config &mconfig, const char *tag, dev m_ddrA(0), m_ddrB(0), m_ddrC(0), m_mode(0), m_ramselect(false), - m_portA_r(*this), - m_portB_r(*this), - m_portC_r(*this), + m_portA_r(*this, 0), + m_portB_r(*this, 0), + m_portC_r(*this, 0), m_portA_w(*this), m_portB_w(*this), m_portC_w(*this), @@ -48,14 +48,6 @@ nsc810_device::nsc810_device(const machine_config &mconfig, const char *tag, dev void nsc810_device::device_start() { - m_portA_r.resolve_safe(0); - m_portB_r.resolve_safe(0); - m_portC_r.resolve_safe(0); - m_portA_w.resolve_safe(); - m_portB_w.resolve_safe(); - m_portC_w.resolve_safe(); - m_timer_out.resolve_all_safe(); - m_portA_w(0); m_portB_w(0); m_portC_w(0); diff --git a/src/devices/machine/nscsi_cb.cpp b/src/devices/machine/nscsi_cb.cpp index 5d42caf8265..b4d80bed9f6 100644 --- a/src/devices/machine/nscsi_cb.cpp +++ b/src/devices/machine/nscsi_cb.cpp @@ -5,34 +5,23 @@ DEFINE_DEVICE_TYPE(NSCSI_CB, nscsi_callback_device, "nscsi_cb", "SCSI callback (new)") -nscsi_callback_device::nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nscsi_device(mconfig, NSCSI_CB, tag, owner, clock), - nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), - m_write_rst(*this), - m_write_atn(*this), - m_write_ack(*this), - m_write_req(*this), - m_write_msg(*this), - m_write_io(*this), - m_write_cd(*this), - m_write_sel(*this), - m_write_bsy(*this), m_ctrl(0) +nscsi_callback_device::nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + nscsi_device(mconfig, NSCSI_CB, tag, owner, clock), + nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), + m_write_rst(*this), + m_write_atn(*this), + m_write_ack(*this), + m_write_req(*this), + m_write_msg(*this), + m_write_io(*this), + m_write_cd(*this), + m_write_sel(*this), + m_write_bsy(*this), m_ctrl(0) { } void nscsi_callback_device::device_start() { - // resolve callbacks - m_write_rst.resolve_safe(); - m_write_atn.resolve_safe(); - m_write_ack.resolve_safe(); - m_write_req.resolve_safe(); - m_write_msg.resolve_safe(); - m_write_io.resolve_safe(); - m_write_cd.resolve_safe(); - m_write_sel.resolve_safe(); - m_write_bsy.resolve_safe(); - // state saving save_item(NAME(m_ctrl)); } diff --git a/src/devices/machine/output_latch.cpp b/src/devices/machine/output_latch.cpp index 7ed407d68f8..bc8dcb8ea09 100644 --- a/src/devices/machine/output_latch.cpp +++ b/src/devices/machine/output_latch.cpp @@ -12,11 +12,6 @@ output_latch_device::output_latch_device(const machine_config &mconfig, const ch { } -void output_latch_device::device_resolve_objects() -{ - m_bit_handlers.resolve_all_safe(); -} - void output_latch_device::device_start() { save_item(NAME(m_bits)); @@ -30,8 +25,7 @@ void output_latch_device::write(uint8_t data) if (bit != m_bits[i]) { m_bits[i] = bit; - if (!m_bit_handlers[i].isnull()) - m_bit_handlers[i](bit); + m_bit_handlers[i](bit); } } } diff --git a/src/devices/machine/output_latch.h b/src/devices/machine/output_latch.h index 0e6a87ff6dc..c807e79f3e4 100644 --- a/src/devices/machine/output_latch.h +++ b/src/devices/machine/output_latch.h @@ -16,7 +16,6 @@ public: void write(uint8_t data); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/devices/machine/pc_fdc.cpp b/src/devices/machine/pc_fdc.cpp index 0609759f3b3..03ce46ee866 100644 --- a/src/devices/machine/pc_fdc.cpp +++ b/src/devices/machine/pc_fdc.cpp @@ -67,9 +67,6 @@ void pc_fdc_family_device::device_add_mconfig(machine_config &config) void pc_fdc_family_device::device_start() { - intrq_cb.resolve(); - drq_cb.resolve(); - for(int i=0; i<4; i++) { char name[2] = {static_cast('0'+i), 0}; floppy_connector *conn = subdevice(name); @@ -150,7 +147,7 @@ void pc_fdc_family_device::check_irq() { bool pirq = irq; irq = fdc_irq && (dor & 4) && (dor & 8); - if(irq != pirq && !intrq_cb.isnull()) { + if(irq != pirq) { LOG("pc_irq = %d\n", irq); intrq_cb(irq); } @@ -160,7 +157,7 @@ void pc_fdc_family_device::check_drq() { bool pdrq = drq; drq = fdc_drq && (dor & 4) && (dor & 8); - if(drq != pdrq && !drq_cb.isnull()) + if(drq != pdrq) drq_cb(drq); } diff --git a/src/devices/machine/pc_lpt.cpp b/src/devices/machine/pc_lpt.cpp index 26d2357a72b..1c4b0349046 100644 --- a/src/devices/machine/pc_lpt.cpp +++ b/src/devices/machine/pc_lpt.cpp @@ -29,8 +29,6 @@ pc_lpt_device::pc_lpt_device(const machine_config &mconfig, const char *tag, dev void pc_lpt_device::device_start() { - m_irq_handler.resolve_safe(); - save_item(NAME(m_irq)); save_item(NAME(m_data)); save_item(NAME(m_control)); diff --git a/src/devices/machine/pccard.cpp b/src/devices/machine/pccard.cpp index ee8aa508a83..3171e85e68d 100644 --- a/src/devices/machine/pccard.cpp +++ b/src/devices/machine/pccard.cpp @@ -55,12 +55,6 @@ pccard_slot_device::pccard_slot_device(const machine_config &mconfig, const char void pccard_slot_device::device_start() { m_pccard = get_card_device(); - - // resolve callbacks - m_card_detect_cb.resolve_safe(); - m_battery_voltage_1_cb.resolve_safe(); - m_battery_voltage_2_cb.resolve_safe(); - m_write_protect_cb.resolve_safe(); } uint16_t pccard_slot_device::read_memory(offs_t offset, uint16_t mem_mask) diff --git a/src/devices/machine/pcf8573.cpp b/src/devices/machine/pcf8573.cpp index b1ac55cfb44..a0d12344db6 100644 --- a/src/devices/machine/pcf8573.cpp +++ b/src/devices/machine/pcf8573.cpp @@ -56,10 +56,6 @@ pcf8573_device::pcf8573_device(const machine_config &mconfig, const char *tag, d void pcf8573_device::device_start() { - m_comp_cb.resolve_safe(); - m_min_cb.resolve_safe(); - m_sec_cb.resolve_safe(); - // allocate timers m_clock_timer = timer_alloc(FUNC(pcf8573_device::clock_tick), this); m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); diff --git a/src/devices/machine/pcf8583.cpp b/src/devices/machine/pcf8583.cpp index 9fd4e08e3c8..890ca586fba 100644 --- a/src/devices/machine/pcf8583.cpp +++ b/src/devices/machine/pcf8583.cpp @@ -69,8 +69,6 @@ void pcf8583_device::device_start() save_item(NAME(m_irq)); save_item(NAME(m_data)); save_item(NAME(m_slave_address)); - - m_irq_cb.resolve_safe(); } TIMER_CALLBACK_MEMBER(pcf8583_device::clock_tick) diff --git a/src/devices/machine/pcf8584.cpp b/src/devices/machine/pcf8584.cpp index 31d78e73008..79d8a013c6a 100644 --- a/src/devices/machine/pcf8584.cpp +++ b/src/devices/machine/pcf8584.cpp @@ -54,7 +54,7 @@ const char *const pcf8584_device::s_bus_function[4] = { "NOP", "stop", "start", pcf8584_device::pcf8584_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, PCF8584, tag, owner, clock) - , m_sda_callback(*this) + , m_sda_callback(*this, 1) , m_sda_out_callback(*this) , m_scl_callback(*this) , m_int_callback(*this) @@ -70,21 +70,6 @@ pcf8584_device::pcf8584_device(const machine_config &mconfig, const char *tag, d } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void pcf8584_device::device_resolve_objects() -{ - m_sda_callback.resolve_safe(1); - m_sda_out_callback.resolve_safe(); - m_scl_callback.resolve_safe(); - m_int_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/pcf8584.h b/src/devices/machine/pcf8584.h index 68886a7affc..cbf2dff9c82 100644 --- a/src/devices/machine/pcf8584.h +++ b/src/devices/machine/pcf8584.h @@ -57,8 +57,7 @@ public: IRQ_CALLBACK_MEMBER(iack); protected: - // device-specific overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp index b7680d6b641..9c4d3a4fda2 100644 --- a/src/devices/machine/pci-ide.cpp +++ b/src/devices/machine/pci-ide.cpp @@ -85,8 +85,6 @@ void ide_pci_device::device_start() pci_bar[3] = 0x374; pci_bar[4] = 0xf00; - m_irq_handler.resolve_safe(); - intr_pin = 0x1; intr_line = 0xe; diff --git a/src/devices/machine/pci9050.cpp b/src/devices/machine/pci9050.cpp index 9f5c63c621e..c3425d01a4b 100644 --- a/src/devices/machine/pci9050.cpp +++ b/src/devices/machine/pci9050.cpp @@ -41,7 +41,7 @@ void pci9050_device::map(address_map &map) pci9050_device::pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, PCI9050, tag, owner, clock) - , m_user_input_handler(*this), m_user_output_handler(*this) + , m_user_input_handler(*this, 0), m_user_output_handler(*this) { set_ids(0x10b59050, 0x01, 0x06800000, 0x10b59050); for(int i=0; i<4; i++) { @@ -69,8 +69,6 @@ void pci9050_device::device_start() else add_map(0, M_MEM | M_DISABLED, address_map_constructor(), nullptr); - m_user_input_handler.resolve(); - m_user_output_handler.resolve(); // Save states save_item(NAME(m_lasrr)); save_item(NAME(m_lasba)); @@ -267,7 +265,7 @@ void pci9050_device::intcsr_w(uint32_t data) uint32_t pci9050_device::cntrl_r() { - if (!m_user_input_handler.isnull()) + if (!m_user_input_handler.isunset()) { int readData = m_user_input_handler(); for (int userIndex = 0; userIndex < 4; userIndex++) @@ -288,7 +286,7 @@ void pci9050_device::cntrl_w(uint32_t data) remap_rom(); if ((oldData ^ m_cntrl) & 0x3000) remap_cb(); - if (!m_user_output_handler.isnull()) { + if (!m_user_output_handler.isunset()) { int userData = 0; for (int userIndex = 0; userIndex < 4; userIndex++) userData |= ((m_cntrl >> (2 + userIndex * 3)) & 1) << userIndex; diff --git a/src/devices/machine/pckeybrd.cpp b/src/devices/machine/pckeybrd.cpp index 966998eee1f..3e59b741798 100644 --- a/src/devices/machine/pckeybrd.cpp +++ b/src/devices/machine/pckeybrd.cpp @@ -327,16 +327,17 @@ void pc_keyboard_device::device_start() ioport_accept_char_delegate(&pc_keyboard_device::accept_char, this), ioport_charqueue_empty_delegate(&pc_keyboard_device::charqueue_empty, this)); - m_out_keypress_func.resolve_safe(); m_keyboard_timer = timer_alloc(FUNC(at_keyboard_device::poll_keys), this); } void at_keyboard_device::device_start() { - save_item(NAME(m_scan_code_set)); - save_item(NAME(m_input_state)); pc_keyboard_device::device_start(); + m_leds.resolve(); + + save_item(NAME(m_scan_code_set)); + save_item(NAME(m_input_state)); } void pc_keyboard_device::device_reset() diff --git a/src/devices/machine/pdc.cpp b/src/devices/machine/pdc.cpp index 2a482d8a236..73aca052620 100644 --- a/src/devices/machine/pdc.cpp +++ b/src/devices/machine/pdc.cpp @@ -304,7 +304,7 @@ pdc_device::pdc_device(const machine_config &mconfig, const char *tag, device_t m_fdc(*this, FDC_TAG), m_hdc9224(*this, HDC_TAG), m_pdc_ram(*this, "pdc_ram"), - m_m68k_r_cb(*this), + m_m68k_r_cb(*this, 0), m_m68k_w_cb(*this) { } @@ -315,10 +315,6 @@ pdc_device::pdc_device(const machine_config &mconfig, const char *tag, device_t void pdc_device::device_start() { - /* Resolve callbacks */ - m_m68k_r_cb.resolve_safe(0); - m_m68k_w_cb.resolve_safe(); - /* Save States */ save_item(NAME(reg_p0)); save_item(NAME(reg_p1)); diff --git a/src/devices/machine/phi.cpp b/src/devices/machine/phi.cpp index 02491c87617..174b00be1ad 100644 --- a/src/devices/machine/phi.cpp +++ b/src/devices/machine/phi.cpp @@ -187,14 +187,14 @@ constexpr uint8_t CONTROLLER_ADDR = 0x1e; // PHI always has this address when DEFINE_DEVICE_TYPE(PHI, phi_device, "hp_phi", "HP Processor-to-HPIB Interface") // Constructors -phi_device::phi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock), - m_dio_read_func(*this), - m_dio_write_func(*this), - m_signal_wr_fns(*this), - m_int_write_func(*this), - m_dmarq_write_func(*this), - m_sys_cntrl_read_func(*this) +phi_device::phi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + m_dio_read_func(*this, 0xff), + m_dio_write_func(*this), + m_signal_wr_fns(*this), + m_int_write_func(*this), + m_dmarq_write_func(*this), + m_sys_cntrl_read_func(*this, 0) { } @@ -374,13 +374,6 @@ void phi_device::device_start() save_item(NAME(m_reg_address)); save_item(NAME(m_nba_origin)); - m_dio_read_func.resolve_safe(0xff); - m_dio_write_func.resolve_safe(); - m_signal_wr_fns.resolve_all_safe(); - m_int_write_func.resolve_safe(); - m_dmarq_write_func.resolve_safe(); - m_sys_cntrl_read_func.resolve_safe(0); - m_sh_dly_timer = timer_alloc(FUNC(phi_device::delayed_update), this); m_c_dly_timer = timer_alloc(FUNC(phi_device::delayed_update), this); } diff --git a/src/devices/machine/pic8259.cpp b/src/devices/machine/pic8259.cpp index 5d7c2e269bd..c9eaecdaf92 100644 --- a/src/devices/machine/pic8259.cpp +++ b/src/devices/machine/pic8259.cpp @@ -378,21 +378,6 @@ void pic8259_device::write(offs_t offset, uint8_t data) } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void pic8259_device::device_resolve_objects() -{ - // resolve callbacks - m_out_int_func.resolve_safe(); - m_in_sp_func.resolve_safe(1); - m_read_slave_ack_func.resolve_safe(0); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -469,8 +454,8 @@ DEFINE_DEVICE_TYPE(MK98PIC, mk98pic_device, "mk98pic", "Elektronika MK-98 PIC") pic8259_device::pic8259_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_out_int_func(*this) - , m_in_sp_func(*this) - , m_read_slave_ack_func(*this) + , m_in_sp_func(*this, 1) + , m_read_slave_ack_func(*this, 0) , m_irr(0) , m_irq_lines(0) , m_level_trig_mode(0) diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h index 7c840b78a4e..0444cc5ae1d 100644 --- a/src/devices/machine/pic8259.h +++ b/src/devices/machine/pic8259.h @@ -55,8 +55,7 @@ public: protected: pic8259_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/pit8253.cpp b/src/devices/machine/pit8253.cpp index fc7c79cc289..d9f2bf913d6 100644 --- a/src/devices/machine/pit8253.cpp +++ b/src/devices/machine/pit8253.cpp @@ -98,7 +98,6 @@ void pit8253_device::device_resolve_objects() { for (int timer = 0; timer < 3; timer++) { - m_out_handler[timer].resolve_safe(); m_counter[timer]->m_index = timer; m_counter[timer]->m_clockin = m_clk[timer]; m_counter[timer]->m_clock_period = (m_clk[timer] != 0) ? attotime::from_hz(m_clk[timer]) : attotime::never; diff --git a/src/devices/machine/psion_asic1.cpp b/src/devices/machine/psion_asic1.cpp index 6fc2aeca782..75408292572 100644 --- a/src/devices/machine/psion_asic1.cpp +++ b/src/devices/machine/psion_asic1.cpp @@ -58,20 +58,6 @@ device_memory_interface::space_config_vector psion_asic1_device::memory_space_co } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void psion_asic1_device::device_resolve_objects() -{ - m_int_cb.resolve_safe(); - m_nmi_cb.resolve_safe(); - m_frcovl_cb.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/psion_asic1.h b/src/devices/machine/psion_asic1.h index fea231c6902..09805d725d3 100644 --- a/src/devices/machine/psion_asic1.h +++ b/src/devices/machine/psion_asic1.h @@ -49,7 +49,6 @@ public: uint32_t screen_update_dual(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/psion_asic2.cpp b/src/devices/machine/psion_asic2.cpp index 895aca6943f..26bef222a9a 100644 --- a/src/devices/machine/psion_asic2.cpp +++ b/src/devices/machine/psion_asic2.cpp @@ -35,32 +35,12 @@ psion_asic2_device::psion_asic2_device(const machine_config &mconfig, const char , m_buz_cb(*this) , m_buzvol_cb(*this) , m_dr_cb(*this) - , m_col_cb(*this) - , m_data_r(*this) + , m_col_cb(*this, 0xff) + , m_data_r(*this, 0x00) , m_data_w(*this) { } - -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void psion_asic2_device::device_resolve_objects() -{ - m_int_cb.resolve_safe(); - m_nmi_cb.resolve_safe(); - m_cbusy_cb.resolve_safe(); - m_buz_cb.resolve_safe(); - m_buzvol_cb.resolve_safe(); - m_dr_cb.resolve_safe(); - m_col_cb.resolve_safe(0xff); - m_data_r.resolve_all_safe(0x00); - m_data_w.resolve_all_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/psion_asic2.h b/src/devices/machine/psion_asic2.h index 25dd8c2de81..64111355201 100644 --- a/src/devices/machine/psion_asic2.h +++ b/src/devices/machine/psion_asic2.h @@ -45,7 +45,6 @@ public: void reset_w(int state); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/psion_asic3.cpp b/src/devices/machine/psion_asic3.cpp index 0585fd5e60b..05857a342b6 100644 --- a/src/devices/machine/psion_asic3.cpp +++ b/src/devices/machine/psion_asic3.cpp @@ -29,23 +29,11 @@ DEFINE_DEVICE_TYPE(PSION_ASIC3, psion_asic3_device, "psion_asic3", "Psion ASIC3" psion_asic3_device::psion_asic3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSION_ASIC3, tag, owner, clock) - , m_adin_cb(*this) + , m_adin_cb(*this, 0) { } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void psion_asic3_device::device_resolve_objects() -{ - m_adin_cb.resolve_safe(0); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/psion_asic3.h b/src/devices/machine/psion_asic3.h index 0279f4e8c5d..c2252cc3a19 100644 --- a/src/devices/machine/psion_asic3.h +++ b/src/devices/machine/psion_asic3.h @@ -30,7 +30,6 @@ public: uint8_t data_r(); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/psion_asic5.cpp b/src/devices/machine/psion_asic5.cpp index 219421e1660..2f7cf0b30ea 100644 --- a/src/devices/machine/psion_asic5.cpp +++ b/src/devices/machine/psion_asic5.cpp @@ -53,8 +53,8 @@ psion_asic5_device::psion_asic5_device(const machine_config &mconfig, const char : device_t(mconfig, PSION_ASIC5, tag, owner, clock) , device_serial_interface(mconfig, *this) , m_mode(~uint8_t(0)) - , m_in_a_handler(*this) - , m_in_b_handler(*this) + , m_in_a_handler(*this, 0) + , m_in_b_handler(*this, 0) , m_out_a_handler(*this) , m_out_b_handler(*this) , m_out_c_handler(*this) @@ -81,14 +81,6 @@ void psion_asic5_device::device_validity_check(validity_checker &valid) const void psion_asic5_device::device_start() { - m_in_a_handler.resolve(); - m_in_b_handler.resolve(); - m_out_a_handler.resolve_safe(); - m_out_b_handler.resolve_safe(); - m_out_c_handler.resolve_safe(); - m_out_d_handler.resolve_safe(); - m_out_e_handler.resolve_safe(); - save_item(NAME(m_port_b_counter)); save_item(NAME(m_port_b_latch)); save_item(NAME(m_port_b_mode)); diff --git a/src/devices/machine/psion_asic9.cpp b/src/devices/machine/psion_asic9.cpp index 6ce5f1eed55..d337e27f0be 100644 --- a/src/devices/machine/psion_asic9.cpp +++ b/src/devices/machine/psion_asic9.cpp @@ -52,9 +52,9 @@ psion_asic9_device::psion_asic9_device(const machine_config &mconfig, device_typ , m_rtc_timer(nullptr) , m_buz_cb(*this) , m_col_cb(*this) - , m_port_ab_r(*this) + , m_port_ab_r(*this, 0) , m_port_ab_w(*this) - , m_data_r(*this) + , m_data_r(*this, 0x00) , m_data_w(*this) { } @@ -108,23 +108,6 @@ device_memory_interface::space_config_vector psion_asic9_device::memory_space_co } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void psion_asic9_device::device_resolve_objects() -{ - m_buz_cb.resolve_safe(); - m_col_cb.resolve_safe(); - m_port_ab_r.resolve_safe(0); - m_port_ab_w.resolve_safe(); - m_data_r.resolve_all_safe(0x00); - m_data_w.resolve_all_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/psion_asic9.h b/src/devices/machine/psion_asic9.h index b721e0c09d4..4314e8d00ff 100644 --- a/src/devices/machine/psion_asic9.h +++ b/src/devices/machine/psion_asic9.h @@ -58,7 +58,6 @@ protected: psion_asic9_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/psion_ssd.cpp b/src/devices/machine/psion_ssd.cpp index ef1d0268b5b..8af3cd41876 100644 --- a/src/devices/machine/psion_ssd.cpp +++ b/src/devices/machine/psion_ssd.cpp @@ -88,18 +88,6 @@ psion_ssd_device::~psion_ssd_device() } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void psion_ssd_device::device_resolve_objects() -{ - m_door_cb.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/psion_ssd.h b/src/devices/machine/psion_ssd.h index b80bbb7f392..3d994895dbe 100644 --- a/src/devices/machine/psion_ssd.h +++ b/src/devices/machine/psion_ssd.h @@ -34,7 +34,6 @@ public: protected: // device_t implementation - virtual void device_resolve_objects() override; virtual void device_config_complete() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/pxa255.cpp b/src/devices/machine/pxa255.cpp index eb0bebd206e..482f1d3bf15 100644 --- a/src/devices/machine/pxa255.cpp +++ b/src/devices/machine/pxa255.cpp @@ -38,9 +38,9 @@ pxa255_periphs_device::pxa255_periphs_device(const machine_config &mconfig, cons , m_gpio0_w(*this) , m_gpio1_w(*this) , m_gpio2_w(*this) - , m_gpio0_r(*this) - , m_gpio1_r(*this) - , m_gpio2_r(*this) + , m_gpio0_r(*this, 0xffffffff) + , m_gpio1_r(*this, 0xffffffff) + , m_gpio2_r(*this, 0xffffffff) , m_maincpu(*this, finder_base::DUMMY_TAG) , m_dmadac(*this, "dac%u", 1U) , m_palette(*this, "palette") @@ -1521,13 +1521,6 @@ void pxa255_periphs_device::device_start() m_lcd_framebuffer = make_unique_clear(0x100000); m_samples = make_unique_clear(0x1000); - m_gpio0_w.resolve_safe(); - m_gpio1_w.resolve_safe(); - m_gpio2_w.resolve_safe(); - m_gpio0_r.resolve_safe(0xffffffff); - m_gpio1_r.resolve_safe(0xffffffff); - m_gpio2_r.resolve_safe(0xffffffff); - m_rtc_regs.timer = timer_alloc(FUNC(pxa255_periphs_device::rtc_tick), this); } diff --git a/src/devices/machine/r10696.cpp b/src/devices/machine/r10696.cpp index ce9140ef7d5..bee69b5f993 100644 --- a/src/devices/machine/r10696.cpp +++ b/src/devices/machine/r10696.cpp @@ -47,7 +47,7 @@ DEFINE_DEVICE_TYPE(R10696, r10696_device, "r10696", "Rockwell 10696 GPIO") r10696_device::r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, R10696, tag, owner, clock) , m_io_a(0), m_io_b(0), m_io_c(0) - , m_iord(*this), m_iowr(*this) + , m_iord(*this, 0), m_iowr(*this) { } @@ -56,9 +56,6 @@ r10696_device::r10696_device(const machine_config &mconfig, const char *tag, dev */ void r10696_device::device_start() { - m_iord.resolve(); - m_iowr.resolve(); - save_item(NAME(m_io_a)); save_item(NAME(m_io_b)); save_item(NAME(m_io_c)); diff --git a/src/devices/machine/r10788.cpp b/src/devices/machine/r10788.cpp index 4a8a8161ad5..c3d72d2aa16 100644 --- a/src/devices/machine/r10788.cpp +++ b/src/devices/machine/r10788.cpp @@ -67,8 +67,6 @@ r10788_device::r10788_device(const machine_config &mconfig, const char *tag, dev */ void r10788_device::device_start() { - m_display.resolve(); - save_item(NAME(m_reg)); save_item(NAME(m_ktr)); save_item(NAME(m_kts)); diff --git a/src/devices/machine/ra17xx.cpp b/src/devices/machine/ra17xx.cpp index eebdc134727..7a3b930f0ad 100644 --- a/src/devices/machine/ra17xx.cpp +++ b/src/devices/machine/ra17xx.cpp @@ -55,7 +55,7 @@ DEFINE_DEVICE_TYPE(RA17XX, ra17xx_device, "ra17xx", "Rockwell A17xx") ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RA17XX, tag, owner, clock) , m_enable(false) - , m_iord(*this) + , m_iord(*this, 0) , m_iowr(*this) , m_cpu(*this, finder_base::DUMMY_TAG) { @@ -66,9 +66,6 @@ ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, dev */ void ra17xx_device::device_start() { - m_iord.resolve(); - m_iowr.resolve(); - save_item(NAME(m_line)); } diff --git a/src/devices/machine/ripple_counter.cpp b/src/devices/machine/ripple_counter.cpp index 3c446d8a82c..dc4c9317199 100644 --- a/src/devices/machine/ripple_counter.cpp +++ b/src/devices/machine/ripple_counter.cpp @@ -54,7 +54,7 @@ ripple_counter_device::ripple_counter_device(const machine_config &mconfig, cons device_memory_interface::space_config_vector ripple_counter_device::memory_space_config() const { - if (m_rom_out_cb.isnull()) + if (m_rom_out_cb.isunset()) return space_config_vector(); else return device_rom_interface::memory_space_config(); @@ -73,20 +73,6 @@ void ripple_counter_device::device_validity_check(validity_checker &valid) const } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void ripple_counter_device::device_resolve_objects() -{ - // resolve callbacks - m_count_out_cb.resolve_safe(); - m_rom_out_cb.resolve(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -135,7 +121,7 @@ void ripple_counter_device::set_count(u32 count) { m_count = count; m_count_out_cb(count); - if (!m_rom_out_cb.isnull()) + if (!m_rom_out_cb.isunset()) m_rom_out_cb(read_byte(count)); } diff --git a/src/devices/machine/ripple_counter.h b/src/devices/machine/ripple_counter.h index c77d37657c9..3a623a3ce35 100644 --- a/src/devices/machine/ripple_counter.h +++ b/src/devices/machine/ripple_counter.h @@ -38,13 +38,12 @@ public: u32 count() const { return m_count; } protected: - // device-level overrides + // device_t implementation virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_clock_changed() override; - // device_rom_interface overrides + // device_rom_interface implementation virtual space_config_vector memory_space_config() const override; virtual void rom_bank_post_change() override; diff --git a/src/devices/machine/rp5c01.cpp b/src/devices/machine/rp5c01.cpp index 2b1f99d1aae..0babbedb8eb 100644 --- a/src/devices/machine/rp5c01.cpp +++ b/src/devices/machine/rp5c01.cpp @@ -198,9 +198,6 @@ rp5c01_device::rp5c01_device(const machine_config &mconfig, device_type type, co void rp5c01_device::device_start() { - // resolve callbacks - m_out_alarm_cb.resolve_safe(); - // allocate timers if (clock() > 0) { diff --git a/src/devices/machine/rp5c15.cpp b/src/devices/machine/rp5c15.cpp index a37b779c6fd..75481d24f7f 100644 --- a/src/devices/machine/rp5c15.cpp +++ b/src/devices/machine/rp5c15.cpp @@ -202,10 +202,6 @@ rp5c15_device::rp5c15_device(const machine_config &mconfig, const char *tag, dev void rp5c15_device::device_start() { - // resolve callbacks - m_out_alarm_cb.resolve_safe(); - m_out_clkout_cb.resolve_safe(); - // allocate timers m_clock_timer = timer_alloc(FUNC(rp5c15_device::advance_1hz_clock), this); m_clock_timer->adjust(attotime::from_hz(clock() / 16384), 0, attotime::from_hz(clock() / 16384)); diff --git a/src/devices/machine/rstbuf.cpp b/src/devices/machine/rstbuf.cpp index 9e13d72743a..42a241bd308 100644 --- a/src/devices/machine/rstbuf.cpp +++ b/src/devices/machine/rstbuf.cpp @@ -99,18 +99,6 @@ rst_neg_buffer_device::rst_neg_buffer_device(const machine_config &mconfig, cons } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void rst_buffer_device::device_resolve_objects() -{ - m_int_cb.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/rstbuf.h b/src/devices/machine/rstbuf.h index 0ba54b2054a..b6bdd871ff4 100644 --- a/src/devices/machine/rstbuf.h +++ b/src/devices/machine/rstbuf.h @@ -32,8 +32,7 @@ protected: // device base class constructor rst_buffer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; // synchronization helpers diff --git a/src/devices/machine/rtc4543.cpp b/src/devices/machine/rtc4543.cpp index 671780538c4..977da7e0bff 100644 --- a/src/devices/machine/rtc4543.cpp +++ b/src/devices/machine/rtc4543.cpp @@ -70,8 +70,6 @@ rtc4543_device::rtc4543_device(const machine_config &mconfig, device_type type, void rtc4543_device::device_start() { - m_data_cb.resolve_safe(); - // allocate timers m_clock_timer = timer_alloc(FUNC(rtc4543_device::advance_clock), this); m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp index a705c5d0901..2c442335585 100644 --- a/src/devices/machine/rtc65271.cpp +++ b/src/devices/machine/rtc65271.cpp @@ -464,14 +464,12 @@ void rtc65271_device::field_interrupts() if (m_regs[reg_C] & m_regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF)) { m_regs[reg_C] |= reg_C_IRQF; - if (!m_interrupt_cb.isnull()) - m_interrupt_cb(1); + m_interrupt_cb(1); } else { m_regs[reg_C] &= ~reg_C_IRQF; - if (!m_interrupt_cb.isnull()) - m_interrupt_cb(0); + m_interrupt_cb(0); } } @@ -688,7 +686,6 @@ void rtc65271_device::device_start() m_end_update_timer = timer_alloc(FUNC(rtc65271_device::rtc_end_update_cb), this); m_end_update_timer->adjust(attotime::never); m_SQW_timer = timer_alloc(FUNC(rtc65271_device::rtc_SQW_cb), this); - m_interrupt_cb.resolve(); save_item(NAME(m_regs)); save_item(NAME(m_cur_reg)); diff --git a/src/devices/machine/s2636.cpp b/src/devices/machine/s2636.cpp index 8ad26690bcf..c5663d2ccb1 100644 --- a/src/devices/machine/s2636.cpp +++ b/src/devices/machine/s2636.cpp @@ -206,8 +206,6 @@ void s2636_device::device_start() m_stream = stream_alloc(0, 1, machine().sample_rate()); save_item(NAME(m_sample_cnt)); save_item(NAME(m_sound_lvl)); - - m_intreq_cb.resolve_safe(); } diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index 69649d04db0..0fa124fdebd 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -166,14 +166,14 @@ s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, d , m_cpu(*this, ":maincpu") , m_palette(*this, finder_base::DUMMY_TAG) , m_screen(*this, finder_base::DUMMY_TAG) - , m_pin_r_cb(*this) + , m_pin_r_cb(*this, 0) , m_pin_w_cb(*this) - , m_port_r_cb(*this) + , m_port_r_cb(*this, 0) , m_port_w_cb(*this) , m_scl_w_cb(*this) - , m_sda_r_cb(*this) + , m_sda_r_cb(*this, 1) , m_sda_w_cb(*this) - , m_data_r_cb(*this) + , m_data_r_cb(*this, 0) , m_data_w_cb(*this) , m_flags(0) { diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index a6e02bde885..c6319119914 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -222,18 +222,18 @@ s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, d , m_cpu(*this, ":maincpu") , m_palette(*this, finder_base::DUMMY_TAG) , m_screen(*this, finder_base::DUMMY_TAG) - , m_pin_r_cb(*this) + , m_pin_r_cb(*this, 0) , m_pin_w_cb(*this) - , m_port_r_cb(*this) + , m_port_r_cb(*this, 0) , m_port_w_cb(*this) , m_scl_w_cb(*this) - , m_sda_r_cb(*this) + , m_sda_r_cb(*this, 1) , m_sda_w_cb(*this) - , m_data_r_cb(*this) + , m_data_r_cb(*this, 0) , m_data_w_cb(*this) , m_command_w_cb(*this) , m_address_w_cb(*this) - , m_nand_data_r_cb(*this) + , m_nand_data_r_cb(*this, 0) , m_nand_data_w_cb(*this) , m_flags(0) { diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index b43a191873a..562067879b1 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -237,19 +237,19 @@ s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, d , m_cpu(*this, ":maincpu") , m_palette(*this, finder_base::DUMMY_TAG) , m_screen(*this, finder_base::DUMMY_TAG) - , m_pin_r_cb(*this) + , m_pin_r_cb(*this, 0) , m_pin_w_cb(*this) - , m_port_r_cb(*this) + , m_port_r_cb(*this, 0) , m_port_w_cb(*this) , m_scl_w_cb(*this) - , m_sda_r_cb(*this) + , m_sda_r_cb(*this, 1) , m_sda_w_cb(*this) - , m_data_r_cb(*this) + , m_data_r_cb(*this, 0) , m_data_w_cb(*this) , m_flags(0) , m_command_w_cb(*this) , m_address_w_cb(*this) - , m_nand_data_r_cb(*this) + , m_nand_data_r_cb(*this, 0) , m_nand_data_w_cb(*this) { memset(m_steppingstone, 0, sizeof(m_steppingstone)); diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index be8ae0f56c0..d4deb1f0ceb 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -133,14 +133,7 @@ void S3C24_CLASS_NAME::s3c24xx_reset() int S3C24_CLASS_NAME::iface_core_pin_r(int pin) { - if (!m_pin_r_cb.isnull()) - { - return (m_pin_r_cb)(pin); - } - else - { - return 0; - } + return m_pin_r_cb(pin); } /* LCD Controller */ @@ -1754,25 +1747,15 @@ void S3C24_CLASS_NAME::s3c24xx_gpio_reset() uint32_t S3C24_CLASS_NAME::iface_gpio_port_r(int port, uint32_t mask) { - if (!m_port_r_cb.isnull()) - { - // TO CHECK : masking is not done in any of handlers - // devcb do it automatically so guess is masks are not proper right now - // without masking works fine - return (m_port_r_cb)( port ); //, mask); - } - else - { - return 0; - } + // TO CHECK : masking is not done in any of handlers + // devcb do it automatically so guess is masks are not proper right now + // without masking works fine + return m_port_r_cb( port ); //, mask); } void S3C24_CLASS_NAME::iface_gpio_port_w(int port, uint32_t mask, uint32_t data) { - if (!m_port_w_cb.isnull()) - { - (m_port_w_cb)( port, data, mask ); - } + m_port_w_cb( port, data, mask ); } uint16_t S3C24_CLASS_NAME::s3c24xx_gpio_get_mask( uint32_t con, int val) @@ -2228,22 +2211,17 @@ void S3C24_CLASS_NAME::s3c24xx_iic_reset() void S3C24_CLASS_NAME::iface_i2c_scl_w( int state) { - if (!m_scl_w_cb.isnull()) - m_scl_w_cb(state); + m_scl_w_cb(state); } void S3C24_CLASS_NAME::iface_i2c_sda_w(int state) { - if (!m_sda_w_cb.isnull()) - m_sda_w_cb(state); + m_sda_w_cb(state); } int S3C24_CLASS_NAME::iface_i2c_sda_r() { - if (!m_sda_r_cb.isnull()) - return m_sda_r_cb(); - else - return 1; + return m_sda_r_cb(); } void S3C24_CLASS_NAME::i2c_send_start() @@ -2447,8 +2425,7 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_timer_exp ) void S3C24_CLASS_NAME::iface_i2s_data_w(int ch, uint16_t data) { - if (!m_data_w_cb.isnull()) - (m_data_w_cb)(ch, data, 0); + m_data_w_cb(ch, data, 0); } void S3C24_CLASS_NAME::s3c24xx_iis_start() @@ -2598,21 +2575,14 @@ void S3C24_CLASS_NAME::s3c24xx_adc_reset() uint32_t S3C24_CLASS_NAME::iface_adc_data_r(int ch) { - if (!m_data_r_cb.isnull()) - { - int offs = ch; + int offs = ch; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) - if (BIT(m_adc.regs.adctsc, 2) != 0) - { - offs += 2; - } -#endif - return m_data_r_cb(offs, 0); - } - else + if (BIT(m_adc.regs.adctsc, 2) != 0) { - return 0; + offs += 2; } +#endif + return m_data_r_cb(offs, 0); } uint32_t S3C24_CLASS_NAME::s3c24xx_adc_r(offs_t offset, uint32_t mem_mask) @@ -2811,32 +2781,22 @@ void S3C24_CLASS_NAME::s3c24xx_nand_reset() void S3C24_CLASS_NAME::iface_nand_command_w(uint8_t data) { - if (!m_command_w_cb.isnull()) - { - m_command_w_cb(0, data, 0xff); - } + m_command_w_cb(0, data, 0xff); } void S3C24_CLASS_NAME::iface_nand_address_w(uint8_t data) { - if (!m_address_w_cb.isnull()) - { - m_address_w_cb(0, data, 0xff); - } + m_address_w_cb(0, data, 0xff); } uint8_t S3C24_CLASS_NAME::iface_nand_data_r() { - if (!m_nand_data_r_cb.isnull()) - return m_nand_data_r_cb(0, 0xff); - else - return 0; + return m_nand_data_r_cb(0, 0xff); } void S3C24_CLASS_NAME::iface_nand_data_w(uint8_t data) { - if (!m_nand_data_w_cb.isnull()) - m_nand_data_w_cb(0, data, 0xff); + m_nand_data_w_cb(0, data, 0xff); } void S3C24_CLASS_NAME::nand_update_mecc(uint8_t *ecc, int pos, uint8_t data) @@ -3250,21 +3210,6 @@ void S3C24_CLASS_NAME::s3c24xx_device_reset() void S3C24_CLASS_NAME::s3c24xx_device_start() { LOGMASKED(LOG_RESET, "s3c24xx device start\n"); - m_pin_r_cb.resolve(); - m_pin_w_cb.resolve_safe(); - m_port_r_cb.resolve(); - m_port_w_cb.resolve(); - m_scl_w_cb.resolve(); - m_sda_r_cb.resolve(); - m_sda_w_cb.resolve(); - m_data_r_cb.resolve(); - m_data_w_cb.resolve(); -#if !defined(DEVICE_S3C2400) - m_command_w_cb.resolve(); - m_address_w_cb.resolve(); - m_nand_data_r_cb.resolve(); - m_nand_data_w_cb.resolve(); -#endif for (int i = 0; i < 5; i++) m_pwm.timer[i] = timer_alloc(FUNC(S3C24_CLASS_NAME::s3c24xx_pwm_timer_exp), this); for (auto & elem : m_dma) diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index dc5e52c31f0..6d625557933 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -227,12 +227,12 @@ s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, S3C44B0, tag, owner, clock) , device_video_interface(mconfig, *this) , m_cpu(*this, finder_base::DUMMY_TAG) - , m_port_r_cb(*this) + , m_port_r_cb(*this, 0) , m_port_w_cb(*this) , m_scl_w_cb(*this) - , m_sda_r_cb(*this) + , m_sda_r_cb(*this, 0) , m_sda_w_cb(*this) - , m_data_r_cb(*this) + , m_data_r_cb(*this, 0) , m_data_w_cb(*this) { memset(&m_irq, 0, sizeof(s3c44b0_irq_t)); @@ -257,14 +257,6 @@ s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, d void s3c44b0_device::device_start() { - m_port_r_cb.resolve(); - m_port_w_cb.resolve(); - m_scl_w_cb.resolve(); - m_sda_r_cb.resolve(); - m_sda_w_cb.resolve(); - m_data_r_cb.resolve_safe(0); - m_data_w_cb.resolve(); - m_cpu->space(AS_PROGRAM).cache(m_cache); for (int i = 0; i < 6; i++) m_pwm.timer[i] = timer_alloc(FUNC(s3c44b0_device::pwm_timer_exp), this); @@ -1220,22 +1212,17 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::pwm_timer_exp ) inline void s3c44b0_device::iface_i2c_scl_w(int state) { - if (!m_scl_w_cb.isnull()) - (m_scl_w_cb)( state); + m_scl_w_cb(state); } inline void s3c44b0_device::iface_i2c_sda_w(int state) { - if (!m_sda_w_cb.isnull()) - (m_sda_w_cb)( state); + m_sda_w_cb(state); } inline int s3c44b0_device::iface_i2c_sda_r() { - if (!m_sda_r_cb.isnull()) - return (m_sda_r_cb)(); - else - return 0; + return m_sda_r_cb(); } void s3c44b0_device::i2c_send_start() @@ -1442,16 +1429,12 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::iic_timer_exp ) inline uint32_t s3c44b0_device::iface_gpio_port_r(int port) { - if (!m_port_r_cb.isnull()) - return (m_port_r_cb)(port); - else - return 0; + return m_port_r_cb(port); } inline void s3c44b0_device::iface_gpio_port_w(int port, uint32_t data) { - if (!m_port_w_cb.isnull()) - (m_port_w_cb)(port, data, 0xffff); + m_port_w_cb(port, data, 0xffff); } uint32_t s3c44b0_device::gpio_r(offs_t offset, uint32_t mem_mask) @@ -1880,8 +1863,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::sio_timer_exp ) inline void s3c44b0_device::iface_i2s_data_w(int ch, uint16_t data) { - if (!m_data_w_cb.isnull()) - (m_data_w_cb)(ch, data, 0); + m_data_w_cb(ch, data, 0); } void s3c44b0_device::iis_start() diff --git a/src/devices/machine/s_smp.cpp b/src/devices/machine/s_smp.cpp index 9be87af48d5..957f64dbe7a 100644 --- a/src/devices/machine/s_smp.cpp +++ b/src/devices/machine/s_smp.cpp @@ -61,7 +61,7 @@ s_smp_device::s_smp_device(const machine_config &mconfig, const char *tag, devic : spc700_device(mconfig, S_SMP, tag, owner, clock, address_map_constructor(FUNC(s_smp_device::internal_map), this)) , m_data_config("data", ENDIANNESS_LITTLE, 8, 16) , m_ipl_region(*this, "sound_ipl") - , m_dsp_io_r_cb(*this) + , m_dsp_io_r_cb(*this, 0) , m_dsp_io_w_cb(*this) { } @@ -83,9 +83,6 @@ const tiny_rom_entry *s_smp_device::device_rom_region() const void s_smp_device::device_start() { - m_dsp_io_r_cb.resolve_safe(0); - m_dsp_io_w_cb.resolve_safe(); - space(AS_DATA).specific(m_data); space(AS_DATA).cache(m_dcache); diff --git a/src/devices/machine/sa1110.cpp b/src/devices/machine/sa1110.cpp index baa26160441..2f513abad7f 100644 --- a/src/devices/machine/sa1110.cpp +++ b/src/devices/machine/sa1110.cpp @@ -2445,10 +2445,6 @@ void sa1110_periphs_device::device_start() save_item(STRUCT_MEMBER(m_dma_regs, dbs)); save_item(STRUCT_MEMBER(m_dma_regs, dbt)); save_item(NAME(m_dma_active_mask)); - - m_gpio_out.resolve_all_safe(); - m_ssp_out.resolve_safe(); - m_uart3_tx_out.resolve_safe(); } void sa1110_periphs_device::device_reset() diff --git a/src/devices/machine/sa1111.cpp b/src/devices/machine/sa1111.cpp index d7f970f11c5..ac2b018c864 100644 --- a/src/devices/machine/sa1111.cpp +++ b/src/devices/machine/sa1111.cpp @@ -2087,13 +2087,6 @@ void sa1111_device::device_start() m_ssp_regs.rx_timer = timer_alloc(FUNC(sa1111_device::ssp_rx_callback), this); m_ssp_regs.tx_timer = timer_alloc(FUNC(sa1111_device::ssp_tx_callback), this); - - m_irq_out.resolve_safe(); - m_gpio_out.resolve_all_safe(); - m_ssp_out.resolve_safe(); - m_l3_addr_out.resolve_safe(); - m_l3_data_out.resolve_safe(); - m_i2s_out.resolve_safe(); } void sa1111_device::device_reset() diff --git a/src/devices/machine/saa1043.cpp b/src/devices/machine/saa1043.cpp index 053945c9a7e..099041209a8 100644 --- a/src/devices/machine/saa1043.cpp +++ b/src/devices/machine/saa1043.cpp @@ -31,8 +31,6 @@ void saa1043_device::device_start() m_h = attotime::from_ticks(320, clock() * 2); m_line_count = s_line_counts[m_type]; - m_outputs.resolve_all_safe(); - m_timers[OUT_V2] = timer_alloc(FUNC(saa1043_device::toggle_v2), this); m_timers[OUT_V2]->adjust(m_h * 6, 1); } diff --git a/src/devices/machine/saa7191.cpp b/src/devices/machine/saa7191.cpp index 1c8540d2ee3..61c16feba67 100644 --- a/src/devices/machine/saa7191.cpp +++ b/src/devices/machine/saa7191.cpp @@ -28,8 +28,8 @@ DEFINE_DEVICE_TYPE(SAA7191, saa7191_device, "saa7191", "Philips SAA7191 DMSD") saa7191_device::saa7191_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SAA7191, tag, owner, clock) - , m_chr_in(*this) - , m_cvbs_in(*this) + , m_chr_in(*this, 0) + , m_cvbs_in(*this, 0) , m_y_out(*this) , m_uv_out(*this) , m_hs_out(*this) @@ -45,14 +45,6 @@ void saa7191_device::device_start() save_item(NAME(m_i2c_read_addr)); save_item(NAME(m_i2c_subaddr)); save_item(NAME(m_i2c_state)); - - m_chr_in.resolve_safe(0); - m_cvbs_in.resolve_safe(0); - - m_y_out.resolve_safe(); - m_uv_out.resolve_safe(); - m_hs_out.resolve_safe(); - m_vs_out.resolve_safe(); } void saa7191_device::device_reset() diff --git a/src/devices/machine/scc2698b.cpp b/src/devices/machine/scc2698b.cpp index 866c5d67db0..4fb7b2b3a3f 100644 --- a/src/devices/machine/scc2698b.cpp +++ b/src/devices/machine/scc2698b.cpp @@ -369,16 +369,6 @@ scc2698b_device::scc2698b_device(const machine_config &mconfig, const char *tag, void scc2698b_device::device_start() { - write_intr_A.resolve_safe(); - write_intr_B.resolve_safe(); - write_intr_C.resolve_safe(); - write_intr_D.resolve_safe(); - - write_tx.resolve_all_safe(); - write_mpp1.resolve_all_safe(); - write_mpp2.resolve_all_safe(); - write_mpo.resolve_all_safe(); - for (int i = 0; i < 8; i++) { m_channel[i]->channel_port = i; diff --git a/src/devices/machine/scc66470.cpp b/src/devices/machine/scc66470.cpp index b516a6056a0..b723ed2acd4 100644 --- a/src/devices/machine/scc66470.cpp +++ b/src/devices/machine/scc66470.cpp @@ -130,12 +130,12 @@ DEFINE_DEVICE_TYPE(SCC66470, scc66470_device, "scc66470", "Philips SCC66470") // scc66470_device - constructor //------------------------------------------------- -scc66470_device::scc66470_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, SCC66470, tag, owner, clock), - device_memory_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_irqcallback(*this), - m_space_config("videoram", ENDIANNESS_BIG, 16, 21, 0, address_map_constructor(FUNC(scc66470_device::scc66470_vram), this)) +scc66470_device::scc66470_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, SCC66470, tag, owner, clock), + device_memory_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_irqcallback(*this), + m_space_config("videoram", ENDIANNESS_BIG, 16, 21, 0, address_map_constructor(FUNC(scc66470_device::scc66470_vram), this)) { } @@ -145,8 +145,6 @@ scc66470_device::scc66470_device(const machine_config &mconfig, const char *tag, void scc66470_device::device_start() { - m_irqcallback.resolve_safe(); - m_ica_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scc66470_device::process_ica), this)); m_dca_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scc66470_device::process_dca), this)); @@ -341,11 +339,7 @@ uint8_t scc66470_device::csr_r(offs_t offset) if(!machine().side_effects_disabled()) { m_csr_r &= ~(CSR_R_IT1 | CSR_R_IT2); - - if(!m_irqcallback.isnull()) - { - m_irqcallback(CLEAR_LINE); - } + m_irqcallback(CLEAR_LINE); } int scanline = screen().vpos(); @@ -680,10 +674,7 @@ TIMER_CALLBACK_MEMBER(scc66470_device::process_ica) if(!BIT(CSR_REG, CSR_DI1)) { - if(!m_irqcallback.isnull()) - { - m_irqcallback(ASSERT_LINE); - } + m_irqcallback(ASSERT_LINE); } break; @@ -786,10 +777,7 @@ TIMER_CALLBACK_MEMBER(scc66470_device::process_dca) if(!BIT(CSR_REG, CSR_DI1)) { - if(!m_irqcallback.isnull()) - { - m_irqcallback(ASSERT_LINE); - } + m_irqcallback(ASSERT_LINE); } break; diff --git a/src/devices/machine/scc68070.cpp b/src/devices/machine/scc68070.cpp index 1ba24f46597..665ecd16979 100644 --- a/src/devices/machine/scc68070.cpp +++ b/src/devices/machine/scc68070.cpp @@ -240,15 +240,15 @@ void scc68070_device::cpu_space_map(address_map &map) scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scc68070_base_device(mconfig, tag, owner, clock, SCC68070, address_map_constructor(FUNC(scc68070_device::internal_map), this)) - , m_iack2_callback(*this) - , m_iack4_callback(*this) - , m_iack5_callback(*this) - , m_iack7_callback(*this) + , m_iack2_callback(*this, autovector(2)) + , m_iack4_callback(*this, autovector(4)) + , m_iack5_callback(*this, autovector(5)) + , m_iack7_callback(*this, autovector(7)) , m_uart_tx_callback(*this) , m_uart_rtsn_callback(*this) , m_i2c_scl_callback(*this) , m_i2c_sdaw_callback(*this) - , m_i2c_sdar_callback(*this) + , m_i2c_sdar_callback(*this, 0) , m_ipl(0) , m_in2_line(CLEAR_LINE) , m_in4_line(CLEAR_LINE) @@ -260,27 +260,6 @@ scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(scc68070_device::cpu_space_map), this); } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void scc68070_device::device_resolve_objects() -{ - scc68070_base_device::device_resolve_objects(); - - m_iack2_callback.resolve_safe(autovector(2)); - m_iack4_callback.resolve_safe(autovector(4)); - m_iack5_callback.resolve_safe(autovector(5)); - m_iack7_callback.resolve_safe(autovector(7)); - m_uart_tx_callback.resolve_safe(); - m_uart_rtsn_callback.resolve_safe(); - m_i2c_scl_callback.resolve_safe(); - m_i2c_sdaw_callback.resolve_safe(); - m_i2c_sdar_callback.resolve_safe(0); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/scc68070.h b/src/devices/machine/scc68070.h index b954a3f2b79..a10f37b1890 100644 --- a/src/devices/machine/scc68070.h +++ b/src/devices/machine/scc68070.h @@ -190,12 +190,11 @@ public: dma_regs_t& dma() { return m_dma; } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // device_execute_interface overrides + // device_execute_interface implementation virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 2 - 1) / 2; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 2); } diff --git a/src/devices/machine/scn_pci.cpp b/src/devices/machine/scn_pci.cpp index d21e45868ca..8a4b1fec9fd 100644 --- a/src/devices/machine/scn_pci.cpp +++ b/src/devices/machine/scn_pci.cpp @@ -260,42 +260,17 @@ scn2641_device::scn2641_device(const machine_config &mconfig, const char *tag, d void scn2641_device::device_validity_check(validity_checker &valid) const { - if (!m_dtr_callback.isnull()) + if (!m_dtr_callback.isunset()) osd_printf_error("Nonexistent DTR output configured on SCN2641\n"); - if (!m_txemt_dschg_callback.isnull()) + if (!m_txemt_dschg_callback.isunset()) osd_printf_error("Nonexistent TxEMT/DSCHG output configured on SCN2641 (use INTR instead)\n"); - if (!m_txrdy_callback.isnull()) + if (!m_txrdy_callback.isunset()) osd_printf_error("Nonexistent TxRDY output configured on SCN2641 (use INTR instead)\n"); - if (!m_rxrdy_callback.isnull()) + if (!m_rxrdy_callback.isunset()) osd_printf_error("Nonexistent RxRDY output configured on SCN2641 (use INTR instead)\n"); } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void scn_pci_device::device_resolve_objects() -{ - m_dtr_callback.resolve_safe(); - m_rts_callback.resolve_safe(); - m_txemt_dschg_callback.resolve_safe(); - m_txc_callback.resolve_safe(); - m_rxc_callback.resolve_safe(); - m_txd_callback.resolve_safe(); - m_txrdy_callback.resolve_safe(); - m_rxrdy_callback.resolve_safe(); -} - -void scn2641_device::device_resolve_objects() -{ - scn_pci_device::device_resolve_objects(); - m_intr_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/scn_pci.h b/src/devices/machine/scn_pci.h index 0eca08da6be..de3a5c712b6 100644 --- a/src/devices/machine/scn_pci.h +++ b/src/devices/machine/scn_pci.h @@ -102,8 +102,7 @@ protected: // construction/destruction scn_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, const u16 *br_div, bool is_enhanced, bool is_aci); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -260,9 +259,8 @@ public: int intr_r() { return (m_status & 0x07) != 0 ? 0 : 1; } protected: - // device-level overrides + // device_t implementation virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_resolve_objects() override; // scn_pci_device overrides virtual void set_rxrdy(bool state) override; diff --git a/src/devices/machine/scnxx562.cpp b/src/devices/machine/scnxx562.cpp index 487c8065fce..e49c586d00c 100644 --- a/src/devices/machine/scnxx562.cpp +++ b/src/devices/machine/scnxx562.cpp @@ -206,23 +206,6 @@ void duscc_device::device_start() { LOG("%s\n", FUNCNAME); - // resolve callbacks - m_out_txda_cb.resolve_safe(); - m_out_dtra_cb.resolve_safe(); - m_out_rtsa_cb.resolve_safe(); - m_out_synca_cb.resolve_safe(); - m_out_rtxca_cb.resolve_safe(); - m_out_trxca_cb.resolve_safe(); - - m_out_txdb_cb.resolve_safe(); - m_out_dtrb_cb.resolve_safe(); - m_out_rtsb_cb.resolve_safe(); - m_out_syncb_cb.resolve_safe(); - m_out_rtxcb_cb.resolve_safe(); - m_out_trxcb_cb.resolve_safe(); - - m_out_int_cb.resolve_safe(); - // state saving - stuff with runtime values save_item(NAME(m_int_state)); save_item(NAME(m_gsr)); diff --git a/src/devices/machine/scoop.cpp b/src/devices/machine/scoop.cpp index 5c97c11a47e..6f2151cb19a 100644 --- a/src/devices/machine/scoop.cpp +++ b/src/devices/machine/scoop.cpp @@ -27,8 +27,6 @@ scoop_device::scoop_device(const machine_config &mconfig, const char *tag, devic void scoop_device::device_start() { - m_gpio_out.resolve_all_safe(); - save_item(NAME(m_gpwr)); save_item(NAME(m_gpio_in_latch)); save_item(NAME(m_gpcr)); diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp index c7786a0c4d5..8860d5394a9 100644 --- a/src/devices/machine/sensorboard.cpp +++ b/src/devices/machine/sensorboard.cpp @@ -77,8 +77,8 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char m_inp_ui(*this, "UI"), m_inp_conf(*this, "CONF"), m_custom_init_cb(*this), - m_custom_sensor_cb(*this), - m_custom_spawn_cb(*this), + m_custom_sensor_cb(*this, 0), + m_custom_spawn_cb(*this, 0), m_custom_output_cb(*this) { m_nvram_auto = false; @@ -101,13 +101,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char void sensorboard_device::device_start() { - // resolve handlers - m_custom_init_cb.resolve_safe(); - m_custom_sensor_cb.resolve_safe(0); - m_custom_spawn_cb.resolve(); - m_custom_output_cb.resolve(); - - if (m_custom_output_cb.isnull()) + if (m_custom_output_cb.isunset()) { m_out_piece.resolve(); m_out_pui.resolve(); @@ -322,7 +316,7 @@ void sensorboard_device::refresh() if (machine().phase() < machine_phase::RESET) return; - bool custom_out = !m_custom_output_cb.isnull(); + bool custom_out = !m_custom_output_cb.isunset(); // output spawn icons for (int i = 0; i < m_maxspawn; i++) @@ -511,7 +505,7 @@ INPUT_CHANGED_MEMBER(sensorboard_device::ui_spawn) m_handpos = -1; // optional callback to change piece id - if (!m_custom_spawn_cb.isnull()) + if (!m_custom_spawn_cb.isunset()) m_hand = m_custom_spawn_cb(pos); refresh(); diff --git a/src/devices/machine/sis5513_ide.cpp b/src/devices/machine/sis5513_ide.cpp index 99a9541f80e..de0167fc5e7 100644 --- a/src/devices/machine/sis5513_ide.cpp +++ b/src/devices/machine/sis5513_ide.cpp @@ -131,9 +131,6 @@ void sis5513_ide_device::device_start() { pci_device::device_start(); - m_irq_pri_callback.resolve(); - m_irq_sec_callback.resolve(); - add_map(8, M_IO, FUNC(sis5513_ide_device::ide1_command_map)); add_map(4, M_IO, FUNC(sis5513_ide_device::ide1_control_map)); add_map(8, M_IO, FUNC(sis5513_ide_device::ide2_command_map)); diff --git a/src/devices/machine/sis950_lpc.cpp b/src/devices/machine/sis950_lpc.cpp index e4bf3a35fbe..1a74645e379 100644 --- a/src/devices/machine/sis950_lpc.cpp +++ b/src/devices/machine/sis950_lpc.cpp @@ -72,13 +72,6 @@ sis950_lpc_device::sis950_lpc_device(const machine_config &mconfig, const char * { } -void sis950_lpc_device::device_start() -{ - pci_device::device_start(); - - m_fast_reset_cb.resolve_safe(); -} - void sis950_lpc_device::device_reset() { pci_device::device_reset(); diff --git a/src/devices/machine/sis950_lpc.h b/src/devices/machine/sis950_lpc.h index 167a7342218..8f4047beb28 100644 --- a/src/devices/machine/sis950_lpc.h +++ b/src/devices/machine/sis950_lpc.h @@ -54,7 +54,6 @@ public: auto fast_reset_cb() { return m_fast_reset_cb.bind(); } protected: - virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/machine/smartboard.cpp b/src/devices/machine/smartboard.cpp index ac18fd34534..4c8f85a2df1 100644 --- a/src/devices/machine/smartboard.cpp +++ b/src/devices/machine/smartboard.cpp @@ -83,12 +83,9 @@ tasc_sb30_device::tasc_sb30_device(const machine_config &mconfig, const char *ta void tasc_sb30_device::device_start() { - m_led_out.resolve(); - if (m_led_out.isnull()) + if (m_led_out.isunset()) m_out_leds.resolve(); - m_data_out.resolve_safe(); - // zerofill m_data0 = 0; m_data1 = 0; @@ -304,7 +301,7 @@ void tasc_sb30_device::data0_w(int state) else { // output board led(s) - if (m_led_out.isnull()) + if (m_led_out.isunset()) m_out_leds[m_pos & 7][m_pos >> 3 & 7] = m_data1; else m_led_out(m_pos & 0x3f, m_data1); diff --git a/src/devices/machine/smc91c9x.cpp b/src/devices/machine/smc91c9x.cpp index daf0891cc11..9c381ba64f9 100644 --- a/src/devices/machine/smc91c9x.cpp +++ b/src/devices/machine/smc91c9x.cpp @@ -83,8 +83,6 @@ void smc91c9x_device::device_start() // TX timer m_tx_poll = timer_alloc(FUNC(smc91c9x_device::tx_poll), this); - m_irq_handler.resolve_safe(); - // These registers don't get cleared on reset m_reg[B1_CONFIG] = 0x0030; m_regmask[B1_CONFIG] = 0x17c6; m_reg[B1_BASE] = 0x1866; m_regmask[B1_BASE] = 0xfffe; diff --git a/src/devices/machine/smioc.cpp b/src/devices/machine/smioc.cpp index 06c3e03adb1..194d885c196 100644 --- a/src/devices/machine/smioc.cpp +++ b/src/devices/machine/smioc.cpp @@ -201,11 +201,9 @@ smioc_device::smioc_device(const machine_config &mconfig, const char *tag, devic m_smioc_ram(*this, "smioc_ram"), m_dma_timer(nullptr), m_451_timer(nullptr), - m_m68k_r_cb(*this), + m_m68k_r_cb(*this, 0), m_m68k_w_cb(*this) { - - } //------------------------------------------------- @@ -217,10 +215,6 @@ void smioc_device::device_start() m_dma_timer = timer_alloc(FUNC(smioc_device::raise_drq), this); m_451_timer = timer_alloc(FUNC(smioc_device::raise_int1), this); - /* Resolve callbacks */ - m_m68k_r_cb.resolve_safe(0); - m_m68k_w_cb.resolve_safe(); - m_451_timer->adjust(attotime::from_msec(200), 0, attotime::from_msec(200)); } diff --git a/src/devices/machine/smpc.cpp b/src/devices/machine/smpc.cpp index 69ec5b762f4..d8a83a6bfd5 100644 --- a/src/devices/machine/smpc.cpp +++ b/src/devices/machine/smpc.cpp @@ -217,8 +217,8 @@ smpc_hle_device::smpc_hle_device(const machine_config &mconfig, const char *tag, , m_sysres(*this) , m_syshalt(*this) , m_dotsel(*this) - , m_pdr1_read(*this) - , m_pdr2_read(*this) + , m_pdr1_read(*this, 0xff) + , m_pdr2_read(*this, 0xff) , m_pdr1_write(*this) , m_pdr2_write(*this) , m_irq_line(*this) @@ -251,20 +251,6 @@ void smpc_hle_device::device_start() // (-> call the RTC / Language select menu for Saturn) m_mini_nvram->set_base(&m_smem, 5); - m_mshres.resolve_safe(); - m_mshnmi.resolve_safe(); - m_sshres.resolve_safe(); - m_sndres.resolve_safe(); - m_sysres.resolve_safe(); - m_syshalt.resolve_safe(); - m_dotsel.resolve_safe(); - m_irq_line.resolve_safe(); - - m_pdr1_read.resolve_safe(0xff); - m_pdr2_read.resolve_safe(0xff); - m_pdr1_write.resolve_safe(); - m_pdr2_write.resolve_safe(); - save_item(NAME(m_sf)); save_item(NAME(m_sr)); save_item(NAME(m_ddr1)); diff --git a/src/devices/machine/spg110.cpp b/src/devices/machine/spg110.cpp index 87dd77ad338..c31ca87ac7a 100644 --- a/src/devices/machine/spg110.cpp +++ b/src/devices/machine/spg110.cpp @@ -26,10 +26,10 @@ spg110_device::spg110_device(const machine_config &mconfig, device_type type, co m_porta_out(*this), m_portb_out(*this), m_portc_out(*this), - m_porta_in(*this), - m_portb_in(*this), - m_portc_in(*this), - m_adc_in(*this), + m_porta_in(*this, 0), + m_portb_in(*this, 0), + m_portc_in(*this, 0), + m_adc_in(*this, 0x0fff), m_chip_sel(*this), m_is_spiderman(false) { @@ -168,22 +168,9 @@ void spg110_device::internal_map(address_map &map) } -void spg110_device::device_start() -{ - unsp_device::device_start(); - - m_porta_out.resolve_safe(); - m_portb_out.resolve_safe(); - m_portc_out.resolve_safe(); - m_porta_in.resolve_safe(0); - m_portb_in.resolve_safe(0); - m_portc_in.resolve_safe(0); - m_adc_in.resolve_all_safe(0x0fff); - m_chip_sel.resolve_safe(); -} - void spg110_device::device_reset() { unsp_device::device_reset(); + m_spg_video->set_video_irq_spidman(m_is_spiderman); } diff --git a/src/devices/machine/spg110.h b/src/devices/machine/spg110.h index ec0368a9ecc..f555c4ac736 100644 --- a/src/devices/machine/spg110.h +++ b/src/devices/machine/spg110.h @@ -47,7 +47,6 @@ protected: void internal_map(address_map &map); - virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/devices/machine/spg110_video.cpp b/src/devices/machine/spg110_video.cpp index cf14b9dc215..ff7eab802e3 100644 --- a/src/devices/machine/spg110_video.cpp +++ b/src/devices/machine/spg110_video.cpp @@ -697,8 +697,6 @@ void spg110_video_device::device_start() save_item(NAME(m_bg_scrollx)); save_item(NAME(m_bg_scrolly)); save_item(NAME(m_2036_scroll)); - - m_video_irq_cb.resolve(); } void spg110_video_device::device_reset() diff --git a/src/devices/machine/spg290_cdservo.cpp b/src/devices/machine/spg290_cdservo.cpp index f55cdd300be..02a65e5be72 100644 --- a/src/devices/machine/spg290_cdservo.cpp +++ b/src/devices/machine/spg290_cdservo.cpp @@ -33,9 +33,6 @@ spg290_cdservo_device::spg290_cdservo_device(const machine_config &mconfig, cons void spg290_cdservo_device::device_start() { - m_irq_cb.resolve_safe(); - m_space_write_cb.resolve_safe(); - m_cdtimer = timer_alloc(FUNC(spg290_cdservo_device::cd_update), this); m_dsp_memory = std::make_unique(0x10000); diff --git a/src/devices/machine/spg290_i2c.cpp b/src/devices/machine/spg290_i2c.cpp index e360a451736..41eaaf58437 100644 --- a/src/devices/machine/spg290_i2c.cpp +++ b/src/devices/machine/spg290_i2c.cpp @@ -16,16 +16,13 @@ DEFINE_DEVICE_TYPE(SPG290_I2C, spg290_i2c_device, "spg290_i2c", "SPG290 I2C") spg290_i2c_device::spg290_i2c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPG290_I2C, tag, owner, clock) , m_irq_cb(*this) - , m_i2c_read_cb(*this) + , m_i2c_read_cb(*this, 0) , m_i2c_write_cb(*this) { } void spg290_i2c_device::device_start() { - m_irq_cb.resolve_safe(); - m_i2c_read_cb.resolve_safe(0); - m_i2c_write_cb.resolve_safe(); m_i2c_timer = timer_alloc(FUNC(spg290_i2c_device::i2c_update), this); save_item(NAME(m_config)); diff --git a/src/devices/machine/spg290_ppu.cpp b/src/devices/machine/spg290_ppu.cpp index 37f0def0f84..fde5b7338a0 100644 --- a/src/devices/machine/spg290_ppu.cpp +++ b/src/devices/machine/spg290_ppu.cpp @@ -27,7 +27,7 @@ spg290_ppu_device::spg290_ppu_device(const machine_config &mconfig, const char * , m_voffset_ram(*this, "voffset_ram") , m_sprite_ram(*this, "sprite_ram") , m_vblank_irq_cb(*this) - , m_space_read_cb(*this) + , m_space_read_cb(*this, 0) { } @@ -49,9 +49,6 @@ void spg290_ppu_device::map(address_map &map) void spg290_ppu_device::device_start() { - m_vblank_irq_cb.resolve_safe(); - m_space_read_cb.resolve_safe(0); - save_item(NAME(m_control)); save_item(NAME(m_sprite_control)); save_item(NAME(m_irq_control)); diff --git a/src/devices/machine/spg290_timer.cpp b/src/devices/machine/spg290_timer.cpp index ce3754079d3..f0c0867a612 100644 --- a/src/devices/machine/spg290_timer.cpp +++ b/src/devices/machine/spg290_timer.cpp @@ -22,7 +22,6 @@ spg290_timer_device::spg290_timer_device(const machine_config &mconfig, const ch void spg290_timer_device::device_start() { - m_irq_cb.resolve_safe(); m_tick_timer = timer_alloc(FUNC(spg290_timer_device::timer_update), this); save_item(NAME(m_enabled)); diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 2edac0a8dcf..09e0e0c6f39 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -30,14 +30,14 @@ spg2xx_device::spg2xx_device(const machine_config &mconfig, device_type type, co m_porta_out(*this), m_portb_out(*this), m_portc_out(*this), - m_porta_in(*this), - m_portb_in(*this), - m_portc_in(*this), - m_adc_in(*this), - m_guny_in(*this), - m_gunx_in(*this), + m_porta_in(*this, 0), + m_portb_in(*this, 0), + m_portc_in(*this, 0), + m_adc_in(*this, 0x0fff), + m_guny_in(*this, 0), + m_gunx_in(*this, 0), m_i2c_w(*this), - m_i2c_r(*this), + m_i2c_r(*this, 0), m_uart_tx(*this), m_spi_tx(*this), m_chip_sel(*this), @@ -86,21 +86,6 @@ void spg2xx_device::device_start() { unsp_device::device_start(); - m_porta_out.resolve_safe(); - m_portb_out.resolve_safe(); - m_portc_out.resolve_safe(); - m_porta_in.resolve_safe(0); - m_portb_in.resolve_safe(0); - m_portc_in.resolve_safe(0); - m_adc_in.resolve_all_safe(0x0fff); - m_guny_in.resolve_safe(0); - m_gunx_in.resolve_safe(0); - m_i2c_w.resolve_safe(); - m_i2c_r.resolve_safe(0); - m_uart_tx.resolve_safe(); - m_spi_tx.resolve_safe(); - m_chip_sel.resolve_safe(); - save_item(NAME(m_sprite_limit)); save_item(NAME(m_pal_flag)); save_item(NAME(m_fiq_vector)); diff --git a/src/devices/machine/spg2xx_audio.cpp b/src/devices/machine/spg2xx_audio.cpp index 0fdd32b4fae..2cf0fd822d8 100644 --- a/src/devices/machine/spg2xx_audio.cpp +++ b/src/devices/machine/spg2xx_audio.cpp @@ -50,7 +50,7 @@ static FILE *adpcm_file[16] = {}; spg2xx_audio_device::spg2xx_audio_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_sound_interface(mconfig, *this) - , m_space_read_cb(*this) + , m_space_read_cb(*this, 0) , m_irq_cb(*this) , m_ch_irq_cb(*this) { @@ -110,10 +110,6 @@ void spg2xx_audio_device::device_start() m_channel_irq[i] = timer_alloc(FUNC(spg2xx_audio_device::irq_tick), this); m_channel_irq[i]->adjust(attotime::never); } - - m_space_read_cb.resolve_safe(0); - m_irq_cb.resolve(); - m_ch_irq_cb.resolve(); } void spg2xx_audio_device::device_reset() diff --git a/src/devices/machine/spg2xx_io.cpp b/src/devices/machine/spg2xx_io.cpp index 13fa8a04c4f..9c930360eec 100644 --- a/src/devices/machine/spg2xx_io.cpp +++ b/src/devices/machine/spg2xx_io.cpp @@ -43,18 +43,18 @@ spg2xx_io_device::spg2xx_io_device(const machine_config &mconfig, device_type ty m_porta_out(*this), m_portb_out(*this), m_portc_out(*this), - m_porta_in(*this), - m_portb_in(*this), - m_portc_in(*this), - m_adc_in(*this), + m_porta_in(*this, 0), + m_portb_in(*this, 0), + m_portc_in(*this, 0), + m_adc_in(*this, 0x0fff), m_i2c_w(*this), - m_i2c_r(*this), + m_i2c_r(*this, 0), m_uart_tx(*this), m_spi_tx(*this), m_chip_sel(*this), m_cpu(*this, finder_base::DUMMY_TAG), m_screen(*this, finder_base::DUMMY_TAG), - m_pal_read_cb(*this), + m_pal_read_cb(*this, 0), m_timer_irq_cb(*this), m_uart_adc_irq_cb(*this), m_external_irq_cb(*this), @@ -77,28 +77,6 @@ spg28x_io_device::spg28x_io_device(const machine_config &mconfig, const char *ta void spg2xx_io_device::device_start() { - m_porta_out.resolve_safe(); - m_portb_out.resolve_safe(); - m_portc_out.resolve_safe(); - m_porta_in.resolve_safe(0); - m_portb_in.resolve_safe(0); - m_portc_in.resolve_safe(0); - m_adc_in.resolve_all_safe(0x0fff); - m_i2c_w.resolve_safe(); - m_i2c_r.resolve_safe(0); - m_uart_tx.resolve_safe(); - m_spi_tx.resolve_safe(); - m_chip_sel.resolve_safe(); - m_pal_read_cb.resolve_safe(0); - - m_timer_irq_cb.resolve_safe(); - m_uart_adc_irq_cb.resolve_safe(); - m_external_irq_cb.resolve_safe(); - m_ffreq_tmr1_irq_cb.resolve_safe(); - m_ffreq_tmr2_irq_cb.resolve_safe(); - - m_fiq_vector_w.resolve_safe(); - m_tmb1 = timer_alloc(FUNC(spg2xx_io_device::tmb_timer_tick<0>), this); m_tmb2 = timer_alloc(FUNC(spg2xx_io_device::tmb_timer_tick<1>), this); diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp index dda101c9d03..f165e930654 100644 --- a/src/devices/machine/spg2xx_video.cpp +++ b/src/devices/machine/spg2xx_video.cpp @@ -28,9 +28,9 @@ DEFINE_DEVICE_TYPE(SPG24X_VIDEO, spg24x_video_device, "spg24x_video", "SPG240-se spg2xx_video_device::spg2xx_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_guny_in(*this), - m_gunx_in(*this), - m_sprlimit_read_cb(*this), + m_guny_in(*this, 0), + m_gunx_in(*this, 0), + m_sprlimit_read_cb(*this, 0), m_video_irq_cb(*this), m_cpu(*this, finder_base::DUMMY_TAG), m_screen(*this, finder_base::DUMMY_TAG), @@ -49,16 +49,10 @@ spg24x_video_device::spg24x_video_device(const machine_config &mconfig, const ch void spg2xx_video_device::device_start() { - m_guny_in.resolve_safe(0); - m_gunx_in.resolve_safe(0); - m_screenpos_timer = timer_alloc(FUNC(spg2xx_video_device::screenpos_hit), this); m_screenpos_timer->adjust(attotime::never); save_item(NAME(m_video_regs)); - - m_sprlimit_read_cb.resolve_safe(0); - m_video_irq_cb.resolve(); } void spg2xx_video_device::device_reset() diff --git a/src/devices/machine/spg_renderer.cpp b/src/devices/machine/spg_renderer.cpp index 6dd526a902a..0bb116ef784 100644 --- a/src/devices/machine/spg_renderer.cpp +++ b/src/devices/machine/spg_renderer.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE(SPG_RENDERER, spg_renderer_device, "spg_renderer", "SunPlus / spg_renderer_device::spg_renderer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_space_read_cb(*this) + m_space_read_cb(*this, 0) { } @@ -19,8 +19,6 @@ spg_renderer_device::spg_renderer_device(const machine_config &mconfig, const ch void spg_renderer_device::device_start() { - m_space_read_cb.resolve_safe(0); - for (uint8_t i = 0; i < 32; i++) { m_rgb5_to_rgb8[i] = (i << 3) | (i >> 2); diff --git a/src/devices/machine/spi_sdcard.cpp b/src/devices/machine/spi_sdcard.cpp index fdce4a8d907..ee67fbb8301 100644 --- a/src/devices/machine/spi_sdcard.cpp +++ b/src/devices/machine/spi_sdcard.cpp @@ -72,7 +72,6 @@ ALLOW_SAVE_TYPE(spi_sdcard_device::sd_type); void spi_sdcard_device::device_start() { - write_miso.resolve_safe(); save_item(NAME(m_state)); save_item(NAME(m_in_latch)); save_item(NAME(m_out_latch)); diff --git a/src/devices/machine/spifi3.cpp b/src/devices/machine/spifi3.cpp index 235f7069916..d0ea43147c0 100644 --- a/src/devices/machine/spifi3.cpp +++ b/src/devices/machine/spifi3.cpp @@ -325,9 +325,6 @@ void spifi3_device::device_start() save_item(STRUCT_MEMBER(m_odd_fifo, size)); save_item(STRUCT_MEMBER(m_odd_fifo, fifo)); - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - bus_id = 0; tm = timer_alloc(FUNC(spifi3_device::tick), this); } diff --git a/src/devices/machine/steppers.cpp b/src/devices/machine/steppers.cpp index d25f5f61459..675c15bde29 100644 --- a/src/devices/machine/steppers.cpp +++ b/src/devices/machine/steppers.cpp @@ -95,9 +95,6 @@ void stepper_device::update_optic() void stepper_device::device_start() { - /* resolve callbacks */ - m_optic_cb.resolve_safe(); - /* register for state saving */ save_item(NAME(m_index_start)); save_item(NAME(m_index_end)); diff --git a/src/devices/machine/sun4c_mmu.cpp b/src/devices/machine/sun4c_mmu.cpp index eebecb5d7db..038a47e7158 100644 --- a/src/devices/machine/sun4c_mmu.cpp +++ b/src/devices/machine/sun4c_mmu.cpp @@ -54,7 +54,7 @@ sun4_mmu_base_device::sun4_mmu_base_device(const machine_config &mconfig, device , m_rom(*this, finder_base::DUMMY_TAG) , m_scc(*this, finder_base::DUMMY_TAG) , m_host(nullptr) - , m_type1_r(*this) + , m_type1_r(*this, 0xffffffff) , m_type1_w(*this) , m_rom_ptr(nullptr) , m_ram_ptr(nullptr) @@ -81,9 +81,6 @@ sun4c_mmu_device::sun4c_mmu_device(const machine_config &mconfig, const char *ta void sun4_mmu_base_device::device_start() { - m_type1_r.resolve_safe(0xffffffff); - m_type1_w.resolve_safe(); - // allocate timer for system reset m_reset_timer = timer_alloc(FUNC(sun4_mmu_base_device::reset_off_tick), this); m_reset_timer->adjust(attotime::never); diff --git a/src/devices/machine/swim3.cpp b/src/devices/machine/swim3.cpp index 6c93ee6b0c4..129f0f4a261 100644 --- a/src/devices/machine/swim3.cpp +++ b/src/devices/machine/swim3.cpp @@ -22,8 +22,6 @@ void swim3_device::device_start() { applefdintf_device::device_start(); - m_irq_cb.resolve_safe(); - m_drq_cb.resolve_safe(); m_timer = timer_alloc(FUNC(swim3_device::update), this); save_item(NAME(m_mode)); diff --git a/src/devices/machine/swtpc8212.cpp b/src/devices/machine/swtpc8212.cpp index 4d214e43175..7a95585ed8a 100644 --- a/src/devices/machine/swtpc8212.cpp +++ b/src/devices/machine/swtpc8212.cpp @@ -368,13 +368,6 @@ void swtpc8212_device::write_rts(int state) m_rs232_conn_rts_handler(state); } -void swtpc8212_device::device_resolve_objects() -{ - m_rs232_conn_dtr_handler.resolve_safe(); - m_rs232_conn_rts_handler.resolve_safe(); - m_rs232_conn_txd_handler.resolve_safe(); -} - void swtpc8212_device::device_start() { m_bell_timer = timer_alloc(FUNC(swtpc8212_device::bell_off), this); diff --git a/src/devices/machine/swtpc8212.h b/src/devices/machine/swtpc8212.h index 0d363860c14..1a59160d342 100644 --- a/src/devices/machine/swtpc8212.h +++ b/src/devices/machine/swtpc8212.h @@ -36,7 +36,6 @@ public: protected: swtpc8212_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/machine/tdc1008.cpp b/src/devices/machine/tdc1008.cpp index e3a814ec5e5..598c30a24e3 100644 --- a/src/devices/machine/tdc1008.cpp +++ b/src/devices/machine/tdc1008.cpp @@ -75,11 +75,6 @@ void tdc1008_device::device_start() save_item(NAME(m_x.u)); save_item(NAME(m_y.u)); save_item(NAME(m_p_out.u)); - - m_xtp.resolve_safe(); - m_msp.resolve_safe(); - m_lsp.resolve_safe(); - m_p.resolve_safe(); } void tdc1008_device::device_reset() diff --git a/src/devices/machine/te7750.cpp b/src/devices/machine/te7750.cpp index 540b3b27cf5..51577759477 100644 --- a/src/devices/machine/te7750.cpp +++ b/src/devices/machine/te7750.cpp @@ -190,9 +190,9 @@ DEFINE_DEVICE_TYPE(TE7752, te7752_device, "te7752", "TE7752 Super I/O Expander") te7750_device::te7750_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) - , m_input_cb(*this) + , m_input_cb(*this, 0xff) , m_output_cb(*this) - , m_ios_cb(*this) + , m_ios_cb(*this, 0) // assume soft mode unless specified { std::fill(std::begin(m_data_dir), std::end(m_data_dir), 0xff); } @@ -226,13 +226,6 @@ te7752_device::te7752_device(const machine_config &mconfig, const char *tag, dev void te7750_device::device_start() { - // resolve port callbacks - m_input_cb.resolve_all_safe(0xff); - m_output_cb.resolve_all_safe(); - - // resolve IOS (assume soft mode unless specified) - m_ios_cb.resolve_safe(0); - // save state save_item(NAME(m_data_latch)); save_item(NAME(m_data_dir)); diff --git a/src/devices/machine/ticket.cpp b/src/devices/machine/ticket.cpp index e92340f51d7..eac0bf0a18a 100644 --- a/src/devices/machine/ticket.cpp +++ b/src/devices/machine/ticket.cpp @@ -142,8 +142,6 @@ void ticket_dispenser_device::device_start() m_output.resolve(); - m_dispense_handler.resolve_safe(); - save_item(NAME(m_status)); save_item(NAME(m_power)); } diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index f5c3a8bbc10..c8c0d194430 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -231,8 +231,6 @@ void timekeeper_device::device_start() m_watchdog_timer = timer_alloc(FUNC(timekeeper_device::watchdog_callback), this); m_watchdog_timer->adjust(attotime::never); - m_reset_cb.resolve_safe(); - m_irq_cb.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/machine/tmc0430.cpp b/src/devices/machine/tmc0430.cpp index 78d354d2ddc..8264830817a 100644 --- a/src/devices/machine/tmc0430.cpp +++ b/src/devices/machine/tmc0430.cpp @@ -334,7 +334,6 @@ void tmc0430_device::write(uint8_t data) void tmc0430_device::device_start() { - m_gromready.resolve_safe(); save_item(NAME(m_current_clock_level)); save_item(NAME(m_current_ident)); save_item(NAME(m_phase)); diff --git a/src/devices/machine/tmc208k.cpp b/src/devices/machine/tmc208k.cpp index fe275fd693c..5d138b7ba98 100644 --- a/src/devices/machine/tmc208k.cpp +++ b/src/devices/machine/tmc208k.cpp @@ -69,10 +69,6 @@ void tmc208_base_device::device_start() save_item(NAME(m_clk_r)); save_item(NAME(m_rnd_in)); save_item(NAME(m_rnd)); - - m_msp.resolve_safe(); - m_lsp.resolve_safe(); - m_r.resolve_safe(); } template diff --git a/src/devices/machine/tms1024.cpp b/src/devices/machine/tms1024.cpp index c9ebedf3111..b283c20893c 100644 --- a/src/devices/machine/tms1024.cpp +++ b/src/devices/machine/tms1024.cpp @@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(TMS1025, tms1025_device, "tms1025", "TMS1025 I/O Expander") tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) , m_h(0), m_s(0), m_std(0), m_ms(0) - , m_read_port(*this) + , m_read_port(*this, 0) , m_write_port(*this) { } @@ -49,10 +49,6 @@ tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, d void tms1024_device::device_start() { - // resolve callbacks (there is no port 0) - m_read_port.resolve_all_safe(0); - m_write_port.resolve_all_safe(); - // register for savestates save_item(NAME(m_h)); save_item(NAME(m_s)); diff --git a/src/devices/machine/tms5501.cpp b/src/devices/machine/tms5501.cpp index f5844d1c8bf..9004c8b3167 100644 --- a/src/devices/machine/tms5501.cpp +++ b/src/devices/machine/tms5501.cpp @@ -60,7 +60,7 @@ tms5501_device::tms5501_device(const machine_config &mconfig, const char *tag, d device_serial_interface(mconfig, *this), m_write_int(*this), m_write_xmt(*this), - m_read_xi(*this), + m_read_xi(*this, 0), m_write_xo(*this), m_irq(IRQ_TB), m_rb(0), @@ -81,12 +81,6 @@ tms5501_device::tms5501_device(const machine_config &mconfig, const char *tag, d void tms5501_device::device_start() { - // resolve callbacks - m_write_int.resolve_safe(); - m_write_xmt.resolve_safe(); - m_read_xi.resolve_safe(0); - m_write_xo.resolve_safe(); - // create timers m_timer[TIMER_1] = timer_alloc(FUNC(tms5501_device::timer_expired), this); m_timer[TIMER_2] = timer_alloc(FUNC(tms5501_device::timer_expired), this); diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp index e5acfc66176..46779cd13c0 100644 --- a/src/devices/machine/tms9901.cpp +++ b/src/devices/machine/tms9901.cpp @@ -175,7 +175,7 @@ tms9901_device::tms9901_device(const machine_config &mconfig, const char *tag, d m_poll_lines(false), m_clockdiv(0), m_timer_int_pending(false), - m_read_port(*this), + m_read_port(*this, 0), m_write_p(*this), m_interrupt(*this) { @@ -265,14 +265,12 @@ void tms9901_device::signal_int() if (m_int_pending) { LOGMASKED(LOG_INT, "Triggering interrupt, level %d\n", m_int_level); - if (!m_interrupt.isnull()) - m_interrupt(ASSERT_LINE); + m_interrupt(ASSERT_LINE); } else { LOGMASKED(LOG_INT, "Clear all interrupts\n"); - if (!m_interrupt.isnull()) - m_interrupt(CLEAR_LINE); //Spec: INTREQ*=1 <=> IC0,1,2,3 = 1111 + m_interrupt(CLEAR_LINE); //Spec: INTREQ*=1 <=> IC0,1,2,3 = 1111 } } @@ -338,8 +336,8 @@ bool tms9901_device::read_bit(int bit) else { // Positive logic; should be 0 if there is no connection. - if (m_read_port.isnull()) return false; - return m_read_port((crubit<=P6)? crubit : P6+P0-crubit)!=0; + if (m_read_port.isunset()) return false; + return m_read_port((crubit<=P6) ? crubit : P6+P0-crubit)!=0; } } @@ -349,7 +347,7 @@ bool tms9901_device::read_bit(int bit) if (crubit == 15) // bit 15 in clock mode = /INTREQ return !m_int_pending; - return BIT(m_clock_read_register, crubit-1)!=0; + return BIT(m_clock_read_register, crubit-1) != 0; } else { @@ -361,7 +359,7 @@ bool tms9901_device::read_bit(int bit) if (crubit>INT6 && is_output(22-crubit)) return output_value(22-crubit); else - return m_read_port.isnull()? true : (m_read_port(crubit)!=0); + return m_read_port.isunset() ? true : (m_read_port(crubit)!=0); } } @@ -627,10 +625,6 @@ void tms9901_device::device_start() m_decrementer->adjust(attotime::from_hz(clock() / 64.), 0, attotime::from_hz(clock() / 64.)); } - m_read_port.resolve(); - m_write_p.resolve_all_safe(); - m_interrupt.resolve(); - m_clock_register = 0; save_item(NAME(m_int_line)); diff --git a/src/devices/machine/tms9902.cpp b/src/devices/machine/tms9902.cpp index 47794ed0857..bb8bb175cf4 100644 --- a/src/devices/machine/tms9902.cpp +++ b/src/devices/machine/tms9902.cpp @@ -906,11 +906,6 @@ void tms9902_device::device_start() { m_clock_rate = clock(); - m_int_cb.resolve_safe(); - m_rcv_cb.resolve_safe(); - m_xmit_cb.resolve_safe(); - m_ctrl_cb.resolve_safe(); - m_dectimer = timer_alloc(FUNC(tms9902_device::decrementer_expired), this); m_recvtimer = timer_alloc(FUNC(tms9902_device::recv_tick), this); m_sendtimer = timer_alloc(FUNC(tms9902_device::send_tick), this); diff --git a/src/devices/machine/tms9914.cpp b/src/devices/machine/tms9914.cpp index c699079de36..ffab008c777 100644 --- a/src/devices/machine/tms9914.cpp +++ b/src/devices/machine/tms9914.cpp @@ -174,64 +174,64 @@ constexpr uint8_t IFCMD_UNT = 0x5f; // Untalk DEFINE_DEVICE_TYPE(TMS9914, tms9914_device, "tms9914", "TMS9914 GPIB Controller") // Constructors -tms9914_device::tms9914_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig , TMS9914 , tag , owner , clock), - m_dio_read_func(*this), - m_dio_write_func(*this), - m_signal_wr_fns(*this), - m_int_write_func(*this), - m_accrq_write_func(*this), - m_int_line{false}, - m_accrq_line{false}, - m_dio{0}, - m_signals{false}, - m_ext_signals{false}, - m_no_reflection{false}, - m_ext_state_change{false}, - m_reg_int0_status{0}, - m_reg_int0_mask{0}, - m_reg_int1_status{0}, - m_reg_int1_mask{0}, - m_reg_address{0}, - m_reg_serial_p{0}, - m_reg_2nd_serial_p{0}, - m_reg_parallel_p{0}, - m_reg_2nd_parallel_p{0}, - m_reg_di{0}, - m_reg_do{0}, - m_reg_ulpa{false}, - m_swrst{false}, - m_hdfa{false}, - m_hdfe{false}, - m_rtl{false}, - m_gts{false}, - m_rpp{false}, - m_sic{false}, - m_sre{false}, - m_dai{false}, - m_pts{false}, - m_stdl{false}, - m_shdw{false}, - m_vstdl{false}, - m_rsvd2{false}, - m_ah_state{FSM_AH_AIDS}, - m_ah_adhs{false}, - m_ah_anhs{false}, - m_ah_aehs{false}, - m_sh_state{FSM_SH_SIDS}, - m_sh_shfs{false}, - m_sh_vsts{false}, - m_t_state{FSM_T_TIDS}, - m_t_tpas{false}, - m_t_spms{false}, - m_t_eoi_state{FSM_T_ENIS}, - m_l_state{FSM_L_LIDS}, - m_l_lpas{false}, - m_sr_state{FSM_SR_NPRS}, - m_rl_state{FSM_RL_LOCS}, - m_pp_ppas{false}, - m_c_state{FSM_C_CIDS}, - m_next_eoi{false} +tms9914_device::tms9914_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig , TMS9914 , tag , owner , clock), + m_dio_read_func(*this, 0xff), + m_dio_write_func(*this), + m_signal_wr_fns(*this), + m_int_write_func(*this), + m_accrq_write_func(*this), + m_int_line{false}, + m_accrq_line{false}, + m_dio{0}, + m_signals{false}, + m_ext_signals{false}, + m_no_reflection{false}, + m_ext_state_change{false}, + m_reg_int0_status{0}, + m_reg_int0_mask{0}, + m_reg_int1_status{0}, + m_reg_int1_mask{0}, + m_reg_address{0}, + m_reg_serial_p{0}, + m_reg_2nd_serial_p{0}, + m_reg_parallel_p{0}, + m_reg_2nd_parallel_p{0}, + m_reg_di{0}, + m_reg_do{0}, + m_reg_ulpa{false}, + m_swrst{false}, + m_hdfa{false}, + m_hdfe{false}, + m_rtl{false}, + m_gts{false}, + m_rpp{false}, + m_sic{false}, + m_sre{false}, + m_dai{false}, + m_pts{false}, + m_stdl{false}, + m_shdw{false}, + m_vstdl{false}, + m_rsvd2{false}, + m_ah_state{FSM_AH_AIDS}, + m_ah_adhs{false}, + m_ah_anhs{false}, + m_ah_aehs{false}, + m_sh_state{FSM_SH_SIDS}, + m_sh_shfs{false}, + m_sh_vsts{false}, + m_t_state{FSM_T_TIDS}, + m_t_tpas{false}, + m_t_spms{false}, + m_t_eoi_state{FSM_T_ENIS}, + m_l_state{FSM_L_LIDS}, + m_l_lpas{false}, + m_sr_state{FSM_SR_NPRS}, + m_rl_state{FSM_RL_LOCS}, + m_pp_ppas{false}, + m_c_state{FSM_C_CIDS}, + m_next_eoi{false} { // Silence compiler complaints about unused variables (void)REG_INT1_IFC_BIT; @@ -526,12 +526,6 @@ void tms9914_device::device_start() save_item(NAME(m_c_state)); save_item(NAME(m_next_eoi)); - m_dio_read_func.resolve_safe(0xff); - m_dio_write_func.resolve_safe(); - m_signal_wr_fns.resolve_all_safe(); - m_int_write_func.resolve_safe(); - m_accrq_write_func.resolve_safe(); - m_sh_dly_timer = timer_alloc(FUNC(tms9914_device::fsm_tick), this); m_ah_dly_timer = timer_alloc(FUNC(tms9914_device::fsm_tick), this); m_c_dly_timer = timer_alloc(FUNC(tms9914_device::fsm_tick), this); diff --git a/src/devices/machine/tsb12lv01a.cpp b/src/devices/machine/tsb12lv01a.cpp index 8a0b195fa88..8c352e16032 100644 --- a/src/devices/machine/tsb12lv01a.cpp +++ b/src/devices/machine/tsb12lv01a.cpp @@ -26,7 +26,7 @@ DEFINE_DEVICE_TYPE(TSB12LV01A, tsb12lv01a_device, "tsb12lv01a", "TSB12LV01A IEEE tsb12lv01a_device::tsb12lv01a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TSB12LV01A, tag, owner, clock) , m_int_cb(*this) - , m_phy_read_cb(*this) + , m_phy_read_cb(*this, 0x00) , m_phy_write_cb(*this) { } @@ -46,10 +46,6 @@ void tsb12lv01a_device::device_start() save_item(NAME(m_atf_status)); save_item(NAME(m_itf_status)); save_item(NAME(m_grf_status)); - - m_int_cb.resolve_safe(); - m_phy_read_cb.resolve_safe(0x00); - m_phy_write_cb.resolve_safe(); } void tsb12lv01a_device::device_reset() diff --git a/src/devices/machine/tube.cpp b/src/devices/machine/tube.cpp index f16fed18da5..328a5fafbb7 100644 --- a/src/devices/machine/tube.cpp +++ b/src/devices/machine/tube.cpp @@ -46,13 +46,6 @@ tube_device::tube_device(const machine_config &mconfig, const char *tag, device_ void tube_device::device_start() { - // resolve callbacks - m_hirq_handler.resolve_safe(); - m_pnmi_handler.resolve_safe(); - m_pirq_handler.resolve_safe(); - m_prst_handler.resolve_safe(); - m_drq_handler.resolve_safe(); - // register for state saving save_item(NAME(m_ph1)); save_item(NAME(m_ph2)); diff --git a/src/devices/machine/ucb1200.cpp b/src/devices/machine/ucb1200.cpp index e3410605095..636e223ea1d 100644 --- a/src/devices/machine/ucb1200.cpp +++ b/src/devices/machine/ucb1200.cpp @@ -25,18 +25,12 @@ ucb1200_device::ucb1200_device(const machine_config &mconfig, const char *tag, d , m_audio_out(*this) , m_telecom_out(*this) , m_irq_out(*this) - , m_adc_in(*this) + , m_adc_in(*this, 0xffff) { } void ucb1200_device::device_start() { - m_gpio_out.resolve_all_safe(); - m_audio_out.resolve_safe(); - m_telecom_out.resolve_safe(); - m_irq_out.resolve_safe(); - m_adc_in.resolve_all_safe(0xffff); - save_item(NAME(m_gpio_out_latch)); save_item(NAME(m_gpio_in_latch)); save_item(NAME(m_gpio_dir)); diff --git a/src/devices/machine/upc82c710.cpp b/src/devices/machine/upc82c710.cpp index 57c4eed6e6f..d64b9008b07 100644 --- a/src/devices/machine/upc82c710.cpp +++ b/src/devices/machine/upc82c710.cpp @@ -75,14 +75,6 @@ void upc82c710_device::device_start() irq = drq = false; fdc_irq = fdc_drq = false; - m_fintr_callback.resolve_safe(); - m_fdrq_callback.resolve_safe(); - m_pintr_callback.resolve_safe(); - m_sintr_callback.resolve_safe(); - m_txd_callback.resolve_safe(); - m_dtr_callback.resolve_safe(); - m_rts_callback.resolve_safe(); - // default addresses device_address[DEVICE_CFG] = 0x390; device_address[DEVICE_IDE] = 0x1f0; diff --git a/src/devices/machine/upc82c711.cpp b/src/devices/machine/upc82c711.cpp index ad1a4b6598e..7c021d30b2c 100644 --- a/src/devices/machine/upc82c711.cpp +++ b/src/devices/machine/upc82c711.cpp @@ -85,18 +85,6 @@ void upc82c711_device::device_start() irq = drq = false; fdc_irq = fdc_drq = false; - m_fintr_callback.resolve_safe(); - m_fdrq_callback.resolve_safe(); - m_pintr_callback.resolve_safe(); - m_irq3_callback.resolve_safe(); - m_irq4_callback.resolve_safe(); - m_txd1_callback.resolve_safe(); - m_dtr1_callback.resolve_safe(); - m_rts1_callback.resolve_safe(); - m_txd2_callback.resolve_safe(); - m_dtr2_callback.resolve_safe(); - m_rts2_callback.resolve_safe(); - // default addresses com_address[0] = 0x3f8; com_address[1] = 0x2f8; diff --git a/src/devices/machine/upd1990a.cpp b/src/devices/machine/upd1990a.cpp index 49defc21fa2..3110da57013 100644 --- a/src/devices/machine/upd1990a.cpp +++ b/src/devices/machine/upd1990a.cpp @@ -73,9 +73,6 @@ bool upd1990a_device::is_serial_mode() void upd1990a_device::device_start() { (void)m_variant; - // resolve callbacks - m_write_data.resolve_safe(); - m_write_tp.resolve_safe(); for (auto & elem : m_shift_reg) elem = 0; diff --git a/src/devices/machine/upd4701.cpp b/src/devices/machine/upd4701.cpp index 3ffe575fb42..728c7e5e2e8 100644 --- a/src/devices/machine/upd4701.cpp +++ b/src/devices/machine/upd4701.cpp @@ -35,7 +35,7 @@ upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, d , m_cf(true) , m_cf_cb(*this) , m_sf_cb(*this) - , m_open_bus_cb(*this) + , m_open_bus_cb(*this, 0) { } @@ -45,11 +45,6 @@ upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, d void upd4701_device::device_start() { - // resolve callbacks - m_cf_cb.resolve_safe(); - m_sf_cb.resolve_safe(); - m_open_bus_cb.resolve_safe(0); - // register state for saving save_item(NAME(m_cs)); save_item(NAME(m_xy)); diff --git a/src/devices/machine/upd7001.cpp b/src/devices/machine/upd7001.cpp index 949d3d1234b..9f0c63de2d4 100644 --- a/src/devices/machine/upd7001.cpp +++ b/src/devices/machine/upd7001.cpp @@ -40,7 +40,7 @@ DEFINE_DEVICE_TYPE(UPD7001, upd7001_device, "upd7001", "NEC uPD7001 A/D Converte upd7001_device::upd7001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, UPD7001, tag, owner, clock) - , m_an_callback(*this) + , m_an_callback(*this, 0) , m_eoc_callback(*this) , m_res(0.0) , m_cap(0.0) @@ -60,18 +60,6 @@ upd7001_device::upd7001_device(const machine_config &mconfig, const char *tag, d } -//------------------------------------------------- -// device_resolve_objects - -//------------------------------------------------- - -void upd7001_device::device_resolve_objects() -{ - // resolve callbacks - m_an_callback.resolve_all_safe(0); - m_eoc_callback.resolve_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/upd7001.h b/src/devices/machine/upd7001.h index 11345c47f10..5494c3d8962 100644 --- a/src/devices/machine/upd7001.h +++ b/src/devices/machine/upd7001.h @@ -62,8 +62,7 @@ public: int eoc_so_r() { return eoc_r() && so_r(); } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; private: diff --git a/src/devices/machine/upd7004.cpp b/src/devices/machine/upd7004.cpp index a5fb2cba78f..8fcb49e9c62 100644 --- a/src/devices/machine/upd7004.cpp +++ b/src/devices/machine/upd7004.cpp @@ -40,7 +40,7 @@ ALLOW_SAVE_TYPE(upd7004_device::state); upd7004_device::upd7004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD7004, tag, owner, clock), m_eoc_cb(*this), m_eoc_ff_cb(*this), - m_in_cb(*this), + m_in_cb(*this, 0x3ff), m_state(STATE_IDLE), m_cycle_timer(nullptr), m_div(1), m_code(false), m_address(0), m_sar(0x3ff) @@ -53,11 +53,6 @@ upd7004_device::upd7004_device(const machine_config &mconfig, const char *tag, d void upd7004_device::device_start() { - // resolve callbacks - m_eoc_cb.resolve_safe(); - m_eoc_ff_cb.resolve_safe(); - m_in_cb.resolve_all_safe(0x3ff); - // allocate timers m_cycle_timer = timer_alloc(FUNC(upd7004_device::update_state), this); m_cycle_timer->adjust(attotime::never); diff --git a/src/devices/machine/upd71071.cpp b/src/devices/machine/upd71071.cpp index 33440f0c04b..61b830d5920 100644 --- a/src/devices/machine/upd71071.cpp +++ b/src/devices/machine/upd71071.cpp @@ -98,7 +98,7 @@ upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, , m_upd_clock(0) , m_out_hreq_cb(*this) , m_out_eop_cb(*this) - , m_dma_read_cb(*this) + , m_dma_read_cb(*this, 0) , m_dma_write_cb(*this) , m_out_dack_cb(*this) , m_cpu(*this, finder_base::DUMMY_TAG) @@ -111,11 +111,6 @@ upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, void upd71071_device::device_start() { - m_out_hreq_cb.resolve_safe(); - m_out_eop_cb.resolve_safe(); - m_dma_read_cb.resolve_all_safe(0); - m_dma_write_cb.resolve_all_safe(); - m_out_dack_cb.resolve_all_safe(); for (auto &elem : m_timer) elem = timer_alloc(FUNC(upd71071_device::dma_transfer_timer), this); m_selected_channel = 0; @@ -168,7 +163,7 @@ TIMER_CALLBACK_MEMBER(upd71071_device::dma_transfer_timer) case 1: case 2: case 3: - if (!m_dma_read_cb[channel].isnull()) + if (!m_dma_read_cb[channel].isunset()) data = m_dma_read_cb[channel](0); break; } @@ -223,8 +218,7 @@ TIMER_CALLBACK_MEMBER(upd71071_device::dma_transfer_timer) case 1: case 2: case 3: - if (!m_dma_write_cb[channel].isnull()) - m_dma_write_cb[channel](offs_t(0), data); + m_dma_write_cb[channel](offs_t(0), data); break; } if (m_reg.mode_control[channel] & 0x20) // Address direction diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index 41b78776391..51f6d0de63d 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -216,15 +216,6 @@ void ps2_fdc_device::set_mode(mode_t _mode) mode = _mode; } -void upd765_family_device::device_resolve_objects() -{ - intrq_cb.resolve_safe(); - drq_cb.resolve_safe(); - hdl_cb.resolve_safe(); - idx_cb.resolve_safe(); - us_cb.resolve_safe(); -} - void upd765_family_device::device_start() { save_item(NAME(selected_drive)); @@ -3200,7 +3191,7 @@ uint8_t wd37c65c_device::get_st3(floppy_info &fi) mcs3201_device::mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, MCS3201, tag, owner, clock), - m_input_handler(*this) + m_input_handler(*this, 0) { has_dor = true; ready_polled = false; @@ -3209,12 +3200,6 @@ mcs3201_device::mcs3201_device(const machine_config &mconfig, const char *tag, d select_multiplexed = false; } -void mcs3201_device::device_start() -{ - upd765_family_device::device_start(); - m_input_handler.resolve_safe(0); -} - uint8_t mcs3201_device::input_r() { return m_input_handler(); @@ -3315,17 +3300,11 @@ void upd72069_device::auxcmd_w(uint8_t data) hd63266f_device::hd63266f_device(const machine_config& mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, HD63266F, tag, owner, clock) - , inp_cb(*this) + , inp_cb(*this, 0) { has_dor = false; } -void hd63266f_device::device_start() -{ - upd765_family_device::device_start(); - inp_cb.resolve(); -} - void hd63266f_device::map(address_map &map) { map(0x0, 0x0).rw(FUNC(hd63266f_device::msr_r), FUNC(hd63266f_device::abort_w)); @@ -3385,7 +3364,7 @@ void hd63266f_device::execute_command(int cmd) break; case C_SENSE_DRIVE_STATUS: upd765_family_device::execute_command(cmd); - if(inp_cb) + if(!inp_cb.isunset()) result[0] = (result[0] & ~ST3_TS) | (inp_cb() ? 0 : 8); break; default: diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h index ebfdebc3536..9c28f4d17d2 100644 --- a/src/devices/machine/upd765.h +++ b/src/devices/machine/upd765.h @@ -61,7 +61,6 @@ public: protected: upd765_family_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; @@ -574,9 +573,6 @@ public: virtual void map(address_map &map) override; uint8_t input_r(); -protected: - virtual void device_start() override; - private: devcb_read8 m_input_handler; }; @@ -609,7 +605,6 @@ public: protected: virtual void soft_reset() override; - virtual void device_start() override; private: virtual int check_command() override; diff --git a/src/devices/machine/vic_pl192.cpp b/src/devices/machine/vic_pl192.cpp index 2e7a2f4ad85..c4ab633145d 100644 --- a/src/devices/machine/vic_pl192.cpp +++ b/src/devices/machine/vic_pl192.cpp @@ -102,13 +102,6 @@ device_memory_interface::space_config_vector vic_pl190_device::memory_space_conf }; } -void vic_pl190_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_func.resolve_safe(); - m_out_fiq_func.resolve_safe(); -} - void vic_pl190_device::map(address_map &map) { map(0x000, 0x003).r(FUNC(vic_pl190_device::irq_status_r)); diff --git a/src/devices/machine/vic_pl192.h b/src/devices/machine/vic_pl192.h index cde78483337..600ad27ba56 100644 --- a/src/devices/machine/vic_pl192.h +++ b/src/devices/machine/vic_pl192.h @@ -52,10 +52,9 @@ public: protected: vic_pl190_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - virtual void device_resolve_objects() override; virtual space_config_vector memory_space_config() const override; diff --git a/src/devices/machine/vrc4373.cpp b/src/devices/machine/vrc4373.cpp index 7b3ce4c11cf..b7e993c8f90 100644 --- a/src/devices/machine/vrc4373.cpp +++ b/src/devices/machine/vrc4373.cpp @@ -130,8 +130,6 @@ void vrc4373_device::device_start() io_offset = 0x00000000; status = 0x0280; - m_irq_cb.resolve(); - // Reserve 8M for ram m_ram.reserve(0x00800000 / 4); m_ram.resize(m_ram_size); @@ -416,7 +414,7 @@ TIMER_CALLBACK_MEMBER (vrc4373_device::dma_transfer) m_cpu_regs[NREG_DMACR1 + which * 0xc] &= ~DMA_GO; // Set the interrupt if (m_cpu_regs[NREG_DMACR1 + which * 0xc] & DMA_INT_EN) { - if (!m_irq_cb.isnull()) { + if (!m_irq_cb.isunset()) { m_irq_cb(ASSERT_LINE); } else { logerror("vrc4373_device::dma_transfer Error: DMA configured to trigger interrupt but no interrupt line configured\n"); @@ -523,7 +521,7 @@ void vrc4373_device::cpu_if_w(offs_t offset, uint32_t data, uint32_t mem_mask) case NREG_ICSR: // TODO: Check and clear individual interrupts if (data & 0xff000000) { - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) m_irq_cb(CLEAR_LINE); } break; diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp index 932f18a2cc4..81ffdea1af0 100644 --- a/src/devices/machine/vrender0.cpp +++ b/src/devices/machine/vrender0.cpp @@ -167,8 +167,6 @@ void vrender0soc_device::device_start() m_Timer[2] = timer_alloc(FUNC(vrender0soc_device::Timercb<2>), this); m_Timer[3] = timer_alloc(FUNC(vrender0soc_device::Timercb<3>), this); - write_tx.resolve_all_safe(); - for (int i = 0; i < 2; i++) { m_uart[i]->set_channel_num(i); diff --git a/src/devices/machine/vt8231_isa.cpp b/src/devices/machine/vt8231_isa.cpp index 8d2589dc8a9..9fa17c6144b 100644 --- a/src/devices/machine/vt8231_isa.cpp +++ b/src/devices/machine/vt8231_isa.cpp @@ -40,11 +40,6 @@ void vt8231_isa_device::device_start() { pci_device::device_start(); - // resolve callbacks - m_com1_txd_cb.resolve_safe(); - m_com1_dtr_cb.resolve_safe(); - m_com1_rts_cb.resolve_safe(); - // register for save states (TODO) } diff --git a/src/devices/machine/w83977tf.cpp b/src/devices/machine/w83977tf.cpp index fb1d6474c9f..4a7a66d8b86 100644 --- a/src/devices/machine/w83977tf.cpp +++ b/src/devices/machine/w83977tf.cpp @@ -50,17 +50,6 @@ void w83977tf_device::device_start() //m_isa->set_dma_channel(3, this, true); remap(AS_IO, 0, 0x400); - m_gp20_reset_callback.resolve_safe(); - m_gp25_gatea20_callback.resolve_safe(); - m_irq1_callback.resolve_safe(); - m_irq8_callback.resolve_safe(); - m_irq9_callback.resolve_safe(); -// m_txd1_callback.resolve_safe(); -// m_ndtr1_callback.resolve_safe(); -// m_nrts1_callback.resolve_safe(); -// m_txd2_callback.resolve_safe(); -// m_ndtr2_callback.resolve_safe(); -// m_nrts2_callback.resolve_safe(); } void w83977tf_device::device_reset() diff --git a/src/devices/machine/wd1000.cpp b/src/devices/machine/wd1000.cpp index 3f57fef6725..b9a475cc74f 100644 --- a/src/devices/machine/wd1000.cpp +++ b/src/devices/machine/wd1000.cpp @@ -57,10 +57,6 @@ void wd1000_device::set_sector_base(uint32_t base) void wd1000_device::device_start() { - // Resolve callbacks - m_intrq_cb.resolve_safe(); - m_drq_cb.resolve(); - // Allocate timers m_seek_timer = timer_alloc(FUNC(wd1000_device::update_seek), this); m_drq_timer = timer_alloc(FUNC(wd1000_device::delayed_drq), this); @@ -185,8 +181,7 @@ void wd1000_device::set_drq() if ((m_status & S_DRQ) == 0) { m_status |= S_DRQ; - if (!m_drq_cb.isnull()) - m_drq_cb(true); + m_drq_cb(true); } } @@ -195,8 +190,7 @@ void wd1000_device::drop_drq() if (m_status & S_DRQ) { m_status &= ~S_DRQ; - if (!m_drq_cb.isnull()) - m_drq_cb(false); + m_drq_cb(false); } } diff --git a/src/devices/machine/wd1010.cpp b/src/devices/machine/wd1010.cpp index ca6d3590f8b..5a01446c946 100644 --- a/src/devices/machine/wd1010.cpp +++ b/src/devices/machine/wd1010.cpp @@ -50,7 +50,7 @@ wd1010_device::wd1010_device(const machine_config &mconfig, const char *tag, dev m_out_bcr_cb(*this), m_out_dirin_cb(*this), m_out_wg_cb(*this), - m_in_data_cb(*this), + m_in_data_cb(*this, 0), m_out_data_cb(*this), m_intrq(0), m_brdy(0), @@ -84,16 +84,6 @@ void wd1010_device::device_start() m_drives[i].sector = 0; } - // resolve callbacks - m_out_intrq_cb.resolve_safe(); - m_out_bdrq_cb.resolve_safe(); - m_out_bcs_cb.resolve_safe(); - m_out_bcr_cb.resolve_safe(); - m_out_dirin_cb.resolve_safe(); - m_out_wg_cb.resolve_safe(); - m_in_data_cb.resolve_safe(0); - m_out_data_cb.resolve_safe(); - // allocate timer m_seek_timer = timer_alloc(FUNC(wd1010_device::update_seek), this); m_read_timer = timer_alloc(FUNC(wd1010_device::delayed_read), this); diff --git a/src/devices/machine/wd11c00_17.cpp b/src/devices/machine/wd11c00_17.cpp index 981672a70d9..d05db87f6cc 100644 --- a/src/devices/machine/wd11c00_17.cpp +++ b/src/devices/machine/wd11c00_17.cpp @@ -183,10 +183,10 @@ wd11c00_17_device::wd11c00_17_device(const machine_config &mconfig, const char * , m_out_busy_cb(*this) , m_out_req_cb(*this) , m_out_ra3_cb(*this) - , m_in_rd322_cb(*this) - , m_in_ramcs_cb(*this) + , m_in_rd322_cb(*this, 0) + , m_in_ramcs_cb(*this, 0) , m_out_ramwr_cb(*this) - , m_in_cs1010_cb(*this) + , m_in_cs1010_cb(*this, 0) , m_out_cs1010_cb(*this) , m_status(0) , m_ra(0) @@ -205,18 +205,6 @@ wd11c00_17_device::wd11c00_17_device(const machine_config &mconfig, const char * void wd11c00_17_device::device_start() { - // resolve callbacks - m_out_irq5_cb.resolve_safe(); - m_out_drq3_cb.resolve_safe(); - m_out_mr_cb.resolve_safe(); - m_out_busy_cb.resolve_safe(); - m_out_req_cb.resolve_safe(); - m_out_ra3_cb.resolve_safe(); - m_in_rd322_cb.resolve_safe(0); - m_in_ramcs_cb.resolve_safe(0); - m_out_ramwr_cb.resolve_safe(); - m_in_cs1010_cb.resolve_safe(0); - m_out_cs1010_cb.resolve_safe(); } diff --git a/src/devices/machine/wd2010.cpp b/src/devices/machine/wd2010.cpp index 840d0f6f4d8..f86f6645a70 100644 --- a/src/devices/machine/wd2010.cpp +++ b/src/devices/machine/wd2010.cpp @@ -158,18 +158,18 @@ wd2010_device::wd2010_device(const machine_config &mconfig, const char *tag, dev , m_out_intrq_cb(*this) , m_out_bdrq_cb(*this) , m_out_bcr_cb(*this) - , m_in_bcs_cb(*this) - , m_in_brdy_cb(*this) + , m_in_bcs_cb(*this, 0) + , m_in_brdy_cb(*this, 0) , m_out_bcs_cb(*this) , m_out_dirin_cb(*this) , m_out_step_cb(*this) , m_out_rwc_cb(*this) , m_out_wg_cb(*this) - , m_in_drdy_cb(*this) - , m_in_index_cb(*this) - , m_in_wf_cb(*this) - , m_in_tk000_cb(*this) - , m_in_sc_cb(*this) + , m_in_drdy_cb(*this, 0) + , m_in_index_cb(*this, 0) + , m_in_wf_cb(*this, 0) + , m_in_tk000_cb(*this, 0) + , m_in_sc_cb(*this, 0) , m_status(0) , m_error(0) { @@ -182,26 +182,7 @@ wd2010_device::wd2010_device(const machine_config &mconfig, const char *tag, dev void wd2010_device::device_start() { - // resolve callbacks - m_out_intrq_cb.resolve_safe(); - m_out_bdrq_cb.resolve_safe(); - m_out_bcr_cb.resolve_safe(); - m_in_bcs_cb.resolve_safe(0); - - m_in_brdy_cb.resolve_safe(0); - - m_out_bcs_cb.resolve_safe(); - m_out_dirin_cb.resolve_safe(); - m_out_step_cb.resolve_safe(); - m_out_rwc_cb.resolve_safe(); - m_out_wg_cb.resolve_safe(); - m_in_drdy_cb.resolve_safe(0); - m_in_index_cb.resolve_safe(0); - m_in_wf_cb.resolve_safe(0); - m_in_tk000_cb.resolve_safe(0); - m_in_sc_cb.resolve_safe(0); - - /* allocate a timer for commands */ + // allocate a timer for commands m_cmd_timer = timer_alloc(FUNC(wd2010_device::command_complete), this); m_complete_write_timer = timer_alloc(FUNC(wd2010_device::complete_write), this); m_deassert_write_timer = timer_alloc(FUNC(wd2010_device::deassert_write), this); diff --git a/src/devices/machine/wd33c9x.cpp b/src/devices/machine/wd33c9x.cpp index 934a8825b5c..7c0113ad030 100644 --- a/src/devices/machine/wd33c9x.cpp +++ b/src/devices/machine/wd33c9x.cpp @@ -388,8 +388,6 @@ wd33c9x_base_device::wd33c9x_base_device(const machine_config &mconfig, device_t void wd33c9x_base_device::device_start() { - m_irq_cb.resolve_safe(); - m_drq_cb.resolve_safe(); m_timer = timer_alloc(FUNC(wd33c9x_base_device::update_step), this); save_item(NAME(m_addr)); save_item(NAME(m_regs)); diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp index 0d9494f4c8b..3f984614ce4 100644 --- a/src/devices/machine/wd7600.cpp +++ b/src/devices/machine/wd7600.cpp @@ -81,7 +81,7 @@ void wd7600_device::device_add_mconfig(machine_config & config) wd7600_device::wd7600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WD7600, tag, owner, clock), - m_read_ior(*this), + m_read_ior(*this, 0), m_write_iow(*this), m_write_tc(*this), m_write_hold(*this), @@ -121,17 +121,6 @@ void wd7600_device::device_start() if (!m_ram->started()) throw device_missing_dependencies(); - // resolve callbacks - m_read_ior.resolve_safe(0); - m_write_iow.resolve_safe(); - m_write_tc.resolve_safe(); - m_write_hold.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_intr.resolve_safe(); - m_write_cpureset.resolve_safe(); - m_write_a20m.resolve_safe(); - m_write_spkr.resolve_safe(); - m_space = &m_cpu->space(AS_PROGRAM); m_space_io = &m_cpu->space(AS_IO); diff --git a/src/devices/machine/wd_fdc.cpp b/src/devices/machine/wd_fdc.cpp index 96803ca77f9..24cc0b22603 100644 --- a/src/devices/machine/wd_fdc.cpp +++ b/src/devices/machine/wd_fdc.cpp @@ -153,7 +153,7 @@ wd_fdc_device_base::wd_fdc_device_base(const machine_config &mconfig, device_typ enp_cb(*this), sso_cb(*this), ready_cb(*this), // actually output by the drive, not by the FDC - enmf_cb(*this), + enmf_cb(*this, 0), mon_cb(*this) { force_ready = false; @@ -175,16 +175,7 @@ void wd_fdc_device_base::set_disable_motor_control(bool _disable_motor_control) void wd_fdc_device_base::device_start() { - intrq_cb.resolve(); - drq_cb.resolve(); - hld_cb.resolve(); - enp_cb.resolve(); - sso_cb.resolve(); - ready_cb.resolve(); - enmf_cb.resolve(); - mon_cb.resolve_safe(); - - if (!has_enmf && !enmf_cb.isnull()) + if (!has_enmf && !enmf_cb.isunset()) logerror("Warning, this chip doesn't have an ENMF line.\n"); t_gen = timer_alloc(FUNC(wd_fdc_device_base::generic_tick), this); @@ -252,19 +243,16 @@ void wd_fdc_device_base::mr_w(int state) mr = false; // gnd == enmf enabled, otherwise disabled (default) - if (!enmf_cb.isnull() && has_enmf) + if (!enmf_cb.isunset() && has_enmf) enmf = enmf_cb() ? false : true; intrq = false; - if (!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); drq = false; - if (!drq_cb.isnull()) - drq_cb(drq); + drq_cb(drq); if(head_control) { hld = false; - if(!hld_cb.isnull()) - hld_cb(hld); + hld_cb(hld); } mon_cb(1); // Clear the MON* line @@ -370,8 +358,7 @@ void wd_fdc_device_base::command_end() status &= ~S_BUSY; } intrq = true; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } } @@ -1100,8 +1087,7 @@ void wd_fdc_device_base::interrupt_start() if(!intrq && (command & I_IMM)) { intrq = true; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } if(spinup_on_interrupt) { // see notes in FD1771 and WD1772 constructors, might be true for other FDC types as well. @@ -1285,8 +1271,7 @@ void wd_fdc_device_base::cmd_w(uint8_t val) // No other logic present in real chips, descriptions of "Forced interrupt" (Dx) command in datasheets are wrong. if (intrq) { intrq = false; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } // No more than one write in flight, but interrupts take priority @@ -1313,8 +1298,7 @@ uint8_t wd_fdc_device_base::status_r() { if(intrq && !(intrq_cond & I_IMM) && !machine().side_effects_disabled()) { intrq = false; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } if(status_type_1) { @@ -1488,8 +1472,7 @@ void wd_fdc_device_base::spinup() void wd_fdc_device_base::ready_callback(floppy_image_device *floppy, int state) { - if(!ready_cb.isnull()) - ready_cb(state); + ready_cb(state); // why is this even possible? if (!floppy) @@ -1501,8 +1484,7 @@ void wd_fdc_device_base::ready_callback(floppy_image_device *floppy, int state) if(!intrq && (((intrq_cond & I_RDY) && !state) || ((intrq_cond & I_NRDY) && state))) { intrq = true; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } } @@ -1533,8 +1515,7 @@ void wd_fdc_device_base::index_callback(floppy_image_device *floppy, int state) if(!intrq && (intrq_cond & I_IDX)) { intrq = true; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } break; @@ -1636,7 +1617,7 @@ void wd_fdc_device_base::live_start(int state) cur_live.data_bit_context = false; cur_live.byte_counter = 0; - if (!enmf_cb.isnull() && has_enmf) + if (!enmf_cb.isunset() && has_enmf) enmf = enmf_cb() ? false : true; pll_reset(dden, enmf, cur_live.tm); @@ -2379,8 +2360,7 @@ void wd_fdc_device_base::set_drq() status |= S_LOST; } else if(!(status & S_LOST)) { drq = true; - if(!drq_cb.isnull()) - drq_cb(true); + drq_cb(true); } } @@ -2388,13 +2368,11 @@ void wd_fdc_device_base::drop_drq() { if(drq) { drq = false; - if(!drq_cb.isnull()) - drq_cb(false); + drq_cb(false); if(main_state == IDLE && (status & S_BUSY)) { status &= ~S_BUSY; intrq = true; - if(!intrq_cb.isnull()) - intrq_cb(intrq); + intrq_cb(intrq); } } } @@ -2405,8 +2383,7 @@ void wd_fdc_device_base::set_hld() hld = true; int temp = sub_state; sub_state = DUMMY; - if(!hld_cb.isnull()) - hld_cb(hld); + hld_cb(hld); sub_state = temp; } } @@ -2417,8 +2394,7 @@ void wd_fdc_device_base::drop_hld() hld = false; int temp = sub_state; sub_state = DUMMY; - if(!hld_cb.isnull()) - hld_cb(hld); + hld_cb(hld); sub_state = temp; } } @@ -2435,7 +2411,7 @@ void wd_fdc_device_base::update_sso() // If a SSO callback is defined then it is assumed that this callback // will update the floppy side if that is the connection. There are // some machines that use the SSO output for other purposes. - if(!sso_cb.isnull()) { + if(!sso_cb.isunset()) { sso_cb(side); return; } diff --git a/src/devices/machine/wtl3132.cpp b/src/devices/machine/wtl3132.cpp index 7e1d1c2a4d5..c5d3aeb02f9 100644 --- a/src/devices/machine/wtl3132.cpp +++ b/src/devices/machine/wtl3132.cpp @@ -41,11 +41,6 @@ wtl3132_device::wtl3132_device(machine_config const &mconfig, char const *tag, d void wtl3132_device::device_start() { - m_fpcn_cb.resolve_safe(); - m_fpex_cb.resolve_safe(); - m_zero_cb.resolve_safe(); - m_port_x_cb.resolve_safe(); - save_item(NAME(m_fpcn_state)); save_item(NAME(m_fpex_state)); save_item(NAME(m_zero_state)); diff --git a/src/devices/machine/xc1700e.cpp b/src/devices/machine/xc1700e.cpp index fe056664b07..8c91a5293b1 100644 --- a/src/devices/machine/xc1700e.cpp +++ b/src/devices/machine/xc1700e.cpp @@ -51,7 +51,7 @@ base_xc1700e_device::base_xc1700e_device(const machine_config &mconfig, device_t : device_t(mconfig, type, tag, owner, clock) , m_capacity(capacity) , m_region(*this, DEVICE_SELF) - , m_cascade_cb(*this) + , m_cascade_cb(*this, 1) , m_reset(true) , m_address(0) { @@ -59,8 +59,6 @@ base_xc1700e_device::base_xc1700e_device(const machine_config &mconfig, device_t void base_xc1700e_device::device_start() { - m_cascade_cb.resolve_safe(1); - save_item(NAME(m_reset)); save_item(NAME(m_address)); } diff --git a/src/devices/machine/ym2148.cpp b/src/devices/machine/ym2148.cpp index 46f83a80325..24e486e1012 100644 --- a/src/devices/machine/ym2148.cpp +++ b/src/devices/machine/ym2148.cpp @@ -22,7 +22,7 @@ ym2148_device::ym2148_device(const machine_config &mconfig, const char *tag, dev , m_txd_handler(*this) , m_irq_handler(*this) , m_port_write_handler(*this) - , m_port_read_handler(*this) + , m_port_read_handler(*this, 0xff) , m_irq_state(CLEAR_LINE) , m_irq_vector(0xff) // guess , m_external_irq_vector(0xff) // guess @@ -38,11 +38,6 @@ ym2148_device::ym2148_device(const machine_config &mconfig, const char *tag, dev void ym2148_device::device_start() { - m_txd_handler.resolve_safe(); - m_irq_handler.resolve_safe(); - m_port_write_handler.resolve_safe(); - m_port_read_handler.resolve_safe(0xff); - // Start a timer to trigger at clock / 8 / 16 const attotime rate = clocks_to_attotime(8 * 16); m_timer = timer_alloc(FUNC(ym2148_device::serial_clock_tick), this); diff --git a/src/devices/machine/ym3802.cpp b/src/devices/machine/ym3802.cpp index 4a8f6a7ffae..39008a2ea15 100644 --- a/src/devices/machine/ym3802.cpp +++ b/src/devices/machine/ym3802.cpp @@ -23,7 +23,7 @@ ym3802_device::ym3802_device(const machine_config &mconfig, const char *tag, dev , device_serial_interface(mconfig, *this) , m_irq_handler(*this) , m_txd_handler(*this) - , m_rxd_handler(*this) + , m_rxd_handler(*this, 0xff) , m_reg(REG_MAX) , m_wdr(0) , m_irq_status(0) @@ -35,9 +35,6 @@ ym3802_device::ym3802_device(const machine_config &mconfig, const char *tag, dev void ym3802_device::device_start() { - m_irq_handler.resolve_safe(); - m_txd_handler.resolve_safe(); - m_rxd_handler.resolve_safe(0xff); m_midi_timer = timer_alloc(FUNC(ym3802_device::transmit_clk), this); m_midi_counter_timer = timer_alloc(FUNC(ym3802_device::midi_clk), this); save_item(NAME(m_reg)); diff --git a/src/devices/machine/z8038.cpp b/src/devices/machine/z8038.cpp index 11662b2464f..05e3997187f 100644 --- a/src/devices/machine/z8038.cpp +++ b/src/devices/machine/z8038.cpp @@ -59,13 +59,6 @@ template void z8038_device::zbus_map<2>(address_map &map); void z8038_device::device_start() { - m_out_int_cb.resolve_all_safe(); - - m_out_E_cb.resolve_safe(); - m_out_F_cb.resolve_safe(); - m_out_H_cb.resolve_safe(); - m_out_J_cb.resolve_safe(); - save_item(NAME(m_control_2)); save_item(NAME(m_control_3)); diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp index e88a78acb71..735ea85b8e7 100644 --- a/src/devices/machine/z80ctc.cpp +++ b/src/devices/machine/z80ctc.cpp @@ -135,20 +135,6 @@ void z80ctc_device::device_add_mconfig(machine_config &config) } -//------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void z80ctc_device::device_resolve_objects() -{ - // resolve callbacks - m_intr_cb.resolve_safe(); - m_zc_cb.resolve_all_safe(); -} - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h index 62ac96d1a90..9f0d5aa410f 100644 --- a/src/devices/machine/z80ctc.h +++ b/src/devices/machine/z80ctc.h @@ -50,7 +50,7 @@ public: z80ctc_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; @@ -100,13 +100,12 @@ public: u16 get_channel_constant(int ch) const { return m_channel[ch]->m_tconst; } protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset_after_children() override; - // z80daisy_interface overrides + // z80daisy_interface implementation virtual int z80daisy_irq_state() override; virtual int z80daisy_irq_ack() override; virtual void z80daisy_irq_reti() override; diff --git a/src/devices/machine/z80daisy_generic.cpp b/src/devices/machine/z80daisy_generic.cpp index f91af3e076a..a7c74364426 100644 --- a/src/devices/machine/z80daisy_generic.cpp +++ b/src/devices/machine/z80daisy_generic.cpp @@ -39,9 +39,6 @@ z80daisy_generic_device::z80daisy_generic_device(const machine_config &mconfig, void z80daisy_generic_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - // register for save states save_item(NAME(m_int)); save_item(NAME(m_mask)); diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp index 4c31e52a567..7bcc98dd520 100644 --- a/src/devices/machine/z80dma.cpp +++ b/src/devices/machine/z80dma.cpp @@ -155,9 +155,9 @@ z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, dev , m_out_int_cb(*this) , m_out_ieo_cb(*this) , m_out_bao_cb(*this) - , m_in_mreq_cb(*this) + , m_in_mreq_cb(*this, 0) , m_out_mreq_cb(*this) - , m_in_iorq_cb(*this) + , m_in_iorq_cb(*this, 0) , m_out_iorq_cb(*this) { } @@ -169,16 +169,6 @@ z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, dev void z80dma_device::device_start() { - // resolve callbacks - m_out_busreq_cb.resolve_safe(); - m_out_int_cb.resolve_safe(); - m_out_ieo_cb.resolve_safe(); - m_out_bao_cb.resolve_safe(); - m_in_mreq_cb.resolve_safe(0); - m_out_mreq_cb.resolve_safe(); - m_in_iorq_cb.resolve_safe(0); - m_out_iorq_cb.resolve_safe(); - // allocate timer m_timer = timer_alloc(FUNC(z80dma_device::timerproc), this); diff --git a/src/devices/machine/z80pio.cpp b/src/devices/machine/z80pio.cpp index e1664055f21..4f40a1699f8 100644 --- a/src/devices/machine/z80pio.cpp +++ b/src/devices/machine/z80pio.cpp @@ -41,10 +41,10 @@ z80pio_device::z80pio_device(const machine_config &mconfig, const char *tag, dev device_t(mconfig, Z80PIO, tag, owner, clock), device_z80daisy_interface(mconfig, *this), m_out_int_cb(*this), - m_in_pa_cb(*this), + m_in_pa_cb(*this, 0), m_out_pa_cb(*this), m_out_ardy_cb(*this), - m_in_pb_cb(*this), + m_in_pb_cb(*this, 0), m_out_pb_cb(*this), m_out_brdy_cb(*this) { @@ -59,15 +59,6 @@ void z80pio_device::device_start() { m_port[PORT_A].start(this, PORT_A); m_port[PORT_B].start(this, PORT_B); - - // resolve callbacks - m_out_int_cb.resolve_safe(); - m_in_pa_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_out_ardy_cb.resolve_safe(); - m_in_pb_cb.resolve_safe(0); - m_out_pb_cb.resolve_safe(); - m_out_brdy_cb.resolve_safe(); } diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 4a033c6b5c7..c812375f9d5 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -479,24 +479,6 @@ scc8523l_device::scc8523l_device(const machine_config &mconfig, const char *tag, { } -//------------------------------------------------- -// device_resolve_objects - device-specific setup -//------------------------------------------------- -void z80scc_device::device_resolve_objects() -{ - LOG("%s\n", FUNCNAME); - - // resolve callbacks - m_out_txd_cb.resolve_all_safe(); - m_out_dtr_cb.resolve_all_safe(); - m_out_rts_cb.resolve_all_safe(); - m_out_wreq_cb.resolve_all_safe(); - m_out_sync_cb.resolve_all_safe(); - m_out_rxdrq_cb.resolve_all_safe(); - m_out_txdrq_cb.resolve_all_safe(); - m_out_int_cb.resolve_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h index 4ef274aba92..1468b4d0726 100644 --- a/src/devices/machine/z80scc.h +++ b/src/devices/machine/z80scc.h @@ -55,11 +55,7 @@ class z80scc_channel : public device_t, public: z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - - // device_serial_interface overrides + // device_serial_interface implementation virtual void tra_callback() override; virtual void tra_complete() override; virtual void rcv_callback() override; @@ -232,10 +228,10 @@ protected: REG_WR15_EXT_ST_INT_CTRL= 15 }; - emu_timer *m_baudtimer; - uint16_t m_brg_counter; - unsigned int m_brg_rate; - unsigned int m_delayed_tx_brg_change; + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + unsigned int get_brg_rate(); void update_baudtimer(); @@ -253,6 +249,11 @@ protected: void safe_transmit_register_reset(); void check_dma_request(); + emu_timer *m_baudtimer; + uint16_t m_brg_counter; + unsigned int m_brg_rate; + unsigned int m_delayed_tx_brg_change; + // receiver state uint8_t m_rx_data_fifo[8]; // receive data FIFO uint8_t m_rx_error_fifo[8]; // receive error FIFO @@ -296,6 +297,7 @@ protected: // SCC specifics int m_ph; // Point high command to access regs 08-0f uint8_t m_zc; + private: // helpers void out_txd_cb(int state); @@ -382,13 +384,12 @@ public: protected: z80scc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant); - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset_after_children() override; virtual void device_add_mconfig(machine_config &config) override; - // device_z80daisy_interface overrides + // device_z80daisy_interface implementation virtual int z80daisy_irq_state() override; virtual int z80daisy_irq_ack() override; virtual void z80daisy_irq_reti() override; diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp index 6c2def0a5d5..11d2f4e61d0 100644 --- a/src/devices/machine/z80sio.cpp +++ b/src/devices/machine/z80sio.cpp @@ -454,24 +454,6 @@ void z80sio_device::device_validity_check(validity_checker &valid) const osd_printf_error("Host CPU configured but not found.\n"); } -//------------------------------------------------- -// device_resolve_objects - device-specific setup -//------------------------------------------------- -void z80sio_device::device_resolve_objects() -{ - LOG("%s\n", FUNCNAME); - - // resolve callbacks - m_out_txd_cb.resolve_all_safe(); - m_out_dtr_cb.resolve_all_safe(); - m_out_rts_cb.resolve_all_safe(); - m_out_wrdy_cb.resolve_all_safe(); - m_out_sync_cb.resolve_all_safe(); - m_out_int_cb.resolve_safe(); - m_out_rxdrq_cb.resolve_all_safe(); - m_out_txdrq_cb.resolve_all_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/machine/z80sio.h b/src/devices/machine/z80sio.h index b00336b047a..3cfc04bab45 100644 --- a/src/devices/machine/z80sio.h +++ b/src/devices/machine/z80sio.h @@ -286,7 +286,7 @@ protected: uint32_t clock, uint8_t rr1_auto_reset); - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; @@ -528,14 +528,13 @@ public: protected: z80sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides + // device_t implementation virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; - // device_z80daisy_interface overrides + // device_z80daisy_interface implementation virtual int z80daisy_irq_state() override; virtual int z80daisy_irq_ack() override; virtual void z80daisy_irq_reti() override; @@ -599,10 +598,10 @@ public: protected: i8274_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device_t overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; - // device_z80daisy_interface overrides + // device_z80daisy_interface implementation virtual int z80daisy_irq_ack() override; virtual void z80daisy_irq_reti() override; @@ -628,7 +627,7 @@ public: void write(offs_t offset, uint8_t data); protected: - // device_t overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; private: diff --git a/src/devices/machine/z80sti.cpp b/src/devices/machine/z80sti.cpp index a77ead83c04..e16a9b9578d 100644 --- a/src/devices/machine/z80sti.cpp +++ b/src/devices/machine/z80sti.cpp @@ -81,7 +81,7 @@ z80sti_device::z80sti_device(const machine_config &mconfig, const char *tag, dev , device_serial_interface(mconfig, *this) , device_z80daisy_interface(mconfig, *this) , m_out_int_cb(*this) - , m_in_gpio_cb(*this) + , m_in_gpio_cb(*this, 0) , m_out_gpio_cb(*this) , m_out_so_cb(*this) , m_out_tao_cb(*this) @@ -110,16 +110,6 @@ z80sti_device::z80sti_device(const machine_config &mconfig, const char *tag, dev void z80sti_device::device_start() { - // resolve callbacks - m_out_int_cb.resolve_safe(); - m_in_gpio_cb.resolve_safe(0); - m_out_gpio_cb.resolve_safe(); - m_out_so_cb.resolve_safe(); - m_out_tao_cb.resolve_safe(); - m_out_tbo_cb.resolve_safe(); - m_out_tco_cb.resolve_safe(); - m_out_tdo_cb.resolve_safe(); - // create the counter timers m_timer[TIMER_A] = timer_alloc(FUNC(z80sti_device::timer_count), this); m_timer[TIMER_B] = timer_alloc(FUNC(z80sti_device::timer_count), this); diff --git a/src/devices/machine/z8536.cpp b/src/devices/machine/z8536.cpp index c30868d0dbb..cb1fa74adb6 100644 --- a/src/devices/machine/z8536.cpp +++ b/src/devices/machine/z8536.cpp @@ -779,11 +779,11 @@ void cio_base_device::external_port_w(int port, int bit, int state) cio_base_device::cio_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock), m_write_irq(*this), - m_read_pa(*this), + m_read_pa(*this, 0), m_write_pa(*this), - m_read_pb(*this), + m_read_pb(*this, 0), m_write_pb(*this), - m_read_pc(*this), + m_read_pc(*this, 0), m_write_pc(*this), m_irq(CLEAR_LINE) { @@ -829,15 +829,6 @@ void cio_base_device::device_start() m_timer = timer_alloc(FUNC(cio_base_device::advance_counters), this); m_timer->adjust(attotime::from_hz(clock() / 2), 0, attotime::from_hz(clock() / 2)); - // resolve callbacks - m_write_irq.resolve_safe(); - m_read_pa.resolve_safe(0); - m_write_pa.resolve_safe(); - m_read_pb.resolve_safe(0); - m_write_pb.resolve_safe(); - m_read_pc.resolve_safe(0); - m_write_pc.resolve_safe(); - save_item(NAME(m_irq)); save_item(NAME(m_register)); save_item(NAME(m_input)); -- cgit v1.2.3-70-g09d2