From 525ebbb8dc58dfa966c1c740ed941ced5a1ec6cf Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Mon, 29 Jan 2024 15:35:30 +0800 Subject: [PATCH] update submodules --- external/FusionDxHook | 2 +- source/PPSSPP.XboxRainDroplets.cpp | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/external/FusionDxHook b/external/FusionDxHook index 8881bc4..22bf361 160000 --- a/external/FusionDxHook +++ b/external/FusionDxHook @@ -1 +1 @@ -Subproject commit 8881bc49d4d9afc6eeef7509a39dfe15caf15368 +Subproject commit 22bf361c69a047148e9628f70fa3e3c54266e5d7 diff --git a/source/PPSSPP.XboxRainDroplets.cpp b/source/PPSSPP.XboxRainDroplets.cpp index 3ef6cbb..e2eaef4 100644 --- a/source/PPSSPP.XboxRainDroplets.cpp +++ b/source/PPSSPP.XboxRainDroplets.cpp @@ -202,16 +202,12 @@ void RenderDroplets() const UINT WM_USER_GET_EMULATION_STATE = WM_APP + 0x3119; // 0xB119 static XRData* pXRData = nullptr; + static bool bRefreshXRData = false; DWORD_PTR dwResult = 0; - if (SendMessageTimeout(hWndPPSSPP, WM_USER_GET_EMULATION_STATE, 0, 0, SMTO_NORMAL, 10L, &dwResult)) + SendMessageTimeout(hWndPPSSPP, WM_USER_GET_EMULATION_STATE, 0, 0, SMTO_NORMAL, 10L, &dwResult); + if (dwResult == 1) { - if (!dwResult) - { - pXRData = nullptr; - return; - } - enum { lo, // Lower 32 bits of pointer to the base of emulated memory @@ -221,13 +217,13 @@ void RenderDroplets() }; DWORD_PTR high, low = 0; - SendMessageTimeout(hWndPPSSPP, WM_USER_GET_BASE_POINTER, 0, hi, SMTO_NORMAL, 10L, &high); - SendMessageTimeout(hWndPPSSPP, WM_USER_GET_BASE_POINTER, 0, lo, SMTO_NORMAL, 10L, &low); + auto f1 = SendMessageTimeout(hWndPPSSPP, WM_USER_GET_BASE_POINTER, 0, hi, SMTO_NORMAL, 10L, &high); + auto f2 = SendMessageTimeout(hWndPPSSPP, WM_USER_GET_BASE_POINTER, 0, lo, SMTO_NORMAL, 10L, &low); uint64_t ptr = (uint64_t(high) << 32 | low); // +0x08804000; - if (ptr) + if (SUCCEEDED(f1) && SUCCEEDED(f2) && ptr) { - if (pXRData) + if (pXRData && !bRefreshXRData) { if (pXRData->Enabled(ptr)) { @@ -260,13 +256,14 @@ void RenderDroplets() memset(pXRData, 0, 255); } } + bRefreshXRData = false; } } else - pXRData = nullptr; + bRefreshXRData = true; } else - pXRData = nullptr; + bRefreshXRData = true; } }