Dataset Preview
Go to dataset viewer
code (string)repo_name (string)path (string)language (string)license (string)size (int32)
";Imports of r_xsurface_load_obj: extern Hunk_AllocateTempMemory extern memcpy extern XSurfaceTransfer extern Hunk_FreeTempMemory extern r_modelVertColor extern malloc extern ClearBounds extern AddPointToBounds extern ExpandBounds extern BuildAabbTree extern free ;Exports of r_xsurface_load_obj: global XModelReadSurface global XModelReadSurface_BuildCollisionTree SECTION .text ;XModelReadSurface(XModel*, unsigned char const**, void* (*)(int), XSurface*) XModelReadSurface: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x69c mov esi, [ebp+0xc] mov dword [ebp-0x2c], 0x0 mov dword [ebp-0x28], 0x0 mov dword [ebp-0x24], 0x0 mov dword [ebp-0x20], 0x0 mov eax, [esi] movzx eax, byte [eax] mov edx, [ebp+0x14] mov [edx], al mov eax, [esi] lea edx, [eax+0x1] mov [esi], edx movzx edx, word [eax+0x1] mov [ebp-0x1c], dx lea edx, [eax+0x3] mov [esi], edx movzx edx, word [eax+0x3] mov [ebp-0x1c], dx add eax, 0x5 mov [esi], eax mov ecx, [ebp+0x14] mov [ecx+0x2], dx mov eax, [esi] movzx edx, word [eax] mov [ebp-0x1c], dx add eax, 0x2 mov [esi], eax mov [ecx+0x4], dx mov dword [ebp-0x674], 0x0 xor edi, edi lea ebx, [ebp-0x638] jmp XModelReadSurface_10 XModelReadSurface_20: movsx eax, word [ecx+0x2] mov [ebp-0x1c], ax lea edx, [ecx+0x4] mov [esi], edx shl eax, 0x6 mov [ebx], ax movzx eax, word [ebx+0x2] add edi, eax add dword [ebp-0x674], 0x1 add ebx, 0xc XModelReadSurface_10: mov ecx, [esi] movzx edx, word [ecx] mov [ebp-0x1c], dx lea eax, [ecx+0x2] mov [esi], eax mov [ebx+0x2], dx test dx, dx jnz XModelReadSurface_20 mov eax, [ebp+0x14] movzx ebx, word [eax+0x2] cmp ebx, edi setnz byte [ebp-0x675] cmp byte [ebp-0x675], 0x0 mov eax, 0x0 cmovz eax, [ebp-0x674] mov [ebp-0x674], eax movzx edx, byte [ebp-0x675] mov ecx, [ebp+0x14] mov [ecx+0x1], dl sub eax, 0x1 jz XModelReadSurface_30 mov eax, [esi] movsx edx, word [eax] mov [ebp-0x1c], dx add eax, 0x2 mov [esi], eax mov eax, edx movzx ebx, word [ecx+0x2] shl ebx, 0x4 lea eax, [ebx+eax] shl eax, 0x2 mov [esp], eax call Hunk_AllocateTempMemory mov [ebp-0x67c], eax mov edi, eax mov ebx, [ebp+0x14] cmp word [ebx+0x2], 0x0 jnz XModelReadSurface_40 XModelReadSurface_390: mov ecx, ebx XModelReadSurface_470: movzx eax, word [ecx+0x4] lea ebx, [eax+0x1] and ebx, 0xfffffffe mov [ebp-0x680], ebx lea eax, [eax+eax*2] lea eax, [eax+eax+0x6] mov [esp], eax call dword [ebp+0x10] mov edx, [ebp+0x14] mov [edx+0xc], eax movzx ebx, word [edx+0x4] lea eax, [ebx+ebx*2] test eax, eax jg XModelReadSurface_50 mov dword [ebp-0x684], 0x0 XModelReadSurface_500: mov esi, [ebp-0x674] test esi, esi jle XModelReadSurface_60 mov dword [ebp-0x640], 0x0 xor edi, edi mov dword [ebp-0x650], 0x0 lea ecx, [ebp-0x638] mov [ebp-0x64c], ecx mov esi, ecx mov [esi+0x4], di movzx eax, word [esi+0x2] add [ebp-0x650], eax cmp edi, ebx jge XModelReadSurface_70 XModelReadSurface_100: mov eax, [ebp+0x14] mov ecx, [eax+0xc] lea eax, [edi+edi*2] lea edx, [eax+eax] movzx eax, word [edx+ecx] cmp [ebp-0x650], eax jle XModelReadSurface_70 lea ecx, [edx+ecx] mov edx, edi mov esi, ebx XModelReadSurface_90: add edx, 0x1 cmp esi, edx jz XModelReadSurface_80 movzx eax, word [ecx+0x6] add ecx, 0x6 cmp [ebp-0x650], eax jg XModelReadSurface_90 XModelReadSurface_80: mov eax, edx sub ax, di mov edi, edx XModelReadSurface_110: mov edx, [ebp-0x64c] mov [edx+0x6], ax add dword [ebp-0x640], 0x1 add edx, 0xc mov [ebp-0x64c], edx mov ecx, [ebp-0x640] cmp [ebp-0x674], ecx jz XModelReadSurface_60 mov esi, edx mov [esi+0x4], di movzx eax, word [esi+0x2] add [ebp-0x650], eax cmp edi, ebx jl XModelReadSurface_100 XModelReadSurface_70: xor eax, eax jmp XModelReadSurface_110 XModelReadSurface_60: cmp [ebp-0x680], ebx jz XModelReadSurface_120 mov ebx, [ebp+0x14] mov ecx, [ebx+0xc] mov eax, [ebp-0x684] add eax, eax movzx edx, word [ecx+eax-0x2] mov [ecx+eax], dx mov ecx, eax add ecx, [ebx+0xc] movzx edx, word [ecx-0x2] mov [ecx+0x2], dx add eax, [ebx+0xc] movzx edx, word [eax-0x2] mov [eax+0x4], dx add word [ebx+0x4], 0x1 XModelReadSurface_120: mov ebx, [ebp-0x674] test ebx, ebx jnz XModelReadSurface_130 xor eax, eax xor ebx, ebx XModelReadSurface_480: mov edx, [ebp+0x14] mov [edx+0x24], eax mov ecx, [ebp-0x674] mov [edx+0x20], ecx mov [esp+0x8], ebx lea ebx, [ebp-0x638] mov [esp+0x4], ebx mov [esp], eax call memcpy mov esi, [ebp+0x14] movzx ebx, word [esi+0x2] shl ebx, 0x5 mov [esp], ebx call dword [ebp+0x10] mov [esi+0x1c], eax mov eax, [ebp+0x8] add [eax+0xcc], ebx mov edx, [esi+0x1c] movzx eax, word [esi+0x2] mov [esp+0xc], eax mov [esp+0x8], edx mov [esp+0x4], edx mov edx, [ebp-0x67c] mov [esp], edx call XSurfaceTransfer cmp byte [ebp-0x675], 0x0 jz XModelReadSurface_140 mov eax, [ebp-0x2c] test eax, eax jnz XModelReadSurface_150 mov dword [ebp-0x660], 0x0 mov eax, [ebp-0x28] test eax, eax jnz XModelReadSurface_160 XModelReadSurface_530: mov dword [ebp-0x65c], 0x0 mov eax, [ebp-0x24] test eax, eax jnz XModelReadSurface_170 XModelReadSurface_540: mov dword [ebp-0x658], 0x0 mov edx, [ebp-0x20] test edx, edx jnz XModelReadSurface_180 XModelReadSurface_550: mov dword [ebp-0x654], 0x0 XModelReadSurface_560: mov edx, [ebp+0x14] mov ecx, 0x1 lea ebx, [ebp-0x2c] XModelReadSurface_190: mov eax, [ebx+ecx*4-0x4] mov [edx+0x10], ax add ecx, 0x1 add edx, 0x2 cmp ecx, 0x5 jnz XModelReadSurface_190 mov edi, [ebp-0x67c] mov ecx, [ebp+0x14] cmp word [ecx+0x2], 0x0 jz XModelReadSurface_200 mov ebx, [ebp-0x660] mov [ebp-0x670], ebx mov esi, [ebp-0x65c] mov [ebp-0x66c], esi mov eax, [ebp-0x658] mov [ebp-0x668], eax mov edx, [ebp-0x654] mov [ebp-0x664], edx mov dword [ebp-0x63c], 0x0 XModelReadSurface_260: movzx eax, byte [edi+0x3c] cmp al, 0x1 jz XModelReadSurface_210 jb XModelReadSurface_220 cmp al, 0x2 jz XModelReadSurface_230 mov edx, [ebp-0x664] lea ecx, [edx+0x2] lea ebx, [edx+0xe] mov [ebp-0x664], ebx XModelReadSurface_380: movzx eax, word [edi+0x3e] mov [edx], ax movzx eax, byte [edi+0x3c] add edi, 0x40 test al, al jz XModelReadSurface_240 movzx esi, al test esi, esi jle XModelReadSurface_240 mov edx, edi xor ebx, ebx XModelReadSurface_250: movzx eax, word [edx] mov [ecx], ax movzx eax, word [edx+0x2] mov [ecx+0x2], ax add ecx, 0x4 add edx, 0x4 add ebx, 0x1 cmp ebx, esi jnz XModelReadSurface_250 mov edi, edx XModelReadSurface_240: add dword [ebp-0x63c], 0x1 mov edx, [ebp+0x14] movzx eax, word [edx+0x2] cmp [ebp-0x63c], eax jl XModelReadSurface_260 mov ebx, edx XModelReadSurface_520: movsx ecx, word [ebx+0x10] movsx edx, word [ebx+0x14] lea edx, [edx+edx*4] movsx eax, word [ebx+0x12] lea eax, [eax+eax*2] add edx, eax add ecx, edx movsx edx, word [ebx+0x16] lea eax, [edx*8] sub eax, edx add ecx, eax mov ebx, ecx add ebx, ebx jnz XModelReadSurface_270 xor ecx, ecx XModelReadSurface_650: mov esi, [ebp+0x8] add [esi+0xcc], ebx mov eax, [ebp+0x14] mov [eax+0x18], ecx cmp word [eax+0x10], 0x0 jz XModelReadSurface_280 jg XModelReadSurface_290 XModelReadSurface_280: mov eax, [ebp+0x14] XModelReadSurface_580: cmp word [eax+0x12], 0x0 jz XModelReadSurface_300 jg XModelReadSurface_310 XModelReadSurface_300: mov eax, [ebp+0x14] XModelReadSurface_640: cmp word [eax+0x14], 0x0 jz XModelReadSurface_320 jg XModelReadSurface_330 XModelReadSurface_320: mov eax, [ebp+0x14] XModelReadSurface_620: cmp word [eax+0x16], 0x0 jz XModelReadSurface_140 jg XModelReadSurface_340 XModelReadSurface_140: mov eax, [ebp+0x14] XModelReadSurface_600: mov ecx, [eax+0x20] test ecx, ecx jz XModelReadSurface_350 xor ebx, ebx mov ecx, [ebp+0x14] jmp XModelReadSurface_360 XModelReadSurface_370: mov ecx, esi XModelReadSurface_360: mov edx, [ebp+0x10] mov [esp+0x8], edx mov [esp+0x4], ebx mov [esp], ecx call XModelReadSurface_BuildCollisionTree add ebx, 0x1 mov esi, [ebp+0x14] cmp ebx, [esi+0x20] jnz XModelReadSurface_370 XModelReadSurface_350: mov eax, [ebp-0x67c] mov [esp], eax call Hunk_FreeTempMemory add esp, 0x69c pop ebx pop esi pop edi pop ebp ret XModelReadSurface_220: mov edx, [ebp-0x670] mov esi, edx add esi, 0x2 mov [ebp-0x670], esi xor ecx, ecx jmp XModelReadSurface_380 XModelReadSurface_210: mov edx, [ebp-0x66c] lea ecx, [edx+0x2] lea eax, [edx+0x6] mov [ebp-0x66c], eax jmp XModelReadSurface_380 XModelReadSurface_30: movzx ecx, word [ebp-0x638] shr cx, 0x6 movzx ecx, cx mov edx, ecx sar edx, 0x5 and ecx, 0x1f mov eax, 0x80000000 shr eax, cl mov ecx, [ebp+0x14] or [ecx+edx*4+0x28], eax xor eax, eax shl ebx, 0x4 lea eax, [ebx+eax] shl eax, 0x2 mov [esp], eax call Hunk_AllocateTempMemory mov [ebp-0x67c], eax mov edi, eax mov ebx, [ebp+0x14] cmp word [ebx+0x2], 0x0 jz XModelReadSurface_390 XModelReadSurface_40: mov dword [ebp-0x688], 0x0 lea eax, [ebx+0x28] mov [ebp-0x690], eax jmp XModelReadSurface_400 XModelReadSurface_450: mov dword [edi+0xc], 0xffffffff XModelReadSurface_460: mov eax, [esi] lea edx, [eax+0x4] mov [esi], edx mov edx, [eax+0x4] mov [ebp-0x1c], edx add eax, 0x8 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x1c], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x2c], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x10], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x14], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x18], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x20], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x24], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x28], eax cmp dword [ebp-0x674], 0x1 jz XModelReadSurface_410 mov eax, [esi] movzx ecx, byte [eax] mov [ebp-0x641], cl add eax, 0x1 mov [esi], eax mov [edi+0x3c], cl movzx ebx, cl mov [ebp-0x648], ebx add dword [ebp+ebx*4-0x2c], 0x1 mov edx, [esi] movsx eax, word [edx] mov [ebp-0x1c], ax add edx, 0x2 mov [esi], edx mov ebx, eax sar ebx, 0x5 mov ecx, eax and ecx, 0x1f mov edx, 0x80000000 shr edx, cl mov ecx, [ebp+0x14] or [ecx+ebx*4+0x28], edx shl eax, 0x6 mov [edi+0x3e], ax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x30], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x34], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x38], eax add edi, 0x40 cmp byte [ebp-0x641], 0x0 jz XModelReadSurface_420 mov eax, [ebp-0x648] test eax, eax jg XModelReadSurface_430 XModelReadSurface_420: add dword [ebp-0x688], 0x1 mov edx, [ebp+0x14] movzx eax, word [edx+0x2] cmp [ebp-0x688], eax jge XModelReadSurface_440 XModelReadSurface_400: mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x4], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x8], eax mov edx, r_modelVertColor mov eax, [edx] cmp byte [eax+0xc], 0x0 jz XModelReadSurface_450 mov ecx, [esi] movzx edx, byte [ecx+0x2] shl edx, 0x10 movzx eax, byte [ecx+0x1] shl eax, 0x8 or edx, eax movzx eax, byte [ecx] or edx, eax movzx eax, byte [ecx+0x3] shl eax, 0x18 or edx, eax mov [edi+0xc], edx jmp XModelReadSurface_460 XModelReadSurface_410: mov byte [edi+0x3c], 0x0 movzx eax, word [ebp-0x638] mov [edi+0x3e], ax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x30], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x34], eax mov eax, [esi] mov edx, [eax] mov [ebp-0x1c], edx add eax, 0x4 mov [esi], eax mov eax, [ebp-0x1c] mov [edi+0x38], eax add edi, 0x40 add dword [ebp-0x688], 0x1 mov edx, [ebp+0x14] movzx eax, word [edx+0x2] cmp [ebp-0x688], eax jl XModelReadSurface_400 XModelReadSurface_440: mov ecx, edx jmp XModelReadSurface_470 XModelReadSurface_130: mov esi, [ebp-0x674] lea eax, [esi+esi*2] lea ebx, [eax*4] mov [esp], ebx call dword [ebp+0x10] jmp XModelReadSurface_480 XModelReadSurface_50: mov dword [ebp-0x684], 0x0 XModelReadSurface_490: mov ebx, [ebp+0x14] mov ecx, [ebx+0xc] mov eax, [esi] movzx edx, word [eax] mov [ebp-0x1c], dx add eax, 0x2 mov [esi], eax mov eax, [ebp-0x684] mov [ecx+eax*2], dx add eax, 0x1 mov [ebp-0x684], eax mov edx, [ebp+0x14] movzx ebx, word [edx+0x4] lea eax, [ebx+ebx*2] cmp eax, [ebp-0x684] jg XModelReadSurface_490 jmp XModelReadSurface_500 XModelReadSurface_430: mov dword [ebp-0x68c], 0x0 XModelReadSurface_510: mov edx, [esi] movsx eax, word [edx] mov [ebp-0x1c], ax add edx, 0x2 mov [esi], edx mov ebx, eax sar ebx, 0x5 mov ecx, eax and ecx, 0x1f mov edx, 0x80000000 shr edx, cl mov ecx, [ebp-0x690] or [ecx+ebx*4], edx shl eax, 0x6 mov [edi], ax mov eax, [esi] movzx edx, word [eax] mov [ebp-0x1c], dx add eax, 0x2 mov [esi], eax mov [edi+0x2], dx add edi, 0x4 add dword [ebp-0x68c], 0x1 mov ebx, [ebp-0x68c] cmp [ebp-0x648], ebx jnz XModelReadSurface_510 jmp XModelReadSurface_420 XModelReadSurface_200: mov ebx, ecx jmp XModelReadSurface_520 XModelReadSurface_230: mov edx, [ebp-0x668] mov ecx, edx add ecx, 0x2 add dword [ebp-0x668], 0xa jmp XModelReadSurface_380 XModelReadSurface_150: add eax, eax mov [esp], eax call dword [ebp+0x10] mov [ebp-0x660], eax mov eax, [ebp-0x28] test eax, eax jz XModelReadSurface_530 XModelReadSurface_160: lea eax, [eax+eax*2] add eax, eax mov [esp], eax call dword [ebp+0x10] mov [ebp-0x65c], eax mov eax, [ebp-0x24] test eax, eax jz XModelReadSurface_540 XModelReadSurface_170: lea eax, [eax+eax*4] add eax, eax mov [esp], eax call dword [ebp+0x10] mov [ebp-0x658], eax mov edx, [ebp-0x20] test edx, edx jz XModelReadSurface_550 XModelReadSurface_180: lea eax, [edx+edx] shl edx, 0x4 sub edx, eax mov [esp], edx call dword [ebp+0x10] mov [ebp-0x654], eax jmp XModelReadSurface_560 XModelReadSurface_290: mov ebx, [ebp-0x660] xor edx, edx XModelReadSurface_570: movzx eax, word [ebx] mov [ecx], ax add ecx, 0x2 add edx, 0x1 add ebx, 0x2 mov esi, [ebp+0x14] movsx eax, word [esi+0x10] cmp eax, edx jg XModelReadSurface_570 mov eax, esi jmp XModelReadSurface_580 XModelReadSurface_340: mov edx, [ebp-0x654] xor ebx, ebx XModelReadSurface_590: movzx eax, word [edx] mov [ecx], ax movzx eax, word [edx+0x2] mov [ecx+0x2], ax movzx eax, word [edx+0x4] mov [ecx+0x4], ax movzx eax, word [edx+0x6] mov [ecx+0x6], ax movzx eax, word [edx+0x8] mov [ecx+0x8], ax movzx eax, word [edx+0xa] mov [ecx+0xa], ax movzx eax, word [edx+0xc] mov [ecx+0xc], ax add ecx, 0xe add ebx, 0x1 add edx, 0xe mov esi, [ebp+0x14] movsx eax, word [esi+0x16] cmp ebx, eax jl XModelReadSurface_590 mov eax, esi jmp XModelReadSurface_600 XModelReadSurface_330: mov edx, [ebp-0x658] xor ebx, ebx XModelReadSurface_610: movzx eax, word [edx] mov [ecx], ax movzx eax, word [edx+0x2] mov [ecx+0x2], ax movzx eax, word [edx+0x4] mov [ecx+0x4], ax movzx eax, word [edx+0x6] mov [ecx+0x6], ax movzx eax, word [edx+0x8] mov [ecx+0x8], ax add ecx, 0xa add ebx, 0x1 add edx, 0xa mov esi, [ebp+0x14] movsx eax, word [esi+0x14] cmp ebx, eax jl XModelReadSurface_610 mov eax, esi jmp XModelReadSurface_620 XModelReadSurface_310: mov edx, [ebp-0x65c] xor ebx, ebx XModelReadSurface_630: movzx eax, word [edx] mov [ecx], ax movzx eax, word [edx+0x2] mov [ecx+0x2], ax movzx eax, word [edx+0x4] mov [ecx+0x4], ax add ecx, 0x6 add ebx, 0x1 add edx, 0x6 mov esi, [ebp+0x14] movsx eax, word [esi+0x12] cmp ebx, eax jl XModelReadSurface_630 mov eax, esi jmp XModelReadSurface_640 XModelReadSurface_270: mov [esp], ebx call dword [ebp+0x10] mov ecx, eax jmp XModelReadSurface_650 add [eax], al ;XModelReadSurface_BuildCollisionTree(XSurface*, unsigned int, void* (*)(int)) XModelReadSurface_BuildCollisionTree: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x1ac mov ebx, [ebp+0xc] lea ebx, [ebx+ebx*2] mov edx, [ebp+0x8] mov eax, [edx+0x24] lea ebx, [eax+ebx*4] mov dword [esp], 0x28 call dword [ebp+0x10] mov [ebp-0xb0], eax mov [ebx+0x8], eax cld mov ecx, 0xa xor eax, eax lea edi, [ebp-0x88] rep stosd mov dword [ebp-0x7c], 0x1 mov dword [esp], 0x20000 call malloc mov [ebp-0x70], eax mov dword [ebp-0x6c], 0x2000 mov dword [ebp-0x68], 0x1 mov dword [ebp-0x64], 0x10 lea eax, [ebp-0x30] mov [esp+0x4], eax lea edx, [ebp-0x24] mov [esp], edx call ClearBounds mov eax, [ebp-0xb0] mov dword [eax+0x24], 0x0 movzx edx, word [ebx+0x4] mov [ebp-0xa4], edx movzx eax, word [ebx+0x6] add eax, edx mov [ebp-0xa0], eax mov byte [ebp-0x99], 0x0 lea eax, [edx+edx*2] add eax, eax mov [ebp-0xb4], eax lea edi, [ebp-0x54] jmp XModelReadSurface_BuildCollisionTree_10 XModelReadSurface_BuildCollisionTree_30: mov dword [ebp-0xa8], 0x0 XModelReadSurface_BuildCollisionTree_60: cmp byte [ebp-0x99], 0x0 jnz XModelReadSurface_BuildCollisionTree_20 mov ebx, [ebp-0xa8] add ebx, ebx mov [esp], ebx call dword [ebp+0x10] mov edx, [ebp-0xb0] mov [edx+0x24], eax mov eax, [ebp-0xa8] mov [edx+0x20], eax add ebx, eax shl ebx, 0x2 mov [esp], ebx call malloc mov [ebp-0x78], eax mov [esp], ebx call malloc mov [ebp-0x74], eax mov edx, [ebp-0xb0] mov eax, [edx+0x24] mov [ebp-0x88], eax mov eax, [ebp-0xa8] mov [ebp-0x84], eax mov dword [ebp-0x80], 0x2 mov byte [ebp-0x99], 0x1 XModelReadSurface_BuildCollisionTree_10: lea eax, [ebp-0x48] mov [esp+0x4], eax lea edx, [ebp-0x3c] mov [esp], edx call ClearBounds mov eax, [ebp-0xa0] cmp [ebp-0xa4], eax jz XModelReadSurface_BuildCollisionTree_30 mov ebx, [ebp-0xb4] mov esi, [ebp-0xa4] mov byte [ebp-0x9a], 0x0 mov dword [ebp-0xa8], 0x0 mov dword [ebp-0x17c], 0x0 mov dword [ebp-0x180], 0x0 jmp XModelReadSurface_BuildCollisionTree_40 XModelReadSurface_BuildCollisionTree_70: cmp byte [ebp-0x99], 0x0 jz XModelReadSurface_BuildCollisionTree_50 mov edx, [ebp-0xb0] mov eax, [edx+0x24] mov edx, [ebp-0xa8] mov [eax+edx*2], si mov edx, [ebp-0x17c] add edx, [ebp-0x78] mov eax, [ebp-0x54] mov [edx], eax mov eax, [ebp-0x50] mov [edx+0x4], eax mov eax, [ebp-0x4c] mov [edx+0x8], eax mov edx, [ebp-0x17c] add edx, [ebp-0x74] mov eax, [ebp-0x60] mov [edx], eax mov eax, [ebp-0x5c] mov [edx+0x4], eax mov eax, [ebp-0x58] mov [edx+0x8], eax XModelReadSurface_BuildCollisionTree_50: add dword [ebp-0xa8], 0x1 add dword [ebp-0x180], 0x2 add dword [ebp-0x17c], 0xc mov eax, [ebp-0x54] mov [ebp-0x3c], eax mov eax, [ebp-0x50] mov [ebp-0x38], eax mov eax, [ebp-0x4c] mov [ebp-0x34], eax mov eax, [ebp-0x60] mov [ebp-0x48], eax mov eax, [ebp-0x5c] mov [ebp-0x44], eax mov eax, [ebp-0x58] mov [ebp-0x40], eax mov byte [ebp-0x9a], 0x1 XModelReadSurface_BuildCollisionTree_90: add esi, 0x1 add ebx, 0x6 cmp [ebp-0xa0], esi jz XModelReadSurface_BuildCollisionTree_60 XModelReadSurface_BuildCollisionTree_40: lea edx, [ebp-0x60] mov [esp+0x4], edx mov [esp], edi call ClearBounds lea eax, [ebp-0x60] mov [esp+0x8], eax mov [esp+0x4], edi mov edx, [ebp+0x8] mov eax, [edx+0xc] movzx eax, word [ebx+eax] shl eax, 0x5 add eax, [edx+0x1c] mov [esp], eax call AddPointToBounds lea eax, [ebp-0x60] mov [esp+0x8], eax mov [esp+0x4], edi mov edx, [ebp+0x8] mov eax, [edx+0xc] movzx eax, word [ebx+eax+0x2] shl eax, 0x5 add eax, [edx+0x1c] mov [esp], eax call AddPointToBounds lea eax, [ebp-0x60] mov [esp+0x8], eax mov [esp+0x4], edi mov edx, [ebp+0x8] mov eax, [edx+0xc] movzx eax, word [ebx+eax+0x4] shl eax, 0x5 add eax, [edx+0x1c] mov [esp], eax call AddPointToBounds lea eax, [ebp-0x30] mov [esp+0xc], eax lea edx, [ebp-0x24] mov [esp+0x8], edx lea eax, [ebp-0x60] mov [esp+0x4], eax mov [esp], edi call ExpandBounds cmp byte [ebp-0x9a], 0x0 jz XModelReadSurface_BuildCollisionTree_70 movss xmm3, dword [ebp-0x40] subss xmm3, [ebp-0x34] movss xmm1, dword [ebp-0x48] subss xmm1, [ebp-0x3c] movss xmm0, dword [ebp-0x44] subss xmm0, [ebp-0x38] mulss xmm1, xmm0 mulss xmm3, xmm1 movss xmm4, dword [ebp-0x58] subss xmm4, [ebp-0x4c] movss xmm1, dword [ebp-0x60] subss xmm1, [ebp-0x54] movss xmm0, dword [ebp-0x5c] subss xmm0, [ebp-0x50] mulss xmm1, xmm0 mulss xmm4, xmm1 lea edx, [ebp-0x48] mov [esp+0xc], edx lea eax, [ebp-0x3c] mov [esp+0x8], eax lea edx, [ebp-0x60] mov [esp+0x4], edx mov [esp], edi movss [ebp-0x198], xmm3 movss [ebp-0x1a8], xmm4 call ExpandBounds movss xmm5, dword [ebp-0x3c] movss xmm2, dword [ebp-0x40] subss xmm2, [ebp-0x34] movss xmm1, dword [ebp-0x48] subss xmm1, xmm5 movss xmm0, dword [ebp-0x44] subss xmm0, [ebp-0x38] mulss xmm1, xmm0 mulss xmm2, xmm1 movss xmm3, dword [ebp-0x198] movss xmm4, dword [ebp-0x1a8] addss xmm3, xmm4 ucomiss xmm3, xmm2 jb XModelReadSurface_BuildCollisionTree_70 cmp byte [ebp-0x99], 0x0 jz XModelReadSurface_BuildCollisionTree_80 mov eax, [ebp-0x17c] add eax, [ebp-0x78] lea edx, [eax-0xc] movss [eax-0xc], xmm5 mov eax, [ebp-0x38] mov [edx+0x4], eax mov eax, [ebp-0x34] mov [edx+0x8], eax mov edx, [ebp-0x17c] add edx, [ebp-0x74] lea ecx, [edx-0xc] mov eax, [ebp-0x48] mov [edx-0xc], eax mov eax, [ebp-0x44] mov [ecx+0x4], eax mov eax, [ebp-0x40] mov [ecx+0x8], eax mov eax, [ebp-0x180] mov edx, [ebp-0xb0] add eax, [edx+0x24] sub word [eax-0x2], 0x8000 XModelReadSurface_BuildCollisionTree_80: mov byte [ebp-0x9a], 0x0 jmp XModelReadSurface_BuildCollisionTree_90 XModelReadSurface_BuildCollisionTree_20: movss xmm1, dword [_data16_80000000] movss xmm0, dword [ebp-0x24] xorps xmm0, xmm1 mov edx, [ebp-0xb0] movss [edx], xmm0 movss xmm0, dword [ebp-0x20] xorps xmm0, xmm1 movss [edx+0x4], xmm0 movss xmm0, dword [ebp-0x1c] xorps xmm0, xmm1 movss [edx+0x8], xmm0 movss xmm2, dword [ebp-0x2c] subss xmm2, [ebp-0x20] movss xmm3, dword [ebp-0x28] subss xmm3, [ebp-0x1c] movss xmm1, dword [ebp-0x30] subss xmm1, [ebp-0x24] movss xmm0, dword [_float_65535_00000000] movaps xmm4, xmm0 divss xmm4, xmm1 movss [edx+0xc], xmm4 movaps xmm1, xmm0 divss xmm1, xmm2 movss [edx+0x10], xmm1 divss xmm0, xmm3 movss [edx+0x14], xmm0 lea eax, [ebp-0x88] mov [esp], eax call BuildAabbTree mov [ebp-0xac], eax mov edx, [ebp-0xb0] mov [edx+0x18], eax mov eax, [ebp-0xac] shl eax, 0x4 add eax, 0xf mov [esp], eax call dword [ebp+0x10] add eax, 0xf and eax, 0xfffffff0 mov edx, [ebp-0xb0] mov [edx+0x1c], eax mov edx, [ebp-0xac] test edx, edx jz XModelReadSurface_BuildCollisionTree_100 mov dword [ebp-0x98], 0x0 mov dword [ebp-0x8c], 0x0 XModelReadSurface_BuildCollisionTree_200: mov edx, [ebp-0x8c] mov eax, [ebp-0xb0] add edx, [eax+0x1c] mov [ebp-0x94], edx mov eax, [ebp-0x8c] add eax, [ebp-0x70] mov [ebp-0x90], eax mov esi, [eax] add esi, [eax+0x4] lea edx, [ebp-0x54] mov [esp+0x4], edx lea eax, [ebp-0x60] mov [esp], eax call ClearBounds mov eax, [ebp-0x90] mov edx, [eax] cmp esi, edx jz XModelReadSurface_BuildCollisionTree_110 lea eax, [edx+edx*2] lea ebx, [eax*4] xor edi, edi sub esi, edx XModelReadSurface_BuildCollisionTree_120: lea edx, [ebp-0x54] mov [esp+0xc], edx lea eax, [ebp-0x60] mov [esp+0x8], eax mov eax, ebx add eax, [ebp-0x74] mov [esp+0x4], eax mov eax, ebx add eax, [ebp-0x78] mov [esp], eax call ExpandBounds add edi, 0x1 add ebx, 0xc cmp edi, esi jnz XModelReadSurface_BuildCollisionTree_120 XModelReadSurface_BuildCollisionTree_110: movss xmm0, dword [ebp-0x60] mov edx, [ebp-0xb0] addss xmm0, [edx] mulss xmm0, [edx+0xc] movss xmm6, dword [_float_0_50000000] subss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movss xmm4, dword [_data16_4f000000] movaps xmm3, xmm4 cmpss xmm3, xmm0, 0x2 movss xmm5, dword [_data16_4f800000] movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps xmm2, xmm3 andps xmm2, xmm4 pslld xmm3, 0x1f subps xmm0, xmm2 cvttps2dq xmm0, xmm0 paddd xmm0, xmm3 por xmm0, xmm1 movdqa [ebp-0xd8], xmm0 mov eax, [ebp-0xd8] test eax, eax js XModelReadSurface_BuildCollisionTree_130 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_270: mov eax, [ebp-0x94] mov [eax], dx movss xmm0, dword [ebp-0x5c] mov edx, [ebp-0xb0] addss xmm0, [edx+0x4] mulss xmm0, [edx+0x10] subss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movaps xmm2, xmm4 cmpss xmm2, xmm0, 0x2 movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps xmm3, xmm2 andps xmm3, xmm4 pslld xmm2, 0x1f subps xmm0, xmm3 cvttps2dq xmm0, xmm0 paddd xmm0, xmm2 por xmm0, xmm1 movdqa [ebp-0xf8], xmm0 mov eax, [ebp-0xf8] test eax, eax js XModelReadSurface_BuildCollisionTree_140 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_260: mov eax, [ebp-0x94] mov [eax+0x2], dx movss xmm0, dword [ebp-0x58] mov edx, [ebp-0xb0] addss xmm0, [edx+0x8] mulss xmm0, [edx+0x14] subss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movaps xmm2, xmm4 cmpss xmm2, xmm0, 0x2 movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps xmm3, xmm2 andps xmm3, xmm4 pslld xmm2, 0x1f subps xmm0, xmm3 cvttps2dq xmm0, xmm0 paddd xmm0, xmm2 por xmm0, xmm1 movdqa [ebp-0x118], xmm0 mov eax, [ebp-0x118] test eax, eax js XModelReadSurface_BuildCollisionTree_150 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_250: mov eax, [ebp-0x94] mov [eax+0x4], dx movss xmm0, dword [ebp-0x54] mov edx, [ebp-0xb0] addss xmm0, [edx] mulss xmm0, [edx+0xc] addss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movaps xmm2, xmm4 cmpss xmm2, xmm0, 0x2 movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps xmm3, xmm2 andps xmm3, xmm4 pslld xmm2, 0x1f subps xmm0, xmm3 cvttps2dq xmm0, xmm0 paddd xmm0, xmm2 por xmm0, xmm1 movdqa [ebp-0x138], xmm0 mov eax, [ebp-0x138] test eax, eax js XModelReadSurface_BuildCollisionTree_160 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_240: mov eax, [ebp-0x94] mov [eax+0x6], dx movss xmm0, dword [ebp-0x50] mov edx, [ebp-0xb0] addss xmm0, [edx+0x4] mulss xmm0, [edx+0x10] addss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movaps xmm2, xmm4 cmpss xmm2, xmm0, 0x2 movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps xmm3, xmm2 andps xmm3, xmm4 pslld xmm2, 0x1f subps xmm0, xmm3 cvttps2dq xmm0, xmm0 paddd xmm0, xmm2 por xmm0, xmm1 movdqa [ebp-0x158], xmm0 mov eax, [ebp-0x158] test eax, eax js XModelReadSurface_BuildCollisionTree_170 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_230: mov eax, [ebp-0x94] mov [eax+0x8], dx movss xmm0, dword [ebp-0x4c] mov edx, [ebp-0xb0] addss xmm0, [edx+0x8] mulss xmm0, [edx+0x14] addss xmm0, xmm6 xorps xmm1, xmm1 maxss xmm0, xmm1 movaps xmm2, xmm4 cmpss xmm2, xmm0, 0x2 movaps xmm1, xmm5 cmpss xmm1, xmm0, 0x2 movaps [ebp-0x168], xmm1 movaps xmm1, xmm4 andps xmm1, xmm2 pslld xmm2, 0x1f subps xmm0, xmm1 cvttps2dq xmm0, xmm0 paddd xmm0, xmm2 por xmm0, [ebp-0x168] movdqa [ebp-0x178], xmm0 mov eax, [ebp-0x178] test eax, eax js XModelReadSurface_BuildCollisionTree_180 mov edx, 0xffffffff cmp eax, 0x10000 cmovl edx, eax XModelReadSurface_BuildCollisionTree_220: mov eax, [ebp-0x94] mov [eax+0xa], dx mov edx, [ebp-0x90] mov eax, [edx+0xc] test eax, eax jz XModelReadSurface_BuildCollisionTree_190 mov eax, [edx+0x8] mov edx, [ebp-0x94] mov [edx+0xc], ax mov edx, [ebp-0x90] mov eax, [edx+0xc] mov edx, [ebp-0x94] mov [edx+0xe], ax XModelReadSurface_BuildCollisionTree_210: add dword [ebp-0x98], 0x1 add dword [ebp-0x8c], 0x10 mov eax, [ebp-0x98] cmp [ebp-0xac], eax jnz XModelReadSurface_BuildCollisionTree_200 XModelReadSurface_BuildCollisionTree_100: mov eax, [ebp-0x78] mov [esp], eax call free mov eax, [ebp-0x74] mov [esp], eax call free mov eax, [ebp-0x70] mov [esp], eax call free add esp, 0x1ac pop ebx pop esi pop edi pop ebp ret XModelReadSurface_BuildCollisionTree_190: mov eax, [edx] mov edx, [ebp-0x94] mov [edx+0xc], ax mov edx, [ebp-0x90] movzx eax, word [edx+0x4] sub ax, 0x8000 mov edx, [ebp-0x94] mov [edx+0xe], ax jmp XModelReadSurface_BuildCollisionTree_210 XModelReadSurface_BuildCollisionTree_180: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_220 XModelReadSurface_BuildCollisionTree_170: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_230 XModelReadSurface_BuildCollisionTree_160: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_240 XModelReadSurface_BuildCollisionTree_150: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_250 XModelReadSurface_BuildCollisionTree_140: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_260 XModelReadSurface_BuildCollisionTree_130: xor edx, edx jmp XModelReadSurface_BuildCollisionTree_270 ;Initialized global or static variables of r_xsurface_load_obj: SECTION .data ;Initialized constant data of r_xsurface_load_obj: SECTION .rdata ;Zero initialized global or static variables of r_xsurface_load_obj: SECTION .bss ;All cstrings: SECTION .rdata ;All constant floats and doubles: SECTION .rdata _float_65535_00000000: dd 0x477fff00 ; 65535 _float_0_50000000: dd 0x3f000000 ; 0.5 align 16,db 0 _data16_80000000: dd 0x80000000, 0x0, 0x0, 0x0 ; DQWORD _data16_4f000000: dd 0x4f000000, 0x0, 0x0, 0x0 ; DQWORD _data16_4f800000: dd 0x4f800000, 0x0, 0x0, 0x0 ; DQWORD"
"D4edalus/CoD4x1.8_Server_Pub"
"src/asmsource/_r_xsurface_load_obj.asm"
"Assembly"
"agpl-3.0"
30,063
"; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "vpx_ports/x86_abi_support.asm" %macro STACK_FRAME_CREATE 0 %if ABI_IS_32BIT %define input rsi %define output rdi %define pitch rax push rbp mov rbp, rsp GET_GOT rbx push rsi push rdi ; end prolog mov rsi, arg(0) mov rdi, arg(1) movsxd rax, dword ptr arg(2) lea rcx, [rsi + rax*2] %else %if LIBVPX_YASM_WIN64 %define input rcx %define output rdx %define pitch r8 SAVE_XMM 7, u %else %define input rdi %define output rsi %define pitch rdx %endif %endif %endmacro %macro STACK_FRAME_DESTROY 0 %define input %define output %define pitch %if ABI_IS_32BIT pop rdi pop rsi RESTORE_GOT pop rbp %else %if LIBVPX_YASM_WIN64 RESTORE_XMM %endif %endif ret %endmacro SECTION .text ;void vp8_short_fdct4x4_sse2(short *input, short *output, int pitch) global sym(vp8_short_fdct4x4_sse2) PRIVATE sym(vp8_short_fdct4x4_sse2): STACK_FRAME_CREATE movq xmm0, MMWORD PTR[input ] ;03 02 01 00 movq xmm2, MMWORD PTR[input+ pitch] ;13 12 11 10 lea input, [input+2*pitch] movq xmm1, MMWORD PTR[input ] ;23 22 21 20 movq xmm3, MMWORD PTR[input+ pitch] ;33 32 31 30 punpcklqdq xmm0, xmm2 ;13 12 11 10 03 02 01 00 punpcklqdq xmm1, xmm3 ;33 32 31 30 23 22 21 20 movdqa xmm2, xmm0 punpckldq xmm0, xmm1 ;23 22 03 02 21 20 01 00 punpckhdq xmm2, xmm1 ;33 32 13 12 31 30 11 10 movdqa xmm1, xmm0 punpckldq xmm0, xmm2 ;31 21 30 20 11 10 01 00 pshufhw xmm1, xmm1, 0b1h ;22 23 02 03 xx xx xx xx pshufhw xmm2, xmm2, 0b1h ;32 33 12 13 xx xx xx xx punpckhdq xmm1, xmm2 ;32 33 22 23 12 13 02 03 movdqa xmm3, xmm0 paddw xmm0, xmm1 ;b1 a1 b1 a1 b1 a1 b1 a1 psubw xmm3, xmm1 ;c1 d1 c1 d1 c1 d1 c1 d1 psllw xmm0, 3 ;b1 <<= 3 a1 <<= 3 psllw xmm3, 3 ;c1 <<= 3 d1 <<= 3 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)];d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_14500)] paddd xmm4, XMMWORD PTR[GLOBAL(_7500)] psrad xmm3, 12 ;(c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm4, 12 ;(d1 * 2217 - c1 * 5352 + 7500)>>12 packssdw xmm0, xmm1 ;op[2] op[0] packssdw xmm3, xmm4 ;op[3] op[1] ; 23 22 21 20 03 02 01 00 ; ; 33 32 31 30 13 12 11 10 ; movdqa xmm2, xmm0 punpcklqdq xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhqdq xmm2, xmm3 ;23 22 21 20 33 32 31 30 movdqa xmm3, xmm0 punpcklwd xmm0, xmm2 ;32 30 22 20 12 10 02 00 punpckhwd xmm3, xmm2 ;33 31 23 21 13 11 03 01 movdqa xmm2, xmm0 punpcklwd xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhwd xmm2, xmm3 ;33 32 31 30 23 22 21 20 movdqa xmm5, XMMWORD PTR[GLOBAL(_7)] pshufd xmm2, xmm2, 04eh movdqa xmm3, xmm0 paddw xmm0, xmm2 ;b1 b1 b1 b1 a1 a1 a1 a1 psubw xmm3, xmm2 ;c1 c1 c1 c1 d1 d1 d1 d1 pshufd xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 b1 a1 a1 movdqa xmm2, xmm3 ;save d1 for compare pshufd xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 c1 d1 d1 pshuflw xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 a1 b1 a1 pshuflw xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 d1 c1 d1 pshufhw xmm0, xmm0, 0d8h ;b1 a1 b1 a1 b1 a1 b1 a1 pshufhw xmm3, xmm3, 0d8h ;c1 d1 c1 d1 c1 d1 c1 d1 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 pxor xmm4, xmm4 ;zero out for compare paddd xmm0, xmm5 paddd xmm1, xmm5 pcmpeqw xmm2, xmm4 psrad xmm0, 4 ;(a1 + b1 + 7)>>4 psrad xmm1, 4 ;(a1 - b1 + 7)>>4 pandn xmm2, XMMWORD PTR[GLOBAL(_cmp_mask)] ;clear upper, ;and keep bit 0 of lower movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)] ;d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_12000)] paddd xmm4, XMMWORD PTR[GLOBAL(_51000)] packssdw xmm0, xmm1 ;op[8] op[0] psrad xmm3, 16 ;(c1 * 2217 + d1 * 5352 + 12000)>>16 psrad xmm4, 16 ;(d1 * 2217 - c1 * 5352 + 51000)>>16 packssdw xmm3, xmm4 ;op[12] op[4] movdqa xmm1, xmm0 paddw xmm3, xmm2 ;op[4] += (d1!=0) punpcklqdq xmm0, xmm3 ;op[4] op[0] punpckhqdq xmm1, xmm3 ;op[12] op[8] movdqa XMMWORD PTR[output + 0], xmm0 movdqa XMMWORD PTR[output + 16], xmm1 STACK_FRAME_DESTROY ;void vp8_short_fdct8x4_sse2(short *input, short *output, int pitch) global sym(vp8_short_fdct8x4_sse2) PRIVATE sym(vp8_short_fdct8x4_sse2): STACK_FRAME_CREATE ; read the input data movdqa xmm0, [input ] movdqa xmm2, [input+ pitch] lea input, [input+2*pitch] movdqa xmm4, [input ] movdqa xmm3, [input+ pitch] ; transpose for the first stage movdqa xmm1, xmm0 ; 00 01 02 03 04 05 06 07 movdqa xmm5, xmm4 ; 20 21 22 23 24 25 26 27 punpcklwd xmm0, xmm2 ; 00 10 01 11 02 12 03 13 punpckhwd xmm1, xmm2 ; 04 14 05 15 06 16 07 17 punpcklwd xmm4, xmm3 ; 20 30 21 31 22 32 23 33 punpckhwd xmm5, xmm3 ; 24 34 25 35 26 36 27 37 movdqa xmm2, xmm0 ; 00 10 01 11 02 12 03 13 punpckldq xmm0, xmm4 ; 00 10 20 30 01 11 21 31 punpckhdq xmm2, xmm4 ; 02 12 22 32 03 13 23 33 movdqa xmm4, xmm1 ; 04 14 05 15 06 16 07 17 punpckldq xmm4, xmm5 ; 04 14 24 34 05 15 25 35 punpckhdq xmm1, xmm5 ; 06 16 26 36 07 17 27 37 movdqa xmm3, xmm2 ; 02 12 22 32 03 13 23 33 punpckhqdq xmm3, xmm1 ; 03 13 23 33 07 17 27 37 punpcklqdq xmm2, xmm1 ; 02 12 22 32 06 16 26 36 movdqa xmm1, xmm0 ; 00 10 20 30 01 11 21 31 punpcklqdq xmm0, xmm4 ; 00 10 20 30 04 14 24 34 punpckhqdq xmm1, xmm4 ; 01 11 21 32 05 15 25 35 ; xmm0 0 ; xmm1 1 ; xmm2 2 ; xmm3 3 ; first stage movdqa xmm5, xmm0 movdqa xmm4, xmm1 paddw xmm0, xmm3 ; a1 = 0 + 3 paddw xmm1, xmm2 ; b1 = 1 + 2 psubw xmm4, xmm2 ; c1 = 1 - 2 psubw xmm5, xmm3 ; d1 = 0 - 3 psllw xmm5, 3 psllw xmm4, 3 psllw xmm0, 3 psllw xmm1, 3 ; output 0 and 2 movdqa xmm2, xmm0 ; a1 paddw xmm0, xmm1 ; op[0] = a1 + b1 psubw xmm2, xmm1 ; op[2] = a1 - b1 ; output 1 and 3 ; interleave c1, d1 movdqa xmm1, xmm5 ; d1 punpcklwd xmm1, xmm4 ; c1 d1 punpckhwd xmm5, xmm4 ; c1 d1 movdqa xmm3, xmm1 movdqa xmm4, xmm5 pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 paddd xmm1, XMMWORD PTR[GLOBAL(_14500)] paddd xmm4, XMMWORD PTR[GLOBAL(_14500)] paddd xmm3, XMMWORD PTR[GLOBAL(_7500)] paddd xmm5, XMMWORD PTR[GLOBAL(_7500)] psrad xmm1, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm4, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm3, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 psrad xmm5, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 packssdw xmm1, xmm4 ; op[1] packssdw xmm3, xmm5 ; op[3] ; done with vertical ; transpose for the second stage movdqa xmm4, xmm0 ; 00 10 20 30 04 14 24 34 movdqa xmm5, xmm2 ; 02 12 22 32 06 16 26 36 punpcklwd xmm0, xmm1 ; 00 01 10 11 20 21 30 31 punpckhwd xmm4, xmm1 ; 04 05 14 15 24 25 34 35 punpcklwd xmm2, xmm3 ; 02 03 12 13 22 23 32 33 punpckhwd xmm5, xmm3 ; 06 07 16 17 26 27 36 37 movdqa xmm1, xmm0 ; 00 01 10 11 20 21 30 31 punpckldq xmm0, xmm2 ; 00 01 02 03 10 11 12 13 punpckhdq xmm1, xmm2 ; 20 21 22 23 30 31 32 33 movdqa xmm2, xmm4 ; 04 05 14 15 24 25 34 35 punpckldq xmm2, xmm5 ; 04 05 06 07 14 15 16 17 punpckhdq xmm4, xmm5 ; 24 25 26 27 34 35 36 37 movdqa xmm3, xmm1 ; 20 21 22 23 30 31 32 33 punpckhqdq xmm3, xmm4 ; 30 31 32 33 34 35 36 37 punpcklqdq xmm1, xmm4 ; 20 21 22 23 24 25 26 27 movdqa xmm4, xmm0 ; 00 01 02 03 10 11 12 13 punpcklqdq xmm0, xmm2 ; 00 01 02 03 04 05 06 07 punpckhqdq xmm4, xmm2 ; 10 11 12 13 14 15 16 17 ; xmm0 0 ; xmm1 4 ; xmm2 1 ; xmm3 3 movdqa xmm5, xmm0 movdqa xmm2, xmm1 paddw xmm0, xmm3 ; a1 = 0 + 3 paddw xmm1, xmm4 ; b1 = 1 + 2 psubw xmm4, xmm2 ; c1 = 1 - 2 psubw xmm5, xmm3 ; d1 = 0 - 3 pxor xmm6, xmm6 ; zero out for compare pcmpeqw xmm6, xmm5 ; d1 != 0 pandn xmm6, XMMWORD PTR[GLOBAL(_cmp_mask8x4)] ; clear upper, ; and keep bit 0 of lower ; output 0 and 2 movdqa xmm2, xmm0 ; a1 paddw xmm0, xmm1 ; a1 + b1 psubw xmm2, xmm1 ; a1 - b1 paddw xmm0, XMMWORD PTR[GLOBAL(_7w)] paddw xmm2, XMMWORD PTR[GLOBAL(_7w)] psraw xmm0, 4 ; op[0] = (a1 + b1 + 7)>>4 psraw xmm2, 4 ; op[8] = (a1 - b1 + 7)>>4 ; output 1 and 3 ; interleave c1, d1 movdqa xmm1, xmm5 ; d1 punpcklwd xmm1, xmm4 ; c1 d1 punpckhwd xmm5, xmm4 ; c1 d1 movdqa xmm3, xmm1 movdqa xmm4, xmm5 pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 paddd xmm1, XMMWORD PTR[GLOBAL(_12000)] paddd xmm4, XMMWORD PTR[GLOBAL(_12000)] paddd xmm3, XMMWORD PTR[GLOBAL(_51000)] paddd xmm5, XMMWORD PTR[GLOBAL(_51000)] psrad xmm1, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 psrad xmm4, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 psrad xmm3, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 psrad xmm5, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 packssdw xmm1, xmm4 ; op[4] packssdw xmm3, xmm5 ; op[12] paddw xmm1, xmm6 ; op[4] += (d1!=0) movdqa xmm4, xmm0 movdqa xmm5, xmm2 punpcklqdq xmm0, xmm1 punpckhqdq xmm4, xmm1 punpcklqdq xmm2, xmm3 punpckhqdq xmm5, xmm3 movdqa XMMWORD PTR[output + 0 ], xmm0 movdqa XMMWORD PTR[output + 16], xmm2 movdqa XMMWORD PTR[output + 32], xmm4 movdqa XMMWORD PTR[output + 48], xmm5 STACK_FRAME_DESTROY SECTION_RODATA align 16 _5352_2217: dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 align 16 _2217_neg5352: dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 align 16 _mult_add: times 8 dw 1 align 16 _cmp_mask: times 4 dw 1 times 4 dw 0 align 16 _cmp_mask8x4: times 8 dw 1 align 16 _mult_sub: dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 align 16 _7: times 4 dd 7 align 16 _7w: times 8 dw 7 align 16 _14500: times 4 dd 14500 align 16 _7500: times 4 dd 7500 align 16 _12000: times 4 dd 12000 align 16 _51000: times 4 dd 51000 "
"artclarke/humble-video"
"humble-video-captive/src/main/gnu/libvpx/csrc/vp8/encoder/x86/dct_sse2.asm"
"Assembly"
"agpl-3.0"
15,141
";************************* memcmp64.asm ************************************* ; Author: Agner Fog ; Date created: 2013-10-03 ; Last modified: 2013-10-03 ; Description: ; Faster version of the standard memcmp function: ; ; int A_memcmp (const void * ptr1, const void * ptr2, size_t count); ; ; Compares two memory blocks of size num. ; The return value is zero if the two memory blocks ptr1 and ptr2 are equal ; The return value is positive if the first differing byte of ptr1 is bigger ; than ptr2 when compared as unsigned bytes. ; The return value is negative if the first differing byte of ptr1 is smaller ; than ptr2 when compared as unsigned bytes. ; ; Overriding standard function memcmp: ; The alias ?OVR_memcmp is changed to _memcmp in the object file if ; it is desired to override the standard library function memcmp. ; ; Optimization: ; Uses XMM registers if SSE2 is available, uses YMM registers if AVX2. ; ; The latest version of this file is available at: ; www.agner.org/optimize/asmexamples.zip ; Copyright (c) 2013 GNU General Public License www.gnu.org/licenses ;****************************************************************************** global A_memcmp: function ; Function memcmp global ?OVR_memcmp: function ; ?OVR_ removed if standard function memcmp overridden ; Direct entries to CPU-specific versions global memcmpSSE2: function ; SSE2 version global memcmpAVX2: function ; AVX2 version ; Imported from instrset64.asm extern InstructionSet ; Instruction set for CPU dispatcher default rel ; define registers used for parameters %IFDEF WINDOWS %define par1 rcx ; function parameter 1 %define par2 rdx ; function parameter 2 %define par3 r8 ; function parameter 3 %define par4 r9 ; scratch register %define par4d r9d ; scratch register %ENDIF %IFDEF UNIX %define par1 rdi ; function parameter 1 %define par2 rsi ; function parameter 2 %define par3 rdx ; function parameter 3 %define par4 rcx ; scratch register %define par4d ecx ; scratch register %ENDIF SECTION .text align=16 ; extern "C" int A_memcmp (const void * ptr1, const void * ptr2, size_t count); ; Function entry: A_memcmp: ?OVR_memcmp: jmp qword [memcmpDispatch] ; Go to appropriate version, depending on instruction set align 16 memcmpAVX2: ; AVX2 version. Use ymm register memcmpAVX2@: ; internal reference add par1, par3 ; use negative index from end of memory block add par2, par3 neg par3 jz A900 mov par4d, 0FFFFH cmp par3, -32 ja A100 A000: ; loop comparing 32 bytes vmovdqu ymm1, [par1+par3] vpcmpeqb ymm0, ymm1, [par2+par3] ; compare 32 bytes vpmovmskb eax, ymm0 ; get byte mask xor eax, -1 ; not eax would not set flags jnz A700 ; difference found add par3, 32 jz A900 ; finished, equal cmp par3, -32 jna A000 ; next 32 bytes vzeroupper ; end ymm state A100: ; less than 32 bytes left cmp par3, -16 ja A200 movdqu xmm1, [par1+par3] movdqu xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 16 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d ; invert lower 16 bits jnz A701 ; difference found add par3, 16 jz A901 ; finished, equal A200: ; less than 16 bytes left cmp par3, -8 ja A300 ; compare 8 bytes movq xmm1, [par1+par3] movq xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 8 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d jnz A701 ; difference found add par3, 8 jz A901 A300: ; less than 8 bytes left cmp par3, -4 ja A400 ; compare 4 bytes movd xmm1, [par1+par3] movd xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 4 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d ; not ax jnz A701 ; difference found add par3, 4 jz A901 A400: ; less than 4 bytes left cmp par3, -2 ja A500 movzx eax, word [par1+par3] movzx par4d, word [par2+par3] sub eax, par4d jnz A800 ; difference in byte 0 or 1 add par3, 2 jz A901 A500: ; less than 2 bytes left test par3, par3 jz A901 ; no bytes left A600: ; one byte left movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret A700: ; difference found. find position vzeroupper A701: bsf eax, eax add par3, rax movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret A800: ; difference in byte 0 or 1 neg al sbb par3, -1 ; add 1 to par3 if al == 0 movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret A900: ; equal vzeroupper A901: xor eax, eax ret memcmpSSE2: ; SSE2 version. Use xmm register memcmpSSE2@: ; internal reference add par1, par3 ; use negative index from end of memory block add par2, par3 neg par3 jz S900 mov par4d, 0FFFFH cmp par3, -16 ja S200 S100: ; loop comparing 16 bytes movdqu xmm1, [par1+par3] movdqu xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 16 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d ; not ax jnz S700 ; difference found add par3, 16 jz S900 ; finished, equal cmp par3, -16 jna S100 ; next 16 bytes S200: ; less than 16 bytes left cmp par3, -8 ja S300 ; compare 8 bytes movq xmm1, [par1+par3] movq xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 8 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d ; not ax jnz S700 ; difference found add par3, 8 jz S900 S300: ; less than 8 bytes left cmp par3, -4 ja S400 ; compare 4 bytes movd xmm1, [par1+par3] movd xmm2, [par2+par3] pcmpeqb xmm1, xmm2 ; compare 4 bytes pmovmskb eax, xmm1 ; get byte mask xor eax, par4d ; not ax jnz S700 ; difference found add par3, 4 jz S900 S400: ; less than 4 bytes left cmp par3, -2 ja S500 movzx eax, word [par1+par3] movzx par4d, word [par2+par3] sub eax, par4d jnz S800 ; difference in byte 0 or 1 add par3, 2 jz S900 S500: ; less than 2 bytes left test par3, par3 jz S900 ; no bytes left ; one byte left movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret S700: ; difference found. find position bsf eax, eax add par3, rax movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret S800: ; difference in byte 0 or 1 neg al sbb par3, -1 ; add 1 to par3 if al == 0 S820: movzx eax, byte [par1+par3] movzx par4d, byte [par2+par3] sub eax, par4d ; return result ret S900: ; equal xor eax, eax ret ; CPU dispatching for memcmp. This is executed only once memcmpCPUDispatch: push par1 push par2 push par3 call InstructionSet ; get supported instruction set ; SSE2 always supported lea par4, [memcmpSSE2@] cmp eax, 13 ; check AVX2 jb Q100 ; AVX2 supported lea par4, [memcmpAVX2@] Q100: ; save pointer mov qword [memcmpDispatch], par4 ; Continue in appropriate version of memcmp pop par3 pop par2 pop par1 jmp par4 SECTION .data align 16 ; Pointer to appropriate version. ; This initially points to memcmpCPUDispatch. memcmpCPUDispatch will ; change this to the appropriate version of memcmp, so that ; memcmpCPUDispatch is only executed once: memcmpDispatch DQ memcmpCPUDispatch "
"papyrussolution/OpenPapyrus"
"Src/OSF/ASMLIB/memcmp64.asm"
"Assembly"
"agpl-3.0"
10,258
";Imports of phys_ode: extern dBodyGetData extern ODE_BodyGetFirstGeom extern dGeomEnable extern dGeomGetBodyNext extern dBodyDisable extern dGeomDisable extern dBodyIsEnabled extern dBodyGetRotation extern dBodyGetPosition extern AxisTransformVec3 extern circleCoords.131667 extern dBodySetPosition extern dGeomGetClass extern ODE_GeomTransformGetOffset extern ODE_GeomTransformSetOffset extern dMassSetZero extern dBodyGetMass extern cgMedia extern SND_AddPhysicsSound extern dBodyGetPointVel extern ODE_WorldGetBodyCount extern colorGreen extern CG_DrawStringExt extern va extern CM_ModelBounds extern ODE_GeomGetAAContainedBox extern CM_BoxTrace extern dBodySetLinearVel extern dBodySetAngularVel extern dMassSetSphereTotal extern dCreateGeomTransform extern dGeomTransformSetGeom extern vec3_origin extern ODE_GeomTransformSetRotation extern dBodySetMass extern Com_PrintError extern dMassSetCylinderTotal extern Phys_CreateCylinderGeom extern Com_PrintWarning extern dMassSetParameters extern Phys_CreateBrushGeom extern dMassSetCappedCylinderTotal extern Phys_CreateCapsuleGeom extern Phys_CreateBrushmodelGeom extern dMassSetBoxTotal extern dCreateBox extern dWorldSetAutoDisableLinearThreshold extern dWorldSetAutoDisableAngularThreshold extern dWorldSetAutoDisableTime extern dBodyCreate extern Sys_EnterCriticalSection extern Pool_Alloc extern Sys_LeaveCriticalSection extern memset extern dBodySetData extern dBodySetRotation extern dBodySetFiniteRotationMode extern dGeomGetBody extern dAreConnectedExcluding extern dCollide extern Phys_CreateJointForEachContact extern Phys_ReduceContacts extern MemFile_ReadData extern dBodyGetLinearVel extern dBodyGetAngularVel extern MemFile_WriteData extern Cmd_RemoveCommand extern dJointGroupDestroy extern dSpaceDestroy extern dWorldDestroy extern dCloseODE extern QuatToAxis extern PIXBeginNamedEvent extern dWorldSetGravity extern ODE_CollideSimpleSpaceWithGeomNoAABBTest extern dWorldQuickStep extern dWorldSetCFM extern dWorldSetERP extern dWorldSetContactMaxCorrectingVel extern dWorldSetContactSurfaceLayer extern dWorldSetQuickStepNumIterations extern dSpaceCollide extern Cvar_SetBool extern dBodyDestroy extern Pool_Free extern dJointCreateHinge extern dJointAttach extern dJointSetHingeAnchor extern dJointSetHingeAxis extern dBodyAddForceAtPos extern dBodyEnable extern dJointDestroy extern AxisCopy extern dJointSetHingeParam extern dGeomMoved extern dJointGroupEmpty extern dJointCreateAMotor extern dJointSetAMotorMode extern dJointSetAMotorNumAxes extern dJointSetAMotorAxis extern dJointCreateBall extern dJointSetBallAnchor extern dJointSetAMotorParam extern AxisToQuat extern QuatLerp extern Vec4Normalize extern dGeomGetClassData extern ShrinkBoundsToHeight extern CM_ClipHandleToModel extern XModelGetBounds extern Pool_Init extern ODE_Init extern dWorldCreate extern dGetSimpleSpace extern dGetContactJointGroup extern dWorldSetAutoDisableFlag extern dWorldSetAutoDisableSteps extern Cvar_RegisterFloat extern Cvar_RegisterBool extern Cvar_RegisterInt extern Cmd_AddCommand extern Phys_InitBrushmodelGeomClass extern Phys_InitBrushGeomClass extern Phys_InitCylinderGeomClass extern Phys_InitCapsuleGeomClass extern Phys_InitWorldCollision ;Exports of phys_ode: global physInited global g_phys_maxMsecStep global g_phys_minMsecStep global Phys_EnableGeom global Phys_DisableBodyAndGeom global Phys_ObjCountIfActive global Phys_AdjustForNewCenterOfMass global Phys_PlayCollisionSound global Phys_Stop_f global Phys_Go_f global Phys_DrawDebugTextForWorld global _ZZ9Phys_InitvE13Phys_Go_f_VAR global _ZZ9Phys_InitvE15Phys_Stop_f_VAR global Phys_DoBodyOncePerRun global Phys_BodyGrabSnapshot global Phys_BodyAddGeomAndSetMass global Phys_CreateBodyFromState global Phys_NearCallback global Phys_ObjLoad global Phys_ObjSave global Phys_Shutdown global Phys_ObjCreate global Phys_RunToTime global Phys_InitJoints global Phys_ObjDestroy global Phys_CreateHinge global Phys_ObjAddForce global Phys_ObjIsAsleep global Phys_JointDestroy global Phys_DrawDebugText global Phys_ObjAddGeomBox global Phys_ObjCreateAxis global Phys_ObjGetPosition global Phys_ObjSetVelocity global Phys_SetHingeParams global Phys_AddJitterRegion global Phys_ObjAddGeomBrush global Phys_ObjBulletImpact global dxPostProcessIslands global Phys_ObjAddGeomCapsule global Phys_ObjSetOrientation global Phys_CreateAngularMotor global Phys_ObjAddGeomCylinder global Phys_ObjGetCenterOfMass global Phys_CreateBallAndSocket global Phys_ObjAddGeomBoxRotated global Phys_ObjAddGeomBrushModel global Phys_ObjSetInertialTensor global Phys_SetCollisionCallback global Phys_ObjSetAngularVelocity global Phys_ObjSetContactCentroid global Phys_SetAngularMotorParams global Phys_ObjGetInterpolatedState global Phys_ObjSetAngularVelocityRaw global Phys_GeomUserGetAAContainedBox global Phys_ObjAddGeomCylinderRotated global Phys_ObjSetCollisionFromXModel global Phys_ObjAddGeomCylinderDirection global Phys_Init global phys_drawDebugInfo global phys_gravityChangeWakeupRadius global phys_drawCollisionObj global phys_drawCollisionWorld global g_phys_msecStep global physGlob global phys_contact_cfm global phys_contact_erp global phys_drawcontacts global phys_jitterMaxMass global phys_noIslands global phys_autoDisableAngular global phys_autoDisableLinear global phys_autoDisableTime global phys_bulletSpinScale global phys_bulletUpBias global phys_cfm global phys_collUseEntities global phys_contact_cfm_ragdoll global phys_contact_erp_ragdoll global phys_csl global phys_dragAngular global phys_dragLinear global phys_drawAwake global phys_drawAwakeTooLong global phys_dumpcontacts global phys_erp global phys_frictionScale global phys_gravity global phys_interBodyCollision global phys_joint_cfm global phys_joint_stop_cfm global phys_joint_stop_erp global phys_mcv global phys_mcv_ragdoll global phys_minImpactMomentum global phys_narrowObjMaxLength global phys_qsi global phys_reorderConst global phys_visibleTris SECTION .text ;Phys_EnableGeom(dxBody*) Phys_EnableGeom: push ebp mov ebp, esp push ebx sub esp, 0x14 mov ebx, [ebp+0x8] mov [esp], ebx call dBodyGetData mov [esp], ebx call ODE_BodyGetFirstGeom mov ebx, eax test eax, eax jz Phys_EnableGeom_10 Phys_EnableGeom_20: mov [esp], ebx call dGeomEnable mov [esp], ebx call dGeomGetBodyNext mov ebx, eax test eax, eax jnz Phys_EnableGeom_20 Phys_EnableGeom_10: add esp, 0x14 pop ebx pop ebp ret ;Phys_DisableBodyAndGeom(dxBody*) Phys_DisableBodyAndGeom: push ebp mov ebp, esp push ebx sub esp, 0x14 mov ebx, [ebp+0x8] mov [esp], ebx call dBodyGetData mov eax, [eax+0xc] mov [esp], eax call dBodyDisable mov [esp], ebx call ODE_BodyGetFirstGeom mov ebx, eax test eax, eax jz Phys_DisableBodyAndGeom_10 Phys_DisableBodyAndGeom_20: mov [esp], ebx call dGeomDisable mov [esp], ebx call dGeomGetBodyNext mov ebx, eax test eax, eax jnz Phys_DisableBodyAndGeom_20 Phys_DisableBodyAndGeom_10: add esp, 0x14 pop ebx pop ebp ret nop ;Phys_ObjCountIfActive(dxBody*) Phys_ObjCountIfActive: push ebp mov ebp, esp sub esp, 0x18 mov eax, [ebp+0x8] mov [esp], eax call dBodyIsEnabled mov edx, [physGlob+0xbab4] cmp al, 0x1 sbb edx, 0xffffffff mov [physGlob+0xbab4], edx leave ret add [eax], al ;Phys_AdjustForNewCenterOfMass(dxBody*, float const*) Phys_AdjustForNewCenterOfMass: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x9c mov [ebp-0x8c], eax mov [ebp-0x90], edx mov [esp], eax call dBodyGetData mov [ebp-0x88], eax mov eax, [ebp-0x8c] mov [esp], eax call dBodyGetRotation mov esi, eax xor edi, edi Phys_AdjustForNewCenterOfMass_20: mov ecx, esi lea edx, [ebp+edi*4-0x60] xor ebx, ebx Phys_AdjustForNewCenterOfMass_10: mov eax, [ecx] mov [edx], eax add ebx, 0x1 add ecx, 0x4 add edx, 0xc cmp ebx, 0x3 jnz Phys_AdjustForNewCenterOfMass_10 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jnz Phys_AdjustForNewCenterOfMass_20 mov edx, [ebp-0x8c] mov [esp], edx call dBodyGetPosition movss xmm0, dword [eax] movss [ebp-0x6c], xmm0 movss xmm0, dword [eax+0x4] movss [ebp-0x70], xmm0 movss xmm0, dword [eax+0x8] movss [ebp-0x74], xmm0 mov eax, [ebp-0x8c] mov [esp], eax call dBodyGetData lea edx, [ebp-0x3c] mov [esp+0x8], edx mov [esp+0x4], eax lea edx, [ebp-0x60] mov [esp], edx call AxisTransformVec3 movss xmm0, dword [ebp-0x6c] addss xmm0, [ebp-0x3c] movss [ebp-0x6c], xmm0 movss xmm0, dword [ebp-0x70] addss xmm0, [ebp-0x38] movss [ebp-0x70], xmm0 movss xmm0, dword [ebp-0x74] addss xmm0, [ebp-0x34] movss [ebp-0x74], xmm0 movss xmm1, dword [circleCoords.131667+0xf0] mov eax, [ebp-0x88] movss xmm0, dword [eax] movss [ebp-0x78], xmm0 xor dword [ebp-0x78], 0x80000000 movss xmm0, dword [eax+0x4] movss [ebp-0x7c], xmm0 xor dword [ebp-0x7c], 0x80000000 movss xmm0, dword [eax+0x8] movss [ebp-0x80], xmm0 xor dword [ebp-0x80], 0x80000000 mov eax, [ebp-0x90] movss xmm0, dword [eax] xorps xmm0, xmm1 mov edx, [ebp-0x88] movss [edx], xmm0 add eax, 0x4 mov [ebp-0x84], eax mov eax, [ebp-0x90] movss xmm0, dword [eax+0x4] xorps xmm0, xmm1 movss [edx+0x4], xmm0 mov edi, eax add edi, 0x8 movss xmm0, dword [eax+0x8] xorps xmm0, xmm1 movss [edx+0x8], xmm0 lea eax, [ebp-0x24] mov [esp+0x8], eax mov edx, [ebp-0x90] mov [esp+0x4], edx lea eax, [ebp-0x60] mov [esp], eax call AxisTransformVec3 movss xmm0, dword [ebp-0x6c] addss xmm0, [ebp-0x24] movss [ebp-0x6c], xmm0 movss xmm0, dword [ebp-0x70] addss xmm0, [ebp-0x20] movss [ebp-0x70], xmm0 movss xmm0, dword [ebp-0x74] addss xmm0, [ebp-0x1c] movss [ebp-0x74], xmm0 movss [esp+0xc], xmm0 movss xmm0, dword [ebp-0x70] movss [esp+0x8], xmm0 movss xmm0, dword [ebp-0x6c] movss [esp+0x4], xmm0 mov eax, [ebp-0x8c] mov [esp], eax call dBodySetPosition mov edx, [ebp-0x8c] mov [esp], edx call ODE_BodyGetFirstGeom mov ebx, eax test eax, eax jz Phys_AdjustForNewCenterOfMass_30 lea esi, [ebp-0x30] jmp Phys_AdjustForNewCenterOfMass_40 Phys_AdjustForNewCenterOfMass_50: mov [esp], ebx call dGeomGetBodyNext mov ebx, eax test eax, eax jz Phys_AdjustForNewCenterOfMass_30 Phys_AdjustForNewCenterOfMass_40: mov [esp], ebx call dGeomGetClass cmp eax, 0x6 jnz Phys_AdjustForNewCenterOfMass_50 mov [esp+0x4], esi mov [esp], ebx call ODE_GeomTransformGetOffset movss xmm0, dword [ebp-0x78] addss xmm0, [ebp-0x30] movss xmm1, dword [ebp-0x7c] addss xmm1, [ebp-0x2c] movss xmm2, dword [ebp-0x80] addss xmm2, [ebp-0x28] mov eax, [ebp-0x90] subss xmm0, [eax] movss [ebp-0x30], xmm0 mov edx, [ebp-0x84] subss xmm1, [edx] movss [ebp-0x2c], xmm1 subss xmm2, [edi] movss [ebp-0x28], xmm2 mov [esp+0x4], esi mov [esp], ebx call ODE_GeomTransformSetOffset mov [esp], ebx call dGeomGetBodyNext mov ebx, eax test eax, eax jnz Phys_AdjustForNewCenterOfMass_40 Phys_AdjustForNewCenterOfMass_30: mov eax, [ebp-0x88] add eax, 0x10 movss xmm0, dword [ebp-0x6c] mov edx, [ebp-0x88] movss [edx+0x10], xmm0 movss xmm0, dword [ebp-0x70] movss [eax+0x4], xmm0 movss xmm0, dword [ebp-0x74] movss [eax+0x8], xmm0 add esp, 0x9c pop ebx pop esi pop edi pop ebp ret ;Phys_PlayCollisionSound(int, dxBody*, int, ContactList*) Phys_PlayCollisionSound: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xbc mov [ebp-0x7c], edx mov [ebp-0x80], ecx lea ebx, [ebp-0x78] mov [esp], ebx call dMassSetZero xor esi, esi mov [ebp-0x24], esi mov [ebp-0x20], esi mov [ebp-0x1c], esi mov [esp+0x4], ebx mov eax, [ebp-0x7c] mov [esp], eax call dBodyGetMass mov edx, [ebp+0x8] mov eax, [edx+0x1800] pxor xmm3, xmm3 test eax, eax jg Phys_PlayCollisionSound_10 Phys_PlayCollisionSound_40: cvtsi2ss xmm2, eax movss xmm0, dword [_float_1_00000000] divss xmm0, xmm2 movaps xmm1, xmm0 mulss xmm1, [ebp-0x24] movss [ebp-0x24], xmm1 movaps xmm1, xmm0 mulss xmm1, [ebp-0x20] movss [ebp-0x20], xmm1 mulss xmm0, [ebp-0x1c] movss [ebp-0x1c], xmm0 divss xmm3, xmm2 mulss xmm3, [ebp-0x78] mov eax, [phys_minImpactMomentum] movss xmm0, dword [eax+0xc] xorps xmm0, [circleCoords.131667+0x100] ucomiss xmm0, xmm3 jbe Phys_PlayCollisionSound_20 mov ecx, [ebp+0x8] mov eax, [ecx+0x2c] and eax, 0x1f00000 shr eax, 0x14 mov edx, [ebp-0x80] shl edx, 0x3 sub edx, [ebp-0x80] mov ecx, [ebp-0x80] lea edx, [ecx+edx*4] add edx, eax mov eax, cgMedia mov edx, [eax+edx*4+0x1068] test edx, edx jz Phys_PlayCollisionSound_20 lea eax, [ebp-0x24] mov [esp+0x4], eax mov [esp], edx call SND_AddPhysicsSound Phys_PlayCollisionSound_20: add esp, 0xbc pop ebx pop esi pop edi pop ebp ret Phys_PlayCollisionSound_10: xor edi, edi mov [ebp-0x9c], esi movss xmm3, dword [ebp-0x9c] lea esi, [ebp-0x34] mov ebx, edx Phys_PlayCollisionSound_30: mov [esp+0x10], esi mov eax, [ebx+0x8] mov [esp+0xc], eax mov eax, [ebx+0x4] mov [esp+0x8], eax mov eax, [ebx] mov [esp+0x4], eax mov ecx, [ebp-0x7c] mov [esp], ecx movss [ebp-0x98], xmm3 call dBodyGetPointVel movss xmm1, dword [ebp-0x34] mulss xmm1, [ebx+0x10] movss xmm0, dword [ebp-0x30] mulss xmm0, [ebx+0x14] addss xmm1, xmm0 movss xmm0, dword [ebp-0x2c] mulss xmm0, [ebx+0x18] addss xmm1, xmm0 movss xmm3, dword [ebp-0x98] addss xmm3, xmm1 movss xmm0, dword [ebp-0x24] addss xmm0, [ebx] movss [ebp-0x24], xmm0 movss xmm0, dword [ebp-0x20] addss xmm0, [ebx+0x4] movss [ebp-0x20], xmm0 movss xmm0, dword [ebp-0x1c] addss xmm0, [ebx+0x8] movss [ebp-0x1c], xmm0 add edi, 0x1 add ebx, 0x30 mov edx, [ebp+0x8] mov eax, [edx+0x1800] cmp edi, eax jl Phys_PlayCollisionSound_30 jmp Phys_PlayCollisionSound_40 ;Phys_Stop_f() Phys_Stop_f: push ebp mov ebp, esp push ebx sub esp, 0x14 mov eax, [physGlob] mov ebx, [eax] test ebx, ebx jz Phys_Stop_f_10 Phys_Stop_f_20: mov [esp], ebx call Phys_DisableBodyAndGeom mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_Stop_f_20 Phys_Stop_f_10: add esp, 0x14 pop ebx pop ebp ret nop ;Phys_Go_f() Phys_Go_f: push ebp mov ebp, esp push ebx sub esp, 0x14 mov eax, [physGlob] mov ebx, [eax] test ebx, ebx jz Phys_Go_f_10 Phys_Go_f_20: mov [esp], ebx call Phys_EnableGeom mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_Go_f_20 Phys_Go_f_10: add esp, 0x14 pop ebx pop ebp ret nop ;Phys_DrawDebugTextForWorld(unsigned int, char const*, float*, float*, float, ScreenPlacement const*) Phys_DrawDebugTextForWorld: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x4c mov ebx, eax mov [ebp-0x1c], edx mov [ebp-0x20], ecx mov esi, [ebp+0x8] movss [ebp-0x24], xmm0 mov dword [physGlob+0xbab4], 0x0 mov eax, [eax*4+physGlob] mov [esp], eax call ODE_WorldGetBodyCount mov edi, eax mov eax, [ebx*4+physGlob] mov ebx, [eax] test ebx, ebx jz Phys_DrawDebugTextForWorld_10 Phys_DrawDebugTextForWorld_20: mov [esp], ebx call Phys_ObjCountIfActive mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_DrawDebugTextForWorld_20 Phys_DrawDebugTextForWorld_10: mov dword [esp+0x20], 0x0 movss xmm0, dword [ebp-0x24] movss [esp+0x1c], xmm0 mov dword [esp+0x18], 0x1 mov dword [esp+0x14], 0x0 mov ebx, colorGreen mov [esp+0x10], ebx mov eax, [ebp-0x1c] mov [esp+0xc], eax mov eax, [esi] mov [esp+0x8], eax mov edx, [ebp-0x20] mov eax, [edx] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax call CG_DrawStringExt movss xmm0, dword [ebp-0x24] addss xmm0, [esi] movss [esi], xmm0 mov eax, [physGlob+0xbab4] mov [esp+0x4], eax mov dword [esp], _cstring____awake_i call va mov dword [esp+0x20], 0x0 movss xmm0, dword [ebp-0x24] movss [esp+0x1c], xmm0 mov dword [esp+0x18], 0x1 mov dword [esp+0x14], 0x0 mov [esp+0x10], ebx mov [esp+0xc], eax mov eax, [esi] mov [esp+0x8], eax mov edx, [ebp-0x20] mov eax, [edx] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax call CG_DrawStringExt movss xmm0, dword [ebp-0x24] addss xmm0, [esi] movss [esi], xmm0 sub edi, [physGlob+0xbab4] mov [esp+0x4], edi mov dword [esp], _cstring____asleep_i call va mov dword [esp+0x20], 0x0 movss xmm0, dword [ebp-0x24] movss [esp+0x1c], xmm0 mov dword [esp+0x18], 0x1 mov dword [esp+0x14], 0x0 mov [esp+0x10], ebx mov [esp+0xc], eax mov eax, [esi] mov [esp+0x8], eax mov edx, [ebp-0x20] mov eax, [edx] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax call CG_DrawStringExt movss xmm0, dword [ebp-0x24] addss xmm0, [esi] movss [esi], xmm0 mov eax, [physGlob+0xbab4] add esp, 0x4c pop ebx pop esi pop edi pop ebp ret nop ;Phys_DoBodyOncePerRun(dxBody*) Phys_DoBodyOncePerRun: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov edi, [ebp+0x8] mov [esp], edi call dBodyIsEnabled test al, al jnz Phys_DoBodyOncePerRun_10 Phys_DoBodyOncePerRun_90: add esp, 0xac pop ebx pop esi pop edi pop ebp ret Phys_DoBodyOncePerRun_10: mov [esp], edi call dBodyIsEnabled test al, al jnz Phys_DoBodyOncePerRun_20 Phys_DoBodyOncePerRun_50: mov ebx, edi mov esi, 0x1 Phys_DoBodyOncePerRun_40: lea eax, [ebp-0x50] mov [esp+0x8], eax lea eax, [ebp-0x5c] mov [esp+0x4], eax mov dword [esp], 0x0 call CM_ModelBounds movss xmm1, dword [ebx+0xe0] lea eax, [esi*4] ucomiss xmm1, [ebp+eax-0x54] ja Phys_DoBodyOncePerRun_30 movss xmm0, dword [ebp+eax-0x60] ucomiss xmm0, xmm1 ja Phys_DoBodyOncePerRun_30 add esi, 0x1 add ebx, 0x4 cmp esi, 0x4 jnz Phys_DoBodyOncePerRun_40 add esp, 0xac pop ebx pop esi pop edi pop ebp ret Phys_DoBodyOncePerRun_20: mov [esp], edi call dBodyGetData mov esi, eax mov [esp], edi call ODE_BodyGetFirstGeom mov edx, eax test eax, eax jz Phys_DoBodyOncePerRun_50 lea eax, [ebp-0x2c] mov [esp+0x8], eax lea eax, [ebp-0x50] mov [esp+0x4], eax mov [esp], edx call ODE_GeomGetAAContainedBox movss xmm3, dword [ebp-0x2c] mov eax, [phys_csl] movss xmm0, dword [eax+0xc] addss xmm0, xmm0 ucomiss xmm0, xmm3 jbe Phys_DoBodyOncePerRun_60 mov eax, 0xba83126f mov [ebp-0x38], eax mov [ebp-0x34], eax mov [ebp-0x30], eax mov eax, 0x3a83126f mov [ebp-0x44], eax mov [ebp-0x40], eax mov [ebp-0x3c], eax mov byte [ebp-0x89], 0x1 Phys_DoBodyOncePerRun_120: mov [esp], edi call dBodyGetPosition mov edx, [eax] mov [ebp-0x5c], edx mov edx, [eax+0x4] mov [ebp-0x58], edx movss xmm5, dword [eax+0x8] movss [ebp-0x54], xmm5 lea ebx, [esi+0x10] movss xmm0, dword [esi+0x10] ucomiss xmm0, [ebp-0x5c] jnz Phys_DoBodyOncePerRun_70 jp Phys_DoBodyOncePerRun_70 movss xmm0, dword [ebx+0x4] ucomiss xmm0, [ebp-0x58] jnz Phys_DoBodyOncePerRun_70 jp Phys_DoBodyOncePerRun_70 ucomiss xmm5, [ebx+0x8] jnz Phys_DoBodyOncePerRun_70 jp Phys_DoBodyOncePerRun_70 mov eax, [esi+0x4c] test eax, eax jz Phys_DoBodyOncePerRun_70 sub eax, 0x1 jnz Phys_DoBodyOncePerRun_50 Phys_DoBodyOncePerRun_70: mov dword [esp+0x18], 0x2806c91 mov dword [esp+0x14], 0x0 lea eax, [ebp-0x44] mov [esp+0x10], eax lea eax, [ebp-0x38] mov [esp+0xc], eax lea eax, [ebp-0x5c] mov [esp+0x8], eax mov [esp+0x4], ebx lea eax, [ebp-0x88] mov [esp], eax call CM_BoxTrace cmp byte [ebp-0x5f], 0x1 sbb eax, eax not eax add eax, 0x2 mov [esi+0x4c], eax movss xmm4, dword [ebp-0x88] ucomiss xmm4, [_float_1_00000000] jae Phys_DoBodyOncePerRun_50 jp Phys_DoBodyOncePerRun_50 cmp byte [ebp-0x5f], 0x0 jnz Phys_DoBodyOncePerRun_50 cmp byte [ebp-0x89], 0x0 jnz Phys_DoBodyOncePerRun_80 lea esi, [ebx+0x4] lea ecx, [ebx+0x8] movss xmm3, dword [ebp-0x5c] movss xmm6, dword [ebp-0x58] movss xmm5, dword [ebp-0x54] Phys_DoBodyOncePerRun_140: movss xmm0, dword [ebx] subss xmm3, xmm0 mulss xmm3, xmm4 addss xmm3, xmm0 movss [ebp-0x5c], xmm3 movss xmm0, dword [esi] movaps xmm1, xmm6 subss xmm1, xmm0 mulss xmm1, xmm4 addss xmm1, xmm0 movss [ebp-0x58], xmm1 movss xmm2, dword [ecx] movaps xmm0, xmm5 subss xmm0, xmm2 mulss xmm0, xmm4 addss xmm0, xmm2 movss [ebp-0x54], xmm0 movss [esp+0xc], xmm0 movss [esp+0x8], xmm1 movss [esp+0x4], xmm3 mov [esp], edi call dBodySetPosition movss xmm0, dword [_float_0_00100000] ucomiss xmm0, [ebp-0x88] jbe Phys_DoBodyOncePerRun_50 xor ebx, ebx mov [esp+0xc], ebx mov [esp+0x8], ebx mov [esp+0x4], ebx mov [esp], edi call dBodySetLinearVel mov [esp+0xc], ebx mov [esp+0x8], ebx mov [esp+0x4], ebx mov [esp], edi call dBodySetAngularVel jmp Phys_DoBodyOncePerRun_50 Phys_DoBodyOncePerRun_30: mov [esp], edi call dBodyDisable jmp Phys_DoBodyOncePerRun_90 Phys_DoBodyOncePerRun_60: movss xmm0, dword [_float_0_20000000] movss xmm1, dword [ebp-0x50] mulss xmm1, xmm0 movss [ebp-0x38], xmm1 movss xmm1, dword [ebp-0x4c] mulss xmm1, xmm0 movss [ebp-0x34], xmm1 movss xmm1, dword [ebp-0x48] mulss xmm1, xmm0 movss [ebp-0x30], xmm1 movaps xmm1, xmm3 mulss xmm1, xmm0 movss [ebp-0x44], xmm1 movss xmm1, dword [ebp-0x28] mulss xmm1, xmm0 movss [ebp-0x40], xmm1 mulss xmm0, [ebp-0x24] movss [ebp-0x3c], xmm0 movss xmm2, dword [eax+0xc] movaps xmm1, xmm3 subss xmm1, [ebp-0x44] movaps xmm0, xmm2 addss xmm0, xmm2 ucomiss xmm0, xmm1 jbe Phys_DoBodyOncePerRun_100 movaps xmm1, xmm2 mulss xmm1, [_float__2_00000000] addss xmm1, xmm3 movss xmm2, dword [_float_0_00100000] movaps xmm0, xmm1 subss xmm0, xmm2 ucomiss xmm0, [_float_0_00000000] jb Phys_DoBodyOncePerRun_110 movaps xmm0, xmm1 xorps xmm0, [circleCoords.131667+0x110] Phys_DoBodyOncePerRun_130: movss [ebp-0x44], xmm1 movss [ebp-0x40], xmm1 movss [ebp-0x3c], xmm1 movss [ebp-0x38], xmm0 movss [ebp-0x34], xmm0 movss [ebp-0x30], xmm0 Phys_DoBodyOncePerRun_100: mov byte [ebp-0x89], 0x0 jmp Phys_DoBodyOncePerRun_120 Phys_DoBodyOncePerRun_110: movaps xmm1, xmm2 movss xmm0, dword [_float__0_00100000] jmp Phys_DoBodyOncePerRun_130 Phys_DoBodyOncePerRun_80: movss xmm3, dword [ebp-0x5c] movaps xmm0, xmm3 subss xmm0, [ebx] lea esi, [ebx+0x4] movss xmm6, dword [ebp-0x58] movaps xmm2, xmm6 subss xmm2, [ebx+0x4] lea ecx, [ebx+0x8] movss xmm5, dword [ebp-0x54] movaps xmm1, xmm5 subss xmm1, [ebx+0x8] mulss xmm0, xmm0 mulss xmm2, xmm2 addss xmm0, xmm2 mulss xmm1, xmm1 addss xmm0, xmm1 movss [ebp-0x1c], xmm0 mov edx, [ebp-0x1c] sar edx, 1 mov eax, 0x5f3759df sub eax, edx mov [ebp-0x20], eax movss xmm2, dword [ebp-0x20] mulss xmm0, [_float_0_50000000] mulss xmm0, xmm2 mulss xmm0, xmm2 movss xmm1, dword [_float_1_50000000] subss xmm1, xmm0 mulss xmm1, xmm2 movss [ebp-0x1c], xmm1 movss xmm0, dword [_float__0_50000000] mulss xmm0, [ebp-0x2c] mulss xmm1, xmm0 addss xmm4, xmm1 pxor xmm0, xmm0 movaps xmm1, xmm0 subss xmm1, xmm4 movaps xmm2, xmm0 cmpss xmm2, xmm1, 0x6 andps xmm4, xmm2 orps xmm4, xmm0 movss [ebp-0x88], xmm4 jmp Phys_DoBodyOncePerRun_140 nop ;Phys_BodyGrabSnapshot(dxBody*) Phys_BodyGrabSnapshot: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c mov esi, [ebp+0x8] mov [esp], esi call dBodyGetData mov ebx, eax lea edi, [eax+0x10] mov [esp], esi call dBodyGetPosition mov edx, [eax] mov [ebx+0x10], edx mov edx, [eax+0x4] mov [edi+0x4], edx mov eax, [eax+0x8] mov [edi+0x8], eax add ebx, 0x1c mov [ebp-0x1c], ebx mov [esp], esi call dBodyGetRotation mov edi, eax xor ebx, ebx Phys_BodyGrabSnapshot_20: mov ecx, edi mov eax, [ebp-0x1c] lea edx, [eax+ebx*4] mov esi, 0x3 Phys_BodyGrabSnapshot_10: mov eax, [ecx] mov [edx], eax add ecx, 0x4 add edx, 0xc sub esi, 0x1 jnz Phys_BodyGrabSnapshot_10 add ebx, 0x1 add edi, 0x10 cmp ebx, 0x3 jnz Phys_BodyGrabSnapshot_20 add esp, 0x2c pop ebx pop esi pop edi pop ebp ret nop ;Phys_BodyAddGeomAndSetMass(PhysWorld, dxBody*, float, GeomState const*, float const*) Phys_BodyAddGeomAndSetMass: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov ebx, eax mov edi, edx mov esi, ecx lea eax, [ebp-0x5c] mov [esp], eax movss [ebp-0x88], xmm0 call dMassSetZero mov [esp], edi call dBodyGetData mov edx, [ebp+0x8] mov eax, edi call Phys_AdjustForNewCenterOfMass cmp dword [esi], 0x5 movss xmm7, dword [ebp-0x88] ja Phys_BodyAddGeomAndSetMass_10 mov eax, [esi] jmp dword [eax*4+Phys_BodyAddGeomAndSetMass_jumptab_0] Phys_BodyAddGeomAndSetMass_60: mov dword [esp+0x8], 0x3f800000 movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetSphereTotal Phys_BodyAddGeomAndSetMass_10: mov dword [ebp-0x6c], 0x0 Phys_BodyAddGeomAndSetMass_40: cmp byte [esi+0x4], 0x0 jz Phys_BodyAddGeomAndSetMass_20 mov ecx, [ebp-0x6c] test ecx, ecx jz Phys_BodyAddGeomAndSetMass_20 mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call dCreateGeomTransform mov ebx, eax test eax, eax jz Phys_BodyAddGeomAndSetMass_30 mov eax, [ebp-0x6c] mov [esp+0x4], eax mov [esp], ebx call dGeomTransformSetGeom lea eax, [esi+0x8] mov [esp+0x8], eax mov eax, vec3_origin mov [esp+0x4], eax mov [esp], ebx call ODE_GeomTransformSetRotation Phys_BodyAddGeomAndSetMass_20: lea eax, [ebp-0x5c] mov [esp+0x4], eax mov [esp], edi call dBodySetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret Phys_BodyAddGeomAndSetMass_30: mov dword [esp+0x4], _cstring_maximum_number_o mov dword [esp], 0x14 call Com_PrintError lea eax, [ebp-0x5c] mov [esp+0x4], eax mov [esp], edi call dBodySetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret Phys_BodyAddGeomAndSetMass_100: mov eax, [esi+0x34] mov [esp+0x10], eax mov eax, [esi+0x30] mov [esp+0xc], eax mov eax, [esi+0x2c] mov [esp+0x8], eax movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetCylinderTotal lea eax, [esi+0x2c] mov [esp+0x8], eax mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call Phys_CreateCylinderGeom mov [ebp-0x6c], eax test eax, eax jnz Phys_BodyAddGeomAndSetMass_40 Phys_BodyAddGeomAndSetMass_50: mov dword [esp+0x4], _cstring_maximum_number_o mov dword [esp], 0x14 call Com_PrintWarning jmp Phys_BodyAddGeomAndSetMass_40 Phys_BodyAddGeomAndSetMass_90: lea eax, [esi+0x3c] lea edx, [esi+0x30] movaps xmm6, xmm7 mulss xmm6, [eax+0x8] movaps xmm0, xmm7 mulss xmm0, [eax+0x4] movss [esp+0x24], xmm0 movaps xmm1, xmm7 mulss xmm1, [esi+0x3c] movss [esp+0x20], xmm1 movss xmm0, dword [edx+0x8] pxor xmm5, xmm5 movss xmm4, dword [_float_100_00000000] movaps xmm3, xmm5 cmpss xmm3, xmm0, 0x1 andps xmm0, xmm3 andnps xmm3, xmm4 orps xmm3, xmm0 mulss xmm3, xmm7 movss xmm0, dword [edx+0x4] movaps xmm2, xmm5 cmpss xmm2, xmm0, 0x1 andps xmm0, xmm2 andnps xmm2, xmm4 orps xmm2, xmm0 mulss xmm2, xmm7 movss xmm1, dword [esi+0x30] movaps xmm0, xmm5 cmpss xmm0, xmm1, 0x1 andps xmm1, xmm0 andnps xmm0, xmm4 orps xmm0, xmm1 movss [esp+0x28], xmm6 movss [esp+0x1c], xmm3 movss [esp+0x18], xmm2 mulss xmm0, xmm7 movss [esp+0x14], xmm0 movss [esp+0x10], xmm5 movss [esp+0xc], xmm5 movss [esp+0x8], xmm5 movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetParameters mov eax, [ebp+0x8] mov [esp+0xc], eax mov eax, [esi+0x2c] mov [esp+0x8], eax mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call Phys_CreateBrushGeom mov [ebp-0x6c], eax test eax, eax jnz Phys_BodyAddGeomAndSetMass_40 jmp Phys_BodyAddGeomAndSetMass_50 Phys_BodyAddGeomAndSetMass_110: mov eax, [esi+0x34] mov [esp+0x10], eax mov eax, [esi+0x30] mov [esp+0xc], eax mov eax, [esi+0x2c] mov [esp+0x8], eax movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetCappedCylinderTotal lea eax, [esi+0x2c] mov [esp+0x8], eax mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call Phys_CreateCapsuleGeom mov [ebp-0x6c], eax test eax, eax jnz Phys_BodyAddGeomAndSetMass_40 jmp Phys_BodyAddGeomAndSetMass_50 Phys_BodyAddGeomAndSetMass_80: lea eax, [esi+0x3c] lea edx, [esi+0x30] movaps xmm6, xmm7 mulss xmm6, [eax+0x8] movaps xmm0, xmm7 mulss xmm0, [eax+0x4] movss [esp+0x24], xmm0 movaps xmm1, xmm7 mulss xmm1, [esi+0x3c] movss [esp+0x20], xmm1 movss xmm0, dword [edx+0x8] pxor xmm5, xmm5 movss xmm4, dword [_float_100_00000000] movaps xmm3, xmm5 cmpss xmm3, xmm0, 0x1 andps xmm0, xmm3 andnps xmm3, xmm4 orps xmm3, xmm0 mulss xmm3, xmm7 movss xmm0, dword [edx+0x4] movaps xmm2, xmm5 cmpss xmm2, xmm0, 0x1 andps xmm0, xmm2 andnps xmm2, xmm4 orps xmm2, xmm0 mulss xmm2, xmm7 movss xmm1, dword [esi+0x30] movaps xmm0, xmm5 cmpss xmm0, xmm1, 0x1 andps xmm1, xmm0 andnps xmm0, xmm4 orps xmm0, xmm1 movss [esp+0x28], xmm6 movss [esp+0x1c], xmm3 movss [esp+0x18], xmm2 mulss xmm0, xmm7 movss [esp+0x14], xmm0 movss [esp+0x10], xmm5 movss [esp+0xc], xmm5 movss [esp+0x8], xmm5 movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetParameters mov eax, [ebp+0x8] mov [esp+0xc], eax movzx eax, word [esi+0x2c] mov [esp+0x8], eax mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call Phys_CreateBrushmodelGeom mov [ebp-0x6c], eax test eax, eax jnz Phys_BodyAddGeomAndSetMass_40 jmp Phys_BodyAddGeomAndSetMass_50 Phys_BodyAddGeomAndSetMass_70: mov eax, [esi+0x34] mov [esp+0x10], eax mov eax, [esi+0x30] mov [esp+0xc], eax mov eax, [esi+0x2c] mov [esp+0x8], eax movss [esp+0x4], xmm7 lea eax, [ebp-0x5c] mov [esp], eax call dMassSetBoxTotal mov eax, [esi+0x34] mov [esp+0x10], eax mov eax, [esi+0x30] mov [esp+0xc], eax mov eax, [esi+0x2c] mov [esp+0x8], eax mov [esp+0x4], edi mov eax, [ebx*4+physGlob+0x270] mov [esp], eax call dCreateBox mov [ebp-0x6c], eax test eax, eax jnz Phys_BodyAddGeomAndSetMass_40 jmp Phys_BodyAddGeomAndSetMass_50 nop Phys_BodyAddGeomAndSetMass_jumptab_0: dd Phys_BodyAddGeomAndSetMass_60 dd Phys_BodyAddGeomAndSetMass_70 dd Phys_BodyAddGeomAndSetMass_80 dd Phys_BodyAddGeomAndSetMass_90 dd Phys_BodyAddGeomAndSetMass_100 dd Phys_BodyAddGeomAndSetMass_110 ;Phys_CreateBodyFromState(PhysWorld, BodyState const*) Phys_CreateBodyFromState: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xcc mov [ebp-0xb8], eax mov [ebp-0xbc], edx mov eax, [phys_autoDisableLinear] mov eax, [eax+0xc] mov [esp+0x4], eax mov edx, [ebp-0xb8] mov eax, [edx*4+physGlob] mov [esp], eax call dWorldSetAutoDisableLinearThreshold mov eax, [phys_autoDisableAngular] mov eax, [eax+0xc] mov [esp+0x4], eax mov ecx, [ebp-0xb8] mov eax, [ecx*4+physGlob] mov [esp], eax call dWorldSetAutoDisableAngularThreshold mov eax, [phys_autoDisableTime] mov eax, [eax+0xc] mov [esp+0x4], eax mov edx, [ebp-0xb8] mov eax, [edx*4+physGlob] mov [esp], eax call dWorldSetAutoDisableTime mov ecx, [ebp-0xb8] mov eax, [ecx*4+physGlob] mov [esp], eax call dBodyCreate mov [ebp-0xb4], eax test eax, eax jz Phys_CreateBodyFromState_10 cmp dword [ebp-0xb8], 0x2 jz Phys_CreateBodyFromState_20 Phys_CreateBodyFromState_70: mov dword [esp], 0xb call Sys_EnterCriticalSection mov dword [esp], physGlob+0xba88 call Pool_Alloc mov [ebp-0xb0], eax mov dword [esp], 0xb call Sys_LeaveCriticalSection mov dword [esp+0x8], 0x5c mov dword [esp+0x4], 0x0 mov edx, [ebp-0xb0] mov [esp], edx call memset mov ecx, [ebp-0xb0] mov [esp+0x4], ecx mov eax, [ebp-0xb4] mov [esp], eax call dBodySetData mov edx, [ebp-0xbc] mov eax, [edx+0x8] mov [esp+0xc], eax mov eax, [edx+0x4] mov [esp+0x8], eax mov eax, [edx] mov [esp+0x4], eax mov ecx, [ebp-0xb4] mov [esp], ecx call dBodySetPosition mov edx, [ebp-0xbc] mov eax, [edx+0x38] mov [esp+0xc], eax mov eax, [edx+0x34] mov [esp+0x8], eax mov eax, [edx+0x30] mov [esp+0x4], eax mov ecx, [ebp-0xb4] mov [esp], ecx call dBodySetLinearVel mov edx, [ebp-0xbc] mov eax, [edx+0x44] mov [esp+0xc], eax mov eax, [edx+0x40] mov [esp+0x8], eax mov eax, [edx+0x3c] mov [esp+0x4], eax mov ecx, [ebp-0xb4] mov [esp], ecx call dBodySetAngularVel mov eax, [ebp-0xbc] add eax, 0xc mov [ebp-0xac], eax xor edi, edi xor esi, esi Phys_CreateBodyFromState_50: mov ecx, esi lea edx, [eax+edi*4] xor ebx, ebx Phys_CreateBodyFromState_30: mov eax, [edx] mov [ebp+ecx-0x54], eax add ebx, 0x1 add ecx, 0x4 add edx, 0xc cmp ebx, 0x3 jnz Phys_CreateBodyFromState_30 mov dword [esi+ebp-0x48], 0x0 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jz Phys_CreateBodyFromState_40 mov eax, [ebp-0xac] jmp Phys_CreateBodyFromState_50 Phys_CreateBodyFromState_40: lea edx, [ebp-0x54] mov [esp+0x4], edx mov ecx, [ebp-0xb4] mov [esp], ecx call dBodySetRotation movss xmm2, dword [circleCoords.131667+0x150] mov eax, [ebp-0xbc] movss xmm1, dword [eax+0x48] movaps xmm0, xmm1 xorps xmm0, xmm2 movss [ebp-0x24], xmm0 movss xmm0, dword [eax+0x4c] xorps xmm0, xmm2 movss [ebp-0x20], xmm0 movss xmm0, dword [eax+0x50] xorps xmm0, xmm2 movss [ebp-0x1c], xmm0 mov byte [ebp-0x98], 0x0 mov dword [ebp-0x9c], 0x0 mov edx, [ebp-0xb0] movss [edx], xmm1 mov ecx, [ebp-0xbc] mov eax, [ecx+0x4c] mov [edx+0x4], eax mov eax, [ecx+0x50] mov [edx+0x8], eax lea ecx, [ebp-0x9c] mov eax, [ebp-0xbc] movss xmm0, dword [eax+0x54] lea eax, [ebp-0x24] mov [esp], eax mov edx, [ebp-0xb4] mov eax, [ebp-0xb8] call Phys_BodyAddGeomAndSetMass mov ecx, [ebp-0xb4] mov edx, [ebp-0xb0] mov [edx+0xc], ecx mov edx, [ebp-0xb0] add edx, 0x10 mov ecx, [ebp-0xbc] mov eax, [ecx] mov ecx, [ebp-0xb0] mov [ecx+0x10], eax mov ecx, [ebp-0xbc] mov eax, [ecx+0x4] mov [edx+0x4], eax mov eax, [ecx+0x8] mov [edx+0x8], eax mov edx, [ebp-0xb0] add edx, 0x1c mov ecx, [ebp-0xac] mov eax, [ecx] mov ecx, [ebp-0xb0] mov [ecx+0x1c], eax mov ecx, [ebp-0xac] mov eax, [ecx+0x4] mov [edx+0x4], eax mov eax, [ecx+0x8] mov [edx+0x8], eax mov eax, [ecx+0xc] mov [edx+0xc], eax mov eax, [ecx+0x10] mov [edx+0x10], eax mov eax, [ecx+0x14] mov [edx+0x14], eax mov eax, [ecx+0x18] mov [edx+0x18], eax mov eax, [ecx+0x1c] mov [edx+0x1c], eax mov eax, [ecx+0x20] mov [edx+0x20], eax mov edx, [ebp-0xbc] mov eax, [edx+0x5c] mov ecx, [ebp-0xb0] mov [ecx+0x48], eax mov eax, [edx+0x58] mov [ecx+0x44], eax mov eax, [edx+0x60] mov [ecx+0x4c], eax mov eax, [edx+0x68] mov [ecx+0x40], eax cmp byte [edx+0x6c], 0x0 jnz Phys_CreateBodyFromState_60 mov eax, [ebp-0xb4] mov [esp], eax call dBodyDisable Phys_CreateBodyFromState_60: mov eax, [ebp-0xb4] add esp, 0xcc pop ebx pop esi pop edi pop ebp ret Phys_CreateBodyFromState_20: mov dword [esp+0x4], 0x1 mov eax, [ebp-0xb4] mov [esp], eax call dBodySetFiniteRotationMode jmp Phys_CreateBodyFromState_70 Phys_CreateBodyFromState_10: mov dword [esp+0x8], 0x200 mov dword [esp+0x4], _cstring_maximum_number_o1 mov dword [esp], 0x14 call Com_PrintWarning jmp Phys_CreateBodyFromState_60 nop ;Phys_NearCallback Phys_NearCallback: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x309c mov edi, [ebp+0x10] mov eax, [ebp+0x8] mov eax, [eax+0x4] mov [ebp-0x3060], eax mov ebx, [ebp+0xc] mov [esp], ebx call dGeomGetBody mov esi, eax mov [esp], edi call dGeomGetBody mov ebx, eax test esi, esi jz Phys_NearCallback_10 test eax, eax jz Phys_NearCallback_10 mov dword [esp+0x8], 0x4 mov [esp+0x4], eax mov [esp], esi call dAreConnectedExcluding test eax, eax jnz Phys_NearCallback_20 Phys_NearCallback_10: mov dword [esp+0x10], 0x30 lea eax, [ebp-0x1848] mov [esp+0xc], eax mov dword [esp+0x8], 0x80 mov [esp+0x4], edi mov eax, [ebp+0xc] mov [esp], eax call dCollide mov [ebp-0x48], eax test esi, esi jz Phys_NearCallback_30 xor edi, edi test ebx, ebx cmovz edi, esi Phys_NearCallback_150: test eax, eax jle Phys_NearCallback_40 test esi, esi jz Phys_NearCallback_50 mov [esp], esi call dBodyGetData mov [ebp-0x305c], eax movss xmm4, dword [eax+0x48] movss xmm2, dword [_float_1_00000000] movaps xmm0, xmm2 subss xmm0, xmm4 pxor xmm3, xmm3 movaps xmm1, xmm3 cmpss xmm1, xmm0, 0x2 movaps xmm0, xmm1 movaps xmm1, xmm4 andps xmm1, xmm0 movaps xmm4, xmm0 andnps xmm4, xmm2 orps xmm4, xmm1 addss xmm3, [eax+0x44] test ebx, ebx jz Phys_NearCallback_60 Phys_NearCallback_100: mov [esp], ebx movss [ebp-0x3078], xmm3 movss [ebp-0x3088], xmm4 call dBodyGetData mov [ebp-0x305c], eax movss xmm2, dword [eax+0x48] movss xmm4, dword [ebp-0x3088] movaps xmm0, xmm4 subss xmm0, xmm2 pxor xmm1, xmm1 cmpss xmm1, xmm0, 0x2 movaps xmm0, xmm2 andps xmm0, xmm1 movaps xmm2, xmm1 andnps xmm2, xmm4 orps xmm2, xmm0 movss xmm3, dword [ebp-0x3078] addss xmm3, [eax+0x44] mov dword [ebp-0x44], 0x301c cmp dword [ebp-0x3060], 0x2 jz Phys_NearCallback_70 Phys_NearCallback_110: mov eax, [phys_contact_cfm] mov eax, [eax+0xc] mov [ebp-0x2c], eax cmp dword [ebp-0x3060], 0x2 jz Phys_NearCallback_80 Phys_NearCallback_120: mov eax, [phys_contact_erp] mov eax, [eax+0xc] Phys_NearCallback_130: mov [ebp-0x30], eax mov eax, [phys_frictionScale] mulss xmm3, [eax+0xc] movss [ebp-0x40], xmm3 mov dword [ebp-0x3c], 0x0 movss [ebp-0x38], xmm2 mov dword [ebp-0x34], 0x3dcccccd cmp dword [ebp-0x48], 0x4 jg Phys_NearCallback_90 mov eax, [ebp-0x3060] mov [esp+0x10], eax lea eax, [ebp-0x44] mov [esp+0xc], eax mov [esp+0x8], ebx mov [esp+0x4], esi lea ebx, [ebp-0x1848] Phys_NearCallback_140: mov [esp], ebx call Phys_CreateJointForEachContact mov eax, [ebp-0x305c] mov ecx, [eax+0x40] test edi, edi cmovz edi, esi mov [esp], ebx mov edx, edi mov ebx, [ebp+0x8] mov eax, [ebx] call Phys_PlayCollisionSound Phys_NearCallback_20: add esp, 0x309c pop ebx pop esi pop edi pop ebp ret Phys_NearCallback_50: mov dword [ebp-0x305c], 0x0 pxor xmm3, xmm3 movss xmm4, dword [_float_1_00000000] test ebx, ebx jnz Phys_NearCallback_100 Phys_NearCallback_60: movaps xmm2, xmm4 mov dword [ebp-0x44], 0x301c cmp dword [ebp-0x3060], 0x2 jnz Phys_NearCallback_110 Phys_NearCallback_70: mov eax, [phys_contact_cfm_ragdoll] mov eax, [eax+0xc] mov [ebp-0x2c], eax cmp dword [ebp-0x3060], 0x2 jnz Phys_NearCallback_120 Phys_NearCallback_80: mov eax, [phys_contact_erp_ragdoll] mov eax, [eax+0xc] jmp Phys_NearCallback_130 Phys_NearCallback_90: lea eax, [ebp-0x304c] mov [esp+0x8], eax lea eax, [ebp-0x1848] mov [esp+0x4], eax mov [esp], edi call Phys_ReduceContacts mov eax, [ebp-0x3060] mov [esp+0x10], eax lea eax, [ebp-0x44] mov [esp+0xc], eax mov [esp+0x8], ebx mov [esp+0x4], esi lea ebx, [ebp-0x304c] jmp Phys_NearCallback_140 Phys_NearCallback_40: test edi, edi jz Phys_NearCallback_20 mov [esp], edi call dBodyGetData mov dword [eax+0x4c], 0x2 add esp, 0x309c pop ebx pop esi pop edi pop ebp ret Phys_NearCallback_30: mov edi, ebx jmp Phys_NearCallback_150 ;Phys_ObjLoad(PhysWorld, MemoryFile*) Phys_ObjLoad: push ebp mov ebp, esp push ebx sub esp, 0x84 lea ebx, [ebp-0x78] mov [esp+0x8], ebx mov dword [esp+0x4], 0x70 mov eax, [ebp+0xc] mov [esp], eax call MemFile_ReadData mov edx, ebx mov eax, [ebp+0x8] call Phys_CreateBodyFromState add esp, 0x84 pop ebx pop ebp ret nop ;Phys_ObjSave(int, MemoryFile*) Phys_ObjSave: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xec lea eax, [ebp-0x5c] mov [esp], eax call dMassSetZero mov edx, [ebp+0x8] mov [esp], edx call dBodyGetData mov [ebp-0xe0], eax mov eax, [ebp+0x8] mov [esp], eax call dBodyGetPosition mov edx, [eax] mov [ebp-0xcc], edx mov edx, [eax+0x4] mov [ebp-0xc8], edx mov eax, [eax+0x8] mov [ebp-0xc4], eax mov edx, [ebp+0x8] mov [esp], edx call dBodyGetRotation mov esi, eax mov dword [ebp-0xdc], 0x0 lea edi, [ebp-0xcc] Phys_ObjSave_20: mov ecx, esi lea edx, [edi+0xc] mov ebx, 0x3 Phys_ObjSave_10: mov eax, [ecx] mov [edx], eax add ecx, 0x4 add edx, 0xc sub ebx, 0x1 jnz Phys_ObjSave_10 add dword [ebp-0xdc], 0x1 add edi, 0x4 add esi, 0x10 cmp dword [ebp-0xdc], 0x3 jnz Phys_ObjSave_20 mov eax, [ebp+0x8] mov [esp], eax call dBodyGetLinearVel mov edx, [eax] mov [ebp-0x9c], edx mov edx, [eax+0x4] mov [ebp-0x98], edx mov eax, [eax+0x8] mov [ebp-0x94], eax mov edx, [ebp+0x8] mov [esp], edx call dBodyGetAngularVel mov edx, [eax] mov [ebp-0x90], edx mov edx, [eax+0x4] mov [ebp-0x8c], edx mov eax, [eax+0x8] mov [ebp-0x88], eax mov edx, [ebp-0xe0] mov eax, [edx] mov [ebp-0x84], eax mov eax, [edx+0x4] mov [ebp-0x80], eax mov eax, [edx+0x8] mov [ebp-0x7c], eax lea eax, [ebp-0x5c] mov [esp+0x4], eax mov edx, [ebp+0x8] mov [esp], edx call dBodyGetMass mov eax, [ebp-0x5c] mov [ebp-0x78], eax mov edx, [ebp-0xe0] mov eax, [edx+0x48] mov [ebp-0x70], eax mov eax, [edx+0x44] mov [ebp-0x74], eax mov eax, [edx+0x4c] mov [ebp-0x6c], eax mov eax, [edx+0x40] mov [ebp-0x64], eax mov eax, [ebp+0x8] mov [esp], eax call dBodyIsEnabled mov [ebp-0x60], al lea edx, [ebp-0xcc] mov [esp+0x8], edx mov dword [esp+0x4], 0x70 mov eax, [ebp+0xc] mov [esp], eax call MemFile_WriteData add esp, 0xec pop ebx pop esi pop edi pop ebp ret nop ;Phys_Shutdown() Phys_Shutdown: push ebp mov ebp, esp push ebx sub esp, 0x14 cmp byte [physInited], 0x0 jnz Phys_Shutdown_10 add esp, 0x14 pop ebx pop ebp ret Phys_Shutdown_10: mov dword [esp], _cstring_phys_stop call Cmd_RemoveCommand mov dword [esp], _cstring_phys_go call Cmd_RemoveCommand mov ebx, physGlob+0x27c Phys_Shutdown_50: mov eax, [ebx] test eax, eax jz Phys_Shutdown_20 mov [esp], eax call dJointGroupDestroy mov dword [ebx], 0x0 Phys_Shutdown_20: mov eax, [ebx-0xc] test eax, eax jz Phys_Shutdown_30 mov [esp], eax call dSpaceDestroy mov dword [ebx-0xc], 0x0 Phys_Shutdown_30: mov eax, [ebx-0x27c] test eax, eax jz Phys_Shutdown_40 mov [esp], eax call dWorldDestroy mov dword [ebx-0x27c], 0x0 Phys_Shutdown_40: add ebx, 0x4 cmp ebx, physGlob+0x288 jnz Phys_Shutdown_50 call dCloseODE mov dword [physGlob+0xba90], 0x0 mov byte [physInited], 0x0 add esp, 0x14 pop ebx pop ebp ret add [eax], al ;Phys_ObjCreate(PhysWorld, float const*, float const*, float const*, PhysPreset const*) Phys_ObjCreate: push ebp mov ebp, esp push ebx sub esp, 0x54 lea ebx, [ebp-0x2c] mov [esp+0x4], ebx mov eax, [ebp+0x10] mov [esp], eax call QuatToAxis mov eax, [ebp+0x18] mov [esp+0x10], eax mov eax, [ebp+0x14] mov [esp+0xc], eax mov [esp+0x8], ebx mov eax, [ebp+0xc] mov [esp+0x4], eax mov eax, [ebp+0x8] mov [esp], eax call Phys_ObjCreateAxis add esp, 0x54 pop ebx pop ebp ret nop ;Phys_RunToTime(int, PhysWorld, int) Phys_RunToTime: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x3c mov edx, [ebp+0xc] lea eax, [edx+edx*2] mov edx, eax shl edx, 0x4 add eax, edx lea esi, [eax*4] lea ebx, [esi+physGlob] lea edi, [ebx+0xc] mov dword [esp+0x4], _cstring_phys_runtotime mov dword [esp], 0xffffffff call PIXBeginNamedEvent mov ecx, [ebx+0xc] cmp ecx, [ebp+0x10] jle Phys_RunToTime_10 mov edx, [edi+0x4] cmp ecx, edx jl Phys_RunToTime_20 Phys_RunToTime_270: mov edx, [ebp+0xc] lea eax, [edx+edx*2] mov edx, eax shl edx, 0x4 add eax, edx shl eax, 0x2 mov edx, [ebp+0x10] mov [eax+physGlob+0xc], edx mov [eax+physGlob+0x10], edx mov dword [eax+physGlob+0x14], 0x3f800000 mov edx, [edi+0x4] mov eax, [ebp+0xc] mov eax, [eax*4+physGlob] mov [ebp-0x34], eax cmp [ebp+0x10], edx jg Phys_RunToTime_30 Phys_RunToTime_50: mov eax, [edi] cmp edx, eax jle Phys_RunToTime_40 Phys_RunToTime_250: sub [ebp+0x10], eax cvtsi2ss xmm0, dword [ebp+0x10] sub edx, eax cvtsi2ss xmm1, edx divss xmm0, xmm1 movss [edi+0x8], xmm0 add esp, 0x3c pop ebx pop esi pop edi pop ebp ret Phys_RunToTime_10: mov edx, [edi+0x4] Phys_RunToTime_260: mov eax, [ebp+0xc] mov eax, [eax*4+physGlob] mov [ebp-0x34], eax cmp [ebp+0x10], edx jle Phys_RunToTime_50 Phys_RunToTime_30: mov [edi], edx mov ebx, [eax] test ebx, ebx jz Phys_RunToTime_60 Phys_RunToTime_70: mov [esp], ebx call Phys_BodyGrabSnapshot mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_RunToTime_70 mov edx, [edi+0x4] Phys_RunToTime_60: mov dword [ebp-0x30], 0x2 jmp Phys_RunToTime_80 Phys_RunToTime_160: mov eax, [physGlob+0xbaac] test eax, eax jz Phys_RunToTime_90 mov [esp], eax call dGeomEnable Phys_RunToTime_90: mov eax, [physGlob+0xbab0] mov [esp], eax call dGeomDisable Phys_RunToTime_180: mov eax, [phys_gravity] movss xmm0, dword [eax+0xc] xorps xmm0, [circleCoords.131667+0x120] movaps xmm1, xmm0 mulss xmm1, [physGlob+0x23ccc] movss [esp+0xc], xmm1 movaps xmm1, xmm0 mulss xmm1, [physGlob+0x23cc8] movss [esp+0x8], xmm1 mulss xmm0, [physGlob+0x23cc4] movss [esp+0x4], xmm0 mov [esp], ebx call dWorldSetGravity mov eax, [phys_interBodyCollision] cmp byte [eax+0xc], 0x0 jnz Phys_RunToTime_100 Phys_RunToTime_190: mov ecx, [ebp-0x1c] lea eax, [ecx+ecx*2] mov edx, eax shl edx, 0x4 add eax, edx mov eax, [eax*4+physGlob+0x18] test eax, eax jz Phys_RunToTime_110 call eax mov ecx, [ebp-0x1c] Phys_RunToTime_110: mov edx, [ebp+0x8] mov [ebp-0x24], edx mov [ebp-0x20], ecx lea eax, [ebp-0x24] mov [esp+0x8], eax mov eax, [physGlob+0xbab0] mov [esp+0x4], eax mov eax, [ecx*4+physGlob+0x270] mov [esp], eax call ODE_CollideSimpleSpaceWithGeomNoAABBTest movss xmm0, dword [ebp-0x2c] movss [esp+0x4], xmm0 mov [esp], ebx call dWorldQuickStep mov byte [physGlob+0xbaa8], 0x0 add [edi+0x4], esi mov eax, [ebp+0xc] mov [esp], eax call dxPostProcessIslands mov edx, [ebp+0x10] cmp edx, [edi+0x4] jle Phys_RunToTime_120 mov edx, [edi+0x4] Phys_RunToTime_80: mov eax, [ebp+0x10] sub eax, edx xor edx, edx div dword [ebp-0x30] mov esi, eax mov edx, [ebp+0xc] mov eax, [edx*4+g_phys_msecStep] cmp esi, eax cmovle esi, eax sub dword [ebp-0x30], 0x1 test esi, esi js Phys_RunToTime_130 cvtsi2ss xmm0, esi Phys_RunToTime_220: mulss xmm0, [_float_0_00100000] movss [ebp-0x2c], xmm0 mov eax, [ebp+0xc] mov [ebp-0x1c], eax mov ebx, [eax*4+physGlob] movss [ebx+0x50], xmm0 mov eax, [phys_dumpcontacts] cmp byte [eax+0xc], 0x0 jnz Phys_RunToTime_140 Phys_RunToTime_200: mov eax, [phys_cfm] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetCFM mov eax, [phys_erp] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetERP cmp dword [ebp-0x1c], 0x2 jz Phys_RunToTime_150 mov eax, [phys_mcv] mov eax, [eax+0xc] Phys_RunToTime_210: mov [esp+0x4], eax mov [esp], ebx call dWorldSetContactMaxCorrectingVel mov eax, [phys_csl] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetContactSurfaceLayer mov eax, [phys_qsi] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetQuickStepNumIterations mov eax, [phys_autoDisableLinear] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetAutoDisableLinearThreshold mov eax, [phys_autoDisableAngular] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetAutoDisableAngularThreshold mov eax, [phys_autoDisableTime] mov eax, [eax+0xc] mov [esp+0x4], eax mov [esp], ebx call dWorldSetAutoDisableTime mov eax, [phys_visibleTris] cmp byte [eax+0xc], 0x0 jnz Phys_RunToTime_160 mov eax, [physGlob+0xbaac] test eax, eax jz Phys_RunToTime_170 mov [esp], eax call dGeomDisable Phys_RunToTime_170: mov eax, [physGlob+0xbab0] mov [esp], eax call dGeomEnable jmp Phys_RunToTime_180 Phys_RunToTime_100: mov dword [esp+0x8], Phys_NearCallback lea eax, [ebp-0x1c] mov [esp+0x4], eax mov eax, [ebp-0x1c] mov eax, [eax*4+physGlob+0x270] mov [esp], eax call dSpaceCollide jmp Phys_RunToTime_190 Phys_RunToTime_140: mov byte [physGlob+0xbaa8], 0x1 mov dword [esp+0x4], 0x0 mov [esp], eax call Cvar_SetBool jmp Phys_RunToTime_200 Phys_RunToTime_150: mov eax, [phys_mcv_ragdoll] mov eax, [eax+0xc] jmp Phys_RunToTime_210 Phys_RunToTime_130: mov eax, esi shr eax, 1 mov edx, esi and edx, 0x1 or eax, edx cvtsi2ss xmm0, eax addss xmm0, xmm0 jmp Phys_RunToTime_220 Phys_RunToTime_120: mov eax, [ebp-0x34] mov ebx, [eax] test ebx, ebx jz Phys_RunToTime_230 Phys_RunToTime_240: mov [esp], ebx call Phys_DoBodyOncePerRun mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_RunToTime_240 Phys_RunToTime_230: mov edx, [edi+0x4] mov eax, [edi] cmp edx, eax jg Phys_RunToTime_250 Phys_RunToTime_40: mov dword [edi+0x8], 0x3f800000 add esp, 0x3c pop ebx pop esi pop edi pop ebp ret Phys_RunToTime_20: mov eax, [ebp+0x10] sub eax, ecx cvtsi2ss xmm1, eax mov eax, edx sub eax, ecx cvtsi2ss xmm0, eax divss xmm1, xmm0 ucomiss xmm1, [esi+physGlob+0x14] jae Phys_RunToTime_260 ucomiss xmm1, [_float_0_00000000] jb Phys_RunToTime_270 ucomiss xmm1, [_float_1_00000000] ja Phys_RunToTime_270 jp Phys_RunToTime_270 movss [esi+physGlob+0x14], xmm1 jmp Phys_RunToTime_260 ;Phys_InitJoints() Phys_InitJoints: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x1c mov dword [esp+0x8], 0x8d00 mov dword [esp+0x4], 0x0 mov dword [esp], physGlob+0xbabc call memset mov dword [physGlob+0xbab8], 0xffffffff mov edi, 0xbf mov ebx, 0x8c44 mov esi, physGlob+0x146f4 Phys_InitJoints_10: lea eax, [esi+0xc] mov dword [esp+0x8], 0xbc mov dword [esp+0x4], 0x0 mov [esp], eax call memset mov eax, [physGlob+0xbab8] mov [ebx+physGlob+0xbabc], eax mov eax, ebx sar eax, 0x2 imul eax, eax, 0x677d46cf mov [physGlob+0xbab8], eax sub edi, 0x1 sub esi, 0xbc sub ebx, 0xbc cmp edi, 0xffffffff jnz Phys_InitJoints_10 mov dword [esp+0x8], 0x3c00 mov dword [esp+0x4], 0x0 mov dword [esp], physGlob+0x147c0 call memset mov dword [physGlob+0x147bc], 0xffffffff mov edi, 0x9f mov ebx, 0x3ba0 mov esi, physGlob+0x18350 Phys_InitJoints_20: lea eax, [esi+0x10] mov dword [esp+0x8], 0x60 mov dword [esp+0x4], 0x0 mov [esp], eax call memset mov eax, [physGlob+0x147bc] mov [ebx+physGlob+0x147c0], eax mov ecx, ebx sar ecx, 0x5 lea eax, [ecx+ecx*4] mov edx, eax shl edx, 0x4 add eax, edx mov edx, eax shl edx, 0x8 add eax, edx mov edx, eax shl edx, 0x10 add eax, edx lea eax, [ecx+eax*2] mov [physGlob+0x147bc], eax sub edi, 0x1 sub esi, 0x60 sub ebx, 0x60 cmp edi, 0xffffffff jnz Phys_InitJoints_20 mov dword [esp+0x8], 0xb900 mov dword [esp+0x4], 0x0 mov dword [esp], physGlob+0x183c4 call memset mov dword [physGlob+0x183c0], 0xffffffff mov edi, 0x9f mov ebx, 0xb7d8 mov esi, physGlob+0x23b98 Phys_InitJoints_30: lea eax, [esi+0x4] mov dword [esp+0x8], 0x128 mov dword [esp+0x4], 0x0 mov [esp], eax call memset mov eax, [physGlob+0x183c0] mov [ebx+physGlob+0x183c4], eax mov edx, ebx sar edx, 0x3 lea eax, [edx+edx*2] lea eax, [eax+eax*8] lea eax, [edx+eax*4] mov edx, eax shl edx, 0x6 add eax, edx mov edx, eax shl edx, 0x12 sub eax, edx mov [physGlob+0x183c0], eax sub edi, 0x1 sub esi, 0x128 sub ebx, 0x128 cmp edi, 0xffffffff jnz Phys_InitJoints_30 add esp, 0x1c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjDestroy(PhysWorld, int) Phys_ObjDestroy: push ebp mov ebp, esp push esi push ebx sub esp, 0x10 mov ebx, [ebp+0xc] mov [esp], ebx call dBodyGetData mov esi, eax mov [esp], ebx call dBodyDestroy mov dword [esp], 0xb call Sys_EnterCriticalSection mov dword [esp+0x4], physGlob+0xba88 mov [esp], esi call Pool_Free mov dword [ebp+0x8], 0xb add esp, 0x10 pop ebx pop esi pop ebp jmp Sys_LeaveCriticalSection nop ;Phys_CreateHinge(PhysWorld, int, int, float const*, float const*, float, float, float, float) Phys_CreateHinge: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c mov esi, [ebp+0x14] mov edi, [ebp+0x18] mov edx, [physGlob+0xbab8] cmp edx, 0xffffffff jz Phys_CreateHinge_10 lea eax, [edx+edx*2] shl eax, 0x4 sub eax, edx lea eax, [eax*4+physGlob+0xbab0] mov edx, [eax+0xc] mov [physGlob+0xbab8], edx add eax, 0xc jz Phys_CreateHinge_10 mov [esp+0x4], eax mov edx, [ebp+0x8] mov eax, [edx*4+physGlob] mov [esp], eax call dJointCreateHinge mov ebx, eax test eax, eax jz Phys_CreateHinge_20 mov eax, [ebp+0x10] mov [esp+0x8], eax mov edx, [ebp+0xc] mov [esp+0x4], edx mov [esp], ebx call dJointAttach mov eax, [esi+0x8] mov [esp+0xc], eax mov eax, [esi+0x4] mov [esp+0x8], eax mov eax, [esi] mov [esp+0x4], eax mov [esp], ebx call dJointSetHingeAnchor mov eax, [edi+0x8] mov [esp+0xc], eax mov eax, [edi+0x4] mov [esp+0x8], eax mov eax, [edi] mov [esp+0x4], eax mov [esp], ebx call dJointSetHingeAxis movss xmm0, dword [ebp+0x28] movss [esp+0x14], xmm0 movss xmm0, dword [ebp+0x24] movss [esp+0x10], xmm0 movss xmm0, dword [ebp+0x20] movss [esp+0xc], xmm0 movss xmm0, dword [ebp+0x1c] movss [esp+0x8], xmm0 mov [esp+0x4], ebx mov eax, [ebp+0x8] mov [esp], eax call Phys_SetHingeParams Phys_CreateHinge_20: mov eax, ebx add esp, 0x2c pop ebx pop esi pop edi pop ebp ret Phys_CreateHinge_10: mov dword [esp+0x8], 0xc0 mov dword [esp+0x4], _cstring_physics_out_of_h mov dword [esp], 0x14 call Com_PrintWarning xor ebx, ebx mov eax, ebx add esp, 0x2c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjAddForce(PhysWorld, int, float const*, float const*) Phys_ObjAddForce: push ebp mov ebp, esp push ebx sub esp, 0x24 mov ebx, [ebp+0xc] mov edx, [ebp+0x10] mov ecx, [ebp+0x14] mov eax, [ebp+0x8] cvtsi2ss xmm0, dword [eax*4+g_phys_msecStep] movss xmm1, dword [_float_1000_00000000] divss xmm1, xmm0 mov eax, [edx+0x8] mov [esp+0x18], eax mov eax, [edx+0x4] mov [esp+0x14], eax mov eax, [edx] mov [esp+0x10], eax movaps xmm0, xmm1 mulss xmm0, [ecx+0x8] movss [esp+0xc], xmm0 movaps xmm0, xmm1 mulss xmm0, [ecx+0x4] movss [esp+0x8], xmm0 mulss xmm1, [ecx] movss [esp+0x4], xmm1 mov [esp], ebx call dBodyAddForceAtPos mov [ebp+0x8], ebx add esp, 0x24 pop ebx pop ebp jmp dBodyEnable nop ;Phys_ObjIsAsleep(int) Phys_ObjIsAsleep: push ebp mov ebp, esp sub esp, 0x18 mov eax, [ebp+0x8] mov [esp], eax call dBodyIsEnabled test al, al setz al movzx eax, al leave ret nop ;Phys_JointDestroy(PhysWorld, int) Phys_JointDestroy: push ebp mov ebp, esp push ebx sub esp, 0x14 mov ebx, [ebp+0xc] mov [esp], ebx call dJointDestroy cmp ebx, physGlob+0xbabc jb Phys_JointDestroy_10 cmp ebx, physGlob+0x147bc jb Phys_JointDestroy_20 Phys_JointDestroy_10: xor eax, eax test eax, eax jnz Phys_JointDestroy_30 Phys_JointDestroy_110: cmp ebx, physGlob+0x147c0 jae Phys_JointDestroy_40 Phys_JointDestroy_90: xor eax, eax test eax, eax jnz Phys_JointDestroy_50 Phys_JointDestroy_100: cmp ebx, physGlob+0x183c4 jb Phys_JointDestroy_60 cmp ebx, physGlob+0x23cc4 jb Phys_JointDestroy_70 Phys_JointDestroy_60: xor eax, eax Phys_JointDestroy_120: test eax, eax jz Phys_JointDestroy_80 mov dword [esp+0x8], 0x128 mov dword [esp+0x4], 0x0 mov [esp], ebx call memset mov eax, [physGlob+0x183c0] mov [ebx], eax mov edx, ebx sub edx, physGlob+0x183c4 sar edx, 0x3 lea eax, [edx+edx*2] lea eax, [eax+eax*8] lea eax, [edx+eax*4] mov edx, eax shl edx, 0x6 add eax, edx mov edx, eax shl edx, 0x12 sub eax, edx mov [physGlob+0x183c0], eax add esp, 0x14 pop ebx pop ebp ret Phys_JointDestroy_40: cmp ebx, physGlob+0x183c0 jae Phys_JointDestroy_90 mov eax, 0x1 test eax, eax jz Phys_JointDestroy_100 Phys_JointDestroy_50: mov dword [esp+0x8], 0x60 mov dword [esp+0x4], 0x0 mov [esp], ebx call memset mov eax, [physGlob+0x147bc] mov [ebx], eax mov ecx, ebx sub ecx, physGlob+0x147c0 sar ecx, 0x5 lea eax, [ecx+ecx*4] mov edx, eax shl edx, 0x4 add eax, edx mov edx, eax shl edx, 0x8 add eax, edx mov edx, eax shl edx, 0x10 add eax, edx lea eax, [ecx+eax*2] mov [physGlob+0x147bc], eax Phys_JointDestroy_80: add esp, 0x14 pop ebx pop ebp ret Phys_JointDestroy_20: mov eax, 0x1 test eax, eax jz Phys_JointDestroy_110 Phys_JointDestroy_30: mov dword [esp+0x8], 0xbc mov dword [esp+0x4], 0x0 mov [esp], ebx call memset mov eax, [physGlob+0xbab8] mov [ebx], eax sub ebx, physGlob+0xbabc sar ebx, 0x2 imul eax, ebx, 0x677d46cf mov [physGlob+0xbab8], eax add esp, 0x14 pop ebx pop ebp ret Phys_JointDestroy_70: mov eax, 0x1 jmp Phys_JointDestroy_120 nop ;Phys_DrawDebugText(ScreenPlacement const*) Phys_DrawDebugText: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x4c mov dword [ebp-0x1c], 0x0 mov dword [ebp-0x20], 0x42900000 mov eax, [ebp+0x8] mov [esp+0x4], eax lea ebx, [ebp-0x20] mov [esp], ebx movss xmm0, dword [_float_12_00000000] lea ecx, [ebp-0x1c] mov edx, _cstring_dynent_objects xor eax, eax call Phys_DrawDebugTextForWorld mov esi, eax mov eax, [ebp+0x8] mov [esp+0x4], eax mov [esp], ebx movss xmm0, dword [_float_12_00000000] lea ecx, [ebp-0x1c] mov edx, _cstring_fx_objects mov eax, 0x1 call Phys_DrawDebugTextForWorld lea edi, [esi+eax] mov eax, [ebp+0x8] mov [esp+0x4], eax mov [esp], ebx movss xmm0, dword [_float_12_00000000] lea ecx, [ebp-0x1c] mov edx, _cstring_ragdoll_objects mov eax, 0x2 call Phys_DrawDebugTextForWorld lea eax, [edi+eax] mov [esp+0x4], eax mov dword [esp], _cstring_total_objects_aw call va mov dword [esp+0x20], 0x0 mov dword [esp+0x1c], 0x41400000 mov dword [esp+0x18], 0x1 mov dword [esp+0x14], 0x0 mov edx, colorGreen mov [esp+0x10], edx mov [esp+0xc], eax mov eax, [ebp-0x20] mov [esp+0x8], eax mov eax, [ebp-0x1c] mov [esp+0x4], eax mov eax, [ebp+0x8] mov [esp], eax call CG_DrawStringExt add esp, 0x4c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjAddGeomBox(PhysWorld, int, float const*, float const*) Phys_ObjAddGeomBox: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xbc mov edi, [ebp+0xc] mov esi, [ebp+0x10] mov ebx, [ebp+0x14] lea eax, [ebp-0x68] mov [esp], eax call dMassSetZero mov dword [ebp-0xb0], 0x1 movss xmm0, dword [esi] addss xmm0, [ebx] movss xmm1, dword [_float_0_50000000] mulss xmm0, xmm1 movss [ebp-0x24], xmm0 movss xmm0, dword [esi+0x4] addss xmm0, [ebx+0x4] mulss xmm0, xmm1 movss [ebp-0x20], xmm0 movss xmm0, dword [esi+0x8] addss xmm0, [ebx+0x8] mulss xmm0, xmm1 movss [ebp-0x1c], xmm0 movss xmm0, dword [ebx] subss xmm0, [esi] movss [ebp-0x84], xmm0 movss xmm0, dword [ebx+0x4] subss xmm0, [esi+0x4] movss [ebp-0x80], xmm0 movss xmm0, dword [ebx+0x8] subss xmm0, [esi+0x8] movss [ebp-0x7c], xmm0 mov byte [ebp-0xac], 0x0 lea eax, [ebp-0x68] mov [esp+0x4], eax mov [esp], edi call dBodyGetMass lea ecx, [ebp-0xb0] lea eax, [ebp-0x24] mov [esp], eax movss xmm0, dword [ebp-0x68] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xbc pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjCreateAxis(PhysWorld, float const*, float const (*) [3], float const*, PhysPreset const*) Phys_ObjCreateAxis: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x8c mov edi, [ebp+0x8] mov ebx, [ebp+0xc] mov esi, [ebp+0x14] lea eax, [ebp-0x7c] mov [esp+0x4], eax mov eax, [ebp+0x10] mov [esp], eax call AxisCopy mov eax, [ebx] mov [ebp-0x88], eax mov eax, [ebx+0x4] mov [ebp-0x84], eax mov eax, [ebx+0x8] mov [ebp-0x80], eax mov eax, [esi] mov [ebp-0x58], eax mov eax, [esi+0x4] mov [ebp-0x54], eax mov eax, [esi+0x8] mov [ebp-0x50], eax xor eax, eax mov [ebp-0x4c], eax mov [ebp-0x48], eax mov [ebp-0x44], eax mov [ebp-0x40], eax mov [ebp-0x3c], eax mov [ebp-0x38], eax mov edx, [ebp+0x18] mov eax, [edx+0x8] mov [ebp-0x34], eax mov eax, [edx+0xc] mov [ebp-0x2c], eax mov eax, [edx+0x10] mov [ebp-0x30], eax mov dword [ebp-0x28], 0x0 lea eax, [edi+edi*2] mov edx, eax shl edx, 0x4 add eax, edx mov eax, [eax*4+physGlob+0x10] mov [ebp-0x24], eax mov edx, [ebp+0x18] mov eax, [edx+0x4] mov [ebp-0x20], eax mov byte [ebp-0x1c], 0x1 lea edx, [ebp-0x88] mov eax, edi call Phys_CreateBodyFromState add esp, 0x8c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjGetPosition(int, float*, float (*) [3]) Phys_ObjGetPosition: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x3c mov eax, [ebp+0x8] mov [esp], eax call dBodyGetPosition mov [ebp-0x2c], eax mov edx, [ebp+0x8] mov [esp], edx call dBodyGetRotation mov esi, eax xor edi, edi Phys_ObjGetPosition_20: mov ecx, esi mov eax, [ebp+0x10] lea edx, [eax+edi*4] mov ebx, 0x3 Phys_ObjGetPosition_10: mov eax, [ecx] mov [edx], eax add ecx, 0x4 add edx, 0xc sub ebx, 0x1 jnz Phys_ObjGetPosition_10 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jnz Phys_ObjGetPosition_20 mov edx, [ebp-0x2c] mov eax, [edx] mov edx, [ebp+0xc] mov [edx], eax mov edx, [ebp-0x2c] mov eax, [edx+0x4] mov edx, [ebp+0xc] mov [edx+0x4], eax mov edx, [ebp-0x2c] mov eax, [edx+0x8] mov edx, [ebp+0xc] mov [edx+0x8], eax mov eax, [ebp+0x8] mov [esp], eax call dBodyGetData lea edx, [ebp-0x24] mov [esp+0x8], edx mov [esp+0x4], eax mov edx, [ebp+0x10] mov [esp], edx call AxisTransformVec3 movss xmm0, dword [ebp-0x24] mov eax, [ebp+0xc] addss xmm0, [eax] movss [eax], xmm0 movss xmm0, dword [ebp-0x20] addss xmm0, [eax+0x4] movss [eax+0x4], xmm0 movss xmm0, dword [ebp-0x1c] addss xmm0, [eax+0x8] movss [eax+0x8], xmm0 add esp, 0x3c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjSetVelocity(int, float const*) Phys_ObjSetVelocity: push ebp mov ebp, esp sub esp, 0x18 mov edx, [ebp+0xc] mov eax, [edx+0x8] mov [esp+0xc], eax mov eax, [edx+0x4] mov [esp+0x8], eax mov eax, [edx] mov [esp+0x4], eax mov eax, [ebp+0x8] mov [esp], eax call dBodySetLinearVel leave ret ;Phys_SetHingeParams(PhysWorld, int, float, float, float, float) Phys_SetHingeParams: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c mov ebx, [ebp+0xc] mov esi, [ebp+0x14] mov edi, [ebp+0x18] movss xmm0, dword [ebp+0x1c] movss [ebp-0x1c], xmm0 mov eax, [ebp+0x10] mov [esp+0x8], eax mov dword [esp+0x4], 0x2 mov [esp], ebx call dJointSetHingeParam mov [esp+0x8], esi mov dword [esp+0x4], 0x3 mov [esp], ebx call dJointSetHingeParam mov dword [esp+0x8], 0x3f666666 mov dword [esp+0x4], 0x4 mov [esp], ebx call dJointSetHingeParam mov eax, [phys_joint_cfm] mov eax, [eax+0xc] mov [esp+0x8], eax mov dword [esp+0x4], 0x6 mov [esp], ebx call dJointSetHingeParam mov eax, [phys_joint_stop_cfm] mov eax, [eax+0xc] mov [esp+0x8], eax mov dword [esp+0x4], 0x8 mov [esp], ebx call dJointSetHingeParam mov eax, [phys_joint_stop_erp] mov eax, [eax+0xc] mov [esp+0x8], eax mov dword [esp+0x4], 0x7 mov [esp], ebx call dJointSetHingeParam mov [esp+0x8], edi mov dword [esp+0x4], 0x0 mov [esp], ebx call dJointSetHingeParam movss xmm0, dword [ebp-0x1c] movss [ebp+0x10], xmm0 mov dword [ebp+0xc], 0x1 mov [ebp+0x8], ebx add esp, 0x2c pop ebx pop esi pop edi pop ebp jmp dJointSetHingeParam nop ;Phys_AddJitterRegion(PhysWorld, float const*, float, float, float, float) Phys_AddJitterRegion: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x1c mov ebx, [ebp+0x8] movss xmm0, dword [ebp+0x10] movss xmm1, dword [ebp+0x14] lea eax, [ebx+ebx*2] mov edx, eax shl edx, 0x4 add eax, edx lea eax, [eax*4+physGlob] lea ecx, [eax+0xc] mov edx, [ecx+0x10] cmp edx, 0x4 jle Phys_AddJitterRegion_10 lea esi, [eax+0xb4] Phys_AddJitterRegion_50: mov edx, [ebp+0xc] mov eax, [edx] mov [esi], eax mov edi, edx add edi, 0x4 mov eax, [edx+0x4] mov [esi+0x4], eax mov eax, [edx+0x8] mov [esi+0x8], eax movss [esi+0x14], xmm0 movss [esi+0x18], xmm1 mulss xmm0, xmm0 movss [esi+0xc], xmm0 mulss xmm1, xmm1 movss [esi+0x10], xmm1 mov eax, [ebp+0x18] mov [esi+0x1c], eax mov eax, [ebp+0x1c] mov [esi+0x20], eax mov eax, [ebx*4+physGlob] mov ebx, [eax] test ebx, ebx jnz Phys_AddJitterRegion_20 jmp Phys_AddJitterRegion_30 Phys_AddJitterRegion_40: mov eax, [ebx+0x4] mov ebx, eax test eax, eax jz Phys_AddJitterRegion_30 Phys_AddJitterRegion_20: mov [esp], ebx call dBodyGetPosition movss xmm0, dword [eax] mov edx, [ebp+0xc] subss xmm0, [edx] movss xmm1, dword [eax+0x4] subss xmm1, [edi] mulss xmm0, xmm0 mulss xmm1, xmm1 addss xmm0, xmm1 addss xmm0, [_float_0_00000000] ucomiss xmm0, [esi+0x10] ja Phys_AddJitterRegion_40 mov [esp], ebx call dBodyEnable mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz Phys_AddJitterRegion_20 Phys_AddJitterRegion_30: add esp, 0x1c pop ebx pop esi pop edi pop ebp ret Phys_AddJitterRegion_10: lea eax, [edx+edx*8] lea esi, [ecx+eax*4+0x18] lea eax, [edx+0x1] mov [ecx+0x10], eax jmp Phys_AddJitterRegion_50 nop ;Phys_ObjAddGeomBrush(PhysWorld, int, cbrush_t const*, PhysMass const*) Phys_ObjAddGeomBrush: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov edi, [ebp+0xc] mov ebx, [ebp+0x14] lea esi, [ebp-0x5c] mov [esp], esi call dMassSetZero mov dword [ebp-0xa4], 0x3 mov eax, [ebp+0x10] mov [ebp-0x78], eax lea edx, [ebx+0xc] mov eax, [ebx+0xc] mov [ebp-0x74], eax mov eax, [edx+0x4] mov [ebp-0x70], eax mov eax, [edx+0x8] mov [ebp-0x6c], eax lea edx, [ebx+0x18] mov eax, [ebx+0x18] mov [ebp-0x68], eax mov eax, [edx+0x4] mov [ebp-0x64], eax mov eax, [edx+0x8] mov [ebp-0x60], eax mov byte [ebp-0xa0], 0x0 mov [esp+0x4], esi mov [esp], edi call dBodyGetMass lea ecx, [ebp-0xa4] mov [esp], ebx movss xmm0, dword [ebp-0x5c] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjBulletImpact(PhysWorld, int, float const*, float const*, float, float) Phys_ObjBulletImpact: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x12c mov esi, [ebp+0x10] mov ebx, [ebp+0x14] lea eax, [ebp-0xa4] mov [esp], eax call dMassSetZero mov eax, [ebp+0xc] mov [esp], eax call dBodyGetPosition movss xmm0, dword [eax] movss [ebp-0xd0], xmm0 movss xmm1, dword [eax+0x4] movss [ebp-0xd4], xmm1 movss xmm0, dword [eax+0x8] movss [ebp-0xd8], xmm0 movss xmm4, dword [ebx] movss xmm5, dword [ebx+0x4] movss xmm2, dword [ebx+0x8] movss xmm6, dword [esi] movss xmm7, dword [esi+0x4] movss xmm1, dword [esi+0x8] movss [ebp-0xcc], xmm1 mov eax, [phys_bulletUpBias] addss xmm2, [eax+0xc] movaps xmm0, xmm4 mulss xmm0, xmm4 movaps xmm1, xmm5 mulss xmm1, xmm5 addss xmm0, xmm1 movaps xmm1, xmm2 mulss xmm1, xmm2 addss xmm0, xmm1 sqrtss xmm3, xmm0 movaps xmm0, xmm3 xorps xmm0, [circleCoords.131667+0x160] ucomiss xmm0, [_float_0_00000000] jb Phys_ObjBulletImpact_10 movss xmm0, dword [_float_1_00000000] Phys_ObjBulletImpact_120: mulss xmm4, xmm0 movss [ebp-0xac], xmm4 mulss xmm5, xmm0 movss [ebp-0xb0], xmm5 mulss xmm2, xmm0 movss [ebp-0xb4], xmm2 movaps xmm0, xmm6 subss xmm0, [ebp-0xd0] movss [ebp-0xb8], xmm0 movaps xmm1, xmm7 subss xmm1, [ebp-0xd4] movss [ebp-0xbc], xmm1 movss xmm0, dword [ebp-0xcc] subss xmm0, [ebp-0xd8] movss [ebp-0xc0], xmm0 mov eax, [phys_bulletSpinScale] movss xmm0, dword [eax+0xc] movss xmm1, dword [ebp-0xb8] mulss xmm1, xmm0 addss xmm6, xmm1 movss [ebp-0xb8], xmm6 movss xmm1, dword [ebp-0xbc] mulss xmm1, xmm0 addss xmm7, xmm1 movss [ebp-0xbc], xmm7 mulss xmm0, [ebp-0xc0] movss xmm1, dword [ebp-0xcc] addss xmm1, xmm0 movss [ebp-0xc0], xmm1 mov eax, [ebp+0xc] mov [esp], eax call dBodyGetLinearVel movss xmm0, dword [ebp-0xac] mulss xmm0, [eax] movss xmm1, dword [ebp-0xb0] mulss xmm1, [eax+0x4] addss xmm0, xmm1 movss xmm1, dword [ebp-0xb4] mulss xmm1, [eax+0x8] addss xmm0, xmm1 movss xmm1, dword [ebp+0x18] subss xmm1, xmm0 movss [ebp-0xdc], xmm1 lea eax, [ebp-0xa4] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax call dBodyGetMass movss xmm3, dword [ebp-0xb8] subss xmm3, [ebp-0xd0] movss xmm1, dword [ebp-0xbc] subss xmm1, [ebp-0xd4] movss xmm2, dword [ebp-0xc0] subss xmm2, [ebp-0xd8] movss xmm4, dword [ebp-0xb4] mulss xmm4, xmm1 movss xmm0, dword [ebp-0xb0] mulss xmm0, xmm2 subss xmm4, xmm0 movss xmm5, dword [ebp-0xac] mulss xmm5, xmm2 movss xmm0, dword [ebp-0xb4] mulss xmm0, xmm3 subss xmm5, xmm0 movss xmm2, dword [ebp-0xb0] mulss xmm2, xmm3 mulss xmm1, [ebp-0xac] subss xmm2, xmm1 movaps xmm0, xmm4 mulss xmm0, xmm4 movaps xmm1, xmm5 mulss xmm1, xmm5 addss xmm0, xmm1 movaps xmm1, xmm2 mulss xmm1, xmm2 addss xmm0, xmm1 sqrtss xmm7, xmm0 movaps xmm0, xmm7 xorps xmm0, [circleCoords.131667+0x160] ucomiss xmm0, [_float_0_00000000] jb Phys_ObjBulletImpact_20 movss xmm0, dword [_float_1_00000000] Phys_ObjBulletImpact_110: movaps xmm6, xmm4 mulss xmm6, xmm0 mulss xmm5, xmm0 movss [ebp-0xc4], xmm5 mulss xmm2, xmm0 movss [ebp-0xc8], xmm2 xor esi, esi lea edi, [ebp-0x60] Phys_ObjBulletImpact_40: mov ecx, esi shl ecx, 0x4 lea edx, [edi+esi*4] xor ebx, ebx Phys_ObjBulletImpact_30: mov eax, [ebp+ecx-0x90] mov [edx], eax add ebx, 0x1 add ecx, 0x4 add edx, 0xc cmp ebx, 0x3 jnz Phys_ObjBulletImpact_30 add esi, 0x1 cmp esi, 0x3 jnz Phys_ObjBulletImpact_40 mov eax, [ebp+0xc] mov [esp], eax movss [ebp-0x108], xmm6 movss [ebp-0x118], xmm7 call dBodyGetRotation mov esi, eax xor edi, edi movss xmm7, dword [ebp-0x118] movss xmm6, dword [ebp-0x108] Phys_ObjBulletImpact_60: mov ecx, esi lea edx, [ebp+edi*4-0x3c] mov ebx, 0x3 Phys_ObjBulletImpact_50: mov eax, [ecx] mov [edx], eax add ecx, 0x4 add edx, 0xc sub ebx, 0x1 jnz Phys_ObjBulletImpact_50 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jnz Phys_ObjBulletImpact_60 movaps xmm3, xmm6 mulss xmm3, [ebp-0x3c] movss xmm0, dword [ebp-0xc4] mulss xmm0, [ebp-0x30] addss xmm3, xmm0 movss xmm0, dword [ebp-0xc8] mulss xmm0, [ebp-0x24] addss xmm3, xmm0 movaps xmm4, xmm6 mulss xmm4, [ebp-0x38] movss xmm0, dword [ebp-0xc4] mulss xmm0, [ebp-0x2c] addss xmm4, xmm0 movss xmm0, dword [ebp-0xc8] mulss xmm0, [ebp-0x20] addss xmm4, xmm0 movaps xmm2, xmm6 mulss xmm2, [ebp-0x34] movss xmm0, dword [ebp-0xc4] mulss xmm0, [ebp-0x28] addss xmm2, xmm0 movss xmm0, dword [ebp-0xc8] mulss xmm0, [ebp-0x1c] addss xmm2, xmm0 movaps xmm5, xmm3 mulss xmm5, [ebp-0x60] movaps xmm0, xmm4 mulss xmm0, [ebp-0x54] addss xmm5, xmm0 movaps xmm0, xmm2 mulss xmm0, [ebp-0x48] addss xmm5, xmm0 mulss xmm5, xmm3 movaps xmm0, xmm3 mulss xmm0, [ebp-0x5c] movaps xmm1, xmm4 mulss xmm1, [ebp-0x50] addss xmm0, xmm1 movaps xmm1, xmm2 mulss xmm1, [ebp-0x44] addss xmm0, xmm1 mulss xmm0, xmm4 addss xmm5, xmm0 mulss xmm3, [ebp-0x58] mulss xmm4, [ebp-0x4c] addss xmm3, xmm4 movaps xmm0, xmm2 mulss xmm0, [ebp-0x40] addss xmm3, xmm0 mulss xmm2, xmm3 addss xmm5, xmm2 mov eax, [ebp+0xc] mov [esp], eax movss [ebp-0xf8], xmm5 movss [ebp-0x108], xmm6 movss [ebp-0x118], xmm7 call dBodyGetAngularVel movss xmm6, dword [ebp-0x108] mulss xmm6, [eax] movss xmm0, dword [ebp-0xc4] mulss xmm0, [eax+0x4] addss xmm6, xmm0 movss xmm1, dword [ebp-0xc8] mulss xmm1, [eax+0x8] addss xmm6, xmm1 movss xmm7, dword [ebp-0x118] mulss xmm6, xmm7 movss xmm1, dword [ebp-0xdc] subss xmm1, xmm6 addss xmm1, xmm1 movss xmm3, dword [_float_0_50000000] mulss xmm1, xmm3 movss xmm5, dword [ebp-0xf8] ucomiss xmm1, [_float_0_00000000] jp Phys_ObjBulletImpact_70 jbe Phys_ObjBulletImpact_80 Phys_ObjBulletImpact_70: movss xmm0, dword [ebp-0xa4] movaps xmm2, xmm0 addss xmm2, xmm3 ucomiss xmm7, [_float_0_00000000] jp Phys_ObjBulletImpact_90 jnz Phys_ObjBulletImpact_90 Phys_ObjBulletImpact_100: mulss xmm0, [ebp+0x1c] mulss xmm0, xmm1 divss xmm0, xmm2 mov eax, [ebp+0x8] cvtsi2ss xmm1, dword [eax*4+g_phys_msecStep] movss xmm2, dword [_float_1000_00000000] divss xmm2, xmm1 movss xmm1, dword [ebp-0xc0] movss [esp+0x18], xmm1 movss xmm1, dword [ebp-0xbc] movss [esp+0x14], xmm1 movss xmm1, dword [ebp-0xb8] movss [esp+0x10], xmm1 movss xmm1, dword [ebp-0xb4] mulss xmm1, xmm0 movss [ebp-0xb4], xmm1 mulss xmm1, xmm2 movss [esp+0xc], xmm1 movss xmm1, dword [ebp-0xb0] mulss xmm1, xmm0 movss [ebp-0xb0], xmm1 mulss xmm1, xmm2 movss [esp+0x8], xmm1 mulss xmm0, [ebp-0xac] mulss xmm2, xmm0 movss [esp+0x4], xmm2 mov eax, [ebp+0xc] mov [esp], eax call dBodyAddForceAtPos mov eax, [ebp+0xc] mov [esp], eax call dBodyEnable Phys_ObjBulletImpact_80: add esp, 0x12c pop ebx pop esi pop edi pop ebp ret Phys_ObjBulletImpact_90: mulss xmm7, xmm7 mulss xmm7, xmm0 mulss xmm7, xmm3 divss xmm7, xmm5 addss xmm2, xmm7 jmp Phys_ObjBulletImpact_100 Phys_ObjBulletImpact_20: movss xmm0, dword [_float_1_00000000] divss xmm0, xmm7 jmp Phys_ObjBulletImpact_110 Phys_ObjBulletImpact_10: movss xmm0, dword [_float_1_00000000] divss xmm0, xmm3 jmp Phys_ObjBulletImpact_120 ;dxPostProcessIslands(PhysWorld) dxPostProcessIslands: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x3c mov eax, [ebp+0x8] mov edi, [eax*4+physGlob] mov esi, [edi] test esi, esi jz dxPostProcessIslands_10 dxPostProcessIslands_40: test byte [esi+0x18], 0x4 jnz dxPostProcessIslands_20 lea eax, [esi+0x98] mov dword [esi+0x98], 0x0 mov dword [eax+0x4], 0x0 mov dword [eax+0x8], 0x0 lea eax, [esi+0xa8] mov dword [esi+0xa8], 0x0 mov dword [eax+0x4], 0x0 mov dword [eax+0x8], 0x0 mov ebx, [esi+0x1c] test ebx, ebx jz dxPostProcessIslands_20 dxPostProcessIslands_30: mov [esp], ebx call dGeomMoved mov [esp], ebx call dGeomGetBodyNext mov ebx, eax test eax, eax jnz dxPostProcessIslands_30 dxPostProcessIslands_20: mov eax, [esi+0x4] mov esi, eax test eax, eax jnz dxPostProcessIslands_40 mov edx, [ebp+0x8] dxPostProcessIslands_110: mov eax, [edx*4+physGlob+0x27c] mov [esp], eax call dJointGroupEmpty mov ecx, [ebp+0x8] lea eax, [ecx+ecx*2] mov edx, eax shl edx, 0x4 add eax, edx mov dword [eax*4+physGlob+0x1c], 0x0 movss xmm0, dword [edi+0x50] movss [ebp-0x1c], xmm0 mov ebx, [edi] test ebx, ebx jz dxPostProcessIslands_50 xor esi, esi pxor xmm3, xmm3 dxPostProcessIslands_80: mov [esp], ebx movss [ebp-0x38], xmm3 call dBodyIsEnabled test al, al movss xmm3, dword [ebp-0x38] jz dxPostProcessIslands_60 cmp dword [ebp+0x8], 0x2 jz dxPostProcessIslands_70 mov eax, [phys_dragLinear] movss xmm0, dword [ebp-0x1c] mulss xmm0, [eax+0xc] movss xmm1, dword [_float_1_00000000] subss xmm1, xmm0 movaps xmm0, xmm1 movaps xmm1, xmm3 cmpss xmm1, xmm0, 0x2 andps xmm0, xmm1 orps xmm0, xmm3 lea eax, [ebx+0x130] movaps xmm1, xmm0 mulss xmm1, [ebx+0x130] movss [ebx+0x130], xmm1 movaps xmm1, xmm0 mulss xmm1, [eax+0x4] movss [eax+0x4], xmm1 mulss xmm0, [eax+0x8] movss [eax+0x8], xmm0 mov eax, [phys_dragAngular] movss xmm0, dword [ebp-0x1c] mulss xmm0, [eax+0xc] movss xmm1, dword [_float_1_00000000] subss xmm1, xmm0 movaps xmm0, xmm1 movaps xmm1, xmm3 cmpss xmm1, xmm0, 0x2 andps xmm0, xmm1 orps xmm0, xmm3 lea eax, [ebx+0x140] movaps xmm1, xmm0 mulss xmm1, [ebx+0x140] movss [ebx+0x140], xmm1 movaps xmm1, xmm0 mulss xmm1, [eax+0x4] movss [eax+0x4], xmm1 mulss xmm0, [eax+0x8] movss [eax+0x8], xmm0 dxPostProcessIslands_90: add esi, 0x1 dxPostProcessIslands_60: mov eax, [ebx+0x4] mov ebx, eax test eax, eax jnz dxPostProcessIslands_80 lea eax, [esi-0x20] dxPostProcessIslands_100: cvtsi2ss xmm1, eax divss xmm1, dword [_float_18_00000000] movss xmm4, dword [_float_1_00000000] movaps xmm0, xmm1 subss xmm0, xmm4 pxor xmm2, xmm2 movaps xmm3, xmm2 cmpss xmm3, xmm0, 0x6 movaps xmm0, xmm3 movaps xmm3, xmm1 andps xmm3, xmm0 andnps xmm0, xmm4 orps xmm0, xmm3 movaps xmm3, xmm2 subss xmm3, xmm1 movaps xmm1, xmm3 movaps xmm3, xmm2 cmpss xmm3, xmm1, 0x6 andps xmm0, xmm3 orps xmm0, xmm2 mov eax, [ebp+0x8] mov edx, [eax*4+g_phys_minMsecStep] mov ecx, eax mov eax, [eax*4+g_phys_maxMsecStep] sub eax, edx cvtsi2ss xmm1, eax mulss xmm0, xmm1 cvttss2si eax, xmm0 add edx, eax mov [ecx*4+g_phys_msecStep], edx add esp, 0x3c pop ebx pop esi pop edi pop ebp ret dxPostProcessIslands_70: lea eax, [ebx+0x140] movss xmm1, dword [ebx+0x144] mulss xmm1, [_float__0_01000000] movss xmm2, dword [ebx+0x148] mulss xmm2, [_float__0_01000000] movss xmm0, dword [ebx+0x140] mulss xmm0, [_float__0_01000000] addss xmm0, [ebx+0x140] movss [ebx+0x140], xmm0 addss xmm1, [ebx+0x144] movss [eax+0x4], xmm1 addss xmm2, [ebx+0x148] movss [eax+0x8], xmm2 jmp dxPostProcessIslands_90 dxPostProcessIslands_50: mov eax, 0xffffffe0 jmp dxPostProcessIslands_100 dxPostProcessIslands_10: mov edx, eax jmp dxPostProcessIslands_110 ;Phys_ObjAddGeomCapsule(PhysWorld, int, int, float, float, float const*) Phys_ObjAddGeomCapsule: push ebp mov ebp, esp push esi push ebx sub esp, 0xa0 mov esi, [ebp+0xc] lea ebx, [ebp-0x4c] mov [esp], ebx call dMassSetZero mov dword [ebp-0x94], 0x5 mov eax, [ebp+0x10] add eax, 0x1 mov [ebp-0x68], eax mov eax, [ebp+0x14] mov [ebp-0x64], eax mov eax, [ebp+0x18] mov [ebp-0x60], eax mov byte [ebp-0x90], 0x0 mov [esp+0x4], ebx mov [esp], esi call dBodyGetMass lea ecx, [ebp-0x94] mov eax, [ebp+0x1c] mov [esp], eax movss xmm0, dword [ebp-0x4c] mov edx, esi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xa0 pop ebx pop esi pop ebp ret ;Phys_ObjSetOrientation(PhysWorld, int, float const*, float const*) Phys_ObjSetOrientation: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xec mov eax, [ebp+0xc] mov [esp], eax call dBodyGetData mov [ebp-0xac], eax lea edx, [ebp-0x78] mov [esp+0x8], edx lea eax, [ebp-0x30] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax call Phys_ObjGetPosition mov edx, [ebp+0xc] mov [esp], edx call dBodyGetRotation mov esi, eax xor edi, edi Phys_ObjSetOrientation_20: mov ecx, esi lea edx, [ebp+edi*4-0x78] mov ebx, 0x3 Phys_ObjSetOrientation_10: mov eax, [ecx] mov [edx], eax add ecx, 0x4 add edx, 0xc sub ebx, 0x1 jnz Phys_ObjSetOrientation_10 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jnz Phys_ObjSetOrientation_20 lea eax, [ebp-0x54] mov [esp+0x4], eax mov eax, [ebp+0x14] mov [esp], eax call QuatToAxis lea eax, [ebp-0x24] mov [esp+0x8], eax mov edx, [ebp-0xac] mov [esp+0x4], edx lea eax, [ebp-0x54] mov [esp], eax call AxisTransformVec3 mov edx, [ebp+0x10] movss xmm2, dword [edx] subss xmm2, [ebp-0x24] movss xmm1, dword [edx+0x4] subss xmm1, [ebp-0x20] movss xmm0, dword [edx+0x8] subss xmm0, [ebp-0x1c] xor di, di xor esi, esi Phys_ObjSetOrientation_40: mov ecx, esi lea edx, [ebp+edi*4-0x54] xor ebx, ebx Phys_ObjSetOrientation_30: mov eax, [edx] mov [ebp+ecx-0xa8], eax add ebx, 0x1 add ecx, 0x4 add edx, 0xc cmp ebx, 0x3 jnz Phys_ObjSetOrientation_30 mov dword [esi+ebp-0x9c], 0x0 add edi, 0x1 add esi, 0x10 cmp edi, 0x3 jnz Phys_ObjSetOrientation_40 mov eax, [ebp-0xac] add eax, 0x10 mov edx, [ebp-0xac] movss [edx+0x10], xmm2 movss [eax+0x4], xmm1 movss [eax+0x8], xmm0 mov eax, edx add eax, 0x1c mov [esp+0x4], eax lea eax, [ebp-0x54] mov [esp], eax movss [ebp-0xc8], xmm0 movss [ebp-0xd8], xmm1 movss [ebp-0xe8], xmm2 call AxisCopy movss xmm0, dword [ebp-0xc8] movss [esp+0xc], xmm0 movss xmm1, dword [ebp-0xd8] movss [esp+0x8], xmm1 movss xmm2, dword [ebp-0xe8] movss [esp+0x4], xmm2 mov edx, [ebp+0xc] mov [esp], edx call dBodySetPosition lea eax, [ebp-0xa8] mov [esp+0x4], eax mov edx, [ebp+0xc] mov [esp], edx call dBodySetRotation add esp, 0xec pop ebx pop esi pop edi pop ebp ret nop ;Phys_CreateAngularMotor(PhysWorld, int, int, int, float const (*) [3], float const*, float const*, float const*, float const*) Phys_CreateAngularMotor: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c mov edi, [ebp+0x8] mov esi, [ebp+0x18] mov edx, [physGlob+0x183c0] cmp edx, 0xffffffff jz Phys_CreateAngularMotor_10 lea eax, [edx+edx*8] lea eax, [edx+eax*4] lea eax, [eax*8+physGlob+0x183c0] mov edx, [eax+0x4] mov [physGlob+0x183c0], edx add eax, 0x4 jz Phys_CreateAngularMotor_10 mov [esp+0x4], eax mov eax, [edi*4+physGlob] mov [esp], eax call dJointCreateAMotor mov ebx, eax test eax, eax jz Phys_CreateAngularMotor_20 mov eax, [ebp+0x10] mov [esp+0x8], eax mov eax, [ebp+0xc] mov [esp+0x4], eax mov [esp], ebx call dJointAttach mov dword [esp+0x4], 0x1 mov [esp], ebx call dJointSetAMotorMode mov dword [esp+0x4], 0x3 mov [esp], ebx call dJointSetAMotorNumAxes mov edx, [ebp+0x10] test edx, edx jz Phys_CreateAngularMotor_30 lea edx, [esi+0x18] mov eax, [edx+0x8] mov [esp+0x14], eax mov eax, [edx+0x4] mov [esp+0x10], eax mov eax, [esi+0x18] mov [esp+0xc], eax mov dword [esp+0x8], 0x2 mov dword [esp+0x4], 0x2 mov [esp], ebx call dJointSetAMotorAxis Phys_CreateAngularMotor_60: mov eax, [ebp+0xc] test eax, eax jz Phys_CreateAngularMotor_40 mov eax, [esi+0x8] mov [esp+0x14], eax mov eax, [esi+0x4] mov [esp+0x10], eax mov eax, [esi] mov [esp+0xc], eax mov dword [esp+0x8], 0x1 mov dword [esp+0x4], 0x0 mov [esp], ebx call dJointSetAMotorAxis Phys_CreateAngularMotor_50: mov eax, [ebp+0x28] mov [esp+0x14], eax mov eax, [ebp+0x24] mov [esp+0x10], eax mov eax, [ebp+0x20] mov [esp+0xc], eax mov eax, [ebp+0x1c] mov [esp+0x8], eax mov [esp+0x4], ebx mov [esp], edi call Phys_SetAngularMotorParams Phys_CreateAngularMotor_20: mov eax, ebx add esp, 0x2c pop ebx pop esi pop edi pop ebp ret Phys_CreateAngularMotor_10: mov dword [esp+0x8], 0xa0 mov dword [esp+0x4], _cstring_physics_out_of_a mov dword [esp], 0x14 call Com_PrintWarning xor ebx, ebx mov eax, ebx add esp, 0x2c pop ebx pop esi pop edi pop ebp ret Phys_CreateAngularMotor_40: mov eax, [esi+0x8] mov [esp+0x14], eax mov eax, [esi+0x4] mov [esp+0x10], eax mov eax, [esi] mov [esp+0xc], eax mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov [esp], ebx call dJointSetAMotorAxis jmp Phys_CreateAngularMotor_50 Phys_CreateAngularMotor_30: lea edx, [esi+0x18] mov eax, [edx+0x8] mov [esp+0x14], eax mov eax, [edx+0x4] mov [esp+0x10], eax mov eax, [esi+0x18] mov [esp+0xc], eax mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x2 mov [esp], ebx call dJointSetAMotorAxis jmp Phys_CreateAngularMotor_60 ;Phys_ObjAddGeomCylinder(PhysWorld, int, float const*, float const*) Phys_ObjAddGeomCylinder: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xbc mov edi, [ebp+0xc] mov esi, [ebp+0x10] mov ebx, [ebp+0x14] lea eax, [ebp-0x68] mov [esp], eax call dMassSetZero mov dword [ebp-0xb0], 0x4 movss xmm0, dword [esi] addss xmm0, [ebx] movss xmm5, dword [_float_0_50000000] mulss xmm0, xmm5 movss [ebp-0x24], xmm0 movss xmm0, dword [esi+0x4] addss xmm0, [ebx+0x4] mulss xmm0, xmm5 movss [ebp-0x20], xmm0 movss xmm0, dword [esi+0x8] addss xmm0, [ebx+0x8] mulss xmm0, xmm5 movss [ebp-0x1c], xmm0 movss xmm1, dword [ebx] subss xmm1, [esi] movss xmm2, dword [ebx+0x4] subss xmm2, [esi+0x4] movss xmm3, dword [ebx+0x8] subss xmm3, [esi+0x8] mov dword [ebp-0x84], 0x3 movaps xmm4, xmm1 subss xmm4, xmm2 pxor xmm0, xmm0 cmpss xmm0, xmm4, 0x2 andps xmm1, xmm0 andnps xmm0, xmm2 orps xmm0, xmm1 mulss xmm0, xmm5 movss [ebp-0x80], xmm0 mulss xmm3, xmm5 movss [ebp-0x7c], xmm3 mov byte [ebp-0xac], 0x0 lea eax, [ebp-0x68] mov [esp+0x4], eax mov [esp], edi call dBodyGetMass lea ecx, [ebp-0xb0] lea eax, [ebp-0x24] mov [esp], eax movss xmm0, dword [ebp-0x68] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xbc pop ebx pop esi pop edi pop ebp ret ;Phys_ObjGetCenterOfMass(int, float*) Phys_ObjGetCenterOfMass: push ebp mov ebp, esp push ebx sub esp, 0x14 mov ebx, [ebp+0xc] mov eax, [ebp+0x8] mov [esp], eax call dBodyGetPosition mov edx, [eax] mov [ebx], edx mov edx, [eax+0x4] mov [ebx+0x4], edx mov eax, [eax+0x8] mov [ebx+0x8], eax add esp, 0x14 pop ebx pop ebp ret nop ;Phys_CreateBallAndSocket(PhysWorld, int, int, float const*) Phys_CreateBallAndSocket: push ebp mov ebp, esp push esi push ebx sub esp, 0x10 mov esi, [ebp+0x14] mov eax, [physGlob+0x147bc] cmp eax, 0xffffffff jz Phys_CreateBallAndSocket_10 lea eax, [eax+eax*2] shl eax, 0x5 add eax, physGlob+0x147b0 mov edx, [eax+0x10] mov [physGlob+0x147bc], edx add eax, 0x10 jz Phys_CreateBallAndSocket_10 mov [esp+0x4], eax mov edx, [ebp+0x8] mov eax, [edx*4+physGlob] mov [esp], eax call dJointCreateBall mov ebx, eax mov eax, [ebp+0x10] mov [esp+0x8], eax mov edx, [ebp+0xc] mov [esp+0x4], edx mov [esp], ebx call dJointAttach mov eax, [esi+0x8] mov [esp+0xc], eax mov eax, [esi+0x4] mov [esp+0x8], eax mov eax, [esi] mov [esp+0x4], eax mov [esp], ebx call dJointSetBallAnchor mov eax, ebx add esp, 0x10 pop ebx pop esi pop ebp ret Phys_CreateBallAndSocket_10: mov dword [esp+0x8], 0xa0 mov dword [esp+0x4], _cstring_physics_out_of_b mov dword [esp], 0x14 call Com_PrintWarning xor eax, eax add esp, 0x10 pop ebx pop esi pop ebp ret ;Phys_ObjAddGeomBoxRotated(PhysWorld, int, float const*, float const*, float const (*) [3]) Phys_ObjAddGeomBoxRotated: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov edi, [ebp+0xc] mov esi, [ebp+0x14] mov ebx, [ebp+0x18] lea eax, [ebp-0x5c] mov [esp], eax call dMassSetZero mov dword [ebp-0xa4], 0x1 movss xmm0, dword [esi] addss xmm0, xmm0 movss [ebp-0x78], xmm0 movss xmm0, dword [esi+0x4] addss xmm0, xmm0 movss [ebp-0x74], xmm0 movss xmm0, dword [esi+0x8] addss xmm0, xmm0 movss [ebp-0x70], xmm0 mov byte [ebp-0xa0], 0x1 mov eax, [ebx] mov [ebp-0x9c], eax lea esi, [ebp-0xa4] mov eax, [ebx+0x4] mov [ebp-0x98], eax mov eax, [ebx+0x8] mov [ebp-0x94], eax lea edx, [ebx+0xc] mov eax, [ebx+0xc] mov [ebp-0x90], eax mov eax, [edx+0x4] mov [ebp-0x8c], eax mov eax, [edx+0x8] mov [ebp-0x88], eax lea edx, [ebx+0x18] mov eax, [ebx+0x18] mov [ebp-0x84], eax mov eax, [edx+0x4] mov [ebp-0x80], eax mov eax, [edx+0x8] mov [ebp-0x7c], eax lea eax, [ebp-0x5c] mov [esp+0x4], eax mov [esp], edi call dBodyGetMass mov eax, [ebp+0x10] mov [esp], eax mov ecx, esi movss xmm0, dword [ebp-0x5c] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjAddGeomBrushModel(PhysWorld, int, unsigned short, PhysMass const*) Phys_ObjAddGeomBrushModel: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov edi, [ebp+0xc] mov esi, [ebp+0x10] mov ebx, [ebp+0x14] lea eax, [ebp-0x5c] mov [esp], eax call dMassSetZero mov dword [ebp-0xa4], 0x2 mov [ebp-0x78], si lea edx, [ebx+0xc] mov eax, [ebx+0xc] mov [ebp-0x74], eax mov eax, [edx+0x4] mov [ebp-0x70], eax mov eax, [edx+0x8] mov [ebp-0x6c], eax lea edx, [ebx+0x18] mov eax, [ebx+0x18] mov [ebp-0x68], eax mov eax, [edx+0x4] mov [ebp-0x64], eax mov eax, [edx+0x8] mov [ebp-0x60], eax mov byte [ebp-0xa0], 0x0 lea eax, [ebp-0x5c] mov [esp+0x4], eax mov [esp], edi call dBodyGetMass lea ecx, [ebp-0xa4] mov [esp], ebx movss xmm0, dword [ebp-0x5c] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjSetInertialTensor(int, PhysMass const*) Phys_ObjSetInertialTensor: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x8c mov edi, [ebp+0x8] mov ebx, [ebp+0xc] lea esi, [ebp-0x5c] mov [esp], esi call dMassSetZero mov [esp+0x4], esi mov [esp], edi call dBodyGetMass lea eax, [ebx+0x18] lea edx, [ebx+0xc] movss xmm4, dword [ebp-0x5c] movaps xmm7, xmm4 mulss xmm7, [eax+0x8] movaps xmm0, xmm4 mulss xmm0, [eax+0x4] movss [esp+0x24], xmm0 movaps xmm1, xmm4 mulss xmm1, [ebx+0x18] movss [esp+0x20], xmm1 movss xmm0, dword [edx+0x8] pxor xmm6, xmm6 movss xmm5, dword [_float_100_00000000] movaps xmm3, xmm6 cmpss xmm3, xmm0, 0x1 andps xmm0, xmm3 andnps xmm3, xmm5 orps xmm3, xmm0 mulss xmm3, xmm4 movss xmm0, dword [edx+0x4] movaps xmm2, xmm6 cmpss xmm2, xmm0, 0x1 andps xmm0, xmm2 andnps xmm2, xmm5 orps xmm2, xmm0 mulss xmm2, xmm4 movss xmm1, dword [ebx+0xc] movaps xmm0, xmm6 cmpss xmm0, xmm1, 0x1 andps xmm1, xmm0 andnps xmm0, xmm5 orps xmm0, xmm1 movss [esp+0x28], xmm7 movss [esp+0x1c], xmm3 movss [esp+0x18], xmm2 mulss xmm0, xmm4 movss [esp+0x14], xmm0 movss [esp+0x10], xmm6 movss [esp+0xc], xmm6 movss [esp+0x8], xmm6 movss [esp+0x4], xmm4 mov [esp], esi call dMassSetParameters mov [esp+0x4], esi mov [esp], edi call dBodySetMass mov edx, ebx mov eax, edi call Phys_AdjustForNewCenterOfMass add esp, 0x8c pop ebx pop esi pop edi pop ebp ret ;Phys_SetCollisionCallback(PhysWorld, void (*)()) Phys_SetCollisionCallback: push ebp mov ebp, esp mov eax, [ebp+0x8] lea eax, [eax+eax*2] mov edx, eax shl edx, 0x4 add eax, edx mov edx, [ebp+0xc] mov [eax*4+physGlob+0x18], edx pop ebp ret ;Phys_ObjSetAngularVelocity(int, float const*) Phys_ObjSetAngularVelocity: push ebp mov ebp, esp sub esp, 0x18 mov edx, [ebp+0xc] mov eax, [edx+0x4] mov [esp+0xc], eax mov eax, [edx] mov [esp+0x8], eax mov eax, [edx+0x8] mov [esp+0x4], eax mov eax, [ebp+0x8] mov [esp], eax call dBodySetAngularVel leave ret ;Phys_ObjSetContactCentroid(int, float const*) Phys_ObjSetContactCentroid: push ebp mov ebp, esp push ebx sub esp, 0x14 mov ebx, [ebp+0xc] mov eax, [ebp+0x8] mov [esp], eax call dBodyGetData lea ecx, [eax+0x50] mov edx, [ebx] mov [eax+0x50], edx mov eax, [ebx+0x4] mov [ecx+0x4], eax mov eax, [ebx+0x8] mov [ecx+0x8], eax add esp, 0x14 pop ebx pop ebp ret nop ;Phys_SetAngularMotorParams(PhysWorld, int, float const*, float const*, float const*, float const*) Phys_SetAngularMotorParams: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c mov edi, [ebp+0xc] xor esi, esi mov dword [ebp-0x1c], 0x1 Phys_SetAngularMotorParams_10: mov ebx, [ebp-0x1c] shl ebx, 0x2 mov edx, [ebp+0x18] mov eax, [edx+ebx-0x4] mov [esp+0x8], eax mov [esp+0x4], esi mov [esp], edi call dJointSetAMotorParam mov edx, [ebp+0x1c] mov eax, [edx+ebx-0x4] mov [esp+0x8], eax lea eax, [esi+0x1] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov edx, [ebp+0x10] mov eax, [edx+ebx-0x4] mov [esp+0x8], eax lea eax, [esi+0x2] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov edx, [ebp+0x14] mov eax, [edx+ebx-0x4] mov [esp+0x8], eax lea eax, [esi+0x3] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov dword [esp+0x8], 0x3f666666 lea eax, [esi+0x4] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov eax, [phys_joint_cfm] mov eax, [eax+0xc] mov [esp+0x8], eax lea eax, [esi+0x6] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov eax, [phys_joint_stop_cfm] mov eax, [eax+0xc] mov [esp+0x8], eax lea eax, [esi+0x8] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam mov eax, [phys_joint_stop_erp] mov eax, [eax+0xc] mov [esp+0x8], eax lea eax, [esi+0x7] mov [esp+0x4], eax mov [esp], edi call dJointSetAMotorParam add esi, 0x100 add dword [ebp-0x1c], 0x1 cmp esi, 0x300 jnz Phys_SetAngularMotorParams_10 add esp, 0x2c pop ebx pop esi pop edi pop ebp ret ;Phys_ObjGetInterpolatedState(PhysWorld, int, float*, float*) Phys_ObjGetInterpolatedState: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xdc mov edi, [ebp+0x8] lea edi, [edi+edi*2] mov eax, edi shl eax, 0x4 add edi, eax lea edi, [edi*4+physGlob] mov eax, [ebp+0xc] mov [esp], eax call dBodyGetData mov esi, eax lea ebx, [eax+0x1c] lea eax, [eax+0x10] mov [ebp-0x9c], eax mov eax, [ebp+0xc] mov [esp], eax call dBodyGetData lea edx, [ebp-0x30] mov [esp+0x8], edx mov [esp+0x4], eax mov [esp], ebx call AxisTransformVec3 movss xmm2, dword [ebp-0x30] addss xmm2, [esi+0x10] movss xmm3, dword [ebp-0x2c] mov eax, [ebp-0x9c] addss xmm3, [eax+0x4] movss xmm4, dword [ebp-0x28] addss xmm4, [eax+0x8] mov eax, [esi+0x1c] mov [ebp-0x74], eax mov eax, [ebx+0x4] mov [ebp-0x70], eax mov eax, [ebx+0x8] mov [ebp-0x6c], eax mov eax, [ebx+0xc] mov [ebp-0x68], eax mov eax, [ebx+0x10] mov [ebp-0x64], eax mov eax, [ebx+0x14] mov [ebp-0x60], eax mov eax, [ebx+0x18] mov [ebp-0x5c], eax mov eax, [ebx+0x1c] mov [ebp-0x58], eax mov eax, [ebx+0x20] mov [ebp-0x54], eax lea eax, [ebp-0x98] mov [esp+0x8], eax lea eax, [ebp-0x24] mov [esp+0x4], eax mov eax, [ebp+0xc] mov [esp], eax movss [ebp-0xb8], xmm2 movss [ebp-0xc8], xmm3 movss [ebp-0xd8], xmm4 call Phys_ObjGetPosition movss xmm1, dword [edi+0x14] movss xmm0, dword [ebp-0x24] movss xmm2, dword [ebp-0xb8] subss xmm0, xmm2 mulss xmm0, xmm1 addss xmm2, xmm0 mov eax, [ebp+0x10] movss [eax], xmm2 movss xmm0, dword [ebp-0x20] movss xmm3, dword [ebp-0xc8] subss xmm0, xmm3 mulss xmm0, xmm1 addss xmm3, xmm0 movss [eax+0x4], xmm3 movss xmm0, dword [ebp-0x1c] movss xmm4, dword [ebp-0xd8] subss xmm0, xmm4 mulss xmm1, xmm0 addss xmm4, xmm1 movss [eax+0x8], xmm4 lea esi, [ebp-0x40] mov [esp+0x4], esi lea eax, [ebp-0x74] mov [esp], eax call AxisToQuat lea ebx, [ebp-0x50] mov [esp+0x4], ebx lea eax, [ebp-0x98] mov [esp], eax call AxisToQuat mov eax, [ebp+0x14] mov [esp+0xc], eax mov eax, [edi+0x14] mov [esp+0x8], eax mov [esp+0x4], ebx mov [esp], esi call QuatLerp mov eax, [ebp+0x14] mov [esp], eax call Vec4Normalize fstp st0 add esp, 0xdc pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjSetAngularVelocityRaw(int, float const*) Phys_ObjSetAngularVelocityRaw: push ebp mov ebp, esp sub esp, 0x18 mov edx, [ebp+0xc] mov eax, [edx+0x8] mov [esp+0xc], eax mov eax, [edx+0x4] mov [esp+0x8], eax mov eax, [edx] mov [esp+0x4], eax mov eax, [ebp+0x8] mov [esp], eax call dBodySetAngularVel leave ret ;Phys_GeomUserGetAAContainedBox(dxGeom*, float*, float*) Phys_GeomUserGetAAContainedBox: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x1c mov ebx, [ebp+0x8] mov esi, [ebp+0xc] mov edi, [ebp+0x10] mov [esp], ebx call dGeomGetClass cmp eax, 0xc jz Phys_GeomUserGetAAContainedBox_10 jle Phys_GeomUserGetAAContainedBox_20 cmp eax, 0xd jz Phys_GeomUserGetAAContainedBox_30 cmp eax, 0xe jnz Phys_GeomUserGetAAContainedBox_40 mov [esp], ebx call dGeomGetClassData movss xmm0, dword [eax+0x4] movaps xmm1, xmm0 mulss xmm1, [_float_0_70710677] addss xmm0, xmm0 addss xmm0, [eax+0x8] minss xmm0, xmm1 movaps xmm1, xmm0 xorps xmm0, [circleCoords.131667+0xe0] movss [esi], xmm0 movss [esi+0x4], xmm0 movss [esi+0x8], xmm0 movss [edi], xmm1 movss [edi+0x4], xmm1 movss [edi+0x8], xmm1 jmp Phys_GeomUserGetAAContainedBox_40 Phys_GeomUserGetAAContainedBox_20: cmp eax, 0xb jz Phys_GeomUserGetAAContainedBox_50 Phys_GeomUserGetAAContainedBox_40: add esp, 0x1c pop ebx pop esi pop edi pop ebp ret Phys_GeomUserGetAAContainedBox_10: mov [esp], ebx call dGeomGetClassData mov eax, [eax] movss xmm0, dword [_float_0_01000000] movss xmm1, dword [eax] mulss xmm1, xmm0 movss [esi], xmm1 movss xmm1, dword [eax+0x4] mulss xmm1, xmm0 movss [esi+0x4], xmm1 movss xmm1, dword [eax+0x8] mulss xmm1, xmm0 movss [esi+0x8], xmm1 lea edx, [eax+0x10] movss xmm1, dword [eax+0x10] Phys_GeomUserGetAAContainedBox_60: mulss xmm1, xmm0 movss [edi], xmm1 movss xmm1, dword [edx+0x4] mulss xmm1, xmm0 movss [edi+0x4], xmm1 mulss xmm0, [edx+0x8] movss [edi+0x8], xmm0 mov [ebp+0xc], edi mov [ebp+0x8], esi add esp, 0x1c pop ebx pop esi pop edi pop ebp jmp ShrinkBoundsToHeight Phys_GeomUserGetAAContainedBox_30: mov [esp], ebx call dGeomGetClassData movss xmm0, dword [_float_0_70710677] mulss xmm0, [eax+0x4] movss xmm1, dword [eax+0x8] minss xmm1, xmm0 movaps xmm0, xmm1 xorps xmm1, [circleCoords.131667+0xe0] movss [esi], xmm1 movss [esi+0x4], xmm1 movss [esi+0x8], xmm1 movss [edi], xmm0 movss [edi+0x4], xmm0 movss [edi+0x8], xmm0 add esp, 0x1c pop ebx pop esi pop edi pop ebp ret Phys_GeomUserGetAAContainedBox_50: mov [esp], ebx call dGeomGetClassData movzx eax, word [eax] mov [esp], eax call CM_ClipHandleToModel movss xmm0, dword [_float_0_01000000] movss xmm1, dword [eax] mulss xmm1, xmm0 movss [esi], xmm1 movss xmm1, dword [eax+0x4] mulss xmm1, xmm0 movss [esi+0x4], xmm1 movss xmm1, dword [eax+0x8] mulss xmm1, xmm0 movss [esi+0x8], xmm1 lea edx, [eax+0xc] movss xmm1, dword [eax+0xc] jmp Phys_GeomUserGetAAContainedBox_60 nop ;Phys_ObjAddGeomCylinderRotated(PhysWorld, int, int, float, float, float const*, float const (*) [3]) Phys_ObjAddGeomCylinderRotated: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0xac mov edi, [ebp+0xc] mov ebx, [ebp+0x20] lea esi, [ebp-0x5c] mov [esp], esi call dMassSetZero mov dword [ebp-0xa4], 0x4 mov eax, [ebp+0x10] add eax, 0x1 mov [ebp-0x78], eax mov eax, [ebp+0x14] mov [ebp-0x74], eax mov eax, [ebp+0x18] mov [ebp-0x70], eax mov byte [ebp-0xa0], 0x1 mov eax, [ebx] mov [ebp-0x9c], eax mov eax, [ebx+0x4] mov [ebp-0x98], eax mov eax, [ebx+0x8] mov [ebp-0x94], eax lea edx, [ebx+0xc] mov eax, [ebx+0xc] mov [ebp-0x90], eax mov eax, [edx+0x4] mov [ebp-0x8c], eax mov eax, [edx+0x8] mov [ebp-0x88], eax lea edx, [ebx+0x18] mov eax, [ebx+0x18] mov [ebp-0x84], eax mov eax, [edx+0x4] mov [ebp-0x80], eax mov eax, [edx+0x8] mov [ebp-0x7c], eax mov [esp+0x4], esi mov [esp], edi call dBodyGetMass mov eax, [ebp+0x1c] mov [esp], eax lea ecx, [ebp-0xa4] movss xmm0, dword [ebp-0x5c] mov edx, edi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xac pop ebx pop esi pop edi pop ebp ret nop ;Phys_ObjSetCollisionFromXModel(XModel const*, PhysWorld, int) Phys_ObjSetCollisionFromXModel: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x5c mov eax, [ebp+0x8] mov esi, [eax+0xd8] test esi, esi jz Phys_ObjSetCollisionFromXModel_10 mov ebx, [esi+0x4] mov edi, [esi] test edi, edi jz Phys_ObjSetCollisionFromXModel_20 xor edi, edi lea eax, [esi+0x8] mov [ebp-0x3c], eax jmp Phys_ObjSetCollisionFromXModel_30 Phys_ObjSetCollisionFromXModel_50: mov edx, [ebp-0x3c] mov [esp+0xc], edx mov [esp+0x8], eax mov eax, [ebp+0x10] mov [esp+0x4], eax mov edx, [ebp+0xc] mov [esp], edx call Phys_ObjAddGeomBrush Phys_ObjSetCollisionFromXModel_80: add edi, 0x1 add ebx, 0x44 cmp [esi], edi jbe Phys_ObjSetCollisionFromXModel_40 Phys_ObjSetCollisionFromXModel_30: mov eax, [ebx] test eax, eax jnz Phys_ObjSetCollisionFromXModel_50 cmp dword [ebx+0x4], 0x1 jz Phys_ObjSetCollisionFromXModel_60 lea eax, [ebx+0x8] mov [esp+0x18], eax lea eax, [ebx+0x2c] mov [esp+0x14], eax mov eax, [ebx+0x38] mov [esp+0x10], eax mov eax, [ebx+0x3c] mov [esp+0xc], eax mov dword [esp+0x8], 0x0 mov eax, [ebp+0x10] mov [esp+0x4], eax mov edx, [ebp+0xc] mov [esp], edx call Phys_ObjAddGeomCylinderRotated add edi, 0x1 add ebx, 0x44 cmp [esi], edi ja Phys_ObjSetCollisionFromXModel_30 Phys_ObjSetCollisionFromXModel_40: mov eax, [ebp-0x3c] jmp Phys_ObjSetCollisionFromXModel_70 Phys_ObjSetCollisionFromXModel_20: add esi, 0x8 mov [ebp-0x3c], esi mov eax, esi Phys_ObjSetCollisionFromXModel_70: mov [esp+0x4], eax mov edx, [ebp+0x10] mov [esp], edx call Phys_ObjSetInertialTensor Phys_ObjSetCollisionFromXModel_130: add esp, 0x5c pop ebx pop esi pop edi pop ebp ret Phys_ObjSetCollisionFromXModel_60: lea eax, [ebx+0x8] mov [esp+0x10], eax lea eax, [ebx+0x38] mov [esp+0xc], eax lea eax, [ebx+0x2c] mov [esp+0x8], eax mov eax, [ebp+0x10] mov [esp+0x4], eax mov edx, [ebp+0xc] mov [esp], edx call Phys_ObjAddGeomBoxRotated jmp Phys_ObjSetCollisionFromXModel_80 Phys_ObjSetCollisionFromXModel_10: lea esi, [ebp-0x30] mov [esp+0x8], esi lea ebx, [ebp-0x24] mov [esp+0x4], ebx mov [esp], eax call XModelGetBounds movss xmm0, dword [ebp-0x24] ucomiss xmm0, [ebp-0x30] jp Phys_ObjSetCollisionFromXModel_90 jz Phys_ObjSetCollisionFromXModel_100 Phys_ObjSetCollisionFromXModel_90: movss xmm0, dword [ebp-0x20] ucomiss xmm0, [ebp-0x2c] jp Phys_ObjSetCollisionFromXModel_110 jz Phys_ObjSetCollisionFromXModel_100 Phys_ObjSetCollisionFromXModel_110: movss xmm0, dword [ebp-0x1c] ucomiss xmm0, [ebp-0x28] jnz Phys_ObjSetCollisionFromXModel_120 jp Phys_ObjSetCollisionFromXModel_120 Phys_ObjSetCollisionFromXModel_100: mov eax, 0xc2480000 mov [ebp-0x24], eax mov [ebp-0x20], eax mov [ebp-0x1c], eax mov eax, 0x42480000 mov [ebp-0x30], eax mov [ebp-0x2c], eax mov [ebp-0x28], eax Phys_ObjSetCollisionFromXModel_120: mov [esp+0xc], esi mov [esp+0x8], ebx mov eax, [ebp+0x10] mov [esp+0x4], eax mov edx, [ebp+0xc] mov [esp], edx call Phys_ObjAddGeomBox jmp Phys_ObjSetCollisionFromXModel_130 ;Phys_ObjAddGeomCylinderDirection(PhysWorld, int, int, float, float, float const*) Phys_ObjAddGeomCylinderDirection: push ebp mov ebp, esp push esi push ebx sub esp, 0xa0 mov esi, [ebp+0xc] lea ebx, [ebp-0x4c] mov [esp], ebx call dMassSetZero mov dword [ebp-0x94], 0x4 mov eax, [ebp+0x10] add eax, 0x1 mov [ebp-0x68], eax mov eax, [ebp+0x14] mov [ebp-0x64], eax mov eax, [ebp+0x18] mov [ebp-0x60], eax mov byte [ebp-0x90], 0x0 mov [esp+0x4], ebx mov [esp], esi call dBodyGetMass lea ecx, [ebp-0x94] mov eax, [ebp+0x1c] mov [esp], eax movss xmm0, dword [ebp-0x4c] mov edx, esi mov eax, [ebp+0x8] call Phys_BodyAddGeomAndSetMass add esp, 0xa0 pop ebx pop esi pop ebp ret ;Phys_Init() Phys_Init: push ebp mov ebp, esp push edi push esi push ebx sub esp, 0x2c cmp byte [physInited], 0x0 jz Phys_Init_10 add esp, 0x2c pop ebx pop esi pop edi pop ebp ret Phys_Init_10: mov dword [esp+0x8], 0x23cd0 mov dword [esp+0x4], 0x0 mov dword [esp], physGlob call memset mov dword [esp+0xc], 0x200 mov dword [esp+0x8], 0x5c mov dword [esp+0x4], physGlob+0xba88 mov dword [esp], physGlob+0x288 call Pool_Init call ODE_Init xor esi, esi mov edi, physGlob mov ebx, physGlob+0x270 Phys_Init_20: mov [esp], esi call dWorldCreate mov [ebx-0x270], eax mov dword [edi+0xc], 0x0 mov dword [edi+0x10], 0x0 mov [esp], esi call dGetSimpleSpace mov [ebx], eax mov [esp], esi call dGetContactJointGroup mov [ebx+0xc], eax mov dword [esp+0x4], 0x1 mov eax, [ebx-0x270] mov [esp], eax call dWorldSetAutoDisableFlag mov dword [esp+0x4], 0x0 mov eax, [ebx-0x270] mov [esp], eax call dWorldSetAutoDisableSteps mov dword [edi+0x18], 0x0 add esi, 0x1 add edi, 0xcc add ebx, 0x4 cmp esi, 0x3 jnz Phys_Init_20 mov byte [physGlob+0xbaa8], 0x0 mov dword [esp+0x14], _cstring_physics_constrai mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 xor esi, esi mov [esp+0x8], esi mov dword [esp+0x4], 0x38d1b717 mov dword [esp], _cstring_phys_cfm call Cvar_RegisterFloat mov [phys_cfm], eax mov dword [esp+0x14], _cstring_physics_error_re mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3f4ccccd mov dword [esp], _cstring_phys_erp call Cvar_RegisterFloat mov [phys_erp], eax mov dword [esp+0x14], _cstring_physics_maximum_ mov dword [esp+0x10], 0x0 mov edi, 0x7f7fffff mov [esp+0xc], edi mov ebx, 0xff7fffff mov [esp+0x8], ebx mov dword [esp+0x4], 0x41a00000 mov dword [esp], _cstring_phys_mcv call Cvar_RegisterFloat mov [phys_mcv], eax mov dword [esp+0x14], _cstring_physics_maximum_1 mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], ebx mov dword [esp+0x4], 0x447a0000 mov dword [esp], _cstring_phys_mcv_ragdoll call Cvar_RegisterFloat mov [phys_mcv_ragdoll], eax mov dword [esp+0x14], _cstring_physics_contact_ mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], ebx mov dword [esp+0x4], 0x3f800000 mov dword [esp], _cstring_phys_csl call Cvar_RegisterFloat mov [phys_csl], eax mov dword [esp+0x14], _cstring_physics_gravity_ mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], ebx mov dword [esp+0x4], 0xc4480000 mov dword [esp], _cstring_phys_gravity call Cvar_RegisterFloat mov [phys_gravity], eax mov dword [esp+0x14], _cstring_up_bias_for_the_ mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x40000000 mov [esp+0x8], esi mov ebx, 0x3f000000 mov [esp+0x4], ebx mov dword [esp], _cstring_phys_bulletupbia call Cvar_RegisterFloat mov [phys_bulletUpBias], eax mov dword [esp+0x14], _cstring_scale_of_the_eff mov dword [esp+0x10], 0x1000 mov dword [esp+0xc], 0x42c80000 mov dword [esp+0x8], 0xbf800000 mov dword [esp+0x4], 0x40400000 mov dword [esp], _cstring_phys_bulletspins call Cvar_RegisterFloat mov [phys_bulletSpinScale], eax mov dword [esp+0xc], _cstring_set_to_true_to_d mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_dumpcontact call Cvar_RegisterBool mov [phys_dumpcontacts], eax mov dword [esp+0x14], _cstring_number_of_iterat mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x7fffffff mov dword [esp+0x8], 0x1 mov dword [esp+0x4], 0xf mov dword [esp], _cstring_phys_qsi call Cvar_RegisterInt mov [phys_qsi], eax mov dword [esp+0xc], _cstring_debug_draw_conta mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawcontact call Cvar_RegisterBool mov [phys_drawcontacts], eax mov dword [esp+0xc], _cstring_debug_draw_colli mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawcollisi call Cvar_RegisterBool mov [phys_drawCollisionWorld], eax mov dword [esp+0xc], _cstring_debug_draw_colli1 mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawcollisi1 call Cvar_RegisterBool mov [phys_drawCollisionObj], eax mov dword [esp+0xc], _cstring_debug_draw_a_box mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawawake call Cvar_RegisterBool mov [phys_drawAwake], eax mov dword [esp+0xc], _cstring_draw_an_indicato mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawawaketo call Cvar_RegisterBool mov [phys_drawAwakeTooLong], eax mov dword [esp+0xc], _cstring_print_info_about mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_drawdebugin call Cvar_RegisterBool mov [phys_drawDebugInfo], eax mov dword [esp+0xc], _cstring_visible_triangle mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_visibletris call Cvar_RegisterBool mov [phys_visibleTris], eax mov dword [esp+0xc], _cstring_ode_solver_reord mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x1 mov dword [esp], _cstring_phys_reordercons call Cvar_RegisterBool mov [phys_reorderConst], eax mov dword [esp+0xc], _cstring_make_all_contact mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_noislands call Cvar_RegisterBool mov [phys_noIslands], eax mov dword [esp+0xc], _cstring_disable_to_turn_ mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_interbodyco call Cvar_RegisterBool mov [phys_interBodyCollision], eax mov dword [esp+0xc], _cstring_disable_to_turn_1 mov dword [esp+0x8], 0x0 mov dword [esp+0x4], 0x0 mov dword [esp], _cstring_phys_colluseenti call Cvar_RegisterBool mov [phys_collUseEntities], eax mov dword [esp+0x14], _cstring_a_body_must_have mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x41a00000 mov dword [esp], _cstring_phys_autodisable call Cvar_RegisterFloat mov [phys_autoDisableLinear], eax mov dword [esp+0x14], _cstring_a_body_must_have1 mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x3f800000 mov dword [esp], _cstring_phys_autodisable1 call Cvar_RegisterFloat mov [phys_autoDisableAngular], eax mov dword [esp+0x14], _cstring_the_amount_of_ti mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x3f666666 mov dword [esp], _cstring_phys_autodisable2 call Cvar_RegisterFloat mov [phys_autoDisableTime], eax mov dword [esp+0x14], _cstring_physics_constrai1 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3727c5ac mov dword [esp], _cstring_phys_contact_cfm call Cvar_RegisterFloat mov [phys_contact_cfm], eax mov dword [esp+0x14], _cstring_physics_error_re1 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3f4ccccd mov dword [esp], _cstring_phys_contact_erp call Cvar_RegisterFloat mov [phys_contact_erp], eax mov dword [esp+0x14], _cstring_physics_constrai1 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3a83126f mov dword [esp], _cstring_phys_contact_cfm1 call Cvar_RegisterFloat mov [phys_contact_cfm_ragdoll], eax mov dword [esp+0x14], _cstring_physics_error_re1 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3e99999a mov dword [esp], _cstring_phys_contact_erp1 call Cvar_RegisterFloat mov [phys_contact_erp_ragdoll], eax mov dword [esp+0x14], _cstring_physics_constrai2 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x38d1b717 mov dword [esp], _cstring_phys_joint_cfm call Cvar_RegisterFloat mov [phys_joint_cfm], eax mov dword [esp+0x14], _cstring_physics_constrai3 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x38d1b717 mov dword [esp], _cstring_phys_joint_stop_ call Cvar_RegisterFloat mov [phys_joint_stop_cfm], eax mov dword [esp+0x14], _cstring_physics_error_re2 mov dword [esp+0x10], 0x0 mov dword [esp+0xc], 0x3f800000 mov [esp+0x8], esi mov dword [esp+0x4], 0x3f4ccccd mov dword [esp], _cstring_phys_joint_stop_1 call Cvar_RegisterFloat mov [phys_joint_stop_erp], eax mov dword [esp+0x14], _cstring_scales_the_amoun mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x3f800000 mov dword [esp], _cstring_phys_frictionsca call Cvar_RegisterFloat mov [phys_frictionScale], eax mov dword [esp+0x14], _cstring_the_amount_of_li mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x3cf5c28f mov dword [esp], _cstring_phys_draglinear call Cvar_RegisterFloat mov [phys_dragLinear], eax mov dword [esp+0x14], _cstring_the_amount_of_an mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov [esp+0x4], ebx mov dword [esp], _cstring_phys_dragangular call Cvar_RegisterFloat mov [phys_dragAngular], eax mov dword [esp+0x14], _cstring_the_minimum_mome mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x437a0000 mov dword [esp], _cstring_phys_minimpactmo call Cvar_RegisterFloat mov [phys_minImpactMomentum], eax mov dword [esp+0x14], _cstring_maximum_mass_to_ mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov dword [esp+0x8], 0x3dcccccd mov dword [esp+0x4], 0x43480000 mov dword [esp], _cstring_phys_jittermaxma call Cvar_RegisterFloat mov [phys_jitterMaxMass], eax mov dword [esp+0x14], _cstring_the_radius_aroun mov dword [esp+0x10], 0x1000 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x42f00000 mov dword [esp], _cstring_phys_gravitychan call Cvar_RegisterFloat mov [phys_gravityChangeWakeupRadius], eax mov dword [esp+0x14], _cstring_if_a_geom_has_a_ mov dword [esp+0x10], 0x0 mov [esp+0xc], edi mov [esp+0x8], esi mov dword [esp+0x4], 0x40800000 mov dword [esp], _cstring_phys_narrowobjma call Cvar_RegisterFloat mov [phys_narrowObjMaxLength], eax mov dword [esp+0x8], _ZZ9Phys_InitvE15Phys_Stop_f_VAR mov dword [esp+0x4], Phys_Stop_f mov dword [esp], _cstring_phys_stop call Cmd_AddCommand mov dword [esp+0x8], _ZZ9Phys_InitvE13Phys_Go_f_VAR mov dword [esp+0x4], Phys_Go_f mov dword [esp], _cstring_phys_go call Cmd_AddCommand call Phys_InitBrushmodelGeomClass call Phys_InitBrushGeomClass call Phys_InitCylinderGeomClass call Phys_InitCapsuleGeomClass call Phys_InitWorldCollision call Phys_InitJoints mov [physGlob+0x23cc4], esi mov [physGlob+0x23cc8], esi mov dword [physGlob+0x23ccc], 0xbf800000 mov byte [physInited], 0x1 add esp, 0x2c pop ebx pop esi pop edi pop ebp ret nop ;Zero initialized global or static variables of phys_ode: SECTION .bss physInited: resb 0x4 _ZZ9Phys_InitvE13Phys_Go_f_VAR: resb 0x14 _ZZ9Phys_InitvE15Phys_Stop_f_VAR: resb 0x68 phys_drawDebugInfo: resb 0x4 phys_gravityChangeWakeupRadius: resb 0x4 phys_drawCollisionObj: resb 0x4 phys_drawCollisionWorld: resb 0x4 physGlob: resb 0x23cd0 phys_contact_cfm: resb 0x4 phys_contact_erp: resb 0x4 phys_drawcontacts: resb 0x4 phys_jitterMaxMass: resb 0x4 phys_noIslands: resb 0x4 phys_autoDisableAngular: resb 0x4 phys_autoDisableLinear: resb 0x4 phys_autoDisableTime: resb 0x4 phys_bulletSpinScale: resb 0x4 phys_bulletUpBias: resb 0x4 phys_cfm: resb 0x1c phys_collUseEntities: resb 0x4 phys_contact_cfm_ragdoll: resb 0x4 phys_contact_erp_ragdoll: resb 0x4 phys_csl: resb 0x4 phys_dragAngular: resb 0x4 phys_dragLinear: resb 0x4 phys_drawAwake: resb 0x4 phys_drawAwakeTooLong: resb 0x4 phys_dumpcontacts: resb 0x4 phys_erp: resb 0x4 phys_frictionScale: resb 0x4 phys_gravity: resb 0x4 phys_interBodyCollision: resb 0x4 phys_joint_cfm: resb 0x4 phys_joint_stop_cfm: resb 0x4 phys_joint_stop_erp: resb 0x4 phys_mcv: resb 0x4 phys_mcv_ragdoll: resb 0x4 phys_minImpactMomentum: resb 0x4 phys_narrowObjMaxLength: resb 0x4 phys_qsi: resb 0x4 phys_reorderConst: resb 0x4 phys_visibleTris: resb 0x4 ;Initialized global or static variables of phys_ode: SECTION .data g_phys_maxMsecStep: dd 0x43, 0x43, 0x22 g_phys_minMsecStep: dd 0x11, 0x11, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 g_phys_msecStep: dd 0x11, 0x11, 0x11 ;Initialized constant data of phys_ode: SECTION .rdata ;All cstrings: SECTION .rdata _cstring____awake_i: db " Awake: %i",0 _cstring____asleep_i: db " Asleep: %i",0 _cstring_maximum_number_o: db "Maximum number of physics geoms exceeded",0ah,0 _cstring_maximum_number_o1: db "Maximum number of physics bodies exceeded (more than %i)",0ah,0 _cstring_phys_stop: db "phys_stop",0 _cstring_phys_go: db "phys_go",0 _cstring_phys_runtotime: db "Phys_RunToTime",0 _cstring_physics_out_of_h: db "Physics: Out of hinge joints (%d max)",0ah,0 _cstring_dynent_objects: db "Dynent Objects",0 _cstring_fx_objects: db "Fx Objects",0 _cstring_ragdoll_objects: db "Ragdoll Objects",0 _cstring_total_objects_aw: db "Total Objects Awake: %i",0 _cstring_physics_out_of_a: db "Physics: Out of angular motor joints (%d max)",0ah,0 _cstring_physics_out_of_b: db "Physics: Out of ball and socket joints (%d max)",0ah,0 _cstring_physics_constrai: db "Physics constraint force mixing magic parameter.",0 _cstring_phys_cfm: db "phys_cfm",0 _cstring_physics_error_re: db "Physics error reduction magic parameter.",0 _cstring_phys_erp: db "phys_erp",0 _cstring_physics_maximum_: db "Physics maximum correcting velocity magic parameter.",0 _cstring_phys_mcv: db "phys_mcv",0 _cstring_physics_maximum_1: db "Physics maximum correcting velocity magic parameter (for ragdoll).",0 _cstring_phys_mcv_ragdoll: db "phys_mcv_ragdoll",0 _cstring_physics_contact_: db "Physics contact surface level magic parameter.",0 _cstring_phys_csl: db "phys_csl",0 _cstring_physics_gravity_: db "Physics gravity in units/sec^2.",0 _cstring_phys_gravity: db "phys_gravity",0 _cstring_up_bias_for_the_: db "Up Bias for the direction of the bullet impact.",0 _cstring_phys_bulletupbia: db "phys_bulletUpBias",0 _cstring_scale_of_the_eff: db "Scale of the effective offset from the center of mass for the bullet impacts.",0 _cstring_phys_bulletspins: db "phys_bulletSpinScale",0 _cstring_set_to_true_to_d: db "Set to true to dump all constraints in next physics frame.",0 _cstring_phys_dumpcontact: db "phys_dumpcontacts",0 _cstring_number_of_iterat: db "Number of iterations that QuickStep performs per step.",0 _cstring_phys_qsi: db "phys_qsi",0 _cstring_debug_draw_conta: db "Debug draw contact points",0 _cstring_phys_drawcontact: db "phys_drawcontacts",0 _cstring_debug_draw_colli: db "Debug draw collision brushes and terrain triangles",0 _cstring_phys_drawcollisi: db "phys_drawCollisionWorld",0 _cstring_debug_draw_colli1: db "Debug draw collision geometry for each physics object",0 _cstring_phys_drawcollisi1: db "phys_drawCollisionObj",0 _cstring_debug_draw_a_box: db "Debug draw a box indicating which bodies are disabled",0 _cstring_phys_drawawake: db "phys_drawAwake",0 _cstring_draw_an_indicato: db "Draw an indicator showing where the objects are that have been awake too long.",0 _cstring_phys_drawawaketo: db "phys_drawAwakeTooLong",0 _cstring_print_info_about: db "Print info about the physics objects",0 _cstring_phys_drawdebugin: db "phys_drawDebugInfo",0 _cstring_visible_triangle: db "Visible triangles are used for collision",0 _cstring_phys_visibletris: db "phys_visibleTris",0 _cstring_ode_solver_reord: db "ODE solver reorder constraints",0 _cstring_phys_reordercons: db "phys_reorderConst",0 _cstring_make_all_contact: db "Make all contacts joints between an object and the world: no object-object contacts",0 _cstring_phys_noislands: db "phys_noIslands",0 _cstring_disable_to_turn_: db "Disable to turn off all inter-body collisions",0 _cstring_phys_interbodyco: db "phys_interBodyCollision",0 _cstring_disable_to_turn_1: db "Disable to turn off testing for collision against entities",0 _cstring_phys_colluseenti: db "phys_collUseEntities",0 _cstring_a_body_must_have: db "A body must have linear velocity less than this to be considered idle.",0 _cstring_phys_autodisable: db "phys_autoDisableLinear",0 _cstring_a_body_must_have1: db "A body must have angular velocity less than this to be considered idle.",0 _cstring_phys_autodisable1: db "phys_autoDisableAngular",0 _cstring_the_amount_of_ti: db "The amount of time a body must be idle for it to go to sleep.",0 _cstring_phys_autodisable2: db "phys_autoDisableTime",0 _cstring_physics_constrai1: db "Physics constraint force mixing magic parameter for contacts.",0 _cstring_phys_contact_cfm: db "phys_contact_cfm",0 _cstring_physics_error_re1: db "Physics error reduction magic parameter for contacts.",0 _cstring_phys_contact_erp: db "phys_contact_erp",0 _cstring_phys_contact_cfm1: db "phys_contact_cfm_ragdoll",0 _cstring_phys_contact_erp1: db "phys_contact_erp_ragdoll",0 _cstring_physics_constrai2: db "Physics constraint force mixing magic parameter for joints.",0 _cstring_phys_joint_cfm: db "phys_joint_cfm",0 _cstring_physics_constrai3: db "Physics constraint force mixing magic parameter for joints at their limits.",0 _cstring_phys_joint_stop_: db "phys_joint_stop_cfm",0 _cstring_physics_error_re2: db "Physics error reduction magic parameter for joints at their limits.",0 _cstring_phys_joint_stop_1: db "phys_joint_stop_erp",0 _cstring_scales_the_amoun: db "Scales the amount of physics friction globally.",0 _cstring_phys_frictionsca: db "phys_frictionScale",0 _cstring_the_amount_of_li: db "The amount of linear drag, applied globally",0 _cstring_phys_draglinear: db "phys_dragLinear",0 _cstring_the_amount_of_an: db "The amount of angular drag, applied globally",0 _cstring_phys_dragangular: db "phys_dragAngular",0 _cstring_the_minimum_mome: db "The minimum momentum required to trigger impact sounds",0 _cstring_phys_minimpactmo: db "phys_minImpactMomentum",0 _cstring_maximum_mass_to_: db "Maximum mass to jitter - jitter will fall off up to this mass",0 _cstring_phys_jittermaxma: db "phys_jitterMaxMass",0 _cstring_the_radius_aroun: db "The radius around the player within which objects get awakened when gravity changes",0 _cstring_phys_gravitychan: db "phys_gravityChangeWakeupRadius",0 _cstring_if_a_geom_has_a_: db "If a geom has a dimension less than this, then extra work will be done to prevent it from falling into cracks (like between the wall and the floor)",0 _cstring_phys_narrowobjma: db "phys_narrowObjMaxLength",0 ;All constant floats and doubles: SECTION .rdata _float_1_00000000: dd 0x3f800000 ; 1 _float_0_00100000: dd 0x3a83126f ; 0.001 _float_0_20000000: dd 0x3e4ccccd ; 0.2 _float__2_00000000: dd 0xc0000000 ; -2 _float_0_00000000: dd 0x0 ; 0 _float__0_00100000: dd 0xba83126f ; -0.001 _float_0_50000000: dd 0x3f000000 ; 0.5 _float_1_50000000: dd 0x3fc00000 ; 1.5 _float__0_50000000: dd 0xbf000000 ; -0.5 _float_100_00000000: dd 0x42c80000 ; 100 _float_1000_00000000: dd 0x447a0000 ; 1000 _float_12_00000000: dd 0x41400000 ; 12 _float_18_00000000: dd 0x41900000 ; 18 _float__0_01000000: dd 0xbc23d70a ; -0.01 _float_0_70710677: dd 0x3f3504f3 ; 0.707107 _float_0_01000000: dd 0x3c23d70a ; 0.01 "
"D4edalus/CoD4x1.8_Server_Pub"
"src/asmsource/_phys_ode.asm"
"Assembly"
"agpl-3.0"
119,736
"; 7zAsm.asm -- ASM macros ; 2012-12-30 : Igor Pavlov : Public domain MY_ASM_START macro ifdef x64 .code else .386 .model flat _TEXT$00 SEGMENT PARA PUBLIC 'CODE' endif endm MY_PROC macro name:req, numParams:req align 16 proc_numParams = numParams ifdef x64 proc_name equ name else proc_name equ @CatStr(@,name,@, %numParams * 4) endif proc_name PROC endm MY_ENDP macro ifdef x64 ret else if proc_numParams LT 3 ret else ret (proc_numParams - 2) * 4 endif endif proc_name ENDP endm ifdef x64 REG_SIZE equ 8 REG_LOGAR_SIZE equ 3 else REG_SIZE equ 4 REG_LOGAR_SIZE equ 2 endif x0 equ EAX x1 equ ECX x2 equ EDX x3 equ EBX x4 equ ESP x5 equ EBP x6 equ ESI x7 equ EDI x0_L equ AL x1_L equ CL x2_L equ DL x3_L equ BL x0_H equ AH x1_H equ CH x2_H equ DH x3_H equ BH ifdef x64 r0 equ RAX r1 equ RCX r2 equ RDX r3 equ RBX r4 equ RSP r5 equ RBP r6 equ RSI r7 equ RDI x8 equ r8d x9 equ r9d x10 equ r10d x11 equ r11d x12 equ r12d x13 equ r13d x14 equ r14d x15 equ r15d else r0 equ x0 r1 equ x1 r2 equ x2 r3 equ x3 r4 equ x4 r5 equ x5 r6 equ x6 r7 equ x7 endif MY_PUSH_4_REGS macro push r3 push r5 push r6 push r7 endm MY_POP_4_REGS macro pop r7 pop r6 pop r5 pop r3 endm "
"papyrussolution/OpenPapyrus"
"Src/OSF/7z/Asm/x86/7zAsm.asm"
"Assembly"
"agpl-3.0"
1,394
"";Imports of scr_animtree:\n\textern Hunk_AllocAlignInternal\n\textern FindFirstSibling\n\textern Fi"(...TRUNCATED)
"D4edalus/CoD4x1.8_Server_Pub"
"src/asmsource/_scr_animtree.asm"
"Assembly"
"agpl-3.0"
21,873
"" ;; Attempt to generate a few Fibonacci numbers\n\n\n 1 dup \"a\" sym bind out\n "(...TRUNCATED)
"arlaneenalra/insomniac"
"asm/fib.asm"
"Assembly"
"agpl-3.0"
440
""; * Práctica de Sistemas Electrónicos Digitales de la Ingeniería Técnica\r\n; * de Telecomunica"(...TRUNCATED)
"jmerchanm/PIC16F84A"
"Practica SED Completa a 2 Lineas Con Detector RX TX/plantilla.asm"
"Assembly"
"agpl-3.0"
5,282
"";===========================================================================\n; Copyright (c) 20"(...TRUNCATED)
"atrX/CoD4x-Server"
"src/trace_hooks.asm"
"Assembly"
"agpl-3.0"
1,408
"";Imports of g_items:\n\textern BG_GetWeaponDef\n\textern G_rand\n\textern g_entities\n\textern pick"(...TRUNCATED)
"D4edalus/CoD4x1.8_Server_Pub"
"src/asmsource/_g_items.asm"
"Assembly"
"agpl-3.0"
59,989

