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/diablo/diablo1300.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/diablo/diablo1300.cpp')
-rw-r--r-- | src/devices/cpu/diablo/diablo1300.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/devices/cpu/diablo/diablo1300.cpp b/src/devices/cpu/diablo/diablo1300.cpp index e9eef2275a9..81fe6e4142b 100644 --- a/src/devices/cpu/diablo/diablo1300.cpp +++ b/src/devices/cpu/diablo/diablo1300.cpp @@ -29,29 +29,27 @@ inline uint16_t diablo1300_cpu_device::opcode_read(uint16_t address) { - return m_cache->read_word(address); + return m_cache.read_word(address); } inline uint16_t diablo1300_cpu_device::program_read16(uint16_t address) { - return m_program->read_word(address); + return m_program.read_word(address); } inline void diablo1300_cpu_device::program_write16(uint16_t address, uint16_t data) { - m_program->write_word(address, data); - return; + m_program.write_word(address, data); } inline uint8_t diablo1300_cpu_device::data_read8(uint16_t address) { - return m_data->read_byte(address); + return m_data.read_byte(address); } inline void diablo1300_cpu_device::data_write8(uint16_t address, uint8_t data) { - m_data->write_byte(address, data); - return; + m_data.write_byte(address, data); } inline uint8_t diablo1300_cpu_device::read_reg(uint16_t reg) @@ -98,9 +96,6 @@ diablo1300_cpu_device::diablo1300_cpu_device(const machine_config &mconfig, cons , m_b(0) , m_carry(0) , m_power_on(ASSERT_LINE) - , m_program(nullptr) - , m_data(nullptr) - , m_cache(nullptr) , m_table(nullptr) { // Allocate & setup @@ -109,9 +104,9 @@ diablo1300_cpu_device::diablo1300_cpu_device(const machine_config &mconfig, cons void diablo1300_cpu_device::device_start() { - m_program = &space(AS_PROGRAM); - m_data = &space(AS_DATA); - m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); + space(AS_DATA).specific(m_data); m_table = memregion("trom"); // register our state for the debugger |