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/pic16c62x/pic16c62x.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/pic16c62x/pic16c62x.cpp')
-rw-r--r-- | src/devices/cpu/pic16c62x/pic16c62x.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/devices/cpu/pic16c62x/pic16c62x.cpp b/src/devices/cpu/pic16c62x/pic16c62x.cpp index 6263fd04f42..166b26b731e 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.cpp +++ b/src/devices/cpu/pic16c62x/pic16c62x.cpp @@ -187,16 +187,16 @@ std::unique_ptr<util::disasm_interface> pic16c62x_device::create_disassembler() void pic16c62x_device::update_internalram_ptr() { - m_internalram = (uint8_t *)m_data->get_write_ptr(0x00); + m_internalram = (uint8_t *)m_data.space().get_write_ptr(0x00); } -#define PIC16C62x_RDOP(A) (m_cache->read_word(A)) -#define PIC16C62x_RAM_RDMEM(A) ((uint8_t)m_data->read_byte(A)) -#define PIC16C62x_RAM_WRMEM(A,V) (m_data->write_byte(A,V)) -#define PIC16C62x_In(Port) ((uint8_t)m_io->read_byte((Port))) -#define PIC16C62x_Out(Port,Value) (m_io->write_byte((Port),Value)) +#define PIC16C62x_RDOP(A) (m_cache.read_word(A)) +#define PIC16C62x_RAM_RDMEM(A) ((uint8_t)m_data.read_byte(A)) +#define PIC16C62x_RAM_WRMEM(A,V) (m_data.write_byte(A,V)) +#define PIC16C62x_In(Port) ((uint8_t)m_io.read_byte((Port))) +#define PIC16C62x_Out(Port,Value) (m_io.write_byte((Port),Value)) /************ Read the state of the T0 Clock input signal ************/ -#define PIC16C62x_T0_In (m_io->read_byte(PIC16C62x_T0) >> 4) +#define PIC16C62x_T0_In (m_io.read_byte(PIC16C62x_T0) >> 4) #define M_RDRAM(A) (((A) == 0) ? m_internalram[0] : PIC16C62x_RAM_RDMEM(A)) #define M_WRTRAM(A,V) do { if ((A) == 0) m_internalram[0] = (V); else PIC16C62x_RAM_WRMEM(A,V); } while (0) @@ -887,10 +887,10 @@ void pic16c62x_device::build_opcode_table(void) void pic16c62x_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); /* ensure the internal ram pointers are set before get_info is called */ update_internalram_ptr(); |