mirror of
https://github.com/holub/mame
synced 2025-07-17 07:19:48 +03:00
Added a check for a bus error when fetching an instruction, the bus error condition is cleared before the fetch so bus errors in the debugger don't cause an exception to be triggered. [smf]
This commit is contained in:
parent
d62b776560
commit
52721f795b
@ -73,6 +73,7 @@
|
|||||||
#define EXC_INT ( 0 )
|
#define EXC_INT ( 0 )
|
||||||
#define EXC_ADEL ( 4 )
|
#define EXC_ADEL ( 4 )
|
||||||
#define EXC_ADES ( 5 )
|
#define EXC_ADES ( 5 )
|
||||||
|
#define EXC_IBE ( 6 )
|
||||||
#define EXC_DBE ( 7 )
|
#define EXC_DBE ( 7 )
|
||||||
#define EXC_SYS ( 8 )
|
#define EXC_SYS ( 8 )
|
||||||
#define EXC_BP ( 9 )
|
#define EXC_BP ( 9 )
|
||||||
@ -1072,7 +1073,6 @@ void psxcpu_device::log_bioscall()
|
|||||||
sprintf( buf, "unknown_%02x_%02x", address, operation );
|
sprintf( buf, "unknown_%02x_%02x", address, operation );
|
||||||
}
|
}
|
||||||
logerror( "%08x: bioscall %s\n", (unsigned int)m_r[ 31 ] - 8, buf );
|
logerror( "%08x: bioscall %s\n", (unsigned int)m_r[ 31 ] - 8, buf );
|
||||||
m_berr = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1576,7 +1576,6 @@ void psxcpu_device::common_exception( int exception, UINT32 romOffset, UINT32 ra
|
|||||||
|
|
||||||
m_delayr = 0;
|
m_delayr = 0;
|
||||||
m_delayv = 0;
|
m_delayv = 0;
|
||||||
m_berr = 0;
|
|
||||||
|
|
||||||
if( m_cp0r[ CP0_SR ] & SR_BEV )
|
if( m_cp0r[ CP0_SR ] & SR_BEV )
|
||||||
{
|
{
|
||||||
@ -1604,6 +1603,11 @@ void psxcpu_device::breakpoint_exception()
|
|||||||
common_exception( EXC_BP, 0xbfc00140, 0x80000040 );
|
common_exception( EXC_BP, 0xbfc00140, 0x80000040 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void psxcpu_device::fetch_bus_error_exception()
|
||||||
|
{
|
||||||
|
common_exception( EXC_IBE, 0xbfc00180, 0x80000080 );
|
||||||
|
}
|
||||||
|
|
||||||
void psxcpu_device::load_bus_error_exception()
|
void psxcpu_device::load_bus_error_exception()
|
||||||
{
|
{
|
||||||
fetch_next_op();
|
fetch_next_op();
|
||||||
@ -1942,7 +1946,6 @@ void psxcpu_device::device_reset()
|
|||||||
|
|
||||||
m_delayr = 0;
|
m_delayr = 0;
|
||||||
m_delayv = 0;
|
m_delayv = 0;
|
||||||
m_berr = 0;
|
|
||||||
m_biu = 0;
|
m_biu = 0;
|
||||||
|
|
||||||
m_multiplier_operation = MULTIPLIER_OPERATION_IDLE;
|
m_multiplier_operation = MULTIPLIER_OPERATION_IDLE;
|
||||||
@ -2274,7 +2277,15 @@ void psxcpu_device::execute_run()
|
|||||||
if (LOG_BIOSCALL) log_bioscall();
|
if (LOG_BIOSCALL) log_bioscall();
|
||||||
debugger_instruction_hook( this, m_pc );
|
debugger_instruction_hook( this, m_pc );
|
||||||
|
|
||||||
|
m_berr = 0;
|
||||||
m_op = m_direct->read_decrypted_dword( m_pc );
|
m_op = m_direct->read_decrypted_dword( m_pc );
|
||||||
|
|
||||||
|
if( m_berr )
|
||||||
|
{
|
||||||
|
fetch_bus_error_exception();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch( INS_OP( m_op ) )
|
switch( INS_OP( m_op ) )
|
||||||
{
|
{
|
||||||
case OP_SPECIAL:
|
case OP_SPECIAL:
|
||||||
@ -3264,6 +3275,8 @@ void psxcpu_device::execute_run()
|
|||||||
exception( EXC_RI );
|
exception( EXC_RI );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_icount--;
|
m_icount--;
|
||||||
} while( m_icount > 0 );
|
} while( m_icount > 0 );
|
||||||
}
|
}
|
||||||
|
@ -297,6 +297,7 @@ protected:
|
|||||||
void common_exception( int exception, UINT32 romOffset, UINT32 ramOffset );
|
void common_exception( int exception, UINT32 romOffset, UINT32 ramOffset );
|
||||||
void exception( int exception );
|
void exception( int exception );
|
||||||
void breakpoint_exception();
|
void breakpoint_exception();
|
||||||
|
void fetch_bus_error_exception();
|
||||||
void load_bus_error_exception();
|
void load_bus_error_exception();
|
||||||
void store_bus_error_exception();
|
void store_bus_error_exception();
|
||||||
void load_bad_address( UINT32 address );
|
void load_bad_address( UINT32 address );
|
||||||
|
Loading…
Reference in New Issue
Block a user