summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/upd78k/upd78k0.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/upd78k/upd78k0.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/upd78k/upd78k0.cpp')
-rw-r--r--src/devices/cpu/upd78k/upd78k0.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/devices/cpu/upd78k/upd78k0.cpp b/src/devices/cpu/upd78k/upd78k0.cpp
index ff87be3553c..6af06e02685 100644
--- a/src/devices/cpu/upd78k/upd78k0.cpp
+++ b/src/devices/cpu/upd78k/upd78k0.cpp
@@ -30,10 +30,6 @@ upd78k0_device::upd78k0_device(const machine_config &mconfig, device_type type,
address_map_constructor(FUNC(upd78k0_device::iram_map), this))
, m_sfr_config("SFR", ENDIANNESS_LITTLE, 16, 8, 0, sfr_map)
, m_iram_size(iram_size)
- , m_program_space(nullptr)
- , m_program_cache(nullptr)
- , m_iram_cache(nullptr)
- , m_sfr_space(nullptr)
, m_subclock(0)
, m_pc(0)
, m_ppc(0)
@@ -103,10 +99,10 @@ inline u16 upd78k0_device::debug_register_base() const noexcept
void upd78k0_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);
@@ -158,7 +154,7 @@ void upd78k0_device::device_reset()
void upd78k0_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);