From 38b7d89dfbbf49a036a1ee4536e52085bd4265e0 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 7 May 2016 21:34:27 +0200 Subject: [PATCH] Fix a performance issue in CallSyscall --- Core/HLE/HLE.cpp | 7 ++++--- Core/HLE/ReplaceTables.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index a4a448f574..2083b1ba24 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -70,6 +70,7 @@ static int delayedResultEvent = -1; static int hleAfterSyscall = HLE_AFTER_NOTHING; static const char *hleAfterSyscallReschedReason; static const HLEFunction *latestSyscall = nullptr; +static int idleOp; void hleDelayResultFinish(u64 userdata, int cycleslate) { @@ -93,6 +94,7 @@ void HLEInit() { RegisterAllModules(); delayedResultEvent = CoreTiming::RegisterEvent("HLEDelayedResult", hleDelayResultFinish); + idleOp = GetSyscallOp("FakeSysCalls", NID_IDLE); } void HLEDoState(PointerWrap &p) @@ -540,9 +542,8 @@ void CallSyscall(MIPSOpcode op) return; } - if (info->func) - { - if (op == GetSyscallOp("FakeSysCalls", NID_IDLE)) + if (info->func) { + if (op == idleOp) info->func(); else if (info->flags != 0) CallSyscallWithFlags(info); diff --git a/Core/HLE/ReplaceTables.h b/Core/HLE/ReplaceTables.h index 84f85b7eea..94ee26d69e 100644 --- a/Core/HLE/ReplaceTables.h +++ b/Core/HLE/ReplaceTables.h @@ -33,6 +33,8 @@ #pragma once +#include + #include "Common/CommonTypes.h" #include "Core/MIPS/JitCommon/JitCommon.h"