summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2020-03-03 19:34:36 +0000
committer Nigel Barnes <Pernod70@users.noreply.github.com>2020-03-03 19:40:23 +0000
commit660194d7cee5cab944c57991b1ae3d4c1e8af4b9 (patch)
tree303d5420805ad7dfba3e6263f05653ec7c3f08df /src/devices
parenta1a70c4357c4ee87e7492a4cd2f62306f7965cd5 (diff)
bus/bbc/1mhzbus: Added Pull Down RAM and Colour Card 500 devices.
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.cpp10
-rw-r--r--src/devices/bus/bbc/1mhzbus/cc500.cpp176
-rw-r--r--src/devices/bus/bbc/1mhzbus/cc500.h59
-rw-r--r--src/devices/bus/bbc/1mhzbus/pdram.cpp87
-rw-r--r--src/devices/bus/bbc/1mhzbus/pdram.h49
5 files changed, 379 insertions, 2 deletions
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
index ca3a5e5f0af..0748624d276 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
@@ -108,6 +108,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data)
// slot devices
#include "autoprom.h"
+#include "cc500.h"
//#include "beebscan.h"
//#include "teletext.h"
//#include "digitiser.h"
@@ -119,6 +120,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data)
#include "scsi.h"
//#include "multiform.h"
#include "opus3.h"
+#include "pdram.h"
#include "pms64k.h"
#include "ramdisc.h"
//#include "graduate.h"
@@ -145,11 +147,13 @@ void bbc_1mhzbus_devices(device_slot_interface &device)
//device.option_add("procyon", BBC_PROCYON); /* CST Procyon IEEE Interface */
//device.option_add("multiform", BBC_MULTIFORM); /* Technomatic Multiform Z80 */
device.option_add("opus3", BBC_OPUS3); /* Opus Challenger 3 */
+ device.option_add("pdram", BBC_PDRAM); /* Micro User Pull Down RAM */
device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */
device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */
- //device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
+ //device.option_add("graduate", BBC_GRADUATE); /* Torch Graduate G400/G800 */
device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
+ device.option_add("cc500", BBC_CC500); /* CTS Colour Card 500 */
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
}
@@ -172,11 +176,13 @@ void bbcm_1mhzbus_devices(device_slot_interface &device)
//device.option_add("m87", BBC_M87); /* Peartree Music 87 Synthesiser */
//device.option_add("multiform", BBC_MULTIFORM); /* Technomatic Multiform Z80 */
device.option_add("opusa", BBC_OPUSA); /* Opus Challenger ADFS */
+ device.option_add("pdram", BBC_PDRAM); /* Micro User Pull Down RAM */
device.option_add("pms64k", BBC_PMS64K); /* PMS 64K Non-Volatile Ram Module */
device.option_add("ramdisc", BBC_RAMDISC); /* Morley Electronics RAM Disc */
- //device.option_add("graduate", BBC_GRADUATE); /* The Torch Graduate G400/G800 */
+ //device.option_add("graduate", BBC_GRADUATE); /* Torch Graduate G400/G800 */
device.option_add("beebopl", BBC_BEEBOPL); /* BeebOPL */
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
+ device.option_add("cc500", BBC_CC500); /* CTS Colour Card 500 */
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
device.option_add_internal("cfa3000opt", CFA3000_OPT);/* Henson CFA 3000 Option Board */
diff --git a/src/devices/bus/bbc/1mhzbus/cc500.cpp b/src/devices/bus/bbc/1mhzbus/cc500.cpp
new file mode 100644
index 00000000000..2d13526ed6b
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/cc500.cpp
@@ -0,0 +1,176 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Colour Card 500 - CTS Recognition
+
+ The CTS Palette is a 1 MHz bus device and it can be used to convert the 8
+ colours available on the BBC into any 8 colours from a range of 4096.
+
+ Programming the hardware directly
+ ---------------------------------
+ The hardware consists of 3 banks of very fast RAM (for red, green and blue
+ levels) and a 6522 versatile interface adaptor.
+
+ The memory map is as follows:
+
+ 6522 VIA &FC90 to &FC9F
+
+ RED BANK &FCA0 to &FCA7
+ GREEN BANK &FCA8 to &FCAF
+ BLUE BANK &FCB0 to &FCB8
+
+ There are 8 bytes in each bank, one for each actual colour. The physical
+ colour for logical colour L is stored at &FCA0+L, &FCA8+L and &FCB0+L.
+
+ For example, to reprogram actual colour 1 to brown, 10 would be stored in
+ &FCA1, 6 in &FCA9 and 0 in &FCB1.
+
+ Port A of the 6522 VIA is available for use as an extra 'user port', and
+ Port B is used internally.
+
+ Note : Line (Horizontal) sync pulses are available on PB6
+ Field (Vertical) sync pulses are available on CB1
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "cc500.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_CC500, bbc_cc500_device, "bbc_cc500", "CTS Colour Card 500")
+
+
+//-------------------------------------------------
+// ROM( cc500 )
+//-------------------------------------------------
+
+ROM_START(cc500)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_LOAD("cts_palette_1.10.rom", 0x0000, 0x2000, CRC(93533144) SHA1(e645afdc5c7574a487ff484b79ea21a3b476f847))
+ROM_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_cc500_device::device_add_mconfig(machine_config &config)
+{
+ VIA6522(config, m_via, DERIVED_CLOCK(1, 1));
+ m_via->readpa_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_r));
+ m_via->writepa_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_w));
+ m_via->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
+
+ BBC_USERPORT_SLOT(config, m_userport, bbc_userport_devices, nullptr);
+ m_userport->cb1_handler().set(m_via, FUNC(via6522_device::write_ca1));
+ m_userport->cb2_handler().set(m_via, FUNC(via6522_device::write_ca2));
+
+ BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr);
+ m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
+ m_1mhzbus->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w));
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry* bbc_cc500_device::device_rom_region() const
+{
+ return ROM_NAME(cc500);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_cc500_device - constructor
+//-------------------------------------------------
+
+bbc_cc500_device::bbc_cc500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_CC500, tag, owner, clock)
+ , device_bbc_1mhzbus_interface(mconfig, *this)
+ , m_palette(*this, ":palette")
+ , m_1mhzbus(*this, "1mhzbus")
+ , m_via(*this, "via")
+ , m_userport(*this, "userport")
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_cc500_device::device_start()
+{
+ memset(m_palette_ram, 0, sizeof(m_palette_ram));
+
+ /* register for save states */
+ save_item(NAME(m_palette_ram));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_cc500_device::fred_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (offset & 0xf0)
+ {
+ case 0x90:
+ data = m_via->read(offset & 0x0f);
+ break;
+ }
+
+ data &= m_1mhzbus->fred_r(offset);
+
+ return data;
+}
+
+void bbc_cc500_device::fred_w(offs_t offset, uint8_t data)
+{
+ switch (offset & 0xf0)
+ {
+ case 0x90:
+ m_via->write(offset & 0x0f, data);
+ break;
+
+ case 0xa0: case 0xb0:
+ switch (offset & 0x18)
+ {
+ case 0x00:
+ m_palette_ram[~offset & 0x07].set_r((data << 4) | (data & 0x0f));
+ break;
+ case 0x08:
+ m_palette_ram[~offset & 0x07].set_g((data << 4) | (data & 0x0f));
+ break;
+ case 0x10:
+ m_palette_ram[~offset & 0x07].set_b((data << 4) | (data & 0x0f));
+ break;
+ }
+ m_palette->set_pen_colors(0, &m_palette_ram[0], 8);
+ break;
+ }
+
+ m_1mhzbus->fred_w(offset, data);
+}
+
+uint8_t bbc_cc500_device::jim_r(offs_t offset)
+{
+ return m_1mhzbus->jim_r(offset);
+}
+
+void bbc_cc500_device::jim_w(offs_t offset, uint8_t data)
+{
+ m_1mhzbus->jim_w(offset, data);
+}
diff --git a/src/devices/bus/bbc/1mhzbus/cc500.h b/src/devices/bus/bbc/1mhzbus/cc500.h
new file mode 100644
index 00000000000..f99ceec100a
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/cc500.h
@@ -0,0 +1,59 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Colour Card 500 - CTS Recognition
+
+**********************************************************************/
+
+#ifndef MAME_BUS_BBC_1MHZBUS_CC500_H
+#define MAME_BUS_BBC_1MHZBUS_CC500_H
+
+#include "1mhzbus.h"
+#include "machine/6522via.h"
+#include "bus/bbc/userport/userport.h"
+#include "emupal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_cc500_device
+
+class bbc_cc500_device :
+ public device_t,
+ public device_bbc_1mhzbus_interface
+{
+public:
+ // construction/destruction
+ bbc_cc500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t 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;
+
+ virtual uint8_t fred_r(offs_t offset) override;
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_device<palette_device> m_palette;
+ required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
+ required_device<via6522_device> m_via;
+ required_device<bbc_userport_slot_device> m_userport;
+
+ rgb_t m_palette_ram[8];
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_CC500, bbc_cc500_device)
+
+
+#endif // MAME_BUS_BBC_1MHZBUS_CC500_H
diff --git a/src/devices/bus/bbc/1mhzbus/pdram.cpp b/src/devices/bus/bbc/1mhzbus/pdram.cpp
new file mode 100644
index 00000000000..81106218fc4
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/pdram.cpp
@@ -0,0 +1,87 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Pull Down RAM - Micro User Jul/Aug 1990
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "pdram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_PDRAM, bbc_pdram_device, "bbc_pdram", "Micro User Pull Down RAM (DIY)");
+
+
+//-------------------------------------------------
+// ROM( pdram )
+//-------------------------------------------------
+
+ROM_START(pdram)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_LOAD("ramdvr.rom", 0x0000, 0x2000, CRC(56f61728) SHA1(265359d1fb9c0adca53912aa6a42a995b8225a3e))
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry* bbc_pdram_device::device_rom_region() const
+{
+ return ROM_NAME(pdram);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_pdram_device - constructor
+//-------------------------------------------------
+
+bbc_pdram_device::bbc_pdram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_PDRAM, tag, owner, clock)
+ , device_bbc_1mhzbus_interface(mconfig, *this)
+ , m_ram_page(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_pdram_device::device_start()
+{
+ m_ram = std::make_unique<uint8_t[]>(0x8000);
+
+ /* register for save states */
+ save_pointer(NAME(m_ram), 0x8000);
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_pdram_device::fred_w(offs_t offset, uint8_t data)
+{
+ if (offset == 0xff)
+ {
+ m_ram_page = data;
+ }
+}
+
+uint8_t bbc_pdram_device::jim_r(offs_t offset)
+{
+ return m_ram[(m_ram_page << 8) | offset];
+}
+
+void bbc_pdram_device::jim_w(offs_t offset, uint8_t data)
+{
+ m_ram[(m_ram_page << 8) | offset] = data;
+}
diff --git a/src/devices/bus/bbc/1mhzbus/pdram.h b/src/devices/bus/bbc/1mhzbus/pdram.h
new file mode 100644
index 00000000000..23f5b2884ca
--- /dev/null
+++ b/src/devices/bus/bbc/1mhzbus/pdram.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Pull Down RAM
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_1MHZBUS_PDRAM_H
+#define MAME_BUS_BBC_1MHZBUS_PDRAM_H
+
+#include "1mhzbus.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_pdram_device:
+ public device_t,
+ public device_bbc_1mhzbus_interface
+{
+public:
+ // construction/destruction
+ bbc_pdram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry* device_rom_region() const override;
+
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
+
+private:
+ std::unique_ptr<uint8_t[]> m_ram;
+
+ uint8_t m_ram_page;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_PDRAM, bbc_pdram_device);
+
+
+#endif /* MAME_BUS_BBC_1MHZBUS_PDRAM_H */