m68000: Add exception hook for debugger gex command

This commit is contained in:
AJR 2020-05-02 18:39:12 -04:00
parent 1fa06800dd
commit 0894eb27f7
2 changed files with 15 additions and 19 deletions

View File

@ -763,7 +763,7 @@ void m68000_base_device::m68k_cause_bus_error()
return;
}
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_BUS_ERROR);
m_run_mode = RUN_MODE_BERR_AERR_RESET_WSF;
@ -951,7 +951,7 @@ void m68000_base_device::execute_run()
}
}
sr = m68ki_init_exception();
sr = m68ki_init_exception(EXCEPTION_BUS_ERROR);
m_run_mode = RUN_MODE_BERR_AERR_RESET;
@ -2278,7 +2278,7 @@ void m68000_base_device::m68ki_exception_interrupt(u32 int_level)
vector = m_cpu_space->read_word(0xfffffff0 | (int_level << 1)) & 0xff;
/* Start exception processing */
sr = m68ki_init_exception();
sr = m68ki_init_exception(vector);
/* Set the interrupt mask to the level of the one being serviced */
m_int_mask = int_level<<8;

View File

@ -1108,8 +1108,10 @@ inline void m68ki_set_sr(u32 value)
/* ------------------------- Exception Processing ------------------------- */
/* Initiate exception processing */
inline u32 m68ki_init_exception()
inline u32 m68ki_init_exception(u32 vector)
{
debugger_exception_hook(vector);
/* Save the old status register */
u32 sr = m68ki_get_sr();
@ -1454,7 +1456,7 @@ inline void m68ki_stack_frame_0111(u32 sr, u32 vector, u32 pc, u32 fault_address
*/
inline void m68ki_exception_trap(u32 vector)
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(vector);
if(CPU_TYPE_IS_010_LESS())
m68ki_stack_frame_0000(m_pc, sr, vector);
@ -1470,7 +1472,7 @@ inline void m68ki_exception_trap(u32 vector)
/* Trap#n stacks a 0 frame but behaves like group2 otherwise */
inline void m68ki_exception_trapN(u32 vector)
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(vector);
m68ki_stack_frame_0000(m_pc, sr, vector);
m68ki_jump_vector(vector);
@ -1481,7 +1483,7 @@ inline void m68ki_exception_trapN(u32 vector)
/* Exception for trace mode */
inline void m68ki_exception_trace()
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_TRACE);
if(CPU_TYPE_IS_010_LESS())
{
@ -1506,7 +1508,7 @@ inline void m68ki_exception_trace()
/* Exception for privilege violation */
inline void m68ki_exception_privilege_violation()
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_PRIVILEGE_VIOLATION);
if(CPU_TYPE_IS_000())
{
@ -1523,9 +1525,7 @@ inline void m68ki_exception_privilege_violation()
/* Exception for A-Line instructions */
inline void m68ki_exception_1010()
{
u32 sr;
sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_1010);
m68ki_stack_frame_0000(m_ppc, sr, EXCEPTION_1010);
m68ki_jump_vector(EXCEPTION_1010);
@ -1536,9 +1536,7 @@ inline void m68ki_exception_1010()
/* Exception for F-Line instructions */
inline void m68ki_exception_1111()
{
u32 sr;
sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_1111);
m68ki_stack_frame_0000(m_ppc, sr, EXCEPTION_1111);
m68ki_jump_vector(EXCEPTION_1111);
@ -1549,9 +1547,7 @@ inline void m68ki_exception_1111()
/* Exception for illegal instructions */
inline void m68ki_exception_illegal()
{
u32 sr;
sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_ILLEGAL_INSTRUCTION);
if(CPU_TYPE_IS_000())
{
@ -1568,7 +1564,7 @@ inline void m68ki_exception_illegal()
/* Exception for format errror in RTE */
inline void m68ki_exception_format_error()
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_FORMAT_ERROR);
m68ki_stack_frame_0000(m_pc, sr, EXCEPTION_FORMAT_ERROR);
m68ki_jump_vector(EXCEPTION_FORMAT_ERROR);
@ -1579,7 +1575,7 @@ inline void m68ki_exception_format_error()
/* Exception for address error */
inline void m68ki_exception_address_error()
{
u32 sr = m68ki_init_exception();
u32 sr = m68ki_init_exception(EXCEPTION_ADDRESS_ERROR);
/* If we were processing a bus error, address error, or reset,
* this is a catastrophic failure.