From da5f67a62c1f70022c9ed0d65347d6818c1562c3 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Sun, 14 Nov 2021 15:21:57 +0000 Subject: bus/archimedes/podule: Various podules for Acorn Archimedes: - Acorn AGA30 BBC I/O Podule - Acorn AKA05 ROM Podule - Acorn AKA10 BBC I/O Podule - Acorn AKA12 User Port/MIDI Podule - Acorn AKA15 MIDI and BBC I/O Podule - Acorn AKA16 MIDI Podule - Acorn AKA25 Ethernet - Acorn Tube Podule - Archimedes Dual RS423 Serial Interface (not working) - Armadillo Systems A448 Sound Sampler (not working) - Armadillo Systems A448b Stereo MIDI Sound Sampler (not working) - Atomwide Serial Expansion Card - Baildon Electronics IDE HD Interface - Clares Armadeus Sampler Board - Computer Concepts Fax-Pack (not working) - Computer Concepts LaserDirect (Canon LBP-4) (not working) - Computer Concepts ScanLight (not working) - Computer Concepts ScanLight Junior (not working) - Computer Concepts ScanLight Video 256 (not working) - Digital Services Ethernet Podule (not working) - HCCS User/Analogue Podule - RISC Developments Ethernet Card (not working) - RISC Developments IDE Hard Disc System - VTI User Port and SCSI Podule - Watford Electronics BBC User I/O Card - Wild Vision MidiMax - Wild Vision/Computer Concepts Lark A16 --- scripts/src/bus.lua | 53 +++ scripts/target/mame/mess.lua | 1 + src/devices/bus/archimedes/podule/a448.cpp | 159 +++++++++ src/devices/bus/archimedes/podule/a448.h | 20 ++ src/devices/bus/archimedes/podule/armadeus.cpp | 111 ++++++ src/devices/bus/archimedes/podule/armadeus.h | 19 + src/devices/bus/archimedes/podule/ether1.cpp | 184 ++++++++++ src/devices/bus/archimedes/podule/ether1.h | 19 + src/devices/bus/archimedes/podule/etherd.cpp | 126 +++++++ src/devices/bus/archimedes/podule/etherd.h | 19 + src/devices/bus/archimedes/podule/etherr.cpp | 126 +++++++ src/devices/bus/archimedes/podule/etherr.h | 19 + src/devices/bus/archimedes/podule/faxpack.cpp | 135 +++++++ src/devices/bus/archimedes/podule/faxpack.h | 20 ++ src/devices/bus/archimedes/podule/ide_rdev.cpp | 122 +++++++ src/devices/bus/archimedes/podule/ide_rdev.h | 19 + src/devices/bus/archimedes/podule/io.cpp | 446 ++++++++++++++++++++++++ src/devices/bus/archimedes/podule/io.h | 23 ++ src/devices/bus/archimedes/podule/io_hccs.cpp | 143 ++++++++ src/devices/bus/archimedes/podule/io_hccs.h | 19 + src/devices/bus/archimedes/podule/io_morley.cpp | 179 ++++++++++ src/devices/bus/archimedes/podule/io_morley.h | 19 + src/devices/bus/archimedes/podule/io_we.cpp | 190 ++++++++++ src/devices/bus/archimedes/podule/io_we.h | 19 + src/devices/bus/archimedes/podule/lark.cpp | 255 ++++++++++++++ src/devices/bus/archimedes/podule/lark.h | 19 + src/devices/bus/archimedes/podule/laserd.cpp | 169 +++++++++ src/devices/bus/archimedes/podule/laserd.h | 19 + src/devices/bus/archimedes/podule/midimax.cpp | 132 +++++++ src/devices/bus/archimedes/podule/midimax.h | 19 + src/devices/bus/archimedes/podule/rom.cpp | 190 ++++++++++ src/devices/bus/archimedes/podule/rom.h | 19 + src/devices/bus/archimedes/podule/rs423.cpp | 136 ++++++++ src/devices/bus/archimedes/podule/rs423.h | 19 + src/devices/bus/archimedes/podule/scanlight.cpp | 227 ++++++++++++ src/devices/bus/archimedes/podule/scanlight.h | 21 ++ src/devices/bus/archimedes/podule/scsi_vti.cpp | 173 +++++++++ src/devices/bus/archimedes/podule/scsi_vti.h | 19 + src/devices/bus/archimedes/podule/serial.cpp | 156 +++++++++ src/devices/bus/archimedes/podule/serial.h | 19 + src/devices/bus/archimedes/podule/slot.cpp | 365 +++++++++++++++++++ src/devices/bus/archimedes/podule/slot.h | 159 +++++++++ src/devices/bus/archimedes/podule/tube.cpp | 87 +++++ src/devices/bus/archimedes/podule/tube.h | 19 + 44 files changed, 4412 insertions(+) create mode 100644 src/devices/bus/archimedes/podule/a448.cpp create mode 100644 src/devices/bus/archimedes/podule/a448.h create mode 100644 src/devices/bus/archimedes/podule/armadeus.cpp create mode 100644 src/devices/bus/archimedes/podule/armadeus.h create mode 100644 src/devices/bus/archimedes/podule/ether1.cpp create mode 100644 src/devices/bus/archimedes/podule/ether1.h create mode 100644 src/devices/bus/archimedes/podule/etherd.cpp create mode 100644 src/devices/bus/archimedes/podule/etherd.h create mode 100644 src/devices/bus/archimedes/podule/etherr.cpp create mode 100644 src/devices/bus/archimedes/podule/etherr.h create mode 100644 src/devices/bus/archimedes/podule/faxpack.cpp create mode 100644 src/devices/bus/archimedes/podule/faxpack.h create mode 100644 src/devices/bus/archimedes/podule/ide_rdev.cpp create mode 100644 src/devices/bus/archimedes/podule/ide_rdev.h create mode 100644 src/devices/bus/archimedes/podule/io.cpp create mode 100644 src/devices/bus/archimedes/podule/io.h create mode 100644 src/devices/bus/archimedes/podule/io_hccs.cpp create mode 100644 src/devices/bus/archimedes/podule/io_hccs.h create mode 100644 src/devices/bus/archimedes/podule/io_morley.cpp create mode 100644 src/devices/bus/archimedes/podule/io_morley.h create mode 100644 src/devices/bus/archimedes/podule/io_we.cpp create mode 100644 src/devices/bus/archimedes/podule/io_we.h create mode 100644 src/devices/bus/archimedes/podule/lark.cpp create mode 100644 src/devices/bus/archimedes/podule/lark.h create mode 100644 src/devices/bus/archimedes/podule/laserd.cpp create mode 100644 src/devices/bus/archimedes/podule/laserd.h create mode 100644 src/devices/bus/archimedes/podule/midimax.cpp create mode 100644 src/devices/bus/archimedes/podule/midimax.h create mode 100644 src/devices/bus/archimedes/podule/rom.cpp create mode 100644 src/devices/bus/archimedes/podule/rom.h create mode 100644 src/devices/bus/archimedes/podule/rs423.cpp create mode 100644 src/devices/bus/archimedes/podule/rs423.h create mode 100644 src/devices/bus/archimedes/podule/scanlight.cpp create mode 100644 src/devices/bus/archimedes/podule/scanlight.h create mode 100644 src/devices/bus/archimedes/podule/scsi_vti.cpp create mode 100644 src/devices/bus/archimedes/podule/scsi_vti.h create mode 100644 src/devices/bus/archimedes/podule/serial.cpp create mode 100644 src/devices/bus/archimedes/podule/serial.h create mode 100644 src/devices/bus/archimedes/podule/slot.cpp create mode 100644 src/devices/bus/archimedes/podule/slot.h create mode 100644 src/devices/bus/archimedes/podule/tube.cpp create mode 100644 src/devices/bus/archimedes/podule/tube.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 770b4fae633..404caa4832b 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -331,6 +331,59 @@ if (BUSES["ARCHIMEDES_ECONET"]~=null) then end +--------------------------------------------------- +-- +--@src/devices/bus/archimedes/podule/slot.h,BUSES["ARCHIMEDES_PODULE"] = true +--------------------------------------------------- + +if (BUSES["ARCHIMEDES_PODULE"]~=null) then + files { + MAME_DIR .. "src/devices/bus/archimedes/podule/slot.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/slot.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/a448.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/a448.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/armadeus.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/armadeus.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/ether1.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/ether1.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/etherd.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/etherd.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/etherr.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/etherr.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/faxpack.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/faxpack.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/ide_rdev.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/ide_rdev.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/io.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/io.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_hccs.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_hccs.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_morley.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_morley.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_we.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/io_we.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/lark.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/lark.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/laserd.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/laserd.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/midimax.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/midimax.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/rom.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/rom.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/rs423.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/rs423.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/scanlight.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/scanlight.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/scsi_vti.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/scsi_vti.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/serial.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/serial.h", + MAME_DIR .. "src/devices/bus/archimedes/podule/tube.cpp", + MAME_DIR .. "src/devices/bus/archimedes/podule/tube.h", + } +end + + --------------------------------------------------- -- --@src/devices/bus/astrocde/slot.h,BUSES["ASTROCADE"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 53d0dfcfc4d..6a730df65f9 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -849,6 +849,7 @@ BUSES["APRICOT_VIDEO"] = true BUSES["AQUARIUS"] = true BUSES["ARCADIA"] = true BUSES["ARCHIMEDES_ECONET"] = true +BUSES["ARCHIMEDES_PODULE"] = true BUSES["ASTROCADE"] = true BUSES["ATA"] = true BUSES["BBC_1MHZBUS"] = true diff --git a/src/devices/bus/archimedes/podule/a448.cpp b/src/devices/bus/archimedes/podule/a448.cpp new file mode 100644 index 00000000000..400a15722e6 --- /dev/null +++ b/src/devices/bus/archimedes/podule/a448.cpp @@ -0,0 +1,159 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Armadillo Systems A448 Sound Sampler + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Armadillo_A448.html + + TODO: + - everything, requires driver software to determine how hardware is accessed. + +**********************************************************************/ + +#include "emu.h" +#include "a448.h" +#include "bus/midi/midi.h" + + +namespace { + +// ======================> arc_a448_device + +class arc_a448_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::CAPTURE; } + + // construction/destruction + arc_a448_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + arc_a448_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; +}; + + +// ======================> arc_a448b_device + +class arc_a448b_device : public arc_a448_device +{ +public: + // construction/destruction + arc_a448b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; +}; + + +void arc_a448_device::ioc_map(address_map &map) +{ + map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset]; })).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( a448 ) +//------------------------------------------------- + +ROM_START( a448 ) + ROM_REGION(0x1000, "podule_rom", 0) + ROM_LOAD("a448.rom", 0x0000, 0x1000, CRC(e1988e76) SHA1(8140e9cf82dc67324963766d33efd5c8ad6d53f8)) +ROM_END + +ROM_START( a448b ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_LOAD("a448b_midi.rom", 0x0000, 0x4000, CRC(864f7967) SHA1(125b5a505498d91ca049f95fd05e693b2396bda6)) +ROM_END + +const tiny_rom_entry *arc_a448_device::device_rom_region() const +{ + return ROM_NAME( a448 ); +} + +const tiny_rom_entry *arc_a448b_device::device_rom_region() const +{ + return ROM_NAME( a448b ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_a448_device::device_add_mconfig(machine_config &config) +{ + //ZN448(config, "zn448", 0); +} + +void arc_a448b_device::device_add_mconfig(machine_config &config) +{ + arc_a448_device::device_add_mconfig(config); + + midi_port_device &mdin(MIDI_PORT(config, "mdin", midiin_slot, "midiin")); + mdin.rxd_handler().set("mdthru", FUNC(midi_port_device::write_txd)); + midiout_slot(MIDI_PORT(config, "mdthru")); + midiout_slot(MIDI_PORT(config, "mdout")); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_a448_device - constructor +//------------------------------------------------- + +arc_a448_device::arc_a448_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") +{ +} + +arc_a448_device::arc_a448_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_a448_device(mconfig, ARC_A448, tag, owner, clock) +{ +} + +arc_a448b_device::arc_a448b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_a448_device(mconfig, ARC_A448B, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_a448_device::device_start() +{ +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_A448, device_archimedes_podule_interface, arc_a448_device, "arc_a448", "Armadillo Systems A448 Sound Sampler") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_A448B, device_archimedes_podule_interface, arc_a448b_device, "arc_a448b", "Armadillo Systems A448b Stereo MIDI Sound Sampler") diff --git a/src/devices/bus/archimedes/podule/a448.h b/src/devices/bus/archimedes/podule/a448.h new file mode 100644 index 00000000000..a207c2eafd3 --- /dev/null +++ b/src/devices/bus/archimedes/podule/a448.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Armadillo Systems A448 Sound Sampler + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_A448_H +#define MAME_BUS_ARCHIMEDES_PODULE_A448_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_A448, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_A448B, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_A448_H diff --git a/src/devices/bus/archimedes/podule/armadeus.cpp b/src/devices/bus/archimedes/podule/armadeus.cpp new file mode 100644 index 00000000000..4af99d9dd8f --- /dev/null +++ b/src/devices/bus/archimedes/podule/armadeus.cpp @@ -0,0 +1,111 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Clares Armadeus Sampler Board + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Clares_SoundSampler.html + +**********************************************************************/ + +#include "emu.h" +#include "armadeus.h" +#include "sound/dac.h" +#include "speaker.h" + + +namespace { + +class arc_armadeus_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::CAPTURE; } + + // construction/destruction + arc_armadeus_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; +}; + + +void arc_armadeus_device::ioc_map(address_map &map) +{ + map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset]; })).umask32(0x000000ff); + map(0x2000, 0x2000).w("dac", FUNC(zn428e_device::data_w)); +} + + +//------------------------------------------------- +// ROM( armadeus ) +//------------------------------------------------- + +ROM_START( armadeus ) + ROM_REGION(0x0800, "podule_rom", 0) + ROM_LOAD("sound_sampler_issue_0.20.rom", 0x0000, 0x0800, CRC(dc41cfd9) SHA1(6129d91bcd21bdab75f1293f9daa7612feaffc4b)) +ROM_END + +const tiny_rom_entry *arc_armadeus_device::device_rom_region() const +{ + return ROM_NAME( armadeus ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_armadeus_device::device_add_mconfig(machine_config &config) +{ + SPEAKER(config, "speaker").front_center(); + ZN428E(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + + //ZN448(config, "zn448", 0); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_armadeus_device - constructor +//------------------------------------------------- + +arc_armadeus_device::arc_armadeus_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_ARMADEUS, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_armadeus_device::device_start() +{ +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_ARMADEUS, device_archimedes_podule_interface, arc_armadeus_device, "arc_armadeus", "Clares Armadeus Sampler Board") diff --git a/src/devices/bus/archimedes/podule/armadeus.h b/src/devices/bus/archimedes/podule/armadeus.h new file mode 100644 index 00000000000..2c45ae56e37 --- /dev/null +++ b/src/devices/bus/archimedes/podule/armadeus.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Clares Armadeus Sampler Board + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_ARMADEUS_H +#define MAME_BUS_ARCHIMEDES_PODULE_ARMADEUS_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_ARMADEUS, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_ARMADEUS_H diff --git a/src/devices/bus/archimedes/podule/ether1.cpp b/src/devices/bus/archimedes/podule/ether1.cpp new file mode 100644 index 00000000000..e4e23704360 --- /dev/null +++ b/src/devices/bus/archimedes/podule/ether1.cpp @@ -0,0 +1,184 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AKA25 Ethernet + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA25_Ethernet.html + +**********************************************************************/ + +#include "emu.h" +#include "ether1.h" +#include "machine/i82586.h" + + +namespace { + +class arc_ether1_aka25_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_ether1_aka25_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_shared_ptr m_ram; + required_device m_lance; + + void lan_map(address_map &map); + + void checksum(); + void control_w(u8 data); + + u8 m_rom_page; + u8 m_ram_page; +}; + + +void arc_ether1_aka25_device::ioc_map(address_map &map) +{ + map(0x0000, 0x003f).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | ((m_rom_page << 4) & 0x1f)]; })).umask32(0x000000ff); + map(0x0000, 0x0000).lw8(NAME([this](u8 data) { m_ram_page = data & 0x0f; })); + map(0x0004, 0x0004).w(FUNC(arc_ether1_aka25_device::control_w)); + map(0x2000, 0x3fff).lrw8(NAME([this](offs_t offset) { return m_ram[offset | (m_ram_page << 11)]; }), NAME([this](offs_t offset, u16 data) { m_ram[offset | (m_ram_page << 11)] = data; })).umask32(0x0000ffff); +} + + +void arc_ether1_aka25_device::lan_map(address_map &map) +{ + map(0x000000, 0x00ffff).mirror(0xff0000).ram().share("ram"); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_ether1_aka25_device::device_add_mconfig(machine_config &config) +{ + I82586(config, m_lance, 20_MHz_XTAL / 2); + m_lance->out_irq_cb().set([this](int state) { m_rom_page = state; set_pirq(state); }); + m_lance->set_addrmap(0, &arc_ether1_aka25_device::lan_map); +} + + +//------------------------------------------------- +// ROM( ether1_aka25 ) +//------------------------------------------------- + +ROM_START( ether1_aka25 ) + ROM_REGION(0x20, "podule_rom", 0) + ROM_LOAD("27ls19.bin", 0x00, 0x20, CRC(e034ae68) SHA1(9a9404028d166d9cbb466513f514be5d3ea77956)) +ROM_END + +const tiny_rom_entry *arc_ether1_aka25_device::device_rom_region() const +{ + return ROM_NAME( ether1_aka25 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_ether1_aka25_device - constructor +//------------------------------------------------- + +arc_ether1_aka25_device::arc_ether1_aka25_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_ETHER1_AKA25, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_ram(*this, "ram") + , m_lance(*this, "lance") + , m_rom_page(0) + , m_ram_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_ether1_aka25_device::device_start() +{ + checksum(); + + save_item(NAME(m_rom_page)); + save_item(NAME(m_ram_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_ether1_aka25_device::device_reset() +{ + m_rom_page = 0x00; + m_ram_page = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +void arc_ether1_aka25_device::checksum() +{ + // PROM CRC calculation (from A500/R200 Service Manual) + u32 chk = 0xffffffff; + + for (int i = 0; i < 28; i++) + { + // CRC on bytes 0..28 + u8 byte = m_podule_rom->base()[i]; + for (int j = 0; j < 8; j++) + { + if (((byte & 1) ^ (chk >> 31)) != 0) + chk = (chk << 1) ^ (0x04c11db7); + else + chk = (chk << 1); + + byte = byte >> 1; + } + } + + // get CRC from PROM + u32 checksum = (m_podule_rom->base()[31] << 24) | (m_podule_rom->base()[30] << 16) | (m_podule_rom->base()[29] << 8) | (m_podule_rom->base()[28] << 0); + + // test to see if the same + logerror("checksum: %08x %s\n", chk, checksum == chk ? "Pass" : "Fail"); +} + +void arc_ether1_aka25_device::control_w(u8 data) +{ + m_lance->reset_w(BIT(data, 0)); // b0 Reset + //m_sia->lpbk(BIT(data, 1)); // b1 Loop-Back + m_lance->ca(BIT(data, 2)); // b2 Channel Attention + if (BIT(data, 3)) set_pirq(0); // b3 Clear Interrupt +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_ETHER1_AKA25, device_archimedes_podule_interface, arc_ether1_aka25_device, "arc_ether1_aka25", "Acorn AKA25 Ethernet") diff --git a/src/devices/bus/archimedes/podule/ether1.h b/src/devices/bus/archimedes/podule/ether1.h new file mode 100644 index 00000000000..05cd0a3fbb8 --- /dev/null +++ b/src/devices/bus/archimedes/podule/ether1.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AKA25 Ethernet + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_ETHER1_H +#define MAME_BUS_ARCHIMEDES_PODULE_ETHER1_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_ETHER1_AKA25, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_ETHER1_H diff --git a/src/devices/bus/archimedes/podule/etherd.cpp b/src/devices/bus/archimedes/podule/etherd.cpp new file mode 100644 index 00000000000..f1f4bfc4228 --- /dev/null +++ b/src/devices/bus/archimedes/podule/etherd.cpp @@ -0,0 +1,126 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Digital Services Ethernet Podule + + TODO: + - everything, this is skeleton with ROM. + +**********************************************************************/ + +#include "emu.h" +#include "etherd.h" + + +namespace { + +class arc_etherd_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_etherd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::COMMS; } + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_etherd_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) & 0x1f800)]; })).umask32(0x000000ff); + map(0x0000, 0x0000).lw8(NAME([this](u8 data) { m_rom_page = data; })); +} + +void arc_etherd_device::memc_map(address_map &map) +{ +} + + +//------------------------------------------------- +// ROM( etherd ) +//------------------------------------------------- + +ROM_START( etherd ) + ROM_REGION(0x20000, "podule_rom", 0) + ROM_LOAD("dsle3a-2.00.rom", 0x0000, 0x20000, CRC(123a04b9) SHA1(e972c1ab2ccfd20a6e5321549d555f8ae14e12f9)) +ROM_END + +const tiny_rom_entry *arc_etherd_device::device_rom_region() const +{ + return ROM_NAME( etherd ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_etherd_device::device_add_mconfig(machine_config &config) +{ + //SMC91C90(config, "lan", 20_MHz_XTAL); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_etherd_device - constructor +//------------------------------------------------- + +arc_etherd_device::arc_etherd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_ETHERD, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_etherd_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_etherd_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_ETHERD, device_archimedes_podule_interface, arc_etherd_device, "arc_etherd", "Digital Services Ethernet Podule") diff --git a/src/devices/bus/archimedes/podule/etherd.h b/src/devices/bus/archimedes/podule/etherd.h new file mode 100644 index 00000000000..a7dcf88daaf --- /dev/null +++ b/src/devices/bus/archimedes/podule/etherd.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Digital Services Ethernet Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_ETHERD_H +#define MAME_BUS_ARCHIMEDES_PODULE_ETHERD_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_ETHERD, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_ETHERD_H diff --git a/src/devices/bus/archimedes/podule/etherr.cpp b/src/devices/bus/archimedes/podule/etherr.cpp new file mode 100644 index 00000000000..df3ebc6a57b --- /dev/null +++ b/src/devices/bus/archimedes/podule/etherr.cpp @@ -0,0 +1,126 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RISC Developments Ethernet Card + + TODO: + - everything, this is skeleton with ROM. + +**********************************************************************/ + +#include "emu.h" +#include "etherr.h" + + +namespace { + +class arc_etherr_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_etherr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::COMMS; } + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_etherr_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) & 0x1f800)]; })).umask32(0x000000ff); + map(0x0000, 0x0000).lw8(NAME([this](u8 data) { m_rom_page = data; })); +} + +void arc_etherr_device::memc_map(address_map &map) +{ +} + + +//------------------------------------------------- +// ROM( etherr ) +//------------------------------------------------- + +ROM_START( etherr ) + ROM_REGION(0x20000, "podule_rom", 0) + ROM_LOAD("etherr_1.06.rom", 0x0000, 0x20000, CRC(7b214fda) SHA1(a8045e3749fbf24e721e84e57acb68753fa46428)) +ROM_END + +const tiny_rom_entry *arc_etherr_device::device_rom_region() const +{ + return ROM_NAME( etherr ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_etherr_device::device_add_mconfig(machine_config &config) +{ + //NQ8005A(config, "edlc", 20_MHz_XTAL); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_etherr_device - constructor +//------------------------------------------------- + +arc_etherr_device::arc_etherr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_ETHERR, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_etherr_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_etherr_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_ETHERR, device_archimedes_podule_interface, arc_etherr_device, "arc_etherr", "RISC Developments Ethernet Card") diff --git a/src/devices/bus/archimedes/podule/etherr.h b/src/devices/bus/archimedes/podule/etherr.h new file mode 100644 index 00000000000..dd653a2fada --- /dev/null +++ b/src/devices/bus/archimedes/podule/etherr.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RISC Developments Ethernet Card + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_ETHERR_H +#define MAME_BUS_ARCHIMEDES_PODULE_ETHERR_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_ETHERR, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_ETHERR_H diff --git a/src/devices/bus/archimedes/podule/faxpack.cpp b/src/devices/bus/archimedes/podule/faxpack.cpp new file mode 100644 index 00000000000..0ae0d375203 --- /dev/null +++ b/src/devices/bus/archimedes/podule/faxpack.cpp @@ -0,0 +1,135 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts Fax-Pack + + https://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/CC_FaxPack.html + + TODO: + - add R96DFX modem. + +**********************************************************************/ + +#include "emu.h" +#include "faxpack.h" +#include "machine/mb8421.h" +//#include "machine/r96dfx.h" + + +namespace { + +class arc_faxpack_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_faxpack_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::CAPTURE; } + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_device m_mcu; + required_memory_region m_podule_rom; + + void mem_map(address_map &map); + void io_map(address_map &map); +}; + + +void arc_faxpack_device::ioc_map(address_map &map) +{ + map(0x0000, 0x0fff).rw("dpram", FUNC(idt7130_device::right_r), FUNC(idt7130_device::right_w)).umask32(0x000000ff); +} + + +void arc_faxpack_device::mem_map(address_map &map) +{ + map(0x0000, 0x7fff).rom().region("podule_rom", 0); +} + +void arc_faxpack_device::io_map(address_map &map) +{ + //map(0x2000, 0x201f).rw("modem", FUNC(r96dfx_device::read), FUNC(r96dfx_device::write)); + map(0x6000, 0x63ff).rw("dpram", FUNC(idt7130_device::left_r), FUNC(idt7130_device::left_w)); +} + + +//------------------------------------------------- +// ROM( faxpack ) +//------------------------------------------------- + +ROM_START( faxpack ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("faxpack_3873.rom", 0x0000, 0x8000, CRC(4bb7a925) SHA1(bbd1c4560c3bde1e61f81ae6505cd5d4658c6cb8)) +ROM_END + +const tiny_rom_entry *arc_faxpack_device::device_rom_region() const +{ + return ROM_NAME( faxpack ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_faxpack_device::device_add_mconfig(machine_config &config) +{ + I8031(config, m_mcu, 11.0592_MHz_XTAL); + m_mcu->set_addrmap(AS_PROGRAM, &arc_faxpack_device::mem_map); + m_mcu->set_addrmap(AS_IO, &arc_faxpack_device::io_map); + + idt7130_device &dpram(IDT7130(config, "dpram")); + dpram.intl_callback().set_inputline(m_mcu, MCS51_INT0_LINE); + dpram.intr_callback().set([this](int state) { set_pirq(state); }); + + //R96DFX(config, "modem", 24.00014_MHz_XTAL); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_faxpack_device - constructor +//------------------------------------------------- + +arc_faxpack_device::arc_faxpack_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_FAXPACK, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_mcu(*this, "mcu") + , m_podule_rom(*this, "podule_rom") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_faxpack_device::device_start() +{ +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_FAXPACK, device_archimedes_podule_interface, arc_faxpack_device, "arc_faxpack", "Computer Concepts FaxPack Modem") diff --git a/src/devices/bus/archimedes/podule/faxpack.h b/src/devices/bus/archimedes/podule/faxpack.h new file mode 100644 index 00000000000..562af1ffdb8 --- /dev/null +++ b/src/devices/bus/archimedes/podule/faxpack.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts Fax-Pack + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_FAXPACK_H +#define MAME_BUS_ARCHIMEDES_PODULE_FAXPACK_H + +#pragma once + +#include "slot.h" +#include "cpu/mcs51/mcs51.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_FAXPACK, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_FAXPACK_H diff --git a/src/devices/bus/archimedes/podule/ide_rdev.cpp b/src/devices/bus/archimedes/podule/ide_rdev.cpp new file mode 100644 index 00000000000..ccf48d24e51 --- /dev/null +++ b/src/devices/bus/archimedes/podule/ide_rdev.cpp @@ -0,0 +1,122 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RISC Developments IDE Hard Disc System + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/RiscDev_IDE.html + +**********************************************************************/ + +#include "emu.h" +#include "ide_rdev.h" +#include "bus/ata/ataintf.h" + + +namespace { + +class arc_ide_rdev_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_ide_rdev_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_ide_rdev_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) & 0x7800)]; })).umask32(0x000000ff); + map(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data; })); + map(0x2400, 0x2403).nopw(); // TODO: interrupt enable? + map(0x2800, 0x281f).rw("ata", FUNC(ata_interface_device::cs0_r), FUNC(ata_interface_device::cs0_w)).umask32(0x0000ffff); +} + + +//------------------------------------------------- +// ROM( ide_riscdev ) +//------------------------------------------------- + +ROM_START( ide_riscdev ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("ide_1.24_riscdev.bin", 0x0000, 0x8000, CRC(53bc8e72) SHA1(84e5d31d631b69401c47ef1ce91f11f1bb317597)) +ROM_END + +const tiny_rom_entry *arc_ide_rdev_device::device_rom_region() const +{ + return ROM_NAME( ide_riscdev ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_ide_rdev_device::device_add_mconfig(machine_config &config) +{ + ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false)); + ata.irq_handler().set([this](int state) { set_pirq(state); }); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_ide_rdev_device - constructor +//------------------------------------------------- + +arc_ide_rdev_device::arc_ide_rdev_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_IDE_RDEV, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_ide_rdev_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_ide_rdev_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_IDE_RDEV, device_archimedes_podule_interface, arc_ide_rdev_device, "arc_ide_rdev", "RISC Developments IDE Hard Disc System") diff --git a/src/devices/bus/archimedes/podule/ide_rdev.h b/src/devices/bus/archimedes/podule/ide_rdev.h new file mode 100644 index 00000000000..ad4ccb683a7 --- /dev/null +++ b/src/devices/bus/archimedes/podule/ide_rdev.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + RISC Developments IDE Hard Disc System + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_IDE_RDEV_H +#define MAME_BUS_ARCHIMEDES_PODULE_IDE_RDEV_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_IDE_RDEV, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_IDE_RDEV_H diff --git a/src/devices/bus/archimedes/podule/io.cpp b/src/devices/bus/archimedes/podule/io.cpp new file mode 100644 index 00000000000..1636079dc7e --- /dev/null +++ b/src/devices/bus/archimedes/podule/io.cpp @@ -0,0 +1,446 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AKA10 BBC I/O Podule + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA10_IO.html + + Acorn AKA12 User Port/Midi Upgrade + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA12_MIDI.html + + Acorn AKA15 Midi and BBC I/O Podule + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA15_MIDI.html + + Acorn AKA16 Midi Podule + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA16_MIDI.html + + TODO: + - interrupts are optional, and are enabled with links. + +**********************************************************************/ + +#include "emu.h" +#include "io.h" +#include "machine/6522via.h" +#include "machine/6850acia.h" +#include "machine/clock.h" +#include "machine/input_merger.h" +#include "machine/mc68681.h" +#include "machine/upd7002.h" +#include "bus/bbc/1mhzbus/1mhzbus.h" +#include "bus/bbc/analogue/analogue.h" +#include "bus/bbc/userport/userport.h" +#include "bus/midi/midi.h" + + +namespace { + +// ======================> arc_io_aka_device + +class arc_io_aka_device : + public device_t, + public device_archimedes_podule_interface +{ +protected: + arc_io_aka_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + void add_1mhzbus(machine_config &config); + void add_analogue(machine_config &config); + void add_midi_6850(machine_config &config); + void add_midi_2691(machine_config &config); + void add_userport(machine_config &config); + + required_memory_region m_podule_rom; + required_device m_irqs; + optional_device m_analog; + + u8 m_rom_page; + + u8 pa_r(); + int get_analogue_input(int channel_number); + void upd7002_eoc(int state); + + int m_irq_en; +}; + + +// ======================> arc_bbcio_aka10_device + +class arc_bbcio_aka10_device : public arc_io_aka_device +{ +public: + // construction/destruction + arc_bbcio_aka10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; +}; + + +// ======================> arc_upmidi_aka12_device + +class arc_upmidi_aka12_device : public arc_io_aka_device +{ +public: + // construction/destruction + arc_upmidi_aka12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; +}; + + +// ======================> arc_iomidi_aka15_device + +class arc_iomidi_aka15_device : public arc_io_aka_device +{ +public: + // construction/destruction + arc_iomidi_aka15_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; +}; + + +// ======================> arc_midi_aka16_device + +class arc_midi_aka16_device : public arc_io_aka_device +{ +public: + // construction/destruction + arc_midi_aka16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; +}; + + +void arc_bbcio_aka10_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); +} + +void arc_bbcio_aka10_device::memc_map(address_map &map) +{ + map(0x0000, 0x03ff).rw("1mhzbus", FUNC(bbc_1mhzbus_slot_device::fred_r), FUNC(bbc_1mhzbus_slot_device::fred_w)).umask32(0x000000ff); + map(0x0800, 0x0bff).rw("1mhzbus", FUNC(bbc_1mhzbus_slot_device::jim_r), FUNC(bbc_1mhzbus_slot_device::jim_w)).umask32(0x000000ff); + map(0x1000, 0x100f).rw("upd7002", FUNC(upd7002_device::read), FUNC(upd7002_device::write)).umask32(0x000000ff); +} + + +void arc_upmidi_aka12_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); + map(0x3000, 0x301f).rw("uart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff); +} + + +void arc_iomidi_aka15_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); +} + +void arc_iomidi_aka15_device::memc_map(address_map &map) +{ + map(0x0000, 0x03ff).rw("1mhzbus", FUNC(bbc_1mhzbus_slot_device::fred_r), FUNC(bbc_1mhzbus_slot_device::fred_w)).umask32(0x000000ff); + map(0x0800, 0x0bff).rw("1mhzbus", FUNC(bbc_1mhzbus_slot_device::jim_r), FUNC(bbc_1mhzbus_slot_device::jim_w)).umask32(0x000000ff); + map(0x1000, 0x100f).rw("upd7002", FUNC(upd7002_device::read), FUNC(upd7002_device::write)).umask32(0x000000ff); + map(0x1800, 0x1807).rw("acia", FUNC(acia6850_device::read), FUNC(acia6850_device::write)).umask32(0x000000ff); +} + + +void arc_midi_aka16_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data; })); + map(0x3000, 0x301f).rw("uart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( aka10 ) +//------------------------------------------------- + +ROM_START( aka10 ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "3", "Third release 22-Sep-89") + ROMX_LOAD("0276,202-03_io.bin", 0x0000, 0x4000, CRC(f4df6587) SHA1(2c0402cd754ebeb1e1fe750dc8a88a2acc1ea06d), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "2", "Second release 18-Dec-87") + ROMX_LOAD("0276,202-02_io.bin", 0x0000, 0x4000, CRC(d548b4dc) SHA1(22e1f1a0adf896f08b1e1d487aa24141296aa127), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "1", "Release 1.04 07-Aug-87") + ROMX_LOAD("0276,202-01_io.bin", 0x0000, 0x4000, CRC(fc1d61d0) SHA1(4c3de606de594c8f6ed236ffa19374c76e307226), ROM_BIOS(2)) +ROM_END + +ROM_START( aka12 ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "2", "Second release 31-Aug-89") + ROMX_LOAD("0280,320-02_a3000_upm.bin", 0x0000, 0x4000, CRC(3f0f5794) SHA1(4e0e2cf2586c8f2fc1431458f677a45164749ab2), ROM_BIOS(0)) +ROM_END + +ROM_START( aka15 ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "1", "Initial release 18-Dec-87") + ROMX_LOAD("0276,211-01_iomidi.bin", 0x0000, 0x4000, CRC(e85a77c5) SHA1(32e990c435b439d4a169e85a009fc6a864121c3f), ROM_BIOS(0)) +ROM_END + +ROM_START( aka16 ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "2", "Second release 31-Aug-89") + ROMX_LOAD("0276,281-02_midi-pod_v3.03.rom", 0x0000, 0x4000, CRC(1833afdd) SHA1(beb86b74bf6a9c9caf10f57e326cc539ffe9624b), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "1", "Test version 11-Jan-88") + ROMX_LOAD("0276,281-01_midi-pod.rom", 0x0000, 0x4000, CRC(c09ae053) SHA1(e0e63e0b44d3eba805aea9d2103ab35ea93e8c1c), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "m", "Millipede Mod 8/1/98") // modified by Millipede to fix clash with their cards + ROMX_LOAD("millipede_mod_8-1-98.rom", 0x0000, 0x4000, CRC(729b9d61) SHA1(f6ad28d3cf9a14af3c103f9fae74795f539f24e8), ROM_BIOS(2)) +ROM_END + +const tiny_rom_entry *arc_bbcio_aka10_device::device_rom_region() const +{ + return ROM_NAME( aka10 ); +} + +const tiny_rom_entry *arc_upmidi_aka12_device::device_rom_region() const +{ + return ROM_NAME( aka12 ); +} + +const tiny_rom_entry *arc_iomidi_aka15_device::device_rom_region() const +{ + return ROM_NAME( aka15 ); +} + +const tiny_rom_entry *arc_midi_aka16_device::device_rom_region() const +{ + return ROM_NAME( aka16 ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_io_aka_device::add_userport(machine_config &config) +{ + via6522_device &via(MOS6522(config, "via", DERIVED_CLOCK(1, 4))); + via.irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>)); + via.readpa_handler().set(FUNC(arc_io_aka_device::pa_r)); + via.writepa_handler().set([this](u8 data) { m_rom_page = data; }); + via.readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r)); + via.writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w)); + via.ca2_handler().set([this](int state) { m_irq_en = !state; }); // AKA10/15 only + via.cb1_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb1)); + via.cb2_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb2)); + + bbc_userport_slot_device &userport(BBC_USERPORT_SLOT(config, "userport", bbc_userport_devices, nullptr)); + userport.cb1_handler().set("via", FUNC(via6522_device::write_cb1)); + userport.cb2_handler().set("via", FUNC(via6522_device::write_cb2)); +} + +void arc_io_aka_device::add_analogue(machine_config &config) +{ + upd7002_device &upd7002(UPD7002(config, "upd7002", DERIVED_CLOCK(1, 4))); + upd7002.set_get_analogue_callback(FUNC(arc_io_aka_device::get_analogue_input)); + upd7002.set_eoc_callback(FUNC(arc_io_aka_device::upd7002_eoc)); + + BBC_ANALOGUE_SLOT(config, m_analog, bbc_analogue_devices, nullptr); + m_analog->lpstb_handler().set("via", FUNC(via6522_device::write_ca1)); +} + +void arc_io_aka_device::add_1mhzbus(machine_config &config) +{ + bbc_1mhzbus_slot_device &bus(BBC_1MHZBUS_SLOT(config, "1mhzbus", DERIVED_CLOCK(1, 8), bbcm_1mhzbus_devices, nullptr)); + bus.irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>)); + bus.nmi_handler().set([this](int state) { set_pfiq(state); }); +} + +void arc_io_aka_device::add_midi_6850(machine_config &config) +{ + acia6850_device &acia(ACIA6850(config, "acia", 0)); + acia.irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<3>)); + acia.txd_handler().set("mdout", FUNC(midi_port_device::write_txd)); + + clock_device &acia_clock(CLOCK(config, "acia_clock", DERIVED_CLOCK(1, 4))); + acia_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc)); + acia_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc)); + + midiout_slot(MIDI_PORT(config, "mdout")); + + auto &mdin(MIDI_PORT(config, "mdin")); + midiin_slot(mdin); + mdin.rxd_handler().set("acia", FUNC(acia6850_device::write_rxd)); +} + +void arc_io_aka_device::add_midi_2691(machine_config &config) +{ + scn2681_device &uart(SCN2681(config, "uart", DERIVED_CLOCK(1, 4))); // SCC2691 + uart.irq_cb().set(m_irqs, FUNC(input_merger_device::in_w<3>)); + uart.a_tx_cb().set("mdout", FUNC(midi_port_device::write_txd)); + uart.a_tx_cb().append("mdthru", FUNC(midi_port_device::write_txd)); + + auto &mdin(MIDI_PORT(config, "mdin")); + midiin_slot(mdin); + mdin.rxd_handler().set("uart", FUNC(scn2681_device::rx_a_w)); + mdin.rxd_handler().append("mdthru", FUNC(midi_port_device::write_txd)); + + midiout_slot(MIDI_PORT(config, "mdthru")); + midiout_slot(MIDI_PORT(config, "mdout")); +} + + +void arc_bbcio_aka10_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(m_irq_en && state); }); + add_userport(config); + add_1mhzbus(config); + add_analogue(config); +} + +void arc_upmidi_aka12_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(state); }); + add_userport(config); + add_midi_2691(config); +} + +void arc_iomidi_aka15_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(m_irq_en && state); }); + add_userport(config); + add_1mhzbus(config); + add_analogue(config); + add_midi_6850(config); +} + +void arc_midi_aka16_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(state); }); + add_midi_2691(config); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_io_aka_device - constructor +//------------------------------------------------- + +arc_io_aka_device::arc_io_aka_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_irqs(*this, "irqs") + , m_analog(*this, "analogue") + , m_rom_page(0) + , m_irq_en(0) +{ +} + +arc_bbcio_aka10_device::arc_bbcio_aka10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_io_aka_device(mconfig, ARC_BBCIO_AKA10, tag, owner, clock) +{ +} + +arc_upmidi_aka12_device::arc_upmidi_aka12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_io_aka_device(mconfig, ARC_UPMIDI_AKA12, tag, owner, clock) +{ +} + +arc_iomidi_aka15_device::arc_iomidi_aka15_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_io_aka_device(mconfig, ARC_IOMIDI_AKA15, tag, owner, clock) +{ +} + +arc_midi_aka16_device::arc_midi_aka16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_io_aka_device(mconfig, ARC_MIDI_AKA16, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_io_aka_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_io_aka_device::device_reset() +{ + m_rom_page = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +u8 arc_io_aka_device::pa_r() +{ + u8 data = 0xff; + + if (m_analog) + { + data = (m_analog->pb_r() << 2) | 0x3f; + } + + return data; +} + +int arc_io_aka_device::get_analogue_input(int channel_number) +{ + return (0xff - m_analog->ch_r(channel_number)) << 8; +} + +void arc_io_aka_device::upd7002_eoc(int state) +{ + m_irqs->in_w<1>(!state); +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_BBCIO_AKA10, device_archimedes_podule_interface, arc_bbcio_aka10_device, "arc_bbcio_aka10", "Acorn AKA10 BBC I/O Podule") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_UPMIDI_AKA12, device_archimedes_podule_interface, arc_upmidi_aka12_device, "arc_upmidi_aka12", "Acorn AKA12 User Port/MIDI Podule") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_IOMIDI_AKA15, device_archimedes_podule_interface, arc_iomidi_aka15_device, "arc_iomidi_aka15", "Acorn AKA15 MIDI and BBC I/O Podule") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_MIDI_AKA16, device_archimedes_podule_interface, arc_midi_aka16_device, "arc_midi_aka16", "Acorn AKA16 MIDI Podule") diff --git a/src/devices/bus/archimedes/podule/io.h b/src/devices/bus/archimedes/podule/io.h new file mode 100644 index 00000000000..56acab33bd6 --- /dev/null +++ b/src/devices/bus/archimedes/podule/io.h @@ -0,0 +1,23 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn BBC I/O Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_IO_H +#define MAME_BUS_ARCHIMEDES_PODULE_IO_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_BBCIO_AKA10, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_UPMIDI_AKA12, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_IOMIDI_AKA15, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_MIDI_AKA16, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_BBCIO_AGA30, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_IO_H diff --git a/src/devices/bus/archimedes/podule/io_hccs.cpp b/src/devices/bus/archimedes/podule/io_hccs.cpp new file mode 100644 index 00000000000..7daabf0f980 --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_hccs.cpp @@ -0,0 +1,143 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + HCCS User/Analogue Podule + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/HCCS_UserAnalogue.html + +**********************************************************************/ + +#include "emu.h" +#include "io_hccs.h" +#include "machine/6522via.h" +#include "machine/upd7002.h" +#include "bus/bbc/analogue/analogue.h" +#include "bus/bbc/userport/userport.h" + + +namespace { + +// ======================> arc_upa_hccs_device + +class arc_upa_hccs_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_upa_hccs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_device m_analog; + + int get_analogue_input(int channel_number); +}; + + +void arc_upa_hccs_device::ioc_map(address_map &map) +{ + map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | 0x4000]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); + map(0x3000, 0x300f).rw("upd7002", FUNC(upd7002_device::read), FUNC(upd7002_device::write)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( upa_hccs ) +//------------------------------------------------- + +ROM_START( upa_hccs ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "7", "V7.00 (04 Jul 1991)") + ROMX_LOAD("upa_v7.00.bin", 0x0000, 0x8000, CRC(e4d5514e) SHA1(1a5d5c2571624df6fbeff91045c5b40effeda1d9), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *arc_upa_hccs_device::device_rom_region() const +{ + return ROM_NAME( upa_hccs ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_upa_hccs_device::device_add_mconfig(machine_config &config) +{ + via6522_device &via(MOS6522(config, "via", DERIVED_CLOCK(1, 4))); + via.irq_handler().set([this](int state) { set_pirq(state); }); + via.readpa_handler().set(m_analog, FUNC(bbc_analogue_slot_device::pb_r)); + via.readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r)); + via.writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w)); + via.cb1_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb1)); + via.cb2_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb2)); + + bbc_userport_slot_device &userport(BBC_USERPORT_SLOT(config, "userport", bbc_userport_devices, nullptr)); + userport.cb1_handler().set("via", FUNC(via6522_device::write_cb1)); + userport.cb2_handler().set("via", FUNC(via6522_device::write_cb2)); + + upd7002_device &upd7002(UPD7002(config, "upd7002", DERIVED_CLOCK(1, 4))); + upd7002.set_get_analogue_callback(FUNC(arc_upa_hccs_device::get_analogue_input)); + upd7002.set_eoc_callback("via", FUNC(via6522_device::write_ca2)); + + BBC_ANALOGUE_SLOT(config, m_analog, bbc_analogue_devices, nullptr); + m_analog->lpstb_handler().set("via", FUNC(via6522_device::write_ca1)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_upa_hccs_device - constructor +//------------------------------------------------- + +arc_upa_hccs_device::arc_upa_hccs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_UPA_HCCS, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_analog(*this, "analogue") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_upa_hccs_device::device_start() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +int arc_upa_hccs_device::get_analogue_input(int channel_number) +{ + return (0xff - m_analog->ch_r(channel_number)) << 8; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_UPA_HCCS, device_archimedes_podule_interface, arc_upa_hccs_device, "arc_upa_hccs", "HCCS User/Analogue Podule") diff --git a/src/devices/bus/archimedes/podule/io_hccs.h b/src/devices/bus/archimedes/podule/io_hccs.h new file mode 100644 index 00000000000..6287e5cedbf --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_hccs.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + HCCS User/Analogue Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_IO_HCCS_H +#define MAME_BUS_ARCHIMEDES_PODULE_IO_HCCS_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_UPA_HCCS, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_IO_HCCS_H diff --git a/src/devices/bus/archimedes/podule/io_morley.cpp b/src/devices/bus/archimedes/podule/io_morley.cpp new file mode 100644 index 00000000000..bb5da44d7ad --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_morley.cpp @@ -0,0 +1,179 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Morley Electronics User I2C Analogue mini-podule + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/Morley_UserICAnalogue.html + + Acorn AGA30 BBC I/O Podule + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AGA30_AnalogueUserP.html + +**********************************************************************/ + +#include "emu.h" +#include "io_morley.h" +#include "machine/6522via.h" +#include "machine/input_merger.h" +#include "machine/upd7002.h" +#include "bus/bbc/analogue/analogue.h" +#include "bus/bbc/userport/userport.h" + + +namespace { + +// ======================> arc_bbcio_aga30_device + +class arc_bbcio_aga30_device : + public device_t, + public device_archimedes_podule_interface +{ + public: + // construction/destruction + arc_bbcio_aga30_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_device m_irqs; + optional_device m_analog; + + u8 m_rom_page; + + int get_analogue_input(int channel_number); + void upd7002_eoc(int state); +}; + + +void arc_bbcio_aga30_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); +} + +void arc_bbcio_aga30_device::memc_map(address_map &map) +{ + map(0x1000, 0x100f).rw("upd7002", FUNC(upd7002_device::read), FUNC(upd7002_device::write)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( aga30 ) +//------------------------------------------------- + +ROM_START( aga30 ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "1", "First release 08-Mar-90") + ROMX_LOAD("morleyio_v2.01.bin", 0x0000, 0x4000, CRC(b149f631) SHA1(ed8d0caa478f030e11348b23e915897f27dcf153), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *arc_bbcio_aga30_device::device_rom_region() const +{ + return ROM_NAME( aga30 ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_bbcio_aga30_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(state); }); + + via6522_device &via(MOS6522(config, "via", DERIVED_CLOCK(1, 4))); + via.irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>)); + via.readpa_handler().set(m_analog, FUNC(bbc_analogue_slot_device::pb_r)).lshift(2); + via.writepa_handler().set([this](u8 data) { m_rom_page = data; }); + via.readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r)); + via.writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w)); + via.cb1_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb1)); + via.cb2_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb2)); + + bbc_userport_slot_device &userport(BBC_USERPORT_SLOT(config, "userport", bbc_userport_devices, nullptr)); + userport.cb1_handler().set("via", FUNC(via6522_device::write_cb1)); + userport.cb2_handler().set("via", FUNC(via6522_device::write_cb2)); + + upd7002_device &upd7002(UPD7002(config, "upd7002", DERIVED_CLOCK(1, 4))); + upd7002.set_get_analogue_callback(FUNC(arc_bbcio_aga30_device::get_analogue_input)); + upd7002.set_eoc_callback(FUNC(arc_bbcio_aga30_device::upd7002_eoc)); + + BBC_ANALOGUE_SLOT(config, m_analog, bbc_analogue_devices, nullptr); + m_analog->lpstb_handler().set("via", FUNC(via6522_device::write_ca1)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_bbcio_aga30_device - constructor +//------------------------------------------------- + +arc_bbcio_aga30_device::arc_bbcio_aga30_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_BBCIO_AGA30, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_irqs(*this, "irqs") + , m_analog(*this, "analogue") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_bbcio_aga30_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_bbcio_aga30_device::device_reset() +{ + m_rom_page = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +int arc_bbcio_aga30_device::get_analogue_input(int channel_number) +{ + return (0xff - m_analog->ch_r(channel_number)) << 8; +} + +void arc_bbcio_aga30_device::upd7002_eoc(int state) +{ + m_irqs->in_w<1>(!state); +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_BBCIO_AGA30, device_archimedes_podule_interface, arc_bbcio_aga30_device, "arc_bbcio_aga30", "Acorn AGA30 BBC I/O Podule") diff --git a/src/devices/bus/archimedes/podule/io_morley.h b/src/devices/bus/archimedes/podule/io_morley.h new file mode 100644 index 00000000000..4d5f8655dfa --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_morley.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Morley Electronics User I2C Analogue mini-podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_IO_MORLEY_H +#define MAME_BUS_ARCHIMEDES_PODULE_IO_MORLEY_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_BBCIO_AGA30, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_IO_MORLEY_H diff --git a/src/devices/bus/archimedes/podule/io_we.cpp b/src/devices/bus/archimedes/podule/io_we.cpp new file mode 100644 index 00000000000..e7916c15b21 --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_we.cpp @@ -0,0 +1,190 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Watford Electronics A3000 BBC User I/O + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/WE_A3000_IICUserAnalog.html + +**********************************************************************/ + +#include "emu.h" +#include "io_we.h" +#include "machine/6522via.h" +#include "machine/input_merger.h" +#include "machine/upd7002.h" +#include "bus/bbc/analogue/analogue.h" +#include "bus/bbc/userport/userport.h" + + +namespace { + +// ======================> arc_bbcio_we_device + +class arc_bbcio_we_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_bbcio_we_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_device m_irqs; + required_device m_analog; + required_device m_upd7002; + + u8 m_rom_page; + + int get_analogue_input(int channel_number); + void upd7002_eoc(int state); + + int m_adc_irq; + int m_via_irq; +}; + + +void arc_bbcio_we_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) & 0x3800)]; })).umask32(0x000000ff); + map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); + map(0x3000, 0x3000).lr8(NAME([this]() { return (m_via_irq << 7); })); + map(0x3800, 0x3800).lr8(NAME([this]() { return (m_adc_irq << 7); })); +} + +void arc_bbcio_we_device::memc_map(address_map &map) +{ + map(0x1000, 0x10ff).lr8(NAME([this](offs_t offset) { return m_upd7002->read(offset >> 4); })).umask32(0x000000ff); + map(0x1000, 0x10ff).lw8(NAME([this](offs_t offset, u8 data) { m_upd7002->write(offset >> 4, data); })).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( bbcio_we ) +//------------------------------------------------- + +ROM_START( bbcio_we ) + ROM_REGION(0x4000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "100", "1.00 (16 Jan 1992)") + ROMX_LOAD("a3000_io-1.01.bin", 0x0000, 0x4000, CRC(a432bdcd) SHA1(05c79e38707e406eed23cec6b3d2730e8fe550e8), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *arc_bbcio_we_device::device_rom_region() const +{ + return ROM_NAME( bbcio_we ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_bbcio_we_device::device_add_mconfig(machine_config &config) +{ + INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set([this](int state) { set_pirq(state); }); + + via6522_device &via(MOS6522(config, "via", DERIVED_CLOCK(1, 4))); + via.irq_handler().set([this](int state) { m_via_irq = state; m_irqs->in_w<0>(state); }); + via.readpa_handler().set(m_analog, FUNC(bbc_analogue_slot_device::pb_r)).lshift(2); + via.writepa_handler().set([this](u8 data) { m_rom_page = data; }); + via.readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r)); + via.writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w)); + via.cb1_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb1)); + via.cb2_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb2)); + + bbc_userport_slot_device &userport(BBC_USERPORT_SLOT(config, "userport", bbc_userport_devices, nullptr)); + userport.cb1_handler().set("via", FUNC(via6522_device::write_cb1)); + userport.cb2_handler().set("via", FUNC(via6522_device::write_cb2)); + + upd7002_device &upd7002(UPD7002(config, "upd7002", DERIVED_CLOCK(1, 4))); + upd7002.set_get_analogue_callback(FUNC(arc_bbcio_we_device::get_analogue_input)); + upd7002.set_eoc_callback(FUNC(arc_bbcio_we_device::upd7002_eoc)); + + BBC_ANALOGUE_SLOT(config, m_analog, bbc_analogue_devices, nullptr); + m_analog->lpstb_handler().set("via", FUNC(via6522_device::write_ca1)); + + // TODO: internal A3000 version adds IIC port +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_bbcio_we_device - constructor +//------------------------------------------------- + +arc_bbcio_we_device::arc_bbcio_we_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_BBCIO_WE, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_irqs(*this, "irqs") + , m_analog(*this, "analogue") + , m_upd7002(*this, "upd7002") + , m_rom_page(0) + , m_adc_irq(0) + , m_via_irq(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_bbcio_we_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_bbcio_we_device::device_reset() +{ + m_rom_page = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +int arc_bbcio_we_device::get_analogue_input(int channel_number) +{ + return (0xff - m_analog->ch_r(channel_number)) << 8; +} + +void arc_bbcio_we_device::upd7002_eoc(int state) +{ + m_adc_irq = !state; + + m_irqs->in_w<1>(!state); +} + + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_BBCIO_WE, device_archimedes_podule_interface, arc_bbcio_we_device, "arc_bbcio_we", "Watford Electronics BBC User I/O Card") diff --git a/src/devices/bus/archimedes/podule/io_we.h b/src/devices/bus/archimedes/podule/io_we.h new file mode 100644 index 00000000000..37a767eaee9 --- /dev/null +++ b/src/devices/bus/archimedes/podule/io_we.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Watford Electronics A3000 BBC User I/O + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_IO_WE_H +#define MAME_BUS_ARCHIMEDES_PODULE_IO_WE_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_BBCIO_WE, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_IO_WE_H diff --git a/src/devices/bus/archimedes/podule/lark.cpp b/src/devices/bus/archimedes/podule/lark.cpp new file mode 100644 index 00000000000..1a02c74b0c3 --- /dev/null +++ b/src/devices/bus/archimedes/podule/lark.cpp @@ -0,0 +1,255 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Wild Vision/Computer Concepts Lark A16 + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/CC_Lark.html + +**********************************************************************/ + +#include "emu.h" +#include "lark.h" +#include "machine/7200fifo.h" +#include "machine/ins8250.h" +#include "sound/ad1848.h" +#include "bus/midi/midi.h" +#include "speaker.h" + + +namespace { + +class arc_lark_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_lark_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::CAPTURE; } + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_device m_ad1848; + required_device m_fifo_in; + required_device m_fifo_out; + + u8 status_r(); + void control_w(u8 data); + + void update_irqs(); + void set_irq(u8 mask, int state); + void playback_drq(int state); + + u8 m_rom_page; + u8 m_status; + u8 m_ctrl; + + static constexpr u8 IRQ_MASTER = 1 << 0; + static constexpr u8 IRQ_AD1848 = 1 << 1; + static constexpr u8 IRQ_16550 = 1 << 2; + static constexpr u8 IRQ_FIFO_OUT = 1 << 6; + static constexpr u8 IRQ_FIFO_IN = 1 << 7; + + static constexpr u8 CTRL_FIFO_OUT_ENA = 1 << 3; + static constexpr u8 CTRL_FIFO_IN_ENA = 1 << 4; + static constexpr u8 CTRL_RESET = 1 << 7; +}; + + +void arc_lark_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) & 0x1f800)]; })).umask32(0x000000ff); + map(0x0000, 0x0000).lw8(NAME([this](u8 data) { })); // XC3030 FPGA + map(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data; })); + map(0x3000, 0x3000).rw(FUNC(arc_lark_device::status_r), FUNC(arc_lark_device::control_w)); + map(0x3400, 0x341f).rw("uart", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x3c00, 0x3c0f).rw(m_ad1848, FUNC(ad1848_device::read), FUNC(ad1848_device::write)).umask32(0x000000ff); +} + +void arc_lark_device::memc_map(address_map &map) +{ + map(0x0000, 0x0003).mirror(0x1ffc) + .lr16(NAME([this]() + { + u16 data; + data = m_fifo_in->data_byte_r() << 8; + data |= m_fifo_in->data_byte_r(); + return data; + })) + .lw16(NAME([this](u16 data) + { + m_fifo_out->data_byte_w(data >> 8); + m_fifo_out->data_byte_w(data & 0xff); + + })).umask32(0x0000ffff); +} + + +//------------------------------------------------- +// ROM( lark ) +//------------------------------------------------- + +ROM_START( lark ) + ROM_REGION(0x20000, "podule_rom", 0) + ROM_SYSTEM_BIOS(0, "110", "Lark A16 V1.10 (12 Jul 1994)") + ROMX_LOAD("lark.rom", 0x0000, 0x20000, CRC(9bb6cb99) SHA1(f0b2ba52d0069dfe00a7ba66fba23e0eb2346d8c), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *arc_lark_device::device_rom_region() const +{ + return ROM_NAME( lark ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_lark_device::device_add_mconfig(machine_config &config) +{ + AD1848(config, m_ad1848, 0); + //m_ad1848->irq().set([this](int state) { set_irq(IRQ_AD1848, state); }); // not used/connected? + m_ad1848->drq().set(FUNC(arc_lark_device::playback_drq)); + + IDT7202(config, m_fifo_out); // AM7202A + m_fifo_out->hf_handler().set([this](int state) { set_irq(IRQ_FIFO_OUT, state); }); + IDT7202(config, m_fifo_in); // AM7202A + m_fifo_in->hf_handler().set([this](int state) { set_irq(IRQ_FIFO_IN, !state); }); + + ns16550_device &uart(NS16550(config, "uart", DERIVED_CLOCK(1, 4))); + uart.out_tx_callback().set("mdout", FUNC(midi_port_device::write_txd)); + uart.out_tx_callback().append("mdthru", FUNC(midi_port_device::write_txd)); + uart.out_int_callback().set([this](int state) { set_irq(IRQ_16550, state); }); + + midi_port_device &mdin(MIDI_PORT(config, "mdin", midiin_slot, "midiin")); + mdin.rxd_handler().set("uart", FUNC(ns16550_device::rx_w)); + mdin.rxd_handler().append("mdthru", FUNC(midi_port_device::write_txd)); + midiout_slot(MIDI_PORT(config, "mdout")); + midiout_slot(MIDI_PORT(config, "mdthru")); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_lark_device - constructor +//------------------------------------------------- + +arc_lark_device::arc_lark_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_LARK, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_ad1848(*this, "ad1848") + , m_fifo_in(*this, "fifo_in") + , m_fifo_out(*this, "fifo_out") + , m_rom_page(0) + , m_status(0) + , m_ctrl(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_lark_device::device_start() +{ + save_item(NAME(m_rom_page)); + save_item(NAME(m_status)); + save_item(NAME(m_ctrl)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_lark_device::device_reset() +{ + m_rom_page = 0x00; + m_status = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +u8 arc_lark_device::status_r() +{ + if (m_status ^ IRQ_FIFO_IN) + return (m_status | IRQ_MASTER); + else + return m_status; +} + +void arc_lark_device::control_w(u8 data) +{ + m_ctrl = data; + + update_irqs(); + + if (m_ctrl & CTRL_RESET) + m_fifo_out->reset(); +} + +void arc_lark_device::update_irqs() +{ + u8 irq_status = m_status ^ 0x80; + + if (!(m_ctrl & CTRL_FIFO_IN_ENA)) + irq_status &= 0x7f; + + set_pirq(irq_status ? ASSERT_LINE : CLEAR_LINE); +} + +void arc_lark_device::set_irq(u8 mask, int state) +{ + if (state) + m_status |= mask; + else + m_status &= ~mask; + + update_irqs(); +} + +void arc_lark_device::playback_drq(int state) +{ + if (state) + { + if (m_ctrl & CTRL_FIFO_OUT_ENA) + { + // 16-bit stereo data stream + m_ad1848->dack_w(m_fifo_out->data_byte_r()); + m_ad1848->dack_w(m_fifo_out->data_byte_r()); + m_ad1848->dack_w(m_fifo_out->data_byte_r()); + m_ad1848->dack_w(m_fifo_out->data_byte_r()); + } + } +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_LARK, device_archimedes_podule_interface, arc_lark_device, "arc_lark", "Wild Vision/Computer Concepts Lark A16") diff --git a/src/devices/bus/archimedes/podule/lark.h b/src/devices/bus/archimedes/podule/lark.h new file mode 100644 index 00000000000..46202f82b2d --- /dev/null +++ b/src/devices/bus/archimedes/podule/lark.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Wild Vision/Computer Concepts Lark A16 + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_LARK_H +#define MAME_BUS_ARCHIMEDES_PODULE_LARK_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_LARK, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_LARK_H diff --git a/src/devices/bus/archimedes/podule/laserd.cpp b/src/devices/bus/archimedes/podule/laserd.cpp new file mode 100644 index 00000000000..eb688f3735f --- /dev/null +++ b/src/devices/bus/archimedes/podule/laserd.cpp @@ -0,0 +1,169 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts LaserDirect + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/CC_LaserDirect.html + + TODO: + - everything, this is skeleton with ROM. + +**********************************************************************/ + +#include "emu.h" +#include "laserd.h" +#include "machine/7200fifo.h" +#include "bus/centronics/ctronics.h" + + +namespace { + +class arc_laserd_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::PRINTER; } + +protected: + arc_laserd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 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; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +// ======================> arc_lbp4_device + +class arc_lbp4_device : public arc_laserd_device +{ +public: + // construction/destruction + arc_lbp4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual const tiny_rom_entry *device_rom_region() const override; +}; + + +void arc_laserd_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) & 0x7800)]; })).umask32(0x000000ff); + map(0x0000, 0x3fff).lw8(NAME([this](u8 data) { m_rom_page = data ^ 0xff; })).umask32(0x000000ff); +} + +void arc_laserd_device::memc_map(address_map &map) +{ + //map(0x0000, 0x0003).r("fifo0", FUNC(fifo7200_device::data_word_r)).umask32(0x0000ffff); + //map(0x0000, 0x0003).w("cent_data_out", FUNC(output_latch_device::write)).umask32(0x000000ff); + map(0x0004, 0x0007).r("cent_status_in", FUNC(input_buffer_device::read)).umask32(0x000000ff); + map(0x0004, 0x0007).w("cent_ctrl_out", FUNC(output_latch_device::write)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( lbp4 ) +//------------------------------------------------- + +ROM_START( lbp4 ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("lbp-4.rom", 0x0000, 0x8000, CRC(f21b8089) SHA1(07503fa6d29d34cc4ceb972296c9bd178085e412)) +ROM_END + +const tiny_rom_entry *arc_lbp4_device::device_rom_region() const +{ + return ROM_NAME( lbp4 ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_laserd_device::device_add_mconfig(machine_config &config) +{ + IDT7201(config, "fifo0"); + IDT7201(config, "fifo1"); + + centronics_device ¢ronics(CENTRONICS(config, "printer", centronics_devices, "printer")); + centronics.ack_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit5)); + centronics.busy_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit1)); + centronics.perror_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit4)); + centronics.select_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit3)); + centronics.fault_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit6)); + + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + centronics.set_output_latch(cent_data_out); + + INPUT_BUFFER(config, "cent_status_in"); + + output_latch_device ¢_ctrl_out(OUTPUT_LATCH(config, "cent_ctrl_out")); + cent_ctrl_out.bit_handler<4>().set(centronics, FUNC(centronics_device::write_strobe)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_laserd_device - constructor +//------------------------------------------------- + +arc_laserd_device::arc_laserd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + +arc_lbp4_device::arc_lbp4_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_laserd_device(mconfig, ARC_LBP4, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_laserd_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_laserd_device::device_reset() +{ + m_rom_page = 0xff; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_LBP4, device_archimedes_podule_interface, arc_lbp4_device, "arc_lbp4", "Computer Concepts LaserDirect (Canon LBP-4)") +//DEFINE_DEVICE_TYPE_PRIVATE(ARC_LBP8, device_archimedes_podule_interface, arc_lbp8_device, "arc_lbp8", "Computer Concepts LaserDirect (Canon LBP-8)") +//DEFINE_DEVICE_TYPE_PRIVATE(ARC_QUME, device_archimedes_podule_interface, arc_qume_device, "arc_qume", "Computer Concepts LaserDirect (Qume)") diff --git a/src/devices/bus/archimedes/podule/laserd.h b/src/devices/bus/archimedes/podule/laserd.h new file mode 100644 index 00000000000..431e8809c68 --- /dev/null +++ b/src/devices/bus/archimedes/podule/laserd.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts LaserDirect + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_LASERD_H +#define MAME_BUS_ARCHIMEDES_PODULE_LASERD_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_LBP4, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_LASERD_H diff --git a/src/devices/bus/archimedes/podule/midimax.cpp b/src/devices/bus/archimedes/podule/midimax.cpp new file mode 100644 index 00000000000..c9215fee4d9 --- /dev/null +++ b/src/devices/bus/archimedes/podule/midimax.cpp @@ -0,0 +1,132 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Wild Vision MidiMax + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/WildVision_MidiMax.html + +**********************************************************************/ + +#include "emu.h" +#include "midimax.h" +#include "machine/ins8250.h" +#include "bus/midi/midi.h" + + +namespace { + +class arc_midimax_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_midimax_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_midimax_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(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data; })); + map(0x3000, 0x301f).rw("uart", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( midimax ) +//------------------------------------------------- + +ROM_START( midimax ) + ROM_REGION(0x10000, "podule_rom", 0) + ROM_LOAD("midimax.rom", 0x0000, 0x10000, CRC(62d8a431) SHA1(8c291082d9e8a8533a4f3b59da857813aa357ecb)) +ROM_END + +const tiny_rom_entry *arc_midimax_device::device_rom_region() const +{ + return ROM_NAME( midimax ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_midimax_device::device_add_mconfig(machine_config &config) +{ + ns16550_device &uart(NS16550(config, "uart", DERIVED_CLOCK(1, 4))); // TODO: verify clock + uart.out_tx_callback().set("mdout1", FUNC(midi_port_device::write_txd)); + uart.out_tx_callback().append("mdout2", FUNC(midi_port_device::write_txd)); + uart.out_tx_callback().append("mdthru", FUNC(midi_port_device::write_txd)); + uart.out_int_callback().set([this](int state) { set_pirq(state); }); + + midiout_slot(MIDI_PORT(config, "mdthru")); + midiout_slot(MIDI_PORT(config, "mdout1")); + midiout_slot(MIDI_PORT(config, "mdout2")); + midi_port_device &mdin(MIDI_PORT(config, "mdin", midiin_slot, "midiin")); + mdin.rxd_handler().set("uart", FUNC(ns16550_device::rx_w)); + mdin.rxd_handler().append("mdthru", FUNC(midi_port_device::write_txd)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_midimax_device - constructor +//------------------------------------------------- + +arc_midimax_device::arc_midimax_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_MIDIMAX, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_midimax_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_midimax_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_MIDIMAX, device_archimedes_podule_interface, arc_midimax_device, "arc_midimax", "Wild Vision MidiMax") diff --git a/src/devices/bus/archimedes/podule/midimax.h b/src/devices/bus/archimedes/podule/midimax.h new file mode 100644 index 00000000000..ce76e5cccb3 --- /dev/null +++ b/src/devices/bus/archimedes/podule/midimax.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Wild Vision MidiMax + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_MIDIMAX_H +#define MAME_BUS_ARCHIMEDES_PODULE_MIDIMAX_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_MIDIMAX, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_MIDIMAX_H diff --git a/src/devices/bus/archimedes/podule/rom.cpp b/src/devices/bus/archimedes/podule/rom.cpp new file mode 100644 index 00000000000..94c55746ee0 --- /dev/null +++ b/src/devices/bus/archimedes/podule/rom.cpp @@ -0,0 +1,190 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AKA05 ROM Podule + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_AKA05_ROMpodule.html + +**********************************************************************/ + +#include "emu.h" +#include "rom.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" +#include "bus/generic/ram.h" +#include "bus/generic/rom.h" + + +namespace { + +class arc_rom_aka05_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_rom_aka05_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::ROM; } + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + required_device_array m_rom; + + u8 rom_r(offs_t offset); + void rom_w(offs_t offset, u8 data); + + u8 m_rom_select; + u8 m_rom_page; +}; + + +void arc_rom_aka05_device::ioc_map(address_map &map) +{ + map(0x0000, 0x1fff).rw(FUNC(arc_rom_aka05_device::rom_r), FUNC(arc_rom_aka05_device::rom_w)).umask32(0x000000ff); + map(0x2000, 0x2fff).lw8(NAME([this](u8 data) { m_rom_page = data & 0x3f; m_rom_select = (m_rom_select & 0x04) | ((data >> 6) & 0x03); })).umask32(0x000000ff); + map(0x3000, 0x37ff).lw8(NAME([this](u8 data) { m_rom_select &= ~0x04; })).umask32(0x000000ff); + map(0x3800, 0x3fff).lw8(NAME([this](u8 data) { m_rom_select |= 0x04; })).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( rom ) +//------------------------------------------------- + +ROM_START( rom_aka05 ) + ROM_REGION(0x20000, "podule_rom", ROMREGION_ERASEFF) + ROM_SYSTEM_BIOS(0, "2", "Second release 18-Dec-87") + ROMX_LOAD("0276,221-02_manager.bin", 0x0000, 0x4000, CRC(23ec4ddb) SHA1(e699157895433010b1ea110c78fbc80a4bc58f09), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *arc_rom_aka05_device::device_rom_region() const +{ + return ROM_NAME( rom_aka05 ); +} + + +void arc_ram_devices(device_slot_interface &device) +{ + device.option_add("ram", GENERIC_RAM_32K_PLAIN); +} + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_rom_aka05_device::device_add_mconfig(machine_config &config) +{ + // rom sockets 5 x 128K + GENERIC_SOCKET(config, m_rom[0], generic_plain_slot, "bbc_rom", "bin,rom"); + GENERIC_SOCKET(config, m_rom[1], generic_plain_slot, "bbc_rom", "bin,rom"); + GENERIC_SOCKET(config, m_rom[2], generic_plain_slot, "bbc_rom", "bin,rom"); + GENERIC_SOCKET(config, m_rom[3], generic_plain_slot, "bbc_rom", "bin,rom"); + GENERIC_SOCKET(config, m_rom[4], generic_plain_slot, "bbc_rom", "bin,rom"); + + // ram sockets 2 x 32K + GENERIC_SOCKET(config, m_rom[5], arc_ram_devices, "bbc_rom", "bin,rom").set_user_loadable(false); + GENERIC_SOCKET(config, m_rom[6], arc_ram_devices, "bbc_rom", "bin,rom").set_user_loadable(false); + + SOFTWARE_LIST(config, "rom_ls").set_original("bbc_rom").set_filter("B"); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_rom_aka05_device - constructor +//------------------------------------------------- + +arc_rom_aka05_device::arc_rom_aka05_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_ROM_AKA05, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom(*this, "rom%u", 1U) + , m_rom_select(0) + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_rom_aka05_device::device_start() +{ + save_item(NAME(m_rom_select)); + save_item(NAME(m_rom_page)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_rom_aka05_device::device_reset() +{ + m_rom_select = 0x00; + m_rom_page = 0x00; +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +u8 arc_rom_aka05_device::rom_r(offs_t offset) +{ + u8 data = 0xff; + + switch (m_rom_select) + { + case 0: + data = m_podule_rom->base()[offset | (m_rom_page << 11)]; + break; + + case 1: case 2: case 3: case 4: case 5: + data = m_rom[m_rom_select - 1]->read_rom(offset | (m_rom_page << 11)); + break; + + case 6: case 7: + data = m_rom[m_rom_select - 1]->read_ram(offset | (m_rom_page << 11)); + break; + } + + return data; +} + +void arc_rom_aka05_device::rom_w(offs_t offset, u8 data) +{ + switch (m_rom_select) + { + case 6: case 7: + m_rom[m_rom_select - 1]->write_ram(offset | (m_rom_page << 11), data); + break; + } +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_ROM_AKA05, device_archimedes_podule_interface, arc_rom_aka05_device, "arc_rom_aka05", "Acorn AKA05 ROM Podule") diff --git a/src/devices/bus/archimedes/podule/rom.h b/src/devices/bus/archimedes/podule/rom.h new file mode 100644 index 00000000000..6a583839a90 --- /dev/null +++ b/src/devices/bus/archimedes/podule/rom.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn AKA05 ROM Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_ROM_H +#define MAME_BUS_ARCHIMEDES_PODULE_ROM_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_ROM_AKA05, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_ROM_H diff --git a/src/devices/bus/archimedes/podule/rs423.cpp b/src/devices/bus/archimedes/podule/rs423.cpp new file mode 100644 index 00000000000..605c7db0877 --- /dev/null +++ b/src/devices/bus/archimedes/podule/rs423.cpp @@ -0,0 +1,136 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Intelligent Interfaces Dual RS423 Serial Interface + + TODO: + - everything, this is skeleton with ROM. + +**********************************************************************/ + +#include "emu.h" +#include "rs423.h" +#include "machine/6522via.h" +#include "machine/mc68681.h" +#include "bus/rs232/rs232.h" + + +namespace { + +// ======================> arc_rs423_device + +class arc_rs423_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_rs423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_rs423_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) & 0x7800)]; })).umask32(0x000000ff); + //map(0x2000, 0x203f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); + //map(0x3000, 0x301f).rw("duart", FUNC(scn2681_device::read), FUNC(scn2681_device::write)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// ROM( rs423 ) +//------------------------------------------------- + +ROM_START( rs423 ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("iidual_id.rom", 0x0000, 0x8000, CRC(ae113882) SHA1(eb97839cd66dce33598aed90ac2f0624de1aa60d)) +ROM_END + +const tiny_rom_entry *arc_rs423_device::device_rom_region() const +{ + return ROM_NAME( rs423 ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_rs423_device::device_add_mconfig(machine_config &config) +{ + via6522_device &via(R65C22(config, "via", DERIVED_CLOCK(1, 4))); + via.writepa_handler().set([this](u8 data) { m_rom_page = data; }); + via.irq_handler().set([this](int state) { set_pirq(state); }); + + scn2681_device &duart(SCN2681(config, "duart", 3.6864_MHz_XTAL)); // SC26C92 + duart.a_tx_cb().set("rs232a", FUNC(rs232_port_device::write_txd)); + duart.b_tx_cb().set("rs232b", FUNC(rs232_port_device::write_txd)); + + rs232_port_device &rs232a(RS232_PORT(config, "rs232a", default_rs232_devices, nullptr)); + rs232a.rxd_handler().set("duart", FUNC(scn2681_device::rx_a_w)); + rs232_port_device &rs232b(RS232_PORT(config, "rs232b", default_rs232_devices, nullptr)); + rs232b.rxd_handler().set("duart", FUNC(scn2681_device::rx_b_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_rs423_device - constructor +//------------------------------------------------- + +arc_rs423_device::arc_rs423_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_RS423, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_rs423_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_rs423_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_RS423, device_archimedes_podule_interface, arc_rs423_device, "arc_rs423", "Archimedes Dual RS423 Serial Interface") diff --git a/src/devices/bus/archimedes/podule/rs423.h b/src/devices/bus/archimedes/podule/rs423.h new file mode 100644 index 00000000000..f488d016599 --- /dev/null +++ b/src/devices/bus/archimedes/podule/rs423.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Intelligent Interfaces Dual RS423 Serial Interface + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_RS423_H +#define MAME_BUS_ARCHIMEDES_PODULE_RS423_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_RS423, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_RS423_H diff --git a/src/devices/bus/archimedes/podule/scanlight.cpp b/src/devices/bus/archimedes/podule/scanlight.cpp new file mode 100644 index 00000000000..8453e04f3b4 --- /dev/null +++ b/src/devices/bus/archimedes/podule/scanlight.cpp @@ -0,0 +1,227 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts Scanner Interface + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/CC_Scannerif.html + + Computer Concepts ScanLight Video 256 + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/CC_ScanlightVideo256.html + + TODO: + - implement scanner device + - implement frame grabber from video source. + +**********************************************************************/ + +#include "emu.h" +#include "scanlight.h" +#include "imagedev/avivideo.h" +#include "imagedev/picture.h" + + +namespace { + +// ======================> arc_scanlight_device + +class arc_scanlight_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_scanlight_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type unemulated_features() { return feature::CAPTURE; } + +protected: + arc_scanlight_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +//private: + required_memory_region m_podule_rom; + required_device m_picture; + + u8 m_rom_page; +}; + + +// ======================> arc_scanjunior_device + +class arc_scanjunior_device : public arc_scanlight_device +{ +public: + // construction/destruction + arc_scanjunior_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual const tiny_rom_entry *device_rom_region() const override; +}; + + +// ======================> arc_scanvideo_device + +class arc_scanvideo_device : public arc_scanlight_device +{ +public: + // construction/destruction + arc_scanvideo_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_device m_avivideo; + + u8 m_rom_bank; +}; + + +void arc_scanlight_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) & 0x7800)]; })).umask32(0x000000ff); + map(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data; })); +} + +void arc_scanvideo_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(0x2000, 0x2000).lw8(NAME([this](u8 data) { m_rom_page = data | (m_rom_bank << 4); })); +} + + +//------------------------------------------------- +// ROM( scanlight ) +//------------------------------------------------- + +ROM_START( scanlight ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("scan-light.rom", 0x0000, 0x8000, CRC(6ba1764b) SHA1(fa69fb69e01553b27409b65a37d3d30a376e7380)) +ROM_END + +ROM_START( scanjunior ) + ROM_REGION(0x8000, "podule_rom", 0) + ROM_LOAD("scan-light_jr.rom", 0x0000, 0x8000, CRC(bf1b8268) SHA1(3c63f8379d8fc222fc57838a9384ecec7c5d2484)) +ROM_END + +ROM_START( scanvideo ) + ROM_REGION(0x10000, "podule_rom", 0) + ROM_LOAD("video256_1.20.rom", 0x0000, 0x10000, CRC(3e9a44b8) SHA1(9fe739b42c5bf5dab69e3c1ffb1c3c5a5d8d7a50)) +ROM_END + + + +const tiny_rom_entry *arc_scanlight_device::device_rom_region() const +{ + return ROM_NAME( scanlight ); +} + +const tiny_rom_entry *arc_scanjunior_device::device_rom_region() const +{ + return ROM_NAME( scanjunior ); +} + +const tiny_rom_entry *arc_scanvideo_device::device_rom_region() const +{ + return ROM_NAME( scanvideo ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_scanlight_device::device_add_mconfig(machine_config &config) +{ + IMAGE_PICTURE(config, m_picture); +} + +void arc_scanvideo_device::device_add_mconfig(machine_config &config) +{ + arc_scanlight_device::device_add_mconfig(config); + + IMAGE_AVIVIDEO(config, m_avivideo); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_scanlight_device - constructor +//------------------------------------------------- + +arc_scanlight_device::arc_scanlight_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_picture(*this, "srcimg") + , m_rom_page(0) +{ +} + +arc_scanlight_device::arc_scanlight_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_scanlight_device(mconfig, ARC_SCANLIGHT, tag, owner, clock) +{ +} + +arc_scanjunior_device::arc_scanjunior_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_scanlight_device(mconfig, ARC_SCANJUNIOR, tag, owner, clock) +{ +} + +arc_scanvideo_device::arc_scanvideo_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : arc_scanlight_device(mconfig, ARC_SCANVIDEO, tag, owner, clock) + , m_avivideo(*this, "srcavi") + , m_rom_bank(1) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_scanlight_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_scanlight_device::device_reset() +{ + m_rom_page = 0xff; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_SCANLIGHT, device_archimedes_podule_interface, arc_scanlight_device, "arc_scanlight", "Computer Concepts ScanLight") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_SCANJUNIOR, device_archimedes_podule_interface, arc_scanjunior_device, "arc_scanjunior", "Computer Concepts ScanLight Junior") +DEFINE_DEVICE_TYPE_PRIVATE(ARC_SCANVIDEO, device_archimedes_podule_interface, arc_scanvideo_device, "arc_scanvideo", "Computer Concepts ScanLight Video 256") diff --git a/src/devices/bus/archimedes/podule/scanlight.h b/src/devices/bus/archimedes/podule/scanlight.h new file mode 100644 index 00000000000..579c100c333 --- /dev/null +++ b/src/devices/bus/archimedes/podule/scanlight.h @@ -0,0 +1,21 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Computer Concepts Scanner Interface + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_SCANLIGHT_H +#define MAME_BUS_ARCHIMEDES_PODULE_SCANLIGHT_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_SCANLIGHT, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_SCANJUNIOR, device_archimedes_podule_interface) +DECLARE_DEVICE_TYPE(ARC_SCANVIDEO, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_SCANLIGHT_H diff --git a/src/devices/bus/archimedes/podule/scsi_vti.cpp b/src/devices/bus/archimedes/podule/scsi_vti.cpp new file mode 100644 index 00000000000..f0239dfeeb0 --- /dev/null +++ b/src/devices/bus/archimedes/podule/scsi_vti.cpp @@ -0,0 +1,173 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + VTI User Port and SCSI Podule + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesH2Z/VTI_userportSCSI.html + + TODO: + - map the EEPROM + - fix User Port module + +**********************************************************************/ + +#include "emu.h" +#include "scsi_vti.h" +#include "machine/6522via.h" +#include "machine/eepromser.h" +#include "machine/ncr5390.h" +#include "bus/bbc/userport/userport.h" +#include "bus/nscsi/devices.h" + + +namespace { + +class arc_scsi_vti_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_scsi_vti_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + static constexpr feature_type imperfect_features() { return feature::DISK; } + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + virtual void memc_map(address_map &map) override; + +private: + required_device m_fas216; + required_device m_eeprom; + required_memory_region m_podule_rom; + + u8 m_rom_page; + u8 m_drq_status; +}; + + +void arc_scsi_vti_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(0x3d00, 0x3d3f).rw("via", FUNC(via6522_device::read), FUNC(via6522_device::write)).umask32(0x000000ff); +} + +void arc_scsi_vti_device::memc_map(address_map &map) +{ + map(0x2000, 0x21ff).lr8(NAME([this](offs_t offset) { return m_fas216->read(offset >> 3); })).umask32(0x000000ff); + map(0x2000, 0x21ff).lw8(NAME([this](offs_t offset, u8 data) { m_fas216->write(offset >> 3, data); })).umask32(0x000000ff); + map(0x2200, 0x2203).rw(m_fas216, FUNC(ncr53c94_device::dma16_r), FUNC(ncr53c94_device::dma16_w)).umask32(0x0000ffff); + map(0x2600, 0x2600).lr8(NAME([this]() { return m_drq_status; })); +} + + +//------------------------------------------------- +// ROM( scsi_vti ) +//------------------------------------------------- + +ROM_START( scsi_vti ) + ROM_REGION(0x10000, "podule_rom", 0) + ROM_LOAD("vti_up_powerrom.bin", 0x0000, 0x10000, CRC(7ec5854c) SHA1(eb20b1369964cfaee156ba1fc3636997407cc7ba)) +ROM_END + +const tiny_rom_entry *arc_scsi_vti_device::device_rom_region() const +{ + return ROM_NAME( scsi_vti ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_scsi_vti_device::device_add_mconfig(machine_config &config) +{ + NSCSI_BUS(config, "scsi"); + NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, "harddisk", false); + NSCSI_CONNECTOR(config, "scsi:1", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi:2", default_scsi_devices, nullptr, false); + NSCSI_CONNECTOR(config, "scsi:3", default_scsi_devices, nullptr, false); + 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("fas216", NCR53CF94).clock(24.576_MHz_XTAL) // FAS216 + .machine_config([this](device_t *device) + { + ncr53c94_device &fas216(downcast(*device)); + fas216.set_busmd(ncr53c94_device::busmd_t::BUSMD_1); + fas216.irq_handler_cb().set([this](int state) { set_pirq(state); }); + fas216.drq_handler_cb().set([this](int state) { m_drq_status = state; }); + }); + + EEPROM_93C06_16BIT(config, m_eeprom); // 2600 b0 + + via6522_device &via(MOS6522(config, "via", DERIVED_CLOCK(1, 4))); + via.irq_handler().set([this](int state) { set_pirq(state); }); + via.writepa_handler().set([this](u8 data) { m_rom_page = data; }); + via.readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r)); + via.writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w)); + via.cb1_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb1)); + via.cb2_handler().set("userport", FUNC(bbc_userport_slot_device::write_cb2)); + + bbc_userport_slot_device &userport(BBC_USERPORT_SLOT(config, "userport", bbc_userport_devices, nullptr)); + userport.cb1_handler().set("via", FUNC(via6522_device::write_cb1)); + userport.cb2_handler().set("via", FUNC(via6522_device::write_cb2)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_scsi_vti_device - constructor +//------------------------------------------------- + +arc_scsi_vti_device::arc_scsi_vti_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_SCSI_VTI, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_fas216(*this, "scsi:7:fas216") + , m_eeprom(*this, "eeprom") + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) + , m_drq_status(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_scsi_vti_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_scsi_vti_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_SCSI_VTI, device_archimedes_podule_interface, arc_scsi_vti_device, "arc_scsi_vti", "VTI User Port and SCSI Podule") diff --git a/src/devices/bus/archimedes/podule/scsi_vti.h b/src/devices/bus/archimedes/podule/scsi_vti.h new file mode 100644 index 00000000000..8650c1fb26e --- /dev/null +++ b/src/devices/bus/archimedes/podule/scsi_vti.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + VTI User Port and SCSI Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_SCSI_VTI_H +#define MAME_BUS_ARCHIMEDES_PODULE_SCSI_VTI_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_SCSI_VTI, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_SCSI_VTI_H diff --git a/src/devices/bus/archimedes/podule/serial.cpp b/src/devices/bus/archimedes/podule/serial.cpp new file mode 100644 index 00000000000..dff0fa826f9 --- /dev/null +++ b/src/devices/bus/archimedes/podule/serial.cpp @@ -0,0 +1,156 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Atomwide Serial Expansion Card + + http://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Atomwide_SerialExp.html + +**********************************************************************/ + +#include "emu.h" +#include "serial.h" +#include "machine/ins8250.h" +#include "bus/rs232/rs232.h" + + +namespace { + +// ======================> arc_serial_device + +class arc_serial_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // 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 const tiny_rom_entry *device_rom_region() const override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; + +private: + required_memory_region m_podule_rom; + + u8 m_rom_page; +}; + + +void arc_serial_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(0x2000, 0x201f).rw("uart2", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x2400, 0x241f).rw("uart1", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x2800, 0x281f).rw("uart0", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x3c00, 0x3c00).lw8(NAME([this](u8 data) { m_rom_page = data; })); +} + + +//------------------------------------------------- +// ROM( serial ) +//------------------------------------------------- + +ROM_START( serial ) + ROM_REGION(0x10000, "podule_rom", 0) + ROM_LOAD("atomwide_serial.rom", 0x0000, 0x10000, CRC(2dcf3b28) SHA1(c100cc4f5e3d87233e6db6a1da04ac7c19ac2357)) +ROM_END + +const tiny_rom_entry *arc_serial_device::device_rom_region() const +{ + return ROM_NAME( serial ); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_serial_device::device_add_mconfig(machine_config &config) +{ + ns16550_device &uart0(NS16550(config, "uart0", 7.3728_MHz_XTAL)); + uart0.out_tx_callback().set("serial0", FUNC(rs232_port_device::write_txd)); + uart0.out_dtr_callback().set("serial0", FUNC(rs232_port_device::write_dtr)); + uart0.out_rts_callback().set("serial0", FUNC(rs232_port_device::write_rts)); + + rs232_port_device &serial0(RS232_PORT(config, "serial0", default_rs232_devices, nullptr)); + serial0.rxd_handler().set("uart0", FUNC(ns16550_device::rx_w)); + serial0.dcd_handler().set("uart0", FUNC(ns16550_device::dcd_w)); + serial0.dsr_handler().set("uart0", FUNC(ns16550_device::dsr_w)); + serial0.cts_handler().set("uart0", FUNC(ns16550_device::cts_w)); + + ns16550_device &uart1(NS16550(config, "uart1", 7.3728_MHz_XTAL)); + uart1.out_tx_callback().set("serial1", FUNC(rs232_port_device::write_txd)); + uart1.out_dtr_callback().set("serial1", FUNC(rs232_port_device::write_dtr)); + uart1.out_rts_callback().set("serial1", FUNC(rs232_port_device::write_rts)); + + rs232_port_device &serial1(RS232_PORT(config, "serial1", default_rs232_devices, nullptr)); + serial1.rxd_handler().set("uart1", FUNC(ns16550_device::rx_w)); + serial1.dcd_handler().set("uart1", FUNC(ns16550_device::dcd_w)); + serial1.dsr_handler().set("uart1", FUNC(ns16550_device::dsr_w)); + serial1.cts_handler().set("uart1", FUNC(ns16550_device::cts_w)); + + ns16550_device &uart2(NS16550(config, "uart2", 7.3728_MHz_XTAL)); + uart2.out_tx_callback().set("serial2", FUNC(rs232_port_device::write_txd)); + uart2.out_dtr_callback().set("serial2", FUNC(rs232_port_device::write_dtr)); + uart2.out_rts_callback().set("serial2", FUNC(rs232_port_device::write_rts)); + + rs232_port_device &serial2(RS232_PORT(config, "serial2", default_rs232_devices, nullptr)); + serial2.rxd_handler().set("uart2", FUNC(ns16550_device::rx_w)); + serial2.dcd_handler().set("uart2", FUNC(ns16550_device::dcd_w)); + serial2.dsr_handler().set("uart2", FUNC(ns16550_device::dsr_w)); + serial2.cts_handler().set("uart2", FUNC(ns16550_device::cts_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_serial_device - constructor +//------------------------------------------------- + +arc_serial_device::arc_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_SERIAL, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) + , m_podule_rom(*this, "podule_rom") + , m_rom_page(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_serial_device::device_start() +{ + save_item(NAME(m_rom_page)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void arc_serial_device::device_reset() +{ + m_rom_page = 0x00; +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_SERIAL, device_archimedes_podule_interface, arc_serial_device, "arc_serial", "Atomwide Serial Expansion Card") diff --git a/src/devices/bus/archimedes/podule/serial.h b/src/devices/bus/archimedes/podule/serial.h new file mode 100644 index 00000000000..929bc914dc0 --- /dev/null +++ b/src/devices/bus/archimedes/podule/serial.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Atomwide Serial Expansion Card + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_SERIAL_H +#define MAME_BUS_ARCHIMEDES_PODULE_SERIAL_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_SERIAL, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_SERIAL_H diff --git a/src/devices/bus/archimedes/podule/slot.cpp b/src/devices/bus/archimedes/podule/slot.cpp new file mode 100644 index 00000000000..8543eb8931b --- /dev/null +++ b/src/devices/bus/archimedes/podule/slot.cpp @@ -0,0 +1,365 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn Archimedes Expansion Bus emulation + +**********************************************************************/ + +#include "emu.h" +#include "slot.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(ARCHIMEDES_PODULE_SLOT, archimedes_podule_slot_device, "archimedes_exp_slot", "Acorn Archimedes Podule slot") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// archimedes_podule_slot_device - constructor +//------------------------------------------------- +archimedes_podule_slot_device::archimedes_podule_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARCHIMEDES_PODULE_SLOT, tag, owner, clock) + , device_single_card_slot_interface(mconfig, *this) + , m_exp(*this, finder_base::DUMMY_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void archimedes_podule_slot_device::device_resolve_objects() +{ + device_archimedes_podule_interface *const intf(get_card_device()); + if (intf) + intf->set_archimedes_exp(m_exp, tag()); +} + +void archimedes_podule_slot_device::device_start() +{ +} + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +DEFINE_DEVICE_TYPE(ARCHIMEDES_EXPANSION_BUS, archimedes_exp_device, "archimedes_exp", "Acorn Archimedes Expansion Bus") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// archimedes_exp_device - constructor +//------------------------------------------------- + +archimedes_exp_device::archimedes_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARCHIMEDES_EXPANSION_BUS, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_ioc_config("podule_ioc", ENDIANNESS_LITTLE, 32, 16, 0, address_map_constructor(FUNC(archimedes_exp_device::ioc_map), this)) + , m_memc_config("podule_memc", ENDIANNESS_LITTLE, 32, 16, 0, address_map_constructor(FUNC(archimedes_exp_device::memc_map), this)) + , m_out_pirq_cb(*this) + , m_out_pfiq_cb(*this) +{ +} + +device_memory_interface::space_config_vector archimedes_exp_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(AS_PROGRAM, &m_memc_config), + std::make_pair(AS_IO, &m_ioc_config) + }; +} + +void archimedes_exp_device::ioc_map(address_map &map) +{ + map.unmap_value_high(); +} + +void archimedes_exp_device::memc_map(address_map &map) +{ + map.unmap_value_high(); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void archimedes_exp_device::device_resolve_objects() +{ + // resolve callbacks + m_out_pirq_cb.resolve_safe(); + m_out_pfiq_cb.resolve_safe(); +} + +void archimedes_exp_device::device_start() +{ + m_ioc = &space(AS_IO); + m_memc = &space(AS_PROGRAM); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void archimedes_exp_device::device_reset() +{ + m_pirq_state = 0x00; + m_pirq_mask = 0xff; +} + +void archimedes_exp_device::pirq_w(int state, int slot) +{ + if (state == ASSERT_LINE) + { + m_pirq_state |= (1 << slot); + } + else + { + m_pirq_state &= ~(1 << slot); + } + + m_out_pirq_cb(m_pirq_state & m_pirq_mask ? ASSERT_LINE : CLEAR_LINE); +} + + +//------------------------------------------------- +// ps - simple podule select +//------------------------------------------------- + +u16 archimedes_exp_device::ps4_r(offs_t offset, u16 mem_mask) +{ + return m_ioc->read_word(offset << 2, mem_mask); +} + +void archimedes_exp_device::ps4_w(offs_t offset, u16 data, u16 mem_mask) +{ + m_ioc->write_word(offset << 2, data, mem_mask); +} + + +u16 archimedes_exp_device::ps6_r(offs_t offset, u16 mem_mask) +{ + switch ((offset << 2) & 0xfc) + { + case 0x00: + return m_pirq_state & m_pirq_mask; + + case 0x04: + return m_pirq_mask; + } + + return 0xffff; +} + +void archimedes_exp_device::ps6_w(offs_t offset, u16 data, u16 mem_mask) +{ + switch ((offset << 2) & 0xfc) + { + case 0x00: + break; + + case 0x04: + m_pirq_mask = data & 0xff; + m_out_pirq_cb(m_pirq_state & m_pirq_mask ? ASSERT_LINE : CLEAR_LINE); + break; + } +} + +//------------------------------------------------- +// ms - memc select +//------------------------------------------------- + +u16 archimedes_exp_device::ms_r(offs_t offset, u16 mem_mask) +{ + return m_memc->read_word(offset << 2, mem_mask); +} + +void archimedes_exp_device::ms_w(offs_t offset, u16 data, u16 mem_mask) +{ + m_memc->write_word(offset << 2, data, mem_mask); +} + + +//************************************************************************** +// DEVICE ARCHIMEDES EXPANSION INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_archimedes_podule_interface - constructor +//------------------------------------------------- + +device_archimedes_podule_interface::device_archimedes_podule_interface(const machine_config &mconfig, device_t &device) + : device_interface(device, "arcexp") + , m_exp(nullptr) + , m_exp_slottag(nullptr) + , m_slot(-1) +{ +} + + +//------------------------------------------------- +// ~device_archimedes_podule_interface - destructor +//------------------------------------------------- + +device_archimedes_podule_interface::~device_archimedes_podule_interface() +{ +} + + +void device_archimedes_podule_interface::interface_pre_start() +{ + if (!m_exp->started()) + throw device_missing_dependencies(); + + // extract the slot number from the last digit of the slot tag + size_t const tlen = strlen(m_exp_slottag); + + m_slot = (m_exp_slottag[tlen - 1] - '0'); + if (m_slot < 0 || m_slot > 3) + fatalerror("Podule %d out of range for Archimedes expansion bus\n", m_slot); +} + +void device_archimedes_podule_interface::interface_post_start() +{ + m_exp->install_ioc_map(m_slot, *this, &device_archimedes_podule_interface::ioc_map); + m_exp->install_memc_map(m_slot, *this, &device_archimedes_podule_interface::memc_map); +} + + +// slot devices +#include "a448.h" +#include "armadeus.h" +//#include "discbuffer.h" +//#include "colourcard.h" +//#include "digitiser_we.h" +//#include "eaglem2.h" +#include "ether1.h" +//#include "ether2.h" +//#include "ether3.h" +//#include "ether5.h" +//#include "ethera.h" +#include "etherd.h" +#include "etherr.h" +#include "faxpack.h" +//#include "g8.h" +//#include "hdfc_rdev.h" +//#include "hdisc.h" +//#include "hdisc_cw.h" +//#include "hdisc_we.h" +//#include "ide_be.h" +//#include "ide_castle.h" +//#include "ide_hccs.h" +//#include "ide_ics.h" +#include "ide_rdev.h" +//#include "ide_we.h" +#include "io.h" +#include "io_hccs.h" +#include "io_morley.h" +#include "io_we.h" +#include "lark.h" +#include "laserd.h" +#include "midimax.h" +//#include "nexus.h" +//#include "prisma3.h" +#include "rom.h" +//#include "rom_cc.h" +#include "rs423.h" +#include "scanlight.h" +//#include "scsi_a500.h" +//#include "scsi_acorn.h" +//#include "scsi_ling.h" +//#include "scsi_morley.h" +//#include "scsi_oak.h" +#include "scsi_vti.h" +#include "serial.h" +#include "tube.h" +//#include "ultimate.h" +//#include "ultimatecd.h" + +//------------------------------------------------- +// archimedes_exp_devices (A3x0/A4x0/A5x0/A5000) +//------------------------------------------------- + +void archimedes_exp_devices(device_slot_interface &device) +{ + device.option_add("a448", ARC_A448); // Armadillo Systems A448 Sound Sampler + device.option_add("a448b", ARC_A448B); // Armadillo Systems A448b Stereo MIDI Sound Sampler + device.option_add("armadeus", ARC_ARMADEUS); // Clares Armadeus Sampler Board + device.option_add("bbcio_aka10", ARC_BBCIO_AKA10); // Acorn AKA10 BBC I/O Podule + device.option_add("bbcio_we", ARC_BBCIO_WE); // Watford BBC User I/O Card + //device.option_add("cc", ARC_CC); // Wild Vision/Computer Concepts Colour Card + //device.option_add("ccgold", ARC_CCGOLD); // Wild Vision/Computer Concepts Colour Card Gold + //device.option_add("digitiser_we", ARC_DIGITISER_WE); // Watford Electronics Archimedes Video Digitiser + //device.option_add("eaglem2", ARC_EAGLEM2); // Wild Vision/Computer Concepts Eagle M2 + device.option_add("ether1", ARC_ETHER1_AKA25); // Acorn AKA25 Ethernet + //device.option_add("ether2", ARC_ETHER2_AEH50); // Acorn AEH50 Ethernet II + //device.option_add("ether3_aeh54", ARC_ETHER3_AEH54); // Acorn AEH54 10Base2 Ethernet Podule + //device.option_add("ether5", ARC_ETHER5); // Atomwide Ethernet V Podule + device.option_add("etherr", ARC_ETHERR); // RISC Developments Ethernet Card + device.option_add("faxpack", ARC_FAXPACK); // Computer Concepts Fax-Pack + //device.option_add("g16", ARC_G16); // State Machine G16 Graphic Accelerator + //device.option_add("hdfc_rdev", ARC_HDFC_RDEV); // RISC Developments High Density Floppy Controller + //device.option_add("hdisc_akd52", ARC_HDISC_AKD52); // Acorn AKD52 Hard Disc Podule + //device.option_add("hdisc_cw", ARC_HDISC_CW); // Computerware Hard Disk Podule + //device.option_add("hdisc_we", ARC_HDISC_WE); // Watford Electronics Archimedes Hard Disk Podule + //device.option_add("ide_be", ARC_IDE_BE); // Baildon Electronics IDE HD Interface + //device.option_add("ide_hccs", ARC_IDE_HCCS); // HCCS IDE Interface + device.option_add("ide_rdev", ARC_IDE_RDEV); // RISC Developments IDE Hard Disc System + //device.option_add("ide1v4_ics", ARC_IDE1V4_ICS); // ICS ideA Hard Disc System + device.option_add("iomidi_aka15", ARC_IOMIDI_AKA15); // Acorn AKA15 MIDI and BBC I/O Podule + device.option_add("lark", ARC_LARK); // Wild Vision/Computer Concepts Lark A16 + device.option_add("lbp4", ARC_LBP4); // Computer Concepts LaserDirect LBP-4 + device.option_add("midi_aka16", ARC_MIDI_AKA16); // Acorn AKA16 MIDI Podule + device.option_add("midimax", ARC_MIDIMAX); // Wild Vision MidiMax + //device.option_add("nexus_a500", ARC_NEXUS_A500); // SJ Research Nexus Interface (A500) + //device.option_add("prisma3", ARC_PRISMA3); // Millipede PRISMA-3 Podule + //device.option_add("prisma3p", ARC_PRISMA3P); // Millipede PRISMA-3 Plus Podule + device.option_add("rom_aka05", ARC_ROM_AKA05); // Acorn AKA05 ROM Podule + //device.option_add("rom_cc", ARC_ROM_CC); // Computer Concepts ROM/RAM Podule + device.option_add("rs423", ARC_RS423); // Intelligent Interfaces Dual RS423 Serial Interface + device.option_add("scanlight", ARC_SCANLIGHT); // Computer Concepts ScanLight + device.option_add("scanjunior", ARC_SCANJUNIOR); // Computer Concepts ScanLight Junior + device.option_add("scanvideo", ARC_SCANVIDEO); // Computer Concepts ScanLight Video 256 + //device.option_add("scsi_a500", ARC_SCSI_A500); // Acorn A500 SCSI Interface + //device.option_add("scsi_aka31", ARC_SCSI_AKA31); // Acorn AKA31 SCSI Expansion Card + //device.option_add("scsi_aka32", ARC_SCSI_AKA32); // Acorn AKA32 CDFS & SCSI Expansion Card + //device.option_add("scsi_ling", ARC_SCSI_LING); // Lingenuity SCSI Podule + //device.option_add("scsi_morley", ARC_SCSI_MORLEY); // Morley Electronics 16bit Cached SCSI card + //device.option_add("scsi_oak", ARC_SCSI_OAK); // Oak Solutions SCSI Interface + device.option_add("scsi_vti", ARC_SCSI_VTI); // VTI User Port and SCSI Podule + device.option_add("serial", ARC_SERIAL); // Atomwide Serial Expansion Card + device.option_add("tube", ARC_TUBE); // Acorn Tube Podule + //device.option_add("ultcd", ARC_ULTCD); // HCCS Ultimate CD-ROM +} + +//------------------------------------------------- +// archimedes_mini_exp_devices (A30x0/A4000) +//------------------------------------------------- + +void archimedes_mini_exp_devices(device_slot_interface &device) +{ + device.option_add("bbcio_aga30", ARC_BBCIO_AGA30); // Acorn AGA30 BBC I/O Podule + device.option_add("bbcio_we", ARC_BBCIO_WE); // Watford BBC User I/O Card + //device.option_add("disc_a3k6", ARC_DISC_A3K6); // PRES A3K6 Disc Buffer + //device.option_add("ethera", ARC_ETHERA); // ANT Ethernet 10base2 mini-podule + device.option_add("etherd", ARC_ETHERD); // Digital Services Ethernet Podule + //device.option_add("ide_castle", ARC_IDE_CASTLE); // Castle Technology A3000 IDE Expansion Card + //device.option_add("ide1v5_ics", ARC_IDE1V5_ICS); // ICS ideA Hard Disc System + //device.option_add("ide3v5_ics", ARC_IDE3V5_ICS); // ICS ideA Hard Disc System + //device.option_add("ide_we", ARC_IDE_WE); // Watford Electronics A3000 IDE Interface + //device.option_add("ult3010", ARC_ULT3010); // HCCS A3010 Ultimate Expansion System + device.option_add("upa_hccs", ARC_UPA_HCCS); // HCCS User/Analogue Podule + device.option_add("upmidi_aka12", ARC_UPMIDI_AKA12); // Acorn AKA12 User Port/MIDI Upgrade +} diff --git a/src/devices/bus/archimedes/podule/slot.h b/src/devices/bus/archimedes/podule/slot.h new file mode 100644 index 00000000000..cff826408cb --- /dev/null +++ b/src/devices/bus/archimedes/podule/slot.h @@ -0,0 +1,159 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn Archimedes Expansion Bus emulation + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_SLOT_H +#define MAME_BUS_ARCHIMEDES_PODULE_SLOT_H + +#pragma once + + +//************************************************************************** +// FORWARD DECLARATIONS +//************************************************************************** + +class archimedes_exp_device; +class device_archimedes_podule_interface; + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> archimedes_podule_slot_device + +class archimedes_podule_slot_device : public device_t, + public device_single_card_slot_interface +{ +public: + // construction/destruction + template + archimedes_podule_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&bus_tag, U &&opts, const char *dflt) + : archimedes_podule_slot_device(mconfig, tag, owner, DERIVED_CLOCK(1, 1)) + { + option_reset(); + opts(*this); + set_default_option(dflt); + set_fixed(false); + m_exp.set_tag(std::forward(bus_tag)); + } + archimedes_podule_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + + required_device m_exp; +}; + +// device type definition +DECLARE_DEVICE_TYPE(ARCHIMEDES_PODULE_SLOT, archimedes_podule_slot_device) + + + +// ======================> archimedes_exp_device + +class archimedes_exp_device : public device_t, + public device_memory_interface +{ +public: + // construction/destruction + archimedes_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // inline configuration + auto out_irq_callback() { return m_out_pirq_cb.bind(); } + auto out_fiq_callback() { return m_out_pfiq_cb.bind(); } + + u16 ps4_r(offs_t offset, u16 mem_mask = ~0); + void ps4_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 ps6_r(offs_t offset, u16 mem_mask = ~0); + void ps6_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 ms_r(offs_t offset, u16 mem_mask = ~0); + void ms_w(offs_t offset, u16 data, u16 mem_mask = ~0); + + template void install_ioc_map(int slot, T &device, void (T::*map)(class address_map &map)) + { + offs_t base = slot << 14; + m_ioc->install_device(base, base + 0x3fff, device, map); + } + template void install_memc_map(int slot, T &device, void (T::*map)(class address_map &map)) + { + offs_t base = slot << 14; + m_memc->install_device(base, base + 0x3fff, device, map); + } + + void pirq_w(int state, int slot); + void pfiq_w(int state) { m_out_pfiq_cb(state); } + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual void device_reset() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + +private: + address_space_config m_ioc_config; + address_space_config m_memc_config; + + devcb_write_line m_out_pirq_cb; + devcb_write_line m_out_pfiq_cb; + + u8 m_pirq_state; + u8 m_pirq_mask; + + address_space *m_ioc; + address_space *m_memc; + + void ioc_map(address_map &map); + void memc_map(address_map &map); +}; + + +// device type definition +DECLARE_DEVICE_TYPE(ARCHIMEDES_EXPANSION_BUS, archimedes_exp_device) + + +// ======================> device_archimedes_podule_interface + +class device_archimedes_podule_interface : public device_interface +{ + friend class archimedes_exp_device; + +public: + // construction/destruction + virtual ~device_archimedes_podule_interface(); + + // inline configuration + void set_archimedes_exp(archimedes_exp_device *exp, const char *slottag) { m_exp = exp; m_exp_slottag = slottag; } + +protected: + void set_pirq(int state) { m_exp->pirq_w(state, m_slot); } + void set_pfiq(int state) { m_exp->pfiq_w(state); } + + device_archimedes_podule_interface(const machine_config &mconfig, device_t &device); + + virtual void interface_pre_start() override; + virtual void interface_post_start() override; + + virtual void ioc_map(address_map &map) { }; + virtual void memc_map(address_map &map) { }; + + archimedes_exp_device *m_exp; + const char *m_exp_slottag; + int m_slot; +}; + + +void archimedes_exp_devices(device_slot_interface &device); +void archimedes_mini_exp_devices(device_slot_interface &device); + + +#endif // MAME_BUS_ARCHIMEDES_PODULE_SLOT_H diff --git a/src/devices/bus/archimedes/podule/tube.cpp b/src/devices/bus/archimedes/podule/tube.cpp new file mode 100644 index 00000000000..84d699b4bc2 --- /dev/null +++ b/src/devices/bus/archimedes/podule/tube.cpp @@ -0,0 +1,87 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn Tube Podule + + TODO: + - attach BBC Micro as Tube Host. + +**********************************************************************/ + +#include "emu.h" +#include "tube.h" +#include "machine/tube.h" + + +namespace { + +class arc_tube_device : + public device_t, + public device_archimedes_podule_interface +{ +public: + // construction/destruction + arc_tube_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override; + + // device_archimedes_podule_interface overrides + virtual void ioc_map(address_map &map) override; +}; + + +void arc_tube_device::ioc_map(address_map &map) +{ + map(0x0000, 0x3fff).rw("tube", FUNC(tube_device::parasite_r), FUNC(tube_device::parasite_w)).umask32(0x000000ff); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void arc_tube_device::device_add_mconfig(machine_config &config) +{ + tube_device &tube(TUBE(config, "tube")); + tube.pnmi_handler().set([this](int state) { set_pfiq(state); }); + tube.pirq_handler().set([this](int state) { set_pirq(state); }); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arc_tube_device - constructor +//------------------------------------------------- + +arc_tube_device::arc_tube_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, ARC_TUBE, tag, owner, clock) + , device_archimedes_podule_interface(mconfig, *this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arc_tube_device::device_start() +{ +} + +} // anonymous namespace + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(ARC_TUBE, device_archimedes_podule_interface, arc_tube_device, "arc_tube", "Acorn Tube Podule") diff --git a/src/devices/bus/archimedes/podule/tube.h b/src/devices/bus/archimedes/podule/tube.h new file mode 100644 index 00000000000..4c78a7404e4 --- /dev/null +++ b/src/devices/bus/archimedes/podule/tube.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Acorn Tube Podule + +**********************************************************************/ + +#ifndef MAME_BUS_ARCHIMEDES_PODULE_TUBE_H +#define MAME_BUS_ARCHIMEDES_PODULE_TUBE_H + +#pragma once + +#include "slot.h" + +// device type definition +DECLARE_DEVICE_TYPE(ARC_TUBE, device_archimedes_podule_interface) + +#endif // MAME_BUS_ARCHIMEDES_PODULE_TUBE_H -- cgit v1.2.3