From 22513fb6fe281f5ccb75aaddb6417a12a66c313d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 25 May 2020 16:42:42 +0200 Subject: 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). --- src/devices/cpu/dsp56156/dsp56156.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/devices/cpu/dsp56156/dsp56156.cpp') diff --git a/src/devices/cpu/dsp56156/dsp56156.cpp b/src/devices/cpu/dsp56156/dsp56156.cpp index b6c5b4fd672..04952c0f7d3 100644 --- a/src/devices/cpu/dsp56156/dsp56156.cpp +++ b/src/devices/cpu/dsp56156/dsp56156.cpp @@ -141,7 +141,7 @@ device_memory_interface::space_config_vector dsp56156_device::memory_space_confi /*************************************************************************** MEMORY ACCESSORS ***************************************************************************/ -#define ROPCODE(pc) cpustate->cache->read_word(pc) +#define ROPCODE(pc) cpustate->cache.read_word(pc) /*************************************************************************** @@ -291,9 +291,9 @@ void dsp56156_device::device_start() save_item(NAME(m_core.peripheral_ram)); - m_core.program = &space(AS_PROGRAM); - m_core.cache = m_core.program->cache<1, -1, ENDIANNESS_LITTLE>(); - m_core.data = &space(AS_DATA); + space(AS_PROGRAM).cache(m_core.cache); + space(AS_PROGRAM).specific(m_core.program); + space(AS_DATA).specific(m_core.data); state_add(DSP56156_PC, "PC", m_core.PCU.pc).formatstr("%04X"); state_add(DSP56156_SR, "SR", m_core.PCU.sr).formatstr("%04X"); @@ -445,7 +445,7 @@ void dsp56156_device::device_reset() m_core.ppc = m_core.PCU.pc; /* HACK - Put a jump to 0x0000 at 0x0000 - this keeps the CPU locked to the instruction at address 0x0000 */ - m_core.program->write_word(0x0000, 0x0124); + m_core.program.write_word(0x0000, 0x0124); } -- cgit v1.2.3-70-g09d2