summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/scmp/scmp.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/scmp/scmp.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/scmp/scmp.cpp')
-rw-r--r--src/devices/cpu/scmp/scmp.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/devices/cpu/scmp/scmp.cpp b/src/devices/cpu/scmp/scmp.cpp
index fdcd8dd75fd..a9021737300 100644
--- a/src/devices/cpu/scmp/scmp.cpp
+++ b/src/devices/cpu/scmp/scmp.cpp
@@ -31,7 +31,7 @@ scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_
scmp_device::scmp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0)
- , m_AC(0), m_ER(0), m_SR(0), m_program(nullptr), m_cache(nullptr), m_icount(0)
+ , m_AC(0), m_ER(0), m_SR(0), m_icount(0)
, m_flag_out_func(*this)
, m_sout_func(*this)
, m_sin_func(*this)
@@ -70,24 +70,24 @@ uint8_t scmp_device::ROP()
{
uint16_t pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
- return m_cache->read_byte( pc);
+ return m_cache.read_byte( pc);
}
uint8_t scmp_device::ARG()
{
uint16_t pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
- return m_cache->read_byte(pc);
+ return m_cache.read_byte(pc);
}
uint8_t scmp_device::RM(uint32_t a)
{
- return m_program->read_byte(a);
+ return m_program.read_byte(a);
}
void scmp_device::WM(uint32_t a, uint8_t v)
{
- m_program->write_byte(a, v);
+ m_program.write_byte(a, v);
}
void scmp_device::illegal(uint8_t opcode)
@@ -502,8 +502,8 @@ void scmp_device::device_start()
state_add(SCMP_SR, "SR", m_SR);
}
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<0, 0, ENDIANNESS_LITTLE>();
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
/* resolve callbacks */
m_flag_out_func.resolve_safe();