diff options
| author | 2025-11-22 20:31:40 +0100 | |
|---|---|---|
| committer | 2025-11-22 20:31:40 +0100 | |
| commit | 64ff4296b05e4623b63aa1484b905a7e9be2901f (patch) | |
| tree | a8e701bb0545d185bfa7e26817a5b11530de04a6 | |
| parent | 3c5c80dc2af65f6ca35b08e66fb6274341e31d94 (diff) | |
bus/pc98_cbus: implement eop
| -rw-r--r-- | src/devices/bus/nscsi/dtc510.cpp | 7 | ||||
| -rw-r--r-- | src/devices/bus/nscsi/dtc510.h | 2 | ||||
| -rw-r--r-- | src/devices/bus/pc98_cbus/pc9801_27.cpp | 12 | ||||
| -rw-r--r-- | src/devices/bus/pc98_cbus/pc9801_27.h | 1 | ||||
| -rw-r--r-- | src/devices/bus/pc98_cbus/slot.cpp | 10 | ||||
| -rw-r--r-- | src/devices/bus/pc98_cbus/slot.h | 2 | ||||
| -rw-r--r-- | src/mame/nec/pc88va.cpp | 18 | ||||
| -rw-r--r-- | src/mame/nec/pc88va.h | 2 | ||||
| -rw-r--r-- | src/mame/nec/pc9801.cpp | 17 |
9 files changed, 60 insertions, 11 deletions
diff --git a/src/devices/bus/nscsi/dtc510.cpp b/src/devices/bus/nscsi/dtc510.cpp index 01efe5cc9ab..1872697c761 100644 --- a/src/devices/bus/nscsi/dtc510.cpp +++ b/src/devices/bus/nscsi/dtc510.cpp @@ -91,7 +91,7 @@ void nscsi_dtc510_device::scsi_command() scsi_status_complete(SS_NOT_READY); scsi_sense_buffer[0] = SK_DRIVE_NOT_READY; } else { - m_seek = 0; + // lba = 0; scsi_status_complete(SS_GOOD); } break; @@ -101,7 +101,7 @@ void nscsi_dtc510_device::scsi_command() scsi_status_complete(SS_NOT_READY); scsi_sense_buffer[0] = SK_DRIVE_NOT_READY; } else { - m_seek = get_u24be(&scsi_cmdbuf[1]) & 0x1fffff; + //lba = get_u24be(&scsi_cmdbuf[1]) & 0x1fffff; scsi_status_complete(SS_GOOD); } break; @@ -121,7 +121,8 @@ void nscsi_dtc510_device::scsi_command() { const auto &info = image->get_info(); auto block = std::make_unique<uint8_t[]>(info.sectorbytes); - memset(&block[0], 0x6c, info.sectorbytes); + const u8 fill_byte = scsi_cmdbuf[3] == 0 ? 0xe5 : scsi_cmdbuf[3]; + memset(&block[0], fill_byte, info.sectorbytes); lba = get_u24be(&scsi_cmdbuf[1]) & 0x1fffff; for(; lba < (info.cylinders * info.heads * info.sectors); lba++) { image->write(lba, block.get()); diff --git a/src/devices/bus/nscsi/dtc510.h b/src/devices/bus/nscsi/dtc510.h index 17ec28328fa..b35bf124045 100644 --- a/src/devices/bus/nscsi/dtc510.h +++ b/src/devices/bus/nscsi/dtc510.h @@ -105,7 +105,7 @@ protected: virtual attotime scsi_data_command_delay() override; uint8_t m_param[10]; - u32 m_seek; + //u32 m_seek; }; DECLARE_DEVICE_TYPE(NSCSI_DTC510, nscsi_dtc510_device) diff --git a/src/devices/bus/pc98_cbus/pc9801_27.cpp b/src/devices/bus/pc98_cbus/pc9801_27.cpp index cbdf3edbe4c..868371cc29f 100644 --- a/src/devices/bus/pc98_cbus/pc9801_27.cpp +++ b/src/devices/bus/pc98_cbus/pc9801_27.cpp @@ -77,7 +77,7 @@ ioport_constructor pc9801_27_device::device_input_ports() const void pc9801_27_device::device_start() { - m_bus->set_dma_channel(0, this, false); + m_bus->set_dma_channel(0, this, true); save_item(NAME(m_control)); save_item(NAME(m_sasi_ack)); @@ -222,6 +222,14 @@ void pc9801_27_device::dack_w(int line, u8 data) data_w(data); } +void pc9801_27_device::eop_w(int state) +{ + if (state) + { + m_control &= 0xfd; + update_drq(); + } +} void pc9801_27_device::sasi_req_w(int state) { @@ -283,7 +291,7 @@ void pc9801_27_device::sasi_bsy_w(int state) void pc9801_27_device::update_irq() { - //printf("%d %d %d %d\n", m_sasi_req, m_sasi_msg, m_sasi_cd, m_sasi_io); +// printf("%d %d %d %d\n", m_sasi_req, m_sasi_msg, m_sasi_cd, m_sasi_io); //if (m_sasi_req && !m_sasi_msg && m_sasi_cd && m_sasi_io) if (m_sasi->req_r() && !m_sasi->msg_r() && m_sasi->cd_r() && m_sasi->io_r()) { diff --git a/src/devices/bus/pc98_cbus/pc9801_27.h b/src/devices/bus/pc98_cbus/pc9801_27.h index 47e6f3faa3e..95ce6e83f88 100644 --- a/src/devices/bus/pc98_cbus/pc9801_27.h +++ b/src/devices/bus/pc98_cbus/pc9801_27.h @@ -31,6 +31,7 @@ protected: virtual void remap(int space_id, offs_t start, offs_t end) override; virtual u8 dack_r(int line) override; virtual void dack_w(int line, u8 data) override; + virtual void eop_w(int state) override; private: required_device<nscsi_bus_device> m_sasibus; diff --git a/src/devices/bus/pc98_cbus/slot.cpp b/src/devices/bus/pc98_cbus/slot.cpp index a4606be4f83..4deb60c9a83 100644 --- a/src/devices/bus/pc98_cbus/slot.cpp +++ b/src/devices/bus/pc98_cbus/slot.cpp @@ -149,6 +149,12 @@ void pc98_cbus_root_device::dack_w(int line, u8 data) m_dma_device[line]->dack_w(line, data); } +void pc98_cbus_root_device::eop_w(int line, int state) +{ + if (m_dma_eop[line] && m_dma_device[line]) + m_dma_device[line]->eop_w(state); +} + void pc98_cbus_root_device::set_dma_channel(u8 channel, device_pc98_cbus_slot_interface *dev, bool do_eop) { m_dma_device[channel] = dev; @@ -178,6 +184,10 @@ void device_pc98_cbus_slot_interface::dack_w(int line, u8 data) { } +void device_pc98_cbus_slot_interface::eop_w(int state) +{ +} + pc98_cbus_slot_device::pc98_cbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc98_cbus_slot_device(mconfig, PC98_CBUS_SLOT, tag, owner, clock) diff --git a/src/devices/bus/pc98_cbus/slot.h b/src/devices/bus/pc98_cbus/slot.h index 3f366255e75..a4aeb00ff17 100644 --- a/src/devices/bus/pc98_cbus/slot.h +++ b/src/devices/bus/pc98_cbus/slot.h @@ -99,6 +99,7 @@ public: u8 dack_r(int line); void dack_w(int line, u8 data); + void eop_w(int line, int state); // from card to C-Bus void int_w(int Line, int state) { m_int_cb[Line](state); } @@ -137,6 +138,7 @@ public: virtual void remap(int space_id, offs_t start, offs_t end) {} virtual u8 dack_r(int line); virtual void dack_w(int line, u8 data); + virtual void eop_w(int state); void set_bus(pc98_cbus_root_device *cbus_device) { m_bus = cbus_device; } diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index 7b218db9daf..249d850d497 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -1198,7 +1198,15 @@ void pc88va_state::int4_irq_w(int state) void pc88va_state::tc_w(int state) { - m_fdc->tc_w(state); + switch(m_dack) + { + case 0: + m_cbus_root->eop_w(0, state); + break; + case 2: + m_fdc->tc_w(state); + break; + } } void pc88va_state::floppy_formats(format_registration &fr) @@ -1241,6 +1249,8 @@ void pc88va_state::machine_start() m_fdd[0]->get_device()->set_rpm(300); m_fdd[1]->get_device()->set_rpm(300); m_fdc->set_rate(250000); + + save_item(NAME(m_dack)); } void pc88va_state::machine_reset() @@ -1267,6 +1277,8 @@ void pc88va_state::machine_reset() m_misc_ctrl = 0x00; m_sound_irq_enable = true; m_sound_irq_pending = false; + + m_dack = -1; } // NOTE: PC-88VA implementation omits some C-Bus lines compared to PC-98. @@ -1309,6 +1321,10 @@ void pc88va_state::pc88va(machine_config &config) m_maincpu->out_iow_cb<2>().set(m_fdc, FUNC(upd765a_device::dma_w)); m_maincpu->in_memr_cb().set([this] (offs_t offset) { return m_maincpu->space(AS_PROGRAM).read_byte(offset); }); m_maincpu->out_memw_cb().set([this] (offs_t offset, u8 data) { m_maincpu->space(AS_PROGRAM).write_byte(offset, data); }); + m_maincpu->out_dack_cb<0>().set([this] (int state) { if (!state) m_dack = 0; }); + m_maincpu->out_dack_cb<1>().set([this] (int state) { if (!state) m_dack = 1; }); + m_maincpu->out_dack_cb<2>().set([this] (int state) { if (!state) m_dack = 2; }); + m_maincpu->out_dack_cb<3>().set([this] (int state) { if (!state) m_dack = 3;}); pc88va_cbus(config); diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index fd0873070de..2a88ede4c67 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -301,6 +301,8 @@ private: void sgp_map(address_map &map) ATTR_COLD; + int m_dack; + // TODO: stuff backported from PC88/PC98 as QoL that should really be common protected: required_device<gfxdecode_device> m_gfxdecode; diff --git a/src/mame/nec/pc9801.cpp b/src/mame/nec/pc9801.cpp index ac8d9646cb4..db91f7dc4fd 100644 --- a/src/mame/nec/pc9801.cpp +++ b/src/mame/nec/pc9801.cpp @@ -1215,10 +1215,19 @@ void pc9801_state::dma_hrq_changed(int state) void pc9801_state::tc_w(int state) { - /* floppy terminal count */ - m_fdc_2hd->tc_w(state); - if(m_fdc_2dd) - m_fdc_2dd->tc_w(state); + switch (m_dack) + { + case 0: + m_cbus_root->eop_w(0, state); + break; + case 2: + case 3: + m_fdc_2hd->tc_w(state); + if(m_fdc_2dd) + m_fdc_2dd->tc_w(state); + break; + } + // logerror("TC %02x\n",state); } |
