Mercurial > mm7
diff mm7_5.cpp @ 1391:cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
stru148 -> struct Polygon
author | Nomad |
---|---|
date | Thu, 18 Jul 2013 14:42:54 +0200 |
parents | b51332ab228f |
children | 28f87f5234a1 |
line wrap: on
line diff
--- a/mm7_5.cpp Thu Jul 18 04:08:20 2013 +0200 +++ b/mm7_5.cpp Thu Jul 18 14:42:54 2013 +0200 @@ -16,7 +16,6 @@ #include "Mouse.h" #include "Keyboard.h" #include "GammaControl.h" -#include "stru11.h" #include "mm7_data.h" #include "FactionTable.h" #include "Vis.h" @@ -3626,444 +3625,8 @@ this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z; } -//----- (00438526) -------------------------------------------------------- -stru11::stru11() -{ - stru11 *v1; // esi@1 - signed int v2; // eax@1 - char *v3; // edx@1 - - v1 = this; - v2 = 0; - this->cpuid_00000000_eax_numops = 0; - this->cpuid_00000001_eax = 0; - this->cpuid_00000001_edx = 0; - this->field_38 = 0; - this->field_3C = 0; - this->cpuid_80000000_edx = 0; - this->cpuid_80000001_eax = 0; - this->cpuid_80000001_edx = 0; - this->cpuid_80000005_ebx = 0; - this->cpuid_80000005_ecx = 0; - this->cpuid_80000005_edx = 0; - this->cpuid_80000006_ecx = 0; - this->field_AC = 0; - this->uProcessorManufacturer = 0; - LOBYTE(this->cpuid_80000002_registers2[0]) = 0; - v3 = (char *)&this->cpuid_00000002_eax; - do - { - if ( v2 < 3 ) - *((int *)v3 - 9) = 0; - if ( v2 < 4 ) - *(int *)v3 = 0; - if ( v2 < 12 ) - *((int *)v3 + 17) = 0; - if ( v2 < 13 ) - this->pCPUString[v2] = 0; - if ( v2 < 30 ) - *((char *)this->field_40 + v2) = 0; - *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0; - v3 += 4; - } - while ( v2 < 48 ); - CheckCPU(); -} - -//----- (004385B5) -------------------------------------------------------- -void stru11::CheckCPU() -{ - LOG_DECOMPILATION_WARNING(); - /* - int v5; // [sp-4h] [bp-10h]@0 - signed int v6; // [sp+4h] [bp-8h]@1 - signed int v7; // [sp+8h] [bp-4h]@1 - - _CF = 0; - _OF = 0; - _ZF = 1; - _SF = 0; - v7 = 0; - __asm { pushf } - v6 = 3; - if ( v5 != (v5 ^ 0x40000) ) - { - __asm { popf } - v6 = 4; - __asm { pushf } - if ( v5 != (v5 ^ 0x200000) ) - { - v7 = 1; - v6 = 0; - } - } - if ( v6 == 3 ) - { - this->field_AC = 1; - } - else - { - if ( v6 == 4 ) - { - this->field_AC = 2; - } - else - { - if ( v7 ) - { - this->field_AC = 2; - RunCPUID(); - } - else - { - this->field_AC = 0; - } - } - }*/ -} - -//----- (00438659) -------------------------------------------------------- -void stru11::RunCPUID() -{ - __debugbreak(); - /*stru11 *v6; // esi@1 - unsigned int uNumOps; // edi@1 - int uNumExtOps; // edi@16 - char pCyrixString[16]; // [sp+Ch] [bp-60h]@1 - char pCentaurString[16]; // [sp+1Ch] [bp-50h]@1 - char pAMDString[16]; // [sp+2Ch] [bp-40h]@1 - char pIntelString[16]; // [sp+3Ch] [bp-30h]@1 - char pCPUString[16]; // [sp+4Ch] [bp-20h]@1 - stru11 *thisa; // [sp+5Ch] [bp-10h]@1 - char *v35; // [sp+60h] [bp-Ch]@1 - int v36; // [sp+64h] [bp-8h]@1 - int v37; // [sp+68h] [bp-4h]@1 - - thisa = this; - *(int *)pIntelString = *(int *)"GenuineIntel"; - *(int *)&pIntelString[4] = *(int *)"ineIntel"; - *(int *)&pIntelString[8] = *(int *)"ntel"; - pIntelString[12] = aGenuineintel[12]; - *(int *)pAMDString = *(int *)"AuthenticAMD"; - *(int *)&pAMDString[4] = *(int *)"enticAMD"; - *(int *)&pAMDString[8] = *(int *)"cAMD"; - pAMDString[12] = aAuthenticamd[12]; - *(int *)pCyrixString = *(int *)"CyrixInstead"; - *(int *)&pCyrixString[4] = *(int *)"xInstead"; - *(int *)&pCyrixString[8] = *(int *)"tead"; - pCyrixString[12] = aCyrixinstead[12]; - *(int *)pCentaurString = *(int *)"CentaurHauls"; - *(int *)&pCentaurString[4] = *(int *)"aurHauls"; - *(int *)&pCentaurString[8] = *(int *)"auls"; - v37 = 0; - v36 = 0; - pCentaurString[12] = aCentaurhauls[12]; - v35 = pCPUString; - pCPUString[12] = 0; - _EAX = 0; - __asm { cpuid } - v37 = _EAX; - *(int *)pCPUString = _EBX; - *(int *)&pCPUString[4] = _EDX; - *(int *)&pCPUString[8] = _ECX; - v6 = thisa; - uNumOps = _EAX; - thisa->cpuid_00000000_ebx_vendorstr1 = _EBX; - v6->cpuid_00000000_edx_vendorstr2 = *(int *)&pCPUString[4]; - v6->cpuid_00000000_ecx_vendorstr3 = *(int *)&pCPUString[8]; - v6->cpuid_00000000_eax_numops = _EAX; - strcpy(v6->pCPUString, pCPUString); - if ( strcmp(pIntelString, pCPUString) ) - { - if ( strcmp(pAMDString, pCPUString) ) - { - if ( strcmp(pCyrixString, pCPUString) ) - { - if ( strcmp(pCentaurString, pCPUString) ) - v6->uProcessorManufacturer = 0; - else - v6->uProcessorManufacturer = 4; - } - else - { - v6->uProcessorManufacturer = 3; - } - } - else - { - v6->uProcessorManufacturer = 2; - } - } - else - { - v6->uProcessorManufacturer = 1; - } - if ( uNumOps >= 1 ) - RunCPUID_op1(); - if ( uNumOps >= 2 ) - RunCPUID_op2(); - _EAX = 0x80000000u; - __asm { cpuid } - if ( !(_EAX & 0x80000000) ) - _EAX = 0x80000000u; - v36 = _EAX; - v6->cpuid_80000000_edx = _EAX; - uNumExtOps = _EAX ^ 0x80000000; - if ( (_EAX ^ 0x80000000u) >= 1 ) - { - _EAX = 0x80000001u; - __asm { cpuid } - thisa = (stru11 *)_EAX; - v35 = (char *)_EDX; - v6->cpuid_80000001_eax = _EAX; - v6->cpuid_80000001_edx = (int)v35; - } - if ( (unsigned int)uNumExtOps >= 4 ) - RunCPUID_ext2_3_4(); - if ( (unsigned int)uNumExtOps >= 5 ) - { - _EAX = 0x80000005u; - __asm { cpuid } - thisa = (stru11 *)_EBX; - v35 = (char *)_ECX; - v36 = _EDX; - v6->cpuid_80000005_ebx = _EBX; - v6->cpuid_80000005_ecx = (int)v35; - v6->cpuid_80000005_edx = v36; - } - if ( (unsigned int)uNumExtOps >= 6 ) - { - _EAX = 0x80000006u; - __asm { cpuid } - v6->cpuid_80000006_ecx = _ECX; - }*/ -} - -//----- (00438821) -------------------------------------------------------- -void stru11::RunCPUID_op1() -{ - __debugbreak(); - /*stru11 *v1; // esi@1 - unsigned int v7; // ecx@1 - int v8; // eax@3 - int v9; // eax@10 - signed int v10; // eax@11 - int v11; // ecx@11 - int v12; // eax@15 - signed int v13; // eax@19 - int v14; // ecx@19 - signed int v15; // eax@25 - int v16; // ecx@25 - signed int v17; // eax@34 - int v18; // ecx@34 - - v1 = this; - _EAX = 1; - __asm { cpuid } - v7 = _EAX; - v1->cpuid_00000001_edx = _EDX; - v1->cpuid_00000001_eax = _EAX; - if ( (_EAX & 0x3000) == 8192 ) - { - LOBYTE(v1->cpuid_80000002_registers2[0]) = 1; - v7 = 0; - } - v8 = (v7 >> 8) & 0xF; - switch ( v8 ) - { - case 4: - v1->field_AC = 2; - break; - case 5: - v1->field_AC = 15; - break; - case 6: - v1->field_AC = 36; - break; - default: - v1->field_AC = 49; - break; - } - v9 = v1->uProcessorManufacturer; - if ( v9 == 1 ) - { - v10 = 0; - v11 = v7 & 0x3FF0; - while ( v11 != dword_4E4948[2 * v10] ) - { - ++v10; - if ( v10 >= 17 ) - return; - } - v12 = dword_4E494C[2 * v10]; - goto LABEL_39; - } - if ( v9 == 2 ) - { - if ( (v7 & 0xF00) == dword_4E49D0[0] ) - { - v12 = dword_4E49D4[0]; - } - else - { - v13 = 1; - v14 = v7 & 0x3FF0; - while ( v14 != dword_4E49D0[2 * v13] ) - { - ++v13; - if ( v13 >= 9 ) - return; - } - v12 = dword_4E49D4[2 * v13]; - } - goto LABEL_39; - } - if ( v9 != 3 ) - { - if ( v9 != 4 ) - return; - v17 = 0; - v18 = v7 & 0x3FF0; - while ( v18 != dword_4E4A40[2 * v17] ) - { - ++v17; - if ( v17 >= 2 ) - return; - } - v12 = dword_4E4A44[2 * v17]; - goto LABEL_39; - } - v15 = 1; - v16 = v7 & 0x3FF0; - while ( v16 != dword_4E4A18[2 * v15] ) - { - ++v15; - if ( v15 >= 5 ) - goto LABEL_30; - } - v1->field_AC = dword_4E4A1C[2 * v15]; -LABEL_30: - v12 = 24; - if ( v1->field_AC == 24 ) - { - if ( _EDX != 1 ) - v12 = (((_EDX != 261) - 1) & 0xA) + 15; -LABEL_39: - v1->field_AC = v12; - }*/ -} - -//----- (00438992) -------------------------------------------------------- -void stru11::RunCPUID_op2() -{ - __debugbreak(); - /* - stru11 *v1; // edi@1 - int v7; // eax@1 - signed int v8; // ecx@2 - unsigned __int8 v9; // al@3 - signed int v10; // ecx@14 - unsigned __int8 v11; // al@15 - int v12; // [sp+Ch] [bp-14h]@1 - int v13; // [sp+10h] [bp-10h]@1 - int v14; // [sp+14h] [bp-Ch]@1 - int v15; // [sp+18h] [bp-8h]@1 - int *v16; // [sp+1Ch] [bp-4h]@1 - - v1 = this; - v16 = &v12; - _EAX = 2; - __asm { cpuid } - v12 = _EAX; - v13 = _EBX; - v14 = _ECX; - v15 = _EDX; - v1->cpuid_00000002_eax = _EAX; - v1->cpuid_00000002_ebx = v13; - v1->cpuid_00000002_ecx = v14; - v1->cpuid_00000002_edx = v15; - v7 = v1->field_AC; - if ( v7 == 40 ) - { - v8 = 0; - while ( 1 ) - { - v9 = *((char *)&v12 + v8); - if ( v9 == 64 ) - { - v1->field_AC = 43; - return; - } - if ( v9 >= 0x41u && v9 <= 0x43u ) - { - v1->field_AC = 41; - return; - } - if ( v9 >= 0x44u && v9 <= 0x45u ) - break; - ++v8; - if ( v8 >= 16 ) - return; - } - v1->field_AC = 42; - } - else - { - if ( v7 == 45 ) - { - v10 = 0; - while ( 1 ) - { - v11 = *((char *)&v12 + v10); - if ( v11 >= 0x40u && v11 <= 0x43u ) - { - v1->field_AC = 46; - return; - } - if ( v11 >= 0x44u && v11 <= 0x45u ) - break; - ++v10; - if ( v10 >= 16 ) - return; - } - v1->field_AC = 47; - } - }*/ -} - -//----- (00438A67) -------------------------------------------------------- -void stru11::RunCPUID_ext2_3_4() -{ - __debugbreak(); - /*stru11 *v1; // edi@1 - stru11 *v17; // eax@1 - int v18[3][4]; // [sp+Ch] [bp-38h]@1 - stru11 *v19; // [sp+3Ch] [bp-8h]@1 - - v1 = this; - v19 = this; - _EAX = 0x80000002u; - __asm { cpuid } - v18[0][0] = _EAX; - *(_QWORD *)&v18[0][1] = __PAIR__(_ECX, _EBX); - v18[0][3] = _EDX; - _EAX = 0x80000003u; - __asm { cpuid } - v18[1][0] = _EAX; - *(_QWORD *)&v18[1][1] = __PAIR__(_ECX, _EBX); - v18[1][3] = _EDX; - _EAX = 0x80000004u; - __asm { cpuid } - v18[2][0] = _EAX; - *(_QWORD *)&v18[2][1] = __PAIR__(_ECX, _EBX); - v18[2][3] = _EDX; - v17 = v19; - memcpy(v1->cpuid_80000002_registers, v18, 0x30u); - memcpy((char *)&v17->cpuid_80000002_registers2[0] + 1, v18, 0x30u);*/ -} - //----- (00438F8F) -------------------------------------------------------- -void __cdecl area_of_effect__damage_evaluate() +void area_of_effect__damage_evaluate() { int v0; // edx@1 char *v1; // esi@2 @@ -4295,7 +3858,7 @@ //----- (0043A97E) -------------------------------------------------------- void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2) { - if ( PID_TYPE(a2) == OBJECT_BLVDoor) + if (PID_TYPE(a2) == OBJECT_BLVDoor) { layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x; layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y; @@ -4552,13 +4115,6 @@ } } -// A750D8: using guessed type __int64 qword_A750D8; - - -// A750D8: using guessed type __int64 qword_A750D8; - - -// A750D8: using guessed type __int64 qword_A750D8; //----- (0043F515) -------------------------------------------------------- void FindBillboardsLightLevels_BLV() @@ -5356,7 +4912,7 @@ //----- (0040DEDB) -------------------------------------------------------- unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor) { - return TargetColor((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor)); + return TargetColor(LOBYTE(uColor), BYTE1(uColor), BYTE2(uColor)); } //----- (0040DEF3) --------------------------------------------------------