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/s2650/s2650.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/s2650/s2650.cpp')
-rw-r--r-- | src/devices/cpu/s2650/s2650.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/devices/cpu/s2650/s2650.cpp b/src/devices/cpu/s2650/s2650.cpp index 9e36a1c8ae1..ccdc5694cd2 100644 --- a/src/devices/cpu/s2650/s2650.cpp +++ b/src/devices/cpu/s2650/s2650.cpp @@ -36,7 +36,7 @@ s2650_device::s2650_device(const machine_config &mconfig, const char *tag, devic , m_sense_handler(*this) , m_flag_handler(*this), m_intack_handler(*this) , m_ppc(0), m_page(0), m_iar(0), m_ea(0), m_psl(0), m_psu(0), m_r(0) - , m_halt(0), m_ir(0), m_irq_state(0), m_icount(0), m_cache(nullptr) + , m_halt(0), m_ir(0), m_irq_state(0), m_icount(0) , m_debugger_temp(0) { memset(m_reg, 0x00, sizeof(m_reg)); @@ -167,7 +167,7 @@ static const int S2650_relative[0x100] = * RDMEM * read memory byte from addr ***************************************************************/ -#define RDMEM(addr) space(AS_PROGRAM).read_byte(addr) +#define RDMEM(addr) m_program.read_byte(addr) inline void s2650_device::set_psu(uint8_t new_val) { @@ -264,7 +264,7 @@ inline int s2650_device::check_irq_line() ***************************************************************/ inline uint8_t s2650_device::ROP() { - uint8_t result = m_cache->read_byte(m_page + m_iar); + uint8_t result = m_cprogram.read_byte(m_page + m_iar); m_iar = (m_iar + 1) & PMSK; return result; } @@ -275,7 +275,7 @@ inline uint8_t s2650_device::ROP() ***************************************************************/ inline uint8_t s2650_device::ARG() { - uint8_t result = m_cache->read_byte(m_page + m_iar); + uint8_t result = m_cprogram.read_byte(m_page + m_iar); m_iar = (m_iar + 1) & PMSK; return result; } @@ -561,7 +561,7 @@ inline uint8_t s2650_device::ARG() * Store source register to memory addr (CC unchanged) ***************************************************************/ #define M_STR(address,source) \ - space(AS_PROGRAM).write_byte(address, source) + m_program.write_byte(address, source) /*************************************************************** * M_AND @@ -824,7 +824,10 @@ void s2650_device::device_start() m_flag_handler.resolve_safe(); m_intack_handler.resolve_safe(0x00); - m_cache = space(AS_PROGRAM).cache<0, 0, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cprogram); + space(AS_PROGRAM).specific(m_program); + space(AS_DATA).specific(m_data); + space(AS_IO).specific(m_io); save_item(NAME(m_ppc)); save_item(NAME(m_page)); @@ -1124,7 +1127,7 @@ void s2650_device::execute_run() case 0x32: /* REDC,2 */ case 0x33: /* REDC,3 */ m_icount -= 6; - m_reg[m_r] = space(AS_DATA).read_byte(S2650_CTRL_PORT); + m_reg[m_r] = m_data.read_byte(S2650_CTRL_PORT); SET_CC( m_reg[m_r] ); break; @@ -1214,7 +1217,7 @@ void s2650_device::execute_run() case 0x56: /* REDE,2 v */ case 0x57: /* REDE,3 v */ m_icount -= 9; - m_reg[m_r] = space(AS_IO).read_byte(ARG()); + m_reg[m_r] = m_io.read_byte(ARG()); SET_CC(m_reg[m_r]); break; @@ -1273,7 +1276,7 @@ void s2650_device::execute_run() case 0x72: /* REDD,2 */ case 0x73: /* REDD,3 */ m_icount -= 6; - m_reg[m_r] = space(AS_DATA).read_byte(S2650_DATA_PORT); + m_reg[m_r] = m_data.read_byte(S2650_DATA_PORT); SET_CC(m_reg[m_r]); break; @@ -1429,7 +1432,7 @@ void s2650_device::execute_run() case 0xb2: /* WRTC,2 */ case 0xb3: /* WRTC,3 */ m_icount -= 6; - space(AS_DATA).write_byte(S2650_CTRL_PORT,m_reg[m_r]); + m_data.write_byte(S2650_CTRL_PORT,m_reg[m_r]); break; case 0xb4: /* TPSU */ @@ -1515,7 +1518,7 @@ void s2650_device::execute_run() case 0xd6: /* WRTE,2 v */ case 0xd7: /* WRTE,3 v */ m_icount -= 9; - space(AS_IO).write_byte( ARG(), m_reg[m_r] ); + m_io.write_byte( ARG(), m_reg[m_r] ); break; case 0xd8: /* BIRR,0 (*)a */ @@ -1573,7 +1576,7 @@ void s2650_device::execute_run() case 0xf2: /* WRTD,2 */ case 0xf3: /* WRTD,3 */ m_icount -= 6; - space(AS_DATA).write_byte(S2650_DATA_PORT, m_reg[m_r]); + m_data.write_byte(S2650_DATA_PORT, m_reg[m_r]); break; case 0xf4: /* TMI,0 v */ |