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/h6280/h6280.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/h6280/h6280.cpp')
-rw-r--r-- | src/devices/cpu/h6280/h6280.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/devices/cpu/h6280/h6280.cpp b/src/devices/cpu/h6280/h6280.cpp index 814f906de81..96ecb18534d 100644 --- a/src/devices/cpu/h6280/h6280.cpp +++ b/src/devices/cpu/h6280/h6280.cpp @@ -320,9 +320,9 @@ void h6280_device::device_reset() #endif m_io_buffer = 0; - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<0, 0, ENDIANNESS_LITTLE>(); - m_io = &space(AS_IO); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); + space(AS_IO).specific(m_io); /* set I and B flags */ P = _fI | _fB; @@ -1605,7 +1605,7 @@ inline uint8_t h6280_device::smb(int bit, uint8_t tmp) inline void h6280_device::st0(uint8_t tmp) { clear_t(); - m_io->write_byte(0x0000,tmp); + m_io.write_byte(0x0000,tmp); } /* 6280 ******************************************************** @@ -1614,7 +1614,7 @@ inline void h6280_device::st0(uint8_t tmp) inline void h6280_device::st1(uint8_t tmp) { clear_t(); - m_io->write_byte(0x0002,tmp); + m_io.write_byte(0x0002,tmp); } /* 6280 ******************************************************** @@ -1623,7 +1623,7 @@ inline void h6280_device::st1(uint8_t tmp) inline void h6280_device::st2(uint8_t tmp) { clear_t(); - m_io->write_byte(0x0003,tmp); + m_io.write_byte(0x0003,tmp); } /* 6280 ******************************************************** @@ -2329,7 +2329,7 @@ void h6280_device::execute_set_input(int inputnum, int state) uint8_t h6280_device::program_read8(offs_t addr) { check_vdc_vce_penalty(addr); - return m_program->read_byte(translated(addr)); + return m_program.read_byte(translated(addr)); } /*************************************************************** @@ -2338,7 +2338,7 @@ uint8_t h6280_device::program_read8(offs_t addr) void h6280_device::program_write8(offs_t addr, uint8_t data) { check_vdc_vce_penalty(addr); - m_program->write_byte(translated(addr), data); + m_program.write_byte(translated(addr), data); } /*************************************************************** @@ -2346,7 +2346,7 @@ void h6280_device::program_write8(offs_t addr, uint8_t data) ***************************************************************/ uint8_t h6280_device::program_read8z(offs_t addr) { - return m_program->read_byte((m_mmr[1] << 13) | (addr & 0x1fff)); + return m_program.read_byte((m_mmr[1] << 13) | (addr & 0x1fff)); } /*************************************************************** @@ -2354,7 +2354,7 @@ uint8_t h6280_device::program_read8z(offs_t addr) ***************************************************************/ void h6280_device::program_write8z(offs_t addr, uint8_t data) { - m_program->write_byte((m_mmr[1] << 13) | (addr & 0x1fff), data); + m_program.write_byte((m_mmr[1] << 13) | (addr & 0x1fff), data); } /*************************************************************** @@ -2362,8 +2362,8 @@ void h6280_device::program_write8z(offs_t addr, uint8_t data) ***************************************************************/ uint16_t h6280_device::program_read16(offs_t addr) { - return m_program->read_byte(translated(addr)) | - (m_program->read_byte(translated(addr + 1)) << 8); + return m_program.read_byte(translated(addr)) | + (m_program.read_byte(translated(addr + 1)) << 8); } /*************************************************************** @@ -2373,13 +2373,13 @@ uint16_t h6280_device::program_read16z(offs_t addr) { if ((addr & 0xff) == 0xff) { - return m_program->read_byte((m_mmr[1] << 13) | (addr & 0x1fff)) | - (m_program->read_byte((m_mmr[1] << 13) | ((addr - 0xff) & 0x1fff)) << 8); + return m_program.read_byte((m_mmr[1] << 13) | (addr & 0x1fff)) | + (m_program.read_byte((m_mmr[1] << 13) | ((addr - 0xff) & 0x1fff)) << 8); } else { - return m_program->read_byte((m_mmr[1] << 13) | (addr & 0x1fff)) | - (m_program->read_byte((m_mmr[1] << 13) | ((addr + 1) & 0x1fff)) << 8); + return m_program.read_byte((m_mmr[1] << 13) | (addr & 0x1fff)) | + (m_program.read_byte((m_mmr[1] << 13) | ((addr + 1) & 0x1fff)) << 8); } } @@ -2388,7 +2388,7 @@ uint16_t h6280_device::program_read16z(offs_t addr) ***************************************************************/ void h6280_device::push(uint8_t value) { - m_program->write_byte((m_mmr[1] << 13) | m_sp.d, value); + m_program.write_byte((m_mmr[1] << 13) | m_sp.d, value); S--; } @@ -2398,7 +2398,7 @@ void h6280_device::push(uint8_t value) void h6280_device::pull(uint8_t &value) { S++; - value = m_program->read_byte((m_mmr[1] << 13) | m_sp.d); + value = m_program.read_byte((m_mmr[1] << 13) | m_sp.d); } /*************************************************************** @@ -2406,7 +2406,7 @@ void h6280_device::pull(uint8_t &value) ***************************************************************/ uint8_t h6280_device::read_opcode() { - return m_cache->read_byte(translated(PCW)); + return m_cache.read_byte(translated(PCW)); } /*************************************************************** @@ -2414,7 +2414,7 @@ uint8_t h6280_device::read_opcode() ***************************************************************/ uint8_t h6280_device::read_opcode_arg() { - return m_cache->read_byte(translated(PCW)); + return m_cache.read_byte(translated(PCW)); } |