Skip to content

Commit ac41fe6

Browse files
committed
tek4132: add scsi and dma controller
icm3216: add scsi controller
1 parent 47f8f4b commit ac41fe6

File tree

2 files changed

+129
-62
lines changed

2 files changed

+129
-62
lines changed

src/mame/natsemi/icm3216.cpp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// various hardware
3131
#include "machine/mc68681.h"
3232
#include "machine/mm58274c.h"
33-
//#include "machine/ncr5385.h"
33+
#include "machine/ncr5385.h"
3434
#include "machine/ns32081.h"
3535
#include "machine/ns32082.h"
3636
#include "machine/ns32202.h"
@@ -60,7 +60,7 @@ class icm3216_state : public driver_device
6060
, m_duart(*this, "duart%u", 0U)
6161
, m_serial(*this, "serial%u", 0U)
6262
, m_iop(*this, "iop")
63-
//, m_scsi(*this, "scsi:7:ncr5385")
63+
, m_scsi(*this, "scsi:7:ncr5385")
6464
, m_led(*this, "led%u", 1U)
6565
, m_boot(*this, "boot")
6666
{
@@ -106,7 +106,7 @@ class icm3216_state : public driver_device
106106
required_device_array<rs232_port_device, 4> m_serial;
107107

108108
required_device<z80_device> m_iop;
109-
//required_device<ncr5385_device> m_scsi;
109+
required_device<ncr5385_device> m_scsi;
110110

111111
output_finder<5> m_led;
112112

@@ -126,7 +126,9 @@ class icm3216_state : public driver_device
126126
enum iop_status_mask : u8
127127
{
128128
IOP_IID = 0x07, // subchannel interrupt ID
129-
IOP_IRS = 0x10, // interrupt request set
129+
IOP_IRS = 0x10, // interrupt request
130+
IOP_RST = 0x20, // scsi reset
131+
IOP_ABT = 0x40, // scsi abort interrupt?
130132
IOP_BSY = 0x80, // busy
131133
};
132134

@@ -254,7 +256,7 @@ void icm3216_state::iop_mem_map(address_map &map)
254256
// c015 write 0x08
255257
// c017 write 0x00 (after read16?, clear BSY?)
256258

257-
//map(0xc020, 0xc02f).m(m_scsi, FUNC(ncr5385_device::map));
259+
map(0xc020, 0xc02f).m(m_scsi, FUNC(ncr5385_device::map));
258260
}
259261

260262
void icm3216_state::iop_pio_map(address_map &map)
@@ -328,9 +330,6 @@ void icm3216_state::icm3216(machine_config &config)
328330
NSCSI_CONNECTOR(config, "scsi:4", scsi_devices, nullptr, false);
329331
NSCSI_CONNECTOR(config, "scsi:5", scsi_devices, nullptr, false);
330332
NSCSI_CONNECTOR(config, "scsi:6", scsi_devices, nullptr, false);
331-
#if 1
332-
NSCSI_CONNECTOR(config, "scsi:7", scsi_devices, nullptr, false);
333-
#else
334333
NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr5385", NCR5385).machine_config(
335334
[this](device_t *device)
336335
{
@@ -341,7 +340,6 @@ void icm3216_state::icm3216(machine_config &config)
341340
ncr5385.irq().set(*this, FUNC(icm3216_state::iop_int<2>));
342341
ncr5385.dreq().set_inputline(m_iop, INPUT_LINE_NMI);
343342
});
344-
#endif
345343
}
346344

347345
void icm3216_state::parity_select_w(u8 data)
@@ -480,15 +478,22 @@ u8 icm3216_state::iop_r()
480478

481479
void icm3216_state::iop_w(u8 data)
482480
{
481+
/*
482+
* cmd function
483+
* 0x00 write command pointer table (followed by address, lsb first)
484+
* 0x01 acknowledge interrupt
485+
* 0x02 reset i/o controller?
486+
* 0x03 scsi reset
487+
* 0x05 reset i/o controller?
488+
* 0x1n start i/o subchannel n
489+
* 0x2n abort i/o subchannel n
490+
*/
483491
LOG("iop_w 0x%02x (%s)\n", data, machine().describe_context());
484492
m_iop_cmd = data;
485493

486-
if (false)
487-
{
488-
m_iop_sts |= IOP_BSY;
494+
m_iop_sts |= IOP_BSY;
489495

490-
iop_int<1>(1);
491-
}
496+
iop_int<1>(1);
492497
}
493498

494499
// iop interrupt vector bits

0 commit comments

Comments
 (0)