| 1611 | } |
| 1612 | |
| 1613 | void Exception_build_stack_frame_common(uae_u32 oldpc, uae_u32 currpc, uae_u32 ssw, int nr, int vector_nr) |
| 1614 | { |
| 1615 | if (nr == 5 || nr == 6 || nr == 7 || nr == 9) { |
| 1616 | if (nr == 9) |
| 1617 | oldpc = regs.trace_pc; |
| 1618 | if (currprefs.cpu_model <= 68010) |
| 1619 | Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, vector_nr, 0x0); |
| 1620 | else |
| 1621 | Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, vector_nr, 0x2); |
| 1622 | } else if (nr == 60 || nr == 61) { |
| 1623 | Exception_build_stack_frame(oldpc, regs.instruction_pc, regs.mmu_ssw, vector_nr, 0x0); |
| 1624 | } else if (nr >= 48 && nr <= 55) { |
| 1625 | if (regs.fpu_exp_pre) { |
| 1626 | if (currprefs.cpu_model == 68060 && nr == 55 && regs.fp_unimp_pend == 2) { // packed decimal real |
| 1627 | Exception_build_stack_frame(regs.fp_ea, regs.instruction_pc, 0, vector_nr, 0x2); |
| 1628 | } else { |
| 1629 | Exception_build_stack_frame(oldpc, regs.instruction_pc, 0, vector_nr, 0x0); |
| 1630 | } |
| 1631 | } else { /* post-instruction */ |
| 1632 | if (currprefs.cpu_model == 68060 && nr == 55 && regs.fp_unimp_pend == 2) { // packed decimal real |
| 1633 | Exception_build_stack_frame(regs.fp_ea, currpc, 0, vector_nr, 0x2); |
| 1634 | } else { |
| 1635 | Exception_build_stack_frame(oldpc, currpc, 0, vector_nr, 0x3); |
| 1636 | } |
| 1637 | } |
| 1638 | } else if (nr == 11 && regs.fp_unimp_ins) { |
| 1639 | regs.fp_unimp_ins = false; |
| 1640 | if ((currprefs.cpu_model == 68060 && (currprefs.fpu_model == 0 || (regs.pcr & 2))) || |
| 1641 | (currprefs.cpu_model == 68040 && currprefs.fpu_model == 0)) { |
| 1642 | Exception_build_stack_frame(regs.fp_ea, currpc, regs.instruction_pc, vector_nr, 0x4); |
| 1643 | } else { |
| 1644 | Exception_build_stack_frame(regs.fp_ea, currpc, regs.mmu_ssw, vector_nr, 0x2); |
| 1645 | } |
| 1646 | } else { |
| 1647 | Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, vector_nr, 0x0); |
| 1648 | } |
| 1649 | } |
| 1650 | |
| 1651 | void Exception_build_68000_address_error_stack_frame(uae_u16 mode, uae_u16 opcode, uaecptr fault_addr, uaecptr pc) |
| 1652 | { |