From d363f6336a6e076975771da4d8eab869ad50a93c Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Sun, 11 Dec 2022 20:12:15 +0000 Subject: bus/bbc/rom: Added support for the Acornsoft Trilogy Emulator board. --- src/devices/bus/bbc/rom/pal.cpp | 26 ++++++++++++++++++++++++++ src/devices/bus/bbc/rom/pal.h | 14 ++++++++++++++ src/devices/bus/bbc/rom/slot.cpp | 3 +++ 3 files changed, 43 insertions(+) diff --git a/src/devices/bus/bbc/rom/pal.cpp b/src/devices/bus/bbc/rom/pal.cpp index 51667f70955..c0cfb1ac7b5 100644 --- a/src/devices/bus/bbc/rom/pal.cpp +++ b/src/devices/bus/bbc/rom/pal.cpp @@ -34,6 +34,12 @@ Not a PALPROM carrier board but a larger ROM carrier containing 4x32K and TTL circuits to enable and page each ROM into 16K banks. + Acornsoft Trilogy Emulator (PAL20R4) + An unreleased product that combines the View family of ROMs into a + single banked 64K ROM, using a PAL to perform 16K bank switches upon + reads from the last 4 bytes of ROM space &BFFC to &BFFF. Only known + example loaned by Stuart Swales. + ***************************************************************************/ #include "emu.h" @@ -53,6 +59,7 @@ DEFINE_DEVICE_TYPE(BBC_PALTED, bbc_palted_device, "bbc_palted", "Watford Electro DEFINE_DEVICE_TYPE(BBC_PALABEP, bbc_palabep_device, "bbc_palabep", "P.R.E.S. 32K ROM Carrier (ABE+)") DEFINE_DEVICE_TYPE(BBC_PALABE, bbc_palabe_device, "bbc_palabe", "P.R.E.S. 32K ROM Carrier (ABE)") DEFINE_DEVICE_TYPE(BBC_PALMO2, bbc_palmo2_device, "bbc_palmo2", "Instant Mini Office 2 ROM Carrier") +DEFINE_DEVICE_TYPE(BBC_TRILOGY, bbc_trilogy_device, "bbc_trilogy", "Acornsoft Trilogy Emulator") //************************************************************************** @@ -115,6 +122,11 @@ bbc_palmo2_device::bbc_palmo2_device(const machine_config &mconfig, const char * { } +bbc_trilogy_device::bbc_trilogy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bbc_pal_device(mconfig, BBC_TRILOGY, tag, owner, clock) +{ +} + //------------------------------------------------- // device_start - device-specific startup @@ -310,3 +322,17 @@ uint8_t bbc_palmo2_device::read(offs_t offset) return get_rom_base()[(offset & 0x3fff) | (m_bank << 13)]; } + +uint8_t bbc_trilogy_device::read(offs_t offset) +{ + if (!machine().side_effects_disabled()) + { + /* switching zones for Acornsoft Trilogy Emulator */ + switch (offset & 0x3ff8) + { + case 0x3ff8: m_bank = offset & 0x03; break; + } + } + + return get_rom_base()[(offset & 0x3fff) | (m_bank << 14)]; +} diff --git a/src/devices/bus/bbc/rom/pal.h b/src/devices/bus/bbc/rom/pal.h index 31c8dcd0d78..23ccd94741f 100644 --- a/src/devices/bus/bbc/rom/pal.h +++ b/src/devices/bus/bbc/rom/pal.h @@ -151,6 +151,19 @@ protected: virtual uint8_t read(offs_t offset) override; }; +// ======================> bbc_trilogy_device + +class bbc_trilogy_device : public bbc_pal_device +{ +public: + // construction/destruction + bbc_trilogy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device_bbc_rom_interface overrides + virtual uint8_t read(offs_t offset) override; +}; + // device type definition DECLARE_DEVICE_TYPE(BBC_CCIWORD, bbc_cciword_device) @@ -162,6 +175,7 @@ DECLARE_DEVICE_TYPE(BBC_PALTED, bbc_palted_device) DECLARE_DEVICE_TYPE(BBC_PALABEP, bbc_palabep_device) DECLARE_DEVICE_TYPE(BBC_PALABE, bbc_palabe_device) DECLARE_DEVICE_TYPE(BBC_PALMO2, bbc_palmo2_device) +DECLARE_DEVICE_TYPE(BBC_TRILOGY, bbc_trilogy_device) #endif // MAME_BUS_BBC_ROM_PAL_H diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp index b7ea541bbc2..1be895375c3 100644 --- a/src/devices/bus/bbc/rom/slot.cpp +++ b/src/devices/bus/bbc/rom/slot.cpp @@ -213,6 +213,7 @@ void bbc_romslot_device::write(offs_t offset, uint8_t data) #include "datagem.h" #include "dfs.h" #include "genie.h" +//#include "gommc.h" #include "pal.h" //#include "ramagic.h" #include "rtc.h" @@ -234,8 +235,10 @@ void bbc_rom_devices(device_slot_interface &device) device.option_add_internal("palmo2", BBC_PALMO2); device.option_add_internal("datagem", BBC_DATAGEM); device.option_add_internal("genie", BBC_PMSGENIE); + //device.option_add_internal("gommc", BBC_GOMMC); device.option_add_internal("dfse00", BBC_DFSE00); //device.option_add_internal("ramagic", BBC_RAMAGIC); device.option_add_internal("stlrtc", BBC_STLRTC); device.option_add_internal("pmsrtc", BBC_PMSRTC); + device.option_add_internal("trilogy", BBC_TRILOGY); } -- cgit v1.2.3