diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index 787b91d715..a42007c0cf 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -2019,14 +2019,14 @@ void Compiler::HACK(u32 index) { CreateBranch(nullptr, lr_i32, false, true); } // copied from Compiler::SC() - auto ret_i1 = Call("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]); - auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true)); - auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true"); - auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true"); - m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb); - m_ir_builder->SetInsertPoint(then_bb); - m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF)); - m_ir_builder->SetInsertPoint(merge_bb); + //auto ret_i1 = Call("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]); + //auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true)); + //auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true"); + //auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true"); + //m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb); + //m_ir_builder->SetInsertPoint(then_bb); + //m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF)); + //m_ir_builder->SetInsertPoint(merge_bb); } void Compiler::SC(u32 lev) { @@ -6087,7 +6087,9 @@ BranchType ppu_recompiler_llvm::GetBranchTypeFromInstruction(u32 instruction) { } else if (field2 == 528) { type = lk ? BranchType::FunctionCall : BranchType::LocalBranch; } + } else if (field1 == 1 && (instruction & EIF_PERFORM_BLR)) { + type = BranchType::Return; } - + return type; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp index 863a290223..f124378b37 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp @@ -14,7 +14,7 @@ SysCallBase sys_interrupt("sys_interrupt"); s32 sys_interrupt_tag_destroy(u32 intrtag) { - sys_interrupt.Warning("sys_interrupt_tag_destroy(intrtag=%d)", intrtag); + sys_interrupt.Warning("sys_interrupt_tag_destroy(intrtag=0x%x)", intrtag); const u32 class_id = intrtag >> 8; @@ -49,7 +49,7 @@ s32 sys_interrupt_tag_destroy(u32 intrtag) s32 sys_interrupt_thread_establish(vm::ptr ih, u32 intrtag, u64 intrthread, u64 arg) { - sys_interrupt.Warning("sys_interrupt_thread_establish(ih_addr=0x%x, intrtag=%d, intrthread=%lld, arg=0x%llx)", ih.addr(), intrtag, intrthread, arg); + sys_interrupt.Warning("sys_interrupt_thread_establish(ih=*0x%x, intrtag=0x%x, intrthread=%lld, arg=0x%llx)", ih, intrtag, intrthread, arg); const u32 class_id = intrtag >> 8; @@ -130,7 +130,7 @@ s32 sys_interrupt_thread_establish(vm::ptr ih, u32 intrtag, u64 intrthread, s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr r13) { - sys_interrupt.Todo("_sys_interrupt_thread_disestablish(ih=%d)", ih); + sys_interrupt.Todo("_sys_interrupt_thread_disestablish(ih=0x%x, r13=*0x%x)", ih, r13); std::shared_ptr handler; if (!Emu.GetIdManager().GetIDData(ih, handler)) @@ -147,9 +147,9 @@ s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr r13) return CELL_OK; } -void sys_interrupt_thread_eoi() +void sys_interrupt_thread_eoi(PPUThread& CPU) { sys_interrupt.Log("sys_interrupt_thread_eoi()"); - GetCurrentPPUThread().FastStop(); + CPU.FastStop(); } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.h b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.h index 250fd836fb..7167f6b546 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.h @@ -11,4 +11,4 @@ struct interrupt_handler_t s32 sys_interrupt_tag_destroy(u32 intrtag); s32 sys_interrupt_thread_establish(vm::ptr ih, u32 intrtag, u64 intrthread, u64 arg); s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr r13); -void sys_interrupt_thread_eoi(); +void sys_interrupt_thread_eoi(PPUThread& CPU);