summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m6809
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2016-10-21 18:29:25 +0100
committer smf- <smf-@users.noreply.github.com>2016-10-21 18:30:45 +0100
commit14a7a262c9274ca963f7549960f993929cb635fa (patch)
tree72f99d97dce27b10740a75fa3e174e34d609fb7c /src/devices/cpu/m6809
parent1243f834cb01d24a7abed683017f214e68c03eba (diff)
Sync pc & curpc, remove superfluous callimport()/callexport() on STATE_GENFLAGS (nw)
Diffstat (limited to 'src/devices/cpu/m6809')
-rw-r--r--src/devices/cpu/m6809/m6809.cpp26
-rw-r--r--src/devices/cpu/m6809/m6809.h3
2 files changed, 24 insertions, 5 deletions
diff --git a/src/devices/cpu/m6809/m6809.cpp b/src/devices/cpu/m6809/m6809.cpp
index 148015c3af4..693480cd940 100644
--- a/src/devices/cpu/m6809/m6809.cpp
+++ b/src/devices/cpu/m6809/m6809.cpp
@@ -139,10 +139,9 @@ void m6809_base_device::device_start()
m_lic_func.resolve_safe();
// register our state for the debugger
- state_add(STATE_GENPC, "GENPC", m_pc.w).noshow();
- state_add(STATE_GENPCBASE, "CURPC", m_ppc.w).noshow();
- state_add(STATE_GENFLAGS, "GENFLAGS", m_cc).callimport().callexport().formatstr("%8s").noshow();
- state_add(M6809_PC, "PC", m_pc.w).mask(0xffff);
+ state_add(STATE_GENPCBASE, "CURPC", m_ppc.w).callimport().noshow();
+ state_add(STATE_GENFLAGS, "CURFLAGS", m_cc).formatstr("%8s").noshow();
+ state_add(M6809_PC, "PC", m_pc.w).callimport().mask(0xffff);
state_add(M6809_S, "S", m_s.w).mask(0xffff);
state_add(M6809_CC, "CC", m_cc).mask(0xff);
state_add(M6809_DP, "DP", m_dp).mask(0xff);
@@ -305,6 +304,25 @@ const address_space_config *m6809_base_device::memory_space_config(address_space
//-------------------------------------------------
+// state_import - import state into the device,
+// after it has been set
+//-------------------------------------------------
+
+void m6809_base_device::state_import(const device_state_entry &entry)
+{
+ switch (entry.index())
+ {
+ case M6809_PC:
+ m_ppc.w = m_pc.w;
+ break;
+
+ case STATE_GENPCBASE:
+ m_pc.w = m_ppc.w;
+ break;
+ }
+}
+
+//-------------------------------------------------
// state_string_export - export state as a string
// for the debugger
//-------------------------------------------------
diff --git a/src/devices/cpu/m6809/m6809.h b/src/devices/cpu/m6809/m6809.h
index 8a2f5f9e400..d2124afc277 100644
--- a/src/devices/cpu/m6809/m6809.h
+++ b/src/devices/cpu/m6809/m6809.h
@@ -80,6 +80,7 @@ protected:
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override;
// device_state_interface overrides
+ virtual void state_import(const device_state_entry &entry) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
virtual bool is_6809() { return true; };
@@ -324,7 +325,7 @@ public:
enum
{
- M6809_PC=1, M6809_S, M6809_CC ,M6809_A, M6809_B, M6809_D, M6809_U, M6809_X, M6809_Y,
+ M6809_PC = STATE_GENPC, M6809_S = 0, M6809_CC ,M6809_A, M6809_B, M6809_D, M6809_U, M6809_X, M6809_Y,
M6809_DP
};