summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2020-02-08 16:47:53 -0500
committer arbee <rb6502@users.noreply.github.com>2020-02-08 16:47:53 -0500
commit288b39709805d80ce91c09c4f0af12fa1972f948 (patch)
tree68b36389bd192db9bca098fca15277296c938e12
parent3e6ace480ade79e63ac80c51abd5371f4f9cea02 (diff)
m68k: allow RTE to unwind type 1000 (68010 bus error) stack frames [R. Belmont]
-rw-r--r--src/devices/cpu/m68000/m68k_in.lst34
-rw-r--r--src/devices/cpu/m68000/m68kops.cpp34
2 files changed, 60 insertions, 8 deletions
diff --git a/src/devices/cpu/m68000/m68k_in.lst b/src/devices/cpu/m68000/m68k_in.lst
index 94961a37451..78583dc144d 100644
--- a/src/devices/cpu/m68000/m68k_in.lst
+++ b/src/devices/cpu/m68000/m68k_in.lst
@@ -6886,10 +6886,36 @@ e5c0 ffc0 roxl w A+-DXWL 01:8 7:14 234fc:5
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
} else {
- m_instr_mode = INSTRUCTION_YES;
- m_run_mode = RUN_MODE_NORMAL;
- /* Not handling bus fault (9) */
- m68ki_exception_format_error();
+ if (format_word == 0x8) /* type 1000 stack frame */
+ {
+ new_sr = m68ki_pull_16();
+ new_pc = m68ki_pull_32();
+ m68ki_fake_pull_16(); /* format word */
+ m68ki_jump(new_pc);
+ m68ki_set_sr(new_sr);
+ m_instr_mode = INSTRUCTION_YES;
+ m_run_mode = RUN_MODE_NORMAL;
+ m68ki_fake_pull_16(); /* special status */
+ m68ki_fake_pull_32(); /* fault address */
+ m68ki_fake_pull_32(); /* reserved and data output buffer */
+ m68ki_fake_pull_32(); /* reserved and data input buffer */
+ m68ki_fake_pull_32(); /* reserved and instruction input buffer */
+ m68ki_fake_pull_32(); /* 8 dwords of CPU specific undocumented data */
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ }
+ else
+ {
+ m_instr_mode = INSTRUCTION_YES;
+ m_run_mode = RUN_MODE_NORMAL;
+ /* Not handling bus fault (9) */
+ m68ki_exception_format_error();
+ }
}
} else {
m68ki_exception_privilege_violation();
diff --git a/src/devices/cpu/m68000/m68kops.cpp b/src/devices/cpu/m68000/m68kops.cpp
index 3d767be723a..9413f9a6271 100644
--- a/src/devices/cpu/m68000/m68kops.cpp
+++ b/src/devices/cpu/m68000/m68kops.cpp
@@ -26542,10 +26542,36 @@ void m68000_base_device::x4e73_rte_l_71()
m_instr_mode = INSTRUCTION_YES;
m_run_mode = RUN_MODE_NORMAL;
} else {
- m_instr_mode = INSTRUCTION_YES;
- m_run_mode = RUN_MODE_NORMAL;
- /* Not handling bus fault (9) */
- m68ki_exception_format_error();
+ if (format_word == 0x8) /* type 1000 stack frame */
+ {
+ new_sr = m68ki_pull_16();
+ new_pc = m68ki_pull_32();
+ m68ki_fake_pull_16(); /* format word */
+ m68ki_jump(new_pc);
+ m68ki_set_sr(new_sr);
+ m_instr_mode = INSTRUCTION_YES;
+ m_run_mode = RUN_MODE_NORMAL;
+ m68ki_fake_pull_16(); /* special status */
+ m68ki_fake_pull_32(); /* fault address */
+ m68ki_fake_pull_32(); /* reserved and data output buffer */
+ m68ki_fake_pull_32(); /* reserved and data input buffer */
+ m68ki_fake_pull_32(); /* reserved and instruction input buffer */
+ m68ki_fake_pull_32(); /* 8 dwords of CPU specific undocumented data */
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ m68ki_fake_pull_32();
+ }
+ else
+ {
+ m_instr_mode = INSTRUCTION_YES;
+ m_run_mode = RUN_MODE_NORMAL;
+ /* Not handling bus fault (9) */
+ m68ki_exception_format_error();
+ }
}
} else {
m68ki_exception_privilege_violation();