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/ssp1601/ssp1601.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/ssp1601/ssp1601.cpp')
-rw-r--r-- | src/devices/cpu/ssp1601/ssp1601.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/devices/cpu/ssp1601/ssp1601.cpp b/src/devices/cpu/ssp1601/ssp1601.cpp index 8f449d6d6a9..79119b6a97a 100644 --- a/src/devices/cpu/ssp1601/ssp1601.cpp +++ b/src/devices/cpu/ssp1601/ssp1601.cpp @@ -45,8 +45,8 @@ #define PPC m_ppc.w.h -#define FETCH() m_cache->read_word(rPC++) -#define PROGRAM_WORD(a) m_program->read_word(a) +#define FETCH() m_cache.read_word(rPC++) +#define PROGRAM_WORD(a) m_program.read_word(a) #define GET_PPC_OFFS() PPC #define REG_READ(r) (((r) <= 4) ? m_gr[r].w.h : (this->*reg_read_handlers[r])(r)) @@ -241,13 +241,13 @@ void ssp1601_device::write_unknown(int reg, uint32_t d) uint32_t ssp1601_device::read_ext(int reg) { reg &= 7; - return m_io->read_word((reg << 1)); + return m_io.read_word((reg << 1)); } void ssp1601_device::write_ext(int reg, uint32_t d) { reg &= 7; - m_io->write_word((reg << 1), d); + m_io.write_word((reg << 1), d); } // 4 @@ -521,9 +521,9 @@ void ssp1601_device::device_start() m_g_cycles = 0; m_gr[0].w.h = 0xffff; // constant reg - 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); state_add( SSP_R0, "REG0", m_gr[0].w.h).formatstr("%04X"); state_add( SSP_X, "X", rX).formatstr("%04X"); |