From d0f790d81711b3cc3bc1f1e9eb60c7f800c16da0 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 27 Oct 2025 22:02:25 +0100 Subject: bus/pc8801/pc8801_31.cpp: just ack the bytes on data ports * fix mirrors hang at startup --- hash/pc8801_cdrom.xml | 24 ++++++++++++++++-------- src/devices/bus/nscsi/pc8801_30.cpp | 13 +++++++++---- src/devices/bus/pc8801/pc8801_31.cpp | 20 ++++++++++++++------ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/hash/pc8801_cdrom.xml b/hash/pc8801_cdrom.xml index 2f749fdc978..1ed05dfb8f0 100644 --- a/hash/pc8801_cdrom.xml +++ b/hash/pc8801_cdrom.xml @@ -9,8 +9,6 @@ license:CC0-1.0 PC-8801-31 SW list TODO: -- Add Mirrors dump (ones floating around are in .ccd/.sub/.img format); -- Add DIOS CD-ROM Ban dump (undumped?) - Reportedly later Koei and Falcom releases can optionally load the correlated audio CD soundtracks. Pinpoint how exactly they detect the presence of a valid CD-ROM, add candidates here. @@ -20,7 +18,11 @@ TODO: CD Takarabako 1989 NEC + + @@ -33,7 +35,11 @@ TODO: CD Takarabako (alt) 1989 NEC + + @@ -47,7 +53,10 @@ TODO: 1990 ザインソフト (Zain Soft) @@ -70,8 +79,8 @@ Throws "CD-ROM" not working after loading floppy 1990 ソフトスタジオWING (Soft Studio Wing) @@ -119,9 +128,8 @@ FDC stalls [Tries to match CHRN=(00 00 0x 01) with existing N=03, 2DD image?] - - + @@ -135,7 +143,7 @@ FDC stalls [Tries to match CHRN=(00 00 0x 01) with existing N=03, 2DD image?] - + diff --git a/src/devices/bus/nscsi/pc8801_30.cpp b/src/devices/bus/nscsi/pc8801_30.cpp index 310fa6fa684..47d6daa461b 100644 --- a/src/devices/bus/nscsi/pc8801_30.cpp +++ b/src/devices/bus/nscsi/pc8801_30.cpp @@ -19,8 +19,8 @@ DEFINE_DEVICE_TYPE(NSCSI_CDROM_PC8801_30, nscsi_cdrom_pc8801_30_device, "scsi_pc8801_30", "SCSI NEC PC8801-30 CD-ROM") -nscsi_cdrom_pc8801_30_device::nscsi_cdrom_pc8801_30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - nscsi_cdrom_device(mconfig, NSCSI_CDROM_PC8801_30, tag, owner, clock) +nscsi_cdrom_pc8801_30_device::nscsi_cdrom_pc8801_30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : nscsi_cdrom_device(mconfig, NSCSI_CDROM_PC8801_30, tag, owner, clock) { } @@ -431,6 +431,10 @@ void nscsi_cdrom_pc8801_30_device::scsi_command() { switch (scsi_cmdbuf[0]) { + case SC_READ_6: + nscsi_cdrom_device::scsi_command(); + LOGCMD("SC_READ_6: lba: %02x%02x%02x blocks: %02x\n", scsi_cmdbuf[1], scsi_cmdbuf[2], scsi_cmdbuf[3], scsi_cmdbuf[4]); + break; case SC_MODE_SELECT_6: LOG("command MODE SELECT 6 length %d\n", scsi_cmdbuf[4]); @@ -447,9 +451,10 @@ void nscsi_cdrom_pc8801_30_device::scsi_command() case 0xde: nec_get_dir_info(); break; default: - if (scsi_cmdbuf[0] != 0) - LOGCMD("Not yet emulated command %02x\n", scsi_cmdbuf[0]); // TODO: purge commands that don't exist on this implementation + if (scsi_cmdbuf[0] != SC_TEST_UNIT_READY && scsi_cmdbuf[0] != SC_REQUEST_SENSE) + popmessage("PC8801-30: potentially unavailable %02x command trigger", scsi_cmdbuf[0]); + nscsi_cdrom_device::scsi_command(); break; } diff --git a/src/devices/bus/pc8801/pc8801_31.cpp b/src/devices/bus/pc8801/pc8801_31.cpp index eaa83f5581f..a24ffa0c240 100644 --- a/src/devices/bus/pc8801/pc8801_31.cpp +++ b/src/devices/bus/pc8801/pc8801_31.cpp @@ -5,9 +5,9 @@ NEC PC8801-31 CD-ROM I/F TODO: -- Interface with PC8801-30 (the actual CD drive); -- Make it a slot option for PC-8801MA (does it have same ROM as the internal MC version?) -- Document BIOS program flow (PC=1000) +- Make it a slot option for PC-8801MA (does it have same ROM as the internal MC version?); +- volume fader; +- Document BIOS program flow (PC=1000); **************************************************************************************************/ @@ -136,6 +136,7 @@ void pc8801_31_device::amap(address_map &map) map(0x09, 0x09).rw(FUNC(pc8801_31_device::id_r), FUNC(pc8801_31_device::rom_bank_w)); map(0x0b, 0x0b).r(FUNC(pc8801_31_device::volume_meter_r<1>)); map(0x0d, 0x0d).r(FUNC(pc8801_31_device::volume_meter_r<0>)); + // TODO: bit 6 also used at startup, what for? map(0x0f, 0x0f).lw8( NAME([this](u8 data) { m_cddrive_enable = bool(BIT(data, 0)); }) ); @@ -164,6 +165,8 @@ u8 pc8801_31_device::status_r() m_sasi->io_r() << 3 | m_cddrive_enable); + // at boot up SEL=1 drives BSY, MSG, CD and IO low + // according to Takeda nobubufu (+ redbook CD) also wants this behaviour if (m_sasi_sel) res &= ~0xb8; @@ -189,7 +192,9 @@ void pc8801_31_device::select_w(u8 data) u8 pc8801_31_device::data_r() { u8 res = m_sasi->read(); - if (m_sasi->bsy_r() && m_sasi->io_r() && !machine().side_effects_disabled()) + + //if (m_sasi->bsy_r() && m_sasi->io_r() && !machine().side_effects_disabled()) + if (!machine().side_effects_disabled()) { m_sasi->ack_w(1); //m_sasi->write(0); @@ -202,7 +207,9 @@ void pc8801_31_device::data_w(u8 data) { m_sasi->write(data); - if (m_sasi->bsy_r() && !m_sasi->io_r()) + // do not guard against anything, just ack the byte + // (mirrors cares after the Views logo) + //if (m_sasi->bsy_r()) //&& !m_sasi->io_r()) { m_sasi->ack_w(1); //m_sasi->write(0); @@ -287,7 +294,7 @@ void pc8801_31_device::rom_bank_w(u8 data) * ? may just be sign, ignored by HW * */ -// TODO: templatìze, measure via real HW tests, is $9c / $9e actually low port? +// TODO: measure via real HW tests, is $9c / $9e actually low CDDA readback? template u8 pc8801_31_device::volume_meter_r() { return m_cddrive->get_channel_sample(N) >> 8; @@ -319,3 +326,4 @@ void pc8801_31_device::sasi_req_w(int state) m_sasi_req = state; } + -- cgit v1.2.3