From 22513fb6fe281f5ccb75aaddb6417a12a66c313d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 25 May 2020 16:42:42 +0200 Subject: 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). --- src/devices/cpu/tms32010/tms32010.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/devices/cpu/tms32010/tms32010.cpp') 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 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 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 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 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 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); -- cgit v1.2.3-70-g09d2