diff options
author | Nigel Barnes <Pernod70@users.noreply.github.com> | 2020-07-22 12:06:43 +0100 |
---|---|---|
committer | Nigel Barnes <Pernod70@users.noreply.github.com> | 2020-07-22 12:06:43 +0100 |
commit | de637b8dbb49bd0c6111640d9759707e63cbcbe1 (patch) | |
tree | a52748d41378d27fd8bb2691077c43becc77bb86 /src/devices/bus | |
parent | d8b2021a2268d5ef37a0a7915256cecb58f843c6 (diff) |
bus/bbc/1mhzbus: Added the Torch Hard Disc Pack.
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/1mhzbus.cpp | 3 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/sasi.cpp | 175 | ||||
-rw-r--r-- | src/devices/bus/bbc/1mhzbus/sasi.h | 73 |
3 files changed, 251 insertions, 0 deletions
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index 7cf8aaf21b1..1246cb1902c 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -118,6 +118,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data) #include "ieee488.h" #include "m2000.h" //#include "m5000.h" +#include "sasi.h" #include "scsi.h" #include "multiform.h" #include "opus3.h" @@ -151,6 +152,7 @@ void bbc_1mhzbus_devices(device_slot_interface &device) device.option_add("pdram", BBC_PDRAM); /* Micro User Pull Down RAM */ device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */ device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */ + device.option_add("torchhd", BBC_TORCHHD); /* Torch Hard Disc Pack */ device.option_add("dc", BBC_DATACENTRE); /* RetroClinic DataCentre */ //device.option_add("graduate", BBC_GRADUATE); /* Torch Graduate G400/G800 */ device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */ @@ -181,6 +183,7 @@ void bbcm_1mhzbus_devices(device_slot_interface &device) device.option_add("pdram", BBC_PDRAM); /* Micro User Pull Down RAM */ device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */ device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */ + device.option_add("torchhd", BBC_TORCHHD); /* Torch Hard Disc Pack */ device.option_add("dc", BBC_DATACENTRE); /* RetroClinic DataCentre */ //device.option_add("graduate", BBC_GRADUATE); /* Torch Graduate G400/G800 */ device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */ diff --git a/src/devices/bus/bbc/1mhzbus/sasi.cpp b/src/devices/bus/bbc/1mhzbus/sasi.cpp new file mode 100644 index 00000000000..9a55916f8f1 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/sasi.cpp @@ -0,0 +1,175 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Torch SCSI Host Adaptor + + Circuit diagram: http://mdfs.net/Info/Comp/Torch/scsi1.gif + + http://mdfs.net/Docs/Comp/BBC/Hardware/TorchSCSI + + Supported by Hard Disc Utilities: + Mb ss i c h s + BASF 6188 11 256 9 360 4 32 + BASF 6185 20 256 9 440 6 32 + Mitsubishi MR522 19 256 9 612 4 32 + NEC D5126 19 256 9 615 4 32 + Rodime 200/10 10 256 9 320 4 32 + Rodime 200/20 20 256 9 320 8 32 + Rodime 202E 20 256 9 640 4 32 + Rodime 204E 40 256 9 640 8 32 + Vertex V130 23 256 9 987 5 32 + Vertex V150 38 256 9 987 5 32 + Vertex V170 53 256 9 987 7 32 + +**********************************************************************/ + +#include "emu.h" +#include "sasi.h" +#include "machine/nscsi_bus.h" +#include "bus/nscsi/devices.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_SASI, bbc_sasi_device, "bbc_sasi", "Torch SCSI Host Adaptor"); +DEFINE_DEVICE_TYPE(BBC_TORCHHD, bbc_torchhd_device, "bbc_torchhd", "Torch Hard Disc Pack"); + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void bbc_sasi_device::device_add_mconfig(machine_config& config) +{ + NSCSI_BUS(config, "sasi"); + NSCSI_CONNECTOR(config, "sasi:0", default_scsi_devices, nullptr); + NSCSI_CONNECTOR(config, "sasi:7", default_scsi_devices, "scsicb", true) + .option_add_internal("scsicb", NSCSI_CB) + .machine_config([this](device_t* device) { + downcast<nscsi_callback_device&>(*device).req_callback().set(*this, FUNC(bbc_sasi_device::req_w)); + downcast<nscsi_callback_device&>(*device).sel_callback().set(*this, FUNC(bbc_sasi_device::sel_w)); + }); +} + +void bbc_torchhd_device::device_add_mconfig(machine_config &config) +{ + bbc_sasi_device::device_add_mconfig(config); + + /* Xebec S1410 */ + subdevice<nscsi_connector>("sasi:0")->set_default_option("s1410"); + subdevice<nscsi_connector>("sasi:0")->set_fixed(true); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_sasi_device - constructor +//------------------------------------------------- + +bbc_sasi_device::bbc_sasi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) + , device_bbc_1mhzbus_interface(mconfig, *this) + , m_sasi(*this, "sasi:7:scsicb") + , m_sel_state(0) +{ +} + +bbc_sasi_device::bbc_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bbc_sasi_device(mconfig, BBC_SASI, tag, owner, clock) +{ +} + +bbc_torchhd_device::bbc_torchhd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bbc_sasi_device(mconfig, BBC_TORCHHD, tag, owner, clock) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_sasi_device::device_start() +{ + /* register for save states */ + save_item(NAME(m_sel_state)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void bbc_sasi_device::device_reset() +{ + m_sasi->rst_w(1); + m_sasi->rst_w(0); +} + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t bbc_sasi_device::jim_r(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset) + { + case 0xf0: + data = m_sasi->read(); + m_sasi->ack_w(1); + break; + case 0xf1: + data = (m_sasi->req_r() << 0) + | (m_sasi->ack_r() << 1) + | (m_sasi->rst_r() << 2) + | (!m_sel_state << 3) + | (m_sasi->io_r() << 4) + | (m_sasi->cd_r() << 5) + | (m_sasi->msg_r() << 6) + | (m_sasi->bsy_r() << 7); + break; + case 0xf2: + m_sasi->ack_w(1); + break; + } + return data; +} + +void bbc_sasi_device::jim_w(offs_t offset, uint8_t data) +{ + switch (offset) + { + case 0xf0: + m_sasi->write(data); + m_sasi->ack_w(1); + break; + case 0xf1: + m_sasi->rst_w(1); + m_sasi->rst_w(0); + break; + case 0xf2: + m_sasi->sel_w(1); + m_sel_state = 1; + break; + case 0xf3: + m_sasi->sel_w(0); + m_sel_state = 0; + break; + } +} + +WRITE_LINE_MEMBER(bbc_sasi_device::req_w) +{ + m_sasi->ack_w(0); +} + +WRITE_LINE_MEMBER(bbc_sasi_device::sel_w) +{ + m_sel_state = state; +} diff --git a/src/devices/bus/bbc/1mhzbus/sasi.h b/src/devices/bus/bbc/1mhzbus/sasi.h new file mode 100644 index 00000000000..a87655aefb8 --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/sasi.h @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Torch SCSI Host Adaptor + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_1MHZBUS_SASI_H +#define MAME_BUS_BBC_1MHZBUS_SASI_H + +#include "1mhzbus.h" +#include "machine/nscsi_cb.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class bbc_sasi_device: + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + bbc_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + DECLARE_WRITE_LINE_MEMBER(req_w); + DECLARE_WRITE_LINE_MEMBER(sel_w); + +protected: + bbc_sasi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config& config) override; + + virtual uint8_t jim_r(offs_t offset) override; + virtual void jim_w(offs_t offset, uint8_t data) override; + +private: + required_device<nscsi_callback_device> m_sasi; + + int m_sel_state; +}; + + +// ======================> bbc_torchhd_device + +class bbc_torchhd_device : public bbc_sasi_device +{ +public: + static constexpr feature_type imperfect_features() { return feature::DISK; } + + // construction/destruction + bbc_torchhd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_SASI, bbc_sasi_device); +DECLARE_DEVICE_TYPE(BBC_TORCHHD, bbc_torchhd_device); + + +#endif /* MAME_BUS_BBC_1MHZBUS_SASI_H */ |