- unsigned int i;
-
- printf("CYCLE 0x%08x PC 0x%08x", psxRegs.cycle, psxRegs.pc);
-
- if (lightrec_very_debug)
- printf(" RAM 0x%08x SCRATCH 0x%08x HW 0x%08x",
- hash_calculate_le(psxM, 0x200000),
- hash_calculate_le(psxH, 0x400),
- hash_calculate_le(psxH + 0x1000, 0x2000));
-
- printf(" CP0 0x%08x CP2D 0x%08x CP2C 0x%08x INT 0x%04x INTCYCLE 0x%08x GPU 0x%08x",
- hash_calculate(&psxRegs.CP0.r,
- sizeof(psxRegs.CP0.r)),
- hash_calculate(&psxRegs.CP2D.r,
- sizeof(psxRegs.CP2D.r)),
- hash_calculate(&psxRegs.CP2C.r,
- sizeof(psxRegs.CP2C.r)),
- psxRegs.interrupt,
- hash_calculate(psxRegs.intCycle,
- sizeof(psxRegs.intCycle)),
- LE32TOH(HW_GPU_STATUS));
-
- if (lightrec_very_debug)
- for (i = 0; i < 34; i++)
- printf(" %s 0x%08x", mips_regs[i], psxRegs.GPR.r[i]);
- else
- printf(" GPR 0x%08x", hash_calculate(&psxRegs.GPR.r,
- sizeof(psxRegs.GPR.r)));
- printf("\n");
-}
-
-static u32 old_cycle_counter;
-
-static void lightrec_plugin_execute_block(void)
-{
- u32 old_pc = psxRegs.pc;
- u32 flags;
-
- lightrec_reset_cycle_count(lightrec_state, psxRegs.cycle);
- lightrec_restore_registers(lightrec_state, psxRegs.GPR.r);
+ struct lightrec_registers *regs;
+ u32 flags, cycles_pcsx;
+
+ regs = lightrec_get_registers(lightrec_state);
+ gen_interupt((psxCP0Regs *)regs->cp0);
+ 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);
+ }