machine/ncr5380.cpp: Add DP8490 type so that its Enhanced Mode can be emulated in the future

This commit is contained in:
AJR 2025-03-12 10:49:57 -04:00
parent da5ddf83c5
commit dc2ba0ed83
4 changed files with 40 additions and 26 deletions

View File

@ -44,7 +44,7 @@ protected:
virtual void memc_map(address_map &map) override ATTR_COLD;
private:
required_device<ncr5380_device> m_ncr5380;
required_device<dp8490_device> m_dp8490;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_memory_region m_podule_rom;
@ -56,10 +56,10 @@ void arc_scsi_cumana_device::ioc_map(address_map &map)
{
map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | ((m_rom_page << 11) & 0xf800)]; })).umask32(0x000000ff);
map(0x0000, 0x1fff).lw8(NAME([this](u8 data) { m_rom_page = data; }));
//map(0x2000, 0x201f).mirror(0x0100).rw(m_ncr5380, FUNC(ncr5380_device::read), FUNC(ncr5380_device::write)).umask32(0x000000ff);
map(0x2100, 0x211f).m(m_ncr5380, FUNC(ncr5380_device::map)).umask32(0x000000ff);
//map(0x2100, 0x2100).r(m_ncr5380, FUNC(ncr5380_device::dma_r));
//map(0x2100, 0x2100).w(m_ncr5380, FUNC(ncr5380_device::dma_w));
//map(0x2000, 0x201f).mirror(0x0100).rw(m_dp8490, FUNC(dp8490_device::read), FUNC(dp8490_device::write)).umask32(0x000000ff);
map(0x2100, 0x211f).m(m_dp8490, FUNC(dp8490_device::map)).umask32(0x000000ff);
//map(0x2100, 0x2100).r(m_dp8490, FUNC(dp8490_device::dma_r));
//map(0x2100, 0x2100).w(m_dp8490, FUNC(dp8490_device::dma_w));
}
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)
NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr5380", NCR5380) // DP8490
NSCSI_CONNECTOR(config, "scsi:7").option_set("dp8490", DP8490) // DP8490N
.machine_config([this](device_t *device)
{
downcast<ncr5380_device &>(*device).irq_handler().set([this](int state) { set_pirq(state); });
downcast<dp8490_device &>(*device).irq_handler().set([this](int state) { set_pirq(state); });
});
EEPROM_93C06_16BIT(config, m_eeprom);
@ -117,7 +117,7 @@ void arc_scsi_cumana_device::device_add_mconfig(machine_config &config)
arc_scsi_cumana_device::arc_scsi_cumana_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, ARC_SCSI_CUMANA, tag, owner, clock)
, device_archimedes_podule_interface(mconfig, *this)
, m_ncr5380(*this, "scsi:7:ncr5380")
, m_dp8490(*this, "scsi:7:dp8490")
, m_eeprom(*this, "eeprom")
, m_podule_rom(*this, "podule_rom")
, m_rom_page(0)

View File

