From 5ce7e5e10967774b295ab0e1cacfc614d4bfb00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 9 Mar 2017 14:22:33 +0100 Subject: [PATCH] UWP ARM: Shrink the JIT hack --- Core/MIPS/ARM/ArmAsm.cpp | 1 + Core/MIPS/ARM/ArmJit.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Core/MIPS/ARM/ArmAsm.cpp b/Core/MIPS/ARM/ArmAsm.cpp index e657bad925..b32d39ef78 100644 --- a/Core/MIPS/ARM/ArmAsm.cpp +++ b/Core/MIPS/ARM/ArmAsm.cpp @@ -57,6 +57,7 @@ extern volatile CoreState coreState; void ShowPC(u32 sp) { ERROR_LOG(JIT, "ShowPC : %08x ArmSP : %08x", currentMIPS->pc, sp); + // Sleep(1); } void DisassembleArm(const u8 *data, int size); diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index a117c48c9c..8054c196f7 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -198,13 +198,14 @@ void ArmJit::CompileDelaySlot(int flags) void ArmJit::Compile(u32 em_address) { PROFILE_THIS_SCOPE("jitc"); - // If I keep any of these, it works on UWP for ARM! #if PPSSPP_PLATFORM(UWP) - INFO_LOG(JIT, "Compiling at %08x", em_address); -#endif - // Sleep(1); + // INFO_LOG(JIT, "Compiling at %08x", em_address); // Unfortunately Microsoft forgot to expose FlushInstructionCache to UWP applications... even though they expose - // the ability to generate code :( This will work great on x86 but on ARM we're out of luck. + // the ability to generate code :( This works great on x86 but on ARM we're out of luck. + // This seems to be enough to flush the instruction cache: + // If this OutputDebugStringUTF8 is not called, we crash. + OutputDebugStringUTF8("JITHACK"); +#endif if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) { ClearCache();