Core: Add exit reason exception

This commit is contained in:
zilmar 2023-08-30 12:16:07 +09:30
parent 703ad4049a
commit e49438cdab
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@ enum ExitReason
ExitReason_AddressErrorExceptionRead32, ExitReason_AddressErrorExceptionRead32,
ExitReason_AddressErrorExceptionRead64, ExitReason_AddressErrorExceptionRead64,
ExitReason_IllegalInstruction, ExitReason_IllegalInstruction,
ExitReason_Exception,
}; };
struct CExitInfo struct CExitInfo

View File

@ -9559,6 +9559,17 @@ void CX86RecompilerOps::CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo
m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL); m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL);
ExitCodeBlock(); ExitCodeBlock();
break; break;
case ExitReason_Exception:
m_Assembler.MoveVariableToX86reg(asmjit::x86::edx, &g_System->m_JumpToLocation, "System->m_JumpToLocation");
m_Assembler.MoveX86regToVariable(&g_Reg->m_PROGRAM_COUNTER, "PROGRAM_COUNTER", asmjit::x86::edx);
m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL);
if (TargetPC == (uint32_t)-1)
{
ExitRegSet.SetBlockCycleCount(0);
UpdateCounters(ExitRegSet, true, false, false);
}
ExitCodeBlock();
break;
default: default:
WriteTrace(TraceRecompiler, TraceError, "How did you want to exit on reason (%d) ???", reason); WriteTrace(TraceRecompiler, TraceError, "How did you want to exit on reason (%d) ???", reason);
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);