summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-05-02 18:39:12 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-05-02 18:39:12 -0400
commit0894eb27f7c785e01b79e62ea4c5b14b5bd92a85 (patch)
tree0a343611ac21cc4197df139643ba59fe875141b7
parent1fa06800ddc4b13d8611f0a8a9fa9b7a5d270870 (diff)
m68000: Add exception hook for debugger gex command
-rw-r--r--src/devices/cpu/m68000/m68kcpu.cpp6
-rw-r--r--src/devices/cpu/m68000/m68kcpu.h28
2 files changed, 15 insertions, 19 deletions
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp
index d47f1e8a8b0..a14d411e279 100644
--- a/src/devices/cpu/m68000/m68kcpu.cpp
+++ b/src/devices/cpu/m68000/m68kcpu.cpp
@@ -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;
diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h
index c712a861585..1502b09d775 100644
--- a/src/devices/cpu/m68000/m68kcpu.h
+++ b/src/devices/cpu/m68000/m68kcpu.h
@@ -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.