summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/userport/userport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/bbc/userport/userport.cpp')
-rw-r--r--src/devices/bus/bbc/userport/userport.cpp63
1 files changed, 44 insertions, 19 deletions
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<bbc_userport_device *>(device.owner());
+ m_slot = dynamic_cast<bbc_userport_slot_device *>(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<device_bbc_userport_interface *>(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<device_bbc_userport_interface *>(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