From e98b0770264d312354fce517e32cf71c2202076e Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sat, 20 Jun 2020 16:04:27 +0300 Subject: spectrum/beta.cpp add remaining known clone devices --- src/devices/bus/spectrum/beta.cpp | 184 ++++++++++++++++++++++++++++++++++++-- src/devices/bus/spectrum/beta.h | 41 ++++++++- src/devices/bus/spectrum/exp.cpp | 2 + src/devices/bus/spectrum/mgt.cpp | 7 +- 4 files changed, 223 insertions(+), 11 deletions(-) diff --git a/src/devices/bus/spectrum/beta.cpp b/src/devices/bus/spectrum/beta.cpp index 0a21ba741b6..e38aeacde55 100644 --- a/src/devices/bus/spectrum/beta.cpp +++ b/src/devices/bus/spectrum/beta.cpp @@ -48,9 +48,11 @@ - SYNCHRON IDS91 - SYNCHRON IDS2001ne - ARCADE AR-20 - (not yet added) - - MIDAS Gammadisk (adds i8255 for joystick and printer, use 32KByte ROM with modified BASIC48 ROM in one half and TR-DOS 4.12 in another) - - Vision Desktop Betadisk + - MIDAS Gammadisk - 3 versions known to exists: + - straight clone + - added i8255 PPI for joystick and printer, uses 32KByte ROM with modified BASIC48 ROM in one half and TR-DOS 4.12 in another + - same as above plus 6850 ACIA + - number of straight clones with "Vision Desktop" boot ROM Some units also exist that allow population of both V3 and V4 ROM types with a switch (unofficial, for compatibility?) @@ -71,10 +73,12 @@ memory access 0x3CXX (any type of access: code or data, read or write) -> temporary use BDI ROM (NOT permanent latch/switch like in beta128) memory access <0x4000 area and BDI ROM_latch==true -> use BDI ROM - IO write to port 0bxxxxxx00 -> D7 - master_latch, 0=enable, 1=disable + IO write to port 0bxxxxxx00 -> D7 - BDI I/O access, 0=enable, 1=disable (when BDI I/O enabled - /IORQ passthrough to next expansions is blocked) CBI clones: D6 - 1=disable permanent BDI ROM mapping at 3c00-3cff, 0=enable (like original BDI) + Gammadisk : D6 - 0 - enable Gammadisk I/O (/IORQ passthrough blocked), 1=disable all Gammadisk I/O (enable /IORQ passthrough) + D7 - (have effect if D6 is 0) 0=enable FDC I/O, 1=enable PPI and ACIA I/O; - while master_latch is enabled IO access to other expansions is blocked (output /IORQ forced to 1) but enabled BDI ports: + BDI I/O ports: IO write to port 0b1xxxx111 -> V2: D7 BDI ROM_latch (0=enable, 1=disble), D4 - FDC HLT, D3 - SIDE, D0-2 - floppy drive select (bitmask, active low). @@ -99,7 +103,9 @@ DEFINE_DEVICE_TYPE(SPECTRUM_BETAV2, spectrum_betav2_device, "spectrum_betav2", "TR Beta Disk Interface V2 (FD1771 based)") DEFINE_DEVICE_TYPE(SPECTRUM_BETAV3, spectrum_betav3_device, "spectrum_betav3", "TR Beta Disk Interface V3 (FD1793 based)") DEFINE_DEVICE_TYPE(SPECTRUM_BETAPLUS, spectrum_betaplus_device, "spectrum_betaplus", "TR Beta Disk Plus Interface") +DEFINE_DEVICE_TYPE(SPECTRUM_BETACLONE,spectrum_betaclone_device,"spectrum_betaclone","Beta Disk Plus clones") DEFINE_DEVICE_TYPE(SPECTRUM_BETACBI, spectrum_betacbi_device, "spectrum_betacbi", "CBI-95 Disk Interface") +DEFINE_DEVICE_TYPE(SPECTRUM_GAMMA, spectrum_gamma_device, "spectrum_gamma", "MIDAS Gammadisk Interface") //------------------------------------------------- // SLOT_INTERFACE( beta_floppies ) @@ -194,6 +200,23 @@ ROM_START(betaplus) ROM_RELOAD(0x2000,0x2000) ROM_END +ROM_START(betaclone) + ROM_REGION(0x4000, "rom", 0) + ROM_DEFAULT_BIOS("vision10") + ROM_SYSTEM_BIOS(0, "vision10", "Vision 1.0 TR-DOS v4.12") + ROMX_LOAD("vision10.bin", 0x0000, 0x4000, CRC(20f49ff5) SHA1(d391324cb39e9fc6b93b867a71caec019c353518), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "vision14", "Vision 1.4 TR-DOS v4.40") + ROMX_LOAD("vision14.bin", 0x0000, 0x4000, CRC(9903f577) SHA1(579627a2865caf3079cbae360bdaf0309d4a2911), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "vision17b", "Vision 1.7 TR-DOS v4.82") + ROMX_LOAD("vision17b.bin", 0x0000, 0x4000, CRC(ecee1ff1) SHA1(ffde2a0f9b13328b6462fbf4eb95cfe8202a2d3f), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "vision17c", "Vision 1.7 TR-DOS v4.83") + ROMX_LOAD("vision17c.bin", 0x0000, 0x4000, CRC(c192a6b1) SHA1(d9eb1e06e28b2fb45c704cffd4a8b8a912041d08), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(4, "vision18", "Vision 1.8 TR-DOS v4.80") + ROMX_LOAD("vision18.bin", 0x0000, 0x4000, CRC(3ee7a488) SHA1(57167b82a6a3ffa8b25e97fa8cc208da361f1cc7), ROM_BIOS(4)) + ROM_SYSTEM_BIOS(5, "vision19", "Vision 1.9 TR-DOS v4.81") + ROMX_LOAD("vision19.bin", 0x0000, 0x4000, CRC(1a793d53) SHA1(cdbd0ac2262ede3852998174f88ae333419a570f), ROM_BIOS(5)) +ROM_END + ROM_START(betacbi) ROM_REGION(0x4000, "rom", 0) ROM_DEFAULT_BIOS("cbi24") @@ -209,6 +232,13 @@ ROM_START(betacbi) ROMX_LOAD("ar-20.bin", 0x0000, 0x4000, CRC(0ceeaa4d) SHA1(3e5f7d43218b5bd2a6e2aa28220c77cb651f5daa), ROM_BIOS(4)) ROM_END +ROM_START(gamma) + ROM_REGION(0x8000, "rom", 0) + ROM_DEFAULT_BIOS("gamma") + ROM_SYSTEM_BIOS(0, "gamma", "Gammadisk v4.1") + ROMX_LOAD("gamma.bin", 0x0000, 0x8000, CRC(00e4a835) SHA1(dffeb9f47b3eca94afbb61373eba003efd4675ff), ROM_BIOS(0)) +ROM_END + //------------------------------------------------- // device_add_mconfig - add device configuration @@ -251,6 +281,18 @@ void spectrum_betacbi_device::device_add_mconfig(machine_config& config) device_add_mconfig_base(config); } +void spectrum_gamma_device::device_add_mconfig(machine_config& config) +{ + FD1793(config, m_fdc, 4_MHz_XTAL / 4); + m_fdc->hld_wr_callback().set(FUNC(spectrum_gamma_device::fdc_hld_w)); + + device_add_mconfig_base(config); + + I8255(config, m_ppi); + // TODO hook joystick and printer ports + ACIA6850(config, m_acia, 0); // schematics missing, wiring unknown +} + const tiny_rom_entry *spectrum_betav2_device::device_rom_region() const { return ROM_NAME(betav2); @@ -266,11 +308,21 @@ const tiny_rom_entry *spectrum_betaplus_device::device_rom_region() const return ROM_NAME(betaplus); } +const tiny_rom_entry *spectrum_betaclone_device::device_rom_region() const +{ + return ROM_NAME(betaclone); +} + const tiny_rom_entry *spectrum_betacbi_device::device_rom_region() const { return ROM_NAME(betacbi); } +const tiny_rom_entry *spectrum_gamma_device::device_rom_region() const +{ + return ROM_NAME(gamma); +} + //************************************************************************** // LIVE DEVICE @@ -316,16 +368,38 @@ spectrum_betaplus_device::spectrum_betaplus_device(const machine_config &mconfig { } -spectrum_betacbi_device::spectrum_betacbi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +spectrum_betaclone_device::spectrum_betaclone_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : spectrum_betaplus_device(mconfig, type, tag, owner, clock) { } +spectrum_betaclone_device::spectrum_betaclone_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betaclone_device(mconfig, SPECTRUM_BETACLONE, tag, owner, clock) +{ +} + +spectrum_betacbi_device::spectrum_betacbi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betaclone_device(mconfig, type, tag, owner, clock) +{ +} + spectrum_betacbi_device::spectrum_betacbi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : spectrum_betacbi_device(mconfig, SPECTRUM_BETACBI, tag, owner, clock) { } +spectrum_gamma_device::spectrum_gamma_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betaplus_device(mconfig, type, tag, owner, clock) + , m_ppi(*this, "PPI") + , m_acia(*this, "ACIA") +{ +} + +spectrum_gamma_device::spectrum_gamma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : spectrum_gamma_device(mconfig, SPECTRUM_GAMMA, tag, owner, clock) +{ +} + //------------------------------------------------- // device_start - device-specific startup @@ -512,6 +586,97 @@ void spectrum_betav3_device::iorq_w(offs_t offset, uint8_t data) m_exp->iorq_w(offset, data); } +uint8_t spectrum_gamma_device::iorq_r(offs_t offset) +{ + uint8_t data = 0xff; + + if (!(m_masterdisable & 0x40)) + { + if (!(m_masterdisable & 0x80)) + { + switch (offset & 0x9f) + { + case 0x1f: + data = m_fdc->read((offset >> 5) & 0x03); + break; + + case 0x9f: + data &= 0x3f; // actually open bus + data |= m_fdc->drq_r() ? 0x40 : 0; + data |= m_fdc->intrq_r() ? 0x80 : 0; + break; + } + } + else + { + switch (offset & 0x9f) + { + case 0x1f: + data = m_ppi->read((offset >> 5) & 0x03); + break; + + case 0x9f: + data = m_acia->read((offset >> 6) & 0x01); + break; + } + } + } + else + data = m_exp->iorq_r(offset); + + return data; +} + +void spectrum_gamma_device::iorq_w(offs_t offset, uint8_t data) +{ + if ((offset & 3) == 0) + m_masterdisable = data; + + if (!(m_masterdisable & 0x40)) + { + if (!(m_masterdisable & 0x80)) + { + switch (offset & 0x9f) + { + case 0x1f: + m_fdc->write((offset >> 5) & 0x03, data); + break; + + case 0x9f: + m_control = data; + + floppy_image_device* floppy = m_floppy[data & 3]->get_device(); + + m_fdc->set_floppy(floppy); + if (floppy) + floppy->ss_w(BIT(data, 4) ? 0 : 1); + m_fdc->dden_w(BIT(data, 6)); + + m_fdc->hlt_w(BIT(data, 3)); + + m_fdc->mr_w(BIT(data, 2)); + motors_control(); + break; + } + } + else + { + switch (offset & 0x9f) + { + case 0x1f: + m_ppi->write((offset >> 5) & 0x03, data); + break; + + case 0x9f: + m_acia->write((offset >> 6) & 0x01, data); + break; + } + } + } + else + m_exp->iorq_w(offset, data); +} + uint8_t spectrum_betav2_device::mreq_r(offs_t offset) { uint8_t data = 0xff; @@ -528,7 +693,7 @@ uint8_t spectrum_betav2_device::mreq_r(offs_t offset) return data; } -uint8_t spectrum_betacbi_device::mreq_r(offs_t offset) +uint8_t spectrum_betaclone_device::mreq_r(offs_t offset) { uint8_t data = 0xff; @@ -541,6 +706,11 @@ uint8_t spectrum_betacbi_device::mreq_r(offs_t offset) return data; } +uint8_t spectrum_gamma_device::mreq_r(offs_t offset) +{ + return m_rom->base()[(offset & 0x3fff) + (m_romcs ? 0x4000 : 0)]; +} + void spectrum_betav2_device::mreq_w(offs_t offset, uint8_t data) { if (m_exp->romcs()) diff --git a/src/devices/bus/spectrum/beta.h b/src/devices/bus/spectrum/beta.h index 5d080f93deb..82600ab9206 100644 --- a/src/devices/bus/spectrum/beta.h +++ b/src/devices/bus/spectrum/beta.h @@ -12,6 +12,8 @@ #include "softlist.h" #include "imagedev/floppy.h" #include "machine/wd_fdc.h" +#include "machine/i8255.h" +#include "machine/6850acia.h" #include "formats/trd_dsk.h" //************************************************************************** @@ -95,9 +97,23 @@ protected: }; -class spectrum_betacbi_device : +class spectrum_betaclone_device : public spectrum_betaplus_device { +public: + // construction/destruction + spectrum_betaclone_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + spectrum_betaclone_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual uint8_t mreq_r(offs_t offset) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +}; + +class spectrum_betacbi_device : + public spectrum_betaclone_device +{ public: // construction/destruction spectrum_betacbi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -105,16 +121,37 @@ public: protected: virtual void device_add_mconfig(machine_config &config) override; - virtual uint8_t mreq_r(offs_t offset) override; virtual void fetch(offs_t offset) override; virtual const tiny_rom_entry *device_rom_region() const override; }; +class spectrum_gamma_device : + public spectrum_betaplus_device +{ +public: + // construction/destruction + spectrum_gamma_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + spectrum_gamma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + required_device m_ppi; + required_device m_acia; + + virtual void device_add_mconfig(machine_config &config) override; + virtual uint8_t mreq_r(offs_t offset) override; + virtual const tiny_rom_entry *device_rom_region() const override; + virtual uint8_t iorq_r(offs_t offset) override; + virtual void iorq_w(offs_t offset, uint8_t data) override; + virtual DECLARE_READ_LINE_MEMBER(romcs) override { return 1; }; +}; + // device type definition DECLARE_DEVICE_TYPE(SPECTRUM_BETAV2, spectrum_betav2_device) DECLARE_DEVICE_TYPE(SPECTRUM_BETAV3, spectrum_betav3_device) DECLARE_DEVICE_TYPE(SPECTRUM_BETAPLUS, spectrum_betaplus_device) +DECLARE_DEVICE_TYPE(SPECTRUM_BETACLONE, spectrum_betaclone_device) DECLARE_DEVICE_TYPE(SPECTRUM_BETACBI, spectrum_betacbi_device) +DECLARE_DEVICE_TYPE(SPECTRUM_GAMMA, spectrum_gamma_device) #endif // MAME_BUS_SPECTRUM_BETA_H diff --git a/src/devices/bus/spectrum/exp.cpp b/src/devices/bus/spectrum/exp.cpp index 642dcd1d8e0..df21157ff40 100644 --- a/src/devices/bus/spectrum/exp.cpp +++ b/src/devices/bus/spectrum/exp.cpp @@ -178,7 +178,9 @@ void spectrum_expansion_devices(device_slot_interface &device) device.option_add("betav2", SPECTRUM_BETAV2); device.option_add("betav3", SPECTRUM_BETAV3); device.option_add("betaplus", SPECTRUM_BETAPLUS); + device.option_add("betaclone", SPECTRUM_BETACLONE); device.option_add("betacbi", SPECTRUM_BETACBI); + device.option_add("gamma", SPECTRUM_GAMMA); device.option_add("beta128", SPECTRUM_BETA128); device.option_add("disciple", SPECTRUM_DISCIPLE); device.option_add("intf1", SPECTRUM_INTF1); diff --git a/src/devices/bus/spectrum/mgt.cpp b/src/devices/bus/spectrum/mgt.cpp index 142e3ef1997..e63789f2033 100644 --- a/src/devices/bus/spectrum/mgt.cpp +++ b/src/devices/bus/spectrum/mgt.cpp @@ -440,8 +440,11 @@ void spectrum_plusd_device::iorq_w(offs_t offset, uint8_t data) break; case 0xef: // bit 0-1: drive select, 6: printer strobe, 7: side select { - uint8_t drive = data & 3; - floppy_image_device* floppy = m_floppy[drive > 0 ? drive-1 : drive]->get_device(); + floppy_image_device* floppy = nullptr; + if (data & 1) + floppy = m_floppy[0]->get_device(); + else if (data & 2) + floppy = m_floppy[1]->get_device(); m_fdc->set_floppy(floppy); m_centronics->write_strobe(BIT(data, 6)); if (floppy) floppy->ss_w(BIT(data, 7)); -- cgit v1.2.3