summaryrefslogtreecommitdiffstats
path: root/src/devices/cpu/dsp32/dsp32.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/dsp32/dsp32.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/dsp32/dsp32.cpp')
-rw-r--r--src/devices/cpu/dsp32/dsp32.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/devices/cpu/dsp32/dsp32.cpp b/src/devices/cpu/dsp32/dsp32.cpp
index 6586276395f..c7452161137 100644
--- a/src/devices/cpu/dsp32/dsp32.cpp
+++ b/src/devices/cpu/dsp32/dsp32.cpp
@@ -174,8 +174,6 @@ dsp32c_device::dsp32c_device(const machine_config &mconfig, const char *tag, dev
m_icount(0),
m_lastpins(0),
m_ppc(0),
- m_program(nullptr),
- m_cache(nullptr),
m_output_pins_changed(*this)
{
// set our instruction counter
@@ -191,8 +189,8 @@ void dsp32c_device::device_start()
m_output_pins_changed.resolve_safe();
// get our address spaces
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<2, 0, ENDIANNESS_LITTLE>();
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
// register our state for the debugger
state_add(STATE_GENPC, "GENPC", m_r[15]).noshow();
@@ -415,17 +413,17 @@ std::unique_ptr<util::disasm_interface> dsp32c_device::create_disassembler()
inline uint32_t dsp32c_device::ROPCODE(offs_t pc)
{
- return m_cache->read_dword(pc);
+ return m_cache.read_dword(pc);
}
inline uint8_t dsp32c_device::RBYTE(offs_t addr)
{
- return m_program->read_byte(addr);
+ return m_program.read_byte(addr);
}
inline void dsp32c_device::WBYTE(offs_t addr, uint8_t data)
{
- m_program->write_byte(addr, data);
+ m_program.write_byte(addr, data);
}
inline uint16_t dsp32c_device::RWORD(offs_t addr)
@@ -434,7 +432,7 @@ inline uint16_t dsp32c_device::RWORD(offs_t addr)
if (!WORD_ALIGNED(addr))
osd_printf_error("Unaligned word read @ %06X, PC=%06X\n", addr, PC);
#endif
- return m_program->read_word(addr);
+ return m_program.read_word(addr);
}
inline uint32_t dsp32c_device::RLONG(offs_t addr)
@@ -443,7 +441,7 @@ inline uint32_t dsp32c_device::RLONG(offs_t addr)
if (!DWORD_ALIGNED(addr))
osd_printf_error("Unaligned long read @ %06X, PC=%06X\n", addr, PC);
#endif
- return m_program->read_dword(addr);
+ return m_program.read_dword(addr);
}
inline void dsp32c_device::WWORD(offs_t addr, uint16_t data)
@@ -452,7 +450,7 @@ inline void dsp32c_device::WWORD(offs_t addr, uint16_t data)
if (!WORD_ALIGNED(addr))
osd_printf_error("Unaligned word write @ %06X, PC=%06X\n", addr, PC);
#endif
- m_program->write_word(addr, data);
+ m_program.write_word(addr, data);
}
inline void dsp32c_device::WLONG(offs_t addr, uint32_t data)
@@ -461,7 +459,7 @@ inline void dsp32c_device::WLONG(offs_t addr, uint32_t data)
if (!DWORD_ALIGNED(addr))
osd_printf_error("Unaligned long write @ %06X, PC=%06X\n", addr, PC);
#endif
- m_program->write_dword(addr, data);
+ m_program.write_dword(addr, data);
}