diff options
author | 2020-05-25 16:42:42 +0200 | |
---|---|---|
committer | 2020-05-25 16:42:57 +0200 | |
commit | 22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch) | |
tree | 3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/tms32051/tms32051.cpp | |
parent | e42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (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/tms32051/tms32051.cpp')
-rw-r--r-- | src/devices/cpu/tms32051/tms32051.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/devices/cpu/tms32051/tms32051.cpp b/src/devices/cpu/tms32051/tms32051.cpp index ebcc1d216e5..1691c66b2e2 100644 --- a/src/devices/cpu/tms32051/tms32051.cpp +++ b/src/devices/cpu/tms32051/tms32051.cpp @@ -130,7 +130,7 @@ std::unique_ptr<util::disasm_interface> tms32051_device::create_disassembler() #define CYCLES(x) (m_icount -= x) -#define ROPCODE() m_cache->read_word(m_pc++) +#define ROPCODE() m_cache.read_word(m_pc++) void tms32051_device::CHANGE_PC(uint16_t new_pc) { @@ -139,22 +139,22 @@ void tms32051_device::CHANGE_PC(uint16_t new_pc) uint16_t tms32051_device::PM_READ16(uint16_t address) { - return m_program->read_word(address); + return m_program.read_word(address); } void tms32051_device::PM_WRITE16(uint16_t address, uint16_t data) { - m_program->write_word(address, data); + m_program.write_word(address, data); } uint16_t tms32051_device::DM_READ16(uint16_t address) { - return m_data->read_word(address); + return m_data.read_word(address); } void tms32051_device::DM_WRITE16(uint16_t address, uint16_t data) { - m_data->write_word(address, data); + m_data.write_word(address, data); } #include "32051ops.hxx" @@ -186,10 +186,10 @@ void tms32051_device::delay_slot(uint16_t startpc) void tms32051_device::device_start() { - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>(); - 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_pcstack_ptr = 0; m_op = 0; @@ -519,7 +519,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r ) case 0x5d: case 0x5e: case 0x5f: - return m_io->read_word(offset); + return m_io.read_word(offset); default: if (!machine().side_effects_disabled()) @@ -630,7 +630,7 @@ WRITE16_MEMBER( tms32051_device::cpuregs_w ) case 0x5d: case 0x5e: case 0x5f: - m_io->write_word(offset, data); + m_io.write_word(offset, data); break; default: |