summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/adc0808.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/adc0808.cpp')
-rw-r--r--src/devices/machine/adc0808.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/devices/machine/adc0808.cpp b/src/devices/machine/adc0808.cpp
index 11aafe276fb..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}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*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,15 +78,8 @@ 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();
-
- for (int i = 0; i < 8; i++)
- m_in_cb[i].resolve_safe(0xff);
-
// allocate timers
- m_cycle_timer = timer_alloc();
+ m_cycle_timer = timer_alloc(FUNC(adc0808_device::update_state), this);
m_cycle_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()));
// register for save states
@@ -98,10 +91,10 @@ void adc0808_device::device_start()
}
//-------------------------------------------------
-// device_timer - handler timer events
+// update_state
//-------------------------------------------------
-void adc0808_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(adc0808_device::update_state)
{
switch (m_state)
{
@@ -142,7 +135,7 @@ void adc0808_device::device_timer(emu_timer &timer, device_timer_id id, int para
logerror("Conversion finished, result %02x\n", m_sar);
if (m_sar != start_sar)
- logerror("Conversion finished, should fail - starting value %02x, ending value %02x", start_sar, m_sar);
+ logerror("Conversion finished, should fail - starting value %02x, ending value %02x\n", start_sar, m_sar);
// eoc is delayed by one cycle
m_cycle_timer->adjust(attotime::never);
@@ -175,7 +168,7 @@ void adc0808_device::address_w(u8 data)
m_address = data & 7;
}
-WRITE_LINE_MEMBER( adc0808_device::start_w )
+void adc0808_device::start_w(int state)
{
if (m_start == state)
return;
@@ -193,7 +186,7 @@ WRITE_LINE_MEMBER( adc0808_device::start_w )
m_start = state;
}
-READ_LINE_MEMBER( adc0808_device::eoc_r )
+int adc0808_device::eoc_r()
{
return m_eoc;
}