Skip to content

Commit dc2ba0e

Browse files
committed
machine/ncr5380.cpp: Add DP8490 type so that its Enhanced Mode can be emulated in the future
1 parent da5ddf8 commit dc2ba0e

File tree

4 files changed

+40
-26
lines changed

4 files changed

+40
-26
lines changed

src/devices/bus/archimedes/podule/scsi_cumana.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class arc_scsi_cumana_device :
4444
virtual void memc_map(address_map &map) override ATTR_COLD;
4545

4646
private:
47-
required_device<ncr5380_device> m_ncr5380;
47+
required_device<dp8490_device> m_dp8490;
4848
required_device<eeprom_serial_93cxx_device> m_eeprom;
4949
required_memory_region m_podule_rom;
5050

@@ -56,10 +56,10 @@ void arc_scsi_cumana_device::ioc_map(address_map &map)
5656
{
5757
map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | ((m_rom_page << 11) & 0xf800)]; })).umask32(0x000000ff);
5858
map(0x0000, 0x1fff).lw8(NAME([this](u8 data) { m_rom_page = data; }));
59-
//map(0x2000, 0x201f).mirror(0x0100).rw(m_ncr5380, FUNC(ncr5380_device::read), FUNC(ncr5380_device::write)).umask32(0x000000ff);
60-
map(0x2100, 0x211f).m(m_ncr5380, FUNC(ncr5380_device::map)).umask32(0x000000ff);
61-
//map(0x2100, 0x2100).r(m_ncr5380, FUNC(ncr5380_device::dma_r));
62-
//map(0x2100, 0x2100).w(m_ncr5380, FUNC(ncr5380_device::dma_w));
59+
//map(0x2000, 0x201f).mirror(0x0100).rw(m_dp8490, FUNC(dp8490_device::read), FUNC(dp8490_device::write)).umask32(0x000000ff);
60+
map(0x2100, 0x211f).m(m_dp8490, FUNC(dp8490_device::map)).umask32(0x000000ff);
61+
//map(0x2100, 0x2100).r(m_dp8490, FUNC(dp8490_device::dma_r));
62+
//map(0x2100, 0x2100).w(m_dp8490, FUNC(dp8490_device::dma_w));
6363
}
6464

6565
void arc_scsi_cumana_device::memc_map(address_map &map)
@@ -96,10 +96,10 @@ void arc_scsi_cumana_device::device_add_mconfig(machine_config &config)
9696
NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr, false);
9797
NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false);
9898
NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr, false);
99-
NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr5380", NCR5380) // DP8490
99+
NSCSI_CONNECTOR(config, "scsi:7").option_set("dp8490", DP8490) // DP8490N
100100
.machine_config([this](device_t *device)
101101
{
102-
downcast<ncr5380_device &>(*device).irq_handler().set([this](int state) { set_pirq(state); });
102+
downcast<dp8490_device &>(*device).irq_handler().set([this](int state) { set_pirq(state); });
103103
});
104104

105105
EEPROM_93C06_16BIT(config, m_eeprom);
@@ -117,7 +117,7 @@ void arc_scsi_cumana_device::device_add_mconfig(machine_config &config)
117117
arc_scsi_cumana_device::arc_scsi_cumana_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
118118
: device_t(mconfig, ARC_SCSI_CUMANA, tag, owner, clock)
119119
, device_archimedes_podule_interface(mconfig, *this)
120-
, m_ncr5380(*this, "scsi:7:ncr5380")
120+
, m_dp8490(*this, "scsi:7:dp8490")
121121
, m_eeprom(*this, "eeprom")
122122
, m_podule_rom(*this, "podule_rom")
123123
, m_rom_page(0)

src/devices/machine/ncr5380.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
// copyright-holders:Patrick Mackinlay
33