GitHub Code Dataset

Dataset Description

The GitHub Code dataset consists of 115M code files from GitHub in 32 programming languages with 60 extensions totaling in 1TB of data. The dataset was created from the public GitHub dataset on Google BiqQuery.

How to use it

The GitHub Code dataset is a very large dataset so for most use cases it is recommended to make use of the streaming API of datasets. You can load and iterate through the dataset with the following two lines of code:

from datasets import load_dataset

ds = load_dataset("codeparrot/github-code", streaming=True, split="train")
print(next(iter(ds)))

#OUTPUT:
{
 'code': "import mod189 from './mod189';\nvar value=mod189+1;\nexport default value;\n",
 'repo_name': 'MirekSz/webpack-es6-ts',
 'path': 'app/mods/mod190.js',
 'language': 'JavaScript',
 'license': 'isc',
 'size': 73
}

You can see that besides the code, repo name, and path also the programming language, license, and the size of the file are part of the dataset. You can also filter the dataset for any subset of the 30 included languages (see the full list below) in the dataset. Just pass the list of languages as a list. E.g. if your dream is to build a Codex model for Dockerfiles use the following configuration:

ds = load_dataset("codeparrot/github-code", streaming=True, split="train", languages=["Dockerfile"])
print(next(iter(ds))["code"])

