adc0808: Allow polling of EOC line (nw)

This commit is contained in:
AJR 2018-04-02 12:55:44 -04:00
parent 064e459e32
commit 5424d500b5
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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;
};