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/upd78k/upd78k2.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/upd78k/upd78k2.cpp')
-rw-r--r-- | src/devices/cpu/upd78k/upd78k2.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/devices/cpu/upd78k/upd78k2.cpp b/src/devices/cpu/upd78k/upd78k2.cpp index 823bc438883..91f25b29618 100644 --- a/src/devices/cpu/upd78k/upd78k2.cpp +++ b/src/devices/cpu/upd78k/upd78k2.cpp @@ -30,10 +30,6 @@ upd78k2_device::upd78k2_device(const machine_config &mconfig, device_type type, , m_iram_config("IRAM", ENDIANNESS_LITTLE, 16, iram_bits, 0, address_map_constructor(FUNC(upd78k2_device::iram_map), this)) , m_sfr_config("SFR", ENDIANNESS_LITTLE, 16, 8, 0, sfr_map) , m_iram_addrmask((offs_t(1) << iram_bits) - 1) - , m_program_space(nullptr) - , m_program_cache(nullptr) - , m_iram_cache(nullptr) - , m_sfr_space(nullptr) , m_pc(0) , m_ppc(0) , m_psw(0) @@ -86,10 +82,10 @@ inline u8 upd78k2_device::register_base() const noexcept void upd78k2_device::device_start() { // get address spaces and access caches - m_program_space = &space(AS_PROGRAM); - m_program_cache = m_program_space->cache<0, 0, ENDIANNESS_LITTLE>(); - m_iram_cache = space(AS_DATA).cache<1, 0, ENDIANNESS_LITTLE>(); - m_sfr_space = &space(AS_IO); + space(AS_PROGRAM).specific(m_program_space); + space(AS_PROGRAM).cache(m_program_cache); + space(AS_DATA).cache(m_iram_cache); + space(AS_IO).specific(m_sfr_space); set_icountptr(m_icount); @@ -141,7 +137,7 @@ void upd78k2_device::device_reset() void upd78k2_device::execute_run() { - m_pc = m_program_cache->read_word(0); + m_pc = m_program_cache.read_word(0); m_ppc = m_pc; debugger_instruction_hook(m_pc); |