From 26d94f2275aec52c3a28c25076735fc7e4a465c6 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Mon, 20 Nov 2017 02:30:34 +0000 Subject: cfa3000: Added input devices on userport, analogue, and 1MHz bus. --- scripts/src/bus.lua | 6 ++ src/devices/bus/bbc/1mhzbus/1mhzbus.cpp | 38 ++++---- src/devices/bus/bbc/1mhzbus/1mhzbus.h | 5 +- src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp | 116 +++++++++++++++++++++++ src/devices/bus/bbc/1mhzbus/cfa3000opt.h | 50 ++++++++++ src/devices/bus/bbc/analogue/analogue.cpp | 2 + src/devices/bus/bbc/analogue/cfa3000a.cpp | 100 ++++++++++++++++++++ src/devices/bus/bbc/analogue/cfa3000a.h | 52 ++++++++++ src/devices/bus/bbc/userport/cfa3000kbd.cpp | 141 ++++++++++++++++++++++++++++ src/devices/bus/bbc/userport/cfa3000kbd.h | 50 ++++++++++ src/devices/bus/bbc/userport/userport.cpp | 63 +++++++++---- src/devices/bus/bbc/userport/userport.h | 85 +++++++++-------- src/mame/drivers/bbc.cpp | 70 +++++++++----- src/mame/includes/bbc.h | 4 + src/mame/machine/bbc.cpp | 28 ++++-- 15 files changed, 703 insertions(+), 107 deletions(-) create mode 100644 src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp create mode 100644 src/devices/bus/bbc/1mhzbus/cfa3000opt.h create mode 100644 src/devices/bus/bbc/analogue/cfa3000a.cpp create mode 100644 src/devices/bus/bbc/analogue/cfa3000a.h create mode 100644 src/devices/bus/bbc/userport/cfa3000kbd.cpp create mode 100644 src/devices/bus/bbc/userport/cfa3000kbd.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 62dcbe0ed8c..6a3d9cb9cc9 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -253,6 +253,8 @@ if (BUSES["BBC_ANALOGUE"]~=null) then MAME_DIR .. "src/devices/bus/bbc/analogue/analogue.h", MAME_DIR .. "src/devices/bus/bbc/analogue/joystick.cpp", MAME_DIR .. "src/devices/bus/bbc/analogue/joystick.h", + MAME_DIR .. "src/devices/bus/bbc/analogue/cfa3000a.cpp", + MAME_DIR .. "src/devices/bus/bbc/analogue/cfa3000a.h", } end @@ -285,6 +287,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.h", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/opus3.cpp", MAME_DIR .. "src/devices/bus/bbc/1mhzbus/opus3.h", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp", + MAME_DIR .. "src/devices/bus/bbc/1mhzbus/cfa3000opt.h", } end @@ -327,6 +331,8 @@ if (BUSES["BBC_USERPORT"]~=null) then files { MAME_DIR .. "src/devices/bus/bbc/userport/userport.cpp", MAME_DIR .. "src/devices/bus/bbc/userport/userport.h", + MAME_DIR .. "src/devices/bus/bbc/userport/cfa3000kbd.cpp", + MAME_DIR .. "src/devices/bus/bbc/userport/cfa3000kbd.h", } end diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index 023412f7e7c..12feac575f8 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -96,6 +96,11 @@ void bbc_1mhzbus_slot_device::device_reset() } } +WRITE_LINE_MEMBER(bbc_1mhzbus_slot_device::rst_w) +{ + if (m_card) + m_card->rst_w(state); +} //------------------------------------------------- // SLOT_INTERFACE( bbc_1mhzbus_devices ) @@ -105,29 +110,28 @@ void bbc_1mhzbus_slot_device::device_reset() // slot devices //#include "teletext.h" //#include "ieee488.h" -//#include "music500.h" -//#include "music5000.h" +//#include "m5000.h" //#include "multiform.h" #include "opus3.h" //#include "ramdisc.h" -//#include "torchg400.h" -//#include "torchg800.h" +//#include "graduate.h" #include "beebsid.h" //#include "prisma3.h" +#include "cfa3000opt.h" SLOT_INTERFACE_START(bbc_1mhzbus_devices) -// SLOT_INTERFACE("teletext", BBC_TELETEXT) /* Acorn ANE01 Teletext Adapter */ -// SLOT_INTERFACE("ieee488", BBC_IEEE488) /* Acorn ANK01 IEEE488 Interface */ -// SLOT_INTERFACE("music500", BBC_MUSIC500) /* Acorn ANV02 Music500 */ -// SLOT_INTERFACE("music2000", BBC_MUSIC2000) /* Hybrid Music 2000 MIDI Interface */ -// SLOT_INTERFACE("music3000", BBC_MUSIC3000) /* Hybrid Music 3000 Expander */ -// SLOT_INTERFACE("music5000", BBC_MUSIC5000) /* Hybrid Music 5000 Synthesiser */ -// SLOT_INTERFACE("multiform", BBC_MULTIFORM) /* Technomatic Multiform Z80 */ - SLOT_INTERFACE("opus3", BBC_OPUS3) /* Opus Challenger 3 */ -// SLOT_INTERFACE("ramdisc", BBC_RAMDISC) /* Morley Electronics RAM Disc */ -// SLOT_INTERFACE("torchg400", BBC_TORCHG400) /* Torch Graduate G400 */ -// SLOT_INTERFACE("torchg800", BBC_TORCHG800) /* Torch Graduate G800 */ - SLOT_INTERFACE("beebsid", BBC_BEEBSID) /* BeebSID */ -// SLOT_INTERFACE("prisma3", BBC_PRISMA3) /* Prisma 3 - Millipede 1989 */ +// SLOT_INTERFACE("teletext", BBC_TELETEXT) /* Acorn ANE01 Teletext Adapter */ +// SLOT_INTERFACE("ieee488", BBC_IEEE488) /* Acorn ANK01 IEEE488 Interface */ +// SLOT_INTERFACE("m500", BBC_M500) /* Acorn ANV02 Music 500 */ +// SLOT_INTERFACE("m2000", BBC_M2000) /* Hybrid Music 2000 MIDI Interface */ +// SLOT_INTERFACE("m3000", BBC_M3000) /* Hybrid Music 3000 Expander */ +// SLOT_INTERFACE("m5000", BBC_M5000) /* Hybrid Music 5000 Synthesiser */ +// SLOT_INTERFACE("multiform", BBC_MULTIFORM) /* Technomatic Multiform Z80 */ + SLOT_INTERFACE("opus3", BBC_OPUS3) /* Opus Challenger 3 */ +// SLOT_INTERFACE("ramdisc", BBC_RAMDISC) /* Morley Electronics RAM Disc */ +// SLOT_INTERFACE("graduate", BBC_GRADUATE) /* The Torch Graduate G400/G800 */ + SLOT_INTERFACE("beebsid", BBC_BEEBSID) /* BeebSID */ +// SLOT_INTERFACE("prisma3", BBC_PRISMA3) /* PRISMA-3 - Millipede 1989 */ + SLOT_INTERFACE("cfa3000opt", CFA3000_OPT) /* Henson CFA 3000 Option Board */ SLOT_INTERFACE_END diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h index a05d3d7eb12..3c6527a0adc 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h @@ -14,7 +14,7 @@ 0V 7 8 NIRQ 0V 9 10 NPGFC 0V 11 12 NPGFD - 0V 13 14 RST + 0V 13 14 NRST 0V 15 16 Analog In 0V 17 18 D0 D1 19 20 D2 @@ -128,6 +128,7 @@ public: template static devcb_base &set_nmi_handler(device_t &device, Object &&cb) { return downcast(device).m_nmi_handler.set_callback(std::forward(cb)); } + DECLARE_WRITE_LINE_MEMBER( rst_w ); DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); } DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); } @@ -152,6 +153,8 @@ public: // construction/destruction virtual ~device_bbc_1mhzbus_interface(); + virtual DECLARE_WRITE_LINE_MEMBER(rst_w) { } + protected: device_bbc_1mhzbus_interface(const machine_config &mconfig, device_t &device); diff --git a/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp b/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp new file mode 100644 index 00000000000..63f2229b27a --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/cfa3000opt.cpp @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA 3000 Option Board + +**********************************************************************/ + + +#include "emu.h" +#include "cfa3000opt.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(CFA3000_OPT, cfa3000_opt_device, "cfa3000opt", "Henson CFA 3000 Option Board") + + +//------------------------------------------------- +// INPUT_PORTS( cfa3000opt ) +//------------------------------------------------- + +static INPUT_PORTS_START( cfa3000opt ) + PORT_START("OPT") + PORT_DIPNAME(0x80, 0x00, "Switch 1") PORT_DIPLOCATION("Option:1") + PORT_DIPSETTING(0x80, "not used") + PORT_DIPSETTING(0x00, "not used") + + PORT_DIPNAME(0x40, 0x00, "Switch 2") PORT_DIPLOCATION("Option:2") + PORT_DIPSETTING(0x40, "not used") + PORT_DIPSETTING(0x00, "not used") + + PORT_DIPNAME(0x20, 0x00, "Switch 3") PORT_DIPLOCATION("Option:3") + PORT_DIPSETTING(0x20, "Auto Send") + PORT_DIPSETTING(0x00, "Request Send") + + PORT_DIPNAME(0x10, 0x00, "Switch 4") PORT_DIPLOCATION("Option:4") + PORT_DIPSETTING(0x10, "repeat >4db") + PORT_DIPSETTING(0x00, "do not repeat >4db") + + PORT_DIPNAME(0x08, 0x00, "Switch 5") PORT_DIPLOCATION("Option:5") + PORT_DIPSETTING(0x08, "est. fluct.") + PORT_DIPSETTING(0x00, "do not est. fluct.") + + PORT_DIPNAME(0x04, 0x00, "Switch 6") PORT_DIPLOCATION("Option:6") + PORT_DIPSETTING(0x04, "Full Threshold") + PORT_DIPSETTING(0x00, "Supra Threshold") + + PORT_DIPNAME(0x02, 0x00, "Switch 7") PORT_DIPLOCATION("Option:7") + PORT_DIPSETTING(0x02, "db") + PORT_DIPSETTING(0x00, "log units") + + PORT_DIPNAME(0x01, 0x00, "Switch 8") PORT_DIPLOCATION("Option:8") + PORT_DIPSETTING(0x01, "2nd level") + PORT_DIPSETTING(0x00, "1st level") +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor cfa3000_opt_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( cfa3000opt ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// cfa3000_opt_device - constructor +//------------------------------------------------- + +cfa3000_opt_device::cfa3000_opt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CFA3000_OPT, tag, owner, clock), + device_bbc_1mhzbus_interface(mconfig, *this), + m_opt(*this, "OPT") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void cfa3000_opt_device::device_start() +{ + address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); + m_slot = dynamic_cast(owner()); + + space.install_read_handler(0xfcc2, 0xfcc2, read8_delegate(FUNC(cfa3000_opt_device::option_r), this)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void cfa3000_opt_device::device_reset() +{ +} + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +READ8_MEMBER(cfa3000_opt_device::option_r) +{ + return m_opt->read(); +} diff --git a/src/devices/bus/bbc/1mhzbus/cfa3000opt.h b/src/devices/bus/bbc/1mhzbus/cfa3000opt.h new file mode 100644 index 00000000000..e372a14b51b --- /dev/null +++ b/src/devices/bus/bbc/1mhzbus/cfa3000opt.h @@ -0,0 +1,50 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA 3000 Option Board + +**********************************************************************/ + +#ifndef MAME_BUS_BBC_1MHZBUS_CFA3000OPT_H +#define MAME_BUS_BBC_1MHZBUS_CFA3000OPT_H + +#pragma once + +#include "1mhzbus.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> cfa3000_opt_device + +class cfa3000_opt_device : + public device_t, + public device_bbc_1mhzbus_interface +{ +public: + // construction/destruction + cfa3000_opt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + DECLARE_READ8_MEMBER(option_r); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + +private: + required_ioport m_opt; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(CFA3000_OPT, cfa3000_opt_device) + + +#endif // MAME_BUS_BBC_1MHZBUS_CFA3000OPT_H diff --git a/src/devices/bus/bbc/analogue/analogue.cpp b/src/devices/bus/bbc/analogue/analogue.cpp index 5d7f4497d67..24f2707e8f5 100644 --- a/src/devices/bus/bbc/analogue/analogue.cpp +++ b/src/devices/bus/bbc/analogue/analogue.cpp @@ -103,10 +103,12 @@ void bbc_analogue_slot_device::device_reset() // slot devices #include "joystick.h" //#include "quinkey.h" +#include "cfa3000a.h" SLOT_INTERFACE_START( bbc_analogue_devices ) SLOT_INTERFACE("acornjoy", BBC_ACORNJOY) /* Acorn ANH01 Joysticks */ SLOT_INTERFACE("voltmace3b", BBC_VOLTMACE3B) /* Voltmace Delta 3b "Twin" Joysticks */ // SLOT_INTERFACE("quinkey", BBC_QUINKEY) /* Microwriter Quinkey */ + SLOT_INTERFACE("cfa3000a", CFA3000_ANLG) /* Hanson CFA 3000 Analogue */ SLOT_INTERFACE_END diff --git a/src/devices/bus/bbc/analogue/cfa3000a.cpp b/src/devices/bus/bbc/analogue/cfa3000a.cpp new file mode 100644 index 00000000000..da163200c2c --- /dev/null +++ b/src/devices/bus/bbc/analogue/cfa3000a.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA 3000 Analogue + +**********************************************************************/ + + +#include "emu.h" +#include "cfa3000a.h" + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(CFA3000_ANLG, cfa3000_anlg_device, "cfa3000a", "Henson CFA 3000 Analogue") + + +//------------------------------------------------- +// INPUT_PORTS( cfa3000a ) +//------------------------------------------------- + +static INPUT_PORTS_START( cfa3000a ) + PORT_START("CHANNEL0") + PORT_BIT(0xff, 0x80, IPT_PADDLE) PORT_NAME("Background Intensity") PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_REVERSE + + PORT_START("CHANNEL1") + PORT_BIT(0xff, 0x00, IPT_UNKNOWN) + + PORT_START("CHANNEL2") + PORT_BIT(0xff, 0x80, IPT_PADDLE) PORT_NAME("Age") PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_REVERSE + + PORT_START("CHANNEL3") + PORT_BIT(0xff, 0x00, IPT_UNKNOWN) + + PORT_START("BUTTONS") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor cfa3000_anlg_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( cfa3000a ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// cfa3000_anlg_device - constructor +//------------------------------------------------- + +cfa3000_anlg_device::cfa3000_anlg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CFA3000_ANLG, tag, owner, clock), + device_bbc_analogue_interface(mconfig, *this), + m_channel(*this, "CHANNEL%u", 0), + m_buttons(*this, "BUTTONS") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void cfa3000_anlg_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void cfa3000_anlg_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +uint8_t cfa3000_anlg_device::ch_r(int channel) +{ + return m_channel[channel]->read(); +} + +uint8_t cfa3000_anlg_device::pb_r() +{ + return m_buttons->read(); +} diff --git a/src/devices/bus/bbc/analogue/cfa3000a.h b/src/devices/bus/bbc/analogue/cfa3000a.h new file mode 100644 index 00000000000..8948ca586be --- /dev/null +++ b/src/devices/bus/bbc/analogue/cfa3000a.h @@ -0,0 +1,52 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA3000 Analogue + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_ANALOGUE_CFA3000A_H +#define MAME_BUS_BBC_ANALOGUE_CFA3000A_H + +#pragma once + +#include "analogue.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> cfa3000_anlg_device + +class cfa3000_anlg_device : + public device_t, + public device_bbc_analogue_interface +{ +public: + // construction/destruction + cfa3000_anlg_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; + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + + virtual uint8_t ch_r(int channel) override; + virtual uint8_t pb_r() override; + +private: + required_ioport_array<4> m_channel; + required_ioport m_buttons; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(CFA3000_ANLG, cfa3000_anlg_device) + + +#endif // MAME_BUS_BBC_ANALOGUE_CFA3000A_H diff --git a/src/devices/bus/bbc/userport/cfa3000kbd.cpp b/src/devices/bus/bbc/userport/cfa3000kbd.cpp new file mode 100644 index 00000000000..d07d7b6dd2f --- /dev/null +++ b/src/devices/bus/bbc/userport/cfa3000kbd.cpp @@ -0,0 +1,141 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA 3000 Keyboard + + 240 Pattern Right 0000 + 241 Pattern Left 0001 + 242 Patient Response 0010 + 243 Present Stimuli 0011 + + 244 Up 0100 + 245 Down 0101 + 246 Left 0110 + 247 Right 0111 + + 248 D 1000 + 249 C 1001 + 250 B 1010 + 251 A 1011 + + 252 Mode 1100 + 253 Erase 1101 + 254 Restart 1110 + 255 Print 1111 + +**********************************************************************/ + + +#include "emu.h" +#include "cfa3000kbd.h" + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(CFA3000_KBD, cfa3000_kbd_device, "cfa3000kbd", "Henson CFA 3000 Keyboard") + + +//------------------------------------------------- +// INPUT_PORTS( cfa3000kbd ) +//------------------------------------------------- + +static INPUT_PORTS_START( cfa3000kbd ) + PORT_START("KBD.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Pattern ->") PORT_CODE(KEYCODE_STOP) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Pattern <-") PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Patient Response") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Present Stimuli") PORT_CODE(KEYCODE_S) + PORT_START("KBD.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left/Menu") PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right/Extend") PORT_CODE(KEYCODE_RIGHT) + PORT_START("KBD.2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) + PORT_START("KBD.3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Mode") PORT_CODE(KEYCODE_M) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Erase") PORT_CODE(KEYCODE_E) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Restart") PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Print") PORT_CODE(KEYCODE_P) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor cfa3000_kbd_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( cfa3000kbd ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// cfa3000_kbd_device - constructor +//------------------------------------------------- + +cfa3000_kbd_device::cfa3000_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, CFA3000_KBD, tag, owner, clock), + device_bbc_userport_interface(mconfig, *this), + m_kbd(*this, "KBD.%u", 0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void cfa3000_kbd_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void cfa3000_kbd_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +READ8_MEMBER(cfa3000_kbd_device::pb_r) +{ + uint8_t data = 0x00; + + if (m_kbd[0]->read()) + { + data = m_kbd[0]->read() >> 1; + data = 0xf0 | (BIT(data, 2) ? 0x03 : data); + } + if (m_kbd[1]->read()) + { + data = m_kbd[1]->read() >> 1; + data = 0xf4 | (BIT(data, 2) ? 0x03 : data); + } + if (m_kbd[2]->read()) + { + data = m_kbd[2]->read() >> 1; + data = 0xf8 | (BIT(data, 2) ? 0x03 : data); + } + if (m_kbd[3]->read()) + { + data = m_kbd[3]->read() >> 1; + data = 0xfc | (BIT(data, 2) ? 0x03 : data); + } + return data; +} diff --git a/src/devices/bus/bbc/userport/cfa3000kbd.h b/src/devices/bus/bbc/userport/cfa3000kbd.h new file mode 100644 index 00000000000..2ece3cbf380 --- /dev/null +++ b/src/devices/bus/bbc/userport/cfa3000kbd.h @@ -0,0 +1,50 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************** + + Henson CFA 3000 Keyboard + +**********************************************************************/ + + +#ifndef MAME_BUS_BBC_USERPORT_CFA3000KBD_H +#define MAME_BUS_BBC_USERPORT_CFA3000KBD_H + +#pragma once + +#include "userport.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> cfa3000_kbd_device + +class cfa3000_kbd_device : + public device_t, + public device_bbc_userport_interface +{ +public: + // construction/destruction + cfa3000_kbd_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; + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + + virtual DECLARE_READ8_MEMBER(pb_r) override; + +private: + required_ioport_array<4> m_kbd; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(CFA3000_KBD, cfa3000_kbd_device) + + +#endif // MAME_BUS_BBC_USERPORT_CFA3000KBD_H diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp index 51591bbe85e..7df5c0e7f66 100644 --- a/src/devices/bus/bbc/userport/userport.cpp +++ b/src/devices/bus/bbc/userport/userport.cpp @@ -14,7 +14,7 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_device, "bbc_userport_slot", "BBC Micro User port") +DEFINE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_slot_device, "bbc_userport_slot", "BBC Micro User port") @@ -29,7 +29,7 @@ DEFINE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_device, "bbc_userport_slot", device_bbc_userport_interface::device_bbc_userport_interface(const machine_config &mconfig, device_t &device) : device_slot_card_interface(mconfig, device) { - m_slot = dynamic_cast(device.owner()); + m_slot = dynamic_cast(device.owner()); } @@ -51,38 +51,61 @@ device_bbc_userport_interface::~device_bbc_userport_interface() // bbc_userport_slot_device - constructor //------------------------------------------------- -bbc_userport_device::bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : +bbc_userport_slot_device::bbc_userport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_USERPORT_SLOT, tag, owner, clock), - device_slot_interface(mconfig, *this), m_device(nullptr) + device_slot_interface(mconfig, *this), + m_device(nullptr), + m_cb1_handler(*this), + m_cb2_handler(*this) { } + //------------------------------------------------- -// ~bbc_userport_slot_device - destructor +// device_start - device-specific startup //------------------------------------------------- -//bbc_userport_device::~bbc_userport_device() -//{ -//} +void bbc_userport_slot_device::device_start() +{ + m_device = dynamic_cast(get_card_device()); + + // resolve callbacks + m_cb1_handler.resolve_safe(); + m_cb2_handler.resolve_safe(); +} //------------------------------------------------- -// device_start - device-specific startup +// device_reset - device-specific reset //------------------------------------------------- -void bbc_userport_device::device_start() +void bbc_userport_slot_device::device_reset() { - m_device = dynamic_cast(get_card_device()); } -uint8_t bbc_userport_device::read_portb() +//------------------------------------------------- +// pb_r +//------------------------------------------------- + +READ8_MEMBER(bbc_userport_slot_device::pb_r) +{ + if (m_device) + return m_device->pb_r(space, 0); + else + return 0xff; +} + + +//------------------------------------------------- +// pb_w +//------------------------------------------------- + +WRITE8_MEMBER(bbc_userport_slot_device::pb_w) { - uint8_t data = 0xff; if (m_device) - data |= m_device->read_portb(); - return data; + m_device->pb_w(space, 0, data); } @@ -92,12 +115,14 @@ uint8_t bbc_userport_device::read_portb() // slot devices -//#include "amxmouse.h" -//#include "tracker.h" +//#include "mouse.h" +#include "cfa3000kbd.h" SLOT_INTERFACE_START( bbc_userport_devices ) -// SLOT_INTERFACE("amxmouse", BBC_AMXMOUSE) /* AMX Mouse */ -// SLOT_INTERFACE("tracker", BBC_TRACKER) /* Acorn Tracker Ball */ +// SLOT_INTERFACE("amxmouse", BBC_AMXMOUSE) /* AMX Mouse */ +// SLOT_INTERFACE("m512mouse", BBC_M512MOUSE) /* Acorn Mouse (provided with Master 512) */ +// SLOT_INTERFACE("tracker", BBC_TRACKER) /* Marconi RB2 Tracker Ball / Acorn Tracker Ball */ // SLOT_INTERFACE("music4000", BBC_MUSIC4000) /* Hybrid Music 4000 Keyboard */ + SLOT_INTERFACE("cfa3000kbd", CFA3000_KBD) /* Henson CFA 3000 Keyboard */ SLOT_INTERFACE_END diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h index 0db9464af32..632ad412f63 100644 --- a/src/devices/bus/bbc/userport/userport.h +++ b/src/devices/bus/bbc/userport/userport.h @@ -31,70 +31,81 @@ #pragma once + //************************************************************************** -// TYPE DEFINITIONS +// INTERFACE CONFIGURATION MACROS //************************************************************************** -class bbc_userport_device; +#define MCFG_BBC_USERPORT_SLOT_ADD(_tag, _slot_intf, _def_slot) \ + MCFG_DEVICE_ADD(_tag, BBC_USERPORT_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) -// ======================> device_bbc_userport_interface +#define MCFG_BBC_USERPORT_CB1_HANDLER(_devcb) \ + devcb = &bbc_userport_slot_device::set_cb1_handler(*device, DEVCB_##_devcb); -class device_bbc_userport_interface : public device_slot_card_interface -{ -public: - // construction/destruction - virtual ~device_bbc_userport_interface(); +#define MCFG_BBC_USERPORT_CB2_HANDLER(_devcb) \ + devcb = &bbc_userport_slot_device::set_cb2_handler(*device, DEVCB_##_devcb); - virtual uint8_t read_portb() { return 0xff; }; - virtual uint8_t read_cb1() { return 0xff; }; - virtual uint8_t read_cb2() { return 0xff; }; +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** -protected: - device_bbc_userport_interface(const machine_config &mconfig, device_t &device); - bbc_userport_device *m_slot; -}; +// ======================> bbc_userport_slot_device -// ======================> bbc_userport_device +class device_bbc_userport_interface; -class bbc_userport_device : public device_t, - public device_slot_interface +class bbc_userport_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + bbc_userport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // callbacks + template static devcb_base &set_cb1_handler(device_t &device, Object &&cb) + { return downcast(device).m_cb1_handler.set_callback(std::forward(cb)); } + template static devcb_base &set_cb2_handler(device_t &device, Object &&cb) + { return downcast(device).m_cb2_handler.set_callback(std::forward(cb)); } - uint8_t read_portb(); - uint8_t read_cb1(); - uint8_t read_cb2(); + DECLARE_WRITE_LINE_MEMBER(cb1_w) { m_cb1_handler(state); } + DECLARE_WRITE_LINE_MEMBER(cb2_w) { m_cb2_handler(state); } + DECLARE_READ8_MEMBER(pb_r); + DECLARE_WRITE8_MEMBER(pb_w); + +protected: // device-level overrides virtual void device_start() override; + virtual void device_reset() override; -protected: device_bbc_userport_interface *m_device; + +private: + devcb_write_line m_cb1_handler; + devcb_write_line m_cb2_handler; }; -// device type definition -DECLARE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_device) +// ======================> device_bbc_userport_interface -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** +class device_bbc_userport_interface : public device_slot_card_interface +{ +public: + // construction/destruction + virtual ~device_bbc_userport_interface(); -#define MCFG_BBC_USERPORT_SLOT_ADD(_tag, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, BBC_USERPORT_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + virtual DECLARE_READ8_MEMBER(pb_r) { return 0xff; } + virtual DECLARE_WRITE8_MEMBER(pb_w) { } -#define MCFG_BBC_USERPORT_PB_HANDLER(_devcb) \ - devcb = &bbc_userport_device::set_pb_handler(*device, DEVCB_##_devcb); +protected: + device_bbc_userport_interface(const machine_config &mconfig, device_t &device); -#define MCFG_BBC_USERPORT_CB1_HANDLER(_devcb) \ - devcb = &bbc_userport_device::set_cb1_handler(*device, DEVCB_##_devcb); + bbc_userport_slot_device *m_slot; +}; -#define MCFG_BBC_USERPORT_CB2_HANDLER(_devcb) \ - devcb = &bbc_userport_device::set_cb2_handler(*device, DEVCB_##_devcb); + +// device type definition +DECLARE_DEVICE_TYPE(BBC_USERPORT_SLOT, bbc_userport_slot_device) SLOT_INTERFACE_EXTERN( bbc_userport_devices ); diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp index b9def522eb2..9189ad64654 100644 --- a/src/mame/drivers/bbc.cpp +++ b/src/mame/drivers/bbc.cpp @@ -962,12 +962,12 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* user via */ - MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_16MHz / 16) - MCFG_VIA6522_READPB_HANDLER(READ8(bbc_state, bbcb_via_user_read_portb)) - MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) - MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_user_write_portb)) - MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) - MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<2>)) + MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_16MHz / 16) + MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) + MCFG_VIA6522_READPB_HANDLER(DEVREAD8("userport", bbc_userport_slot_device, pb_r)) + MCFG_VIA6522_WRITEPB_HANDLER(DEVWRITE8("userport", bbc_userport_slot_device, pb_w)) + MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) + MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<2>)) /* adc */ MCFG_DEVICE_ADD("upd7002", UPD7002, 0) @@ -994,7 +994,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_ECONET_SLOT_ADD("econet254", 254, econet_devices, nullptr) /* analogue port */ - MCFG_BBC_ANALOGUE_SLOT_ADD("analogue", bbc_analogue_devices, "acornjoy") + MCFG_BBC_ANALOGUE_SLOT_ADD("analogue", bbc_analogue_devices, nullptr) /* 1mhz bus port */ MCFG_BBC_1MHZBUS_SLOT_ADD("1mhzbus", bbc_1mhzbus_devices, nullptr) @@ -1007,6 +1007,8 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) /* user port */ MCFG_BBC_USERPORT_SLOT_ADD("userport", bbc_userport_devices, nullptr) + MCFG_BBC_USERPORT_CB1_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_cb1)) + MCFG_BBC_USERPORT_CB2_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_cb2)) /* software lists */ MCFG_SOFTWARE_LIST_ADD("cass_ls_b", "bbcb_cass") @@ -1407,12 +1409,12 @@ static MACHINE_CONFIG_START( bbcm ) MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<1>)) /* user via */ - MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_16MHz / 16) - MCFG_VIA6522_READPB_HANDLER(READ8(bbc_state, bbcb_via_user_read_portb)) - MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) - MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_user_write_portb)) - MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) - MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<2>)) + MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_16MHz / 16) + MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) + MCFG_VIA6522_READPB_HANDLER(DEVREAD8("userport", bbc_userport_slot_device, pb_r)) + MCFG_VIA6522_WRITEPB_HANDLER(DEVWRITE8("userport", bbc_userport_slot_device, pb_w)) + MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) + MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("irqs", input_merger_device, in_w<2>)) /* fdc */ MCFG_WD1770_ADD("wd1770", XTAL_16MHz / 2) @@ -1449,6 +1451,8 @@ static MACHINE_CONFIG_START( bbcm ) /* user port */ MCFG_BBC_USERPORT_SLOT_ADD("userport", bbc_userport_devices, nullptr) + MCFG_BBC_USERPORT_CB1_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_cb1)) + MCFG_BBC_USERPORT_CB2_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_cb2)) MACHINE_CONFIG_END @@ -1537,6 +1541,26 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( cfa3000, bbcm ) + MCFG_MACHINE_START_OVERRIDE(bbc_state, cfa3000) + + /* fdc */ + MCFG_DEVICE_MODIFY("wd1770:0") + MCFG_DEVICE_SLOT_INTERFACE(bbc_floppies_525, nullptr, false) + MCFG_DEVICE_MODIFY("wd1770:1") + MCFG_DEVICE_SLOT_INTERFACE(bbc_floppies_525, nullptr, false) + + /* keyboard */ + MCFG_DEVICE_MODIFY("userport") + MCFG_SLOT_DEFAULT_OPTION("cfa3000kbd") + + /* option board */ + MCFG_DEVICE_MODIFY("1mhzbus") + MCFG_SLOT_DEFAULT_OPTION("cfa3000opt") + + /* analogue dials/sensors */ + MCFG_DEVICE_MODIFY("analogue") + MCFG_SLOT_DEFAULT_OPTION("cfa3000a") + /* software lists */ MCFG_SOFTWARE_LIST_REMOVE("cass_ls_m") MCFG_SOFTWARE_LIST_REMOVE("cass_ls_a") @@ -2305,8 +2329,8 @@ ROM_START(cfa3000) ROM_REGION(0x44000, "option", 0) /* ROM */ ROM_LOAD("CFA3000_3_4_Iss10.3.ic41", 0x10000, 0x08000, CRC(ecb385ab) SHA1(eafa9b34cb1cf63790f74332bb7d85ee356b6973)) ROM_LOAD("CFA3000_SM_Iss10.3.ic37", 0x18000, 0x08000, CRC(c07aee5f) SHA1(1994e3755dc15d1ea7e105bc19cd57893b719779)) - ROM_LOAD("Acorn_MOS_(Tinsley_64K)_Iss10.3.ic24", 0x30000, 0x10000, CRC(4413c3ee) SHA1(76d0462b4dabe2461010fce2341570ff3d606d54)) - //ROM_COPY("option", 0x20000, 0x30000, 0x10000) /* Mirror MOS */ + ROM_LOAD("Acorn_MOS_(Tinsley_64K)_Iss10.3.ic24", 0x20000, 0x10000, CRC(4413c3ee) SHA1(76d0462b4dabe2461010fce2341570ff3d606d54)) + ROM_COPY("option", 0x20000, 0x30000, 0x10000) /* Mirror MOS */ ROM_COPY("option", 0x30000, 0x40000, 0x04000) /* Move loaded roms into place */ ROM_FILL(0x30000, 0x4000, 0xff) /* 00000 rom 0 SK3 Rear Cartridge bottom 16K */ @@ -2317,13 +2341,13 @@ ROM_START(cfa3000) /* 14000 rom 5 IC41 SWRAM or top 16K */ /* 18000 rom 6 IC37 SWRAM or bottom 16K */ /* 1c000 rom 7 IC37 SWRAM or top 16K */ - /* 20000 rom 8 IC27 ANFS */ - /* 24000 rom 9 IC24 DFS + SRAM */ - /* 28000 rom 10 IC24 Viewsheet */ - /* 2c000 rom 11 IC24 Edit */ - /* 30000 rom 12 IC24 BASIC */ - /* 34000 rom 13 IC24 ADFS */ - /* 38000 rom 14 IC24 View + MOS code */ + /* 20000 rom 8 IC27 */ + /* 24000 rom 9 IC24 */ + /* 28000 rom 10 IC24 */ + /* 2c000 rom 11 IC24 */ + /* 30000 rom 12 IC24 */ + /* 34000 rom 13 IC24 DFS */ + /* 38000 rom 14 IC24 BASIC */ /* 3c000 rom 15 IC24 Terminal + Tube host + CFS */ ROM_REGION(0x4000, "os", 0) @@ -2368,4 +2392,4 @@ COMP ( 1987, pro128s, bbcmc, 0, pro128s, bbcm, bbc_state, bbc, //COMP ( 1988, discmon, bbcm, 0, discmon, bbcm, bbc_state, bbc, "Arbiter Leisure", "Arbiter Discmonitor A-01", MACHINE_NOT_WORKING) COMP ( 1988, discmate, bbcm, 0, discmate, bbcm, bbc_state, bbc, "Arbiter Leisure", "Arbiter Discmate A-02", MACHINE_NOT_WORKING) //COMP ( 1988, discmast, bbcm, 0, discmast, bbcm, bbc_state, bbc, "Arbiter Leisure", "Arbiter Discmaster A-03", MACHINE_NOT_WORKING) -COMP ( 1988, cfa3000, bbcm, 0, cfa3000, bbcm, bbc_state, bbc, "Tinsley Medical Instruments", "Henson CFA 3000", MACHINE_NOT_WORKING) +COMP ( 1989, cfa3000, bbcm, 0, cfa3000, bbcm, bbc_state, bbc, "Tinsley Medical Instruments", "Henson CFA 3000", MACHINE_NOT_WORKING) diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h index b0ad68e3697..7fdc56713b4 100644 --- a/src/mame/includes/bbc.h +++ b/src/mame/includes/bbc.h @@ -161,6 +161,7 @@ public: DECLARE_MACHINE_RESET(bbcmc); DECLARE_MACHINE_RESET(ltmpbp); DECLARE_MACHINE_RESET(ltmpm); + DECLARE_MACHINE_START(cfa3000); DECLARE_PALETTE_INIT(bbc); INTERRUPT_GEN_MEMBER(bbcb_vsync); @@ -278,6 +279,9 @@ public: // HACK FOR MC6845 int m_pagedRAM; // BBC B+ memory handling int m_vdusel; // BBC B+ memory handling + bool m_lk18_ic41_paged_rom; // BBC Master Paged ROM/RAM select IC41 + bool m_lk19_ic37_paged_rom; // BBC Master Paged ROM/RAM select IC37 + /* ACCCON diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index ab69a413c34..cc2d12a9dfa 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -346,6 +346,9 @@ WRITE8_MEMBER(bbc_state::page_selectbm_w) m_pagedRAM = (data & 0x80) >> 7; m_rombank = data & 0x0f; + if (m_lk19_ic37_paged_rom && (m_rombank == 4 || m_rombank == 5)) m_pagedRAM = 0; + if (m_lk18_ic41_paged_rom && (m_rombank == 6 || m_rombank == 7)) m_pagedRAM = 0; + if (m_pagedRAM) { m_bank4->set_entry(0x10); @@ -359,14 +362,12 @@ WRITE8_MEMBER(bbc_state::page_selectbm_w) } - WRITE8_MEMBER(bbc_state::bbc_memorybm1_w) { m_region_maincpu->base()[offset] = data; } - WRITE8_MEMBER(bbc_state::bbc_memorybm2_w) { uint8_t *RAM = m_region_maincpu->base(); @@ -387,11 +388,6 @@ WRITE8_MEMBER(bbc_state::bbc_memorybm2_w) } } -static const unsigned short bbc_master_sideways_ram_banks[16]= -{ - 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0 -}; - WRITE8_MEMBER(bbc_state::bbc_memorybm4_w) { @@ -401,7 +397,7 @@ WRITE8_MEMBER(bbc_state::bbc_memorybm4_w) } else { - if (bbc_master_sideways_ram_banks[m_rombank]) + if ((!m_lk18_ic41_paged_rom && (m_rombank == 6 || m_rombank == 7)) || (!m_lk19_ic37_paged_rom && (m_rombank == 4 || m_rombank == 5))) { m_region_opt->base()[offset+(m_rombank<<14)] = data; } @@ -411,9 +407,9 @@ WRITE8_MEMBER(bbc_state::bbc_memorybm4_w) WRITE8_MEMBER(bbc_state::bbc_memorybm5_w) { - if (bbc_master_sideways_ram_banks[m_rombank]) + if ((!m_lk18_ic41_paged_rom && (m_rombank == 6 || m_rombank == 7)) || (!m_lk19_ic37_paged_rom && (m_rombank == 4 || m_rombank == 5))) { - m_region_opt->base()[offset+(m_rombank<<14)+0x1000] = data; + m_region_opt->base()[offset+(m_rombank<<14) + 0x1000] = data; } } @@ -1759,6 +1755,9 @@ MACHINE_START_MEMBER(bbc_state, bbcm) m_machinetype = MASTER; m_mc6850_clock = 0; + m_lk18_ic41_paged_rom = false; /* Link set for RAM in slots 6 and 7 */ + m_lk19_ic37_paged_rom = false; /* Link set for RAM in slots 4 and 5 */ + bbcm_setup_banks(m_bank4, 16, 0, 0x1000); m_bank4->configure_entries(16, 1, m_region_maincpu->base() + 0x8000, 0x1000); // additional bank for paged ram bbcm_setup_banks(m_bank5, 16, 0x1000, 0x3000); @@ -1816,3 +1815,12 @@ MACHINE_RESET_MEMBER(bbc_state, ltmpm) m_Speech = 0; m_SWRAMtype = 0; } + + +MACHINE_START_MEMBER(bbc_state, cfa3000) +{ + MACHINE_START_CALL_MEMBER(bbcm); + + m_lk18_ic41_paged_rom = true; /* Link set for ROM in slots 6 and 7 */ + m_lk19_ic37_paged_rom = true; /* Link set for ROM in slots 4 and 5 */ +} -- cgit v1.2.3