#OUTPUT:
"""\
FROM rockyluke/ubuntu:precise

ENV DEBIAN_FRONTEND="noninteractive" \
    TZ="Europe/Amsterdam"
...
"""

We also have access to the license of the origin repo of a file so we can filter for licenses in the same way we filtered for languages:

ds = load_dataset("codeparrot/github-code", streaming=True, split="train", licenses=["mit", "isc"])

licenses = []
for element in iter(ds).take(10_000):
    licenses.append(element["license"])
print(Counter(licenses))

#OUTPUT:
Counter({'mit': 9896, 'isc': 104})

Naturally, you can also download the full dataset. Note that this will download ~300GB compressed text data and the uncompressed dataset will take up ~1TB of storage:

ds = load_dataset("codeparrot/github-code", split="train")

Data Structure

Data Instances

{
 'code': "import mod189 from './mod189';\nvar value=mod189+1;\nexport default value;\n",
 'repo_name': 'MirekSz/webpack-es6-ts',
 'path': 'app/mods/mod190.js',
 'language': 'JavaScript',
 'license': 'isc',
 'size': 73
}

Data Fields

Field Type Description
code string content of source file
repo_name string name of the GitHub repository
path string path of file in GitHub repository
language string programming language as inferred by extension
license string license of GitHub repository
size int size of source file in bytes

