summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Brice Onken <32155223+briceonk@users.noreply.github.com>2026-05-19 10:43:33 -0700
committer GitHub <noreply@github.com>2026-05-19 13:43:33 -0400
commit3a9fb92d490d3484d50a240ad3d1daeff7b05e0e (patch)
tree521acf424ff71d6b561ffc13d44daec443983386 /src/devices
parent80419894898d00e7a3d22a028e5090f920ded9a9 (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/devices')
-rw-r--r--src/devices/bus/nscsi/cd.cpp2
-rw-r--r--src/devices/bus/nscsi/tape.cpp24
-rw-r--r--src/devices/bus/nscsi/tape.h14
3 files changed, 33 insertions, 7 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