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/pic16c5x/pic16c5x.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/pic16c5x/pic16c5x.cpp')
-rw-r--r-- | src/devices/cpu/pic16c5x/pic16c5x.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp index 21907b7d369..715cf574ee1 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.cpp +++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp @@ -197,14 +197,14 @@ std::unique_ptr<util::disasm_interface> pic16c5x_device::create_disassembler() void pic16c5x_device::update_internalram_ptr() { - m_internalram = (uint8_t *)m_data->get_write_ptr(0x00); + m_internalram = (uint8_t *)space(AS_DATA).get_write_ptr(0x00); } -#define PIC16C5x_RDOP(A) (m_cache->read_word(A)) -#define PIC16C5x_RAM_RDMEM(A) ((uint8_t)m_data->read_byte(A)) -#define PIC16C5x_RAM_WRMEM(A,V) (m_data->write_byte(A,V)) +#define PIC16C5x_RDOP(A) (m_program.read_word(A)) +#define PIC16C5x_RAM_RDMEM(A) ((uint8_t)m_data.read_byte(A)) +#define PIC16C5x_RAM_WRMEM(A,V) (m_data.write_byte(A,V)) #define M_RDRAM(A) (((A) < 9) ? m_internalram[A] : PIC16C5x_RAM_RDMEM(A)) #define M_WRTRAM(A,V) do { if ((A) < 9) m_internalram[A] = (V); else PIC16C5x_RAM_WRMEM(A,V); } while (0) @@ -887,9 +887,8 @@ enum void pic16c5x_device::device_start() { - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>(); - m_data = &space(AS_DATA); + space(AS_PROGRAM).cache(m_program); + space(AS_DATA).specific(m_data); m_read_a.resolve_safe(0); m_read_b.resolve_safe(0); |