Data Splits

The dataset only contains a train split.

Languages

The dataset contains 30 programming languages with over 60 extensions:

{
    "Assembly": [".asm"],
    "Batchfile": [".bat", ".cmd"],
    "C": [".c", ".h"],
    "C#": [".cs"],
    "C++": [".cpp", ".hpp", ".c++", ".h++", ".cc", ".hh", ".C", ".H"],
    "CMake": [".cmake"],
    "CSS": [".css"],
    "Dockerfile": [".dockerfile", "Dockerfile"],
    "FORTRAN": ['.f90', '.f', '.f03', '.f08', '.f77', '.f95', '.for', '.fpp'],
    "GO": [".go"],
    "Haskell": [".hs"],
    "HTML":[".html"],
    "Java": [".java"],
    "JavaScript": [".js"],
    "Julia": [".jl"],
    "Lua": [".lua"],
    "Makefile": ["Makefile"],
    "Markdown": [".md", ".markdown"],
    "PHP": [".php", ".php3", ".php4", ".php5", ".phps", ".phpt"],
    "Perl": [".pl", ".pm", ".pod", ".perl"],
    "PowerShell": ['.ps1', '.psd1', '.psm1'],
    "Python": [".py"],
    "Ruby": [".rb"],
    "Rust": [".rs"],
    "SQL": [".sql"],
    "Scala": [".scala"],
    "Shell": [".sh", ".bash", ".command", ".zsh"],
    "TypeScript": [".ts", ".tsx"],
    "TeX": [".tex"],
    "Visual Basic": [".vb"]
}

