mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Match LegoDeviceEnumerate::SupportsMMX
(#1443)
* Match `LegoDeviceEnumerate::SupportsMMX` * Fix indent
This commit is contained in:

committed by
GitHub

parent
2cab039a5f
commit
f851103d48
@@ -201,12 +201,12 @@ int LegoDeviceEnumerate::FUN_1009d0d0()
|
||||
// FUNCTION: BETA10 0x1011cf54
|
||||
int LegoDeviceEnumerate::SupportsMMX()
|
||||
{
|
||||
if (!SupportsCPUID()) {
|
||||
return 0;
|
||||
}
|
||||
int supports_mmx;
|
||||
int supports_mmx = SupportsCPUID();
|
||||
|
||||
if (supports_mmx) {
|
||||
#ifdef _MSC_VER
|
||||
__asm {
|
||||
push ebx
|
||||
mov eax, 0x0 ; EAX=0: Highest Function Parameter and Manufacturer ID
|
||||
#if _MSC_VER > 1100
|
||||
cpuid ; Run CPUID
|
||||
@@ -224,6 +224,7 @@ int LegoDeviceEnumerate::SupportsMMX()
|
||||
xor eax, eax ; Zero EAX register
|
||||
bt edx, 0x17 ; Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF)
|
||||
adc eax, eax ; Add with carry: EAX = EAX + EAX + CF = CF
|
||||
pop ebx
|
||||
mov supports_mmx, eax ; Save eax into C variable
|
||||
}
|
||||
#else
|
||||
@@ -237,6 +238,8 @@ int LegoDeviceEnumerate::SupportsMMX()
|
||||
: "=a"(supports_mmx) // supports_mmx == EAX
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
return supports_mmx;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user