diff options
author | 2020-05-25 16:42:42 +0200 | |
---|---|---|
committer | 2020-05-25 16:42:57 +0200 | |
commit | 22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch) | |
tree | 3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/8x300/8x300.cpp | |
parent | e42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (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/8x300/8x300.cpp')
-rw-r--r-- | src/devices/cpu/8x300/8x300.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/cpu/8x300/8x300.cpp b/src/devices/cpu/8x300/8x300.cpp index a8a9b9dcdad..1b0aecfc4c4 100644 --- a/src/devices/cpu/8x300/8x300.cpp +++ b/src/devices/cpu/8x300/8x300.cpp @@ -14,10 +14,10 @@ #include "8x300dasm.h" #include "debugger.h" -#define FETCHOP(a) (m_cache->read_word(a)) +#define FETCHOP(a) (m_cache.read_word(a)) #define CYCLES(x) do { m_icount -= (x); } while (0) -#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 SRC ((opcode & 0x1f00) >> 8) #define DST (opcode & 0x001f) @@ -153,9 +153,9 @@ void n8x300_cpu_device::device_resolve_objects() void n8x300_cpu_device::device_start() { - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<1, -1, ENDIANNESS_BIG>(); - m_io = &space(AS_IO); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); + space(AS_IO).specific(m_io); save_item(NAME(m_PC)); save_item(NAME(m_AR)); |