Licenses

Each example is also annotated with the license of the associated repository. There are in total 15 licenses:

[
  'mit',
  'apache-2.0',
  'gpl-3.0',
  'gpl-2.0',
  'bsd-3-clause',
  'agpl-3.0',
  'lgpl-3.0',
  'lgpl-2.1',
  'bsd-2-clause',
  'cc0-1.0',
  'epl-1.0',
  'mpl-2.0',
  'unlicense',
  'isc',
  'artistic-2.0'
 ]

Dataset Statistics

The dataset contains 115M files and the sum of all the source code file sizes is 873 GB (note that the size of the dataset is larger due to the extra fields). A breakdown per language is given in the plot and table below:

dataset-statistics

Language File Count Size (GB)
0 Java 19548190 107.70
1 C 14143113 183.83
2 JavaScript 11839883 87.82
3 HTML 11178557 118.12
4 PHP 11177610 61.41
5 Markdown 8464626 23.09
6 C++ 7380520 87.73
7 Python 7226626 52.03
8 C# 6811652 36.83
9 Ruby 4473331 10.95
10 GO 2265436 19.28
11 TypeScript 1940406 24.59
12 CSS 1734406 22.67
13 Shell 1385648 3.01
14 Scala 835755 3.87
15 Makefile 679430 2.92
16 SQL 656671 5.67
17 Lua 578554 2.81
18 Perl 497949 4.70
19 Dockerfile 366505 0.71
20 Haskell 340623 1.85
21 Rust 322431 2.68
22 TeX 251015 2.15
23 Batchfile 236945 0.70
24 CMake 175282 0.54
25 Visual Basic 155652 1.91
26 FORTRAN 142038 1.62
27 PowerShell 136846 0.69
28 Assembly 82905 0.78
29 Julia 58317 0.29

Dataset Creation

The dataset was created in two steps:

  1. Files of with the extensions given in the list above were retrieved from the GitHub dataset on BigQuery (full query here). The query was executed on Mar 16, 2022, 6:23:39 PM UTC+1.
  2. Files with lines longer than 1000 characters and duplicates (exact duplicates ignoring whitespaces) were dropped (full preprocessing script here).

Considerations for Using the Data

The dataset consists of source code from a wide range of repositories. As such they can potentially include harmful or biased code as well as sensitive information like passwords or usernames.

Releases

You can load any older version of the dataset with the revision argument:

ds = load_dataset("codeparrot/github-code", revision="v1.0")

v1.0

  • Initial release of dataset
  • The query was executed on Feb 14, 2022, 12:03:16 PM UTC+1

v1.1

  • Fix missing Scala/TypeScript
  • Fix deduplication issue with inconsistent Python hash
  • The query was executed on Mar 16, 2022, 6:23:39 PM UTC+1
Downloads last month
4,861
Edit dataset card
Evaluate models HF Leaderboard

Models trained or fine-tuned on codeparrot/github-code

Spaces using codeparrot/github-code