summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/msx/msx_systemflags.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/msx/msx_systemflags.cpp')
-rw-r--r--src/mame/msx/msx_systemflags.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mame/msx/msx_systemflags.cpp b/src/mame/msx/msx_systemflags.cpp
new file mode 100644
index 00000000000..2c6ab4be7ce
--- /dev/null
+++ b/src/mame/msx/msx_systemflags.cpp
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Wilbert Pol
+#include "emu.h"
+#include "msx_systemflags.h"
+
+
+DEFINE_DEVICE_TYPE(MSX_SYSTEMFLAGS, msx_systemflags_device, "msx_systemflags", "MSX System Flags")
+
+
+msx_systemflags_device::msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, MSX_SYSTEMFLAGS, tag, owner, clock)
+ , m_initial_value(0xff)
+ , m_system_flags(0xff)
+ , m_maincpu(*this, finder_base::DUMMY_TAG)
+{
+}
+
+void msx_systemflags_device::device_start()
+{
+ m_system_flags = m_initial_value;
+
+ save_item(NAME(m_system_flags));
+
+ // Install IO read/write handlers
+ address_space &space = m_maincpu->space(AS_IO);
+ space.install_write_handler(0xf4, 0xf4, write8smo_delegate(*this, FUNC(msx_systemflags_device::write)));
+ space.install_read_handler(0xf4, 0xf4, read8smo_delegate(*this, FUNC(msx_systemflags_device::read)));
+}
+
+u8 msx_systemflags_device::read()
+{
+ return m_system_flags;
+}
+
+void msx_systemflags_device::write(u8 data)
+{
+ m_system_flags = data;
+}