44
/*
5-
* NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180 and others.
5+
* NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180, National Semiconductor DP8490, Logic Devices L5380 and others.
66
*
77
* Sources:
88
* - http://bitsavers.org/components/ncr/scsi/SP-1051_NCR_5380-53C80_SCSI_Interface_Chip_Design_Manual_Mar86.pdf
99
*
1010
* TODO:
1111
* - target mode
12-
* - cxd1180 enhancements
12+
* - CXD1180 enhancements
13+
* - DP8490 enhancements
1314
*/
1415

1516
#include "emu.h"
@@ -27,6 +28,7 @@
2728
DEFINE_DEVICE_TYPE(NCR5380, ncr5380_device, "ncr5380", "NCR 5380 SCSI")
2829
DEFINE_DEVICE_TYPE(NCR53C80, ncr53c80_device, "ncr53c80", "NCR 53C80 SCSI")
2930
DEFINE_DEVICE_TYPE(CXD1180, cxd1180_device, "cxd1180", "Sony CXD1180")
31+
DEFINE_DEVICE_TYPE(DP8490, dp8490_device, "dp8490", "National Semiconductor DP8490 EASI")
3032

3133
ALLOW_SAVE_TYPE(ncr5380_device::state);
3234

@@ -54,6 +56,11 @@ cxd1180_device::cxd1180_device(machine_config const &mconfig, char const *tag, d
5456
{
5557
}
5658

59+
dp8490_device::dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
60+
: ncr5380_device(mconfig, DP8490, tag, owner, clock, true)
61+
{
62+
}
63+
5764
void ncr5380_device::map(address_map &map)
5865
{
5966
map(0x0, 0x0).rw(FUNC(ncr5380_device::csdata_r), FUNC(ncr5380_device::odata_w));

src/devices/machine/ncr5380.h

+7
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,15 @@ class cxd1180_device : public ncr5380_device
179179
cxd1180_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
180180
};
181181

182+
class dp8490_device : public ncr5380_device
183+
{
184+
public:
185+
dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
186+
};
187+
182188
DECLARE_DEVICE_TYPE(NCR5380, ncr5380_device)
183189
DECLARE_DEVICE_TYPE(NCR53C80, ncr53c80_device)
184190
DECLARE_DEVICE_TYPE(CXD1180, cxd1180_device)
191+
DECLARE_DEVICE_TYPE(DP8490, dp8490_device)
185192

186193
#endif // MAME_MACHINE_NCR5380_H

src/mame/homebrew/pc532.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class pc532_state : public driver_device
4949
, m_fpu(*this, "fpu")
5050
, m_icu(*this, "icu")
5151
, m_rtc(*this, "rtc")
52-
, m_ncr5380(*this, "slot:7:ncr5380")
52+
, m_dp8490(*this, "slot:7:dp8490")
5353
, m_aic6250(*this, "scsi:0:aic6250")
5454
, m_duart(*this, "duart%u", 0U)
5555
, m_serial(*this, "serial%u", 0U)
@@ -74,7 +74,7 @@ class pc532_state : public driver_device
7474

7575
required_device<ds1216e_device> m_rtc;
7676

77-
required_device<ncr5380_device> m_ncr5380;
77+
required_device<dp8490_device> m_dp8490;
7878
required_device<aic6250_device> m_aic6250;
7979

8080
required_device_array<scn2681_device, 4> m_duart;
@@ -154,13 +154,13 @@ void pc532_state::drq_w(int state)
154154
{
155155
switch (m_state)
156156
{
157-
case RD1: m_dma |= u32(m_ncr5380->dma_r()) << 8; m_state = RD2; break;
158-
case RD2: m_dma |= u32(m_ncr5380->dma_r()) << 16; m_state = RD3; break;
159-
case RD3: m_dma |= u32(m_ncr5380->dma_r()) << 24; m_state = RD4; break;
157+
case RD1: m_dma |= u32(m_dp8490->dma_r()) << 8; m_state = RD2; break;
158+
case RD2: m_dma |= u32(m_dp8490->dma_r()) << 16; m_state = RD3; break;
159+
case RD3: m_dma |= u32(m_dp8490->dma_r()) << 24; m_state = RD4; break;
160160

161-
case WR3: m_ncr5380->dma_w(m_dma >> 8); m_state = WR2; break;
162-
case WR2: m_ncr5380->dma_w(m_dma >> 16); m_state = WR1; break;
163-
case WR1: m_ncr5380->dma_w(m_dma >> 24); m_state = IDLE; break;
161+
case WR3: m_dp8490->dma_w(m_dma >> 8); m_state = WR2; break;
162+
case WR2: m_dp8490->dma_w(m_dma >> 16); m_state = WR1; break;
163+
case WR1: m_dp8490->dma_w(m_dma >> 24); m_state = IDLE; break;
164164

165165
default:
166166
break;
@@ -212,7 +212,7 @@ u32 pc532_state::dma_r(offs_t offset, u32 mem_mask)
212212
if (m_drq && !m_irq)
213213
{
214214
// buffer empty and SCSI ready to transfer; read SCSI data, enter the read state, and signal the CPU to wait
215-
m_dma = m_ncr5380->dma_r();
215+
m_dma = m_dp8490->dma_r();
216216
m_state = RD1;
217217

218218
m_cpu->rdy_w(1);
@@ -249,7 +249,7 @@ void pc532_state::dma_w(offs_t offset, u32 data, u32 mem_mask)
249249
if (m_drq)
250250
{
251251
m_dma = data;
252-
m_ncr5380->dma_w(m_dma >> 0);
252+
m_dp8490->dma_w(m_dma >> 0);
253253
m_state = WR3;
254254
}
255255
}
@@ -280,7 +280,7 @@ template <unsigned ST> void pc532_state::cpu_map(address_map &map)
280280
if (ST == ns32000::ST_ODT)
281281
{
282282
map(0x3000'0000, 0x3fff'ffff).view(m_select);
283-
m_select[0](0x3000'0000, 0x3000'0007).m(m_ncr5380, FUNC(ncr5380_device::map));
283+
m_select[0](0x3000'0000, 0x3000'0007).m(m_dp8490, FUNC(dp8490_device::map));
284284
m_select[0](0x3800'0000, 0x3fff'ffff).rw(FUNC(pc532_state::dma_r), FUNC(pc532_state::dma_w));
285285
m_select[1](0x3000'0000, 0x3000'0001).rw(m_aic6250, FUNC(aic6250_device::read), FUNC(aic6250_device::write));
286286
}
@@ -316,14 +316,14 @@ void pc532_state::pc532(machine_config &config)
316316
NSCSI_CONNECTOR(config, "slot:1", scsi_devices, nullptr, false);
317317
NSCSI_CONNECTOR(config, "slot:2", scsi_devices, nullptr, false);
318318
NSCSI_CONNECTOR(config, "slot:3", scsi_devices, nullptr, false);
319-
NSCSI_CONNECTOR(config, "slot:7").option_set("ncr5380", NCR5380).machine_config( // DP8490
319+
NSCSI_CONNECTOR(config, "slot:7").option_set("dp8490", DP8490).machine_config( // DP8490V
320320
[this](device_t *device)
321321
{
322-
ncr5380_device &ncr5380(downcast<ncr5380_device &>(*device));
322+
dp8490_device &dp8490(downcast<dp8490_device &>(*device));
323323

324-
ncr5380.drq_handler().set(*this, FUNC(pc532_state::drq_w));
325-
ncr5380.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>));
326-
ncr5380.irq_handler().append(*this, FUNC(pc532_state::irq_w));
324+
dp8490.drq_handler().set(*this, FUNC(pc532_state::drq_w));
325+
dp8490.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>));
326+
dp8490.irq_handler().append(*this, FUNC(pc532_state::irq_w));
327327
});
328328

329329
NSCSI_BUS(config, "scsi");

0 commit comments

Comments
 (0)