diff options
| author | 2026-04-12 15:17:49 +0300 | |
|---|---|---|
| committer | 2026-04-12 15:17:49 +0300 | |
| commit | 13493035a704249a425828ae0316eb4dcab0b551 (patch) | |
| tree | 5a53ad0ab7199b2db9c7481263e9eb6c8647d036 | |
| parent | 476b92f075f06e99d5c7213848e14b67b16b1774 (diff) | |
luxor/x37: WIP
| -rw-r--r-- | src/mame/luxor/x37.cpp | 18 | ||||
| -rw-r--r-- | src/mame/luxor/x37_sasi.cpp | 26 | ||||
| -rw-r--r-- | src/mame/luxor/x37_sasi.h | 3 |
3 files changed, 31 insertions, 16 deletions
diff --git a/src/mame/luxor/x37.cpp b/src/mame/luxor/x37.cpp index 0edc6b45a05..f131bdf2958 100644 --- a/src/mame/luxor/x37.cpp +++ b/src/mame/luxor/x37.cpp @@ -15,7 +15,6 @@ - trap 46 on boot - SASI - - bus errors - tst.w 0xfffffc - SCC interrupt acknowledge @@ -207,7 +206,12 @@ uint16_t x37_state::ram_r(offs_t offset, uint16_t mem_mask) bool at0, at1; offs_t const ma = get_ma(offset, at0, at1); - if (ma < 0x400000) { + if (!machine().side_effects_disabled() && at1 && !at0) { + // AT1=1, AT0=0: no access + m_cpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); + m_cpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); + logerror("%s: Invalid RAM read at offset %06x (MA %06x, AT1=1, AT0=0)\n", machine().describe_context(), offset<<1, ma); + } else if (ma < 0x400000) { if (ACCESSING_BITS_0_7) data |= m_ram[ma & ~1]; if (ACCESSING_BITS_8_15) @@ -225,6 +229,14 @@ void x37_state::ram_w(offs_t offset, uint16_t data, uint16_t mem_mask) bool at0, at1; offs_t const ma = get_ma(offset, at0, at1); + if (!machine().side_effects_disabled() && !at0) { + // AT0=0: read-only (AT1=0) or no access (AT1=1) + m_cpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); + m_cpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); + logerror("%s: Invalid RAM write at offset %06x (MA %06x, AT1=%d, AT0=0)\n", machine().describe_context(), offset<<1, ma, at1); + return; + } + if (ma < 0x400000) { if (ACCESSING_BITS_0_7) m_ram[ma & ~1] = data; @@ -429,7 +441,7 @@ void x37_state::xdck_w(offs_t offset, uint16_t data, uint16_t mem_mask) */ - logerror("%s XDCK %04x\n", machine().describe_context(), data); + LOG("%s XDCK %04x\n", machine().describe_context(), data); if (ACCESSING_BITS_0_7) { m_fdc->mr_w(BIT(data, 0)); diff --git a/src/mame/luxor/x37_sasi.cpp b/src/mame/luxor/x37_sasi.cpp index bf167701725..885a6c51093 100644 --- a/src/mame/luxor/x37_sasi.cpp +++ b/src/mame/luxor/x37_sasi.cpp @@ -30,12 +30,11 @@ luxor_x37_sasi_device::luxor_x37_sasi_device(const machine_config &mconfig, cons void luxor_x37_sasi_device::device_start() { save_item(NAME(m_int)); - save_item(NAME(m_req0)); + save_item(NAME(m_brq)); save_item(NAME(m_data_out)); save_item(NAME(m_a)); save_item(NAME(m_hlc)); save_item(NAME(m_dir)); - save_item(NAME(m_rc)); } void luxor_x37_sasi_device::device_reset() @@ -52,32 +51,37 @@ void luxor_x37_sasi_device::scsi_ctrl_changed() if (m_scsi_bus->ctrl_r() & S_REQ) { if (m_dir) - if (m_hlc) + if (!m_hlc) m_buffer[m_a] = (m_scsi_bus->data_r() << 8) | (m_buffer[m_a] & 0xff); else m_buffer[m_a] = m_scsi_bus->data_r() | (m_buffer[m_a] & 0xff00); else - if (m_hlc) + if (!m_hlc) m_scsi_bus->data_w(m_scsi_refid, m_buffer[m_a] >> 8); else m_scsi_bus->data_w(m_scsi_refid, m_buffer[m_a] & 0xff); m_hlc = !m_hlc; - if (m_hlc) { - m_rc = 0; + if (!m_hlc) { + m_brq = 1; m_a++; if (m_a == 16) { - m_rc = 1; + m_brq = 0; m_a = 0; } - // TODO write_req0 + m_write_req0(!m_brq); } m_scsi_bus->ctrl_w(m_scsi_refid, S_ACK, S_ACK); - } else + } else { + if (m_brq) { + m_brq = 0; + m_write_req0(1); + } m_scsi_bus->ctrl_w(m_scsi_refid, 0, S_ACK); + } } uint16_t luxor_x37_sasi_device::stat_r(offs_t offset, uint16_t mem_mask) @@ -94,7 +98,7 @@ uint16_t luxor_x37_sasi_device::stat_r(offs_t offset, uint16_t mem_mask) 5 0 6 0 7 0 - 8 *REQ0 + 8 BRQ 9 SCSIDIR 10 11 @@ -109,7 +113,7 @@ uint16_t luxor_x37_sasi_device::stat_r(offs_t offset, uint16_t mem_mask) data |= m_hlc; data |= m_a << 1; - data |= m_req0 << 8; + data |= !m_brq << 8; data |= m_dir << 9; data |= m_scsi_bus->ctrl_r() & S_BSY ? 1 << 14 : 0; data |= m_int << 15; diff --git a/src/mame/luxor/x37_sasi.h b/src/mame/luxor/x37_sasi.h index aa307c969d4..6a97418cdba 100644 --- a/src/mame/luxor/x37_sasi.h +++ b/src/mame/luxor/x37_sasi.h @@ -55,12 +55,11 @@ private: memory_share_creator<u16> m_buffer; bool m_int = 1; - bool m_req0 = 1; + bool m_brq = 1; u8 m_data_out = 0; offs_t m_a = 0; bool m_hlc = 0; bool m_dir = 0; - bool m_rc = 1; }; |
