summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/e132xs
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/e132xs')
-rw-r--r--src/devices/cpu/e132xs/e132xs.cpp18
-rw-r--r--src/devices/cpu/e132xs/e132xs.h3
2 files changed, 12 insertions, 9 deletions
diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp
index cce03566729..2311ba75a8b 100644
--- a/src/devices/cpu/e132xs/e132xs.cpp
+++ b/src/devices/cpu/e132xs/e132xs.cpp
@@ -1115,24 +1115,24 @@ void hyperstone_device::init(int scale_mask)
m_program = &space(AS_PROGRAM);
if (m_program->data_width() == 16)
{
- auto cache = m_program->cache<1, 0, ENDIANNESS_BIG>();
- m_pr16 = [cache](offs_t address) -> u16 { return cache->read_word(address); };
- m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); };
+ m_program->cache(m_cache16);
+ m_pr16 = [this](offs_t address) -> u16 { return m_cache16.read_word(address); };
+ m_prptr = [this](offs_t address) -> const void * { return m_cache16.read_ptr(address); };
}
else
{
- auto cache = m_program->cache<2, 0, ENDIANNESS_BIG>();
- m_pr16 = [cache](offs_t address) -> u16 { return cache->read_word(address); };
+ m_program->cache(m_cache32);
+ m_pr16 = [this](offs_t address) -> u16 { return m_cache32.read_word(address); };
if (ENDIANNESS_NATIVE != ENDIANNESS_BIG)
- m_prptr = [cache](offs_t address) -> const void * {
- const u16 *ptr = static_cast<u16 *>(cache->read_ptr(address & ~3));
+ m_prptr = [this](offs_t address) -> const void * {
+ const u16 *ptr = static_cast<u16 *>(m_cache32.read_ptr(address & ~3));
if(!(address & 2))
ptr++;
return ptr;
};
else
- m_prptr = [cache](offs_t address) -> const void * {
- const u16 *ptr = static_cast<u16 *>(cache->read_ptr(address & ~3));
+ m_prptr = [this](offs_t address) -> const void * {
+ const u16 *ptr = static_cast<u16 *>(m_cache32.read_ptr(address & ~3));
if(address & 2)
ptr++;
return ptr;
diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h
index 6c838fefb37..fb50a3dfb5b 100644
--- a/src/devices/cpu/e132xs/e132xs.h
+++ b/src/devices/cpu/e132xs/e132xs.h
@@ -305,6 +305,9 @@ protected:
const address_space_config m_program_config;
const address_space_config m_io_config;
address_space *m_program;
+ memory_access<32, 1, 0, ENDIANNESS_BIG>::cache m_cache16;
+ memory_access<32, 2, 0, ENDIANNESS_BIG>::cache m_cache32;
+
std::function<u16 (offs_t)> m_pr16;
std::function<const void * (offs_t)> m_prptr;
address_space *m_io;