mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier0: split CPU feature checks into multiple functions
This commit is contained in:
parent
7a331284eb
commit
f18829a487
@ -575,7 +575,7 @@ const CPUInformation& GetCPUInformation(void)
|
||||
return pi;
|
||||
}
|
||||
|
||||
void CheckSystemCPU()
|
||||
void CheckSystemCPUForSSE2()
|
||||
{
|
||||
const CPUInformation& pi = GetCPUInformation();
|
||||
|
||||
@ -586,6 +586,12 @@ void CheckSystemCPU()
|
||||
TerminateProcess(GetCurrentProcess(), 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckSystemCPUForSSE3()
|
||||
{
|
||||
const CPUInformation& pi = GetCPUInformation();
|
||||
|
||||
if (!pi.m_bSSE3)
|
||||
{
|
||||
if (MessageBoxA(NULL, "SSE3 is required.", "Unsupported CPU", MB_ICONERROR | MB_OK))
|
||||
@ -593,6 +599,12 @@ void CheckSystemCPU()
|
||||
TerminateProcess(GetCurrentProcess(), 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckSystemCPUForSupplementalSSE3()
|
||||
{
|
||||
const CPUInformation& pi = GetCPUInformation();
|
||||
|
||||
if (!pi.m_bSSSE3)
|
||||
{
|
||||
if (MessageBoxA(NULL, "SSSE3 (Supplemental SSE3 Instructions) is required.", "Unsupported CPU", MB_ICONERROR | MB_OK))
|
||||
@ -600,6 +612,12 @@ void CheckSystemCPU()
|
||||
TerminateProcess(GetCurrentProcess(), 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckSystemCPUForPopCount()
|
||||
{
|
||||
const CPUInformation& pi = GetCPUInformation();
|
||||
|
||||
if (!pi.m_bPOPCNT)
|
||||
{
|
||||
if (MessageBoxA(NULL, "POPCNT is required.", "Unsupported CPU", MB_ICONERROR | MB_OK))
|
||||
@ -608,3 +626,11 @@ void CheckSystemCPU()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckSystemCPU()
|
||||
{
|
||||
CheckSystemCPUForSSE2();
|
||||
CheckSystemCPUForSSE3();
|
||||
CheckSystemCPUForSupplementalSSE3();
|
||||
CheckSystemCPUForPopCount();
|
||||
}
|
||||
|
@ -130,6 +130,11 @@ const char* GetProcessorBrand(bool bRemovePadding);
|
||||
|
||||
const CPUInformation& GetCPUInformation(void);
|
||||
|
||||
void CheckSystemCPUForSSE2();
|
||||
void CheckSystemCPUForSSE3();
|
||||
void CheckSystemCPUForSupplementalSSE3();
|
||||
void CheckSystemCPUForPopCount();
|
||||
|
||||
void CheckSystemCPU();
|
||||
|
||||
#endif // CPU_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user