m68k: allow RTE to unwind type 1000 (68010 bus error) stack frames [R. Belmont]

This commit is contained in:
arbee 2020-02-08 16:47:53 -05:00
parent 3e6ace480a
commit 288b397098
2 changed files with 60 additions and 8 deletions

View File

@ -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();

View File

@ -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();