summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/scsi
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-11-13 17:54:38 +0100
committer mooglyguy <therealmogminer@gmail.com>2018-11-13 17:55:47 +0100
commit882b5376a8d59b9eaa2faef35c9ff8a8a36d95d3 (patch)
treed636801e0f34116d808e17081f6bccf80f931643 /src/devices/bus/scsi
parent0d948ec7e238e8bdd6ab7559bd04359283e6b318 (diff)
-scsicd512.cpp: Added various legacy SCSI CD-ROM devices which support 512-byte blocks by default. [Ryan Holtz]
-nscsi_cd.cpp: Added various new-SCSI CD-ROM devices which support 512-byte blocks by default. [Ryan Holtz] -sgikbd.cpp: Added a rudimentary HLE SGI Indigo keyboard device. Still needs keys to be mapped. [Ryan Holtz] -indigo.cpp: Various changes: [Ryan Holtz] * Expanded logging. * Enabled PIT8254 timer. Has the wrong clock value; the correct clock causes a hang. * Improved RAM layout. * Added stubs for DSP RAM and Entry-level graphics.
Diffstat (limited to 'src/devices/bus/scsi')
-rw-r--r--src/devices/bus/scsi/scsicd512.cpp102
-rw-r--r--src/devices/bus/scsi/scsicd512.h86
2 files changed, 188 insertions, 0 deletions
diff --git a/src/devices/bus/scsi/scsicd512.cpp b/src/devices/bus/scsi/scsicd512.cpp
new file mode 100644
index 00000000000..5395d9ff5b4
--- /dev/null
+++ b/src/devices/bus/scsi/scsicd512.cpp
@@ -0,0 +1,102 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+/***************************************************************************
+
+ DEC RRD45 CD-ROM
+
+***************************************************************************/
+
+#include "emu.h"
+#include "scsicd512.h"
+
+DEFINE_DEVICE_TYPE(RRD45, dec_rrd45_device, "rrd45", "DEC RRD45")
+DEFINE_DEVICE_TYPE(XM3301, toshiba_xm3301_device, "xm3301", "Toshiba XM-3301TA CD-ROM")
+DEFINE_DEVICE_TYPE(XM5301SUN, toshiba_xm5301_sun_device, "xm5301sun", "Toshiba XM-5301B Sun 4x CD-ROM")
+DEFINE_DEVICE_TYPE(XM5401SUN, toshiba_xm5401_sun_device, "xm5401sun", "Toshiba XM-5401B Sun 4x CD-ROM")
+DEFINE_DEVICE_TYPE(XM5701, toshiba_xm5701_device, "xm5701", "Toshiba XM-5701B 12x CD-ROM")
+DEFINE_DEVICE_TYPE(XM5701SUN, toshiba_xm5701_sun_device, "xm5701sun", "Toshiba XM-5701B Sun 12x CD-ROM")
+
+void scsicd512_device::device_reset()
+{
+ scsihle_device::device_reset();
+
+ m_sector_bytes = 512;
+ m_num_subblocks = 4;
+}
+
+void scsicd512_device::ExecCommand()
+{
+ switch (command[0])
+ {
+ case 0x12: // INQUIRY
+ m_phase = SCSI_PHASE_DATAIN;
+ m_status_code = SCSI_STATUS_CODE_GOOD;
+ m_transfer_length = SCSILengthFromUINT8(&command[4]);
+ break;
+ default:
+ scsicd_device::ExecCommand();
+ break;
+ }
+}
+
+void scsicd512_device::ReadData(uint8_t *data, int dataLength)
+{
+ switch (command[0])
+ {
+ case 0x12: // INQUIRY
+ {
+ uint8_t buffer[36];
+ memset(buffer, 0, dataLength);
+ buffer[0] = 0x05; // device is present, device is CD/DVD (MMC-3)
+ buffer[1] = 0x80; // media is removable
+ buffer[2] = 0x02; // copied from response from actual drive
+ buffer[3] = 0x02; // response data format = SPC-3 standard
+ buffer[4] = 0x1f; // copied ...
+ buffer[7] = 0x98; // copied ...
+ memcpy(&buffer[8], m_manufacturer, 8);
+ memcpy(&buffer[16], m_product, 16);
+ memcpy(&buffer[32], m_revision, 4);
+ memcpy(data, buffer, dataLength);
+ break;
+ }
+
+ default:
+ scsicd_device::ReadData(data, dataLength);
+ break;
+ }
+}
+
+scsicd512_device::scsicd512_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd_device(mconfig, type, tag, owner, clock)
+{
+}
+
+dec_rrd45_device::dec_rrd45_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, RRD45, tag, owner, "DEC ", "RRD45 (C) DEC ", "0436", 0x98)
+{
+}
+
+toshiba_xm3301_device::toshiba_xm3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, XM3301, tag, owner, "TOSHIBA ", "CD-ROM XM-3301TA", "0272", 0x88)
+{
+}
+
+toshiba_xm5301_sun_device::toshiba_xm5301_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, XM5301SUN, tag, owner, "TOSHIBA ", "XM-5301TASUN4XCD", "2915", 0x98)
+{
+}
+
+toshiba_xm5401_sun_device::toshiba_xm5401_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, XM5401SUN, tag, owner, "TOSHIBA ", "XM-5401TASUN4XCD", "1036", 0x98)
+{
+}
+
+toshiba_xm5701_device::toshiba_xm5701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, XM5701, tag, owner, "TOSHIBA ", "CD-ROM XM-5701TA", "3136", 0x98)
+{
+}
+
+toshiba_xm5701_sun_device::toshiba_xm5701_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ scsicd512_device(mconfig, XM5701SUN, tag, owner, "TOSHIBA ", "XM5701TASUN12XCD", "0997", 0x98)
+{
+}
diff --git a/src/devices/bus/scsi/scsicd512.h b/src/devices/bus/scsi/scsicd512.h
new file mode 100644
index 00000000000..0345a74ca9a
--- /dev/null
+++ b/src/devices/bus/scsi/scsicd512.h
@@ -0,0 +1,86 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+/***************************************************************************
+
+ Various 512-byte-block SCSI CD-ROM devices
+
+***************************************************************************/
+
+#ifndef DEVICES_BUS_SCSI_SCSICD512_H
+#define DEVICES_BUS_SCSI_SCSICD512_H
+
+#pragma once
+
+#include "scsicd.h"
+
+class scsicd512_device : public scsicd_device
+{
+public:
+ virtual void ExecCommand() override;
+ virtual void ReadData(uint8_t *data, int dataLength) override;
+
+protected:
+ scsicd512_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0);
+
+ scsicd512_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner,
+ const char *mfr, const char *product, const char *rev, uint8_t data)
+ : scsicd512_device(mconfig, type, tag, owner, 0)
+ {
+ strncpy(m_manufacturer, mfr, 8);
+ strncpy(m_product, product, 16);
+ strncpy(m_revision, rev, 4);
+ m_data = data;
+ }
+
+ virtual void device_reset() override;
+
+ char m_manufacturer[8];
+ char m_product[16];
+ char m_revision[4];
+ uint8_t m_data;
+};
+
+class dec_rrd45_device : public scsicd512_device
+{
+public:
+ dec_rrd45_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+class toshiba_xm3301_device : public scsicd512_device
+{
+public:
+ toshiba_xm3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+class toshiba_xm5301_sun_device : public scsicd512_device
+{
+public:
+ toshiba_xm5301_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+class toshiba_xm5401_sun_device : public scsicd512_device
+{
+public:
+ toshiba_xm5401_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+class toshiba_xm5701_device : public scsicd512_device
+{
+public:
+ toshiba_xm5701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+class toshiba_xm5701_sun_device : public scsicd512_device
+{
+public:
+ toshiba_xm5701_sun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+};
+
+DECLARE_DEVICE_TYPE(RRD45, dec_rrd45_device)
+DECLARE_DEVICE_TYPE(XM3301, toshiba_xm3301_device)
+DECLARE_DEVICE_TYPE(XM5301SUN, toshiba_xm5301_sun_device)
+DECLARE_DEVICE_TYPE(XM5401SUN, toshiba_xm5401_sun_device)
+DECLARE_DEVICE_TYPE(XM5701, toshiba_xm5701_device)
+DECLARE_DEVICE_TYPE(XM5701SUN, toshiba_xm5701_sun_device)
+
+#endif // DEVICES_BUS_SCSI_SCSICD512_H