summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/tanbus/etirtc.cpp
diff options
context:
space:
mode:
author Nigel Barnes <ngbarnes@gmail.com>2022-12-11 22:16:32 +0000
committer Nigel Barnes <ngbarnes@gmail.com>2022-12-11 22:16:32 +0000
commite3c1dc11fcd7ff065ae8aa8c7601ad00b4a0f669 (patch)
treec4b54237d9c01cf4f8bca77c8876282dd0de76e8 /src/devices/bus/tanbus/etirtc.cpp
parentd363f6336a6e076975771da4d8eab869ad50a93c (diff)
mt65: Slotified the keyboard port, devicified Microtan Keypad (MT006), Microtan Keyboard (MT009), and ETI Space Invasion Key Unit.
- Added cards ETI Real Time Clock, ETI Sound Card, Microtanic Real Time Clock, TUG Combo Card, and TUG EPROM Storage Card. mt6809: Fixed keyboard input, RALBUG commands now work, and promoted to working. - Added support for FLEX and BBC Micro floppy formats. spinveti: Replaced incorrect ROM to load at &F800.
Diffstat (limited to 'src/devices/bus/tanbus/etirtc.cpp')
-rw-r--r--src/devices/bus/tanbus/etirtc.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/devices/bus/tanbus/etirtc.cpp b/src/devices/bus/tanbus/etirtc.cpp
new file mode 100644
index 00000000000..9875858bd44
--- /dev/null
+++ b/src/devices/bus/tanbus/etirtc.cpp
@@ -0,0 +1,88 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ ETI Real Time Clock/Calendar
+
+ http://www.microtan.ukpc.net/pageProducts.html#CLOCK
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "etirtc.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(TANBUS_ETIRTC, tanbus_etirtc_device, "tanbus_etirtc", "Microtan ETI Real Time Clock")
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void tanbus_etirtc_device::device_add_mconfig(machine_config &config)
+{
+ MM58174(config, "rtc", 32.768_kHz_XTAL);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// tanbus_etirtc_device - constructor
+//-------------------------------------------------
+
+tanbus_etirtc_device::tanbus_etirtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, TANBUS_ETIRTC, tag, owner, clock)
+ , device_tanbus_interface(mconfig, *this)
+ , m_rtc(*this, "rtc")
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tanbus_etirtc_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - card read
+//-------------------------------------------------
+
+uint8_t tanbus_etirtc_device::read(offs_t offset, int inhrom, int inhram, int be)
+{
+ uint8_t data = 0xff;
+
+ switch (offset & 0xfff0)
+ {
+ case 0xbc00:
+ data = m_rtc->read(offset);
+ break;
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// write - card write
+//-------------------------------------------------
+
+void tanbus_etirtc_device::write(offs_t offset, uint8_t data, int inhrom, int inhram, int be)
+{
+ switch (offset & 0xfff0)
+ {
+ case 0xbc00:
+ m_rtc->write(offset, data);
+ break;
+ }
+}