summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2019-11-05 21:25:02 +0000
committer Nigel Barnes <Pernod70@users.noreply.github.com>2019-11-06 11:49:39 +0000
commitf8af6df01fe1f913a9e8e01f603ab52017b0032c (patch)
treeb1a66e59baf557187e532146324c603a908219fd /src/devices/bus
parent71f101d9a7657dfa75fd64a942ff1ee803b6b0e7 (diff)
bbcm: Added Slogger Click, Solidisk Mega 256, Peartree MR8000, Master Smart Cartridge devices.
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/bbc/cart/click.cpp113
-rw-r--r--src/devices/bus/bbc/cart/click.h47
-rw-r--r--src/devices/bus/bbc/cart/mega256.cpp97
-rw-r--r--src/devices/bus/bbc/cart/mega256.h47
-rw-r--r--src/devices/bus/bbc/cart/mr8000.cpp102
-rw-r--r--src/devices/bus/bbc/cart/mr8000.h46
-rw-r--r--src/devices/bus/bbc/cart/msc.cpp104
-rw-r--r--src/devices/bus/bbc/cart/msc.h48
-rw-r--r--src/devices/bus/bbc/cart/slot.cpp8
9 files changed, 612 insertions, 0 deletions
diff --git a/src/devices/bus/bbc/cart/click.cpp b/src/devices/bus/bbc/cart/click.cpp
new file mode 100644
index 00000000000..175de5eeae3
--- /dev/null
+++ b/src/devices/bus/bbc/cart/click.cpp
@@ -0,0 +1,113 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Slogger Click cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Slogger_Click.html
+
+ The Master version of the Click cartridge differs from the Electron
+ version:
+ Master 128 Electron
+ ROM 16K 32K
+ RAM (battery) 8K 32K
+
+ The data lines D1 and D2 are swapped between edge connector and ROM/RAM.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "click.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_CLICK, bbc_click_device, "bbc_click", "Slogger Click (Master 128) cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( clickm )
+//-------------------------------------------------
+
+INPUT_PORTS_START(clickm)
+ PORT_START("BUTTON")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Click") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, bbc_click_device, click_button, 0)
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_click_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(clickm);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_click_device - constructor
+//-------------------------------------------------
+
+bbc_click_device::bbc_click_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_CLICK, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_click_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_click_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe)
+ {
+ if (offset & 0x2000)
+ {
+ data = m_nvram[offset & 0x1fff];
+ }
+ else
+ {
+ data = m_rom[(offset & 0x1fff) | (romqa << 13)];
+ }
+ }
+
+ return bitswap<8>(data, 7, 6, 5, 4, 3, 1, 2, 0);
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_click_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe)
+ {
+ if (offset & 0x2000)
+ {
+ m_nvram[offset & 0x1fff] = bitswap<8>(data, 7, 6, 5, 4, 3, 1, 2, 0);
+ }
+ }
+}
+
+INPUT_CHANGED_MEMBER(bbc_click_device::click_button)
+{
+ m_slot->irq_w(!newval);
+}
diff --git a/src/devices/bus/bbc/cart/click.h b/src/devices/bus/bbc/cart/click.h
new file mode 100644
index 00000000000..9f6691c4356
--- /dev/null
+++ b/src/devices/bus/bbc/cart/click.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Slogger Click cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Slogger_Click.html
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_CLICK_H
+#define MAME_BUS_BBC_CART_CLICK_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_click_device
+
+class bbc_click_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_click_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_INPUT_CHANGED_MEMBER(click_button);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_CLICK, bbc_click_device)
+
+#endif // MAME_BUS_BBC_CART_CLICK_H
diff --git a/src/devices/bus/bbc/cart/mega256.cpp b/src/devices/bus/bbc/cart/mega256.cpp
new file mode 100644
index 00000000000..f0348df2e74
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mega256.cpp
@@ -0,0 +1,97 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Mega 256 cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_Mega256.html
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mega256.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MEGA256, bbc_mega256_device, "bbc_mega256", "Solidisk Mega 256 cartridge")
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_mega256_device - constructor
+//-------------------------------------------------
+
+bbc_mega256_device::bbc_mega256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MEGA256, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_page(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mega256_device::device_start()
+{
+ // register for save states
+ save_item(NAME(m_page));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_mega256_device::device_reset()
+{
+ m_page = 0x00;
+}
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_mega256_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe)
+ {
+ if (romqa)
+ {
+ data = m_rom[offset & 0x1fff];
+ }
+ else
+ {
+ data = m_ram[(offset & 0x3fff) | (m_page << 14)];
+ }
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_mega256_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe)
+ {
+ if (romqa)
+ {
+ // Not known whether this latch is fully decoded.
+ if (offset == 0x3fff) m_page = data & 0x0f;
+ }
+ else
+ {
+ m_ram[(offset & 0x3fff) | (m_page << 14)] = data;
+ }
+ }
+}
diff --git a/src/devices/bus/bbc/cart/mega256.h b/src/devices/bus/bbc/cart/mega256.h
new file mode 100644
index 00000000000..b6f211b694a
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mega256.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Mega 256 cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_Mega256.html
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MEGA256_H
+#define MAME_BUS_BBC_CART_MEGA256_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_mega256_device
+
+class bbc_mega256_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_mega256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ uint8_t m_page;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MEGA256, bbc_mega256_device)
+
+#endif // MAME_BUS_BBC_CART_MEGA256_H
diff --git a/src/devices/bus/bbc/cart/mr8000.cpp b/src/devices/bus/bbc/cart/mr8000.cpp
new file mode 100644
index 00000000000..a039936f23a
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mr8000.cpp
@@ -0,0 +1,102 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ MR8000 Master RAM Cartridge emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mr8000.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MR8000, bbc_mr8000_device, "bbc_mr8000", "MR8000 Master RAM Cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( mr8000 )
+//-------------------------------------------------
+
+INPUT_PORTS_START(mr8000)
+ PORT_START("SWITCH")
+ PORT_CONFNAME(0x03, 0x00, "ROM Choice")
+ PORT_CONFSETTING(0x00, "A (lower banks)")
+ PORT_CONFSETTING(0x01, "B (upper banks)")
+ PORT_CONFSETTING(0x02, "Off (disabled)")
+
+ PORT_CONFNAME(0x04, 0x00, "Write Protect")
+ PORT_CONFSETTING(0x00, "On (read only")
+ PORT_CONFSETTING(0x04, "Off (read and write)")
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_mr8000_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(mr8000);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_mr8000_device - constructor
+//-------------------------------------------------
+
+bbc_mr8000_device::bbc_mr8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MR8000, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_switch(*this, "SWITCH")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mr8000_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_mr8000_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0x00;
+ int bank = BIT(m_switch->read(), 0);
+
+ if (oe && !BIT(m_switch->read(), 1))
+ {
+ data = m_nvram[offset | (bank << 15) | (romqa << 14)];
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_mr8000_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ int bank = BIT(m_switch->read(), 0);
+
+ if (oe && !BIT(m_switch->read(), 1))
+ {
+ if (BIT(m_switch->read(), 2))
+ {
+ m_nvram[offset | (bank << 15) | (romqa << 14)] = data;
+ }
+ }
+}
diff --git a/src/devices/bus/bbc/cart/mr8000.h b/src/devices/bus/bbc/cart/mr8000.h
new file mode 100644
index 00000000000..ccf79e4508e
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mr8000.h
@@ -0,0 +1,46 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ MR8000 Master RAM Cartridge emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MR8000_H
+#define MAME_BUS_BBC_CART_MR8000_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_mr8000_device
+
+class bbc_mr8000_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_mr8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ required_ioport m_switch;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MR8000, bbc_mr8000_device)
+
+#endif // MAME_BUS_BBC_CART_MR8000_H
diff --git a/src/devices/bus/bbc/cart/msc.cpp b/src/devices/bus/bbc/cart/msc.cpp
new file mode 100644
index 00000000000..05a3284e83d
--- /dev/null
+++ b/src/devices/bus/bbc/cart/msc.cpp
@@ -0,0 +1,104 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Master Smart Cartridge emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "msc.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MSC, bbc_msc_device, "bbc_msc", "Master Smart Cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( msc )
+//-------------------------------------------------
+
+INPUT_PORTS_START(msc)
+ PORT_START("BUTTON")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Activate") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, bbc_msc_device, activate, 0)
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_msc_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(msc);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_msc_device - constructor
+//-------------------------------------------------
+
+bbc_msc_device::bbc_msc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MSC, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_button(*this, "BUTTON")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_msc_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_msc_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe & !romqa)
+ {
+ if (offset & 0x2000)
+ {
+ data = m_ram[offset & 0x7ff];
+ }
+ else
+ {
+ data = m_rom[(offset & 0x1fff) | (m_button->read() << 13)];
+ }
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_msc_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe & !romqa)
+ {
+ if (offset & 0x2000)
+ {
+ m_ram[offset & 0x7ff] = data;
+ }
+ }
+}
+
+INPUT_CHANGED_MEMBER(bbc_msc_device::activate)
+{
+ m_slot->irq_w(!newval);
+}
diff --git a/src/devices/bus/bbc/cart/msc.h b/src/devices/bus/bbc/cart/msc.h
new file mode 100644
index 00000000000..4bde2113047
--- /dev/null
+++ b/src/devices/bus/bbc/cart/msc.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Master Smart Cartridge emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MSC_H
+#define MAME_BUS_BBC_CART_MSC_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_msc_device
+
+class bbc_msc_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_msc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_INPUT_CHANGED_MEMBER(activate);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ required_ioport m_button;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MSC, bbc_msc_device)
+
+#endif // MAME_BUS_BBC_CART_MSC_H
diff --git a/src/devices/bus/bbc/cart/slot.cpp b/src/devices/bus/bbc/cart/slot.cpp
index b39c0e9dc1e..d67924503ea 100644
--- a/src/devices/bus/bbc/cart/slot.cpp
+++ b/src/devices/bus/bbc/cart/slot.cpp
@@ -61,6 +61,10 @@ bbc_cartslot_device::bbc_cartslot_device(const machine_config &mconfig, const ch
#include "bus/electron/cart/std.h"
#include "bus/electron/cart/abr.h"
#include "bus/electron/cart/aqr.h"
+#include "click.h"
+#include "mega256.h"
+#include "mr8000.h"
+#include "msc.h"
void bbcm_cart(device_slot_interface &device)
@@ -68,4 +72,8 @@ void bbcm_cart(device_slot_interface &device)
device.option_add_internal("std", ELECTRON_STDCART);
device.option_add_internal("abr", ELECTRON_ABR);
device.option_add_internal("aqr", ELECTRON_AQR);
+ device.option_add_internal("click", BBC_CLICK);
+ device.option_add_internal("mega256", BBC_MEGA256);
+ device.option_add_internal("mr8000", BBC_MR8000);
+ device.option_add_internal("msc", BBC_MSC);
}