diff options
| author | 2023-06-17 01:10:05 +1000 | |
|---|---|---|
| committer | 2023-06-17 01:10:05 +1000 | |
| commit | e9c1f4a42a6758a6fb75403e28c7dc6cf869081c (patch) | |
| tree | 8e0b6d960bed4baec2408c9ab950218592ef33ec | |
| parent | c1ceb6e016763537c5109cc76fe5d1b4ae72fdb3 (diff) | |
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.
1181 files changed, 2579 insertions, 8722 deletions
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp index b1bd0587c24..f8036fa2be9 100644 --- a/src/devices/bus/a1bus/a1bus.cpp +++ b/src/devices/bus/a1bus/a1bus.cpp @@ -87,13 +87,6 @@ a1bus_device::a1bus_device(const machine_config &mconfig, device_type type, cons // device_start - device-specific startup //------------------------------------------------- -void a1bus_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); -} - void a1bus_device::device_start() { // clear slot diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h index 34b5ada79e3..e012c589f02 100644 --- a/src/devices/bus/a1bus/a1bus.h +++ b/src/devices/bus/a1bus/a1bus.h @@ -38,7 +38,7 @@ public: protected: a1bus_slot_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; @@ -77,8 +77,7 @@ public: protected: a1bus_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/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp index e8e8a973e99..d591accf73e 100644 --- a/src/devices/bus/a2bus/a2bus.cpp +++ b/src/devices/bus/a2bus/a2bus.cpp @@ -152,15 +152,6 @@ a2bus_device::a2bus_device(const machine_config &mconfig, device_type type, cons // device_start - device-specific startup //------------------------------------------------- -void a2bus_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); - m_out_inh_cb.resolve_safe(); - m_out_dma_cb.resolve_safe(); -} - void a2bus_device::device_start() { // clear slots diff --git a/src/devices/bus/a2bus/a2bus.h b/src/devices/bus/a2bus/a2bus.h index f838d865073..32b280fd006 100644 --- a/src/devices/bus/a2bus/a2bus.h +++ b/src/devices/bus/a2bus/a2bus.h @@ -59,7 +59,7 @@ public: protected: a2bus_slot_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; @@ -106,8 +106,7 @@ public: protected: a2bus_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/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp index 004fdc760e0..1b37eecde0a 100644 --- a/src/devices/bus/a2bus/a2eauxslot.cpp +++ b/src/devices/bus/a2bus/a2eauxslot.cpp @@ -72,19 +72,6 @@ a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void a2eauxslot_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/bus/a2bus/a2eauxslot.h b/src/devices/bus/a2bus/a2eauxslot.h index a527b616d6c..185e1deede5 100644 --- a/src/devices/bus/a2bus/a2eauxslot.h +++ b/src/devices/bus/a2bus/a2eauxslot.h @@ -42,7 +42,7 @@ public: a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override { } @@ -81,8 +81,7 @@ public: protected: a2eauxslot_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; // internal state diff --git a/src/devices/bus/a2bus/a2mcms.cpp b/src/devices/bus/a2bus/a2mcms.cpp index d4e699361de..3455fa3d8fc 100644 --- a/src/devices/bus/a2bus/a2mcms.cpp +++ b/src/devices/bus/a2bus/a2mcms.cpp @@ -205,7 +205,6 @@ mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_ void mcms_device::device_start() { - m_write_irq.resolve(); m_stream = stream_alloc(0, 2, 31250); m_timer = timer_alloc(FUNC(mcms_device::set_irq_tick), this); m_clrtimer = timer_alloc(FUNC(mcms_device::clr_irq_tick), this); diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp index e72308c4565..1e9cd5e9acd 100644 --- a/src/devices/bus/a800/a800_slot.cpp +++ b/src/devices/bus/a800/a800_slot.cpp @@ -198,12 +198,6 @@ void a800_cart_slot_device::device_start() m_space_mem = &space(AS_PROGRAM); } -void a800_cart_slot_device::device_resolve_objects() -{ - m_rd4_cb.resolve_safe(); - m_rd5_cb.resolve_safe(); -} - void a5200_cart_slot_device::device_start() { m_cart = get_card_device(); diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index 53de7be11ff..476a54a4f4d 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -143,7 +143,6 @@ protected: // device_t implementation virtual void device_start() override; - virtual void device_resolve_objects() override; virtual space_config_vector memory_space_config() const override; private: diff --git a/src/devices/bus/a800/a8sio.cpp b/src/devices/bus/a800/a8sio.cpp index 65f52308e26..c7e134a4e46 100644 --- a/src/devices/bus/a800/a8sio.cpp +++ b/src/devices/bus/a800/a8sio.cpp @@ -74,13 +74,6 @@ void a8sio_device::device_resolve_objects() m_device = get_card_device(); if (m_device) m_device->set_a8sio_device(this); - - // resolve callbacks - m_out_clock_in_cb.resolve_safe(); - m_out_data_in_cb.resolve_safe(); - m_out_proceed_cb.resolve_safe(); - m_out_audio_in_cb.resolve_safe(); - m_out_interrupt_cb.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/abcbus/abcbus.cpp b/src/devices/bus/abcbus/abcbus.cpp index 5e0adb49c3f..d02042720b7 100644 --- a/src/devices/bus/abcbus/abcbus.cpp +++ b/src/devices/bus/abcbus/abcbus.cpp @@ -71,18 +71,6 @@ abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char void abcbus_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_rdy.resolve_safe(); - m_write_resin.resolve_safe(); - m_write_pren.resolve_safe(); - m_write_trrq.resolve_safe(); - m_write_xint2.resolve_safe(); - m_write_xint3.resolve_safe(); - m_write_xint4.resolve_safe(); - m_write_xint5.resolve_safe(); } diff --git a/src/devices/bus/abckb/abckb.cpp b/src/devices/bus/abckb/abckb.cpp index aa8ff17117e..efe3ef757e3 100644 --- a/src/devices/bus/abckb/abckb.cpp +++ b/src/devices/bus/abckb/abckb.cpp @@ -61,11 +61,6 @@ abc_keyboard_port_device::abc_keyboard_port_device(const machine_config &mconfig void abc_keyboard_port_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_out_rx_handler.resolve_safe(); - m_out_trxc_handler.resolve_safe(); - m_out_keydown_handler.resolve_safe(); } diff --git a/src/devices/bus/acorn/bus.cpp b/src/devices/bus/acorn/bus.cpp index ec4218cead3..8f3a5fcde07 100644 --- a/src/devices/bus/acorn/bus.cpp +++ b/src/devices/bus/acorn/bus.cpp @@ -83,9 +83,6 @@ void acorn_bus_device::add_slot(acorn_bus_slot_device &slot) void acorn_bus_device::device_start() { - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp index 3e519125f57..837da2b6e77 100644 --- a/src/devices/bus/adam/exp.cpp +++ b/src/devices/bus/adam/exp.cpp @@ -67,9 +67,6 @@ adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mco void adam_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); } diff --git a/src/devices/bus/adb/adb.cpp b/src/devices/bus/adb/adb.cpp index cdf0810369a..28d836ec3ff 100644 --- a/src/devices/bus/adb/adb.cpp +++ b/src/devices/bus/adb/adb.cpp @@ -52,8 +52,6 @@ adb_device::adb_device(const machine_config &mconfig, device_type type, const ch void adb_device::device_start() { - m_adb_cb.resolve_safe(); - m_poweron_cb.resolve_safe(); } void adb_device::device_reset() diff --git a/src/devices/bus/amiga/keyboard/keyboard.cpp b/src/devices/bus/amiga/keyboard/keyboard.cpp index 073661028c1..a7c52973239 100644 --- a/src/devices/bus/amiga/keyboard/keyboard.cpp +++ b/src/devices/bus/amiga/keyboard/keyboard.cpp @@ -56,11 +56,6 @@ void amiga_keyboard_bus_device::device_start() { // get connected keyboard m_kbd = get_card_device(); - - // resolve callbacks - m_kclk_handler.resolve_safe(); - m_kdat_handler.resolve_safe(); - m_krst_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/amiga/zorro/zorro.cpp b/src/devices/bus/amiga/zorro/zorro.cpp index f13a2ded4fa..e83f939760e 100644 --- a/src/devices/bus/amiga/zorro/zorro.cpp +++ b/src/devices/bus/amiga/zorro/zorro.cpp @@ -74,20 +74,6 @@ zorro_bus_device_base::zorro_bus_device_base(const machine_config &mconfig, devi } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void zorro_bus_device_base::device_resolve_objects() -{ - // resolve callbacks - m_ovr_handler.resolve_safe(); - m_int2_handler.resolve_safe(); - m_int6_handler.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -124,21 +110,6 @@ exp_slot_device::exp_slot_device(const machine_config &mconfig, device_type type } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void exp_slot_device::device_resolve_objects() -{ - // call base device - zorro_bus_device_base::device_resolve_objects(); - - // resolve callbacks - m_ipl_handler.resolve_safe(); -} - -//------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- @@ -209,24 +180,6 @@ zorro2_bus_device::~zorro2_bus_device() } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void zorro2_bus_device::device_resolve_objects() -{ - // call base device - zorro_bus_device_base::device_resolve_objects(); - - // resolve callbacks - m_eint1_handler.resolve_safe(); - m_eint4_handler.resolve_safe(); - m_eint5_handler.resolve_safe(); - m_eint7_handler.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific start //------------------------------------------------- diff --git a/src/devices/bus/amiga/zorro/zorro.h b/src/devices/bus/amiga/zorro/zorro.h index 24ee21459e8..667ac6cbbc9 100644 --- a/src/devices/bus/amiga/zorro/zorro.h +++ b/src/devices/bus/amiga/zorro/zorro.h @@ -182,7 +182,7 @@ public: protected: zorro_slot_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 ATTR_COLD; // configuration @@ -223,8 +223,7 @@ protected: // construction/destruction zorro_bus_device_base(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 ATTR_COLD; + // device_t implementation virtual void device_start() override ATTR_COLD; private: @@ -257,8 +256,7 @@ public: protected: exp_slot_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 ATTR_COLD; + // device_t implementation virtual void device_reset() override; private: @@ -301,8 +299,7 @@ public: protected: zorro2_bus_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 ATTR_COLD; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/bus/apricot/expansion/expansion.cpp b/src/devices/bus/apricot/expansion/expansion.cpp index ee86b76412f..606e2b913fe 100644 --- a/src/devices/bus/apricot/expansion/expansion.cpp +++ b/src/devices/bus/apricot/expansion/expansion.cpp @@ -86,13 +86,6 @@ apricot_expansion_bus_device::~apricot_expansion_bus_device() void apricot_expansion_bus_device::device_start() { - // resolve callbacks - m_dma1_handler.resolve_safe(); - m_dma2_handler.resolve_safe(); - m_ext1_handler.resolve_safe(); - m_ext2_handler.resolve_safe(); - m_int2_handler.resolve_safe(); - m_int3_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/apricot/keyboard/keyboard.cpp b/src/devices/bus/apricot/keyboard/keyboard.cpp index b76c8e0835b..bb63a0e20c5 100644 --- a/src/devices/bus/apricot/keyboard/keyboard.cpp +++ b/src/devices/bus/apricot/keyboard/keyboard.cpp @@ -50,9 +50,6 @@ void apricot_keyboard_bus_device::device_start() { // get connected keyboard m_kbd = get_card_device(); - - // resolve callbacks - m_in_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/apricot/video/video.cpp b/src/devices/bus/apricot/video/video.cpp index 13e91b04a58..8543ff4d571 100644 --- a/src/devices/bus/apricot/video/video.cpp +++ b/src/devices/bus/apricot/video/video.cpp @@ -49,9 +49,6 @@ void apricot_video_slot_device::device_start() { // get inserted module m_card = get_card_device(); - - // resolve callbacks - m_apvid_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/aquarius/slot.cpp b/src/devices/bus/aquarius/slot.cpp index 67ccbba65b0..90ca85a38d1 100644 --- a/src/devices/bus/aquarius/slot.cpp +++ b/src/devices/bus/aquarius/slot.cpp @@ -73,10 +73,6 @@ aquarius_cartridge_slot_device::aquarius_cartridge_slot_device(const machine_con void aquarius_cartridge_slot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/archimedes/econet/slot.cpp b/src/devices/bus/archimedes/econet/slot.cpp index c15e13698c3..c6417eeb268 100644 --- a/src/devices/bus/archimedes/econet/slot.cpp +++ b/src/devices/bus/archimedes/econet/slot.cpp @@ -57,9 +57,6 @@ archimedes_econet_slot_device::archimedes_econet_slot_device(const machine_confi void archimedes_econet_slot_device::device_start() { m_device = get_card_device(); - - // resolve callbacks - m_efiq_handler.resolve_safe(); } diff --git a/src/devices/bus/archimedes/podule/slot.cpp b/src/devices/bus/archimedes/podule/slot.cpp index 725eae79ea5..2c5ecd61212 100644 --- a/src/devices/bus/archimedes/podule/slot.cpp +++ b/src/devices/bus/archimedes/podule/slot.cpp @@ -96,13 +96,6 @@ void archimedes_exp_device::memc_map(address_map &map) // device_start - device-specific startup //------------------------------------------------- -void archimedes_exp_device::device_resolve_objects() -{ - // resolve callbacks - m_out_pirq_cb.resolve_safe(); - m_out_pfiq_cb.resolve_safe(); -} - void archimedes_exp_device::device_start() { m_ioc = &space(AS_IO); diff --git a/src/devices/bus/archimedes/podule/slot.h b/src/devices/bus/archimedes/podule/slot.h index eca2c54865f..b05425b9b70 100644 --- a/src/devices/bus/archimedes/podule/slot.h +++ b/src/devices/bus/archimedes/podule/slot.h @@ -44,7 +44,7 @@ public: archimedes_podule_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; @@ -91,12 +91,11 @@ public: void pfiq_w(int state) { m_out_pfiq_cb(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_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; private: diff --git a/src/devices/bus/astrocde/accessory.cpp b/src/devices/bus/astrocde/accessory.cpp index fb047e660d8..b2e5fd6cf5c 100644 --- a/src/devices/bus/astrocde/accessory.cpp +++ b/src/devices/bus/astrocde/accessory.cpp @@ -66,8 +66,6 @@ void astrocade_accessory_port_device::device_resolve_objects() m_device = get_card_device(); if (m_device) m_device->set_screen(m_screen); - - m_ltpen_handler.resolve_safe(); } void astrocade_accessory_port_device::device_start() diff --git a/src/devices/bus/astrocde/ctrl.cpp b/src/devices/bus/astrocde/ctrl.cpp index 94bfd34f7f9..07aa620aba6 100644 --- a/src/devices/bus/astrocde/ctrl.cpp +++ b/src/devices/bus/astrocde/ctrl.cpp @@ -72,8 +72,6 @@ astrocade_ctrl_port_device::~astrocade_ctrl_port_device() void astrocade_ctrl_port_device::device_resolve_objects() { m_device = get_card_device(); - - m_ltpen_handler.resolve_safe(); } void astrocade_ctrl_port_device::device_start() diff --git a/src/devices/bus/ata/atahle.cpp b/src/devices/bus/ata/atahle.cpp index fecaf717153..6621c44cfe5 100644 --- a/src/devices/bus/ata/atahle.cpp +++ b/src/devices/bus/ata/atahle.cpp @@ -74,11 +74,6 @@ void ata_hle_device::device_start() { MINIMUM_COMMAND_TIME = attotime::from_usec(10); - m_irq_handler.resolve_safe(); - m_dmarq_handler.resolve_safe(); - m_dasp_handler.resolve_safe(); - m_pdiag_handler.resolve_safe(); - m_buffer.resize(sector_length()); save_item(NAME(m_buffer)); save_item(NAME(m_buffer_offset)); diff --git a/src/devices/bus/ata/ataintf.cpp b/src/devices/bus/ata/ataintf.cpp index 8bc7a99508d..54ae8dc646a 100644 --- a/src/devices/bus/ata/ataintf.cpp +++ b/src/devices/bus/ata/ataintf.cpp @@ -230,10 +230,6 @@ ata_interface_device::ata_interface_device(const machine_config &mconfig, const void abstract_ata_interface_device::device_start() { - m_irq_handler.resolve_safe(); - m_dmarq_handler.resolve_safe(); - m_dasp_handler.resolve_safe(); - for (int i = 0; i < 2; i++) { m_irq[i] = 0; diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index 52c823771dd..ede63f18ead 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -58,10 +58,6 @@ bbc_1mhzbus_slot_device::bbc_1mhzbus_slot_device(const machine_config &mconfig, void bbc_1mhzbus_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/analogue/analogue.cpp b/src/devices/bus/bbc/analogue/analogue.cpp index 6dce6a36e99..a39a01716f0 100644 --- a/src/devices/bus/bbc/analogue/analogue.cpp +++ b/src/devices/bus/bbc/analogue/analogue.cpp @@ -57,9 +57,6 @@ bbc_analogue_slot_device::bbc_analogue_slot_device(const machine_config &mconfig void bbc_analogue_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_lpstb_handler.resolve_safe(); } uint8_t bbc_analogue_slot_device::ch_r(int channel) diff --git a/src/devices/bus/bbc/exp/exp.cpp b/src/devices/bus/bbc/exp/exp.cpp index 4209249a0f9..8339197eccb 100644 --- a/src/devices/bus/bbc/exp/exp.cpp +++ b/src/devices/bus/bbc/exp/exp.cpp @@ -60,13 +60,6 @@ bbc_exp_slot_device::bbc_exp_slot_device(const machine_config &mconfig, const ch void bbc_exp_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - - m_cb1_handler.resolve_safe(); - m_cb2_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/fdc/fdc.cpp b/src/devices/bus/bbc/fdc/fdc.cpp index abfc5e109b1..e13993d7b11 100644 --- a/src/devices/bus/bbc/fdc/fdc.cpp +++ b/src/devices/bus/bbc/fdc/fdc.cpp @@ -58,10 +58,6 @@ bbc_fdc_slot_device::bbc_fdc_slot_device(const machine_config &mconfig, const ch void bbc_fdc_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_intrq_cb.resolve_safe(); - m_drq_cb.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/bbc/internal/internal.cpp b/src/devices/bus/bbc/internal/internal.cpp index 50e0e6e0a12..4adad689824 100644 --- a/src/devices/bus/bbc/internal/internal.cpp +++ b/src/devices/bus/bbc/internal/internal.cpp @@ -69,10 +69,6 @@ bbc_internal_slot_device::bbc_internal_slot_device(const machine_config &mconfig void bbc_internal_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/joyport/joyport.cpp b/src/devices/bus/bbc/joyport/joyport.cpp index 59173030724..44387a80deb 100644 --- a/src/devices/bus/bbc/joyport/joyport.cpp +++ b/src/devices/bus/bbc/joyport/joyport.cpp @@ -57,10 +57,6 @@ bbc_joyport_slot_device::bbc_joyport_slot_device(const machine_config &mconfig, void bbc_joyport_slot_device::device_start() { m_device = get_card_device(); - - // resolve callbacks - m_cb1_handler.resolve_safe(); - m_cb2_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/modem/modem.cpp b/src/devices/bus/bbc/modem/modem.cpp index e3b4d164fac..6dfcf4e47f1 100644 --- a/src/devices/bus/bbc/modem/modem.cpp +++ b/src/devices/bus/bbc/modem/modem.cpp @@ -57,9 +57,6 @@ bbc_modem_slot_device::bbc_modem_slot_device(const machine_config &mconfig, cons void bbc_modem_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp index 505b7a25030..3d5a0011a45 100644 --- a/src/devices/bus/bbc/tube/tube.cpp +++ b/src/devices/bus/bbc/tube/tube.cpp @@ -59,9 +59,6 @@ bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const void bbc_tube_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); } diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp index 6bf5476db9c..0c189608699 100644 --- a/src/devices/bus/bbc/userport/userport.cpp +++ b/src/devices/bus/bbc/userport/userport.cpp @@ -69,10 +69,6 @@ bbc_userport_slot_device::bbc_userport_slot_device(const machine_config &mconfig void bbc_userport_slot_device::device_start() { m_device = get_card_device(); - - // resolve callbacks - m_cb1_handler.resolve_safe(); - m_cb2_handler.resolve_safe(); } diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp index 2eab8a3f008..8c564cc2bb8 100644 --- a/src/devices/bus/bml3/bml3bus.cpp +++ b/src/devices/bus/bml3/bml3bus.cpp @@ -121,10 +121,6 @@ bml3bus_device::bml3bus_device(const machine_config &mconfig, device_type type, void bml3bus_device::device_start() { - // resolve callbacks - m_out_nmi_cb.resolve_safe(); - m_out_irq_cb.resolve_safe(); - m_out_firq_cb.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp index 5525204d1ee..e1c7c866a3e 100644 --- a/src/devices/bus/c64/exp.cpp +++ b/src/devices/bus/c64/exp.cpp @@ -60,7 +60,7 @@ c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconf device_t(mconfig, C64_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface<device_c64_expansion_card_interface>(mconfig, *this), device_cartrom_image_interface(mconfig, *this), - m_read_dma_cd(*this), + m_read_dma_cd(*this, 0), m_write_dma_cd(*this), m_write_irq(*this), m_write_nmi(*this), @@ -77,14 +77,6 @@ c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconf void c64_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_read_dma_cd.resolve_safe(0); - m_write_dma_cd.resolve_safe(); - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_dma.resolve_safe(); - m_write_reset.resolve_safe(); } diff --git a/src/devices/bus/cbm2/user.cpp b/src/devices/bus/cbm2/user.cpp index 5dc12567096..8aa9153e30e 100644 --- a/src/devices/bus/cbm2/user.cpp +++ b/src/devices/bus/cbm2/user.cpp @@ -62,12 +62,6 @@ cbm2_user_port_device::cbm2_user_port_device(const machine_config &mconfig, cons void cbm2_user_port_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_sp.resolve_safe(); - m_write_cnt.resolve_safe(); - m_write_flag.resolve_safe(); } diff --git a/src/devices/bus/cbmiec/cbmiec.cpp b/src/devices/bus/cbmiec/cbmiec.cpp index 03b9837779f..43faf6e17a3 100644 --- a/src/devices/bus/cbmiec/cbmiec.cpp +++ b/src/devices/bus/cbmiec/cbmiec.cpp @@ -302,12 +302,6 @@ cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, d void cbm_iec_device::device_start() { - // resolve callbacks - m_write_srq.resolve_safe(); - m_write_atn.resolve_safe(); - m_write_clk.resolve_safe(); - m_write_data.resolve_safe(); - m_write_reset.resolve_safe(); } diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 9077d8cc4ea..5f6dfce58a7 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -88,18 +88,6 @@ void pc9801_slot_device::device_config_complete() //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void pc9801_slot_device::device_resolve_objects() -{ - m_int_callback.resolve_all_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h index ab7085dfa86..e59f76bf096 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -116,10 +116,9 @@ public: void flush_install_io(const char *client_tag, u16 old_io, u16 new_io, u16 size, read8sm_delegate rhandler, write8sm_delegate whandler); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_config_complete() override; - virtual void device_resolve_objects() override; private: // device_pc9801_slot_card_interface *m_card; diff --git a/src/devices/bus/centronics/ctronics.cpp b/src/devices/bus/centronics/ctronics.cpp index 1c23644fa1b..156c4e3578a 100644 --- a/src/devices/bus/centronics/ctronics.cpp +++ b/src/devices/bus/centronics/ctronics.cpp @@ -51,25 +51,6 @@ void centronics_device::device_reset() void centronics_device::device_start() { - m_strobe_handler.resolve_safe(); - m_data0_handler.resolve_safe(); - m_data1_handler.resolve_safe(); - m_data2_handler.resolve_safe(); - m_data3_handler.resolve_safe(); - m_data4_handler.resolve_safe(); - m_data5_handler.resolve_safe(); - m_data6_handler.resolve_safe(); - m_data7_handler.resolve_safe(); - m_ack_handler.resolve_safe(); - m_busy_handler.resolve_safe(); - m_perror_handler.resolve_safe(); - m_select_handler.resolve_safe(); - m_autofd_handler.resolve_safe(); - m_fault_handler.resolve_safe(); - m_init_handler.resolve_safe(); - m_sense_handler.resolve_safe(); - m_select_in_handler.resolve_safe(); - m_sense_handler(0); // pull up diff --git a/src/devices/bus/cgenie/expansion/expansion.cpp b/src/devices/bus/cgenie/expansion/expansion.cpp index d35d75401bd..577c8a4409b 100644 --- a/src/devices/bus/cgenie/expansion/expansion.cpp +++ b/src/devices/bus/cgenie/expansion/expansion.cpp @@ -53,10 +53,6 @@ cg_exp_slot_device::~cg_exp_slot_device() void cg_exp_slot_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - m_reset_handler.resolve_safe(); } diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 5bb45dba7a9..2c385890311 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -152,7 +152,6 @@ void cococart_slot_device::device_start() m_cart_line.value = line_value::CLEAR; m_cart_line.line = 0; m_cart_line.q_count = 0; - m_cart_callback.resolve_safe(); m_cart_line.callback = &m_cart_callback; m_nmi_line.timer_index = 0; @@ -160,7 +159,6 @@ void cococart_slot_device::device_start() m_nmi_line.value = line_value::CLEAR; m_nmi_line.line = 0; m_nmi_line.q_count = 0; - m_nmi_callback.resolve_safe(); m_nmi_line.callback = &m_nmi_callback; m_halt_line.timer_index = 0; @@ -168,7 +166,6 @@ void cococart_slot_device::device_start() m_halt_line.value = line_value::CLEAR; m_halt_line.line = 0; m_halt_line.q_count = 0; - m_halt_callback.resolve_safe(); m_halt_line.callback = &m_halt_callback; m_cart = get_card_device(); diff --git a/src/devices/bus/coco/meb_intrf.cpp b/src/devices/bus/coco/meb_intrf.cpp index 48e4b02d27f..4a70daf9cb0 100644 --- a/src/devices/bus/coco/meb_intrf.cpp +++ b/src/devices/bus/coco/meb_intrf.cpp @@ -67,7 +67,6 @@ distomeb_slot_device::distomeb_slot_device(const machine_config &mconfig, const void distomeb_slot_device::device_start() { m_cart = get_card_device(); - m_cart_callback.resolve_safe(); save_item(NAME(m_cart_line)); } diff --git a/src/devices/bus/coleco/controller/ctrl.cpp b/src/devices/bus/coleco/controller/ctrl.cpp index 80b5968eb03..2a9cb9baadd 100644 --- a/src/devices/bus/coleco/controller/ctrl.cpp +++ b/src/devices/bus/coleco/controller/ctrl.cpp @@ -61,8 +61,6 @@ colecovision_control_port_device::colecovision_control_port_device(const machine void colecovision_control_port_device::device_start() { m_device = get_card_device(); - - m_write_irq.resolve_safe(); } diff --git a/src/devices/bus/compis/graphics.cpp b/src/devices/bus/compis/graphics.cpp index ad9291dee65..059f19b6517 100644 --- a/src/devices/bus/compis/graphics.cpp +++ b/src/devices/bus/compis/graphics.cpp @@ -54,9 +54,6 @@ compis_graphics_slot_device::compis_graphics_slot_device(const machine_config &m void compis_graphics_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_dma_request.resolve_safe(); } diff --git a/src/devices/bus/comx35/exp.cpp b/src/devices/bus/comx35/exp.cpp index d358c0f7e4d..6848ade4f92 100644 --- a/src/devices/bus/comx35/exp.cpp +++ b/src/devices/bus/comx35/exp.cpp @@ -58,9 +58,6 @@ comx_expansion_slot_device::comx_expansion_slot_device(const machine_config &mco void comx_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); } diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp index c4761f44e7a..c625ed4689e 100644 --- a/src/devices/bus/cpc/cpcexp.cpp +++ b/src/devices/bus/cpc/cpcexp.cpp @@ -65,13 +65,6 @@ cpc_expansion_slot_device::~cpc_expansion_slot_device() void cpc_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); - m_out_reset_cb.resolve_safe(); - m_out_romdis_cb.resolve_safe(); - m_out_rom_select.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/dmv/dmvbus.cpp b/src/devices/bus/dmv/dmvbus.cpp index 3b828de41a1..a2a51092f81 100644 --- a/src/devices/bus/dmv/dmvbus.cpp +++ b/src/devices/bus/dmv/dmvbus.cpp @@ -199,7 +199,7 @@ device_dmvslot_interface::~device_dmvslot_interface() dmvcart_slot_device::dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMVCART_SLOT, tag, owner, clock), device_single_card_slot_interface<device_dmvslot_interface>(mconfig, *this), - m_prog_read_cb(*this), + m_prog_read_cb(*this, 0), m_prog_write_cb(*this), m_out_int_cb(*this), m_out_irq_cb(*this), @@ -226,13 +226,6 @@ dmvcart_slot_device::~dmvcart_slot_device() void dmvcart_slot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_prog_read_cb.resolve_safe(0); - m_prog_write_cb.resolve_safe(); - m_out_int_cb.resolve_safe(); - m_out_irq_cb.resolve_safe(); - m_out_thold_cb.resolve_safe(); } /*------------------------------------------------- diff --git a/src/devices/bus/ecbbus/ecbbus.cpp b/src/devices/bus/ecbbus/ecbbus.cpp index 5eaeda9f284..a59c0eede84 100644 --- a/src/devices/bus/ecbbus/ecbbus.cpp +++ b/src/devices/bus/ecbbus/ecbbus.cpp @@ -96,9 +96,6 @@ ecbbus_device::ecbbus_device(const machine_config &mconfig, const char *tag, dev void ecbbus_device::device_start() { - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); } diff --git a/src/devices/bus/econet/econet.cpp b/src/devices/bus/econet/econet.cpp index 49fda7dbefa..5571dd3a505 100644 --- a/src/devices/bus/econet/econet.cpp +++ b/src/devices/bus/econet/econet.cpp @@ -191,9 +191,6 @@ econet_device::econet_device(const machine_config &mconfig, const char *tag, dev void econet_device::device_start() { - // resolve callbacks - m_write_clk.resolve_safe(); - m_write_data.resolve_safe(); } diff --git a/src/devices/bus/einstein/pipe/pipe.cpp b/src/devices/bus/einstein/pipe/pipe.cpp index 5ec71fc1744..05196ac2d49 100644 --- a/src/devices/bus/einstein/pipe/pipe.cpp +++ b/src/devices/bus/einstein/pipe/pipe.cpp @@ -80,11 +80,6 @@ void tatung_pipe_device::device_start() { // get inserted module m_card = get_card_device(); - - // resolve callbacks - m_int_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - m_reset_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/einstein/userport/userport.cpp b/src/devices/bus/einstein/userport/userport.cpp index 0a464e28ac7..dac68cc1181 100644 --- a/src/devices/bus/einstein/userport/userport.cpp +++ b/src/devices/bus/einstein/userport/userport.cpp @@ -51,9 +51,6 @@ einstein_userport_device::~einstein_userport_device() void einstein_userport_device::device_start() { - // resolve callbacks - m_bstb_handler.resolve_safe(); - m_card = get_card_device(); } diff --git a/src/devices/bus/electron/cart/slot.cpp b/src/devices/bus/electron/cart/slot.cpp index fa0c87fcf9d..76ea4a63cdc 100644 --- a/src/devices/bus/electron/cart/slot.cpp +++ b/src/devices/bus/electron/cart/slot.cpp @@ -111,10 +111,6 @@ electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig void electron_cartslot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } diff --git a/src/devices/bus/electron/exp.cpp b/src/devices/bus/electron/exp.cpp index 6e9b1c6a2e4..794e2e0df96 100644 --- a/src/devices/bus/electron/exp.cpp +++ b/src/devices/bus/electron/exp.cpp @@ -57,10 +57,6 @@ electron_expansion_slot_device::electron_expansion_slot_device(const machine_con void electron_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } diff --git a/src/devices/bus/ep64/exp.cpp b/src/devices/bus/ep64/exp.cpp index ebd423cfc7f..aff87fc77cc 100644 --- a/src/devices/bus/ep64/exp.cpp +++ b/src/devices/bus/ep64/exp.cpp @@ -63,11 +63,6 @@ ep64_expansion_bus_slot_device::ep64_expansion_bus_slot_device(const machine_con void ep64_expansion_bus_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_wait.resolve_safe(); } diff --git a/src/devices/bus/epson_qx/keyboard/keyboard.cpp b/src/devices/bus/epson_qx/keyboard/keyboard.cpp index 8a2669e41da..6316313fc9d 100644 --- a/src/devices/bus/epson_qx/keyboard/keyboard.cpp +++ b/src/devices/bus/epson_qx/keyboard/keyboard.cpp @@ -50,8 +50,6 @@ keyboard_port_device::keyboard_port_device(const machine_config &mconfig, const void keyboard_port_device::device_start() { - // resolve callbacks - m_txd_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/epson_qx/option.cpp b/src/devices/bus/epson_qx/option.cpp index de97df07e6a..a22a20236b3 100644 --- a/src/devices/bus/epson_qx/option.cpp +++ b/src/devices/bus/epson_qx/option.cpp @@ -30,9 +30,9 @@ option_slot_device::option_slot_device(const machine_config &mconfig, const char device_single_card_slot_interface<device_option_expansion_interface>(mconfig, *this), m_bus(*this, finder_base::DUMMY_TAG), m_dmas_w_cb(*this), - m_dmas_r_cb(*this), + m_dmas_r_cb(*this, 0xff), m_dmaf_w_cb(*this), - m_dmaf_r_cb(*this), + m_dmaf_r_cb(*this, 0), m_eopf_cb(*this), m_eops_cb(*this), m_slot(-1) @@ -44,14 +44,6 @@ option_slot_device::option_slot_device(const machine_config &mconfig, const char //------------------------------------------------- void option_slot_device::device_start() { - m_dmas_w_cb.resolve_safe(); - m_dmas_r_cb.resolve_safe(0xff); - m_dmaf_w_cb.resolve(); - m_dmaf_r_cb.resolve(); - - m_eopf_cb.resolve_safe(); - m_eops_cb.resolve_safe(); - device_option_expansion_interface *const intf(get_card_device()); if (intf) { intf->set_option_bus(*m_bus, m_slot); @@ -108,13 +100,6 @@ void option_bus_device::add_slot(option_slot_device &slot) //------------------------------------------------- void option_bus_device::device_start() { - m_inth1_cb.resolve_safe(); - m_inth2_cb.resolve_safe(); - m_intl_cb.resolve_all_safe(); - m_drqf_cb.resolve_safe(); - m_drqs_cb.resolve_all_safe(); - m_rdyf_cb.resolve_safe(); - m_rdys_cb.resolve_safe(); } //------------------------------------------------- @@ -132,9 +117,7 @@ void option_bus_device::device_reset() void option_bus_device::dackf_w(uint8_t data) { for (int i = 0; i < m_slot_list.size(); ++i) { - if (!m_slot_list[i]->m_dmaf_w_cb.isnull()) { - m_slot_list[i]->m_dmaf_w_cb(data); - } + m_slot_list[i]->m_dmaf_w_cb(data); } } @@ -143,7 +126,7 @@ uint8_t option_bus_device::dackf_r() uint8_t value = 0; bool found = false; for (int i = 0; i < m_slot_list.size(); ++i) { - if (!m_slot_list[i]->m_dmaf_r_cb.isnull()) { + if (!m_slot_list[i]->m_dmaf_r_cb.isunset()) { found = true; value |= m_slot_list[i]->m_dmaf_r_cb(); } diff --git a/src/devices/bus/epson_sio/epson_sio.cpp b/src/devices/bus/epson_sio/epson_sio.cpp index 846d42fff86..926c1080ec2 100644 --- a/src/devices/bus/epson_sio/epson_sio.cpp +++ b/src/devices/bus/epson_sio/epson_sio.cpp @@ -79,9 +79,6 @@ epson_sio_device::~epson_sio_device() void epson_sio_device::device_start() { m_cart = get_card_device(); - - m_write_rx.resolve_safe(); - m_write_pin.resolve_safe(); } diff --git a/src/devices/bus/fmt_scsi/fmt_scsi.cpp b/src/devices/bus/fmt_scsi/fmt_scsi.cpp index b5d62fb3577..ccdab14f57e 100644 --- a/src/devices/bus/fmt_scsi/fmt_scsi.cpp +++ b/src/devices/bus/fmt_scsi/fmt_scsi.cpp @@ -60,8 +60,6 @@ void fmt_scsi_slot_device::device_resolve_objects() void fmt_scsi_slot_device::device_start() { - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); } diff --git a/src/devices/bus/gio64/gio64.cpp b/src/devices/bus/gio64/gio64.cpp index 589e2fdf6d7..ccd309251eb 100644 --- a/src/devices/bus/gio64/gio64.cpp +++ b/src/devices/bus/gio64/gio64.cpp @@ -73,11 +73,6 @@ gio64_device::gio64_device(const machine_config &mconfig, device_type type, cons { } -void gio64_device::device_resolve_objects() -{ - m_interrupt_cb.resolve_all_safe(); -} - void gio64_device::device_start() { std::fill(std::begin(m_device_list), std::end(m_device_list), nullptr); diff --git a/src/devices/bus/gio64/gio64.h b/src/devices/bus/gio64/gio64.h index 59b3a3fe679..486f419ca25 100644 --- a/src/devices/bus/gio64/gio64.h +++ b/src/devices/bus/gio64/gio64.h @@ -37,7 +37,7 @@ public: gio64_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, slot_type_t slot_type = GIO64_SLOT_EXP0); 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; @@ -115,8 +115,7 @@ public: protected: gio64_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; // internal state diff --git a/src/devices/bus/gio64/newport.cpp b/src/devices/bus/gio64/newport.cpp index 00cf965c04d..9a644c89c6c 100644 --- a/src/devices/bus/gio64/newport.cpp +++ b/src/devices/bus/gio64/newport.cpp @@ -306,9 +306,6 @@ vc2_device::vc2_device(const machine_config &mconfig, const char *tag, device_t void vc2_device::device_start() { - m_vert_int.resolve_safe(); - m_screen_timing_changed.resolve_safe(); - m_ram = std::make_unique<uint16_t[]>(RAM_SIZE); m_vt_table = make_unique_clear<uint32_t[]>(2048 * 2048); @@ -1092,7 +1089,7 @@ newport_base_device::newport_base_device(const machine_config &mconfig, device_t , m_draw_flags_w(*this) , m_set_address(*this) , m_write_pixel(*this) - , m_read_pixel(*this) + , m_read_pixel(*this, 0) { } @@ -1203,12 +1200,6 @@ void newport_base_device::device_start() save_item(NAME(m_ramdac_lut_g)); save_item(NAME(m_ramdac_lut_b)); save_item(NAME(m_ramdac_lut_index)); - - m_write_mask_w.resolve_safe(); - m_draw_flags_w.resolve_safe(); - m_set_address.resolve_safe(); - m_write_pixel.resolve_safe(); - m_read_pixel.resolve_safe(0); } //------------------------------------------------- diff --git a/src/devices/bus/hexbus/tp0370.cpp b/src/devices/bus/hexbus/tp0370.cpp index 1bd26788cfb..d5aed93015e 100644 --- a/src/devices/bus/hexbus/tp0370.cpp +++ b/src/devices/bus/hexbus/tp0370.cpp @@ -347,9 +347,6 @@ void ibc_device::update_lines(bool bav, bool hsk) void ibc_device::device_start() { - m_int.resolve_safe(); - m_hexout.resolve_safe(); - m_latch.resolve_safe(); } void ibc_device::device_reset() diff --git a/src/devices/bus/hp80_io/hp80_io.cpp b/src/devices/bus/hp80_io/hp80_io.cpp index 12742d1b3da..5ca970060bf 100644 --- a/src/devices/bus/hp80_io/hp80_io.cpp +++ b/src/devices/bus/hp80_io/hp80_io.cpp @@ -36,8 +36,6 @@ hp80_io_slot_device::~hp80_io_slot_device() void hp80_io_slot_device::device_start() { - m_irl_cb_func.resolve_safe(); - m_halt_cb_func.resolve_safe(); } void hp80_io_slot_device::irl_w(int state) diff --git a/src/devices/bus/hp9845_io/98032.cpp b/src/devices/bus/hp9845_io/98032.cpp index 00cd9f2edb7..c6052d40fad 100644 --- a/src/devices/bus/hp9845_io/98032.cpp +++ b/src/devices/bus/hp9845_io/98032.cpp @@ -13,9 +13,11 @@ #include "emu.h" #include "98032.h" + #include "hp9871.h" #include "hp9885.h" + // Debugging #define VERBOSE 0 #include "logmacro.h" @@ -455,9 +457,6 @@ void hp98032_gpio_slot_device::preset_w(int state) void hp98032_gpio_slot_device::device_start() { - m_pflg_handler.resolve_safe(); - m_psts_handler.resolve_safe(); - m_eir_handler.resolve_safe(); } void hp98032_gpio_slot_device::device_reset() diff --git a/src/devices/bus/hp9845_io/hp9845_io.cpp b/src/devices/bus/hp9845_io/hp9845_io.cpp index b75e5857ff6..6962dea066e 100644 --- a/src/devices/bus/hp9845_io/hp9845_io.cpp +++ b/src/devices/bus/hp9845_io/hp9845_io.cpp @@ -10,12 +10,14 @@ #include "emu.h" #include "hp9845_io.h" + #include "98032.h" #include "98035.h" #include "98036.h" #include "98034.h" #include "98046.h" + // device type definition DEFINE_DEVICE_TYPE(HP9845_IO_SLOT, hp9845_io_slot_device, "hp98x5_io_slot", "HP98x5 I/O Slot") @@ -49,14 +51,6 @@ hp9845_io_slot_device::~hp9845_io_slot_device() void hp9845_io_slot_device::device_start() { - m_irq_cb_func.resolve_safe(); - m_sts_cb_func.resolve_safe(); - m_flg_cb_func.resolve_safe(); - m_irq_nextsc_cb_func.resolve_safe(); - m_sts_nextsc_cb_func.resolve_safe(); - m_flg_nextsc_cb_func.resolve_safe(); - m_dmar_cb_func.resolve_safe(); - device_hp9845_io_interface *card = get_card_device(); if (card != nullptr) { diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp index 36d4fc67e3c..6406b572b3b 100644 --- a/src/devices/bus/hp_dio/hp_dio.cpp +++ b/src/devices/bus/hp_dio/hp_dio.cpp @@ -127,16 +127,6 @@ dio16_device::dio16_device(const machine_config &mconfig, device_type type, cons void dio16_device::device_start() { - m_irq1_out_cb.resolve_safe(); - m_irq2_out_cb.resolve_safe(); - m_irq3_out_cb.resolve_safe(); - m_irq4_out_cb.resolve_safe(); - m_irq5_out_cb.resolve_safe(); - m_irq6_out_cb.resolve_safe(); - m_irq7_out_cb.resolve_safe(); - m_dmar0_out_cb.resolve_safe(); - m_dmar1_out_cb.resolve_safe(); - m_prgwidth = m_prgspace->data_width(); save_item(NAME(m_irq)); diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp index 9225edb31f6..e1e477b5d58 100644 --- a/src/devices/bus/hp_hil/hp_hil.cpp +++ b/src/devices/bus/hp_hil/hp_hil.cpp @@ -79,10 +79,6 @@ void hp_hil_mlc_device::add_hp_hil_device(device_hp_hil_interface *device) //------------------------------------------------- void hp_hil_mlc_device::device_start() { - // resolve callbacks - int_cb.resolve_safe(); - nmi_cb.resolve_safe(); - save_item(NAME(m_r2)); save_item(NAME(m_r3)); save_item(NAME(m_w1)); diff --git a/src/devices/bus/hp_ipc_io/hp_ipc_io.cpp b/src/devices/bus/hp_ipc_io/hp_ipc_io.cpp index 8d5648754bf..94b51b2f178 100644 --- a/src/devices/bus/hp_ipc_io/hp_ipc_io.cpp +++ b/src/devices/bus/hp_ipc_io/hp_ipc_io.cpp @@ -35,7 +35,6 @@ hp_ipc_io_slot_device::~hp_ipc_io_slot_device() void hp_ipc_io_slot_device::device_start() { - m_irq_cb_func.resolve_all_safe(); } uint32_t hp_ipc_io_slot_device::get_slot_base_addr() const diff --git a/src/devices/bus/ieee488/c2040fdc.cpp b/src/devices/bus/ieee488/c2040fdc.cpp index 4de4dc34757..fa9ec6205a3 100644 --- a/src/devices/bus/ieee488/c2040fdc.cpp +++ b/src/devices/bus/ieee488/c2040fdc.cpp @@ -105,11 +105,6 @@ c2040_fdc_device::c2040_fdc_device(const machine_config &mconfig, const char *ta void c2040_fdc_device::device_start() { - // resolve callbacks - m_write_sync.resolve_safe(); - m_write_ready.resolve_safe(); - m_write_error.resolve_safe(); - // allocate timer t_gen = timer_alloc(FUNC(c2040_fdc_device::update_state), this); diff --git a/src/devices/bus/ieee488/c8050fdc.cpp b/src/devices/bus/ieee488/c8050fdc.cpp index 75bd8146348..3fc1adc37de 100644 --- a/src/devices/bus/ieee488/c8050fdc.cpp +++ b/src/devices/bus/ieee488/c8050fdc.cpp @@ -106,12 +106,6 @@ c8050_fdc_device::c8050_fdc_device(const machine_config &mconfig, const char *ta void c8050_fdc_device::device_start() { - // resolve callbacks - m_write_sync.resolve_safe(); - m_write_ready.resolve_safe(); - m_write_brdy.resolve_safe(); - m_write_error.resolve_safe(); - // allocate timer t_gen = timer_alloc(FUNC(c8050_fdc_device::update_state), this); diff --git a/src/devices/bus/ieee488/ieee488.cpp b/src/devices/bus/ieee488/ieee488.cpp index 947aad2d1f7..94a93e424e4 100644 --- a/src/devices/bus/ieee488/ieee488.cpp +++ b/src/devices/bus/ieee488/ieee488.cpp @@ -135,16 +135,6 @@ ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, d void ieee488_device::device_start() { - // resolve callbacks - m_write_eoi.resolve_safe(); - m_write_dav.resolve_safe(); - m_write_nrfd.resolve_safe(); - m_write_ndac.resolve_safe(); - m_write_ifc.resolve_safe(); - m_write_srq.resolve_safe(); - m_write_atn.resolve_safe(); - m_write_ren.resolve_safe(); - m_write_dio.resolve_safe(); } diff --git a/src/devices/bus/intellec4/intellec4.cpp b/src/devices/bus/intellec4/intellec4.cpp index b4da2185d0c..fb980a2efd5 100644 --- a/src/devices/bus/intellec4/intellec4.cpp +++ b/src/devices/bus/intellec4/intellec4.cpp @@ -109,11 +109,6 @@ void univ_bus_device::cpu_reset_in(int state) void univ_bus_device::device_start() { - m_test_out_cb.resolve_safe(); - m_stop_out_cb.resolve_safe(); - m_reset_4002_out_cb.resolve_safe(); - m_user_reset_out_cb.resolve_safe(); - save_item(NAME(m_test)); save_item(NAME(m_stop)); save_item(NAME(m_reset_4002)); diff --git a/src/devices/bus/interpro/keyboard/keyboard.cpp b/src/devices/bus/interpro/keyboard/keyboard.cpp index fd3b694fc4a..0c108497ecb 100644 --- a/src/devices/bus/interpro/keyboard/keyboard.cpp +++ b/src/devices/bus/interpro/keyboard/keyboard.cpp @@ -24,7 +24,6 @@ void interpro_keyboard_port_device::device_config_complete() void interpro_keyboard_port_device::device_start() { - m_rxd_handler.resolve_safe(); } void interpro_keyboard_port_device::write_txd(int state) diff --git a/src/devices/bus/interpro/mouse/mouse.cpp b/src/devices/bus/interpro/mouse/mouse.cpp index 835bcd1f68d..c85eea90ed5 100644 --- a/src/devices/bus/interpro/mouse/mouse.cpp +++ b/src/devices/bus/interpro/mouse/mouse.cpp @@ -51,7 +51,6 @@ void interpro_mouse_port_device::device_config_complete() void interpro_mouse_port_device::device_start() { - m_state_func.resolve_safe(); } device_interpro_mouse_port_interface::device_interpro_mouse_port_interface(machine_config const &mconfig, device_t &device) diff --git a/src/devices/bus/interpro/sr/sr.cpp b/src/devices/bus/interpro/sr/sr.cpp index 82071af86d2..5ce5f8cc3b9 100644 --- a/src/devices/bus/interpro/sr/sr.cpp +++ b/src/devices/bus/interpro/sr/sr.cpp @@ -265,15 +265,6 @@ DEFINE_DEVICE_TYPE(CBUS_SLOT, cbus_slot_device, "cbus_slot", "InterPro CBUS slot DEFINE_DEVICE_TYPE(SRX_BUS, srx_bus_device, "srx_bus", "InterPro SRX bus") DEFINE_DEVICE_TYPE(SRX_SLOT, srx_slot_device, "srx_slot", "InterPro SRX slot") -void interpro_bus_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq0_cb.resolve_safe(); - m_out_irq1_cb.resolve_safe(); - m_out_irq2_cb.resolve_safe(); - m_out_irq3_cb.resolve_safe(); -} - cbus_bus_device::cbus_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : interpro_bus_device(mconfig, CBUS_BUS, tag, owner, clock) , m_slot_count(0) diff --git a/src/devices/bus/interpro/sr/sr.h b/src/devices/bus/interpro/sr/sr.h index f87d35b6171..ee706178e5a 100644 --- a/src/devices/bus/interpro/sr/sr.h +++ b/src/devices/bus/interpro/sr/sr.h @@ -37,9 +37,6 @@ protected: { } - // device-level overrides - virtual void device_resolve_objects() override; - // internal state required_address_space m_main_space; required_address_space m_io_space; @@ -87,7 +84,7 @@ public: } protected: - // device-level overrides + // device_t implementation virtual void device_start() override; private: @@ -112,7 +109,7 @@ public: cbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; @@ -199,7 +196,7 @@ public: } protected: - // device-level overrides + // device_t implementation virtual void device_start() override; private: @@ -224,7 +221,7 @@ public: srx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index e1f6f1ebb4e..aa729cefce3 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -86,15 +86,6 @@ void iq151cart_slot_device::device_start() m_cart = get_card_device(); if (m_cart) m_cart->set_screen_device(*m_screen); - - // resolve callbacks - m_out_irq0_cb.resolve_safe(); - m_out_irq1_cb.resolve_safe(); - m_out_irq2_cb.resolve_safe(); - m_out_irq3_cb.resolve_safe(); - m_out_irq4_cb.resolve_safe(); - m_out_drq_cb.resolve_safe(); - } diff --git a/src/devices/bus/isa/gus.cpp b/src/devices/bus/isa/gus.cpp index 6ad155a5db5..2017482fc96 100644 --- a/src/devices/bus/isa/gus.cpp +++ b/src/devices/bus/isa/gus.cpp @@ -380,18 +380,6 @@ void gf1_device::device_start() { acia6850_device::device_start(); - m_txirq_handler.resolve_safe(); - m_rxirq_handler.resolve_safe(); - m_wave_irq_handler.resolve_safe(); - m_ramp_irq_handler.resolve_safe(); - m_timer1_irq_handler.resolve_safe(); - m_timer2_irq_handler.resolve_safe(); - m_sb_irq_handler.resolve_safe(); - m_dma_irq_handler.resolve_safe(); - m_drq1_handler.resolve_safe(); - m_drq2_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - // TODO: make DRAM size configurable. Can be 256k, 512k, 768k, or 1024k m_wave_ram.resize(1024*1024); memset(&m_wave_ram[0], 0, 1024*1024); diff --git a/src/devices/bus/isa/hdc.cpp b/src/devices/bus/isa/hdc.cpp index ae164d52647..a320f3f9ee5 100644 --- a/src/devices/bus/isa/hdc.cpp +++ b/src/devices/bus/isa/hdc.cpp @@ -196,8 +196,6 @@ void xt_hdc_device::device_start() { m_buffer = std::make_unique<uint8_t[]>(256*512); // maximum possible transfer m_timer = timer_alloc(FUNC(xt_hdc_device::process_command), this); - m_irq_handler.resolve_safe(); - m_drq_handler.resolve_safe(); } void xt_hdc_device::device_reset() diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp index 5ddfde0823e..f212f61d3d7 100644 --- a/src/devices/bus/isa/isa.cpp +++ b/src/devices/bus/isa/isa.cpp @@ -223,20 +223,6 @@ void isa8_device::device_config_complete() void isa8_device::device_resolve_objects() { - // resolve callbacks - m_write_iochrdy.resolve_safe(); - m_write_iochck.resolve_safe(); - - m_out_irq2_cb.resolve_safe(); - m_out_irq3_cb.resolve_safe(); - m_out_irq4_cb.resolve_safe(); - m_out_irq5_cb.resolve_safe(); - m_out_irq6_cb.resolve_safe(); - m_out_irq7_cb.resolve_safe(); - m_out_drq1_cb.resolve_safe(); - m_out_drq2_cb.resolve_safe(); - m_out_drq3_cb.resolve_safe(); - m_iowidth = m_iospace->data_width(); m_memwidth = m_memspace->data_width(); } @@ -521,27 +507,6 @@ isa16_device::isa16_device(const machine_config &mconfig, const char *tag, devic { } -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void isa16_device::device_start() -{ - isa8_device::device_start(); - - // resolve callbacks - m_out_irq10_cb.resolve_safe(); - m_out_irq11_cb.resolve_safe(); - m_out_irq12_cb.resolve_safe(); - m_out_irq14_cb.resolve_safe(); - m_out_irq15_cb.resolve_safe(); - - m_out_drq0_cb.resolve_safe(); - m_out_drq5_cb.resolve_safe(); - m_out_drq6_cb.resolve_safe(); - m_out_drq7_cb.resolve_safe(); -} - template<typename R, typename W> void isa16_device::install16_device(offs_t start, offs_t end, R rhandler, W whandler) { int buswidth = m_iowidth; diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h index 3beb1804133..4b02d0bf946 100644 --- a/src/devices/bus/isa/isa.h +++ b/src/devices/bus/isa/isa.h @@ -95,7 +95,7 @@ public: protected: isa8_slot_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; // configuration @@ -210,7 +210,7 @@ protected: template<typename R, typename W> void install_space(int spacenum, offs_t start, offs_t end, R rhandler, W whandler); - // device-level overrides + // device_t implementation virtual void device_config_complete() override; virtual void device_resolve_objects() override; virtual void device_start() override; @@ -292,7 +292,7 @@ public: isa16_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; }; @@ -348,10 +348,6 @@ public: uint16_t io16_swap_r(offs_t offset, uint16_t mem_mask = 0xffff); void io16_swap_w(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff); -protected: - // device-level overrides - virtual void device_start() override; - private: // internal state devcb_write_line m_out_irq10_cb; diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index 737256d8b61..a621c3ed22c 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -113,8 +113,6 @@ void s3virge_vga_device::device_start() save_item(s3virge.s3d.reg[3],"S3D Registers: 3D Line"); save_item(s3virge.s3d.reg[4],"S3D Registers: 3D Triangle"); - m_linear_config_changed_cb.resolve_safe(); - // Initialise hardware graphics cursor colours, Windows 95 doesn't touch the registers for some reason for (int x = 0; x < 4; x++) { diff --git a/src/devices/bus/isbx/isbx.cpp b/src/devices/bus/isbx/isbx.cpp index 373d147cadd..178f2215ab2 100644 --- a/src/devices/bus/isbx/isbx.cpp +++ b/src/devices/bus/isbx/isbx.cpp @@ -57,12 +57,6 @@ isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *ta void isbx_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_mintr0.resolve_safe(); - m_write_mintr1.resolve_safe(); - m_write_mdrqt.resolve_safe(); - m_write_mwait.resolve_safe(); } diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index 9f00129e6ac..feed0c8995e 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -193,11 +193,6 @@ void kcexp_slot_device::device_validity_check(validity_checker &valid) const void kcexp_slot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); - m_out_halt_cb.resolve_safe(); } diff --git a/src/devices/bus/lpci/i82371sb.cpp b/src/devices/bus/lpci/i82371sb.cpp index 425fc563364..16917043332 100644 --- a/src/devices/bus/lpci/i82371sb.cpp +++ b/src/devices/bus/lpci/i82371sb.cpp @@ -255,8 +255,7 @@ void i82371sb_device::device_start() southbridge_device::device_start(); m_ide_io_ports_enabled = false; spaceio.install_readwrite_handler(0x00b0, 0x00b3, read8sm_delegate(*this, FUNC(i82371sb_device::read_apmcapms)), write8sm_delegate(*this, FUNC(i82371sb_device::write_apmcapms)), 0xffff0000); - m_smi_callback.resolve_safe(); - m_boot_state_hook.resolve_safe(); + // setup save states save_item(NAME(m_regs)); } diff --git a/src/devices/bus/mackbd/mackbd.cpp b/src/devices/bus/mackbd/mackbd.cpp index 128f7b54725..3f12d89b8c6 100644 --- a/src/devices/bus/mackbd/mackbd.cpp +++ b/src/devices/bus/mackbd/mackbd.cpp @@ -118,12 +118,6 @@ void mac_keyboard_port_device::data_w(int state) m_peripheral->data_w(state); } -void mac_keyboard_port_device::device_resolve_objects() -{ - m_clock_cb.resolve_safe(); - m_data_cb.resolve_safe(); -} - void mac_keyboard_port_device::device_start() { m_peripheral = dynamic_cast<device_mac_keyboard_interface *>(get_card_device()); diff --git a/src/devices/bus/mackbd/mackbd.h b/src/devices/bus/mackbd/mackbd.h index acb83df2e01..bd1de2f0225 100644 --- a/src/devices/bus/mackbd/mackbd.h +++ b/src/devices/bus/mackbd/mackbd.h @@ -49,7 +49,6 @@ public: void data_w(int state); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/devices/bus/mc10/mc10_cart.cpp b/src/devices/bus/mc10/mc10_cart.cpp index dd9b08866a3..77d2ae58332 100644 --- a/src/devices/bus/mc10/mc10_cart.cpp +++ b/src/devices/bus/mc10/mc10_cart.cpp @@ -71,7 +71,6 @@ mc10cart_slot_device::mc10cart_slot_device(const machine_config &mconfig, const void mc10cart_slot_device::device_start() { - m_nmi_callback.resolve_safe(); m_cart = get_card_device(); } diff --git a/src/devices/bus/mc68000/sysbus.cpp b/src/devices/bus/mc68000/sysbus.cpp index bf7ad7b78db..f8818ce005d 100644 --- a/src/devices/bus/mc68000/sysbus.cpp +++ b/src/devices/bus/mc68000/sysbus.cpp @@ -39,14 +39,6 @@ void mc68000_sysbus_device::add_card(int slot, device_mc68000_sysbus_card_interf void mc68000_sysbus_device::device_start() { - // resolve callbacks - m_irq1_cb.resolve_safe(); - m_irq2_cb.resolve_safe(); - m_irq3_cb.resolve_safe(); - m_irq4_cb.resolve_safe(); - m_irq5_cb.resolve_safe(); - m_irq6_cb.resolve_safe(); - m_irq7_cb.resolve_safe(); // clear slots std::fill(std::begin(m_device_list), std::end(m_device_list), nullptr); diff --git a/src/devices/bus/midi/midi.cpp b/src/devices/bus/midi/midi.cpp index a225c81371e..4fb56b1e24f 100644 --- a/src/devices/bus/midi/midi.cpp +++ b/src/devices/bus/midi/midi.cpp @@ -25,7 +25,6 @@ void midi_port_device::device_config_complete() void midi_port_device::device_start() { - m_rxd_handler.resolve_safe(); } void midi_port_device::write_txd(int state) diff --git a/src/devices/bus/msx/slot/cartridge.cpp b/src/devices/bus/msx/slot/cartridge.cpp index 46c4505fcfb..13138bd3ca4 100644 --- a/src/devices/bus/msx/slot/cartridge.cpp +++ b/src/devices/bus/msx/slot/cartridge.cpp @@ -19,7 +19,6 @@ msx_slot_cartridge_base_device::msx_slot_cartridge_base_device(const machine_con void msx_slot_cartridge_base_device::device_resolve_objects() { - m_irq_handler.resolve_safe(); m_cartridge = dynamic_cast<msx_cart_interface *>(get_card_device()); if (m_cartridge) { diff --git a/src/devices/bus/msx/slot/msx_rs232.cpp b/src/devices/bus/msx/slot/msx_rs232.cpp index aebae56a487..0750abf7c9a 100644 --- a/src/devices/bus/msx/slot/msx_rs232.cpp +++ b/src/devices/bus/msx/slot/msx_rs232.cpp @@ -75,8 +75,6 @@ void msx_slot_rs232_base_device::device_start() { msx_slot_rom_device::device_start(); - m_irq_handler.resolve_safe(); - save_item(NAME(m_irq_mask)); save_item(NAME(m_out2)); save_item(NAME(m_cts)); diff --git a/src/devices/bus/mtx/exp.cpp b/src/devices/bus/mtx/exp.cpp index 9132ea385d7..3a8a5f64801 100644 --- a/src/devices/bus/mtx/exp.cpp +++ b/src/devices/bus/mtx/exp.cpp @@ -77,11 +77,6 @@ mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const ch void mtx_exp_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_busreq_handler.resolve_safe(); - m_int_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); } diff --git a/src/devices/bus/multibus/multibus.cpp b/src/devices/bus/multibus/multibus.cpp index f8c64ac0d08..6f08efb58b4 100644 --- a/src/devices/bus/multibus/multibus.cpp +++ b/src/devices/bus/multibus/multibus.cpp @@ -41,8 +41,6 @@ device_memory_interface::space_config_vector multibus_device::memory_space_confi void multibus_device::device_start() { - m_int_cb.resolve_all_safe(); - m_xack_cb.resolve_safe(); } multibus_slot_device::multibus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) diff --git a/src/devices/bus/nabupc/option.cpp b/src/devices/bus/nabupc/option.cpp index 7e4421ff227..4865a4ccaf9 100644 --- a/src/devices/bus/nabupc/option.cpp +++ b/src/devices/bus/nabupc/option.cpp @@ -88,7 +88,6 @@ void option_bus_device::add_slot(option_slot_device &slot) //------------------------------------------------- void option_bus_device::device_start() { - m_int_cb.resolve_all_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/nasbus/nasbus.cpp b/src/devices/bus/nasbus/nasbus.cpp index 6cdc2669e2d..2f9ef67b811 100644 --- a/src/devices/bus/nasbus/nasbus.cpp +++ b/src/devices/bus/nasbus/nasbus.cpp @@ -78,8 +78,6 @@ nasbus_device::~nasbus_device() void nasbus_device::device_start() { - // resolve callbacks - m_ram_disable_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index 8ebe3cce2d2..f37599694f9 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -101,23 +101,6 @@ nubus_device::~nubus_device() } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void nubus_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq9_cb.resolve_safe(); - m_out_irqa_cb.resolve_safe(); - m_out_irqb_cb.resolve_safe(); - m_out_irqc_cb.resolve_safe(); - m_out_irqd_cb.resolve_safe(); - m_out_irqe_cb.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h index 2d7ecc21033..42a68a8b597 100644 --- a/src/devices/bus/nubus/nubus.h +++ b/src/devices/bus/nubus/nubus.h @@ -91,7 +91,7 @@ public: protected: nubus_slot_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; @@ -140,8 +140,7 @@ public: protected: nubus_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; // internal state diff --git a/src/devices/bus/oricext/oricext.cpp b/src/devices/bus/oricext/oricext.cpp index 59bbb54aa55..ee8c285c3ef 100644 --- a/src/devices/bus/oricext/oricext.cpp +++ b/src/devices/bus/oricext/oricext.cpp @@ -21,8 +21,6 @@ oricext_connector::~oricext_connector() void oricext_connector::device_start() { - irq_handler.resolve_safe(); - reset_handler.resolve_safe(); } void oricext_connector::irq_w(int state) diff --git a/src/devices/bus/pc1512/mouse.cpp b/src/devices/bus/pc1512/mouse.cpp index f1d92ce4df5..988716bbb78 100644 --- a/src/devices/bus/pc1512/mouse.cpp +++ b/src/devices/bus/pc1512/mouse.cpp @@ -69,12 +69,6 @@ pc1512_mouse_device::pc1512_mouse_device(const machine_config &mconfig, const ch void pc1512_mouse_port_device::device_start() { m_device = get_card_device(); - - // resolve callbacks - m_write_x.resolve_safe(); - m_write_y.resolve_safe(); - m_write_m1.resolve_safe(); - m_write_m2.resolve_safe(); } void pc1512_mouse_device::device_start() diff --git a/src/devices/bus/pc8801/pc8801_31.cpp b/src/devices/bus/pc8801/pc8801_31.cpp index f979e59162b..d125b9c9ad6 100644 --- a/src/devices/bus/pc8801/pc8801_31.cpp +++ b/src/devices/bus/pc8801/pc8801_31.cpp @@ -74,12 +74,6 @@ void pc8801_31_device::device_add_mconfig(machine_config &config) // device_start - device-specific startup //------------------------------------------------- -void pc8801_31_device::device_resolve_objects() -{ - m_rom_bank_cb.resolve(); -} - - void pc8801_31_device::device_start() { m_sel_off_timer = timer_alloc(FUNC(pc8801_31_device::select_off), this); diff --git a/src/devices/bus/pc8801/pc8801_31.h b/src/devices/bus/pc8801/pc8801_31.h index fd580002610..e028d51528b 100644 --- a/src/devices/bus/pc8801/pc8801_31.h +++ b/src/devices/bus/pc8801/pc8801_31.h @@ -32,8 +32,7 @@ public: void amap(address_map &map); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/bus/pc8801/pc8801_exp.cpp b/src/devices/bus/pc8801/pc8801_exp.cpp index 0317c72dfe3..b71c8b140a3 100644 --- a/src/devices/bus/pc8801/pc8801_exp.cpp +++ b/src/devices/bus/pc8801/pc8801_exp.cpp @@ -35,13 +35,6 @@ void pc8801_exp_slot_device::device_start() { } -void pc8801_exp_slot_device::device_resolve_objects() -{ - m_int3_cb.resolve_safe(); - m_int4_cb.resolve_safe(); - m_int5_cb.resolve_safe(); -} - device_pc8801_exp_interface::device_pc8801_exp_interface(const machine_config &mconfig, device_t &device) : device_interface(device, "pc8801exp") { diff --git a/src/devices/bus/pc8801/pc8801_exp.h b/src/devices/bus/pc8801/pc8801_exp.h index 7d6286651af..411d15e5fe8 100644 --- a/src/devices/bus/pc8801/pc8801_exp.h +++ b/src/devices/bus/pc8801/pc8801_exp.h @@ -38,9 +38,8 @@ public: auto int5_callback() { return m_int5_cb.bind(); } protected: - // device-level overrides + // device_t implementation virtual void device_start() override; - virtual void device_resolve_objects() override; private: required_address_space m_iospace; diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp index dc0063ace8a..4eee89f4188 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.cpp +++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp @@ -61,9 +61,6 @@ void pc_kbdc_device::device_resolve_objects() device_pc_kbd_interface *const pc_kbd = get_card_device(); if (pc_kbd) pc_kbd->set_pc_kbdc(this); - - m_out_clock_cb.resolve_safe(); - m_out_data_cb.resolve_safe(); } void pc_kbdc_device::device_start() diff --git a/src/devices/bus/pet/cass.cpp b/src/devices/bus/pet/cass.cpp index 159cbbf82e0..332d0140312 100644 --- a/src/devices/bus/pet/cass.cpp +++ b/src/devices/bus/pet/cass.cpp @@ -76,9 +76,6 @@ pet_datassette_port_device::~pet_datassette_port_device() void pet_datassette_port_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_read_handler.resolve_safe(); } diff --git a/src/devices/bus/pet/exp.cpp b/src/devices/bus/pet/exp.cpp index 33a6041a0ca..ee22ba3fc5d 100644 --- a/src/devices/bus/pet/exp.cpp +++ b/src/devices/bus/pet/exp.cpp @@ -39,7 +39,7 @@ pet_expansion_slot_device::pet_expansion_slot_device(const machine_config &mconf device_t(mconfig, PET_EXPANSION_SLOT, tag, owner, clock), device_single_card_slot_interface<device_pet_expansion_card_interface>(mconfig, *this), m_card(nullptr), - m_read_dma(*this), + m_read_dma(*this, 0), m_write_dma(*this) { } @@ -81,10 +81,6 @@ device_pet_expansion_card_interface::~device_pet_expansion_card_interface() void pet_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_read_dma.resolve_safe(0); - m_write_dma.resolve_safe(); } diff --git a/src/devices/bus/pet/user.cpp b/src/devices/bus/pet/user.cpp index 0c2cd7b40b3..87da4269628 100644 --- a/src/devices/bus/pet/user.cpp +++ b/src/devices/bus/pet/user.cpp @@ -46,26 +46,6 @@ void pet_user_port_device::device_config_complete() void pet_user_port_device::device_start() { - m_2_handler.resolve_safe(); - m_3_handler.resolve_safe(); - m_4_handler.resolve_safe(); - m_5_handler.resolve_safe(); - m_6_handler.resolve_safe(); - m_7_handler.resolve_safe(); - m_8_handler.resolve_safe(); - m_9_handler.resolve_safe(); - m_10_handler.resolve_safe(); - m_b_handler.resolve_safe(); - m_c_handler.resolve_safe(); - m_d_handler.resolve_safe(); - m_e_handler.resolve_safe(); - m_f_handler.resolve_safe(); - m_h_handler.resolve_safe(); - m_j_handler.resolve_safe(); - m_k_handler.resolve_safe(); - m_l_handler.resolve_safe(); - m_m_handler.resolve_safe(); - // pull up m_3_handler(1); m_4_handler(1); diff --git a/src/devices/bus/plus4/exp.cpp b/src/devices/bus/plus4/exp.cpp index 1bbd9867f97..b475875145c 100644 --- a/src/devices/bus/plus4/exp.cpp +++ b/src/devices/bus/plus4/exp.cpp @@ -69,7 +69,7 @@ plus4_expansion_slot_device::plus4_expansion_slot_device(const machine_config &m device_single_card_slot_interface<device_plus4_expansion_card_interface>(mconfig, *this), device_cartrom_image_interface(mconfig, *this), m_write_irq(*this), - m_read_dma_cd(*this), + m_read_dma_cd(*this, 0xff), m_write_dma_cd(*this), m_write_aec(*this), m_card(nullptr) @@ -84,12 +84,6 @@ plus4_expansion_slot_device::plus4_expansion_slot_device(const machine_config &m void plus4_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_read_dma_cd.resolve_safe(0xff); - m_write_dma_cd.resolve_safe(); - m_write_aec.resolve_safe(); } diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp index c0edb7ee263..d97b229624a 100644 --- a/src/devices/bus/pofo/exp.cpp +++ b/src/devices/bus/pofo/exp.cpp @@ -65,11 +65,6 @@ portfolio_expansion_slot_device::portfolio_expansion_slot_device(const machine_c void portfolio_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_eint.resolve_safe(); - m_write_nmio.resolve_safe(); - m_write_wake.resolve_safe(); } diff --git a/src/devices/bus/psi_kbd/psi_kbd.cpp b/src/devices/bus/psi_kbd/psi_kbd.cpp index 5046036f3d5..08c072d2d68 100644 --- a/src/devices/bus/psi_kbd/psi_kbd.cpp +++ b/src/devices/bus/psi_kbd/psi_kbd.cpp @@ -53,10 +53,6 @@ void psi_keyboard_bus_device::device_start() { // get connected keyboard m_kbd = get_card_device(); - - // resolve callbacks - m_rx_handler.resolve_safe(); - m_key_strobe_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/psion/honda/slot.cpp b/src/devices/bus/psion/honda/slot.cpp index 049e9d7237a..5ce984d67f5 100644 --- a/src/devices/bus/psion/honda/slot.cpp +++ b/src/devices/bus/psion/honda/slot.cpp @@ -61,9 +61,6 @@ psion_honda_slot_device::psion_honda_slot_device(const machine_config &mconfig, void psion_honda_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_int_cb.resolve_safe(); } diff --git a/src/devices/bus/psion/module/slot.cpp b/src/devices/bus/psion/module/slot.cpp index b2f8787f49e..55107f8f3ac 100644 --- a/src/devices/bus/psion/module/slot.cpp +++ b/src/devices/bus/psion/module/slot.cpp @@ -58,9 +58,6 @@ psion_module_slot_device::psion_module_slot_device(const machine_config &mconfig void psion_module_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_intr_cb.resolve_safe(); } diff --git a/src/devices/bus/psion/sibo/slot.cpp b/src/devices/bus/psion/sibo/slot.cpp index 5aff9dba4af..892deb1e8dc 100644 --- a/src/devices/bus/psion/sibo/slot.cpp +++ b/src/devices/bus/psion/sibo/slot.cpp @@ -58,9 +58,6 @@ psion_sibo_slot_device::psion_sibo_slot_device(const machine_config &mconfig, co void psion_sibo_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_int_cb.resolve_safe(); } diff --git a/src/devices/bus/psx/ctlrport.cpp b/src/devices/bus/psx/ctlrport.cpp index ab2c9db7722..bd445add41e 100644 --- a/src/devices/bus/psx/ctlrport.cpp +++ b/src/devices/bus/psx/ctlrport.cpp @@ -52,9 +52,6 @@ psxcontrollerports_device::psxcontrollerports_device(const machine_config &mconf void psxcontrollerports_device::device_start() { - m_dsr_handler.resolve_safe(); - m_rxd_handler.resolve_safe(); - m_port0->set_ack_cb(*this, FUNC(psxcontrollerports_device::ack)); m_port1->set_ack_cb(*this, FUNC(psxcontrollerports_device::ack)); } diff --git a/src/devices/bus/qbus/qbus.cpp b/src/devices/bus/qbus/qbus.cpp index e9b6960b96c..eb8cc3a3b2b 100644 --- a/src/devices/bus/qbus/qbus.cpp +++ b/src/devices/bus/qbus/qbus.cpp @@ -75,12 +75,6 @@ void qbus_slot_device::device_start() device_qbus_card_interface *dev = dynamic_cast<device_qbus_card_interface *>(get_card_device()); if (dev) m_bus->add_card(*dev); - - m_write_birq4.resolve_safe(); - m_write_birq5.resolve_safe(); - m_write_birq6.resolve_safe(); - m_write_birq7.resolve_safe(); - m_write_bdmr.resolve_safe(); } @@ -120,12 +114,6 @@ device_memory_interface::space_config_vector qbus_device::memory_space_config() void qbus_device::device_start() { - // resolve callbacks - m_out_birq4_cb.resolve_safe(); - m_out_birq5_cb.resolve_safe(); - m_out_birq6_cb.resolve_safe(); - m_out_birq7_cb.resolve_safe(); - m_out_bdmr_cb.resolve_safe(); } diff --git a/src/devices/bus/ql/exp.cpp b/src/devices/bus/ql/exp.cpp index aadb3905b86..ab2bb007d80 100644 --- a/src/devices/bus/ql/exp.cpp +++ b/src/devices/bus/ql/exp.cpp @@ -68,12 +68,6 @@ ql_expansion_slot_device::ql_expansion_slot_device(const machine_config &mconfig void ql_expansion_slot_device::device_resolve_objects() { - // resolve callbacks - m_write_ipl0l.resolve_safe(); - m_write_ipl1l.resolve_safe(); - m_write_berrl.resolve_safe(); - m_write_extintl.resolve_safe(); - m_card = get_card_device(); } diff --git a/src/devices/bus/rc2014/rc2014.cpp b/src/devices/bus/rc2014/rc2014.cpp index afe6ba6172a..e23af856311 100644 --- a/src/devices/bus/rc2014/rc2014.cpp +++ b/src/devices/bus/rc2014/rc2014.cpp @@ -46,15 +46,6 @@ rc2014_bus_device::~rc2014_bus_device() void rc2014_bus_device::device_start() { - // resolve callbacks - m_clk.resolve_safe(); - m_int.resolve_safe(); - m_tx.resolve_safe(); - m_rx.resolve_safe(); - m_user1.resolve_safe(); - m_user2.resolve_safe(); - m_user3.resolve_safe(); - m_user4.resolve_safe(); } void rc2014_bus_device::device_reset() @@ -166,20 +157,6 @@ rc2014_ext_bus_device::rc2014_ext_bus_device(const machine_config &mconfig, devi { } -void rc2014_ext_bus_device::device_start() -{ - rc2014_bus_device::device_start(); - m_clk2.resolve_safe(); - m_page.resolve_safe(); - m_nmi.resolve_safe(); - m_tx2.resolve_safe(); - m_rx2.resolve_safe(); - m_user5.resolve_safe(); - m_user6.resolve_safe(); - m_user7.resolve_safe(); - m_user8.resolve_safe(); -} - //------------------------------------------------- // device_rc2014_ext_card_interface //------------------------------------------------- diff --git a/src/devices/bus/rc2014/rc2014.h b/src/devices/bus/rc2014/rc2014.h index cbdff7ec847..1a689a2cc9f 100644 --- a/src/devices/bus/rc2014/rc2014.h +++ b/src/devices/bus/rc2014/rc2014.h @@ -104,7 +104,8 @@ public: protected: rc2014_bus_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; @@ -159,7 +160,8 @@ public: protected: rc2014_slot_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); - // device-level overrides + + // device_t implementation virtual void device_start() override; virtual void device_resolve_objects() override; @@ -200,8 +202,6 @@ public: protected: rc2014_ext_bus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; private: devcb_write_line m_clk2; @@ -252,7 +252,8 @@ public: protected: rc2014_ext_slot_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); - // device-level overrides + + // device_t implementation virtual void device_start() override; virtual void device_resolve_objects() override; }; diff --git a/src/devices/bus/rs232/rs232.cpp b/src/devices/bus/rs232/rs232.cpp index 7ce61331f23..e85a15dd275 100644 --- a/src/devices/bus/rs232/rs232.cpp +++ b/src/devices/bus/rs232/rs232.cpp @@ -83,15 +83,6 @@ void rs232_port_device::device_config_complete() void rs232_port_device::device_resolve_objects() { - m_rxd_handler.resolve_safe(); - m_dcd_handler.resolve_safe(); - m_dsr_handler.resolve_safe(); - m_ri_handler.resolve_safe(); - m_si_handler.resolve_safe(); - m_cts_handler.resolve_safe(); - m_rxc_handler.resolve_safe(); - m_txc_handler.resolve_safe(); - m_rxd = 1; m_dcd = 1; m_dsr = 1; diff --git a/src/devices/bus/rtpc/kbd_con.cpp b/src/devices/bus/rtpc/kbd_con.cpp index e19ba8b7b51..3e689485594 100644 --- a/src/devices/bus/rtpc/kbd_con.cpp +++ b/src/devices/bus/rtpc/kbd_con.cpp @@ -35,12 +35,6 @@ void rtpc_kbd_con_device::device_config_complete() m_keyboard = get_card_device(); } -void rtpc_kbd_con_device::device_resolve_objects() -{ - m_out_clock_cb.resolve_safe(); - m_out_data_cb.resolve_safe(); -} - void rtpc_kbd_con_device::device_start() { save_item(NAME(m_clock_state)); diff --git a/src/devices/bus/rtpc/kbd_con.h b/src/devices/bus/rtpc/kbd_con.h index b066fc56137..1c38bbc09e7 100644 --- a/src/devices/bus/rtpc/kbd_con.h +++ b/src/devices/bus/rtpc/kbd_con.h @@ -36,7 +36,6 @@ public: void data_write_from_kb(int state); protected: - virtual void device_resolve_objects() override; virtual void device_config_complete() override; virtual void device_start() override; diff --git a/src/devices/bus/s100/s100.cpp b/src/devices/bus/s100/s100.cpp index 1df02138290..403c0e6e5b6 100644 --- a/src/devices/bus/s100/s100.cpp +++ b/src/devices/bus/s100/s100.cpp @@ -100,24 +100,6 @@ s100_bus_device::~s100_bus_device() void s100_bus_device::device_start() { - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_vi0.resolve_safe(); - m_write_vi1.resolve_safe(); - m_write_vi2.resolve_safe(); - m_write_vi3.resolve_safe(); - m_write_vi4.resolve_safe(); - m_write_vi5.resolve_safe(); - m_write_vi6.resolve_safe(); - m_write_vi7.resolve_safe(); - m_write_dma0.resolve_safe(); - m_write_dma1.resolve_safe(); - m_write_dma2.resolve_safe(); - m_write_dma3.resolve_safe(); - m_write_rdy.resolve_safe(); - m_write_hold.resolve_safe(); - m_write_error.resolve_safe(); } diff --git a/src/devices/bus/saitek_osa/expansion.cpp b/src/devices/bus/saitek_osa/expansion.cpp index f7af65e1dcb..a226a8ffafc 100644 --- a/src/devices/bus/saitek_osa/expansion.cpp +++ b/src/devices/bus/saitek_osa/expansion.cpp @@ -56,10 +56,6 @@ void saitekosa_expansion_device::device_start() // get inserted module m_module = get_card_device(); - // resolve callbacks - m_stb_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - // register for savestates save_item(NAME(m_data)); save_item(NAME(m_nmi)); diff --git a/src/devices/bus/samcoupe/expansion/expansion.cpp b/src/devices/bus/samcoupe/expansion/expansion.cpp index 49c2409cf9f..91ce532cf9d 100644 --- a/src/devices/bus/samcoupe/expansion/expansion.cpp +++ b/src/devices/bus/samcoupe/expansion/expansion.cpp @@ -51,9 +51,6 @@ void samcoupe_expansion_device::device_start() { // get inserted module m_module = get_card_device(); - - // resolve callbacks - m_int_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/samcoupe/mouse/mouseport.cpp b/src/devices/bus/samcoupe/mouse/mouseport.cpp index 3bfc609c093..21a048f8d63 100644 --- a/src/devices/bus/samcoupe/mouse/mouseport.cpp +++ b/src/devices/bus/samcoupe/mouse/mouseport.cpp @@ -51,9 +51,6 @@ void samcoupe_mouse_port_device::device_start() { // get inserted module m_module = get_card_device(); - - // resolve callbacks - m_mseint_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/sbus/sbus.cpp b/src/devices/bus/sbus/sbus.cpp index 6640509d3ec..efd0a6991b5 100644 --- a/src/devices/bus/sbus/sbus.cpp +++ b/src/devices/bus/sbus/sbus.cpp @@ -91,13 +91,6 @@ sbus_device::sbus_device(const machine_config &mconfig, device_type type, const { } -void sbus_device::device_resolve_objects() -{ - // resolve callbacks - m_irq_cb.resolve_all_safe(); - m_buserr.resolve_safe(); -} - void sbus_device::device_start() { std::fill(std::begin(m_device_list), std::end(m_device_list), nullptr); diff --git a/src/devices/bus/sbus/sbus.h b/src/devices/bus/sbus/sbus.h index 2c66318c8aa..8f395afa253 100644 --- a/src/devices/bus/sbus/sbus.h +++ b/src/devices/bus/sbus/sbus.h @@ -38,7 +38,7 @@ public: protected: sbus_slot_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; @@ -93,8 +93,7 @@ public: protected: sbus_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; // internal state diff --git a/src/devices/bus/scsi/scsi.cpp b/src/devices/bus/scsi/scsi.cpp index 1530679230e..d42e0a527da 100644 --- a/src/devices/bus/scsi/scsi.cpp +++ b/src/devices/bus/scsi/scsi.cpp @@ -79,24 +79,6 @@ void scsi_port_device::device_start() m_device_count = i + 1; } - m_bsy_handler.resolve_safe(); - m_sel_handler.resolve_safe(); - m_cd_handler.resolve_safe(); - m_io_handler.resolve_safe(); - m_msg_handler.resolve_safe(); - m_req_handler.resolve_safe(); - m_ack_handler.resolve_safe(); - m_atn_handler.resolve_safe(); - m_rst_handler.resolve_safe(); - m_data0_handler.resolve_safe(); - m_data1_handler.resolve_safe(); - m_data2_handler.resolve_safe(); - m_data3_handler.resolve_safe(); - m_data4_handler.resolve_safe(); - m_data5_handler.resolve_safe(); - m_data6_handler.resolve_safe(); - m_data7_handler.resolve_safe(); - m_data0_handler(0); m_data1_handler(0); m_data2_handler(0); diff --git a/src/devices/bus/sms_ctrl/smsctrl.cpp b/src/devices/bus/sms_ctrl/smsctrl.cpp index 1df60acf304..7323a77bec9 100644 --- a/src/devices/bus/sms_ctrl/smsctrl.cpp +++ b/src/devices/bus/sms_ctrl/smsctrl.cpp @@ -66,12 +66,6 @@ sms_control_port_device::~sms_control_port_device() } -void sms_control_port_device::device_resolve_objects() -{ - m_th_handler.resolve_safe(); -} - - void sms_control_port_device::device_start() { m_controller = get_card_device(); diff --git a/src/devices/bus/sms_ctrl/smsctrl.h b/src/devices/bus/sms_ctrl/smsctrl.h index 5a0cac7de42..4f6e7f5a919 100644 --- a/src/devices/bus/sms_ctrl/smsctrl.h +++ b/src/devices/bus/sms_ctrl/smsctrl.h @@ -91,7 +91,6 @@ public: void out_w(u8 data, u8 mem_mask); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp index 04b9b6a1c89..b98be058777 100644 --- a/src/devices/bus/snes/snes_slot.cpp +++ b/src/devices/bus/snes/snes_slot.cpp @@ -227,7 +227,7 @@ base_sns_cart_slot_device::base_sns_cart_slot_device(const machine_config &mconf m_type(SNES_MODE20), m_cart(nullptr), m_irq_callback(*this), - m_open_bus_callback(*this) + m_open_bus_callback(*this, 0xff) { } @@ -263,9 +263,6 @@ void base_sns_cart_slot_device::device_start() m_cart = dynamic_cast<device_sns_cart_interface *>(get_card_device()); if (m_cart != nullptr) m_cart->m_slot = this; - - m_irq_callback.resolve_safe(); - m_open_bus_callback.resolve_safe(0xff); } diff --git a/src/devices/bus/spectrum/exp.cpp b/src/devices/bus/spectrum/exp.cpp index 88912901418..1f38862fa26 100644 --- a/src/devices/bus/spectrum/exp.cpp +++ b/src/devices/bus/spectrum/exp.cpp @@ -46,7 +46,7 @@ spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_con m_card(nullptr), m_irq_handler(*this), m_nmi_handler(*this), - m_fb_r_handler(*this) + m_fb_r_handler(*this, 0xff) { } @@ -58,11 +58,6 @@ spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_con void spectrum_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_irq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - m_fb_r_handler.resolve_safe(0xff); } //------------------------------------------------- diff --git a/src/devices/bus/ss50/interface.cpp b/src/devices/bus/ss50/interface.cpp index 6db293bfec8..af39817693b 100644 --- a/src/devices/bus/ss50/interface.cpp +++ b/src/devices/bus/ss50/interface.cpp @@ -120,9 +120,6 @@ ss50_interface_port_device::ss50_interface_port_device(const machine_config &mco void ss50_interface_port_device::device_resolve_objects() { - m_irq_cb.resolve_safe(); - m_firq_cb.resolve_safe(); - m_card = get_card_device(); if (m_card != nullptr) m_card->m_slot = this; diff --git a/src/devices/bus/sunkbd/sunkbd.cpp b/src/devices/bus/sunkbd/sunkbd.cpp index cdc8c89b4cf..315b9332130 100644 --- a/src/devices/bus/sunkbd/sunkbd.cpp +++ b/src/devices/bus/sunkbd/sunkbd.cpp @@ -132,12 +132,6 @@ void sun_keyboard_port_device::device_config_complete() } -void sun_keyboard_port_device::device_resolve_objects() -{ - m_rxd_handler.resolve_safe(); -} - - void sun_keyboard_port_device::device_start() { save_item(NAME(m_rxd)); diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h index ee70ce937f2..39d38b093ec 100644 --- a/src/devices/bus/sunkbd/sunkbd.h +++ b/src/devices/bus/sunkbd/sunkbd.h @@ -39,7 +39,6 @@ protected: sun_keyboard_port_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock); virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; int m_rxd; diff --git a/src/devices/bus/sunmouse/sunmouse.cpp b/src/devices/bus/sunmouse/sunmouse.cpp index 5c37d3b0774..15635831ed2 100644 --- a/src/devices/bus/sunmouse/sunmouse.cpp +++ b/src/devices/bus/sunmouse/sunmouse.cpp @@ -112,8 +112,6 @@ void sun_mouse_port_device::device_config_complete() void sun_mouse_port_device::device_resolve_objects() { m_rxd = 1; - - m_rxd_handler.resolve_safe(); } diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp index c7906b99261..b04c456fd95 100644 --- a/src/devices/bus/svi3x8/expander/expander.cpp +++ b/src/devices/bus/svi3x8/expander/expander.cpp @@ -36,7 +36,7 @@ svi_expander_device::svi_expander_device(const machine_config &mconfig, const ch m_ramdis_handler(*this), m_ctrl1_handler(*this), m_ctrl2_handler(*this), - m_excsr_handler(*this), + m_excsr_handler(*this, 0xff), m_excsw_handler(*this) { } @@ -57,15 +57,6 @@ void svi_expander_device::device_start() { // get inserted module m_module = get_card_device(); - - // resolve callbacks - m_int_handler.resolve_safe(); - m_romdis_handler.resolve_safe(); - m_ramdis_handler.resolve_safe(); - m_ctrl1_handler.resolve_safe(); - m_ctrl2_handler.resolve_safe(); - m_excsr_handler.resolve_safe(0xff); - m_excsw_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp index a514d0e9da4..dddae4f445a 100644 --- a/src/devices/bus/svi3x8/slot/slot.cpp +++ b/src/devices/bus/svi3x8/slot/slot.cpp @@ -42,10 +42,6 @@ svi_slot_bus_device::~svi_slot_bus_device() void svi_slot_bus_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - m_romdis_handler.resolve_safe(); - m_ramdis_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/devices/bus/tanbus/keyboard/keyboard.cpp b/src/devices/bus/tanbus/keyboard/keyboard.cpp index fa0c26d4c7d..183b0890765 100644 --- a/src/devices/bus/tanbus/keyboard/keyboard.cpp +++ b/src/devices/bus/tanbus/keyboard/keyboard.cpp @@ -58,10 +58,6 @@ microtan_kbd_slot_device::microtan_kbd_slot_device(const machine_config &mconfig void microtan_kbd_slot_device::device_start() { m_kbd = get_card_device(); - - // resolve callbacks - m_strobe_handler.resolve_safe(); - m_reset_handler.resolve_safe(); } diff --git a/src/devices/bus/tanbus/tanbus.cpp b/src/devices/bus/tanbus/tanbus.cpp index dc3f96df568..15d4ab8c976 100644 --- a/src/devices/bus/tanbus/tanbus.cpp +++ b/src/devices/bus/tanbus/tanbus.cpp @@ -84,12 +84,6 @@ void tanbus_device::add_card(device_tanbus_interface *card, int num) void tanbus_device::device_start() { - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); - m_out_so_cb.resolve_safe(); - m_out_pgm_cb.resolve_safe(); - save_item(NAME(m_block_register)); } diff --git a/src/devices/bus/thomson/extension.cpp b/src/devices/bus/thomson/extension.cpp index 205d8a24a88..4fb2cfbb7ce 100644 --- a/src/devices/bus/thomson/extension.cpp +++ b/src/devices/bus/thomson/extension.cpp @@ -31,12 +31,6 @@ void thomson_extension_device::io_map(address_space_installer &space, offs_t sta space.install_device(start, end, *dev, &thomson_extension_interface::io_map); } -void thomson_extension_device::device_resolve_objects() -{ - m_firq_callback.resolve_safe(); - m_irq_callback.resolve_safe(); -} - void thomson_extension_device::device_start() { } diff --git a/src/devices/bus/thomson/extension.h b/src/devices/bus/thomson/extension.h index 4fe83a8a007..d17b5d22536 100644 --- a/src/devices/bus/thomson/extension.h +++ b/src/devices/bus/thomson/extension.h @@ -44,7 +44,6 @@ public: void io_map(address_space_installer &space, offs_t start, offs_t end); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; devcb_write_line m_firq_callback; diff --git a/src/devices/bus/ti8x/ti8x.cpp b/src/devices/bus/ti8x/ti8x.cpp index ecc0f58e031..4c89147d996 100644 --- a/src/devices/bus/ti8x/ti8x.cpp +++ b/src/devices/bus/ti8x/ti8x.cpp @@ -72,9 +72,6 @@ void ti8x_link_port_device::ring_w(int state) void ti8x_link_port_device::device_start() { - m_tip_handler.resolve_safe(); - m_ring_handler.resolve_safe(); - save_item(NAME(m_tip_in)); save_item(NAME(m_tip_out)); save_item(NAME(m_ring_in)); diff --git a/src/devices/bus/ti99/colorbus/colorbus.cpp b/src/devices/bus/ti99/colorbus/colorbus.cpp index df6767cf65e..d3f26da93f1 100644 --- a/src/devices/bus/ti99/colorbus/colorbus.cpp +++ b/src/devices/bus/ti99/colorbus/colorbus.cpp @@ -51,14 +51,13 @@ void v9938_colorbus_device::buttons(int bstate) void v9938_colorbus_device::device_start() { - m_extra_button.resolve_safe(); } /*****************************************************************************/ -device_v9938_colorbus_interface::device_v9938_colorbus_interface(const machine_config &mconfig, device_t &device) - : device_interface(device, "v9938colorbus"), - m_colorbus(nullptr) +device_v9938_colorbus_interface::device_v9938_colorbus_interface(const machine_config &mconfig, device_t &device) : + device_interface(device, "v9938colorbus"), + m_colorbus(nullptr) { } diff --git a/src/devices/bus/ti99/gromport/gromport.cpp b/src/devices/bus/ti99/gromport/gromport.cpp index 9afb4161309..518750d6402 100644 --- a/src/devices/bus/ti99/gromport/gromport.cpp +++ b/src/devices/bus/ti99/gromport/gromport.cpp @@ -205,8 +205,6 @@ void gromport_device::set_gromlines(line_state mline, line_state moline, line_st void gromport_device::device_start() { - m_console_ready.resolve(); - m_console_reset.resolve(); save_item(NAME(m_romgq)); } diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp index 99a52a26d6e..a2222b36c3a 100644 --- a/src/devices/bus/ti99/internal/992board.cpp +++ b/src/devices/bus/ti99/internal/992board.cpp @@ -139,13 +139,13 @@ DEFINE_DEVICE_TYPE(TI992_RAM32K, bus::ti99::internal::ti992_expram_device, "ti99 namespace bus::ti99::internal { -video992_device::video992_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_video_interface(mconfig, *this), - m_mem_read_cb(*this), - m_hold_cb(*this), - m_int_cb(*this), - m_videna(true) +video992_device::video992_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_video_interface(mconfig, *this), + m_mem_read_cb(*this, 0), + m_hold_cb(*this), + m_int_cb(*this), + m_videna(true) { } @@ -295,10 +295,6 @@ void video992_device::device_start() m_border_color = rgb_t::black(); m_background_color = rgb_t::white(); m_text_color = rgb_t::black(); - - m_mem_read_cb.resolve(); - m_hold_cb.resolve(); - m_int_cb.resolve(); } void video992_device::device_reset() @@ -444,8 +440,6 @@ void io992_device::device_start() // Establish callback for inbound propagations m_hexbus_outbound->set_chain_element(this); - - m_set_rom_bank.resolve(); } uint8_t io992_device::cruread(offs_t offset) diff --git a/src/devices/bus/ti99/internal/998board.cpp b/src/devices/bus/ti99/internal/998board.cpp index f435687554d..684c531895d 100644 --- a/src/devices/bus/ti99/internal/998board.cpp +++ b/src/devices/bus/ti99/internal/998board.cpp @@ -1025,11 +1025,6 @@ void mainboard8_device::ggrdy_in(int state) void mainboard8_device::device_start() { - // Lines going to the main driver class, then to the CPU - m_ready.resolve_safe(); // READY - m_console_reset.resolve_safe(); // RESET - m_hold_line.resolve_safe(); // HOLD - m_rom0 = machine().root_device().memregion(TI998_ROM0_REG)->base(); m_rom1 = machine().root_device().memregion(TI998_ROM1_REG)->base(); m_pascalrom = machine().root_device().memregion(TI998_PASCAL_REG)->base(); @@ -2739,7 +2734,6 @@ void oso_device::hexbus_value_changed(uint8_t data) void oso_device::device_start() { m_status = m_xmit = m_control = m_data = 0; - m_int.resolve_safe(); // Establish the downstream link in the parent class hexbus_chained_device set_outbound_hexbus(m_hexbusout); diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp index 1dd8ee3ed0a..d87b2df75e6 100644 --- a/src/devices/bus/ti99/internal/datamux.cpp +++ b/src/devices/bus/ti99/internal/datamux.cpp @@ -581,10 +581,9 @@ void datamux_device::gromclk_in(int state) DEVICE LIFECYCLE FUNCTIONS ***************************************************************************/ -void datamux_device::device_start(void) +void datamux_device::device_start() { m_muxready = ASSERT_LINE; - m_ready.resolve(); // Register persistable state variables save_item(NAME(m_addr_buf)); @@ -599,11 +598,11 @@ void datamux_device::device_start(void) save_item(NAME(m_grom_idle)); } -void datamux_device::device_stop(void) +void datamux_device::device_stop() { } -void datamux_device::device_reset(void) +void datamux_device::device_reset() { m_consolerom = (uint16_t*)owner()->memregion(TI99_CONSOLEROM)->base(); m_use32k = (ioport("RAM")->read()==1); diff --git a/src/devices/bus/ti99/internal/evpcconn.cpp b/src/devices/bus/ti99/internal/evpcconn.cpp index 81598f3d893..5c9114e53c7 100644 --- a/src/devices/bus/ti99/internal/evpcconn.cpp +++ b/src/devices/bus/ti99/internal/evpcconn.cpp @@ -26,9 +26,9 @@ DEFINE_DEVICE_TYPE(TI99_EVPCCONN, bus::ti99::internal::evpc_clock_connector, "ti namespace bus::ti99::internal { -evpc_clock_connector::evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TI99_EVPCCONN, tag, owner, clock), - m_vdpint(*this) +evpc_clock_connector::evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TI99_EVPCCONN, tag, owner, clock), + m_vdpint(*this) { } @@ -39,7 +39,6 @@ void evpc_clock_connector::vclock_line(int state) void evpc_clock_connector::device_start() { - m_vdpint.resolve(); } } // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp index a4e6d127c4b..e9815a9a806 100644 --- a/src/devices/bus/ti99/internal/genboard.cpp +++ b/src/devices/bus/ti99/internal/genboard.cpp @@ -1082,10 +1082,6 @@ int geneve_gate_array_device::get_prefix(int lines) void geneve_gate_array_device::device_start() { - m_keyint.resolve_safe(); - m_keyb_clk.resolve_safe(); - m_keyb_data.resolve_safe(); - m_geneve_mode = false; m_direct_mode = true; @@ -1382,8 +1378,6 @@ void geneve_pal_device::set_ready() void geneve_pal_device::device_start() { - m_ready.resolve_safe(); - save_item(NAME(m_pin3)); save_item(NAME(m_pin4)); save_item(NAME(m_pin5)); diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index 0720a2e8116..b6605b90aa1 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -149,8 +149,6 @@ void ioport_device::reset_in(int state) void ioport_device::device_start() { - m_console_extint.resolve(); - m_console_ready.resolve(); if (m_connected != nullptr) m_connected->set_ioport(this); } diff --git a/src/devices/bus/ti99/joyport/joyport.cpp b/src/devices/bus/ti99/joyport/joyport.cpp index b93d09d767f..c131f59be70 100644 --- a/src/devices/bus/ti99/joyport/joyport.cpp +++ b/src/devices/bus/ti99/joyport/joyport.cpp @@ -94,7 +94,6 @@ void joyport_device::set_interrupt(int state) void joyport_device::device_start() { - m_interrupt.resolve(); } void joyport_device::device_config_complete() diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index 83d9d29c37c..c2d9fe68d11 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -452,13 +452,7 @@ void peribox_device::set_slot_loaded(int slot, peribox_slot_device* slotdev) void peribox_device::device_start() { - // Resolve the callback lines to the console - m_slot1_inta.resolve(); - m_slot1_intb.resolve(); - m_slot1_lcp.resolve(); - m_slot1_ready.resolve(); - - m_ioport_connected = (m_slot1_inta.isnull()); // TODO: init + m_ioport_connected = (m_slot1_inta.isunset()); // TODO: init LOGMASKED(LOG_CONFIG, "AMA/B/C address prefix set to %05x\n", m_address_prefix); for (int i=2; i < 9; i++) diff --git a/src/devices/bus/ti99x/990_dk.cpp b/src/devices/bus/ti99x/990_dk.cpp index f9815b2302a..bc08be51f59 100644 --- a/src/devices/bus/ti99x/990_dk.cpp +++ b/src/devices/bus/ti99x/990_dk.cpp @@ -870,7 +870,6 @@ LEGACY_FLOPPY_OPTIONS_END void fd800_legacy_device::device_start() { logerror("fd800: start\n"); - m_int_line.resolve(); for (auto & elem : m_drv) { diff --git a/src/devices/bus/ti99x/990_hd.cpp b/src/devices/bus/ti99x/990_hd.cpp index 052aa6af352..33f8a1424ab 100644 --- a/src/devices/bus/ti99x/990_hd.cpp +++ b/src/devices/bus/ti99x/990_hd.cpp @@ -275,10 +275,9 @@ int ti990_hdc_device::cur_disk_unit() */ void ti990_hdc_device::update_interrupt() { - if (!m_interrupt_callback.isnull()) - m_interrupt_callback((m_w[7] & w7_idle) - && (((m_w[7] & w7_int_enable) && (m_w[7] & (w7_complete | w7_error))) - || ((m_w[0] & (m_w[0] >> 4)) & w0_attn_mask))); + m_interrupt_callback((m_w[7] & w7_idle) + && (((m_w[7] & w7_int_enable) && (m_w[7] & (w7_complete | w7_error))) + || ((m_w[0] & (m_w[0] >> 4)) & w0_attn_mask))); } /* @@ -942,11 +941,9 @@ ti990_hdc_device::ti990_hdc_device(const machine_config &mconfig, const char *ta void ti990_hdc_device::device_start() { - int i; - /* initialize harddisk information */ /* attention lines will be set by DEVICE_IMAGE_LOAD */ - for (i=0; i<MAX_DISK_UNIT; i++) + for (int i=0; i<MAX_DISK_UNIT; i++) { m_d[i].format = format_mame; m_d[i].wp = 1; @@ -961,8 +958,6 @@ void ti990_hdc_device::device_start() m_d[2].img = dynamic_cast<harddisk_image_device *>(subdevice("harddisk3")); m_d[3].img = dynamic_cast<harddisk_image_device *>(subdevice("harddisk4")); - m_interrupt_callback.resolve_safe(); - update_interrupt(); } diff --git a/src/devices/bus/ti99x/990_tap.cpp b/src/devices/bus/ti99x/990_tap.cpp index 88029455f33..58f3619c101 100644 --- a/src/devices/bus/ti99x/990_tap.cpp +++ b/src/devices/bus/ti99x/990_tap.cpp @@ -35,6 +35,9 @@ #include "imagedev/magtape.h" +#include <algorithm> +#include <iterator> + enum { w0_offline = 0x8000, @@ -968,8 +971,7 @@ tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, d void tap_990_device::device_start() { - m_int_line.resolve(); - memset(m_w, 0, sizeof(m_w)); + std::fill(std::begin(m_w), std::end(m_w), 0); // The PE bit is always set for the MT3200 (but not MT1600) // According to MT3200 manual, w7 bit #4 (reserved) is always set diff --git a/src/devices/bus/tiki100/exp.cpp b/src/devices/bus/tiki100/exp.cpp index 1bef2819c10..a78b143146d 100644 --- a/src/devices/bus/tiki100/exp.cpp +++ b/src/devices/bus/tiki100/exp.cpp @@ -58,7 +58,7 @@ tiki100_bus_device::tiki100_bus_device(const machine_config &mconfig, const char m_irq_cb(*this), m_nmi_cb(*this), m_busrq_cb(*this), - m_in_mrq_cb(*this), + m_in_mrq_cb(*this, 0), m_out_mrq_cb(*this) { } @@ -74,12 +74,6 @@ tiki100_bus_device::~tiki100_bus_device() void tiki100_bus_device::device_start() { - // resolve callbacks - m_irq_cb.resolve_safe(); - m_nmi_cb.resolve_safe(); - m_busrq_cb.resolve_safe(); - m_in_mrq_cb.resolve(); - m_out_mrq_cb.resolve(); } diff --git a/src/devices/bus/tvc/tvc.cpp b/src/devices/bus/tvc/tvc.cpp index d3b4cee5652..c1c8dc902e6 100644 --- a/src/devices/bus/tvc/tvc.cpp +++ b/src/devices/bus/tvc/tvc.cpp @@ -75,10 +75,6 @@ tvcexp_slot_device::~tvcexp_slot_device() void tvcexp_slot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_out_irq_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); } /*------------------------------------------------- diff --git a/src/devices/bus/uts_kbd/uts_kbd.cpp b/src/devices/bus/uts_kbd/uts_kbd.cpp index 8a379b69f0c..5f1cc77eab5 100644 --- a/src/devices/bus/uts_kbd/uts_kbd.cpp +++ b/src/devices/bus/uts_kbd/uts_kbd.cpp @@ -50,11 +50,6 @@ void uts_keyboard_port_device::device_config_complete() m_kbd = get_card_device(); } -void uts_keyboard_port_device::device_resolve_objects() -{ - m_rxd_callback.resolve_safe(); -} - void uts_keyboard_port_device::device_start() { } diff --git a/src/devices/bus/uts_kbd/uts_kbd.h b/src/devices/bus/uts_kbd/uts_kbd.h index a70f9e7c5ff..5d34f7f98cb 100644 --- a/src/devices/bus/uts_kbd/uts_kbd.h +++ b/src/devices/bus/uts_kbd/uts_kbd.h @@ -45,9 +45,8 @@ public: inline void ready_w(int state); protected: - // device-level overrides + // device_t implementation virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; // called from keyboard diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp index 4cd783409c2..6e5cfbb0bb2 100644 --- a/src/devices/bus/vboy/slot.cpp +++ b/src/devices/bus/vboy/slot.cpp @@ -95,12 +95,6 @@ void vboy_cart_slot_device::device_validity_check(validity_checker &valid) const } -void vboy_cart_slot_device::device_resolve_objects() -{ - m_intcro.resolve_safe(); -} - - void vboy_cart_slot_device::device_start() { if (!m_exp_space && ((m_exp_space.finder_tag() != finder_base::DUMMY_TAG) || (m_exp_space.spacenum() >= 0))) diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h index 3b3b7979878..850841de194 100644 --- a/src/devices/bus/vboy/slot.h +++ b/src/devices/bus/vboy/slot.h @@ -117,7 +117,6 @@ public: protected: // device_t implementation virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD; - virtual void device_resolve_objects() override ATTR_COLD; virtual void device_start() override ATTR_COLD; private: diff --git a/src/devices/bus/vcs_ctrl/ctrl.cpp b/src/devices/bus/vcs_ctrl/ctrl.cpp index 248fcf2b584..2ff11e88040 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.cpp +++ b/src/devices/bus/vcs_ctrl/ctrl.cpp @@ -58,8 +58,6 @@ vcs_control_port_device::vcs_control_port_device(const machine_config &mconfig, void vcs_control_port_device::device_start() { m_device = dynamic_cast<device_vcs_control_port_interface *>(get_card_device()); - - m_write_trigger.resolve_safe(); } diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp index 19f55c0bac7..2b1f1ecea82 100644 --- a/src/devices/bus/vic10/exp.cpp +++ b/src/devices/bus/vic10/exp.cpp @@ -73,12 +73,6 @@ vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &m void vic10_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_res.resolve_safe(); - m_write_cnt.resolve_safe(); - m_write_sp.resolve_safe(); } diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp index d9bbd22d16b..9e9e48235f5 100644 --- a/src/devices/bus/vic20/exp.cpp +++ b/src/devices/bus/vic20/exp.cpp @@ -71,11 +71,6 @@ vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &m void vic20_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_res.resolve_safe(); } diff --git a/src/devices/bus/vidbrain/exp.cpp b/src/devices/bus/vidbrain/exp.cpp index bf78cdfc9ea..067f2d6e14b 100644 --- a/src/devices/bus/vidbrain/exp.cpp +++ b/src/devices/bus/vidbrain/exp.cpp @@ -95,9 +95,6 @@ videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine void videobrain_expansion_slot_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_write_extres.resolve_safe(); } diff --git a/src/devices/bus/vip/byteio.cpp b/src/devices/bus/vip/byteio.cpp index a63fcce8d60..0826cab70ac 100644 --- a/src/devices/bus/vip/byteio.cpp +++ b/src/devices/bus/vip/byteio.cpp @@ -58,9 +58,6 @@ vip_byteio_port_device::vip_byteio_port_device(const machine_config &mconfig, co void vip_byteio_port_device::device_start() { m_cart = get_card_device(); - - // resolve callbacks - m_write_inst.resolve_safe(); } diff --git a/src/devices/bus/vip/exp.cpp b/src/devices/bus/vip/exp.cpp index d538d653d17..16374ed7941 100644 --- a/src/devices/bus/vip/exp.cpp +++ b/src/devices/bus/vip/exp.cpp @@ -68,11 +68,6 @@ vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconf void vip_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_write_int.resolve_safe(); - m_write_dma_out.resolve_safe(); - m_write_dma_in.resolve_safe(); } diff --git a/src/devices/bus/vsmile/vsmile_ctrl.cpp b/src/devices/bus/vsmile/vsmile_ctrl.cpp index f253e800fab..8fc8e0e678b 100644 --- a/src/devices/bus/vsmile/vsmile_ctrl.cpp +++ b/src/devices/bus/vsmile/vsmile_ctrl.cpp @@ -73,9 +73,6 @@ vsmile_ctrl_port_device::~vsmile_ctrl_port_device() void vsmile_ctrl_port_device::device_resolve_objects() { m_device = get_card_device(); - - m_rts_cb.resolve_safe(); - m_data_cb.resolve_safe(); } void vsmile_ctrl_port_device::device_start() diff --git a/src/devices/bus/vtech/memexp/memexp.cpp b/src/devices/bus/vtech/memexp/memexp.cpp index 74d2213009a..984849fe9ab 100644 --- a/src/devices/bus/vtech/memexp/memexp.cpp +++ b/src/devices/bus/vtech/memexp/memexp.cpp @@ -86,11 +86,6 @@ void vtech_memexp_slot_device::device_start() m_module->iorq_w(offset, data); } ); - - // resolve callbacks - m_int_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - m_reset_handler.resolve_safe(); } diff --git a/src/devices/bus/wangpc/wangpc.cpp b/src/devices/bus/wangpc/wangpc.cpp index bcf4612b928..c03f84d9372 100644 --- a/src/devices/bus/wangpc/wangpc.cpp +++ b/src/devices/bus/wangpc/wangpc.cpp @@ -77,17 +77,6 @@ wangpcbus_device::~wangpcbus_device() void wangpcbus_device::device_start() { - // resolve callbacks - m_write_irq2.resolve_safe(); - m_write_irq3.resolve_safe(); - m_write_irq4.resolve_safe(); - m_write_irq5.resolve_safe(); - m_write_irq6.resolve_safe(); - m_write_irq7.resolve_safe(); - m_write_drq1.resolve_safe(); - m_write_drq2.resolve_safe(); - m_write_drq3.resolve_safe(); - m_write_ioerror.resolve_safe(); } diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp index 9b56c1bcfe2..58c0f639170 100644 --- a/src/devices/bus/x68k/x68kexp.cpp +++ b/src/devices/bus/x68k/x68kexp.cpp @@ -68,12 +68,6 @@ x68k_expansion_slot_device::~x68k_expansion_slot_device() void x68k_expansion_slot_device::device_start() { m_card = get_card_device(); - - // resolve callbacks - m_out_irq2_cb.resolve_safe(); - m_out_irq4_cb.resolve_safe(); - m_out_nmi_cb.resolve_safe(); - m_out_reset_cb.resolve_safe(); } diff --git a/src/devices/bus/z29_kbd/keyboard.cpp b/src/devices/bus/z29_kbd/keyboard.cpp index 637bc8d4389..670ab5804a8 100644 --- a/src/devices/bus/z29_kbd/keyboard.cpp +++ b/src/devices/bus/z29_kbd/keyboard.cpp @@ -82,12 +82,6 @@ void z29_keyboard_port_device::device_config_complete() m_kbd = get_card_device(); } -void z29_keyboard_port_device::device_resolve_objects() -{ - m_keyin_callback.resolve_safe(); - m_reset_callback.resolve_safe(); -} - void z29_keyboard_port_device::device_start() { } diff --git a/src/devices/bus/z29_kbd/keyboard.h b/src/devices/bus/z29_kbd/keyboard.h index ec3867f4aa7..b4c5aea9213 100644 --- a/src/devices/bus/z29_kbd/keyboard.h +++ b/src/devices/bus/z29_kbd/keyboard.h @@ -43,12 +43,11 @@ public: auto reset_callback() { return m_reset_callback.bind(); } // line handler - inline void keyout_w(int state); + void keyout_w(int state); protected: - // device-level overrides + // device_t implementation virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; // called from keyboard @@ -95,7 +94,7 @@ extern void z29_keyboards(device_slot_interface &slot); // INLINE FUNCTIONS //************************************************************************** -void z29_keyboard_port_device::keyout_w(int state) +inline void z29_keyboard_port_device::keyout_w(int state) { if (m_kbd != nullptr) m_kbd->receive_data(state); diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index f7c38114f83..fe77274a8ed 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -73,9 +73,6 @@ void z88cart_slot_device::device_start() { m_cart = get_card_device(); - // resolve callbacks - m_out_flp_cb.resolve_safe(); - m_flp_timer = timer_alloc(FUNC(z88cart_slot_device::close_flap), this); m_flp_timer->reset(); } diff --git a/src/devices/cpu/8x300/8x300.cpp b/src/devices/cpu/8x300/8x300.cpp index cd6efcb1b3c..dbc7614748a 100644 --- a/src/devices/cpu/8x300/8x300.cpp +++ b/src/devices/cpu/8x300/8x300.cpp @@ -184,16 +184,6 @@ uint8_t n8x305_cpu_device::get_reg(uint8_t reg) } } -void n8x300_cpu_device::device_resolve_objects() -{ - m_sc_callback.resolve_safe(); - m_wc_callback.resolve_safe(); - m_lb_callback.resolve_safe(); - m_rb_callback.resolve_safe(); - m_mclk_callback.resolve_safe(); - m_iv_callback.resolve_safe(); -} - void n8x300_cpu_device::device_start() { space(AS_PROGRAM).cache(m_cache); diff --git a/src/devices/cpu/8x300/8x300.h b/src/devices/cpu/8x300/8x300.h index e4f2a2a3dda..c4e36490b7f 100644 --- a/src/devices/cpu/8x300/8x300.h +++ b/src/devices/cpu/8x300/8x300.h @@ -54,24 +54,23 @@ public: protected: n8x300_cpu_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; - // device_state_interface overrides + // device_state_interface implementation virtual void state_import(const device_state_entry &entry) override; - // device_execute_interface overrides + // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } virtual uint32_t execute_input_lines() const noexcept override { return 0; } virtual void execute_run() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; virtual void set_reg(uint8_t reg, uint8_t val, bool xmit); diff --git a/src/devices/cpu/adsp2100/2100ops.hxx b/src/devices/cpu/adsp2100/2100ops.hxx index 0eab17b5ad6..373b7e1cddc 100644 --- a/src/devices/cpu/adsp2100/2100ops.hxx +++ b/src/devices/cpu/adsp2100/2100ops.hxx @@ -82,8 +82,7 @@ inline void adsp21xx_device::update_mstat() m_alt = temp; } if ((m_mstat ^ m_mstat_prev) & MSTAT_TIMER) - if (!m_timer_fired_cb.isnull()) - m_timer_fired_cb((m_mstat & MSTAT_TIMER) != 0); + m_timer_fired_cb((m_mstat & MSTAT_TIMER) != 0); if (m_mstat & MSTAT_STICKYV) m_astat_clear = ~(CFLAG | NFLAG | ZFLAG); else @@ -339,8 +338,7 @@ inline void adsp21xx_device::update_l(int which) inline void adsp21xx_device::update_dmovlay() { - if (!m_dmovlay_cb.isnull()) - m_dmovlay_cb(m_dmovlay); + m_dmovlay_cb(m_dmovlay); } void adsp21xx_device::write_reg0(int regnum, int32_t val) @@ -445,8 +443,8 @@ void adsp21xx_device::write_reg3(int regnum, int32_t val) case 0x05: cntr_stack_push(); m_cntr = val & 0x3fff; break; case 0x06: m_core.sb.s = util::sext(val, 5); break; case 0x07: m_px = val; break; - case 0x09: if (!m_sport_tx_cb.isnull()) m_sport_tx_cb(0, val, 0xffff); break; - case 0x0b: if (!m_sport_tx_cb.isnull()) m_sport_tx_cb(1, val, 0xffff); break; + case 0x09: m_sport_tx_cb(0, val, 0xffff); break; + case 0x0b: m_sport_tx_cb(1, val, 0xffff); break; case 0x0c: m_ifc = val; if (m_chip_type >= CHIP_TYPE_ADSP2181) @@ -538,8 +536,8 @@ int32_t adsp21xx_device::read_reg3(int regnum) case 0x05: return m_cntr; case 0x06: return m_core.sb.s; case 0x07: return m_px; - case 0x08: if (!m_sport_rx_cb.isnull()) return m_sport_rx_cb(0); else return 0; - case 0x0a: if (!m_sport_rx_cb.isnull()) return m_sport_rx_cb(1); else return 0; + case 0x08: return m_sport_rx_cb(0); + case 0x0a: return m_sport_rx_cb(1); case 0x0f: return pc_stack_pop_val(); default: logerror("ADSP %04x: Reading from an invalid register! RGP=b11 RegCode=%1X\n", m_ppc, regnum); return 0; } diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp index 86b0158caa7..4a5a0963a9f 100644 --- a/src/devices/cpu/adsp2100/adsp2100.cpp +++ b/src/devices/cpu/adsp2100/adsp2100.cpp @@ -165,7 +165,7 @@ adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type m_mstat_mask((m_chip_type >= CHIP_TYPE_ADSP2101) ? 0x7f : 0x0f), m_imask_mask((m_chip_type >= CHIP_TYPE_ADSP2181) ? 0x3ff : (m_chip_type >= CHIP_TYPE_ADSP2101) ? 0x3f : 0x0f), - m_sport_rx_cb(*this), + m_sport_rx_cb(*this, 0), m_sport_tx_cb(*this), m_timer_fired_cb(*this), m_dmovlay_cb(*this) @@ -420,11 +420,6 @@ uint16_t adsp2181_device::idma_data_r() void adsp21xx_device::device_start() { - m_sport_rx_cb.resolve(); - m_sport_tx_cb.resolve(); - m_timer_fired_cb.resolve(); - m_dmovlay_cb.resolve(); - // get our address spaces space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); diff --git a/src/devices/cpu/alpha/alpha.cpp b/src/devices/cpu/alpha/alpha.cpp index bbc32f087f8..62752d5f590 100644 --- a/src/devices/cpu/alpha/alpha.cpp +++ b/src/devices/cpu/alpha/alpha.cpp @@ -58,7 +58,7 @@ alpha_device::alpha_device(const machine_config &mconfig, device_type type, cons address_space_config("3", ENDIANNESS_LITTLE, 64, 32, 0) } , m_srom_oe_cb(*this) - , m_srom_data_cb(*this) + , m_srom_data_cb(*this, 0) , m_icount(0) { } @@ -85,9 +85,6 @@ void alpha_device::device_start() // floating point registers for (unsigned i = 0; i < 32; i++) state_add(i + 32, util::string_format("F%d", i).c_str(), m_f[i]); - - m_srom_oe_cb.resolve_safe(); - m_srom_data_cb.resolve_safe(0); } void alpha_device::device_reset() diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp index 5d093a96966..0ae70dc623b 100644 --- a/src/devices/cpu/alto2/alto2cpu.cpp +++ b/src/devices/cpu/alto2/alto2cpu.cpp @@ -127,7 +127,7 @@ void alto2_cpu_device::iomem_map(address_map &map) alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : cpu_device(mconfig, ALTO2, tag, owner, clock), - m_kb_read_callback(*this), + m_kb_read_callback(*this, 0177777), m_utilout_callback(*this), m_ucode_config("ucode", ENDIANNESS_BIG, 32, 12, -2, address_map_constructor(FUNC(alto2_cpu_device::ucode_map), this)), m_const_config("const", ENDIANNESS_BIG, 16, 8, -1, address_map_constructor(FUNC(alto2_cpu_device::const_map), this)), @@ -792,9 +792,6 @@ device_memory_interface::space_config_vector alto2_cpu_device::memory_space_conf void alto2_cpu_device::device_start() { - m_kb_read_callback.resolve_safe(0177777); - m_utilout_callback.resolve_safe(); - // get a pointer to the IO address space m_iomem = &space(2); diff --git a/src/devices/cpu/amis2000/amis2000.cpp b/src/devices/cpu/amis2000/amis2000.cpp index 468b29acd98..2f4ca06eb19 100644 --- a/src/devices/cpu/amis2000/amis2000.cpp +++ b/src/devices/cpu/amis2000/amis2000.cpp @@ -59,6 +59,23 @@ void amis2000_base_device::data_80x4(address_map &map) // device definitions +amis2000_base_device::amis2000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 bu_bits, u8 callstack_bits, u8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) + : cpu_device(mconfig, type, tag, owner, clock) + , m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program) + , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) + , m_bu_bits(bu_bits) + , m_callstack_bits(callstack_bits) + , m_callstack_depth(callstack_depth) + , m_7seg_table(nullptr) + , m_read_k(*this, 0xf) + , m_read_i(*this, 0xf) + , m_read_d(*this, 0) + , m_write_d(*this) + , m_write_a(*this) + , m_write_f(*this) +{ +} + amis2000_cpu_device::amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : amis2000_base_device(mconfig, AMI_S2000, tag, owner, clock, 2, 10, 3, 13, address_map_constructor(FUNC(amis2000_cpu_device::program_1k), this), 6, address_map_constructor(FUNC(amis2000_cpu_device::data_64x4), this)) { } @@ -117,13 +134,6 @@ void amis2000_base_device::device_start() m_program = &space(AS_PROGRAM); m_data = &space(AS_DATA); - m_read_k.resolve_safe(0xf); - m_read_i.resolve_safe(0xf); - m_read_d.resolve_safe(0); - m_write_d.resolve_safe(); - m_write_a.resolve_safe(); - m_write_f.resolve_safe(); - m_bu_mask = (1 << m_bu_bits) - 1; m_callstack_mask = (1 << m_callstack_bits) - 1; diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h index f284149dd15..e6f5a0f3236 100644 --- a/src/devices/cpu/amis2000/amis2000.h +++ b/src/devices/cpu/amis2000/amis2000.h @@ -39,22 +39,7 @@ public: protected: // construction/destruction - amis2000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 bu_bits, u8 callstack_bits, u8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : cpu_device(mconfig, type, tag, owner, clock) - , m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program) - , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) - , m_bu_bits(bu_bits) - , m_callstack_bits(callstack_bits) - , m_callstack_depth(callstack_depth) - , m_7seg_table(nullptr) - , m_read_k(*this) - , m_read_i(*this) - , m_read_d(*this) - , m_write_d(*this) - , m_write_a(*this) - , m_write_f(*this) - { - } + amis2000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 bu_bits, u8 callstack_bits, u8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); // device-level overrides virtual void device_start() override; diff --git a/src/devices/cpu/apexc/apexc.cpp b/src/devices/cpu/apexc/apexc.cpp index 68c1547823c..b38e66d7aeb 100644 --- a/src/devices/cpu/apexc/apexc.cpp +++ b/src/devices/cpu/apexc/apexc.cpp @@ -340,7 +340,7 @@ DEFINE_DEVICE_TYPE(APEXC, apexc_cpu_device, "apexc_cpu", "APE(X)C") apexc_cpu_device::apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, APEXC, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, 32, 15, 0) - , m_tape_read_cb(*this) + , m_tape_read_cb(*this, 0) , m_tape_punch_cb(*this) , m_a(0) , m_r(0) @@ -763,9 +763,6 @@ special_fetch: void apexc_cpu_device::device_start() { - m_tape_read_cb.resolve_safe(0); - m_tape_punch_cb.resolve_safe(); - m_program = &space(AS_PROGRAM); save_item(NAME(m_a)); diff --git a/src/devices/cpu/arm7/upd800468.cpp b/src/devices/cpu/arm7/upd800468.cpp index 16b6928bf7c..fef0fdc9fce 100644 --- a/src/devices/cpu/arm7/upd800468.cpp +++ b/src/devices/cpu/arm7/upd800468.cpp @@ -63,8 +63,6 @@ void upd800468_timer_device::device_start() { m_timer = timer_alloc(FUNC(upd800468_timer_device::irq_timer_tick), this); - m_irq_cb.resolve_safe(); - save_item(NAME(m_rate)); save_item(NAME(m_control)); } @@ -128,7 +126,7 @@ upd800468_device::upd800468_device(const machine_config &mconfig, const char *ta , m_vic(*this, "vic") , m_timer(*this, "timer%u", 0) , m_kbd(*this, "kbd") - , m_adc_cb(*this), m_in_cb(*this), m_out_cb(*this) + , m_adc_cb(*this, 0x00), m_in_cb(*this, 0x00), m_out_cb(*this) , m_ram_view(*this, "ramview") { } @@ -169,10 +167,6 @@ void upd800468_device::device_start() { arm7_cpu_device::device_start(); - m_adc_cb.resolve_all_safe(0x000); - m_in_cb.resolve_all_safe(0x00); - m_out_cb.resolve_all_safe(); - save_item(NAME(m_port_data)); save_item(NAME(m_port_ddr)); save_item(NAME(m_ram_enable)); diff --git a/src/devices/cpu/avr8/avr8.cpp b/src/devices/cpu/avr8/avr8.cpp index b07eb8719a4..a9a33f6958c 100644 --- a/src/devices/cpu/avr8/avr8.cpp +++ b/src/devices/cpu/avr8/avr8.cpp @@ -751,8 +751,8 @@ avr8_device::avr8_device(const machine_config &mconfig, const char *tag, device_ , m_pc(0) , m_num_timers(num_timers) , m_gpio_out_cb(*this) - , m_gpio_in_cb(*this) - , m_adc_in_cb(*this) + , m_gpio_in_cb(*this, 0) + , m_adc_in_cb(*this, 0) , m_adc_timer(nullptr) , m_spi_active(false) , m_spi_prescale(0) @@ -849,10 +849,6 @@ void avr8_device::device_start() m_program = &space(AS_PROGRAM); m_data = &space(AS_DATA); - m_gpio_out_cb.resolve_all_safe(); - m_gpio_in_cb.resolve_all_safe(0); - - m_adc_in_cb.resolve_all_safe(0); m_adc_timer = timer_alloc(FUNC(avr8_device::adc_conversion_complete), this); // register our state for the debugger diff --git a/src/devices/cpu/axc51/axc51.cpp b/src/devices/cpu/axc51/axc51.cpp index 739abdf5e5b..0f1ee436f51 100644 --- a/src/devices/cpu/axc51/axc51.cpp +++ b/src/devices/cpu/axc51/axc51.cpp @@ -83,10 +83,10 @@ axc51base_cpu_device::axc51base_cpu_device(const machine_config &mconfig, device , m_num_interrupts(5) , m_scratchpad(*this, "scratchpad") , m_mainram(*this, "mainram") - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) , m_dac_out_cb(*this) - , m_spi_in_cb(*this) + , m_spi_in_cb(*this, 0xff) , m_spi_out_cb(*this) , m_spi_out_dir_cb(*this) , m_rtemp(0) @@ -1221,14 +1221,6 @@ void axc51base_cpu_device::device_start() space(AS_DATA).specific(m_data); space(AS_IO).specific(m_io); - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - m_dac_out_cb.resolve_all_safe(); - - m_spi_in_cb.resolve_safe(0xff); - m_spi_out_cb.resolve_safe(); - m_spi_out_dir_cb.resolve_safe(); - /* Save states */ save_item(NAME(m_ppc)); save_item(NAME(m_pc)); diff --git a/src/devices/cpu/bcp/dp8344.cpp b/src/devices/cpu/bcp/dp8344.cpp index 3e78cb0d0dd..3c37aa7f874 100644 --- a/src/devices/cpu/bcp/dp8344.cpp +++ b/src/devices/cpu/bcp/dp8344.cpp @@ -150,22 +150,6 @@ device_memory_interface::space_config_vector dp8344_device::memory_space_config( //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void dp8344_device::device_resolve_objects() -{ - // resolve output callbacks - m_birq_out_cb.resolve_safe(); - m_data_out_cb.resolve_safe(); - m_data_dly_cb.resolve_safe(); - m_tx_act_cb.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/cpu/bcp/dp8344.h b/src/devices/cpu/bcp/dp8344.h index f4e1e674da9..aede18c32a0 100644 --- a/src/devices/cpu/bcp/dp8344.h +++ b/src/devices/cpu/bcp/dp8344.h @@ -64,25 +64,24 @@ protected: // construction/destruction dp8344_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device-specific 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 u32 execute_min_cycles() const noexcept override { return 2; } virtual u32 execute_max_cycles() const noexcept override { return 4; } virtual u32 execute_input_lines() const noexcept override { return 3; } virtual void execute_run() override; virtual void execute_set_input(int irqline, int state) override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; private: diff --git a/src/devices/cpu/capricorn/capricorn.cpp b/src/devices/cpu/capricorn/capricorn.cpp index ddf3d6d821c..8a55dd7bfbd 100644 --- a/src/devices/cpu/capricorn/capricorn.cpp +++ b/src/devices/cpu/capricorn/capricorn.cpp @@ -138,12 +138,12 @@ static constexpr uint8_t E_MASK = 0xf; DEFINE_DEVICE_TYPE(HP_CAPRICORN , capricorn_cpu_device , "capricorn" , "HP-Capricorn") -capricorn_cpu_device::capricorn_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : cpu_device(mconfig, HP_CAPRICORN, tag, owner, clock), +capricorn_cpu_device::capricorn_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + cpu_device(mconfig, HP_CAPRICORN, tag, owner, clock), m_program_config("program" , ENDIANNESS_LITTLE , 8 , 16), m_opcode_func(*this), m_lma_out(*this), - m_intack_in(*this) + m_intack_in(*this, 0) { } @@ -181,10 +181,6 @@ void capricorn_cpu_device::device_start() save_item(NAME(m_flags)); set_icountptr(m_icount); - - m_opcode_func.resolve_safe(); - m_lma_out.resolve_safe(); - m_intack_in.resolve_safe(0); } void capricorn_cpu_device::device_reset() diff --git a/src/devices/cpu/ccpu/ccpu.cpp b/src/devices/cpu/ccpu/ccpu.cpp index 00a210a6c23..3524724fabe 100644 --- a/src/devices/cpu/ccpu/ccpu.cpp +++ b/src/devices/cpu/ccpu/ccpu.cpp @@ -69,7 +69,7 @@ ccpu_cpu_device::ccpu_cpu_device(const machine_config &mconfig, const char *tag, , m_program_config("program", ENDIANNESS_BIG, 8, 15, 0) , m_data_config("data", ENDIANNESS_BIG, 16, 32, -1) , m_io_config("io", ENDIANNESS_BIG, 8, 5, 0) - , m_external_input(*this) + , m_external_input(*this, 0) , m_vector_callback(*this) , m_flags(0) { @@ -104,7 +104,6 @@ void ccpu_cpu_device::wdt_timer_trigger() void ccpu_cpu_device::device_start() { /* copy input params */ - m_external_input.resolve_safe(0); m_vector_callback.resolve_safe(); space(AS_PROGRAM).cache(m_cache); diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp index de401789db0..6b7522350e6 100644 --- a/src/devices/cpu/cop400/cop400.cpp +++ b/src/devices/cpu/cop400/cop400.cpp @@ -176,17 +176,17 @@ cop400_cpu_device::cop400_cpu_device(const machine_config &mconfig, device_type : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, program_addr_bits, 0, internal_map_program) , m_data_config("data", ENDIANNESS_LITTLE, 8, data_addr_bits, 0, internal_map_data) // data width is really 4 - , m_read_l(*this) - , m_read_l_tristate(*this) + , m_read_l(*this, 0) + , m_read_l_tristate(*this, 0) , m_write_l(*this) - , m_read_g(*this) + , m_read_g(*this, 0) , m_write_g(*this) , m_write_d(*this) - , m_read_in(*this) - , m_read_si(*this) + , m_read_in(*this, 0) + , m_read_si(*this, 0) , m_write_so(*this) , m_write_sk(*this) - , m_read_cko(*this) + , m_read_cko(*this, 0) , m_cki(COP400_CKI_DIVISOR_16) , m_cko(COP400_CKO_OSCILLATOR_OUTPUT) , m_has_microbus(false) @@ -1069,19 +1069,6 @@ void cop400_cpu_device::device_start() space(AS_PROGRAM).cache(m_program); space(AS_DATA).specific(m_data); - /* find i/o handlers */ - m_read_l.resolve_safe(0); - m_read_l_tristate.resolve_safe(0); - m_write_l.resolve_safe(); - m_read_g.resolve_safe(0); - m_write_g.resolve_safe(); - m_write_d.resolve_safe(); - m_read_in.resolve_safe(0); - m_read_si.resolve_safe(0); - m_write_so.resolve_safe(); - m_write_sk.resolve_safe(); - m_read_cko.resolve_safe(0); - /* allocate counter timer */ m_counter_timer = nullptr; if (m_has_counter) diff --git a/src/devices/cpu/cops1/cops1base.cpp b/src/devices/cpu/cops1/cops1base.cpp index 3bba883377b..b0e8dc2b102 100644 --- a/src/devices/cpu/cops1/cops1base.cpp +++ b/src/devices/cpu/cops1/cops1base.cpp @@ -41,15 +41,15 @@ cops1_base_device::cops1_base_device(const machine_config &mconfig, device_type m_prgwidth(prgwidth), m_datawidth(datawidth), m_opla(*this, "opla"), - m_read_k(*this), - m_read_inb(*this), - m_read_f(*this), + m_read_k(*this, 0), + m_read_inb(*this, 0), + m_read_f(*this, 0), m_write_f(*this), - m_read_do3(*this), + m_read_do3(*this, 0), m_write_do(*this), m_write_s(*this), m_write_blk(*this), - m_read_si(*this), + m_read_si(*this, 0), m_write_so(*this) { } @@ -65,18 +65,6 @@ void cops1_base_device::device_start() m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; - // resolve callbacks - m_read_k.resolve_safe(0); - m_read_inb.resolve_safe(0); - m_read_f.resolve(); - m_write_f.resolve_safe(); - m_read_do3.resolve(); - m_write_do.resolve_safe(); - m_write_s.resolve_safe(); - m_write_blk.resolve_safe(); - m_read_si.resolve_safe(0); - m_write_so.resolve_safe(); - // zerofill m_pc = 0; m_prev_pc = 0; diff --git a/src/devices/cpu/cops1/mm5799op.cpp b/src/devices/cpu/cops1/mm5799op.cpp index 180ae257011..4e293ff3c3f 100644 --- a/src/devices/cpu/cops1/mm5799op.cpp +++ b/src/devices/cpu/cops1/mm5799op.cpp @@ -126,7 +126,7 @@ void mm5799_device::op_tin() void mm5799_device::op_tf() { // TF x: test F pin - u8 f = m_read_f.isnull() ? m_f : m_read_f(); + u8 f = m_read_f.isunset() ? m_f : m_read_f(); m_skip = !BIT(f, m_op >> 4 & 3); } @@ -140,7 +140,7 @@ void mm5799_device::op_tkb() void mm5799_device::op_tir() { // TIR: test DO3 pin - int d = m_read_do3.isnull() ? (m_do >> 2) : m_read_do3(); + int d = m_read_do3.isunset() ? (m_do >> 2) : m_read_do3(); m_skip = !bool(d & 1); } diff --git a/src/devices/cpu/cosmac/cosmac.cpp b/src/devices/cpu/cosmac/cosmac.cpp index cdd4d5d9fed..6b9c866c92e 100644 --- a/src/devices/cpu/cosmac/cosmac.cpp +++ b/src/devices/cpu/cosmac/cosmac.cpp @@ -358,27 +358,27 @@ DEFINE_DEVICE_TYPE(CDP1806, cdp1806_device, "cdp1806", "RCA CDP1806") // cosmac_device - constructor //------------------------------------------------- -cosmac_device::cosmac_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : cpu_device(mconfig, type, tag, owner, clock), - cosmac_disassembler::config(), - m_program_config("program", ENDIANNESS_LITTLE, 8, 16), - m_io_config("io", ENDIANNESS_LITTLE, 8, 3), - m_read_wait(*this), - m_read_clear(*this), - m_read_ef(*this), - m_write_q(*this), - m_read_dma(*this), - m_write_dma(*this), - m_write_sc(*this), - m_write_tpb(*this), - m_state(cosmac_state::STATE_1_INIT), - m_mode(cosmac_mode::RESET), - m_pmode(cosmac_mode::RUN), - m_wait(true), - m_clear(true), - m_irq(CLEAR_LINE), - m_dmain(CLEAR_LINE), - m_dmaout(CLEAR_LINE) +cosmac_device::cosmac_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + cpu_device(mconfig, type, tag, owner, clock), + cosmac_disassembler::config(), + m_program_config("program", ENDIANNESS_LITTLE, 8, 16), + m_io_config("io", ENDIANNESS_LITTLE, 8, 3), + m_read_wait(*this, 0), + m_read_clear(*this, 0), + m_read_ef(*this, 0), + m_write_q(*this), + m_read_dma(*this, 0), + m_write_dma(*this), + m_write_sc(*this), + m_write_tpb(*this), + m_state(cosmac_state::STATE_1_INIT), + m_mode(cosmac_mode::RESET), + m_pmode(cosmac_mode::RUN), + m_wait(true), + m_clear(true), + m_irq(CLEAR_LINE), + m_dmain(CLEAR_LINE), + m_dmaout(CLEAR_LINE) { for (auto & elem : m_ef) elem = CLEAR_LINE; @@ -478,16 +478,6 @@ void cosmac_device::device_start() m_cnt_count = 0; m_cnt_timer = timer_alloc(FUNC(cosmac_device::cnt_timerout), this); - // resolve callbacks - m_read_wait.resolve(); - m_read_clear.resolve(); - m_read_ef.resolve_all(); - m_write_q.resolve_safe(); - m_read_dma.resolve_safe(0); - m_write_dma.resolve_safe(); - m_write_sc.resolve_safe(); - m_write_tpb.resolve_safe(); - // get our address spaces space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); @@ -940,11 +930,11 @@ inline void cosmac_device::debug() inline void cosmac_device::sample_wait_clear() { - if (!m_read_wait.isnull()) m_wait = m_read_wait(); - if (!m_read_clear.isnull()) m_clear = m_read_clear(); + if (!m_read_wait.isunset()) m_wait = m_read_wait(); + if (!m_read_clear.isunset()) m_clear = m_read_clear(); m_pmode = m_mode; - m_mode = (cosmac_mode) ((m_clear << 1) | m_wait); + m_mode = cosmac_mode((m_clear << 1) | m_wait); } @@ -955,7 +945,7 @@ inline void cosmac_device::sample_wait_clear() inline void cosmac_device::sample_ef_lines() { for (int i = 0; i < 4; i++) - EF[i] = m_read_ef[i].isnull() ? m_ef_line[i] : m_read_ef[i](); + EF[i] = m_read_ef[i].isunset() ? m_ef_line[i] : m_read_ef[i](); } diff --git a/src/devices/cpu/cp1610/cp1610.cpp b/src/devices/cpu/cp1610/cp1610.cpp index 1be6605fec8..4746fc18cd2 100644 --- a/src/devices/cpu/cp1610/cp1610.cpp +++ b/src/devices/cpu/cp1610/cp1610.cpp @@ -3329,9 +3329,6 @@ void cp1610_cpu_device::execute_run() void cp1610_cpu_device::device_start() { - m_read_bext.resolve_safe(0); - m_read_iab.resolve_safe(0); - m_write_intak.resolve_safe(); m_intr_enabled = false; m_reset_pending = false; m_intr_pending = false; @@ -3395,8 +3392,8 @@ cp1610_cpu_device::cp1610_cpu_device(const machine_config &mconfig, const char * , m_program_config("program", ENDIANNESS_BIG, 16, 16, -1) , m_intr_state(0) , m_intrm_state(0) - , m_read_bext(*this) - , m_read_iab(*this) + , m_read_bext(*this, 0) + , m_read_iab(*this, 0) , m_write_intak(*this) { } diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp index da608c33d65..72d5db5f162 100644 --- a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp +++ b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp @@ -120,7 +120,7 @@ std::unique_ptr<util::disasm_interface> cquestrot_cpu_device::create_disassemble cquestlin_cpu_device::cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : cpu_device(mconfig, CQUESTLIN, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, 64, 8, -3) - , m_linedata_r(*this) + , m_linedata_r(*this, 0) , m_flags(0) , m_curpc(0) { @@ -177,7 +177,6 @@ u16 cquestrot_cpu_device::rotram_r(offs_t offset) void cquestsnd_cpu_device::device_start() { - m_dac_w.resolve_safe(); assert(m_sound_region_tag != nullptr); m_sound_data = (u16*)machine().root_device().memregion(m_sound_region_tag)->base(); @@ -258,8 +257,6 @@ void cquestsnd_cpu_device::device_reset() void cquestrot_cpu_device::device_start() { - m_linedata_w.resolve_safe(); - space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); @@ -389,8 +386,6 @@ device_memory_interface::space_config_vector cquestrot_cpu_device::memory_space_ void cquestlin_cpu_device::device_start() { - m_linedata_r.resolve_safe(0); - space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); diff --git a/src/devices/cpu/dsp16/dsp16.cpp b/src/devices/cpu/dsp16/dsp16.cpp index 799bf5be2d2..4a8b42a0753 100644 --- a/src/devices/cpu/dsp16/dsp16.cpp +++ b/src/devices/cpu/dsp16/dsp16.cpp @@ -177,7 +177,7 @@ dsp16_device_base::dsp16_device_base( , m_iack_cb(*this) , m_ick_cb(*this), m_ild_cb(*this) , m_do_cb(*this), m_ock_cb(*this), m_old_cb(*this), m_ose_cb(*this) - , m_pio_r_cb(*this), m_pio_w_cb(*this), m_pdb_w_cb(*this), m_psel_cb(*this), m_pids_cb(*this), m_pods_cb(*this) + , m_pio_r_cb(*this, 0U), m_pio_w_cb(*this), m_pdb_w_cb(*this), m_psel_cb(*this), m_pids_cb(*this), m_pods_cb(*this) , m_space_config{ { "rom", ENDIANNESS_BIG, 16, 16, -1, address_map_constructor(FUNC(dsp16_device_base::program_map), this) }, { "ram", ENDIANNESS_BIG, 16, yaau_bits, -1, std::move(data_map) }, @@ -200,25 +200,6 @@ dsp16_device_base::dsp16_device_base( device_t implementation ***********************************************************************/ -void dsp16_device_base::device_resolve_objects() -{ - m_iack_cb.resolve_safe(); - - m_ick_cb.resolve_safe(); - m_ild_cb.resolve_safe(); - m_do_cb.resolve_safe(); - m_ock_cb.resolve_safe(); - m_old_cb.resolve_safe(); - m_ose_cb.resolve_safe(); - - m_pio_r_cb.resolve(); - m_pio_w_cb.resolve_safe(); - m_pdb_w_cb.resolve_safe(); - m_psel_cb.resolve_safe(); - m_pids_cb.resolve_safe(); - m_pods_cb.resolve_safe(); -} - void dsp16_device_base::device_start() { m_core.reset(reinterpret_cast<core_state *>(m_drc_cache.alloc_near(sizeof(core_state)))); @@ -1533,7 +1514,7 @@ inline void dsp16_device_base::pio_step() assert(!m_pids_out); if (!--m_pio_pids_cnt) { - if (!m_pio_r_cb.isnull()) + if (!m_pio_r_cb.isunset()) m_pio_pdx_in = m_pio_r_cb(m_psel_out, 0xffffU); m_pids_cb(m_pids_out = 1U); LOGPIO("DSP16: PIO read active edge PSEL = %u, PDX = %04X (PC = %04X)\n", m_psel_out, m_pio_pdx_in, m_st_pcbase); diff --git a/src/devices/cpu/dsp16/dsp16.h b/src/devices/cpu/dsp16/dsp16.h index 889fd0e356e..f23477ed10b 100644 --- a/src/devices/cpu/dsp16/dsp16.h +++ b/src/devices/cpu/dsp16/dsp16.h @@ -75,7 +75,6 @@ protected: address_map_constructor &&data_map); // device_t implementation - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_stop() override; virtual void device_reset() override; diff --git a/src/devices/cpu/dsp32/dsp32.cpp b/src/devices/cpu/dsp32/dsp32.cpp index 9ef3aef63c9..2341cdf4f0c 100644 --- a/src/devices/cpu/dsp32/dsp32.cpp +++ b/src/devices/cpu/dsp32/dsp32.cpp @@ -185,8 +185,6 @@ dsp32c_device::dsp32c_device(const machine_config &mconfig, const char *tag, dev void dsp32c_device::device_start() { - m_output_pins_changed.resolve_safe(); - // get our address spaces space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); diff --git a/src/devices/cpu/dsp56156/dsp56156.cpp b/src/devices/cpu/dsp56156/dsp56156.cpp index 017ceb8c7cf..1ead0838621 100644 --- a/src/devices/cpu/dsp56156/dsp56156.cpp +++ b/src/devices/cpu/dsp56156/dsp56156.cpp @@ -269,9 +269,6 @@ void dsp56156_device::device_start() m_core.modC_state = false; m_core.reset_state = false; - /* Resolve line callbacks */ - portC_cb.resolve_safe(); - /* save states - dsp56156_core members */ save_item(NAME(m_core.modA_state)); save_item(NAME(m_core.modB_state)); diff --git a/src/devices/cpu/dspp/dspp.cpp b/src/devices/cpu/dspp/dspp.cpp index 70bc923a67e..9679de25b96 100644 --- a/src/devices/cpu/dspp/dspp.cpp +++ b/src/devices/cpu/dspp/dspp.cpp @@ -85,44 +85,44 @@ DEFINE_DEVICE_TYPE(DSPP, dspp_device, "dspp", "3DO DSPP") // dspp_device - constructor //------------------------------------------------- -dspp_device::dspp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : dspp_device(mconfig, DSPP, tag, owner, clock, address_map_constructor(FUNC(dspp_device::code_map), this), - address_map_constructor(FUNC(dspp_device::data_map), this)) -{ -} - -dspp_device::dspp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor code_map_ctor, address_map_constructor data_map_ctor) - : cpu_device(mconfig, type, tag, owner, clock), - m_int_handler(*this), - m_dma_read_handler(*this), - m_dma_write_handler(*this), - m_code_config("code", ENDIANNESS_BIG, 16, 10, -1, code_map_ctor), - m_data_config("data", ENDIANNESS_BIG, 16, 10, -1, data_map_ctor), - m_output_fifo_start(0), - m_output_fifo_count(0), - m_dspx_reset(0), - m_dspx_int_enable(0), - m_dspx_channel_enable(0), - m_dspx_channel_complete(0), - m_dspx_channel_direction(0), - m_dspx_channel_8bit(0), - m_dspx_channel_sqxd(0), - m_dspx_shadow_current_addr(0), - m_dspx_shadow_current_count(0), - m_dspx_shadow_next_addr(0), - m_dspx_shadow_next_count(0), - m_dspx_dmanext_int(0), - m_dspx_dmanext_enable(0), - m_dspx_consumed_int(0), - m_dspx_consumed_enable(0), - m_dspx_underover_int(0), - m_dspx_underover_enable(0), - m_dspx_audio_time(0), - m_dspx_audio_duration(0), - m_cache(CACHE_SIZE), - m_drcuml(nullptr), - m_drcfe(nullptr), - m_drcoptions(0) +dspp_device::dspp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + dspp_device(mconfig, DSPP, tag, owner, clock, address_map_constructor(FUNC(dspp_device::code_map), this), + address_map_constructor(FUNC(dspp_device::data_map), this)) +{ +} + +dspp_device::dspp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor code_map_ctor, address_map_constructor data_map_ctor) : + cpu_device(mconfig, type, tag, owner, clock), + m_int_handler(*this), + m_dma_read_handler(*this, 0), + m_dma_write_handler(*this), + m_code_config("code", ENDIANNESS_BIG, 16, 10, -1, code_map_ctor), + m_data_config("data", ENDIANNESS_BIG, 16, 10, -1, data_map_ctor), + m_output_fifo_start(0), + m_output_fifo_count(0), + m_dspx_reset(0), + m_dspx_int_enable(0), + m_dspx_channel_enable(0), + m_dspx_channel_complete(0), + m_dspx_channel_direction(0), + m_dspx_channel_8bit(0), + m_dspx_channel_sqxd(0), + m_dspx_shadow_current_addr(0), + m_dspx_shadow_current_count(0), + m_dspx_shadow_next_addr(0), + m_dspx_shadow_next_count(0), + m_dspx_dmanext_int(0), + m_dspx_dmanext_enable(0), + m_dspx_consumed_int(0), + m_dspx_consumed_enable(0), + m_dspx_underover_int(0), + m_dspx_underover_enable(0), + m_dspx_audio_time(0), + m_dspx_audio_duration(0), + m_cache(CACHE_SIZE), + m_drcuml(nullptr), + m_drcfe(nullptr), + m_drcoptions(0) { #if 0 memset(m_core->m_stack, 0, sizeof(m_core->m_stack)); @@ -150,11 +150,6 @@ void dspp_device::device_start() m_drcfe = std::make_unique<dspp_frontend>(this, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE); - // Resolve our callbacks - m_int_handler.resolve_safe(); - m_dma_read_handler.resolve_safe(0); - m_dma_write_handler.resolve_safe(); - // Get our address spaces space(AS_PROGRAM).cache(m_code_cache); space(AS_PROGRAM).specific(m_code); diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index 5e30570ae76..5e0c1fee703 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -55,7 +55,7 @@ e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, d , m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0) , m_pixel_update_cb(*this) , m_write_r(*this) - , m_read_p(*this) + , m_read_p(*this, 0) , m_write_p(*this) , m_r_dir(0), m_p_dir(0), m_p_pullup(0), m_dfk0(0), m_256_src_pulse(0), m_core_256_handle(nullptr) , m_watchdog_count(0), m_clktimer_count(0), m_stopwatch_on(0), m_swl_cur_pulse(0), m_swl_slice(0) @@ -75,11 +75,6 @@ void e0c6s46_device::device_start() { e0c6200_cpu_device::device_start(); - // find ports - m_write_r.resolve_all_safe(); - m_read_p.resolve_all_safe(0); - m_write_p.resolve_all_safe(); - m_pixel_update_cb.resolve(); // create timers diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp index 40457212abb..ac99aec9290 100644 --- a/src/devices/cpu/esrip/esrip.cpp +++ b/src/devices/cpu/esrip/esrip.cpp @@ -182,10 +182,7 @@ void esrip_device::make_ops() void esrip_device::device_start() { /* Register configuration structure callbacks */ - m_fdt_r.resolve_safe(0); - m_fdt_w.resolve_safe(); m_lbrm = (uint8_t*)machine().root_device().memregion(m_lbrm_prom)->base(); - m_status_in.resolve_safe(0); m_draw.resolve(); /* Allocate image pointer table RAM */ @@ -1670,9 +1667,9 @@ DEFINE_DEVICE_TYPE(ESRIP, esrip_device, "esrip", "Entertainment Sciences RIP") esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ESRIP, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, 64, 9, -3) - , m_fdt_r(*this) + , m_fdt_r(*this, 0) , m_fdt_w(*this) - , m_status_in(*this) + , m_status_in(*this, 0) , m_draw(*this) , m_screen(*this, finder_base::DUMMY_TAG) , m_lbrm_prom(nullptr) diff --git a/src/devices/cpu/f8/f8.cpp b/src/devices/cpu/f8/f8.cpp index e545b7da9db..a62c3037617 100644 --- a/src/devices/cpu/f8/f8.cpp +++ b/src/devices/cpu/f8/f8.cpp @@ -68,7 +68,7 @@ f8_cpu_device::f8_cpu_device(const machine_config &mconfig, const char *tag, dev m_program_config("program", ENDIANNESS_BIG, 8, 16, 0), m_regs_config("register", ENDIANNESS_BIG, 8, 6, 0, address_map_constructor(FUNC(f8_cpu_device::regs_map), this)), m_io_config("io", ENDIANNESS_BIG, 8, 8, 0), - m_romc08_callback(*this) + m_romc08_callback(*this, 0) { } void f8_cpu_device::regs_map(address_map &map) @@ -106,11 +106,6 @@ void f8_cpu_device::state_string_export(const device_state_entry &entry, std::st } } -void f8_cpu_device::device_resolve_objects() -{ - m_romc08_callback.resolve_safe(0); -} - void f8_cpu_device::device_start() { space(AS_PROGRAM).cache(m_program); diff --git a/src/devices/cpu/f8/f8.h b/src/devices/cpu/f8/f8.h index fd823acb705..da621d3a306 100644 --- a/src/devices/cpu/f8/f8.h +++ b/src/devices/cpu/f8/f8.h @@ -32,25 +32,24 @@ protected: F8_H, F8_K, F8_Q }; - // 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 u32 execute_min_cycles() const noexcept override { return 4; } virtual u32 execute_max_cycles() const noexcept override { return 26; } virtual u32 execute_input_lines() const noexcept override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; private: diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp index dcde7138fbe..b44c99c561e 100644 --- a/src/devices/cpu/g65816/g65816.cpp +++ b/src/devices/cpu/g65816/g65816.cpp @@ -875,8 +875,6 @@ void g65816_device::device_start() (has_space(AS_OPCODES) ? space(AS_OPCODES) : space(AS_PROGRAM)).cache(m_opcode); (has_space(AS_DATA) ? space(AS_DATA) : space(AS_PROGRAM)).specific(m_data); - m_wdm_w.resolve_safe(); - save_item(NAME(m_a)); save_item(NAME(m_b)); save_item(NAME(m_x)); diff --git a/src/devices/cpu/gigatron/gigatron.cpp b/src/devices/cpu/gigatron/gigatron.cpp index 5729a33633e..ea85c9baae5 100644 --- a/src/devices/cpu/gigatron/gigatron.cpp +++ b/src/devices/cpu/gigatron/gigatron.cpp @@ -71,10 +71,6 @@ void gigatron_cpu_device::device_start() save_item(NAME(m_outx)); save_item(NAME(m_out)); - m_outx_cb.resolve_safe(); - m_out_cb.resolve_safe(); - m_ir_cb.resolve_safe(0); - reset_cpu(); } @@ -347,7 +343,7 @@ gigatron_cpu_device::gigatron_cpu_device(const machine_config &mconfig, const ch , m_data_config("data", ENDIANNESS_BIG, 8, 16, 0) , m_outx_cb(*this) , m_out_cb(*this) - , m_ir_cb(*this) + , m_ir_cb(*this, 0) { } diff --git a/src/devices/cpu/h6280/h6280.cpp b/src/devices/cpu/h6280/h6280.cpp index a0b4115b19e..7bb01c3f6d5 100644 --- a/src/devices/cpu/h6280/h6280.cpp +++ b/src/devices/cpu/h6280/h6280.cpp @@ -172,7 +172,7 @@ h6280_device::h6280_device(const machine_config &mconfig, const char *tag, devic , device_mixer_interface(mconfig, *this, 2) , m_program_config("program", ENDIANNESS_LITTLE, 8, 21, 0, 16, 0, address_map_constructor(FUNC(h6280_device::internal_map), this)) , m_io_config("io", ENDIANNESS_LITTLE, 8, 2) - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0) , m_port_out_cb(*this) , m_psg(*this, "psg") , m_timer_scale(1) @@ -238,9 +238,6 @@ void h6280_device::device_add_mconfig(machine_config &config) void h6280_device::device_start() { - m_port_in_cb.resolve(); - m_port_out_cb.resolve_safe(); - // register our state for the debugger state_add(STATE_GENPC, "GENPC", m_pc.w.l).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc.w.l).noshow(); @@ -2582,7 +2579,7 @@ void h6280_device::timer_w(offs_t offset, uint8_t data) uint8_t h6280_device::port_r() { - if (!m_port_in_cb.isnull()) + if (!m_port_in_cb.isunset()) return m_port_in_cb(); else return m_io_buffer; diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index 8d1851c8abc..338023eab12 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -18,8 +18,8 @@ h8_device::h8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor map_delegate) : cpu_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_BIG, 16, 16, 0, map_delegate), - m_read_adc(*this), - m_read_port(*this), + m_read_adc(*this, 0), + m_read_port(*this, 0), m_write_port(*this), m_sci(*this, "sci%u", 0), m_sci_tx(*this), @@ -74,12 +74,6 @@ void h8_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - m_read_adc.resolve_all(); - m_read_port.resolve_all(); - m_write_port.resolve_all(); - m_sci_tx.resolve_all_safe(); - m_sci_clk.resolve_all_safe(); - uint32_t pcmask = m_mode_advanced ? 0xffffff : 0xffff; state_add<uint32_t>(H8_PC, "PC", [this]() { return m_NPC; }, diff --git a/src/devices/cpu/h8/h83002.cpp b/src/devices/cpu/h8/h83002.cpp index 85035625bfc..3501a466bd3 100644 --- a/src/devices/cpu/h8/h83002.cpp +++ b/src/devices/cpu/h8/h83002.cpp @@ -166,10 +166,8 @@ void h83002_device::device_add_mconfig(machine_config &config) void h83002_device::execute_set_input(int inputnum, int state) { - if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) { - if(!m_tend_cb[inputnum - H8_INPUT_LINE_TEND0].isnull()) - m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); - } + if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) + m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); else if(inputnum == H8_INPUT_LINE_DREQ0 || inputnum == H8_INPUT_LINE_DREQ1) m_dma->set_input(inputnum, state); else @@ -239,8 +237,6 @@ void h83002_device::device_start() { h8h_device::device_start(); m_dma_device = m_dma; - - m_tend_cb.resolve_all(); } void h83002_device::device_reset() diff --git a/src/devices/cpu/h8/h83003.cpp b/src/devices/cpu/h8/h83003.cpp index 934a22acbd8..9a90b646b8f 100644 --- a/src/devices/cpu/h8/h83003.cpp +++ b/src/devices/cpu/h8/h83003.cpp @@ -193,10 +193,8 @@ void h83003_device::device_add_mconfig(machine_config &config) void h83003_device::execute_set_input(int inputnum, int state) { - if(inputnum >= H8_INPUT_LINE_TEND0 && inputnum <= H8_INPUT_LINE_TEND3) { - if(!m_tend_cb[inputnum - H8_INPUT_LINE_TEND0].isnull()) - m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); - } + if(inputnum >= H8_INPUT_LINE_TEND0 && inputnum <= H8_INPUT_LINE_TEND3) + m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); else if(inputnum >= H8_INPUT_LINE_DREQ0 && inputnum <= H8_INPUT_LINE_DREQ3) m_dma->set_input(inputnum, state); else @@ -266,8 +264,6 @@ void h83003_device::device_start() { h8h_device::device_start(); m_dma_device = m_dma; - - m_tend_cb.resolve_all(); } void h83003_device::device_reset() diff --git a/src/devices/cpu/h8/h8s2320.cpp b/src/devices/cpu/h8/h8s2320.cpp index a49580c3f8e..83db3490ed3 100644 --- a/src/devices/cpu/h8/h8s2320.cpp +++ b/src/devices/cpu/h8/h8s2320.cpp @@ -350,10 +350,8 @@ void h8s2320_device::device_add_mconfig(machine_config &config) void h8s2320_device::execute_set_input(int inputnum, int state) { - if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) { - if(!m_tend_cb[inputnum - H8_INPUT_LINE_TEND0].isnull()) - m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); - } + if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1) + m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); else if(inputnum == H8_INPUT_LINE_DREQ0 || inputnum == H8_INPUT_LINE_DREQ1) m_dma->set_input(inputnum, state); else @@ -442,8 +440,6 @@ void h8s2320_device::device_start() h8s2000_device::device_start(); m_dma_device = m_dma; m_dtc_device = m_dtc; - - m_tend_cb.resolve_all(); } void h8s2320_device::device_reset() diff --git a/src/devices/cpu/hcd62121/hcd62121.cpp b/src/devices/cpu/hcd62121/hcd62121.cpp index e05fe883d65..00faac4f7a2 100644 --- a/src/devices/cpu/hcd62121/hcd62121.cpp +++ b/src/devices/cpu/hcd62121/hcd62121.cpp @@ -70,8 +70,8 @@ hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const ch , m_koh_cb(*this) , m_port_cb(*this) , m_opt_cb(*this) - , m_ki_cb(*this) - , m_in0_cb(*this) + , m_ki_cb(*this, 0) + , m_in0_cb(*this, 0) { } @@ -306,13 +306,6 @@ void hcd62121_cpu_device::device_start() { m_program = &space(AS_PROGRAM); - m_kol_cb.resolve_safe(); - m_koh_cb.resolve_safe(); - m_port_cb.resolve_safe(); - m_opt_cb.resolve_safe(); - m_ki_cb.resolve_safe(0); - m_in0_cb.resolve_safe(0); - save_item(NAME(m_prev_pc)); save_item(NAME(m_sp)); save_item(NAME(m_ip)); diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp index 2241855cf1c..58efd62d668 100644 --- a/src/devices/cpu/hd61700/hd61700.cpp +++ b/src/devices/cpu/hd61700/hd61700.cpp @@ -110,11 +110,11 @@ hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char , m_pc(0) , m_flags(0) , m_lcd_ctrl_cb(*this) - , m_lcd_read_cb(*this) + , m_lcd_read_cb(*this, 0xff) , m_lcd_write_cb(*this) - , m_kb_read_cb(*this) + , m_kb_read_cb(*this, 0xff) , m_kb_write_cb(*this) - , m_port_read_cb(*this) + , m_port_read_cb(*this, 0xff) , m_port_write_cb(*this) { } @@ -138,14 +138,6 @@ void hd61700_cpu_device::device_start() m_sec_timer = timer_alloc(FUNC(hd61700_cpu_device::second_tick), this); m_sec_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); - m_lcd_ctrl_cb.resolve_safe(); - m_lcd_read_cb.resolve_safe(0xff); - m_lcd_write_cb.resolve_safe(); - m_kb_read_cb.resolve_safe(0xff); - m_kb_write_cb.resolve_safe(); - m_port_read_cb.resolve_safe(0xff); - m_port_write_cb.resolve_safe(); - // save state save_item(NAME(m_ppc)); save_item(NAME(m_curpc)); diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp index b94818f8288..87566bd401b 100644 --- a/src/devices/cpu/hmcs40/hmcs40.cpp +++ b/src/devices/cpu/hmcs40/hmcs40.cpp @@ -103,9 +103,9 @@ hmcs40_cpu_device::hmcs40_cpu_device(const machine_config &mconfig, device_type , m_family(family) , m_polarity(polarity) , m_stack_levels(stack_levels) - , m_read_r(*this) + , m_read_r(*this, polarity & 0xf) , m_write_r(*this) - , m_read_d(*this) + , m_read_d(*this, polarity) , m_write_d(*this) { } @@ -205,12 +205,6 @@ void hmcs40_cpu_device::device_start() m_datamask = (1 << m_datawidth) - 1; m_pcmask = (1 << m_pcwidth) - 1; - // resolve callbacks - m_read_r.resolve_all_safe(m_polarity & 0xf); - m_write_r.resolve_all_safe(); - m_read_d.resolve_safe(m_polarity); - m_write_d.resolve_safe(); - // zerofill memset(m_stack, 0, sizeof(m_stack)); m_op = 0; diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h index 0738eab209a..eb4592653db 100644 --- a/src/devices/cpu/hmcs40/hmcs40.h +++ b/src/devices/cpu/hmcs40/hmcs40.h @@ -137,15 +137,15 @@ protected: int m_icount; int m_state_count; - int m_pcwidth; // Program Counter bit-width - int m_prgwidth; - int m_datawidth; + int const m_pcwidth; // Program Counter bit-width + int const m_prgwidth; + int const m_datawidth; + int const m_family; // MCU family (42-47) + u16 const m_polarity; // i/o polarity (pmos vs cmos) + int const m_stack_levels; // number of callstack levels int m_pcmask; int m_prgmask; int m_datamask; - int m_family; // MCU family (42-47) - u16 m_polarity; // i/o polarity (pmos vs cmos) - int m_stack_levels; // number of callstack levels u16 m_stack[4]; // max 4 u16 m_op; // current opcode u16 m_prev_op; diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp index 5c80a88cc14..4b913f0d69d 100644 --- a/src/devices/cpu/hphybrid/hphybrid.cpp +++ b/src/devices/cpu/hphybrid/hphybrid.cpp @@ -236,7 +236,6 @@ void hp_hybrid_cpu_device::device_start() set_icountptr(m_icount); - m_pa_changed_func.resolve_safe(); m_opcode_func.resolve(); m_stm_func.resolve(); m_int_func.resolve(); diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp index a082d979ade..5f03d5347c8 100644 --- a/src/devices/cpu/i386/i386.cpp +++ b/src/devices/cpu/i386/i386.cpp @@ -2043,8 +2043,6 @@ void i386_device::i386_common_init() machine().save().register_postload(save_prepost_delegate(FUNC(i386_device::i386_postload), this)); - m_smiact.resolve_safe(); - m_ferr_handler.resolve_safe(); m_ferr_handler(0); set_icountptr(m_cycles); @@ -2547,8 +2545,7 @@ void i386_device::enter_smm() m_cr[0] &= ~(0x8000000d); set_flags(2); - if(!m_smiact.isnull()) - m_smiact(true); + m_smiact(true); m_smm = true; m_smi_latched = false; @@ -2699,8 +2696,7 @@ void i386_device::leave_smm() m_sreg[i].valid = true; } - if (!m_smiact.isnull()) - m_smiact(false); + m_smiact(false); m_smm = false; CHANGE_PC(m_eip); diff --git a/src/devices/cpu/i8085/i8085.cpp b/src/devices/cpu/i8085/i8085.cpp index 992f89d4427..59026715ce8 100644 --- a/src/devices/cpu/i8085/i8085.cpp +++ b/src/devices/cpu/i8085/i8085.cpp @@ -208,10 +208,10 @@ i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, device_type , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) , m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, 16, 0) - , m_in_inta_func(*this) + , m_in_inta_func(*this, 0) , m_out_status_func(*this) , m_out_inte_func(*this) - , m_in_sid_func(*this) + , m_in_sid_func(*this, 0) , m_out_sod_func(*this) , m_clk_out_func(*this) { } @@ -350,13 +350,6 @@ void i8085a_cpu_device::device_start() space(has_space(AS_OPCODES) ? AS_OPCODES : AS_PROGRAM).cache(m_copcodes); space(AS_IO).specific(m_io); - /* resolve callbacks */ - m_in_inta_func.resolve(); - m_out_status_func.resolve_safe(); - m_out_inte_func.resolve_safe(); - m_in_sid_func.resolve_safe(0); - m_out_sod_func.resolve_safe(); - /* register for state saving */ save_item(NAME(m_PC.w.l)); save_item(NAME(m_SP.w.l)); @@ -605,7 +598,7 @@ void i8085a_cpu_device::check_for_interrupts() else if (m_irq_state[I8085_INTR_LINE] && (m_im & IM_IE)) { /* break out of HALT state and call the IRQ ack callback */ - if (!m_in_inta_func.isnull()) + if (!m_in_inta_func.isunset()) standard_irq_callback(I8085_INTR_LINE, m_PC.w.l); break_halt_for_interrupt(); @@ -710,7 +703,7 @@ u8 i8085a_cpu_device::read_op() u8 i8085a_cpu_device::read_inta() { - if (m_in_inta_func.isnull()) + if (m_in_inta_func.isunset()) return standard_irq_callback(I8085_INTR_LINE, m_PC.w.l); else return m_in_inta_func(m_PC.w.l); diff --git a/src/devices/cpu/i8089/i8089.cpp b/src/devices/cpu/i8089/i8089.cpp index 915d30c551b..eb32469f10a 100644 --- a/src/devices/cpu/i8089/i8089.cpp +++ b/src/devices/cpu/i8089/i8089.cpp @@ -60,10 +60,6 @@ void i8089_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_write_sintr1.resolve_safe(); - m_write_sintr2.resolve_safe(); - // register debugger states state_add(SYSBUS, "SYSBUS", m_sysbus).mask(0x01).formatstr("%1s"); state_add(SCB, "SCB", m_scb).mask(0xfffff); diff --git a/src/devices/cpu/i8089/i8089_channel.cpp b/src/devices/cpu/i8089/i8089_channel.cpp index dc8d75eabe1..97e2c21977d 100644 --- a/src/devices/cpu/i8089/i8089_channel.cpp +++ b/src/devices/cpu/i8089/i8089_channel.cpp @@ -71,9 +71,6 @@ void i8089_channel_device::device_start() // get parent device m_iop = downcast<i8089_device *>(owner()); - // resolve callbacks - m_write_sintr.resolve_safe(); - // register for save states save_item(NAME(m_xfer_pending)); save_item(NAME(m_dma_value)); diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp index 6114a8ec1af..7f64274ce6e 100644 --- a/src/devices/cpu/i86/i186.cpp +++ b/src/devices/cpu/i86/i186.cpp @@ -158,7 +158,7 @@ i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, device_type , m_program_config("program", ENDIANNESS_LITTLE, data_bus_size, 20, 0) , m_opcodes_config("opcodes", ENDIANNESS_LITTLE, data_bus_size, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, data_bus_size, 16, 0) - , m_read_slave_ack_func(*this) + , m_read_slave_ack_func(*this, 0) , m_out_chip_select_func(*this) , m_out_tmrout0_func(*this) , m_out_tmrout1_func(*this) @@ -733,12 +733,6 @@ void i80186_cpu_device::device_start() m_timer[1].int_timer = timer_alloc(FUNC(i80186_cpu_device::timer_elapsed), this); m_timer[2].int_timer = timer_alloc(FUNC(i80186_cpu_device::timer_elapsed), this); - m_out_tmrout0_func.resolve_safe(); - m_out_tmrout1_func.resolve_safe(); - m_read_slave_ack_func.resolve_safe(0); - m_out_chip_select_func.resolve_safe(); - m_irmx_irq_cb.resolve_safe(); - m_irqa_cb.resolve_safe(); m_irmx_irq_ack.resolve_safe(0); } @@ -901,11 +895,9 @@ void i80186_cpu_device::write_word(uint32_t addr, uint16_t data) *************************************/ IRQ_CALLBACK_MEMBER(i80186_cpu_device::inta_callback) { - if (!m_irqa_cb.isnull()) // s-state 0 is irqack - { - m_irqa_cb(ASSERT_LINE); - m_irqa_cb(CLEAR_LINE); - } + // s-state 0 is irqack + m_irqa_cb(ASSERT_LINE); + m_irqa_cb(CLEAR_LINE); if (BIT(m_reloc, 14)) return m_irmx_irq_ack(device, irqline); return int_callback(device, irqline); diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index ece39503c44..6c65ab5c39d 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -280,7 +280,6 @@ void i80286_cpu_device::device_start() state_add( I8086_HALT, "HALT", m_halt ).mask(1); m_a20_callback.resolve_safe(0xffffff); - m_out_shutdown_func.resolve_safe(); } device_memory_interface::space_config_vector i80286_cpu_device::memory_space_config() const diff --git a/src/devices/cpu/i86/i86.cpp b/src/devices/cpu/i86/i86.cpp index 8c78c47a1ab..0df4308ae79 100644 --- a/src/devices/cpu/i86/i86.cpp +++ b/src/devices/cpu/i86/i86.cpp @@ -345,9 +345,6 @@ void i8086_cpu_device::execute_run() void i8086_cpu_device::device_start() { i8086_common_cpu_device::device_start(); - m_out_if_func.resolve_safe(); - m_esc_opcode_handler.resolve_safe(); - m_esc_data_handler.resolve_safe(); m_stack = has_space(AS_STACK) ? &space(AS_STACK) : m_program; m_code = has_space(AS_CODE) ? &space(AS_CODE) : m_program; m_extra = has_space(AS_EXTRA) ? &space(AS_EXTRA) : m_program; @@ -525,8 +522,6 @@ void i8086_common_cpu_device::device_start() state_add(STATE_GENFLAGS, "GENFLAGS", m_TF).formatstr("%16s").noshow(); set_icountptr(m_icount); - - m_lock_handler.resolve_safe(); } diff --git a/src/devices/cpu/jaguar/jaguar.cpp b/src/devices/cpu/jaguar/jaguar.cpp index db5223dbf1d..8db47937d55 100644 --- a/src/devices/cpu/jaguar/jaguar.cpp +++ b/src/devices/cpu/jaguar/jaguar.cpp @@ -353,7 +353,6 @@ void jaguar_cpu_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); space(AS_IO).specific(m_io); - m_cpu_interrupt.resolve_safe(); save_item(NAME(m_r)); save_item(NAME(m_a)); diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp index 14bb12714c7..eee3aea5e94 100644 --- a/src/devices/cpu/lc8670/lc8670.cpp +++ b/src/devices/cpu/lc8670/lc8670.cpp @@ -200,8 +200,7 @@ void lc8670_cpu_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_bankswitch_func.resolve(); + // resolve delegates m_lcd_update_func.resolve_safe(0); // setup timers diff --git a/src/devices/cpu/lh5801/lh5801.cpp b/src/devices/cpu/lh5801/lh5801.cpp index 3f9045ae57e..d7eed38700b 100644 --- a/src/devices/cpu/lh5801/lh5801.cpp +++ b/src/devices/cpu/lh5801/lh5801.cpp @@ -69,7 +69,7 @@ lh5801_cpu_device::lh5801_cpu_device(const machine_config &mconfig, const char * : cpu_device(mconfig, LH5801, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) - , m_in_func(*this) + , m_in_func(*this, 0) { } @@ -92,8 +92,6 @@ void lh5801_cpu_device::device_start() space(AS_PROGRAM).specific(m_program); space(AS_IO).specific(m_io); - m_in_func.resolve_safe(0); - m_s.w.l = 0; m_p.w.l = 0; m_u.w.l = 0; diff --git a/src/devices/cpu/lr35902/lr35902.cpp b/src/devices/cpu/lr35902/lr35902.cpp index 86eba6464d2..c575eea4157 100644 --- a/src/devices/cpu/lr35902/lr35902.cpp +++ b/src/devices/cpu/lr35902/lr35902.cpp @@ -139,10 +139,6 @@ void lr35902_cpu_device::device_start() { m_program = &space(AS_PROGRAM); - // resolve callbacks - m_timer_func.resolve_safe(); - m_incdec16_func.resolve_safe(); - // register for save states save_item(NAME(m_A)); save_item(NAME(m_F)); diff --git a/src/devices/cpu/m37710/m37710.cpp b/src/devices/cpu/m37710/m37710.cpp index f953cb143c0..ddd5f097dfc 100644 --- a/src/devices/cpu/m37710/m37710.cpp +++ b/src/devices/cpu/m37710/m37710.cpp @@ -336,9 +336,9 @@ void m37732s4_device::map(address_map &map) m37710_cpu_device::m37710_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor map_delegate) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, map_delegate) - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) - , m_analog_cb(*this) + , m_analog_cb(*this, 0) { } @@ -1342,10 +1342,6 @@ void m37710_cpu_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - m_analog_cb.resolve_all_safe(0); - m_ICount = 0; m_source = 0; diff --git a/src/devices/cpu/m6502/gew12.cpp b/src/devices/cpu/m6502/gew12.cpp index 716df3fe020..b087b18f43d 100644 --- a/src/devices/cpu/m6502/gew12.cpp +++ b/src/devices/cpu/m6502/gew12.cpp @@ -21,7 +21,7 @@ DEFINE_DEVICE_TYPE(GEW12, gew12_device, "gew12", "Yamaha YMW728-F (GEW12)") gew12_device::gew12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_mcu_device_base<m65c02_device>(mconfig, GEW12, tag, owner, clock) , device_mixer_interface(mconfig, *this, 2) - , m_in_cb(*this), m_out_cb(*this) + , m_in_cb(*this, 0xff), m_out_cb(*this) , m_rom(*this, DEVICE_SELF) , m_bank(*this, "bank%u", 0U) { @@ -38,9 +38,6 @@ void gew12_device::device_start() { m65c02_device::device_start(); - m_in_cb.resolve_all_safe(0xff); - m_out_cb.resolve_all_safe(); - m_bank_mask = device_generic_cart_interface::map_non_power_of_two( unsigned(m_rom->bytes() >> 14), [this, base = &m_rom->as_u8()] (unsigned entry, unsigned page) diff --git a/src/devices/cpu/m6502/gew7.cpp b/src/devices/cpu/m6502/gew7.cpp index d85cf4bff97..7fd85ad2538 100644 --- a/src/devices/cpu/m6502/gew7.cpp +++ b/src/devices/cpu/m6502/gew7.cpp @@ -21,7 +21,7 @@ DEFINE_DEVICE_TYPE(GEW7, gew7_device, "gew7", "Yamaha YMW270-F (GEW7)") gew7_device::gew7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_mcu_device_base<m65c02_device>(mconfig, GEW7, tag, owner, clock) , device_mixer_interface(mconfig, *this, 2) - , m_in_cb(*this), m_out_cb(*this) + , m_in_cb(*this, 0xff), m_out_cb(*this) , m_rom(*this, DEVICE_SELF) , m_bank(*this, "bank%u", 0U) , m_pcm(*this, "pcm") @@ -45,9 +45,6 @@ void gew7_device::device_start() { m6502_mcu_device_base<m65c02_device>::device_start(); - m_in_cb.resolve_all_safe(0xff); - m_out_cb.resolve_all_safe(); - m_bank_mask = device_generic_cart_interface::map_non_power_of_two( unsigned(m_rom->bytes() >> 14), [this, base = &m_rom->as_u8()] (unsigned entry, unsigned page) diff --git a/src/devices/cpu/m6502/m3745x.cpp b/src/devices/cpu/m6502/m3745x.cpp index 20b881f217e..a8552e51d4b 100644 --- a/src/devices/cpu/m6502/m3745x.cpp +++ b/src/devices/cpu/m6502/m3745x.cpp @@ -40,9 +40,9 @@ DEFINE_DEVICE_TYPE(M37450, m37450_device, "m37450", "Mitsubishi M37450") m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) : m740_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map), - m_read_p(*this), + m_read_p(*this, 0), m_write_p(*this), - m_read_ad(*this), + m_read_ad(*this, 0), m_intreq1(0), m_intreq2(0), m_intctrl1(0), @@ -58,10 +58,6 @@ m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, co void m3745x_device::device_start() { - m_read_p.resolve_all_safe(0); - m_write_p.resolve_all_safe(); - m_read_ad.resolve_all_safe(0); - for (int i = TIMER_1; i <= TIMER_3; i++) { m_timers[i] = machine().scheduler().timer_alloc(timer_expired_delegate()); diff --git a/src/devices/cpu/m6502/m50734.cpp b/src/devices/cpu/m6502/m50734.cpp index 4e01bfc3d93..af58690aa29 100644 --- a/src/devices/cpu/m6502/m50734.cpp +++ b/src/devices/cpu/m6502/m50734.cpp @@ -27,9 +27,9 @@ DEFINE_DEVICE_TYPE(M50734, m50734_device, "m50734", "Mitsubishi M50734") m50734_device::m50734_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : m740_device(mconfig, M50734, tag, owner, clock) , m_data_config("data", ENDIANNESS_LITTLE, 8, 16, 0) - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0) , m_port_out_cb(*this) - , m_analog_in_cb(*this) + , m_analog_in_cb(*this, 0) , m_port_latch{0, 0, 0, 0} , m_port_3state{0, 0, 0, 0} , m_ad_control(0) @@ -53,13 +53,15 @@ device_memory_interface::space_config_vector m50734_device::memory_space_config( return scv; } -void m50734_device::device_resolve_objects() +void m50734_device::device_config_complete() { + m740_device::device_config_complete(); + for (int n = 0; n < 4; n++) - m_port_in_cb[n].resolve_safe(m_port_3state[n]); - m_port_in_cb[4].resolve_safe(0); - m_port_out_cb.resolve_all_safe(); - m_analog_in_cb.resolve_all_safe(0); + { + if (m_port_in_cb[n].isunset()) + m_port_in_cb[n].bind().set_constant(m_port_3state[n]); + } } void m50734_device::step_motor(int which) diff --git a/src/devices/cpu/m6502/m50734.h b/src/devices/cpu/m6502/m50734.h index 89a1b5fc55b..94ade4ad585 100644 --- a/src/devices/cpu/m6502/m50734.h +++ b/src/devices/cpu/m6502/m50734.h @@ -51,9 +51,6 @@ class m50734_device : public m740_device { public: - //enum { - //}; - m50734_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // port callback configuration @@ -78,16 +75,16 @@ public: void set_p3_3state(u8 value) { assert(!configured()); m_port_3state[3] = value; } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation + virtual void device_config_complete() override; 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 + 4 - 1) / 4; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } - // device_memory_interface overrides + // device_memory_interface implementation space_config_vector memory_space_config() const override; // m740_device overrides diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 2d961b694a5..eb24e461e1f 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -43,7 +43,7 @@ DEFINE_DEVICE_TYPE(M50753, m50753_device, "m50753", "Mitsubishi M50753") m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int addrbits, address_map_constructor internal_map) : m740_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 8, addrbits, 0, internal_map), - m_read_p(*this), + m_read_p(*this, 0), m_write_p(*this), m_intctrl(0), m_tmrctrl(0), @@ -66,9 +66,6 @@ m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, co void m5074x_device::device_start() { - m_read_p.resolve_all_safe(0); - m_write_p.resolve_all_safe(); - m_timers[TIMER_1] = timer_alloc(FUNC(m5074x_device::timer1_tick), this); m_timers[TIMER_2] = timer_alloc(FUNC(m5074x_device::timer2_tick), this); m_timers[TIMER_X] = timer_alloc(FUNC(m5074x_device::timerx_tick), this); @@ -513,8 +510,8 @@ m50753_device::m50753_device(const machine_config &mconfig, const char *tag, dev m50753_device::m50753_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : m5074x_device(mconfig, type, tag, owner, clock, 16, address_map_constructor(FUNC(m50753_device::m50753_map), this)), - m_ad_in(*this), - m_in_p(*this), + m_ad_in(*this, 0), + m_in_p(*this, 0), m_ad_control(0), m_pwm_enabled(false) { @@ -524,9 +521,6 @@ void m50753_device::device_start() { m5074x_device::device_start(); - m_ad_in.resolve_all_safe(0); - m_in_p.resolve_safe(0); - save_item(NAME(m_ad_control)); save_item(NAME(m_pwm_enabled)); } diff --git a/src/devices/cpu/m6502/m6500_1.cpp b/src/devices/cpu/m6502/m6500_1.cpp index 4a065a0a8e7..7d32aa1030a 100644 --- a/src/devices/cpu/m6502/m6500_1.cpp +++ b/src/devices/cpu/m6502/m6500_1.cpp @@ -95,7 +95,7 @@ DEFINE_DEVICE_TYPE(M6500_1, m6500_1_device, "m6500_1", "MOS Technology 6500/1"); m6500_1_device::m6500_1_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : m6502_mcu_device_base<m6502_device>(mconfig, M6500_1, tag, owner, clock) - , m_port_in_cb{ *this } + , m_port_in_cb{ *this, 0xffU } , m_port_out_cb{ *this } , m_cntr_out_cb{ *this } , m_cr{ 0x00U } @@ -142,15 +142,6 @@ void m6500_1_device::cntr_w(int state) } -void m6500_1_device::device_resolve_objects() -{ - m6502_mcu_device_base<m6502_device>::device_resolve_objects(); - - m_port_in_cb.resolve_all(); - m_port_out_cb.resolve_all_safe(); - m_cntr_out_cb.resolve_safe(); -} - void m6500_1_device::device_start() { m6502_mcu_device_base<m6502_device>::device_start(); @@ -308,7 +299,7 @@ void m6500_1_device::update_irq() u8 m6500_1_device::read_port(offs_t offset) { - if (!machine().side_effects_disabled() && m_port_in_cb[offset]) + if (!machine().side_effects_disabled() && !m_port_in_cb[offset].isunset()) { u8 const prev(m_port_in[offset]); m_port_in[offset] = m_port_in_cb[offset](); @@ -334,7 +325,7 @@ void m6500_1_device::write_port(offs_t offset, u8 data) if (!offset) { - if (!machine().side_effects_disabled() && m_port_in_cb[0]) + if (!machine().side_effects_disabled() && !m_port_in_cb[0].isunset()) m_port_in[0] = m_port_in_cb[0](); u8 const effective(m_port_in[0] & data); u8 const diff(prev ^ effective); @@ -355,7 +346,7 @@ void m6500_1_device::clear_edge(offs_t offset, u8 data) template <unsigned Port> TIMER_CALLBACK_MEMBER(m6500_1_device::set_port_in) { u8 const prev(m_port_in[Port]); - m_port_in[Port] = m_port_in_cb[Port] ? m_port_in_cb[Port]() : u8(u32(param)); + m_port_in[Port] = !m_port_in_cb[Port].isunset() ? m_port_in_cb[Port]() : u8(u32(param)); if (!Port) { diff --git a/src/devices/cpu/m6502/m6500_1.h b/src/devices/cpu/m6502/m6500_1.h index dc5d84f5492..15af85ff417 100644 --- a/src/devices/cpu/m6502/m6500_1.h +++ b/src/devices/cpu/m6502/m6500_1.h @@ -77,7 +77,6 @@ protected: M6500_1_LC }; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index c5f10de21aa..a8f7d508c43 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -53,8 +53,6 @@ void m6502_device::init() space(AS_PROGRAM).specific(mintf->program14); } - sync_w.resolve_safe(); - XPC = 0; state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow(); diff --git a/src/devices/cpu/m6502/m6510.cpp b/src/devices/cpu/m6502/m6510.cpp index 706c1407fcb..0a6a0b90fe3 100644 --- a/src/devices/cpu/m6502/m6510.cpp +++ b/src/devices/cpu/m6502/m6510.cpp @@ -25,8 +25,9 @@ m6510_device::m6510_device(const machine_config &mconfig, const char *tag, devic m6510_device::m6510_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, type, tag, owner, clock), - read_port(*this), - write_port(*this), dir(0), port(0), drive(0) + read_port(*this, 0), + write_port(*this), + dir(0), port(0), drive(0) { pullup = 0x00; floating = 0x00; @@ -45,9 +46,6 @@ std::unique_ptr<util::disasm_interface> m6510_device::create_disassembler() void m6510_device::init_port() { - read_port.resolve_safe(0); - write_port.resolve_safe(); - save_item(NAME(pullup)); save_item(NAME(floating)); save_item(NAME(dir)); diff --git a/src/devices/cpu/m6502/st2204.cpp b/src/devices/cpu/m6502/st2204.cpp index 0e8541be87a..cc18732226e 100644 --- a/src/devices/cpu/m6502/st2204.cpp +++ b/src/devices/cpu/m6502/st2204.cpp @@ -68,13 +68,6 @@ st2202_device::st2202_device(const machine_config &mconfig, const char *tag, dev { } -void st2204_device::device_resolve_objects() -{ - st2xxx_device::device_resolve_objects(); - - m_dac_callback.resolve_safe(); -} - void st2204_device::device_start() { std::unique_ptr<mi_st2204> intf = std::make_unique<mi_st2204>(); diff --git a/src/devices/cpu/m6502/st2204.h b/src/devices/cpu/m6502/st2204.h index c1fbe707fd9..63e537309f2 100644 --- a/src/devices/cpu/m6502/st2204.h +++ b/src/devices/cpu/m6502/st2204.h @@ -37,7 +37,6 @@ public: protected: st2204_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor int_map); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp index c3934a1d85d..4dbaf96b3b3 100644 --- a/src/devices/cpu/m6502/st2xxx.cpp +++ b/src/devices/cpu/m6502/st2xxx.cpp @@ -45,7 +45,7 @@ st2xxx_device::st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, bool has_banked_ram) : w65c02s_device(mconfig, type, tag, owner, clock) , m_data_config("data", ENDIANNESS_LITTLE, 8, data_bits, 0) - , m_in_port_cb(*this) + , m_in_port_cb(*this, 0xff) , m_out_port_cb(*this) , m_prr_mask(data_bits <= 14 ? 0 : ((u16(1) << (data_bits - 14)) - 1) | (has_banked_ram ? 0x8000 : 0)) , m_drr_mask(data_bits <= 15 ? 0 : ((u16(1) << (data_bits - 15)) - 1) | (has_banked_ram ? 0x8000 : 0)) @@ -98,12 +98,6 @@ device_memory_interface::space_config_vector st2xxx_device::memory_space_config( }; } -void st2xxx_device::device_resolve_objects() -{ - m_in_port_cb.resolve_all_safe(0xff); - m_out_port_cb.resolve_all_safe(); -} - TIMER_CALLBACK_MEMBER(st2xxx_device::bt_interrupt) { // BTSR must be cleared each time the interrupt is serviced diff --git a/src/devices/cpu/m6502/st2xxx.h b/src/devices/cpu/m6502/st2xxx.h index 811c2008d49..6f63866f2de 100644 --- a/src/devices/cpu/m6502/st2xxx.h +++ b/src/devices/cpu/m6502/st2xxx.h @@ -88,7 +88,6 @@ protected: st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, bool has_banked_ram); virtual space_config_vector memory_space_config() const override; - virtual void device_resolve_objects() override; virtual void device_reset() override; virtual u16 st2xxx_ireq_mask() const = 0; diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index 0388134d0f6..db309444e28 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -315,7 +315,7 @@ m6801_cpu_device::m6801_cpu_device(const machine_config &mconfig, const char *ta m6801_cpu_device::m6801_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const op_func *insn, const uint8_t *cycles, address_map_constructor internal) : m6800_cpu_device(mconfig, type, tag, owner, clock, insn, cycles, internal) - , m_in_port_func(*this) + , m_in_port_func(*this, 0xff) , m_out_port_func(*this) , m_out_sc2_func(*this) , m_out_sertx_func(*this) @@ -355,7 +355,7 @@ hd6303r_cpu_device::hd6303r_cpu_device(const machine_config &mconfig, const char hd6301x_cpu_device::hd6301x_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : hd6301_cpu_device(mconfig, type, tag, owner, clock, hd63701_insn, cycles_63701) - , m_in_portx_func(*this) + , m_in_portx_func(*this, 0xff) , m_out_portx_func(*this) { m_sclk_divider = 16; @@ -1015,25 +1015,6 @@ void hd6301y_cpu_device::execute_set_input(int irqline, int state) -void m6801_cpu_device::device_resolve_objects() -{ - m6800_cpu_device::device_resolve_objects(); - - m_in_port_func.resolve_all_safe(0xff); - m_out_port_func.resolve_all_safe(); - m_out_sc2_func.resolve_safe(); - m_out_sertx_func.resolve_safe(); -} - -void hd6301x_cpu_device::device_resolve_objects() -{ - m6801_cpu_device::device_resolve_objects(); - - m_in_portx_func.resolve_all_safe(0xff); - m_out_portx_func.resolve_all_safe(); -} - - void m6801_cpu_device::device_start() { m6800_cpu_device::device_start(); diff --git a/src/devices/cpu/m6800/m6801.h b/src/devices/cpu/m6800/m6801.h index 3161936132e..f3721cc4ec5 100644 --- a/src/devices/cpu/m6800/m6801.h +++ b/src/devices/cpu/m6800/m6801.h @@ -65,18 +65,17 @@ public: protected: m6801_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const m6800_cpu_device::op_func *insn, const uint8_t *cycles, address_map_constructor internal = address_map_constructor()); - // 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 uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 4 - 1) / 4; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 4); } virtual uint32_t execute_input_lines() const noexcept override { return 5; } virtual void execute_set_input(int inputnum, int state) override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; void p1_ddr_w(uint8_t data); @@ -265,8 +264,7 @@ public: protected: hd6301x_cpu_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/cpu/m68000/m68000.cpp b/src/devices/cpu/m68000/m68000.cpp index 60e6c14a119..7ebc5731bac 100644 --- a/src/devices/cpu/m68000/m68000.cpp +++ b/src/devices/cpu/m68000/m68000.cpp @@ -167,7 +167,6 @@ void m68000_device::device_start() { init_decode_table(); - m_reset_cb.resolve_safe(); m_cmpild_instr_callback.resolve(); m_rte_instr_callback.resolve(); m_tas_write_callback.resolve(); diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index 822af275ef7..3aa2d74b771 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -2399,7 +2399,6 @@ void m68000_musashi_device::clear_all() void m68000_musashi_device::device_start() { - m_reset_cb.resolve_safe(); } void m68000_musashi_device::device_stop() diff --git a/src/devices/cpu/m68000/tmp68301.cpp b/src/devices/cpu/m68000/tmp68301.cpp index f85697e4440..8338fb14efb 100644 --- a/src/devices/cpu/m68000/tmp68301.cpp +++ b/src/devices/cpu/m68000/tmp68301.cpp @@ -13,9 +13,9 @@ DEFINE_DEVICE_TYPE(TMP68301, tmp68301_device, "tmp68301", "Toshiba TMP68301") tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : m68000_mcu_device(mconfig, TMP68301, tag, owner, clock), - m_parallel_r_cb(*this), + m_parallel_r_cb(*this, 0xffff), m_parallel_w_cb(*this), - m_tx_cb{*this, *this, *this} + m_tx_cb(*this) { auto m = address_map_constructor(FUNC(tmp68301_device::internal_map), this); m_program_config.m_internal_map = m; @@ -63,11 +63,6 @@ void tmp68301_device::internal_update(uint64_t current_time) void tmp68301_device::device_start() { m68000_mcu_device::device_start(); - m_parallel_r_cb.resolve_safe(0xffff); - m_parallel_w_cb.resolve_safe(); - - for(auto &tx : m_tx_cb) - tx.resolve_safe(); save_item(NAME(m_external_interrupt_state)); diff --git a/src/devices/cpu/m68000/tmp68301.h b/src/devices/cpu/m68000/tmp68301.h index 96001d21253..0d3406a827a 100644 --- a/src/devices/cpu/m68000/tmp68301.h +++ b/src/devices/cpu/m68000/tmp68301.h @@ -29,7 +29,7 @@ public: protected: devcb_read16 m_parallel_r_cb; devcb_write16 m_parallel_w_cb; - devcb_write_line m_tx_cb[3]; + devcb_write_line::array<3> m_tx_cb; void device_start() override; void device_reset() override; diff --git a/src/devices/cpu/m6805/m68705.cpp b/src/devices/cpu/m6805/m68705.cpp index 7d8e155661d..056135e05af 100644 --- a/src/devices/cpu/m6805/m68705.cpp +++ b/src/devices/cpu/m6805/m68705.cpp @@ -221,7 +221,7 @@ m6805_hmos_device::m6805_hmos_device(machine_config const &mconfig, char const * , m_port_input{ 0xff, 0xff, 0xff, 0xff } , m_port_latch{ 0xff, 0xff, 0xff, 0xff } , m_port_ddr{ 0x00, 0x00, 0x00, 0x00 } - , m_port_cb_r(*this) + , m_port_cb_r(*this, 0xff) , m_port_cb_w(*this) , m_ram_size(ram_size) { @@ -282,7 +282,7 @@ template <std::size_t N> void m6805_hmos_device::set_port_mask(u8 mask) template <std::size_t N> u8 m6805_hmos_device::port_r() { - if (!m_port_cb_r[N].isnull()) + if (!m_port_cb_r[N].isunset()) { u8 const newval(m_port_cb_r[N](0, ~m_port_ddr[N] & ~m_port_mask[N]) & ~m_port_mask[N]); if (newval != m_port_input[N]) @@ -412,8 +412,6 @@ void m6805_hmos_device::device_start() // initialise digital I/O for (u8 &input : m_port_input) input = 0xff; - m_port_cb_r.resolve_all(); - m_port_cb_w.resolve_all_safe(); add_port_latch_state<0>(); add_port_latch_state<1>(); diff --git a/src/devices/cpu/m6805/m68hc05.cpp b/src/devices/cpu/m6805/m68hc05.cpp index 45a22c002af..f2033bb55b4 100644 --- a/src/devices/cpu/m6805/m68hc05.cpp +++ b/src/devices/cpu/m6805/m68hc05.cpp @@ -150,7 +150,7 @@ m68hc05_device::m68hc05_device( type, { addr_width > 13 ? s_hc_b_ops : s_hc_s_ops, s_hc_cycles, addr_width, 0x00ff, 0x00c0, vector_mask, M68HC05_VECTOR_SWI }, internal_map) - , m_port_cb_r(*this) + , m_port_cb_r(*this, 0xff) , m_port_cb_w(*this) , m_port_bits{ 0xff, 0xff, 0xff, 0xff } , m_port_interrupt{ 0x00, 0x00, 0x00, 0x00 } @@ -194,7 +194,7 @@ void m68hc05_device::set_port_interrupt(std::array<u8, PORT_COUNT> const &interr { diff |= (m_port_interrupt[i] ^ interrupt[i]) & ~m_port_ddr[i]; m_port_interrupt[i] = interrupt[i]; - if (interrupt[i] && !m_port_cb_r[i].isnull()) + if (interrupt[i] && !m_port_cb_r[i].isunset()) logerror("PORT%c has interrupts enabled with pulled inputs, behaviour may be incorrect\n", 'A' + i); } if (diff) update_port_irq(); @@ -203,7 +203,7 @@ void m68hc05_device::set_port_interrupt(std::array<u8, PORT_COUNT> const &interr u8 m68hc05_device::port_read(offs_t offset) { offset &= PORT_COUNT - 1; - if (!machine().side_effects_disabled() && !m_port_cb_r[offset].isnull()) + if (!machine().side_effects_disabled() && !m_port_cb_r[offset].isunset()) { u8 const newval(m_port_cb_r[offset](0, ~m_port_ddr[offset] & m_port_bits[offset]) & m_port_bits[offset]); u8 const diff(newval ^ m_port_input[offset]); @@ -250,7 +250,7 @@ void m68hc05_device::port_ddr_w(offs_t offset, u8 data) m_port_ddr[offset] = data; if (diff & m_port_interrupt[offset]) { - if (!m_port_cb_r[offset].isnull()) + if (!m_port_cb_r[offset].isunset()) { u8 const newval(m_port_cb_r[offset](0, ~m_port_ddr[offset] & m_port_bits[offset]) & m_port_bits[offset]); u8 const diff(newval ^ m_port_input[offset]); @@ -454,11 +454,6 @@ void m68hc05_device::device_start() { m6805_base_device::device_start(); - // resolve callbacks - m_port_cb_r.resolve_all(); - m_port_cb_w.resolve_all_safe(); - m_tcmp_cb.resolve_safe(); - // save digital I/O save_item(NAME(m_port_interrupt)); save_item(NAME(m_port_input)); diff --git a/src/devices/cpu/m6809/konami.cpp b/src/devices/cpu/m6809/konami.cpp index 5c189cc5758..f8c6354db03 100644 --- a/src/devices/cpu/m6809/konami.cpp +++ b/src/devices/cpu/m6809/konami.cpp @@ -104,9 +104,6 @@ void konami_cpu_device::device_start() { super::device_start(); - // resolve callbacks - m_set_lines.resolve(); - // initialize variables m_temp_im = 0; m_bcount = 0; @@ -307,8 +304,7 @@ inline void konami_cpu_device::divx() void konami_cpu_device::set_lines(uint8_t data) { - if (!m_set_lines.isnull()) - m_set_lines((offs_t)0, data); + m_set_lines(offs_t(0), data); } diff --git a/src/devices/cpu/m6809/m6809.cpp b/src/devices/cpu/m6809/m6809.cpp index cebeeb81708..dd4d39ffe4e 100644 --- a/src/devices/cpu/m6809/m6809.cpp +++ b/src/devices/cpu/m6809/m6809.cpp @@ -165,8 +165,6 @@ void m6809_base_device::device_start() space(AS_PROGRAM).specific(m_mintf->program); space(has_space(AS_OPCODES) ? AS_OPCODES : AS_PROGRAM).cache(m_mintf->csprogram); - m_lic_func.resolve_safe(); - // register our state for the debugger state_add(STATE_GENPCBASE, "CURPC", m_ppc.w).callimport().noshow(); state_add(STATE_GENFLAGS, "CURFLAGS", m_cc).formatstr("%8s").noshow(); diff --git a/src/devices/cpu/mb88xx/mb88xx.cpp b/src/devices/cpu/mb88xx/mb88xx.cpp index 0d6daeb6680..2899f06627f 100644 --- a/src/devices/cpu/mb88xx/mb88xx.cpp +++ b/src/devices/cpu/mb88xx/mb88xx.cpp @@ -117,12 +117,12 @@ mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, device_type type , m_program_config("program", ENDIANNESS_BIG, 8, program_width, 0, (program_width == 9) ? address_map_constructor(FUNC(mb88_cpu_device::program_9bit), this) : (program_width == 10) ? address_map_constructor(FUNC(mb88_cpu_device::program_10bit), this) : address_map_constructor(FUNC(mb88_cpu_device::program_11bit), this)) , m_data_config("data", ENDIANNESS_BIG, 8, data_width, 0, (data_width == 4) ? address_map_constructor(FUNC(mb88_cpu_device::data_4bit), this) : (data_width == 5) ? address_map_constructor(FUNC(mb88_cpu_device::data_5bit), this) : (data_width == 6) ? address_map_constructor(FUNC(mb88_cpu_device::data_6bit), this) : address_map_constructor(FUNC(mb88_cpu_device::data_7bit), this)) , m_PLA(nullptr) - , m_read_k(*this) + , m_read_k(*this, 0) , m_write_o(*this) , m_write_p(*this) - , m_read_r(*this) + , m_read_r(*this, 0) , m_write_r(*this) - , m_read_si(*this) + , m_read_si(*this, 0) , m_write_so(*this) { } @@ -185,14 +185,6 @@ void mb88_cpu_device::device_start() space(AS_PROGRAM).specific(m_program); space(AS_DATA).specific(m_data); - m_read_k.resolve_safe(0); - m_write_o.resolve_safe(); - m_write_p.resolve_safe(); - m_read_r.resolve_all_safe(0); - m_write_r.resolve_all_safe(); - m_read_si.resolve_safe(0); - m_write_so.resolve_safe(); - m_serial = timer_alloc(FUNC(mb88_cpu_device::serial_timer), this); m_ctr = 0; diff --git a/src/devices/cpu/mc68hc11/mc68hc11.cpp b/src/devices/cpu/mc68hc11/mc68hc11.cpp index 397604ee4ef..4469be598ca 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.cpp +++ b/src/devices/cpu/mc68hc11/mc68hc11.cpp @@ -62,10 +62,10 @@ mc68hc11_cpu_device::mc68hc11_cpu_device(const machine_config &mconfig, device_t , device_nvram_interface(mconfig, *this, (config_mask & 0xf9) != 0) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, address_map_constructor(FUNC(mc68hc11_cpu_device::internal_map), this)) , m_irq_asserted(false) - , m_port_input_cb(*this) + , m_port_input_cb(*this, 0xff) , m_port_output_cb(*this) - , m_analog_cb(*this) - , m_spi2_data_input_cb(*this) + , m_analog_cb(*this, 0) + , m_spi2_data_input_cb(*this, 0xff) , m_spi2_data_output_cb(*this) , m_ram_view(*this, "ram") , m_reg_view(*this, "regs") @@ -155,15 +155,6 @@ device_memory_interface::space_config_vector mc68hc11_cpu_device::memory_space_c }; } -void mc68hc11_cpu_device::device_resolve_objects() -{ - m_port_input_cb.resolve_all_safe(0xff); - m_port_output_cb.resolve_all_safe(); - m_analog_cb.resolve_all_safe(0); - m_spi2_data_input_cb.resolve_safe(0xff); - m_spi2_data_output_cb.resolve_safe(); -} - std::unique_ptr<util::disasm_interface> mc68hc11_cpu_device::create_disassembler() { return std::make_unique<hc11_disassembler>(); diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h index 964ab90fefe..75c12c1455c 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.h +++ b/src/devices/cpu/mc68hc11/mc68hc11.h @@ -55,12 +55,11 @@ public: protected: mc68hc11_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint16_t ram_size, uint16_t reg_block_size, uint16_t rom_size, uint16_t eeprom_size, uint8_t init_value, uint8_t config_mask, uint8_t option_mask); - // 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 uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 41; } virtual uint32_t execute_input_lines() const noexcept override { return 2; } @@ -69,18 +68,18 @@ protected: virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const 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_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; void set_irq_state(uint8_t irqn, bool state); diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp index 138850c69c9..e7b30082012 100644 --- a/src/devices/cpu/mcs40/mcs40.cpp +++ b/src/devices/cpu/mcs40/mcs40.cpp @@ -143,13 +143,6 @@ void mcs40_cpu_device_base::device_start() m_spaces[AS_ROM]->cache(m_cache); m_bus_cycle_cb.resolve_safe(); - m_sync_cb.resolve_safe(); - m_cm_rom_cb.resolve_all_safe(); - m_cm_ram_cb.resolve_all_safe(); - m_cy_cb.resolve_safe(); - m_stp_ack_cb.resolve_safe(); - m_4289_pm_cb.resolve_safe(); - m_4289_f_l_cb.resolve_safe(); m_stop_latch = m_decoded_halt = m_resume = false; diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index f1654f35e6a..b3ea2e55dda 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -211,11 +211,11 @@ mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type ty (ram_size == 128) ? address_map_constructor(FUNC(mcs48_cpu_device::data_7bit), this) : address_map_constructor(FUNC(mcs48_cpu_device::data_8bit), this)) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) - , m_bus_in_cb(*this) + , m_bus_in_cb(*this, 0xff) , m_bus_out_cb(*this) - , m_test_in_cb(*this) + , m_test_in_cb(*this, 0) , m_t0_clk_func(*this) , m_prog_out_cb(*this) , m_psw(0) @@ -1133,14 +1133,6 @@ void mcs48_cpu_device::device_start() if(m_feature_mask & EXT_BUS_FEATURE) space(AS_IO).specific(m_io); - // resolve callbacks - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - m_bus_in_cb.resolve_safe(0xff); - m_bus_out_cb.resolve_safe(); - m_test_in_cb.resolve_all_safe(0); - m_prog_out_cb.resolve_safe(); - // ensure that regptr is valid before get_info gets called update_regptr(); diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp index eabc3f16c29..45ae5a5851b 100644 --- a/src/devices/cpu/mcs51/mcs51.cpp +++ b/src/devices/cpu/mcs51/mcs51.cpp @@ -299,7 +299,7 @@ mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type ty , m_num_interrupts(5) , m_sfr_ram(*this, "sfr_ram") , m_scratchpad(*this, "scratchpad") - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) , m_rtemp(0) { @@ -2291,9 +2291,6 @@ void mcs51_cpu_device::device_start() space(AS_DATA).specific(m_data); space(AS_IO).specific(m_io); - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - /* Save states */ save_item(NAME(m_ppc)); save_item(NAME(m_pc)); diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp index 5beb1717d65..be53f4075dd 100644 --- a/src/devices/cpu/mcs96/i8x9x.cpp +++ b/src/devices/cpu/mcs96/i8x9x.cpp @@ -14,12 +14,12 @@ i8x9x_device::i8x9x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int data_width) : mcs96_device(mconfig, type, tag, owner, clock, data_width, address_map_constructor(FUNC(i8x9x_device::internal_regs), this)), - m_ach_cb(*this), + m_ach_cb(*this, 0), m_hso_cb(*this), m_serial_tx_cb(*this), - m_in_p0_cb(*this), - m_out_p1_cb(*this), m_in_p1_cb(*this), - m_out_p2_cb(*this), m_in_p2_cb(*this), + m_in_p0_cb(*this, 0), + m_out_p1_cb(*this), m_in_p1_cb(*this, 0xff), + m_out_p2_cb(*this), m_in_p2_cb(*this, 0xc2), base_timer2(0), ad_done(0), hsi_mode(0), hsi_status(0), hso_command(0), ad_command(0), hso_active(0), hso_time(0), ad_result(0), pwm_control(0), port1(0), port2(0), ios0(0), ios1(0), ioc0(0), ioc1(0), extint(false), @@ -39,18 +39,6 @@ std::unique_ptr<util::disasm_interface> i8x9x_device::create_disassembler() return std::make_unique<i8x9x_disassembler>(); } -void i8x9x_device::device_resolve_objects() -{ - m_ach_cb.resolve_all(); - m_hso_cb.resolve_safe(); - m_serial_tx_cb.resolve_safe(); - m_in_p0_cb.resolve_safe(0); - m_out_p1_cb.resolve_safe(); - m_in_p1_cb.resolve_safe(0xff); - m_out_p2_cb.resolve_safe(); - m_in_p2_cb.resolve_safe(0xc2); -} - void i8x9x_device::device_start() { mcs96_device::device_start(); @@ -156,7 +144,7 @@ void i8x9x_device::ad_start(u64 current_time) ad_result = 8 | (ad_command & 7); if (!BIT(i8x9x_p0_mask(), ad_command & 7)) logerror("Analog input on ACH%d does not exist on this device\n", ad_command & 7); - else if (m_ach_cb[ad_command & 7].isnull()) + else if (m_ach_cb[ad_command & 7].isunset()) logerror("Analog input on ACH%d not configured\n", ad_command & 7); else ad_result |= m_ach_cb[ad_command & 7]() << 6; diff --git a/src/devices/cpu/mcs96/i8x9x.h b/src/devices/cpu/mcs96/i8x9x.h index 5f4ab03f8a5..903e2c5c488 100644 --- a/src/devices/cpu/mcs96/i8x9x.h +++ b/src/devices/cpu/mcs96/i8x9x.h @@ -70,7 +70,6 @@ public: protected: i8x9x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int data_width); - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/cpu/melps4/melps4.cpp b/src/devices/cpu/melps4/melps4.cpp index e5bfa378aaf..72cbb51d273 100644 --- a/src/devices/cpu/melps4/melps4.cpp +++ b/src/devices/cpu/melps4/melps4.cpp @@ -55,10 +55,10 @@ melps4_cpu_device::melps4_cpu_device(const machine_config &mconfig, device_type , m_sp_mask(0x7<<4) , m_ba_op(0x01) , m_stack_levels(3) - , m_read_k(*this) - , m_read_d(*this) - , m_read_s(*this) - , m_read_f(*this) + , m_read_k(*this, 0) + , m_read_d(*this, 0) + , m_read_s(*this, 0) + , m_read_f(*this, 0) , m_write_d(*this) , m_write_s(*this) , m_write_f(*this) @@ -103,19 +103,6 @@ void melps4_cpu_device::device_start() m_datamask = (1 << m_datawidth) - 1; m_d_mask = (1 << m_d_pins) - 1; - // resolve callbacks - m_read_k.resolve_safe(0); - m_read_d.resolve_safe(0); - m_read_s.resolve_safe(0); - m_read_f.resolve_safe(0); - - m_write_d.resolve_safe(); - m_write_s.resolve_safe(); - m_write_f.resolve_safe(); - m_write_g.resolve_safe(); - m_write_u.resolve_safe(); - m_write_t.resolve_safe(); - // zerofill m_pc = 0; m_prev_pc = 0; diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp index c6665d13d01..f89ad30cb68 100644 --- a/src/devices/cpu/mips/mips1.cpp +++ b/src/devices/cpu/mips/mips1.cpp @@ -65,7 +65,7 @@ mips1core_device_base::mips1core_device_base(machine_config const &mconfig, devi , m_icount(0) , m_icache_size(icache_size) , m_dcache_size(dcache_size) - , m_in_brcond(*this) + , m_in_brcond(*this, 0) { } @@ -148,9 +148,6 @@ void mips1core_device_base::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve conditional branch input handlers - m_in_brcond.resolve_all_safe(0); - // register our state for the debugger state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp index 64da0efe23f..2e825978bf8 100644 --- a/src/devices/cpu/mn10200/mn10200.cpp +++ b/src/devices/cpu/mn10200/mn10200.cpp @@ -48,7 +48,7 @@ void mn10200_device::mn1020012a_internal_map(address_map &map) mn10200_device::mn10200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program), m_program(nullptr) - , m_read_port(*this) + , m_read_port(*this, 0xff) , m_write_port(*this) , m_cycles(0), m_pc(0), m_psw(0), m_mdr(0), m_nmicr(0), m_iagr(0) , m_extmdl(0), m_extmdh(0), m_possible_irq(false), m_pplul(0), m_ppluh(0), m_p3md(0), m_p4(0) @@ -122,10 +122,6 @@ void mn10200_device::device_start() { m_program = &space(AS_PROGRAM); - // resolve callbacks - m_read_port.resolve_all_safe(0xff); - m_write_port.resolve_all_safe(); - // init and register for savestates save_item(NAME(m_pc)); save_item(NAME(m_d)); diff --git a/src/devices/cpu/mn1400/mn1400base.cpp b/src/devices/cpu/mn1400/mn1400base.cpp index c9aa9c34cc0..7f57afe53ff 100644 --- a/src/devices/cpu/mn1400/mn1400base.cpp +++ b/src/devices/cpu/mn1400/mn1400base.cpp @@ -52,9 +52,9 @@ mn1400_base_device::mn1400_base_device(const machine_config &mconfig, device_typ m_stack_levels(stack_levels), m_prgwidth(prgwidth), m_datawidth(datawidth), - m_read_a(*this), - m_read_b(*this), - m_read_sns(*this), + m_read_a(*this, 0), + m_read_b(*this, 0), + m_read_sns(*this, 0), m_write_c(*this), m_write_d(*this), m_write_e(*this), @@ -94,14 +94,6 @@ void mn1400_base_device::device_start() m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; - // resolve callbacks - m_read_a.resolve_safe(0); - m_read_b.resolve_safe(0); - m_read_sns.resolve_safe(0); - m_write_c.resolve_safe(); - m_write_d.resolve_safe(); - m_write_e.resolve_safe(); - // zerofill m_pc = 0; m_prev_pc = 0; diff --git a/src/devices/cpu/nanoprocessor/nanoprocessor.cpp b/src/devices/cpu/nanoprocessor/nanoprocessor.cpp index da3dadedd80..d78c237727f 100644 --- a/src/devices/cpu/nanoprocessor/nanoprocessor.cpp +++ b/src/devices/cpu/nanoprocessor/nanoprocessor.cpp @@ -53,8 +53,8 @@ DEFINE_DEVICE_TYPE(HP_NANOPROCESSOR, hp_nanoprocessor_device, "nanoprocessor", " hp_nanoprocessor_device::hp_nanoprocessor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, HP_NANOPROCESSOR, tag, owner, clock), m_dc_changed_func(*this), - m_read_dc_func(*this), - m_int_ack_func(*this), + m_read_dc_func(*this, 0xff), + m_int_ack_func(*this, 0xff), m_program_config("program", ENDIANNESS_BIG, 8, 11), m_io_config("io", ENDIANNESS_BIG, 8, 4) { @@ -98,10 +98,6 @@ void hp_nanoprocessor_device::device_start() save_item(NAME(m_flags)); set_icountptr(m_icount); - - m_dc_changed_func.resolve_safe(); - m_read_dc_func.resolve_safe(0xff); - m_int_ack_func.resolve_safe(0xff); } void hp_nanoprocessor_device::device_reset() diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index ae13e89730d..5c0b04000e6 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -57,10 +57,10 @@ v25_common_device::v25_common_device(const machine_config &mconfig, device_type , m_io_config("io", ENDIANNESS_LITTLE, is_16bit ? 16 : 8, 16, 0) , m_internal_ram(*this, "internal_ram") , m_PCK(8) - , m_pt_in(*this) - , m_p0_in(*this) - , m_p1_in(*this) - , m_p2_in(*this) + , m_pt_in(*this, 0xff) + , m_p0_in(*this, 0xff) + , m_p1_in(*this, 0xff) + , m_p2_in(*this, 0xff) , m_p0_out(*this) , m_p1_out(*this) , m_p2_out(*this) @@ -633,15 +633,6 @@ void v25_common_device::device_start() m_data = &space(AS_DATA); m_io = &space(AS_IO); - m_pt_in.resolve_safe(0xff); - m_p0_in.resolve_safe(0xff); - m_p1_in.resolve_safe(0xff); - m_p2_in.resolve_safe(0xff); - - m_p0_out.resolve_safe(); - m_p1_out.resolve_safe(); - m_p2_out.resolve_safe(); - state_add( V25_PC, "PC", m_ip).formatstr("%04X"); state_add<uint16_t>( V25_PSW, "PSW", [this]() { return CompressFlags(); }, [this](uint16_t data) { ExpandFlags(data); }); diff --git a/src/devices/cpu/nec/v5x.cpp b/src/devices/cpu/nec/v5x.cpp index 8791111fbe4..31e7799c556 100644 --- a/src/devices/cpu/nec/v5x.cpp +++ b/src/devices/cpu/nec/v5x.cpp @@ -346,9 +346,6 @@ void v50_base_device::device_start() nec_common_device::device_start(); m_internal_io = &space(AS_INTERNAL_IO); - m_tout1_callback.resolve_safe(); - m_icu_slave_ack.resolve_safe(0); - set_irq_acknowledge_callback(*m_icu, FUNC(v5x_icu_device::inta_cb)); save_item(NAME(m_OPCN)); @@ -521,7 +518,7 @@ v50_base_device::v50_base_device(const machine_config &mconfig, device_type type : nec_common_device(mconfig, type, tag, owner, clock, is_16bit, prefetch_size, prefetch_cycles, chip_type, address_map_constructor(FUNC(v50_base_device::internal_port_map), this)) , device_v5x_interface(mconfig, *this, is_16bit) , m_tout1_callback(*this) - , m_icu_slave_ack(*this) + , m_icu_slave_ack(*this, 0) , m_OPCN(0) , m_tout1(false) , m_intp1(false) diff --git a/src/devices/cpu/ns32000/slave.h b/src/devices/cpu/ns32000/slave.h index b7511e6bcff..576689f2c04 100644 --- a/src/devices/cpu/ns32000/slave.h +++ b/src/devices/cpu/ns32000/slave.h @@ -35,12 +35,6 @@ protected: { } - // device_interface overrides - virtual void interface_post_start() override - { - m_out_scb.resolve_safe(); - } - devcb_write_line m_out_scb; }; diff --git a/src/devices/cpu/pace/pace.cpp b/src/devices/cpu/pace/pace.cpp index 2bfba2cc338..b48e3537ecf 100644 --- a/src/devices/cpu/pace/pace.cpp +++ b/src/devices/cpu/pace/pace.cpp @@ -65,8 +65,8 @@ ALLOW_SAVE_TYPE(pace_device::cycle); pace_device::pace_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : cpu_device(mconfig, type, tag, owner, clock) , m_space_config("program", ENDIANNESS_LITTLE, 16, 16, -1) - , m_bps_callback(*this) - , m_jc_callback(*this) + , m_bps_callback(*this, 0) + , m_jc_callback(*this, 0) , m_flag_callback(*this) , m_fr(0xffff) , m_pc(0) @@ -109,21 +109,6 @@ device_memory_interface::space_config_vector pace_device::memory_space_config() //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void pace_device::device_resolve_objects() -{ - // resolve callbacks - m_bps_callback.resolve_safe(0); - m_jc_callback.resolve_all_safe(0); - m_flag_callback.resolve_all_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/cpu/pace/pace.h b/src/devices/cpu/pace/pace.h index c96c38e5c02..ed9cadf39b9 100644 --- a/src/devices/cpu/pace/pace.h +++ b/src/devices/cpu/pace/pace.h @@ -70,24 +70,23 @@ protected: // construction/destruction pace_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device-specific 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 + 4 - 1) / 4; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } virtual void execute_run() override; virtual void execute_set_input(int irqline, int state) override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; private: diff --git a/src/devices/cpu/patinhofeio/patinho_feio.cpp b/src/devices/cpu/patinhofeio/patinho_feio.cpp index 8757ab29f5f..4db14b4d9de 100644 --- a/src/devices/cpu/patinhofeio/patinho_feio.cpp +++ b/src/devices/cpu/patinhofeio/patinho_feio.cpp @@ -61,11 +61,11 @@ patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, , m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, address_map_constructor(FUNC(patinho_feio_cpu_device::prog_8bit), this)) , m_update_panel_cb(*this) , m_icount(0) - , m_rc_read_cb(*this) - , m_buttons_read_cb(*this) - , m_iodev_read_cb(*this) + , m_rc_read_cb(*this, 0) + , m_buttons_read_cb(*this, 0) + , m_iodev_read_cb(*this, 0) , m_iodev_write_cb(*this) - , m_iodev_status_cb(*this) + , m_iodev_status_cb(*this, 0) // unused? { } @@ -77,10 +77,7 @@ device_memory_interface::space_config_vector patinho_feio_cpu_device::memory_spa } uint16_t patinho_feio_cpu_device::read_panel_keys_register(){ - if (!m_rc_read_cb.isnull()) - m_rc = m_rc_read_cb(0); - else - m_rc = 0; + m_rc = m_rc_read_cb(0); return m_rc; } @@ -128,17 +125,6 @@ void patinho_feio_cpu_device::device_start() state_add(STATE_GENPCBASE, "CURPC", m_pc).formatstr("0%06O").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%8s"); - m_rc_read_cb.resolve(); - if (m_rc_read_cb.isnull()){ - fatalerror("Panel keys register not found!"); - } - - m_buttons_read_cb.resolve(); - - m_iodev_read_cb.resolve_all(); - m_iodev_write_cb.resolve_all(); - m_iodev_status_cb.resolve_all(); // unused? - set_icountptr(m_icount); } @@ -172,7 +158,7 @@ void patinho_feio_cpu_device::execute_run() { debugger_instruction_hook(PC); if (!m_run){ - if (!m_buttons_read_cb.isnull()){ + if (!m_buttons_read_cb.isunset()){ uint16_t buttons = m_buttons_read_cb(0); if (buttons & BUTTON_PARTIDA){ /* "startup" button */ @@ -742,7 +728,7 @@ void patinho_feio_cpu_device::execute_instruction() break; case 0x80: /* SAI = "Output data to I/O device" */ - if (m_iodev_write_cb[channel].isnull()){ + if (m_iodev_write_cb[channel].isunset()){ printf("Warning: There's no device hooked up at I/O address 0x%X", channel); } else { m_iodev_write_cb[channel](ACC); diff --git a/src/devices/cpu/pdp8/hd6120.cpp b/src/devices/cpu/pdp8/hd6120.cpp index b1198387e70..0faf3602d9c 100644 --- a/src/devices/cpu/pdp8/hd6120.cpp +++ b/src/devices/cpu/pdp8/hd6120.cpp @@ -173,9 +173,9 @@ hd6120_device::hd6120_device(const machine_config &config, const char *tag, devi , m_lxmar_callback(*this) , m_lxpar_callback(*this) , m_lxdar_callback(*this) - , m_rsr_callback(*this) + , m_rsr_callback(*this, 0) , m_wsr_callback(*this) - , m_strtup_callback(*this) + , m_strtup_callback(*this, 1) , m_intgnt_callback(*this) , m_ioclr_callback(*this) , m_pc(0) @@ -228,19 +228,6 @@ hd6120_device::space_config_vector hd6120_device::memory_space_config() const }; } -void hd6120_device::device_resolve_objects() -{ - // Resolve callbacks - m_lxmar_callback.resolve_safe(); - m_lxpar_callback.resolve_safe(); - m_lxdar_callback.resolve_safe(); - m_rsr_callback.resolve(); - m_wsr_callback.resolve_safe(); - m_strtup_callback.resolve_safe(1); - m_intgnt_callback.resolve_safe(); - m_ioclr_callback.resolve_safe(); -} - u16 hd6120_device::rotate_step(u16 data) { const bool link = BIT(m_flags, 2); @@ -734,7 +721,7 @@ void hd6120_device::execute_run() break; case minor_state::OSR_3: - if (m_rsr_callback.isnull()) + if (m_rsr_callback.isunset()) { logerror("%06o: SR read (IR = %04o)\n", m_iaddr, m_ir); m_temp = 0; diff --git a/src/devices/cpu/pdp8/hd6120.h b/src/devices/cpu/pdp8/hd6120.h index 126ce115040..d7df0fd6547 100644 --- a/src/devices/cpu/pdp8/hd6120.h +++ b/src/devices/cpu/pdp8/hd6120.h @@ -81,24 +81,23 @@ public: auto ioclr_callback() { return m_ioclr_callback.bind(); } 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 void execute_run() override; virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } virtual void execute_set_input(int linenum, int state) override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; private: diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp index ba2145e9a8b..0d72c196539 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.cpp +++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp @@ -160,10 +160,10 @@ pic16c5x_device::pic16c5x_device(const machine_config &mconfig, device_type type , m_data_width(data_width) , m_program_width(program_width) , m_temp_config(0) - , m_read_a(*this) - , m_read_b(*this) - , m_read_c(*this) - , m_read_d(*this) + , m_read_a(*this, 0) + , m_read_b(*this, 0) + , m_read_c(*this, 0) + , m_read_d(*this, 0) , m_write_a(*this) , m_write_b(*this) , m_write_c(*this) @@ -937,15 +937,6 @@ void pic16c5x_device::device_start() space(AS_PROGRAM).cache(m_program); space(AS_DATA).specific(m_data); - m_read_a.resolve_safe(0); - m_read_b.resolve_safe(0); - m_read_c.resolve_safe(0); - m_read_d.resolve_safe(0); - m_write_a.resolve_safe(); - m_write_b.resolve_safe(); - m_write_c.resolve_safe(); - m_write_d.resolve_safe(); - m_program_mask = (1 << m_program_width) - 1; m_data_mask = (1 << m_data_width) - 1; m_status_mask = (m_picmodel == 0x1650 || m_picmodel == 0x1654 || m_picmodel == 0x1655) ? 0x07 : 0xff; diff --git a/src/devices/cpu/pic17/pic17c4x.cpp b/src/devices/cpu/pic17/pic17c4x.cpp index 07976c32b79..45c2065ae86 100644 --- a/src/devices/cpu/pic17/pic17c4x.cpp +++ b/src/devices/cpu/pic17/pic17c4x.cpp @@ -418,12 +418,6 @@ void pic17c4x_device::increment_timers() } } -void pic17c4x_device::device_resolve_objects() -{ - // Resolve callback objects - m_port_out_cb.resolve_all_safe(); -} - void pic17c4x_device::device_start() { pic17_cpu_device::device_start(); diff --git a/src/devices/cpu/pic17/pic17c4x.h b/src/devices/cpu/pic17/pic17c4x.h index e1ae9290230..fd48f2aa49a 100644 --- a/src/devices/cpu/pic17/pic17c4x.h +++ b/src/devices/cpu/pic17/pic17c4x.h @@ -77,12 +77,11 @@ public: protected: pic17c4x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u16 rom_size, address_map_constructor data_map); - // 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 u32 execute_input_lines() const noexcept override { return 6; } // for now virtual bool execute_input_edge_triggered(int linenum) const noexcept override { return linenum == INT_LINE || linenum == T0CKI_LINE; } virtual void execute_set_input(int linenum, int state) override; diff --git a/src/devices/cpu/pps4/pps4.cpp b/src/devices/cpu/pps4/pps4.cpp index 1a44fa2a39b..de09b96166f 100644 --- a/src/devices/cpu/pps4/pps4.cpp +++ b/src/devices/cpu/pps4/pps4.cpp @@ -91,8 +91,8 @@ pps4_device::pps4_device(const machine_config &mconfig, device_type type, const , m_program_config("program", ENDIANNESS_LITTLE, 8, 12) , m_data_config("data", ENDIANNESS_LITTLE, 8, 12) // 4bit RAM , m_io_config("io", ENDIANNESS_LITTLE, 8, 8) // 4bit IO - , m_dia_cb(*this) - , m_dib_cb(*this) + , m_dia_cb(*this, 0) + , m_dib_cb(*this, 0) , m_do_cb(*this) , m_wasldi(0) , m_waslbl(0) @@ -1590,10 +1590,6 @@ void pps4_device::device_start() state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow(); set_icountptr(m_icount); - - m_dia_cb.resolve_safe(0); - m_dib_cb.resolve_safe(0); - m_do_cb.resolve_safe(); } void pps4_2_device::device_start() diff --git a/src/devices/cpu/pps41/pps41base.cpp b/src/devices/cpu/pps41/pps41base.cpp index 9fa004640b3..dc37d66bf5f 100644 --- a/src/devices/cpu/pps41/pps41base.cpp +++ b/src/devices/cpu/pps41/pps41base.cpp @@ -63,12 +63,12 @@ pps41_base_device::pps41_base_device(const machine_config &mconfig, device_type m_prgwidth(prgwidth), m_datawidth(datawidth), m_opla(*this, "opla"), - m_read_p(*this), - m_read_d(*this), + m_read_p(*this, 0xff), + m_read_d(*this, 0), m_write_d(*this), - m_read_r(*this), + m_read_r(*this, 0xff), m_write_r(*this), - m_read_sdi(*this), + m_read_sdi(*this, 1), m_write_sdo(*this), m_write_ssc(*this), m_write_spk(*this) @@ -86,17 +86,6 @@ void pps41_base_device::device_start() m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; - // resolve callbacks - m_read_p.resolve_safe(0xff); - m_read_d.resolve_safe(0); - m_write_d.resolve_safe(); - m_read_r.resolve_safe(0xff); - m_write_r.resolve_safe(); - m_read_sdi.resolve_safe(1); - m_write_sdo.resolve_safe(); - m_write_ssc.resolve_safe(); - m_write_spk.resolve_safe(); - // init RAM with 0xf for (int i = 0; i <= m_datamask; i++) m_data->write_byte(i, 0xf); diff --git a/src/devices/cpu/psx/dma.cpp b/src/devices/cpu/psx/dma.cpp index 957810ff840..64bb8f1c71e 100644 --- a/src/devices/cpu/psx/dma.cpp +++ b/src/devices/cpu/psx/dma.cpp @@ -48,8 +48,6 @@ void psxdma_device::device_post_load() void psxdma_device::device_start() { - m_irq_handler.resolve_safe(); - for( int index = 0; index < 7; index++ ) { psx_dma_channel *dma = &m_channel[ index ]; diff --git a/src/devices/cpu/psx/irq.cpp b/src/devices/cpu/psx/irq.cpp index e5dcc5c02b9..41706fcf9db 100644 --- a/src/devices/cpu/psx/irq.cpp +++ b/src/devices/cpu/psx/irq.cpp @@ -39,10 +39,8 @@ void psxirq_device::device_post_load() void psxirq_device::device_start() { - m_irq_handler.resolve_safe(); - - save_item( NAME( n_irqdata ) ); - save_item( NAME( n_irqmask ) ); + save_item(NAME(n_irqdata)); + save_item(NAME(n_irqmask)); } void psxirq_device::set( uint32_t bitmask ) diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp index 1e7ed448c2e..b658b9046d7 100644 --- a/src/devices/cpu/psx/psx.cpp +++ b/src/devices/cpu/psx/psx.cpp @@ -1785,16 +1785,16 @@ void psxcpu_device::psxcpu_internal_map(address_map &map) //------------------------------------------------- psxcpu_device::psxcpu_device( const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock ) : - cpu_device( mconfig, type, tag, owner, clock ), - m_program_config( "program", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(psxcpu_device::psxcpu_internal_map), this)), - m_gpu_read_handler( *this ), - m_gpu_write_handler( *this ), - m_spu_read_handler( *this ), - m_spu_write_handler( *this ), - m_cd_read_handler( *this ), - m_cd_write_handler( *this ), - m_ram( *this, "ram" ), - m_rom( *this, "rom" ) + cpu_device(mconfig, type, tag, owner, clock), + m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(psxcpu_device::psxcpu_internal_map), this)), + m_gpu_read_handler(*this, 0), + m_gpu_write_handler(*this), + m_spu_read_handler(*this, 0), + m_spu_write_handler(*this), + m_cd_read_handler(*this, 0), + m_cd_write_handler(*this), + m_ram(*this, "ram"), + m_rom(*this, "rom") { m_disable_rom_berr = false; } @@ -1988,13 +1988,6 @@ void psxcpu_device::device_start() // set our instruction counter set_icountptr(m_icount); - - m_gpu_read_handler.resolve_safe( 0 ); - m_gpu_write_handler.resolve_safe(); - m_spu_read_handler.resolve_safe( 0 ); - m_spu_write_handler.resolve_safe(); - m_cd_read_handler.resolve_safe( 0 ); - m_cd_write_handler.resolve_safe(); } diff --git a/src/devices/cpu/psx/rcnt.cpp b/src/devices/cpu/psx/rcnt.cpp index c31c9464f8e..0a9b03f89d3 100644 --- a/src/devices/cpu/psx/rcnt.cpp +++ b/src/devices/cpu/psx/rcnt.cpp @@ -35,10 +35,6 @@ void psxrcnt_device::device_post_load() void psxrcnt_device::device_start() { - m_irq0_handler.resolve_safe(); - m_irq1_handler.resolve_safe(); - m_irq2_handler.resolve_safe(); - save_item(STRUCT_MEMBER(root_counter, n_count)); save_item(STRUCT_MEMBER(root_counter, n_mode)); save_item(STRUCT_MEMBER(root_counter, n_target)); diff --git a/src/devices/cpu/psx/sio.cpp b/src/devices/cpu/psx/sio.cpp index 120fa395d41..07f7bd93bb6 100644 --- a/src/devices/cpu/psx/sio.cpp +++ b/src/devices/cpu/psx/sio.cpp @@ -47,12 +47,6 @@ void psxsio_device::device_post_load() void psxsio_device::device_start() { - m_irq_handler.resolve_safe(); - m_sck_handler.resolve_safe(); - m_txd_handler.resolve_safe(); - m_dtr_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - m_timer = timer_alloc(FUNC( psxsio_device::sio_tick ), this); m_mode = 0; m_control = 0; diff --git a/src/devices/cpu/rii/riscii.cpp b/src/devices/cpu/rii/riscii.cpp index f7c642a2f0a..a2364d99641 100644 --- a/src/devices/cpu/rii/riscii.cpp +++ b/src/devices/cpu/rii/riscii.cpp @@ -65,8 +65,8 @@ riscii_series_device::riscii_series_device(const machine_config &mconfig, device : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, addrbits, -1) , m_regs_config("register", ENDIANNESS_LITTLE, 8, 8 + bankbits, 0, regs) - , m_porta_in_cb(*this) - , m_port_in_cb(*this) + , m_porta_in_cb(*this, 0xff) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) , m_pcmask((1 << pcbits) - 1) , m_tbptmask(((1 << (addrbits + 1)) - 1) | 0x800000) @@ -189,13 +189,6 @@ device_memory_interface::space_config_vector riscii_series_device::memory_space_ }; } -void riscii_series_device::device_resolve_objects() -{ - m_porta_in_cb.resolve_safe(0xff); - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); -} - void riscii_series_device::device_start() { space(AS_PROGRAM).cache(m_cache); diff --git a/src/devices/cpu/rii/riscii.h b/src/devices/cpu/rii/riscii.h index 41b54d93a9e..496281d260f 100644 --- a/src/devices/cpu/rii/riscii.h +++ b/src/devices/cpu/rii/riscii.h @@ -94,19 +94,18 @@ public: protected: riscii_series_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, unsigned addrbits, unsigned pcbits, unsigned bankbits, u8 maxbank, u8 post_id_mask, address_map_constructor regs); - // 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 void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; void core_regs_map(address_map &map); @@ -390,7 +389,7 @@ public: epg3231_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; private: diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp index a91c764da16..c72e8652d8c 100644 --- a/src/devices/cpu/rsp/rsp.cpp +++ b/src/devices/cpu/rsp/rsp.cpp @@ -122,9 +122,9 @@ rsp_device::rsp_device(const machine_config &mconfig, const char *tag, device_t , m_pc_temp(0) , m_ppc_temp(0) , m_nextpc_temp(0xffff) - , m_dp_reg_r_func(*this) + , m_dp_reg_r_func(*this, 0) , m_dp_reg_w_func(*this) - , m_sp_reg_r_func(*this) + , m_sp_reg_r_func(*this, 0) , m_sp_reg_w_func(*this) , m_sp_set_status_func(*this) { @@ -252,15 +252,6 @@ void rsp_device::unimplemented_opcode(uint32_t op) /*****************************************************************************/ -void rsp_device::resolve_cb() -{ - m_dp_reg_r_func.resolve(); - m_dp_reg_w_func.resolve(); - m_sp_reg_r_func.resolve(); - m_sp_reg_w_func.resolve(); - m_sp_set_status_func.resolve(); -} - void rsp_device::device_start() { if (LOG_INSTRUCTION_EXECUTION) @@ -270,7 +261,6 @@ void rsp_device::device_start() space(AS_PROGRAM).specific(m_imem); space(AS_DATA).cache(m_dcache); space(AS_DATA).specific(m_dmem); - resolve_cb(); for (int regIdx = 0; regIdx < 32; regIdx++) m_r[regIdx] = 0; diff --git a/src/devices/cpu/rsp/rsp.h b/src/devices/cpu/rsp/rsp.h index b33012bddda..3bbb95ca348 100644 --- a/src/devices/cpu/rsp/rsp.h +++ b/src/devices/cpu/rsp/rsp.h @@ -87,7 +87,6 @@ public: rsp_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); virtual ~rsp_device() override; - void resolve_cb(); auto dp_reg_r() { return m_dp_reg_r_func.bind(); } auto dp_reg_w() { return m_dp_reg_w_func.bind(); } auto sp_reg_r() { return m_sp_reg_r_func.bind(); } diff --git a/src/devices/cpu/rw5000/rw5000base.cpp b/src/devices/cpu/rw5000/rw5000base.cpp index 1d0fc237dc8..ad5745f4e94 100644 --- a/src/devices/cpu/rw5000/rw5000base.cpp +++ b/src/devices/cpu/rw5000/rw5000base.cpp @@ -30,8 +30,8 @@ rw5000_base_device::rw5000_base_device(const machine_config &mconfig, device_typ m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), m_prgwidth(prgwidth), m_datawidth(datawidth), - m_read_kb(*this), - m_read_din(*this), + m_read_kb(*this, 0), + m_read_din(*this, 0), m_write_str(*this), m_write_seg(*this), m_write_spk(*this) @@ -49,13 +49,6 @@ void rw5000_base_device::device_start() m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; - // resolve callbacks - m_read_kb.resolve_safe(0); - m_read_din.resolve_safe(0); - m_write_str.resolve_safe(); - m_write_seg.resolve_safe(); - m_write_spk.resolve_safe(); - // zerofill m_pc = 0; m_prev_pc = 0; diff --git a/src/devices/cpu/rx01/rx01.cpp b/src/devices/cpu/rx01/rx01.cpp index 07ac688e1d7..b15813640bc 100644 --- a/src/devices/cpu/rx01/rx01.cpp +++ b/src/devices/cpu/rx01/rx01.cpp @@ -77,11 +77,6 @@ device_memory_interface::space_config_vector rx01_cpu_device::memory_space_confi }; } -void rx01_cpu_device::device_resolve_objects() -{ - m_interface_callback.resolve_all_safe(); -} - void rx01_cpu_device::device_start() { space(AS_PROGRAM).cache(m_inst_cache); diff --git a/src/devices/cpu/rx01/rx01.h b/src/devices/cpu/rx01/rx01.h index dd2fa02b523..230f1cb8170 100644 --- a/src/devices/cpu/rx01/rx01.h +++ b/src/devices/cpu/rx01/rx01.h @@ -51,24 +51,23 @@ public: int data_r() { return !data_in(); } 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 + 4 - 1) / 4; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } virtual void execute_set_input(int linenum, int state) override; virtual void execute_run() override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; private: diff --git a/src/devices/cpu/s2650/s2650.cpp b/src/devices/cpu/s2650/s2650.cpp index 9adac06044c..baa8beae391 100644 --- a/src/devices/cpu/s2650/s2650.cpp +++ b/src/devices/cpu/s2650/s2650.cpp @@ -32,8 +32,9 @@ s2650_device::s2650_device(const machine_config &mconfig, const char *tag, devic , m_program_config("program", ENDIANNESS_BIG, 8, 15) , m_io_config("io", ENDIANNESS_BIG, 8, 8) , m_data_config("data", ENDIANNESS_BIG, 8, 1) - , m_sense_handler(*this) - , m_flag_handler(*this), m_intack_handler(*this) + , m_sense_handler(*this, 0) + , m_flag_handler(*this) + , m_intack_handler(*this, 0x00) , m_ppc(0), m_page(0), m_iar(0), m_ea(0), m_psl(0), m_psu(0), m_r(0) , m_halt(0), m_ir(0), m_irq_state(0), m_icount(0) , m_debugger_temp(0) @@ -179,7 +180,7 @@ inline void s2650_device::set_psu(uint8_t new_val) inline uint8_t s2650_device::get_psu() { - if (!m_sense_handler.isnull()) + if (!m_sense_handler.isunset()) { if (m_sense_handler()) m_psu |= SI; @@ -206,7 +207,7 @@ inline int s2650_device::check_irq_line() if (m_irq_state != CLEAR_LINE) { - if( (m_psu & II) == 0 ) + if ((m_psu & II) == 0) { if (m_halt) { @@ -819,10 +820,6 @@ static void BRA_EA(void) _BRA_EA() void s2650_device::device_start() { - m_sense_handler.resolve(); - m_flag_handler.resolve_safe(); - m_intack_handler.resolve_safe(0x00); - space(AS_PROGRAM).cache(m_cprogram); space(AS_PROGRAM).specific(m_program); space(AS_DATA).specific(m_data); diff --git a/src/devices/cpu/saturn/saturn.cpp b/src/devices/cpu/saturn/saturn.cpp index d79d9acdee3..3c89c9239ad 100644 --- a/src/devices/cpu/saturn/saturn.cpp +++ b/src/devices/cpu/saturn/saturn.cpp @@ -44,11 +44,11 @@ saturn_device::saturn_device(const machine_config &mconfig, const char *tag, dev : cpu_device(mconfig, SATURN, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) , m_out_func(*this) - , m_in_func(*this) + , m_in_func(*this, 0) , m_reset_func(*this) , m_config_func(*this) , m_unconfig_func(*this) - , m_id_func(*this) + , m_id_func(*this, 0) , m_crc_func(*this) , m_rsi_func(*this) , m_pc(0), m_oldpc(0), m_p(0), m_out(0), m_carry(0), m_decimal(0), m_st(0), m_hst(0) @@ -95,15 +95,6 @@ void saturn_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - m_out_func.resolve_safe(); - m_in_func.resolve_safe(0); - m_reset_func.resolve_safe(); - m_config_func.resolve_safe(); - m_unconfig_func.resolve_safe(); - m_id_func.resolve_safe(0); - m_crc_func.resolve_safe(); - m_rsi_func.resolve_safe(); - memset(m_reg, 0, sizeof(m_reg)); memset(m_d, 0, sizeof(m_d)); m_pc = 0; diff --git a/src/devices/cpu/sc61860/sc61860.cpp b/src/devices/cpu/sc61860/sc61860.cpp index 9719ebc7069..70743897fe6 100644 --- a/src/devices/cpu/sc61860/sc61860.cpp +++ b/src/devices/cpu/sc61860/sc61860.cpp @@ -50,12 +50,12 @@ DEFINE_DEVICE_TYPE(SC61860, sc61860_device, "sc61860", "Sharp SC61860") sc61860_device::sc61860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SC61860, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0) - , m_reset(*this) - , m_brk(*this) - , m_x(*this) - , m_ina(*this) + , m_reset(*this, 0) + , m_brk(*this, 0) + , m_x(*this, 0) + , m_ina(*this, 0) , m_outa(*this) - , m_inb(*this) + , m_inb(*this, 0) , m_outb(*this) , m_outc(*this) { @@ -110,14 +110,6 @@ void sc61860_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - m_reset.resolve(); - m_brk.resolve(); - m_x.resolve(); - m_ina.resolve_safe(0); - m_outa.resolve_safe(); - m_inb.resolve_safe(0); - m_outb.resolve_safe(); - m_outc.resolve_safe(); m_p = 0; m_q = 0; diff --git a/src/devices/cpu/sc61860/scops.hxx b/src/devices/cpu/sc61860/scops.hxx index 23c122ac55f..f43d41cf0c3 100644 --- a/src/devices/cpu/sc61860/scops.hxx +++ b/src/devices/cpu/sc61860/scops.hxx @@ -468,9 +468,9 @@ void sc61860_device::sc61860_test_special() int t=0; if (m_timer.t512ms) t|=1; if (m_timer.t2ms) t|=2; - if (!m_brk.isnull()&&m_brk()) t|=8; - if (!m_reset.isnull()&&m_reset()) t|=0x40; - if (!m_x.isnull()&&m_x()) t|=0x80; + if (!m_brk.isunset()&&m_brk()) t|=8; + if (!m_reset.isunset()&&m_reset()) t|=0x40; + if (!m_x.isunset()&&m_x()) t|=0x80; m_zero=(t&READ_OP())==0; } @@ -748,7 +748,7 @@ void sc61860_device::sc61860_wait_x(int level) int c; m_zero=level; - if (!m_x.isnull()) { + if (!m_x.isunset()) { for (c=READ_RAM(I); c>=0; c--) { uint8_t t = (READ_RAM(m_p)+1)&0x7f; WRITE_RAM(m_p, t); diff --git a/src/devices/cpu/scmp/scmp.cpp b/src/devices/cpu/scmp/scmp.cpp index e4f064b3e48..f37308da5a5 100644 --- a/src/devices/cpu/scmp/scmp.cpp +++ b/src/devices/cpu/scmp/scmp.cpp @@ -33,9 +33,9 @@ scmp_device::scmp_device(const machine_config &mconfig, device_type type, const , m_AC(0), m_ER(0), m_SR(0), m_icount(0) , m_flag_out_func(*this) , m_sout_func(*this) - , m_sin_func(*this) - , m_sensea_func(*this) - , m_senseb_func(*this) + , m_sin_func(*this, 0) + , m_sensea_func(*this, 0) + , m_senseb_func(*this, 0) , m_halt_func(*this) { } @@ -500,14 +500,6 @@ void scmp_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - /* resolve callbacks */ - m_flag_out_func.resolve_safe(); - m_sout_func.resolve_safe(); - m_sin_func.resolve_safe(0); - m_sensea_func.resolve_safe(0); - m_senseb_func.resolve_safe(0); - m_halt_func.resolve_safe(); - save_item(NAME(m_PC)); save_item(NAME(m_P1)); save_item(NAME(m_P2)); diff --git a/src/devices/cpu/scudsp/scudsp.cpp b/src/devices/cpu/scudsp/scudsp.cpp index 14124d9f18f..2f8c2d0e0a6 100644 --- a/src/devices/cpu/scudsp/scudsp.cpp +++ b/src/devices/cpu/scudsp/scudsp.cpp @@ -987,10 +987,6 @@ void scudsp_cpu_device::device_start() state_add( STATE_GENPCBASE, "CURPC", m_pc ).noshow(); state_add( STATE_GENFLAGS, "GENFLAGS", m_flags ).formatstr("%17s").noshow(); - m_out_irq_cb.resolve_safe(); - m_in_dma_cb.resolve_safe(0); - m_out_dma_cb.resolve_safe(); - set_icountptr(m_icount); } @@ -1021,7 +1017,7 @@ void scudsp_cpu_device::data_map(address_map &map) scudsp_cpu_device::scudsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SCUDSP, tag, owner, clock) , m_out_irq_cb(*this) - , m_in_dma_cb(*this) + , m_in_dma_cb(*this, 0) , m_out_dma_cb(*this) , m_program_config("program", ENDIANNESS_BIG, 32, 8, -2, address_map_constructor(FUNC(scudsp_cpu_device::program_map), this)) , m_data_config("data", ENDIANNESS_BIG, 32, 8, -2, address_map_constructor(FUNC(scudsp_cpu_device::data_map), this)) diff --git a/src/devices/cpu/se3208/se3208.cpp b/src/devices/cpu/se3208/se3208.cpp index ced0649feb0..32d9dc533a4 100644 --- a/src/devices/cpu/se3208/se3208.cpp +++ b/src/devices/cpu/se3208/se3208.cpp @@ -38,7 +38,7 @@ se3208_device::se3208_device(const machine_config &mconfig, const char *tag, dev : cpu_device(mconfig, SE3208, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) , m_machinex_cb(*this) - , m_iackx_cb(*this) + , m_iackx_cb(*this, 0) , m_PC(0), m_SR(0), m_SP(0), m_ER(0), m_PPC(0), m_IRQ(0), m_NMI(0), m_icount(0) { } @@ -51,13 +51,6 @@ device_memory_interface::space_config_vector se3208_device::memory_space_config( } -void se3208_device::device_resolve_objects() -{ - m_machinex_cb.resolve_safe(); - m_iackx_cb.resolve_safe(0); -} - - uint8_t se3208_device::SE3208_Read8(uint32_t address) { return m_program.read_byte(address); diff --git a/src/devices/cpu/se3208/se3208.h b/src/devices/cpu/se3208/se3208.h index 1b93eeb3984..0e6608540c3 100644 --- a/src/devices/cpu/se3208/se3208.h +++ b/src/devices/cpu/se3208/se3208.h @@ -25,12 +25,11 @@ public: auto iackx_cb() { return m_iackx_cb.bind(); } 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 uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 1; } virtual uint32_t execute_input_lines() const noexcept override { return 1; } @@ -38,13 +37,13 @@ protected: virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; private: diff --git a/src/devices/cpu/sm510/sm510base.cpp b/src/devices/cpu/sm510/sm510base.cpp index 5345d203723..66e7925b8c2 100644 --- a/src/devices/cpu/sm510/sm510base.cpp +++ b/src/devices/cpu/sm510/sm510base.cpp @@ -19,6 +19,28 @@ #include "sm510base.h" +sm510_base_device::sm510_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + cpu_device(mconfig, type, tag, owner, clock), + m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program), + m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), + m_prgwidth(prgwidth), + m_datawidth(datawidth), + m_stack_levels(stack_levels), + m_r_mask_option(RMASK_DIRECT), + m_lcd_ram_a(*this, "lcd_ram_a"), + m_lcd_ram_b(*this, "lcd_ram_b"), + m_lcd_ram_c(*this, "lcd_ram_c"), + m_write_segs(*this), + m_melody_rom(*this, "melody"), + m_read_k(*this, 0), + m_read_ba(*this, 1), + m_read_b(*this, 1), + m_write_s(*this), + m_write_r(*this) +{ +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -31,14 +53,6 @@ void sm510_base_device::device_start() m_datamask = (1 << m_datawidth) - 1; m_pagemask = 0x3f; - // resolve callbacks - m_read_k.resolve_safe(0); - m_read_ba.resolve_safe(1); - m_read_b.resolve_safe(1); - m_write_s.resolve_safe(); - m_write_r.resolve_safe(); - m_write_segs.resolve_safe(); - // init/zerofill std::fill_n(m_stack, std::size(m_stack), 0); m_pc = 0; diff --git a/src/devices/cpu/sm510/sm510base.h b/src/devices/cpu/sm510/sm510base.h index bf061967fc4..1e3aa5c9795 100644 --- a/src/devices/cpu/sm510/sm510base.h +++ b/src/devices/cpu/sm510/sm510base.h @@ -36,27 +36,6 @@ enum class sm510_base_device : public cpu_device { public: - // construction/destruction - sm510_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : - cpu_device(mconfig, type, tag, owner, clock), - m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program), - m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data), - m_prgwidth(prgwidth), - m_datawidth(datawidth), - m_stack_levels(stack_levels), - m_r_mask_option(RMASK_DIRECT), - m_lcd_ram_a(*this, "lcd_ram_a"), - m_lcd_ram_b(*this, "lcd_ram_b"), - m_lcd_ram_c(*this, "lcd_ram_c"), - m_write_segs(*this), - m_melody_rom(*this, "melody"), - m_read_k(*this), - m_read_ba(*this), - m_read_b(*this), - m_write_s(*this), - m_write_r(*this) - { } - // For SM510, SM500, SM5A, R port output is selected with a mask option, // either from the divider or direct contol. Documented options are: // SM510/SM5A: direct control, 2(4096Hz meant for alarm sound) @@ -87,11 +66,14 @@ public: auto write_segs() { return m_write_segs.bind(); } protected: - // device-level overrides + // construction/destruction + sm510_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data); + + // 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 + m_clk_div - 1) / m_clk_div; } // default 2 cycles per machine cycle virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * m_clk_div); } // " virtual u32 execute_min_cycles() const noexcept override { return 1; } @@ -100,20 +82,20 @@ protected: virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; - virtual void execute_one() { } // -> child class + // device_memory_interface implementation + virtual space_config_vector memory_space_config() const override; + + virtual void execute_one() = 0; virtual bool op_argument() { return false; } - // device_memory_interface overrides - virtual space_config_vector memory_space_config() const override; + virtual void reset_vector() { do_branch(3, 7, 0); } + virtual void wakeup_vector() { do_branch(1, 0, 0); } // after halt address_space_config m_program_config; address_space_config m_data_config; address_space *m_program; address_space *m_data; - virtual void reset_vector() { do_branch(3, 7, 0); } - virtual void wakeup_vector() { do_branch(1, 0, 0); } // after halt - int m_prgwidth; int m_datawidth; int m_prgmask; diff --git a/src/devices/cpu/sm510/sm530.cpp b/src/devices/cpu/sm510/sm530.cpp index a17213fa1cb..1110a22db33 100644 --- a/src/devices/cpu/sm510/sm530.cpp +++ b/src/devices/cpu/sm510/sm530.cpp @@ -64,9 +64,6 @@ void sm530_device::device_start() // common init sm511_device::device_start(); - // resolve callbacks - m_write_f.resolve_safe(); - // zerofill m_subdiv = 0; m_count_1s = 0; diff --git a/src/devices/cpu/sm510/sm590.cpp b/src/devices/cpu/sm510/sm590.cpp index 7237dbbfa5d..f833b7e2683 100644 --- a/src/devices/cpu/sm510/sm590.cpp +++ b/src/devices/cpu/sm510/sm590.cpp @@ -53,7 +53,7 @@ void sm590_device::data_56x4(address_map &map) sm590_device::sm590_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data), m_write_rx(*this), - m_read_rx(*this) + m_read_rx(*this, 0) { } sm590_device::sm590_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : @@ -85,10 +85,6 @@ void sm590_device::device_start() // common init sm510_base_device::device_start(); - // resolve callbacks - m_read_rx.resolve_all_safe(0); - m_write_rx.resolve_all_safe(); - // init/register for savestates m_pagemask = 0x7f; save_item(NAME(m_rports)); diff --git a/src/devices/cpu/sm8500/sm8500.cpp b/src/devices/cpu/sm8500/sm8500.cpp index d85b845d3dc..d64b898f1dc 100644 --- a/src/devices/cpu/sm8500/sm8500.cpp +++ b/src/devices/cpu/sm8500/sm8500.cpp @@ -108,9 +108,6 @@ void sm8500_cpu_device::device_start() { m_program = &space(AS_PROGRAM); - m_dma_func.resolve_safe(); - m_timer_func.resolve_safe(); - save_item(NAME(m_PC)); save_item(NAME(m_IE0)); save_item(NAME(m_IE1)); diff --git a/src/devices/cpu/sparc/sparc.cpp b/src/devices/cpu/sparc/sparc.cpp index e207c0837fe..8717d56e22e 100644 --- a/src/devices/cpu/sparc/sparc.cpp +++ b/src/devices/cpu/sparc/sparc.cpp @@ -138,7 +138,7 @@ sparcv8_device::sparcv8_device(const machine_config &mconfig, device_type type, mb86930_device::mb86930_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sparcv8_device(mconfig, MB86930, tag, owner, clock) - , m_cs_r(*this) + , m_cs_r(*this, 0) , m_cs_w(*this) { m_asi_config[0x00] = address_space_config("debugger", ENDIANNESS_BIG, 32, 32); @@ -647,9 +647,6 @@ void mb86930_device::device_start() std::fill_n(&m_arsr[0], 6, 0); std::fill_n(&m_amr[0], 6, 0); - - m_cs_r.resolve_all_safe(0); - m_cs_w.resolve_all_safe(); } void mb86930_device::device_reset() diff --git a/src/devices/cpu/st62xx/st62xx.cpp b/src/devices/cpu/st62xx/st62xx.cpp index 76b21f05b39..7b47c087dfd 100644 --- a/src/devices/cpu/st62xx/st62xx.cpp +++ b/src/devices/cpu/st62xx/st62xx.cpp @@ -127,12 +127,6 @@ void st6228_device::device_start() m_data_rom_bank->configure_entries(0, 128, m_rom->base(), 0x40); m_data_bank->set_base(&m_regs[0x80]); - - m_porta_out.resolve_all_safe(); - m_portb_out.resolve_all_safe(); - m_portc_out.resolve_all_safe(); - m_portd_out.resolve_all_safe(); - m_timer_out.resolve_safe(); } void st6228_device::device_reset() diff --git a/src/devices/cpu/superfx/superfx.cpp b/src/devices/cpu/superfx/superfx.cpp index e14ac788c5e..e91ec0d5deb 100644 --- a/src/devices/cpu/superfx/superfx.cpp +++ b/src/devices/cpu/superfx/superfx.cpp @@ -627,8 +627,6 @@ void superfx_device::device_start() m_program = &space(AS_PROGRAM); - m_out_irq_func.resolve(); - save_item(NAME(m_pipeline)); save_item(NAME(m_ramaddr)); diff --git a/src/devices/cpu/t11/t11.cpp b/src/devices/cpu/t11/t11.cpp index 5094508c76f..9e2af21ba29 100644 --- a/src/devices/cpu/t11/t11.cpp +++ b/src/devices/cpu/t11/t11.cpp @@ -54,7 +54,7 @@ t11_device::t11_device(const machine_config &mconfig, device_type type, const ch , m_berr_active(false) , m_hlt_active(false) , m_out_reset_func(*this) - , m_in_iack_func(*this) + , m_in_iack_func(*this, 0) // default vector (T-11 User's Guide, p. A-11) { m_program_config.m_is_octal = true; for (auto ® : m_reg) @@ -310,8 +310,6 @@ void t11_device::device_start() m_initial_pc = initial_pc[c_initial_mode >> 13]; space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - m_out_reset_func.resolve_safe(); - m_in_iack_func.resolve_safe(0); // default vector (T-11 User's Guide, p. A-11) save_item(NAME(m_ppc.w.l)); save_item(NAME(m_reg[0].w.l)); diff --git a/src/devices/cpu/tlcs870/tlcs870.cpp b/src/devices/cpu/tlcs870/tlcs870.cpp index f23cd725952..d29ae07b7b6 100644 --- a/src/devices/cpu/tlcs870/tlcs870.cpp +++ b/src/devices/cpu/tlcs870/tlcs870.cpp @@ -110,9 +110,9 @@ tlcs870_device::tlcs870_device(const machine_config &mconfig, device_type optype , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) , m_intram(*this, "intram") , m_dbr(*this, "dbr") - , m_port_in_cb(*this) + , m_port_in_cb(*this, 0xff) , m_port_out_cb(*this) - , m_port_analog_in_cb(*this) + , m_port_analog_in_cb(*this, 0xff) , m_serial_out_cb(*this) { } @@ -1239,11 +1239,6 @@ void tlcs870_device::device_start() set_icountptr(m_icount); - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - m_port_analog_in_cb.resolve_all_safe(0xff); - m_serial_out_cb.resolve_all_safe(); - m_serial_transmit_timer[0] = timer_alloc(FUNC(tlcs870_device::sio0_transmit_cb), this); m_serial_transmit_timer[1] = timer_alloc(FUNC(tlcs870_device::sio1_transmit_cb), this); diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index 148f2dbd4a8..0616f68a5cb 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -157,7 +157,7 @@ void tlcs90_device::tmp90ph44_mem(address_map &map) tlcs90_device::tlcs90_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program_map) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0, program_map) - , m_port_read_cb(*this) + , m_port_read_cb(*this, 0xff) , m_port_write_cb(*this) { } @@ -2850,9 +2850,6 @@ TIMER_CALLBACK_MEMBER( tlcs90_device::t90_timer4_callback ) void tlcs90_device::device_start() { - m_port_read_cb.resolve_all_safe(0xff); - m_port_write_cb.resolve_all_safe(); - save_item(NAME(m_prvpc.w.l)); save_item(NAME(m_pc.w.l)); save_item(NAME(m_sp.w.l)); diff --git a/src/devices/cpu/tlcs900/tmp95c061.cpp b/src/devices/cpu/tlcs900/tmp95c061.cpp index 7174569e800..5602e707387 100644 --- a/src/devices/cpu/tlcs900/tmp95c061.cpp +++ b/src/devices/cpu/tlcs900/tmp95c061.cpp @@ -14,23 +14,23 @@ DEFINE_DEVICE_TYPE(TMP95C061, tmp95c061_device, "tmp95c061", "Toshiba TMP95C061" tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C061, tag, owner, clock), - m_port1_read(*this), + m_port1_read(*this, 0), m_port1_write(*this), m_port2_write(*this), - m_port5_read(*this), + m_port5_read(*this, 0), m_port5_write(*this), - m_port6_read(*this), + m_port6_read(*this, 0), m_port6_write(*this), - m_port7_read(*this), + m_port7_read(*this, 0), m_port7_write(*this), - m_port8_read(*this), + m_port8_read(*this, 0), m_port8_write(*this), - m_port9_read(*this), - m_porta_read(*this), + m_port9_read(*this, 0), + m_porta_read(*this, 0), m_porta_write(*this), - m_portb_read(*this), + m_portb_read(*this, 0), m_portb_write(*this), - m_an_read(*this), + m_an_read(*this, 0), m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -190,24 +190,6 @@ void tmp95c061_device::device_start() save_item(NAME(m_mem_start_mask)); save_item(NAME(m_dram_refresh)); save_item(NAME(m_dram_access)); - - m_port1_read.resolve_safe(0); - m_port1_write.resolve_safe(); - m_port2_write.resolve_safe(); - m_port5_read.resolve_safe(0); - m_port5_write.resolve_safe(); - m_port6_read.resolve_safe(0); - m_port6_write.resolve_safe(); - m_port7_read.resolve_safe(0); - m_port7_write.resolve_safe(); - m_port8_read.resolve_safe(0); - m_port8_write.resolve_safe(); - m_port9_read.resolve_safe(0); - m_porta_read.resolve_safe(0); - m_porta_write.resolve_safe(); - m_portb_read.resolve_safe(0); - m_portb_write.resolve_safe(); - m_an_read.resolve_all_safe(0); } void tmp95c061_device::device_reset() diff --git a/src/devices/cpu/tlcs900/tmp95c063.cpp b/src/devices/cpu/tlcs900/tmp95c063.cpp index 90663eeaff3..c70a19e85cc 100644 --- a/src/devices/cpu/tlcs900/tmp95c063.cpp +++ b/src/devices/cpu/tlcs900/tmp95c063.cpp @@ -14,29 +14,29 @@ DEFINE_DEVICE_TYPE(TMP95C063, tmp95c063_device, "tmp95c063", "Toshiba TMP95C063" tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C063, tag, owner, clock), - m_port1_read(*this), + m_port1_read(*this, 0), m_port1_write(*this), m_port2_write(*this), - m_port5_read(*this), + m_port5_read(*this, 0), m_port5_write(*this), - m_port6_read(*this), + m_port6_read(*this, 0), m_port6_write(*this), - m_port7_read(*this), + m_port7_read(*this, 0), m_port7_write(*this), - m_port8_read(*this), + m_port8_read(*this, 0), m_port8_write(*this), - m_port9_read(*this), + m_port9_read(*this, 0), m_port9_write(*this), - m_porta_read(*this), + m_porta_read(*this, 0), m_porta_write(*this), - m_portb_read(*this), + m_portb_read(*this, 0), m_portb_write(*this), - m_portc_read(*this), - m_portd_read(*this), + m_portc_read(*this, 0), + m_portd_read(*this, 0), m_portd_write(*this), - m_porte_read(*this), + m_porte_read(*this, 0), m_porte_write(*this), - m_an_read(*this), + m_an_read(*this, 0), m_port_latch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_port_control{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, m_port_function{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -589,30 +589,6 @@ void tmp95c063_device::device_start() save_item(NAME(m_dram_refresh)); save_item(NAME(m_dram_access)); save_item(NAME(m_da_drive)); - - m_port1_read.resolve_safe(0); - m_port1_write.resolve_safe(); - m_port2_write.resolve_safe(); - m_port5_read.resolve_safe(0); - m_port5_write.resolve_safe(); - m_port6_read.resolve_safe(0); - m_port6_write.resolve_safe(); - m_port7_read.resolve_safe(0); - m_port7_write.resolve_safe(); - m_port8_read.resolve_safe(0); - m_port8_write.resolve_safe(); - m_port9_read.resolve_safe(0); - m_port9_write.resolve_safe(); - m_porta_read.resolve_safe(0); - m_porta_write.resolve_safe(); - m_portb_read.resolve_safe(0); - m_portb_write.resolve_safe(); - m_portc_read.resolve_safe(0); - m_portd_read.resolve_safe(0); - m_portd_write.resolve_safe(); - m_porte_read.resolve_safe(0); - m_porte_write.resolve_safe(); - m_an_read.resolve_all_safe(0); } void tmp95c063_device::device_reset() diff --git a/src/devices/cpu/tms1000/smc1102.cpp b/src/devices/cpu/tms1000/smc1102.cpp index e3a28ebc9a3..caf4dc13443 100644 --- a/src/devices/cpu/tms1000/smc1102.cpp +++ b/src/devices/cpu/tms1000/smc1102.cpp @@ -60,8 +60,6 @@ void smc1102_cpu_device::device_start() { tms1100_cpu_device::device_start(); - m_write_segs.resolve_safe(); - // zerofill memset(m_lcd_ram, 0, sizeof(m_lcd_ram)); m_lcd_sr = 0; diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp index b04b5288215..0b764041412 100644 --- a/src/devices/cpu/tms1000/tms0980.cpp +++ b/src/devices/cpu/tms1000/tms0980.cpp @@ -98,7 +98,7 @@ void tms0980_cpu_device::device_reset() m_fixed_decode[op] = (op & 0x80) ? F_CALL: F_BR; // 6 output bits select a microinstruction index - m_micro_decode[op] = m_decode_micro.isnull() ? decode_micro(m_ipla->read(op) & 0x3f) : m_decode_micro(op); + m_micro_decode[op] = m_decode_micro.isunset() ? decode_micro(m_ipla->read(op) & 0x3f) : m_decode_micro(op); // the other ipla terms each select a fixed instruction m_fixed_decode[op] |= decode_fixed(op); @@ -110,7 +110,7 @@ void tms0980_cpu_device::device_reset() memset(&m_micro_decode[0], 0, 0x40*sizeof(u32)); for (int op = 0; op < 0x40; op++) - m_micro_direct[op] = m_decode_micro.isnull() ? decode_micro(op) : m_decode_micro(op + 0x200); + m_micro_direct[op] = m_decode_micro.isunset() ? decode_micro(op) : m_decode_micro(op + 0x200); } u32 tms0980_cpu_device::decode_fixed(offs_t offset) diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp index 02120756353..4a20debfeeb 100644 --- a/src/devices/cpu/tms1000/tms1000.cpp +++ b/src/devices/cpu/tms1000/tms1000.cpp @@ -123,7 +123,7 @@ void tms1000_cpu_device::device_reset() // decode microinstructions for (int op = 0; op < 0x100; op++) - m_micro_decode[op] = m_decode_micro.isnull() ? decode_micro(op) : m_decode_micro(op); + m_micro_decode[op] = m_decode_micro.isunset() ? decode_micro(op) : m_decode_micro(op); // the fixed instruction set is not programmable m_fixed_decode[0x00] = F_COMX; diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp index 7fb2395f639..f885532d813 100644 --- a/src/devices/cpu/tms1000/tms1k_base.cpp +++ b/src/devices/cpu/tms1000/tms1k_base.cpp @@ -80,17 +80,17 @@ tms1k_base_device::tms1k_base_device(const machine_config &mconfig, device_type m_x_bits(x_bits), m_stack_levels(stack_levels), m_option_dec_div(0), - m_read_k(*this), + m_read_k(*this, 0), m_write_o(*this), m_write_r(*this), - m_read_j(*this), - m_read_r(*this), + m_read_j(*this, 0), + m_read_r(*this, 0), m_power_off(*this), - m_read_ctl(*this), + m_read_ctl(*this, 0), m_write_ctl(*this), m_write_pdc(*this), m_output_pla_table(nullptr), - m_decode_micro(*this) + m_decode_micro(*this, 0) { } @@ -138,18 +138,6 @@ void tms1k_base_device::device_start() m_pc_mask = (1 << m_pc_bits) - 1; m_x_mask = (1 << m_x_bits) - 1; - // resolve callbacks - m_read_k.resolve_safe(0); - m_write_o.resolve_safe(); - m_write_r.resolve_safe(); - m_read_j.resolve_safe(0); - m_read_r.resolve_safe(0); - m_power_off.resolve_safe(); - m_read_ctl.resolve_safe(0); - m_write_ctl.resolve_safe(); - m_write_pdc.resolve_safe(); - m_decode_micro.resolve(); - if (m_opla_b != nullptr && m_output_pla_table == nullptr) set_output_pla(&m_opla_b->as_u16()); diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp index 7a9fb58b54c..c1067de5486 100644 --- a/src/devices/cpu/tms32010/tms32010.cpp +++ b/src/devices/cpu/tms32010/tms32010.cpp @@ -110,7 +110,7 @@ tms32010_device::tms32010_device(const machine_config &mconfig, device_type type , m_program_config("program", ENDIANNESS_BIG, 16, 12, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 8, -1, data_map) , m_io_config("io", ENDIANNESS_BIG, 16, 4, -1) - , m_bio_in(*this) + , m_bio_in(*this, 0) , m_addr_mask(addr_mask) { } @@ -839,8 +839,6 @@ void tms32010_device::device_start() space(AS_DATA).specific(m_data); space(AS_IO).specific(m_io); - m_bio_in.resolve_safe(0); - m_PREVPC = 0; m_ALU.d = 0; m_Preg.d = 0; diff --git a/src/devices/cpu/tms32025/tms32025.cpp b/src/devices/cpu/tms32025/tms32025.cpp index dd615547e35..86dbb05e48a 100644 --- a/src/devices/cpu/tms32025/tms32025.cpp +++ b/src/devices/cpu/tms32025/tms32025.cpp @@ -249,11 +249,11 @@ tms32025_device::tms32025_device(const machine_config &mconfig, device_type type , m_b1(*this, "b1") , m_b2(*this, "b2") , m_b3(*this, "b3") - , m_bio_in(*this) - , m_hold_in(*this) + , m_bio_in(*this, 0xffff) + , m_hold_in(*this, 0xffff) , m_hold_ack_out(*this) , m_xf_out(*this) - , m_dr_in(*this) + , m_dr_in(*this, 0xffff) , m_dx_out(*this) , m_mp_mc(true) { @@ -1664,13 +1664,6 @@ void tms32025_device::device_start() m_program.space().install_rom(0x0000, 0x0fff, memregion("internal")->base()); } - m_bio_in.resolve_safe(0xffff); - m_hold_in.resolve_safe(0xffff); - m_hold_ack_out.resolve_safe(); - m_xf_out.resolve_safe(); - m_dr_in.resolve_safe(0xffff); - m_dx_out.resolve_safe(); - m_PREVPC = 0; m_PFC = 0; m_STR0 = 0; diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp index f4516f27788..dd318f7debf 100644 --- a/src/devices/cpu/tms32031/tms32031.cpp +++ b/src/devices/cpu/tms32031/tms32031.cpp @@ -528,12 +528,6 @@ void tms3203x_device::device_start() space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); - // resolve devcb handlers - m_xf0_cb.resolve_safe(); - m_xf1_cb.resolve_safe(); - m_iack_cb.resolve_safe(); - m_holda_cb.resolve_safe(); - // set up the internal boot loader ROM if (m_mcbl_mode) { diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp index 6a79f2c22c4..5f83443da68 100644 --- a/src/devices/cpu/tms34010/tms34010.cpp +++ b/src/devices/cpu/tms34010/tms34010.cpp @@ -712,8 +712,6 @@ void tms340x0_device::device_start() { m_scanline_ind16_cb.resolve(); m_scanline_rgb32_cb.resolve(); - m_output_int_cb.resolve(); - m_ioreg_pre_write_cb.resolve(); m_to_shiftreg_cb.resolve(); m_from_shiftreg_cb.resolve(); @@ -1244,7 +1242,7 @@ static const char *const ioreg_name[] = void tms34010_device::io_register_w(offs_t offset, u16 data, u16 mem_mask) { - if (!m_ioreg_pre_write_cb.isnull()) + if (!m_ioreg_pre_write_cb.isunset()) m_ioreg_pre_write_cb(offset, data, mem_mask); int oldreg, newreg; @@ -1319,15 +1317,9 @@ void tms34010_device::io_register_w(offs_t offset, u16 data, u16 mem_mask) /* the TMS34010 can set output interrupt? */ if (!(oldreg & 0x0080) && (newreg & 0x0080)) - { - if (!m_output_int_cb.isnull()) - m_output_int_cb(1); - } + m_output_int_cb(1); else if ((oldreg & 0x0080) && !(newreg & 0x0080)) - { - if (!m_output_int_cb.isnull()) - m_output_int_cb(0); - } + m_output_int_cb(0); /* input interrupt? (should really be state-based, but the functions don't exist!) */ if (!(oldreg & 0x0008) && (newreg & 0x0008)) @@ -1395,7 +1387,7 @@ static const char *const ioreg020_name[] = void tms34020_device::io_register_w(offs_t offset, u16 data, u16 mem_mask) { - if (!m_ioreg_pre_write_cb.isnull()) + if (!m_ioreg_pre_write_cb.isunset()) m_ioreg_pre_write_cb(offset, data, mem_mask); int oldreg, newreg; @@ -1471,15 +1463,9 @@ void tms34020_device::io_register_w(offs_t offset, u16 data, u16 mem_mask) /* the TMS34010 can set output interrupt? */ if (!(oldreg & 0x0080) && (newreg & 0x0080)) - { - if (!m_output_int_cb.isnull()) - m_output_int_cb(1); - } + m_output_int_cb(1); else if ((oldreg & 0x0080) && !(newreg & 0x0080)) - { - if (!m_output_int_cb.isnull()) - m_output_int_cb(0); - } + m_output_int_cb(0); /* input interrupt? (should really be state-based, but the functions don't exist!) */ if (!(oldreg & 0x0008) && (newreg & 0x0008)) diff --git a/src/devices/cpu/tms57002/tms57002.cpp b/src/devices/cpu/tms57002/tms57002.cpp index 39f052328f8..f93ca5796bf 100644 --- a/src/devices/cpu/tms57002/tms57002.cpp +++ b/src/devices/cpu/tms57002/tms57002.cpp @@ -939,13 +939,6 @@ void tms57002_device::sound_stream_update(sound_stream &stream, std::vector<read sync_w(1); } -void tms57002_device::device_resolve_objects() -{ - m_dready_callback.resolve_safe(); - m_pc0_callback.resolve_safe(); - m_empty_callback.resolve_safe(); -} - void tms57002_device::device_start() { sti = S_IDLE; diff --git a/src/devices/cpu/tms57002/tms57002.h b/src/devices/cpu/tms57002/tms57002.h index db5b217ee9b..4c9809f9501 100644 --- a/src/devices/cpu/tms57002/tms57002.h +++ b/src/devices/cpu/tms57002/tms57002.h @@ -32,8 +32,8 @@ public: void sync_w(int state); void internal_pgm(address_map &map); + protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp index 22b553b9a33..2f23b4ba05a 100644 --- a/src/devices/cpu/tms7000/tms7000.cpp +++ b/src/devices/cpu/tms7000/tms7000.cpp @@ -119,7 +119,7 @@ tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, d tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal, uint32_t info_flags) : cpu_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal), - m_port_in_cb(*this), + m_port_in_cb(*this, 0xff), m_port_out_cb(*this), m_info_flags(info_flags), m_divider(2) @@ -204,9 +204,6 @@ void tms7000_device::device_start() m_irq_state[TMS7000_INT1_LINE] = false; m_irq_state[TMS7000_INT3_LINE] = false; - m_port_in_cb.resolve_all_safe(0xff); - m_port_out_cb.resolve_all_safe(); - m_idle_state = false; m_idle_halt = false; m_pc = 0; diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp index 52380c629c1..49e60c1a28b 100644 --- a/src/devices/cpu/tms9900/tms9900.cpp +++ b/src/devices/cpu/tms9900/tms9900.cpp @@ -169,7 +169,7 @@ tms99xx_device::tms99xx_device(const machine_config &mconfig, device_type type, m_clock_out_line(*this), m_wait_line(*this), m_holda_line(*this), - m_get_intlevel(*this), + m_get_intlevel(*this, 0), m_external_operation(*this), m_ready_bufd(true), m_program_index(NOPRG), @@ -202,7 +202,6 @@ enum void tms99xx_device::device_start() { // TODO: Restore state save feature - resolve_lines(); m_prgspace = &space(AS_PROGRAM); m_setaddr = has_space(AS_SETADDRESS) ? &space(AS_SETADDRESS) : nullptr; m_cru = &space(AS_IO); @@ -278,19 +277,6 @@ void tms99xx_device::device_stop() } /* - External connections -*/ -void tms99xx_device::resolve_lines() -{ - // Resolve our external connections - m_external_operation.resolve(); - m_get_intlevel.resolve(); - m_clock_out_line.resolve(); - m_wait_line.resolve(); - m_holda_line.resolve(); -} - -/* TMS9900 hard reset The device reset is just the emulator's trigger for the reset procedure which is invoked via the main loop. @@ -1218,7 +1204,7 @@ void tms99xx_device::execute_run() { LOGMASKED(LOG_IDLE, "IDLE state\n"); pulse_clock(1); - if (!m_external_operation.isnull()) + if (!m_external_operation.isunset()) { m_external_operation(IDLE_OP, 0, 0xff); m_external_operation(IDLE_OP, 1, 0xff); @@ -1322,7 +1308,7 @@ void tms99xx_device::execute_set_input(int irqline, int state) */ int tms99xx_device::get_intlevel(int state) { - if (!m_get_intlevel.isnull()) return m_get_intlevel(0); + if (!m_get_intlevel.isunset()) return m_get_intlevel(0); return 0; } @@ -1332,7 +1318,7 @@ void tms99xx_device::service_interrupt() m_command = INTR; m_idle_state = false; - if (!m_external_operation.isnull()) m_external_operation(IDLE_OP, 0, 0xff); + if (!m_external_operation.isunset()) m_external_operation(IDLE_OP, 0, 0xff); m_state = 0; @@ -1380,9 +1366,9 @@ void tms99xx_device::pulse_clock(int count) { for (int i=0; i < count; i++) { - if (!m_clock_out_line.isnull()) m_clock_out_line(ASSERT_LINE); + if (!m_clock_out_line.isunset()) m_clock_out_line(ASSERT_LINE); m_ready = m_ready_bufd; // get the latched READY state - if (!m_clock_out_line.isnull()) m_clock_out_line(CLEAR_LINE); + if (!m_clock_out_line.isunset()) m_clock_out_line(CLEAR_LINE); m_icount--; // This is the only location where we count down the cycles. if (m_check_ready) LOGMASKED(LOG_CLOCK, "pulse_clock, READY=%d\n", m_ready? 1:0); else LOGMASKED(LOG_CLOCK, "pulse_clock\n"); @@ -1398,7 +1384,7 @@ void tms99xx_device::set_hold(int state) if (!m_hold_state) { m_hold_acknowledged = false; - if (!m_holda_line.isnull()) m_holda_line(CLEAR_LINE); + if (!m_holda_line.isunset()) m_holda_line(CLEAR_LINE); } } @@ -1408,7 +1394,7 @@ void tms99xx_device::set_hold(int state) inline void tms99xx_device::acknowledge_hold() { m_hold_acknowledged = true; - if (!m_holda_line.isnull()) m_holda_line(ASSERT_LINE); + if (!m_holda_line.isunset()) m_holda_line(ASSERT_LINE); } /* @@ -1444,7 +1430,7 @@ void tms99xx_device::abort_operation() inline void tms99xx_device::set_wait_state(bool state) { if (m_wait_state != state) - if (!m_wait_line.isnull()) m_wait_line(state? ASSERT_LINE : CLEAR_LINE); + if (!m_wait_line.isunset()) m_wait_line(state? ASSERT_LINE : CLEAR_LINE); m_wait_state = state; } @@ -2670,7 +2656,7 @@ void tms99xx_device::alu_external() if (m_command == IDLE) m_idle_state = true; - if (!m_external_operation.isnull()) m_external_operation((IR >> 5) & 0x07, 1, 0xff); + if (!m_external_operation.isunset()) m_external_operation((IR >> 5) & 0x07, 1, 0xff); pulse_clock(2); } diff --git a/src/devices/cpu/tms9900/tms9900.h b/src/devices/cpu/tms9900/tms9900.h index 1be5e10f679..67e6fd034c1 100644 --- a/src/devices/cpu/tms9900/tms9900.h +++ b/src/devices/cpu/tms9900/tms9900.h @@ -71,12 +71,10 @@ protected: virtual void device_stop() override; virtual void device_reset() override; - virtual void resolve_lines(); - // device_execute_interface overrides - virtual uint32_t execute_min_cycles() const noexcept override; - virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; + virtual uint32_t execute_min_cycles() const noexcept override; + virtual uint32_t execute_max_cycles() const noexcept override; + virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; @@ -86,9 +84,9 @@ protected: virtual space_config_vector memory_space_config() const override; // Let these methods be overloaded by the TMS9980. - virtual void mem_read(void); - virtual void mem_write(void); - virtual void acquire_instruction(void); + virtual void mem_read(); + virtual void mem_write(); + virtual void acquire_instruction(); void decode(uint16_t inst); const address_space_config m_program_config; @@ -234,7 +232,7 @@ private: typedef const uint8_t* microprogram; // Method pointer - typedef void (tms99xx_device::*ophandler)(void); + typedef void (tms99xx_device::*ophandler)(); // Opcode list entry struct tms_instruction @@ -262,54 +260,54 @@ private: static const tms99xx_device::tms_instruction s_command[]; // Micro-operation declarations - void register_read(void); - void register_write(void); - void cru_input_operation(void); - void cru_output_operation(void); - void data_derivation_subprogram(void); - void return_from_subprogram(void); - void command_completed(void); - - void alu_nop(void); - void alu_clear(void); - void alu_source(void); - void alu_setaddr(void); - void alu_addone(void); - void alu_setaddr_addone(void); - void alu_pcaddr_advance(void); - void alu_add_register(void); - - void alu_imm(void); - void alu_reg(void); - - void alu_f1(void); - void alu_comp(void); - void alu_f3(void); - void alu_multiply(void); - void alu_divide(void); - void alu_xop(void); - void alu_clr_swpb(void); - void alu_abs(void); - void alu_x(void); - void alu_b(void); - void alu_blwp(void); - void alu_ldcr(void); - void alu_stcr(void); - void alu_sbz_sbo(void); - void alu_tb(void); - void alu_jmp(void); - void alu_shift(void); - void alu_ai_ori(void); - void alu_ci(void); - void alu_li(void); - void alu_lwpi(void); - void alu_limi(void); - void alu_stwp_stst(void); - void alu_external(void); - void alu_rtwp(void); - void alu_int(void); - - void abort_operation(void); + void register_read(); + void register_write(); + void cru_input_operation(); + void cru_output_operation(); + void data_derivation_subprogram(); + void return_from_subprogram(); + void command_completed(); + + void alu_nop(); + void alu_clear(); + void alu_source(); + void alu_setaddr(); + void alu_addone(); + void alu_setaddr_addone(); + void alu_pcaddr_advance(); + void alu_add_register(); + + void alu_imm(); + void alu_reg(); + + void alu_f1(); + void alu_comp(); + void alu_f3(); + void alu_multiply(); + void alu_divide(); + void alu_xop(); + void alu_clr_swpb(); + void alu_abs(); + void alu_x(); + void alu_b(); + void alu_blwp(); + void alu_ldcr(); + void alu_stcr(); + void alu_sbz_sbo(); + void alu_tb(); + void alu_jmp(); + void alu_shift(); + void alu_ai_ori(); + void alu_ci(); + void alu_li(); + void alu_lwpi(); + void alu_limi(); + void alu_stwp_stst(); + void alu_external(); + void alu_rtwp(); + void alu_int(); + + void abort_operation(); // Micro-operation program counter (as opposed to the program counter PC) int MPC; diff --git a/src/devices/cpu/tms9900/tms9980a.cpp b/src/devices/cpu/tms9900/tms9980a.cpp index 41341d6586e..a57bb4d3639 100644 --- a/src/devices/cpu/tms9900/tms9980a.cpp +++ b/src/devices/cpu/tms9900/tms9980a.cpp @@ -95,17 +95,6 @@ tms9981_device::tms9981_device(const machine_config &mconfig, const char *tag, d { } -/* - External connections -*/ -void tms9980a_device::resolve_lines() -{ - // Resolve our external connections - m_external_operation.resolve(); - m_clock_out_line.resolve(); - m_holda_line.resolve(); -} - uint16_t tms9980a_device::read_workspace_register_debug(int reg) { int temp = m_icount; diff --git a/src/devices/cpu/tms9900/tms9980a.h b/src/devices/cpu/tms9900/tms9980a.h index 9210007a5ec..c93212e6a4c 100644 --- a/src/devices/cpu/tms9900/tms9980a.h +++ b/src/devices/cpu/tms9900/tms9980a.h @@ -35,14 +35,12 @@ protected: void mem_write(void) override; void acquire_instruction(void) override; - void resolve_lines() override; - - uint16_t read_workspace_register_debug(int reg) override; + uint16_t read_workspace_register_debug(int reg) override; void write_workspace_register_debug(int reg, uint16_t data) override; - uint32_t execute_min_cycles() const noexcept override; - uint32_t execute_max_cycles() const noexcept override; - uint32_t execute_input_lines() const noexcept override; + uint32_t execute_min_cycles() const noexcept override; + uint32_t execute_max_cycles() const noexcept override; + uint32_t execute_input_lines() const noexcept override; void execute_set_input(int irqline, int state) override; // The clock is internally divided by 4 diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp index 82c6f6c27ad..905357dc597 100644 --- a/src/devices/cpu/tms9900/tms9995.cpp +++ b/src/devices/cpu/tms9900/tms9995.cpp @@ -198,11 +198,6 @@ void tms9995_device::device_start() m_setaddr = has_space(AS_SETADDRESS) ? &space(AS_SETADDRESS) : nullptr; m_cru = &space(AS_IO); - // Resolve our external connections - m_external_operation.resolve(); - m_clock_out_line.resolve(); - m_holda_line.resolve(); - // set our instruction counter set_icountptr(m_icount); @@ -1362,9 +1357,9 @@ void tms9995_device::pulse_clock(int count) { for (int i=0; i < count; i++) { - if (!m_clock_out_line.isnull()) m_clock_out_line(ASSERT_LINE); + if (!m_clock_out_line.isunset()) m_clock_out_line(ASSERT_LINE); m_ready = m_ready_bufd && !m_request_auto_wait_state; // get the latched READY state - if (!m_clock_out_line.isnull()) m_clock_out_line(CLEAR_LINE); + if (!m_clock_out_line.isunset()) m_clock_out_line(CLEAR_LINE); m_icount--; // This is the only location where we count down the cycles. if (m_check_ready) @@ -1392,7 +1387,7 @@ void tms9995_device::hold_line(int state) LOGMASKED(LOG_HOLD, "set HOLD = %d\n", state); if (!m_hold_requested) { - if (!m_holda_line.isnull()) m_holda_line(CLEAR_LINE); + if (!m_holda_line.isunset()) m_holda_line(CLEAR_LINE); } } @@ -1436,7 +1431,7 @@ void tms9995_device::abort_operation() void tms9995_device::set_hold_state(bool state) { if (m_hold_state != state) - if (!m_holda_line.isnull()) m_holda_line(state? ASSERT_LINE : CLEAR_LINE); + if (!m_holda_line.isunset()) m_holda_line(state? ASSERT_LINE : CLEAR_LINE); m_hold_state = state; } @@ -2745,7 +2740,7 @@ void tms9995_device::alu_external() LOGMASKED(LOG_OP, "RSET, new ST = %04x\n", ST); } - if (!m_external_operation.isnull()) + if (!m_external_operation.isunset()) m_external_operation((IR >> 5) & 0x07, 1, 0xff); } diff --git a/src/devices/cpu/tms9900/tms9995.h b/src/devices/cpu/tms9900/tms9995.h index e744aed93c1..13f16ffafff 100644 --- a/src/devices/cpu/tms9900/tms9995.h +++ b/src/devices/cpu/tms9900/tms9995.h @@ -66,9 +66,9 @@ protected: virtual void device_start() override; // device_execute_interface overrides - virtual uint32_t execute_min_cycles() const noexcept override; - virtual uint32_t execute_max_cycles() const noexcept override; - virtual uint32_t execute_input_lines() const noexcept override; + virtual uint32_t execute_min_cycles() const noexcept override; + virtual uint32_t execute_max_cycles() const noexcept override; + virtual uint32_t execute_input_lines() const noexcept override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; diff --git a/src/devices/cpu/tx0/tx0.cpp b/src/devices/cpu/tx0/tx0.cpp index 1157bb516d6..c2d18c6c6b0 100644 --- a/src/devices/cpu/tx0/tx0.cpp +++ b/src/devices/cpu/tx0/tx0.cpp @@ -152,18 +152,6 @@ void tx0_device::device_start() m_ioh = 0; m_ios = 0; - // Resolve callbacks - m_cpy_handler.resolve(); - m_r1l_handler.resolve(); - m_dis_handler.resolve(); - m_r3l_handler.resolve(); - m_prt_handler.resolve(); - m_rsv_handler.resolve(); - m_p6h_handler.resolve(); - m_p7h_handler.resolve(); - m_sel_handler.resolve(); - m_io_reset_callback.resolve(); - m_program = &space(AS_PROGRAM); save_item(NAME(m_mbr)); diff --git a/src/devices/cpu/ucom4/ucom4.cpp b/src/devices/cpu/ucom4/ucom4.cpp index 4c2a43427c4..d9245939cec 100644 --- a/src/devices/cpu/ucom4/ucom4.cpp +++ b/src/devices/cpu/ucom4/ucom4.cpp @@ -72,10 +72,10 @@ ucom4_cpu_device::ucom4_cpu_device(const machine_config &mconfig, device_type ty , m_datawidth(datawidth) , m_family(family) , m_stack_levels(stack_levels) - , m_read_a(*this) - , m_read_b(*this) - , m_read_c(*this) - , m_read_d(*this) + , m_read_a(*this, 0) + , m_read_b(*this, 0) + , m_read_c(*this, 0) + , m_read_d(*this, 0) , m_write_c(*this) , m_write_d(*this) , m_write_e(*this) @@ -162,20 +162,6 @@ void ucom4_cpu_device::device_start() m_timer = timer_alloc(FUNC(ucom4_cpu_device::simple_timer_cb), this); - // resolve callbacks - m_read_a.resolve_safe(0); - m_read_b.resolve_safe(0); - m_read_c.resolve_safe(0); - m_read_d.resolve_safe(0); - - m_write_c.resolve_safe(); - m_write_d.resolve_safe(); - m_write_e.resolve_safe(); - m_write_f.resolve_safe(); - m_write_g.resolve_safe(); - m_write_h.resolve_safe(); - m_write_i.resolve_safe(); - // zerofill memset(m_stack, 0, sizeof(m_stack)); memset(m_port_out, 0, sizeof(m_port_out)); diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp index 31cf876eb8b..45f685c1370 100644 --- a/src/devices/cpu/upd7725/upd7725.cpp +++ b/src/devices/cpu/upd7725/upd7725.cpp @@ -30,12 +30,12 @@ necdsp_device::necdsp_device(const machine_config &mconfig, device_type type, co m_data_config("data", ENDIANNESS_BIG, 16, dbits, -1), m_icount(0), // -1 for WORD-addressable m_irq(0), m_irq_firing(0), - m_in_int_cb(*this), - //m_in_si_cb(*this), - //m_in_sck_cb(*this), - //m_in_sien_cb(*this), - //m_in_soen_cb(*this), - //m_in_dack_cb(*this), + m_in_int_cb(*this, 0), + //m_in_si_cb(*this, 0), + //m_in_sck_cb(*this, 0), + //m_in_sien_cb(*this, 0), + //m_in_soen_cb(*this, 0), + //m_in_dack_cb(*this, 0), m_out_p0_cb(*this), m_out_p1_cb(*this) //m_out_so_cb(*this), @@ -86,19 +86,6 @@ void necdsp_device::device_start() state_add(UPD7725_SO, "SO", regs.so); state_add(UPD7725_IDB, "IDB", regs.idb); - // resolve callbacks - m_in_int_cb.resolve_safe(0); - //m_in_si_cb.resolve_safe(0); - //m_in_sck_cb.resolve_safe(0); - //m_in_sien_cb.resolve_safe(0); - //m_in_soen_cb.resolve_safe(0); - //m_in_dack_cb.resolve_safe(0); - m_out_p0_cb.resolve_safe(); - m_out_p1_cb.resolve_safe(); - //m_out_so_cb.resolve_safe(); - //m_out_sorq_cb.resolve_safe(); - //m_out_drq_cb.resolve_safe(); - // save state registrations save_item(NAME(regs.pc)); save_item(NAME(regs.rp)); diff --git a/src/devices/cpu/upd7810/upd7810.cpp b/src/devices/cpu/upd7810/upd7810.cpp index 09526b7fd85..fd43adb2294 100644 --- a/src/devices/cpu/upd7810/upd7810.cpp +++ b/src/devices/cpu/upd7810/upd7810.cpp @@ -410,19 +410,19 @@ upd7810_device::upd7810_device(const machine_config &mconfig, device_type type, , m_co0_func(*this) , m_co1_func(*this) , m_txd_func(*this) - , m_rxd_func(*this) - , m_an_func(*this) - , m_pa_in_cb(*this) - , m_pb_in_cb(*this) - , m_pc_in_cb(*this) - , m_pd_in_cb(*this) - , m_pf_in_cb(*this) + , m_rxd_func(*this, 1) + , m_an_func(*this, 0) + , m_pa_in_cb(*this, 0xff) + , m_pb_in_cb(*this, 0xff) + , m_pc_in_cb(*this, 0xff) + , m_pd_in_cb(*this, 0xff) + , m_pf_in_cb(*this, 0xff) , m_pa_out_cb(*this) , m_pb_out_cb(*this) , m_pc_out_cb(*this) , m_pd_out_cb(*this) , m_pf_out_cb(*this) - , m_pt_in_cb(*this) + , m_pt_in_cb(*this, 0) // TODO: uPD7807 only , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map) , m_pa_pullups(0xff) , m_pb_pullups(0xff) @@ -598,17 +598,17 @@ uint8_t upd7810_device::RP(offs_t port) switch (port) { case UPD7810_PORTA: - if (m_ma && !m_pa_in_cb.isnull()) // NS20031301 no need to read if the port is set as output + if (m_ma && !m_pa_in_cb.isunset()) // NS20031301 no need to read if the port is set as output m_pa_in = m_pa_in_cb(0, m_ma); data = (m_pa_in & m_ma) | (m_pa_out & ~m_ma); break; case UPD7810_PORTB: - if (m_mb && !m_pb_in_cb.isnull()) // NS20031301 no need to read if the port is set as output + if (m_mb && !m_pb_in_cb.isunset()) // NS20031301 no need to read if the port is set as output m_pb_in = m_pb_in_cb(0, m_mb); data = (m_pb_in & m_mb) | (m_pb_out & ~m_mb); break; case UPD7810_PORTC: - if (m_mc && !m_pc_in_cb.isnull()) // NS20031301 no need to read if the port is set as output + if (m_mc && !m_pc_in_cb.isunset()) // NS20031301 no need to read if the port is set as output m_pc_in = m_pc_in_cb(0, m_mc); data = (m_pc_in & m_mc) | (m_pc_out & ~m_mc); if (m_mcc & 0x01) /* PC0 = TxD output */ @@ -629,7 +629,7 @@ uint8_t upd7810_device::RP(offs_t port) data = (data & ~0x80) | (m_co1 & 1 ? 0x80 : 0x00); break; case UPD7810_PORTD: - if (!m_pd_in_cb.isnull()) + if (!m_pd_in_cb.isunset()) m_pd_in = m_pd_in_cb(); switch (m_mm & 0x07) { @@ -645,7 +645,7 @@ uint8_t upd7810_device::RP(offs_t port) } break; case UPD7810_PORTF: - if (m_mf && !m_pf_in_cb.isnull()) + if (m_mf && !m_pf_in_cb.isunset()) m_pf_in = m_pf_in_cb(0, m_mf); switch (m_mm & 0x06) { @@ -1600,27 +1600,6 @@ void upd7810_device::base_device_start() space(AS_PROGRAM).specific(m_program); space(AS_PROGRAM).cache(m_opcodes); - m_to_func.resolve_safe(); - m_co0_func.resolve_safe(); - m_co1_func.resolve_safe(); - m_txd_func.resolve_safe(); - m_rxd_func.resolve_safe(1); - m_an_func.resolve_all_safe(0); - - m_pa_in_cb.resolve(); - m_pb_in_cb.resolve(); - m_pc_in_cb.resolve(); - m_pd_in_cb.resolve(); - m_pf_in_cb.resolve(); - - m_pa_out_cb.resolve_safe(); - m_pb_out_cb.resolve_safe(); - m_pc_out_cb.resolve_safe(); - m_pd_out_cb.resolve_safe(); - m_pf_out_cb.resolve_safe(); - - m_pt_in_cb.resolve_safe(0); // TODO: uPD7807 only - configure_ops(); save_item(NAME(m_ppc.w.l)); diff --git a/src/devices/cpu/v30mz/v30mz.cpp b/src/devices/cpu/v30mz/v30mz.cpp index 3a755bc6706..cbdcf4aff47 100644 --- a/src/devices/cpu/v30mz/v30mz.cpp +++ b/src/devices/cpu/v30mz/v30mz.cpp @@ -83,7 +83,7 @@ v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *ta , m_TF(0) , m_int_vector(0) , m_pc(0) - , m_vector_func(*this) + , m_vector_func(*this, 0) { static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; @@ -129,8 +129,6 @@ void v30mz_cpu_device::device_start() space(AS_PROGRAM).specific(m_program); space(AS_IO).specific(m_io); - m_vector_func.resolve_safe(0); - save_item(NAME(m_regs.w)); save_item(NAME(m_sregs)); save_item(NAME(m_ip)); diff --git a/src/devices/cpu/vt50/vt50.cpp b/src/devices/cpu/vt50/vt50.cpp index 7a964c4be5b..a81e94b05d9 100644 --- a/src/devices/cpu/vt50/vt50.cpp +++ b/src/devices/cpu/vt50/vt50.cpp @@ -77,19 +77,19 @@ vt5x_cpu_device::vt5x_cpu_device(const machine_config &mconfig, device_type type , m_ram_config("data", ENDIANNESS_LITTLE, 8, 6 + ybits, 0) // actually 7 bits wide , m_baud_9600_callback(*this) , m_vert_count_callback(*this) - , m_uart_rd_callback(*this) + , m_uart_rd_callback(*this, 0) , m_uart_xd_callback(*this) - , m_ur_flag_callback(*this) - , m_ut_flag_callback(*this) + , m_ur_flag_callback(*this, 0) + , m_ut_flag_callback(*this, 0) , m_ruf_callback(*this) - , m_key_up_callback(*this) - , m_kclk_callback(*this) - , m_frq_callback(*this) + , m_key_up_callback(*this, 1) + , m_kclk_callback(*this, 1) + , m_frq_callback(*this, 1) , m_bell_callback(*this) , m_cen_callback(*this) - , m_csf_callback(*this) - , m_ccf_callback(*this) - , m_char_data_callback(*this) + , m_csf_callback(*this, 1) + , m_ccf_callback(*this, 1) + , m_char_data_callback(*this, 0177) , m_bbits(bbits) , m_ybits(ybits) , m_pc(0) @@ -163,33 +163,6 @@ void vt5x_cpu_device::device_config_complete() screen().set_raw(clock(), 900, 128, 848, 256, 4, 244); // 60 Hz default parameters } -void vt5x_cpu_device::device_resolve_objects() -{ - // resolve callbacks - m_baud_9600_callback.resolve_safe(); - m_vert_count_callback.resolve_safe(); - m_uart_rd_callback.resolve_safe(0); - m_uart_xd_callback.resolve_safe(); - m_ur_flag_callback.resolve_safe(0); - m_ut_flag_callback.resolve_safe(0); - m_ruf_callback.resolve_safe(); - m_key_up_callback.resolve_safe(1); - m_kclk_callback.resolve_safe(1); - m_frq_callback.resolve_safe(1); - m_bell_callback.resolve_safe(); - m_cen_callback.resolve_safe(); - m_csf_callback.resolve_safe(1); - m_ccf_callback.resolve_safe(1); - m_char_data_callback.resolve_safe(0177); -} - -void vt52_cpu_device::device_resolve_objects() -{ - vt5x_cpu_device::device_resolve_objects(); - - m_graphic_callback.resolve_safe(); -} - void vt5x_cpu_device::device_start() { // acquire address spaces diff --git a/src/devices/cpu/vt50/vt50.h b/src/devices/cpu/vt50/vt50.h index e9d0b39b1bc..fcb7fc1d91c 100644 --- a/src/devices/cpu/vt50/vt50.h +++ b/src/devices/cpu/vt50/vt50.h @@ -40,19 +40,18 @@ protected: // construction/destruction vt5x_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int bbits, int ybits); - // device-level overrides + // device_t implementation virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; - // device_execute_interface overrides + // device_execute_interface implementation virtual void execute_run() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // video helpers @@ -154,10 +153,7 @@ public: auto graphic_callback() { return m_graphic_callback.bind(); } protected: - // device-level overrides - virtual void device_resolve_objects() override; - - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; virtual void execute_tw(u8 inst) override; diff --git a/src/devices/cpu/z180/hd647180x.cpp b/src/devices/cpu/z180/hd647180x.cpp index 8643be896b6..85d7c0629c2 100644 --- a/src/devices/cpu/z180/hd647180x.cpp +++ b/src/devices/cpu/z180/hd647180x.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(HD647180X, hd647180x_device, "hd647180x", "Hitachi HD647180X hd647180x_device::hd647180x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z180_device(mconfig, HD647180X, tag, owner, clock, true, address_map_constructor(FUNC(hd647180x_device::internal_map), this)) - , m_port_input_cb(*this) + , m_port_input_cb(*this, 0xff) , m_port_output_cb(*this) , m_ram_view(*this, "ram_view") { @@ -248,14 +248,6 @@ void hd647180x_device::z180_internal_port_write(uint8_t port, uint8_t data) } } -void hd647180x_device::device_resolve_objects() -{ - z180_device::device_resolve_objects(); - - m_port_input_cb.resolve_all_safe(0xff); - m_port_output_cb.resolve_all_safe(); -} - void hd647180x_device::device_start() { z180_device::device_start(); diff --git a/src/devices/cpu/z180/hd647180x.h b/src/devices/cpu/z180/hd647180x.h index 22d4212b4af..ca122201a5e 100644 --- a/src/devices/cpu/z180/hd647180x.h +++ b/src/devices/cpu/z180/hd647180x.h @@ -42,8 +42,7 @@ public: auto out_pf_callback() { return m_port_output_cb[5].bind(); } 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/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 3b047bbfbdc..3097427bd69 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -167,12 +167,6 @@ z80182_device::z80182_device(const machine_config &mconfig, const char *tag, dev { } -void z180_device::device_resolve_objects() -{ - m_tend0_cb.resolve_safe(); - m_tend1_cb.resolve_safe(); -} - #define CF 0x01 #define NF 0x02 #define PF 0x04 diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h index 1ce1ee61f57..69b1b979d69 100644 --- a/src/devices/cpu/z180/z180.h +++ b/src/devices/cpu/z180/z180.h @@ -134,13 +134,12 @@ protected: // construction/destruction z180_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool extended_io, address_map_constructor internal_map); - // device-level overrides + // device_t implementation 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; - // device_execute_interface overrides + // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 16; } virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } @@ -152,16 +151,16 @@ protected: virtual void execute_burn(int32_t cycles) override; virtual void execute_set_input(int inputnum, int state) override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; virtual bool memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_import(const device_state_entry &entry) override; virtual void state_export(const device_state_entry &entry) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; virtual uint8_t z180_internal_port_read(uint8_t port); @@ -1834,13 +1833,13 @@ public: protected: z8s180_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_clock_changed() override; virtual void device_add_mconfig(machine_config &config) override; - // device_execute_interface overrides + // device_execute_interface implementation virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return BIT(m_cmr, 7) ? (clocks * 2) : BIT(m_ccr, 7) ? clocks : (clocks + 2 - 1) / 2; } virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return BIT(m_cmr, 7) ? (cycles + 2 - 1) / 2 : BIT(m_ccr, 7) ? cycles : (cycles * 2); } diff --git a/src/devices/cpu/z180/z180asci.cpp b/src/devices/cpu/z180/z180asci.cpp index e49e2d0db93..d7ce1ce9ba1 100644 --- a/src/devices/cpu/z180/z180asci.cpp +++ b/src/devices/cpu/z180/z180asci.cpp @@ -85,14 +85,6 @@ z180asci_channel_base::z180asci_channel_base(const machine_config &mconfig, devi } -void z180asci_channel_base::device_resolve_objects() -{ - // resolve callbacks - m_txa_handler.resolve_safe(); - m_rts_handler.resolve_safe(); - m_cka_handler.resolve_safe(); -} - void z180asci_channel_base::device_start() { save_item(NAME(m_asci_cntla)); diff --git a/src/devices/cpu/z180/z180asci.h b/src/devices/cpu/z180/z180asci.h index 525603e3c35..b99eec339ee 100644 --- a/src/devices/cpu/z180/z180asci.h +++ b/src/devices/cpu/z180/z180asci.h @@ -52,10 +52,9 @@ public: protected: z180asci_channel_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const int id, const bool ext); - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - virtual void device_resolve_objects() override; virtual void device_clock_changed() override; void transmit_edge(); @@ -143,7 +142,8 @@ public: void state_add(device_state_interface &parent) override; protected: z180asci_channel_0(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const bool ext); - // device-level overrides + + // device_t implementation virtual void device_reset() override; }; @@ -162,7 +162,8 @@ public: void state_add(device_state_interface &parent) override; protected: z180asci_channel_1(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const bool ext); - // device-level overrides + + // device_t implementation virtual void device_reset() override; }; diff --git a/src/devices/cpu/z180/z180csio.cpp b/src/devices/cpu/z180/z180csio.cpp index aca83507e86..21e9ae0b1e5 100644 --- a/src/devices/cpu/z180/z180csio.cpp +++ b/src/devices/cpu/z180/z180csio.cpp @@ -54,10 +54,6 @@ z180csio_device::z180csio_device(const machine_config &mconfig, const char *tag, void z180csio_device::device_resolve_objects() { - // resolve callbacks - m_cks_cb.resolve_safe(); - m_txs_cb.resolve_safe(); - // set default input line state m_cks_in = 1; m_rxs_in = 1; diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index 85993382d21..4f93091f802 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -180,7 +180,7 @@ z8_device::z8_device(const machine_config &mconfig, device_type type, const char , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, preprogrammed ? address_map_constructor(FUNC(z8_device::preprogrammed_map), this) : address_map_constructor(FUNC(z8_device::program_map), this)) , m_data_config("data", ENDIANNESS_BIG, 8, 16, 0) , m_register_config("register", ENDIANNESS_BIG, 8, 8, 0, address_map_constructor(FUNC(z8_device::register_map), this)) - , m_input_cb(*this) + , m_input_cb(*this, 0xff) , m_output_cb(*this) , m_rom_size(rom_size) , m_input{0xff, 0xff, 0xff, 0x0f} @@ -1209,9 +1209,6 @@ TIMER_CALLBACK_MEMBER(z8_device::timeout) void z8_device::device_start() { - m_input_cb.resolve_all_safe(0xff); - m_output_cb.resolve_all_safe(); - /* set up the state table */ { state_add(Z8_PC, "PC", m_pc).callimport(); diff --git a/src/devices/cpu/z80/kl5c80a12.cpp b/src/devices/cpu/z80/kl5c80a12.cpp index 495a0ab4afd..702facf2ad2 100644 --- a/src/devices/cpu/z80/kl5c80a12.cpp +++ b/src/devices/cpu/z80/kl5c80a12.cpp @@ -40,9 +40,9 @@ kl5c80a12_device::kl5c80a12_device(const machine_config &mconfig, const char *ta address_map_constructor(FUNC(kl5c80a12_device::internal_ram), this), address_map_constructor(FUNC(kl5c80a12_device::internal_io), this)) , m_kp69(*this, "kp69") - , m_porta_in_callback(*this) + , m_porta_in_callback(*this, 0) , m_porta_out_callback(*this) - , m_portb_in_callback(*this) + , m_portb_in_callback(*this, 0) , m_portb_out_callback(*this) , m_porta_data{0, 0} , m_porta_direction{0, 0} @@ -87,24 +87,6 @@ void kl5c80a12_device::internal_io(address_map &map) //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void kl5c80a12_device::device_resolve_objects() -{ - // Resolve parallel port callbacks - for (int i = 0; i < 2; i++) - m_porta_in_callback[i].resolve_safe(m_porta_3state[i]); - m_porta_out_callback.resolve_all_safe(); - for (int i = 0; i < 3; i++) - m_portb_in_callback[i].resolve_safe(m_portb_3state[i]); - m_portb_out_callback.resolve_all_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -175,7 +157,20 @@ void kl5c80a12_device::device_add_mconfig(machine_config &config) void kl5c80a12_device::device_config_complete() { + kc82_device::device_config_complete(); + set_daisy_config(pseudo_daisy_config); + + for (int i = 0; i < 2; i++) + { + if (m_porta_in_callback[i].isunset()) + m_porta_in_callback[i].bind().set_constant(m_porta_3state[i]); + } + for (int i = 0; i < 3; i++) + { + if (m_portb_in_callback[i].isunset()) + m_portb_in_callback[i].bind().set_constant(m_portb_3state[i]); + } } diff --git a/src/devices/cpu/z80/kl5c80a12.h b/src/devices/cpu/z80/kl5c80a12.h index 28434f8c8f6..2d3884ad409 100644 --- a/src/devices/cpu/z80/kl5c80a12.h +++ b/src/devices/cpu/z80/kl5c80a12.h @@ -50,14 +50,13 @@ public: void set_p4_3state(u8 value) { m_portb_3state[2] = value; } protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual void device_config_complete() override; - virtual void device_resolve_objects() override; 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/cpu/z80/kl5c80a16.cpp b/src/devices/cpu/z80/kl5c80a16.cpp index d92cc9142de..5efe26a0d9b 100644 --- a/src/devices/cpu/z80/kl5c80a16.cpp +++ b/src/devices/cpu/z80/kl5c80a16.cpp @@ -35,7 +35,7 @@ kl5c80a16_device::kl5c80a16_device(const machine_config &mconfig, const char *ta address_map_constructor(), address_map_constructor(FUNC(kl5c80a16_device::internal_io), this)) , m_kp69(*this, "kp69") - , m_port_in_callback(*this) + , m_port_in_callback(*this, 0) , m_port_out_callback(*this) , m_port_data{0, 0, 0, 0} , m_port_direction{0x0f, 0, 0, 0} @@ -61,21 +61,6 @@ void kl5c80a16_device::internal_io(address_map &map) //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void kl5c80a16_device::device_resolve_objects() -{ - // Resolve parallel port callbacks - for (int i = 0; i < 4; i++) - m_port_in_callback[i].resolve_safe(m_port_3state[i]); - m_port_out_callback.resolve_all_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -135,7 +120,15 @@ void kl5c80a16_device::device_add_mconfig(machine_config &config) void kl5c80a16_device::device_config_complete() { + kc82_device::device_config_complete(); + set_daisy_config(pseudo_daisy_config); + + for (int i = 0; i < 4; i++) + { + if (m_port_in_callback[i].isunset()) + m_port_in_callback[i].bind().set_constant(m_port_3state[i]); + } } diff --git a/src/devices/cpu/z80/kl5c80a16.h b/src/devices/cpu/z80/kl5c80a16.h index d3ac8eda636..a7cd2178396 100644 --- a/src/devices/cpu/z80/kl5c80a16.h +++ b/src/devices/cpu/z80/kl5c80a16.h @@ -47,14 +47,13 @@ public: void set_p3_3state(u8 value) { m_port_3state[3] = value; } protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual void device_config_complete() override; - virtual void device_resolve_objects() override; 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/cpu/z80/kp63.cpp b/src/devices/cpu/z80/kp63.cpp index db42ef30ecb..2d8d693d11f 100644 --- a/src/devices/cpu/z80/kp63.cpp +++ b/src/devices/cpu/z80/kp63.cpp @@ -99,20 +99,6 @@ kp63a_device::kp63a_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 kp63_device::device_resolve_objects() -{ - // Resolve output callbacks - m_out_pulse_callback.resolve_all_safe(); - m_out_strobe_callback.resolve_all_safe(); -} - - -//------------------------------------------------- // timer_expired - handle timed count underflow //------------------------------------------------- diff --git a/src/devices/cpu/z80/kp63.h b/src/devices/cpu/z80/kp63.h index 4d5a84c2349..93e2779d668 100644 --- a/src/devices/cpu/z80/kp63.h +++ b/src/devices/cpu/z80/kp63.h @@ -34,8 +34,7 @@ protected: // construction/destruction kp63_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 num_counters, u8 mode_mask); - // 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/cpu/z80/kp64.cpp b/src/devices/cpu/z80/kp64.cpp index 0a40c4bad5b..ec0b8fdfa87 100644 --- a/src/devices/cpu/z80/kp64.cpp +++ b/src/devices/cpu/z80/kp64.cpp @@ -89,19 +89,6 @@ kp64_device::kp64_device(const machine_config &mconfig, const char *tag, device_ //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void kp64_device::device_resolve_objects() -{ - // Resolve output callback - m_out_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/cpu/z80/kp64.h b/src/devices/cpu/z80/kp64.h index 0bb09f8316a..d8a76dc91b6 100644 --- a/src/devices/cpu/z80/kp64.h +++ b/src/devices/cpu/z80/kp64.h @@ -36,8 +36,7 @@ public: void gate_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; diff --git a/src/devices/cpu/z80/kp69.cpp b/src/devices/cpu/z80/kp69.cpp index 0e194138b2c..3b1b59dcb20 100644 --- a/src/devices/cpu/z80/kp69.cpp +++ b/src/devices/cpu/z80/kp69.cpp @@ -64,19 +64,6 @@ kp69_device::kp69_device(const machine_config &mconfig, const char *tag, device_ //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void kp69_base_device::device_resolve_objects() -{ - // Resolve output callback - m_int_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/cpu/z80/kp69.h b/src/devices/cpu/z80/kp69.h index 285fc610119..31bfbd71fea 100644 --- a/src/devices/cpu/z80/kp69.h +++ b/src/devices/cpu/z80/kp69.h @@ -43,12 +43,11 @@ protected: // construction/destruction kp69_base_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_reset() 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/cpu/z80/tmpz84c011.cpp b/src/devices/cpu/z80/tmpz84c011.cpp index c28aa2b243a..e7925ac74d5 100644 --- a/src/devices/cpu/z80/tmpz84c011.cpp +++ b/src/devices/cpu/z80/tmpz84c011.cpp @@ -41,11 +41,11 @@ tmpz84c011_device::tmpz84c011_device(const machine_config &mconfig, const char * m_outportsc(*this), m_outportsd(*this), m_outportse(*this), - m_inportsa(*this), - m_inportsb(*this), - m_inportsc(*this), - m_inportsd(*this), - m_inportse(*this), + m_inportsa(*this, 0), + m_inportsb(*this, 0), + m_inportsc(*this, 0), + m_inportsd(*this, 0), + m_inportse(*this, 0), m_zc0_cb(*this), m_zc1_cb(*this), m_zc2_cb(*this) @@ -69,23 +69,6 @@ void tmpz84c011_device::device_start() { z80_device::device_start(); - // resolve callbacks - m_outportsa.resolve_safe(); - m_outportsb.resolve_safe(); - m_outportsc.resolve_safe(); - m_outportsd.resolve_safe(); - m_outportse.resolve_safe(); - - m_inportsa.resolve_safe(0); - m_inportsb.resolve_safe(0); - m_inportsc.resolve_safe(0); - m_inportsd.resolve_safe(0); - m_inportse.resolve_safe(0); - - m_zc0_cb.resolve_safe(); - m_zc1_cb.resolve_safe(); - m_zc2_cb.resolve_safe(); - // register for save states save_item(NAME(m_pio_dir[0])); save_item(NAME(m_pio_latch[0])); diff --git a/src/devices/cpu/z80/tmpz84c015.cpp b/src/devices/cpu/z80/tmpz84c015.cpp index 55d21908b77..765ec6af6c9 100644 --- a/src/devices/cpu/z80/tmpz84c015.cpp +++ b/src/devices/cpu/z80/tmpz84c015.cpp @@ -61,11 +61,11 @@ tmpz84c015_device::tmpz84c015_device(const machine_config &mconfig, device_type m_zc_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), @@ -89,36 +89,6 @@ void tmpz84c015_device::device_start() { z80_device::device_start(); - // resolve callbacks - m_out_txda_cb.resolve_safe(); - m_out_dtra_cb.resolve_safe(); - m_out_rtsa_cb.resolve_safe(); - m_out_wrdya_cb.resolve_safe(); - m_out_synca_cb.resolve_safe(); - - m_out_txdb_cb.resolve_safe(); - m_out_dtrb_cb.resolve_safe(); - m_out_rtsb_cb.resolve_safe(); - m_out_wrdyb_cb.resolve_safe(); - m_out_syncb_cb.resolve_safe(); - - m_out_rxdrqa_cb.resolve_safe(); - m_out_txdrqa_cb.resolve_safe(); - m_out_rxdrqb_cb.resolve_safe(); - m_out_txdrqb_cb.resolve_safe(); - - m_zc_cb.resolve_all_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(); - - m_wdtout_cb.resolve(); - // setup watchdog timer m_watchdog_timer = timer_alloc(FUNC(tmpz84c015_device::watchdog_timeout), this); @@ -238,8 +208,7 @@ void tmpz84c015_device::wdtcr_w(uint8_t data) void tmpz84c015_device::watchdog_clear() { - if (!m_wdtout_cb.isnull()) - m_wdtout_cb(CLEAR_LINE); + m_wdtout_cb(CLEAR_LINE); if (BIT(m_wdtmr, 7)) m_watchdog_timer->adjust(cycles_to_attotime(0x10000 << (BIT(m_wdtmr, 5, 2) * 2))); @@ -247,10 +216,8 @@ void tmpz84c015_device::watchdog_clear() TIMER_CALLBACK_MEMBER(tmpz84c015_device::watchdog_timeout) { - if (!m_wdtout_cb.isnull()) - m_wdtout_cb(ASSERT_LINE); - else - logerror("Watchdog timeout\n"); + logerror("Watchdog timeout\n"); + m_wdtout_cb(ASSERT_LINE); } diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index ab8192e2115..24471736584 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -3591,16 +3591,12 @@ void z80_device::device_start() m_cc_xy = cc_xy; m_cc_xycb = cc_xycb; m_cc_ex = cc_ex; - - m_irqack_cb.resolve_safe(); - m_refresh_cb.resolve_safe(); - m_nomreq_cb.resolve_safe(); - m_halt_cb.resolve_safe(); } void nsc800_device::device_start() { z80_device::device_start(); + save_item(NAME(m_nsc800_irq_state)); } diff --git a/src/devices/cpu/z8000/z8000.cpp b/src/devices/cpu/z8000/z8000.cpp index 15439e8b307..8cfe08c72ec 100644 --- a/src/devices/cpu/z8000/z8000.cpp +++ b/src/devices/cpu/z8000/z8000.cpp @@ -37,7 +37,7 @@ z8002_device::z8002_device(const machine_config &mconfig, device_type type, cons , m_opcodes_config("first_word", ENDIANNESS_BIG, 16, addrbits, 0) , m_stack_config("stack", ENDIANNESS_BIG, 16, addrbits, 0) , m_sio_config("io_spc", ENDIANNESS_BIG, 16, 16, 0) - , m_iack_in(*this) + , m_iack_in(*this, 0xffff) , m_mo_out(*this) , m_ppc(0), m_pc(0), m_psapseg(0), m_psapoff(0), m_fcw(0), m_refresh(0), m_nspseg(0), m_nspoff(0), m_irq_req(0), m_irq_vec(0), m_op_valid(0), m_nmi_state(0), m_mi(0), m_halt(false), m_icount(0) , m_vector_mult(vecmult) @@ -610,8 +610,6 @@ void z8002_device::device_start() register_save_state(); set_icountptr(m_icount); - m_iack_in.resolve_all_safe(0xffff); - m_mo_out.resolve_safe(); m_mi = CLEAR_LINE; } diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp index 7c422790c14..104bc3ae284 100644 --- a/src/devices/imagedev/flopdrv.cpp +++ b/src/devices/imagedev/flopdrv.cpp @@ -671,7 +671,6 @@ void legacy_floppy_image_device::device_start() m_active = false; /* resolve callbacks */ - m_out_idx_func.resolve_safe(); //m_in_mon_func.resolve(m_config->in_mon_func, *this); //m_out_tk00_func.resolve(m_config->out_tk00_func, *this); //m_out_wpt_func.resolve(m_config->out_wpt_func, *this); diff --git a/src/devices/imagedev/microdrv.cpp b/src/devices/imagedev/microdrv.cpp index f85c2ea2421..2f8ae27ba9a 100644 --- a/src/devices/imagedev/microdrv.cpp +++ b/src/devices/imagedev/microdrv.cpp @@ -62,9 +62,6 @@ microdrive_image_device::~microdrive_image_device() void microdrive_image_device::device_start() { - // resolve callbacks - m_write_comms_out.resolve_safe(); - // allocate track buffers m_left = std::make_unique<uint8_t[]>(MDV_IMAGE_LENGTH / 2); m_right = std::make_unique<uint8_t[]>(MDV_IMAGE_LENGTH / 2); diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp index fe99c76866e..bc5499f0f0d 100644 --- a/src/devices/imagedev/midiin.cpp +++ b/src/devices/imagedev/midiin.cpp @@ -77,7 +77,6 @@ ioport_constructor midiin_device::device_input_ports() const void midiin_device::device_start() { - m_input_cb.resolve_safe(); m_timer = timer_alloc(FUNC(midiin_device::midi_update), this); m_midi.reset(); m_timer->enable(false); diff --git a/src/devices/imagedev/printer.cpp b/src/devices/imagedev/printer.cpp index cd73690d371..22e0a80a2a3 100644 --- a/src/devices/imagedev/printer.cpp +++ b/src/devices/imagedev/printer.cpp @@ -33,7 +33,6 @@ printer_image_device::printer_image_device(const machine_config &mconfig, const void printer_image_device::device_start() { - m_online_cb.resolve(); } /*************************************************************************** @@ -79,8 +78,7 @@ std::pair<std::error_condition, std::string> printer_image_device::call_create(i std::pair<std::error_condition, std::string> printer_image_device::call_load() { // send notify that the printer is now online - if (!m_online_cb.isnull()) - m_online_cb(true); + m_online_cb(true); // we don't need to do anything special return std::make_pair(std::error_condition(), std::string()); @@ -92,7 +90,6 @@ std::pair<std::error_condition, std::string> printer_image_device::call_load() -------------------------------------------------*/ void printer_image_device::call_unload() { - /* send notify that the printer is now offline */ - if (!m_online_cb.isnull()) - m_online_cb(false); + // send notify that the printer is now offline + m_online_cb(false); } 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,59 +45,35 @@ 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 @@ -65,17 +65,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::vector<std::string_vi machine().debugger().console().printf("0x%08lx (PPL %x)\n", 0x02000000 | ((m_pages[page] * pagesize) + poffs), m_pages_ppl[page]); } -void acorn_memc_device::device_resolve_objects() -{ - m_abort_w.resolve_safe(); - m_sirq_w.resolve_safe(); -} - void acorn_memc_device::device_start() { m_space = &space(); diff --git a/src/devices/machine/acorn_memc.h b/src/devices/machine/acorn_memc.h index fd9a306b4c3..7977527fd31 100644 --- a/src/devices/machine/acorn_memc.h +++ b/src/devices/machine/acorn_memc.h @@ -51,12 +51,11 @@ public: void vidrq_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_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; private: diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp index 6ba1f3ee9df..ae4021e412f 100644 --- a/src/devices/machine/acorn_vidc.cpp +++ b/src/devices/machine/acorn_vidc.cpp @@ -148,9 +148,6 @@ void acorn_vidc10_device::device_config_complete() void acorn_vidc10_device::device_start() { - m_vblank_cb.resolve_safe(); - m_sound_drq_cb.resolve_safe(); - for (int i = 0; i < entries(); i++) set_pen_color(i, rgb_t::black()); diff --git a/src/devices/machine/adc0804.cpp b/src/devices/machine/adc0804.cpp index 5d41988d2c3..5a3813b66b7 100644 --- a/src/devices/machine/adc0804.cpp +++ b/src/devices/machine/adc0804.cpp @@ -59,7 +59,7 @@ ALLOW_SAVE_TYPE(adc0804_device::read_mode); adc0804_device::adc0804_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) - , m_vin_callback(*this) + , m_vin_callback(*this, 0) , m_intr_callback(*this) , m_res(0.0) , m_cap(0.0) @@ -97,9 +97,6 @@ adc0803_device::adc0803_device(const machine_config &mconfig, const char *tag, d void adc0804_device::device_resolve_objects() { - m_vin_callback.resolve_safe(0); - m_intr_callback.resolve_safe(); - if (m_rd_mode == RD_GROUNDED) m_rd_active = true; } diff --git a/src/devices/machine/adc0808.cpp b/src/devices/machine/adc0808.cpp index 9df9e8052f0..101e84a7749 100644 --- a/src/devices/machine/adc0808.cpp +++ b/src/devices/machine/adc0808.cpp @@ -42,7 +42,7 @@ ALLOW_SAVE_TYPE(adc0808_device::state); adc0808_device::adc0808_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_eoc_cb(*this), m_eoc_ff_cb(*this), - m_in_cb(*this), + m_in_cb(*this, 0xff), m_state(STATE_IDLE), m_cycle_timer(nullptr), m_start(0), m_address(0), m_sar(0xff), m_eoc(1) @@ -78,11 +78,6 @@ m58990_device::m58990_device(const machine_config &mconfig, const char *tag, dev void adc0808_device::device_start() { - // resolve callbacks - m_eoc_cb.resolve_safe(); - m_eoc_ff_cb.resolve_safe(); - m_in_cb.resolve_all_safe(0xff); - // allocate timers m_cycle_timer = timer_alloc(FUNC(adc0808_device::update_state), this); m_cycle_timer->adjust(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 @@ -49,21 +49,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} @@ -50,23 +50,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 @@ -95,18 +95,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), @@ -145,25 +145,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<u8 []>(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) @@ -93,20 +93,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<typename T> void generic_fifo_device_base<T>::clear() template<typename T> void generic_fifo_device_base<T>::device_start() { - m_empty_cb.resolve_safe(); - m_full_cb.resolve_safe(); - m_sync_empty = timer_alloc(FUNC(generic_fifo_device_base<T>::sync_empty), this); m_sync_full = timer_alloc(FUNC(generic_fifo_device_base<T>::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" @@ -556,21 +557,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<uint8_t[]>(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 @@ -66,19 +66,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 @@ -85,24 +85,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 @@ -65,18 +65,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<Type[]>(RAM_SIZE); + m_ram = make_unique_clear<Type []>(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 <typename... T> void set_lcd_info_changed(T &&... args) { m_lcd_info_changed_cb.set(std::forward<T>(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 <int Line> 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,9 +84,9 @@ 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) @@ -94,22 +94,6 @@ mc6844_device::mc6844_device(const machine_config &mconfig, const char *tag, dev } //------------------------------------------------- -// 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 @@ -121,19 +121,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<u16, 16> &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<char>('0'+i), 0}; floppy_connector *conn = subdevice<floppy_connector>(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) @@ -71,21 +71,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 @@ -379,21 +379,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 @@ -59,20 +59,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,24 +29,12 @@ 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) { } @@ -109,23 +109,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 @@ -89,18 +89,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<uint8_t[]>(0x100000); m_samples = make_unique_clear<int16_t[]>(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(); @@ -74,20 +74,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 @@ -100,18 +100,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) @@ -261,27 +261,6 @@ scc68070_device::scc68070_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 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,43 +260,18 @@ 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<uint32_t[]>(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<RegType, OutType>::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 <typename RegType, typename OutType> 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) @@ -61,18 +61,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 @@ -136,20 +136,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 @@ -480,24 +480,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 //------------------------------------------------- void z80scc_device::device_start() 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 @@ -455,24 +455,6 @@ void z80sio_device::device_validity_check(validity_checker &valid) const } //------------------------------------------------- -// 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 //------------------------------------------------- void z80sio_device::device_start() 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)); diff --git a/src/devices/sound/315-5641.cpp b/src/devices/sound/315-5641.cpp index 7b5f06b0d8b..defb3cbb9ed 100644 --- a/src/devices/sound/315-5641.cpp +++ b/src/devices/sound/315-5641.cpp @@ -18,8 +18,6 @@ sega_315_5641_pcm_device::sega_315_5641_pcm_device(const machine_config &mconfig void sega_315_5641_pcm_device::device_start() { - m_fifocallback.resolve_safe(); - upd7759_device::device_start(); save_item(NAME(m_fifo_data), 0x40); diff --git a/src/devices/sound/ad1848.cpp b/src/devices/sound/ad1848.cpp index 7c62b4912ef..081b4172d47 100644 --- a/src/devices/sound/ad1848.cpp +++ b/src/devices/sound/ad1848.cpp @@ -33,8 +33,7 @@ void ad1848_device::device_add_mconfig(machine_config &config) void ad1848_device::device_start() { m_timer = timer_alloc(FUNC(ad1848_device::update_tick), this); - m_irq_cb.resolve_safe(); - m_drq_cb.resolve_safe(); + save_item(NAME(m_regs.idx)); save_item(NAME(m_addr)); save_item(NAME(m_stat)); diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index 9be26af8b8d..bb6cc9de495 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -662,7 +662,7 @@ void aica_device::UpdateReg(int reg) case 0x90: case 0x91: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { u32 time; @@ -681,7 +681,7 @@ void aica_device::UpdateReg(int reg) break; case 0x94: case 0x95: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { u32 time; @@ -700,7 +700,7 @@ void aica_device::UpdateReg(int reg) break; case 0x98: case 0x99: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { u32 time; @@ -727,7 +727,7 @@ void aica_device::UpdateReg(int reg) case 0xa4: //SCIRE case 0xa5: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_udata.data[0xa0 / 2] &= ~m_udata.data[0xa4 / 2]; ResetInterrupts(); @@ -754,7 +754,7 @@ void aica_device::UpdateReg(int reg) case 0xad: case 0xb0: case 0xb1: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_IrqTimA = DecodeSCI(SCITMA); m_IrqTimBC = DecodeSCI(SCITMB); @@ -1404,10 +1404,6 @@ void aica_device::device_start() // init the emulation Init(); - // set up the IRQ callbacks - m_irq_cb.resolve_safe(); - m_main_irq_cb.resolve_safe(); - m_stream = stream_alloc(2, 2, (int)m_rate); // save state diff --git a/src/devices/sound/asc.cpp b/src/devices/sound/asc.cpp index 2216b38f328..bc17e19571e 100644 --- a/src/devices/sound/asc.cpp +++ b/src/devices/sound/asc.cpp @@ -83,8 +83,6 @@ void asc_device::device_start() save_item(NAME(m_regs)); save_item(NAME(m_phase)); save_item(NAME(m_incr)); - - write_irq.resolve_safe(); } diff --git a/src/devices/sound/astrocde.cpp b/src/devices/sound/astrocde.cpp index 91d0fdc46b9..e29b6f31617 100644 --- a/src/devices/sound/astrocde.cpp +++ b/src/devices/sound/astrocde.cpp @@ -83,9 +83,9 @@ astrocade_io_device::astrocade_io_device(const machine_config &mconfig, const ch , m_b_state(0) , m_c_count(0) , m_c_state(0) - , m_si_callback(*this) + , m_si_callback(*this, 0) , m_so_callback(*this) - , m_pots(*this) + , m_pots(*this, 0) { memset(m_reg, 0, sizeof(uint8_t)*8); memset(m_bitswap, 0, sizeof(uint8_t)*256); @@ -93,20 +93,6 @@ astrocade_io_device::astrocade_io_device(const machine_config &mconfig, const ch //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void astrocade_io_device::device_resolve_objects() -{ - m_si_callback.resolve_safe(0); - m_so_callback.resolve_all_safe(); - m_pots.resolve_all_safe(0); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h index 387ef7f9ca3..bd62cf96e37 100644 --- a/src/devices/sound/astrocde.h +++ b/src/devices/sound/astrocde.h @@ -52,12 +52,11 @@ public: template <std::size_t Pot> auto pot_cb() { return m_pots[Pot].bind(); } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; - // sound stream update overrides + // device_sound_interface implementation virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; public: diff --git a/src/devices/sound/awacs.cpp b/src/devices/sound/awacs.cpp index 07ec04e4f14..236852c854b 100644 --- a/src/devices/sound/awacs.cpp +++ b/src/devices/sound/awacs.cpp @@ -32,9 +32,9 @@ awacs_device::awacs_device(const machine_config &mconfig, const char *tag, devic , device_sound_interface(mconfig, *this) , m_irq_out_cb(*this) , m_irq_in_cb(*this) - , m_output_cb(*this) + , m_output_cb(*this, 0) , m_input_cb(*this) - , m_input_port_cb(*this) + , m_input_port_cb(*this, 0) , m_output_port_cb(*this) , m_stream(nullptr) { @@ -51,15 +51,6 @@ void awacs_device::device_start() m_last_sample = attotime::zero; - m_irq_out_cb.resolve_safe(); - m_irq_in_cb.resolve_safe(); - - m_output_cb.resolve_safe(0); - m_input_cb.resolve_safe(); - - m_input_port_cb.resolve_safe(0); - m_output_port_cb.resolve_safe(); - save_item(NAME(m_extend)); save_item(NAME(m_ext_command)); save_item(NAME(m_ext_address)); diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index 7ba11e22e56..8d29e58537a 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -976,7 +976,7 @@ void ay8910_device::ay8910_write_reg(int r, int v) ((m_last_enable & 0x40) != (m_regs[AY_ENABLE] & 0x40))) { // write out 0xff if port set to input - if (!m_port_a_write_cb.isnull()) + if (!m_port_a_write_cb.isunset()) m_port_a_write_cb((offs_t)0, (m_regs[AY_ENABLE] & 0x40) ? m_regs[AY_PORTA] : 0xff); } @@ -984,7 +984,7 @@ void ay8910_device::ay8910_write_reg(int r, int v) ((m_last_enable & 0x80) != (m_regs[AY_ENABLE] & 0x80))) { // write out 0xff if port set to input - if (!m_port_b_write_cb.isnull()) + if (!m_port_b_write_cb.isunset()) m_port_b_write_cb((offs_t)0, (m_regs[AY_ENABLE] & 0x80) ? m_regs[AY_PORTB] : 0xff); } m_last_enable = m_regs[AY_ENABLE]; @@ -1013,7 +1013,7 @@ void ay8910_device::ay8910_write_reg(int r, int v) case AY_PORTA: if (m_regs[AY_ENABLE] & 0x40) { - if (!m_port_a_write_cb.isnull()) + if (!m_port_a_write_cb.isunset()) m_port_a_write_cb((offs_t)0, m_regs[AY_PORTA]); else LOGMASKED(LOG_WARNINGS, "%s: warning: unmapped write %02x to %s Port A\n", machine().describe_context(), v, name()); @@ -1026,7 +1026,7 @@ void ay8910_device::ay8910_write_reg(int r, int v) case AY_PORTB: if (m_regs[AY_ENABLE] & 0x80) { - if (!m_port_b_write_cb.isnull()) + if (!m_port_b_write_cb.isunset()) m_port_b_write_cb((offs_t)0, m_regs[AY_PORTB]); else LOGMASKED(LOG_WARNINGS, "%s: warning: unmapped write %02x to %s Port B\n", machine().describe_context(), v, name()); @@ -1304,17 +1304,12 @@ void ay8910_device::device_start() { const int master_clock = clock(); - if (m_ioports < 1 && !(m_port_a_read_cb.isnull() && m_port_a_write_cb.isnull())) + if (m_ioports < 1 && !(m_port_a_read_cb.isunset() && m_port_a_write_cb.isunset())) fatalerror("Device '%s' is a %s and has no port A!", tag(), name()); - if (m_ioports < 2 && !(m_port_b_read_cb.isnull() && m_port_b_write_cb.isnull())) + if (m_ioports < 2 && !(m_port_b_read_cb.isunset() && m_port_b_write_cb.isunset())) fatalerror("Device '%s' is a %s and has no port B!", tag(), name()); - m_port_a_read_cb.resolve(); - m_port_b_read_cb.resolve(); - m_port_a_write_cb.resolve(); - m_port_b_write_cb.resolve(); - if ((m_flags & AY8910_SINGLE_OUTPUT) != 0) { LOGMASKED(LOG_WARNINGS, "%s device using single output!\n", name()); @@ -1452,7 +1447,7 @@ u8 ay8910_device::ay8910_read_ym() We do need a callback for those two flags. Kid Niki (Irem m62) is one such case were it makes a difference in comparison to a standard TTL output. */ - if (!m_port_a_read_cb.isnull()) + if (!m_port_a_read_cb.isunset()) m_regs[AY_PORTA] = m_port_a_read_cb(0); else LOGMASKED(LOG_WARNINGS, "%s: warning - read 8910 Port A\n", machine().describe_context()); @@ -1460,7 +1455,7 @@ u8 ay8910_device::ay8910_read_ym() case AY_PORTB: if ((m_regs[AY_ENABLE] & 0x80) != 0) LOGMASKED(LOG_WARNINGS, "%s: warning - read from 8910 Port B set as output\n", machine().describe_context()); - if (!m_port_b_read_cb.isnull()) + if (!m_port_b_read_cb.isunset()) m_regs[AY_PORTB] = m_port_b_read_cb(0); else LOGMASKED(LOG_WARNINGS, "%s: warning - read 8910 Port B\n", machine().describe_context()); @@ -1617,8 +1612,8 @@ ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, co m_par_env( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? &ay8910_param : &ym2149_param_env), m_flags(AY8910_LEGACY_OUTPUT), m_feature(feature), - m_port_a_read_cb(*this), - m_port_b_read_cb(*this), + m_port_a_read_cb(*this, 0xff), + m_port_b_read_cb(*this, 0xff), m_port_a_write_cb(*this), m_port_b_write_cb(*this) { diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index 1010e36aa8b..9c596401c53 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -116,7 +116,6 @@ void c140_device::device_start() { m_sample_rate = m_baserate = clock(); - m_int1_callback.resolve_safe(); m_int1_timer = timer_alloc(FUNC(c140_device::int1_on), this); m_stream = stream_alloc(0, 2, m_sample_rate); diff --git a/src/devices/sound/cdda.cpp b/src/devices/sound/cdda.cpp index dc763020935..cc222534f98 100644 --- a/src/devices/sound/cdda.cpp +++ b/src/devices/sound/cdda.cpp @@ -40,8 +40,6 @@ void cdda_device::device_start() m_audio_bptr = 0; m_sequence_counter = 0; - m_audio_end_cb.resolve_safe(); - save_item( NAME(m_audio_playing) ); save_item( NAME(m_audio_pause) ); save_item( NAME(m_audio_ended_normally) ); diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp index a3e8f5c037f..2d8acb64358 100644 --- a/src/devices/sound/cdp1864.cpp +++ b/src/devices/sound/cdp1864.cpp @@ -58,24 +58,24 @@ DEFINE_DEVICE_TYPE(CDP1864, cdp1864_device, "cdp1864", "RCA CDP1864") // cdp1864_device - constructor //------------------------------------------------- -cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, CDP1864, tag, owner, clock), - device_sound_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_read_inlace(*this), - m_read_rdata(*this), - m_read_bdata(*this), - m_read_gdata(*this), - m_write_int(*this), - m_write_dma_out(*this), - m_write_efx(*this), - m_write_hsync(*this), - m_disp(0), - m_dmaout(0), - m_bgcolor(0), - m_con(0), - m_aoe(0), - m_latch(CDP1864_DEFAULT_LATCH) +cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CDP1864, tag, owner, clock), + device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_read_inlace(*this, 1), + m_read_rdata(*this, 0), + m_read_bdata(*this, 0), + m_read_gdata(*this, 0), + m_write_int(*this), + m_write_dma_out(*this), + m_write_efx(*this), + m_write_hsync(*this), + m_disp(0), + m_dmaout(0), + m_bgcolor(0), + m_con(0), + m_aoe(0), + m_latch(CDP1864_DEFAULT_LATCH) { } @@ -105,16 +105,6 @@ void cdp1864_device::device_config_complete() void cdp1864_device::device_start() { - // resolve callbacks - m_read_inlace.resolve_safe(1); - m_read_rdata.resolve_safe(0); - m_read_bdata.resolve_safe(0); - m_read_gdata.resolve_safe(0); - m_write_int.resolve_safe(); - m_write_dma_out.resolve_safe(); - m_write_efx.resolve_safe(); - m_write_hsync.resolve_safe(); - // initialize palette initialize_palette(); diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp index 70e4718f212..c0a54adaf99 100644 --- a/src/devices/sound/cdp1869.cpp +++ b/src/devices/sound/cdp1869.cpp @@ -159,13 +159,7 @@ void cdp1869_device::write_page_ram_byte(offs_t pma, uint8_t data) uint8_t cdp1869_device::read_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd) { - uint8_t data = 0; - - if (!m_in_char_ram_func.isnull()) - { - data = m_in_char_ram_func(pma, cma, pmd); - } - + uint8_t const data = m_in_char_ram_func(pma, cma, pmd); return data; } @@ -177,10 +171,7 @@ uint8_t cdp1869_device::read_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd) void cdp1869_device::write_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd, uint8_t data) { - if (!m_out_char_ram_func.isnull()) - { - m_out_char_ram_func(pma, cma, pmd, data); - } + m_out_char_ram_func(pma, cma, pmd, data); } @@ -190,13 +181,7 @@ void cdp1869_device::write_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd, ui int cdp1869_device::read_pcb(offs_t pma, offs_t cma, uint8_t pmd) { - int pcb = 0; - - if (!m_in_pcb_func.isnull()) - { - pcb = m_in_pcb_func(pma, cma, pmd); - } - + int const pcb = m_in_pcb_func(pma, cma, pmd); return pcb; } @@ -355,7 +340,7 @@ cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, d device_sound_interface(mconfig, *this), device_video_interface(mconfig, *this), device_memory_interface(mconfig, *this), - m_read_pal_ntsc(*this), + m_read_pal_ntsc(*this, 0), m_write_prd(*this), m_in_pcb_func(*this), m_in_char_ram_func(*this), @@ -385,11 +370,9 @@ void cdp1869_device::device_add_mconfig(machine_config &config) void cdp1869_device::device_start() { // resolve callbacks - m_read_pal_ntsc.resolve_safe(0); - m_write_prd.resolve_safe(); - m_in_pcb_func.resolve(); - m_in_char_ram_func.resolve(); - m_out_char_ram_func.resolve(); + m_in_pcb_func.resolve_safe(0); + m_in_char_ram_func.resolve_safe(0); + m_out_char_ram_func.resolve_safe(); // allocate timers m_prd_timer = timer_alloc(FUNC(cdp1869_device::prd_update), this); diff --git a/src/devices/sound/dave.cpp b/src/devices/sound/dave.cpp index 90cbf7620c7..1d2a153a214 100644 --- a/src/devices/sound/dave.cpp +++ b/src/devices/sound/dave.cpp @@ -77,11 +77,6 @@ dave_device::dave_device(const machine_config &mconfig, const char *tag, device_ void dave_device::device_start() { - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_lh.resolve_safe(); - m_write_rh.resolve_safe(); - // allocate timers m_timer_1hz = timer_alloc(FUNC(dave_device::update_1hz_timer), this); m_timer_1hz->adjust(attotime::from_hz(2), 0, attotime::from_hz(2)); diff --git a/src/devices/sound/es1373.cpp b/src/devices/sound/es1373.cpp index 779b57c6ba9..5ce753da4a7 100644 --- a/src/devices/sound/es1373.cpp +++ b/src/devices/sound/es1373.cpp @@ -99,12 +99,6 @@ es1373_device::es1373_device(const machine_config &mconfig, const char *tag, dev set_ids(0x12741371, 0x04, 0x040100, 0x12741371); } -void es1373_device::device_resolve_objects() -{ - pci_device::device_resolve_objects(); - m_irq_handler.resolve_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/sound/es1373.h b/src/devices/sound/es1373.h index df3c62687bd..4f6bee13706 100644 --- a/src/devices/sound/es1373.h +++ b/src/devices/sound/es1373.h @@ -22,7 +22,6 @@ public: void reg_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); protected: - 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; diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 70117baaca2..fc23656d36b 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -58,12 +58,12 @@ static constexpr int resshifts[8] = { 9, 10, 11, 12, 13, 14, 15, 16 }; // es5503_device - constructor //------------------------------------------------- -es5503_device::es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ES5503, tag, owner, clock), - device_sound_interface(mconfig, *this), - device_rom_interface(mconfig, *this), - m_irq_func(*this), - m_adc_func(*this) +es5503_device::es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ES5503, tag, owner, clock), + device_sound_interface(mconfig, *this), + device_rom_interface(mconfig, *this), + m_irq_func(*this), + m_adc_func(*this, 0) { } @@ -267,9 +267,6 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s void es5503_device::device_start() { - m_irq_func.resolve_safe(); - m_adc_func.resolve_safe(0); - rege0 = 0xff; save_pointer(STRUCT_MEMBER(oscillators, freq), 32); diff --git a/src/devices/sound/es5506.cpp b/src/devices/sound/es5506.cpp index df690dde132..bc7412619f2 100644 --- a/src/devices/sound/es5506.cpp +++ b/src/devices/sound/es5506.cpp @@ -173,7 +173,7 @@ es550x_device::es550x_device(const machine_config &mconfig, device_type type, co , m_region3(*this, finder_base::DUMMY_TAG) , m_channels(0) , m_irq_cb(*this) - , m_read_port_cb(*this) + , m_read_port_cb(*this, 0) , m_sample_rate_changed_cb(*this) { } @@ -201,9 +201,6 @@ void es550x_device::device_start() { // initialize the rest of the structure m_master_clock = clock(); - m_irq_cb.resolve(); - m_read_port_cb.resolve(); - m_sample_rate_changed_cb.resolve(); m_irqv = 0x80; // register save @@ -301,8 +298,7 @@ void es550x_device::device_clock_changed() m_master_clock = clock(); m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (!m_sample_rate_changed_cb.isnull()) - m_sample_rate_changed_cb(m_sample_rate); + m_sample_rate_changed_cb(m_sample_rate); } //------------------------------------------------- @@ -418,8 +414,7 @@ device_memory_interface::space_config_vector es5505_device::memory_space_config( void es550x_device::update_irq_state() { // ES5505/6 irq line has been set high - inform the host - if (!m_irq_cb.isnull()) - m_irq_cb(1); // IRQB set high + m_irq_cb(1); // IRQB set high } void es550x_device::update_internal_irq_state() @@ -435,8 +430,7 @@ void es550x_device::update_internal_irq_state() m_irqv = 0x80; - if (!m_irq_cb.isnull()) - m_irq_cb(0); // IRQB set low + m_irq_cb(0); // IRQB set low } /********************************************************************************************** @@ -1160,8 +1154,7 @@ inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, u32 m_active_voices = data & 0x1f; m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (!m_sample_rate_changed_cb.isnull()) - m_sample_rate_changed_cb(m_sample_rate); + m_sample_rate_changed_cb(m_sample_rate); LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); break; @@ -1424,7 +1417,7 @@ inline u32 es5506_device::reg_read_low(es550x_voice *voice, offs_t offset) break; case 0x68/8: // PAR - if (!m_read_port_cb.isnull()) + if (!m_read_port_cb.isunset()) result = m_read_port_cb(0) & 0x3ff; // 10 bit, 9:0 break; @@ -1501,7 +1494,7 @@ inline u32 es5506_device::reg_read_high(es550x_voice *voice, offs_t offset) break; case 0x68/8: // PAR - if (!m_read_port_cb.isnull()) + if (!m_read_port_cb.isunset()) result = m_read_port_cb(0) & 0x3ff; // 10 bit, 9:0 break; @@ -1524,7 +1517,7 @@ inline u32 es5506_device::reg_read_test(es550x_voice *voice, offs_t offset) switch (offset) { case 0x68/8: // PAR - if (!m_read_port_cb.isnull()) + if (!m_read_port_cb.isunset()) result = m_read_port_cb(0) & 0x3ff; // 10 bit, 9:0 break; @@ -1694,8 +1687,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, u16 m_active_voices = data & 0x1f; m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (!m_sample_rate_changed_cb.isnull()) - m_sample_rate_changed_cb(m_sample_rate); + m_sample_rate_changed_cb(m_sample_rate); LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } @@ -1788,8 +1780,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, u1 m_active_voices = data & 0x1f; m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (!m_sample_rate_changed_cb.isnull()) - m_sample_rate_changed_cb(m_sample_rate); + m_sample_rate_changed_cb(m_sample_rate); LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } @@ -1838,8 +1829,7 @@ inline void es5505_device::reg_write_test(es550x_voice *voice, offs_t offset, u1 m_active_voices = data & 0x1f; m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (!m_sample_rate_changed_cb.isnull()) - m_sample_rate_changed_cb(m_sample_rate); + m_sample_rate_changed_cb(m_sample_rate); LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } @@ -2049,7 +2039,7 @@ inline u16 es5505_device::reg_read_test(es550x_voice *voice, offs_t offset) break; case 0x09: // PAR - if (!m_read_port_cb.isnull()) + if (!m_read_port_cb.isunset()) result = m_read_port_cb(0) & 0xffc0; // 10 bit, 15:6 break; diff --git a/src/devices/sound/es8712.cpp b/src/devices/sound/es8712.cpp index a969f1a73f7..ae21168ef77 100644 --- a/src/devices/sound/es8712.cpp +++ b/src/devices/sound/es8712.cpp @@ -70,9 +70,6 @@ void es8712_device::device_add_mconfig(machine_config &config) void es8712_device::device_start() { - m_reset_handler.resolve_safe(); - m_msm_write_cb.resolve_safe(); - es8712_state_save_register(); } diff --git a/src/devices/sound/hc55516.cpp b/src/devices/sound/hc55516.cpp index e2e43b2e3bd..90d9a38d2a6 100644 --- a/src/devices/sound/hc55516.cpp +++ b/src/devices/sound/hc55516.cpp @@ -40,7 +40,7 @@ cvsd_device_base::cvsd_device_base(const machine_config &mconfig, device_type ty : device_t(mconfig, type, tag, owner, clock) , device_sound_interface(mconfig, *this) , m_clock_state_push_cb(*this) - , m_digin_pull_cb(*this) + , m_digin_pull_cb(*this, 1) , m_digout_push_cb(*this) , m_active_clock_edge(active_clock_edge) , m_shiftreg_mask(shiftreg_mask) @@ -224,7 +224,7 @@ hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, d hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t sylmask, int32_t sylshift, int32_t syladd, int32_t intshift) : cvsd_device_base(mconfig, type, tag, owner, clock, RISING, 0x7) , m_agc_push_cb(*this) - , m_fzq_pull_cb(*this) + , m_fzq_pull_cb(*this, 1) , m_sylmask(sylmask) , m_sylshift(sylshift) , m_syladd(syladd) @@ -243,14 +243,11 @@ hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, void hc55516_device::device_start() { cvsd_device_base::device_start(); + save_item(NAME(m_sylfilter)); save_item(NAME(m_intfilter)); save_item(NAME(m_agc)); save_item(NAME(m_buffered_fzq)); - - /* resolve lines */ - m_agc_push_cb.resolve(); - m_fzq_pull_cb.resolve(); } //------------------------------------------------- @@ -292,7 +289,7 @@ void hc55516_device::process_bit(bool bit, bool clock_state) { // grab the /FZ state; if the callback is present, use that, otherwise use the buffered state bool fzq_state = false; - if (!m_fzq_pull_cb.isnull()) + if (!m_fzq_pull_cb.isunset()) fzq_state = m_fzq_pull_cb(); else fzq_state = m_buffered_fzq; @@ -355,8 +352,7 @@ void hc55516_device::process_bit(bool bit, bool clock_state) m_agc = true; // push agc state if a callback is present - if (!m_agc_push_cb.isnull()) - m_agc_push_cb(m_agc); + m_agc_push_cb(m_agc); } //------------------------------------------------- diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index d257572f79e..ba969479cf2 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -155,7 +155,7 @@ huc6230_device::huc6230_device(const machine_config &mconfig, const char *tag, d , m_adpcm_freq(0) , m_pcm_lvol(0) , m_pcm_rvol(0) - , m_adpcm_update_cb(*this) + , m_adpcm_update_cb(*this, 0) , m_vca_cb(*this) { } @@ -176,10 +176,6 @@ void huc6230_device::device_add_mconfig(machine_config &config) void huc6230_device::device_start() { - m_adpcm_update_cb.resolve_all_safe(0); - - m_vca_cb.resolve_safe(); - m_stream = stream_alloc(2, 2, clock() / 6); m_adpcm_timer = timer_alloc(FUNC(huc6230_device::adpcm_timer), this); diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index dc12755ab71..f38b31e6c86 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -63,8 +63,6 @@ void ics2115_device::device_start() m_timer[1].timer = timer_alloc(FUNC(ics2115_device::timer_cb_1), this); m_stream = stream_alloc(0, 2, clock() / (32 * 32)); - m_irq_cb.resolve_safe(); - //Exact formula as per patent 5809466 //This seems to give the ok fit but it is not good enough. /*double maxvol = ((1 << volume_bits) - 1) * pow(2., (double)1/0x100); @@ -1082,8 +1080,7 @@ void ics2115_device::recalc_irq() for (int i = 0; (!irq) && (i < 32); i++) irq |= m_voice[i].vol_ctrl.bitflags.irq_pending && m_voice[i].osc_conf.bitflags.irq_pending; m_irq_on = irq; - if (!m_irq_cb.isnull()) - m_irq_cb(irq ? ASSERT_LINE : CLEAR_LINE); + m_irq_cb(irq ? ASSERT_LINE : CLEAR_LINE); } TIMER_CALLBACK_MEMBER( ics2115_device::timer_cb_0 ) diff --git a/src/devices/sound/k007232.cpp b/src/devices/sound/k007232.cpp index 9b4bc9e4b16..125ebc1352e 100644 --- a/src/devices/sound/k007232.cpp +++ b/src/devices/sound/k007232.cpp @@ -70,8 +70,6 @@ void k007232_device::device_start() space(0).cache(m_cache); /* Set up the chips */ - m_port_write_handler.resolve_safe(); - for (int i = 0; i < KDAC_A_PCM_MAX; i++) { m_channel[i].addr = 0; diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index c8d99d18d55..cdae8a4abee 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -113,9 +113,6 @@ k053260_device::k053260_device(const machine_config &mconfig, const char *tag, d void k053260_device::device_start() { - m_sh1_cb.resolve_safe(); - m_sh2_cb.resolve_safe(); - m_stream = stream_alloc(0, 2, clock() / CLOCKS_PER_SAMPLE); /* register with the save state system */ diff --git a/src/devices/sound/k054539.cpp b/src/devices/sound/k054539.cpp index 8dd04c6a6f8..59f9cf2ae2e 100644 --- a/src/devices/sound/k054539.cpp +++ b/src/devices/sound/k054539.cpp @@ -508,8 +508,7 @@ void k054539_device::device_start() { m_timer = timer_alloc(FUNC(k054539_device::call_timer_handler), this); - // resolve / bind callbacks - m_timer_handler.resolve_safe(); + // resolve delegates m_apan_cb.resolve(); for (auto & elem : gain) diff --git a/src/devices/sound/k056800.cpp b/src/devices/sound/k056800.cpp index aae1aa10bf2..00a7f7235b6 100644 --- a/src/devices/sound/k056800.cpp +++ b/src/devices/sound/k056800.cpp @@ -37,8 +37,6 @@ k056800_device::k056800_device(const machine_config &mconfig, const char *tag, d void k056800_device::device_start() { - m_int_handler.resolve_safe(); - save_item(NAME(m_int_pending)); save_item(NAME(m_int_enabled)); save_item(NAME(m_host_to_snd_regs)); diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp index f5c3c4d02e9..2b541e11b0f 100644 --- a/src/devices/sound/ks0164.cpp +++ b/src/devices/sound/ks0164.cpp @@ -56,8 +56,6 @@ void ks0164_device::device_start() space().cache(m_mem_cache); m_timer = timer_alloc(FUNC(ks0164_device::irq_timer_tick), this); - m_midi_tx.resolve_safe(); - set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); set_rate(clock(), 542); diff --git a/src/devices/sound/lc7535.cpp b/src/devices/sound/lc7535.cpp index 70afb5372d3..21a921668e3 100644 --- a/src/devices/sound/lc7535.cpp +++ b/src/devices/sound/lc7535.cpp @@ -40,7 +40,7 @@ DEFINE_DEVICE_TYPE(LC7535, lc7535_device, "lc7535", "Sanyo LC7535") lc7535_device::lc7535_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LC7535, tag, owner, clock), - m_select_cb(*this), + m_select_cb(*this, 1), m_volume_cb(*this), m_addr(0), m_data(0), m_count(0), @@ -54,8 +54,7 @@ lc7535_device::lc7535_device(const machine_config &mconfig, const char *tag, dev void lc7535_device::device_start() { - // resolve callbacks - m_select_cb.resolve(); + // resolve delegates m_volume_cb.resolve(); // register for save states diff --git a/src/devices/sound/mas3507d.cpp b/src/devices/sound/mas3507d.cpp index c04d60a9a42..3780dd4e792 100644 --- a/src/devices/sound/mas3507d.cpp +++ b/src/devices/sound/mas3507d.cpp @@ -54,9 +54,6 @@ void mas3507d_device::device_start() stream = stream_alloc(0, 2, 44100); mp3dec = std::make_unique<mp3_audio>(reinterpret_cast<const uint8_t *>(&mp3data[0])); - cb_mpeg_frame_sync.resolve(); - cb_demand.resolve(); - save_item(NAME(mp3data)); save_item(NAME(samples)); save_item(NAME(i2c_bus_state)); diff --git a/src/devices/sound/mea8000.cpp b/src/devices/sound/mea8000.cpp index e557d046db4..25381b9ae81 100644 --- a/src/devices/sound/mea8000.cpp +++ b/src/devices/sound/mea8000.cpp @@ -130,8 +130,6 @@ mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, d void mea8000_device::device_start() { - m_write_req.resolve_safe(); - init_tables(); m_stream = stream_alloc(0, 1, clock() / 60); diff --git a/src/devices/sound/mm5837.cpp b/src/devices/sound/mm5837.cpp index ae6687655f3..40bec2727b8 100644 --- a/src/devices/sound/mm5837.cpp +++ b/src/devices/sound/mm5837.cpp @@ -43,9 +43,6 @@ mm5837_device::mm5837_device(const machine_config &mconfig, const char *tag, dev void mm5837_device::device_start() { - // resolve callbacks - m_output_cb.resolve_safe(); - // get timer m_timer = timer_alloc(FUNC(mm5837_device::update_clock_output), this); diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp index bd35429c31c..eebb6ee252e 100644 --- a/src/devices/sound/mos6560.cpp +++ b/src/devices/sound/mos6560.cpp @@ -680,16 +680,16 @@ void mos6560_device::mos6560_colorram_map(address_map &map) map(0x000, 0x3ff).ram(); } -mos6560_device::mos6560_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_memory_interface(mconfig, *this), - device_sound_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_variant(variant), - m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, address_map_constructor(FUNC(mos6560_device::mos6560_videoram_map), this)), - m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, address_map_constructor(FUNC(mos6560_device::mos6560_colorram_map), this)), - m_read_potx(*this), - m_read_poty(*this) +mos6560_device::mos6560_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_memory_interface(mconfig, *this), + device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_variant(variant), + m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, address_map_constructor(FUNC(mos6560_device::mos6560_videoram_map), this)), + m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, address_map_constructor(FUNC(mos6560_device::mos6560_colorram_map), this)), + m_read_potx(*this, 0xff), + m_read_poty(*this, 0xff) { } @@ -731,10 +731,6 @@ void mos6560_device::device_start() { screen().register_screen_bitmap(m_bitmap); - // resolve callbacks - m_read_potx.resolve_safe(0xff); - m_read_poty.resolve_safe(0xff); - switch (m_variant) { case TYPE_6560: diff --git a/src/devices/sound/mos6581.cpp b/src/devices/sound/mos6581.cpp index 6682ddca4fe..941472a58f0 100644 --- a/src/devices/sound/mos6581.cpp +++ b/src/devices/sound/mos6581.cpp @@ -41,8 +41,8 @@ DEFINE_DEVICE_TYPE(MOS8580, mos8580_device, "mos8580", "MOS 8580 SID") mos6581_device::mos6581_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_sound_interface(mconfig, *this) - , m_read_potx(*this) - , m_read_poty(*this) + , m_read_potx(*this, 0xff) + , m_read_poty(*this, 0xff) , m_stream(nullptr) , m_variant(variant) @@ -193,10 +193,6 @@ void mos6581_device::save_state(SID6581_t *token) void mos6581_device::device_start() { - // resolve callbacks - m_read_potx.resolve_safe(0xff); - m_read_poty.resolve_safe(0xff); - // create sound stream m_stream = stream_alloc(0, 1, machine().sample_rate()); diff --git a/src/devices/sound/mos7360.cpp b/src/devices/sound/mos7360.cpp index c76e1d8adb7..51953d93ecd 100644 --- a/src/devices/sound/mos7360.cpp +++ b/src/devices/sound/mos7360.cpp @@ -261,15 +261,15 @@ inline uint8_t mos7360_device::read_rom(offs_t offset) // mos7360_device - constructor //------------------------------------------------- -mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MOS7360, tag, owner, clock), - device_memory_interface(mconfig, *this), - device_sound_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(FUNC(mos7360_device::mos7360_videoram_map), this)), - m_write_irq(*this), - m_read_k(*this), - m_stream(nullptr) +mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, MOS7360, tag, owner, clock), + device_memory_interface(mconfig, *this), + device_sound_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(FUNC(mos7360_device::mos7360_videoram_map), this)), + m_write_irq(*this), + m_read_k(*this, 0xff), + m_stream(nullptr) { } @@ -280,10 +280,6 @@ mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, d void mos7360_device::device_start() { - // resolve callbacks - m_write_irq.resolve_safe(); - m_read_k.resolve_safe(0xff); - // allocate timers m_timer[TIMER_ID_1] = timer_alloc(FUNC(mos7360_device::timer_expired), this); m_timer[TIMER_ID_2] = timer_alloc(FUNC(mos7360_device::timer_expired), this); diff --git a/src/devices/sound/msm5205.cpp b/src/devices/sound/msm5205.cpp index ba196a419a3..f3f1f5e6302 100644 --- a/src/devices/sound/msm5205.cpp +++ b/src/devices/sound/msm5205.cpp @@ -91,9 +91,6 @@ msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, d void msm5205_device::device_start() { - m_vck_cb.resolve_safe(); - m_vck_legacy_cb.resolve(); - /* compute the difference tables */ compute_tables(); @@ -190,7 +187,7 @@ TIMER_CALLBACK_MEMBER(msm5205_device::update_adpcm) int new_signal; // callback user handler and latch next data - if (!m_vck_legacy_cb.isnull()) + if (!m_vck_legacy_cb.isunset()) m_vck_legacy_cb(1); // reset check at last hiedge of VCK diff --git a/src/devices/sound/msm5232.cpp b/src/devices/sound/msm5232.cpp index dc0fcf76421..3761e442ae7 100644 --- a/src/devices/sound/msm5232.cpp +++ b/src/devices/sound/msm5232.cpp @@ -30,8 +30,6 @@ void msm5232_device::device_start() int rate = clock()/CLOCK_RATE_DIVIDER; int voicenum; - m_gate_handler_cb.resolve(); - init(clock(), rate); m_stream = stream_alloc(0, 11, rate); @@ -291,7 +289,7 @@ void msm5232_device::gate_update() { int new_state = (m_control2 & 0x20) ? m_voi[7].GF : 0; - if (m_gate != new_state && !m_gate_handler_cb.isnull()) + if (m_gate != new_state) { m_gate = new_state; m_gate_handler_cb(new_state); diff --git a/src/devices/sound/nes_apu.cpp b/src/devices/sound/nes_apu.cpp index a988427d583..bd74adbd5c5 100644 --- a/src/devices/sound/nes_apu.cpp +++ b/src/devices/sound/nes_apu.cpp @@ -55,7 +55,7 @@ nesapu_device::nesapu_device(const machine_config &mconfig, device_type type, co , m_samps_per_sync(0) , m_stream(nullptr) , m_irq_handler(*this) - , m_mem_read_cb(*this) + , m_mem_read_cb(*this, 0x00) , m_frame_timer(nullptr) { } @@ -114,10 +114,6 @@ void nesapu_device::calculate_rates() void nesapu_device::device_start() { - // resolve callbacks - m_irq_handler.resolve_safe(); - m_mem_read_cb.resolve_safe(0x00); - m_frame_timer = timer_alloc(FUNC(nesapu_device::frame_timer_cb), this); m_frame_clocks = m_is_pal ? 33254 : 29830; m_frame_period = clocks_to_attotime(m_frame_clocks); diff --git a/src/devices/sound/nn71003f.cpp b/src/devices/sound/nn71003f.cpp index 780f51f9399..b9d926a9855 100644 --- a/src/devices/sound/nn71003f.cpp +++ b/src/devices/sound/nn71003f.cpp @@ -20,7 +20,6 @@ nn71003f_device::nn71003f_device(const machine_config &mconfig, const char *tag, void nn71003f_device::device_start() { - m_miso.resolve_safe(); save_item(NAME(m_ss)); save_item(NAME(m_sclk)); save_item(NAME(m_mosi)); diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 6341c751e41..4940e355312 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -199,9 +199,9 @@ pokey_device::pokey_device(const machine_config &mconfig, const char *tag, devic device_state_interface(mconfig, *this), m_icount(0), m_stream(nullptr), - m_pot_r_cb(*this), - m_allpot_r_cb(*this), - m_serin_r_cb(*this), + m_pot_r_cb(*this, 0), + m_allpot_r_cb(*this, 0), + m_serin_r_cb(*this, 0), m_serout_w_cb(*this), m_irq_w_cb(*this), m_keyboard_r(*this), @@ -227,7 +227,7 @@ void pokey_device::device_start() m_channel[CHAN2].m_INTMask = IRQ_TIMR2; m_channel[CHAN4].m_INTMask = IRQ_TIMR4; - // bind callbacks + // bind delegates m_keyboard_r.resolve(); /* calculate the A/D times @@ -284,12 +284,6 @@ void pokey_device::device_start() std::fill(std::begin(m_clock_cnt), std::end(m_clock_cnt), 0); std::fill(std::begin(m_POTx), std::end(m_POTx), 0); - m_pot_r_cb.resolve_all(); - m_allpot_r_cb.resolve(); - m_serin_r_cb.resolve(); - m_serout_w_cb.resolve_safe(); - m_irq_w_cb.resolve_safe(); - m_stream = stream_alloc(0, 1, clock()); m_serout_ready_timer = timer_alloc(FUNC(pokey_device::serout_ready_irq), this); @@ -831,7 +825,7 @@ uint8_t pokey_device::read(offs_t offset) data = m_ALLPOT; LOG("%s: POKEY ALLPOT internal $%02x (reset)\n", machine().describe_context(), data); } - else if (!m_allpot_r_cb.isnull()) + else if (!m_allpot_r_cb.isunset()) { m_ALLPOT = data = m_allpot_r_cb(offset); LOG("%s: POKEY ALLPOT callback $%02x\n", machine().describe_context(), data); @@ -861,7 +855,7 @@ uint8_t pokey_device::read(offs_t offset) break; case SERIN_C: - if (!m_serin_r_cb.isnull()) + if (!m_serin_r_cb.isunset()) m_SERIN = m_serin_r_cb(offset); data = m_SERIN; LOG("%s: POKEY SERIN $%02x\n", machine().describe_context(), data); @@ -1120,7 +1114,7 @@ void pokey_device::pokey_potgo() for (int pot = 0; pot < 8; pot++) { m_POTx[pot] = 228; - if (!m_pot_r_cb[pot].isnull()) + if (!m_pot_r_cb[pot].isunset()) { int r = m_pot_r_cb[pot](pot); diff --git a/src/devices/sound/qs1000.cpp b/src/devices/sound/qs1000.cpp index 65c6e4cd24c..b3f494890b4 100644 --- a/src/devices/sound/qs1000.cpp +++ b/src/devices/sound/qs1000.cpp @@ -164,19 +164,19 @@ ROM_END //------------------------------------------------- // qs1000_device - constructor //------------------------------------------------- -qs1000_device::qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, QS1000, tag, owner, clock), - device_sound_interface(mconfig, *this), - device_rom_interface(mconfig, *this), - m_external_rom(false), - m_in_p1_cb(*this), - m_in_p2_cb(*this), - m_in_p3_cb(*this), - m_out_p1_cb(*this), - m_out_p2_cb(*this), - m_out_p3_cb(*this), - m_stream(nullptr), - m_cpu(*this, "cpu") +qs1000_device::qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, QS1000, tag, owner, clock), + device_sound_interface(mconfig, *this), + device_rom_interface(mconfig, *this), + m_external_rom(false), + m_in_p1_cb(*this, 0), + m_in_p2_cb(*this, 0), + m_in_p3_cb(*this, 0), + m_out_p1_cb(*this), + m_out_p2_cb(*this), + m_out_p3_cb(*this), + m_stream(nullptr), + m_cpu(*this, "cpu") { } @@ -230,15 +230,6 @@ void qs1000_device::device_start() // gives reasonable results m_stream = stream_alloc(0, 2, clock() / 32); - // Resolve CPU port callbacks - m_in_p1_cb.resolve_safe(0); - m_in_p2_cb.resolve_safe(0); - m_in_p3_cb.resolve_safe(0); - - m_out_p1_cb.resolve_safe(); - m_out_p2_cb.resolve_safe(); - m_out_p3_cb.resolve_safe(); - save_item(NAME(m_wave_regs)); for (int i = 0; i < QS1000_CHANNELS; i++) diff --git a/src/devices/sound/rolandpcm.cpp b/src/devices/sound/rolandpcm.cpp index e31132b934e..fed29abfc22 100644 --- a/src/devices/sound/rolandpcm.cpp +++ b/src/devices/sound/rolandpcm.cpp @@ -39,17 +39,6 @@ mb87419_mb87420_device::mb87419_mb87420_device(const machine_config &mconfig, co } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void mb87419_mb87420_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/sound/rolandpcm.h b/src/devices/sound/rolandpcm.h index 702da28dcf1..6afb177b108 100644 --- a/src/devices/sound/rolandpcm.h +++ b/src/devices/sound/rolandpcm.h @@ -18,15 +18,14 @@ public: void write(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; - // sound stream update overrides + // device_sound_interface implementation virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; - // device_rom_interface overrides + // device_rom_interface implementation virtual void rom_bank_pre_change() override; static int16_t decode_sample(int8_t data); diff --git a/src/devices/sound/s14001a.cpp b/src/devices/sound/s14001a.cpp index 50f2ca07eaa..e93ca984480 100644 --- a/src/devices/sound/s14001a.cpp +++ b/src/devices/sound/s14001a.cpp @@ -196,13 +196,13 @@ uint8_t CalculateOutput(bool bVoiced, bool bXSilence, uint8_t uPPQtr, bool bPPQS // device definition DEFINE_DEVICE_TYPE(S14001A, s14001a_device, "s14001a", "SSi TSI S14001A") -s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, S14001A, tag, owner, clock), - device_sound_interface(mconfig, *this), - m_SpeechRom(*this, DEVICE_SELF), - m_stream(nullptr), - m_bsy_handler(*this), - m_ext_read_handler(*this) +s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, S14001A, tag, owner, clock), + device_sound_interface(mconfig, *this), + m_SpeechRom(*this, DEVICE_SELF), + m_stream(nullptr), + m_bsy_handler(*this), + m_ext_read_handler(*this, 0) { } @@ -216,10 +216,6 @@ void s14001a_device::device_start() { m_stream = stream_alloc(0, 1, clock() ? clock() : machine().sample_rate()); - // resolve callbacks - m_ext_read_handler.resolve(); - m_bsy_handler.resolve(); - // zero-fill m_bPhase1 = false; m_uStateP1 = m_uStateP2 = states::IDLE; @@ -361,7 +357,7 @@ void s14001a_device::set_clock(uint32_t clock) uint8_t s14001a_device::readmem(uint16_t offset, bool phase) { offset &= 0xfff; // 11-bit internal - return ((m_ext_read_handler.isnull()) ? m_SpeechRom[offset & (m_SpeechRom.bytes() - 1)] : m_ext_read_handler(offset)); + return (m_ext_read_handler.isunset()) ? m_SpeechRom[offset & (m_SpeechRom.bytes() - 1)] : m_ext_read_handler(offset); } bool s14001a_device::Clock() @@ -413,7 +409,7 @@ bool s14001a_device::Clock() m_uOutputP1 = 7; if (m_bStart) m_uStateP1 = states::WORDWAIT; - if (m_bBusyP1 && !m_bsy_handler.isnull()) + if (m_bBusyP1) m_bsy_handler(0); m_bBusyP1 = false; break; @@ -428,7 +424,7 @@ bool s14001a_device::Clock() if (m_bStart) m_uStateP1 = states::WORDWAIT; else m_uStateP1 = states::CWARMSB; - if (!m_bBusyP1 && !m_bsy_handler.isnull()) + if (!m_bBusyP1) m_bsy_handler(1); m_bBusyP1 = true; break; diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index 96436fefd90..be8fc35cdc7 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -199,10 +199,6 @@ void scsp_device::device_start() // init the emulation init(); - // set up the IRQ callbacks - m_irq_cb.resolve_safe(); - m_main_irq_cb.resolve_safe(); - // Stereo output with EXTS0,1 Input (External digital audio output) m_stream = stream_alloc(2, 2, clock() / 512); @@ -763,7 +759,7 @@ void scsp_device::UpdateReg(int reg) break; case 0x18: case 0x19: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_TimPris[0] = 1 << ((m_udata.data[0x18/2] >> 8) & 0x7); m_TimCnt[0] = (m_udata.data[0x18/2] & 0xff) << 8; @@ -780,7 +776,7 @@ void scsp_device::UpdateReg(int reg) break; case 0x1a: case 0x1b: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_TimPris[1] = 1 << ((m_udata.data[0x1A/2] >> 8) & 0x7); m_TimCnt[1] = (m_udata.data[0x1A/2] & 0xff) << 8; @@ -797,7 +793,7 @@ void scsp_device::UpdateReg(int reg) break; case 0x1C: case 0x1D: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_TimPris[2] = 1 << ((m_udata.data[0x1C/2] >> 8) & 0x7); m_TimCnt[2] = (m_udata.data[0x1C/2] & 0xff) << 8; @@ -814,7 +810,7 @@ void scsp_device::UpdateReg(int reg) break; case 0x1e: // SCIEB case 0x1f: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { CheckPendingIRQ(); @@ -824,7 +820,7 @@ void scsp_device::UpdateReg(int reg) break; case 0x20: // SCIPD case 0x21: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { if (m_udata.data[0x1e/2] & m_udata.data[0x20/2] & 0x20) popmessage("SCSP SCIPD write %04x, contact MAMEdev",m_udata.data[0x20/2]); @@ -833,7 +829,7 @@ void scsp_device::UpdateReg(int reg) case 0x22: //SCIRE case 0x23: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_udata.data[0x20/2] &= ~m_udata.data[0x22/2]; ResetInterrupts(); @@ -860,7 +856,7 @@ void scsp_device::UpdateReg(int reg) case 0x27: case 0x28: case 0x29: - if (!m_irq_cb.isnull()) + if (!m_irq_cb.isunset()) { m_IrqTimA = DecodeSCI(SCITMA); m_IrqTimBC = DecodeSCI(SCITMB); diff --git a/src/devices/sound/sn76496.cpp b/src/devices/sound/sn76496.cpp index 96c6a3ba789..44460be345e 100644 --- a/src/devices/sound/sn76496.cpp +++ b/src/devices/sound/sn76496.cpp @@ -227,24 +227,20 @@ segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, d void sn76496_base_device::device_start() { int sample_rate = clock()/2; - int i; - double out; int gain; - m_ready_handler.resolve_safe(); - m_sound = stream_alloc(0, (m_stereo? 2:1), sample_rate); - for (i = 0; i < 4; i++) m_volume[i] = 0; + for (int i = 0; i < 4; i++) m_volume[i] = 0; m_last_register = m_sega_style_psg?3:0; // Sega VDP PSG defaults to selected period reg for 2nd channel - for (i = 0; i < 8; i+=2) + for (int i = 0; i < 8; i+=2) { m_register[i] = 0; m_register[i + 1] = 0x0; // volume = 0x0 (max volume) on reset; this needs testing on chips other than SN76489A and Sega VDP PSG } - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { m_output[i] = 0; m_period[i] = 0; @@ -263,12 +259,12 @@ void sn76496_base_device::device_start() gain &= 0xff; // increase max output basing on gain (0.2 dB per step) - out = MAX_OUTPUT / 4; // four channels, each gets 1/4 of the total range + double out = MAX_OUTPUT / 4; // four channels, each gets 1/4 of the total range while (gain-- > 0) out *= 1.023292992; // = (10 ^ (0.2/20)) // build volume table (2dB per step) - for (i = 0; i < 15; i++) + for (int i = 0; i < 15; i++) { // limit volume to avoid clipping if (out > MAX_OUTPUT / 4) m_vol_table[i] = MAX_OUTPUT / 4; diff --git a/src/devices/sound/sp0250.cpp b/src/devices/sound/sp0250.cpp index 9544adb3c38..c0b0f1c4f13 100644 --- a/src/devices/sound/sp0250.cpp +++ b/src/devices/sound/sp0250.cpp @@ -68,8 +68,7 @@ void sp0250_device::device_start() // if a DRQ callback is offered, run a timer at the frame rate // to ensure the DRQ gets picked up in a timely manner - m_drq.resolve_safe(); - if (!m_drq.isnull()) + if (!m_drq.isunset()) { m_drq(ASSERT_LINE); attotime period = attotime::from_hz(frame_rate); diff --git a/src/devices/sound/sp0256.cpp b/src/devices/sound/sp0256.cpp index 3ce5162f9d4..237904be94a 100644 --- a/src/devices/sound/sp0256.cpp +++ b/src/devices/sound/sp0256.cpp @@ -68,8 +68,6 @@ sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, dev void sp0256_device::device_start() { - m_drq_cb.resolve_safe(); - m_sby_cb.resolve_safe(); m_drq_cb(1); m_sby_cb(1); diff --git a/src/devices/sound/spu.cpp b/src/devices/sound/spu.cpp index a0ec7800a9c..9e3a95b0357 100644 --- a/src/devices/sound/spu.cpp +++ b/src/devices/sound/spu.cpp @@ -962,8 +962,6 @@ spu_device::spu_device(const machine_config &mconfig, const char *tag, device_t void spu_device::device_start() { - m_irq_handler.resolve_safe(); - spu_base_frequency_hz = clock() / 768.0f; generate_linear_rate_table(); generate_pos_exp_rate_table(); diff --git a/src/devices/sound/t6721a.cpp b/src/devices/sound/t6721a.cpp index 6ab00ac10b6..a094d4dc783 100644 --- a/src/devices/sound/t6721a.cpp +++ b/src/devices/sound/t6721a.cpp @@ -49,12 +49,6 @@ t6721a_device::t6721a_device(const machine_config &mconfig, const char *tag, dev void t6721a_device::device_start() { - // resolve callbacks - m_write_eos.resolve_safe(); - m_write_phi2.resolve_safe(); - m_write_dtrd.resolve_safe(); - m_write_apd.resolve_safe(); - // create sound stream m_stream = stream_alloc(0, 1, machine().sample_rate()); } diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp index 62b43b42173..42899a0ac4d 100644 --- a/src/devices/sound/tms5110.cpp +++ b/src/devices/sound/tms5110.cpp @@ -149,13 +149,10 @@ static int16_t clip_analog(int16_t cliptemp); void tms5110_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { - if (!m_m0_cb.isnull()) - m_m0_cb(m0); - if (!m_m1_cb.isnull()) - m_m1_cb(m1); - if (!m_addr_cb.isnull()) - m_addr_cb((offs_t)0, addr); - if (!m_romclk_cb.isnull()) + m_m0_cb(m0); + m_m1_cb(m1); + m_addr_cb(offs_t(0), addr); + if (!m_romclk_cb.isunset()) { //printf("rc %d\n", rc); m_romclk_cb(rc); @@ -176,7 +173,7 @@ uint8_t tms5110_device::new_int_read() new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus new_int_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus new_int_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus - if (!m_data_cb.isnull()) + if (!m_data_cb.isunset()) return m_data_cb(); if (DEBUG_5110) logerror("WARNING: CALLBACK MISSING, RETURNING 0!\n"); return 0; @@ -1040,13 +1037,6 @@ void tms5110_device::device_start() fatalerror("Unknown variant in tms5110_create\n"); } - /* resolve lines */ - m_m0_cb.resolve(); - m_m1_cb.resolve(); - m_romclk_cb.resolve(); - m_addr_cb.resolve(); - m_data_cb.resolve(); - /* initialize a stream */ m_stream = stream_alloc(0, 1, clock() / 80); @@ -1355,10 +1345,6 @@ TIMER_CALLBACK_MEMBER(tmsprom_device::update_romclk) void tmsprom_device::device_start() { - /* resolve lines */ - m_pdc_cb.resolve_safe(); - m_ctl_cb.resolve_safe(); - m_romclk_timer = timer_alloc(FUNC(tmsprom_device::update_romclk), this); m_romclk_timer->adjust(attotime::zero, 0, attotime::from_hz(clock())); @@ -1450,7 +1436,7 @@ tms5110_device::tms5110_device(const machine_config &mconfig, device_type type, , m_m0_cb(*this) , m_m1_cb(*this) , m_addr_cb(*this) - , m_data_cb(*this) + , m_data_cb(*this, 0) , m_romclk_cb(*this) { } diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index 9e2fcf8fc7d..5a102e4323c 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -568,13 +568,10 @@ void tms5220_device::printbits(long data, int num) ***********************************************************************************************/ void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { - if (!m_m0_cb.isnull()) - m_m0_cb(m0); - if (!m_m1_cb.isnull()) - m_m1_cb(m1); - if (!m_addr_cb.isnull()) - m_addr_cb((offs_t)0, addr); - if (!m_romclk_cb.isnull()) + m_m0_cb(m0); + m_m1_cb(m1); + m_addr_cb(offs_t(0), addr); + if (!m_romclk_cb.isunset()) { //printf("rc %d\n", rc); m_romclk_cb(rc); @@ -605,7 +602,7 @@ uint8_t tms5220_device::new_int_read() new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus new_int_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus new_int_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus - if (!m_data_cb.isnull()) + if (!m_data_cb.isunset()) return m_data_cb(); LOG("WARNING: CALLBACK MISSING, RETURNING 0!\n"); return 0; @@ -1581,8 +1578,7 @@ void tms5220_device::update_ready_state() if (m_ready_pin != state) { LOGMASKED(LOG_PIN_READS, "ready pin set to state %d\n", state); - if (!m_readyq_handler.isnull()) - m_readyq_handler(!state); + m_readyq_handler(!state); m_ready_pin = state; } } @@ -1639,15 +1635,6 @@ void tms5220_device::device_start() fatalerror("Unknown variant in tms5220_set_variant\n"); } - /* resolve callbacks */ - m_irq_handler.resolve_safe(); - m_readyq_handler.resolve(); - m_m0_cb.resolve(); - m_m1_cb.resolve(); - m_romclk_cb.resolve(); - m_addr_cb.resolve(); - m_data_cb.resolve(); - /* initialize a stream */ m_stream = stream_alloc(0, 1, clock() / 80); @@ -2104,7 +2091,7 @@ tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, , m_m0_cb(*this) , m_m1_cb(*this) , m_addr_cb(*this) - , m_data_cb(*this) + , m_data_cb(*this, 0) , m_romclk_cb(*this) { } diff --git a/src/devices/sound/uda1344.cpp b/src/devices/sound/uda1344.cpp index d63aa5a4cd1..d2454b57994 100644 --- a/src/devices/sound/uda1344.cpp +++ b/src/devices/sound/uda1344.cpp @@ -64,8 +64,6 @@ void uda1344_device::device_start() save_item(NAME(m_dac_enable)); save_item(NAME(m_adc_enable)); - m_l3_ack_out.resolve_safe(); - m_buffer[0].resize(BUFFER_SIZE); m_buffer[1].resize(BUFFER_SIZE); } diff --git a/src/devices/sound/upd1771.cpp b/src/devices/sound/upd1771.cpp index 4e865ea2c42..6b0ef06b884 100644 --- a/src/devices/sound/upd1771.cpp +++ b/src/devices/sound/upd1771.cpp @@ -250,9 +250,6 @@ upd1771c_device::upd1771c_device(const machine_config &mconfig, const char *tag, void upd1771c_device::device_start() { - /* resolve callbacks */ - m_ack_handler.resolve_safe(); - m_timer = timer_alloc(FUNC(upd1771c_device::ack_callback), this); m_channel = stream_alloc(0, 1, clock() / 4); diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index b108f6c3ebb..1579fd8ee39 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -269,8 +269,6 @@ void upd7759_device::device_start() m_sample_offset_shift = 1; m_timer = timer_alloc(FUNC(upd7759_device::drq_update), this); - - m_drqcallback.resolve_safe(); } diff --git a/src/devices/sound/votrax.cpp b/src/devices/sound/votrax.cpp index ac737dd3fc7..2151e2dbdca 100644 --- a/src/devices/sound/votrax.cpp +++ b/src/devices/sound/votrax.cpp @@ -194,7 +194,6 @@ void votrax_sc01_device::device_start() m_timer = timer_alloc(FUNC(votrax_sc01_device::phone_tick), this); // reset outputs - m_ar_cb.resolve_safe(); m_ar_state = ASSERT_LINE; // save inputs diff --git a/src/devices/sound/vrender0.cpp b/src/devices/sound/vrender0.cpp index fd86b56adea..4178d98859a 100644 --- a/src/devices/sound/vrender0.cpp +++ b/src/devices/sound/vrender0.cpp @@ -139,8 +139,6 @@ vr0sound_device::vr0sound_device(const machine_config &mconfig, const char *tag, void vr0sound_device::device_start() { - m_irq_cb.resolve_safe(); - // Find our direct access space(AS_TEXTURE).cache(m_texcache); space(AS_FRAME).cache(m_fbcache); diff --git a/src/devices/sound/ym2154.cpp b/src/devices/sound/ym2154.cpp index 287529aeeec..b52c4e49532 100644 --- a/src/devices/sound/ym2154.cpp +++ b/src/devices/sound/ym2154.cpp @@ -21,7 +21,7 @@ ym2154_device::ym2154_device(const machine_config &mconfig, const char *tag, dev m_stream(nullptr), m_timer(nullptr), m_update_irq(*this), - m_io_read(*this), + m_io_read(*this, 0), m_io_write(*this), m_group0_config("group0", ENDIANNESS_LITTLE, 8, 18, 0), m_group1_config("group1", ENDIANNESS_LITTLE, 8, 18, 0), @@ -50,7 +50,7 @@ u8 ym2154_device::read(offs_t offset) case 0x08: // A/D converter registers case 0x09: // A/D converter registers case 0x0a: // A/D converter registers - result = m_io_read.isnull() ? 0 : m_io_read(offset - 1); + result = m_io_read(offset - 1); break; case 0x0e: // IRQ ack @@ -90,8 +90,7 @@ void ym2154_device::write(offs_t offset, u8 data) m_timer->enable(false); else if (m_timer_enable && !old) m_timer->adjust((2048 - m_timer_count) * attotime::from_hz(sample_rate())); - if (!m_io_write.isnull()) - m_io_write(0, BIT(data, 4, 4) ^ 0x0f); + m_io_write(0, BIT(data, 4, 4) ^ 0x0f); break; // output level @@ -179,11 +178,6 @@ void ym2154_device::device_start() // allocate our timer m_timer = timer_alloc(FUNC(ym2154_device::delayed_irq), this); - // resolve the handlers - m_update_irq.resolve(); - m_io_read.resolve(); - m_io_write.resolve(); - // allocate our stream m_stream = stream_alloc(0, 2, sample_rate()); diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp index 886d6d516d5..3f748656d91 100644 --- a/src/devices/sound/ymf271.cpp +++ b/src/devices/sound/ymf271.cpp @@ -1317,9 +1317,7 @@ TIMER_CALLBACK_MEMBER(ymf271_device::timer_a_expired) if (m_enable & 4) { m_irqstate |= 1; - - if (!m_irq_handler.isnull()) - m_irq_handler(1); + m_irq_handler(1); } // reload timer @@ -1334,9 +1332,7 @@ TIMER_CALLBACK_MEMBER(ymf271_device::timer_b_expired) if (m_enable & 8) { m_irqstate |= 2; - - if (!m_irq_handler.isnull()) - m_irq_handler(1); + m_irq_handler(1); } // reload timer @@ -1397,7 +1393,7 @@ void ymf271_device::ymf271_write_timer(uint8_t address, uint8_t data) m_irqstate &= ~1; m_status &= ~1; - if (!m_irq_handler.isnull() && ~m_irqstate & 2) + if (~m_irqstate & 2) m_irq_handler(0); } @@ -1407,7 +1403,7 @@ void ymf271_device::ymf271_write_timer(uint8_t address, uint8_t data) m_irqstate &= ~2; m_status &= ~2; - if (!m_irq_handler.isnull() && ~m_irqstate & 1) + if (~m_irqstate & 1) m_irq_handler(0); } @@ -1727,8 +1723,6 @@ void ymf271_device::device_start() m_timA = timer_alloc(FUNC(ymf271_device::timer_a_expired), this); m_timB = timer_alloc(FUNC(ymf271_device::timer_b_expired), this); - m_irq_handler.resolve(); - m_master_clock = clock(); init_tables(); init_state(); @@ -1757,8 +1751,7 @@ void ymf271_device::device_reset() m_status = 0; m_enable = 0; - if (!m_irq_handler.isnull()) - m_irq_handler(0); + m_irq_handler(0); } //------------------------------------------------- diff --git a/src/devices/sound/ymfm_mame.h b/src/devices/sound/ymfm_mame.h index 14d5f00aa36..479abdf038b 100644 --- a/src/devices/sound/ymfm_mame.h +++ b/src/devices/sound/ymfm_mame.h @@ -35,8 +35,8 @@ public: device_sound_interface(mconfig, *this), m_timer{ nullptr, nullptr }, m_update_irq(*this), - m_io_read{ *this, *this }, - m_io_write{ *this, *this } + m_io_read(*this, 0), + m_io_write(*this) { } @@ -96,8 +96,7 @@ protected: // needed to the change in IRQ state, signaling any consumers virtual void ymfm_update_irq(bool asserted) override { - if (!m_update_irq.isnull()) - m_update_irq(asserted ? ASSERT_LINE : CLEAR_LINE); + m_update_irq(asserted ? ASSERT_LINE : CLEAR_LINE); } // the chip implementation calls this to indicate that the chip should be @@ -122,14 +121,14 @@ protected: // of the chip; our responsibility is to provide the data requested virtual uint8_t ymfm_external_read(ymfm::access_class type, uint32_t address) override { - return (type != ymfm::ACCESS_IO || m_io_read[address & 1].isnull()) ? 0 : m_io_read[address & 1](); + return (type != ymfm::ACCESS_IO) ? 0 : m_io_read[address & 1](); } // the chip implementation calls this whenever data is written outside // of the chip; our responsibility is to pass the written data on to any consumers virtual void ymfm_external_write(ymfm::access_class type, uint32_t address, uint8_t data) override { - if (type == ymfm::ACCESS_IO && !m_io_write[address & 1].isnull()) + if (type == ymfm::ACCESS_IO) m_io_write[address & 1](data); } @@ -140,13 +139,6 @@ protected: for (int tnum = 0; tnum < 2; tnum++) m_timer[tnum] = timer_alloc(FUNC(ym_generic_device::fm_timer_handler), this); - // resolve the handlers - m_update_irq.resolve(); - m_io_read[0].resolve(); - m_io_read[1].resolve(); - m_io_write[0].resolve(); - m_io_write[1].resolve(); - // remember the busy end time save_item(NAME(m_busy_end)); } @@ -157,11 +149,11 @@ protected: void fm_timer_handler(int param) { m_engine->engine_timer_expired(param); } // internal state - attotime m_busy_end; // busy end time - emu_timer *m_timer[2]; // two timers - devcb_write_line m_update_irq; // IRQ update callback - devcb_read8 m_io_read[2]; // up to 2 input port handlers - devcb_write8 m_io_write[2]; // up to 2 output port handlers + attotime m_busy_end; // busy end time + emu_timer *m_timer[2]; // two timers + devcb_write_line m_update_irq; // IRQ update callback + devcb_read8::array<2> m_io_read; // up to 2 input port handlers + devcb_write8::array<2> m_io_write; // up to 2 output port handlers }; diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp index 82fd7ed9c77..8eced2f7fa8 100644 --- a/src/devices/sound/ymz280b.cpp +++ b/src/devices/sound/ymz280b.cpp @@ -67,7 +67,7 @@ void ymz280b_device::update_irq_state() if (irq_bits && !m_irq_state) { m_irq_state = 1; - if (!m_irq_handler.isnull()) + if (!m_irq_handler.isunset()) m_irq_handler(1); else logerror("YMZ280B: IRQ generated, but no callback specified!\n"); @@ -75,7 +75,7 @@ void ymz280b_device::update_irq_state() else if (!irq_bits && m_irq_state) { m_irq_state = 0; - if (!m_irq_handler.isnull()) + if (!m_irq_handler.isunset()) m_irq_handler(0); else logerror("YMZ280B: IRQ generated, but no callback specified!\n"); @@ -554,7 +554,6 @@ void ymz280b_device::device_start() /* initialize the rest of the structure */ m_master_clock = (double)clock() / 384.0; - m_irq_handler.resolve(); for (int i = 0; i < 8; i++) { diff --git a/src/devices/sound/zsg2.cpp b/src/devices/sound/zsg2.cpp index 518d765ccc3..66072775500 100644 --- a/src/devices/sound/zsg2.cpp +++ b/src/devices/sound/zsg2.cpp @@ -120,7 +120,7 @@ zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_ , device_sound_interface(mconfig, *this) , m_mem_base(*this, DEVICE_SELF) , m_read_address(0) - , m_ext_read_handler(*this) + , m_ext_read_handler(*this, 0) { } @@ -130,8 +130,6 @@ zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_ void zsg2_device::device_start() { - m_ext_read_handler.resolve(); - memset(&m_chan, 0, sizeof(m_chan)); m_stream = stream_alloc(0, 4, clock() / 768); @@ -227,7 +225,7 @@ uint32_t zsg2_device::read_memory(uint32_t offset) if (offset >= m_mem_blocks) return 0; - if (m_ext_read_handler.isnull()) + if (m_ext_read_handler.isunset()) return m_mem_base[offset]; return m_ext_read_handler(offset); diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp index 1b87b1a8bba..bc35a956bab 100644 --- a/src/devices/video/315_5124.cpp +++ b/src/devices/video/315_5124.cpp @@ -518,9 +518,7 @@ TIMER_CALLBACK_MEMBER(sega315_5124_device::trigger_hint) if (BIT(m_reg[0x00], 4)) { m_n_int_state = 0; - - if (!m_n_int_cb.isnull()) - m_n_int_cb(ASSERT_LINE); + m_n_int_cb(ASSERT_LINE); } } } @@ -532,9 +530,7 @@ TIMER_CALLBACK_MEMBER(sega315_5124_device::trigger_vint) if (BIT(m_reg[0x01], 5)) { m_n_int_state = 0; - - if (!m_n_int_cb.isnull()) - m_n_int_cb(ASSERT_LINE); + m_n_int_cb(ASSERT_LINE); } } } @@ -564,8 +560,7 @@ void sega315_5124_device::vblank_end(int vpos) void sega315_5377_device::vblank_end(int vpos) { // Assume the VBlank line is used to trigger the NMI logic performed by the 315-5378 chip. - if (!m_vblank_cb.isnull()) - m_vblank_cb(0); + m_vblank_cb(0); } @@ -581,19 +576,16 @@ TIMER_CALLBACK_MEMBER(sega315_5124_device::process_line_timer) m_reg8copy = m_reg[0x08]; /* Check if the /CSYNC signal must be active (low) */ - if (!m_n_csync_cb.isnull()) - { - /* /CSYNC is signals /HSYNC and /VSYNC (both internals) ANDed together. - According to Charles MacDonald, /HSYNC goes low for 28 pixels on beginning - (before active screen) of all lines except on vertical sync area, where - /VSYNC goes low for 3 full lines, and except the two lines that follows, - because /VSYNC goes high for another line and remains high until the - active screen of the next line, what avoids a /HSYNC pulse there. - */ - if (vpos == 0 || vpos > (m_frame_timing[VERTICAL_SYNC] + 1)) - { - m_n_csync_cb(0); - } + /* /CSYNC is signals /HSYNC and /VSYNC (both internals) ANDed together. + According to Charles MacDonald, /HSYNC goes low for 28 pixels on beginning + (before active screen) of all lines except on vertical sync area, where + /VSYNC goes low for 3 full lines, and except the two lines that follows, + because /VSYNC goes high for another line and remains high until the + active screen of the next line, what avoids a /HSYNC pulse there. + */ + if (vpos == 0 || vpos > (m_frame_timing[VERTICAL_SYNC] + 1)) + { + m_n_csync_cb(0); } vpos_limit -= m_frame_timing[BOTTOM_BLANKING]; @@ -633,8 +625,7 @@ TIMER_CALLBACK_MEMBER(sega315_5124_device::process_line_timer) { m_vint_timer->adjust(screen().time_until_pos(vpos, m_line_timing[VINT_HPOS])); m_pending_status |= STATUS_VINT; - if (!m_vblank_cb.isnull()) - m_vblank_cb(1); + m_vblank_cb(1); } /* Draw borders */ @@ -789,9 +780,7 @@ u8 sega315_5124_device::control_read() if (m_n_int_state == 0) { m_n_int_state = 1; - - if (!m_n_int_cb.isnull()) - m_n_int_cb(CLEAR_LINE); + m_n_int_cb(CLEAR_LINE); } } @@ -945,11 +934,7 @@ void sega315_5124_device::control_write(u8 data) if (m_n_int_state == 0) { m_n_int_state = 1; - - if (!m_n_int_cb.isnull()) - { - m_n_int_cb(CLEAR_LINE); - } + m_n_int_cb(CLEAR_LINE); } } else @@ -961,9 +946,7 @@ void sega315_5124_device::control_write(u8 data) // Assume the same behavior for reg0+HINT. // m_n_int_state = 0; - - if (!m_n_int_cb.isnull()) - m_n_int_cb(ASSERT_LINE); + m_n_int_cb(ASSERT_LINE); } } m_addrmode = 0; @@ -2003,12 +1986,6 @@ void sega315_5124_device::device_post_load() void sega315_5124_device::device_start() { - /* Resolve callbacks */ - m_vblank_cb.resolve(); - m_n_csync_cb.resolve(); - m_n_int_cb.resolve(); - m_n_nmi_cb.resolve(); - /* Make temp bitmap for rendering */ screen().register_screen_bitmap(m_tmpbitmap); screen().register_screen_bitmap(m_y1_bitmap); diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp index 9d79b2dc396..57b32a642a9 100644 --- a/src/devices/video/315_5313.cpp +++ b/src/devices/video/315_5313.cpp @@ -299,10 +299,6 @@ void sega315_5313_device::device_post_load() void sega315_5313_device::device_start() { - m_sndirqline_callback.resolve_safe(); - m_lv6irqline_callback.resolve_safe(); - m_lv4irqline_callback.resolve_safe(); - m_32x_scanline_func.resolve(); m_32x_interrupt_func.resolve(); m_32x_scanline_helper_func.resolve(); diff --git a/src/devices/video/atirage.cpp b/src/devices/video/atirage.cpp index cdacbddb0c8..0aff30e95e4 100644 --- a/src/devices/video/atirage.cpp +++ b/src/devices/video/atirage.cpp @@ -86,7 +86,7 @@ atirage_device::atirage_device(const machine_config &mconfig, device_type type, : pci_device(mconfig, type, tag, owner, clock), m_mach64(*this, "vga"), m_screen(*this, "screen"), - read_gpio(*this), + read_gpio(*this, 0), write_gpio(*this) { m_hres = m_vres = m_htotal = m_vtotal = m_format = 0; @@ -141,9 +141,6 @@ void atirage_device::config_map(address_map &map) void atirage_device::device_start() { - read_gpio.resolve_safe(0); - write_gpio.resolve_safe(); - pci_device::device_start(); add_map(0x1000000, M_MEM, FUNC(atirage_device::mem_map)); // 16 MB memory map diff --git a/src/devices/video/catseye.cpp b/src/devices/video/catseye.cpp index ee11dbdecea..11ca2677475 100644 --- a/src/devices/video/catseye.cpp +++ b/src/devices/video/catseye.cpp @@ -68,8 +68,6 @@ catseye_device::catseye_device(const machine_config &mconfig, const char *tag, d void catseye_device::device_start() { - m_int_write_func.resolve_safe(); - m_blink_timer = timer_alloc(FUNC(catseye_device::blink_callback), this); m_blink_timer->adjust(attotime::from_hz(3)); diff --git a/src/devices/video/cdp1861.cpp b/src/devices/video/cdp1861.cpp index e19074045aa..ca59bc51eee 100644 --- a/src/devices/video/cdp1861.cpp +++ b/src/devices/video/cdp1861.cpp @@ -109,11 +109,6 @@ void cdp1861_device::device_config_complete() void cdp1861_device::device_start() { - // resolve callbacks - m_write_int.resolve_safe(); - m_write_dma_out.resolve_safe(); - m_write_efx.resolve_safe(); - // allocate timers m_int_timer = timer_alloc(FUNC(cdp1861_device::int_tick), this); m_efx_timer = timer_alloc(FUNC(cdp1861_device::efx_tick), this); diff --git a/src/devices/video/cdp1862.cpp b/src/devices/video/cdp1862.cpp index 66fa8d9e684..437c246f229 100644 --- a/src/devices/video/cdp1862.cpp +++ b/src/devices/video/cdp1862.cpp @@ -78,12 +78,12 @@ inline void cdp1862_device::initialize_palette() // cdp1862_device - constructor //------------------------------------------------- -cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, CDP1862, tag, owner, clock), - device_video_interface(mconfig, *this), - m_read_rd(*this), - m_read_bd(*this), - m_read_gd(*this) +cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CDP1862, tag, owner, clock), + device_video_interface(mconfig, *this), + m_read_rd(*this, 0), + m_read_bd(*this, 0), + m_read_gd(*this, 0) { } @@ -94,11 +94,6 @@ cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, d void cdp1862_device::device_start() { - // resolve callbacks - m_read_rd.resolve_safe(0); - m_read_bd.resolve_safe(0); - m_read_gd.resolve_safe(0); - // find devices screen().register_screen_bitmap(m_bitmap); diff --git a/src/devices/video/cesblit.cpp b/src/devices/video/cesblit.cpp index 7e0e6a2085b..a5837fcfdc1 100644 --- a/src/devices/video/cesblit.cpp +++ b/src/devices/video/cesblit.cpp @@ -92,9 +92,6 @@ device_memory_interface::space_config_vector cesblit_device::memory_space_config void cesblit_device::device_start() { - // resolve callbacks - m_blit_irq_cb.resolve(); - // default to rom reading from a region m_space = &space(AS_PROGRAM); memory_region *region = memregion(tag()); @@ -146,13 +143,13 @@ void cesblit_device::regs_w(offs_t offset, uint16_t data, uint16_t mem_mask) // case 0x00/2: // bit 15: FPGA programming serial in (lsb first) case 0x10/2: - if (!m_blit_irq_cb.isnull() && !BIT(olddata, 3) && BIT(newdata, 3)) + if (!BIT(olddata, 3) && BIT(newdata, 3)) m_blit_irq_cb(CLEAR_LINE); break; case 0x0e/2: do_blit(); - if (!m_blit_irq_cb.isnull() && BIT(m_regs[0x10/2], 3)) + if (BIT(m_regs[0x10/2], 3)) m_blit_irq_cb(ASSERT_LINE); break; } diff --git a/src/devices/video/crt9007.cpp b/src/devices/video/crt9007.cpp index 347a06382a1..eac1717e41a 100644 --- a/src/devices/video/crt9007.cpp +++ b/src/devices/video/crt9007.cpp @@ -476,29 +476,6 @@ crt9007_device::crt9007_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 crt9007_device::device_resolve_objects() -{ - // resolve callbacks - m_write_int.resolve_safe(); - m_write_dmar.resolve_safe(); - m_write_hs.resolve_safe(); - m_write_vs.resolve_safe(); - m_write_vlt.resolve_safe(); - m_write_curs.resolve_safe(); - m_write_drb.resolve_safe(); - m_write_wben.resolve_safe(); - m_write_cblank.resolve_safe(); - m_write_slg.resolve_safe(); - m_write_sld.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/video/crt9007.h b/src/devices/video/crt9007.h index 433ca521f01..9ea8b3b9a48 100644 --- a/src/devices/video/crt9007.h +++ b/src/devices/video/crt9007.h @@ -72,14 +72,13 @@ public: void lpstb_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; virtual void device_post_load() override; virtual void device_clock_changed() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; TIMER_CALLBACK_MEMBER(hsync_update); diff --git a/src/devices/video/crt9028.cpp b/src/devices/video/crt9028.cpp index 94cc2429e13..7ed0c398c2f 100644 --- a/src/devices/video/crt9028.cpp +++ b/src/devices/video/crt9028.cpp @@ -148,19 +148,6 @@ device_memory_interface::space_config_vector crt9028_device::memory_space_config //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void crt9028_device::device_resolve_objects() -{ - m_hsync_callback.resolve_safe(); - m_vsync_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/video/crt9028.h b/src/devices/video/crt9028.h index d8aa637c06a..e42598c96de 100644 --- a/src/devices/video/crt9028.h +++ b/src/devices/video/crt9028.h @@ -66,12 +66,11 @@ protected: u16 thin_gfx_seg1, u16 thin_gfx_seg2, u16 thin_gfx_seg3, u16 thin_gfx_seg4, u8 thin_gfx_dots1, u8 thin_gfx_dots2, u8 thin_gfx_dots3, u8 thin_gfx_dots4); - // device-specific overrides + // device_t implementation virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; private: diff --git a/src/devices/video/crt9212.cpp b/src/devices/video/crt9212.cpp index 5bbcd8aaac7..7e13f75fd5a 100644 --- a/src/devices/video/crt9212.cpp +++ b/src/devices/video/crt9212.cpp @@ -61,11 +61,6 @@ crt9212_device::crt9212_device(const machine_config &mconfig, const char *tag, d void crt9212_device::device_start() { - // resolve callbacks - m_write_dout.resolve_safe(); - m_write_rof.resolve_safe(); - m_write_wof.resolve_safe(); - // state saving save_item(NAME(m_data)); save_item(NAME(m_clrcnt)); diff --git a/src/devices/video/crtc_ega.cpp b/src/devices/video/crtc_ega.cpp index 4ce861fbf8a..15131095fd3 100644 --- a/src/devices/video/crtc_ega.cpp +++ b/src/devices/video/crtc_ega.cpp @@ -238,9 +238,7 @@ void crtc_ega_device::set_de(int state) if (m_de != state) { m_de = state; - - if (!m_res_out_de_cb.isnull()) - m_res_out_de_cb(m_de); + m_res_out_de_cb(m_de); } } @@ -250,9 +248,7 @@ void crtc_ega_device::set_hsync(int state) if (m_hsync != state) { m_hsync = state; - - if (!m_res_out_hsync_cb.isnull()) - m_res_out_hsync_cb(m_hsync); + m_res_out_hsync_cb(m_hsync); } } @@ -262,9 +258,7 @@ void crtc_ega_device::set_vsync(int state) if (m_vsync != state) { m_vsync = state; - - if (!m_res_out_vsync_cb.isnull()) - m_res_out_vsync_cb(m_vsync); + m_res_out_vsync_cb(m_vsync); } } @@ -274,10 +268,8 @@ void crtc_ega_device::set_vblank(int state) if (m_vblank != state) { m_vblank = state; - - if (!m_res_out_vblank_cb.isnull()) - m_res_out_vblank_cb(m_vblank); - if (!m_res_out_irq_cb.isnull() && !m_irq_enable) + m_res_out_vblank_cb(m_vblank); + if (!m_irq_enable) m_res_out_irq_cb(m_vblank); if (state) m_disp_start_addr = m_start_addr_latch; @@ -290,9 +282,7 @@ void crtc_ega_device::set_cur(int state) if (m_cur != state) { m_cur = state; - -// if (!m_res_out_cur_cb.isnull()) -// m_res_out_cur_cb(m_cur); +// m_res_out_cur_cb(m_cur); } } @@ -596,13 +586,6 @@ void crtc_ega_device::device_start() assert(m_clock > 0); assert(m_hpixels_per_column > 0); - /* resolve callbacks */ - m_res_out_de_cb.resolve(); - m_res_out_hsync_cb.resolve(); - m_res_out_vsync_cb.resolve(); - m_res_out_vblank_cb.resolve(); - m_res_out_irq_cb.resolve(); - /* bind delegates */ m_begin_update_cb.resolve(); m_row_update_cb.resolve(); @@ -701,20 +684,11 @@ void crtc_ega_device::device_start() void crtc_ega_device::device_reset() { /* internal registers other than status remain unchanged, all outputs go low */ - if (!m_res_out_de_cb.isnull()) - m_res_out_de_cb(false); - - if (!m_res_out_hsync_cb.isnull()) - m_res_out_hsync_cb(false); - - if (!m_res_out_vsync_cb.isnull()) - m_res_out_vsync_cb(false); - - if (!m_res_out_vblank_cb.isnull()) - m_res_out_vblank_cb(false); - - if(!m_res_out_irq_cb.isnull()) - m_res_out_irq_cb(false); + m_res_out_de_cb(false); + m_res_out_hsync_cb(false); + m_res_out_vsync_cb(false); + m_res_out_vblank_cb(false); + m_res_out_irq_cb(false); if (!m_line_timer->enabled()) { diff --git a/src/devices/video/decsfb.cpp b/src/devices/video/decsfb.cpp index 716941d18cc..df302d076f4 100644 --- a/src/devices/video/decsfb.cpp +++ b/src/devices/video/decsfb.cpp @@ -43,8 +43,6 @@ decsfb_device::decsfb_device(const machine_config &mconfig, const char *tag, dev void decsfb_device::device_start() { - m_int_cb.resolve_safe(); - save_item(NAME(m_vram)); save_item(NAME(m_regs)); save_item(NAME(m_copy_src)); diff --git a/src/devices/video/dl1416.cpp b/src/devices/video/dl1416.cpp index 09111840fe2..b50a6c72452 100644 --- a/src/devices/video/dl1416.cpp +++ b/src/devices/video/dl1416.cpp @@ -214,8 +214,6 @@ dl1416_device::dl1416_device( void dl1414_device::device_start() { - m_update_cb.resolve_safe(); - // register for state saving save_item(NAME(m_digit_ram)); save_item(NAME(m_cursor_state)); diff --git a/src/devices/video/dm9368.cpp b/src/devices/video/dm9368.cpp index 4702430403b..57d59366e2e 100644 --- a/src/devices/video/dm9368.cpp +++ b/src/devices/video/dm9368.cpp @@ -63,14 +63,6 @@ void dm9368_device::a_w(u8 data) } -void dm9368_device::device_resolve_objects() -{ - // resolve callbacks - m_update_cb.resolve_safe(); - m_rbo_cb.resolve_safe(); -} - - void dm9368_device::device_start() { // state saving diff --git a/src/devices/video/dm9368.h b/src/devices/video/dm9368.h index 3b1157c89d1..556b5b6313f 100644 --- a/src/devices/video/dm9368.h +++ b/src/devices/video/dm9368.h @@ -44,8 +44,7 @@ public: int rbo_r() { return m_rbo; } protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; void update(); diff --git a/src/devices/video/dp8350.cpp b/src/devices/video/dp8350.cpp index 4cfd886a822..c14a93b8958 100644 --- a/src/devices/video/dp8350.cpp +++ b/src/devices/video/dp8350.cpp @@ -194,24 +194,6 @@ void dp835x_device::device_config_complete() //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void dp835x_device::device_resolve_objects() -{ - m_lrc_callback.resolve_safe(); - m_clc_callback.resolve_safe(); - m_lc_callback.resolve_safe(); - m_lbre_callback.resolve_safe(); - m_hsync_callback.resolve_safe(); - m_vsync_callback.resolve_safe(); - m_vblank_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/devices/video/dp8350.h b/src/devices/video/dp8350.h index c1707ba3a44..ee4700cffdf 100644 --- a/src/devices/video/dp8350.h +++ b/src/devices/video/dp8350.h @@ -81,9 +81,8 @@ protected: bool cursor_on_all_lines, int lbc_0_width, int hsync_serration, bool hsync_active, bool vsync_active, bool vblank_active); - // device-specific overrides + // device_t implementation virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_clock_changed() override; virtual void device_reset() override; diff --git a/src/devices/video/ef9340_1.cpp b/src/devices/video/ef9340_1.cpp index deb26990e16..c218645208c 100644 --- a/src/devices/video/ef9340_1.cpp +++ b/src/devices/video/ef9340_1.cpp @@ -40,7 +40,7 @@ ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag, , device_video_interface(mconfig, *this) , m_charset(*this, "ef9340_1") , m_write_exram(*this) - , m_read_exram(*this) + , m_read_exram(*this, 0xff) { m_offset_x = 0; m_offset_y = 0; @@ -61,9 +61,6 @@ const tiny_rom_entry *ef9340_1_device::device_rom_region() const void ef9340_1_device::device_start() { - m_write_exram.resolve_safe(); - m_read_exram.resolve_safe(0xff); - // let the screen create our temporary bitmap with the screen's dimensions screen().register_screen_bitmap(m_tmp_bitmap); diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp index 85a3291b1b2..899ccb8f4f3 100644 --- a/src/devices/video/ef9365.cpp +++ b/src/devices/video/ef9365.cpp @@ -312,8 +312,6 @@ void ef9365_device::set_color_filler(uint8_t color) void ef9365_device::device_start() { - m_irq_handler.resolve_safe(); - m_busy_timer = timer_alloc(FUNC(ef9365_device::clear_busy_flag), this); m_videoram = &space(0); diff --git a/src/devices/video/epic12.cpp b/src/devices/video/epic12.cpp index 15a2fc69792..515c29929a3 100644 --- a/src/devices/video/epic12.cpp +++ b/src/devices/video/epic12.cpp @@ -36,7 +36,7 @@ epic12_device::epic12_device(const machine_config &mconfig, const char *tag, dev , m_ram16(nullptr), m_gfx_size(0), m_bitmaps(nullptr), m_use_ram(nullptr) , m_main_ramsize(0), m_main_rammask(0), m_ram16_copy(nullptr), m_work_queue(nullptr) , m_maincpu(*this, finder_base::DUMMY_TAG) - , m_port_r_cb(*this) + , m_port_r_cb(*this, 0) { m_blitter_request = nullptr; m_blitter_delay_timer = nullptr; @@ -61,8 +61,6 @@ TIMER_CALLBACK_MEMBER(epic12_device::blitter_delay_callback) void epic12_device::device_start() { - m_port_r_cb.resolve_safe(0); - m_gfx_size = 0x2000 * 0x1000; m_bitmaps = std::make_unique<bitmap_rgb32>(0x2000, 0x1000); m_clip = m_bitmaps->cliprect(); diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp index 78c278b1aa5..7b69e7a27ab 100644 --- a/src/devices/video/gba_lcd.cpp +++ b/src/devices/video/gba_lcd.cpp @@ -1654,16 +1654,11 @@ TIMER_CALLBACK_MEMBER(gba_lcd_device::perform_hbl) if (scanline < 160) { draw_scanline(scanline); - - if (!m_dma_hblank_cb.isnull()) - m_dma_hblank_cb(ASSERT_LINE); + m_dma_hblank_cb(ASSERT_LINE); } if (is_set(dispstat::hblank_irq_en)) - { - if (!m_int_hblank_cb.isnull()) - m_int_hblank_cb(ASSERT_LINE); - } + m_int_hblank_cb(ASSERT_LINE); set(dispstat::hblank); @@ -1686,13 +1681,9 @@ TIMER_CALLBACK_MEMBER(gba_lcd_device::perform_scan) if (scanline == 160) { if (is_set(dispstat::vblank_irq_en)) - { - if (!m_int_vblank_cb.isnull()) - m_int_vblank_cb(ASSERT_LINE); - } + m_int_vblank_cb(ASSERT_LINE); - if (!m_dma_vblank_cb.isnull()) - m_dma_vblank_cb(ASSERT_LINE); + m_dma_vblank_cb(ASSERT_LINE); } } else @@ -1706,10 +1697,7 @@ TIMER_CALLBACK_MEMBER(gba_lcd_device::perform_scan) set(dispstat::vcount); if (is_set(dispstat::vcount_irq_en)) - { - if (!m_int_vcount_cb.isnull()) - m_int_vcount_cb(ASSERT_LINE); - } + m_int_vcount_cb(ASSERT_LINE); } m_hbl_timer->adjust(screen().time_until_pos(scanline, 240)); @@ -1739,13 +1727,6 @@ uint32_t gba_lcd_device::screen_update(screen_device &screen, bitmap_ind16 &bitm void gba_lcd_device::device_start() { - /* resolve callbacks */ - m_int_hblank_cb.resolve(); - m_int_vblank_cb.resolve(); - m_int_vcount_cb.resolve(); - m_dma_hblank_cb.resolve(); - m_dma_vblank_cb.resolve(); - m_pram = make_unique_clear<uint32_t[]>(0x400 / 4); m_vram = make_unique_clear<uint32_t[]>(0x18000 / 4); m_oam = make_unique_clear<uint32_t[]>(0x400 / 4); diff --git a/src/devices/video/hd44352.cpp b/src/devices/video/hd44352.cpp index 12d431b21ef..c5da136331e 100644 --- a/src/devices/video/hd44352.cpp +++ b/src/devices/video/hd44352.cpp @@ -55,8 +55,6 @@ void hd44352_device::device_validity_check(validity_checker &valid) const void hd44352_device::device_start() { - m_on_cb.resolve_safe(); - m_on_timer = timer_alloc(FUNC(hd44352_device::on_tick), this); m_on_timer->adjust(attotime::from_hz(m_clock/16384), 0, attotime::from_hz(m_clock/16384)); diff --git a/src/devices/video/hd61603.cpp b/src/devices/video/hd61603.cpp index 49a21cc779b..bdc2cd7aa66 100644 --- a/src/devices/video/hd61603.cpp +++ b/src/devices/video/hd61603.cpp @@ -35,9 +35,6 @@ hd61603_device::hd61603_device(const machine_config &mconfig, const char *tag, d void hd61603_device::device_start() { - // resolve callbacks - m_write_segs.resolve_safe(); - // zerofill m_blank = 0; m_count = 0; diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp index 9d2a8a5eb67..d499b873ba3 100644 --- a/src/devices/video/hd61830.cpp +++ b/src/devices/video/hd61830.cpp @@ -79,7 +79,7 @@ hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, d device_t(mconfig, HD61830, tag, owner, clock), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), - m_read_rd(*this), + m_read_rd(*this, 0), m_bf(false), m_cac(0), m_blink(0), @@ -99,9 +99,6 @@ void hd61830_device::device_start() // allocate timers m_busy_timer = timer_alloc(FUNC(hd61830_device::clear_busy_flag), this); - // resolve callbacks - m_read_rd.resolve_safe(0); - // register for state saving save_item(NAME(m_bf)); save_item(NAME(m_ir)); diff --git a/src/devices/video/hlcd0438.cpp b/src/devices/video/hlcd0438.cpp index 64f95711c8b..f92683f79ee 100644 --- a/src/devices/video/hlcd0438.cpp +++ b/src/devices/video/hlcd0438.cpp @@ -33,10 +33,6 @@ hlcd0438_device::hlcd0438_device(const machine_config &mconfig, const char *tag, void hlcd0438_device::device_start() { - // resolve callbacks - m_write_segs.resolve_safe(); - m_write_data.resolve_safe(); - // timer (when LCD pin is oscillator) m_lcd_timer = timer_alloc(FUNC(hlcd0438_device::toggle_lcd), this); attotime period = (clock() != 0) ? attotime::from_hz(2 * clock()) : attotime::never; diff --git a/src/devices/video/hlcd0488.cpp b/src/devices/video/hlcd0488.cpp index 0c0189ccdcd..016bad5f73d 100644 --- a/src/devices/video/hlcd0488.cpp +++ b/src/devices/video/hlcd0488.cpp @@ -33,7 +33,6 @@ hlcd0488_device::hlcd0488_device(const machine_config &mconfig, const char *tag, void hlcd0488_device::device_start() { - m_write_cols.resolve_safe(); m_sync_timer = timer_alloc(FUNC(hlcd0488_device::sync_update), this); // zerofill diff --git a/src/devices/video/hlcd0515.cpp b/src/devices/video/hlcd0515.cpp index edccd8b147e..5598391bba2 100644 --- a/src/devices/video/hlcd0515.cpp +++ b/src/devices/video/hlcd0515.cpp @@ -58,10 +58,6 @@ hlcd0601_device::hlcd0601_device(const machine_config &mconfig, const char *tag, void hlcd0515_device::device_start() { - // resolve callbacks - m_write_cols.resolve_safe(); - m_write_data.resolve_safe(); - // timer m_lcd_timer = timer_alloc(FUNC(hlcd0515_device::scan_lcd), this); attotime period = attotime::from_hz(clock() / 2); diff --git a/src/devices/video/hlcd0538.cpp b/src/devices/video/hlcd0538.cpp index f36f479d76f..8ec3ed2be62 100644 --- a/src/devices/video/hlcd0538.cpp +++ b/src/devices/video/hlcd0538.cpp @@ -46,10 +46,6 @@ hlcd0539_device::hlcd0539_device(const machine_config &mconfig, const char *tag, void hlcd0538_device::device_start() { - // resolve callbacks - m_write_cols.resolve_safe(); - m_write_interrupt.resolve_safe(); - // timer (when LCD pin is oscillator) m_lcd_timer = timer_alloc(FUNC(hlcd0538_device::toggle_lcd), this); attotime period = (clock() != 0) ? attotime::from_hz(2 * clock()) : attotime::never; diff --git a/src/devices/video/huc6202.cpp b/src/devices/video/huc6202.cpp index b6e8fc442dd..abb81c076af 100644 --- a/src/devices/video/huc6202.cpp +++ b/src/devices/video/huc6202.cpp @@ -17,17 +17,17 @@ DEFINE_DEVICE_TYPE(HUC6202, huc6202_device, "huc6202", "Hudson HuC6202 VPC") huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HUC6202, tag, owner, clock) - , m_next_pixel_0_cb(*this) - , m_time_til_next_event_0_cb(*this) + , m_next_pixel_0_cb(*this, 0) + , m_time_til_next_event_0_cb(*this, 1) , m_vsync_changed_0_cb(*this) , m_hsync_changed_0_cb(*this) - , m_read_0_cb(*this) + , m_read_0_cb(*this, 0) , m_write_0_cb(*this) - , m_next_pixel_1_cb(*this) - , m_time_til_next_event_1_cb(*this) + , m_next_pixel_1_cb(*this, 0) + , m_time_til_next_event_1_cb(*this, 1) , m_vsync_changed_1_cb(*this) , m_hsync_changed_1_cb(*this) - , m_read_1_cb(*this) + , m_read_1_cb(*this, 0) , m_write_1_cb(*this) , m_window1(0), m_window2(0), m_io_device(0), m_map_index(0), m_map_dirty(0) { @@ -297,34 +297,15 @@ void huc6202_device::io_write(offs_t offset, u8 data) void huc6202_device::device_start() { - /* Resolve callbacks */ - m_next_pixel_0_cb.resolve(); - m_time_til_next_event_0_cb.resolve(); - m_hsync_changed_0_cb.resolve(); - m_vsync_changed_0_cb.resolve(); - m_read_0_cb.resolve(); - m_write_0_cb.resolve(); - - m_next_pixel_1_cb.resolve(); - m_time_til_next_event_1_cb.resolve(); - m_hsync_changed_1_cb.resolve(); - m_vsync_changed_1_cb.resolve(); - m_read_1_cb.resolve(); - m_write_1_cb.resolve(); - /* We want all our callbacks to be resolved */ - assert( ! m_next_pixel_0_cb.isnull() ); - assert( ! m_time_til_next_event_0_cb.isnull() ); - assert( ! m_hsync_changed_0_cb.isnull() ); - assert( ! m_vsync_changed_0_cb.isnull() ); - assert( ! m_read_0_cb.isnull() ); - assert( ! m_write_0_cb.isnull() ); - assert( ! m_next_pixel_1_cb.isnull() ); - assert( ! m_time_til_next_event_1_cb.isnull() ); - assert( ! m_hsync_changed_1_cb.isnull() ); - assert( ! m_vsync_changed_1_cb.isnull() ); - assert( ! m_read_1_cb.isnull() ); - assert( ! m_write_1_cb.isnull() ); + assert(!m_next_pixel_0_cb.isunset()); + assert(!m_time_til_next_event_0_cb.isunset()); + assert(!m_read_0_cb.isunset()); + assert(!m_write_0_cb.isunset()); + assert(!m_next_pixel_1_cb.isunset()); + assert(!m_time_til_next_event_1_cb.isunset()); + assert(!m_read_1_cb.isunset()); + assert(!m_write_1_cb.isunset()); /* Register save items */ save_item(NAME(m_prio[0].prio_type)); diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp index a4859e5db74..68078052ebc 100644 --- a/src/devices/video/huc6260.cpp +++ b/src/devices/video/huc6260.cpp @@ -51,14 +51,14 @@ void huc6260_device::palette_init() DEFINE_DEVICE_TYPE(HUC6260, huc6260_device, "huc6260", "Hudson HuC6260 VCE") -huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, HUC6260, tag, owner, clock), - device_palette_interface(mconfig, *this), - device_video_interface(mconfig, *this), - m_next_pixel_data_cb(*this), - m_time_til_next_event_cb(*this), - m_vsync_changed_cb(*this), - m_hsync_changed_cb(*this) +huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, HUC6260, tag, owner, clock), + device_palette_interface(mconfig, *this), + device_video_interface(mconfig, *this), + m_next_pixel_data_cb(*this, 0), + m_time_til_next_event_cb(*this, 1), + m_vsync_changed_cb(*this), + m_hsync_changed_cb(*this) { } @@ -257,17 +257,9 @@ void huc6260_device::device_start() m_timer = timer_alloc(FUNC(huc6260_device::update_events), this); m_bmp = std::make_unique<bitmap_ind16>(WPF, LPF); - /* Resolve callbacks */ - m_hsync_changed_cb.resolve(); - m_vsync_changed_cb.resolve(); - m_next_pixel_data_cb.resolve(); - m_time_til_next_event_cb.resolve(); - /* We want to have a valid screen and valid callbacks */ - assert( ! m_hsync_changed_cb.isnull() ); - assert( ! m_vsync_changed_cb.isnull() ); - assert( ! m_next_pixel_data_cb.isnull() ); - assert( ! m_time_til_next_event_cb.isnull() ); + assert(!m_next_pixel_data_cb.isunset()); + assert(!m_time_til_next_event_cb.isunset()); palette_init(); diff --git a/src/devices/video/huc6270.cpp b/src/devices/video/huc6270.cpp index 3e993bde8c6..009b9766fab 100644 --- a/src/devices/video/huc6270.cpp +++ b/src/devices/video/huc6270.cpp @@ -846,9 +846,6 @@ void huc6270_device::write(offs_t offset, u8 data) void huc6270_device::device_start() { - /* Resolve callbacks */ - m_irq_changed_cb.resolve_safe(); - m_vram = make_unique_clear<uint16_t[]>(m_vram_size/sizeof(uint16_t)); m_vram_mask = (m_vram_size >> 1) - 1; diff --git a/src/devices/video/huc6272.cpp b/src/devices/video/huc6272.cpp index bd046584f42..11a06429fca 100644 --- a/src/devices/video/huc6272.cpp +++ b/src/devices/video/huc6272.cpp @@ -172,8 +172,6 @@ void huc6272_device::device_validity_check(validity_checker &valid) const void huc6272_device::device_start() { - m_irq_changed_cb.resolve_safe(); - save_item(NAME(m_register)); save_item(NAME(m_kram_addr_r)); save_item(NAME(m_kram_inc_r)); diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp index 622d5c056df..6df1f3b9142 100644 --- a/src/devices/video/i8244.cpp +++ b/src/devices/video/i8244.cpp @@ -150,8 +150,6 @@ void i8244_device::i8244_palette(palette_device &palette) const void i8244_device::device_start() { - m_irq_func.resolve_safe(); - // allocate timers m_vblank_timer = timer_alloc(FUNC(i8244_device::vblank_start), this); m_vblank_timer->adjust(screen().time_until_pos(m_vblank_start, m_hblank_start - 1), 0, screen().frame_period()); diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp index c771772d54d..4fb3e87e1f6 100644 --- a/src/devices/video/i82730.cpp +++ b/src/devices/video/i82730.cpp @@ -73,9 +73,6 @@ void i82730_device::device_start() // register bitmap screen().register_screen_bitmap(m_bitmap); - // resolve callbacks - m_sint_handler.resolve_safe(); - // bind delegates m_update_row_cb.resolve(); diff --git a/src/devices/video/i8275.cpp b/src/devices/video/i8275.cpp index 0f371d8edf9..b11db64d8df 100644 --- a/src/devices/video/i8275.cpp +++ b/src/devices/video/i8275.cpp @@ -149,12 +149,7 @@ void i8275_device::device_start() // get the screen device screen().register_screen_bitmap(m_bitmap); - // resolve callbacks - m_write_drq.resolve_safe(); - m_write_irq.resolve_safe(); - m_write_hrtc.resolve_safe(); - m_write_vrtc.resolve_safe(); - m_write_lc.resolve_safe(); + // resolve delegates m_display_cb.resolve_safe(); // allocate timers diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp index 27358440af1..7f8706f5e10 100644 --- a/src/devices/video/imagetek_i4100.cpp +++ b/src/devices/video/imagetek_i4100.cpp @@ -383,15 +383,10 @@ void imagetek_i4100_device::device_start() m_gfxrom_size = m_gfxrom.bytes(); - m_irq_cb.resolve_safe(); m_blit_done_timer = timer_alloc(FUNC(imagetek_i4100_device::blit_done), this); m_spritelist = std::make_unique<sprite_t []>(0x1000 / 8); m_sprite_end = m_spritelist.get(); - - m_ext_ctrl_0_cb.resolve_safe(); - m_ext_ctrl_1_cb.resolve_safe(); - m_ext_ctrl_2_cb.resolve_safe(); } void imagetek_i4300_device::device_start() diff --git a/src/devices/video/lc7582.cpp b/src/devices/video/lc7582.cpp index ef167fdb0f7..b8f5b87c7ba 100644 --- a/src/devices/video/lc7582.cpp +++ b/src/devices/video/lc7582.cpp @@ -34,9 +34,6 @@ lc7582_device::lc7582_device(const machine_config &mconfig, const char *tag, dev void lc7582_device::device_start() { - // resolve callbacks - m_write_segs.resolve_safe(); - // zerofill m_data = 0; m_ce = 0; diff --git a/src/devices/video/mb88303.cpp b/src/devices/video/mb88303.cpp index 16a24122306..98688bf26d8 100644 --- a/src/devices/video/mb88303.cpp +++ b/src/devices/video/mb88303.cpp @@ -122,11 +122,6 @@ mb88303_device::mb88303_device(const machine_config &mconfig, const char *tag, d void mb88303_device::device_start() { - // resolve callbacks - m_write_vow.resolve_safe(); - m_write_vobn.resolve_safe(); - m_write_do.resolve_safe(); - // register for state saving save_item(NAME(m_display_mem)); save_item(NAME(m_horiz_display_pos)); diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index a95eacb3755..0189bd96f7d 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -1025,12 +1025,6 @@ void mc6845_device::device_start() m_end_update_cb.resolve_safe(); m_on_update_addr_changed_cb.resolve(); - /* resolve callbacks */ - m_out_de_cb.resolve_safe(); - m_out_cur_cb.resolve_safe(); - m_out_hsync_cb.resolve_safe(); - m_out_vsync_cb.resolve_safe(); - /* create the timers */ m_line_timer = timer_alloc(FUNC(mc6845_device::handle_line_timer), this); m_de_off_timer = timer_alloc(FUNC(mc6845_device::de_off_tick), this); diff --git a/src/devices/video/mc6847.cpp b/src/devices/video/mc6847.cpp index 7e0e3d4c67e..57649fe39d2 100644 --- a/src/devices/video/mc6847.cpp +++ b/src/devices/video/mc6847.cpp @@ -155,9 +155,6 @@ mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device void mc6847_friend_device::device_start() { - m_write_hsync.resolve_safe(); - m_write_fsync.resolve_safe(); - /* create the timers */ m_frame_timer = timer_alloc(FUNC(mc6847_friend_device::new_frame), this); m_hsync_on_timer = timer_alloc(FUNC(mc6847_friend_device::change_horizontal_sync), this); @@ -518,7 +515,7 @@ std::string mc6847_friend_device::describe_context() const mc6847_base_device::mc6847_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs) : mc6847_friend_device(mconfig, type, tag, owner, clock, fontdata, (type == MC6847T1_NTSC) || (type == MC6847T1_PAL), tpfs, 25+191, 1, true), - m_input_cb(*this), + m_input_cb(*this, 0), m_black_and_white(false), m_fixed_mode(0), m_fixed_mode_mask(0) @@ -587,7 +584,6 @@ void mc6847_base_device::device_start() memset(m_data, 0, sizeof(m_data)); /* resolve callbacks */ - m_input_cb.resolve_safe(0); m_charrom_cb.resolve(); /* set up fixed mode */ diff --git a/src/devices/video/md4330b.cpp b/src/devices/video/md4330b.cpp index eb76e46585c..b44313d8bac 100644 --- a/src/devices/video/md4330b.cpp +++ b/src/devices/video/md4330b.cpp @@ -44,10 +44,6 @@ md4332b_device::md4332b_device(const machine_config &mconfig, const char *tag, d void md4330b_device::device_start() { - // resolve callbacks - m_write_q.resolve_safe(); - m_write_do.resolve_safe(); - // zerofill m_shift = 0; m_clk = 0; diff --git a/src/devices/video/mm5445.cpp b/src/devices/video/mm5445.cpp index ea78da7fe1e..30d5e8b03bc 100644 --- a/src/devices/video/mm5445.cpp +++ b/src/devices/video/mm5445.cpp @@ -51,9 +51,6 @@ mm5448_device::mm5448_device(const machine_config &mconfig, const char *tag, dev void mm5445_device::device_start() { - // resolve callbacks - m_write_output.resolve_safe(); - // zerofill m_clk = 0; m_enable = 0; diff --git a/src/devices/video/mos6566.cpp b/src/devices/video/mos6566.cpp index 82eb4356304..2b9cd48ccee 100644 --- a/src/devices/video/mos6566.cpp +++ b/src/devices/video/mos6566.cpp @@ -634,12 +634,6 @@ void mos6566_device::device_start() // set our instruction counter set_icountptr(m_icount); - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_ba.resolve_safe(); - m_write_aec.resolve_safe(); - m_write_k.resolve_safe(); - screen().register_screen_bitmap(m_bitmap); for (int i = 0; i < 256; i++) diff --git a/src/devices/video/pc_xga.cpp b/src/devices/video/pc_xga.cpp index bc474a81cfb..60dc15a8538 100644 --- a/src/devices/video/pc_xga.cpp +++ b/src/devices/video/pc_xga.cpp @@ -14,7 +14,7 @@ DEFINE_DEVICE_TYPE(OTI111, oak_oti111_vga_device, "oti111_vga", "Oak Techn xga_copro_device::xga_copro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XGA_COPRO, tag, owner, clock) , m_var(TYPE::XGA) - , m_mem_read_cb(*this) + , m_mem_read_cb(*this, 0) , m_mem_write_cb(*this) { } @@ -750,8 +750,6 @@ void xga_copro_device::xga_write(offs_t offset, u8 data) void xga_copro_device::device_start() { - m_mem_read_cb.resolve_safe(0); - m_mem_write_cb.resolve_safe(); } void xga_copro_device::device_reset() diff --git a/src/devices/video/pcf2100.cpp b/src/devices/video/pcf2100.cpp index e1999c6b813..dcffabfe797 100644 --- a/src/devices/video/pcf2100.cpp +++ b/src/devices/video/pcf2100.cpp @@ -55,9 +55,6 @@ pcf2112_device::pcf2112_device(const machine_config &mconfig, const char *tag, d void pcf2100_device::device_start() { - // resolve callbacks - m_write_segs.resolve_safe(); - // timer m_lcd_timer = timer_alloc(FUNC(pcf2100_device::update_output_latches), this); attotime period = attotime::from_hz(clock()); diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp index 3d40fffc917..8078424fa56 100644 --- a/src/devices/video/ppu2c0x.cpp +++ b/src/devices/video/ppu2c0x.cpp @@ -215,9 +215,6 @@ ppu2c04_clone_device::ppu2c04_clone_device(const machine_config& mconfig, const void ppu2c0x_device::start_nopalram() { - // bind our handler - m_int_callback.resolve_safe(); - // allocate timers m_hblank_timer = timer_alloc(FUNC(ppu2c0x_device::hblank_tick), this); m_nmi_timer = timer_alloc(FUNC(ppu2c0x_device::nmi_tick), this); diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp index 2b8b9b6e3dd..3287ccbd6cc 100644 --- a/src/devices/video/ppu2c0x_vt.cpp +++ b/src/devices/video/ppu2c0x_vt.cpp @@ -24,8 +24,8 @@ ppu_vt03_device::ppu_vt03_device(const machine_config& mconfig, device_type type ppu2c0x_device(mconfig, type, tag, owner, clock), m_is_pal(false), m_is_50hz(false), - m_read_bg(*this), - m_read_sp(*this) + m_read_bg(*this, 0), + m_read_sp(*this, 0) { } @@ -281,8 +281,6 @@ void ppu_vt03_device::device_reset() { ppu2c0x_device::device_reset(); - m_read_bg.resolve_safe(0); - m_read_sp.resolve_safe(0); for (int i = 0; i < 0xff; i++) m_palette_ram[i] = 0x0; diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp index dfef8568f3c..c891830257b 100644 --- a/src/devices/video/psx.cpp +++ b/src/devices/video/psx.cpp @@ -51,8 +51,6 @@ psxgpu_device::psxgpu_device(const machine_config &mconfig, device_type type, co void psxgpu_device::device_start() { - m_vblank_handler.resolve_safe(); - screen().register_vblank_callback(vblank_state_delegate(&psxgpu_device::vblank, this)); for( int n_colour = 0; n_colour < 0x10000; n_colour++ ) diff --git a/src/devices/video/pwm.cpp b/src/devices/video/pwm.cpp index 5258b204392..d1d5064be87 100644 --- a/src/devices/video/pwm.cpp +++ b/src/devices/video/pwm.cpp @@ -76,11 +76,7 @@ pwm_display_device::pwm_display_device(const machine_config &mconfig, const char void pwm_display_device::device_start() { // resolve handlers - m_external_output = !m_output_x_cb.isnull() || !m_output_a_cb.isnull() || !m_output_multi_cb.isnull() || !m_output_digit_cb.isnull(); - m_output_x_cb.resolve_safe(); - m_output_a_cb.resolve_safe(); - m_output_multi_cb.resolve_safe(); - m_output_digit_cb.resolve_safe(); + m_external_output = !m_output_x_cb.isunset() || !m_output_a_cb.isunset() || !m_output_multi_cb.isunset() || !m_output_digit_cb.isunset(); if (!m_external_output) { diff --git a/src/devices/video/saa5050.cpp b/src/devices/video/saa5050.cpp index 75886f7af1c..4e930ca8d62 100644 --- a/src/devices/video/saa5050.cpp +++ b/src/devices/video/saa5050.cpp @@ -177,7 +177,7 @@ const tiny_rom_entry *saa5057_device::device_rom_region() const saa5050_device::saa5050_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_char_rom(*this, "chargen"), - m_read_d(*this), + m_read_d(*this, 0), m_frame_count(0), m_cols(0), m_rows(0), @@ -233,9 +233,6 @@ saa5057_device::saa5057_device(const machine_config &mconfig, const char *tag, d void saa5050_device::device_start() { - // resolve callbacks - m_read_d.resolve_safe(0); - // register for state saving save_item(NAME(m_code)); save_item(NAME(m_held_char)); diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 375dbf4d636..b3b8af01388 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -46,8 +46,8 @@ scn2674_device::scn2674_device(const machine_config &mconfig, device_type type, , m_intr_cb(*this) , m_breq_cb(*this) , m_mbc_cb(*this) - , m_mbc_char_cb(*this) - , m_mbc_attr_cb(*this) + , m_mbc_char_cb(*this, 0) + , m_mbc_attr_cb(*this, 0) , m_IR_pointer(0) , m_screen1_address(0), m_screen2_address(0) , m_cursor_address(0) @@ -105,13 +105,9 @@ device_memory_interface::space_config_vector scn2674_device::memory_space_config void scn2674_device::device_start() { - // resolve callbacks + // resolve delegates m_display_cb.resolve_safe(); - m_intr_cb.resolve_safe(); - m_breq_cb.resolve_safe(); - m_mbc_cb.resolve_safe(); - m_mbc_char_cb.resolve(); - m_mbc_attr_cb.resolve(); + m_scanline_timer = timer_alloc(FUNC(scn2674_device::scanline_timer), this); m_breq_timer = timer_alloc(FUNC(scn2674_device::breq_timer), this); m_vblank_timer = timer_alloc(FUNC(scn2674_device::vblank_timer), this); @@ -1131,12 +1127,12 @@ TIMER_CALLBACK_MEMBER(scn2674_device::scanline_timer) for (int i = 0; i < m_character_per_row; i++) { u8 charcode, attrcode = 0; - if (mbc && !m_mbc_char_cb.isnull()) + if (mbc && !m_mbc_char_cb.isunset()) { // row buffering DMA charcode = m_mbc_char_cb(address); m_char_space->write_byte(address, charcode); - if (m_attr_space != nullptr && !m_mbc_attr_cb.isnull()) + if (m_attr_space != nullptr && !m_mbc_attr_cb.isunset()) { attrcode = m_mbc_attr_cb(address); m_attr_space->write_byte(address, attrcode); diff --git a/src/devices/video/sed1500.cpp b/src/devices/video/sed1500.cpp index 41ade315d56..04c3c07bf35 100644 --- a/src/devices/video/sed1500.cpp +++ b/src/devices/video/sed1500.cpp @@ -63,9 +63,6 @@ sed1503_device::sed1503_device(const machine_config &mconfig, const char *tag, d void sed1500_device::device_start() { - // resolve callbacks - m_write_segs.resolve_safe(); - // timer m_lcd_timer = timer_alloc(FUNC(sed1500_device::update_segs), this); attotime period = attotime::from_hz(clock() / 64); diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp index 3bf448dc4c2..d83f16a6cae 100644 --- a/src/devices/video/snes_ppu.cpp +++ b/src/devices/video/snes_ppu.cpp @@ -193,7 +193,7 @@ snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag, : device_t(mconfig, SNES_PPU, tag, owner, clock) , device_video_interface(mconfig, *this) , device_palette_interface(mconfig, *this) - , m_openbus_cb(*this) + , m_openbus_cb(*this, 0) , m_options(*this, ":OPTIONS") , m_debug1(*this, ":DEBUG1") , m_debug2(*this, ":DEBUG2") @@ -208,8 +208,6 @@ snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag, void snes_ppu_device::device_start() { - m_openbus_cb.resolve_safe(0); - m_vram = std::make_unique<uint8_t[]>(SNES_VRAM_SIZE); m_cgram = std::make_unique<uint16_t[]>(SNES_CGRAM_SIZE/2); diff --git a/src/devices/video/tms34061.cpp b/src/devices/video/tms34061.cpp index 8fe8daa9112..9dada231a2b 100644 --- a/src/devices/video/tms34061.cpp +++ b/src/devices/video/tms34061.cpp @@ -57,9 +57,6 @@ tms34061_device::tms34061_device(const machine_config &mconfig, const char *tag, void tms34061_device::device_start() { - /* resolve callbak */ - m_interrupt_cb.resolve(); - /* reset the data */ m_vrammask = m_vramsize - 1; @@ -139,15 +136,11 @@ static const char *const regnames[] = void tms34061_device::update_interrupts() { - /* if we have a callback, process it */ - if (!m_interrupt_cb.isnull()) - { - /* if the status bit is set, and ints are enabled, turn it on */ - if ((m_regs[TMS34061_STATUS] & 0x0001) && (m_regs[TMS34061_CONTROL1] & 0x0400)) - m_interrupt_cb(ASSERT_LINE); - else - m_interrupt_cb(CLEAR_LINE); - } + /* if the status bit is set, and ints are enabled, turn it on */ + if ((m_regs[TMS34061_STATUS] & 0x0001) && (m_regs[TMS34061_CONTROL1] & 0x0400)) + m_interrupt_cb(ASSERT_LINE); + else + m_interrupt_cb(CLEAR_LINE); } diff --git a/src/devices/video/tms9927.cpp b/src/devices/video/tms9927.cpp index ef765fc40b4..caa7230ad0c 100644 --- a/src/devices/video/tms9927.cpp +++ b/src/devices/video/tms9927.cpp @@ -84,10 +84,6 @@ void tms9927_device::device_start() assert(clock() > 0); if (!(m_hpixels_per_column > 0)) fatalerror("TMS9927: number of pixels per column must be explicitly set using set_char_width()!\n"); - // resolve callbacks - m_write_vsyn.resolve_safe(); - m_write_hsyn.resolve(); - // allocate timers m_vsync_timer = timer_alloc(FUNC(tms9927_device::toggle_vsync), this); m_hsync_timer = timer_alloc(FUNC(tms9927_device::toggle_hsync), this); @@ -358,7 +354,7 @@ void tms9927_device::recompute_parameters(bool postload) screen().configure(m_total_hpix, m_total_vpix, visarea, refresh.as_attoseconds()); m_hsyn = false; - if (!m_write_hsyn.isnull()) + if (!m_write_hsyn.isunset()) { m_write_hsyn(0); m_hsync_timer->adjust(screen().time_until_pos(m_vsyn_start, m_hsyn_start)); diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp index dffe7b8ba72..64b0e9d8c54 100644 --- a/src/devices/video/tms9928a.cpp +++ b/src/devices/video/tms9928a.cpp @@ -213,8 +213,7 @@ void tms9928a_device::check_interrupt() if (b != m_INT) { m_INT = b; - if ( !m_out_int_line_cb.isnull() ) - m_out_int_line_cb( m_INT ); + m_out_int_line_cb(m_INT); } } @@ -725,9 +724,6 @@ void tms9928a_device::device_start() m_top_border = m_50hz ? VERT_DISPLAY_START_PAL : VERT_DISPLAY_START_NTSC; m_vertical_size = m_50hz ? TOTAL_VERT_PAL : TOTAL_VERT_NTSC; - m_out_int_line_cb.resolve(); - m_out_gromclk_cb.resolve(); - // Video RAM is allocated as an own address space m_vram_space = &space(AS_DATA); @@ -790,6 +786,6 @@ void tms9928a_device::device_reset() m_line_timer->adjust( screen().time_until_pos( 0, HORZ_DISPLAY_START ) ); // TODO: Check clock freq settings in all drivers - if (!m_out_gromclk_cb.isnull() && m_99) + if (!m_out_gromclk_cb.isunset() && m_99) m_gromclk_timer->adjust(attotime::zero, 0, clocks_to_attotime(24)); } diff --git a/src/devices/video/topcat.cpp b/src/devices/video/topcat.cpp index 630cb3d3e87..502faffbd12 100644 --- a/src/devices/video/topcat.cpp +++ b/src/devices/video/topcat.cpp @@ -24,7 +24,6 @@ topcat_device::topcat_device(const machine_config &mconfig, const char *tag, dev void topcat_device::device_start() { - m_int_write_func.resolve_safe(); m_cursor_timer = timer_alloc(FUNC(topcat_device::cursor_callback), this); m_cursor_timer->adjust(attotime::from_hz(3)); diff --git a/src/devices/video/upd3301.cpp b/src/devices/video/upd3301.cpp index e8a9d676260..f1252c0c3ae 100644 --- a/src/devices/video/upd3301.cpp +++ b/src/devices/video/upd3301.cpp @@ -146,12 +146,8 @@ upd3301_device::upd3301_device(const machine_config &mconfig, const char *tag, d void upd3301_device::device_start() { screen().register_screen_bitmap(m_bitmap); - // resolve callbacks - m_write_drq.resolve_safe(); - m_write_int.resolve_safe(); - m_write_hrtc.resolve_safe(); - m_write_vrtc.resolve_safe(); - m_write_rvv.resolve(); + + // resolve delegates m_display_cb.resolve(); m_attr_fetch_cb.resolve(); @@ -208,7 +204,7 @@ void upd3301_device::device_reset() m_cm = 0; m_b = 48; m_reverse_display = false; - if (!m_write_rvv.isnull()) + if (!m_write_rvv.isunset()) m_write_rvv(m_reverse_display); recompute_parameters(); @@ -464,7 +460,7 @@ void upd3301_device::write(offs_t offset, uint8_t data) if (m_reverse_display != new_rvv) { m_reverse_display = new_rvv; - if (!m_write_rvv.isnull()) + if (!m_write_rvv.isunset()) m_write_rvv(m_reverse_display); else if (m_reverse_display == true) logerror("%s: RVV reverse display enabled (warning)\n", machine().describe_context()); diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index f593f182f40..1b6b8235ac8 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -668,11 +668,6 @@ void upd7220_device::device_start() m_display_cb.resolve_safe(); m_draw_text_cb.resolve_safe(); - m_write_drq.resolve_safe(); - m_write_hsync.resolve_safe(); - m_write_vsync.resolve_safe(); - m_write_blank.resolve_safe(); - // allocate timers m_vsync_timer = timer_alloc(FUNC(upd7220_device::vsync_update), this); m_hsync_timer = timer_alloc(FUNC(upd7220_device::hsync_update), this); diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp index 34d7782bc64..aec5835f4a0 100644 --- a/src/devices/video/v9938.cpp +++ b/src/devices/video/v9938.cpp @@ -608,7 +608,6 @@ void v99x8_device::register_w(uint8_t data) void v99x8_device::device_start() { - m_int_callback.resolve_safe(); m_vdp_ops_count = 1; m_vdp_engine = nullptr; diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp index ead044f387c..1208bd243f9 100644 --- a/src/devices/video/vic4567.cpp +++ b/src/devices/video/vic4567.cpp @@ -155,14 +155,14 @@ vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_ , device_video_interface(mconfig, *this) , m_type(vic3_type::NTSC) , m_cpu(*this, finder_base::DUMMY_TAG) - , m_dma_read_cb(*this) - , m_dma_read_color_cb(*this) + , m_dma_read_cb(*this, 0) + , m_dma_read_color_cb(*this, 0) , m_interrupt_cb(*this) , m_port_changed_cb(*this) - , m_lightpen_button_cb(*this) - , m_lightpen_x_cb(*this) - , m_lightpen_y_cb(*this) - , m_c64_mem_r_cb(*this) + , m_lightpen_button_cb(*this, 0) + , m_lightpen_x_cb(*this, 0) + , m_lightpen_y_cb(*this, 0) + , m_c64_mem_r_cb(*this, 0) { } @@ -177,18 +177,6 @@ void vic3_device::device_start() m_bitmap = std::make_unique<bitmap_ind16>(width, height); - m_dma_read_cb.resolve_safe(0); - m_dma_read_color_cb.resolve_safe(0); - m_interrupt_cb.resolve_safe(); - - m_port_changed_cb.resolve(); - - m_c64_mem_r_cb.resolve_safe(0); - - m_lightpen_button_cb.resolve_safe(0); - m_lightpen_x_cb.resolve_safe(0); - m_lightpen_y_cb.resolve_safe(0); - m_screendata = std::make_unique<uint8_t []>(216 * 656 / 8); m_screenptr[0] = m_screendata.get(); @@ -1456,12 +1444,9 @@ void vic3_device::port_w(offs_t offset, uint8_t data) m_reg[offset] = data; break; case 0x30: + DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data)); m_reg[offset] = data; - if (!m_port_changed_cb.isnull()) - { - DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data)); - m_port_changed_cb((offs_t)0,data); - } + m_port_changed_cb(offs_t(0), data); break; case 0x31: m_reg[offset] = data; diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 9e540e061e8..5390ee10675 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -685,10 +685,6 @@ generic_voodoo_device::generic_voodoo_device(const machine_config &mconfig, devi void generic_voodoo_device::device_start() { - // resolve callbacks - m_vblank_cb.resolve(); - m_stall_cb.resolve(); - m_pciint_cb.resolve(); } @@ -2579,8 +2575,7 @@ void voodoo_1_device::vblank_start(s32 param) m_vblank = true; // notify external VBLANK handler on all models - if (!m_vblank_cb.isnull()) - m_vblank_cb(true); + m_vblank_cb(true); } @@ -2598,8 +2593,7 @@ void voodoo_1_device::vblank_stop(s32 param) m_vblank = false; // notify external VBLANK handler on all models - if (!m_vblank_cb.isnull()) - m_vblank_cb(false); + m_vblank_cb(false); // go to the end of the next frame adjust_vblank_start_timer(); @@ -3137,7 +3131,7 @@ void voodoo_1_device::check_stalled_cpu(attotime current_time) m_stall_state = NOT_STALLED; // either call the callback, or trigger the trigger - if (!m_stall_cb.isnull()) + if (!m_stall_cb.isunset()) m_stall_cb(false); else machine().scheduler().trigger(m_stall_trigger); @@ -3165,7 +3159,7 @@ void voodoo_1_device::stall_cpu(stall_state state) m_stats.m_stalls++; // either call the callback, or spin the CPU - if (!m_stall_cb.isnull()) + if (!m_stall_cb.isunset()) m_stall_cb(true); else m_cpu->spin_until_trigger(m_stall_trigger); diff --git a/src/devices/video/voodoo_2.cpp b/src/devices/video/voodoo_2.cpp index 56fd7cdcc65..5529c035eef 100644 --- a/src/devices/video/voodoo_2.cpp +++ b/src/devices/video/voodoo_2.cpp @@ -930,7 +930,7 @@ u32 voodoo_2_device::reg_intrctrl_w(u32 chipmask, u32 regnum, u32 data) m_reg.write(regnum, data); // Setting bit 31 clears the PCI interrupts - if (BIT(data, 31) && !m_pciint_cb.isnull()) + if (BIT(data, 31)) m_pciint_cb(false); } return 0; @@ -999,9 +999,8 @@ u32 voodoo_2_device::reg_userintr_w(u32 chipmask, u32 regnum, u32 data) reg_intr_ctrl::EXTERNAL_PIN_ACTIVE | reg_intr_ctrl::USER_INTERRUPT_TAG_MASK, ((data << 10) & reg_intr_ctrl::USER_INTERRUPT_TAG_MASK) | reg_intr_ctrl::USER_INTERRUPT_GENERATED); - // Signal pci interrupt handler - if (!m_pciint_cb.isnull()) - m_pciint_cb(true); + // Signal PCI interrupt handler + m_pciint_cb(true); } return 0; } @@ -1157,8 +1156,7 @@ void voodoo_2_device::vblank_start(s32 param) if (m_reg.intr_ctrl().vsync_rising_enable()) { m_reg.clear_set(voodoo_regs::reg_intrCtrl, reg_intr_ctrl::EXTERNAL_PIN_ACTIVE, reg_intr_ctrl::VSYNC_RISING_GENERATED); - if (!m_pciint_cb.isnull()) - m_pciint_cb(true); + m_pciint_cb(true); } } @@ -1176,8 +1174,7 @@ void voodoo_2_device::vblank_stop(s32 param) if (m_reg.intr_ctrl().vsync_falling_enable()) { m_reg.clear_set(voodoo_regs::reg_intrCtrl, reg_intr_ctrl::EXTERNAL_PIN_ACTIVE, reg_intr_ctrl::VSYNC_FALLING_GENERATED); - if (!m_pciint_cb.isnull()) - m_pciint_cb(true); + m_pciint_cb(true); } } diff --git a/src/devices/video/vrender0.cpp b/src/devices/video/vrender0.cpp index 63ce715213d..d2085339bef 100644 --- a/src/devices/video/vrender0.cpp +++ b/src/devices/video/vrender0.cpp @@ -125,8 +125,6 @@ void vr0video_device::flip_count_w(offs_t offset, uint16_t data, uint16_t mem_ma void vr0video_device::device_start() { - m_idleskip_cb.resolve_safe(); - save_item(NAME(m_InternalPalette)); save_item(NAME(m_LastPalUpdate)); diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp index d7a91138f8c..475f4d2ae63 100644 --- a/src/devices/video/zeus2.cpp +++ b/src/devices/video/zeus2.cpp @@ -79,9 +79,6 @@ void zeus2_device::device_start() /* initialize polygon engine */ poly = std::make_unique<zeus2_renderer>(this); - m_vblank.resolve_safe(); - m_irq.resolve_safe(); - /* we need to cleanup on exit */ //machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&zeus2_device::exit_handler2, this)); diff --git a/src/devices/video/zr36110.cpp b/src/devices/video/zr36110.cpp index 3521e8cfaaf..b119061e55f 100644 --- a/src/devices/video/zr36110.cpp +++ b/src/devices/video/zr36110.cpp @@ -27,8 +27,6 @@ zr36110_device::zr36110_device(const machine_config &mconfig, char const *tag, d void zr36110_device::device_start() { - m_drq_w.resolve_safe(); - save_item(NAME(m_mc1_adr)); save_item(NAME(m_mc23_adr)); save_item(NAME(m_setup_adr)); diff --git a/src/emu/devcb.cpp b/src/emu/devcb.cpp index 19970f45c5f..25a0006b4e9 100644 --- a/src/emu/devcb.cpp +++ b/src/emu/devcb.cpp @@ -341,7 +341,8 @@ template class devcb_write_line::creator_impl<devcb_write_line::log_builder>; devcb_base::devcb_base(device_t &owner) - : m_owner(owner) + : device_resolver_base(owner) + , m_owner(owner) { } diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 9a50df90a00..54fa2c97958 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -64,11 +64,8 @@ template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write_ /// /// Provides utilities for supporting multiple read/write/transform /// signatures, and the base exclusive-or/mask transform methods. -class devcb_base +class devcb_base : protected device_resolver_base { -public: - virtual void validity_check(validity_checker &valid) const = 0; - protected: // This is in C++17 but not C++14 template <typename... T> struct void_wrapper { using type = void; }; @@ -174,9 +171,9 @@ protected: class array : public std::array<T, Count> { private: - template <unsigned... V> - array(device_t &owner, std::integer_sequence<unsigned, V...> const &) - : std::array<T, Count>{{ { make_one<V>(owner) }... }} + template <unsigned... V, typename... Params> + array(device_t &owner, std::integer_sequence<unsigned, V...>, Params &&... args) + : std::array<T, Count>{{ { make_one<V>(owner), std::forward<Params>(args)... }... }} { } @@ -185,12 +182,10 @@ protected: public: using std::array<T, Count>::array; - array(device_t &owner) : array(owner, std::make_integer_sequence<unsigned, Count>()) { } - - void resolve_all() + template <typename... Params> + array(device_t &owner, Params &&... args) + : array(owner, std::make_integer_sequence<unsigned, Count>(), std::forward<Params>(args)...) { - for (T &elem : *this) - elem.resolve(); } }; @@ -336,7 +331,7 @@ private: using ptr = std::unique_ptr<creator>; virtual ~creator() { } - virtual void validity_check(validity_checker &valid) const = 0; + virtual bool validity_check(validity_checker &valid) const = 0; virtual func_t create() = 0; std::make_unsigned_t<Result> mask() const { return m_mask; } @@ -353,7 +348,7 @@ private: public: creator_impl(T &&builder) : creator(builder.mask()), m_builder(std::move(builder)) { } - virtual void validity_check(validity_checker &valid) const override { m_builder.validity_check(valid); } + virtual bool validity_check(validity_checker &valid) const override { return m_builder.validity_check(valid); } virtual func_t create() override { @@ -371,7 +366,7 @@ private: public: log_creator(device_t &devbase, std::string &&message) : creator(0U), m_devbase(devbase), m_message(std::move(message)) { } - virtual void validity_check(validity_checker &valid) const override { } + virtual bool validity_check(validity_checker &valid) const override { return true; } virtual func_t create() override { @@ -467,7 +462,7 @@ private: return transform_builder<transform_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, std::move(*this), std::forward<T>(cb), m); } - void validity_check(validity_checker &valid) const { m_src.validity_check(valid); } + bool validity_check(validity_checker &valid) const { return m_src.validity_check(valid); } template <typename T> void build(T &&chain) @@ -535,7 +530,7 @@ private: return transform_builder<functoid_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, std::move(*this), std::forward<T>(cb), m); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } template <typename T> void build(T &&chain) @@ -595,11 +590,15 @@ private: return transform_builder<delegate_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, std::move(*this), std::forward<T>(cb), m); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { auto const target(m_delegate.finder_target()); if (target.second && !target.first.subdevice(target.second)) + { osd_printf_error("Read callback bound to non-existent object tag %s (%s)\n", target.first.subtag(target.second), m_delegate.name()); + return false; + } + return true; } template <typename T> @@ -655,7 +654,7 @@ private: return transform_builder<ioport_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, std::move(*this), std::forward<T>(cb), m); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } template <typename T> void build(T &&chain) @@ -823,41 +822,39 @@ private: std::vector<func_t> m_functions; std::vector<typename creator::ptr> m_creators; + Result const m_default; + bool m_unset = false; + +protected: + virtual bool findit(validity_checker *valid) override; + virtual void end_configuration() override; public: template <unsigned Count> class array : public devcb_read_base::array<devcb_read<Result, DefaultMask>, Count> { public: - using devcb_read_base::array<devcb_read<Result, DefaultMask>, Count>::array; - - void resolve_all_safe(Result dflt) + array(device_t &owner, Result dflt) + : devcb_read_base::array<devcb_read<Result, DefaultMask>, Count>::array(owner, dflt) { - for (devcb_read<Result, DefaultMask> &elem : *this) - elem.resolve_safe(dflt); } }; - devcb_read(device_t &owner); + devcb_read(device_t &owner, Result dflt); binder bind(); void reset(); - virtual void validity_check(validity_checker &valid) const override; - - void resolve(); - void resolve_safe(Result dflt); - Result operator()(offs_t offset, std::make_unsigned_t<Result> mem_mask = DefaultMask); Result operator()(); - bool isnull() const { return m_functions.empty() && m_creators.empty(); } - explicit operator bool() const { return !m_functions.empty(); } + bool isunset() const noexcept { return m_unset || (m_functions.empty() && m_creators.empty()); } }; template <typename Result, std::make_unsigned_t<Result> DefaultMask> -devcb_read<Result, DefaultMask>::devcb_read(device_t &owner) +devcb_read<Result, DefaultMask>::devcb_read(device_t &owner, Result dflt) : devcb_read_base(owner) + , m_default(dflt & DefaultMask) { } @@ -875,38 +872,48 @@ void devcb_read<Result, DefaultMask>::reset() } template <typename Result, std::make_unsigned_t<Result> DefaultMask> -void devcb_read<Result, DefaultMask>::validity_check(validity_checker &valid) const +bool devcb_read<Result, DefaultMask>::findit(validity_checker *valid) { assert(m_functions.empty()); - for (typename std::vector<typename creator::ptr>::const_iterator i = m_creators.begin(); m_creators.end() != i; ++i) + if (!valid) { - (*i)->validity_check(valid); - std::make_unsigned_t<Result> const m((*i)->mask()); - for (typename std::vector<typename creator::ptr>::const_iterator j = std::next(i); m_creators.end() != j; ++j) + // FIXME: report errors by returning false rather than throwing fatal errors + m_functions.reserve(m_creators.size()); + for (typename creator::ptr const &c : m_creators) + m_functions.emplace_back(c->create()); + m_creators.clear(); + if (m_functions.empty()) { - std::make_unsigned_t<Result> const n((*j)->mask()); - if (m & n) - osd_printf_error("Read callback masks %lX and %lX overlap\n", static_cast<unsigned long>(m), static_cast<unsigned long>(n)); // FIXME: doesn't work with u64 + m_functions.emplace_back([dflt = m_default] (offs_t offset, std::make_unsigned_t<Result> mem_mask) { return dflt; }); + m_unset = true; } + return true; + } + else + { + bool success(true); + for (typename std::vector<typename creator::ptr>::const_iterator i = m_creators.begin(); m_creators.end() != i; ++i) + { + if (!(*i)->validity_check(*valid)) + success = false; + std::make_unsigned_t<Result> const m((*i)->mask()); + for (typename std::vector<typename creator::ptr>::const_iterator j = std::next(i); m_creators.end() != j; ++j) + { + std::make_unsigned_t<Result> const n((*j)->mask()); + if (m & n) + { + osd_printf_error("Read callback masks 0x%X and 0x%X overlap\n", m, n); + success = false; + } + } + } + return success; } } template <typename Result, std::make_unsigned_t<Result> DefaultMask> -void devcb_read<Result, DefaultMask>::resolve() -{ - assert(m_functions.empty()); - m_functions.reserve(m_creators.size()); - for (typename creator::ptr const &c : m_creators) - m_functions.emplace_back(c->create()); - m_creators.clear(); -} - -template <typename Result, std::make_unsigned_t<Result> DefaultMask> -void devcb_read<Result, DefaultMask>::resolve_safe(Result dflt) +void devcb_read<Result, DefaultMask>::end_configuration() { - resolve(); - if (m_functions.empty()) - m_functions.emplace_back([dflt] (offs_t offset, std::make_unsigned_t<Result> mem_mask) { return dflt; }); } template <typename Result, std::make_unsigned_t<Result> DefaultMask> @@ -944,7 +951,7 @@ private: using ptr = std::unique_ptr<creator>; virtual ~creator() { } - virtual void validity_check(validity_checker &valid) const = 0; + virtual bool validity_check(validity_checker &valid) const = 0; virtual func_t create() = 0; }; @@ -954,7 +961,7 @@ private: public: creator_impl(T &&builder) : m_builder(std::move(builder)) { } - virtual void validity_check(validity_checker &valid) const override { m_builder.validity_check(valid); } + virtual bool validity_check(validity_checker &valid) const override { return m_builder.validity_check(valid); } virtual func_t create() override { @@ -968,7 +975,7 @@ private: class nop_creator : public creator { public: - virtual void validity_check(validity_checker &valid) const override { } + virtual bool validity_check(validity_checker &valid) const override { return true; } virtual func_t create() override { return [] (offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask) { }; } }; @@ -1067,7 +1074,7 @@ private: }); } - void validity_check(validity_checker &valid) const { m_src.validity_check(valid); } + bool validity_check(validity_checker &valid) const { return m_src.validity_check(valid); } private: transform_builder(transform_builder const &) = delete; @@ -1124,7 +1131,7 @@ private: } ~first_transform_builder() { this->template register_creator<first_transform_builder>(); } - void validity_check(validity_checker &valid) const { m_sink.validity_check(valid); } + bool validity_check(validity_checker &valid) const { return m_sink.validity_check(valid); } template <typename T> std::enable_if_t<is_transform<output_t, output_t, T>::value, transform_builder<first_transform_builder, std::remove_reference_t<T> > > transform(T &&cb) @@ -1191,7 +1198,7 @@ private: wrapped_builder(functoid_builder &&that) : builder_base(std::move(that)), m_cb(std::move(that.m_cb)) { that.consume(); that.built(); } wrapped_builder(wrapped_builder &&that) : builder_base(std::move(that)), m_cb(std::move(that.m_cb)) { that.consume(); that.built(); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1241,7 +1248,7 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1279,11 +1286,15 @@ private: that.built(); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { auto const target(m_delegate.finder_target()); if (target.second && !target.first.subdevice(target.second)) + { osd_printf_error("Write callback bound to non-existent object tag %s (%s)\n", target.first.subtag(target.second), m_delegate.name()); + return false; + } + return true; } auto build() @@ -1345,11 +1356,15 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), in_mask, out_mask); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { auto const target(m_delegate.finder_target()); if (target.second && !target.first.subdevice(target.second)) + { osd_printf_error("Write callback bound to non-existent object tag %s (%s)\n", target.first.subtag(target.second), m_delegate.name()); + return false; + } + return true; } auto build() @@ -1394,16 +1409,23 @@ private: that.built(); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { if (!m_exec) { device_t *const device(m_devbase.subdevice(m_tag)); if (!device) + { osd_printf_error("Write callback bound to non-existent object tag %s\n", m_tag); + return false; + } else if (!dynamic_cast<device_execute_interface *>(device)) + { osd_printf_error("Write callback bound to device %s (%s) that does not implement device_execute_interface\n", device->tag(), device->name()); + return false; + } } + return true; } auto build() @@ -1485,16 +1507,23 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), in_mask, 1U); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { if (!m_exec) { device_t *const device(m_devbase.subdevice(m_tag)); if (!device) + { osd_printf_error("Write callback bound to non-existent object tag %s\n", m_tag); + return false; + } else if (!dynamic_cast<device_execute_interface *>(device)) + { osd_printf_error("Write callback bound to device %s (%s) that does not implement device_execute_interface\n", device->tag(), device->name()); + return false; + } } + return true; } auto build() @@ -1549,16 +1578,23 @@ private: that.built(); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { if (!m_exec) { device_t *const device(m_devbase.subdevice(m_tag)); if (!device) + { osd_printf_error("Write callback bound to non-existent object tag %s\n", m_tag); + return false; + } else if (!dynamic_cast<device_execute_interface *>(device)) + { osd_printf_error("Write callback bound to device %s (%s) that does not implement device_execute_interface\n", device->tag(), device->name()); + return false; + } } + return true; } auto build() @@ -1644,16 +1680,23 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const + bool validity_check(validity_checker &valid) const { if (!m_exec) { device_t *const device(m_devbase.subdevice(m_tag)); if (!device) + { osd_printf_error("Write callback bound to non-existent object tag %s\n", m_tag); + return false; + } else if (!dynamic_cast<device_execute_interface *>(device)) + { osd_printf_error("Write callback bound to device %s (%s) that does not implement device_execute_interface\n", device->tag(), device->name()); + return false; + } } + return true; } auto build() @@ -1702,7 +1745,7 @@ private: that.built(); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1760,7 +1803,7 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1802,7 +1845,7 @@ private: that.built(); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1860,7 +1903,7 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1902,7 +1945,7 @@ private: that.built(); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1957,7 +2000,7 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -1996,7 +2039,7 @@ private: that.built(); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -2051,7 +2094,7 @@ private: return first_transform_builder<wrapped_builder, std::remove_reference_t<T> >(this->m_target, this->m_append, wrapped_builder(std::move(*this)), std::forward<T>(cb), this->exor(), this->mask(), DefaultMask); } - void validity_check(validity_checker &valid) const { } + bool validity_check(validity_checker &valid) const { return true; } auto build() { @@ -2300,18 +2343,20 @@ private: std::vector<func_t> m_functions; std::vector<typename creator::ptr> m_creators; + bool m_unset = false; + +protected: + virtual bool findit(validity_checker *valid) override; + virtual void end_configuration() override; public: template <unsigned Count> class array : public devcb_write_base::array<devcb_write<Input, DefaultMask>, Count> { public: - using devcb_write_base::array<devcb_write<Input, DefaultMask>, Count>::array; - - void resolve_all_safe() + array(device_t &owner) + : devcb_write_base::array<devcb_write<Input, DefaultMask>, Count>::array(owner) { - for (devcb_write<Input, DefaultMask> &elem : *this) - elem.resolve_safe(); } }; @@ -2320,16 +2365,10 @@ public: binder bind(); void reset(); - virtual void validity_check(validity_checker &valid) const override; - - void resolve(); - void resolve_safe(); - void operator()(offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask = DefaultMask); void operator()(Input data); - bool isnull() const { return m_functions.empty() && m_creators.empty(); } - explicit operator bool() const { return !m_functions.empty(); } + bool isunset() const noexcept { return m_unset || (m_functions.empty() && m_creators.empty()); } }; template <typename Input, std::make_unsigned_t<Input> DefaultMask> @@ -2352,29 +2391,38 @@ void devcb_write<Input, DefaultMask>::reset() } template <typename Input, std::make_unsigned_t<Input> DefaultMask> -void devcb_write<Input, DefaultMask>::validity_check(validity_checker &valid) const -{ - assert(m_functions.empty()); - for (typename creator::ptr const &c : m_creators) - c->validity_check(valid); -} - -template <typename Input, std::make_unsigned_t<Input> DefaultMask> -void devcb_write<Input, DefaultMask>::resolve() +bool devcb_write<Input, DefaultMask>::findit(validity_checker *valid) { assert(m_functions.empty()); - m_functions.reserve(m_creators.size()); - for (typename creator::ptr const &c : m_creators) - m_functions.emplace_back(c->create()); - m_creators.clear(); + if (!valid) + { + // FIXME: report errors by returning false rather than throwing fatal errors + m_functions.reserve(m_creators.size()); + for (typename creator::ptr const &c : m_creators) + m_functions.emplace_back(c->create()); + m_creators.clear(); + if (m_functions.empty()) + { + m_functions.emplace_back([] (offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask) { }); + m_unset = true; + } + return true; + } + else + { + bool success(true); + for (typename creator::ptr const &c : m_creators) + { + if (!c->validity_check(*valid)) + success = false; + } + return success; + } } template <typename Input, std::make_unsigned_t<Input> DefaultMask> -void devcb_write<Input, DefaultMask>::resolve_safe() +void devcb_write<Input, DefaultMask>::end_configuration() { - resolve(); - if (m_functions.empty()) - m_functions.emplace_back([] (offs_t offset, Input data, std::make_unsigned_t<Input> mem_mask) { }); } template <typename Input, std::make_unsigned_t<Input> DefaultMask> diff --git a/src/emu/devfind.cpp b/src/emu/devfind.cpp index d6bc984703e..6170b2fca8c 100644 --- a/src/emu/devfind.cpp +++ b/src/emu/devfind.cpp @@ -18,27 +18,42 @@ // BASE FINDER CLASS //************************************************************************** -constexpr char finder_base::DUMMY_TAG[]; +//------------------------------------------------- +// device_resolver_base - constructor +//------------------------------------------------- + +device_resolver_base::device_resolver_base(device_t &base) + : m_next(base.register_auto_finder(*this)) +{ +} //------------------------------------------------- -// finder_base - constructor +// ~device_resolver_base - destructor //------------------------------------------------- -finder_base::finder_base(device_t &base, char const *tag) - : m_next(base.register_auto_finder(*this)) - , m_base(base) - , m_tag(tag) - , m_resolved(false) +device_resolver_base::~device_resolver_base() { } + +//************************************************************************** +// BASE FINDER CLASS +//************************************************************************** + +constexpr char finder_base::DUMMY_TAG[]; + + //------------------------------------------------- -// ~finder_base - destructor +// finder_base - constructor //------------------------------------------------- -finder_base::~finder_base() +finder_base::finder_base(device_t &base, char const *tag) + : device_resolver_base(base) + , m_base(base) + , m_tag(tag) + , m_resolved(false) { } @@ -50,6 +65,7 @@ finder_base::~finder_base() void finder_base::set_tag(char const *tag) { assert(!m_resolved); + assert(tag); m_base = m_base.get().mconfig().current_device(); m_tag = tag; } diff --git a/src/emu/devfind.h b/src/emu/devfind.h index 20a555a8784..81ebb9f9812 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -216,21 +216,21 @@ public: /// Abstract non-template base class for object auto-discovery helpers. /// Provides the interface that the device_t uses to manage discovery at /// resolution time. -class finder_base +class device_resolver_base { public: /// \brief Destructor /// /// Destruction via base class pointer and dynamic type behaviour /// are allowed. - virtual ~finder_base(); + virtual ~device_resolver_base(); /// \brief Get next registered object discovery helper /// /// Implementation of basic single-linked list behaviour. /// \return Pointer to the next registered object discovery helper, /// or nullptr if this is the last. - finder_base *next() const { return m_next; } + device_resolver_base *next() const noexcept { return m_next; } /// \brief Attempt discovery /// @@ -254,6 +254,32 @@ public: /// subsequently removes or replaces devices. virtual void end_configuration() = 0; +protected: + /// \brief Designated constructor + /// + /// Construct base object discovery helper and register with device + /// to be invoked at resolution time. + /// \param [in] base Device to register with for resolution. + device_resolver_base(device_t &base); + + + /// \brief Pointer to next registered discovery helper + /// + /// This is a polymorphic class, so it can't be held in a standard + /// list container that requires elements of the same type. Hence + /// it implements basic intrusive single-linked list behaviour. + device_resolver_base *const m_next; +}; + + +/// \brief Base class for object discovery helpers +/// +/// Abstract non-template base class for object auto-discovery helpers. +/// Provides functionality for specifying a target as a base device and +/// relative tag. Also supplies helpers for looking up resources. +class finder_base : protected device_resolver_base +{ +public: /// \brief Get search tag /// /// Returns the search tag. @@ -280,6 +306,7 @@ public: void set_tag(device_t &base, char const *tag) { assert(!m_resolved); + assert(tag); m_base = base; m_tag = tag; } @@ -315,7 +342,9 @@ protected: /// /// Construct base object discovery helper and register with device /// to be invoked at resolution time. - /// \param [in] base Base device to search from. + /// \param [in] base Device to register with for resolution. Also + /// sets initial base device to search from. The tag must be + /// specified relative to this device. /// \param [in] tag Object tag to search for. This is not copied, /// it is the caller's responsibility to ensure this pointer /// remains valid until resolution time. @@ -419,13 +448,6 @@ protected: bool report_missing(bool found, char const *objname, bool required) const; - /// \brief Pointer to next registered discovery helper - /// - /// This is a polymorphic class, so it can't be held in a standard - /// list container that requires elements of the same type. Hence - /// it implements basic intrusive single-linked list behaviour. - finder_base *const m_next; - /// \brief Base device to search from std::reference_wrapper<device_t> m_base; diff --git a/src/emu/device.cpp b/src/emu/device.cpp index 425ce52d461..1940c619455 100644 --- a/src/emu/device.cpp +++ b/src/emu/device.cpp @@ -224,7 +224,7 @@ void device_t::add_machine_configuration(machine_config &config) assert(&config == &m_machine_config); machine_config::token const tok(config.begin_configuration(*this)); device_add_mconfig(config); - for (finder_base *autodev = m_auto_finder_list; autodev != nullptr; autodev = autodev->next()) + for (auto *autodev = m_auto_finder_list; autodev; autodev = autodev->next()) autodev->end_configuration(); } @@ -321,11 +321,7 @@ void device_t::config_complete() void device_t::validity_check(validity_checker &valid) const { - // validate callbacks - for (devcb_base const *callback : m_callbacks) - callback->validity_check(valid); - - // validate via the interfaces + // validate mixins for (device_interface &intf : interfaces()) intf.interface_validity_check(valid); @@ -478,26 +474,10 @@ void device_t::set_machine(running_machine &machine) bool device_t::findit(validity_checker *valid) const { bool allfound = true; - for (finder_base *autodev = m_auto_finder_list; autodev != nullptr; autodev = autodev->next()) + for (auto *autodev = m_auto_finder_list; autodev; autodev = autodev->next()) { - if (valid) - { - // sanity checking - char const *const tag = autodev->finder_tag(); - if (!tag) - { - osd_printf_error("Finder tag is null!\n"); - allfound = false; - continue; - } - if (tag[0] == '^' && tag[1] == ':') - { - osd_printf_error("Malformed finder tag: %s\n", tag); - allfound = false; - continue; - } - } - allfound &= autodev->findit(valid); + if (!autodev->findit(valid)) + allfound = false; } return allfound; } @@ -1006,18 +986,9 @@ void device_t::subdevice_list::remove(device_t &device) // list of stuff to find after we go live //------------------------------------------------- -finder_base *device_t::register_auto_finder(finder_base &autodev) -{ - // add to this list - finder_base *old = m_auto_finder_list; - m_auto_finder_list = &autodev; - return old; -} - - -void device_t::register_callback(devcb_base &callback) +device_resolver_base *device_t::register_auto_finder(device_resolver_base &autodev) { - m_callbacks.emplace_back(&callback); + return std::exchange(m_auto_finder_list, &autodev); } diff --git a/src/emu/device.h b/src/emu/device.h index 0142b9e665e..87736144292 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -465,8 +465,7 @@ class device_t : public delegate_late_bind friend class simple_list<device_t>; friend class running_machine; - friend class finder_base; - friend class devcb_base; + friend class device_resolver_base; class subdevice_list { @@ -850,8 +849,7 @@ protected: void pre_save(); void post_load(); void notify_clock_changed(bool sync_on_new_clock_domain = false); - finder_base *register_auto_finder(finder_base &autodev); - void register_callback(devcb_base &callback); + device_resolver_base *register_auto_finder(device_resolver_base &autodev); //------------------- begin derived class overrides @@ -1030,9 +1028,8 @@ private: std::string m_basetag; // base part of the tag bool m_config_complete; // have we completed our configuration? bool m_started; // true if the start function has succeeded - finder_base * m_auto_finder_list; // list of objects to auto-find + device_resolver_base * m_auto_finder_list; // list of objects to auto-find mutable std::vector<rom_entry> m_rom_entries; - std::list<devcb_base *> m_callbacks; std::vector<memory_view *> m_viewlist; // list of views // string formatting buffer for logerror diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h index d6d8e26929c..e6b890fcd6f 100644 --- a/src/emu/emufwd.h +++ b/src/emu/emufwd.h @@ -93,6 +93,7 @@ class devcb_base; template <typename Input, std::make_unsigned_t<Input> DefaultMask> class devcb_write; // declared in devfind.h +class device_resolver_base; class finder_base; template <class DeviceClass, bool Required> class device_finder; diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index f8d027310f1..cf311fb21eb 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -772,8 +772,6 @@ void screen_device::device_resolve_objects() // bind our handlers m_screen_update_ind16.resolve(); m_screen_update_rgb32.resolve(); - m_screen_vblank.resolve_safe(); - m_scanline_cb.resolve(); // assign our format to the palette before it starts if (m_palette) @@ -843,7 +841,7 @@ void screen_device::device_start() m_scanline0_timer = timer_alloc(FUNC(screen_device::first_scanline_tick), this); // allocate a timer to generate per-scanline updates - if ((m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0 || m_scanline_cb) + if ((m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0 || !m_scanline_cb.isunset()) m_scanline_timer = timer_alloc(FUNC(screen_device::scanline_tick), this); // configure the screen with the default parameters @@ -854,7 +852,7 @@ void screen_device::device_start() m_vblank_end_time = attotime(0, m_vblank_period); // start the timer to generate per-scanline updates - if ((m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0 || m_scanline_cb) + if ((m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0 || !m_scanline_cb.isunset()) m_scanline_timer->adjust(time_until_pos(0)); // create burn-in bitmap @@ -957,7 +955,7 @@ TIMER_CALLBACK_MEMBER(screen_device::scanline_tick) // force a partial update to the current scanline update_partial(param); } - if (m_scanline_cb) + if (!m_scanline_cb.isunset()) m_scanline_cb(param); // compute the next visible scanline diff --git a/src/mame/acorn/accomm.cpp b/src/mame/acorn/accomm.cpp index 774fcc371bf..30703aac61f 100644 --- a/src/mame/acorn/accomm.cpp +++ b/src/mame/acorn/accomm.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "emu.h" + #include "cpu/g65816/g65816.h" #include "machine/6522via.h" #include "machine/6850acia.h" @@ -40,13 +41,18 @@ #include "bus/econet/econet.h" #include "bus/centronics/ctronics.h" #include "bus/rs232/rs232.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" + #include "utf8.h" #include "accomm.lh" + +namespace { + /* Interrupts */ #define INT_HIGH_TONE 0x40 #define INT_TRANSMIT_EMPTY 0x20 @@ -928,8 +934,7 @@ void accomm_state::accomm(machine_config &config) MOS6522(config, m_via, 16_MHz_XTAL / 16); m_via->writepa_handler().set("cent_data_out", FUNC(output_latch_device::write)); m_via->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe)); - m_via->readpb_handler().set(m_rtc, FUNC(pcf8573_device::sda_r)).bit(0); - m_via->readpb_handler().append(m_cct, FUNC(saa5240a_device::read_sda)).bit(0); + m_via->readpb_handler().set([this] () { return uint8_t(m_rtc->sda_r() & m_cct->read_sda()); }); m_via->writepb_handler().set(m_rtc, FUNC(pcf8573_device::sda_w)).bit(1).invert(); m_via->writepb_handler().append(m_rtc, FUNC(pcf8573_device::scl_w)).bit(2).invert(); m_via->writepb_handler().append(m_cct, FUNC(saa5240a_device::write_sda)).bit(1).invert(); @@ -1079,6 +1084,8 @@ ROM_START(accommi) ROM_REGION(0x380000, "ext", ROMREGION_ERASEFF) ROM_END +} // anonymous namespace + /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP( 1986, accomm, 0, 0, accomm, accomm, accomm_state, empty_init, "Acorn Computers", "Acorn Communicator", MACHINE_NOT_WORKING ) diff --git a/src/mame/acorn/upd65031.cpp b/src/mame/acorn/upd65031.cpp index c09ad130845..32cd2438bcd 100644 --- a/src/mame/acorn/upd65031.cpp +++ b/src/mame/acorn/upd65031.cpp @@ -268,7 +268,7 @@ inline void upd65031_device::set_mode(int mode) upd65031_device::upd65031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD65031, tag, owner, clock), device_serial_interface(mconfig, *this), - m_read_kb(*this), + m_read_kb(*this, 0), m_write_int(*this), m_write_nmi(*this), m_write_spkr(*this), @@ -290,16 +290,6 @@ upd65031_device::upd65031_device(const machine_config &mconfig, const char *tag, void upd65031_device::device_start() { - // resolve callbacks - m_read_kb.resolve_safe(0); - m_write_int.resolve_safe(); - m_write_nmi.resolve_safe(); - m_write_spkr.resolve_safe(); - m_write_txd.resolve_safe(); - m_write_rts.resolve_safe(); - m_write_dtr.resolve_safe(); - m_write_vpp.resolve_safe(); - // bind delegates m_screen_update_cb.resolve(); m_out_mem_cb.resolve(); diff --git a/src/mame/act/apricotkb.cpp b/src/mame/act/apricotkb.cpp index 383fa1fe07b..e701275cbef 100644 --- a/src/mame/act/apricotkb.cpp +++ b/src/mame/act/apricotkb.cpp @@ -252,8 +252,6 @@ apricot_keyboard_device::apricot_keyboard_device(const machine_config &mconfig, void apricot_keyboard_device::device_start() { - // resolve callbacks - m_write_txd.resolve_safe(); } diff --git a/src/mame/act/victor9k_fdc.cpp b/src/mame/act/victor9k_fdc.cpp index eb8e4224994..3d8fb5091e8 100644 --- a/src/mame/act/victor9k_fdc.cpp +++ b/src/mame/act/victor9k_fdc.cpp @@ -255,11 +255,6 @@ void victor_9000_fdc_device::device_start() { m_leds.resolve(); - // resolve callbacks - m_irq_cb.resolve_safe(); - m_syn_cb.resolve_safe(); - m_lbrdy_cb.resolve_safe(); - // allocate timer t_gen = timer_alloc(FUNC(victor_9000_fdc_device::gen_tick), this); t_tach[0] = timer_alloc(FUNC(victor_9000_fdc_device::tach0_tick), this); diff --git a/src/mame/act/victor9k_kb.cpp b/src/mame/act/victor9k_kb.cpp index c5389036e97..04901f6ac6c 100644 --- a/src/mame/act/victor9k_kb.cpp +++ b/src/mame/act/victor9k_kb.cpp @@ -339,6 +339,8 @@ Y11 104 103 102 101 100 99 98 97 kN/A k. k00 k0 RGHT LEFT PAUS #include "utf8.h" +//#define VERBOSE 1 +#include "logmacro.h" //************************************************************************** @@ -347,8 +349,6 @@ Y11 104 103 102 101 100 99 98 97 kN/A k. k00 k0 RGHT LEFT PAUS #define I8021_TAG "z3" -#define LOG 0 - //************************************************************************** @@ -569,10 +569,6 @@ victor_9000_keyboard_device::victor_9000_keyboard_device(const machine_config &m void victor_9000_keyboard_device::device_start() { - // resolve callbacks - m_kbrdy_cb.resolve_safe(); - m_kbdata_cb.resolve_safe(); - // state saving save_item(NAME(m_p1)); save_item(NAME(m_keylatch)); @@ -590,7 +586,7 @@ void victor_9000_keyboard_device::device_start() void victor_9000_keyboard_device::kback_w(int state) { - if (LOG) logerror("KBACK %u\n", state); + LOG("KBACK %u\n", state); m_kback = !state; } diff --git a/src/mame/agat/agatkeyb.cpp b/src/mame/agat/agatkeyb.cpp index f6ba09d6c45..74ce7df560e 100644 --- a/src/mame/agat/agatkeyb.cpp +++ b/src/mame/agat/agatkeyb.cpp @@ -179,10 +179,6 @@ ioport_constructor agat_keyboard_device::device_input_ports() const void agat_keyboard_device::device_start() { - m_keyboard_cb.resolve(); - m_out_meta_cb.resolve(); - m_out_reset_cb.resolve(); - save_item(NAME(m_last_modifiers)); save_item(NAME(m_meta)); } diff --git a/src/mame/altos/acs8600_ics.cpp b/src/mame/altos/acs8600_ics.cpp index 2ad55917359..d7f2a6d1143 100644 --- a/src/mame/altos/acs8600_ics.cpp +++ b/src/mame/altos/acs8600_ics.cpp @@ -198,13 +198,6 @@ void acs8600_ics_device::device_add_mconfig(machine_config &config) rs2324b.cts_handler().set("sio4", FUNC(z80sio_device::ctsb_w)); } -void acs8600_ics_device::device_resolve_objects() -{ - m_out_irq1_func.resolve_safe(); - m_out_irq2_func.resolve_safe(); -} - void acs8600_ics_device::device_start() { } - diff --git a/src/mame/altos/acs8600_ics.h b/src/mame/altos/acs8600_ics.h index 869344c7da7..46b15923abf 100644 --- a/src/mame/altos/acs8600_ics.h +++ b/src/mame/altos/acs8600_ics.h @@ -21,7 +21,6 @@ public: const tiny_rom_entry *device_rom_region() const override; protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/mame/altos/altos2_kbd.cpp b/src/mame/altos/altos2_kbd.cpp index 6bd9f430821..122ab102959 100644 --- a/src/mame/altos/altos2_kbd.cpp +++ b/src/mame/altos/altos2_kbd.cpp @@ -45,7 +45,6 @@ void altos2_keyboard_device::device_resolve_objects() m_insline_led.resolve(); m_inschar_led.resolve(); m_calc_led.resolve(); - m_txd_callback.resolve_safe(); } void altos2_keyboard_device::device_start() diff --git a/src/mame/amiga/amiga.cpp b/src/mame/amiga/amiga.cpp index cb8e61587c4..fabb0fcc924 100644 --- a/src/mame/amiga/amiga.cpp +++ b/src/mame/amiga/amiga.cpp @@ -143,11 +143,6 @@ public: } protected: - virtual void device_resolve_objects() override - { - m_kbrst_cb.resolve_safe(); - } - virtual void device_start() override { // allocate resources diff --git a/src/mame/amstrad/pc1512kb.cpp b/src/mame/amstrad/pc1512kb.cpp index 1882b4fa02c..469a65bcd3b 100644 --- a/src/mame/amstrad/pc1512kb.cpp +++ b/src/mame/amstrad/pc1512kb.cpp @@ -225,14 +225,12 @@ pc1512_keyboard_device::pc1512_keyboard_device(const machine_config &mconfig, co void pc1512_keyboard_device::device_start() { + // resolve outputs m_leds.resolve(); + // allocate timers m_reset_timer = timer_alloc(FUNC(pc1512_keyboard_device::reset_timer_tick), this); - // resolve callbacks - m_write_clock.resolve_safe(); - m_write_data.resolve_safe(); - // state saving save_item(NAME(m_data_in)); save_item(NAME(m_clock_in)); diff --git a/src/mame/amstrad/pda600_copro.cpp b/src/mame/amstrad/pda600_copro.cpp index bb67fe10be7..f615c73d17d 100644 --- a/src/mame/amstrad/pda600_copro.cpp +++ b/src/mame/amstrad/pda600_copro.cpp @@ -226,14 +226,6 @@ ioport_constructor pda600_copro_device::device_input_ports() const } -void pda600_copro_device::device_resolve_objects() -{ - // resolve callbacks - m_tx_cb.resolve_safe(); - m_tone_cb.resolve_safe(); -} - - void pda600_copro_device::device_start() { // parameters used by the MAINCPU to configure the Z180 ASCI1 diff --git a/src/mame/amstrad/pda600_copro.h b/src/mame/amstrad/pda600_copro.h index a504655d583..ef3ce585957 100644 --- a/src/mame/amstrad/pda600_copro.h +++ b/src/mame/amstrad/pda600_copro.h @@ -35,7 +35,6 @@ public: private: // device-level overrides virtual ioport_constructor device_input_ports() const override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/apollo/apollo_kbd.cpp b/src/mame/apollo/apollo_kbd.cpp index 8d43814ee31..f793a0d84fb 100644 --- a/src/mame/apollo/apollo_kbd.cpp +++ b/src/mame/apollo/apollo_kbd.cpp @@ -193,7 +193,7 @@ apollo_kbd_device::apollo_kbd_device(const machine_config &mconfig, const char * , m_io_keyboard(*this, "keyboard%u", 1U) , m_io_mouse(*this, "mouse%u", 1U) , m_tx_w(*this) - , m_german_r(*this) + , m_german_r(*this, 0) { } @@ -219,16 +219,6 @@ ioport_constructor apollo_kbd_device::device_input_ports() const } //------------------------------------------------- -// device_resolve_objects - resolve objects -//------------------------------------------------- - -void apollo_kbd_device::device_resolve_objects() -{ - m_tx_w.resolve_safe(); - m_german_r.resolve_safe(0); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/apollo/apollo_kbd.h b/src/mame/apollo/apollo_kbd.h index fe4f64f1fb2..f4c92eac8cc 100644 --- a/src/mame/apollo/apollo_kbd.h +++ b/src/mame/apollo/apollo_kbd.h @@ -44,17 +44,17 @@ public: auto german_cb() { return m_german_r.bind(); } private: - // device-level overrides + // device_t implementation virtual ioport_constructor device_input_ports() const override; 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; - // serial overrides + // device_serial_interface implementation virtual void rcv_complete() override; // Rx completed receiving byte virtual void tra_complete() override; // Tx completed sending byte virtual void tra_callback() override; // Tx send bit + void input_callback(uint8_t state); TIMER_CALLBACK_MEMBER( kbd_scan_timer ); diff --git a/src/mame/apollo/apollo_m.cpp b/src/mame/apollo/apollo_m.cpp index 52e34f02722..1980dc138d8 100644 --- a/src/mame/apollo/apollo_m.cpp +++ b/src/mame/apollo/apollo_m.cpp @@ -1274,7 +1274,7 @@ void apollo_stdio_device::device_start() { CLOG1(("device_start")); - m_tx_w.resolve_safe(); + m_tx_w.resolve(); m_poll_timer = timer_alloc(FUNC(apollo_stdio_device::poll_timer), this); } diff --git a/src/mame/apple/adbmodem.cpp b/src/mame/apple/adbmodem.cpp index a0e787f2493..0f3424c8b43 100644 --- a/src/mame/apple/adbmodem.cpp +++ b/src/mame/apple/adbmodem.cpp @@ -95,14 +95,14 @@ void adbmodem_device::adb_change() // adbmodem_device - constructor //------------------------------------------------- -adbmodem_device::adbmodem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ADBMODEM, tag, owner, clock), - write_reset(*this), - write_linechange(*this), - write_via_clock(*this), - write_via_data(*this), - write_irq(*this), - m_maincpu(*this, "adbmodem") +adbmodem_device::adbmodem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ADBMODEM, tag, owner, clock), + write_reset(*this), + write_linechange(*this), + write_via_clock(*this), + write_via_data(*this), + write_irq(*this), + m_maincpu(*this, "adbmodem") #if USE_BUS_ADB , m_adb_connector{{*this, "adb1"}, {*this, finder_base::DUMMY_TAG}} #endif @@ -115,12 +115,6 @@ adbmodem_device::adbmodem_device(const machine_config &mconfig, const char *tag, void adbmodem_device::device_start() { - write_reset.resolve_safe(); - write_linechange.resolve_safe(); - write_via_clock.resolve_safe(); - write_via_data.resolve_safe(); - write_irq.resolve_safe(); - #if USE_BUS_ADB for (int i = 0; i < 2; i++) { diff --git a/src/mame/apple/awacs_macrisc.cpp b/src/mame/apple/awacs_macrisc.cpp index be87caf10f6..f40c8e11013 100644 --- a/src/mame/apple/awacs_macrisc.cpp +++ b/src/mame/apple/awacs_macrisc.cpp @@ -39,7 +39,7 @@ DEFINE_DEVICE_TYPE(SCREAMER, screamer_device, "screamer", "Screamer audio I/O") awacs_macrisc_device::awacs_macrisc_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_output_cb(*this) + , m_output_cb(*this, 0) , m_input_cb(*this) , m_stream(nullptr) { @@ -64,9 +64,6 @@ void awacs_macrisc_device::device_start() // create the stream m_stream = stream_alloc(0, 2, clock()/1024, STREAM_SYNCHRONOUS); - m_output_cb.resolve_safe(0); - m_input_cb.resolve_safe(); - save_item(NAME(m_phase)); save_item(NAME(m_active)); save_item(NAME(m_registers)); diff --git a/src/mame/apple/burgundy.cpp b/src/mame/apple/burgundy.cpp index 99b5b5df0ea..2865b9e5574 100644 --- a/src/mame/apple/burgundy.cpp +++ b/src/mame/apple/burgundy.cpp @@ -33,7 +33,7 @@ constexpr u32 CODEC_PRESENT = (1 << 22); burgundy_device::burgundy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BURGUNDY, tag, owner, clock) , device_sound_interface(mconfig, *this) - , m_output_cb(*this) + , m_output_cb(*this, 0) , m_input_cb(*this) , m_stream(nullptr) { @@ -48,9 +48,6 @@ void burgundy_device::device_start() // create the stream m_stream = stream_alloc(0, 2, clock() / 512, STREAM_SYNCHRONOUS); - m_output_cb.resolve_safe(0); - m_input_cb.resolve_safe(); - save_item(NAME(m_phase)); save_item(NAME(m_active)); save_item(NAME(m_registers)); diff --git a/src/mame/apple/cuda.cpp b/src/mame/apple/cuda.cpp index 30d3d620182..c632742e5b4 100644 --- a/src/mame/apple/cuda.cpp +++ b/src/mame/apple/cuda.cpp @@ -417,15 +417,9 @@ cuda_device::cuda_device(const machine_config &mconfig, const char *tag, device_ void cuda_device::device_start() { - write_reset.resolve_safe(); - write_linechange.resolve_safe(); - write_via_clock.resolve_safe(); - write_via_data.resolve_safe(); - write_iic_scl.resolve_safe(); - write_iic_sda.resolve_safe(); - m_timer = timer_alloc(FUNC(cuda_device::seconds_tick), this); m_prog_timer = timer_alloc(FUNC(cuda_device::timer_tick), this); + save_item(NAME(ddrs[0])); save_item(NAME(ddrs[1])); save_item(NAME(ddrs[2])); diff --git a/src/mame/apple/dbdma.cpp b/src/mame/apple/dbdma.cpp index 720ed585c2d..ed6f20b2196 100644 --- a/src/mame/apple/dbdma.cpp +++ b/src/mame/apple/dbdma.cpp @@ -28,9 +28,9 @@ static constexpr u16 STATUS_ACTIVE = 0x0400; // dbdma_device - constructor //------------------------------------------------- -dbdma_device::dbdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, DBDMA_CHANNEL, tag, owner, clock), - write_irq(*this) +dbdma_device::dbdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, DBDMA_CHANNEL, tag, owner, clock), + write_irq(*this) { } @@ -40,8 +40,6 @@ dbdma_device::dbdma_device(const machine_config &mconfig, const char *tag, devic void dbdma_device::device_start() { - write_irq.resolve_safe(); - save_item(NAME(m_status)); save_item(NAME(m_command_pointer)); save_item(NAME(m_intselect)); diff --git a/src/mame/apple/egret.cpp b/src/mame/apple/egret.cpp index fed99abb31d..6c1e5d9d8e0 100644 --- a/src/mame/apple/egret.cpp +++ b/src/mame/apple/egret.cpp @@ -395,11 +395,6 @@ egret_device::egret_device(const machine_config &mconfig, const char *tag, devic void egret_device::device_start() { - write_reset.resolve_safe(); - write_linechange.resolve_safe(); - write_via_clock.resolve_safe(); - write_via_data.resolve_safe(); - #if USE_BUS_ADB for (int i = 0; i < 2; i++) { @@ -413,6 +408,7 @@ void egret_device::device_start() #endif m_timer = timer_alloc(FUNC(egret_device::seconds_tick), this); + save_item(NAME(ddrs[0])); save_item(NAME(ddrs[1])); save_item(NAME(ddrs[2])); diff --git a/src/mame/apple/heathrow.cpp b/src/mame/apple/heathrow.cpp index eeeb1fb7a30..d63685bcc14 100644 --- a/src/mame/apple/heathrow.cpp +++ b/src/mame/apple/heathrow.cpp @@ -195,46 +195,46 @@ void macio_device::config_map(address_map &map) // macio_device - constructor //------------------------------------------------- -macio_device::macio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) - : pci_device(mconfig, type, tag, owner, clock), - write_irq(*this), - write_pb4(*this), - write_pb5(*this), - write_cb2(*this), - read_pb3(*this), - read_codec(*this), - write_codec(*this), - m_maincpu(*this, finder_base::DUMMY_TAG), - m_via1(*this, "via1"), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:%d", 0U), - m_scc(*this, "scc"), - m_dma_scsi(*this, "dma_scsi0"), - m_dma_floppy(*this, "dma_floppy"), - m_dma_sccatx(*this, "dma_scca_tx"), - m_dma_sccarx(*this, "dma_scca_rx"), - m_dma_sccbtx(*this, "dma_sccb_tx"), - m_dma_sccbrx(*this, "dma_sccb_rx"), - m_dma_audio_in(*this, "dma_audin"), - m_dma_audio_out(*this, "dma_audout"), - m_pci_memory(*this, ":pci:00.0", AS_DATA), - m_cur_floppy(nullptr), - m_hdsel(0) +macio_device::macio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + pci_device(mconfig, type, tag, owner, clock), + write_irq(*this), + write_pb4(*this), + write_pb5(*this), + write_cb2(*this), + read_pb3(*this, 0), + read_codec(*this, 0), + write_codec(*this), + m_maincpu(*this, finder_base::DUMMY_TAG), + m_via1(*this, "via1"), + m_fdc(*this, "fdc"), + m_floppy(*this, "fdc:%d", 0U), + m_scc(*this, "scc"), + m_dma_scsi(*this, "dma_scsi0"), + m_dma_floppy(*this, "dma_floppy"), + m_dma_sccatx(*this, "dma_scca_tx"), + m_dma_sccarx(*this, "dma_scca_rx"), + m_dma_sccbtx(*this, "dma_sccb_tx"), + m_dma_sccbrx(*this, "dma_sccb_rx"), + m_dma_audio_in(*this, "dma_audin"), + m_dma_audio_out(*this, "dma_audout"), + m_pci_memory(*this, ":pci:00.0", AS_DATA), + m_cur_floppy(nullptr), + m_hdsel(0) { m_toggle = 0; } -grandcentral_device::grandcentral_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : macio_device(mconfig, GRAND_CENTRAL, tag, owner, clock), +grandcentral_device::grandcentral_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + macio_device(mconfig, GRAND_CENTRAL, tag, owner, clock), m_dma_scsi1(*this, "dma_scsi1") { } -ohare_device::ohare_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) - : macio_device(mconfig, type, tag, owner, clock), - device_nvram_interface(mconfig, *this), - m_dma_ata0(*this, "dma_ata0"), - m_dma_ata1(*this, "dma_ata1") +ohare_device::ohare_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + macio_device(mconfig, type, tag, owner, clock), + device_nvram_interface(mconfig, *this), + m_dma_ata0(*this, "dma_ata0"), + m_dma_ata1(*this, "dma_ata1") { } @@ -264,14 +264,6 @@ paddington_device::paddington_device(const machine_config &mconfig, const char * void macio_device::common_init() { - write_irq.resolve_safe(); - write_pb4.resolve_safe(); - write_pb5.resolve_safe(); - write_cb2.resolve_safe(); - read_pb3.resolve_safe(0); - read_codec.resolve_safe(0); - write_codec.resolve_safe(); - m_dma_scsi->set_address_space(m_pci_memory); m_dma_floppy->set_address_space(m_pci_memory); m_dma_sccatx->set_address_space(m_pci_memory); diff --git a/src/mame/apple/iphone2g.cpp b/src/mame/apple/iphone2g.cpp index ec4a2d3b446..316a34ff5be 100644 --- a/src/mame/apple/iphone2g.cpp +++ b/src/mame/apple/iphone2g.cpp @@ -27,7 +27,6 @@ protected: iphone2g_spi_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; virtual void device_start() override; virtual void device_reset() override; @@ -87,12 +86,6 @@ device_memory_interface::space_config_vector iphone2g_spi_device::memory_space_c }; } -void iphone2g_spi_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_func.resolve_safe(); -} - void iphone2g_spi_device::device_start() { save_item(NAME(m_cmd)); @@ -137,7 +130,6 @@ protected: iphone2g_timer_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; virtual void device_start() override; virtual void device_reset() override; @@ -180,12 +172,6 @@ device_memory_interface::space_config_vector iphone2g_timer_device::memory_space }; } -void iphone2g_timer_device::device_resolve_objects() -{ - // resolve callbacks - m_out_irq_func.resolve_safe(); -} - void iphone2g_timer_device::device_start() { m_irq_timer = timer_alloc(FUNC(iphone2g_timer_device::send_irq), this); diff --git a/src/mame/apple/macadb.cpp b/src/mame/apple/macadb.cpp index cf5993acc0f..405fc3238f2 100644 --- a/src/mame/apple/macadb.cpp +++ b/src/mame/apple/macadb.cpp @@ -252,11 +252,6 @@ ioport_constructor macadb_device::device_input_ports() const void macadb_device::device_start() { - write_via_clock.resolve_safe(); - write_via_data.resolve_safe(); - write_adb_data.resolve_safe(); - write_adb_irq.resolve_safe(); - this->m_adb_timer = timer_alloc(FUNC(macadb_device::mac_adb_tick), this); this->m_adb_timer->adjust(attotime::never); diff --git a/src/mame/apple/macrtc.cpp b/src/mame/apple/macrtc.cpp index 1f662e3a1f8..e684d15b751 100644 --- a/src/mame/apple/macrtc.cpp +++ b/src/mame/apple/macrtc.cpp @@ -78,11 +78,6 @@ rtc3430040_device::rtc3430040_device(const machine_config &mconfig, const char * { } -void rtc3430042_device::device_resolve_objects() -{ - m_cko_cb.resolve_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/apple/macrtc.h b/src/mame/apple/macrtc.h index 2d9689ea3f2..499a9f6f23a 100644 --- a/src/mame/apple/macrtc.h +++ b/src/mame/apple/macrtc.h @@ -42,7 +42,6 @@ public: protected: // device-level overrides - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/apple/macscsi.cpp b/src/mame/apple/macscsi.cpp index 15524a6bec4..6929ec9a8e4 100644 --- a/src/mame/apple/macscsi.cpp +++ b/src/mame/apple/macscsi.cpp @@ -68,9 +68,9 @@ ALLOW_SAVE_TYPE(mac_scsi_helper_device::mode); mac_scsi_helper_device::mac_scsi_helper_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MAC_SCSI_HELPER, tag, owner, clock) - , m_scsi_read_callback(*this) + , m_scsi_read_callback(*this, BAD_BYTE) , m_scsi_write_callback(*this) - , m_scsi_dma_read_callback(*this) + , m_scsi_dma_read_callback(*this, BAD_BYTE) , m_scsi_dma_write_callback(*this) , m_cpu_halt_callback(*this) , m_timeout_error_callback(*this) @@ -84,16 +84,6 @@ mac_scsi_helper_device::mac_scsi_helper_device(const machine_config &mconfig, co { } -void mac_scsi_helper_device::device_resolve_objects() -{ - m_scsi_read_callback.resolve_safe(BAD_BYTE); - m_scsi_write_callback.resolve_safe(); - m_scsi_dma_read_callback.resolve_safe(BAD_BYTE); - m_scsi_dma_write_callback.resolve_safe(); - m_cpu_halt_callback.resolve_safe(); - m_timeout_error_callback.resolve_safe(); -} - void mac_scsi_helper_device::device_start() { m_pseudo_dma_timer = timer_alloc(FUNC(mac_scsi_helper_device::timer_callback), this); diff --git a/src/mame/apple/macscsi.h b/src/mame/apple/macscsi.h index c5bdf198a4b..d2c3c595fd8 100644 --- a/src/mame/apple/macscsi.h +++ b/src/mame/apple/macscsi.h @@ -30,8 +30,7 @@ public: void drq_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; diff --git a/src/mame/apple/rbv.cpp b/src/mame/apple/rbv.cpp index 7fa8f7d24d0..37ca86eb5cf 100644 --- a/src/mame/apple/rbv.cpp +++ b/src/mame/apple/rbv.cpp @@ -71,13 +71,13 @@ void rbv_device::device_add_mconfig(machine_config &config) // rbv_device - constructor //------------------------------------------------- -rbv_device::rbv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, RBV, tag, owner, clock), - write_6015(*this), - write_irq(*this), - m_montype(*this, "MONTYPE"), - m_screen(*this, "screen"), - m_palette(*this, "palette") +rbv_device::rbv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, RBV, tag, owner, clock), + write_6015(*this), + write_irq(*this), + m_montype(*this, "MONTYPE"), + m_screen(*this, "screen"), + m_palette(*this, "palette") { } @@ -87,9 +87,6 @@ rbv_device::rbv_device(const machine_config &mconfig, const char *tag, device_t void rbv_device::device_start() { - write_6015.resolve_safe(); - write_irq.resolve_safe(); - m_6015_timer = timer_alloc(FUNC(rbv_device::mac_6015_tick), this); m_6015_timer->adjust(attotime::never); diff --git a/src/mame/apple/sonora.cpp b/src/mame/apple/sonora.cpp index a59eddcd771..b51c349f909 100644 --- a/src/mame/apple/sonora.cpp +++ b/src/mame/apple/sonora.cpp @@ -92,22 +92,22 @@ void sonora_device::device_add_mconfig(machine_config &config) // sonora_device - constructor //------------------------------------------------- -sonora_device::sonora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SONORA, tag, owner, clock), - write_pb4(*this), - write_pb5(*this), - write_cb2(*this), - read_pb3(*this), - m_maincpu(*this, finder_base::DUMMY_TAG), - m_video(*this, "sonora_video"), - m_via1(*this, "via1"), - m_asc(*this, "asc"), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:%d", 0U), - m_rom(*this, finder_base::DUMMY_TAG), - m_cur_floppy(nullptr), - m_hdsel(0), - m_overlay(false) +sonora_device::sonora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, SONORA, tag, owner, clock), + write_pb4(*this), + write_pb5(*this), + write_cb2(*this), + read_pb3(*this, 0), + m_maincpu(*this, finder_base::DUMMY_TAG), + m_video(*this, "sonora_video"), + m_via1(*this, "via1"), + m_asc(*this, "asc"), + m_fdc(*this, "fdc"), + m_floppy(*this, "fdc:%d", 0U), + m_rom(*this, finder_base::DUMMY_TAG), + m_cur_floppy(nullptr), + m_hdsel(0), + m_overlay(false) { } @@ -119,11 +119,6 @@ void sonora_device::device_start() { m_vram = std::make_unique<u32[]>(0x100000 / sizeof(u32)); - write_pb4.resolve_safe(); - write_pb5.resolve_safe(); - write_cb2.resolve_safe(); - read_pb3.resolve_safe(0); - m_6015_timer = timer_alloc(FUNC(sonora_device::mac_6015_tick), this); m_6015_timer->adjust(attotime::never); diff --git a/src/mame/apple/v8.cpp b/src/mame/apple/v8.cpp index 8abbda5590f..8293a6e211f 100644 --- a/src/mame/apple/v8.cpp +++ b/src/mame/apple/v8.cpp @@ -138,7 +138,7 @@ v8_device::v8_device(const machine_config &mconfig, device_type type, const char write_cb2(*this), write_hdsel(*this), write_hmmu_enable(*this), - read_pb3(*this), + read_pb3(*this, 0), m_montype(*this, "MONTYPE"), m_via1(*this, "via1"), m_rom(*this, finder_base::DUMMY_TAG), @@ -155,13 +155,6 @@ void v8_device::device_start() { m_vram = std::make_unique<u32[]>(0x100000 / sizeof(u32)); - write_pb4.resolve_safe(); - write_pb5.resolve_safe(); - write_cb2.resolve_safe(); - write_hdsel.resolve_safe(); - write_hmmu_enable.resolve_safe(); - read_pb3.resolve_safe(0); - m_6015_timer = timer_alloc(FUNC(v8_device::mac_6015_tick), this); m_6015_timer->adjust(attotime::never); diff --git a/src/mame/apple/vasp.cpp b/src/mame/apple/vasp.cpp index 2558ce03ab8..764738b78ef 100644 --- a/src/mame/apple/vasp.cpp +++ b/src/mame/apple/vasp.cpp @@ -97,21 +97,21 @@ void vasp_device::device_add_mconfig(machine_config &config) // vasp_device - constructor //------------------------------------------------- -vasp_device::vasp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, VASP, tag, owner, clock), - write_pb4(*this), - write_pb5(*this), - write_cb2(*this), - write_hdsel(*this), - read_pb3(*this), - m_maincpu(*this, finder_base::DUMMY_TAG), - m_montype(*this, "MONTYPE"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_via1(*this, "via1"), - m_asc(*this, "asc"), - m_rom(*this, finder_base::DUMMY_TAG), - m_overlay(false) +vasp_device::vasp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, VASP, tag, owner, clock), + write_pb4(*this), + write_pb5(*this), + write_cb2(*this), + write_hdsel(*this), + read_pb3(*this, 0), + m_maincpu(*this, finder_base::DUMMY_TAG), + m_montype(*this, "MONTYPE"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_via1(*this, "via1"), + m_asc(*this, "asc"), + m_rom(*this, finder_base::DUMMY_TAG), + m_overlay(false) { } @@ -123,12 +123,6 @@ void vasp_device::device_start() { m_vram = std::make_unique<u32[]>(0x100000 / sizeof(u32)); - write_pb4.resolve_safe(); - write_pb5.resolve_safe(); - write_cb2.resolve_safe(); - write_hdsel.resolve_safe(); - read_pb3.resolve_safe(0); - m_6015_timer = timer_alloc(FUNC(vasp_device::mac_6015_tick), this); m_6015_timer->adjust(attotime::never); diff --git a/src/mame/atari/atarijsa.cpp b/src/mame/atari/atarijsa.cpp index 8b14ae8f4f9..6886b2efe90 100644 --- a/src/mame/atari/atarijsa.cpp +++ b/src/mame/atari/atarijsa.cpp @@ -242,7 +242,7 @@ atari_jsa_base_device::atari_jsa_base_device(const machine_config &mconfig, devi m_ym2151(*this, "ym2151"), m_cpu_region(*this, "cpu"), m_cpu_bank(*this, "cpubank"), - m_test_read_cb(*this), + m_test_read_cb(*this, 0), m_main_int_cb(*this), m_timed_int(false), m_ym2151_int(false), @@ -263,10 +263,6 @@ void atari_jsa_base_device::device_start() // configure CPU bank m_cpu_bank->configure_entries(0, 4, m_cpu_region->base(), 0x1000); - // resolve devices - m_test_read_cb.resolve_safe(0); - m_main_int_cb.resolve_safe(); - // save states save_item(NAME(m_timed_int)); save_item(NAME(m_ym2151_int)); diff --git a/src/mame/atari/atariscom.cpp b/src/mame/atari/atariscom.cpp index 36e0bb37d2a..f1ba2ff10ff 100644 --- a/src/mame/atari/atariscom.cpp +++ b/src/mame/atari/atariscom.cpp @@ -52,9 +52,6 @@ atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, void atari_sound_comm_device::device_start() { - // resolve callbacks - m_main_int_cb.resolve_safe(); - // register for save states save_item(NAME(m_main_to_sound_ready)); save_item(NAME(m_sound_to_main_ready)); diff --git a/src/mame/atari/atarist_v.cpp b/src/mame/atari/atarist_v.cpp index 5aab360faff..20ed5073b41 100644 --- a/src/mame/atari/atarist_v.cpp +++ b/src/mame/atari/atarist_v.cpp @@ -617,12 +617,6 @@ ste_video_device::ste_video_device(const machine_config &mconfig, const char *ta } -void stx_video_device::device_resolve_objects() -{ - m_de_callback.resolve_safe(); -} - - void stx_video_device::device_start() { m_shifter_timer = timer_alloc(FUNC(stx_video_device::shifter_tick), this); diff --git a/src/mame/atari/atarist_v.h b/src/mame/atari/atarist_v.h index a38c9384701..6b0d4daac9a 100644 --- a/src/mame/atari/atarist_v.h +++ b/src/mame/atari/atarist_v.h @@ -53,7 +53,6 @@ public: protected: stx_video_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; virtual uint32_t palette_entries() const noexcept override { return 16; } diff --git a/src/mame/atari/ataristb.cpp b/src/mame/atari/ataristb.cpp index 9e4364bce77..6f2bb0d1809 100644 --- a/src/mame/atari/ataristb.cpp +++ b/src/mame/atari/ataristb.cpp @@ -518,12 +518,6 @@ st_blitter_device::st_blitter_device(const machine_config &mconfig, const char * } -void st_blitter_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); -} - - void st_blitter_device::device_start() { m_blitter_timer = timer_alloc(FUNC(st_blitter_device::blitter_tick), this); diff --git a/src/mame/atari/ataristb.h b/src/mame/atari/ataristb.h index 28041a2c8e7..dfda8e918f0 100644 --- a/src/mame/atari/ataristb.h +++ b/src/mame/atari/ataristb.h @@ -47,7 +47,6 @@ public: void ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/atari/atarivad.cpp b/src/mame/atari/atarivad.cpp index 0182f814944..460762805f0 100644 --- a/src/mame/atari/atarivad.cpp +++ b/src/mame/atari/atarivad.cpp @@ -164,9 +164,6 @@ void atari_vad_device::device_start() if (m_eof_data == nullptr) throw emu_fatalerror("EOF data not found!"); - // resolve callbacks - m_scanline_int_cb.resolve_safe(); - // allocate timers m_scanline_int_timer = timer_alloc(FUNC(atari_vad_device::scanline_int), this); m_tilerow_update_timer = timer_alloc(FUNC(atari_vad_device::update_tilerow), this); diff --git a/src/mame/atari/gtia.cpp b/src/mame/atari/gtia.cpp index 51713be74e4..73f2d66dcc0 100644 --- a/src/mame/atari/gtia.cpp +++ b/src/mame/atari/gtia.cpp @@ -123,9 +123,9 @@ DEFINE_DEVICE_TYPE(ATARI_GTIA, gtia_device, "gtia", "Atari GTIA") gtia_device::gtia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_GTIA, tag, owner, clock) , m_region(GTIA_NTSC) - , m_read_cb(*this) + , m_read_cb(*this, 0x0f) , m_write_cb(*this) - , m_trigger_cb(*this) + , m_trigger_cb(*this, 0xf) { } @@ -136,10 +136,6 @@ gtia_device::gtia_device(const machine_config &mconfig, const char *tag, device_ void gtia_device::device_start() { - m_read_cb.resolve(); - m_write_cb.resolve(); - m_trigger_cb.resolve_safe(0xf); - save_item(NAME(m_r.m0pf)); save_item(NAME(m_r.m1pf)); save_item(NAME(m_r.m2pf)); @@ -380,7 +376,7 @@ uint8_t gtia_device::read(offs_t offset) // unconfirmed behaviour with reading lines unconnected, // assume active low logic with read direction. const u8 consol_read_dir = (~m_w.consol & 0xf); - const u8 res = !m_read_cb.isnull() ? m_read_cb(0) : 0x0f; + const u8 res = m_read_cb(0); m_r.consol = res & consol_read_dir; return m_r.consol; } @@ -906,8 +902,7 @@ void gtia_device::write(offs_t offset, uint8_t data) if (data == m_w.consol) break; m_w.consol = data & 0x0f; - if (!m_write_cb.isnull()) - m_write_cb((offs_t)0, m_w.consol); + m_write_cb(offs_t(0), m_w.consol); break; } } diff --git a/src/mame/atari/pofo_kbd.cpp b/src/mame/atari/pofo_kbd.cpp index 35c5f56c6b7..ad3bff0d117 100644 --- a/src/mame/atari/pofo_kbd.cpp +++ b/src/mame/atari/pofo_kbd.cpp @@ -38,8 +38,6 @@ void pofo_keyboard_device::key_break(u8 row, u8 column) void pofo_keyboard_device::device_start() { - m_int_handler.resolve_safe(); - save_item(NAME(m_data)); } diff --git a/src/mame/atari/stkbd.cpp b/src/mame/atari/stkbd.cpp index 25ece09815b..435fa363581 100644 --- a/src/mame/atari/stkbd.cpp +++ b/src/mame/atari/stkbd.cpp @@ -66,7 +66,6 @@ st_kbd_device::st_kbd_device(const machine_config &mconfig, const char *tag, dev void st_kbd_device::device_start() { m_led.resolve(); - m_rx_cb.resolve(); save_item(NAME(m_keylatch)); save_item(NAME(m_mouse)); diff --git a/src/mame/atari/stvideo.cpp b/src/mame/atari/stvideo.cpp index 71f15d5c94b..9ec22b6ab4d 100644 --- a/src/mame/atari/stvideo.cpp +++ b/src/mame/atari/stvideo.cpp @@ -318,10 +318,6 @@ void st_video_device::device_config_complete() void st_video_device::device_start() { - m_de_cb.resolve(); - m_hsync_cb.resolve(); - m_vsync_cb.resolve(); - m_event_timer = timer_alloc(FUNC(st_video_device::timer_event), this); m_de_timer = timer_alloc(FUNC(st_video_device::de_event ), this); diff --git a/src/mame/atari/tia.cpp b/src/mame/atari/tia.cpp index 4ba53742b73..d38b0e5c6d5 100644 --- a/src/mame/atari/tia.cpp +++ b/src/mame/atari/tia.cpp @@ -353,8 +353,8 @@ tia_video_device::tia_video_device(const machine_config &mconfig, device_type ty : device_t(mconfig, type, tag, owner, clock) , device_video_interface(mconfig, *this) , device_palette_interface(mconfig, *this) - , m_read_input_port_cb(*this) - , m_databus_contents_cb(*this) + , m_read_input_port_cb(*this, TIA_INPUT_PORT_ALWAYS_ON) + , m_databus_contents_cb(*this, 0x3f) , m_vsync_cb(*this) , m_maincpu(*this, "^maincpu") , m_tia(*this, finder_base::DUMMY_TAG) @@ -391,11 +391,6 @@ tia_ntsc_video_device::tia_ntsc_video_device(const machine_config &mconfig, cons void tia_video_device::device_start() { - // resolve callbacks - m_read_input_port_cb.resolve(); - m_databus_contents_cb.resolve(); - m_vsync_cb.resolve(); - init_palette(); int cx = screen().width(); @@ -998,13 +993,9 @@ void tia_video_device::VSYNC_w(uint8_t data) int curr_y = current_y(); if ( curr_y > 5 ) - update_bitmap( - screen().width(), - screen().height()); + update_bitmap(screen().width(), screen().height()); - if ( !m_vsync_cb.isnull() ) { - m_vsync_cb(0, curr_y, 0xFFFF ); - } + m_vsync_cb(0, curr_y, 0xFFFF); prev_y = 0; prev_x = 0; @@ -1774,19 +1765,15 @@ void tia_video_device::GRP1_w(uint8_t data) uint8_t tia_video_device::INPT_r(offs_t offset) { - uint64_t elapsed = m_maincpu->total_cycles() - paddle_start; - uint16_t input = TIA_INPUT_PORT_ALWAYS_ON; - if ( !m_read_input_port_cb.isnull() ) - { - input = m_read_input_port_cb(offset & 3, 0xFFFF); - } + const uint64_t elapsed = m_maincpu->total_cycles() - paddle_start; + const uint16_t input = m_read_input_port_cb(offset & 3, 0xffff); - if ( input == TIA_INPUT_PORT_ALWAYS_ON ) + if (input == TIA_INPUT_PORT_ALWAYS_ON) return 0x80; - if ( input == TIA_INPUT_PORT_ALWAYS_OFF ) + if (input == TIA_INPUT_PORT_ALWAYS_OFF) return 0x00; - uint16_t paddle_cycles = input * 76; + const uint16_t paddle_cycles = input * 76; return elapsed > paddle_cycles ? 0x80 : 0x00; } @@ -1800,7 +1787,7 @@ uint8_t tia_video_device::read(offs_t offset) */ uint8_t data = offset & 0x3f; - if ( !m_databus_contents_cb.isnull() ) + if (!m_databus_contents_cb.isunset()) { data = m_databus_contents_cb(offset) & 0x3f; } @@ -1838,13 +1825,13 @@ uint8_t tia_video_device::read(offs_t offset) return data | INPT_r(3); case 0xC: { - int button = !m_read_input_port_cb.isnull() ? ( m_read_input_port_cb(4,0xFFFF) & 0x80 ) : 0x80; + int button = !m_read_input_port_cb.isunset() ? ( m_read_input_port_cb(4,0xFFFF) & 0x80 ) : 0x80; INPT4 = ( VBLANK & 0x40) ? ( INPT4 & button ) : button; } return data | INPT4; case 0xD: { - int button = !m_read_input_port_cb.isnull() ? ( m_read_input_port_cb(5,0xFFFF) & 0x80 ) : 0x80; + int button = !m_read_input_port_cb.isunset() ? ( m_read_input_port_cb(5,0xFFFF) & 0x80 ) : 0x80; INPT5 = ( VBLANK & 0x40) ? ( INPT5 & button ) : button; } return data | INPT5; diff --git a/src/mame/bandai/wswan_v.cpp b/src/mame/bandai/wswan_v.cpp index 596781d0c73..469f6c74a0e 100644 --- a/src/mame/bandai/wswan_v.cpp +++ b/src/mame/bandai/wswan_v.cpp @@ -111,8 +111,6 @@ void wswan_video_device::device_start() std::fill(std::begin(m_vram), std::end(m_vram), 0); common_save(); - - m_icons_cb.resolve(); } diff --git a/src/mame/barcrest/mpu4_oki_sampled_sound.cpp b/src/mame/barcrest/mpu4_oki_sampled_sound.cpp index 932111a8c9f..353e1000edf 100644 --- a/src/mame/barcrest/mpu4_oki_sampled_sound.cpp +++ b/src/mame/barcrest/mpu4_oki_sampled_sound.cpp @@ -196,7 +196,6 @@ void mpu4_oki_sampled_sound::device_add_mconfig(machine_config &config) void mpu4_oki_sampled_sound::device_start() { - m_cb2_handler.resolve_safe(); save_item(NAME(m_expansion_latch)); save_item(NAME(m_global_volume)); save_item(NAME(m_t1)); diff --git a/src/mame/bfm/bfm_dm01.cpp b/src/mame/bfm/bfm_dm01.cpp index 9e5ff56f2c3..b9a72285253 100644 --- a/src/mame/bfm/bfm_dm01.cpp +++ b/src/mame/bfm/bfm_dm01.cpp @@ -82,7 +82,6 @@ bfm_dm01_device::bfm_dm01_device(const machine_config &mconfig, const char *tag, void bfm_dm01_device::device_start() { m_dotmatrix.resolve(); - m_busy_cb.resolve_safe(); save_item(NAME(m_data_avail)); save_item(NAME(m_control)); diff --git a/src/mame/casio/fp6000_kbd.cpp b/src/mame/casio/fp6000_kbd.cpp index 31825ad01d5..5d3cf970374 100644 --- a/src/mame/casio/fp6000_kbd.cpp +++ b/src/mame/casio/fp6000_kbd.cpp @@ -162,9 +162,6 @@ fp6000_kbd_device::fp6000_kbd_device(const machine_config &mconfig, const char * void fp6000_kbd_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - // register for state saving save_item(NAME(m_status)); save_item(NAME(m_data)); diff --git a/src/mame/citoh/cit101_kbd.cpp b/src/mame/citoh/cit101_kbd.cpp index 3a2fee32b13..59a9198443c 100644 --- a/src/mame/citoh/cit101_kbd.cpp +++ b/src/mame/citoh/cit101_kbd.cpp @@ -86,7 +86,6 @@ cit101e_keyboard_device::cit101e_keyboard_device(const machine_config &mconfig, void cit101_keyboard_device::device_resolve_objects() { - m_txd_callback.resolve_safe(); m_leds.resolve(); } diff --git a/src/mame/citoh/cit220_kbd.cpp b/src/mame/citoh/cit220_kbd.cpp index f1c40f0c9d9..4476a52b351 100644 --- a/src/mame/citoh/cit220_kbd.cpp +++ b/src/mame/citoh/cit220_kbd.cpp @@ -36,11 +36,6 @@ cit220p_keyboard_device::cit220p_keyboard_device(const machine_config &mconfig, { } -void cit220p_keyboard_device::device_resolve_objects() -{ - m_txd_callback.resolve_safe(); -} - void cit220p_keyboard_device::device_start() { } diff --git a/src/mame/citoh/cit220_kbd.h b/src/mame/citoh/cit220_kbd.h index 8b0e90b54ab..046eaaab2bf 100644 --- a/src/mame/citoh/cit220_kbd.h +++ b/src/mame/citoh/cit220_kbd.h @@ -29,8 +29,7 @@ public: void write_rxd(int state); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/mame/dataeast/deco146.cpp b/src/mame/dataeast/deco146.cpp index 6d4368171be..a20baf810d7 100644 --- a/src/mame/dataeast/deco146.cpp +++ b/src/mame/dataeast/deco146.cpp @@ -1305,11 +1305,11 @@ u8 deco_146_base_device::soundlatch_r() return m_soundlatch; } -deco_146_base_device::deco_146_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_port_a_r(*this), - m_port_b_r(*this), - m_port_c_r(*this), +deco_146_base_device::deco_146_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_port_a_r(*this, 0xffff), + m_port_b_r(*this, 0xffff), + m_port_c_r(*this, 0xffff), m_soundlatch_irq_cb(*this) { m_external_addrswap[0] = 0; @@ -1334,12 +1334,6 @@ void deco_146_base_device::device_start() save_pointer(NAME(m_rambank[bank]), 0x80, bank); } - // bind our handler - m_port_a_r.resolve_safe(0xffff); - m_port_b_r.resolve_safe(0xffff); - m_port_c_r.resolve_safe(0xffff); - m_soundlatch_irq_cb.resolve_safe(); - save_item(NAME(m_xor)); save_item(NAME(m_nand)); diff --git a/src/mame/dataeast/deco_irq.cpp b/src/mame/dataeast/deco_irq.cpp index 7ef90cb0750..35e4abc58c8 100644 --- a/src/mame/dataeast/deco_irq.cpp +++ b/src/mame/dataeast/deco_irq.cpp @@ -44,7 +44,7 @@ deco_irq_device::deco_irq_device(const machine_config &mconfig, const char *tag, device_t(mconfig, DECO_IRQ, tag, owner, clock), m_screen(*this, finder_base::DUMMY_TAG), m_scanline_timer(nullptr), - m_lightgun1_cb(*this), m_lightgun2_cb(*this), + m_lightgun1_cb(*this, 0), m_lightgun2_cb(*this, 0), m_lightgun_irq_cb(*this), m_raster1_irq_cb(*this), m_raster2_irq_cb(*this), m_vblank_irq_cb(*this), @@ -65,14 +65,6 @@ void deco_irq_device::device_start() if (!m_screen->started()) throw device_missing_dependencies(); - // resolve callbacks - m_lightgun1_cb.resolve_safe(0); - m_lightgun2_cb.resolve_safe(0); - m_lightgun_irq_cb.resolve_safe(); - m_raster1_irq_cb.resolve_safe(); - m_raster2_irq_cb.resolve_safe(); - m_vblank_irq_cb.resolve_safe(); - // allocate scanline timer and start it m_scanline_timer = timer_alloc(FUNC(deco_irq_device::scanline_callback), this); m_scanline_timer->adjust(m_screen->time_until_pos(0)); diff --git a/src/mame/ddr/kc_keyb.cpp b/src/mame/ddr/kc_keyb.cpp index 2c8190e7d4e..52fd76a5526 100644 --- a/src/mame/ddr/kc_keyb.cpp +++ b/src/mame/ddr/kc_keyb.cpp @@ -455,9 +455,6 @@ kc_keyboard_device::~kc_keyboard_device() void kc_keyboard_device::device_start() { - // resolve callbacks - m_write_out.resolve_safe(); - m_timer_transmit_pulse = timer_alloc(FUNC(kc_keyboard_device::transmit_pulse), this); m_timer_transmit_pulse->adjust(attotime::from_usec(1024), 0, attotime::from_usec(1024)); } diff --git a/src/mame/dec/dc305.cpp b/src/mame/dec/dc305.cpp index d98480fb7ea..090c80a75b6 100644 --- a/src/mame/dec/dc305.cpp +++ b/src/mame/dec/dc305.cpp @@ -38,20 +38,6 @@ dc305_device::dc305_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 dc305_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); - m_rxc_callback.resolve_safe(); - m_txc_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/dec/dc305.h b/src/mame/dec/dc305.h index 9721a66176a..8d0ac4bade4 100644 --- a/src/mame/dec/dc305.h +++ b/src/mame/dec/dc305.h @@ -57,8 +57,7 @@ public: u8 inta(); 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/mame/dec/dec_lk201.cpp b/src/mame/dec/dec_lk201.cpp index 1e1a87a3011..1dfb9a493aa 100644 --- a/src/mame/dec/dec_lk201.cpp +++ b/src/mame/dec/dec_lk201.cpp @@ -524,7 +524,6 @@ lk201_device::lk201_device(const machine_config &mconfig, const char *tag, devic void lk201_device::device_start() { m_count = timer_alloc(FUNC(lk201_device::timer_irq), this); - m_tx_handler.resolve_safe(); m_beeper = timer_alloc(FUNC(lk201_device::beeper_off), this); diff --git a/src/mame/dec/decioga.cpp b/src/mame/dec/decioga.cpp index 1f8b915dac1..622026ac7c7 100644 --- a/src/mame/dec/decioga.cpp +++ b/src/mame/dec/decioga.cpp @@ -35,8 +35,6 @@ dec_ioga_device::dec_ioga_device(const machine_config &mconfig, const char *tag, void dec_ioga_device::device_start() { - m_irq_out_cb.resolve_safe(); - save_item(NAME(m_csr)); save_item(NAME(m_intr)); save_item(NAME(m_imsk)); diff --git a/src/mame/dec/pdp1.cpp b/src/mame/dec/pdp1.cpp index d1ce702f299..13aa77566e9 100644 --- a/src/mame/dec/pdp1.cpp +++ b/src/mame/dec/pdp1.cpp @@ -619,11 +619,6 @@ pdp1_readtape_image_device::pdp1_readtape_image_device(const machine_config &mco { } -void pdp1_readtape_image_device::device_resolve_objects() -{ - m_st_ptr.resolve_safe(); -} - void pdp1_readtape_image_device::device_start() { m_timer = timer_alloc(FUNC(pdp1_readtape_image_device::reader_callback), this); @@ -642,11 +637,6 @@ pdp1_punchtape_image_device::pdp1_punchtape_image_device(const machine_config &m { } -void pdp1_punchtape_image_device::device_resolve_objects() -{ - m_st_ptp.resolve_safe(); -} - void pdp1_punchtape_image_device::device_start() { m_timer = timer_alloc(FUNC(pdp1_punchtape_image_device::puncher_callback), this); @@ -667,12 +657,6 @@ pdp1_typewriter_device::pdp1_typewriter_device(const machine_config &mconfig, co { } -void pdp1_typewriter_device::device_resolve_objects() -{ - m_st_tyo.resolve_safe(); - m_st_tyi.resolve_safe(); -} - void pdp1_typewriter_device::device_start() { m_tyo_timer = timer_alloc(FUNC(pdp1_typewriter_device::tyo_callback), this); diff --git a/src/mame/dec/pdp1.h b/src/mame/dec/pdp1.h index 9be010751ea..f5ef61ef59e 100644 --- a/src/mame/dec/pdp1.h +++ b/src/mame/dec/pdp1.h @@ -189,7 +189,6 @@ public: protected: // device_t implementation - virtual void device_resolve_objects() override; virtual void device_start() override; // device_image_interface implementation @@ -235,7 +234,6 @@ public: protected: // device_t implementation - virtual void device_resolve_objects() override; virtual void device_start() override; // device_image_interface implementation @@ -278,7 +276,6 @@ public: protected: // device_t implementation - virtual void device_resolve_objects() override; virtual void device_start() override; // device_image_interface implementation diff --git a/src/mame/dec/vtvideo.cpp b/src/mame/dec/vtvideo.cpp index 5b567c7f23e..965e4ff15ce 100644 --- a/src/mame/dec/vtvideo.cpp +++ b/src/mame/dec/vtvideo.cpp @@ -76,7 +76,7 @@ DEFINE_DEVICE_TYPE(RAINBOW_VIDEO, rainbow_video_device, "rainbow_video", "Rainbo vt100_video_device::vt100_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) , device_video_interface(mconfig, *this) - , m_read_ram(*this) + , m_read_ram(*this, 0) , m_write_vert_freq_intr(*this) , m_write_lba3_lba4(*this) , m_write_lba7(*this) @@ -104,12 +104,6 @@ rainbow_video_device::rainbow_video_device(const machine_config &mconfig, const void vt100_video_device::device_start() { - /* resolve callbacks */ - m_read_ram.resolve_safe(0); - m_write_vert_freq_intr.resolve_safe(); - m_write_lba3_lba4.resolve(); - m_write_lba7.resolve_safe(); - // LBA7 is scan line frequency update m_lba7_change_timer = timer_alloc(FUNC(vt100_video_device::lba7_change), this); m_lba7_change_timer->adjust(clocks_to_attotime(765), 0, clocks_to_attotime(765)); @@ -874,7 +868,7 @@ TIMER_CALLBACK_MEMBER(vt100_video_device::lba7_change) m_lba7 = (m_lba7) ? 0 : 1; m_write_lba7(m_lba7); - if (!m_write_lba3_lba4.isnull()) + if (!m_write_lba3_lba4.isunset()) { // The first of every eight low periods of LBA 3 is twice as long m_write_lba3_lba4(2); diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index d08a4b2c8ba..8e65f74b36f 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -215,11 +215,6 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(mjflove_blitter_r); protected: - virtual void device_resolve_objects() override - { - m_blitter_irq_handler.resolve_safe(); - } - auto blitter_irq() { return m_blitter_irq_handler.bind(); } DECLARE_MACHINE_START(ddenlovr); diff --git a/src/mame/dynax/dynax_blitter_rev2.cpp b/src/mame/dynax/dynax_blitter_rev2.cpp index 237a06876d9..79da380a3e8 100644 --- a/src/mame/dynax/dynax_blitter_rev2.cpp +++ b/src/mame/dynax/dynax_blitter_rev2.cpp @@ -71,21 +71,6 @@ dynax_blitter_rev2_device::dynax_blitter_rev2_device(const machine_config &mconf //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void dynax_blitter_rev2_device::device_resolve_objects() -{ - m_vram_out_cb.resolve_safe(); - m_scrollx_cb.resolve_safe(); - m_scrolly_cb.resolve_safe(); - m_ready_cb.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -333,17 +318,6 @@ cdracula_blitter_device::cdracula_blitter_device(const machine_config &mconfig, //------------------------------------------------- -// device_resolve_objects - -//------------------------------------------------- - -void cdracula_blitter_device::device_resolve_objects() -{ - dynax_blitter_rev2_device::device_resolve_objects(); - m_blit_dest_cb.resolve_safe(); -} - - -//------------------------------------------------- // flags_w - separate flags/start register for // bootleg blitter //------------------------------------------------- diff --git a/src/mame/dynax/dynax_blitter_rev2.h b/src/mame/dynax/dynax_blitter_rev2.h index 003da125fe5..125d180c9fe 100644 --- a/src/mame/dynax/dynax_blitter_rev2.h +++ b/src/mame/dynax/dynax_blitter_rev2.h @@ -41,8 +41,7 @@ protected: // delegated construction dynax_blitter_rev2_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; // internal helpers @@ -81,9 +80,6 @@ public: virtual void regs_w(offs_t offset, uint8_t data) override; private: - // device-level overrides - virtual void device_resolve_objects() override; - // device callbacks devcb_write8 m_blit_dest_cb; }; diff --git a/src/mame/ensoniq/esqpanel.cpp b/src/mame/ensoniq/esqpanel.cpp index 807520cf57f..1343ab289d1 100644 --- a/src/mame/ensoniq/esqpanel.cpp +++ b/src/mame/ensoniq/esqpanel.cpp @@ -427,9 +427,6 @@ esqpanel_device::esqpanel_device(const machine_config &mconfig, device_type type void esqpanel_device::device_start() { - m_write_tx.resolve_safe(); - m_write_analog.resolve_safe(); - m_external_panel_server = new esqpanel::external_panel_server(machine().manager().http()); if (machine().manager().http()->is_active()) { m_external_panel_server->set_keyboard(owner()->shortname()); diff --git a/src/mame/enterprise/nick.cpp b/src/mame/enterprise/nick.cpp index 905d6195ade..fa17197b853 100644 --- a/src/mame/enterprise/nick.cpp +++ b/src/mame/enterprise/nick.cpp @@ -136,9 +136,6 @@ void nick_device::device_start() // initialize palette initialize_palette(); - // resolve callbacks - m_write_virq.resolve_safe(); - // allocate timers m_timer_scanline = timer_alloc(FUNC(nick_device::scanline_tick), this); m_timer_scanline->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period()); diff --git a/src/mame/ericsson/eispc_kb.cpp b/src/mame/ericsson/eispc_kb.cpp index b86092de8bd..5a19b163e57 100644 --- a/src/mame/ericsson/eispc_kb.cpp +++ b/src/mame/ericsson/eispc_kb.cpp @@ -292,11 +292,6 @@ void eispc_keyboard_device::rst_line_w(int state) void eispc_keyboard_device::device_start() { - m_txd_cb.resolve_safe(); - m_led_caps_cb.resolve_safe(); - m_led_num_cb.resolve_safe(); - m_led_scroll_cb.resolve_safe(); - save_item(NAME(m_rxd_high)); save_item(NAME(m_txd_high)); save_item(NAME(m_col_select)); diff --git a/src/mame/exidy/micropolis.cpp b/src/mame/exidy/micropolis.cpp index ec57ac39a1f..e1db2ab45ba 100644 --- a/src/mame/exidy/micropolis.cpp +++ b/src/mame/exidy/micropolis.cpp @@ -65,9 +65,9 @@ static const uint8_t track_SD[][2] = { DEFINE_DEVICE_TYPE(MICROPOLIS, micropolis_device, "micropolis", "Micropolis FDC") -micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, MICROPOLIS, tag, owner, clock), - m_read_dden(*this), +micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, MICROPOLIS, tag, owner, clock), + m_read_dden(*this, 1), m_write_intrq(*this), m_write_drq(*this), m_floppy_drive(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG}), @@ -92,10 +92,6 @@ micropolis_device::micropolis_device(const machine_config &mconfig, const char * void micropolis_device::device_start() { - m_read_dden.resolve_safe(1); - m_write_intrq.resolve_safe(); - m_write_drq.resolve_safe(); - save_item(NAME(m_data)); save_item(NAME(m_drive_num)); save_item(NAME(m_track)); diff --git a/src/mame/facit/f4431_kbd.cpp b/src/mame/facit/f4431_kbd.cpp index e691ae2d1f6..7917794e620 100644 --- a/src/mame/facit/f4431_kbd.cpp +++ b/src/mame/facit/f4431_kbd.cpp @@ -255,9 +255,6 @@ f4431_kbd_device::f4431_kbd_device(const machine_config &mconfig, const char *ta void f4431_kbd_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); - // resolve artwork callback m_leds.resolve(); diff --git a/src/mame/fairlight/cmi01a.cpp b/src/mame/fairlight/cmi01a.cpp index 767cf71b94f..439cfa3eac9 100644 --- a/src/mame/fairlight/cmi01a.cpp +++ b/src/mame/fairlight/cmi01a.cpp @@ -181,11 +181,6 @@ void cmi01a_device::device_reset() m_sample_timer->adjust(attotime::never); } -void cmi01a_device::device_resolve_objects() -{ - m_irq_cb.resolve_safe(); -} - void cmi01a_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { if (m_run) diff --git a/src/mame/fairlight/cmi01a.h b/src/mame/fairlight/cmi01a.h index e24518a080b..25f2b742352 100644 --- a/src/mame/fairlight/cmi01a.h +++ b/src/mame/fairlight/cmi01a.h @@ -33,7 +33,6 @@ public: void set_master_osc(double mosc) { m_mosc = mosc; } protected: - 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; diff --git a/src/mame/fairlight/cmi_ankbd.cpp b/src/mame/fairlight/cmi_ankbd.cpp index de7bedb6a43..90b29daface 100644 --- a/src/mame/fairlight/cmi_ankbd.cpp +++ b/src/mame/fairlight/cmi_ankbd.cpp @@ -29,12 +29,6 @@ cmi_alphanumeric_keyboard_device::cmi_alphanumeric_keyboard_device(const machine { } -void cmi_alphanumeric_keyboard_device::device_resolve_objects() -{ - m_txd_handler.resolve_safe(); - m_rts_handler.resolve_safe(); -} - void cmi_alphanumeric_keyboard_device::device_start() { } diff --git a/src/mame/fairlight/cmi_ankbd.h b/src/mame/fairlight/cmi_ankbd.h index 19cf5c58eb2..b3d9e78ce35 100644 --- a/src/mame/fairlight/cmi_ankbd.h +++ b/src/mame/fairlight/cmi_ankbd.h @@ -28,7 +28,6 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/mame/fairlight/cmi_mkbd.cpp b/src/mame/fairlight/cmi_mkbd.cpp index bf6327a38c9..779fc9274bb 100644 --- a/src/mame/fairlight/cmi_mkbd.cpp +++ b/src/mame/fairlight/cmi_mkbd.cpp @@ -67,10 +67,6 @@ cmi_music_keyboard_device::cmi_music_keyboard_device(const machine_config &mconf void cmi_music_keyboard_device::device_resolve_objects() { - m_cmi_txd.resolve_safe(); - m_cmi_rts.resolve_safe(); - m_kbd_txd.resolve_safe(); - m_kbd_rts.resolve_safe(); m_digit.resolve(); } diff --git a/src/mame/falco/f5220_kbd.cpp b/src/mame/falco/f5220_kbd.cpp index df6f81ea62b..f906cb6be41 100644 --- a/src/mame/falco/f5220_kbd.cpp +++ b/src/mame/falco/f5220_kbd.cpp @@ -199,9 +199,6 @@ f5220_kbd_device::f5220_kbd_device(const machine_config &mconfig, const char *ta void f5220_kbd_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - // timer for initial keyboard data m_reset_timer = timer_alloc(FUNC(f5220_kbd_device::reset_done), this); m_reset_timer->adjust(attotime::from_msec(1000)); diff --git a/src/mame/funtech/acan.cpp b/src/mame/funtech/acan.cpp index 9afd46a1292..589f93972d5 100644 --- a/src/mame/funtech/acan.cpp +++ b/src/mame/funtech/acan.cpp @@ -24,7 +24,7 @@ acan_sound_device::acan_sound_device(const machine_config &mconfig, const char * , m_timer(nullptr) , m_timer_irq_handler(*this) , m_dma_irq_handler(*this) - , m_ram_read(*this) + , m_ram_read(*this, 0) , m_active_channels(0) , m_dma_channels(0) { @@ -37,10 +37,6 @@ void acan_sound_device::device_start() m_mix = std::make_unique<int32_t[]>((clock() / 16 / 5) * 2); m_timer = timer_alloc(FUNC(acan_sound_device::channel_irq), this); - m_timer_irq_handler.resolve_safe(); - m_dma_irq_handler.resolve_safe(); - m_ram_read.resolve_safe(0); - // register for savestates save_item(NAME(m_active_channels)); save_item(NAME(m_dma_channels)); diff --git a/src/mame/gaelco/gaelco3d_m.cpp b/src/mame/gaelco/gaelco3d_m.cpp index 2beb3df53c8..073489f32a4 100644 --- a/src/mame/gaelco/gaelco3d_m.cpp +++ b/src/mame/gaelco/gaelco3d_m.cpp @@ -206,7 +206,6 @@ void gaelco_serial_device::device_start() /* validate arguments */ assert(strlen(tag()) < 20); - m_irq_handler.resolve_safe(); m_sync_timer = timer_alloc(FUNC(gaelco_serial_device::link_cb), this); m_status_set_timer = timer_alloc(FUNC(gaelco_serial_device::set_status_cb), this); diff --git a/src/mame/hds/hds200_kbd.cpp b/src/mame/hds/hds200_kbd.cpp index 2e9116d472a..b06757526d8 100644 --- a/src/mame/hds/hds200_kbd.cpp +++ b/src/mame/hds/hds200_kbd.cpp @@ -273,8 +273,6 @@ hds200_kbd_hle_device::hds200_kbd_hle_device(const machine_config &mconfig, cons void hds200_kbd_hle_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/mame/heathkit/intr_cntrl.cpp b/src/mame/heathkit/intr_cntrl.cpp index 30a694c05cb..eaedd17de58 100644 --- a/src/mame/heathkit/intr_cntrl.cpp +++ b/src/mame/heathkit/intr_cntrl.cpp @@ -31,11 +31,6 @@ void heath_intr_cntrl::device_start() m_intr_lines = 0; } -void heath_intr_cntrl::device_resolve_objects() -{ - m_irq_line.resolve_safe(); -} - void heath_intr_cntrl::update_intr_line() { diff --git a/src/mame/heathkit/intr_cntrl.h b/src/mame/heathkit/intr_cntrl.h index d6da5c0b6d9..8ce609a999d 100644 --- a/src/mame/heathkit/intr_cntrl.h +++ b/src/mame/heathkit/intr_cntrl.h @@ -36,7 +36,6 @@ protected: virtual void update_intr_line(); virtual void device_start() override; - virtual void device_resolve_objects() override; devcb_write8 m_irq_line; diff --git a/src/mame/heathkit/tlb.cpp b/src/mame/heathkit/tlb.cpp index 38a67c01353..5f4b601e3d7 100644 --- a/src/mame/heathkit/tlb.cpp +++ b/src/mame/heathkit/tlb.cpp @@ -151,11 +151,6 @@ static constexpr uint8_t KB_STATUS_ONLINE_KEY_MASK = 0x08; static constexpr uint8_t KB_STATUS_REPEAT_KEYS_MASK = 0x40; static constexpr uint8_t KB_STATUS_KEYBOARD_STROBE_MASK = 0x80; -void heath_tlb_device::device_resolve_objects() -{ - - m_write_sd.resolve_safe(); -} void heath_tlb_device::device_start() { diff --git a/src/mame/heathkit/tlb.h b/src/mame/heathkit/tlb.h index 7ebe322b3b9..e946dbf59d4 100644 --- a/src/mame/heathkit/tlb.h +++ b/src/mame/heathkit/tlb.h @@ -37,7 +37,6 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; void mem_map(address_map &map); void io_map(address_map &map); diff --git a/src/mame/heathkit/z37_fdc.cpp b/src/mame/heathkit/z37_fdc.cpp index 5fccdc2d751..c8b5f2a8e3e 100644 --- a/src/mame/heathkit/z37_fdc.cpp +++ b/src/mame/heathkit/z37_fdc.cpp @@ -198,13 +198,6 @@ void heath_z37_fdc_device::device_add_mconfig(machine_config &config) m_floppies[3]->enable_sound(true); } -void heath_z37_fdc_device::device_resolve_objects() -{ - m_fd_irq_cb.resolve_safe(); - m_drq_cb.resolve_safe(); - m_block_interrupt_cb.resolve_safe(); -} - void heath_z37_fdc_device::set_irq(uint8_t data) { m_fd_irq_cb(m_intrq_allowed ? data : CLEAR_LINE); diff --git a/src/mame/heathkit/z37_fdc.h b/src/mame/heathkit/z37_fdc.h index dcd6a154938..ee8d8f30f31 100644 --- a/src/mame/heathkit/z37_fdc.h +++ b/src/mame/heathkit/z37_fdc.h @@ -29,7 +29,6 @@ public: protected : virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; void ctrl_w(uint8_t val); uint8_t ctrl_r(); diff --git a/src/mame/hegenerglaser/mmdisplay1.cpp b/src/mame/hegenerglaser/mmdisplay1.cpp index 177fb682cca..acc12dea65a 100644 --- a/src/mame/hegenerglaser/mmdisplay1.cpp +++ b/src/mame/hegenerglaser/mmdisplay1.cpp @@ -31,8 +31,7 @@ mephisto_display1_device::mephisto_display1_device(const machine_config &mconfig void mephisto_display1_device::device_start() { - m_output_digit.resolve(); - if (m_output_digit.isnull()) + if (m_output_digit.isunset()) m_digits.resolve(); // register for savestates @@ -66,7 +65,7 @@ void mephisto_display1_device::update_lcd() { for (int i = 0; i < 4; i++) { - if (m_output_digit.isnull()) + if (m_output_digit.isunset()) m_digits[i] = m_digit_data[i]; else m_output_digit(i, m_digit_data[i]); diff --git a/src/mame/hp/hp2640_tape.cpp b/src/mame/hp/hp2640_tape.cpp index a9a7630c4fe..239c3322382 100644 --- a/src/mame/hp/hp2640_tape.cpp +++ b/src/mame/hp/hp2640_tape.cpp @@ -249,10 +249,6 @@ void hp2640_tape_device::device_add_mconfig(machine_config &config) void hp2640_tape_device::device_start() { - m_irq_handler.resolve_safe(); - m_led0_handler.resolve_safe(); - m_led1_handler.resolve_safe(); - m_gap_timer = timer_alloc(FUNC(hp2640_tape_device::gap_timer_tick), this); m_cell_timer = timer_alloc(FUNC(hp2640_tape_device::cell_timer_tick), this); diff --git a/src/mame/hp/hp9825_tape.cpp b/src/mame/hp/hp9825_tape.cpp index 4d5bc458789..07c03b88f55 100644 --- a/src/mame/hp/hp9825_tape.cpp +++ b/src/mame/hp/hp9825_tape.cpp @@ -122,11 +122,6 @@ void hp9825_tape_device::device_add_mconfig(machine_config &config) void hp9825_tape_device::device_start() { LOG_DBG("start\n"); - m_flg_handler.resolve_safe(); - m_sts_handler.resolve_safe(); - m_dmar_handler.resolve_safe(); - m_led_handler.resolve_safe(); - m_cart_in_handler.resolve_safe(); save_item(NAME(m_cmd_reg)); save_item(NAME(m_stat_reg)); diff --git a/src/mame/hp/hp9845_printer.cpp b/src/mame/hp/hp9845_printer.cpp index 27cafb9df07..902b2206c84 100644 --- a/src/mame/hp/hp9845_printer.cpp +++ b/src/mame/hp/hp9845_printer.cpp @@ -145,10 +145,6 @@ void hp9845_printer_device::device_add_mconfig(machine_config &config) void hp9845_printer_device::device_start() { - m_irl_handler.resolve_safe(); - m_flg_handler.resolve_safe(); - m_sts_handler.resolve_safe(); - save_item(NAME(m_display_mode)); save_item(NAME(m_shifted)); save_item(NAME(m_current_u_l)); diff --git a/src/mame/hp/hp98x5_io_sys.cpp b/src/mame/hp/hp98x5_io_sys.cpp index f403117f172..df377d3515c 100644 --- a/src/mame/hp/hp98x5_io_sys.cpp +++ b/src/mame/hp/hp98x5_io_sys.cpp @@ -45,12 +45,6 @@ hp98x5_io_sys_device::hp98x5_io_sys_device(const machine_config &mconfig, const void hp98x5_io_sys_device::device_start() { - m_irl_handler.resolve_safe(); - m_irh_handler.resolve_safe(); - m_flg_handler.resolve_safe(); - m_sts_handler.resolve_safe(); - m_dmar_handler.resolve_safe(); - save_item(NAME(m_irq_pending)); save_item(NAME(m_pa)); save_item(NAME(m_flg_status)); diff --git a/src/mame/ibm/ibm6580_fdc.cpp b/src/mame/ibm/ibm6580_fdc.cpp index ebbf61cd7dc..c3e5d7af22d 100644 --- a/src/mame/ibm/ibm6580_fdc.cpp +++ b/src/mame/ibm/ibm6580_fdc.cpp @@ -57,9 +57,6 @@ dw_fdc_device::dw_fdc_device(const machine_config &mconfig, const char *tag, dev void dw_fdc_device::device_start() { - m_out_data.resolve_safe(); - m_out_clock.resolve_safe(); - m_out_strobe.resolve_safe(); m_reset_timer = timer_alloc(FUNC(dw_fdc_device::assert_reset_line), this); } diff --git a/src/mame/ibm/ibm6580_kbd.cpp b/src/mame/ibm/ibm6580_kbd.cpp index 734712838f9..08283683b7f 100644 --- a/src/mame/ibm/ibm6580_kbd.cpp +++ b/src/mame/ibm/ibm6580_kbd.cpp @@ -192,9 +192,6 @@ dw_keyboard_device::dw_keyboard_device(const machine_config &mconfig, const char void dw_keyboard_device::device_start() { - m_out_data.resolve_safe(); - m_out_clock.resolve_safe(); - m_out_strobe.resolve_safe(); } void dw_keyboard_device::device_reset() diff --git a/src/mame/ibm/rosetta.cpp b/src/mame/ibm/rosetta.cpp index 082eff00335..cc624d61e48 100644 --- a/src/mame/ibm/rosetta.cpp +++ b/src/mame/ibm/rosetta.cpp @@ -202,8 +202,6 @@ void rosetta_device::device_validity_check(validity_checker &valid) const void rosetta_device::device_start() { - m_out_pchk.resolve_safe(); - m_out_mchk.resolve_safe(); m_leds.resolve(); save_item(NAME(m_segment)); diff --git a/src/mame/ibm/rtpc_iocc.cpp b/src/mame/ibm/rtpc_iocc.cpp index 3355f7f4574..864aab0ab56 100644 --- a/src/mame/ibm/rtpc_iocc.cpp +++ b/src/mame/ibm/rtpc_iocc.cpp @@ -52,9 +52,6 @@ device_memory_interface::space_config_vector rtpc_iocc_device::memory_space_conf void rtpc_iocc_device::device_start() { - m_out_int.resolve_safe(); - m_out_rst.resolve_safe(); - save_item(NAME(m_csr)); save_item(NAME(m_ccr)); save_item(NAME(m_dbr)); diff --git a/src/mame/informer/informer_207_376_kbd.cpp b/src/mame/informer/informer_207_376_kbd.cpp index 4dacd14577f..c67ea13250b 100644 --- a/src/mame/informer/informer_207_376_kbd.cpp +++ b/src/mame/informer/informer_207_376_kbd.cpp @@ -201,8 +201,6 @@ informer_207_376_kbd_hle_device::informer_207_376_kbd_hle_device(const machine_c void informer_207_376_kbd_hle_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/mame/informer/informer_213_kbd.cpp b/src/mame/informer/informer_213_kbd.cpp index 30373f5152f..40a5a6b65ca 100644 --- a/src/mame/informer/informer_213_kbd.cpp +++ b/src/mame/informer/informer_213_kbd.cpp @@ -206,8 +206,6 @@ informer_213_kbd_hle_device::informer_213_kbd_hle_device(const machine_config &m void informer_213_kbd_hle_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); } //------------------------------------------------- diff --git a/src/mame/intel/imds2ioc.cpp b/src/mame/intel/imds2ioc.cpp index 81e06e82ddf..44d6f2acedb 100644 --- a/src/mame/intel/imds2ioc.cpp +++ b/src/mame/intel/imds2ioc.cpp @@ -392,12 +392,6 @@ void imds2ioc_device::pio_master_w(offs_t offset, uint8_t data) m_iocpio->upi41_master_w(offset, data); } -void imds2ioc_device::device_resolve_objects() -{ - m_master_intr_cb.resolve_safe(); - m_parallel_int_cb.resolve_safe(); -} - void imds2ioc_device::device_start() { m_iocfdc->set_ready_line_connected(true); diff --git a/src/mame/intel/imds2ioc.h b/src/mame/intel/imds2ioc.h index 1ee4e5541a2..b47484a0775 100644 --- a/src/mame/intel/imds2ioc.h +++ b/src/mame/intel/imds2ioc.h @@ -34,7 +34,6 @@ protected: virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/intel/isbc_208.cpp b/src/mame/intel/isbc_208.cpp index 6c02860a5b4..69444a6bc2d 100644 --- a/src/mame/intel/isbc_208.cpp +++ b/src/mame/intel/isbc_208.cpp @@ -121,6 +121,5 @@ void isbc_208_device::device_reset() void isbc_208_device::device_start() { m_maincpu_mem = &m_maincpu->space(AS_PROGRAM); - m_out_irq_func.resolve_safe(); } diff --git a/src/mame/intergraph/interpro_ioga.cpp b/src/mame/intergraph/interpro_ioga.cpp index c7681ac7c00..569c84615ac 100644 --- a/src/mame/intergraph/interpro_ioga.cpp +++ b/src/mame/intergraph/interpro_ioga.cpp @@ -141,13 +141,13 @@ interpro_ioga_device::interpro_ioga_device(const machine_config &mconfig, device , m_force_state(0) , m_softint(0) , m_dma_channel{ - { 0,0,0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_PLOT, DMA_PLOTTER, "plotter" }, - { 0,0,0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_SCSI, DMA_SCSI, "scsi" }, - { 0,0,0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_FDC, DMA_FLOPPY, "floppy" } } + { 0,0,0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_PLOT, DMA_PLOTTER, "plotter" }, + { 0,0,0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_SCSI, DMA_SCSI, "scsi" }, + { 0,0,0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_FDC, DMA_FLOPPY, "floppy" } } , m_serial_dma_channel{ - { 0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_SER0, 0, "serial0" }, - { 0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_SER1, 1, "serial1" }, - { 0,0,CLEAR_LINE, {*this}, {*this}, ARBCTL_BGR_SER2, 2, "serial2" } } + { 0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_SER0, 0, "serial0" }, + { 0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_SER1, 1, "serial1" }, + { 0,0,CLEAR_LINE, {*this, 0}, {*this}, ARBCTL_BGR_SER2, 2, "serial2" } } { } @@ -171,27 +171,8 @@ void interpro_ioga_device::device_start() { m_memory_space->cache(m_memory); - // resolve callbacks - m_out_nmi_func.resolve(); - m_out_irq_func.resolve(); - m_out_irq_vector_func.resolve(); - m_fdc_tc_func.resolve(); - m_eth_ca_func.resolve(); - m_hwicr = std::make_unique<u16[]>(get_int_count()); - for (dma_channel_t &dma_channel : m_dma_channel) - { - dma_channel.device_r.resolve(); - dma_channel.device_w.resolve(); - } - - for (serial_dma_channel_t &dma_channel : m_serial_dma_channel) - { - dma_channel.device_r.resolve(); - dma_channel.device_w.resolve(); - } - // allocate timers m_interrupt_timer = timer_alloc(FUNC(interpro_ioga_device::interrupt_check), this); m_dma_timer = timer_alloc(FUNC(interpro_ioga_device::dma), this); diff --git a/src/mame/intergraph/interpro_ioga.h b/src/mame/intergraph/interpro_ioga.h index 0489577a9ad..2f90d7dfe19 100644 --- a/src/mame/intergraph/interpro_ioga.h +++ b/src/mame/intergraph/interpro_ioga.h @@ -238,7 +238,7 @@ public: void mouse_status_w(offs_t offset, u32 data, u32 mem_mask = ~0); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/intergraph/interpro_sga.cpp b/src/mame/intergraph/interpro_sga.cpp index 6c7eb8f21d7..75b16423806 100644 --- a/src/mame/intergraph/interpro_sga.cpp +++ b/src/mame/intergraph/interpro_sga.cpp @@ -77,8 +77,6 @@ interpro_sga_device::interpro_sga_device(const machine_config &mconfig, const ch void interpro_sga_device::device_start() { - m_berr_func.resolve(); - save_item(NAME(m_gcsr)); save_item(NAME(m_ipoll)); save_item(NAME(m_imask)); diff --git a/src/mame/itech/iteagle_fpga.cpp b/src/mame/itech/iteagle_fpga.cpp index 999d93a7dac..6b7e001bd9c 100644 --- a/src/mame/itech/iteagle_fpga.cpp +++ b/src/mame/itech/iteagle_fpga.cpp @@ -49,11 +49,11 @@ iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const ch m_scc1(*this, AM85C30_TAG), m_screen(*this, finder_base::DUMMY_TAG), m_cpu(*this, finder_base::DUMMY_TAG), - m_in_cb(*this), - m_trackx_cb(*this), - m_tracky_cb(*this), - m_gunx_cb(*this), - m_guny_cb(*this), + m_in_cb(*this, 0xffff), + m_trackx_cb(*this, 0xff), + m_tracky_cb(*this, 0xff), + m_gunx_cb(*this, 0xffff), + m_guny_cb(*this, 0xffff), m_version(0), m_seq_init(0) { @@ -124,15 +124,6 @@ void iteagle_fpga_device::device_start() m_timer = timer_alloc(FUNC(iteagle_fpga_device::assert_vblank_irq), this); - // Switch IO - m_in_cb.resolve_all_safe(0xffff); - // Track IO - m_trackx_cb.resolve_safe(0xff); - m_tracky_cb.resolve_safe(0xff); - // Gun IO - m_gunx_cb.resolve_safe(0xffff); - m_guny_cb.resolve_safe(0xffff); - // Save states save_item(NAME(m_fpga_regs)); save_item(NAME(m_rtc_regs)); diff --git a/src/mame/jaleco/jaleco_ms32_sysctrl.cpp b/src/mame/jaleco/jaleco_ms32_sysctrl.cpp index 1ef2c744750..dd24e56a066 100644 --- a/src/mame/jaleco/jaleco_ms32_sysctrl.cpp +++ b/src/mame/jaleco/jaleco_ms32_sysctrl.cpp @@ -109,16 +109,6 @@ void jaleco_ms32_sysctrl_device::device_add_mconfig(machine_config &config) // device_start - device-specific startup //------------------------------------------------- -void jaleco_ms32_sysctrl_device::device_resolve_objects() -{ - m_flip_screen_cb.resolve(); - m_vblank_cb.resolve(); - m_field_cb.resolve(); - m_prg_timer_cb.resolve(); - m_sound_reset_cb.resolve(); - m_sound_ack_cb.resolve(); -} - void jaleco_ms32_sysctrl_device::device_start() { save_item(NAME(m_dotclock_setting)); diff --git a/src/mame/jaleco/jaleco_ms32_sysctrl.h b/src/mame/jaleco/jaleco_ms32_sysctrl.h index 8a203bd82f8..14be7a846e5 100644 --- a/src/mame/jaleco/jaleco_ms32_sysctrl.h +++ b/src/mame/jaleco/jaleco_ms32_sysctrl.h @@ -47,7 +47,6 @@ public: protected: // device-level overrides //virtual void device_validity_check(validity_checker &valid) const override; - virtual void device_resolve_objects() override; virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/jpm/jpmimpct.cpp b/src/mame/jpm/jpmimpct.cpp index 9b00f3a43b2..dfe0ff667c3 100644 --- a/src/mame/jpm/jpmimpct.cpp +++ b/src/mame/jpm/jpmimpct.cpp @@ -124,8 +124,6 @@ jpmtouch_device::jpmtouch_device(const machine_config &mconfig, device_type type void jpmtouch_device::device_start() { - m_rxd_handler.resolve_safe(); - save_item(NAME(m_touch_data)); save_item(NAME(m_sendpos)); save_item(NAME(m_sending)); diff --git a/src/mame/kaypro/kay_kbd.cpp b/src/mame/kaypro/kay_kbd.cpp index 15a0281857b..653827af3be 100644 --- a/src/mame/kaypro/kay_kbd.cpp +++ b/src/mame/kaypro/kay_kbd.cpp @@ -370,7 +370,6 @@ ioport_constructor kaypro_10_keyboard_device::device_input_ports() const void kaypro_10_keyboard_device::device_start() { - m_rxd_cb.resolve_safe(); m_led_caps_lock.resolve(); save_item(NAME(m_txd)); diff --git a/src/mame/konami/3dom2.cpp b/src/mame/konami/3dom2.cpp index 22d6162b4c5..02987cecfee 100644 --- a/src/mame/konami/3dom2.cpp +++ b/src/mame/konami/3dom2.cpp @@ -214,7 +214,7 @@ m2_bda_device::m2_bda_device(const machine_config &mconfig, const char *tag, dev m_cpu1(*this, finder_base::DUMMY_TAG), m_cpu2(*this, finder_base::DUMMY_TAG), m_cde(*this, finder_base::DUMMY_TAG), - m_videores_in(*this), + m_videores_in(*this, 0), m_memctl(*this, "memctl"), m_powerbus(*this, "powerbus"), m_vdu(*this, "vdu"), @@ -234,11 +234,6 @@ m2_bda_device::m2_bda_device(const machine_config &mconfig, const char *tag, dev void m2_bda_device::device_start() { - // Resolve callbacks - m_videores_in.resolve_safe(0); - m_dac_l.resolve_safe(); - m_dac_r.resolve_safe(); - // Allocate RAM uint32_t ram_size = (m_rambank_size[0] + m_rambank_size[1]) * 1024 * 1024; m_ram = std::make_unique<uint32_t[]>(ram_size / sizeof(uint32_t)); @@ -500,9 +495,6 @@ m2_powerbus_device::m2_powerbus_device(const machine_config &mconfig, const char void m2_powerbus_device::device_start() { - // Resolve callbacks - m_int_handler.resolve(); - // Register state for saving save_item(NAME(m_ctrl)); save_item(NAME(m_int_enable)); @@ -621,10 +613,10 @@ void m2_powerbus_device::update_interrupts() // m2_memctl_device - constructor //------------------------------------------------- -m2_memctl_device::m2_memctl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, M2_MEMCTL, tag, owner, clock), - m_gpio_in(*this), - m_gpio_out(*this) +m2_memctl_device::m2_memctl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, M2_MEMCTL, tag, owner, clock), + m_gpio_in(*this, 0), + m_gpio_out(*this) { } @@ -635,10 +627,6 @@ m2_memctl_device::m2_memctl_device(const machine_config &mconfig, const char *ta void m2_memctl_device::device_start() { - // Resolve our callbacks - m_gpio_in.resolve_all_safe(0); - m_gpio_out.resolve_all_safe(); - // TODO: DELETE ME m2_bda_device *m_bda = (m2_bda_device*)owner(); // TEMP @@ -801,10 +789,6 @@ m2_vdu_device::m2_vdu_device(const machine_config &mconfig, const char *tag, dev void m2_vdu_device::device_start() { - // Resolve callbacks - m_vint0_int_handler.resolve_safe(); - m_vint1_int_handler.resolve_safe(); - // Initialize line interrupt timers m_vint0_timer = timer_alloc(FUNC(m2_vdu_device::vint0_set), this); m_vint1_timer = timer_alloc(FUNC(m2_vdu_device::vint1_set), this); @@ -1491,10 +1475,6 @@ m2_cde_device::m2_cde_device(const machine_config &mconfig, const char *tag, dev void m2_cde_device::device_start() { - // Resolve callbacks - m_int_handler.resolve_safe(); - m_sdbg_out_handler.resolve_safe(); - // Init DMA m_dma[0].m_timer = timer_alloc(FUNC(m2_cde_device::next_dma), this); m_dma[1].m_timer = timer_alloc(FUNC(m2_cde_device::next_dma), this); diff --git a/src/mame/konami/3dom2_te.cpp b/src/mame/konami/3dom2_te.cpp index e9808eb470f..895b9479010 100644 --- a/src/mame/konami/3dom2_te.cpp +++ b/src/mame/konami/3dom2_te.cpp @@ -709,13 +709,6 @@ void m2_te_device::device_start() // Find our parent m_bda = downcast<m2_bda_device *>(owner()); - // Resolve callbacks - m_general_int_handler.resolve_safe(); - m_dfinstr_int_handler.resolve_safe(); - m_iminstr_int_handler.resolve_safe(); - m_listend_int_handler.resolve_safe(); - m_winclip_int_handler.resolve_safe(); - // Allocate texture RAM m_tram = std::make_unique<uint32_t[]>(TEXTURE_RAM_WORDS); diff --git a/src/mame/konami/k001604.cpp b/src/mame/konami/k001604.cpp index 6f90a19087e..36890f26be1 100644 --- a/src/mame/konami/k001604.cpp +++ b/src/mame/konami/k001604.cpp @@ -172,8 +172,6 @@ k001604_device::k001604_device(const machine_config &mconfig, const char *tag, d void k001604_device::device_start() { - m_irq.resolve_safe(); - if (!palette().device().started()) throw device_missing_dependencies(); @@ -556,10 +554,7 @@ void k001604_device::reg_w(offs_t offset, uint32_t data, uint32_t mem_mask) // (1 = enable VBLANK IRQ, 0 = clear IRQ?) if ((data & 0x1) == 0) { - if (!m_irq.isnull()) - { - m_irq(CLEAR_LINE); - } + m_irq(CLEAR_LINE); } } } diff --git a/src/mame/konami/k051960.cpp b/src/mame/konami/k051960.cpp index 7fd757efa7c..aa77881c5c6 100644 --- a/src/mame/konami/k051960.cpp +++ b/src/mame/konami/k051960.cpp @@ -211,11 +211,6 @@ void k051960_device::device_start() m_ram = make_unique_clear<uint8_t[]>(0x400); - // resolve callbacks - m_irq_handler.resolve_safe(); - m_firq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - // register for save states save_item(NAME(m_romoffset)); save_item(NAME(m_spriteflip)); diff --git a/src/mame/konami/k052109.cpp b/src/mame/konami/k052109.cpp index c2a16be263d..f6655100d0b 100644 --- a/src/mame/konami/k052109.cpp +++ b/src/mame/konami/k052109.cpp @@ -223,13 +223,9 @@ void k052109_device::device_start() screen().register_vblank_callback(vblank_state_delegate(&k052109_device::vblank_callback, this)); } - // resolve callbacks + // resolve delegates m_k052109_cb.resolve(); - m_irq_handler.resolve_safe(); - m_firq_handler.resolve_safe(); - m_nmi_handler.resolve_safe(); - decode_gfx(); gfx(0)->set_colors(palette().entries() / gfx(0)->depth()); diff --git a/src/mame/konami/k053250_ps.cpp b/src/mame/konami/k053250_ps.cpp index b76bb23443f..a02c02b81c1 100644 --- a/src/mame/konami/k053250_ps.cpp +++ b/src/mame/konami/k053250_ps.cpp @@ -76,7 +76,6 @@ void k053250ps_device::device_start() save_item(NAME(m_page)); save_item(NAME(m_dmairq_on)); - m_dmairq_cb.resolve_safe(); m_timer_lvcdma = timer_alloc(FUNC(k053250ps_device::handle_od_wait), this); } diff --git a/src/mame/konami/k057714.cpp b/src/mame/konami/k057714.cpp index c093e466049..2a7ad48ac71 100644 --- a/src/mame/konami/k057714.cpp +++ b/src/mame/konami/k057714.cpp @@ -35,8 +35,6 @@ k057714_device::k057714_device(const machine_config &mconfig, const char *tag, d void k057714_device::device_start() { - m_irq.resolve_safe(); - m_vram = std::make_unique<uint32_t[]>(VRAM_SIZE/4); save_pointer(NAME(m_vram), VRAM_SIZE/4); @@ -229,10 +227,7 @@ void k057714_device::write(offs_t offset, uint32_t data, uint32_t mem_mask) /* it enables bits 0x41, but 0x01 seems to be the one it cares about */ if (ACCESSING_BITS_16_31 && (data & 0x00010000) == 0) { - if (!m_irq.isnull()) - { - m_irq(CLEAR_LINE); - } + m_irq(CLEAR_LINE); } if (ACCESSING_BITS_0_15) { diff --git a/src/mame/konami/k573cass.cpp b/src/mame/konami/k573cass.cpp index 010912e4afe..aafb8e31739 100644 --- a/src/mame/konami/k573cass.cpp +++ b/src/mame/konami/k573cass.cpp @@ -197,15 +197,6 @@ void konami573_cassette_y_device::device_add_mconfig(machine_config &config) void konami573_cassette_y_device::device_start() { - m_d0_handler.resolve_safe(); - m_d1_handler.resolve_safe(); - m_d2_handler.resolve_safe(); - m_d3_handler.resolve_safe(); - m_d4_handler.resolve_safe(); - m_d5_handler.resolve_safe(); - m_d6_handler.resolve_safe(); - m_d7_handler.resolve_safe(); - output_dsr(0); } @@ -354,8 +345,6 @@ konami573_cassette_slot_device::konami573_cassette_slot_device(const machine_con void konami573_cassette_slot_device::device_start() { - m_dsr_handler.resolve_safe(); - m_dev = get_card_device(); } diff --git a/src/mame/konami/k573dio.cpp b/src/mame/konami/k573dio.cpp index 0d3b4cd4631..175e2455bdd 100644 --- a/src/mame/konami/k573dio.cpp +++ b/src/mame/konami/k573dio.cpp @@ -139,8 +139,6 @@ k573dio_device::k573dio_device(const machine_config &mconfig, const char *tag, d void k573dio_device::device_start() { - output_cb.resolve_safe(); - save_item(NAME(ram_adr)); save_item(NAME(ram_read_adr)); save_item(NAME(output_data)); diff --git a/src/mame/konami/konppc_jvshost.cpp b/src/mame/konami/konppc_jvshost.cpp index 678229db32a..f7c1c94b3c5 100644 --- a/src/mame/konami/konppc_jvshost.cpp +++ b/src/mame/konami/konppc_jvshost.cpp @@ -20,8 +20,6 @@ void konppc_jvs_host_device::device_start() { jvs_host::device_start(); - output_cb.resolve_safe(); - m_jvs_sdata = make_unique_clear<uint8_t[]>(JVS_BUFFER_SIZE); m_jvs_is_escape_byte = false; m_jvs_sdata_ptr = 0; diff --git a/src/mame/konami/midikbd.cpp b/src/mame/konami/midikbd.cpp index 67d412b65c5..ae2f6d1b8a2 100644 --- a/src/mame/konami/midikbd.cpp +++ b/src/mame/konami/midikbd.cpp @@ -79,7 +79,6 @@ void midi_keyboard_device::device_start() { set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); //8N1? set_tra_rate(clock()); - m_out_tx_func.resolve_safe(); m_head = m_tail = 0; m_keyboard_timer = timer_alloc(FUNC(midi_keyboard_device::scan_keyboard), this); m_keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); diff --git a/src/mame/liberty/freedom220_kbd.cpp b/src/mame/liberty/freedom220_kbd.cpp index 4dd2a751fe1..e5e949d25ad 100644 --- a/src/mame/liberty/freedom220_kbd.cpp +++ b/src/mame/liberty/freedom220_kbd.cpp @@ -251,9 +251,6 @@ freedom220_kbd_device::freedom220_kbd_device(const machine_config &mconfig, cons void freedom220_kbd_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); - // register for save states save_item(NAME(m_select)); } diff --git a/src/mame/luxor/abc1600mac.cpp b/src/mame/luxor/abc1600mac.cpp index b01d4d6b3ae..4602913091e 100644 --- a/src/mame/luxor/abc1600mac.cpp +++ b/src/mame/luxor/abc1600mac.cpp @@ -113,7 +113,7 @@ abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char m_segment_ram(*this, "segment_ram", 0x400, ENDIANNESS_LITTLE), m_page_ram(*this, "page_ram", 0x400*2, ENDIANNESS_LITTLE), m_watchdog(*this, "watchdog"), - m_read_tren(*this), + m_read_tren(*this, 0xff), m_write_tren(*this), m_rstbut(0), m_boote(0), @@ -131,10 +131,6 @@ abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char void abc1600_mac_device::device_start() { - // resolve callbacks - m_read_tren.resolve_all_safe(0xff); - m_write_tren.resolve_all_safe(); - // state saving save_item(NAME(m_rstbut)); save_item(NAME(m_boote)); diff --git a/src/mame/luxor/abc80kb.cpp b/src/mame/luxor/abc80kb.cpp index 11e2a92897f..e58a0be327d 100644 --- a/src/mame/luxor/abc80kb.cpp +++ b/src/mame/luxor/abc80kb.cpp @@ -189,8 +189,6 @@ abc80_keyboard_device::abc80_keyboard_device(const machine_config &mconfig, cons void abc80_keyboard_device::device_start() { - // resolve callbacks - m_write_keydown.resolve_safe(); } diff --git a/src/mame/mg1/kbd.cpp b/src/mame/mg1/kbd.cpp index 555e88e8bd0..b3c41da3956 100644 --- a/src/mame/mg1/kbd.cpp +++ b/src/mame/mg1/kbd.cpp @@ -236,7 +236,6 @@ void mg1_kbd_device::map_pio(address_map &map) void mg1_kbd_device::device_start() { - m_data_cb.resolve_safe(); m_led.resolve(); } diff --git a/src/mame/microsoft/mct_adr.cpp b/src/mame/microsoft/mct_adr.cpp index f3f95cdfb14..f4d76ed861b 100644 --- a/src/mame/microsoft/mct_adr.cpp +++ b/src/mame/microsoft/mct_adr.cpp @@ -45,8 +45,8 @@ mct_adr_device::mct_adr_device(const machine_config &mconfig, const char *tag, d , m_out_int_dma(*this) , m_out_int_device(*this) , m_out_int_timer(*this) - , m_eisa_iack(*this) - , m_dma_r(*this) + , m_eisa_iack(*this, 0) + , m_dma_r(*this, 0xff) , m_dma_w(*this) { } @@ -144,14 +144,6 @@ void mct_adr_device::dma(address_map &map) void mct_adr_device::device_start() { - m_out_int_dma.resolve(); - m_out_int_device.resolve(); - m_out_int_timer.resolve(); - m_eisa_iack.resolve(); - - m_dma_r.resolve_all_safe(0xff); - m_dma_w.resolve_all_safe(); - m_ioc_maint = 0; m_ioc_physical_tag = 0; m_ioc_logical_tag = 0; diff --git a/src/mame/midw8080/mw8080bw_a.cpp b/src/mame/midw8080/mw8080bw_a.cpp index 5760efbf8a7..8e02a6ea922 100644 --- a/src/mame/midw8080/mw8080bw_a.cpp +++ b/src/mame/midw8080/mw8080bw_a.cpp @@ -1319,7 +1319,6 @@ ioport_constructor desertgu_audio_device::device_input_ports() const void desertgu_audio_device::device_start() { - m_ctrl_sel_out.resolve(); m_recoil.resolve(); m_p2 = 0U; @@ -2011,8 +2010,6 @@ ioport_constructor clowns_audio_device::device_input_ports() const void clowns_audio_device::device_start() { - m_ctrl_sel_out.resolve_safe(); - m_p1 = 0U; m_p2 = 0U; @@ -2395,8 +2392,6 @@ ioport_constructor spacwalk_audio_device::device_input_ports() const void spacwalk_audio_device::device_start() { - m_ctrl_sel_out.resolve(); - m_p1 = 0U; save_item(NAME(m_p1)); @@ -3322,8 +3317,6 @@ void invaders_audio_device::device_add_mconfig(machine_config &config) void invaders_audio_device::device_start() { - m_flip_screen_out.resolve_safe(); - m_p2 = 0U; save_item(NAME(m_p2)); diff --git a/src/mame/midway/midwayic.cpp b/src/mame/midway/midwayic.cpp index 19cbc09a0be..e8ec1d82356 100644 --- a/src/mame/midway/midwayic.cpp +++ b/src/mame/midway/midwayic.cpp @@ -765,10 +765,6 @@ void midway_ioasic_device::device_start() } m_shuffle_map = &shuffle_maps[m_shuffle_type][0]; - // resolve callbacks - m_irq_callback.resolve_safe(); - m_serial_tx_cb.resolve_safe(); - m_aux_output_cb.resolve(); /* initialize the PIC */ midway_serial_pic2_device::device_start(); @@ -831,8 +827,7 @@ void midway_ioasic_device::update_ioasic_irq() if (new_state != m_irq_state) { m_irq_state = new_state; - if (!m_irq_callback.isnull()) - m_irq_callback(m_irq_state ? ASSERT_LINE : CLEAR_LINE); + m_irq_callback(m_irq_state ? ASSERT_LINE : CLEAR_LINE); if (m_irq_state && (m_reg[IOASIC_UARTIN] & 0x1000)) LOGIRQ("IOASIC: Asserting IRQ INTCTRL=%04x INTSTAT=%04X\n", m_reg[IOASIC_INTCTL], m_reg[IOASIC_INTSTAT]); } @@ -1231,8 +1226,7 @@ void midway_ioasic_device::write(offs_t offset, uint32_t data, uint32_t mem_mask case IOASIC_PICIN: /* This is P15 on vegas boards */ - if (!m_aux_output_cb.isnull()) - m_aux_output_cb(data); + m_aux_output_cb(data); break; case IOASIC_INTCTL: diff --git a/src/mame/midway/sente6vb.cpp b/src/mame/midway/sente6vb.cpp index 5621f9ea5cc..6f875ba10cd 100644 --- a/src/mame/midway/sente6vb.cpp +++ b/src/mame/midway/sente6vb.cpp @@ -182,8 +182,6 @@ sente6vb_device::sente6vb_device(const machine_config &mconfig, const char *tag, void sente6vb_device::device_start() { - m_send_cb.resolve_safe(); - m_clock_out_cb.resolve_safe(); m_uart->write_cts(0); m_uart->write_dcd(0); diff --git a/src/mame/mips/mips_rambo.cpp b/src/mame/mips/mips_rambo.cpp index c06a979c8fa..7e30f8b5d09 100644 --- a/src/mame/mips/mips_rambo.cpp +++ b/src/mame/mips/mips_rambo.cpp @@ -32,7 +32,7 @@ mips_rambo_device::mips_rambo_device(const machine_config &mconfig, const char * , m_parity_out_cb(*this) , m_timer_out_cb(*this) , m_buzzer_out_cb(*this) - , m_channel{{ 0,0,0,0,0,0, false, *this, *this }, { 0,0,0,0,0,0, false, *this, *this }} + , m_channel{{ 0,0,0,0,0,0, false, {*this, 0}, {*this} }, { 0,0,0,0,0,0, false, {*this, 0}, {*this} }} , m_buzzer_out_state(0) { } @@ -61,17 +61,6 @@ void mips_rambo_device::map(address_map &map) void mips_rambo_device::device_start() { - m_irq_out_cb.resolve_safe(); - m_parity_out_cb.resolve_safe(); - m_timer_out_cb.resolve_safe(); - m_buzzer_out_cb.resolve_safe(); - - for (dma_t &ch : m_channel) - { - ch.read_cb.resolve_safe(0); - ch.write_cb.resolve_safe(); - } - m_timer = timer_alloc(FUNC(mips_rambo_device::timer), this); m_dma = timer_alloc(FUNC(mips_rambo_device::dma), this); m_buzzer = timer_alloc(FUNC(mips_rambo_device::buzzer), this); diff --git a/src/mame/misc/nabupc_kbd.cpp b/src/mame/misc/nabupc_kbd.cpp index f1a267dbea5..8fc1090e23c 100644 --- a/src/mame/misc/nabupc_kbd.cpp +++ b/src/mame/misc/nabupc_kbd.cpp @@ -239,8 +239,6 @@ nabupc_keyboard_device::nabupc_keyboard_device(machine_config const &mconfig, ch void nabupc_keyboard_device::device_start() { - m_rxd_cb.resolve_safe(); - save_item(NAME(m_port1)); save_item(NAME(m_eoc)); } diff --git a/src/mame/msx/msx_matsushita.cpp b/src/mame/msx/msx_matsushita.cpp index ad4da191b66..f912fadf2e3 100644 --- a/src/mame/msx/msx_matsushita.cpp +++ b/src/mame/msx/msx_matsushita.cpp @@ -34,8 +34,6 @@ ioport_constructor msx_matsushita_device::device_input_ports() const void msx_matsushita_device::device_start() { - m_turbo_out_cb.resolve_safe(); - m_sram.resize(0x800); save_item(NAME(m_selected)); diff --git a/src/mame/namco/c117.cpp b/src/mame/namco/c117.cpp index 87621321507..1eca383715f 100644 --- a/src/mame/namco/c117.cpp +++ b/src/mame/namco/c117.cpp @@ -56,8 +56,6 @@ device_memory_interface::space_config_vector namco_c117_device::memory_space_con void namco_c117_device::device_start() { - m_subres_cb.resolve_safe(); - space(AS_PROGRAM).specific(m_program); m_cpuexec[0]->space(AS_PROGRAM).cache(m_cpucache[0]); diff --git a/src/mame/namco/namco06.cpp b/src/mame/namco/namco06.cpp index 8fb911e4f25..e9116630e46 100644 --- a/src/mame/namco/namco06.cpp +++ b/src/mame/namco/namco06.cpp @@ -244,7 +244,7 @@ namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char * , m_nmicpu(*this, finder_base::DUMMY_TAG) , m_chipsel(*this) , m_rw(*this) - , m_read(*this) + , m_read(*this, 0xff) , m_write(*this) { } @@ -255,11 +255,6 @@ namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char * void namco_06xx_device::device_start() { - m_chipsel.resolve_all_safe(); - m_rw.resolve_all_safe(); - m_read.resolve_all_safe(0xff); - m_write.resolve_all_safe(); - /* allocate a timer */ m_nmi_timer = timer_alloc(FUNC(namco_06xx_device::nmi_generate), this); diff --git a/src/mame/namco/namco51.cpp b/src/mame/namco/namco51.cpp index dda2a9d7a90..3a268019779 100644 --- a/src/mame/namco/namco51.cpp +++ b/src/mame/namco/namco51.cpp @@ -163,7 +163,7 @@ namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char * , m_cpu(*this, "mcu") , m_portO(0) , m_rw(0) - , m_in(*this) + , m_in(*this, 0) , m_out(*this) , m_lockout(*this) { @@ -175,13 +175,6 @@ namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char * void namco_51xx_device::device_start() { - /* resolve our read callbacks */ - m_in.resolve_all_safe(0); - - /* resolve our write callbacks */ - m_out.resolve_safe(); - m_lockout.resolve_safe(); - save_item(NAME(m_portO)); save_item(NAME(m_rw)); } diff --git a/src/mame/namco/namco52.cpp b/src/mame/namco/namco52.cpp index ebce96da818..4716257aa0a 100644 --- a/src/mame/namco/namco52.cpp +++ b/src/mame/namco/namco52.cpp @@ -135,14 +135,14 @@ ROM_END DEFINE_DEVICE_TYPE(NAMCO_52XX, namco_52xx_device, "namco52", "Namco 52xx") -namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, NAMCO_52XX, tag, owner, clock), +namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, NAMCO_52XX, tag, owner, clock), m_cpu(*this, "mcu"), m_discrete(*this, finder_base::DUMMY_TAG), m_basenode(0), m_extclock(0), - m_romread(*this), - m_si(*this), + m_romread(*this, 0), + m_si(*this, 0), m_latched_cmd(0), m_address(0) { @@ -154,10 +154,6 @@ namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char * void namco_52xx_device::device_start() { - /* resolve our read/write callbacks */ - m_romread.resolve_safe(0); - m_si.resolve_safe(0); - /* start the external clock */ if (m_extclock != 0) { diff --git a/src/mame/namco/namco53.cpp b/src/mame/namco/namco53.cpp index 295012d1c50..afc833bb6f1 100644 --- a/src/mame/namco/namco53.cpp +++ b/src/mame/namco/namco53.cpp @@ -131,8 +131,8 @@ namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char * device_t(mconfig, NAMCO_53XX, tag, owner, clock), m_cpu(*this, "mcu"), m_portO(0), - m_k(*this), - m_in(*this), + m_k(*this, 0), + m_in(*this, 0), m_p(*this) { } @@ -142,11 +142,6 @@ namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char * void namco_53xx_device::device_start() { - /* resolve our read/write callbacks */ - m_k.resolve_safe(0); - m_in.resolve_all_safe(0); - m_p.resolve_safe(); - save_item(NAME(m_portO)); } diff --git a/src/mame/namco/namco62.cpp b/src/mame/namco/namco62.cpp index 8a7fc1e88ed..1cbfd61fe08 100644 --- a/src/mame/namco/namco62.cpp +++ b/src/mame/namco/namco62.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(NAMCO_62XX, namco_62xx_device, "namco62", "Namco 62xx") namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_62XX, tag, owner, clock), m_cpu(*this, "mcu"), - m_in(*this), + m_in(*this, 0), m_out(*this) { } @@ -44,11 +44,6 @@ namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char * void namco_62xx_device::device_start() { - /* resolve our read callbacks */ - m_in.resolve_all_safe(0); - - /* resolve our write callbacks */ - m_out.resolve_all_safe(); } //------------------------------------------------- diff --git a/src/mame/namco/namco65.cpp b/src/mame/namco/namco65.cpp index 725e6741473..2df5b53a52f 100644 --- a/src/mame/namco/namco65.cpp +++ b/src/mame/namco/namco65.cpp @@ -16,13 +16,13 @@ DEFINE_DEVICE_TYPE(NAMCOC65, namcoc65_device, "namcoc65", "Namco C65 I/O") namcoc65_device::namcoc65_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCOC65, tag, owner, clock), m_mcu(*this, "mcu"), - m_in_pb_cb(*this), - m_in_pc_cb(*this), - m_in_ph_cb(*this), - m_in_pdsw_cb(*this), - m_port_analog_in_cb(*this), - m_port_dial_in_cb(*this), - m_dp_in(*this), + m_in_pb_cb(*this, 0xff), + m_in_pc_cb(*this, 0xff), + m_in_ph_cb(*this, 0xff), + m_in_pdsw_cb(*this, 0xff), + m_port_analog_in_cb(*this, 0xff), + m_port_dial_in_cb(*this, 0xff), + m_dp_in(*this, 0xff), m_dp_out(*this) { } @@ -174,19 +174,6 @@ void namcoc65_device::device_add_mconfig(machine_config &config) m_mcu->set_addrmap(AS_PROGRAM, &namcoc65_device::mcu_map); } -void namcoc65_device::device_resolve_objects() -{ - m_in_pb_cb.resolve_safe(0xff); - m_in_pc_cb.resolve_safe(0xff); - m_in_ph_cb.resolve_safe(0xff); - m_in_pdsw_cb.resolve_safe(0xff); - m_port_analog_in_cb.resolve_all_safe(0xff); - m_port_dial_in_cb.resolve_all_safe(0xff); - - m_dp_in.resolve_safe(0xff); - m_dp_out.resolve_safe(); -} - void namcoc65_device::device_start() { save_item(NAME(m_mcu_analog_ctrl)); diff --git a/src/mame/namco/namco65.h b/src/mame/namco/namco65.h index 6e7f3c3dedb..37f6b8f16de 100644 --- a/src/mame/namco/namco65.h +++ b/src/mame/namco/namco65.h @@ -45,7 +45,6 @@ protected: void mcu_map(address_map &map); virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_reset() override; diff --git a/src/mame/namco/namco68.cpp b/src/mame/namco/namco68.cpp index c345638c2d6..0b3ae9d9761 100644 --- a/src/mame/namco/namco68.cpp +++ b/src/mame/namco/namco68.cpp @@ -16,13 +16,13 @@ DEFINE_DEVICE_TYPE(NAMCOC68, namcoc68_device, "namcoc68", "Namco C68 I/O") namcoc68_device::namcoc68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCOC68, tag, owner, clock), m_mcu(*this, "mcu"), - m_in_pb_cb(*this), - m_in_pc_cb(*this), - m_in_ph_cb(*this), - m_in_pdsw_cb(*this), - m_port_analog_in_cb(*this), - m_port_dial_in_cb(*this), - m_dp_in(*this), + m_in_pb_cb(*this, 0xff), + m_in_pc_cb(*this, 0xff), + m_in_ph_cb(*this, 0xff), + m_in_pdsw_cb(*this, 0xff), + m_port_analog_in_cb(*this, 0xff), + m_port_dial_in_cb(*this, 0xff), + m_dp_in(*this, 0xff), m_dp_out(*this) { } @@ -114,20 +114,6 @@ void namcoc68_device::device_add_mconfig(machine_config &config) m_mcu->set_addrmap(AS_PROGRAM, &namcoc68_device::c68_default_am); } -void namcoc68_device::device_resolve_objects() -{ - m_in_pb_cb.resolve_safe(0xff); - m_in_pc_cb.resolve_safe(0xff); - m_in_ph_cb.resolve_safe(0xff); - m_in_pdsw_cb.resolve_safe(0xff); - - m_port_analog_in_cb.resolve_all_safe(0xff); - m_port_dial_in_cb.resolve_all_safe(0xff); - - m_dp_in.resolve_safe(0xff); - m_dp_out.resolve_safe(); -} - void namcoc68_device::device_start() { save_item(NAME(m_player_mux)); diff --git a/src/mame/namco/namco68.h b/src/mame/namco/namco68.h index a11fa15ed94..e0338824859 100644 --- a/src/mame/namco/namco68.h +++ b/src/mame/namco/namco68.h @@ -46,7 +46,6 @@ protected: void c68_default_am(address_map &map); virtual void device_add_mconfig(machine_config &config) override; - virtual void device_resolve_objects() override; virtual void device_start() override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_reset() override; diff --git a/src/mame/namco/namco_c148.cpp b/src/mame/namco/namco_c148.cpp index 047dd52a975..dea1599b9aa 100644 --- a/src/mame/namco/namco_c148.cpp +++ b/src/mame/namco/namco_c148.cpp @@ -115,9 +115,6 @@ void namco_c148_device::device_validity_check(validity_checker &valid) const void namco_c148_device::device_start() { - m_out_ext1_cb.resolve_safe(); - m_out_ext2_cb.resolve_safe(); - // TODO: link to SCI, EX and the screen device controller devices save_item(NAME(m_irqlevel.cpu)); diff --git a/src/mame/namco/namcoio.cpp b/src/mame/namco/namcoio.cpp index ee6d5767c6d..079a5ea423f 100644 --- a/src/mame/namco/namcoio.cpp +++ b/src/mame/namco/namcoio.cpp @@ -124,7 +124,7 @@ DEFINE_DEVICE_TYPE(NAMCO_59XX, namco59xx_device, "namco59", "Namco 59xx I/O") namcoio_device::namcoio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int device_type) : device_t(mconfig, type, tag, owner, clock) - , m_in_cb(*this) + , m_in_cb(*this, 0) , m_out_cb(*this) //, m_device_type(device_type) { @@ -151,9 +151,6 @@ namco59xx_device::namco59xx_device(const machine_config &mconfig, const char *ta void namcoio_device::device_start() { - m_in_cb.resolve_all_safe(0); - m_out_cb.resolve_all_safe(); - save_item(NAME(m_ram)); save_item(NAME(m_reset)); save_item(NAME(m_lastcoins)); diff --git a/src/mame/namco/namcos10.cpp b/src/mame/namco/namcos10.cpp index 803ae0bfcee..05b30ad4ae0 100644 --- a/src/mame/namco/namcos10.cpp +++ b/src/mame/namco/namcos10.cpp @@ -1040,7 +1040,6 @@ void namcos10_state::machine_reset() void namcos10_state::device_resolve_objects() { - m_io_update_interrupt.resolve_safe(); m_mgexio_outputs.resolve(); } diff --git a/src/mame/namco/namcos10_exio.cpp b/src/mame/namco/namcos10_exio.cpp index ad9fd519d5f..dfa55abd12f 100644 --- a/src/mame/namco/namcos10_exio.cpp +++ b/src/mame/namco/namcos10_exio.cpp @@ -30,7 +30,7 @@ namcos10_exio_device::namcos10_exio_device(const machine_config &mconfig, const namcos10_exio_base_device(mconfig, NAMCOS10_EXIO, tag, owner, clock, 0x30), m_maincpu(*this, "exio_mcu"), m_ram(*this, "exio_ram"), - m_analog_cb(*this) + m_analog_cb(*this, 0) { } @@ -38,8 +38,6 @@ void namcos10_exio_device::device_start() { namcos10_exio_base_device::device_start(); - m_analog_cb.resolve_safe(0); - save_item(NAME(m_is_active)); save_item(NAME(m_analog_idx)); save_item(NAME(m_bus_req)); @@ -172,7 +170,7 @@ namcos10_mgexio_device::namcos10_mgexio_device(const machine_config &mconfig, co m_maincpu(*this, "exio_mcu"), m_ram(*this, "exio_ram"), m_nvram(*this, "nvram"), - m_port_read(*this), + m_port_read(*this, 0), m_port_write(*this) { } @@ -183,9 +181,6 @@ void namcos10_mgexio_device::device_start() save_item(NAME(m_bus_req)); save_item(NAME(m_ctrl)); - m_port_read.resolve_all_safe(0); - m_port_write.resolve_all_safe(); - m_cpu_reset_timer = timer_alloc(FUNC(namcos10_mgexio_device::cpu_reset_timeout), this); m_nvram->set_base(m_ram, 0x8000); diff --git a/src/mame/namco/namcos21_dsp_c67.cpp b/src/mame/namco/namcos21_dsp_c67.cpp index cf540ebce60..27c2fc3f8cb 100644 --- a/src/mame/namco/namcos21_dsp_c67.cpp +++ b/src/mame/namco/namcos21_dsp_c67.cpp @@ -37,7 +37,6 @@ void namcos21_dsp_c67_device::device_start() m_dspram16 = std::make_unique<uint16_t []>(0x10000/2); // 0x8000 16-bit words std::fill_n(m_dspram16.get(), 0x10000/2, 0x0000); - m_yield_hack_cb.resolve_safe(); m_pointram = std::make_unique<uint8_t[]>(PTRAM_SIZE); m_mpDspState = std::make_unique<dsp_state>(); diff --git a/src/mame/namco/ygv608.cpp b/src/mame/namco/ygv608.cpp index e677750266d..ad6cc77242a 100644 --- a/src/mame/namco/ygv608.cpp +++ b/src/mame/namco/ygv608.cpp @@ -480,8 +480,6 @@ void ygv608_device::device_start() m_iospace = &space(AS_IO); // TODO: tagging configuration - m_vblank_handler.resolve(); - m_raster_handler.resolve(); m_vblank_timer = timer_alloc(FUNC(ygv608_device::update_vblank_flag), this); m_raster_timer = timer_alloc(FUNC(ygv608_device::update_raster_flag), this); diff --git a/src/mame/nec/pc80s31k.cpp b/src/mame/nec/pc80s31k.cpp index 89091f22893..0334d4a7ef1 100644 --- a/src/mame/nec/pc80s31k.cpp +++ b/src/mame/nec/pc80s31k.cpp @@ -519,9 +519,6 @@ void pc88va2_fd_if_device::device_start() { pc80s31k_device::device_start(); - m_write_irq.resolve_safe(); - m_write_drq.resolve_safe(); - m_fdc_timer = timer_alloc(FUNC(pc88va2_fd_if_device::fdc_timer_cb), this); m_fdc_timer->adjust(attotime::never); diff --git a/src/mame/nec/pc9801_kbd.cpp b/src/mame/nec/pc9801_kbd.cpp index f3785c204ba..835158bbc99 100644 --- a/src/mame/nec/pc9801_kbd.cpp +++ b/src/mame/nec/pc9801_kbd.cpp @@ -238,8 +238,6 @@ void pc9801_kbd_device::device_validity_check(validity_checker &valid) const void pc9801_kbd_device::device_start() { - m_write_irq.resolve_safe(); - m_rxtimer = timer_alloc(FUNC(pc9801_kbd_device::rx_timer_tick), this); m_rxtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); } diff --git a/src/mame/next/nextkbd.cpp b/src/mame/next/nextkbd.cpp index deb6036f76c..bfbe7f503eb 100644 --- a/src/mame/next/nextkbd.cpp +++ b/src/mame/next/nextkbd.cpp @@ -29,10 +29,6 @@ nextkbd_device::nextkbd_device(const machine_config &mconfig, const char *tag, d void nextkbd_device::device_start() { - int_change_cb.resolve_safe(); - int_power_cb.resolve_safe(); - int_nmi_cb.resolve_safe(); - poll_timer = timer_alloc(FUNC(nextkbd_device::update_tick), this); save_item(NAME(ctrl_snd)); diff --git a/src/mame/next/nextmo.cpp b/src/mame/next/nextmo.cpp index 8c9b3f3e8d8..3bcb1b754f8 100644 --- a/src/mame/next/nextmo.cpp +++ b/src/mame/next/nextmo.cpp @@ -29,8 +29,6 @@ nextmo_device::nextmo_device(const machine_config &mconfig, const char *tag, dev void nextmo_device::device_start() { - irq_cb.resolve_safe(); - drq_cb.resolve_safe(); } void nextmo_device::device_reset() @@ -88,8 +86,7 @@ void nextmo_device::r7_w(uint8_t data) if(r7 & 0xc0) { logerror("nextmo: start dma %02x %02x\n", r6, r7); sector_pos = 0; - if(!drq_cb.isnull()) - drq_cb(true); + drq_cb(true); } } @@ -117,8 +114,7 @@ void nextmo_device::check_dma_end() else limit = r6 & 0x20 ? 0x400 : 0x510; if(sector_pos == limit) { - if(!drq_cb.isnull()) - drq_cb(false); + drq_cb(false); if(r7 & 0x40) { if(r6 & 0x20) check_ecc(); diff --git a/src/mame/nichibutsu/nb1412m2.cpp b/src/mame/nichibutsu/nb1412m2.cpp index 9dbe7fbe5ad..6bbf9093e21 100644 --- a/src/mame/nichibutsu/nb1412m2.cpp +++ b/src/mame/nichibutsu/nb1412m2.cpp @@ -161,8 +161,6 @@ void nb1412m2_device::device_start() m_timer = timer_alloc(FUNC(nb1412m2_device::main_timer_tick), this); m_timer->adjust(attotime::never); m_dac_timer = timer_alloc(FUNC(nb1412m2_device::update_dac), this); - - m_dac_cb.resolve_safe(); } diff --git a/src/mame/nintendo/nes_vt09_soc.cpp b/src/mame/nintendo/nes_vt09_soc.cpp index 2daac2744b8..3235f689ea5 100644 --- a/src/mame/nintendo/nes_vt09_soc.cpp +++ b/src/mame/nintendo/nes_vt09_soc.cpp @@ -15,8 +15,8 @@ nes_vt09_soc_device::nes_vt09_soc_device(const machine_config& mconfig, const ch nes_vt09_soc_device::nes_vt09_soc_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) : nes_vt02_vt03_soc_device(mconfig, type, tag, owner, clock), m_upper_write_412c_callback(*this), - m_upper_read_412c_callback(*this), - m_upper_read_412d_callback(*this) + m_upper_read_412c_callback(*this, 0xff), + m_upper_read_412d_callback(*this, 0xff) { } @@ -30,15 +30,6 @@ void nes_vt09_soc_device::device_add_mconfig(machine_config& config) m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt09_soc_device::nes_vt_4k_ram_map); } -void nes_vt09_soc_device::device_start() -{ - nes_vt02_vt03_soc_device::device_start(); - - m_upper_write_412c_callback.resolve_safe(); - m_upper_read_412c_callback.resolve_safe(0xff); - m_upper_read_412d_callback.resolve_safe(0xff); -} - void nes_vt09_soc_device::nes_vt_4k_ram_map(address_map &map) { nes_vt02_vt03_soc_device::nes_vt_map(map); diff --git a/src/mame/nintendo/nes_vt09_soc.h b/src/mame/nintendo/nes_vt09_soc.h index 49b97e3e62f..71b53983786 100644 --- a/src/mame/nintendo/nes_vt09_soc.h +++ b/src/mame/nintendo/nes_vt09_soc.h @@ -28,7 +28,6 @@ public: protected: nes_vt09_soc_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock); - void device_start() override; virtual void device_add_mconfig(machine_config& config) override; diff --git a/src/mame/nintendo/nes_vt_soc.cpp b/src/mame/nintendo/nes_vt_soc.cpp index 36d59df526b..6b91d083104 100644 --- a/src/mame/nintendo/nes_vt_soc.cpp +++ b/src/mame/nintendo/nes_vt_soc.cpp @@ -77,16 +77,16 @@ nes_vt02_vt03_soc_device::nes_vt02_vt03_soc_device(const machine_config& mconfig m_chrram(nullptr), m_space_config("program", ENDIANNESS_LITTLE, 8, 25, 0, address_map_constructor(FUNC(nes_vt02_vt03_soc_device::program_map), this)), m_write_0_callback(*this), - m_read_0_callback(*this), - m_read_1_callback(*this), + m_read_0_callback(*this, 0xff), + m_read_1_callback(*this, 0xff), m_extra_write_0_callback(*this), m_extra_write_1_callback(*this), m_extra_write_2_callback(*this), m_extra_write_3_callback(*this), - m_extra_read_0_callback(*this), - m_extra_read_1_callback(*this), - m_extra_read_2_callback(*this), - m_extra_read_3_callback(*this) + m_extra_read_0_callback(*this, 0xff), + m_extra_read_1_callback(*this, 0xff), + m_extra_read_2_callback(*this, 0xff), + m_extra_read_3_callback(*this, 0xff) { // 'no scramble' configuration for (int i = 0; i < 6; i++) @@ -155,20 +155,6 @@ void nes_vt02_vt03_soc_device::device_start() //m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8sm_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_r)), write8sm_delegate(*m_cartslot->m_cart, FUNC(device_nes_cart_interface::chr_w))); m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8sm_delegate(*this, FUNC(nes_vt02_vt03_soc_device::nt_r)), write8sm_delegate(*this, FUNC(nes_vt02_vt03_soc_device::nt_w))); m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8sm_delegate(*this, FUNC(nes_vt02_vt03_soc_device::chr_r)), write8sm_delegate(*this, FUNC(nes_vt02_vt03_soc_device::chr_w))); - - m_write_0_callback.resolve_safe(); - m_read_0_callback.resolve_safe(0xff); - m_read_1_callback.resolve_safe(0xff); - - m_extra_write_0_callback.resolve_safe(); - m_extra_write_1_callback.resolve_safe(); - m_extra_write_2_callback.resolve_safe(); - m_extra_write_3_callback.resolve_safe(); - - m_extra_read_0_callback.resolve_safe(0xff); - m_extra_read_1_callback.resolve_safe(0xff); - m_extra_read_2_callback.resolve_safe(0xff); - m_extra_read_3_callback.resolve_safe(0xff); } void nes_vt02_vt03_soc_device::device_reset() diff --git a/src/mame/nintendo/vt1682_io.cpp b/src/mame/nintendo/vt1682_io.cpp index 8833f2d1a03..09a7eee5db6 100644 --- a/src/mame/nintendo/vt1682_io.cpp +++ b/src/mame/nintendo/vt1682_io.cpp @@ -20,24 +20,15 @@ vrt_vt1682_io_device::vrt_vt1682_io_device(const machine_config &mconfig, const m_portb_out(*this), m_portc_out(*this), m_portd_out(*this), - m_porta_in(*this), - m_portb_in(*this), - m_portc_in(*this), - m_portd_in(*this) + m_porta_in(*this, 0), + m_portb_in(*this, 0), + m_portc_in(*this, 0), + m_portd_in(*this, 0) { } void vrt_vt1682_io_device::device_start() { - m_porta_out.resolve_safe(); - m_portb_out.resolve_safe(); - m_portc_out.resolve_safe(); - m_portd_out.resolve_safe(); - m_porta_in.resolve_safe(0); - m_portb_in.resolve_safe(0); - m_portc_in.resolve_safe(0); - m_portd_in.resolve_safe(0); - save_item(NAME(m_210d_ioconfig)); } diff --git a/src/mame/nintendo/vt1682_timer.cpp b/src/mame/nintendo/vt1682_timer.cpp index b7abc771480..aacf8cbc633 100644 --- a/src/mame/nintendo/vt1682_timer.cpp +++ b/src/mame/nintendo/vt1682_timer.cpp @@ -31,8 +31,6 @@ void vrt_vt1682_timer_device::device_start() save_item(NAME(m_timer_preload_7_0)); save_item(NAME(m_timer_preload_15_8)); save_item(NAME(m_timer_enable)); - - m_irq_cb.resolve(); } void vrt_vt1682_timer_device::device_reset() diff --git a/src/mame/nintendo/vt1682_uio.cpp b/src/mame/nintendo/vt1682_uio.cpp index a6a0230e820..777cd0d838a 100644 --- a/src/mame/nintendo/vt1682_uio.cpp +++ b/src/mame/nintendo/vt1682_uio.cpp @@ -19,9 +19,9 @@ DEFINE_DEVICE_TYPE(VT_VT1682_UIO, vrt_vt1682_uio_device, "vt1682uio", "VRT VT168 vrt_vt1682_uio_device::vrt_vt1682_uio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VT_VT1682_UIO, tag, owner, clock), m_porta_out(*this), - m_porta_in(*this), + m_porta_in(*this, 0), m_portb_out(*this), - m_portb_in(*this) + m_portb_in(*this, 0) { } @@ -109,11 +109,6 @@ void vrt_vt1682_uio_device::inteact_214b_uio_b_attribute_w(uint8_t data) void vrt_vt1682_uio_device::device_start() { - m_porta_out.resolve_safe(); - m_porta_in.resolve_safe(0); - m_portb_out.resolve_safe(); - m_portb_in.resolve_safe(0); - save_item(NAME(m_2129_uio_a_data)); save_item(NAME(m_212a_uio_a_direction)); save_item(NAME(m_212b_uio_a_attribute)); diff --git a/src/mame/nmk/nmk004.cpp b/src/mame/nmk/nmk004.cpp index c60cd43a337..9e52b66afa0 100644 --- a/src/mame/nmk/nmk004.cpp +++ b/src/mame/nmk/nmk004.cpp @@ -101,8 +101,6 @@ nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, dev //------------------------------------------------- void nmk004_device::device_start() { - m_reset_cb.resolve_safe(); - save_item(NAME(to_main)); save_item(NAME(to_nmk004)); diff --git a/src/mame/nokia/mm1kb.cpp b/src/mame/nokia/mm1kb.cpp index 0f08c79ffa2..76345dfee74 100644 --- a/src/mame/nokia/mm1kb.cpp +++ b/src/mame/nokia/mm1kb.cpp @@ -218,9 +218,6 @@ mm1_keyboard_device::mm1_keyboard_device(const machine_config &mconfig, const ch void mm1_keyboard_device::device_start() { - // resolve callbacks - m_write_kbst.resolve_safe(); - // allocate timers m_scan_timer = timer_alloc(FUNC(mm1_keyboard_device::scan_keyboard), this); m_scan_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); diff --git a/src/mame/olivetti/m24_kbd.cpp b/src/mame/olivetti/m24_kbd.cpp index cb141da8be9..02d42a9d240 100644 --- a/src/mame/olivetti/m24_kbd.cpp +++ b/src/mame/olivetti/m24_kbd.cpp @@ -215,7 +215,6 @@ m24_keyboard_device::m24_keyboard_device(const machine_config &mconfig, const ch void m24_keyboard_device::device_start() { - m_out_data.resolve_safe(); m_out_data(1); m_reset_timer = timer_alloc(FUNC(m24_keyboard_device::reset_mcu), this); } diff --git a/src/mame/olivetti/m24_z8000.cpp b/src/mame/olivetti/m24_z8000.cpp index ea91fab297c..02218fbecc7 100644 --- a/src/mame/olivetti/m24_z8000.cpp +++ b/src/mame/olivetti/m24_z8000.cpp @@ -17,7 +17,6 @@ m24_z8000_device::m24_z8000_device(const machine_config &mconfig, const char *ta void m24_z8000_device::device_start() { - m_halt_out.resolve_safe(); } void m24_z8000_device::device_reset() diff --git a/src/mame/pc/europc_kbd.cpp b/src/mame/pc/europc_kbd.cpp index a7c42bfd3b4..5624dd7823f 100644 --- a/src/mame/pc/europc_kbd.cpp +++ b/src/mame/pc/europc_kbd.cpp @@ -49,9 +49,6 @@ europc_keyboard_device::europc_keyboard_device(const machine_config &mconfig, co void europc_keyboard_device::device_resolve_objects() { - m_kbdata_callback.resolve_safe(); - m_kbclk_callback.resolve_safe(); - m_reset_callback.resolve_safe(); m_leds.resolve(); } diff --git a/src/mame/pc/nforcepc.cpp b/src/mame/pc/nforcepc.cpp index 66f8e36b6a9..668bce37e53 100644 --- a/src/mame/pc/nforcepc.cpp +++ b/src/mame/pc/nforcepc.cpp @@ -409,14 +409,6 @@ it8703f_device::it8703f_device(const machine_config &mconfig, const char *tag, d void it8703f_device::device_start() { - pin_reset_callback.resolve_safe(); - pin_gatea20_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 it8703f_device::internal_memory_map(address_map &map) diff --git a/src/mame/philips/cdicdic.cpp b/src/mame/philips/cdicdic.cpp index 06f9290127b..8b440e7e472 100644 --- a/src/mame/philips/cdicdic.cpp +++ b/src/mame/philips/cdicdic.cpp @@ -1479,17 +1479,6 @@ cdicdic_device::cdicdic_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 cdicdic_device::device_resolve_objects() -{ - m_intreq_callback.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/philips/cdicdic.h b/src/mame/philips/cdicdic.h index 46d7816122c..12522857413 100644 --- a/src/mame/philips/cdicdic.h +++ b/src/mame/philips/cdicdic.h @@ -60,8 +60,7 @@ public: uint8_t intack_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/mame/philips/cdislavehle.cpp b/src/mame/philips/cdislavehle.cpp index 104b01ea4b5..e63ef61ce6d 100644 --- a/src/mame/philips/cdislavehle.cpp +++ b/src/mame/philips/cdislavehle.cpp @@ -386,28 +386,14 @@ void cdislave_hle_device::slave_w(offs_t offset, uint16_t data) cdislave_hle_device::cdislave_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDI_SLAVE_HLE, tag, owner, clock) , m_int_callback(*this) - , m_read_mousex(*this) - , m_read_mousey(*this) - , m_read_mousebtn(*this) + , m_read_mousex(*this, 0x0000) + , m_read_mousey(*this, 0x0000) + , m_read_mousebtn(*this, 0x00) , m_dmadac(*this, ":dac%u", 1U) { } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void cdislave_hle_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); - m_read_mousex.resolve_safe(0x0000); - m_read_mousey.resolve_safe(0x0000); - m_read_mousebtn.resolve_safe(0x00); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/philips/cdislavehle.h b/src/mame/philips/cdislavehle.h index 6b6f242be6f..3e80d0de5f4 100644 --- a/src/mame/philips/cdislavehle.h +++ b/src/mame/philips/cdislavehle.h @@ -45,8 +45,7 @@ public: void slave_w(offs_t offset, uint16_t 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/mame/philips/mcd212.cpp b/src/mame/philips/mcd212.cpp index 3aa73d199b0..441d4a39f20 100644 --- a/src/mame/philips/mcd212.cpp +++ b/src/mame/philips/mcd212.cpp @@ -1421,17 +1421,6 @@ mcd212_device::mcd212_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 mcd212_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/philips/mcd212.h b/src/mame/philips/mcd212.h index 133df44e659..48c22318f2c 100644 --- a/src/mame/philips/mcd212.h +++ b/src/mame/philips/mcd212.h @@ -55,8 +55,7 @@ public: int rom_dtack_cycle_count(); 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/mame/pinball/by35.cpp b/src/mame/pinball/by35.cpp index 5109c261295..c8c4c5bf039 100644 --- a/src/mame/pinball/by35.cpp +++ b/src/mame/pinball/by35.cpp @@ -1125,10 +1125,7 @@ void by35_state::u10_cb2_w(int state) void by35_state::u11_cb2_w(int state) { // Handle sound - if (!m_sound_int_handler.isnull()) - { - m_sound_int_handler(state); - } + m_sound_int_handler(state); m_u11_cb2 = state; } @@ -1259,11 +1256,8 @@ void by35_state::u11_a_w(uint8_t data) } // Handle sound - if (!m_sound_select_handler.isnull()) - { - int sound = (m_u11b & 0x0f) | ((data & 0x02) << 3); - m_sound_select_handler(sound); - } + const int sound = (m_u11b & 0x0f) | ((data & 0x02) << 3); + m_sound_select_handler(sound); m_u11a = data; } @@ -1341,11 +1335,8 @@ void by35_state::u11_b_w(uint8_t data) } // Handle sound - if (!m_sound_select_handler.isnull()) - { - int sound = (data & 0x0f) | ((m_u11a & 0x02) << 3); - m_sound_select_handler(sound); - } + const int sound = (data & 0x0f) | ((m_u11a & 0x02) << 3); + m_sound_select_handler(sound); m_u11b = data; } @@ -1462,8 +1453,6 @@ void by35_state::machine_start() m_lamps.resolve(); m_digits.resolve(); m_solenoids.resolve(); - m_sound_select_handler.resolve(); - m_sound_int_handler.resolve(); save_item(NAME(m_u10a)); save_item(NAME(m_u10b)); diff --git a/src/mame/pinball/byvid.cpp b/src/mame/pinball/byvid.cpp index 7c683d59074..2a84f0f30dc 100644 --- a/src/mame/pinball/byvid.cpp +++ b/src/mame/pinball/byvid.cpp @@ -738,8 +738,6 @@ TIMER_DEVICE_CALLBACK_MEMBER( by133_state::u11_timer ) void by133_state::machine_start() { genpin_class::machine_start(); - m_sound_select_handler.resolve(); - m_sound_int_handler.resolve(); m_io_outputs.resolve(); save_item(NAME(m_mpu_to_vid)); diff --git a/src/mame/pinball/decopincpu.cpp b/src/mame/pinball/decopincpu.cpp index 5a018f684a6..e3dceadfd31 100644 --- a/src/mame/pinball/decopincpu.cpp +++ b/src/mame/pinball/decopincpu.cpp @@ -268,11 +268,11 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device , m_pia34(*this, "pia34") , m_rom(*this, finder_base::DUMMY_TAG) , m_diags(*this, "DIAGS") - , m_read_display(*this) + , m_read_display(*this, 0) , m_write_display(*this) - , m_read_dmdstatus(*this) + , m_read_dmdstatus(*this, 0) , m_write_soundlatch(*this) - , m_read_switch(*this) + , m_read_switch(*this, 0) , m_write_switch(*this) , m_write_lamp(*this) , m_write_solenoid(*this) @@ -282,16 +282,6 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device void decocpu_type1_device::device_start() { - // resolve callbacks - m_read_display.resolve_safe(0); - m_write_display.resolve_safe(); - m_read_dmdstatus.resolve_safe(0); - m_write_soundlatch.resolve_safe(); - m_read_switch.resolve_safe(0); - m_write_switch.resolve_safe(); - m_write_lamp.resolve_safe(); - m_write_solenoid.resolve_safe(); - m_irq_timer = timer_alloc(FUNC(decocpu_type1_device::irq_trigger), this); m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES, E_CLOCK), 1); m_irq_active = false; diff --git a/src/mame/pinball/pinsnd88.cpp b/src/mame/pinball/pinsnd88.cpp index 55db48109c3..bcd66da5c40 100644 --- a/src/mame/pinball/pinsnd88.cpp +++ b/src/mame/pinball/pinsnd88.cpp @@ -226,9 +226,6 @@ void pinsnd88_device::device_start() m_cpubank->configure_entries(0, 8, &rom[0x0], 0x8000); m_cpubank->set_entry(0); - /* resolve lines */ - m_syncq_cb.resolve_safe(); - /* timer */ m_sync_timer = timer_alloc(FUNC(pinsnd88_device::sync_callback), this); m_sync_timer->adjust(attotime::never); diff --git a/src/mame/pinball/wpc.cpp b/src/mame/pinball/wpc.cpp index d8f3a80a6c2..fe0e0366d9d 100644 --- a/src/mame/pinball/wpc.cpp +++ b/src/mame/pinball/wpc.cpp @@ -22,9 +22,9 @@ wpc_device::wpc_device(const machine_config &mconfig, const char *tag, device_t m_dmd_visiblepage(0), m_irq_cb(*this), m_firq_cb(*this), - m_sounddata_r(*this), + m_sounddata_r(*this, 0), m_sounddata_w(*this), - m_soundctrl_r(*this), + m_soundctrl_r(*this, 0), m_soundctrl_w(*this), m_sounds11_w(*this), m_bank_w(*this), @@ -36,17 +36,6 @@ wpc_device::wpc_device(const machine_config &mconfig, const char *tag, device_t void wpc_device::device_start() { - // resolve callbacks - m_irq_cb.resolve_safe(); - m_firq_cb.resolve_safe(); - m_sounddata_r.resolve_safe(0); - m_sounddata_w.resolve_safe(); - m_soundctrl_r.resolve_safe(0); - m_soundctrl_w.resolve_safe(); - m_sounds11_w.resolve_safe(); - m_bank_w.resolve_safe(); - m_dmdbank_w.resolve_safe(); - m_zc_timer = timer_alloc(FUNC(wpc_device::zerocross_set), this); m_zc_timer->adjust(attotime::from_hz(120),0,attotime::from_hz(120)); } diff --git a/src/mame/pinball/wpc_dmd.cpp b/src/mame/pinball/wpc_dmd.cpp index ce304b8629e..dec9dd57e18 100644 --- a/src/mame/pinball/wpc_dmd.cpp +++ b/src/mame/pinball/wpc_dmd.cpp @@ -49,8 +49,6 @@ void wpc_dmd_device::device_add_mconfig(machine_config &config) void wpc_dmd_device::device_start() { - scanline_cb.resolve_safe(); - ram.resize(0x2000); screen_buffer.resize(128*32); bitcounts.resize(256); diff --git a/src/mame/pinball/wpcsnd.cpp b/src/mame/pinball/wpcsnd.cpp index ce92abd415f..00c09d9f61e 100644 --- a/src/mame/pinball/wpcsnd.cpp +++ b/src/mame/pinball/wpcsnd.cpp @@ -119,8 +119,6 @@ void wpcsnd_device::device_add_mconfig(machine_config &config) void wpcsnd_device::device_start() { - // resolve callback - m_reply_cb.resolve_safe(); // save states save_item(NAME(m_latch)); save_item(NAME(m_reply)); diff --git a/src/mame/regnecentralen/rc759_kbd.cpp b/src/mame/regnecentralen/rc759_kbd.cpp index 4eb5b44e037..3ff2747cb38 100644 --- a/src/mame/regnecentralen/rc759_kbd.cpp +++ b/src/mame/regnecentralen/rc759_kbd.cpp @@ -164,9 +164,6 @@ rc759_kbd_hle_device::rc759_kbd_hle_device(const machine_config &mconfig, const void rc759_kbd_hle_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - // register for save states save_item(NAME(m_data)); save_item(NAME(m_enabled)); diff --git a/src/mame/roland/mb62h195.cpp b/src/mame/roland/mb62h195.cpp index 7e8a0671c34..c7b40dc43ea 100644 --- a/src/mame/roland/mb62h195.cpp +++ b/src/mame/roland/mb62h195.cpp @@ -34,39 +34,19 @@ DEFINE_DEVICE_TYPE(MB62H195, mb62h195_device, "mb62h195", "Roland MB62H195 I/O") mb62h195_device::mb62h195_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MB62H195, tag, owner, clock) , m_lc_callback(*this) - , m_r_callback(*this) + , m_r_callback(*this, 0xff) , m_t_callback(*this) , m_da_callback(*this) , m_dc_callback(*this) , m_sout_callback(*this) , m_sck_callback(*this) - , m_sin_callback(*this) + , m_sin_callback(*this, 1) , m_adc_callback(*this) { } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void mb62h195_device::device_resolve_objects() -{ - m_lc_callback.resolve_safe(); - m_r_callback.resolve_safe(0xff); - m_t_callback.resolve_safe(); - m_da_callback.resolve_safe(); - m_dc_callback.resolve_safe(); - m_sout_callback.resolve_safe(); - m_sck_callback.resolve_safe(); - m_sin_callback.resolve_safe(1); - m_adc_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/roland/mb62h195.h b/src/mame/roland/mb62h195.h index 186fa9c066f..9970ce4817d 100644 --- a/src/mame/roland/mb62h195.h +++ b/src/mame/roland/mb62h195.h @@ -36,8 +36,8 @@ public: // CPU read/write handlers (TODO) - // device-specific overrides - virtual void device_resolve_objects() override; +protected: + // device_t implementation virtual void device_start() override; private: diff --git a/src/mame/roland/mb63h149.cpp b/src/mame/roland/mb63h149.cpp index 27d80525c4f..ad6486bca9a 100644 --- a/src/mame/roland/mb63h149.cpp +++ b/src/mame/roland/mb63h149.cpp @@ -58,18 +58,6 @@ mb63h130_device::mb63h130_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 mb63h149_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/roland/mb63h149.h b/src/mame/roland/mb63h149.h index 4d9a31f9cba..6a651d5d583 100644 --- a/src/mame/roland/mb63h149.h +++ b/src/mame/roland/mb63h149.h @@ -33,8 +33,7 @@ public: protected: mb63h149_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // 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/mame/roland/mb87013.cpp b/src/mame/roland/mb87013.cpp index 28f12926beb..111f7a423c9 100644 --- a/src/mame/roland/mb87013.cpp +++ b/src/mame/roland/mb87013.cpp @@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE(MB87013, mb87013_device, "mb87013", "Roland MB87013 QDC") mb87013_device::mb87013_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MB87013, tag, owner, clock) - , m_sio_rd_callback(*this) + , m_sio_rd_callback(*this, 0) , m_sio_wr_callback(*this) , m_txc_callback(*this) , m_rxc_callback(*this) @@ -46,24 +46,6 @@ mb87013_device::mb87013_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 mb87013_device::device_resolve_objects() -{ - m_sio_rd_callback.resolve_safe(0); - m_sio_wr_callback.resolve_safe(); - m_txc_callback.resolve_safe(); - m_rxc_callback.resolve_safe(); - m_rxd_callback.resolve_safe(); - m_dsr_callback.resolve_safe(); - m_op4_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/roland/mb87013.h b/src/mame/roland/mb87013.h index 1afd7af7658..9f37dd51061 100644 --- a/src/mame/roland/mb87013.h +++ b/src/mame/roland/mb87013.h @@ -67,8 +67,7 @@ public: void rts_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/mame/roland/sa16.cpp b/src/mame/roland/sa16.cpp index 11e428b4b90..d866acf96b0 100644 --- a/src/mame/roland/sa16.cpp +++ b/src/mame/roland/sa16.cpp @@ -64,19 +64,6 @@ sa16_device::sa16_device(const machine_config &mconfig, const char *tag, device_ //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void sa16_base_device::device_resolve_objects() -{ - m_int_callback.resolve_safe(); - m_sh_callback.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/roland/sa16.h b/src/mame/roland/sa16.h index aadeb2facd9..26f9798ebbd 100644 --- a/src/mame/roland/sa16.h +++ b/src/mame/roland/sa16.h @@ -32,8 +32,7 @@ protected: // base type constructor sa16_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // 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/mame/sanyo/mbc55x_kbd.cpp b/src/mame/sanyo/mbc55x_kbd.cpp index a3c56f46417..201ff87210c 100644 --- a/src/mame/sanyo/mbc55x_kbd.cpp +++ b/src/mame/sanyo/mbc55x_kbd.cpp @@ -176,11 +176,6 @@ ioport_constructor mbc55x_keyboard_device::device_input_ports() const // INITIALIZATION AND HLE SERIAL INTERFACE //************************************************************************** -void mbc55x_keyboard_device::device_resolve_objects() -{ - m_txd_callback.resolve_safe(); -} - void mbc55x_keyboard_device::device_start() { set_tra_rate(1230); // more or less diff --git a/src/mame/sanyo/mbc55x_kbd.h b/src/mame/sanyo/mbc55x_kbd.h index 914ff8f350c..4574680f97a 100644 --- a/src/mame/sanyo/mbc55x_kbd.h +++ b/src/mame/sanyo/mbc55x_kbd.h @@ -31,20 +31,19 @@ public: auto txd_callback() { return m_txd_callback.bind(); } protected: - // device-level overrides + // device_t implementation virtual ioport_constructor device_input_ports() 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; virtual const tiny_rom_entry *device_rom_region() const override; - // device_matrix_keyboard_interface overrides + // device_matrix_keyboard_interface implementation virtual void key_make(u8 row, u8 column) override; virtual void key_repeat(u8 row, u8 column) override; virtual void scan_complete() override; - // device_serial_interface overrides; + // device_serial_interface implementation virtual void tra_callback() override; virtual void tra_complete() override; diff --git a/src/mame/sega/315_5195.cpp b/src/mame/sega/315_5195.cpp index 21778a618ef..09579635e84 100644 --- a/src/mame/sega/315_5195.cpp +++ b/src/mame/sega/315_5195.cpp @@ -203,7 +203,7 @@ u8 sega_315_5195_mapper_device::read(address_space &space, offs_t offset) case 0x03: // this returns data that the sound CPU writes - if (!m_mcu_int_callback.isnull() && !machine().side_effects_disabled()) + if (!machine().side_effects_disabled()) m_mcu_int_callback(CLEAR_LINE); return m_from_sound; @@ -367,8 +367,7 @@ void sega_315_5195_mapper_device::fd1094_state_change(u8 state) TIMER_CALLBACK_MEMBER(sega_315_5195_mapper_device::write_to_sound) { m_to_sound = param; - if (!m_pbf_callback.isnull()) - m_pbf_callback(ASSERT_LINE); + m_pbf_callback(ASSERT_LINE); } @@ -380,8 +379,7 @@ TIMER_CALLBACK_MEMBER(sega_315_5195_mapper_device::write_to_sound) TIMER_CALLBACK_MEMBER(sega_315_5195_mapper_device::write_from_sound) { m_from_sound = param; - if (!m_mcu_int_callback.isnull()) - m_mcu_int_callback(ASSERT_LINE); + m_mcu_int_callback(ASSERT_LINE); } @@ -391,7 +389,7 @@ TIMER_CALLBACK_MEMBER(sega_315_5195_mapper_device::write_from_sound) u8 sega_315_5195_mapper_device::pread() { - if (!m_pbf_callback.isnull() && !machine().side_effects_disabled()) + if (!machine().side_effects_disabled()) m_pbf_callback(CLEAR_LINE); return m_to_sound; } @@ -413,10 +411,8 @@ void sega_315_5195_mapper_device::pwrite(u8 data) void sega_315_5195_mapper_device::device_start() { - // bind our handlers + // bind delegates m_mapper.resolve(); - m_pbf_callback.resolve(); - m_mcu_int_callback.resolve(); // if we are mapping an FD1089, tell all the banks fd1089_base_device *fd1089 = dynamic_cast<fd1089_base_device *>(m_cpu.target()); @@ -465,10 +461,8 @@ void sega_315_5195_mapper_device::device_reset() m_to_sound = 0; m_from_sound = 0; - if (!m_pbf_callback.isnull()) - m_pbf_callback(CLEAR_LINE); - if (!m_mcu_int_callback.isnull()) - m_mcu_int_callback(CLEAR_LINE); + m_pbf_callback(CLEAR_LINE); + m_mcu_int_callback(CLEAR_LINE); } diff --git a/src/mame/sega/315_5296.cpp b/src/mame/sega/315_5296.cpp index 532147ccfbb..f508a40bcd4 100644 --- a/src/mame/sega/315_5296.cpp +++ b/src/mame/sega/315_5296.cpp @@ -35,7 +35,7 @@ DEFINE_DEVICE_TYPE(SEGA_315_5296, sega_315_5296_device, "315_5296", "Sega 315-52 sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SEGA_315_5296, tag, owner, clock), - m_in_port_cb(*this), + m_in_port_cb(*this, 0xff), m_out_port_cb(*this), m_out_cnt_cb(*this), m_dir_override(0xff) @@ -48,11 +48,6 @@ sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const void sega_315_5296_device::device_start() { - // resolve callbacks - m_in_port_cb.resolve_all_safe(0xff); - m_out_port_cb.resolve_all_safe(); - m_out_cnt_cb.resolve_all_safe(); - // register for savestates save_item(NAME(m_output_latch)); save_item(NAME(m_cnt)); diff --git a/src/mame/sega/315_5338a.cpp b/src/mame/sega/315_5338a.cpp index 7a70f19b29e..f07220ced39 100644 --- a/src/mame/sega/315_5338a.cpp +++ b/src/mame/sega/315_5338a.cpp @@ -32,8 +32,8 @@ DEFINE_DEVICE_TYPE(SEGA_315_5338A, sega_315_5338a_device, "315_5338a", "Sega 315 sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5338A, tag, owner, clock), - m_read_cb(*this), m_write_cb(*this), - m_in_port_cb(*this), + m_read_cb(*this, 0xff), m_write_cb(*this), + m_in_port_cb(*this, 0xff), m_out_port_cb(*this), m_port_config(0), m_serial_output(0), m_address(0) { @@ -46,12 +46,6 @@ sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, cons void sega_315_5338a_device::device_start() { - // resolve callbacks - m_read_cb.resolve_safe(0xff); - m_write_cb.resolve_safe(); - m_in_port_cb.resolve_all_safe(0xff); - m_out_port_cb.resolve_all_safe(); - // register for save states save_pointer(NAME(m_port_value), 7); save_item(NAME(m_port_config)); diff --git a/src/mame/sega/315_5649.cpp b/src/mame/sega/315_5649.cpp index 42331720431..e9a1167e789 100644 --- a/src/mame/sega/315_5649.cpp +++ b/src/mame/sega/315_5649.cpp @@ -32,12 +32,12 @@ DEFINE_DEVICE_TYPE(SEGA_315_5649, sega_315_5649_device, "315_5649", "Sega 315-56 sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_315_5649, tag, owner, clock), - m_in_port_cb(*this), + m_in_port_cb(*this, 0xff), m_out_port_cb(*this), - m_an_port_cb(*this), - m_serial_rd_cb(*this), + m_an_port_cb(*this, 0xff), + m_serial_rd_cb(*this, 0), m_serial_wr_cb(*this), - m_cnt_cb(*this), + m_cnt_cb(*this, 0), m_port_config(0), m_mode(0), m_analog_channel(0) @@ -51,17 +51,6 @@ sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const void sega_315_5649_device::device_start() { - // resolve callbacks - m_in_port_cb.resolve_all_safe(0xff); - m_out_port_cb.resolve_all_safe(); - - m_an_port_cb.resolve_all_safe(0xff); - - m_serial_rd_cb.resolve_all_safe(0); - m_serial_wr_cb.resolve_all_safe(); - - m_cnt_cb.resolve_all_safe(0); - // register for save states save_pointer(NAME(m_port_value), 7); save_item(NAME(m_port_config)); diff --git a/src/mame/sega/dc_g2if.cpp b/src/mame/sega/dc_g2if.cpp index 9929a2844fc..ecda409b74a 100644 --- a/src/mame/sega/dc_g2if.cpp +++ b/src/mame/sega/dc_g2if.cpp @@ -77,10 +77,6 @@ void dc_g2if_device::device_start() m_dma[i].end_timer = timer_alloc(FUNC(dc_g2if_device::dma_end_tick), this); } - m_int_w.resolve(); - m_error_ia_w.resolve(); - m_error_ov_w.resolve(); - save_item(STRUCT_MEMBER(m_dma, g2_addr)); save_item(STRUCT_MEMBER(m_dma, root_addr)); save_item(STRUCT_MEMBER(m_dma, len)); diff --git a/src/mame/sega/dsbz80.cpp b/src/mame/sega/dsbz80.cpp index 0be589234ae..a9fe21a8c20 100644 --- a/src/mame/sega/dsbz80.cpp +++ b/src/mame/sega/dsbz80.cpp @@ -82,7 +82,6 @@ dsbz80_device::dsbz80_device(const machine_config &mconfig, const char *tag, dev void dsbz80_device::device_start() { - m_rxd_handler.resolve_safe(); uint8_t *rom_base = machine().root_device().memregion("mpeg")->base(); decoder = new mpeg_audio(rom_base, mpeg_audio::L2, false, 0); stream_alloc(0, 2, 32000); diff --git a/src/mame/sega/maple-dc.cpp b/src/mame/sega/maple-dc.cpp index 47e44386efd..a6dc7e004e3 100644 --- a/src/mame/sega/maple-dc.cpp +++ b/src/mame/sega/maple-dc.cpp @@ -39,7 +39,6 @@ void maple_dc_device::device_start() { logerror("maple_dc_device started\n"); timer = timer_alloc(FUNC(maple_dc_device::dma_timer_tick), this); - irq_cb.resolve_safe(); mdstar = 0; diff --git a/src/mame/sega/mdioport.cpp b/src/mame/sega/mdioport.cpp index f7439d93669..3dc1a239f8d 100644 --- a/src/mame/sega/mdioport.cpp +++ b/src/mame/sega/mdioport.cpp @@ -111,7 +111,6 @@ void megadrive_io_port_device_base::device_resolve_objects() m_in_callback.resolve(); m_out_callback.resolve(); - m_hl_callback.resolve_safe(); } diff --git a/src/mame/sega/model1io.cpp b/src/mame/sega/model1io.cpp index 731f31b0df9..7d06f1fea42 100644 --- a/src/mame/sega/model1io.cpp +++ b/src/mame/sega/model1io.cpp @@ -168,10 +168,10 @@ model1io_device::model1io_device(const machine_config &mconfig, const char *tag, m_eeprom(*this, "eeprom"), m_buttons(*this, "buttons"), m_dsw(*this, "dsw%u", 1U), - m_read_cb(*this), m_write_cb(*this), - m_in_cb(*this), - m_drive_read_cb(*this), m_drive_write_cb(*this), - m_an_cb(*this), + m_read_cb(*this, 0xff), m_write_cb(*this), + m_in_cb(*this, 0xff), + m_drive_read_cb(*this, 0xff), m_drive_write_cb(*this), + m_an_cb(*this, 0xff), m_output_cb(*this), m_secondary_controls(false) { @@ -183,15 +183,6 @@ model1io_device::model1io_device(const machine_config &mconfig, const char *tag, void model1io_device::device_start() { - // resolve callbacks - m_read_cb.resolve_safe(0xff); - m_write_cb.resolve_safe(); - m_in_cb.resolve_all_safe(0xff); - m_drive_read_cb.resolve_safe(0xff); - m_drive_write_cb.resolve_safe(); - m_an_cb.resolve_all_safe(0xff); - m_output_cb.resolve_safe(); - // register for save states save_item(NAME(m_secondary_controls)); } diff --git a/src/mame/sega/model1io2.cpp b/src/mame/sega/model1io2.cpp index 334c27c5f79..8b196599e84 100644 --- a/src/mame/sega/model1io2.cpp +++ b/src/mame/sega/model1io2.cpp @@ -220,10 +220,10 @@ model1io2_device::model1io2_device(const machine_config &mconfig, const char *ta m_lcd(*this, "lcd"), m_led_comm_err(*this, "led_comm_err"), m_lightgun_ports(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG}), - m_read_cb(*this), m_write_cb(*this), - m_in_cb(*this), - m_drive_read_cb(*this), m_drive_write_cb(*this), - m_an_cb(*this), + m_read_cb(*this, 0xff), m_write_cb(*this), + m_in_cb(*this, 0xff), + m_drive_read_cb(*this, 0xff), m_drive_write_cb(*this), + m_an_cb(*this, 0xff), m_output_cb(*this), m_secondary_controls(false), m_lcd_data(0), @@ -237,17 +237,9 @@ model1io2_device::model1io2_device(const machine_config &mconfig, const char *ta void model1io2_device::device_start() { - // resolve callbacks + // resolve outputs m_led_comm_err.resolve(); - m_read_cb.resolve_safe(0xff); - m_write_cb.resolve_safe(); - m_in_cb.resolve_all_safe(0xff); - m_drive_read_cb.resolve_safe(0xff); - m_drive_write_cb.resolve_safe(); - m_an_cb.resolve_all_safe(0xff); - m_output_cb.resolve_safe(); - // register for save states save_item(NAME(m_secondary_controls)); save_item(NAME(m_lcd_data)); diff --git a/src/mame/sega/naomig1.cpp b/src/mame/sega/naomig1.cpp index 059339e08ed..7b6f28af1a5 100644 --- a/src/mame/sega/naomig1.cpp +++ b/src/mame/sega/naomig1.cpp @@ -37,9 +37,6 @@ naomi_g1_device::naomi_g1_device(const machine_config &mconfig, device_type type void naomi_g1_device::device_start() { timer = timer_alloc(FUNC(naomi_g1_device::trigger_gdrom_irq), this); - irq_cb.resolve_safe(); - ext_irq_cb.resolve_safe(); - reset_out_cb.resolve_safe(); save_item(NAME(gdstar)); save_item(NAME(gdlen)); diff --git a/src/mame/sega/naomigd.cpp b/src/mame/sega/naomigd.cpp index 9b0be2c4c08..b92ae9f28b7 100644 --- a/src/mame/sega/naomigd.cpp +++ b/src/mame/sega/naomigd.cpp @@ -410,7 +410,6 @@ idegdrom_device::idegdrom_device(const machine_config &mconfig, const char *tag, void idegdrom_device::device_start() { pci_device::device_start(); - irq_cb.resolve_safe(); add_map(0x00000020, M_IO, FUNC(idegdrom_device::map_command)); bank_infos[0].adr = 0x01c0; // pci system does not support base addresses not multiples of size diff --git a/src/mame/sega/powervr2.cpp b/src/mame/sega/powervr2.cpp index 01e18e8bc9d..88ad0e0c5fb 100644 --- a/src/mame/sega/powervr2.cpp +++ b/src/mame/sega/powervr2.cpp @@ -3912,8 +3912,6 @@ powervr2_device::powervr2_device(const machine_config &mconfig, const char *tag, void powervr2_device::device_start() { - irq_cb.resolve_safe(); - grab = std::make_unique<receiveddata[]>(NUM_BUFFERS); pvr_build_parameterconfig(); diff --git a/src/mame/sega/segaic16_m.cpp b/src/mame/sega/segaic16_m.cpp index 63b3c89db97..341084c4547 100644 --- a/src/mame/sega/segaic16_m.cpp +++ b/src/mame/sega/segaic16_m.cpp @@ -280,8 +280,7 @@ void sega_315_5250_compare_timer_device::exck_w(int state) // regardless of the enable, a value of 0xfff will generate the IRQ if (old_counter == 0xfff) { - if (!m_68kint_callback.isnull()) - m_68kint_callback(ASSERT_LINE); + m_68kint_callback(ASSERT_LINE); m_counter = m_regs[8] & 0xfff; } } @@ -293,8 +292,7 @@ void sega_315_5250_compare_timer_device::exck_w(int state) void sega_315_5250_compare_timer_device::interrupt_ack() { - if (!m_68kint_callback.isnull()) - m_68kint_callback(CLEAR_LINE); + m_68kint_callback(CLEAR_LINE); } @@ -356,10 +354,6 @@ void sega_315_5250_compare_timer_device::write(offs_t offset, u16 data, u16 mem_ void sega_315_5250_compare_timer_device::device_start() { - // bind our handlers - m_68kint_callback.resolve(); - m_zint_callback.resolve(); - // save states save_item(NAME(m_regs)); save_item(NAME(m_counter)); @@ -379,8 +373,7 @@ void sega_315_5250_compare_timer_device::device_reset() m_bit = 0; interrupt_ack(); - if (!m_zint_callback.isnull()) - m_zint_callback(CLEAR_LINE); + m_zint_callback(CLEAR_LINE); } @@ -391,8 +384,7 @@ void sega_315_5250_compare_timer_device::device_reset() TIMER_CALLBACK_MEMBER(sega_315_5250_compare_timer_device::write_to_sound) { m_regs[11] = param; - if (!m_zint_callback.isnull()) - m_zint_callback(ASSERT_LINE); + m_zint_callback(ASSERT_LINE); } @@ -402,7 +394,7 @@ TIMER_CALLBACK_MEMBER(sega_315_5250_compare_timer_device::write_to_sound) u8 sega_315_5250_compare_timer_device::zread() { - if (!m_zint_callback.isnull() && !machine().side_effects_disabled()) + if (!machine().side_effects_disabled()) m_zint_callback(CLEAR_LINE); return m_regs[11]; diff --git a/src/mame/sega/segaic24.cpp b/src/mame/sega/segaic24.cpp index a6703442671..a39c95cfa6f 100644 --- a/src/mame/sega/segaic24.cpp +++ b/src/mame/sega/segaic24.cpp @@ -78,8 +78,6 @@ void segas24_tile_device::device_start() char_ram = std::make_unique<uint16_t[]>(0x80000/2); tile_ram = std::make_unique<uint16_t[]>(0x10000/2); - m_xhout_write_cb.resolve_safe(); - m_xvout_write_cb.resolve_safe(); tile_layer[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(segas24_tile_device::tile_info_0s)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); tile_layer[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(segas24_tile_device::tile_info_0w)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); diff --git a/src/mame/seibu/seibu_crtc.cpp b/src/mame/seibu/seibu_crtc.cpp index 4c882f63185..357c5ea6b04 100644 --- a/src/mame/seibu/seibu_crtc.cpp +++ b/src/mame/seibu/seibu_crtc.cpp @@ -245,20 +245,17 @@ void seibu_crtc_device::seibu_crtc_vregs(address_map &map) void seibu_crtc_device::decrypt_key_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - if (!m_decrypt_key_cb.isnull()) - m_decrypt_key_cb(0, data, mem_mask); + m_decrypt_key_cb(0, data, mem_mask); } void seibu_crtc_device::layer_en_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - if (!m_layer_en_cb.isnull()) - m_layer_en_cb(0,data,mem_mask); + m_layer_en_cb(0,data,mem_mask); } void seibu_crtc_device::layer_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - if (!m_layer_scroll_cb.isnull()) - m_layer_scroll_cb(offset,data,mem_mask); + m_layer_scroll_cb(offset,data,mem_mask); } uint16_t seibu_crtc_device::reg_1a_r() @@ -270,14 +267,12 @@ uint16_t seibu_crtc_device::reg_1a_r() void seibu_crtc_device::reg_1a_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_reg_1a); - if (!m_reg_1a_cb.isnull()) - m_reg_1a_cb(offset,data,mem_mask); + m_reg_1a_cb(offset,data,mem_mask); } void seibu_crtc_device::layer_scroll_base_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - if (!m_layer_scroll_base_cb.isnull()) - m_layer_scroll_base_cb(offset,data,mem_mask); + m_layer_scroll_base_cb(offset,data,mem_mask); } //************************************************************************** @@ -317,12 +312,6 @@ void seibu_crtc_device::device_validity_check(validity_checker &valid) const void seibu_crtc_device::device_start() { - m_decrypt_key_cb.resolve(); - m_layer_en_cb.resolve(); - m_layer_scroll_cb.resolve(); - m_reg_1a_cb.resolve(); - m_layer_scroll_base_cb.resolve(); - save_item(NAME(m_reg_1a)); } diff --git a/src/mame/seibu/seibucop.cpp b/src/mame/seibu/seibucop.cpp index 3058411c16c..bf8788c2edc 100644 --- a/src/mame/seibu/seibucop.cpp +++ b/src/mame/seibu/seibucop.cpp @@ -286,9 +286,6 @@ void raiden2cop_device::device_start() save_item(NAME(m_LEGACY_r0)); save_item(NAME(m_LEGACY_r1)); - m_videoramout_cb.resolve_safe(); - m_paletteramout_cb.resolve_safe(); - m_host_space = &m_host_cpu->space(AS_PROGRAM); m_host_endian = m_host_space->endianness() == ENDIANNESS_BIG; // m_cpu_is_68k diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index 16c60bf57e0..dd343664033 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -740,7 +740,6 @@ void funcube_touchscreen_device::device_start() m_button_state = 0x00; emu_timer *tm = timer_alloc(FUNC(funcube_touchscreen_device::read_buttons), this); tm->adjust(attotime::from_ticks(1, clock()), 0, attotime::from_ticks(1, clock())); - m_tx_cb.resolve_safe(); save_item(NAME(m_button_state)); save_item(NAME(m_serial_pos)); diff --git a/src/mame/sgi/hpc3.cpp b/src/mame/sgi/hpc3.cpp index 868b7a6f378..a72ea9603ef 100644 --- a/src/mame/sgi/hpc3.cpp +++ b/src/mame/sgi/hpc3.cpp @@ -42,14 +42,14 @@ hpc3_device::hpc3_device(const machine_config &mconfig, const char *tag, device_ , m_hal2(*this, finder_base::DUMMY_TAG) , m_enet(*this, finder_base::DUMMY_TAG) , m_enet_intr_out_cb(*this) - , m_hd_rd_cb(*this) + , m_hd_rd_cb(*this, 0) , m_hd_wr_cb(*this) - , m_hd_dma_rd_cb(*this) + , m_hd_dma_rd_cb(*this, 0) , m_hd_dma_wr_cb(*this) , m_hd_reset_cb(*this) - , m_bbram_rd_cb(*this) + , m_bbram_rd_cb(*this, 0) , m_bbram_wr_cb(*this) - , m_eeprom_dati_cb(*this) + , m_eeprom_dati_cb(*this, 0) , m_eeprom_dato_cb(*this) , m_eeprom_clk_cb(*this) , m_eeprom_cs_cb(*this) @@ -74,24 +74,6 @@ device_memory_interface::space_config_vector hpc3_device::memory_space_config() }; } -void hpc3_device::device_resolve_objects() -{ - m_enet_intr_out_cb.resolve_safe(); - m_hd_rd_cb.resolve_all(); - m_hd_wr_cb.resolve_all(); - m_hd_dma_rd_cb.resolve_all_safe(0); - m_hd_dma_wr_cb.resolve_all_safe(); - m_hd_reset_cb.resolve_all_safe(); - m_bbram_rd_cb.resolve_safe(0); - m_bbram_wr_cb.resolve_safe(); - m_eeprom_dati_cb.resolve_safe(0); - m_eeprom_dato_cb.resolve_safe(); - m_eeprom_clk_cb.resolve_safe(); - m_eeprom_cs_cb.resolve_safe(); - m_eeprom_pre_cb.resolve_safe(); - m_dma_complete_int_cb.resolve_safe(); -} - void hpc3_device::device_start() { for (uint32_t i = 0; i < 10; i++) @@ -692,7 +674,7 @@ template void hpc3_device::fifo_w<hpc3_device::FIFO_ENET_XMIT>(offs_t offset, ui template<uint32_t index> uint32_t hpc3_device::hd_r(offs_t offset, uint32_t mem_mask) { - if (ACCESSING_BITS_0_7 && !m_hd_rd_cb[index].isnull()) + if (ACCESSING_BITS_0_7 && !m_hd_rd_cb[index].isunset()) { const uint8_t ret = m_hd_rd_cb[index](offset); LOGMASKED(LOG_SCSI, "%s: SCSI%d Read %02x: %02x\n", machine().describe_context(), index, offset, ret); @@ -709,7 +691,7 @@ uint32_t hpc3_device::hd_r(offs_t offset, uint32_t mem_mask) template<uint32_t index> void hpc3_device::hd_w(offs_t offset, uint32_t data, uint32_t mem_mask) { - if (ACCESSING_BITS_0_7 && !m_hd_wr_cb[index].isnull()) + if (ACCESSING_BITS_0_7 && !m_hd_wr_cb[index].isunset()) { LOGMASKED(LOG_SCSI, "%s: SCSI%d Write %02x = %02x\n", machine().describe_context(), index, offset, (uint8_t)data); m_hd_wr_cb[index](offset, data & 0xff); diff --git a/src/mame/sgi/hpc3.h b/src/mame/sgi/hpc3.h index 5c37109357b..a0fac1cb4f8 100644 --- a/src/mame/sgi/hpc3.h +++ b/src/mame/sgi/hpc3.h @@ -68,7 +68,6 @@ public: void scsi1_drq(int state); protected: - virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/sgi/kbd.cpp b/src/mame/sgi/kbd.cpp index 7be81740fd7..9cd59afb8b0 100644 --- a/src/mame/sgi/kbd.cpp +++ b/src/mame/sgi/kbd.cpp @@ -63,11 +63,6 @@ void sgi_kbd_port_device::device_config_complete() m_kbd = get_card_device(); } -void sgi_kbd_port_device::device_resolve_objects() -{ - m_rxd_handler.resolve_safe(); -} - void sgi_kbd_port_device::device_start() { m_rxd_handler(1); diff --git a/src/mame/sgi/kbd.h b/src/mame/sgi/kbd.h index 917d4527a0b..b447e70eca2 100644 --- a/src/mame/sgi/kbd.h +++ b/src/mame/sgi/kbd.h @@ -34,7 +34,6 @@ public: protected: virtual void device_config_complete() override; - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/mame/sgi/mace.cpp b/src/mame/sgi/mace.cpp index 52d3bb5abd3..f2c2ab09f8d 100644 --- a/src/mame/sgi/mace.cpp +++ b/src/mame/sgi/mace.cpp @@ -55,17 +55,11 @@ DEFINE_DEVICE_TYPE(SGI_MACE, mace_device, "sgimace", "SGI MACE") mace_device::mace_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SGI_MACE, tag, owner, clock) , m_maincpu(*this, finder_base::DUMMY_TAG) - , m_rtc_read_callback(*this) + , m_rtc_read_callback(*this, 0) , m_rtc_write_callback(*this) { } -void mace_device::device_resolve_objects() -{ - m_rtc_read_callback.resolve_safe(0); - m_rtc_write_callback.resolve_safe(); -} - void mace_device::device_start() { save_item(NAME(m_isa.m_ringbase_reset)); diff --git a/src/mame/sgi/mace.h b/src/mame/sgi/mace.h index ece7422551d..691d1ac3a95 100644 --- a/src/mame/sgi/mace.h +++ b/src/mame/sgi/mace.h @@ -31,7 +31,6 @@ public: void map(address_map &map); protected: - 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; diff --git a/src/mame/sgi/sgi.cpp b/src/mame/sgi/sgi.cpp index 3574fcd5da9..d0042677145 100644 --- a/src/mame/sgi/sgi.cpp +++ b/src/mame/sgi/sgi.cpp @@ -32,7 +32,7 @@ sgi_mc_device::sgi_mc_device(const machine_config &mconfig, const char *tag, dev , m_maincpu(*this, finder_base::DUMMY_TAG) , m_eeprom(*this, finder_base::DUMMY_TAG) , m_int_dma_done_cb(*this) - , m_eisa_present(*this) + , m_eisa_present(*this, true) , m_dma_timer(nullptr) , m_last_update_time(attotime::zero) , m_watchdog(0) @@ -68,12 +68,6 @@ sgi_mc_device::sgi_mc_device(const machine_config &mconfig, const char *tag, dev { } -void sgi_mc_device::device_resolve_objects() -{ - m_int_dma_done_cb.resolve_safe(); - m_eisa_present.resolve_safe(true); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/sgi/sgi.h b/src/mame/sgi/sgi.h index 118a63b1468..08e1411d16a 100644 --- a/src/mame/sgi/sgi.h +++ b/src/mame/sgi/sgi.h @@ -37,8 +37,7 @@ public: uint32_t get_mem_config(int channel) const { return m_mem_config[channel]; } 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/mame/sgi/sgi_ge5.cpp b/src/mame/sgi/sgi_ge5.cpp index 6d5e1384e34..d893388d3c9 100644 --- a/src/mame/sgi/sgi_ge5.cpp +++ b/src/mame/sgi/sgi_ge5.cpp @@ -134,9 +134,9 @@ sgi_ge5_device::sgi_ge5_device(machine_config const &mconfig, char const *tag, d , m_data_config("data", ENDIANNESS_BIG, 32, 13, -2, address_map_constructor(FUNC(sgi_ge5_device::data_map), this)) , m_fpu(*this, "fpu") , m_int_cb(*this) - , m_fifo_empty(*this) - , m_fifo_read(*this) - , m_re_r(*this) + , m_fifo_empty(*this, 0) + , m_fifo_read(*this, 0) + , m_re_r(*this, 0) , m_re_w(*this) , m_icount(0) { @@ -162,12 +162,6 @@ void sgi_ge5_device::data_map(address_map &map) void sgi_ge5_device::device_start() { - m_int_cb.resolve_safe(); - m_fifo_empty.resolve(); - m_fifo_read.resolve(); - m_re_r.resolve(); - m_re_w.resolve(); - // TODO: save state state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); diff --git a/src/mame/sgi/sgi_gr1.cpp b/src/mame/sgi/sgi_gr1.cpp index c2fa3bd62d9..58c7f927dbd 100644 --- a/src/mame/sgi/sgi_gr1.cpp +++ b/src/mame/sgi/sgi_gr1.cpp @@ -198,8 +198,6 @@ ioport_constructor sgi_gr1_device::device_input_ports() const void sgi_gr1_device::device_start() { - m_int_fifo_cb.resolve_safe(); - //save_item(NAME()); m_reset = true; diff --git a/src/mame/sgi/sgi_re2.cpp b/src/mame/sgi/sgi_re2.cpp index 401dd228636..34c3ad18d6b 100644 --- a/src/mame/sgi/sgi_re2.cpp +++ b/src/mame/sgi/sgi_re2.cpp @@ -63,9 +63,6 @@ sgi_re2_device::sgi_re2_device(machine_config const &mconfig, char const *tag, d void sgi_re2_device::device_start() { - m_rdy_cb.resolve(); - m_drq_cb.resolve(); - m_vram = std::make_unique<u32[]>(1280 * 1024); m_dram = std::make_unique<u32[]>(1280 * 1024); diff --git a/src/mame/sgi/vino.cpp b/src/mame/sgi/vino.cpp index 6e201c2ad31..a206c72e54f 100644 --- a/src/mame/sgi/vino.cpp +++ b/src/mame/sgi/vino.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(VINO, vino_device, "vino", "SGI VINO Controller") vino_device::vino_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VINO, tag, owner, clock) , m_i2c_data_out(*this) - , m_i2c_data_in(*this) + , m_i2c_data_in(*this, 0x00) , m_i2c_stop(*this) , m_interrupt_cb(*this) , m_picture(*this, "srcimg") @@ -93,11 +93,6 @@ void vino_device::device_start() m_channels[i].m_fetch_timer->adjust(attotime::never); } - - m_i2c_data_out.resolve_safe(); - m_i2c_data_in.resolve_safe(0x00); - m_i2c_stop.resolve_safe(); - m_interrupt_cb.resolve_safe(); } void vino_device::device_reset() diff --git a/src/mame/shared/ballysound.cpp b/src/mame/shared/ballysound.cpp index a88bd87dd1b..24ff89d305d 100644 --- a/src/mame/shared/ballysound.cpp +++ b/src/mame/shared/ballysound.cpp @@ -537,7 +537,6 @@ void bally_cheap_squeak_device::device_add_mconfig(machine_config &config) void bally_cheap_squeak_device::device_start() { - m_sound_ack_w_handler.resolve(); m_leds.resolve(); save_item(NAME(m_sound_select)); @@ -570,10 +569,7 @@ uint8_t bally_cheap_squeak_device::in_p2_cb() void bally_cheap_squeak_device::out_p2_cb(uint8_t data) { m_sound_ack = BIT(data, 0); - if (!m_sound_ack_w_handler.isnull()) - { - m_sound_ack_w_handler(m_sound_ack); - } + m_sound_ack_w_handler(m_sound_ack); update_led(); } diff --git a/src/mame/shared/cage.cpp b/src/mame/shared/cage.cpp index 37124081192..e87188361ee 100644 --- a/src/mame/shared/cage.cpp +++ b/src/mame/shared/cage.cpp @@ -217,9 +217,6 @@ void atari_cage_device::device_start() { attotime cage_cpu_clock_period; - // resolve callbacks - m_irqhandler.resolve_safe(); - m_bootbank->set_base(m_bootrom->base()); m_mainbank->set_base(m_mainrom->base()); diff --git a/src/mame/shared/exidysound.cpp b/src/mame/shared/exidysound.cpp index 6a329759d3d..2ec5011c301 100644 --- a/src/mame/shared/exidysound.cpp +++ b/src/mame/shared/exidysound.cpp @@ -656,14 +656,6 @@ venture_sound_device::venture_sound_device(const machine_config &mconfig, device { } -void venture_sound_device::device_resolve_objects() -{ - m_pa_callback.resolve_safe(); - m_pb_callback.resolve_safe(); - m_ca2_callback.resolve_safe(); - m_cb2_callback.resolve_safe(); -} - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/shared/exidysound.h b/src/mame/shared/exidysound.h index 00779b0047f..cf41f2799a9 100644 --- a/src/mame/shared/exidysound.h +++ b/src/mame/shared/exidysound.h @@ -46,7 +46,7 @@ public: protected: exidy_sound_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; @@ -100,7 +100,7 @@ class exidy_sh8253_sound_device : public exidy_sound_device protected: exidy_sh8253_sound_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; @@ -150,8 +150,7 @@ public: protected: venture_sound_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_add_mconfig(machine_config &config) override; void venture_audio_map(address_map &map); @@ -180,7 +179,7 @@ public: mtrap_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; @@ -208,7 +207,7 @@ public: void command_w(uint8_t data); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/mame/shared/isbc_215g.cpp b/src/mame/shared/isbc_215g.cpp index d45d00a87fb..b11d3f0107e 100644 --- a/src/mame/shared/isbc_215g.cpp +++ b/src/mame/shared/isbc_215g.cpp @@ -416,8 +416,6 @@ void isbc_215g_device::device_start() m_wrgate = false; m_rdgate = false; m_format_bytes = 0; - m_out_irq_func.resolve_safe(); - } void isbc_215g_device::write(offs_t offset, uint8_t data) diff --git a/src/mame/shared/ms7004.cpp b/src/mame/shared/ms7004.cpp index 33a0249f9e8..ea1bff14e0d 100644 --- a/src/mame/shared/ms7004.cpp +++ b/src/mame/shared/ms7004.cpp @@ -366,8 +366,6 @@ ms7004_device::ms7004_device(const machine_config &mconfig, const char *tag, dev void ms7004_device::device_start() { - m_tx_handler.resolve_safe(); - m_rts_handler.resolve_safe(); } diff --git a/src/mame/shared/s11c_bg.cpp b/src/mame/shared/s11c_bg.cpp index d01bddcea13..35c34ce0750 100644 --- a/src/mame/shared/s11c_bg.cpp +++ b/src/mame/shared/s11c_bg.cpp @@ -308,7 +308,7 @@ void s11c_bg_device::s11c_bgs_map(address_map &map) TIMER_CALLBACK_MEMBER(s11c_bg_device::deferred_cb2_w) { - if (!m_cb2_cb.isnull()) + if (!m_cb2_cb.isunset()) m_cb2_cb(param); else logerror("S11C_BG CB2 writeback called with state %x, but callback is not registered!\n", param); @@ -316,7 +316,7 @@ TIMER_CALLBACK_MEMBER(s11c_bg_device::deferred_cb2_w) TIMER_CALLBACK_MEMBER(s11c_bg_device::deferred_pb_w) { - if (!m_pb_cb.isnull()) + if (!m_pb_cb.isunset()) m_pb_cb(param); else logerror("S11C_BG PB writeback called with state 0x%2X, but callback is not registered!\n", param); @@ -501,9 +501,7 @@ void s11c_bg_device::device_start() u8 *rom = memregion("cpu")->base(); m_cpubank->configure_entries(0, 16, &rom[0x0], 0x8000); m_cpubank->set_entry(0); - /* resolve lines */ - m_cb2_cb.resolve(); - m_pb_cb.resolve(); + save_item(NAME(m_old_resetq_state)); } diff --git a/src/mame/shared/segam1audio.cpp b/src/mame/shared/segam1audio.cpp index cfaa49d9424..70a8fc8b1a7 100644 --- a/src/mame/shared/segam1audio.cpp +++ b/src/mame/shared/segam1audio.cpp @@ -110,7 +110,6 @@ segam1audio_device::segam1audio_device(const machine_config &mconfig, const char void segam1audio_device::device_start() { - m_rxd_handler.resolve_safe(); m_mpcmbank1->configure_entries(0, 4, m_multipcm1_region->base(), 0x100000); m_mpcmbank2->configure_entries(0, 4, m_multipcm2_region->base(), 0x100000); } diff --git a/src/mame/shared/seibusound.cpp b/src/mame/shared/seibusound.cpp index e0ba1fd770b..7a70a019cf9 100644 --- a/src/mame/shared/seibusound.cpp +++ b/src/mame/shared/seibusound.cpp @@ -77,7 +77,7 @@ DEFINE_DEVICE_TYPE(SEIBU_SOUND, seibu_sound_device, "seibu_sound", "Seibu Sound seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEIBU_SOUND, tag, owner, clock), m_int_cb(*this), - m_ym_read_cb(*this), + m_ym_read_cb(*this, 0), m_ym_write_cb(*this), m_sound_rom(*this, finder_base::DUMMY_TAG), m_rom_bank(*this, finder_base::DUMMY_TAG), @@ -96,10 +96,6 @@ seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char void seibu_sound_device::device_start() { - m_int_cb.resolve_safe(); - m_ym_read_cb.resolve_safe(0); - m_ym_write_cb.resolve_safe(); - if (m_sound_rom.found() && m_rom_bank.found()) { if (m_sound_rom.length() > 0x10000) diff --git a/src/mame/shared/taito68705.cpp b/src/mame/shared/taito68705.cpp index e303928f4f6..a58a4aefc74 100644 --- a/src/mame/shared/taito68705.cpp +++ b/src/mame/shared/taito68705.cpp @@ -112,8 +112,6 @@ void taito68705_mcu_device_base::mcu_pa_w(u8 data) void taito68705_mcu_device_base::device_start() { - m_semaphore_cb.resolve_safe(); - save_item(NAME(m_latch_driven)); save_item(NAME(m_reset_input)); save_item(NAME(m_host_flag)); @@ -202,9 +200,6 @@ void taito68705_mcu_device::device_start() { taito68705_mcu_device_base::device_start(); - m_aux_out_cb.resolve_all_safe(); - m_aux_strobe_cb.resolve_safe(); - save_item(NAME(m_pb_output)); m_pb_output = 0xff; @@ -282,7 +277,7 @@ arkanoid_mcu_device_base::arkanoid_mcu_device_base( device_t *owner, u32 clock) : taito68705_mcu_device_base(mconfig, type, tag, owner, clock) - , m_portb_r_cb(*this) + , m_portb_r_cb(*this, 0xff) , m_pc_output(0xff) { } @@ -310,8 +305,6 @@ void arkanoid_mcu_device_base::device_start() { taito68705_mcu_device_base::device_start(); - m_portb_r_cb.resolve_safe(0xff); - save_item(NAME(m_pc_output)); m_pc_output = 0xff; diff --git a/src/mame/shared/vt100_kbd.cpp b/src/mame/shared/vt100_kbd.cpp index d9a6fc7f59e..ec4965564f3 100644 --- a/src/mame/shared/vt100_kbd.cpp +++ b/src/mame/shared/vt100_kbd.cpp @@ -217,18 +217,6 @@ ioport_constructor vt100_keyboard_device::device_input_ports() const //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void vt100_keyboard_device::device_resolve_objects() -{ - m_signal_out_cb.resolve_safe(); -} - - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/shared/vt100_kbd.h b/src/mame/shared/vt100_kbd.h index 22d69afcec1..bcda413aa75 100644 --- a/src/mame/shared/vt100_kbd.h +++ b/src/mame/shared/vt100_kbd.h @@ -37,7 +37,6 @@ public: protected: vt100_keyboard_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_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/shared/xbox_pci.cpp b/src/mame/shared/xbox_pci.cpp index fb35f27e62e..ba218745e98 100644 --- a/src/mame/shared/xbox_pci.cpp +++ b/src/mame/shared/xbox_pci.cpp @@ -173,9 +173,6 @@ void mcpx_isalpc_device::device_start() { pci_device::device_start(); set_multifunction_device(true); - m_smi_callback.resolve_safe(); - m_interrupt_output.resolve_safe(); - m_boot_state_hook.resolve_safe(); add_map(0x00000100, M_IO, FUNC(mcpx_isalpc_device::lpc_io)); bank_infos[0].adr = 0x8000; status = 0x00b0; @@ -355,8 +352,7 @@ void mcpx_isalpc_device::acpi_w(offs_t offset, uint32_t data, uint32_t mem_mask) void mcpx_isalpc_device::boot_state_w(uint8_t data) { - if (m_boot_state_hook) - m_boot_state_hook((offs_t)0, data); + m_boot_state_hook(offs_t(0), data); } void mcpx_isalpc_device::interrupt_ouptut_changed(int state) @@ -733,7 +729,6 @@ void mcpx_smbus_device::device_start() { pci_device::device_start(); set_multifunction_device(true); - m_interrupt_handler.resolve_safe(); add_map(0x00000010, M_IO, FUNC(mcpx_smbus_device::smbus_io0)); bank_infos[0].adr = 0x1000; add_map(0x00000010, M_IO, FUNC(mcpx_smbus_device::smbus_io1)); @@ -803,10 +798,7 @@ void mcpx_smbus_device::smbus_write(int bus, offs_t offset, uint32_t data, uint3 if ((offset == 0) && (ACCESSING_BITS_0_7 || ACCESSING_BITS_8_15)) // 0 smbus status { if (!((smbusst[bus].status ^ data) & 0x10)) // clearing interrupt - { - if (m_interrupt_handler) - m_interrupt_handler(0); - } + m_interrupt_handler(0); smbusst[bus].status &= ~data; } if ((offset == 0) && ACCESSING_BITS_16_23) // 2 smbus control @@ -826,10 +818,7 @@ void mcpx_smbus_device::smbus_write(int bus, offs_t offset, uint32_t data, uint3 logerror("SMBUS: access to missing device at bus %d address %d\n", bus, smbusst[bus].address); smbusst[bus].status |= 0x10; if (smbusst[bus].control & 0x10) - { - if (m_interrupt_handler) - m_interrupt_handler(1); - } + m_interrupt_handler(1); } } } @@ -910,7 +899,6 @@ void mcpx_ohci_device::plug_usb_device(int port, device_usb_ohci_function_interf void mcpx_ohci_device::device_start() { pci_device::device_start(); - m_interrupt_handler.resolve_safe(); add_map(0x00001000, M_MEM, FUNC(mcpx_ohci_device::ohci_mmio)); bank_infos[0].adr = 0xfed00000; status = 0x00b0; @@ -1425,8 +1413,6 @@ void mcpx_ide_device::device_start() bank_infos[4].adr = 0xff60; status = 0x00b0; command = 0x0001; - m_pri_interrupt_handler.resolve_safe(); - m_sec_interrupt_handler.resolve_safe(); } void mcpx_ide_device::device_reset() @@ -1604,7 +1590,6 @@ nv2a_gpu_device::nv2a_gpu_device(const machine_config &mconfig, const char *tag, void nv2a_gpu_device::device_start() { agp_device::device_start(); - m_interrupt_handler.resolve_safe(); add_map(0x01000000, M_MEM, FUNC(nv2a_gpu_device::nv2a_mmio)); bank_infos[0].adr = 0xfd000000; add_map(0x08000000, M_MEM, FUNC(nv2a_gpu_device::nv2a_mirror)); diff --git a/src/mame/sharp/x68k_crtc.cpp b/src/mame/sharp/x68k_crtc.cpp index 893f3175375..a6e31f4a550 100644 --- a/src/mame/sharp/x68k_crtc.cpp +++ b/src/mame/sharp/x68k_crtc.cpp @@ -18,8 +18,8 @@ x68k_crtc_device::x68k_crtc_device(const machine_config &mconfig, device_type ty , m_vdisp_callback(*this) , m_rint_callback(*this) , m_hsync_callback(*this) - , m_tvram_read_callback(*this) - , m_gvram_read_callback(*this) + , m_tvram_read_callback(*this, 0) + , m_gvram_read_callback(*this, 0) , m_tvram_write_callback(*this) , m_gvram_write_callback(*this) , m_clock_69m(0) @@ -55,17 +55,6 @@ vicon_device::vicon_device(const machine_config &mconfig, const char *tag, devic { } -void x68k_crtc_device::device_resolve_objects() -{ - m_vdisp_callback.resolve_safe(); - m_rint_callback.resolve_safe(); - m_hsync_callback.resolve_safe(); - m_tvram_read_callback.resolve_safe(0); - m_gvram_read_callback.resolve_safe(0); - m_tvram_write_callback.resolve_safe(); - m_gvram_write_callback.resolve_safe(); -} - void x68k_crtc_device::device_start() { m_scanline_timer = timer_alloc(FUNC(x68k_crtc_device::hsync), this); diff --git a/src/mame/sharp/x68k_crtc.h b/src/mame/sharp/x68k_crtc.h index 7b92222c0d3..acbe6e65445 100644 --- a/src/mame/sharp/x68k_crtc.h +++ b/src/mame/sharp/x68k_crtc.h @@ -54,8 +54,7 @@ protected: // base constructor x68k_crtc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // 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/mame/siemens/pcd_kbd.cpp b/src/mame/siemens/pcd_kbd.cpp index cb1a146147c..5ab25f2932f 100644 --- a/src/mame/siemens/pcd_kbd.cpp +++ b/src/mame/siemens/pcd_kbd.cpp @@ -232,7 +232,6 @@ pcd_keyboard_device::pcd_keyboard_device(const machine_config &mconfig, const ch void pcd_keyboard_device::device_start() { - m_out_tx_handler.resolve_safe(); m_out_tx_handler(1); } diff --git a/src/mame/siemens/pcd_v.cpp b/src/mame/siemens/pcd_v.cpp index da5df9e8927..48198bbdd39 100644 --- a/src/mame/siemens/pcd_v.cpp +++ b/src/mame/siemens/pcd_v.cpp @@ -419,7 +419,6 @@ void pcd_video_device::map(address_map &map) void pcx_video_device::device_start() { m_maincpu->space(AS_IO).install_readwrite_handler(0xfb00, 0xfb01, read8smo_delegate(*this, FUNC(pcdx_video_device::detect_r)), write8smo_delegate(*this, FUNC(pcdx_video_device::detect_w)), 0x00ff); - m_txd_handler.resolve_safe(); decode_gfx(gfx_pcx); } diff --git a/src/mame/sinclair/qimi.cpp b/src/mame/sinclair/qimi.cpp index dba7bd9ee59..10efcb04d23 100644 --- a/src/mame/sinclair/qimi.cpp +++ b/src/mame/sinclair/qimi.cpp @@ -119,8 +119,6 @@ qimi_device::qimi_device(const machine_config &mconfig, const char *tag, device_ void qimi_device::device_start() { - // resolve callbacks - m_write_extint.resolve_safe(); } diff --git a/src/mame/sinclair/tsconfdma.cpp b/src/mame/sinclair/tsconfdma.cpp index 467778225e6..854e8a64b5f 100644 --- a/src/mame/sinclair/tsconfdma.cpp +++ b/src/mame/sinclair/tsconfdma.cpp @@ -11,9 +11,9 @@ tsconfdma_device::tsconfdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TSCONF_DMA, tag, owner, clock), - m_in_mreq_cb(*this), + m_in_mreq_cb(*this, 0), m_out_mreq_cb(*this), - m_in_mspi_cb(*this), + m_in_mspi_cb(*this, 0), m_out_cram_cb(*this), m_out_sfile_cb(*this), m_on_ready_cb(*this) @@ -24,13 +24,6 @@ void tsconfdma_device::device_start() { m_dma_clock = timer_alloc(FUNC(tsconfdma_device::dma_clock), this); - m_in_mreq_cb.resolve_safe(0); - m_out_mreq_cb.resolve_safe(); - m_in_mspi_cb.resolve_safe(0); - m_out_cram_cb.resolve_safe(); - m_out_sfile_cb.resolve_safe(); - m_on_ready_cb.resolve_safe(); - save_item(NAME(m_ready)); save_item(NAME(m_address_s)); save_item(NAME(m_address_d)); diff --git a/src/mame/sinclair/zx8301.cpp b/src/mame/sinclair/zx8301.cpp index 419412c0476..2f0004df2f3 100644 --- a/src/mame/sinclair/zx8301.cpp +++ b/src/mame/sinclair/zx8301.cpp @@ -133,9 +133,6 @@ zx8301_device::zx8301_device(const machine_config &mconfig, const char *tag, dev void zx8301_device::device_start() { - // resolve callbacks - m_write_vsync.resolve_safe(); - // allocate timers m_vsync_timer = timer_alloc(FUNC(zx8301_device::output_vsync), this); m_flash_timer = timer_alloc(FUNC(zx8301_device::toggle_flash), this); diff --git a/src/mame/sinclair/zx8302.cpp b/src/mame/sinclair/zx8302.cpp index 5758ded3cb3..b4d9acdd674 100644 --- a/src/mame/sinclair/zx8302.cpp +++ b/src/mame/sinclair/zx8302.cpp @@ -144,9 +144,9 @@ zx8302_device::zx8302_device(const machine_config &mconfig, const char *tag, dev m_out_mdrdw_cb(*this), m_out_erase_cb(*this), m_out_raw1_cb(*this), - m_in_raw1_cb(*this), + m_in_raw1_cb(*this, 0), m_out_raw2_cb(*this), - m_in_raw2_cb(*this), + m_in_raw2_cb(*this, 0), m_dtr1(0), m_cts2(0), m_idr(1), @@ -171,22 +171,6 @@ zx8302_device::zx8302_device(const machine_config &mconfig, const char *tag, dev void zx8302_device::device_start() { - // resolve callbacks - m_out_ipl1l_cb.resolve_safe(); - m_out_baudx4_cb.resolve_safe(); - m_out_comdata_cb.resolve_safe(); - m_out_txd1_cb.resolve_safe(); - m_out_txd2_cb.resolve_safe(); - m_out_netout_cb.resolve_safe(); - m_out_mdselck_cb.resolve_safe(); - m_out_mdseld_cb.resolve_safe(); - m_out_mdrdw_cb.resolve_safe(); - m_out_erase_cb.resolve_safe(); - m_out_raw1_cb.resolve_safe(); - m_in_raw1_cb.resolve_safe(0); - m_out_raw2_cb.resolve_safe(); - m_in_raw2_cb.resolve_safe(0); - // allocate timers m_baudx4_timer = timer_alloc(FUNC(zx8302_device::baudx4_tick), this); m_rtc_timer = timer_alloc(FUNC(zx8302_device::rtc_tick), this); diff --git a/src/mame/skeleton/alfaskop_s41_kb.cpp b/src/mame/skeleton/alfaskop_s41_kb.cpp index 9551308fee2..87aa9efae59 100644 --- a/src/mame/skeleton/alfaskop_s41_kb.cpp +++ b/src/mame/skeleton/alfaskop_s41_kb.cpp @@ -254,9 +254,6 @@ void alfaskop_s41_keyboard_device::rst_line_w(int state) void alfaskop_s41_keyboard_device::device_start() { - m_txd_cb.resolve_safe(); - m_leds_cb.resolve_safe(); - save_item(NAME(m_rxd_high)); save_item(NAME(m_txd_high)); save_item(NAME(m_col_select)); diff --git a/src/mame/skeleton/ampex210_kbd.cpp b/src/mame/skeleton/ampex210_kbd.cpp index 014e953ec38..f48a90ed881 100644 --- a/src/mame/skeleton/ampex210_kbd.cpp +++ b/src/mame/skeleton/ampex210_kbd.cpp @@ -184,13 +184,6 @@ ioport_constructor ampex230_keyboard_device::device_input_ports() const // DEVICE INITIALIZATION AND STARTUP //************************************************************************** -void ampex230_keyboard_device::device_resolve_objects() -{ - // resolve callbacks - m_data_out_callback.resolve_safe(); - m_clock_out_callback.resolve_safe(); -} - void ampex230_keyboard_device::device_start() { save_item(NAME(m_key_scan)); diff --git a/src/mame/skeleton/ampex210_kbd.h b/src/mame/skeleton/ampex210_kbd.h index c943f679e8e..ae38687b34b 100644 --- a/src/mame/skeleton/ampex210_kbd.h +++ b/src/mame/skeleton/ampex210_kbd.h @@ -20,11 +20,10 @@ public: void strobe_w(int state); protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; virtual ioport_constructor device_input_ports() const override; - virtual void device_resolve_objects() override; virtual void device_start() override; private: diff --git a/src/mame/skeleton/basf7100_kbd.cpp b/src/mame/skeleton/basf7100_kbd.cpp index 147d208c913..0dd7bba680b 100644 --- a/src/mame/skeleton/basf7100_kbd.cpp +++ b/src/mame/skeleton/basf7100_kbd.cpp @@ -209,9 +209,6 @@ basf7100_kbd_device::basf7100_kbd_device(const machine_config &mconfig, const ch void basf7100_kbd_device::device_start() { - // resolve callbacks - m_int_handler.resolve_safe(); - // register for state saving save_item(NAME(m_data)); } diff --git a/src/mame/skeleton/digilog_kbd.cpp b/src/mame/skeleton/digilog_kbd.cpp index c324a6f03eb..87d2199e484 100644 --- a/src/mame/skeleton/digilog_kbd.cpp +++ b/src/mame/skeleton/digilog_kbd.cpp @@ -220,9 +220,6 @@ digilog_kbd_device::digilog_kbd_device(const machine_config &mconfig, const char void digilog_kbd_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); - // register for save states save_item(NAME(m_bus)); save_item(NAME(m_key_row)); diff --git a/src/mame/skeleton/dim68k_kbd.cpp b/src/mame/skeleton/dim68k_kbd.cpp index 5eccb032585..76a1858d53f 100644 --- a/src/mame/skeleton/dim68k_kbd.cpp +++ b/src/mame/skeleton/dim68k_kbd.cpp @@ -46,7 +46,6 @@ void dim68k_keyboard_device::device_resolve_objects() { m_capslock_led.resolve(); m_numlock_led.resolve(); - m_txd_callback.resolve_safe(); } void dim68k_keyboard_device::device_start() diff --git a/src/mame/skeleton/mindset.cpp b/src/mame/skeleton/mindset.cpp index b0c2d8e2c9a..98161025f92 100644 --- a/src/mame/skeleton/mindset.cpp +++ b/src/mame/skeleton/mindset.cpp @@ -83,7 +83,6 @@ private: void mindset_module_interface::device_start() { - m_irq_cb.resolve_safe(); save_item(NAME(m_irq_state)); } diff --git a/src/mame/skeleton/zorbakbd.cpp b/src/mame/skeleton/zorbakbd.cpp index 7ce74f9ecbe..35dc4c4c1cc 100644 --- a/src/mame/skeleton/zorbakbd.cpp +++ b/src/mame/skeleton/zorbakbd.cpp @@ -301,7 +301,6 @@ void zorba_keyboard_device::mcu_pc_w(u8 data) void zorba_keyboard_device::device_start() { - m_rxd_cb.resolve_safe(); m_led_key_caps_lock.resolve(); m_led_key_shift_lock.resolve(); diff --git a/src/mame/snk/hng64.cpp b/src/mame/snk/hng64.cpp index 844429e2c25..f83326717c5 100644 --- a/src/mame/snk/hng64.cpp +++ b/src/mame/snk/hng64.cpp @@ -2328,7 +2328,6 @@ hng64_lamps_device::hng64_lamps_device(const machine_config &mconfig, const char void hng64_lamps_device::device_start() { - m_lamps_out_cb.resolve_all_safe(); } void hng64_state::hng64_drive_lamps7_w(uint8_t data) diff --git a/src/mame/snk/k1ge.cpp b/src/mame/snk/k1ge.cpp index d7f2b416568..820289767a6 100644 --- a/src/mame/snk/k1ge.cpp +++ b/src/mame/snk/k1ge.cpp @@ -760,7 +760,7 @@ TIMER_CALLBACK_MEMBER( k1ge_device::timer_callback ) /* Check if Hint should be triggered */ if ( y == K1GE_SCREEN_HEIGHT - 1 || y < 151 ) { - if (!m_hblank_pin_w.isnull()) + if (!m_hblank_pin_w.isunset()) { if (m_vram[0x000] & 0x40) { @@ -792,9 +792,6 @@ void k1ge_device::update( bitmap_ind16 &bitmap, const rectangle &cliprect ) void k1ge_device::device_start() { - m_vblank_pin_w.resolve(); - m_hblank_pin_w.resolve(); - m_timer = timer_alloc(FUNC(k1ge_device::timer_callback), this); m_hblank_on_timer = timer_alloc(FUNC(k1ge_device::hblank_on_timer_callback), this); m_vram = make_unique_clear<uint8_t[]>(0x4000); diff --git a/src/mame/sony/cat702.cpp b/src/mame/sony/cat702.cpp index 86e4983a271..067be2f0edc 100644 --- a/src/mame/sony/cat702.cpp +++ b/src/mame/sony/cat702.cpp @@ -118,8 +118,6 @@ void cat702_device::device_start() memcpy(m_transform, m_region->base(), sizeof(m_transform)); } - m_dataout_handler.resolve_safe(); - save_item(NAME(m_select)); save_item(NAME(m_clock)); save_item(NAME(m_datain)); diff --git a/src/mame/sony/cxd8442q.cpp b/src/mame/sony/cxd8442q.cpp index 7047215a807..700a1caa2bc 100644 --- a/src/mame/sony/cxd8442q.cpp +++ b/src/mame/sony/cxd8442q.cpp @@ -62,11 +62,6 @@ cxd8442q_device::cxd8442q_device(const machine_config &mconfig, const char *tag, { } -void cxd8442q_device::device_resolve_objects() -{ - out_irq.resolve_safe(); -} - void cxd8442q_device::map(address_map &map) { // Each channel has the same structure @@ -185,11 +180,6 @@ void cxd8442q_device::device_start() fifo_ram = std::make_unique<uint32_t[]>(FIFO_MAX_RAM_SIZE); fifo_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cxd8442q_device::fifo_dma_execute), this)); - for (apfifo_channel& channel : fifo_channels) - { - channel.resolve_callbacks(); - } - save_pointer(NAME(fifo_ram), FIFO_MAX_RAM_SIZE); save_item(STRUCT_MEMBER(fifo_channels, fifo_size)); save_item(STRUCT_MEMBER(fifo_channels, address)); diff --git a/src/mame/sony/cxd8442q.h b/src/mame/sony/cxd8442q.h index d254fad800a..b138e80ce40 100644 --- a/src/mame/sony/cxd8442q.h +++ b/src/mame/sony/cxd8442q.h @@ -20,7 +20,7 @@ protected: class apfifo_channel { public: - apfifo_channel(cxd8442q_device &fifo_device) : fifo_device(fifo_device), dma_r_callback(fifo_device), dma_w_callback(fifo_device) + apfifo_channel(cxd8442q_device &fifo_device) : fifo_device(fifo_device), dma_r_callback(fifo_device, 0), dma_w_callback(fifo_device) { } @@ -60,12 +60,6 @@ protected: auto dma_w_cb() { return dma_w_callback.bind(); } - void resolve_callbacks() - { - dma_r_callback.resolve_safe(0); - dma_w_callback.resolve_safe(); - } - // Emulates the FIFO data port uint32_t read_data_from_fifo(); void write_data_to_fifo(uint32_t data); @@ -118,10 +112,9 @@ protected: TIMER_CALLBACK_MEMBER(fifo_dma_execute); - void device_resolve_objects() override; void irq_check(); - // device_t overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/sony/cxd8452aq.cpp b/src/mame/sony/cxd8452aq.cpp index fa13b2abeff..b93e50c3eff 100644 --- a/src/mame/sony/cxd8452aq.cpp +++ b/src/mame/sony/cxd8452aq.cpp @@ -76,7 +76,6 @@ void cxd8452aq_device::device_start() { m_bus->cache(m_main_cache); space(0).cache(m_net_cache); - m_irq_handler.resolve_safe(); m_apbus_virt_to_phys_callback.resolve(); m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cxd8452aq_device::irq_check), this)); m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cxd8452aq_device::dma_check), this)); diff --git a/src/mame/sony/dmac3.cpp b/src/mame/sony/dmac3.cpp index e74d26dbf0f..fe2a4cab89f 100644 --- a/src/mame/sony/dmac3.cpp +++ b/src/mame/sony/dmac3.cpp @@ -19,7 +19,7 @@ DEFINE_DEVICE_TYPE(DMAC3, dmac3_device, "dmac3", "Sony CXD8403Q DMAC3 DMA Contro dmac3_device::dmac3_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, DMAC3, tag, owner, clock), m_bus(*this, finder_base::DUMMY_TAG, -1, 64), m_irq_handler(*this), - m_dma_r(*this), + m_dma_r(*this, 0), m_dma_w(*this), m_apbus_virt_to_phys_callback(*this) { @@ -28,9 +28,6 @@ dmac3_device::dmac3_device(machine_config const &mconfig, char const *tag, devic void dmac3_device::device_start() { m_apbus_virt_to_phys_callback.resolve(); - m_irq_handler.resolve_safe(); - m_dma_r.resolve_all_safe(0); - m_dma_w.resolve_all_safe(); m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac3_device::irq_check), this)); m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac3_device::dma_check), this)); diff --git a/src/mame/sony/dmac_0266.cpp b/src/mame/sony/dmac_0266.cpp index 4d69a02e702..756d550e1d7 100644 --- a/src/mame/sony/dmac_0266.cpp +++ b/src/mame/sony/dmac_0266.cpp @@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(DMAC_0266, dmac_0266_device, "dmac_0266", "Sony 0266 DMA Cont dmac_0266_device::dmac_0266_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, DMAC_0266, tag, owner, clock) , m_bus(*this, finder_base::DUMMY_TAG, -1, 32) - , m_dma_r(*this) + , m_dma_r(*this, 0) , m_dma_w(*this) { } @@ -45,9 +45,6 @@ void dmac_0266_device::map(address_map &map) void dmac_0266_device::device_start() { - m_dma_r.resolve_safe(0); - m_dma_w.resolve_safe(); - save_item(NAME(m_control)); save_item(NAME(m_status)); save_item(NAME(m_tcount)); diff --git a/src/mame/sony/dmac_0448.cpp b/src/mame/sony/dmac_0448.cpp index 365df3e9582..31dfffd2563 100644 --- a/src/mame/sony/dmac_0448.cpp +++ b/src/mame/sony/dmac_0448.cpp @@ -25,7 +25,7 @@ dmac_0448_device::dmac_0448_device(machine_config const &mconfig, char const *ta : device_t(mconfig, DMAC_0448, tag, owner, clock) , m_bus(*this, finder_base::DUMMY_TAG, -1, 32) , m_out_int(*this) - , m_dma_r(*this) + , m_dma_r(*this, 0) , m_dma_w(*this) { } @@ -49,11 +49,6 @@ void dmac_0448_device::map(address_map &map) void dmac_0448_device::device_start() { - m_out_int.resolve(); - - m_dma_r.resolve_all_safe(0); - m_dma_w.resolve_all_safe(); - m_irq_check = timer_alloc(FUNC(dmac_0448_device::irq_check), this); m_dma_check = timer_alloc(FUNC(dmac_0448_device::dma_check), this); diff --git a/src/mame/sony/news_hid.cpp b/src/mame/sony/news_hid.cpp index e2c229820ce..fa9f58fa7aa 100644 --- a/src/mame/sony/news_hid.cpp +++ b/src/mame/sony/news_hid.cpp @@ -89,8 +89,6 @@ void news_hid_hle_device::map_apbus(address_map &map) void news_hid_hle_device::device_start() { - m_irq_out_cb.resolve_all_safe(); - //save_item(NAME(m_fifo)); save_item(NAME(m_irq_enabled)); save_item(NAME(m_irq_out_state)); diff --git a/src/mame/sony/psxcd.cpp b/src/mame/sony/psxcd.cpp index 187b450a11b..d62a430316f 100644 --- a/src/mame/sony/psxcd.cpp +++ b/src/mame/sony/psxcd.cpp @@ -92,7 +92,6 @@ psxcd_device::psxcd_device(const machine_config &mconfig, const char *tag, devic void psxcd_device::device_start() { cdrom_image_device::device_start(); - m_irq_handler.resolve_safe(); uint32_t sysclk = m_maincpu->clock() / 2; start_read_delay = (sysclk / 60); diff --git a/src/mame/sony/znmcu.cpp b/src/mame/sony/znmcu.cpp index 2978aa38342..f7acb490573 100644 --- a/src/mame/sony/znmcu.cpp +++ b/src/mame/sony/znmcu.cpp @@ -7,9 +7,9 @@ DEFINE_DEVICE_TYPE(ZNMCU, znmcu_device, "znmcu", "Sony ZN MCU") znmcu_device::znmcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZNMCU, tag, owner, clock), - m_dsw_handler(*this), - m_analog1_handler(*this), - m_analog2_handler(*this), + m_dsw_handler(*this, 0xff), + m_analog1_handler(*this, 0xff), + m_analog2_handler(*this, 0xff), m_dataout_handler(*this), m_dsr_handler(*this), m_select(1), @@ -22,12 +22,6 @@ znmcu_device::znmcu_device(const machine_config &mconfig, const char *tag, devic void znmcu_device::device_start() { - m_dsw_handler.resolve_safe(0xff); - m_analog1_handler.resolve_safe(0xff); - m_analog2_handler.resolve_safe(0xff); - m_dataout_handler.resolve_safe(); - m_dsr_handler.resolve_safe(); - m_mcu_timer = timer_alloc(FUNC(znmcu_device::mcu_tick), this); m_dataout_handler(1); diff --git a/src/mame/subsino/lastfght.cpp b/src/mame/subsino/lastfght.cpp index 9f32eb15cf1..ef16fd6e0db 100644 --- a/src/mame/subsino/lastfght.cpp +++ b/src/mame/subsino/lastfght.cpp @@ -86,8 +86,8 @@ namespace { class lastfght_state : public driver_device { public: - lastfght_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + lastfght_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), m_eeprom(*this, "eeprom"), m_screen(*this, "screen"), diff --git a/src/mame/subsino/subsino_io.cpp b/src/mame/subsino/subsino_io.cpp index ee93618d3c7..41e59afdd67 100644 --- a/src/mame/subsino/subsino_io.cpp +++ b/src/mame/subsino/subsino_io.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE(SS9802, ss9802_device, "ss9802", "Subsino SS9802 I/O") subsino_io_device::subsino_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) - , m_in_port_callback(*this) + , m_in_port_callback(*this, 0xff) , m_out_port_callback(*this) , m_port_data{0, 0, 0, 0, 0, 0, 0, 0, 0, 0} , m_port_dir{0, 0, 0, 0, 0, 0, 0, 0, 0, 0} @@ -50,13 +50,6 @@ ss9802_device::ss9802_device(const machine_config &mconfig, const char *tag, dev { } -void subsino_io_device::device_resolve_objects() -{ - // resolve read/write callbacks - m_in_port_callback.resolve_all(); - m_out_port_callback.resolve_all_safe(); -} - void subsino_io_device::device_start() { // save state @@ -76,7 +69,7 @@ u8 subsino_io_device::read_port_data(unsigned port) u8 data = m_port_data[port] & dir; if (dir != 0xff) { - if (!m_in_port_callback[port].isnull()) + if (!m_in_port_callback[port].isunset()) data |= m_in_port_callback[port]() & ~dir; else if (!machine().side_effects_disabled()) logerror("%s: Reading from undefined P%u input\n", machine().describe_context(), port); diff --git a/src/mame/subsino/subsino_io.h b/src/mame/subsino/subsino_io.h index 806a6d40899..36b207d7be5 100644 --- a/src/mame/subsino/subsino_io.h +++ b/src/mame/subsino/subsino_io.h @@ -16,8 +16,7 @@ public: protected: subsino_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); - // device_t overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/svision/svis_snd.cpp b/src/mame/svision/svis_snd.cpp index c7e4ffbc56b..6b9645d6a36 100644 --- a/src/mame/svision/svis_snd.cpp +++ b/src/mame/svision/svis_snd.cpp @@ -50,8 +50,6 @@ svision_sound_device::svision_sound_device(const machine_config &mconfig, const void svision_sound_device::device_start() { - m_irq_cb.resolve_safe(); - memset(&m_dma, 0, sizeof(m_dma)); memset(&m_noise, 0, sizeof(m_noise)); memset(m_channel, 0, sizeof(m_channel)); diff --git a/src/mame/tab/e22_kbd.cpp b/src/mame/tab/e22_kbd.cpp index 52525fe5227..f406866a500 100644 --- a/src/mame/tab/e22_kbd.cpp +++ b/src/mame/tab/e22_kbd.cpp @@ -200,10 +200,6 @@ e22_kbd_hle_device::e22_kbd_hle_device(const machine_config &mconfig, const char void e22_kbd_hle_device::device_start() { - // resolve callbacks - m_tx_handler.resolve_safe(); - m_cts_handler.resolve_safe(); - // signal ready m_cts_handler(0); } diff --git a/src/mame/taito/taitocchip.cpp b/src/mame/taito/taitocchip.cpp index 02110b540b0..a13077417a5 100644 --- a/src/mame/taito/taitocchip.cpp +++ b/src/mame/taito/taitocchip.cpp @@ -119,10 +119,10 @@ taito_cchip_device::taito_cchip_device(const machine_config &mconfig, const char m_upd4464_bank(*this, "upd4464_bank"), m_upd4464_bank68(*this, "upd4464_bank68"), m_sharedram(*this, "upd4464", 0x2000, ENDIANNESS_LITTLE), - m_in_pa_cb(*this), - m_in_pb_cb(*this), - m_in_pc_cb(*this), - m_in_ad_cb(*this), + m_in_pa_cb(*this, 0), + m_in_pb_cb(*this, 0), + m_in_pc_cb(*this, 0), + m_in_ad_cb(*this, 0), m_out_pa_cb(*this), m_out_pb_cb(*this), m_out_pc_cb(*this) @@ -209,17 +209,6 @@ void taito_cchip_device::device_add_mconfig(machine_config &config) upd.an7_func().set([this] { return BIT(m_in_ad_cb(), 7) ? 0xff : 0; }); } -void taito_cchip_device::device_resolve_objects() -{ - m_in_pa_cb.resolve_safe(0); - m_in_pb_cb.resolve_safe(0); - m_in_pc_cb.resolve_safe(0); - m_in_ad_cb.resolve_safe(0); - m_out_pa_cb.resolve_safe(); - m_out_pb_cb.resolve_safe(); - m_out_pc_cb.resolve_safe(); -} - void taito_cchip_device::device_start() { m_upd4464_bank->configure_entries(0, m_sharedram.length() / 0x400, &m_sharedram[0], 0x400); diff --git a/src/mame/taito/taitocchip.h b/src/mame/taito/taitocchip.h index 840d1174f8d..9c2f9d84ed9 100644 --- a/src/mame/taito/taitocchip.h +++ b/src/mame/taito/taitocchip.h @@ -41,7 +41,6 @@ protected: void cchip_map(address_map &map) ATTR_COLD; virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; - virtual void device_resolve_objects() override ATTR_COLD; virtual void device_start() override ATTR_COLD; virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; diff --git a/src/mame/taito/taitoio.cpp b/src/mame/taito/taitoio.cpp index eb20b4bd0bf..dc59d63d2ec 100644 --- a/src/mame/taito/taitoio.cpp +++ b/src/mame/taito/taitoio.cpp @@ -70,12 +70,12 @@ tc0040ioc_device::tc0040ioc_device(const machine_config &mconfig, const char *ta device_t(mconfig, TC0040IOC, tag, owner, clock), m_port(0), m_watchdog(*this, "watchdog"), - m_read_0_cb(*this), - m_read_1_cb(*this), - m_read_2_cb(*this), - m_read_3_cb(*this), + m_read_0_cb(*this, 0), + m_read_1_cb(*this, 0), + m_read_2_cb(*this, 0), + m_read_3_cb(*this, 0), m_write_4_cb(*this), - m_read_7_cb(*this) + m_read_7_cb(*this, 0) { std::fill(std::begin(m_regs), std::end(m_regs), 0); } @@ -86,13 +86,6 @@ tc0040ioc_device::tc0040ioc_device(const machine_config &mconfig, const char *ta void tc0040ioc_device::device_start() { - m_read_0_cb.resolve_safe(0); - m_read_1_cb.resolve_safe(0); - m_read_2_cb.resolve_safe(0); - m_read_3_cb.resolve_safe(0); - m_write_4_cb.resolve_safe(); - m_read_7_cb.resolve_safe(0); - save_item(NAME(m_regs)); save_item(NAME(m_port)); } @@ -215,13 +208,13 @@ DEFINE_DEVICE_TYPE(TC0220IOC, tc0220ioc_device, "tc0220ioc", "Taito TC0220IOC") tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0220IOC, tag, owner, clock), m_watchdog(*this, "watchdog"), - m_read_0_cb(*this), - m_read_1_cb(*this), - m_read_2_cb(*this), - m_read_3_cb(*this), + m_read_0_cb(*this, 0), + m_read_1_cb(*this, 0), + m_read_2_cb(*this, 0), + m_read_3_cb(*this, 0), m_write_3_cb(*this), m_write_4_cb(*this), - m_read_7_cb(*this) + m_read_7_cb(*this, 0) { std::fill(std::begin(m_regs), std::end(m_regs), 0); } @@ -232,14 +225,6 @@ tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *ta void tc0220ioc_device::device_start() { - m_read_0_cb.resolve_safe(0); - m_read_1_cb.resolve_safe(0); - m_read_2_cb.resolve_safe(0); - m_read_3_cb.resolve_safe(0); - m_write_3_cb.resolve_safe(); - m_write_4_cb.resolve_safe(); - m_read_7_cb.resolve_safe(0); - save_item(NAME(m_regs)); } @@ -333,13 +318,13 @@ DEFINE_DEVICE_TYPE(TC0510NIO, tc0510nio_device, "tc0510nio", "Taito TC0510NIO") tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0510NIO, tag, owner, clock), m_watchdog(*this, "watchdog"), - m_read_0_cb(*this), - m_read_1_cb(*this), - m_read_2_cb(*this), - m_read_3_cb(*this), + m_read_0_cb(*this, 0), + m_read_1_cb(*this, 0), + m_read_2_cb(*this, 0), + m_read_3_cb(*this, 0), m_write_3_cb(*this), m_write_4_cb(*this), - m_read_7_cb(*this) + m_read_7_cb(*this, 0) { std::fill(std::begin(m_regs), std::end(m_regs), 0); } @@ -350,14 +335,6 @@ tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *ta void tc0510nio_device::device_start() { - m_read_0_cb.resolve_safe(0); - m_read_1_cb.resolve_safe(0); - m_read_2_cb.resolve_safe(0); - m_read_3_cb.resolve_safe(0); - m_write_3_cb.resolve_safe(); - m_write_4_cb.resolve_safe(); - m_read_7_cb.resolve_safe(0); - save_item(NAME(m_regs)); } @@ -475,12 +452,12 @@ DEFINE_DEVICE_TYPE(TC0640FIO, tc0640fio_device, "tc0640fio", "Taito TC0640FIO") tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0640FIO, tag, owner, clock), m_watchdog(*this, "watchdog"), - m_read_0_cb(*this), - m_read_1_cb(*this), - m_read_2_cb(*this), - m_read_3_cb(*this), + m_read_0_cb(*this, 0), + m_read_1_cb(*this, 0), + m_read_2_cb(*this, 0), + m_read_3_cb(*this, 0), m_write_4_cb(*this), - m_read_7_cb(*this) + m_read_7_cb(*this, 0) { std::fill(std::begin(m_regs), std::end(m_regs), 0); } @@ -491,13 +468,6 @@ tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *ta void tc0640fio_device::device_start() { - m_read_0_cb.resolve_safe(0); - m_read_1_cb.resolve_safe(0); - m_read_2_cb.resolve_safe(0); - m_read_3_cb.resolve_safe(0); - m_write_4_cb.resolve_safe(); - m_read_7_cb.resolve_safe(0); - save_item(NAME(m_regs)); } diff --git a/src/mame/taito/taitosjsec.cpp b/src/mame/taito/taitosjsec.cpp index cf649f0e7be..e56db3838a9 100644 --- a/src/mame/taito/taitosjsec.cpp +++ b/src/mame/taito/taitosjsec.cpp @@ -14,7 +14,7 @@ taito_sj_security_mcu_device::taito_sj_security_mcu_device( : device_t(mconfig,TAITO_SJ_SECURITY_MCU, tag, owner, clock) , m_mcu(*this, "mcu") , m_int_mode(int_mode::NONE) - , m_68read_cb(*this) + , m_68read_cb(*this, 0xff) , m_68write_cb(*this) , m_68intrq_cb(*this) , m_busrq_cb(*this) @@ -90,11 +90,6 @@ void taito_sj_security_mcu_device::reset_w(int state) void taito_sj_security_mcu_device::device_start() { - m_68read_cb.resolve_safe(0xff); - m_68write_cb.resolve_safe(); - m_68intrq_cb.resolve_safe(); - m_busrq_cb.resolve_safe(); - save_item(NAME(m_addr)); save_item(NAME(m_mcu_data)); save_item(NAME(m_host_data)); diff --git a/src/mame/taito/tc0180vcu.cpp b/src/mame/taito/tc0180vcu.cpp index 1e7fb06aca1..8d252aa6cfb 100644 --- a/src/mame/taito/tc0180vcu.cpp +++ b/src/mame/taito/tc0180vcu.cpp @@ -73,18 +73,6 @@ tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *ta } //------------------------------------------------- -// device_resolve_objects - resolve objects that -// may be needed for other devices to set -// initial conditions at start time -//------------------------------------------------- - -void tc0180vcu_device::device_resolve_objects() -{ - m_inth_callback.resolve_safe(); - m_intl_callback.resolve_safe(); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/taito/tc0180vcu.h b/src/mame/taito/tc0180vcu.h index d063c646fe8..ac95a19b548 100644 --- a/src/mame/taito/tc0180vcu.h +++ b/src/mame/taito/tc0180vcu.h @@ -32,8 +32,7 @@ public: void tc0180vcu_memrw(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/mame/tektronix/tek410x_kbd.cpp b/src/mame/tektronix/tek410x_kbd.cpp index e8bf5a40961..74e5578ab27 100644 --- a/src/mame/tektronix/tek410x_kbd.cpp +++ b/src/mame/tektronix/tek410x_kbd.cpp @@ -154,12 +154,6 @@ tek410x_keyboard_device::tek410x_keyboard_device(const machine_config &mconfig, { } -void tek410x_keyboard_device::device_resolve_objects() -{ - m_tdata_callback.resolve_safe(); - m_rdata_callback.resolve_safe(); -} - void tek410x_keyboard_device::device_start() { save_item(NAME(m_select)); diff --git a/src/mame/tektronix/tek410x_kbd.h b/src/mame/tektronix/tek410x_kbd.h index 2702cfb8498..4af349a8fed 100644 --- a/src/mame/tektronix/tek410x_kbd.h +++ b/src/mame/tektronix/tek410x_kbd.h @@ -30,8 +30,7 @@ public: void reset_w(int state); protected: - // device-level overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/mame/telenova/compiskb.cpp b/src/mame/telenova/compiskb.cpp index d19d677e165..19c270091dc 100644 --- a/src/mame/telenova/compiskb.cpp +++ b/src/mame/telenova/compiskb.cpp @@ -240,8 +240,6 @@ compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, co void compis_keyboard_device::device_start() { - // resolve callbacks - m_out_tx_handler.resolve_safe(); m_out_tx_handler(1); // resolve output finder diff --git a/src/mame/televideo/tv950kb.cpp b/src/mame/televideo/tv950kb.cpp index 86f6fe992ac..24b58bc2272 100644 --- a/src/mame/televideo/tv950kb.cpp +++ b/src/mame/televideo/tv950kb.cpp @@ -21,11 +21,6 @@ tv950kb_device::tv950kb_device(const machine_config &mconfig, const char *tag, d { } -void tv950kb_device::device_resolve_objects() -{ - m_tx_cb.resolve_safe(); -} - void tv950kb_device::device_start() { } diff --git a/src/mame/televideo/tv950kb.h b/src/mame/televideo/tv950kb.h index d12b94a4223..6e4ddc7e807 100644 --- a/src/mame/televideo/tv950kb.h +++ b/src/mame/televideo/tv950kb.h @@ -28,8 +28,7 @@ public: void rx_w(int state); protected: - // device-specific overrides - virtual void device_resolve_objects() override; + // device_t implementation virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/televideo/tv955kb.cpp b/src/mame/televideo/tv955kb.cpp index 87bf42ca9f9..11653432687 100644 --- a/src/mame/televideo/tv955kb.cpp +++ b/src/mame/televideo/tv955kb.cpp @@ -32,12 +32,6 @@ tv955kb_device::tv955kb_device(const machine_config &mconfig, const char *tag, d { } -void tv955kb_device::device_resolve_objects() -{ - m_txd_cb.resolve_safe(); - m_reset_cb.resolve_safe(); -} - void tv955kb_device::device_start() { m_bell_timer = timer_alloc(FUNC(tv955kb_device::bell_q8), this); diff --git a/src/mame/televideo/tv955kb.h b/src/mame/televideo/tv955kb.h index 2d6ad11cd88..582cfb82256 100644 --- a/src/mame/televideo/tv955kb.h +++ b/src/mame/televideo/tv955kb.h @@ -28,8 +28,7 @@ public: void write_rxd(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; virtual void device_add_mconfig(machine_config &config) override; diff --git a/src/mame/ti/733_asr.cpp b/src/mame/ti/733_asr.cpp index 08f28ed486f..e36a7bd39ed 100644 --- a/src/mame/ti/733_asr.cpp +++ b/src/mame/ti/733_asr.cpp @@ -100,9 +100,6 @@ void asr733_device::device_start() m_bitmap->fill(0, visarea); - m_keyint_line.resolve(); - m_lineint_line.resolve(); - m_line_timer = timer_alloc(FUNC(asr733_device::line_tick), this); uint8_t *dst; diff --git a/src/mame/ti/911_vdt.cpp b/src/mame/ti/911_vdt.cpp index f9dacb65181..e118c3801e9 100644 --- a/src/mame/ti/911_vdt.cpp +++ b/src/mame/ti/911_vdt.cpp @@ -164,9 +164,6 @@ void vdt911_device::device_start() m_display_enable = false; m_blink_state = false; - m_keyint_line.resolve(); - m_lineint_line.resolve(); - /* set up cursor blink clock. 2Hz frequency -> .25s half-period. */ /*m_blink_clock =*/ diff --git a/src/mame/toaplan/gp9001.cpp b/src/mame/toaplan/gp9001.cpp index 19b3f49e7ce..b26fa7ddb74 100644 --- a/src/mame/toaplan/gp9001.cpp +++ b/src/mame/toaplan/gp9001.cpp @@ -278,7 +278,6 @@ void gp9001vdp_device::device_start() create_tilemaps(); m_gp9001_cb.resolve(); - m_vint_out_cb.resolve(); m_raise_irq_timer = timer_alloc(FUNC(gp9001vdp_device::raise_irq), this); @@ -336,8 +335,7 @@ void gp9001vdp_device::device_reset() init_scroll_regs(); - if (!m_vint_out_cb.isnull()) - m_vint_out_cb(0); + m_vint_out_cb(0); m_raise_irq_timer->adjust(attotime::never); } @@ -489,7 +487,7 @@ void gp9001vdp_device::scroll_reg_data_w(u16 data, u16 mem_mask) case 0x0e: /******* Initialise video controller register ? *******/ - case 0x0f: if (!m_vint_out_cb.isnull()) m_vint_out_cb(0); break; + case 0x0f: m_vint_out_cb(0); break; default: logerror("Hmmm, writing %08x to unknown video control register (%08x) !!!\n",data,m_scroll_reg); @@ -885,7 +883,7 @@ void gp9001vdp_device::screen_eof(void) if (m_sp.use_sprite_buffer) m_spriteram->copy(); // the IRQ appears to fire at line 0xe6 - if (!m_vint_out_cb.isnull()) + if (!m_vint_out_cb.isunset()) m_raise_irq_timer->adjust(screen().time_until_pos(0xe6)); } diff --git a/src/mame/trs/gime.cpp b/src/mame/trs/gime.cpp index 40d4bc32e81..e8dac9ddb5c 100644 --- a/src/mame/trs/gime.cpp +++ b/src/mame/trs/gime.cpp @@ -144,7 +144,7 @@ gime_device::gime_device(const machine_config &mconfig, device_type type, const , sam6883_friend_device_interface(mconfig, *this, 8) , m_write_irq(*this) , m_write_firq(*this) - , m_read_floating_bus(*this) + , m_read_floating_bus(*this, 0) , m_maincpu(*this, finder_base::DUMMY_TAG) , m_ram(*this, finder_base::DUMMY_TAG) , m_cart_device(*this, finder_base::DUMMY_TAG) @@ -193,11 +193,6 @@ void gime_device::device_start() m_write_banks[i] = machine().root_device().membank(buffer); } - // resolve callbacks - m_write_irq.resolve_safe(); - m_write_firq.resolve_safe(); - m_read_floating_bus.resolve_safe(0); - // set up ROM/RAM pointers m_rom = m_rom_region->base(); m_cart_rom = m_cart_device->get_cart_base(); diff --git a/src/mame/trs/tandy2kb.cpp b/src/mame/trs/tandy2kb.cpp index be56c5c96b9..efd1215525c 100644 --- a/src/mame/trs/tandy2kb.cpp +++ b/src/mame/trs/tandy2kb.cpp @@ -228,9 +228,6 @@ tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, void tandy2k_keyboard_device::device_start() { m_leds.resolve(); - // resolve callbacks - m_write_clock.resolve_safe(); - m_write_data.resolve_safe(); // state saving save_item(NAME(m_keylatch)); diff --git a/src/mame/trs/trs80m2kb.cpp b/src/mame/trs/trs80m2kb.cpp index 6bf716110b5..161c7a628f3 100644 --- a/src/mame/trs/trs80m2kb.cpp +++ b/src/mame/trs/trs80m2kb.cpp @@ -230,8 +230,6 @@ trs80m2_keyboard_device::trs80m2_keyboard_device(const machine_config &mconfig, void trs80m2_keyboard_device::device_start() { m_leds.resolve(); - // resolve callbacks - m_write_clock.resolve_safe(); // state saving save_item(NAME(m_busy)); diff --git a/src/mame/tvgames/elan_eu3a05_a.cpp b/src/mame/tvgames/elan_eu3a05_a.cpp index 1ae8a1bc704..93419fe940f 100644 --- a/src/mame/tvgames/elan_eu3a05_a.cpp +++ b/src/mame/tvgames/elan_eu3a05_a.cpp @@ -22,7 +22,7 @@ elan_eu3a05_sound_device::elan_eu3a05_sound_device(const machine_config &mconfig device_memory_interface(mconfig, *this), m_space_config("regs", ENDIANNESS_NATIVE, 8, 6, 0, address_map_constructor(FUNC(elan_eu3a05_sound_device::map), this)), m_stream(nullptr), - m_space_read_cb(*this), + m_space_read_cb(*this, 0), m_sound_end_cb(*this) { } @@ -53,11 +53,8 @@ void elan_eu3a05_sound_device::map(address_map &map) void elan_eu3a05_sound_device::device_start() { - m_space_read_cb.resolve_safe(0); m_stream = stream_alloc(0, 1, 8000); - m_sound_end_cb.resolve_all_safe(); - save_item(NAME(m_sound_byte_address)); save_item(NAME(m_sound_byte_len)); save_item(NAME(m_sound_current_nib_pos)); diff --git a/src/mame/tvgames/elan_eu3a05gpio.cpp b/src/mame/tvgames/elan_eu3a05gpio.cpp index 9d01f3d0618..b38d996bd8f 100644 --- a/src/mame/tvgames/elan_eu3a05gpio.cpp +++ b/src/mame/tvgames/elan_eu3a05gpio.cpp @@ -11,20 +11,14 @@ elan_eu3a05gpio_device::elan_eu3a05gpio_device(const machine_config &mconfig, co m_write_0_callback(*this), m_write_1_callback(*this), m_write_2_callback(*this), - m_read_0_callback(*this), - m_read_1_callback(*this), - m_read_2_callback(*this) + m_read_0_callback(*this, 0xff), + m_read_1_callback(*this, 0xff), + m_read_2_callback(*this, 0xff) { } void elan_eu3a05gpio_device::device_start() { - m_write_0_callback.resolve_safe(); - m_write_1_callback.resolve_safe(); - m_write_2_callback.resolve_safe(); - m_read_0_callback.resolve_safe(0xff); - m_read_1_callback.resolve_safe(0xff); - m_read_2_callback.resolve_safe(0xff); } void elan_eu3a05gpio_device::device_reset() diff --git a/src/mame/tvgames/xavix2002_io.cpp b/src/mame/tvgames/xavix2002_io.cpp index c193aabb02c..c3dd0f5b038 100644 --- a/src/mame/tvgames/xavix2002_io.cpp +++ b/src/mame/tvgames/xavix2002_io.cpp @@ -13,9 +13,9 @@ DEFINE_DEVICE_TYPE(XAVIX2002IO, xavix2002_io_device, "xavix2002io", "XaviX 2002 xavix2002_io_device::xavix2002_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XAVIX2002IO, tag, owner, clock) - , m_in0_cb(*this) - , m_in1_cb(*this) - , m_in2_cb(*this) + , m_in0_cb(*this, 0xff) + , m_in1_cb(*this, 0xff) + , m_in2_cb(*this, 0xff) , m_out0_cb(*this) , m_out1_cb(*this) , m_out2_cb(*this) @@ -24,14 +24,6 @@ xavix2002_io_device::xavix2002_io_device(const machine_config &mconfig, const ch void xavix2002_io_device::device_start() { - m_in0_cb.resolve_safe(0xff); - m_in1_cb.resolve_safe(0xff); - m_in2_cb.resolve_safe(0xff); - - m_out0_cb.resolve_safe(); - m_out1_cb.resolve_safe(); - m_out2_cb.resolve_safe(); - save_item(NAME(m_sx_pio_dir)); save_item(NAME(m_sx_pio_out)); } diff --git a/src/mame/tvgames/xavix_a.cpp b/src/mame/tvgames/xavix_a.cpp index febdba4f6eb..9470f8536de 100644 --- a/src/mame/tvgames/xavix_a.cpp +++ b/src/mame/tvgames/xavix_a.cpp @@ -17,16 +17,13 @@ xavix_sound_device::xavix_sound_device(const machine_config &mconfig, const char : device_t(mconfig, XAVIX_SOUND, tag, owner, clock) , device_sound_interface(mconfig, *this) , m_stream(nullptr) - , m_readregs_cb(*this) - , m_readsamples_cb(*this) + , m_readregs_cb(*this, 0xff) + , m_readsamples_cb(*this, 0x80) { } void xavix_sound_device::device_start() { - m_readregs_cb.resolve_safe(0xff); - m_readsamples_cb.resolve_safe(0x80); - m_stream = stream_alloc(0, 2, 163840); } diff --git a/src/mame/tvgames/xavix_adc.cpp b/src/mame/tvgames/xavix_adc.cpp index e1271e39e47..8a48dc477ae 100644 --- a/src/mame/tvgames/xavix_adc.cpp +++ b/src/mame/tvgames/xavix_adc.cpp @@ -11,28 +11,19 @@ DEFINE_DEVICE_TYPE(XAVIX_ADC, xavix_adc_device, "xavix_adc", "XaviX ADC") xavix_adc_device::xavix_adc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XAVIX_ADC, tag, owner, clock) - , m_in0_cb(*this) - , m_in1_cb(*this) - , m_in2_cb(*this) - , m_in3_cb(*this) - , m_in4_cb(*this) - , m_in5_cb(*this) - , m_in6_cb(*this) - , m_in7_cb(*this) + , m_in0_cb(*this, 0xff) + , m_in1_cb(*this, 0xff) + , m_in2_cb(*this, 0xff) + , m_in3_cb(*this, 0xff) + , m_in4_cb(*this, 0xff) + , m_in5_cb(*this, 0xff) + , m_in6_cb(*this, 0xff) + , m_in7_cb(*this, 0xff) { } void xavix_adc_device::device_start() { - m_in0_cb.resolve_safe(0xff); - m_in1_cb.resolve_safe(0xff); - m_in2_cb.resolve_safe(0xff); - m_in3_cb.resolve_safe(0xff); - m_in4_cb.resolve_safe(0xff); - m_in5_cb.resolve_safe(0xff); - m_in6_cb.resolve_safe(0xff); - m_in7_cb.resolve_safe(0xff); - m_adc_timer = timer_alloc(FUNC(xavix_adc_device::adc_timer_done), this); save_item(NAME(m_adc_control)); diff --git a/src/mame/tvgames/xavix_anport.cpp b/src/mame/tvgames/xavix_anport.cpp index 7f5356d570a..7eb66235e42 100644 --- a/src/mame/tvgames/xavix_anport.cpp +++ b/src/mame/tvgames/xavix_anport.cpp @@ -13,19 +13,15 @@ DEFINE_DEVICE_TYPE(XAVIX_ANPORT, xavix_anport_device, "xavix_anport", "XaviX Ana xavix_anport_device::xavix_anport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XAVIX_ANPORT, tag, owner, clock) - , m_in0_cb(*this) - , m_in1_cb(*this) - , m_in2_cb(*this) - , m_in3_cb(*this) + , m_in0_cb(*this, 0xff) + , m_in1_cb(*this, 0xff) + , m_in2_cb(*this, 0xff) + , m_in3_cb(*this, 0xff) { } void xavix_anport_device::device_start() { - m_in0_cb.resolve_safe(0xff); - m_in1_cb.resolve_safe(0xff); - m_in2_cb.resolve_safe(0xff); - m_in3_cb.resolve_safe(0xff); } void xavix_anport_device::device_reset() diff --git a/src/mame/tvgames/xavix_io.cpp b/src/mame/tvgames/xavix_io.cpp index ec44213ccff..25046211735 100644 --- a/src/mame/tvgames/xavix_io.cpp +++ b/src/mame/tvgames/xavix_io.cpp @@ -14,8 +14,8 @@ DEFINE_DEVICE_TYPE(XAVIXIO, xavix_io_device, "xavixio", "XaviX IO") xavix_io_device::xavix_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XAVIXIO, tag, owner, clock) - , m_in0_cb(*this) - , m_in1_cb(*this) + , m_in0_cb(*this, 0xff) + , m_in1_cb(*this, 0xff) , m_out0_cb(*this) , m_out1_cb(*this) { @@ -23,12 +23,6 @@ xavix_io_device::xavix_io_device(const machine_config &mconfig, const char *tag, void xavix_io_device::device_start() { - m_in0_cb.resolve_safe(0xff); - m_in1_cb.resolve_safe(0xff); - - m_out0_cb.resolve_safe(); - m_out1_cb.resolve_safe(); - save_item(NAME(m_dir)); save_item(NAME(m_dat)); } diff --git a/src/mame/tvgames/xavix_madfb_ball.cpp b/src/mame/tvgames/xavix_madfb_ball.cpp index a127ebdeeed..085a426747c 100644 --- a/src/mame/tvgames/xavix_madfb_ball.cpp +++ b/src/mame/tvgames/xavix_madfb_ball.cpp @@ -18,8 +18,8 @@ DEFINE_DEVICE_TYPE(XAVIX_MADFB_BALL, xavix_madfb_ball_device, "xavix_madfb_ball", "XaviX / Radica Football Ball") -xavix_madfb_ball_device::xavix_madfb_ball_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, XAVIX_MADFB_BALL, tag, owner, clock), +xavix_madfb_ball_device::xavix_madfb_ball_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, XAVIX_MADFB_BALL, tag, owner, clock), m_event_out_cb(*this), m_in(*this, "BALL") { @@ -76,7 +76,6 @@ ioport_constructor xavix_madfb_ball_device::device_input_ports() const void xavix_madfb_ball_device::device_start() { - m_event_out_cb.resolve_safe(); m_event_timer = timer_alloc(FUNC(xavix_madfb_ball_device::event_timer), this); } diff --git a/src/mame/tvgames/xavix_mtrk_wheel.cpp b/src/mame/tvgames/xavix_mtrk_wheel.cpp index 207b32563c1..9f1af76d791 100644 --- a/src/mame/tvgames/xavix_mtrk_wheel.cpp +++ b/src/mame/tvgames/xavix_mtrk_wheel.cpp @@ -5,8 +5,8 @@ DEFINE_DEVICE_TYPE(XAVIX_MTRK_WHEEL, xavix_mtrk_wheel_device, "xavix_mtrk_wheel", "XaviX / Radica Monster Truck Steering Wheel") -xavix_mtrk_wheel_device::xavix_mtrk_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, XAVIX_MTRK_WHEEL, tag, owner, clock), +xavix_mtrk_wheel_device::xavix_mtrk_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, XAVIX_MTRK_WHEEL, tag, owner, clock), m_event_out_cb(*this), m_in(*this, "WHEEL") { @@ -74,7 +74,6 @@ ioport_constructor xavix_mtrk_wheel_device::device_input_ports() const void xavix_mtrk_wheel_device::device_start() { - m_event_out_cb.resolve_safe(); m_event_timer = timer_alloc(FUNC(xavix_mtrk_wheel_device::event_timer), this); } diff --git a/src/mame/unisonic/gic.cpp b/src/mame/unisonic/gic.cpp index 287c55cb9e2..b8597203001 100644 --- a/src/mame/unisonic/gic.cpp +++ b/src/mame/unisonic/gic.cpp @@ -95,7 +95,7 @@ gic_device::gic_device(const machine_config &mconfig, device_type type, const ch , m_audiocnt(0) , m_audioval(0) , m_audioreset(0) - , m_ram(*this) + , m_ram(*this, 0xff) { } @@ -119,8 +119,6 @@ void gic_device::device_start() // allocate the audio stream m_stream = stream_alloc( 0, 1, clock()/(2*228) ); - - m_ram.resolve_safe(0xff); } diff --git a/src/mame/ussr/km035.cpp b/src/mame/ussr/km035.cpp index 0b9ca317a44..372c2e134c1 100644 --- a/src/mame/ussr/km035.cpp +++ b/src/mame/ussr/km035.cpp @@ -274,8 +274,6 @@ km035_device::km035_device(const machine_config &mconfig, const char *tag, devic void km035_device::device_start() { - m_tx_handler.resolve_safe(); - m_rts_handler.resolve_safe(); } diff --git a/src/mame/vectorgraphic/v4_kbd.cpp b/src/mame/vectorgraphic/v4_kbd.cpp index a9cdccf86b5..1d1ada9723a 100644 --- a/src/mame/vectorgraphic/v4_kbd.cpp +++ b/src/mame/vectorgraphic/v4_kbd.cpp @@ -145,7 +145,6 @@ void vector4_keyboard_device::device_start() void vector4_keyboard_device::device_resolve_objects() { - m_txd_cb.resolve_safe(); m_led.resolve(); } diff --git a/src/mame/vidbrain/uv201.cpp b/src/mame/vidbrain/uv201.cpp index 76028d6643d..c8e987a99a6 100644 --- a/src/mame/vidbrain/uv201.cpp +++ b/src/mame/vidbrain/uv201.cpp @@ -100,7 +100,7 @@ uv201_device::uv201_device(const machine_config &mconfig, const char *tag, devic device_video_interface(mconfig, *this), m_write_ext_int(*this), m_write_hblank(*this), - m_read_db(*this) + m_read_db(*this, 0) { } @@ -111,11 +111,6 @@ uv201_device::uv201_device(const machine_config &mconfig, const char *tag, devic void uv201_device::device_start() { - // resolve callbacks - m_write_ext_int.resolve_safe(); - m_write_hblank.resolve_safe(); - m_read_db.resolve_safe(0); - // allocate timers m_timer_y_odd = timer_alloc(FUNC(uv201_device::y_update_tick), this); m_timer_y_even = timer_alloc(FUNC(uv201_device::y_update_tick), this); diff --git a/src/mame/videoton/tvc_a.cpp b/src/mame/videoton/tvc_a.cpp index d80dfa1a97f..1537beb1922 100644 --- a/src/mame/videoton/tvc_a.cpp +++ b/src/mame/videoton/tvc_a.cpp @@ -28,9 +28,6 @@ tvc_sound_device::tvc_sound_device(const machine_config &mconfig, const char *ta //------------------------------------------------- void tvc_sound_device::device_start() { - // resolve callbacks - m_write_sndint.resolve_safe(); - m_stream = stream_alloc(0, 1, machine().sample_rate()); m_sndint_timer = timer_alloc(FUNC(tvc_sound_device::trigger_int), this); } diff --git a/src/mame/visual/v102_kbd.cpp b/src/mame/visual/v102_kbd.cpp index 5ecf727fc37..1301fe0c695 100644 --- a/src/mame/visual/v102_kbd.cpp +++ b/src/mame/visual/v102_kbd.cpp @@ -294,11 +294,6 @@ ioport_constructor v550_keyboard_device::device_input_ports() const return INPUT_PORTS_NAME(v550_keyboard); } -void visual_mcs48_keyboard_device::device_resolve_objects() -{ - m_txd_callback.resolve_safe(); -} - void visual_mcs48_keyboard_device::device_start() { m_key_select = 0x0f; diff --git a/src/mame/visual/v102_kbd.h b/src/mame/visual/v102_kbd.h index 22a1cdba24a..557087b352a 100644 --- a/src/mame/visual/v102_kbd.h +++ b/src/mame/visual/v102_kbd.h @@ -18,7 +18,6 @@ public: protected: visual_mcs48_keyboard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner); - virtual void device_resolve_objects() override; virtual void device_start() override; u8 p1_r(); diff --git a/src/mame/visual/v1050kb.cpp b/src/mame/visual/v1050kb.cpp index 6d2ed33d7a3..365bc8ea2f8 100644 --- a/src/mame/visual/v1050kb.cpp +++ b/src/mame/visual/v1050kb.cpp @@ -303,6 +303,7 @@ v1050_keyboard_device::v1050_keyboard_device(const machine_config &mconfig, cons void v1050_keyboard_device::device_start() { m_led.resolve(); + // state saving save_item(NAME(m_keylatch)); } @@ -314,7 +315,6 @@ void v1050_keyboard_device::device_start() void v1050_keyboard_device::device_reset() { - m_out_tx_handler.resolve_safe(); m_out_tx_handler(1); } diff --git a/src/mame/vsystem/vs9209.cpp b/src/mame/vsystem/vs9209.cpp index 49dd131f6e0..bb4e2a827da 100644 --- a/src/mame/vsystem/vs9209.cpp +++ b/src/mame/vsystem/vs9209.cpp @@ -42,7 +42,7 @@ DEFINE_DEVICE_TYPE(VS9209, vs9209_device, "vs9209", "VS9209 I/O") vs9209_device::vs9209_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, VS9209, tag, owner, clock) - , m_input_cb(*this) + , m_input_cb(*this, 0xff) , m_output_cb(*this) { } @@ -53,10 +53,6 @@ vs9209_device::vs9209_device(const machine_config &mconfig, const char *tag, dev void vs9209_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 @@ -89,7 +85,7 @@ u8 vs9209_device::read(address_space &space, offs_t offset) input_mask &= 0x0f; // read through callback if port not configured entirely for output - if (input_mask != 0 && !m_input_cb[port].isnull()) + if (input_mask != 0 && !m_input_cb[port].isunset()) input_data = m_input_cb[port](0, input_mask) & input_mask; else if (m_data_dir[port] == 0) logerror("%s: Read from undefined input port %c\n", machine().describe_context(), 'A' + port); @@ -127,12 +123,12 @@ void vs9209_device::write(offs_t offset, u8 data) u8 dataout = data & m_data_dir[port]; // send output through callback - if (!m_output_cb[port].isnull()) + if (!m_output_cb[port].isunset()) m_output_cb[port](0, dataout, m_data_dir[port]); else logerror("%s: Writing %02X to undefined output port %c\n", machine().describe_context(), dataout, 'A' + port); } - else if (m_output_cb[port].isnull()) + else if (m_output_cb[port].isunset()) logerror("%s: Writing %02X to input-only port %c\n", machine().describe_context(), data, 'A' + port); } else @@ -148,7 +144,7 @@ void vs9209_device::write(offs_t offset, u8 data) logerror("Port %c & %02X configured for output\n", 'A' + port, data); // if direction changed to output, begin output from latch - if ((data & ~old_data_dir) != 0 && !m_output_cb[port].isnull()) + if ((data & ~old_data_dir) != 0 && !m_output_cb[port].isunset()) m_output_cb[port](0, m_data_latch[port], data); } } diff --git a/src/mame/vsystem/vsystem_gga.cpp b/src/mame/vsystem/vsystem_gga.cpp index 0111664db95..661904aa457 100644 --- a/src/mame/vsystem/vsystem_gga.cpp +++ b/src/mame/vsystem/vsystem_gga.cpp @@ -36,8 +36,6 @@ vsystem_gga_device::vsystem_gga_device(const machine_config &mconfig, const char void vsystem_gga_device::device_start() { - m_write_cb.resolve(); - m_address_latch = 0; for (u8 ® : m_regs) reg = 0; @@ -61,7 +59,7 @@ void vsystem_gga_device::write(offs_t offset, u8 data) { // data write m_regs[m_address_latch] = data; - if (m_write_cb.isnull()) + if (m_write_cb.isunset()) logerror("Setting register $%02x = %02x\n", m_address_latch, data); else m_write_cb(m_address_latch, data, 0xff); diff --git a/src/mame/wang/wangpckb.cpp b/src/mame/wang/wangpckb.cpp index de2ad5027d2..d005fc67df3 100644 --- a/src/mame/wang/wangpckb.cpp +++ b/src/mame/wang/wangpckb.cpp @@ -383,7 +383,6 @@ wangpc_keyboard_device::wangpc_keyboard_device(const machine_config &mconfig, co void wangpc_keyboard_device::device_start() { - m_txd_handler.resolve_safe(); m_leds.resolve(); save_item(NAME(m_keylatch)); diff --git a/src/mame/xerox/x820kb.cpp b/src/mame/xerox/x820kb.cpp index 5c542657aa4..613e10b00ba 100644 --- a/src/mame/xerox/x820kb.cpp +++ b/src/mame/xerox/x820kb.cpp @@ -271,7 +271,6 @@ void xerox_820_keyboard_device::device_start() void xerox_820_keyboard_device::device_reset() { - m_kbstb_cb.resolve_safe(); } void xerox_820_keyboard_device::device_reset_after_children() diff --git a/src/mame/zaccaria/zaccaria_a.cpp b/src/mame/zaccaria/zaccaria_a.cpp index 93daa8d524b..0b633adcdfb 100644 --- a/src/mame/zaccaria/zaccaria_a.cpp +++ b/src/mame/zaccaria/zaccaria_a.cpp @@ -493,8 +493,6 @@ void zac1b11142_audio_device::device_start() { zac1b111xx_melody_base::device_start(); - m_acs_cb.resolve_safe(); - save_item(NAME(m_host_command)); } |
