From a693f1e7e388c45364fa5856ab2a881e661a91ca Mon Sep 17 00:00:00 2001 From: robjustice Date: Mon, 8 Jan 2024 01:36:34 +1100 Subject: bus/a2bus/vista800.cpp: update dma priority and side select status (#11904) --- src/devices/bus/a2bus/vistaa800.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/devices/bus/a2bus/vistaa800.cpp b/src/devices/bus/a2bus/vistaa800.cpp index 802f1a9c3ae..7f8ea9fcaa9 100644 --- a/src/devices/bus/a2bus/vistaa800.cpp +++ b/src/devices/bus/a2bus/vistaa800.cpp @@ -9,6 +9,8 @@ This supported up to four double sided/double density 8inch drives. With DMA support for the data transfers, and booting from the first 8inch drive. + The card looks like it was released in 1981. The schematic is dated 19th Mar 1981 for the initial drawing, with a later revision date marked, however the month is not readable for it. + Manual available here: http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Disk%20Drive%20Controllers/Vista%20A800%20Disk%20Controller/Manuals/Vista%20A800%20Disk%20Controller%20Manual.pdf @@ -74,7 +76,6 @@ private: // fdc handlers void fdc_intrq_w(uint8_t state); void fdc_drq_w(uint8_t state); - void fdc_sso_w(uint8_t state); required_device m_fdc; required_device m_floppy0; @@ -88,7 +89,7 @@ private: bool m_dmaenable_write; uint8_t m_density; uint8_t m_side; - uint8_t m_sso; + uint8_t m_twosided; }; @@ -138,7 +139,6 @@ void a2bus_vistaa800_device::device_add_mconfig(machine_config &config) m_fdc->intrq_wr_callback().set(FUNC(a2bus_vistaa800_device::fdc_intrq_w)); m_fdc->drq_wr_callback().set(FUNC(a2bus_vistaa800_device::fdc_drq_w)); - m_fdc->sso_wr_callback().set(FUNC(a2bus_vistaa800_device::fdc_sso_w)); } void a2bus_vistaa800_device::device_start() @@ -148,7 +148,7 @@ void a2bus_vistaa800_device::device_start() save_item(NAME(m_dmaenable_write)); save_item(NAME(m_density)); save_item(NAME(m_side)); - save_item(NAME(m_sso)); + save_item(NAME(m_twosided)); } void a2bus_vistaa800_device::device_reset() @@ -158,7 +158,7 @@ void a2bus_vistaa800_device::device_reset() m_dmaenable_write = false; m_density = 0; m_side = 0; - m_sso = 0; + m_twosided = 0; } //---------------------------------------------- @@ -202,11 +202,9 @@ uint8_t a2bus_vistaa800_device::read_c0nx(uint8_t offset) case 0xf: if (m_dmaenable_read || m_dmaenable_write) - { - result = result | 0x80; - } + result |= 0x80; - result = result | (m_side << 5); // TODO: check this + result |= (m_twosided << 6); // 0 = two sided disk break; default: @@ -220,7 +218,7 @@ uint8_t a2bus_vistaa800_device::read_c0nx(uint8_t offset) void a2bus_vistaa800_device::write_c0nx(uint8_t offset, uint8_t data) { floppy_image_device *floppy = nullptr; - + switch (offset) { case 0: @@ -260,7 +258,7 @@ void a2bus_vistaa800_device::write_c0nx(uint8_t offset, uint8_t data) m_fdc->dden_w(m_density); m_side = BIT(data, 6); - + if (BIT(data, 0)) floppy = m_floppy0->get_device(); if (BIT(data, 1)) floppy = m_floppy1->get_device(); if (BIT(data, 2)) floppy = m_floppy2->get_device(); @@ -271,6 +269,7 @@ void a2bus_vistaa800_device::write_c0nx(uint8_t offset, uint8_t data) { floppy->ss_w(m_side); floppy->mon_w(0); + m_twosided = floppy->twosid_r(); } break; @@ -304,14 +303,13 @@ void a2bus_vistaa800_device::fdc_drq_w(uint8_t state) { if (state) { - if (m_dmaenable_read) // TODO: verify if both can be turned on at the same time, and which has priority + if (m_dmaenable_read) // read has priority if both were enabled { uint8_t data = m_fdc->data_r(); slot_dma_write(m_dmaaddr, data); m_dmaaddr++; } - - if (m_dmaenable_write) + else if (m_dmaenable_write) { uint8_t data = slot_dma_read(m_dmaaddr); m_fdc->data_w(data); @@ -320,11 +318,6 @@ void a2bus_vistaa800_device::fdc_drq_w(uint8_t state) } } -void a2bus_vistaa800_device::fdc_sso_w(uint8_t state) -{ - m_sso = state; // TODO: needs to be verified on real h/w. This is meant to be from the drive -} - } // anonymous namespace -- cgit v1.2.3