This commit is contained in:
Anonymous Maarten 2024-02-06 22:48:13 +01:00
parent f70d1eb495
commit 41de5779a5
2 changed files with 18 additions and 18 deletions

View File

@ -11,7 +11,7 @@
DECOMP_SIZE_ASSERT(CWinApp, 0xc4) DECOMP_SIZE_ASSERT(CWinApp, 0xc4)
DECOMP_SIZE_ASSERT(CConfigApp, 0x108) DECOMP_SIZE_ASSERT(CConfigApp, 0x108)
DECOMP_STATIC_ASSERT(offsetof(CConfigApp, m_display_bit_depth) == 0xd0) DECOMP_STATIC_ASSERT(offsetof(CConfigApp, m_display_bit_depth) == 0xd0)
// FIXME: are these tags correct? // FIXME: are these tags correct?
// FIXME: how to tag static in-method variables? // FIXME: how to tag static in-method variables?

View File

@ -945,10 +945,10 @@ int MxDeviceEnumerate::FormatDeviceName(char* p_buffer, const MxDriver* p_driver
p_buffer, p_buffer,
"%d 0x%x 0x%x 0x%x 0x%x", "%d 0x%x 0x%x 0x%x 0x%x",
number, number,
((DWORD*)(p_device->m_guid))[0], ((DWORD*) (p_device->m_guid))[0],
((DWORD*)(p_device->m_guid))[1], ((DWORD*) (p_device->m_guid))[1],
((DWORD*)(p_device->m_guid))[2], ((DWORD*) (p_device->m_guid))[2],
((DWORD*)(p_device->m_guid))[3] ((DWORD*) (p_device->m_guid))[3]
); );
return 0; return 0;
} }
@ -1002,11 +1002,11 @@ int MxDeviceEnumerate::FUN_1009d0d0()
int MxDeviceEnumerate::SupportsMMX() int MxDeviceEnumerate::SupportsMMX()
{ {
if (!SupportsCPUID()) { if (!SupportsCPUID()) {
return 0; return 0;
} }
int supports_mmx; int supports_mmx;
#ifdef _MSC_VER #ifdef _MSC_VER
__asm { __asm {
mov eax, 0x0 ; EAX=0: Highest Function Parameter and Manufacturer ID mov eax, 0x0 ; EAX=0: Highest Function Parameter and Manufacturer ID
#if _MSC_VER > 1100 #if _MSC_VER > 1100
cpuid ; Run CPUID cpuid ; Run CPUID
@ -1025,17 +1025,17 @@ int MxDeviceEnumerate::SupportsMMX()
bt edx, 0x17 ; Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF) 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 adc eax, eax ; Add with carry: EAX = EAX + EAX + CF = CF
mov supports_mmx, eax ; Save eax into C variable mov supports_mmx, eax ; Save eax into C variable
} }
#else #else
__asm__("movl $0x0, %%eax\n\t" // EAX=0: Highest Function Parameter and Manufacturer ID __asm__("movl $0x0, %%eax\n\t" // EAX=0: Highest Function Parameter and Manufacturer ID
"cpuid\n\t" // Run CPUID\n" "cpuid\n\t" // Run CPUID\n"
"mov $0x1, %%eax\n\t" // EAX=1: Processor Info and Feature Bits (unused) "mov $0x1, %%eax\n\t" // EAX=1: Processor Info and Feature Bits (unused)
"cpuid\n\t" // Run CPUID "cpuid\n\t" // Run CPUID
"xorl %%eax, %%eax\n\t" // Zero EAX register "xorl %%eax, %%eax\n\t" // Zero EAX register
"btl $0x15, %%edx\n\t" // Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF) "btl $0x15, %%edx\n\t" // Test bit 0x17 (23): MMX instructions (64-bit SIMD) (Store in CF)
"adc %%eax, %%eax" // Add with carry: EAX = EAX + EAX + CF = CF "adc %%eax, %%eax" // Add with carry: EAX = EAX + EAX + CF = CF
: "=a"(supports_mmx) // supports_mmx == EAX : "=a"(supports_mmx) // supports_mmx == EAX
); );
#endif #endif
return supports_mmx; return supports_mmx;
} }