From 5424d500b5ca15d86a47e8b0b9babac1f9ba99d9 Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 2 Apr 2018 12:55:44 -0400 Subject: adc0808: Allow polling of EOC line (nw) --- src/devices/machine/adc0808.cpp | 10 +++++++++- src/devices/machine/adc0808.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/devices/machine/adc0808.cpp b/src/devices/machine/adc0808.cpp index 3c392c4cc39..2e45b377ae0 100644 --- a/src/devices/machine/adc0808.cpp +++ b/src/devices/machine/adc0808.cpp @@ -45,7 +45,7 @@ adc0808_device::adc0808_device(const machine_config &mconfig, device_type type, m_in_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} }, m_state(STATE_IDLE), m_cycle_timer(nullptr), - m_start(0), m_cycle(0), m_step(0), m_address(0), m_sar(0xff), m_eoc_pending(false) + m_start(0), m_cycle(0), m_step(0), m_address(0), m_sar(0xff), m_eoc(true), m_eoc_pending(false) { } @@ -96,6 +96,7 @@ void adc0808_device::device_start() save_item(NAME(m_step)); save_item(NAME(m_address)); save_item(NAME(m_sar)); + save_item(NAME(m_eoc)); save_item(NAME(m_eoc_pending)); } @@ -108,6 +109,7 @@ void adc0808_device::device_timer(emu_timer &timer, device_timer_id id, int para // eoc is delayed one cycle if (m_eoc_pending) { + m_eoc = true; m_eoc_cb(1); m_eoc_ff_cb(1); m_eoc_pending = false; @@ -167,6 +169,7 @@ WRITE_LINE_MEMBER( adc0808_device::start_w ) else if (m_start == 0 && state == 1) { m_sar = 0; + m_eoc = false; m_eoc_cb(0); m_eoc_pending = false; } @@ -174,6 +177,11 @@ WRITE_LINE_MEMBER( adc0808_device::start_w ) m_start = state; } +READ_LINE_MEMBER( adc0808_device::eoc_r ) +{ + return m_eoc ? 1 : 0; +} + WRITE8_MEMBER( adc0808_device::address_offset_start_w ) { if (VERBOSE) diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h index 0ee8c60c90b..646346d92df 100644 --- a/src/devices/machine/adc0808.h +++ b/src/devices/machine/adc0808.h @@ -96,6 +96,7 @@ public: DECLARE_READ8_MEMBER(data_r); DECLARE_WRITE8_MEMBER(address_w); DECLARE_WRITE_LINE_MEMBER(start_w); + DECLARE_READ_LINE_MEMBER(eoc_r); // common hookups DECLARE_WRITE8_MEMBER(address_offset_start_w); // start and ale connected, address to the address bus @@ -130,6 +131,7 @@ private: int m_step; int m_address; uint8_t m_sar; + bool m_eoc; bool m_eoc_pending; }; -- cgit v1.2.3