@ -2,14 +2,15 @@
// copyright-holders:Patrick Mackinlay
/*
* NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180 and others.
* NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180, National Semiconductor DP8490, Logic Devices L5380 and others.
*
* Sources:
* - http://bitsavers.org/components/ncr/scsi/SP-1051_NCR_5380-53C80_SCSI_Interface_Chip_Design_Manual_Mar86.pdf
*
* TODO:
* - target mode
* - cxd1180 enhancements
* - CXD1180 enhancements
* - DP8490 enhancements
*/
#include "emu.h"
@ -27,6 +28,7 @@
DEFINE_DEVICE_TYPE(NCR5380, ncr5380_device, "ncr5380", "NCR 5380 SCSI")
DEFINE_DEVICE_TYPE(NCR53C80, ncr53c80_device, "ncr53c80", "NCR 53C80 SCSI")
DEFINE_DEVICE_TYPE(CXD1180, cxd1180_device, "cxd1180", "Sony CXD1180")
DEFINE_DEVICE_TYPE(DP8490, dp8490_device, "dp8490", "National Semiconductor DP8490 EASI")
ALLOW_SAVE_TYPE(ncr5380_device::state);
@ -54,6 +56,11 @@ cxd1180_device::cxd1180_device(machine_config const &mconfig, char const *tag, d
{
}
dp8490_device::dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
: ncr5380_device(mconfig, DP8490, tag, owner, clock, true)
{
}
void ncr5380_device::map(address_map &map)
{
map(0x0, 0x0).rw(FUNC(ncr5380_device::csdata_r), FUNC(ncr5380_device::odata_w));

View File

@ -179,8 +179,15 @@ public:
cxd1180_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
};
class dp8490_device : public ncr5380_device
{
public:
dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
};
DECLARE_DEVICE_TYPE(NCR5380, ncr5380_device)
DECLARE_DEVICE_TYPE(NCR53C80, ncr53c80_device)
DECLARE_DEVICE_TYPE(CXD1180, cxd1180_device)
DECLARE_DEVICE_TYPE(DP8490, dp8490_device)
#endif // MAME_MACHINE_NCR5380_H

View File

@ -49,7 +49,7 @@ public:
, m_fpu(*this, "fpu")
, m_icu(*this, "icu")
, m_rtc(*this, "rtc")
, m_ncr5380(*this, "slot:7:ncr5380")
, m_dp8490(*this, "slot:7:dp8490")
, m_aic6250(*this, "scsi:0:aic6250")
, m_duart(*this, "duart%u", 0U)
, m_serial(*this, "serial%u", 0U)
@ -74,7 +74,7 @@ protected:
required_device<ds1216e_device> m_rtc;
required_device<ncr5380_device> m_ncr5380;
required_device<dp8490_device> m_dp8490;
required_device<aic6250_device> m_aic6250;
required_device_array<scn2681_device, 4> m_duart;
@ -154,13 +154,13 @@ void pc532_state::drq_w(int state)
{
switch (m_state)
{
case RD1: m_dma |= u32(m_ncr5380->dma_r()) << 8; m_state = RD2; break;
case RD2: m_dma |= u32(m_ncr5380->dma_r()) << 16; m_state = RD3; break;
case RD3: m_dma |= u32(m_ncr5380->dma_r()) << 24; m_state = RD4; break;
case RD1: m_dma |= u32(m_dp8490->dma_r()) << 8; m_state = RD2; break;
case RD2: m_dma |= u32(m_dp8490->dma_r()) << 16; m_state = RD3; break;
case RD3: m_dma |= u32(m_dp8490->dma_r()) << 24; m_state = RD4; break;
case WR3: m_ncr5380->dma_w(m_dma >> 8); m_state = WR2; break;
case WR2: m_ncr5380->dma_w(m_dma >> 16); m_state = WR1; break;
case WR1: m_ncr5380->dma_w(m_dma >> 24); m_state = IDLE; break;
case WR3: m_dp8490->dma_w(m_dma >> 8); m_state = WR2; break;
case WR2: m_dp8490->dma_w(m_dma >> 16); m_state = WR1; break;
case WR1: m_dp8490->dma_w(m_dma >> 24); m_state = IDLE; break;
default:
break;
@ -212,7 +212,7 @@ u32 pc532_state::dma_r(offs_t offset, u32 mem_mask)
if (m_drq && !m_irq)
{
// buffer empty and SCSI ready to transfer; read SCSI data, enter the read state, and signal the CPU to wait
m_dma = m_ncr5380->dma_r();
m_dma = m_dp8490->dma_r();
m_state = RD1;
m_cpu->rdy_w(1);
@ -249,7 +249,7 @@ void pc532_state::dma_w(offs_t offset, u32 data, u32 mem_mask)
if (m_drq)
{
m_dma = data;
m_ncr5380->dma_w(m_dma >> 0);
m_dp8490->dma_w(m_dma >> 0);
m_state = WR3;
}
}
@ -280,7 +280,7 @@ template <unsigned ST> void pc532_state::cpu_map(address_map &map)
if (ST == ns32000::ST_ODT)
{
map(0x3000'0000, 0x3fff'ffff).view(m_select);
m_select[0](0x3000'0000, 0x3000'0007).m(m_ncr5380, FUNC(ncr5380_device::map));
m_select[0](0x3000'0000, 0x3000'0007).m(m_dp8490, FUNC(dp8490_device::map));
m_select[0](0x3800'0000, 0x3fff'ffff).rw(FUNC(pc532_state::dma_r), FUNC(pc532_state::dma_w));
m_select[1](0x3000'0000, 0x3000'0001).rw(m_aic6250, FUNC(aic6250_device::read), FUNC(aic6250_device::write));
}
@ -316,14 +316,14 @@ void pc532_state::pc532(machine_config &config)
NSCSI_CONNECTOR(config, "slot:1", scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "slot:2", scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "slot:3", scsi_devices, nullptr, false);
NSCSI_CONNECTOR(config, "slot:7").option_set("ncr5380", NCR5380).machine_config( // DP8490
NSCSI_CONNECTOR(config, "slot:7").option_set("dp8490", DP8490).machine_config( // DP8490V
[this](device_t *device)
{
ncr5380_device &ncr5380(downcast<ncr5380_device &>(*device));
dp8490_device &dp8490(downcast<dp8490_device &>(*device));
ncr5380.drq_handler().set(*this, FUNC(pc532_state::drq_w));
ncr5380.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>));
ncr5380.irq_handler().append(*this, FUNC(pc532_state::irq_w));
dp8490.drq_handler().set(*this, FUNC(pc532_state::drq_w));
dp8490.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>));
dp8490.irq_handler().append(*this, FUNC(pc532_state::irq_w));
});
NSCSI_BUS(config, "scsi");