diff --git a/r5dev/core/dllmain.cpp b/r5dev/core/dllmain.cpp index a1d83f78..71ba803d 100644 --- a/r5dev/core/dllmain.cpp +++ b/r5dev/core/dllmain.cpp @@ -17,6 +17,8 @@ void SDK_Init() { + CheckCPU(); // Check CPU as early as possible, SpdLog also uses SIMD intrinsics. + if (strstr(GetCommandLineA(), "-launcher")) { g_svCmdLine = GetCommandLineA(); diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index 60fd13e6..7c659f6c 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -416,9 +416,13 @@ void QuerySystemInfo() spdlog::error("Unable to retrieve system memory information: {:s}\n", std::system_category().message(static_cast<int>(::GetLastError()))); } +} +void CheckCPU() // Respawn's engine utilizes POPCNT, SSE3 and SSSE3 (Supplemental SSE 3 Instructions), which is checked in r5apex.exe after we have initialized. We only use up to SSE2. +{ if (!s_bMathlibInitialized) { + const CPUInformation& pi = GetCPUInformation(); if (!(pi.m_bSSE && pi.m_bSSE2)) { if (MessageBoxA(NULL, "SSE and SSE2 are required.", "Unsupported CPU", MB_ICONERROR | MB_OK)) diff --git a/r5dev/core/init.h b/r5dev/core/init.h index 2f6f9475..62f42d1c 100644 --- a/r5dev/core/init.h +++ b/r5dev/core/init.h @@ -14,6 +14,7 @@ void Systems_Shutdown(); void WinSock_Init(); void WinSock_Shutdown(); void QuerySystemInfo(); +void CheckCPU(); void DetourInit(); void DetourAddress();