summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms32010/tms32010.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/tms32010/tms32010.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/tms32010/tms32010.cpp')
-rw-r--r--src/devices/cpu/tms32010/tms32010.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp
index 4ac26dd3185..01c18fb4471 100644
--- a/src/devices/cpu/tms32010/tms32010.cpp
+++ b/src/devices/cpu/tms32010/tms32010.cpp
@@ -167,14 +167,14 @@ std::unique_ptr<util::disasm_interface> tms32010_device::create_disassembler()
* Input a word from given I/O port
*/
-#define TMS32010_In(Port) (m_io->read_word(Port))
+#define TMS32010_In(Port) (m_io.read_word(Port))
/****************************************************************************
* Output a word to given I/O port
*/
-#define TMS32010_Out(Port,Value) (m_io->write_word(Port,Value))
+#define TMS32010_Out(Port,Value) (m_io.write_word(Port,Value))
@@ -182,14 +182,14 @@ std::unique_ptr<util::disasm_interface> tms32010_device::create_disassembler()
* Read a word from given ROM memory location
*/
-#define TMS32010_ROM_RDMEM(A) (m_program->read_word(A))
+#define TMS32010_ROM_RDMEM(A) (m_program.read_word(A))
/****************************************************************************
* Write a word to given ROM memory location
*/
-#define TMS32010_ROM_WRMEM(A,V) (m_program->write_word(A,V))
+#define TMS32010_ROM_WRMEM(A,V) (m_program.write_word(A,V))
@@ -197,14 +197,14 @@ std::unique_ptr<util::disasm_interface> tms32010_device::create_disassembler()
* Read a word from given RAM memory location
*/
-#define TMS32010_RAM_RDMEM(A) (m_data->read_word(A))
+#define TMS32010_RAM_RDMEM(A) (m_data.read_word(A))
/****************************************************************************
* Write a word to given RAM memory location
*/
-#define TMS32010_RAM_WRMEM(A,V) (m_data->write_word(A,V))
+#define TMS32010_RAM_WRMEM(A,V) (m_data.write_word(A,V))
@@ -214,7 +214,7 @@ std::unique_ptr<util::disasm_interface> tms32010_device::create_disassembler()
* used to greatly speed up emulation
*/
-#define TMS32010_RDOP(A) (m_cache->read_word(A))
+#define TMS32010_RDOP(A) (m_cache.read_word(A))
/****************************************************************************
@@ -223,7 +223,7 @@ std::unique_ptr<util::disasm_interface> tms32010_device::create_disassembler()
* that use different encoding mechanisms for opcodes and opcode arguments
*/
-#define TMS32010_RDOP_ARG(A) (m_cache->read_word(A))
+#define TMS32010_RDOP_ARG(A) (m_cache.read_word(A))
/************************************************************************
@@ -835,10 +835,10 @@ void tms32010_device::device_start()
save_item(NAME(m_memaccess));
save_item(NAME(m_addr_mask));
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<1, -1, ENDIANNESS_BIG>();
- m_data = &space(AS_DATA);
- m_io = &space(AS_IO);
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
+ space(AS_DATA).specific(m_data);
+ space(AS_IO).specific(m_io);
m_bio_in.resolve_safe(0);