mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 16:02:26 +00:00
Use different processor values
This commit is contained in:
parent
1841a78508
commit
46d663cdcb
@ -827,8 +827,6 @@ void PatchCPUID(u64 segment_addr, u64 segment_size) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_CRITICAL(Core, "FOUND CPUID INSTRUCTION AT: {}", fmt::ptr(code));
|
|
||||||
|
|
||||||
// Replace any potential prefixes and the 0F byte with single byte NOPs
|
// Replace any potential prefixes and the 0F byte with single byte NOPs
|
||||||
u8 instruction_length = instruction.length;
|
u8 instruction_length = instruction.length;
|
||||||
for (u8 i = 0; i < instruction_length - 1; i++) {
|
for (u8 i = 0; i < instruction_length - 1; i++) {
|
||||||
|
@ -18,18 +18,24 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// CPUID constants from http://instlatx64.atw.hu/
|
// CPUID constants from http://instlatx64.atw.hu/
|
||||||
// There wasn't dumps for the PS4 itself, we used a Jaguar CPU: AMD A9-9820
|
// There aren't dumps for the PS4 itself, these are from a 7600x
|
||||||
// Optimally at some point we should dump the PS4 CPUID values
|
// Optimally at some point we should dump the PS4 CPUID values
|
||||||
// For EAX=0 / EAX=0x80000000
|
// For EAX=0 / EAX=0x80000000
|
||||||
constexpr static u32 maxCpuid = 0xD;
|
constexpr static u32 maxCpuid = 0x10;
|
||||||
constexpr static const char* vendorId = "AuthenticAMD";
|
constexpr static const char* vendorId = "AuthenticAMD";
|
||||||
|
|
||||||
// For EAX=1
|
// For EAX=1
|
||||||
constexpr static u32 processorFamilyIDs = 0x00720F61;
|
constexpr static u32 processorFamilyIDs = 0x00A60F12;
|
||||||
constexpr static u32 additionalInfo = 0x00080800;
|
constexpr static u32 additionalInfo = 0x000C0800;
|
||||||
constexpr static u32 featureInfoEcx = 0x3ED8220B;
|
constexpr static u32 featureInfoEcx = 0x7EF8320B;
|
||||||
constexpr static u32 featureInfoEdx = 0x178BFBFF;
|
constexpr static u32 featureInfoEdx = 0x178BFBFF;
|
||||||
|
|
||||||
|
// For EAX=0x80000001
|
||||||
|
constexpr static u32 extendedFeatureInfoEax = 0x00A60F12;
|
||||||
|
constexpr static u32 extendedFeatureInfoEbx = 0x00000000;
|
||||||
|
constexpr static u32 extendedFeatureInfoEcx = 0x75C237FF;
|
||||||
|
constexpr static u32 extendedFeatureInfoEdx = 0x2FD3FBFF;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
@ -58,6 +64,11 @@ static LONG WINAPI SignalHandler(EXCEPTION_POINTERS* pExp) noexcept {
|
|||||||
results[1] = additionalInfo;
|
results[1] = additionalInfo;
|
||||||
results[2] = featureInfoEcx;
|
results[2] = featureInfoEcx;
|
||||||
results[3] = featureInfoEdx;
|
results[3] = featureInfoEdx;
|
||||||
|
} else if (rax == 0x80000001) {
|
||||||
|
results[0] = extendedFeatureInfoEax;
|
||||||
|
results[1] = extendedFeatureInfoEbx;
|
||||||
|
results[2] = extendedFeatureInfoEcx;
|
||||||
|
results[3] = extendedFeatureInfoEdx;
|
||||||
} else {
|
} else {
|
||||||
__cpuidex(reinterpret_cast<int*>(results), static_cast<int>(rax),
|
__cpuidex(reinterpret_cast<int*>(results), static_cast<int>(rax),
|
||||||
static_cast<int>(rcx));
|
static_cast<int>(rcx));
|
||||||
@ -162,6 +173,11 @@ static void SignalHandler(int sig, siginfo_t* info, void* raw_context) {
|
|||||||
results[1] = additionalInfo;
|
results[1] = additionalInfo;
|
||||||
results[2] = featureInfoEcx;
|
results[2] = featureInfoEcx;
|
||||||
results[3] = featureInfoEdx;
|
results[3] = featureInfoEdx;
|
||||||
|
} else if (rax == 0x80000001) {
|
||||||
|
results[0] = extendedFeatureInfoEax;
|
||||||
|
results[1] = extendedFeatureInfoEbx;
|
||||||
|
results[2] = extendedFeatureInfoEcx;
|
||||||
|
results[3] = extendedFeatureInfoEdx;
|
||||||
} else {
|
} else {
|
||||||
__cpuid_count(rax, rcx, results[0], results[1], results[2], results[3]);
|
__cpuid_count(rax, rcx, results[0], results[1], results[2], results[3]);
|
||||||
if (rax == 0 || rax == 0x80000000) {
|
if (rax == 0 || rax == 0x80000000) {
|
||||||
|
Loading…
Reference in New Issue
Block a user