+ struct lightrec_registers *regs;
+ u32 flags, cycles_pcsx;
+
+ regs = lightrec_get_registers(lightrec_state);
+ gen_interupt((psxCP0Regs *)regs->cp0);
+ if (!block_only && stop)
+ return;
+
+ cycles_pcsx = next_interupt - psxRegs.cycle;
+ assert((s32)cycles_pcsx > 0);
+
+ // step during early boot so that 0x80030000 fastboot hack works
+ block_stepping = block_only;
+ if (block_only)
+ cycles_pcsx = 0;
+
+ if (use_pcsx_interpreter) {
+ intExecuteBlock(0);
+ } else {
+ u32 cycles_lightrec = cycles_pcsx * 1024;
+ if (unlikely(use_lightrec_interpreter)) {
+ psxRegs.pc = lightrec_run_interpreter(lightrec_state,
+ psxRegs.pc,
+ cycles_lightrec);
+ } else {
+ psxRegs.pc = lightrec_execute(lightrec_state,
+ psxRegs.pc, cycles_lightrec);
+ }
+
+ lightrec_tansition_to_pcsx(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);
+ }
+
+ if (flags & LIGHTREC_EXIT_SYSCALL)
+ psxException(R3000E_Syscall << 2, 0, (psxCP0Regs *)regs->cp0);
+ if (flags & LIGHTREC_EXIT_BREAK)
+ psxException(R3000E_Bp << 2, 0, (psxCP0Regs *)regs->cp0);
+ else if (flags & LIGHTREC_EXIT_UNKNOWN_OP) {
+ u32 op = intFakeFetch(psxRegs.pc);
+ u32 hlec = op & 0x03ffffff;
+ if ((op >> 26) == 0x3b && hlec < ARRAY_SIZE(psxHLEt) && Config.HLE) {
+ lightrec_plugin_sync_regs_to_pcsx(0);
+ psxHLEt[hlec]();
+ lightrec_plugin_sync_regs_from_pcsx(0);
+ }
+ else
+ psxException(R3000E_RI << 2, 0, (psxCP0Regs *)regs->cp0);
+ }