mirror of
https://github.com/holub/mame
synced 2025-07-02 16:49:22 +03:00
Preliminary emulation of ASC-88 SCSI adapter [AJR, minuszerodegrees.net]
This commit is contained in:
parent
118df1b2db
commit
6f91e0a2f4
@ -1359,6 +1359,8 @@ if (BUSES["ISA"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/isa/ultra24f.h",
|
||||
MAME_DIR .. "src/devices/bus/isa/tekram_dc820.cpp",
|
||||
MAME_DIR .. "src/devices/bus/isa/tekram_dc820.h",
|
||||
MAME_DIR .. "src/devices/bus/isa/asc88.cpp",
|
||||
MAME_DIR .. "src/devices/bus/isa/asc88.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
184
src/devices/bus/isa/asc88.cpp
Normal file
184
src/devices/bus/isa/asc88.cpp
Normal file
@ -0,0 +1,184 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:AJR
|
||||
/***************************************************************************
|
||||
|
||||
ASC-88 SCSI Adapter
|
||||
© 1985 Advanced Storage Concepts, Inc.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "asc88.h"
|
||||
|
||||
#include "machine/nscsi_bus.h"
|
||||
#include "machine/nscsi_hd.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(ASC88, asc88_device, "asc88", "ASC-88 SCSI Adapter")
|
||||
|
||||
|
||||
asc88_device::asc88_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ASC88, tag, owner, clock)
|
||||
, device_isa8_card_interface(mconfig, *this)
|
||||
, m_scsic(*this, "scsi:7:scsic")
|
||||
, m_eeprom(*this, "eeprom")
|
||||
, m_baseaddr(*this, "BASEADDR")
|
||||
, m_control(0)
|
||||
, m_irq(false)
|
||||
, m_drq(false)
|
||||
{
|
||||
}
|
||||
|
||||
void asc88_device::device_start()
|
||||
{
|
||||
set_isa_device();
|
||||
|
||||
m_ram = make_unique_clear<u8[]>(0x800);
|
||||
|
||||
save_item(NAME(m_control));
|
||||
save_item(NAME(m_irq));
|
||||
save_item(NAME(m_drq));
|
||||
save_pointer(NAME(m_ram), 0x800);
|
||||
}
|
||||
|
||||
void asc88_device::device_reset()
|
||||
{
|
||||
const offs_t baseaddr = 0xc0000 | (u32(m_baseaddr->read()) << 14);
|
||||
m_isa->install_rom(this, baseaddr, baseaddr | 0x37ff, "asc88", "bios");
|
||||
m_isa->install_bank(baseaddr | 0x3800, baseaddr | 0x3fef, "ascram", m_ram.get());
|
||||
m_isa->install_memory(baseaddr | 0x3ff0, baseaddr | 0x3ff7,
|
||||
read8sm_delegate(FUNC(ncr5380n_device::read), &*m_scsic),
|
||||
write8sm_delegate(FUNC(ncr5380n_device::write), &*m_scsic));
|
||||
m_isa->install_memory(baseaddr | 0x3ff8, baseaddr | 0x3ff8,
|
||||
read8smo_delegate(FUNC(asc88_device::eeprom_r), this),
|
||||
write8smo_delegate(FUNC(asc88_device::control_w), this));
|
||||
|
||||
control_w(0);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(asc88_device::irq_w)
|
||||
{
|
||||
if (m_irq != state)
|
||||
{
|
||||
m_irq = state;
|
||||
if (BIT(m_control, 3))
|
||||
m_isa->irq2_w(state);
|
||||
if (BIT(m_control, 4))
|
||||
m_isa->irq3_w(state);
|
||||
if (BIT(m_control, 5))
|
||||
m_isa->irq5_w(state);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(asc88_device::drq_w)
|
||||
{
|
||||
if (m_drq != state)
|
||||
{
|
||||
m_drq = state;
|
||||
if (BIT(m_control, 6))
|
||||
m_isa->drq1_w(state);
|
||||
if (BIT(m_control, 7))
|
||||
m_isa->drq3_w(state);
|
||||
}
|
||||
}
|
||||
|
||||
u8 asc88_device::dack_r(int line)
|
||||
{
|
||||
return m_scsic->dma_r();
|
||||
}
|
||||
|
||||
void asc88_device::dack_w(int line, u8 data)
|
||||
{
|
||||
m_scsic->dma_w(data);
|
||||
}
|
||||
|
||||
void asc88_device::control_w(u8 data)
|
||||
{
|
||||
const u8 changing_bits = data ^ m_control;
|
||||
m_control = data;
|
||||
|
||||
m_eeprom->di_write(BIT(data, 0));
|
||||
m_eeprom->clk_write(BIT(data, 1));
|
||||
m_eeprom->cs_write(BIT(data, 2));
|
||||
|
||||
if (m_irq)
|
||||
{
|
||||
if (BIT(m_control, 3))
|
||||
m_isa->irq2_w(BIT(data, 3));
|
||||
if (BIT(m_control, 4))
|
||||
m_isa->irq3_w(BIT(data, 4));
|
||||
if (BIT(m_control, 5))
|
||||
m_isa->irq5_w(BIT(data, 5));
|
||||
}
|
||||
|
||||
if (m_drq)
|
||||
{
|
||||
if (BIT(changing_bits, 6))
|
||||
m_isa->drq1_w(BIT(data, 6));
|
||||
if (BIT(changing_bits, 7))
|
||||
m_isa->drq3_w(BIT(data, 7));
|
||||
}
|
||||
}
|
||||
|
||||
u8 asc88_device::eeprom_r()
|
||||
{
|
||||
return m_eeprom->do_read();
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START(asc88)
|
||||
PORT_START("BASEADDR")
|
||||
PORT_DIPNAME(0x7, 0x3, "BIOS Segment Address") PORT_DIPLOCATION("A16-A14:!1,!2,!3")
|
||||
// For each jumper, pins 1 & 2 closed = off (0); pins 2 & 3 closed = on (1)
|
||||
PORT_DIPSETTING(0x0, "C000h")
|
||||
PORT_DIPSETTING(0x1, "C400h")
|
||||
PORT_DIPSETTING(0x2, "C800h")
|
||||
PORT_DIPSETTING(0x3, "CC00h")
|
||||
PORT_DIPSETTING(0x4, "D000h")
|
||||
PORT_DIPSETTING(0x5, "D400h")
|
||||
PORT_DIPSETTING(0x6, "D800h")
|
||||
PORT_DIPSETTING(0x7, "DC00h")
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor asc88_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(asc88);
|
||||
}
|
||||
|
||||
static void asc88_scsi_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("harddisk", NSCSI_HARDDISK);
|
||||
device.option_add_internal("scsic", NCR5380N);
|
||||
}
|
||||
|
||||
void asc88_device::scsic_config(device_t *device)
|
||||
{
|
||||
device->set_clock(10'000'000); // FIXME: this clock is fake
|
||||
downcast<ncr5380n_device &>(*device).irq_handler().set("^^", FUNC(asc88_device::irq_w));
|
||||
downcast<ncr5380n_device &>(*device).drq_handler().set("^^", FUNC(asc88_device::drq_w));
|
||||
}
|
||||
|
||||
void asc88_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
NSCSI_BUS(config, "scsi");
|
||||
NSCSI_CONNECTOR(config, "scsi:0", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:1", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:2", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:3", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:4", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:5", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:6", asc88_scsi_devices, nullptr);
|
||||
NSCSI_CONNECTOR(config, "scsi:7", asc88_scsi_devices, "scsic", true)
|
||||
.set_option_machine_config("scsic", [this] (device_t *device) { scsic_config(device); });
|
||||
|
||||
EEPROM_93C06_16BIT(config, m_eeprom); // NMC9306N
|
||||
}
|
||||
|
||||
ROM_START(asc88)
|
||||
ROM_REGION(0x3800, "bios", ROMREGION_ERASE00)
|
||||
ROM_LOAD("asc88_rev._4.0n_14-nov-91.u14", 0x0000, 0x2000, CRC(8657d1bf) SHA1(49c44aafbb3f28478e4b5eeaa208b147fdf253b9)) // TMS27C64-IJL
|
||||
ROM_END
|
||||
|
||||
const tiny_rom_entry *asc88_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(asc88);
|
||||
}
|
56
src/devices/bus/isa/asc88.h
Normal file
56
src/devices/bus/isa/asc88.h
Normal file
@ -0,0 +1,56 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:AJR
|
||||
/***************************************************************************
|
||||
|
||||
ASC-88 SCSI Adapter
|
||||
© 1985 Advanced Storage Concepts, Inc.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_ISA_ASC88_H
|
||||
#define MAME_BUS_ISA_ASC88_H 1
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "isa.h"
|
||||
#include "machine/eepromser.h"
|
||||
#include "machine/ncr5380n.h"
|
||||
|
||||
class asc88_device : public device_t, public device_isa8_card_interface
|
||||
{
|
||||
public:
|
||||
asc88_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
||||
virtual u8 dack_r(int line) override;
|
||||
virtual void dack_w(int line, u8 data) override;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE_LINE_MEMBER(irq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(drq_w);
|
||||
|
||||
void control_w(u8 data);
|
||||
u8 eeprom_r();
|
||||
|
||||
void scsic_config(device_t *device);
|
||||
|
||||
required_device<ncr5380n_device> m_scsic;
|
||||
required_device<eeprom_serial_93cxx_device> m_eeprom;
|
||||
required_ioport m_baseaddr;
|
||||
|
||||
u8 m_control;
|
||||
bool m_irq;
|
||||
bool m_drq;
|
||||
std::unique_ptr<u8[]> m_ram;
|
||||
};
|
||||
|
||||
// device type declaration
|
||||
DECLARE_DEVICE_TYPE(ASC88, asc88_device)
|
||||
|
||||
#endif // MAME_BUS_ISA_ASC88_H
|
@ -45,6 +45,7 @@
|
||||
#include "ultra14f.h"
|
||||
#include "ultra24f.h"
|
||||
#include "tekram_dc820.h"
|
||||
#include "asc88.h"
|
||||
|
||||
// sound
|
||||
#include "adlib.h"
|
||||
@ -120,6 +121,7 @@ void pc_isa8_cards(device_slot_interface &device)
|
||||
device.option_add("dectalk", ISA8_DECTALK);
|
||||
device.option_add("pds", ISA8_PDS);
|
||||
device.option_add("lba_enhancer", ISA8_LBA_ENHANCER);
|
||||
device.option_add("asc88", ASC88);
|
||||
}
|
||||
|
||||
void pc_isa16_cards(device_slot_interface &device)
|
||||
|
Loading…
Reference in New Issue
Block a user