diff options
| author | 2026-05-19 10:43:33 -0700 | |
|---|---|---|
| committer | 2026-05-19 13:43:33 -0400 | |
| commit | 3a9fb92d490d3484d50a240ad3d1daeff7b05e0e (patch) | |
| tree | 521acf424ff71d6b561ffc13d44daec443983386 /src | |
| parent | 80419894898d00e7a3d22a028e5090f920ded9a9 (diff) | |
Add tape support to Sony NEWS drivers and clean up CD-ROM support (#15353)
* Add SCSI tape drive recognized by NEWS-OS 4
* Fix CD-ROM type for proper identification by NEWS-OS
* Have the tape drive identify as a Sony NWP-546
Diffstat (limited to 'src')
| -rw-r--r-- | src/devices/bus/nscsi/cd.cpp | 2 | ||||
| -rw-r--r-- | src/devices/bus/nscsi/tape.cpp | 24 | ||||
| -rw-r--r-- | src/devices/bus/nscsi/tape.h | 14 | ||||
| -rw-r--r-- | src/mame/sony/news_38xx.cpp | 4 | ||||
| -rw-r--r-- | src/mame/sony/news_68k.cpp | 4 | ||||
| -rw-r--r-- | src/mame/sony/news_68k_iop.cpp | 4 | ||||
| -rw-r--r-- | src/mame/sony/news_r3k.cpp | 4 | ||||
| -rw-r--r-- | src/mame/sony/news_r4k.cpp | 2 |
8 files changed, 45 insertions, 13 deletions
diff --git a/src/devices/bus/nscsi/cd.cpp b/src/devices/bus/nscsi/cd.cpp index fdb75661f6c..000b2dc5de8 100644 --- a/src/devices/bus/nscsi/cd.cpp +++ b/src/devices/bus/nscsi/cd.cpp @@ -57,7 +57,7 @@ nscsi_cdrom_sgi_device::nscsi_cdrom_sgi_device(const machine_config &mconfig, co } nscsi_cdrom_news_device::nscsi_cdrom_news_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - nscsi_cdrom_device(mconfig, NSCSI_CDROM_NEWS, tag, owner, "Sony", "CD-ROM CDU-541", "1.0A", 0x00, 0x05) + nscsi_cdrom_device(mconfig, NSCSI_CDROM_NEWS, tag, owner, "SONY", "CD-ROM CDU-541", "1.0A", 0x00, 0x05) { } diff --git a/src/devices/bus/nscsi/tape.cpp b/src/devices/bus/nscsi/tape.cpp index 52e28d68990..8d8a6e00ffe 100644 --- a/src/devices/bus/nscsi/tape.cpp +++ b/src/devices/bus/nscsi/tape.cpp @@ -42,25 +42,39 @@ void clear_response(uint8_t (&buf)[N], T len) DEFINE_DEVICE_TYPE(NSCSI_TAPE, nscsi_tape_device, "scsi_tape", "SCSI tape"); +DEFINE_DEVICE_TYPE(NSCSI_TAPE_NEWS, nscsi_tape_news_device, "scsi_tape_news", "SCSI tape NEWS"); ////////////////////////////////////////////////////////////////////////////// // construction -nscsi_tape_device::nscsi_tape_device(const machine_config &config, device_type type, const char *tag, device_t *owner, u32 clock) +nscsi_tape_device::nscsi_tape_device(const machine_config &config, device_type type, const char *tag, device_t *owner, + u32 clock, const std::string_view manufacturer, const std::string_view product, const std::string_view revision) : nscsi_full_device(config, type, tag, owner, clock) , m_image(*this, "image") , m_sequence_counter(0) , m_has_tape(false) , m_tape_changed(false) , m_fixed_block_len(TAPE_DEFAULT_FIXED_BLOCK_LEN) + , manufacturer(manufacturer) + , product(product) + , revision(revision) , m_rw_buf_size(m_fixed_block_len) , m_rw_pending(false) { } nscsi_tape_device::nscsi_tape_device(const machine_config &config, const char *tag, device_t *owner, u32 clock) - : nscsi_tape_device(config, NSCSI_TAPE, tag, owner, clock) + : nscsi_tape_device(config, NSCSI_TAPE, tag, owner, clock, "MAME", "SCSI tape drive", "1.0") +{ +} + +// This device uses the IDNT info from an Archive Viper 2150S tape drive, used by Sony in the NWP-546 external tape +// drive and is supported out-of-the-box by NEWS-OS 4. Some formats may require using different IDNT data, like the +// Anritsu DMT780 or Archive Viper 2525 for QIC-525, or the Sony SDT-1000 for DAT (among other formats/drives) +// See /usr/src/sys/newsiodev/stdefs.c for more information (or to compile a kernel with support for other drives) +nscsi_tape_news_device::nscsi_tape_news_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + nscsi_tape_device(mconfig, NSCSI_TAPE_NEWS, tag, owner, clock, "ARCHIVE", "VIPER 150", "0000") { } @@ -250,9 +264,9 @@ void nscsi_tape_device::handle_inquiry(const u8 lun) // mandatory; SCSI-2 sectio m_scsi_cmdbuf[2] = 0x02; // we're compliant with SCSI-2 only m_scsi_cmdbuf[3] = 0x02; // we use SCSI-2 response format m_scsi_cmdbuf[4] = 32; // additional length - strncpy((char *)&m_scsi_cmdbuf[8], "MAME", 8); // vendor - strncpy((char *)&m_scsi_cmdbuf[16], "SCSI tape drive", 16); // product - strncpy((char *)&m_scsi_cmdbuf[32], "1.0", 4); // revision + std::copy_n(manufacturer.data(), std::min(manufacturer.size(), static_cast<size_t>(8)), &m_scsi_cmdbuf[8]); // drive manufacturer + std::copy_n(product.data(), std::min(product.size(), static_cast<size_t>(16)), &m_scsi_cmdbuf[16]); // product code + std::copy_n(revision.data(), std::min(revision.size(), static_cast<size_t>(4)), &m_scsi_cmdbuf[32]); // product/firmware revision for (u32 i = 8; i < 36; i++) { if (m_scsi_cmdbuf[i] == 0) m_scsi_cmdbuf[i] = ' '; // pad strings with spaces diff --git a/src/devices/bus/nscsi/tape.h b/src/devices/bus/nscsi/tape.h index a70c43c7cd0..485f8b4715e 100644 --- a/src/devices/bus/nscsi/tape.h +++ b/src/devices/bus/nscsi/tape.h @@ -10,6 +10,7 @@ #include "machine/nscsi_hle.h" DECLARE_DEVICE_TYPE(NSCSI_TAPE, nscsi_tape_device); +DECLARE_DEVICE_TYPE(NSCSI_TAPE_NEWS, nscsi_tape_news_device) ////////////////////////////////////////////////////////////////////////////// @@ -20,7 +21,7 @@ public: nscsi_tape_device(const machine_config &config, const char *tag, device_t *owner, u32 clock = 0); protected: - nscsi_tape_device(const machine_config &config, device_type type, const char *tag, device_t *owner, u32 clock); + nscsi_tape_device(const machine_config &config, device_type type, const char *tag, device_t *owner, u32 clock, const std::string_view manufacturer, const std::string_view product, const std::string_view revision); // device_t implementation virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; @@ -62,6 +63,11 @@ protected: bool m_tape_changed; // should we report medium changed next time we receive command u32 m_fixed_block_len; // fixed-length block length + // INQUIRY data + const std::string_view manufacturer; + const std::string_view product; + const std::string_view revision; + // state for READ and WRITE u32 m_rw_buf_size; // size of read/write buffer std::unique_ptr<u8[]> m_rw_buf; // read/write buffer @@ -78,6 +84,12 @@ protected: u32 m_pl_len; // length of valid data in parameter list buffer }; +class nscsi_tape_news_device : public nscsi_tape_device +{ +public: + nscsi_tape_news_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); +}; + ////////////////////////////////////////////////////////////////////////////// #endif // MAME_BUS_NSCSI_TAPE_H diff --git a/src/mame/sony/news_38xx.cpp b/src/mame/sony/news_38xx.cpp index 4b94a30d75d..573e346a0c3 100644 --- a/src/mame/sony/news_38xx.cpp +++ b/src/mame/sony/news_38xx.cpp @@ -851,8 +851,8 @@ void news_38xx_state::reset_cpu_registers() void news_scsi_devices(device_slot_interface &device) { device.option_add("harddisk", NSCSI_HARDDISK); - device.option_add("cdrom", NSCSI_CDROM); - device.option_add("tape", NSCSI_TAPE); + device.option_add("cdrom", NSCSI_CDROM_NEWS); + device.option_add("tape", NSCSI_TAPE_NEWS); } void news_38xx_state::common(machine_config &config) diff --git a/src/mame/sony/news_68k.cpp b/src/mame/sony/news_68k.cpp index 409d3b024ac..8803991cdb8 100644 --- a/src/mame/sony/news_68k.cpp +++ b/src/mame/sony/news_68k.cpp @@ -95,6 +95,7 @@ __| | | |ALS05A| |N82077 | __ 6 x 74F00J-> #include "machine/nscsi_bus.h" #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "bus/rs232/rs232.h" #include "machine/input_merger.h" @@ -372,7 +373,8 @@ u32 news_68k_state::bus_error_r() static void news_scsi_devices(device_slot_interface &device) { device.option_add("harddisk", NSCSI_HARDDISK); - device.option_add("cdrom", NSCSI_CDROM); + device.option_add("cdrom", NSCSI_CDROM_NEWS); + device.option_add("tape", NSCSI_TAPE_NEWS); } void news_68k_state::common(machine_config &config) diff --git a/src/mame/sony/news_68k_iop.cpp b/src/mame/sony/news_68k_iop.cpp index 4905eb5ea6b..9802a52cf23 100644 --- a/src/mame/sony/news_68k_iop.cpp +++ b/src/mame/sony/news_68k_iop.cpp @@ -796,8 +796,8 @@ namespace static void news_scsi_devices(device_slot_interface &device) { device.option_add("harddisk", NSCSI_HARDDISK); - device.option_add("cdrom", NSCSI_CDROM); - device.option_add("tape", NSCSI_TAPE); + device.option_add("cdrom", NSCSI_CDROM_NEWS); + device.option_add("tape", NSCSI_TAPE_NEWS); } void news_iop_state::handle_rts(int data) diff --git a/src/mame/sony/news_r3k.cpp b/src/mame/sony/news_r3k.cpp index 0365ff564f8..58ab2ca5da6 100644 --- a/src/mame/sony/news_r3k.cpp +++ b/src/mame/sony/news_r3k.cpp @@ -26,6 +26,7 @@ #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "bus/rs232/rs232.h" #include "cpu/mips/mips1.h" #include "imagedev/floppy.h" @@ -467,7 +468,8 @@ void news_r3k_base_state::debug_w(u8 data) static void news_scsi_devices(device_slot_interface &device) { device.option_add("harddisk", NSCSI_HARDDISK); - device.option_add("cdrom", NSCSI_CDROM); + device.option_add("cdrom", NSCSI_CDROM_NEWS); + device.option_add("tape", NSCSI_TAPE_NEWS); } void news_r3k_base_state::common(machine_config &config) diff --git a/src/mame/sony/news_r4k.cpp b/src/mame/sony/news_r4k.cpp index 61549b9a563..90220a8831c 100644 --- a/src/mame/sony/news_r4k.cpp +++ b/src/mame/sony/news_r4k.cpp @@ -97,6 +97,7 @@ #include "bus/nscsi/cd.h" #include "bus/nscsi/hd.h" +#include "bus/nscsi/tape.h" #include "bus/rs232/rs232.h" #include "cpu/mips/r4000.h" #include "imagedev/floppy.h" @@ -373,6 +374,7 @@ static void news_scsi_devices(device_slot_interface &device) { device.option_add("harddisk", NSCSI_HARDDISK); device.option_add("cdrom", NSCSI_CDROM_NEWS); + device.option_add("tape", NSCSI_TAPE_NEWS); } /* |
