diff options
author | 2019-08-28 22:15:06 +0100 | |
---|---|---|
committer | 2019-08-29 00:15:06 +0300 | |
commit | b77d8ecb0382dab1f381412ec9a06706d5b44cb5 (patch) | |
tree | c70bf3f8e237d453921dd8a6c185107453bff5aa /src/devices/bus/spectrum/beta.cpp | |
parent | a1b1b325b1d2f0093fe356f85b6153c68642e00c (diff) |
Spectrum betadisk stuff (#5564)
* spectrum bus : rename beta.cpp to beta128.cpp as the original beta is somewhat different (nw)
* (nw)
* start making a device for the actual original beta disk interfaces (nw)
* flesh out beta stuff a bit (nw)
Diffstat (limited to 'src/devices/bus/spectrum/beta.cpp')
-rw-r--r-- | src/devices/bus/spectrum/beta.cpp | 284 |
1 files changed, 218 insertions, 66 deletions
diff --git a/src/devices/bus/spectrum/beta.cpp b/src/devices/bus/spectrum/beta.cpp index 4fdc6abde3b..4f46db864c2 100644 --- a/src/devices/bus/spectrum/beta.cpp +++ b/src/devices/bus/spectrum/beta.cpp @@ -1,45 +1,81 @@ // license:BSD-3-Clause -// copyright-holders:Nigel Barnes +// copyright-holders:Nigel Barnes, David Haywood /********************************************************************* - Technology Research Beta 128 Disk interface + Technology Research Beta Disk interface & clones + these are designed for the 48k Spectrum models -*********************************************************************/ + There are multiple versions of this -#include "emu.h" -#include "beta.h" + 'hand made' PCB with V2 ROM: + - possible prototype / low production run + - 4k ROM + - FORMAT, COPY etc. must be loaded from a disk to be used + - disks are password protected + - uses 1771 disk controller + https://www.youtube.com/watch?v=gSJIuZjbFYs + Original Beta Disk release with V3 ROM: + - same features as above + - uses a 1793 controller -/*************************************************************************** - DEVICE DEFINITIONS -***************************************************************************/ + Re-release dubbed "Beta Disk plus" with V4 ROM: + - many operations moved into a larger capacity (8k) ROM rather + than requiring a utility disk + - uses a 1793 controller + - adds 'magic button' to dump the running state of the machine + to disk + - disk password system removed -DEFINE_DEVICE_TYPE(SPECTRUM_BETA128, spectrum_beta128_device, "spectrum_beta128", "TR Beta 128 Disk Interface") + Many clones exist, some specific to the various Spectrum clones. + (not yet added) + Original Beta Disk (V3) clones + - Sandy FDD2 SP-DOS + - AC DOS P.Z.APINA -//------------------------------------------------- -// INPUT_PORTS( beta128 ) -//------------------------------------------------- + Beta Disk plus (V4) clones + - CAS DOS Cheyenne Advanced System + - CBI-95 + - SYNCHRON IDS91 + - SYNCHRON IDS2001ne + - ARCADE AR-20 + - Vision Desktop Betadisk -INPUT_PORTS_START(beta128) - PORT_START("BUTTON") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Magic Button") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, spectrum_beta128_device, magic_button, 0) + Some units also exist that allow population of both V3 and V4 + ROM types with a switch (unofficial, for compatibility?) - PORT_START("SWITCH") - PORT_CONFNAME(0x03, 0x01, "System Switch") //PORT_CHANGED_MEMBER(DEVICE_SELF, spectrum_beta128_device, switch_changed, 0) - PORT_CONFSETTING(0x00, "Off (128)") - PORT_CONFSETTING(0x01, "Normal (auto-boot)") - //PORT_CONFSETTING(0x02, "Reset") // TODO: implement RESET callback -INPUT_PORTS_END + --- -//------------------------------------------------- -// input_ports - device-specific input ports -//------------------------------------------------- + NOTE: -ioport_constructor spectrum_beta128_device::device_input_ports() const -{ - return INPUT_PORTS_NAME(beta128); -} + ROMs really need verifying, real dumps appear to be bitswapped + on original boards, so we're using those ones where possible, + however sizes are unconfirmed (some sources state that the data + is duplicated across the 16k in ROM, others state it just mirrors + in memory) and some might be modified or bad. + + beta128.cpp could be modified to expand on this, as it builds + on the features of the betaplus, but for now I've kept them + separate as the enable / disable mechanisms are different and + remaining mappings of devices unconfirmed + + These devices are not currently working as the disable logic is + not understood. + +*********************************************************************/ + +#include "emu.h" +#include "beta.h" + + +/*************************************************************************** + DEVICE DEFINITIONS +***************************************************************************/ + +DEFINE_DEVICE_TYPE(SPECTRUM_BETAV2, spectrum_betav2_device, "spectrum_betav2", "TR Beta Disk Interface (older, FD1771 based)") +DEFINE_DEVICE_TYPE(SPECTRUM_BETAV3, spectrum_betav3_device, "spectrum_betav3", "TR Beta Disk Interface (newer, FD1793 based)") +DEFINE_DEVICE_TYPE(SPECTRUM_BETAPLUS, spectrum_betaplus_device, "spectrum_betaplus", "TR Beta Disk Plus Interface") //------------------------------------------------- // SLOT_INTERFACE( beta_floppies ) @@ -54,7 +90,7 @@ static void beta_floppies(device_slot_interface &device) // floppy_format_type floppy_formats //------------------------------------------------- -FLOPPY_FORMATS_MEMBER(spectrum_beta128_device::floppy_formats) +FLOPPY_FORMATS_MEMBER(spectrum_betav2_device::floppy_formats) FLOPPY_TRD_FORMAT FLOPPY_FORMATS_END @@ -62,28 +98,69 @@ FLOPPY_FORMATS_END // ROM( beta ) //------------------------------------------------- -ROM_START(beta128) +ROM_START(betav2) + ROM_REGION(0x4000, "rom", 0) + ROM_DEFAULT_BIOS("trd20") + ROM_SYSTEM_BIOS(0, "trd20", "TR-DOS v2.0") + ROMX_LOAD("trd20.bin", 0x0000, 0x1000, CRC(dd269fb2) SHA1(ab394a19461f314fffd592645a273b85e76fadec), ROM_BIOS(0)) + ROM_RELOAD(0x1000,0x1000) + ROM_RELOAD(0x2000,0x1000) + ROM_RELOAD(0x3000,0x1000) +ROM_END + + +// there is an alt set CRC(48f9149f) SHA1(52774757096fdc93ea94c55306481f6f41204e96) with differences at 30e, 3cd, 404, 7bd, it appears to be a bad dump +// 30c : call $2acd call $6acd +// 3cc : ld hl, $5b00 ld hl, $5b01 +// 402 : call $2acd call $6bcd +// 7bd : ld ($5d02), hl inc hl, ld (bc),a, ld e,l + +// the Profisoft version appears to be different code, maybe based on a different revision or even modified hw? + +ROM_START(betav3) + ROM_REGION(0x4000, "rom", 0) + ROM_DEFAULT_BIOS("trd30") + ROM_SYSTEM_BIOS(0, "trd30", "TR-DOS v3.0 (set 1)") + ROMX_LOAD("trd30.bin", 0x0000, 0x1000, CRC(c814179d) SHA1(b617ab59639beaa7b5d8e5b4e4a543a8eb0217c8), ROM_BIOS(0)) + ROM_RELOAD(0x1000,0x1000) + ROM_RELOAD(0x2000,0x1000) + ROM_RELOAD(0x3000,0x1000) +// ROM_SYSTEM_BIOS(1, "trd30a", "TR-DOS v3.0 (set 2)") +// ROMX_LOAD("trd30_alt.bin", 0x0000, 0x1000, CRC(48f9149f) SHA1(52774757096fdc93ea94c55306481f6f41204e96), ROM_BIOS(1)) +// ROM_RELOAD(0x1000,0x1000) +// ROM_RELOAD(0x2000,0x1000) +// ROM_RELOAD(0x3000,0x1000) + ROM_SYSTEM_BIOS(1, "trd30p", "TR-DOS v3.0 (set 2, Profisoft)") // is this a clone device? + ROMX_LOAD("trd30ps.bin", 0x0000, 0x1000, CRC(b0f175a3) SHA1(ac95bb4d89072224deef58a1655e8029f811a7fa), ROM_BIOS(1)) + ROM_RELOAD(0x1000,0x1000) + ROM_RELOAD(0x2000,0x1000) + ROM_RELOAD(0x3000,0x1000) +ROM_END + +// some sources indicate these should be 16kb roms with both halves duplicated, others suggest the same but with the first byte being 0x00 instead (maybe an issue with the dumping) +// there are also some '412' unscrambled dumps with most of the data in the mirror regions as 0xff (maybe official, maybe from clone devices that should be treated separately?) +ROM_START(betaplus) ROM_REGION(0x4000, "rom", 0) - ROM_DEFAULT_BIOS("trd504") - ROM_SYSTEM_BIOS(0, "trd501", "TR-DOS v5.01") - ROMX_LOAD("trd501.rom", 0x0000, 0x4000, CRC(3e3cdd4c) SHA1(8303ba0cc79daa6c04cd1e6ce27e8b6886a3f0de), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "trd503", "TR-DOS v5.03") - ROMX_LOAD("trd503.rom", 0x0000, 0x4000, CRC(10751aba) SHA1(21695e3f2a8f796386ce66eea8a246b0ac44810c), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(2, "trd504", "TR-DOS v5.04") - ROMX_LOAD("trd504.rom", 0x0000, 0x4000, CRC(ba310874) SHA1(05e55e37df8eee6c68601ba9cf6c92195852ce3f), ROM_BIOS(2)) + ROM_DEFAULT_BIOS("trd409") + ROM_SYSTEM_BIOS(0, "trd409", "TR-DOS v4.09") + ROMX_LOAD("trd409.bin", 0x0000, 0x2000, CRC(18365bdc) SHA1(a0e7c80905423c54bd497575026ea8821061175a), ROM_BIOS(0)) + ROM_RELOAD(0x2000,0x2000) + ROM_SYSTEM_BIOS(1, "trd411", "TR-DOS v4.11") + ROMX_LOAD("trd411.bin", 0x0000, 0x2000, CRC(26902902) SHA1(cb90fc31bf62d5968730db23a600344338e31e7e), ROM_BIOS(1)) + ROM_RELOAD(0x2000,0x2000) ROM_END + //------------------------------------------------- // device_add_mconfig - add device configuration //------------------------------------------------- -void spectrum_beta128_device::device_add_mconfig(machine_config &config) +void spectrum_betav2_device::device_add_mconfig_base(machine_config& config) { - FD1793(config, m_fdc, 4_MHz_XTAL / 4); - FLOPPY_CONNECTOR(config, "fdc:0", beta_floppies, "525qd", spectrum_beta128_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:1", beta_floppies, "525qd", spectrum_beta128_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:2", beta_floppies, nullptr, spectrum_beta128_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:3", beta_floppies, nullptr, spectrum_beta128_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "fdc:0", beta_floppies, "525qd", spectrum_betav2_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "fdc:1", beta_floppies, "525qd", spectrum_betav2_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "fdc:2", beta_floppies, nullptr, spectrum_betav2_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "fdc:3", beta_floppies, nullptr, spectrum_betav2_device::floppy_formats).enable_sound(true); // passthru SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, nullptr); @@ -91,9 +168,31 @@ void spectrum_beta128_device::device_add_mconfig(machine_config &config) m_exp->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w)); } -const tiny_rom_entry *spectrum_beta128_device::device_rom_region() const +void spectrum_betav2_device::device_add_mconfig(machine_config &config) +{ + FD1771(config, m_fdc, 4_MHz_XTAL / 4); + device_add_mconfig_base(config); +} + +void spectrum_betav3_device::device_add_mconfig(machine_config& config) { - return ROM_NAME(beta128); + FD1793(config, m_fdc, 4_MHz_XTAL / 4); + device_add_mconfig_base(config); +} + +const tiny_rom_entry *spectrum_betav2_device::device_rom_region() const +{ + return ROM_NAME(betav2); +} + +const tiny_rom_entry *spectrum_betav3_device::device_rom_region() const +{ + return ROM_NAME(betav3); +} + +const tiny_rom_entry *spectrum_betaplus_device::device_rom_region() const +{ + return ROM_NAME(betaplus); } @@ -102,69 +201,104 @@ const tiny_rom_entry *spectrum_beta128_device::device_rom_region() const //************************************************************************** //------------------------------------------------- -// spectrum_beta128_device - constructor +// spectrum_betav2_device - constructor //------------------------------------------------- -spectrum_beta128_device::spectrum_beta128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SPECTRUM_BETA128, tag, owner, clock) +spectrum_betav2_device::spectrum_betav2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) , device_spectrum_expansion_interface(mconfig, *this) , m_rom(*this, "rom") , m_fdc(*this, "fdc") , m_floppy(*this, "fdc:%u", 0) , m_exp(*this, "exp") - , m_switch(*this, "SWITCH") { } +spectrum_betav2_device::spectrum_betav2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betav2_device(mconfig, SPECTRUM_BETAV2, tag, owner, clock) +{ +} + +spectrum_betav3_device::spectrum_betav3_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betav2_device(mconfig, type, tag, owner, clock) +{ +} + +spectrum_betav3_device::spectrum_betav3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betav3_device(mconfig, SPECTRUM_BETAV3, tag, owner, clock) +{ +} + +spectrum_betaplus_device::spectrum_betaplus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betav3_device(mconfig, type, tag, owner, clock) +{ +} + +spectrum_betaplus_device::spectrum_betaplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : spectrum_betaplus_device(mconfig, SPECTRUM_BETAPLUS, tag, owner, clock) +{ +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -void spectrum_beta128_device::device_start() +void spectrum_betav2_device::device_start() { save_item(NAME(m_romcs)); + +#if 0 // we do this in realtime instead + for (int i = 0; i < m_rom->bytes(); i++) + { + uint8_t* rom = m_rom->base(); + + rom[i] = bitswap<8>(rom[i],0,6,5,4,3,2,1,7); + } +#endif } //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- -void spectrum_beta128_device::device_reset() +void spectrum_betav2_device::device_reset() { - // Page in the ROM if auto-boot is selected - if (m_switch->read() == 0x01) - m_romcs = 1; - else - m_romcs = 0; + // always paged in on boot? (no mode switch like beta128) + m_romcs = 1; } //************************************************************************** // IMPLEMENTATION //************************************************************************** -READ_LINE_MEMBER(spectrum_beta128_device::romcs) +READ_LINE_MEMBER(spectrum_betav2_device::romcs) { return m_romcs | m_exp->romcs(); } -void spectrum_beta128_device::opcode_fetch(offs_t offset) +void spectrum_betav2_device::opcode_fetch(offs_t offset) { m_exp->opcode_fetch(offset); if (!machine().side_effects_disabled()) { - if ((offset == 0x0066) || (offset & 0xff00) == 0x3d00) + if ((offset & 0xff00) == 0x3c00) m_romcs = 1; - else if (offset >= 0x4000) - m_romcs = 0; + + // how does the ROM get disabled on these older beta units + // there are no RETs that end up in RAM as with the 128 + // so it looks like jumps to the 0xxx and 1xxx regions, but + // that doesn't work? } } -uint8_t spectrum_beta128_device::iorq_r(offs_t offset) +uint8_t spectrum_betav2_device::iorq_r(offs_t offset) { uint8_t data = m_exp->iorq_r(offset); +#if 0 // this is the Beta 128 logic, it may or may not be the same here if (m_romcs) { switch (offset & 0xff) @@ -180,11 +314,14 @@ uint8_t spectrum_beta128_device::iorq_r(offs_t offset) break; } } +#endif + return data; } -void spectrum_beta128_device::iorq_w(offs_t offset, uint8_t data) +void spectrum_betav2_device::iorq_w(offs_t offset, uint8_t data) { +#if 0 // this is the Beta 128 logic, it may or may not be the same here if (m_romcs) { switch (offset & 0xff) @@ -219,16 +356,18 @@ void spectrum_beta128_device::iorq_w(offs_t offset, uint8_t data) break; } } +#endif m_exp->iorq_w(offset, data); } -uint8_t spectrum_beta128_device::mreq_r(offs_t offset) +uint8_t spectrum_betav2_device::mreq_r(offs_t offset) { uint8_t data = 0xff; if (m_romcs) { data = m_rom->base()[offset & 0x3fff]; + data = bitswap<8>(data,0,6,5,4,3,2,1,7); // proper dumps have bits 0 and 7 swapped? } if (m_exp->romcs()) @@ -237,17 +376,30 @@ uint8_t spectrum_beta128_device::mreq_r(offs_t offset) return data; } -void spectrum_beta128_device::mreq_w(offs_t offset, uint8_t data) +void spectrum_betav2_device::mreq_w(offs_t offset, uint8_t data) { if (m_exp->romcs()) m_exp->mreq_w(offset, data); } -INPUT_CHANGED_MEMBER(spectrum_beta128_device::magic_button) +// Betaplus has a 'magic button' for dumping RAM + +INPUT_PORTS_START(betaplus) + PORT_START("BUTTON") // don't use F12, it clashes with the 'exit from debugger' button + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Magic Button") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, spectrum_betaplus_device, magic_button, 0) +INPUT_PORTS_END + +ioport_constructor spectrum_betaplus_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(betaplus); +} + +INPUT_CHANGED_MEMBER(spectrum_betaplus_device::magic_button) { if (newval && !oldval) { m_slot->nmi_w(ASSERT_LINE); + m_romcs = 1; } else { |