Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2013
1,903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; CCSGameMovement::DecayAimPunchAngle(void)
  2. __text:0010B580 __ZN15CCSGameMovement18DecayAimPunchAngleEv proc near
  3. __text:0010B580                                         ; DATA XREF: __const:00BB649Co
  4. __text:0010B580
  5. __text:0010B580 tickInterval    = dword ptr -44h
  6. __text:0010B580 expDecay        = dword ptr -40h
  7. __text:0010B580 linDecay        = dword ptr -3Ch
  8. __text:0010B580 punchYaw        = dword ptr -38h
  9. __text:0010B580 punchPitch      = dword ptr -34h
  10. __text:0010B580 punchRoll       = dword ptr -30h
  11. __text:0010B580 punchPitchVel   = dword ptr -2Ch
  12. __text:0010B580 punchYawVel     = dword ptr -28h
  13. __text:0010B580 punchRollVel    = dword ptr -24h
  14. __text:0010B580 velDecayExpResult= dword ptr -20h
  15. __text:0010B580 var_1C          = dword ptr -1Ch
  16. __text:0010B580 expDecayResult  = dword ptr -18h
  17. __text:0010B580 var_14          = dword ptr -14h
  18. __text:0010B580 var_10          = dword ptr -10h
  19. __text:0010B580 this            = dword ptr  8
  20. __text:0010B580
  21. __text:0010B580                 push    ebp
  22. __text:0010B581                 mov     ebp, esp
  23. __text:0010B583                 push    ebx
  24. __text:0010B584                 push    edi
  25. __text:0010B585                 push    esi
  26. __text:0010B586                 sub     esp, 4Ch
  27. __text:0010B589                 call    $+5
  28. __text:0010B58E                 pop     edi
  29. __text:0010B58F                 mov     esi, [ebp+this]
  30. __text:0010B592                 mov     eax, [esi+0E5Ch] ; local player
  31. __text:0010B598                 movss   xmm0, dword ptr [eax+1354h] ; Roll Vel
  32. __text:0010B5A0                 movss   [ebp+punchRollVel], xmm0
  33. __text:0010B5A5                 movss   xmm0, dword ptr [eax+1350h] ; Yaw Vel
  34. __text:0010B5AD                 movss   [ebp+punchYawVel], xmm0
  35. __text:0010B5B2                 movss   xmm0, dword ptr [eax+134Ch] ; Pitch Vel
  36. __text:0010B5BA                 movss   [ebp+punchPitchVel], xmm0
  37. __text:0010B5BF                 movss   xmm0, dword ptr [eax+1348h] ; punchRoll
  38. __text:0010B5C7                 movss   xmm1, dword ptr [eax+1340h] ; punchPitch
  39. __text:0010B5CF                 movss   xmm2, dword ptr [eax+1344h] ; punchYaw
  40. __text:0010B5D7                 mov     ecx, ds:(_weapon_recoil_decay2_exp_ptr - 10B58Eh)[edi] ; 18.0f
  41. __text:0010B5DD                 mov     eax, [ecx+1Ch]
  42. __text:0010B5E0                 cmp     eax, ecx
  43. __text:0010B5E2                 jnz     short loc_10B5FA
  44. __text:0010B5E4                 movss   [ebp+punchYaw], xmm2
  45. __text:0010B5E9                 movss   [ebp+punchPitch], xmm1
  46. __text:0010B5EE                 movss   [ebp+punchRoll], xmm0
  47. __text:0010B5F3                 movss   xmm0, dword ptr [ecx+2Ch]
  48. __text:0010B5F8                 jmp     short loc_10B619
  49. __text:0010B5FA ; ---------------------------------------------------------------------------
  50. __text:0010B5FA
  51. __text:0010B5FA loc_10B5FA:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+62j
  52. __text:0010B5FA                 movss   [ebp+punchYaw], xmm2
  53. __text:0010B5FF                 movss   [ebp+punchPitch], xmm1
  54. __text:0010B604                 movss   [ebp+punchRoll], xmm0
  55. __text:0010B609                 mov     ecx, [eax]
  56. __text:0010B60B                 mov     [esp], eax
  57. __text:0010B60E                 call    dword ptr [ecx+3Ch]
  58. __text:0010B611                 fstp    [ebp+var_10]
  59. __text:0010B614                 movss   xmm0, [ebp+var_10]
  60. __text:0010B619
  61. __text:0010B619 loc_10B619:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+78j
  62. __text:0010B619                 movss   [ebp+expDecay], xmm0
  63. __text:0010B61E                 mov     ecx, ds:(_weapon_recoil_decay2_lin_ptr - 10B58Eh)[edi] ; 8.0f
  64. __text:0010B624                 mov     eax, [ecx+1Ch]
  65. __text:0010B627                 cmp     eax, ecx
  66. __text:0010B629                 jnz     short loc_10B632
  67. __text:0010B62B                 movss   xmm0, dword ptr [ecx+2Ch]
  68. __text:0010B630                 jmp     short loc_10B642
  69. __text:0010B632 ; ---------------------------------------------------------------------------
  70. __text:0010B632
  71. __text:0010B632 loc_10B632:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+A9j
  72. __text:0010B632                 mov     ecx, [eax]
  73. __text:0010B634                 mov     [esp], eax      ; float
  74. __text:0010B637                 call    dword ptr [ecx+3Ch]
  75. __text:0010B63A                 fstp    [ebp+var_14]
  76. __text:0010B63D                 movss   xmm0, [ebp+var_14]
  77. __text:0010B642
  78. __text:0010B642 loc_10B642:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+B0j
  79. __text:0010B642                 movss   [ebp+linDecay], xmm0
  80. __text:0010B647                 mov     ebx, ds:(_gpGlobals_ptr - 10B58Eh)[edi]
  81. __text:0010B64D                 mov     eax, [ebx]
  82. __text:0010B64F                 movss   xmm1, dword ptr [eax+1Ch] ; interval_per_tick
  83. __text:0010B654                 movss   [ebp+tickInterval], xmm1
  84. __text:0010B659                 movss   xmm0, [ebp+expDecay]
  85. __text:0010B65E                 mulss   xmm0, xmm1      ; expDecay * tickInterval
  86. __text:0010B662                 xorps   xmm0, ds:(xmmword_A0FC00 - 10B58Eh)[edi] ; negate xmm0
  87. __text:0010B669                 movss   dword ptr [esp], xmm0
  88. __text:0010B66E                 call    _expf
  89. __text:0010B673                 fstp    [ebp+expDecayResult] ; = exp(-(expDecay * tickInterval))
  90. __text:0010B676                 movss   xmm0, [ebp+expDecayResult]
  91. __text:0010B67B                 movss   xmm6, [ebp+punchYaw]
  92. __text:0010B680                 mulss   xmm6, xmm0      ; xmm6 = punchYaw * expDecayResult
  93. __text:0010B684                 movaps  xmm2, xmm6      ; xmm2 = xmm6
  94. __text:0010B687                 mulss   xmm2, xmm2      ; xmm2 *= xmm2 (square)
  95. __text:0010B68B                 movss   xmm5, [ebp+punchPitch] ; xmm5 = punchPitch
  96. __text:0010B690                 mulss   xmm5, xmm0      ; xmm5 = punchPitch * expDecayResult
  97. __text:0010B694                 movaps  xmm1, xmm5      ; xmm1 = xmm5
  98. __text:0010B697                 mulss   xmm1, xmm1      ; square xmm1
  99. __text:0010B69B                 addss   xmm1, xmm2      ; xmm1 = (punchYaw * expDecayResult)^2 + (punchPitch * expDecayResult)^2
  100. __text:0010B69F                 movss   xmm4, [ebp+punchRoll]
  101. __text:0010B6A4                 mulss   xmm4, xmm0      ; xmm4 = punchRoll * expDecayResult
  102. __text:0010B6A8                 movaps  xmm0, xmm4      ; xmm0 = xmm4
  103. __text:0010B6AB                 mulss   xmm0, xmm0      ; square xmm0
  104. __text:0010B6AF                 addss   xmm0, xmm1      ; xmm0 = (punchRoll * expDecayResult)^2 + xmm1 (above)
  105. __text:0010B6B3                 xorps   xmm1, xmm1      ; clear xmm1
  106. __text:0010B6B6                 movss   xmm1, xmm0      ; copy single precision from xmm0 to xmm1
  107. __text:0010B6BA                 sqrtss  xmm3, xmm1      ; xmm3 = sqrt[(punchYaw * expDecayResult)^2 + (punchPitch * expDecayResult)^2 + (punchRoll * expDecayResult)^2] = vectorLength(punchAngle)
  108. __text:0010B6BE                 movss   xmm7, [ebp+linDecay]
  109. __text:0010B6C3                 mulss   xmm7, [ebp+tickInterval] ; xmm7 = linDecay * tickInterval
  110. __text:0010B6C8                 pxor    xmm1, xmm1      ; clear xmm1
  111. __text:0010B6CC                 ucomiss xmm3, xmm7      ; compare xmm3(expdecay) to xmm1(lindecay)
  112. __text:0010B6CF                 pxor    xmm0, xmm0      ; clear xmm0
  113. __text:0010B6D3                 pxor    xmm2, xmm2      ; clear xmm2
  114. __text:0010B6D7                 jbe     short loc_10B6FE ; jump if xmm3 <= xmm7
  115. __text:0010B6D9                 divss   xmm7, xmm3      ; xmm7 = linDecayTick / punchAngleExpDecayVectorLength
  116. __text:0010B6DD
  117. __text:0010B6DD loc_10B6DD:                             ; DATA XREF: CCSGameMovement::CheckParameters(void)+3FEr
  118. __text:0010B6DD                 movss   xmm0, ds:(dword_A0F7D8 - 10B58Eh)[edi] ; 1.0f
  119. __text:0010B6E5
  120. __text:0010B6E5 loc_10B6E5:                             ; DATA XREF: CCSGameMovement::CheckParameters(void)+3F6r
  121. __text:0010B6E5                 subss   xmm0, xmm7      ; xmm0 = 1.0f - (linDecayTick / punchAngleExpDecayVectorLength)
  122. __text:0010B6E9
  123. __text:0010B6E9 loc_10B6E9:                             ; DATA XREF: CCSGameMovement::CheckParameters(void)+3EEr
  124. __text:0010B6E9                 mulss   xmm4, xmm0      ; punchRollExpDecay *= xmm0
  125. __text:0010B6ED                 mulss   xmm6, xmm0      ; punchYawExpDecay *= xmm0
  126. __text:0010B6F1                 mulss   xmm5, xmm0      ; punchPitchExpDecay *= xmm0
  127. __text:0010B6F5                 movaps  xmm1, xmm6      ; xmm1 = xmm6 (punchYawExpDecay_Lin)
  128. __text:0010B6F8                 movaps  xmm0, xmm5      ; xmm0 = xmm5 (punchPitchExpDecay_Lin)
  129. __text:0010B6FB                 movaps  xmm2, xmm4      ; xmm2 = xmm4 (punchRollExpDecay_Lin)
  130. __text:0010B6FE
  131. __text:0010B6FE loc_10B6FE:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+157j
  132. __text:0010B6FE                 mov     eax, [ebx]      ; ebx = gpGlobals
  133. __text:0010B700                 movss   xmm5, dword ptr [eax+1Ch] ; xmm5 = tick_interval
  134. __text:0010B705                 movss   [ebp+expDecay], xmm5 ; expDecay = tick_interval
  135. __text:0010B70A                 movss   xmm3, [ebp+punchRollVel]
  136. __text:0010B70F                 mulss   xmm3, xmm5      ; xmm3 = punchRollVel * tick_interval
  137. __text:0010B713                 movss   xmm4, ds:(dword_A055E0 - 10B58Eh)[edi] ; 0.50
  138. __text:0010B71B                 movss   [ebp+linDecay], xmm4 ; linDecay = 0.50f
  139. __text:0010B720                 mulss   xmm3, xmm4      ; xmm3 *= 0.5;
  140. __text:0010B724                 addss   xmm3, xmm2      ; xmm3 += punchRollExpDecay_Lin
  141. __text:0010B728                 movss   [ebp+punchRoll], xmm3 ; punchRoll = xmm3 (punchRollVel * tick_interval * 0.5f) + punchRollExpDecay_Lin
  142. __text:0010B72D                 movss   xmm2, [ebp+punchYawVel]
  143. __text:0010B732                 mulss   xmm2, xmm5      ; xmm2 = punchYawVel * tick_interval
  144. __text:0010B736                 mulss   xmm2, xmm4      ; xmm3 *= 0.5f;
  145. __text:0010B73A                 addss   xmm2, xmm1      ; xmm2 += punchYawExpDecay_Lin
  146. __text:0010B73E                 movss   [ebp+punchPitch], xmm2 ; punchPitch = xmm3 (punchYawVel * tick_interval * 0.5f) + punchYawExpDecay_Lin
  147. __text:0010B743                 movss   xmm1, [ebp+punchPitchVel]
  148. __text:0010B748                 mulss   xmm1, xmm5      ; xmm1 = punchPitchVel * tick_interval
  149. __text:0010B74C                 mulss   xmm1, xmm4      ; xmm1 *= 0.5f;
  150. __text:0010B750                 addss   xmm1, xmm0      ; xmm1 += punchPitchExpDecay_Lin
  151. __text:0010B754                 movss   [ebp+punchYaw], xmm1 ; punchYaw = xmm3 (punchPitchVel * tick_interval * 0.5f) + punchPitchExpDecay_Lin
  152. __text:0010B759                 mov     ecx, ds:(_weapon_recoil_vel_decay_ptr - 10B58Eh)[edi] ; 4.50f
  153. __text:0010B75F                 mov     eax, [ecx+1Ch]
  154. __text:0010B762                 cmp     eax, ecx
  155. __text:0010B764                 jnz     short loc_10B76D
  156. __text:0010B766                 movss   xmm0, dword ptr [ecx+2Ch]
  157. __text:0010B76B                 jmp     short loc_10B77D ; xmm0 = -4.50f
  158. __text:0010B76D ; ---------------------------------------------------------------------------
  159. __text:0010B76D
  160. __text:0010B76D loc_10B76D:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+1E4j
  161. __text:0010B76D                 mov     ecx, [eax]
  162. __text:0010B76F                 mov     [esp], eax      ; float
  163. __text:0010B772                 call    dword ptr [ecx+3Ch]
  164. __text:0010B775                 fstp    [ebp+var_1C]
  165. __text:0010B778                 movss   xmm0, [ebp+var_1C]
  166. __text:0010B77D
  167. __text:0010B77D loc_10B77D:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+1EBj
  168. __text:0010B77D                 xorps   xmm0, ds:(xmmword_A0FC00 - 10B58Eh)[edi] ; xmm0 = -4.50f
  169. __text:0010B784                 movss   xmm1, [ebp+expDecay] ; xmm1 = tick_interval
  170. __text:0010B789                 mulss   xmm1, xmm0      ; xmm1 = tick_interval * -4.50
  171. __text:0010B78D                 movss   dword ptr [esp], xmm1
  172. __text:0010B792                 call    _expf
  173. __text:0010B797                 fstp    [ebp+velDecayExpResult] ; velDecayExpResult = exp(tickinterval * -4.50)
  174. __text:0010B79A                 movss   xmm1, [ebp+velDecayExpResult]
  175. __text:0010B79F                 movss   xmm2, [ebp+punchRollVel]
  176. __text:0010B7A4                 mulss   xmm2, xmm1      ; xmm2 = punchRollVel * velDecayExpResult
  177. __text:0010B7A8                 movss   [ebp+punchRollVel], xmm2 ; punchRollVel *= velDecayExpResult
  178. __text:0010B7AD                 mov     eax, [ebx]
  179. __text:0010B7AF                 movss   xmm0, dword ptr [eax+1Ch] ; xmm0 = tick_interval
  180. __text:0010B7B4                 mulss   xmm2, xmm0      ; xmm2 *= tick_interval
  181. __text:0010B7B8                 movss   xmm5, [ebp+linDecay] ; xmm5 = 0.5;
  182. __text:0010B7BD                 mulss   xmm2, xmm5      ; xmm2 *= 0.5
  183. __text:0010B7C1                 movss   xmm3, [ebp+punchRoll] ; xmm3 = punchRoll
  184. __text:0010B7C6                 addss   xmm3, xmm2      ; xmm3 = punchRoll + xmm2 (punchRollVel * velDecayExpResult * tick_interval * 0.5)
  185. __text:0010B7CA                 movss   xmm2, [ebp+punchYawVel]
  186. __text:0010B7CF                 mulss   xmm2, xmm1      ; xmm2 = punchYawVel * velDecayExpResult
  187. __text:0010B7D3                 movss   [ebp+punchYawVel], xmm2 ; punchYawVel *= velDecayExpResult
  188. __text:0010B7D8                 mulss   xmm2, xmm0      ; xmm2 *= tick_interval
  189. __text:0010B7DC                 mulss   xmm2, xmm5      ; xmm2 *= 0.5
  190. __text:0010B7E0                 movss   xmm4, [ebp+punchPitch]
  191. __text:0010B7E5                 addss   xmm4, xmm2      ; xmm4 = punchPitch + (punchYawVel * velDecayExpResult * tick_interval * 0.5)
  192. __text:0010B7E9                 movss   xmm2, [ebp+punchPitchVel]
  193. __text:0010B7EE                 mulss   xmm2, xmm1
  194. __text:0010B7F2                 movss   [ebp+punchPitchVel], xmm2
  195. __text:0010B7F7                 mulss   xmm0, xmm2
  196. __text:0010B7FB                 mulss   xmm0, xmm5
  197. __text:0010B7FF                 movss   xmm1, [ebp+punchYaw]
  198. __text:0010B804                 addss   xmm1, xmm0
  199. __text:0010B808                 movss   [ebp+punchYaw], xmm1
  200. __text:0010B80D                 mov     edi, [esi+0E5Ch]
  201. __text:0010B813                 ucomiss xmm1, dword ptr ds:(loc_10C8CD+1 - 10B58Eh)[edi]
  202. __text:0010B81A                 jnz     short loc_10B834
  203. __text:0010B81C                 jp      short loc_10B834
  204. __text:0010B81E                 ucomiss xmm4, dword ptr ds:(loc_10C8CD+5 - 10B58Eh)[edi]
  205. __text:0010B825                 jnz     short loc_10B834
  206. __text:0010B827                 jp      short loc_10B834
  207. __text:0010B829                 ucomiss xmm3, dword ptr ds:(loc_10C8D3+3 - 10B58Eh)[edi]
  208. __text:0010B830                 jnz     short loc_10B834
  209. __text:0010B832                 jnp     short loc_10B884
  210. __text:0010B834
  211. __text:0010B834 loc_10B834:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+29Aj
  212. __text:0010B834                                         ; CCSGameMovement::DecayAimPunchAngle(void)+29Cj ...
  213. __text:0010B834                 lea     eax, (loc_10C8CD+1 - 10B58Eh)[edi]
  214. __text:0010B83A                 mov     ecx, dword ptr ds:(loc_10C85E - 10B58Eh)[edi]
  215. __text:0010B840                 mov     [esp+4], eax
  216. __text:0010B844                 add     eax, 0FFFFFF90h
  217. __text:0010B847                 mov     [esp], eax
  218. __text:0010B84A                 movss   [ebp+punchRoll], xmm3
  219. __text:0010B84F                 movss   [ebp+punchPitch], xmm4
  220. __text:0010B854                 call    dword ptr [ecx+8]
  221. __text:0010B857                 movss   xmm0, [ebp+punchYaw]
  222. __text:0010B85C                 movss   dword ptr ds:(loc_10C8CD+1 - 10B58Eh)[edi], xmm0
  223. __text:0010B864                 movss   xmm0, [ebp+punchPitch]
  224. __text:0010B869                 movss   dword ptr ds:(loc_10C8CD+5 - 10B58Eh)[edi], xmm0
  225. __text:0010B871                 movss   xmm0, [ebp+punchRoll]
  226. __text:0010B876                 movss   dword ptr ds:(loc_10C8D3+3 - 10B58Eh)[edi], xmm0
  227. __text:0010B87E                 mov     edi, [esi+0E5Ch]
  228. __text:0010B884
  229. __text:0010B884 loc_10B884:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+2B2j
  230. __text:0010B884                 movss   xmm0, [ebp+punchPitchVel]
  231. __text:0010B889                 ucomiss xmm0, dword ptr ds:(loc_10C8D9+1 - 10B58Eh)[edi]
  232. __text:0010B890                 jnz     short loc_10B8B4
  233. __text:0010B892                 jp      short loc_10B8B4
  234. __text:0010B894                 movss   xmm0, [ebp+punchYawVel]
  235. __text:0010B899                 ucomiss xmm0, dword ptr ds:(loc_10C8DD+1 - 10B58Eh)[edi]
  236. __text:0010B8A0                 jnz     short loc_10B8B4
  237. __text:0010B8A2                 jp      short loc_10B8B4
  238. __text:0010B8A4                 movss   xmm0, [ebp+punchRollVel]
  239. __text:0010B8A9                 ucomiss xmm0, dword ptr ds:(loc_10C8DD+5 - 10B58Eh)[edi]
  240. __text:0010B8B0                 jnz     short loc_10B8B4
  241. __text:0010B8B2                 jnp     short loc_10B8F4
  242. __text:0010B8B4
  243. __text:0010B8B4 loc_10B8B4:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+310j
  244. __text:0010B8B4                                         ; CCSGameMovement::DecayAimPunchAngle(void)+312j ...
  245. __text:0010B8B4                 lea     eax, (loc_10C8D9+1 - 10B58Eh)[edi]
  246. __text:0010B8BA                 mov     ecx, dword ptr ds:(loc_10C85E - 10B58Eh)[edi]
  247. __text:0010B8C0                 mov     [esp+4], eax
  248. __text:0010B8C4                 add     eax, 0FFFFFF84h
  249. __text:0010B8C7                 mov     [esp], eax
  250. __text:0010B8CA                 call    dword ptr [ecx+8]
  251. __text:0010B8CD                 movss   xmm0, [ebp+punchPitchVel]
  252. __text:0010B8D2                 movss   dword ptr ds:(loc_10C8D9+1 - 10B58Eh)[edi], xmm0
  253. __text:0010B8DA                 movss   xmm0, [ebp+punchYawVel]
  254. __text:0010B8DF                 movss   dword ptr ds:(loc_10C8DD+1 - 10B58Eh)[edi], xmm0
  255. __text:0010B8E7                 movss   xmm0, [ebp+punchRollVel]
  256. __text:0010B8EC                 movss   dword ptr ds:(loc_10C8DD+5 - 10B58Eh)[edi], xmm0
  257. __text:0010B8F4
  258. __text:0010B8F4 loc_10B8F4:                             ; CODE XREF: CCSGameMovement::DecayAimPunchAngle(void)+332j
  259. __text:0010B8F4                 add     esp, 4Ch
  260. __text:0010B8F7                 pop     esi
  261. __text:0010B8F8                 pop     edi
  262. __text:0010B8F9                 pop     ebx
  263. __text:0010B8FA                 pop     ebp
  264. __text:0010B8FB                 retn
  265. __text:0010B8FB __ZN15CCSGameMovement18DecayAimPunchAngleEv endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement