summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/ie15
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/ie15
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/ie15')
-rw-r--r--src/devices/cpu/ie15/ie15.cpp19
-rw-r--r--src/devices/cpu/ie15/ie15.h6
2 files changed, 12 insertions, 13 deletions
diff --git a/src/devices/cpu/ie15/ie15.cpp b/src/devices/cpu/ie15/ie15.cpp
index 7d4b8499245..828143e1715 100644
--- a/src/devices/cpu/ie15/ie15.cpp
+++ b/src/devices/cpu/ie15/ie15.cpp
@@ -35,7 +35,6 @@ ie15_cpu_device::ie15_cpu_device(const machine_config &mconfig, const char *tag,
: cpu_device(mconfig, IE15_CPU, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 14)
, m_io_config("io", ENDIANNESS_LITTLE, 8, 8), m_A(0), m_CF(0), m_ZF(0), m_RF(0), m_flags(0)
- , m_program(nullptr), m_io(nullptr), m_cache(nullptr)
{
// set our instruction counter
set_icountptr(m_icount);
@@ -48,9 +47,9 @@ ie15_cpu_device::ie15_cpu_device(const machine_config &mconfig, const char *tag,
void ie15_cpu_device::device_start()
{
// find address spaces
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<0, 0, ENDIANNESS_LITTLE>();
- m_io = &space(AS_IO);
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
+ space(AS_IO).specific(m_io);
// save state
save_item(NAME(m_PC));
@@ -322,7 +321,7 @@ inline void ie15_cpu_device::execute_one(int opcode)
if (opcode == 0x67)
m_A = 255;
else
- m_A = m_io->read_byte(opcode & 15);
+ m_A = m_io.read_byte(opcode & 15);
update_flags(m_A);
break;
case 0xf0: // ota
@@ -332,7 +331,7 @@ inline void ie15_cpu_device::execute_one(int opcode)
else if (opcode == 0xff)
m_RF = 0;
else
- m_io->write_byte(opcode & 15, m_A);
+ m_io.write_byte(opcode & 15, m_A);
// m_CF = 0;
break;
case 0xc0: // cfl, sfl
@@ -344,7 +343,7 @@ inline void ie15_cpu_device::execute_one(int opcode)
m_CF = 0;
break;
default:
- m_io->write_byte(020 | (opcode & 7), BIT(opcode, 3));
+ m_io.write_byte(020 | (opcode & 7), BIT(opcode, 3));
break;
}
break;
@@ -362,7 +361,7 @@ inline void ie15_cpu_device::execute_one(int opcode)
tmp = 0;
break;
default:
- tmp = m_io->read_byte(020 | tmp);
+ tmp = m_io.read_byte(020 | tmp);
break;
}
@@ -406,14 +405,14 @@ inline void ie15_cpu_device::execute_one(int opcode)
inline uint8_t ie15_cpu_device::rop()
{
- uint8_t retVal = m_cache->read_byte(m_PC.w.l);
+ uint8_t retVal = m_cache.read_byte(m_PC.w.l);
m_PC.w.l = (m_PC.w.l + 1) & 0x0fff;
return retVal;
}
inline uint8_t ie15_cpu_device::arg()
{
- uint8_t retVal = m_cache->read_byte(m_PC.w.l);
+ uint8_t retVal = m_cache.read_byte(m_PC.w.l);
return retVal;
}
diff --git a/src/devices/cpu/ie15/ie15.h b/src/devices/cpu/ie15/ie15.h
index 14f4d82357c..a0885ce55f1 100644
--- a/src/devices/cpu/ie15/ie15.h
+++ b/src/devices/cpu/ie15/ie15.h
@@ -72,9 +72,9 @@ protected:
uint8_t m_RF; // Current register page
uint8_t m_flags; // temporary I/O only
- address_space *m_program;
- address_space *m_io;
- memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache;
+ memory_access<14, 0, 0, ENDIANNESS_LITTLE>::cache m_cache;
+ memory_access<14, 0, 0, ENDIANNESS_LITTLE>::specific m_program;
+ memory_access< 8, 0, 0, ENDIANNESS_LITTLE>::specific m_io;
};
// device type definition