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/tms32082/tms32082.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/tms32082/tms32082.cpp')
-rw-r--r-- | src/devices/cpu/tms32082/tms32082.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/devices/cpu/tms32082/tms32082.cpp b/src/devices/cpu/tms32082/tms32082.cpp index a14bf89c346..9df37455e99 100644 --- a/src/devices/cpu/tms32082/tms32082.cpp +++ b/src/devices/cpu/tms32082/tms32082.cpp @@ -90,20 +90,20 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w) // TODO: move TC functionality to separate device uint32_t address = data; - uint32_t next_entry = m_program->read_dword(address + 0); - uint32_t pt_options = m_program->read_dword(address + 4); - uint32_t src_addr = m_program->read_dword(address + 8); - uint32_t dst_addr = m_program->read_dword(address + 12); - uint32_t src_b_count = m_program->read_word(address + 16); - uint32_t src_a_count = m_program->read_word(address + 18); - uint32_t dst_b_count = m_program->read_word(address + 20); - uint32_t dst_a_count = m_program->read_word(address + 22); - uint32_t src_c_count = m_program->read_dword(address + 24); - uint32_t dst_c_count = m_program->read_dword(address + 28); - uint32_t src_b_pitch = m_program->read_dword(address + 32); - uint32_t dst_b_pitch = m_program->read_dword(address + 36); - uint32_t src_c_pitch = m_program->read_dword(address + 40); - uint32_t dst_c_pitch = m_program->read_dword(address + 44); + uint32_t next_entry = m_program.read_dword(address + 0); + uint32_t pt_options = m_program.read_dword(address + 4); + uint32_t src_addr = m_program.read_dword(address + 8); + uint32_t dst_addr = m_program.read_dword(address + 12); + uint32_t src_b_count = m_program.read_word(address + 16); + uint32_t src_a_count = m_program.read_word(address + 18); + uint32_t dst_b_count = m_program.read_word(address + 20); + uint32_t dst_a_count = m_program.read_word(address + 22); + uint32_t src_c_count = m_program.read_dword(address + 24); + uint32_t dst_c_count = m_program.read_dword(address + 28); + uint32_t src_b_pitch = m_program.read_dword(address + 32); + uint32_t dst_b_pitch = m_program.read_dword(address + 36); + uint32_t src_c_pitch = m_program.read_dword(address + 40); + uint32_t dst_c_pitch = m_program.read_dword(address + 44); printf("TC operation:\n"); printf(" Next entry: %08X\n", next_entry); @@ -137,8 +137,8 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w) uint32_t src = src_addr + c_src_offset + b_src_offset + ia; uint32_t dst = dst_addr + c_dst_offset + b_dst_offset + ia; - uint32_t data = m_program->read_byte(src); - m_program->write_byte(dst, data); + uint32_t data = m_program.read_byte(src); + m_program.write_byte(dst, data); //printf("%08X: %02X -> %08X\n", src, data, dst); } @@ -151,7 +151,7 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w) void tms32082_mp_device::device_start() { - m_program = &space(AS_PROGRAM); + space(AS_PROGRAM).specific(m_program); m_cmd_callback.resolve(); save_item(NAME(m_pc)); @@ -218,8 +218,8 @@ void tms32082_mp_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<2, 0, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); set_icountptr(m_icount); } @@ -294,7 +294,7 @@ void tms32082_mp_device::processor_command(uint32_t command) printf("PP0 "); if (!m_cmd_callback.isnull()) - m_cmd_callback(*m_program, 0, command, 0xffffffff); + m_cmd_callback(space(AS_PROGRAM), 0, command, 0xffffffff); printf("\n"); } @@ -403,7 +403,7 @@ void tms32082_mp_device::check_interrupts() m_ie &= ~1; // clear global interrupt mask // get new pc from vector table - m_fetchpc = m_pc = m_program->read_dword(0x01010180 + (i * 4)); + m_fetchpc = m_pc = m_program.read_dword(0x01010180 + (i * 4)); return; } } @@ -436,7 +436,7 @@ void tms32082_mp_device::execute_set_input(int inputnum, int state) uint32_t tms32082_mp_device::fetch() { - uint32_t w = m_cache->read_dword(m_fetchpc); + uint32_t w = m_cache.read_dword(m_fetchpc); m_fetchpc += 4; return w; } @@ -506,7 +506,7 @@ std::unique_ptr<util::disasm_interface> tms32082_pp_device::create_disassembler( void tms32082_pp_device::device_start() { - m_program = &space(AS_PROGRAM); + space(AS_PROGRAM).specific(m_program); save_item(NAME(m_pc)); save_item(NAME(m_fetchpc)); @@ -517,8 +517,8 @@ void tms32082_pp_device::device_start() state_add(STATE_GENPC, "GENPC", m_pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<2, 0, ENDIANNESS_BIG>(); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); set_icountptr(m_icount); } |