summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2014-12-07 22:37:04 +0100
committer Olivier Galibert <galibert@pobox.com>2014-12-07 22:35:56 +0100
commit19df7acfc6cb8c656da790ad57279c31fc8ee88b (patch)
treeb62a5c6562d6ca9941791c6008370f28dda959b1
parent19f96fbb507019c350106ae2bd1c15c485b3480e (diff)
duhhhhhhhhhhhhhhhhhhhhhh (nw)
-rw-r--r--src/emu/machine/lpc-pit.c45
-rw-r--r--src/emu/machine/lpc-pit.h30
2 files changed, 75 insertions, 0 deletions
diff --git a/src/emu/machine/lpc-pit.c b/src/emu/machine/lpc-pit.c
new file mode 100644
index 00000000000..e7d2dffc934
--- /dev/null
+++ b/src/emu/machine/lpc-pit.c
@@ -0,0 +1,45 @@
+#include "lpc-pit.h"
+
+const device_type LPC_PIT = &device_creator<lpc_pit_device>;
+
+DEVICE_ADDRESS_MAP_START(map, 32, lpc_pit_device)
+ AM_RANGE(0x40, 0x43) AM_READWRITE8(status_r, access_w, 0x00ffffff)
+ AM_RANGE(0x40, 0x43) AM_WRITE8 ( control_w, 0xff000000)
+ AM_RANGE(0x50, 0x53) AM_READWRITE8(status_r, access_w, 0x00ffffff)
+ AM_RANGE(0x50, 0x53) AM_WRITE8 ( control_w, 0xff000000)
+ADDRESS_MAP_END
+
+lpc_pit_device::lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : lpc_device(mconfig, LPC_PIT, "LPC PIT", tag, owner, clock, "lpc_pit", __FILE__)
+{
+}
+
+void lpc_pit_device::map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
+ UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space)
+{
+ io_space->install_device(io_offset, io_window_end, *this, &lpc_pit_device::map);
+}
+
+void lpc_pit_device::device_start()
+{
+}
+
+void lpc_pit_device::device_reset()
+{
+}
+
+READ8_MEMBER( lpc_pit_device::status_r)
+{
+ logerror("%s: status_r %d\n", tag(), offset);
+ return 0xff;
+}
+
+WRITE8_MEMBER(lpc_pit_device::access_w)
+{
+ logerror("%s: access_w %d, %02x\n", tag(), offset, data);
+}
+
+WRITE8_MEMBER(lpc_pit_device::control_w)
+{
+ logerror("%s: control_w %02x\n", tag(), data);
+}
diff --git a/src/emu/machine/lpc-pit.h b/src/emu/machine/lpc-pit.h
new file mode 100644
index 00000000000..f6592864fa8
--- /dev/null
+++ b/src/emu/machine/lpc-pit.h
@@ -0,0 +1,30 @@
+#ifndef LPC_PIT_H
+#define LPC_PIT_H
+
+#include "lpc.h"
+
+#define MCFG_LPC_PIT_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, LPC_PIT, 0)
+
+class lpc_pit_device : public lpc_device {
+public:
+ lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
+ UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space);
+
+ DECLARE_READ8_MEMBER( status_r);
+ DECLARE_WRITE8_MEMBER(access_w);
+ DECLARE_WRITE8_MEMBER(control_w);
+
+protected:
+ void device_start();
+ void device_reset();
+
+private:
+ DECLARE_ADDRESS_MAP(map, 32);
+};
+
+extern const device_type LPC_PIT;
+
+#endif