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:
smf- 2013-05-23 21:35:03 +00:00
parent d62b776560
commit 52721f795b
2 changed files with 876 additions and 862 deletions

View File

@ -73,6 +73,7 @@
#define EXC_INT ( 0 )
#define EXC_ADEL ( 4 )
#define EXC_ADES ( 5 )
#define EXC_IBE ( 6 )
#define EXC_DBE ( 7 )
#define EXC_SYS ( 8 )
#define EXC_BP ( 9 )
@ -1072,7 +1073,6 @@ void psxcpu_device::log_bioscall()
sprintf( buf, "unknown_%02x_%02x", address, operation );
}
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_delayv = 0;
m_berr = 0;
if( m_cp0r[ CP0_SR ] & SR_BEV )
{
@ -1604,6 +1603,11 @@ void psxcpu_device::breakpoint_exception()
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()
{
fetch_next_op();
@ -1942,7 +1946,6 @@ void psxcpu_device::device_reset()
m_delayr = 0;
m_delayv = 0;
m_berr = 0;
m_biu = 0;
m_multiplier_operation = MULTIPLIER_OPERATION_IDLE;
@ -2274,7 +2277,15 @@ void psxcpu_device::execute_run()
if (LOG_BIOSCALL) log_bioscall();
debugger_instruction_hook( this, m_pc );
m_berr = 0;
m_op = m_direct->read_decrypted_dword( m_pc );
if( m_berr )
{
fetch_bus_error_exception();
}
else
{
switch( INS_OP( m_op ) )
{
case OP_SPECIAL:
@ -3264,6 +3275,8 @@ void psxcpu_device::execute_run()
exception( EXC_RI );
break;
}
}
m_icount--;
} while( m_icount > 0 );
}

View File

@ -297,6 +297,7 @@ protected:
void common_exception( int exception, UINT32 romOffset, UINT32 ramOffset );
void exception( int exception );
void breakpoint_exception();
void fetch_bus_error_exception();
void load_bus_error_exception();
void store_bus_error_exception();
void load_bad_address( UINT32 address );