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/cubeqcpu/cubeqcpu.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/cubeqcpu/cubeqcpu.cpp')
-rw-r--r-- | src/devices/cpu/cubeqcpu/cubeqcpu.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp index 85f435a68a1..a33fd877505 100644 --- a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp +++ b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp @@ -182,8 +182,8 @@ void cquestsnd_cpu_device::device_start() assert(m_sound_region_tag != nullptr); m_sound_data = (u16*)machine().root_device().memregion(m_sound_region_tag)->base(); - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<3, -3, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); memset(m_ram, 0, sizeof(m_ram)); m_q = 0; @@ -261,8 +261,8 @@ void cquestrot_cpu_device::device_start() { m_linedata_w.resolve_safe(); - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<3, -3, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); memset(m_ram, 0, sizeof(m_ram)); m_q = 0; @@ -392,8 +392,8 @@ void cquestlin_cpu_device::device_start() { m_linedata_r.resolve_safe(0); - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<3, -3, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); memset(m_ram, 0, sizeof(m_ram)); m_q = 0; @@ -542,7 +542,7 @@ void cquestsnd_cpu_device::execute_run() do { /* Decode the instruction */ - u64 inst = m_cache->read_qword(SND_PC); + u64 inst = m_cache.read_qword(SND_PC); u32 inslow = inst & 0xffffffff; u32 inshig = inst >> 32; @@ -798,7 +798,7 @@ void cquestrot_cpu_device::execute_run() do { /* Decode the instruction */ - u64 inst = m_cache->read_qword(ROT_PC); + u64 inst = m_cache.read_qword(ROT_PC); u32 inslow = inst & 0xffffffff; u32 inshig = inst >> 32; @@ -1218,7 +1218,7 @@ void cquestlin_cpu_device::execute_run() int prog = (m_clkcnt & 3) ? BACKGROUND : FOREGROUND; m_curpc = LINE_PC; - u64 inst = m_cache->read_qword(LINE_PC); + u64 inst = m_cache.read_qword(LINE_PC); u32 inslow = inst & 0xffffffff; u32 inshig = inst >> 32; |