summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/v810/v810.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/v810/v810.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/v810/v810.cpp')
-rw-r--r--src/devices/cpu/v810/v810.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/devices/cpu/v810/v810.cpp b/src/devices/cpu/v810/v810.cpp
index 11656b22c9f..a5a7e8dfc52 100644
--- a/src/devices/cpu/v810/v810.cpp
+++ b/src/devices/cpu/v810/v810.cpp
@@ -126,26 +126,26 @@ std::unique_ptr<util::disasm_interface> v810_device::create_disassembler()
#define SET_EP(val) (PSW = (PSW & ~0x00004000) | ((val) << 14))
#define SET_NP(val) (PSW = (PSW & ~0x00008000) | ((val) << 15))
-#define R_B(addr) (m_program->read_byte(addr))
-#define R_H(addr) (m_program->read_word(addr))
-#define R_W(addr) (m_program->read_dword(addr))
+#define R_B(addr) (m_program.read_byte(addr))
+#define R_H(addr) (m_program.read_word(addr))
+#define R_W(addr) (m_program.read_dword(addr))
-#define W_B(addr, val) (m_program->write_byte(addr,val))
-#define W_H(addr, val) (m_program->write_word(addr,val))
-#define W_W(addr, val) (m_program->write_dword(addr,val))
+#define W_B(addr, val) (m_program.write_byte(addr,val))
+#define W_H(addr, val) (m_program.write_word(addr,val))
+#define W_W(addr, val) (m_program.write_dword(addr,val))
-#define RIO_B(addr) (m_io->read_byte(addr))
-#define RIO_H(addr) (m_io->read_word(addr))
-#define RIO_W(addr) (m_io->read_dword(addr))
+#define RIO_B(addr) (m_io.read_byte(addr))
+#define RIO_H(addr) (m_io.read_word(addr))
+#define RIO_W(addr) (m_io.read_dword(addr))
-#define WIO_B(addr, val) (m_io->write_byte(addr,val))
-#define WIO_H(addr, val) (m_io->write_word(addr,val))
-#define WIO_W(addr, val) (m_io->write_dword(addr,val))
+#define WIO_B(addr, val) (m_io.write_byte(addr,val))
+#define WIO_H(addr, val) (m_io.write_word(addr,val))
+#define WIO_W(addr, val) (m_io.write_dword(addr,val))
-#define R_OP(addr) (m_cache->read_word(addr))
+#define R_OP(addr) (m_cache.read_word(addr))
#define GET1 (op&0x1f)
#define GET2 ((op>>5)&0x1f)
@@ -1255,9 +1255,9 @@ const v810_device::opcode_func v810_device::s_OpCodeTable[64] =
void v810_device::device_start()
{
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<2, 0, ENDIANNESS_LITTLE>();
- m_io = has_space(AS_IO) ? &space(AS_IO) : m_program;
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
+ space(has_space(AS_IO) ? AS_IO : AS_PROGRAM).specific(m_io);
m_irq_line = 0;
m_irq_state = CLEAR_LINE;