From 5a89c1f7ba3c24ff668e69eb5ff7e963aa6dc63f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 20 Feb 2024 19:35:24 +0100 Subject: -bus/idpartner/sasi.cpp : managed to load data from disk --- src/devices/bus/idpartner/sasi.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/devices/bus/idpartner/sasi.cpp b/src/devices/bus/idpartner/sasi.cpp index 8895c889e23..9cc29845230 100644 --- a/src/devices/bus/idpartner/sasi.cpp +++ b/src/devices/bus/idpartner/sasi.cpp @@ -36,6 +36,7 @@ protected: void reset_w(u8 data); void req_w(int state); + void io_w(int state); private: required_device m_sasibus; @@ -87,7 +88,9 @@ u8 idpartner_sasi_device::data_r() { u8 data = m_sasi->read(); if (m_data_enable) { - m_sasi->ack_w(1); + m_sasi->ack_w(1); + if (m_drq_enable) + m_bus->drq_w(0); } return data; } @@ -98,6 +101,8 @@ void idpartner_sasi_device::ctrl_w(u8 data) m_sasi->sel_w(BIT(data,0)); m_data_enable = BIT(data,1); m_drq_enable = BIT(data,5); + if (m_data_enable && m_drq_enable) + m_bus->drq_w(m_sasi->req_r()); } void idpartner_sasi_device::data_w(u8 data) @@ -105,6 +110,8 @@ void idpartner_sasi_device::data_w(u8 data) m_sasi->write(data); if (m_data_enable) { m_sasi->ack_w(1); + if (m_drq_enable) + m_bus->drq_w(0); } } @@ -117,6 +124,14 @@ void idpartner_sasi_device::reset_w(u8 data) void idpartner_sasi_device::req_w(int state) { m_sasi->ack_w(0); + if (m_data_enable && m_drq_enable) + m_bus->drq_w(state); +} + +void idpartner_sasi_device::io_w(int state) +{ + if (state) + m_sasi->write(0); // clears lateched data } void idpartner_sasi_device::device_add_mconfig(machine_config &config) @@ -127,6 +142,7 @@ void idpartner_sasi_device::device_add_mconfig(machine_config &config) .option_add_internal("scsicb", NSCSI_CB) .machine_config([this](device_t* device) { downcast(*device).req_callback().set(*this, FUNC(idpartner_sasi_device::req_w)); + downcast(*device).io_callback().set(*this, FUNC(idpartner_sasi_device::io_w)); }); } } // anonymous namespace -- cgit v1.2.3