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/unsp/unsp.h | |
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/unsp/unsp.h')
-rw-r--r-- | src/devices/cpu/unsp/unsp.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/devices/cpu/unsp/unsp.h b/src/devices/cpu/unsp/unsp.h index b5f77d239db..c55daf885c7 100644 --- a/src/devices/cpu/unsp/unsp.h +++ b/src/devices/cpu/unsp/unsp.h @@ -209,14 +209,14 @@ protected: internal_unsp_state* m_core; protected: - uint16_t read16(uint32_t address) { return m_program->read_word(address); } + uint16_t read16(uint32_t address) { return m_program.read_word(address); } void write16(uint32_t address, uint16_t data) { #if UNSP_LOG_REGS log_write(address, data); #endif - m_program->write_word(address, data); + m_program.write_word(address, data); } void add_lpc(const int32_t offset) @@ -287,9 +287,8 @@ private: address_space_config m_program_config; - address_space *m_program; - std::function<u16 (offs_t)> m_pr16; - std::function<const void * (offs_t)> m_prptr; + memory_access<23, 2, -1, ENDIANNESS_BIG>::cache m_cache; + memory_access<23, 2, -1, ENDIANNESS_BIG>::specific m_program; uint32_t m_debugger_temp; #if UNSP_LOG_OPCODES || UNSP_LOG_REGS @@ -300,7 +299,7 @@ private: inline void trigger_irq(int line); void check_irqs(); - drc_cache m_cache; + drc_cache m_drccache; std::unique_ptr<drcuml_state> m_drcuml; std::unique_ptr<unsp_frontend> m_drcfe; uint32_t m_drcoptions; |