summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/psx/psx.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:42 +0200
committer Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:57 +0200
commit22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch)
tree3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/psx/psx.cpp
parente42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (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/psx/psx.cpp')
-rw-r--r--src/devices/cpu/psx/psx.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp
index 58e8997f99b..36f390df5d4 100644
--- a/src/devices/cpu/psx/psx.cpp
+++ b/src/devices/cpu/psx/psx.cpp
@@ -386,7 +386,7 @@ uint8_t psxcpu_device::readbyte( uint32_t address )
{
if( m_bus_attached )
{
- return m_data->read_byte( address );
+ return m_data.read_byte( address );
}
return cache_readword( address ) >> ( ( address & 3 ) * 8 );
@@ -396,7 +396,7 @@ uint16_t psxcpu_device::readhalf( uint32_t address )
{
if( m_bus_attached )
{
- return m_data->read_word( address );
+ return m_data.read_word( address );
}
return cache_readword( address ) >> ( ( address & 2 ) * 8 );
@@ -406,7 +406,7 @@ uint32_t psxcpu_device::readword( uint32_t address )
{
if( m_bus_attached )
{
- return m_data->read_dword( address );
+ return m_data.read_dword( address );
}
return cache_readword( address );
@@ -416,7 +416,7 @@ uint32_t psxcpu_device::readword_masked( uint32_t address, uint32_t mask )
{
if( m_bus_attached )
{
- return m_data->read_dword( address, mask );
+ return m_data.read_dword( address, mask );
}
return cache_readword( address );
@@ -426,7 +426,7 @@ void psxcpu_device::writeword( uint32_t address, uint32_t data )
{
if( m_bus_attached )
{
- m_data->write_dword( address, data );
+ m_data.write_dword( address, data );
}
else
{
@@ -438,7 +438,7 @@ void psxcpu_device::writeword_masked( uint32_t address, uint32_t data, uint32_t
{
if( m_bus_attached )
{
- m_data->write_dword( address, data, mask );
+ m_data.write_dword( address, data, mask );
}
else
{
@@ -1462,7 +1462,7 @@ void psxcpu_device::update_cop0(int reg)
//if (ip & CAUSE_IP5) debugger_interrupt_hook(PSXCPU_IRQ3);
//if (ip & CAUSE_IP6) debugger_interrupt_hook(PSXCPU_IRQ4);
//if (ip & CAUSE_IP7) debugger_interrupt_hook(PSXCPU_IRQ5);
- m_op = m_instruction->read_dword(m_pc);
+ m_op = m_instruction.read_dword(m_pc);
execute_unstoppable_instructions(1);
exception(EXC_INT);
}
@@ -1490,11 +1490,11 @@ void psxcpu_device::fetch_next_op()
{
uint32_t safepc = m_delayv & ~m_bad_word_address_mask;
- m_op = m_instruction->read_dword( safepc );
+ m_op = m_instruction.read_dword( safepc );
}
else
{
- m_op = m_instruction->read_dword( m_pc + 4 );
+ m_op = m_instruction.read_dword( m_pc + 4 );
}
}
@@ -1837,8 +1837,8 @@ void psxcpu_device::device_start()
{
// get our address spaces
m_program = &space( AS_PROGRAM );
- m_instruction = m_program->cache<2, 0, ENDIANNESS_LITTLE>();
- m_data = m_program->specific<2, 0, ENDIANNESS_LITTLE>();
+ m_program->cache(m_instruction);
+ m_program->specific(m_data);
save_item( NAME( m_op ) );
save_item( NAME( m_pc ) );
@@ -2350,7 +2350,7 @@ void psxcpu_device::execute_run()
}
else
{
- m_op = m_instruction->read_dword(m_pc);
+ m_op = m_instruction.read_dword(m_pc);
if( m_berr )
{