diff --git a/core/hw/sh4/dyna/driver.cpp b/core/hw/sh4/dyna/driver.cpp index f127b9e74e..4284232466 100644 --- a/core/hw/sh4/dyna/driver.cpp +++ b/core/hw/sh4/dyna/driver.cpp @@ -213,23 +213,6 @@ static void ngen_FailedToFindBlock_internal() { void (*ngen_FailedToFindBlock)() = &ngen_FailedToFindBlock_internal; -u32 DYNACALL rdv_DoInterrupts_pc(u32 pc) { - next_pc = pc; - UpdateINTC(); - - return next_pc; -} - -u32 DYNACALL rdv_DoInterrupts(void* block_cpde) -{ - RuntimeBlockInfoPtr rbi = bm_GetBlock(block_cpde); - if (!rbi) - rbi = bm_GetStaleBlock(block_cpde); - verify(rbi != nullptr); - - return rdv_DoInterrupts_pc(rbi->vaddr); -} - // addr must be the physical address of the start of the block DynarecCodeEntryPtr DYNACALL rdv_BlockCheckFail(u32 addr) { diff --git a/core/hw/sh4/dyna/ngen.h b/core/hw/sh4/dyna/ngen.h index 3adf26f70d..aa0c991502 100644 --- a/core/hw/sh4/dyna/ngen.h +++ b/core/hw/sh4/dyna/ngen.h @@ -80,9 +80,6 @@ DynarecCodeEntryPtr rdv_FindOrCompile(); //code -> pointer to code of block, dpc -> if dynamic block, pc. if cond, 0 for next, 1 for branch void* DYNACALL rdv_LinkBlock(u8* code,u32 dpc); -u32 DYNACALL rdv_DoInterrupts(void* block_cpde); -u32 DYNACALL rdv_DoInterrupts_pc(u32 pc); - //Stuff to be implemented per dynarec core void ngen_init(); diff --git a/core/rec-x86/rec_x86.cpp b/core/rec-x86/rec_x86.cpp index 8f2ff4eb8b..f738676111 100644 --- a/core/rec-x86/rec_x86.cpp +++ b/core/rec-x86/rec_x86.cpp @@ -130,6 +130,7 @@ void X86Compiler::compile(RuntimeBlockInfo* block, bool force_checks, bool optim test(eax, eax); Xbyak::Label no_up; jg(no_up); + mov(ecx, block->vaddr); call((const void *)intc_sched); L(no_up); sub(dword[&Sh4cntx.cycle_counter], block->guest_cycles); @@ -485,9 +486,8 @@ void X86Compiler::genMainloop() //do_iter: Xbyak::Label do_iter; L(do_iter); - pop(ecx); - call((void *)rdv_DoInterrupts); - mov(ecx, eax); + add(esp, 4); // pop intc_sched() return address + mov(ecx, dword[&Sh4cntx.pc]); jmp(no_updateLabel); //ngen_LinkBlock_Shared_stub: @@ -503,14 +503,15 @@ void X86Compiler::genMainloop() // Functions called by blocks -//intc_sched: +//intc_sched: ecx: vaddr unwinder.start((void *)getCurr()); size_t startOffset = getSize(); unwinder.endProlog(0); Xbyak::Label intc_schedLabel; L(intc_schedLabel); add(dword[&Sh4cntx.cycle_counter], SH4_TIMESLICE); - call((void *)UpdateSystem); + mov(dword[&Sh4cntx.pc], ecx); + call((void *)UpdateSystem_INTC); cmp(eax, 0); jnz(do_iter); ret();