summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ncr5390.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ncr5390.cpp')
-rw-r--r--src/devices/machine/ncr5390.cpp72
1 files changed, 70 insertions, 2 deletions
diff --git a/src/devices/machine/ncr5390.cpp b/src/devices/machine/ncr5390.cpp
index 729e486856d..c140c2bd8b9 100644
--- a/src/devices/machine/ncr5390.cpp
+++ b/src/devices/machine/ncr5390.cpp
@@ -7,6 +7,7 @@
#define DELAY_HACK
DEFINE_DEVICE_TYPE(NCR5390, ncr5390_device, "ncr5390", "NCR 5390 SCSI")
+DEFINE_DEVICE_TYPE(NCR53C94, ncr53c94_device, "ncr53c94", "NCR 53C94 SCSI")
DEVICE_ADDRESS_MAP_START(map, 8, ncr5390_device)
AM_RANGE(0x0, 0x0) AM_READWRITE(tcount_lo_r, tcount_lo_w)
@@ -21,8 +22,25 @@ DEVICE_ADDRESS_MAP_START(map, 8, ncr5390_device)
AM_RANGE(0x9, 0x9) AM_WRITE(clock_w)
ADDRESS_MAP_END
-ncr5390_device::ncr5390_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nscsi_device(mconfig, NCR5390, tag, owner, clock)
+DEVICE_ADDRESS_MAP_START(map, 8, ncr53c94_device)
+ AM_RANGE(0x0, 0x0) AM_READWRITE(tcount_lo_r, tcount_lo_w)
+ AM_RANGE(0x1, 0x1) AM_READWRITE(tcount_hi_r, tcount_hi_w)
+ AM_RANGE(0x2, 0x2) AM_READWRITE(fifo_r, fifo_w)
+ AM_RANGE(0x3, 0x3) AM_READWRITE(command_r, command_w)
+ AM_RANGE(0x4, 0x4) AM_READWRITE(status_r, bus_id_w)
+ AM_RANGE(0x5, 0x5) AM_READWRITE(istatus_r, timeout_w)
+ AM_RANGE(0x6, 0x6) AM_READWRITE(seq_step_r, sync_period_w)
+ AM_RANGE(0x7, 0x7) AM_READWRITE(fifo_flags_r, sync_offset_w)
+ AM_RANGE(0x8, 0x8) AM_READWRITE(conf_r, conf_w)
+ AM_RANGE(0x9, 0x9) AM_WRITE(clock_w)
+ AM_RANGE(0xa, 0xa) AM_WRITE(test_w)
+ AM_RANGE(0xb, 0xb) AM_READWRITE(conf2_r, conf2_w)
+ AM_RANGE(0xc, 0xc) AM_READWRITE(conf3_r, conf3_w)
+ AM_RANGE(0xf, 0xf) AM_WRITE(fifo_align_w)
+ADDRESS_MAP_END
+
+ncr5390_device::ncr5390_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nscsi_device(mconfig, type, tag, owner, clock)
, tm(nullptr), config(0), status(0), istatus(0), clock_conv(0), sync_offset(0), sync_period(0), bus_id(0)
, select_timeout(0), seq(0), tcount(0), mode(0), fifo_pos(0), command_pos(0), state(0), xfr_phase(0), command_length(0), dma_dir(0), irq(false), drq(false)
, m_irq_handler(*this)
@@ -30,6 +48,19 @@ ncr5390_device::ncr5390_device(const machine_config &mconfig, const char *tag, d
{
}
+ncr5390_device::ncr5390_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ncr5390_device(mconfig, NCR5390, tag, owner, clock)
+{
+}
+
+ncr53c94_device::ncr53c94_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : ncr5390_device(mconfig, NCR53C94, tag, owner, clock)
+ , test_mode(false)
+ , config2(0)
+ , config3(0)
+{
+}
+
void ncr5390_device::device_start()
{
nscsi_device::device_start();
@@ -866,3 +897,40 @@ void ncr5390_device::drq_clear()
m_drq_handler(drq);
}
}
+
+void ncr53c94_device::device_start()
+{
+ save_item(NAME(test_mode));
+ save_item(NAME(config2));
+ save_item(NAME(config3));
+
+ test_mode = false;
+ config2 = 0;
+ config3 = 0;
+
+ ncr5390_device::device_start();
+}
+
+void ncr53c94_device::reset_soft()
+{
+ test_mode = false;
+ config2 = 0;
+ config3 = 0;
+
+ ncr5390_device::reset_soft();
+}
+
+WRITE8_MEMBER(ncr53c94_device::conf_w)
+{
+ ncr5390_device::conf_w(space, offset, data, mem_mask);
+
+ // test mode can only be cleared by hard/soft reset
+ if (data & 0x8)
+ test_mode = true;
+}
+
+WRITE8_MEMBER(ncr53c94_device::test_w)
+{
+ if (test_mode)
+ logerror("%s: test_w %d (%08x) - test mode not implemented\n", tag(), data, space.device().safe_pc());
+}