summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/adb/adbhle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/adb/adbhle.cpp')
-rw-r--r--src/devices/bus/adb/adbhle.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/devices/bus/adb/adbhle.cpp b/src/devices/bus/adb/adbhle.cpp
new file mode 100644
index 00000000000..369595ef143
--- /dev/null
+++ b/src/devices/bus/adb/adbhle.cpp
@@ -0,0 +1,45 @@
+// license:BSD-3-Clause
+// copyright-holders: Olivier Galibert
+
+// ADB - Apple Desktop Bus
+//
+// Generic HLE
+
+#include "emu.h"
+#include "adbhle.h"
+
+DEFINE_DEVICE_TYPE(ADB_HLE, adb_hle_device, "adbhle", "ADB HLE")
+
+adb_hle_device::adb_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ adb_device(mconfig, ADB_HLE, tag, owner, clock),
+ adb_slot_card_interface(mconfig, *this, DEVICE_SELF)
+{
+}
+
+void adb_hle_device::device_start()
+{
+ adb_device::device_start();
+
+ save_item(NAME(m_last_state));
+ save_item(NAME(m_last_state_time));
+}
+
+void adb_hle_device::device_reset()
+{
+ adb_device::device_reset();
+ m_last_state = true;
+ m_last_state_time = machine().time();
+}
+
+void adb_hle_device::adb_w(int state)
+{
+ if(m_last_state != state) {
+ attotime delta = machine().time() - m_last_state_time;
+ u32 dt = delta.as_ticks(1000000);
+
+ logerror("level %d duration %6d us\n", m_last_state, dt);
+
+ m_last_state = state;
+ m_last_state_time = machine().time();
+ }
+}