Revert "Add a quirk for Reflex in Sony games"

This reverts commit 58e37b18da.
This commit is contained in:
FakeMichau
2026-03-29 18:30:23 +02:00
parent 58e37b18da
commit 4f4b7b330f
6 changed files with 27 additions and 86 deletions
-3
View File
@@ -1219,9 +1219,6 @@ static void printQuirks(flag_set<GameQuirk>& quirks)
if (quirks & GameQuirk::OldOverlayMenu)
stringQuirks.push_back("Using old overlay (draws on upscaled image)");
if (quirks & GameQuirk::ForceReflexMarkersParam)
stringQuirks.push_back("Add -forceReflexMarkers (and similar) to launch params");
state->detectedQuirks.append_range(stringQuirks);
for (auto& stringQuirk : stringQuirks)
spdlog::info("Quirk: {}", stringQuirk);
-56
View File
@@ -245,62 +245,6 @@ HANDLE WINAPI KernelHooks::hk_K32_CreateFileW(LPCWSTR lpFileName, DWORD dwDesire
dwFlagsAndAttributes, hTemplateFile);
}
VALIDATE_HOOK(hk_K32_GetCommandLineA, Kernel32Proxy::PFN_GetCommandLineA)
LPSTR WINAPI KernelHooks::hk_K32_GetCommandLineA()
{
auto params = o_K32_GetCommandLineA();
static std::string string;
const static bool nukems = State::Instance().activeFgInput == FGInput::Nukems;
const static bool reflexParams = State::Instance().gameQuirks[GameQuirk::ForceReflexMarkersParam];
if (params && (nukems || reflexParams))
{
if (string.empty())
{
string.append(params);
// Disable unused code in the MFG mod
if (nukems)
string.append(" --dlss-off");
if (reflexParams)
string.append(" -unlockReflexOptions -unlockreflexoptions -forceReflexMarkers");
}
return string.data();
}
return params;
}
VALIDATE_HOOK(hk_K32_GetCommandLineW, Kernel32Proxy::PFN_GetCommandLineW)
LPWSTR WINAPI KernelHooks::hk_K32_GetCommandLineW()
{
auto params = o_K32_GetCommandLineW();
static std::wstring string;
const static bool nukems = State::Instance().activeFgInput == FGInput::Nukems;
const static bool reflexParams = State::Instance().gameQuirks[GameQuirk::ForceReflexMarkersParam];
if (params && (nukems || reflexParams))
{
if (string.empty())
{
string.append(params);
// Disable unused code in the MFG mod
if (nukems)
string.append(L" --dlss-off");
if (reflexParams)
string.append(L" -unlockReflexOptions -unlockreflexoptions -forceReflexMarkers");
}
return string.data();
}
return params;
}
// Load Library checks
VALIDATE_HOOK(hk_K32_LoadLibraryW, Kernel32Proxy::PFN_LoadLibraryW)
-11
View File
@@ -28,8 +28,6 @@ class KernelHooks
inline static Kernel32Proxy::PFN_GetModuleHandleA o_K32_GetModuleHandleA = nullptr;
inline static Kernel32Proxy::PFN_GetModuleHandleExW o_K32_GetModuleHandleExW = nullptr;
inline static Kernel32Proxy::PFN_GetFileAttributesW o_K32_GetFileAttributesW = nullptr;
inline static Kernel32Proxy::PFN_GetCommandLineA o_K32_GetCommandLineA = nullptr;
inline static Kernel32Proxy::PFN_GetCommandLineW o_K32_GetCommandLineW = nullptr;
inline static Kernel32Proxy::PFN_CreateFileW o_K32_CreateFileW = nullptr;
inline static KernelBaseProxy::PFN_FreeLibrary o_KB_FreeLibrary = nullptr;
@@ -49,8 +47,6 @@ class KernelHooks
static HANDLE WINAPI hk_K32_CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
static LPSTR WINAPI hk_K32_GetCommandLineA();
static LPWSTR WINAPI hk_K32_GetCommandLineW();
static HMODULE hk_K32_LoadLibraryW(LPCWSTR lpLibFileName);
static HMODULE hk_K32_LoadLibraryA(LPCSTR lpLibFileName);
@@ -78,13 +74,6 @@ class KernelHooks
o_K32_GetFileAttributesW = Kernel32Proxy::Hook_GetFileAttributesW(hk_K32_GetFileAttributesW);
o_K32_CreateFileW = Kernel32Proxy::Hook_CreateFileW(hk_K32_CreateFileW);
if (State::Instance().gameQuirks & GameQuirk::ForceReflexMarkersParam ||
State::Instance().activeFgInput == FGInput::Nukems)
{
o_K32_GetCommandLineA = Kernel32Proxy::Hook_GetCommandLineA(hk_K32_GetCommandLineA);
o_K32_GetCommandLineW = Kernel32Proxy::Hook_GetCommandLineW(hk_K32_GetCommandLineW);
}
if (!Config::Instance()->UseNtdllHooks.value_or_default())
{
o_K32_FreeLibrary = Kernel32Proxy::Hook_FreeLibrary(hk_K32_FreeLibrary);
+17 -1
View File
@@ -10,8 +10,22 @@
typedef void (*PFN_RefreshGlobalConfiguration)();
typedef void (*PFN_EnableDebugView)(bool enable);
static decltype(&GetCommandLineA) o_GetCommandLineA = GetCommandLineA;
static decltype(&GetFileAttributesExW) o_GetFileAttributesExW = GetFileAttributesExW;
static LPSTR WINAPI hkGetCommandLineA(void)
{
static std::string modified;
LPSTR original = o_GetCommandLineA();
// Disable unused code
modified = original;
modified += " --dlss-off";
return (LPSTR) modified.c_str();
}
static BOOL WINAPI hkGetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId,
LPVOID lpFileInformation)
{
@@ -87,12 +101,13 @@ class DLSSGMod
State::Instance().NukemsMFG = true;
HMODULE dll = nullptr;
if (o_GetFileAttributesExW)
if (o_GetCommandLineA && o_GetFileAttributesExW)
{
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&) o_GetCommandLineA, hkGetCommandLineA);
DetourAttach(&(PVOID&) o_GetFileAttributesExW, hkGetFileAttributesExW);
DetourTransactionCommit();
@@ -102,6 +117,7 @@ class DLSSGMod
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach(&(PVOID&) o_GetCommandLineA, hkGetCommandLineA);
DetourDetach(&(PVOID&) o_GetFileAttributesExW, hkGetFileAttributesExW);
DetourTransactionCommit();
+10 -13
View File
@@ -60,7 +60,6 @@ enum class GameQuirk : uint64_t
CreateD3D12DeviceForLuma,
ForceCreateD3D12Device,
ForceDepthD32S8,
ForceReflexMarkersParam,
// Don't forget to add the new entry to printQuirks
_
};
@@ -244,23 +243,21 @@ static const QuirkEntry quirkTable[] = {
//
// Ratchet & Clank: Rift Apart, Marvels Spider-Man Remastered, Marvels Spider-Man: Miles Morales, Marvel's
// Spider-Man 2, DEATH STRANDING 2: ON THE BEACH
QUIRK_ENTRY("riftapart.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("spider-man.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam,
GameQuirk::FSRFGHudlessMismatchFixup),
QUIRK_ENTRY("milesmorales.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("spider-man2.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("ds2.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam,
GameQuirk::FSRFGHudlessMismatchFixup),
QUIRK_ENTRY("riftapart.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("spider-man.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::FSRFGHudlessMismatchFixup),
QUIRK_ENTRY("milesmorales.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("spider-man2.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("ds2.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::FSRFGHudlessMismatchFixup),
//
// Dxgi spoofing disabled, DLSS-FG available, standalone Reflex can be unlocked with -unlockReflexOptions launch
// option if needed
// Horizon Zero Dawn Remastered, Horizon Forbidden West Complete Edition, Ghost of Tsushima DIRECTOR'S CUT, The Last
// of Us Part II Remastered
QUIRK_ENTRY("horizonzerodawnremastered.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("horizonforbiddenwest.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("ghostoftsushima.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("tlou-ii.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("tlou-ii-l.exe", GameQuirk::DisableDxgiSpoofing, GameQuirk::ForceReflexMarkersParam),
QUIRK_ENTRY("horizonzerodawnremastered.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("horizonforbiddenwest.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("ghostoftsushima.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("tlou-ii.exe", GameQuirk::DisableDxgiSpoofing),
QUIRK_ENTRY("tlou-ii-l.exe", GameQuirk::DisableDxgiSpoofing),
// Dead Space Remake
// Override Vsync required to avoid crash on boot
-2
View File
@@ -22,8 +22,6 @@
X(GetModuleHandleW) \
X(GetModuleHandleExA) \
X(GetModuleHandleExW) \
X(GetCommandLineA) \
X(GetCommandLineW) \
X(GetFileAttributesW) \
X(CreateFileW)