summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m6800
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/m6800')
-rw-r--r--src/devices/cpu/m6800/m6800.cpp15
-rw-r--r--src/devices/cpu/m6800/m6800.h4
2 files changed, 9 insertions, 10 deletions
diff --git a/src/devices/cpu/m6800/m6800.cpp b/src/devices/cpu/m6800/m6800.cpp
index e6549dd8d27..7eab9292599 100644
--- a/src/devices/cpu/m6800/m6800.cpp
+++ b/src/devices/cpu/m6800/m6800.cpp
@@ -122,26 +122,26 @@ TODO:
/****************************************************************************/
/* Read a byte from given memory location */
/****************************************************************************/
-#define RM(Addr) ((unsigned)m_program->read_byte(Addr))
+#define RM(Addr) (m_program.read_byte(Addr))
/****************************************************************************/
/* Write a byte to given memory location */
/****************************************************************************/
-#define WM(Addr,Value) (m_program->write_byte(Addr,Value))
+#define WM(Addr,Value) (m_program.write_byte(Addr,Value))
/****************************************************************************/
/* M6800_RDOP() is identical to M6800_RDMEM() except it is used for reading */
/* opcodes. In case of system with memory mapped I/O, this function can be */
/* used to greatly speed up emulation */
/****************************************************************************/
-#define M_RDOP(Addr) ((unsigned)m_opcodes_cache->read_byte(Addr))
+#define M_RDOP(Addr) (m_copcodes.read_byte(Addr))
/****************************************************************************/
/* M6800_RDOP_ARG() is identical to M6800_RDOP() but it's used for reading */
/* opcode arguments. This difference can be used to support systems that */
/* use different encoding mechanisms for opcodes and opcode arguments */
/****************************************************************************/
-#define M_RDOP_ARG(Addr) ((unsigned)m_cache->read_byte(Addr))
+#define M_RDOP_ARG(Addr) (m_cprogram.read_byte(Addr))
/* macros to access memory */
#define IMMBYTE(b) b = M_RDOP_ARG(PCD); PC++
@@ -546,10 +546,9 @@ void m6800_cpu_device::EAT_CYCLES()
void m6800_cpu_device::device_start()
{
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<0, 0, ENDIANNESS_BIG>();
- m_opcodes = has_space(AS_OPCODES) ? &space(AS_OPCODES) : m_program;
- m_opcodes_cache = m_opcodes->cache<0, 0, ENDIANNESS_BIG>();
+ space(AS_PROGRAM).cache(m_cprogram);
+ space(has_space(AS_OPCODES) ? AS_OPCODES : AS_PROGRAM).cache(m_copcodes);
+ space(AS_PROGRAM).specific(m_program);
m_pc.d = 0;
m_s.d = 0;
diff --git a/src/devices/cpu/m6800/m6800.h b/src/devices/cpu/m6800/m6800.h
index 272b436a5f7..1601a62b798 100644
--- a/src/devices/cpu/m6800/m6800.h
+++ b/src/devices/cpu/m6800/m6800.h
@@ -82,8 +82,8 @@ protected:
uint8_t m_irq_state[3]; /* IRQ line state [IRQ1,TIN,SC1] */
/* Memory spaces */
- address_space *m_program, *m_opcodes;
- memory_access_cache<0, 0, ENDIANNESS_BIG> *m_cache, *m_opcodes_cache;
+ memory_access<16, 0, 0, ENDIANNESS_BIG>::cache m_cprogram, m_copcodes;
+ memory_access<16, 0, 0, ENDIANNESS_BIG>::specific m_program;
const op_func *m_insn;
const uint8_t *m_cycles; /* clock cycle of instruction table */