if (support_exceptions && !jit_fpu()) {
if (regs.fp_exp_pend) {
if (warned > 0) {
- write_log (_T("FPU ARITHMETIC EXCEPTION (%d) PC=%08x\n"), regs.fp_exp_pend, regs.instruction_pc);
+ write_log(_T("FPU ARITHMETIC EXCEPTION (%d) PC=%08x\n"), regs.fp_exp_pend, regs.instruction_pc);
}
regs.fpu_exp_pre = pre;
Exception(regs.fp_exp_pend);
// no arithmetic exceptions pending, check for unimplemented datatype
if (regs.fp_unimp_pend) {
if (warned > 0) {
- write_log (_T("FPU unimplemented datatype exception (%s) PC=%08x\n"), pre ? _T("pre") : _T("mid/post"), regs.instruction_pc);
+ write_log(_T("FPU unimplemented datatype exception (%s) PC=%08x\n"), pre ? _T("pre") : _T("mid/post"), regs.instruction_pc);
}
if (currprefs.cpu_model == 68060 && fpu_mmu_fixup) {
m68k_areg(regs, mmufixup[0].reg) = mmufixup[0].value;
{
if (regs.fp_unimp_ins) {
if (warned > 0) {
- write_log (_T("FPU UNIMPLEMENTED INSTRUCTION/FPU DISABLED EXCEPTION PC=%08x\n"), M68K_GETPC);
+ write_log(_T("FPU UNIMPLEMENTED INSTRUCTION/FPU DISABLED EXCEPTION PC=%08x\n"), M68K_GETPC);
}
if (currprefs.cpu_model == 68060 && fpu_mmu_fixup) {
m68k_areg(regs, mmufixup[0].reg) = mmufixup[0].value;
regs.fpsr |= FPSR_AE_IOP;
if (regs.fpcr & FPSR_BSUN) {
- write_log (_T("FPU exception: BSUN! (FPSR: %08x, FPCR: %08x)\n"), regs.fpsr, regs.fpcr);
+ write_log(_T("FPU exception: BSUN! (FPSR: %08x, FPCR: %08x)\n"), regs.fpsr, regs.fpcr);
if (support_exceptions && !jit_fpu()) {
regs.fp_exp_pend = fpsr_get_vector(FPSR_BSUN);
fp_exception_pending(true);
}
}
if (warned > 0) {
- write_log (_T("FPU unimplemented instruction: OP=%04X-%04X SRC=%08X-%08X-%08X EA=%08X PC=%08X\n"),
+ write_log(_T("FPU unimplemented instruction: OP=%04X-%04X SRC=%08X-%08X-%08X EA=%08X PC=%08X\n"),
opcode, extra, fsave_data.et[0],fsave_data.et[1],fsave_data.et[2], ea, oldpc);
#if EXCEPTION_FPP == 0
warned--;
}
}
if (warned > 0) {
- write_log (_T("FPU unimplemented datatype (%s): OP=%04X-%04X SRC=%08X-%08X-%08X EA=%08X PC=%08X\n"),
+ write_log(_T("FPU unimplemented datatype (%s): OP=%04X-%04X SRC=%08X-%08X-%08X EA=%08X PC=%08X\n"),
packed ? _T("packed") : _T("denormal"), opcode, extra,
packed ? fsave_data.fpt[2] : fsave_data.et[0], fsave_data.et[1], fsave_data.et[2], ea, oldpc);
#if EXCEPTION_FPP == 0
return;
}
regs.fp_exception = true;
- m68k_setpc (oldpc);
+ m68k_setpc(oldpc);
op_illg(opcode);
}
static void fpu_noinst(uae_u16 opcode, uaecptr pc)
{
#if EXCEPTION_FPP
- write_log (_T("Unknown FPU instruction %04X %08X\n"), opcode, pc);
+ write_log(_T("Unknown FPU instruction %04X %08X\n"), opcode, pc);
#endif
regs.fp_exception = true;
m68k_setpc(pc);
return (regs.pcr & 2) || currprefs.fpu_model <= 0;
}
-static bool fault_if_no_fpu (uae_u16 opcode, uae_u16 extra, uaecptr ea, bool easet, uaecptr oldpc)
+static bool fault_if_no_fpu(uae_u16 opcode, uae_u16 extra, uaecptr ea, bool easet, uaecptr oldpc)
{
if (if_no_fpu()) {
#if EXCEPTION_FPP
- write_log (_T("no FPU: %04X-%04X PC=%08X\n"), opcode, extra, oldpc);
+ write_log(_T("no FPU: %04X-%04X PC=%08X\n"), opcode, extra, oldpc);
#endif
if (fpu_mmu_fixup) {
m68k_areg (regs, mmufixup[0].reg) = mmufixup[0].value;
{
if (currprefs.cpu_model < 68040 && currprefs.fpu_model <= 0) {
#if EXCEPTION_FPP
- write_log (_T("6888x no FPU: %04X-%04X PC=%08X\n"), opcode, extra, oldpc);
+ write_log(_T("6888x no FPU: %04X-%04X PC=%08X\n"), opcode, extra, oldpc);
#endif
m68k_setpc (oldpc);
regs.fp_exception = true;
#if DEBUG_FPP
if (!isinrom ())
- write_log (_T("PUTFP: %04X %04X\n"), opcode, extra);
+ write_log(_T("PUTFP: %04X %04X\n"), opcode, extra);
#endif
#if 0
if (!(extra & 0x4000)) {
#if FPU_LOG
if (!isinrom())
- write_log (_T("FRESTORE %04x %08x\n"), opcode, M68K_GETPC);
+ write_log(_T("FRESTORE %04x %08x\n"), opcode, M68K_GETPC);
#endif
if (fault_if_no_6888x (opcode, 0, pc))
regs.fp_exp_pend = 48 + v;
}
} else if (ff) {
- write_log (_T("FRESTORE invalid frame format %02x %08x ADDR=%08x\n"), ff, d, ad_orig);
+ write_log(_T("FRESTORE invalid frame format %02x %08x ADDR=%08x\n"), ff, d, ad_orig);
Exception(14);
return;
} else {
uae_u32 tmpsrc[3], tmpdst[3];
fpp_from_exten_fmovem(&src, &tmpsrc[0], &tmpsrc[1], &tmpsrc[2]);
fpp_from_exten_fmovem(&dst, &tmpdst[0], &tmpdst[1], &tmpdst[2]);
- write_log (_T("FRESTORE src = %08X %08X %08X, dst = %08X %08X %08X, extra = %04X\n"),
+ write_log(_T("FRESTORE src = %08X %08X %08X, dst = %08X %08X %08X, extra = %04X\n"),
tmpsrc[0], tmpsrc[1], tmpsrc[2], tmpdst[0], tmpdst[1], tmpdst[2], cmdreg1b);
#endif
fpsr_clear_status();
fpsr_check_arithmetic_exception(0, &src, regs.fp_opword, cmdreg1b, regs.fp_ea, regs.fp_ea_set, 0xffffffff);
} else {
- write_log (_T("FRESTORE resume of opclass %d instruction not supported %08x\n"), opclass, ad_orig);
+ write_log(_T("FRESTORE resume of opclass %d instruction not supported %08x\n"), opclass, ad_orig);
}
}
regs.fpu_state = 1;
regs.fpu_exp_state = 0;
} else {
- write_log (_T("FRESTORE invalid frame size %02x %08x %08x\n"), frame_size, d, ad_orig);
+ write_log(_T("FRESTORE invalid frame size %02x %08x %08x\n"), frame_size, d, ad_orig);
Exception(14);
return;
fpu_model = 68881;
goto retry;
}
- write_log (_T("FRESTORE 68040 (%d) invalid frame version %02x %08x %08x\n"), fpu_model, frame_version, d, ad_orig);
+ write_log(_T("FRESTORE 68040 (%d) invalid frame version %02x %08x %08x\n"), fpu_model, frame_version, d, ad_orig);
Exception(14);
return;
}
regs.fp_exp_pend = 0;
}
} else if (frame_size == 0xB4 || frame_size == 0xD4) {
- write_log (_T("FRESTORE of busy frame not supported %08x\n"), ad_orig);
+ write_log(_T("FRESTORE of busy frame not supported %08x\n"), ad_orig);
ad += frame_size;
} else {
- write_log (_T("FRESTORE invalid frame size %02x %08x %08x\n"), frame_size, d, ad_orig);
+ write_log(_T("FRESTORE invalid frame size %02x %08x %08x\n"), frame_size, d, ad_orig);
Exception(14);
return;
}
fpu_model = 68040;
goto retry;
}
- write_log (_T("FRESTORE 6888x (%d) invalid frame version %02x %08x %08x\n"), fpu_model, frame_version, d, ad_orig);
+ write_log(_T("FRESTORE 6888x (%d) invalid frame version %02x %08x %08x\n"), fpu_model, frame_version, d, ad_orig);
Exception(14);
return;
}
return false;
}
default:
- write_log (_T("Unknown FPU arithmetic function (%02x)\n"), extra & 0x7f);
+ write_log(_T("Unknown FPU arithmetic function (%02x)\n"), extra & 0x7f);
return false;
}
#if DEBUG_FPP
if (!isinrom ())
- write_log (_T("FPP %04x %04x at %08x\n"), opcode & 0xffff, extra, pc);
+ write_log(_T("FPP %04x %04x at %08x\n"), opcode & 0xffff, extra, pc);
#endif
if (fault_if_no_6888x(opcode, extra, pc))
return;
regs.halted = 0;
gui_data.cpu_halted = 0;
- gui_led (LED_CPU, 0, -1);
+ gui_led(LED_CPU, 0, -1);
regs.spcflags = 0;
m68k_reset_delay = 0;
update_68k_cycles();
#ifdef SAVESTATE
- if (isrestore ()) {
+ if (isrestore()) {
m68k_reset_sr();
- m68k_setpc_normal (regs.pc);
+ m68k_setpc_normal(regs.pc);
return;
} else {
m68k_reset_delay = currprefs.reset_delay;
if (currprefs.cpuboard_type) {
uaecptr stack;
v = cpuboard_get_reset_pc(&stack);
- m68k_areg (regs, 7) = stack;
+ m68k_areg(regs, 7) = stack;
} else {
- v = get_long (4);
- m68k_areg (regs, 7) = get_long (0);
+ v = get_long(4);
+ m68k_areg(regs, 7) = get_long(0);
}
m68k_setpc_normal(v);
regs.stopped = 0;
regs.t1 = 0;
regs.t0 = 0;
- SET_ZFLG (0);
- SET_XFLG (0);
- SET_CFLG (0);
- SET_VFLG (0);
- SET_NFLG (0);
+ SET_ZFLG(0);
+ SET_XFLG(0);
+ SET_CFLG(0);
+ SET_VFLG(0);
+ SET_NFLG(0);
regs.intmask = 7;
regs.vbr = regs.sfc = regs.dfc = 0;
regs.irc = 0xffff;
#ifdef FPUEMU
- fpu_reset ();
+ fpu_reset();
#endif
regs.caar = regs.cacr = 0;
regs.itt0 = regs.itt1 = regs.dtt0 = regs.dtt1 = 0;
regs.tcr = regs.mmusr = regs.urp = regs.srp = regs.buscr = 0;
- mmu_tt_modified ();
+ mmu_tt_modified();
if (currprefs.cpu_model == 68020) {
regs.cacr |= 8;
set_cpu_caches (false);
set_cpu_caches(false);
}
if (currprefs.mmu_model >= 68040) {
- mmu_reset ();
- mmu_set_tc (regs.tcr);
- mmu_set_super (regs.s != 0);
+ mmu_reset();
+ mmu_set_tc(regs.tcr);
+ mmu_set_super(regs.s != 0);
} else if (currprefs.mmu_model == 68030) {
- mmu030_reset (hardreset || regs.halted);
+ mmu030_reset(hardreset || regs.halted);
} else {
a3000_fakekick (0);
/* only (E)nable bit is zeroed when CPU is reset, A3000 SuperKickstart expects this */
// regs.ce020memcycles = 0;
regs.ce020startcycle = regs.ce020endcycle = 0;
- fill_prefetch ();
+ fill_prefetch();
}
void m68k_reset(void)
// id < 0: m68k halted, PPC active.
// id > 0: emulation halted.
if (!regs.halted) {
- write_log (_T("CPU halted: reason = %d PC=%08x\n"), id, M68K_GETPC);
+ write_log(_T("CPU halted: reason = %d PC=%08x\n"), id, M68K_GETPC);
if (currprefs.crash_auto_reset) {
write_log(_T("Forcing hard reset\n"));
uae_reset(true, false);
gui_led(LED_CPU, 0, -1);
if (id >= 0) {
regs.intmask = 7;
- MakeSR ();
- audio_deactivate ();
+ MakeSR();
+ audio_deactivate();
if (debugging)
activate_debugger();
}