if ((opcode & 0xF000) == 0xA000 && inrt) {
/* Calltrap. */
m68k_incpc_normal (2);
- m68k_handle_trap (opcode & 0xFFF);
+ m68k_handle_trap(opcode & 0xFFF);
fill_prefetch ();
return 4;
}
static void m68k_run_1 (void)
{
struct regstruct *r = ®s;
+ bool exit = false;
- for (;;) {
+ while (!exit) {
TRY (prb) {
- for (;;) {
+ while (!exit) {
r->opcode = r->ir;
count_instr (r->opcode);
cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
if (r->spcflags) {
- if (do_specialties (cpu_cycles)) {
- regs.ipl = regs.ipl_pin;
- return;
- }
+ if (do_specialties (cpu_cycles))
+ exit = true;
}
regs.ipl = regs.ipl_pin;
if (!currprefs.cpu_compatible || (currprefs.cpu_cycle_exact && currprefs.cpu_model <= 68000))
- return;
+ exit = true;
}
} CATCH (prb) {
bus_error();
+ if (r->spcflags) {
+ if (do_specialties(cpu_cycles))
+ exit = true;
+ }
+ regs.ipl = regs.ipl_pin;
} ENDTRY
}
}
{
struct regstruct *r = ®s;
bool first = true;
+ bool exit = false;
- for(;;) {
+ while (!exit) {
TRY (prb) {
if (first) {
if (cpu_tracer < 0) {
first = false;
}
- for (;;) {
+ while (!exit) {
r->opcode = r->ir;
#if DEBUG_CD32CDTVIO
if (r->spcflags || time_for_interrupt ()) {
if (do_specialties (0))
- return;
+ exit = true;
}
if (!currprefs.cpu_cycle_exact || currprefs.cpu_model > 68000)
- return;
+ exit = true;
}
} CATCH (prb) {
bus_error();
+ if (r->spcflags || time_for_interrupt()) {
+ if (do_specialties(0))
+ exit = true;
+ }
} ENDTRY
}
}
// id < 0: m68k halted, PPC active.
// id > 0: emulation halted.
if (!regs.halted) {
- write_log (_T("CPU halted: reason = %d\n"), id);
+ write_log (_T("CPU halted: reason = %d PC=%08x\n"), id, M68K_GETPC);
regs.halted = id;
gui_data.cpu_halted = id;
gui_led(LED_CPU, 0);
struct regstruct *r = ®s;
bool exit = false;
- for(;;) {
+ while (!exit) {
TRY(prb) {
- for (;;) {
+ while (!exit) {
r->instruction_pc = m68k_getpc();
r->opcode = get_iword_cache_040(0);
// "prefetch"
if (do_specialties (0))
exit = true;
}
-
- if (exit)
- return;
}
} CATCH(prb) {
bus_error();
+ if (r->spcflags) {
+ if (do_specialties(0))
+ exit = true;
+ }
} ENDTRY
}
}
bool exit = false;
int cycles;
- for(;;) {
+ while (!exit) {
TRY(prb) {
- for (;;) {
+ while (!exit) {
r->instruction_pc = m68k_getpc();
r->opcode = get_iword_cache_040(0);
// "prefetch"
exit = true;
}
- if (exit)
- return;
}
} CATCH(prb) {
bus_error();
+ if (r->spcflags) {
+ if (do_specialties(0))
+ exit = true;
+ }
} ENDTRY
}
}
bool exit = false;
bool first = true;
- for(;;) {
+ while (!exit) {
TRY(prb) {
if (first) {
if (cpu_tracer < 0) {
first = false;
}
- for (;;) {
+ while (!exit) {
static int prevopcode;
r->instruction_pc = m68k_getpc ();
regs.ipl = regs.ipl_pin;
- if (exit)
- return;
}
} CATCH(prb) {
bus_error();
+ if (r->spcflags || time_for_interrupt()) {
+ if (do_specialties(0))
+ exit = true;
+ }
+ regs.ipl = regs.ipl_pin;
} ENDTRY
}
}
static void m68k_run_2p (void)
{
struct regstruct *r = ®s;
+ bool exit = false;
- for(;;) {
+ while (!exit) {
TRY(prb) {
- for (;;) {
+ while (!exit) {
r->instruction_pc = m68k_getpc ();
- #if DEBUG_CD32CDTVIO
+#if DEBUG_CD32CDTVIO
out_cd32io (m68k_getpc ());
- #endif
+#endif
x_do_cycles (cpu_cycles);
cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
if (r->spcflags) {
- if (do_specialties (cpu_cycles)) {
- ipl_fetch ();
- return;
- }
+ if (do_specialties (cpu_cycles))
+ exit = true;;
}
ipl_fetch ();
}
} CATCH(prb) {
bus_error();
+ if (r->spcflags) {
+ if (do_specialties(cpu_cycles))
+ exit = true;
+ }
+ ipl_fetch();
} ENDTRY
}
}
{
// static int done;
struct regstruct *r = ®s;
+ bool exit = false;
- for(;;) {
+ while (!exit) {
TRY(prb) {
- for (;;) {
+ while (!exit) {
r->instruction_pc = m68k_getpc ();
r->opcode = x_get_iword(0);
cpu_cycles = adjust_cycles (cpu_cycles);
if (r->spcflags) {
- if (do_specialties (cpu_cycles)) {
- return;
- }
+ if (do_specialties (cpu_cycles))
+ exit = true;
}
}
} CATCH(prb) {
bus_error();
+ if (r->spcflags) {
+ if (do_specialties(cpu_cycles))
+ exit = true;
+ }
} ENDTRY
}
}