- lightrec_reset_cycle_count(lightrec_state, psxRegs.cycle);
- lightrec_restore_registers(lightrec_state, psxRegs.GPR.r);
-
- if (use_lightrec_interpreter)
- psxRegs.pc = lightrec_run_interpreter(lightrec_state, psxRegs.pc);
- else
- psxRegs.pc = lightrec_execute_one(lightrec_state, psxRegs.pc);
-
- psxRegs.cycle = lightrec_current_cycle_count(lightrec_state);
+ gen_interupt();
+
+ if (use_pcsx_interpreter) {
+ intExecuteBlock();
+ } else {
+ lightrec_reset_cycle_count(lightrec_state, psxRegs.cycle);
+ lightrec_restore_regs(lightrec_state);
+
+ if (unlikely(use_lightrec_interpreter))
+ psxRegs.pc = lightrec_run_interpreter(lightrec_state,
+ psxRegs.pc);
+ // step during early boot so that 0x80030000 fastboot hack works
+ else if (unlikely(booting || lightrec_debug))
+ psxRegs.pc = lightrec_execute_one(lightrec_state,
+ psxRegs.pc);
+ else
+ psxRegs.pc = lightrec_execute(lightrec_state,
+ psxRegs.pc, next_interupt);
+
+ psxRegs.cycle = lightrec_current_cycle_count(lightrec_state);
+
+ lightrec_dump_regs(lightrec_state);
+ flags = lightrec_exit_flags(lightrec_state);
+
+ if (flags & LIGHTREC_EXIT_SEGFAULT) {
+ fprintf(stderr, "Exiting at cycle 0x%08x\n",
+ psxRegs.cycle);
+ exit(1);
+ }