From dd1fe09ce3ce3472a7ed39869eb4715ed98e04eb Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 21 Apr 2023 03:21:37 +1000 Subject: cpu/psx/rcnt.cpp: Suppress side effects. --- src/devices/cpu/psx/rcnt.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/devices/cpu/psx/rcnt.cpp b/src/devices/cpu/psx/rcnt.cpp index a52c4e116f6..cdca5953509 100644 --- a/src/devices/cpu/psx/rcnt.cpp +++ b/src/devices/cpu/psx/rcnt.cpp @@ -60,8 +60,8 @@ void psxrcnt_device::device_start() void psxrcnt_device::write(offs_t offset, uint32_t data, uint32_t mem_mask) { - int n_counter = offset / 4; - psx_root *root = &root_counter[ n_counter ]; + int const n_counter = offset / 4; + psx_root *const root = &root_counter[ n_counter ]; LOG( "%s: psx_counter_w ( %08x, %08x, %08x )\n", machine().describe_context(), offset, data, mem_mask ); @@ -107,8 +107,8 @@ void psxrcnt_device::write(offs_t offset, uint32_t data, uint32_t mem_mask) uint32_t psxrcnt_device::read(offs_t offset, uint32_t mem_mask) { - int n_counter = offset / 4; - psx_root *root = &root_counter[ n_counter ]; + int const n_counter = offset / 4; + psx_root *const root = &root_counter[ n_counter ]; uint32_t data; switch( offset % 4 ) @@ -118,16 +118,19 @@ uint32_t psxrcnt_device::read(offs_t offset, uint32_t mem_mask) break; case 1: data = root->n_mode; - root->n_mode &= ~( PSX_RC_REACHEDFFFF | PSX_RC_REACHEDTARGET ); + if (!machine().side_effects_disabled()) + root->n_mode &= ~( PSX_RC_REACHEDFFFF | PSX_RC_REACHEDTARGET ); break; case 2: data = root->n_target; break; default: - logerror( "%s: psx_counter_r( %08x, %08x ) unknown register\n", machine().describe_context(), offset, mem_mask ); + if (!machine().side_effects_disabled()) + logerror( "%s: psx_counter_r( %08x, %08x ) unknown register\n", machine().describe_context(), offset, mem_mask ); return 0; } - LOG( "%s: psx_counter_r ( %08x, %08x ) %08x\n", machine().describe_context(), offset, mem_mask, data ); + if (!machine().side_effects_disabled()) + LOG( "%s: psx_counter_r ( %08x, %08x ) %08x\n", machine().describe_context(), offset, mem_mask, data ); return data; } @@ -139,7 +142,7 @@ uint64_t psxrcnt_device::gettotalcycles( void ) int psxrcnt_device::root_divider( int n_counter ) { - psx_root *root = &root_counter[ n_counter ]; + psx_root *const root = &root_counter[ n_counter ]; if( n_counter == 0 && ( root->n_mode & PSX_RC_CLC ) != 0 ) { @@ -159,7 +162,7 @@ int psxrcnt_device::root_divider( int n_counter ) uint16_t psxrcnt_device::root_current( int n_counter ) { - psx_root *root = &root_counter[ n_counter ]; + psx_root *const root = &root_counter[ n_counter ]; if( ( root->n_mode & PSX_RC_STOP ) != 0 ) { @@ -184,7 +187,7 @@ uint16_t psxrcnt_device::root_current( int n_counter ) int psxrcnt_device::root_target( int n_counter ) { - psx_root *root = &root_counter[ n_counter ]; + psx_root *const root = &root_counter[ n_counter ]; if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 || ( root->n_mode & PSX_RC_IRQTARGET ) != 0 ) @@ -196,7 +199,7 @@ int psxrcnt_device::root_target( int n_counter ) void psxrcnt_device::root_timer_adjust( int n_counter ) { - psx_root *root = &root_counter[ n_counter ]; + psx_root *const root = &root_counter[ n_counter ]; if( ( root->n_mode & PSX_RC_STOP ) != 0 ) { @@ -230,8 +233,8 @@ void psxrcnt_device::root_timer_adjust( int n_counter ) TIMER_CALLBACK_MEMBER( psxrcnt_device::timer_update ) { - int n_counter = param; - psx_root *root = &root_counter[ n_counter ]; + int const n_counter = param; + psx_root *const root = &root_counter[ n_counter ]; LOG( "root_finished( %d ) %04x\n", n_counter, root_current( n_counter ) ); //if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 ) -- cgit v1.2.3