summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/ccpu/ccpu.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:42 +0200
committer Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:57 +0200
commit22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch)
tree3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/ccpu/ccpu.cpp
parente42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (diff)
emumem: A little more speedup. cache and specific change syntax, and are not pointers anymore [O. Galibert]
The last(?) two changes are: - Add a template parameter to everything (theoretically the address space width, in practice a level derived from it to keep as much compatibility between widths as possible) so that the shift size becomes a constant. - Change the syntax of declaring and initializing the caches and specifics so that they're embedded in the owner device. Solves lifetime issues and also removes one indirection (looking up the base dispatch pointer through the cache/specific pointer).
Diffstat (limited to 'src/devices/cpu/ccpu/ccpu.cpp')
-rw-r--r--src/devices/cpu/ccpu/ccpu.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/devices/cpu/ccpu/ccpu.cpp b/src/devices/cpu/ccpu/ccpu.cpp
index 52c235abc5c..55bba0dd96e 100644
--- a/src/devices/cpu/ccpu/ccpu.cpp
+++ b/src/devices/cpu/ccpu/ccpu.cpp
@@ -23,13 +23,13 @@ DEFINE_DEVICE_TYPE(CCPU, ccpu_cpu_device, "ccpu", "Cinematronics CPU")
MACROS
***************************************************************************/
-#define READOP(a) (m_cache->read_byte(a))
+#define READOP(a) (m_cache.read_byte(a))
-#define RDMEM(a) (m_data->read_word((a) & 0xfff))
-#define WRMEM(a,v) (m_data->write_word((a), (v)))
+#define RDMEM(a) (m_data.read_word((a) & 0xfff))
+#define WRMEM(a,v) (m_data.write_word((a), (v)))
-#define READPORT(a) (m_io->read_byte(a))
-#define WRITEPORT(a,v) (m_io->write_byte((a), (v)))
+#define READPORT(a) (m_io.read_byte(a))
+#define WRITEPORT(a,v) (m_io.write_byte((a), (v)))
#define SET_A0 do { m_a0flag = m_A; } while (0)
#define SET_CMP_VAL(x) do { m_cmpacc = *m_acc; m_cmpval = (x) & 0xfff; } while (0)
@@ -107,10 +107,10 @@ void ccpu_cpu_device::device_start()
m_vector_callback.resolve();
assert(!m_vector_callback.isnull());
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<0, 0, ENDIANNESS_BIG>();
- m_data = &space(AS_DATA);
- m_io = &space(AS_IO);
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
+ space(AS_DATA).specific(m_data);
+ space(AS_IO).specific(m_io);
save_item(NAME(m_PC));
save_item(NAME(m_A));