summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mcs96
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2023-06-17 01:10:05 +1000
committer GitHub <noreply@github.com>2023-06-17 01:10:05 +1000
commite9c1f4a42a6758a6fb75403e28c7dc6cf869081c (patch)
tree8e0b6d960bed4baec2408c9ab950218592ef33ec /src/devices/cpu/mcs96
parentc1ceb6e016763537c5109cc76fe5d1b4ae72fdb3 (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.
Diffstat (limited to 'src/devices/cpu/mcs96')
-rw-r--r--src/devices/cpu/mcs96/i8x9x.cpp22
-rw-r--r--src/devices/cpu/mcs96/i8x9x.h1
2 files changed, 5 insertions, 18 deletions
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;