summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/pc9801_memsw.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/pc9801_memsw.h')
-rw-r--r--src/mame/machine/pc9801_memsw.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/mame/machine/pc9801_memsw.h b/src/mame/machine/pc9801_memsw.h
new file mode 100644
index 00000000000..22d4d568108
--- /dev/null
+++ b/src/mame/machine/pc9801_memsw.h
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Angelo Salese
+/***************************************************************************
+
+Template for skeleton device
+
+***************************************************************************/
+
+#ifndef MAME_MACHINE_PC9801_MEMSW_H
+#define MAME_MACHINE_PC9801_MEMSW_H
+
+#pragma once
+
+#include "machine/nvram.h"
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> pc9801_memsw_device
+
+class pc9801_memsw_device : public device_t,
+ public device_nvram_interface
+{
+public:
+ // construction/destruction
+ pc9801_memsw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ uint8_t read(uint8_t offset);
+ void write(uint8_t offset, uint8_t data);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void nvram_default() override;
+ virtual void nvram_read(emu_file &file) override;
+ virtual void nvram_write(emu_file &file) override;
+
+private:
+ uint8_t m_bram[0x10];
+ const uint8_t m_bram_size = 0x10;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(PC9801_MEMSW, pc9801_memsw_device)
+
+#endif // MAME_MACHINE_PC9801_MEMSW_H