FREE.cpp 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934
  1. #include "FREE.h"
  2. #include "LOCstring.h"
  3. #include "CStoryHUD.h"
  4. #include "CStoryCore.h"
  5. #include "CBall.h"
  6. #include "CFTTPObject.h"
  7. #include "CFTTPPBox.h"
  8. #include "CFTTPPCone.h"
  9. #include "CFTTPPCylinder.h"
  10. #include "CFTTPPPolyhedron.h"
  11. #include "CFTTPPSphere.h"
  12. #include "CFTTPhysics.h"
  13. #include "CModelManager.h"
  14. #include "CPlayerManager.h"
  15. #include "fpoint.h"
  16. #include "memctrl.h"
  17. #include "sub.h"
  18. #include "CBallProj.h"
  19. #include "XSYS.h"
  20. #include "SNDGAME.h"
  21. #include "XML.h"
  22. int s_iEVFStrings[160] = {
  23. 0x184B, 0x184C, 0x1858, 0, 0, 0, 0, 0, 0, 0,
  24. 0x1859, 0x185A, 0, 0, 0, 0, 0, 0, 0, 0, 0x1854,
  25. 0x1855, 0x1856, 0, 0, 0, 0, 0, 0, 0,
  26. 0x184F, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  27. 0x1850, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  28. 0x184E, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  29. 0x186B, 0x186C, 0, 0, 0, 0, 0, 0, 0, 0,
  30. 0x184D, 0x1851, 0x1852, 0x1853, 0x1857, 0x186A, 0, 0, 0, 0,
  31. 0x185B, 0x185C, 0x185D, 0x185E, 0x1864, 0x1869, 0, 0, 0, 0,
  32. 0x1860, 0x1861, 0x1862, 0x1865, 0x1866, 0, 0, 0, 0, 0,
  33. 0x1863, 0x1868, 0x1867, 0x185F, 0, 0, 0, 0, 0, 0,
  34. 0x1867, 0x1861, 0x1859, 0x185A, 0, 0, 0, 0, 0, 0,
  35. 0xFB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1878, 0x1879,
  36. 0, 0, 0, 0, 0, 0, 0, 0, 0x1876, 0x1877, 0, 0, 0, 0, 0, 0, 0, 0,
  37. 0x186D, 0x186E, 0x186F, 0x1870, 0x1871, 0x1873, 0x1874, 0x1875, 0x1872, 0};
  38. // FREE_tInfo 0x1D20
  39. // FREE_tGoal 0x7634
  40. int FREE_iTeam ;
  41. TFreeGoal FREE_tGoal;
  42. TFreeInfo FREE_tInfo;
  43. CFTTModel *FREE_pStarModel;
  44. int FREE_iPropWeather;
  45. const char *s_sPropModels_SNOW[3] = {
  46. "PKG:/data/env/dressing/cone_snow.ftm",
  47. "PKG:/data/env/dressing/mannequin_snow.ftm",
  48. "PKG:/data/env/dressing/rebounder.ftm"};
  49. CFTTModel *FREE_pPropModel[3];
  50. const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
  51. "PKG:/data/env/dressing/mannequin.ftm",
  52. "PKG:/data/env/dressing/rebounder.ftm"};
  53. const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
  54. "PKG:/data/env/dressing/mannequin_s.ftm",
  55. "PKG:/data/env/dressing/rebounder.ftm"};
  56. CFTTModel *FREE_pPropModelShadow[3];
  57. //-------------------------------------------------------------------------------------------------
  58. // 001D2758
  59. int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
  60. //-------------------------------------------------------------------------------------------------
  61. // 001D27EC
  62. void FREE_GetWorldRot(TPoint, TPoint) {}
  63. //-------------------------------------------------------------------------------------------------
  64. // 001D281C
  65. void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
  66. //-------------------------------------------------------------------------------------------------
  67. // 001D2A98
  68. int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
  69. //-------------------------------------------------------------------------------------------------
  70. // 001D2BC0
  71. void FREE_ResolveEndPoint(TPoint3D *, TPoint3D *, TPoint *, int *, bool) {}
  72. //-------------------------------------------------------------------------------------------------
  73. // 001D30B8
  74. void FREE_GetKickPower(EAnimID, int *, int *) {}
  75. //-------------------------------------------------------------------------------------------------
  76. // 001D30FC
  77. void FREE_ProcessControls(bool) {}
  78. //-------------------------------------------------------------------------------------------------
  79. // 001D3EC8
  80. int FREE_CalcKickTargetTime(int) { return 0; }
  81. //-------------------------------------------------------------------------------------------------
  82. // 001D3EEC
  83. void FREE_ResetControls() {}
  84. //-------------------------------------------------------------------------------------------------
  85. // 001D3F24
  86. int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
  87. return 0;
  88. }
  89. //-------------------------------------------------------------------------------------------------
  90. // 001D3FA8
  91. void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
  92. int *var_58 = pi1;
  93. int *var_54 = pi2;
  94. int *var_50 = pi3;
  95. int var_2C = 0;
  96. int var_28 = 0;
  97. TPoint3D var_38;
  98. TPoint3D var_48;
  99. int r0_i = player0->tStr32_44.field_10;
  100. FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
  101. var_28 = 100;
  102. int r4_i = 21627;
  103. var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
  104. r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
  105. // 001D3FF0
  106. if (r0_i < r4_i) {
  107. // 001D3FF4
  108. r4_i = r0_i;
  109. }
  110. // 001D3FF6
  111. var_48.dz_8 = r4_i;
  112. r0_i = 0;
  113. int r7_i = 163840;
  114. int r6_i = 0;
  115. r4_i = 0;
  116. var_48.point_0.dx_0 = r0_i;
  117. int r1_i;
  118. // loc_1D40EA
  119. while (r7_i != 1998848) {
  120. // loc_1D4006
  121. int r2_i = FREE_CalcKickTargetTime(r7_i);
  122. int r9_i = 4096;
  123. // r5 = cball
  124. int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
  125. int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  126. int r10_i = r7_i + r3_i;
  127. // 356A7C - 0x356A70
  128. r0_i = cBall.ballPosPrev_4.dz_8;
  129. int var_3C = r6_i;
  130. int r11_i;
  131. // 001D4024
  132. if (r0_i < 32768) {
  133. // 001D402A
  134. TPoint3D tp1;
  135. // int var_4C = r2_i;
  136. tp1.point_0.dx_0 = r8_i;
  137. tp1.point_0.dy_4 = r3_i;
  138. tp1.dz_8 = r0_i;
  139. TPoint3D tp2;
  140. tp2.point_0.dx_0 = r8_i;
  141. tp2.point_0.dy_4 = r10_i;
  142. tp2.dz_8 = r9_i;
  143. /*
  144. * 描述:此处在连续入栈时STRD和STM有出入
  145. * 原始汇编: STMEA.W SP, {R0,R8,R10}
  146. * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
  147. */
  148. int var_4C = r2_i;
  149. r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
  150. r11_i = r7_i;
  151. r1_i = var_48.point_0.dx_0;
  152. // 001D404A
  153. if (r0_i < var_48.dz_8) {
  154. // 001D4050
  155. r1_i = r7_i;
  156. }
  157. var_48.point_0.dx_0 = r1_i;
  158. r1_i = var_48.point_0.dy_4;
  159. // 001D4056
  160. if (r0_i < r1_i) {
  161. // 001D405A
  162. r11_i = r4_i;
  163. }
  164. // 001D405C
  165. if (r4_i != 0) {
  166. // 001D4060
  167. r11_i = r4_i;
  168. }
  169. // 001D4062
  170. r2_i = cBall.ballPosPrev_4.point_0.dx_0;
  171. r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  172. r1_i = r8_i;
  173. r0_i = cBall.ballPosPrev_4.dz_8;
  174. r8_i = r2_i;
  175. r2_i = var_4C;
  176. } else {
  177. // loc_1D4070
  178. r1_i = r8_i;
  179. r11_i = r4_i;
  180. }
  181. // 001D4076
  182. TPoint3D var_78;
  183. var_78.point_0.dx_0 = r8_i;
  184. var_78.point_0.dy_4 = r3_i;
  185. var_78.dz_8 = r0_i;
  186. TPoint3D var_6C;
  187. var_6C.point_0.dx_0 = r1_i;
  188. var_6C.point_0.dy_4 = r10_i;
  189. var_6C.dz_8 = r9_i;
  190. r4_i = r2_i;
  191. int r5_i =
  192. cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
  193. r0_i = r0_i * 2;
  194. r1_i = (uint)r0_i / (uint)5u;
  195. // r0_i = var_38.dz_8 ;
  196. r0_i = r7_i;
  197. // 001D40A4
  198. if (var_38.dz_8 > r1_i) {
  199. // 001D40AA
  200. r5_i = XMATH_Mag3D(&var_38);
  201. r0_i = var_38.dz_8;
  202. r0_i = r0_i / 49;
  203. r0_i = r0_i * r7_i;
  204. r0_i = r0_i / r4_i;
  205. } // loc_1D40C4
  206. r4_i = r0_i;
  207. r1_i = var_48.point_0.dy_4;
  208. r7_i += 32768;
  209. // 001D40CC
  210. if (r5_i < r1_i) {
  211. // 001D40D0
  212. r4_i = r11_i;
  213. }
  214. // 001D40D2
  215. if (r11_i != 0) {
  216. // 001D40D8
  217. r4_i = r11_i;
  218. }
  219. r6_i = var_3C;
  220. // 001D40DC
  221. if (r0_i <= r6_i) {
  222. // 001D40E0
  223. r0_i = r6_i;
  224. }
  225. r1_i = var_48.dz_8;
  226. // 001D40EA
  227. if (r5_i < r1_i) {
  228. // 001D40E8
  229. r6_i = r0_i;
  230. }
  231. } // loc_1D4006
  232. r0_i = r4_i << 1u;
  233. r1_i = 3;
  234. r0_i = r0_i / r1_i;
  235. int *r1_pi = var_58;
  236. *r1_pi = r0_i;
  237. r1_i = var_48.point_0.dx_0;
  238. // 001D40EA
  239. if (r1_i >= 1146880) {
  240. // 001D40F0
  241. r1_i = 1146880;
  242. }
  243. *var_54 = r1_i;
  244. *var_50 = r6_i;
  245. }
  246. //-------------------------------------------------------------------------------------------------
  247. // 001D4120
  248. void FREE_Init() {}
  249. //-------------------------------------------------------------------------------------------------
  250. // 001D4160
  251. void FREE_Shutdown() {}
  252. //-------------------------------------------------------------------------------------------------
  253. // 001D41B0
  254. void FREE_InitGoal(int, bool, bool, bool) {}
  255. //-------------------------------------------------------------------------------------------------
  256. // 001D4318 //^_-
  257. //单元测试等级:目测游戏表现
  258. //测试内容:启动游戏到第1关传球射门
  259. //测试结果: 游戏表现正常无崩溃且无明显变化,检测到日志输出
  260. //测试分支: 001D4318
  261. void FREE_SetupDifficulty() {
  262. /*
  263. * 描述:此处自己的汇编变量赋值上顺序有不同,多种尝试,不太容易完全一致
  264. */
  265. FREE_tInfo.field_1C9C.m_iCPUPlayerCloseDownCount_1CF8 = FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
  266. FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =FREE_tGoal.m_fCPUCloseDownDist_7480;
  267. FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 = FREE_tGoal.m_iCPUKickResponseTime_749C;
  268. FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C = FREE_tGoal.m_iCPUMoveResponseTime_74A0;
  269. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
  270. //注意!!!!!这里的数据符号不对 注意更新 FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
  271. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
  272. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
  273. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490;
  274. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =FREE_tGoal.m_fCPUGKSaveDistance_7494;
  275. uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
  276. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498;
  277. // 001D43B6
  278. if (r5_c != 0) {
  279. // 001D43B8
  280. // float s0_f = 2.8;
  281. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =FREE_tGoal.m_iCPUGKRating_7484 - 5;
  282. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C + 4;
  283. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
  284. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 -0.200000003f;
  285. // 001D43E6
  286. if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
  287. // 001D43FA
  288. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
  289. } else
  290. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
  291. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490 -5.0f;
  292. }
  293. // locret_1D4410
  294. }
  295. //-------------------------------------------------------------------------------------------------
  296. // 001D4424
  297. void FREE_Initialise() {}
  298. //-------------------------------------------------------------------------------------------------
  299. // 001D49C0
  300. void FREE_UpdateCamera(bool) {}
  301. //-------------------------------------------------------------------------------------------------
  302. // 001D56CC
  303. void FREE_ClipPathBounds(TPoint3D *, TPoint3D *, int, int, int, int) {}
  304. //-------------------------------------------------------------------------------------------------
  305. // 001D5718
  306. // void FREE_GameLoop() {
  307. // int r0_i = 0;
  308. // int r1_i = 0;
  309. // int r2_i = 0;
  310. // // 001D571E
  311. // if (NIS_Active() != 0) {
  312. // // 001D5720
  313. // // NIS_GameLoop();
  314. // CFreeHUD::Process();
  315. // // 47F7D8 - 0x47DFB0
  316. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  317. // // 001D5734
  318. // if (r0_i == 6) {
  319. // // 001D5738
  320. // FREE_ProcessFail();
  321. // r1_i = FREE_tInfo.filed_0.field_182C;
  322. // r1_i = r1_i + 1;
  323. // FREE_tInfo.filed_0.field_182C = r1_i;
  324. // return;
  325. // } else {
  326. // // locret_1D582E
  327. // return;
  328. // }
  329. // }
  330. // // loc_1D5748
  331. // // 47F7D8 - 0x47DFB0 = 1828
  332. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  333. // // 001D5754
  334. // if (r0_i != 8) {
  335. // // 001D5758
  336. // tGame.maybe_sound_0++;
  337. // }
  338. // // loc_1D5764
  339. // // 004877F5
  340. // NISGOAL_tInfo.field_1 = 0;
  341. // // 47DFB1 - 0x47DFB0
  342. // FREE_tInfo.filed_0.b_1 = 1;
  343. // // 001D5776
  344. // if (CReplay::Playing() != 0) {
  345. // // 001D5778
  346. // CReplay::Play();
  347. // }
  348. // // loc_1D577C
  349. // // 47F7D8 - 0x47DFB0
  350. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  351. // // 001D5782
  352. // if (r0_i == 7) {
  353. // // 47F7DC - 0x47DFB0
  354. // r1_i = FREE_tInfo.filed_0.field_182C;
  355. // // 3A27BC - 0x39BB88
  356. // r2_i = tGame.field_6C34;
  357. // // 001D5798
  358. // if (r2_i < r1_i) {
  359. // // 001D579C
  360. // r0_i = tGame.mTLogic_6678.field_50;
  361. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  362. // if (r1_i == r0_i) {
  363. // // 001D57C6
  364. // CGFXFX::EnableStarPlayerEffects();
  365. // }
  366. // } else {
  367. // // loc_1D57B0
  368. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  369. // r1_i = FREE_tInfo.filed_0.field_1830;
  370. // if (r1_i == r0_i) {
  371. // // 001D57C6
  372. // CGFXFX::EnableStarPlayerEffects();
  373. // }
  374. // }
  375. // }
  376. // // loc_1D57CA
  377. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  378. // float r0_f = 0.01666666753590107;
  379. // CGFXFX::Update(r0_f);
  380. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  381. // GFXCAMERA_UpdateMatrices();
  382. // int r4_i = FREE_ProcessLogic();
  383. // // 47FC60 - 0x47DFB0
  384. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  385. // // 001D57F2
  386. // if (r4_i != 0) {
  387. // // 001D57F8
  388. // if (CReplay::Playing() != 0) {
  389. // // loc_1D57FA
  390. // CAM_Update();
  391. // return;
  392. // }
  393. // } else {
  394. // // loc_1D57FA
  395. // CAM_Update();
  396. // return;
  397. // }
  398. // // loc_1D5802
  399. // // 3A2208 - 0x39BB88
  400. // r0_i = tGame.mTLogic_6678.field_8;
  401. // // 001D580E
  402. // if (r0_i == 2) {
  403. // // 001D5812
  404. // // 3A2238 - 0x39BB88
  405. // r0_i = tGame.mTLogic_6678.field_38;
  406. // // 001D5818
  407. // if (r0_i <= 29) {
  408. // // 001D581C
  409. // CReplay::RecordFrame();
  410. // }
  411. // } else {
  412. // // loc_1D5822
  413. // CReplay::RecordFrame();
  414. // }
  415. // // loc_1D5826
  416. // // 3A22A0 - 0x39BB88
  417. // r0_i = tGame.mTLogic_6678.field_A0;
  418. // // 001D582C
  419. // if (r0_i != 0) {
  420. // // locret_1D582E
  421. // return;
  422. // }
  423. // // loc_1D5830
  424. // CPlayerManager::UpdatePlayersLogic();
  425. // FREE_CheckCollision();
  426. // cBall.UpdateFrame();
  427. // // 47F7D8 - 0x47DFB0
  428. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  429. // // 001D584A
  430. // if (r0_i != 4) {
  431. // // 001D584E
  432. // COL_PlayerCollisions();
  433. // }
  434. // // 001D5852
  435. // PhysicsTest();
  436. // cBall.CheckEvents();
  437. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  438. // GFXNET::Update(0.01666666753590107f);
  439. // GL_UpdatePlayMode();
  440. // GM_CalcPlayerDist();
  441. // GM_CalcPlayerBallInterceptions();
  442. // FREE_LogicProcess();
  443. // // 3A2204 - 0x39BB88
  444. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  445. // // 001D5878
  446. // if (r0_i == 0) {
  447. // // 001D587C
  448. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  449. // // 001D5882
  450. // if (r0_i >= 4) {
  451. // // 001D5886
  452. // CPlayerManager::UpdatePlayers();
  453. // }
  454. // // 001D588A
  455. // COMM_Process();
  456. // }
  457. // // loc_1D57FA
  458. // CAM_Update();
  459. // return;
  460. // }
  461. //-------------------------------------------------------------------------------------------------
  462. // 001D58B4
  463. void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
  464. //-------------------------------------------------------------------------------------------------
  465. // 001D5A3E
  466. void FREE_UpdateRewindState() {}
  467. //-------------------------------------------------------------------------------------------------
  468. // 001D5A40
  469. void FREE_RestoreRewindState() {}
  470. //-------------------------------------------------------------------------------------------------
  471. // 001D5AE4
  472. void FREE_BeginRewind() {}
  473. //-------------------------------------------------------------------------------------------------
  474. // 001D5B30
  475. int FREE_RewindFrame() { return 0; }
  476. //-------------------------------------------------------------------------------------------------
  477. // 001D5C0C
  478. void FREE_ClipPathBounds(TPoint *, TPoint *, int, int, int, int) {}
  479. //-------------------------------------------------------------------------------------------------
  480. // 001D656C
  481. void FREE_IdleProcess() {
  482. tGame.mTLogic_6678.field_8 = 1;
  483. LOGE("FREE_IdleProcess");
  484. }
  485. //-------------------------------------------------------------------------------------------------
  486. // 001D66F0
  487. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  488. void COUNTER_UpdateGenericCounters(void) {
  489. LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
  490. }
  491. //-------------------------------------------------------------------------------------------------
  492. // 001D6778 //^_-
  493. //单元测试等级:目测游戏表现
  494. //测试内容:启动游戏到第5关传球射门
  495. //测试结果: 修复后游戏表现正常
  496. void FREE_LogicProcess() {
  497. tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
  498. tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
  499. // 001D679E
  500. if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
  501. // 001D67A2
  502. FREE_IdleProcess();
  503. } else {
  504. // loc_1D67A8
  505. if (tGame.mTLogic_6678.field_8 == 1) {
  506. // 001D67AC
  507. COUNTER_UpdateGenericCounters();
  508. }
  509. // loc_1D67B0
  510. }
  511. // loc_1D67B0
  512. if (tGame.mTLogic_6678.field_10 == 0) {
  513. if (tGame.mTLogic_6678.field_8 != 1) {
  514. // 001D67C4
  515. CPlayerManager::SetPlayersWalking(1);
  516. }
  517. }
  518. // loc_1D67C8
  519. tGame.field_6C34++;
  520. tGame.field_6C38++;
  521. }
  522. //-------------------------------------------------------------------------------------------------
  523. // 001D67E8
  524. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  525. //-------------------------------------------------------------------------------------------------
  526. // 001D6918
  527. void FREE_ProcessShotAnim(CPlayer *) {}
  528. //-------------------------------------------------------------------------------------------------
  529. // 001D6CD8
  530. void FREE_ProcessUserTeam() {}
  531. //-------------------------------------------------------------------------------------------------
  532. // 001D7D74
  533. void FREE_ProcessOppoTeam() {}
  534. //-------------------------------------------------------------------------------------------------
  535. // 001D848C
  536. void FREE_ProcessFree() {}
  537. //-------------------------------------------------------------------------------------------------
  538. // 001D86C4
  539. void FREE_ProcessFail() {}
  540. //-------------------------------------------------------------------------------------------------
  541. // 001D8884
  542. void FREE_PlayCommentaryClearance() {}
  543. //-------------------------------------------------------------------------------------------------
  544. // 001D8944
  545. void FREE_PlayCommentaryInterception() {}
  546. //-------------------------------------------------------------------------------------------------
  547. // 001D8998
  548. void FREE_SetupKickAction(TPoint3D, int, int) {}
  549. //-------------------------------------------------------------------------------------------------
  550. // 001D8AD0
  551. void FREE_CheckGKHandPos(CPlayer *, int) {}
  552. //-------------------------------------------------------------------------------------------------
  553. // 001D8B9C
  554. int FREE_SetupPhaseTransition(bool) { return 0; }
  555. //-------------------------------------------------------------------------------------------------
  556. // 001D8DB4
  557. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  558. //-------------------------------------------------------------------------------------------------
  559. // 001D8E68
  560. void FREE_ProcessInProgressCore() {}
  561. //-------------------------------------------------------------------------------------------------
  562. // 001D956C
  563. void FREE_UpdateSuccess(void) {
  564. // 001D956C
  565. TPoint3D var_30_sp20;
  566. TPoint3D var_40_sp10;
  567. /*
  568. * 描述:寄存嚣加载略有不同,VLDR,VLD1.8这两个不知道到底什么区别
  569. * 原始汇编:VLDR D16, [R2]
  570. * 自己汇编:VLD1.8 {D16}, [R2]
  571. */
  572. TPoint3D var_50_sp0 = FREE_tInfo.filed_0.point3D_1848;
  573. // 001D958E
  574. if (FREE_tInfo.filed_0.field_1840 > -1) {
  575. // 001D959C
  576. int r1_i = var_50_sp0.dz_8;
  577. // 001D95A8
  578. if (r1_i <= 0x1000) {
  579. // 001D95A8
  580. r1_i = 0x1000;
  581. }
  582. var_50_sp0.dz_8 = r1_i;
  583. cBallProj.EnsureProj(FREE_tInfo.filed_0.kickTargetTime_1838 + 10);
  584. int r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  585. int r7_i = 0x7FFFFFFF;
  586. int r8_i = 600;
  587. // r10 = var_50
  588. int r5_i = r0_i - 10;
  589. int r11_i;
  590. // loc_1D963E
  591. while (r5_i <= r0_i + 10) {
  592. // loc_1D95D4
  593. r0_i = cBallProj.field_E4;
  594. // 47F7EC - 0x47DFB0 =183C
  595. r0_i = r0_i + r5_i;
  596. r0_i = r0_i % 512;
  597. var_40_sp10 = cBallProj.field_E8[r0_i].point3D_0;
  598. // r9 = var40
  599. if (FREE_tInfo.filed_0.field_183C[0] != 0) {
  600. // 001D960E
  601. r0_i = XMATH_Distance(&var_40_sp10.point_0, &var_50_sp0.point_0);
  602. } else {
  603. // loc_1D9616
  604. r0_i = XMATH_Distance3D(&var_40_sp10, &var_50_sp0);
  605. }
  606. // loc_1D961C
  607. if (r0_i < r7_i) {
  608. // 001D9620
  609. r7_i = r0_i;
  610. r8_i = r5_i;
  611. r11_i = var_40_sp10.dz_8 - var_50_sp0.dz_8;
  612. var_30_sp20 = var_40_sp10;
  613. }
  614. // loc_1D9636
  615. // 47F7E8 - 0x47DFB0 =1838
  616. r5_i++;
  617. r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  618. }
  619. // 001D9644
  620. if (FREE_tInfo.filed_0.field_183C[0] == 0) {
  621. // 001D9644
  622. cBall.ballMovePrev_10.dz_8 = cBall.ballMovePrev_10.dz_8 - r11_i / r8_i;
  623. }
  624. // loc_1D9660
  625. cBallProj.EnsureProj(r8_i + 1);
  626. FREE_tInfo.filed_0.point3D_1848 = var_30_sp20;
  627. FREE_tInfo.field_1884 = tGame.maybe_sound_0 + r8_i;
  628. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  629. // 47F834 - 0x47DFB0 =1884
  630. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  631. // loc_1D96BC
  632. } else {
  633. // loc_1D96A8
  634. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  635. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  636. }
  637. // loc_1D96BC
  638. }
  639. //-------------------------------------------------------------------------------------------------
  640. // 001D96E4
  641. int FREE_ProcessLogic() { return 0; }
  642. //-------------------------------------------------------------------------------------------------
  643. // 001DA0A8
  644. void FREE_PlayCommentaryPassReceive() {}
  645. //-------------------------------------------------------------------------------------------------
  646. // 001DA208
  647. void FREE_PlayCommentaryKick() {}
  648. //-------------------------------------------------------------------------------------------------
  649. // 001DA484
  650. void FREE_SetComplete() {}
  651. //-------------------------------------------------------------------------------------------------
  652. // 001DA5C0
  653. void FREE_PlayersUpset(int) {}
  654. //-------------------------------------------------------------------------------------------------
  655. // 001DA620
  656. void FREE_PlayersCelebrate() {}
  657. //-------------------------------------------------------------------------------------------------
  658. // 001DA670
  659. void FREE_CheckCollision() {}
  660. //-------------------------------------------------------------------------------------------------
  661. // 001DA674
  662. //^_^
  663. void FREE_InitProps(void) {}
  664. //-------------------------------------------------------------------------------------------------
  665. // 001DA730
  666. void FREE_UpdateProps() {}
  667. //-------------------------------------------------------------------------------------------------
  668. // 001DA764
  669. void FREE_ShutdownProps() {}
  670. //-------------------------------------------------------------------------------------------------
  671. // 001DA7A4
  672. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  673. //-------------------------------------------------------------------------------------------------
  674. // 001DA7BC
  675. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  676. //-------------------------------------------------------------------------------------------------
  677. // 001DA7D4
  678. void FREE_RenderPropShadows() {}
  679. //-------------------------------------------------------------------------------------------------
  680. // 001DA8C0
  681. void FREE_RenderProps() {}
  682. //-------------------------------------------------------------------------------------------------
  683. // 001DA9AC
  684. void FREE_ProcessPropCollision(TFreeProp *) {}
  685. //-------------------------------------------------------------------------------------------------
  686. // 001DA9AE
  687. void FREE_ProcessPropCollisions() {}
  688. //-------------------------------------------------------------------------------------------------
  689. // 001DA9B0
  690. //^_^
  691. void FREE_RenderInitOnce() {}
  692. //-------------------------------------------------------------------------------------------------
  693. // 001DA9E0
  694. void FREE_RenderShutdownOnce() {}
  695. //-------------------------------------------------------------------------------------------------
  696. // 001DAA00
  697. void FREE_RenderInit() {}
  698. //-------------------------------------------------------------------------------------------------
  699. // 001DAAAC
  700. void FREE_RenderShutdown() {}
  701. //-------------------------------------------------------------------------------------------------
  702. // 001DAAF4
  703. void FREE_RenderListBegin(char const *, bool, bool) {}
  704. //-------------------------------------------------------------------------------------------------
  705. // 001DAB84
  706. void FREE_RenderListEnd() {}
  707. //-------------------------------------------------------------------------------------------------
  708. // 001DABD4
  709. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  710. //-------------------------------------------------------------------------------------------------
  711. // 001DAC40
  712. void FREE_RenderStar(TPoint3D, float, float) {}
  713. //-------------------------------------------------------------------------------------------------
  714. // 001DACE4
  715. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  716. //-------------------------------------------------------------------------------------------------
  717. // 001DAEEC
  718. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  719. //-------------------------------------------------------------------------------------------------
  720. // 001DB0BC
  721. void FREE_RenderRangeCone() {}
  722. //-------------------------------------------------------------------------------------------------
  723. // 001DB3CC
  724. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  725. //-------------------------------------------------------------------------------------------------
  726. // 001DB5C0
  727. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  728. //-------------------------------------------------------------------------------------------------
  729. // 001DB9C8
  730. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  731. //-------------------------------------------------------------------------------------------------
  732. // 001DBBCC
  733. void FREE_Render3DOpaque() {}
  734. //-------------------------------------------------------------------------------------------------
  735. // 001DBBF0
  736. void FREE_RenderHeroPlayer(bool) {}
  737. //-------------------------------------------------------------------------------------------------
  738. // 001DBEEC
  739. void FREE_Render3DDecal() {}
  740. //-------------------------------------------------------------------------------------------------
  741. // 001DBFC4
  742. void FREE_RenderPreSelectedPlayer() {}
  743. //-------------------------------------------------------------------------------------------------
  744. // 001DC0E0
  745. void FREE_RenderProcess() {
  746. MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0=rand()%10;
  747. }
  748. //-------------------------------------------------------------------------------------------------
  749. // 001DC0E4
  750. void FREE_AddVisualFeedback(int i0, EVFEffect e1, int i2) {
  751. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  752. r0_hud->ClearVisualFeedback();
  753. int r0_i = 0;
  754. int r4_i = i2;
  755. int r5_i = e1;
  756. int r6_i = i0;
  757. // int r7_i =0;
  758. int r1_i = r6_i + r6_i * 4;
  759. int* r7_pi = s_iEVFStrings + r1_i * 2;
  760. // loc_1DC120
  761. while (r0_i <= 9) {
  762. // loc_1DC118
  763. r1_i = *(r7_pi + r0_i);
  764. if (r1_i == 0) {
  765. break;
  766. }
  767. // loc_1DC120
  768. r0_i++;
  769. } // loc_1DC118
  770. // loc_1DC124
  771. r0_i = XSYS_Random(r0_i);
  772. r0_i = *(r7_pi + r0_i);
  773. wchar_t* r1_pwc = LOCstring(r0_i);
  774. wchar_t var_218[256];
  775. xstrlcpy(var_218, r1_pwc, 256);
  776. int r3_i;
  777. int r7_i;
  778. // 47AEA8 - 0x477E90
  779. r0_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
  780. // 001DC148
  781. if (r0_i == 1) {
  782. // 001DC14C
  783. xstrlcat(var_218, L" ", 256);
  784. } else {
  785. // loc_1DC152
  786. xstrlcat(var_218, L"!", 256);
  787. }
  788. /*
  789. * 描述:此处分支被合并到下面的cBall变量访问的代码块中了
  790. * 原始汇编: BLX j__Z8xstrlcatPwPKwj
  791. LDR R0, =(cBall_ptr - 0x1DC166)
  792. ADD R0, PC
  793. LDR R0, [R0]
  794. LDR R1, [R0,#(dword_356A7C - 0x356A70)]
  795. * 自已汇编: ...
  796. * LDR R0, =(cBall_ptr - 0xA26A)
  797. MOV.W R4, #0xFFFFFFFF
  798. ADD R0, PC
  799. LDR R0, [R0]
  800. LDRD.W R3, R2, [R0,#4]
  801. LDR R0, [R0,#(dword_27A4C - 0x27A40)]
  802. */
  803. // 356A7C - 0x356A70
  804. // 001DC168
  805. r1_i = cBall.ballPosPrev_4.dz_8;
  806. if (r1_i <= 98304) {
  807. // 001DC16E
  808. r1_i = 98304;
  809. }
  810. r3_i = cBall.ballPosPrev_4.point_0.dx_0;
  811. int r2_i = cBall.ballPosPrev_4.point_0.dy_4;
  812. bool bC1F8 = false;
  813. // 001DC174
  814. if (r4_i + 1 != 0) {
  815. // 001DC176
  816. if (r5_i == 3) {
  817. // 001DC17A
  818. r1_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.dz_8;
  819. r2_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dy_4;
  820. r3_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dx_0;
  821. r4_i = -1;
  822. // 001DC18A
  823. if (r6_i != 12) {
  824. // 001DC1A2
  825. r1_i = r1_i + 98304;
  826. }
  827. // loc_1DC1F8
  828. bC1F8 = true;
  829. } else {
  830. // loc_1DC1B2
  831. r1_i = 98304;
  832. r2_i = 0;
  833. r3_i = 0;
  834. }
  835. // loc_1DC1BA
  836. } else {
  837. // loc_1DC1A8
  838. r4_i = -1;
  839. }
  840. if (bC1F8 == false) {
  841. // loc_1DC1BA
  842. uint r0_ui = (uint)r5_i - 1u;
  843. // 001DC1BC
  844. if (r0_ui >= 2) {
  845. // 001DC1C0
  846. if (r5_i != 3) {
  847. // 001DC1C4
  848. if (r5_i == 0) {
  849. // 001DC1C8
  850. // 4B0E34 - 0x4AB140
  851. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  852. r7_i = 0;
  853. r6_i = 1;
  854. int var_228 = r6_i;
  855. int var_224 = r7_i;
  856. int var_220 = r4_i;
  857. int r12_i = -256;
  858. float r5_f = 1;
  859. r4_i = 100;
  860. r6_i = 1602;
  861. TPoint3D tp3d0;
  862. tp3d0.point_0.dx_0 = r3_i;
  863. tp3d0.point_0.dy_4 = r2_i;
  864. tp3d0.dz_8 = r1_i;
  865. TPoint3D tp3d1;
  866. tp3d1.point_0.dx_0 = r7_i;
  867. tp3d1.point_0.dy_4 = r7_i;
  868. tp3d1.dz_8 = r6_i;
  869. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r4_i, r5_f, r12_i,
  870. var_228, (EVFEffect)var_224, var_220);
  871. }
  872. // loc_1DC25E
  873. return;
  874. }
  875. // F8
  876. } else {
  877. // loc_1DC228
  878. float r6_f = 0.699999988079071;
  879. r7_i = 1;
  880. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  881. int var_228 = r7_i;
  882. int var_224 = r5_i;
  883. int var_220 = r4_i;
  884. r5_i = 60;
  885. r7_i = 0;
  886. r4_i = 1602;
  887. int r12_i = -1;
  888. TPoint3D tp3d0;
  889. tp3d0.point_0.dx_0 = r3_i;
  890. tp3d0.point_0.dy_4 = r2_i;
  891. tp3d0.dz_8 = r1_i;
  892. TPoint3D tp3d1;
  893. tp3d1.point_0.dx_0 = r7_i;
  894. tp3d1.point_0.dy_4 = r7_i;
  895. tp3d1.dz_8 = r4_i;
  896. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r5_i, r6_f, r12_i, var_228,
  897. (EVFEffect)var_224, var_220);
  898. }
  899. }
  900. // loc_1DC1F8
  901. r0_i = -801;
  902. r7_i = 1;
  903. r6_i = -12566464;
  904. int lr_i = r0_i;
  905. // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  906. float r12_f = 0.699999988079071;
  907. r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  908. int var_228 = r7_i;
  909. int var_224 = r5_i;
  910. r7_i = 40;
  911. r5_i = 0;
  912. TPoint3D tp3d0;
  913. tp3d0.point_0.dx_0 = r3_i;
  914. tp3d0.point_0.dy_4 = r2_i;
  915. tp3d0.dz_8 = r1_i;
  916. TPoint3D tp3d1;
  917. tp3d1.point_0.dx_0 = r5_i;
  918. tp3d1.point_0.dy_4 = r5_i;
  919. tp3d1.dz_8 = lr_i;
  920. r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r7_i, r12_f, r6_i, var_228, (EVFEffect)var_224, r4_i);
  921. }
  922. //-------------------------------------------------------------------------------------------------
  923. // 001DC290
  924. void FREE_AddVisualFeedback_Pass() {
  925. TPoint var_1C = cBallProj.field_E8[((cBallProj.field_E4 + 1) % 512)].point3D_0.point_0;
  926. CPlayer* r7_pplayer = tGame.mTMath_6734.pPlayer_134[FREE_iTeam];
  927. int r0_i = XMATH_Distance(&tGame.mTLogic_6678.field_64, &var_1C);
  928. // 3A2278 - 0x39BB88 = 66F0
  929. int r2_i = tGame.mTLogic_6678.field_78; //[2]
  930. TAnimData* anims = CAnimManager::s_tAnimData;
  931. int r1_i = (ushort)anims[r2_i].u_C.filed_C;
  932. r1_i = r1_i & 1032u;
  933. int r4_i;
  934. EVFEffect r5_i;
  935. /*
  936. * 描述: 原汇编r5= 1有归并,自己汇编分成了两处, 寄存嚣分配有出入
  937. * 原始汇编: loc_1DC30A
  938. * MOVS R5, #1
  939. B loc_1DC31A
  940. * 自已汇编: BLE loc_E2EC
  941. MOVS R4, #1
  942. */
  943. // bool bC30A = false;
  944. // 001DC2FC
  945. if (r1_i == 0) {
  946. // loc_1DC302
  947. if (r0_i > 819200) {
  948. // 001DC308
  949. r4_i = 8;
  950. r5_i = EVFEffect_1;
  951. } else {
  952. // loc_1DC30E
  953. r4_i = 9;
  954. if (r0_i < 327680) {
  955. // 001DC316
  956. r4_i = 10;
  957. }
  958. r5_i = EVFEffect_2;
  959. }
  960. } else {
  961. r4_i = 11;
  962. r5_i = EVFEffect_1;
  963. }
  964. // loc_1DC30A
  965. // loc_1DC31A
  966. CPlayer* r0_pplayer = &tGame.CPlayer_3050[0];
  967. r2_i = r7_pplayer - r0_pplayer;
  968. FREE_AddVisualFeedback(r4_i, r5_i, r2_i);
  969. r0_i = XSYS_Random(2);
  970. r0_i = r0_i + 3;
  971. SNDGAME_Crowd_PlayReaction(r0_i);
  972. }
  973. //-------------------------------------------------------------------------------------------------
  974. // 001DC354
  975. void FREE_AddVisualFeedback_Goal() {}
  976. //-------------------------------------------------------------------------------------------------
  977. // 001DC440
  978. void FREE_AddVisualFeedback_Fail() {}
  979. //-------------------------------------------------------------------------------------------------
  980. // 001DC494
  981. void FREE_AddVisualFeedback_Offside() {}
  982. //-------------------------------------------------------------------------------------------------
  983. // 001DC4C8
  984. void FREE_SortPlayers(TFreeGoal *a1) {
  985. LOGE("FREE_SortPlayers%p",a1);
  986. }
  987. //-------------------------------------------------------------------------------------------------
  988. // 001DC664
  989. void FREE_SortPlayersDistance(TFreeGoal *) {}
  990. //-------------------------------------------------------------------------------------------------
  991. // 001DC848
  992. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  993. //-------------------------------------------------------------------------------------------------
  994. // 001DC888
  995. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  996. //-------------------------------------------------------------------------------------------------
  997. // 001DCA14
  998. void FREE_ReadXMLLevel(TFreeGoal* tFreeGoal_r0, CFTTXmlReaderNode cXMLReaderNode_r1) {
  999. TPoint3D tPoint3D_50;
  1000. CFTTXmlReaderNode cNode_48;
  1001. auto cXMLReaderNode_4C = cXMLReaderNode_r1;
  1002. //CFTTXmlReaderNode cPropNode_54;
  1003. CFTTXmlReaderNode cNodeTeam_40;
  1004. CFTTXmlReaderNode cNodePlayer_3C;
  1005. TPoint tPoint_34;
  1006. TPoint tZero_74;
  1007. // int iTeam_No_Index_78;
  1008. char pFormatBuf_50[0x20];
  1009. TPoint3D tPoint3D_98;
  1010. TPoint tPoint_98;
  1011. // 001DCA30
  1012. memset(tFreeGoal_r0, 0, sizeof(TFreeGoal)); // sizeof(TFreeGoal) = 0x7634
  1013. // 001DCA3A
  1014. cNode_48 = cXMLReaderNode_r1.GetFirstChild("Info");
  1015. // 001DCA46 <- **if 分支**
  1016. if (cNode_48.IsValid()) {
  1017. // 001DCA48 OK
  1018. tFreeGoal_r0->m_iVersion_0 = XMLGetInt(cNode_48, "Version", NULL, 0); // 001DCA56 <- **字段 0 赋值**
  1019. }
  1020. // 001DCA66
  1021. if (XMLExists(cXMLReaderNode_r1, "Ball", "Pos")) {
  1022. // 001DCA68 OK
  1023. // 001DCA7C <- **结构体赋值**
  1024. //tPoint3D_98 = g_vZero3;
  1025. // 001DCA86 <- **call XMLGetPos3D**
  1026. tPoint3D_50 = XMLGetPos3D(cXMLReaderNode_r1, "Ball", "Pos", g_vZero3); // 001DCA86 <- **函数调用,结构体传参通过栈拷贝**
  1027. // 001DCA94 <- **TPoint3D.dz_8 赋值**
  1028. tFreeGoal_r0->m_tBallPos_744C.dz_8 = tPoint3D_50.dz_8;
  1029. // 001DCA9C <- **TPoint3D.point_0赋值**
  1030. // tFreeGoal_r0->m_tBallPos_744C.point_0 = tPoint3D_40.point_0;
  1031. tFreeGoal_r0->m_tBallPos_744C.point_0.dx_0 = tPoint3D_50.point_0.dx_0;
  1032. tFreeGoal_r0->m_tBallPos_744C.point_0.dy_4 = tPoint3D_50.point_0.dy_4;
  1033. // 001DCAA6 <- **if 分支**
  1034. if (tFreeGoal_r0->m_tBallPos_744C.dz_8 < 0x1000) {
  1035. // 001DCABC OK
  1036. tFreeGoal_r0->m_tBallPos_744C.dz_8 = 0x1000; // 001DCAC2 <- **字段 744C 赋值**
  1037. }
  1038. } else {
  1039. // 001DCAAA <- **分支地址**
  1040. // 001DCAB0 <- **TPoint.dy_4 赋值**
  1041. // 001DCAB6 <- **TPoint.dx_0 赋值**
  1042. tFreeGoal_r0->m_tBallPos_744C.point_0 = TPoint(0, 0);
  1043. // 001DCAC2
  1044. tFreeGoal_r0->m_tBallPos_744C.dz_8 = 0x1000;
  1045. }
  1046. // 001DCAD8 <- **字段 745C 赋值**
  1047. tFreeGoal_r0->m_iKickPlayer_745C = XMLGetInt(cXMLReaderNode_r1, "KickPlayer", NULL, 0); // 001DCACE <- **函数调用**
  1048. // 001DCAE2 <- **call XMLGetString()**
  1049. char* pKickAnim_r0 = XMLGetString(cXMLReaderNode_r1, "KickAnim", NULL, NULL);
  1050. // 001DCAEA <- **XMLGetString() 返回值判断**
  1051. if (pKickAnim_r0) {
  1052. // 001DCAEC OK
  1053. tFreeGoal_r0->m_iAnimID_7460 = CAnimManager::GetAnimID(pKickAnim_r0); // 001DCB02 <- **字段 7460 赋值**
  1054. } else {
  1055. // 001DCAF2
  1056. tFreeGoal_r0->m_iAnimID_7460 = -1;
  1057. }
  1058. // 001DCB1E <- **字段 7464 赋值**
  1059. tFreeGoal_r0->m_iKickRot_7464 = XMLGetInt(cXMLReaderNode_r1, "KickRot", 0, 0xB4);
  1060. // 001DCB36 <- **字段 8 赋值**
  1061. const char* sWeatherTypes[3] = {"FINE", "RAIN", "SNOW"};
  1062. tFreeGoal_r0->m_iWeather_8 = XMLGetStringInt(cXMLReaderNode_r1, "Weather", NULL, (const char**)sWeatherTypes, 3, -1);
  1063. // 001DCB44 <- **字段 C 赋值**
  1064. tFreeGoal_r0->m_iMaxPhaseCount_C = XMLGetInt(cXMLReaderNode_r1, "MaxPhaseCount", NULL, 0);
  1065. // 001DCB5A <- **字段 10 赋值**
  1066. tFreeGoal_r0->m_bIndirect_10 = XMLGetInt(cXMLReaderNode_r1, "Indirect", NULL, 0) ? true : false; // 001DCB52 <- **三目运算**
  1067. // 001DCB64 <- **call XMLGetString()**
  1068. char const* pShotAnim_r0 = XMLGetString(cXMLReaderNode_r1, "ShotAnim", NULL, NULL);
  1069. // 001DCB68 <- **返回值判断**
  1070. if (pShotAnim_r0) {
  1071. // 001DCB6A
  1072. tFreeGoal_r0->m_iShotAnimID_7468 = CAnimManager::GetAnimID(pShotAnim_r0); // 001DCB82 <- **字段 7468 赋值**
  1073. } else {
  1074. // 001DCB70 OK
  1075. tFreeGoal_r0->m_iShotAnimID_7468 = -1; // 001DCB7E <- **返回值空则赋值 -1**
  1076. }
  1077. // 001DCB92 <- **字段 746C 赋值**
  1078. tFreeGoal_r0->m_iShotAnimPlayer_746C = XMLGetInt(cXMLReaderNode_r1, "ShotAnimPlayer", NULL, -1);
  1079. // 001DCB9E <- **call XMLGetFloat()**
  1080. tFreeGoal_r0->m_fShotAnimDistance_7470 = XMLGetFloat(cXMLReaderNode_r1, "ShotAnimDistance", NULL, 24.0f);
  1081. // 001DCBB8 <- **字段 7458 赋值**
  1082. tFreeGoal_r0->m_iUserPlayer_7458 = XMLGetInt(cXMLReaderNode_r1, "UserPlayer", NULL, 0);
  1083. // 001DCBCA <- **字段 747C 赋值**
  1084. tFreeGoal_r0->m_iCPUPlayerCloseDownCount_747C = XMLGetInt(cXMLReaderNode_r1, "CPUPlayerCloseDownCount", NULL, 1);
  1085. // 001DCBDE <- **字段 7480 赋值**
  1086. tFreeGoal_r0->m_fCPUCloseDownDist_7480 = XMLGetFloat(cXMLReaderNode_r1, "CPUCloseDownDist", NULL, 4.0f);
  1087. // 001DCBF0 <- **字段 7484 赋值**
  1088. tFreeGoal_r0->m_iCPUGKRating_7484 = XMLGetInt(cXMLReaderNode_r1, "CPUGKRating", NULL, 0x32);
  1089. // 001DCC02 <- **字段 7490 赋值**
  1090. tFreeGoal_r0->m_fCPUGKSaveSpeed_7490 = XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveSpeed", NULL, 90.0f);
  1091. // 001DCC16 <- **字段 7494 赋值**
  1092. tFreeGoal_r0->m_fCPUGKSaveDistance_7494 = XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveDistance", NULL, 4.0f);
  1093. // 001DCC2A <- **字段 7488 赋值**
  1094. tFreeGoal_r0->m_fCPUGKSaveAlwaysDistance_7488 = XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveAlwaysDistance", NULL, 0.75f);
  1095. // 001DCC3C <- **字段 748C 赋值**
  1096. tFreeGoal_r0->m_iCPUGKSaveResponseTime_748C = XMLGetInt(cXMLReaderNode_r1, "CPUGKSaveResponseTime", NULL, 0xF);
  1097. // 001DCC4E <- **字段 7498 赋值**
  1098. tFreeGoal_r0->m_iCPUGKPosResponseTime_7498 = XMLGetInt(cXMLReaderNode_r1, "CPUGKPosResponseTime", NULL, 0xF);
  1099. // 001DCC5C <- **函数返回值赋值**
  1100. int iCPUPlayerResponseTime_r4 = XMLGetInt(cXMLReaderNode_r1, "CPUPlayerResponseTime", NULL, 0xF); // 001DCC58 <- **函数调用**
  1101. // 001DCC6E <- **字段 749C 赋值**
  1102. tFreeGoal_r0->m_iCPUKickResponseTime_749C = XMLGetInt(cXMLReaderNode_r1, "CPUKickResponseTime", NULL, iCPUPlayerResponseTime_r4);
  1103. // 001DCC80 <- **字段 74A0 赋值**
  1104. tFreeGoal_r0->m_iCPUMoveResponseTime_74A0 = XMLGetInt(cXMLReaderNode_r1, "CPUMoveResponseTime", NULL, iCPUPlayerResponseTime_r4);
  1105. // 001DCC92 <- **字段 7478 赋值**
  1106. tFreeGoal_r0->m_iTEAMKickResponseTime_7478 = XMLGetInt(cXMLReaderNode_r1, "TEAMKickResponseTime", 0, 0xA);
  1107. // 001DCCA4 <- **字段 7474 赋值**
  1108. tFreeGoal_r0->m_iTEAMMoveResponseTime_7474 = XMLGetInt(cXMLReaderNode_r1, "TEAMMoveResponseTime", 0, 5);
  1109. // 001DCCB8 <- **字段 74C4 赋值**
  1110. tFreeGoal_r0->m_fTEAMPassForceShotDist_74C4 = XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotDist", NULL, 8.0f);
  1111. // 001DCCCC <- **字段 74C8 赋值**
  1112. tFreeGoal_r0->m_fTEAMPassForceShotSpace_74C8 = XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotSpace", NULL, 4.0f);
  1113. // 001DCCDE <- **字段 74CC 赋值**
  1114. tFreeGoal_r0->m_iShootBias_74CC = XMLGetInt(cXMLReaderNode_r1, "ShootBias", NULL, 0);
  1115. // 001DCCF0 <- **字段 74D4 赋值**
  1116. tFreeGoal_r0->m_iPassBias_74D4 = XMLGetInt(cXMLReaderNode_r1, "PassBias", NULL, 0);
  1117. // 001DCD02 <- **字段 74DC 赋值**
  1118. tFreeGoal_r0->m_iControlWhenShootBias_74DC = XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootBias", NULL, 0);
  1119. // 001DCD14 <- **字段 74E4 赋值**
  1120. tFreeGoal_r0->m_iControlWhenPassBias_74E4 = XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassBias", NULL, 0);
  1121. // 001DCD26 <- **字段 74D0 赋值**
  1122. tFreeGoal_r0->m_iShootScale_74D0 = XMLGetInt(cXMLReaderNode_r1, "ShootScale", NULL, 0);
  1123. // 001DCD38 <- **字段 74D8 赋值**
  1124. tFreeGoal_r0->m_iPassScale_74D8 = XMLGetInt(cXMLReaderNode_r1, "PassScale", NULL, 0);
  1125. // 001DCD4A <- **字段 74E0 赋值**
  1126. tFreeGoal_r0->m_iControlWhenShootScale_74E0 = XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootScale", NULL, 0);
  1127. // 001DCD5C <- **字段 74E8 赋值**
  1128. tFreeGoal_r0->m_iControlWhenPassScale_74E8 = XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassScale", NULL, 0);
  1129. // 001DCD6E <- **字段 74EC 赋值**
  1130. tFreeGoal_r0->m_iControlRepeatReduce_74EC = XMLGetInt(cXMLReaderNode_r1, "ControlRepeatReduce", NULL, 10);
  1131. // 001DCD80 <- **字段 74F0 赋值**
  1132. tFreeGoal_r0->m_iPropCount_74F0 = XMLGetInt(cXMLReaderNode_r1, "PropCount", NULL, 0);
  1133. // 001DCD9C <- **局部变量赋值**
  1134. CFTTXmlReaderNode cPropNode_44 = cXMLReaderNode_r1.GetFirstChild("Prop"); // cNode_var_54 IDA中伪代码 NextSibling
  1135. // 001DCD9A <- **寄存器R4作为循环计数器**
  1136. // 001DCEC2 <- **循环条件判断**
  1137. for (int i_r4 = 0; i_r4 < tFreeGoal_r0->m_iPropCount_74F0; i_r4++) {
  1138. // 001DCE64
  1139. // 001DCE7A <- **结构体字段赋值**
  1140. const char* sFPropTypes[3] = {"CONE", "MANNEQUIN", "BOARD"};
  1141. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iType_C = ( EFreePropType)XMLGetStringInt(cPropNode_44, "Type", NULL, (const char**)sFPropTypes, 3, 0);
  1142. // 001DCEA0 001DCEA2 <- **TPoint3D结构赋值**
  1143. // 001DCEA2 <- **该地址使用了VSTR指令,推测TPoint3D使用了浮点数,但还原代码时使用TPointF3D结构体,汇编代码并未一致**
  1144. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_tPoint3D_0 = XMLGetPos3D(cPropNode_44, "Pos", NULL, g_vZero3);
  1145. // 001DCEB0 <- **字段赋值**
  1146. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iRot_10 = XMLGetInt(cPropNode_44, "Rot", NULL, 0);
  1147. // 001DCEB6 <- **读取下一个node**
  1148. cPropNode_44 = cPropNode_44.GetNextSibling("Prop");
  1149. // 001DCEBC <- **ADDS R6, #0x14; 0x14 说明数组元素是5个int的结构体**
  1150. } // 001DCEC4 <- **循环代码块结束**
  1151. int iPlayerNO_r10;
  1152. // 001DCEF0
  1153. tZero_74 = g_vZero;
  1154. // 001DCEDA 寄存器r3作为循环计数器, iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 == 0,是己方球队
  1155. for (int iTeamNO_r3 = 0; iTeamNO_r3 != 2; iTeamNO_r3++) {
  1156. // 001DCEF4 OK
  1157. // 001DCEFE <- **call snprintf**
  1158. snprintf(pFormatBuf_50, 0x20, "Team%i", iTeamNO_r3);
  1159. // 001DCF0A <- **局部变量赋值**
  1160. cNodeTeam_40 = cXMLReaderNode_r1.GetFirstChild(pFormatBuf_50);
  1161. // 001DCF0E <- **if 代码块**
  1162. if (cNodeTeam_40.IsValid()) {
  1163. // 001DCF18 OK
  1164. // 001DCF26 <- **局部变量赋值**
  1165. cNodePlayer_3C = cNodeTeam_40.GetFirstChild("Player");
  1166. iPlayerNO_r10 = 0; // 001DCF20 <- **循环计数器**
  1167. // 001DD28A <- **call IsValid()**
  1168. // 001DD294 <- **小于等于 10则跳转**
  1169. while (cNodePlayer_3C.IsValid() && iPlayerNO_r10 < 11) {
  1170. // 001DCF2A OK
  1171. if (XMLExists(cNodePlayer_3C, "Pos", NULL)) {
  1172. // 001DCF2A OK
  1173. //tPoint_98 = tZero_74; // 001DCF42 <- **结构体赋值**
  1174. // 001DCF46 <- **tPoint_64 接收函数返回值**
  1175. tPoint_34 = XMLGetPos(cNodePlayer_3C, "Pos", NULL, g_vZero);
  1176. // 001DCF68 <- **结构体比较,这里的操作符重载函数与原始汇编不一致**
  1177. // if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4 != tPoint_34) {
  1178. // 001DCF6C OK
  1179. // 001DCF6E 001DCF72 <- **结构体赋值, 使用结构体操作符重载函数会改变汇编代码结构**
  1180. // LOGI("hook 0 %d", iPlayerNO_r10);
  1181. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dx_0 = tPoint_34.dx_0; //这里的pos如果改为 TPoint(0,0) 在第一二关时,对方球队的守门员会变得跟自己一方的射门的球员的位置一样
  1182. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dy_4 = tPoint_34.dy_4; // iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 == 0,是己方球队
  1183. /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
  1184. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dx_0 = 0;
  1185. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dy_4 = 0;
  1186. //LOGI("hook 0 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3, iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
  1187. }*/
  1188. // }
  1189. } else {
  1190. // 001DCF8A <- **结构体赋值**
  1191. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4 = TPoint(0, 0);
  1192. }
  1193. // 001DCFAE
  1194. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iHoldPosTime_C = XMLGetInt(cNodePlayer_3C, "HoldPosTime", NULL, 0);
  1195. // 001DCFBA
  1196. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iRot_10 = XMLGetInt(cNodePlayer_3C, "Rot", NULL, -1);
  1197. // 001DCFDC <- ** if **
  1198. if (XMLGetInt(cNodePlayer_3C, "TeamMoveInfluence", NULL, iPlayerNO_r10 ? 1 : 0)) {
  1199. // 001DCFDE
  1200. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iTeamMoveInfluence_14 = true;
  1201. } else {
  1202. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iTeamMoveInfluence_14 = false;
  1203. }
  1204. tPoint_98 = TPoint(0, 0); // 001DCFEC <- **结构体赋值**
  1205. // 001DCFE4 <- **tPoint_64 接收返回值**
  1206. tPoint_34 = XMLGetPos(cNodePlayer_3C, "MoveInfluence", NULL, tPoint_98);
  1207. // 001DCFFC <- **结构体比较,重载函数导致汇编不一致**
  1208. //if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0 != tPoint_34.dx_0) {
  1209. // 001DD004
  1210. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0 = tPoint_34.dx_0; // 001DD004
  1211. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4 = tPoint_34.dy_4; // 001DD00A
  1212. /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
  1213. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0 = 0;
  1214. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4 = 0;
  1215. //LOGI("hook 1 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3, iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
  1216. }*/
  1217. // } else {
  1218. // 001DD010 OK
  1219. // tPoint_34.dy_4 = tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4;
  1220. // }
  1221. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD026
  1222. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD032
  1223. // 001DD040 <- **结构体字段赋值**
  1224. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iMoveResponseTime_20 = XMLGetInt(cNodePlayer_3C, "MoveResponseTime", NULL, -1);
  1225. // 001DD052
  1226. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iKickResponseTime_24 = XMLGetInt(cNodePlayer_3C, "KickResponseTime", NULL, -1);
  1227. // 001DD06A
  1228. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_bStatic_28 = XMLGetInt(cNodePlayer_3C, "Static", NULL, 0) ? true : false;
  1229. const char* sFPATypes[3] = {"AI", "PASS", "SHOOT"};
  1230. // 001DD084
  1231. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iAction_534 = XMLGetStringInt(cNodePlayer_3C, "Action", NULL, (const char**)sFPATypes, 3, 0);
  1232. // 001DD094
  1233. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iActionPassTarget_538 = XMLGetInt(cNodePlayer_3C, "ActionPassTarget", NULL, 0);
  1234. // 001DD0A4
  1235. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iActionControlCount_53C = XMLGetInt(cNodePlayer_3C, "ActionControlCount", NULL, 0);
  1236. // 001DD0B6
  1237. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iActionControlRot_540 = XMLGetInt(cNodePlayer_3C, "ActionControlRot", NULL, -1);
  1238. // 001DD0CE
  1239. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_fActionControlKickAhead_544 = XMLGetFloat(cNodePlayer_3C, "ActionControlKickAhead", NULL, 0);
  1240. // 001DD0C8 <- **循环计数器初始化**
  1241. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeTDestSetLoopIndex_2C = 0;
  1242. // 001DD0D4 <- **call GetFirstChild()**
  1243. // 001DD1AA <- **call IsValid()**
  1244. for (auto cNode = cNodePlayer_3C.GetFirstChild("Move"); cNode.IsValid(); cNode = cNode.GetNextSibling("Move")) {
  1245. // 001DD0DA
  1246. int iTempIndex = tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeTDestSetLoopIndex_2C;
  1247. // 001DD0E4 <- **call XMLExits**
  1248. if (XMLExists(cNode, "Dest", NULL)) {
  1249. // 001DD0EC
  1250. // iTempIndex++;
  1251. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeTDestSetLoopIndex_2C++; // 001DD0F4
  1252. // auto ptr = (char*)(tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerMoveInfo_30) + sizeof(TFreeMoveInfo) * iTempIndex;
  1253. // auto pTFreeMoveInfo = (TFreeMoveInfo*)ptr;
  1254. // pTFreeMoveInfo->m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
  1255. // 001DD10E <- **字段赋值**
  1256. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
  1257. // 001DD11C <- **字段赋值**
  1258. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
  1259. // pTFreeMoveInfo->m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
  1260. // tPoint_98 = vZero; //001DD128 <- **结构体赋值**
  1261. // 001DD12C <- **tPoint_64接收返回值**
  1262. tPoint_34 = XMLGetPos(cNode, "Dest", NULL, g_vZero); // tPoint_98);
  1263. // 001DD13C <- **结构体比较**
  1264. // 001DD144
  1265. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tDestPoint_4.dx_0 = tPoint_34.dx_0; // player 2 bug
  1266. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tDestPoint_4.dy_4 = tPoint_34.dy_4;
  1267. // 001DD158 <- **字段赋值**
  1268. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL, 50);
  1269. // pTFreeMoveInfo->m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL, 50);
  1270. tPoint_98 = TPoint(0, 0); // 001DD164
  1271. tPoint_34 = XMLGetPos(cNode, "MoveInfluence", NULL, tPoint_98); // 001DD16A <- **call XMLGetPos()**
  1272. // 001DD174 <- **结构体比较**
  1273. //if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14 != tPoint_34) {
  1274. // 001DD178
  1275. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dx_0 = tPoint_34.dx_0; // 001DD178 001DD17C <- **赋值**
  1276. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dy_4 = tPoint_34.dy_4;
  1277. // } else {
  1278. // 001DD182
  1279. // tPoint_34.dy_4 = tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dy_4;
  1280. // }
  1281. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD18E
  1282. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD198
  1283. } // 001DD1AA <- **if XMLExists 代码块结束**
  1284. } // 001DD1B2 <- **循环结束**
  1285. // 001DD1B6 <- **字段赋值**
  1286. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeAnimSetLoopIndex_3B0 = 0;
  1287. // 001DD1C0 <- **call GetFirstChild()**
  1288. // 001DD264 <- **call IsValid()**
  1289. for (auto cNode = cNodePlayer_3C.GetFirstChild("Anim"); cNode.IsValid(); cNode = cNode.GetNextSibling("Anim")) {
  1290. // 001DD1C6
  1291. int index = tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeAnimSetLoopIndex_3B0;
  1292. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeAnimSetLoopIndex_3B0 += 1; // 001DD1CE
  1293. // 001DD1E8 <- **字段赋值**
  1294. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tAnim_3B4[index].m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
  1295. // 001DD1FA <- **字段赋值*
  1296. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tAnim_3B4[index].m_iRot_8 = XMLGetInt(cNode, "Rot", NULL, -1);
  1297. // 001DD208 <- **if 代码块起始地址**
  1298. char* pAnimStr = XMLGetString(cNode, "Anim", NULL, 0);
  1299. if (pAnimStr) {
  1300. // 001DD20A
  1301. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tAnim_3B4[index].m_iAnimID_4 = CAnimManager::GetAnimID(pAnimStr);
  1302. if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tAnim_3B4[index].m_iAnimID_4 == -1) {
  1303. // 001DD216
  1304. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeAnimSetLoopIndex_3B0--; // 001DD21C
  1305. // 001DD220 <- **该地址出现赋值0操作**
  1306. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tAnim_3B4[index].m_iAnimID_4 = 0;
  1307. }
  1308. } else {
  1309. // 001DD250
  1310. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_iNodeAnimSetLoopIndex_3B0--; // 001DD252
  1311. }
  1312. }
  1313. cNodePlayer_3C = cNodePlayer_3C.GetNextSibling("Player"); // 001DD274
  1314. iPlayerNO_r10++; // 001DD282 <- **计数器加一**
  1315. }
  1316. // 001DD2A0 <- **字段赋值**
  1317. tFreeGoal_r0->m_iTeamPlayerIndex_14[iTeamNO_r3] = iPlayerNO_r10;
  1318. // 001DD2AC <- **结构体赋值**
  1319. tPoint_98 = TPoint(0xA0000, 0xA0000);
  1320. // 001DD2B4 <- **call XMLGetPos()**
  1321. tPoint_34 = XMLGetPos(cNodeTeam_40, "MoveInfluence", NULL, tPoint_98);
  1322. // 001DD2C6 <-**结构体比较**
  1323. // if (tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0 != tPoint_34) {
  1324. // // 001DD2CA OK
  1325. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0;
  1326. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4;
  1327. // } else {
  1328. // // 001DD2DA OK
  1329. // tPoint_34.dy_4 = tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4;
  1330. // }
  1331. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD2EE
  1332. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD2FA
  1333. // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD2EE
  1334. // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD2FA
  1335. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_iMoveInfluenceDelayMin_8 = XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMin", 0, 10); // 001DD30E
  1336. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_iMoveInfluenceDelayMax_C = XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMax", 0, 25); // 001DD324
  1337. }
  1338. }
  1339. // 001DD338
  1340. FREE_SortPlayers(tFreeGoal_r0);
  1341. }
  1342. //-------------------------------------------------------------------------------------------------
  1343. // 00169A80 ^_-
  1344. //单元测试等级: 游戏运行正常
  1345. //单元测试内容: 1-10关
  1346. //单元测试结果: 正常
  1347. void PhysicsTest() {
  1348. LOGE("PhysicsTest_0"); // OK
  1349. fpointQ<PointType_18> fpointq_sp240;
  1350. fpointq_sp240.field_0 = 0;
  1351. fpointq_sp240.field_4 = 0;
  1352. fpointq_sp240.field_8 = 0;
  1353. fpointq_sp240.field_C = 0x40000;
  1354. fpoint3<PointType_18> fpoint3_sp25c;
  1355. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  1356. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  1357. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  1358. CFTTPObject *r6_pobject = new CFTTPObject(
  1359. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  1360. r6_pobject->fpoint3_1C.x_0 =
  1361. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  1362. r6_pobject->fpoint3_1C.y_4 =
  1363. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  1364. r6_pobject->fpoint3_1C.z_8 =
  1365. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  1366. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  1367. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  1368. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  1369. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  1370. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  1371. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  1372. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  1373. r6_pobject->field_34 = 0x94D65;
  1374. r6_pobject->field_38 = 0x37D2A4D;
  1375. fpoint<PointType_18> fpoint_sp23c;
  1376. fpoint3<PointType_18> fpoint3_sp230;
  1377. fpointQ<PointType_18> fpointQ_sp220;
  1378. fpointQ_sp220.field_0 = 0;
  1379. fpointQ_sp220.field_4 = 0;
  1380. fpointQ_sp220.field_8 = 0;
  1381. fpointQ_sp220.field_C = 0x40000;
  1382. fpoint3_sp230.x_0 = 0;
  1383. fpoint3_sp230.y_4 = 0;
  1384. fpoint3_sp230.z_8 = 0;
  1385. fpoint_sp23c.var_0 = 0x8000;
  1386. // check 传参是否都是用了栈
  1387. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  1388. fpointQ_sp220); //这里头文件更新
  1389. // 00169B60
  1390. r6_pobject->field_3C = 0x8000;
  1391. r0_psphere->field_64 = 0x8000;
  1392. r6_pobject->field_44 = 0x10000;
  1393. r6_pobject->field_40 = 0x40000;
  1394. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  1395. r0_psphere->filed_4 = r6_pobject;
  1396. // sp1c=r6_pobject
  1397. CFTTPhysics physics_sp218(0x40);
  1398. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  1399. // 00169B98
  1400. pfpoint3_sp34[14].z_8 = 0;
  1401. pfpoint3_sp34[15].x_0 = 0;
  1402. pfpoint3_sp34[15].y_4 = 0;
  1403. pfpoint3_sp34[15].z_8 = 0;
  1404. pfpoint3_sp34[13].z_8 = 0;
  1405. pfpoint3_sp34[14].x_0 = 0;
  1406. pfpoint3_sp34[14].y_4 = 0;
  1407. pfpoint3_sp34[14].z_8 = 0;
  1408. pfpoint3_sp34[12].y_4 = 0;
  1409. pfpoint3_sp34[12].z_8 = 0;
  1410. pfpoint3_sp34[13].x_0 = 0;
  1411. pfpoint3_sp34[13].y_4 = 0;
  1412. // 00169C06
  1413. pfpoint3_sp34[11].x_0 = 0;
  1414. pfpoint3_sp34[11].y_4 = 0;
  1415. pfpoint3_sp34[11].z_8 = 0;
  1416. pfpoint3_sp34[12].x_0 = 0;
  1417. // 00169C16
  1418. pfpoint3_sp34[1].y_4 = 0x20000;
  1419. pfpoint3_sp34[2].z_8 = 0x3333;
  1420. pfpoint3_sp34[2].x_0 = 0x18000;
  1421. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  1422. // 00169C2C
  1423. pfpoint3_sp34[2].z_8 = 0x3333;
  1424. pfpoint3_sp34[3].x_0 = 0x10000;
  1425. pfpoint3_sp34[3].y_4 = 0x72AAA;
  1426. pfpoint3_sp34[3].z_8 = 0x3333;
  1427. // 00169C34
  1428. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  1429. pfpoint3_sp34[4].y_4 = 0x72AAA;
  1430. pfpoint3_sp34[4].z_8 = 0x3333;
  1431. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  1432. // 00169C3C
  1433. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  1434. pfpoint3_sp34[4].z_8 = 0x3333;
  1435. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  1436. pfpoint3_sp34[5].y_4 = 0x20000;
  1437. // 00169C44
  1438. pfpoint3_sp34[5].z_8 = 0x3333;
  1439. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  1440. pfpoint3_sp34[6].y_4 = 0;
  1441. pfpoint3_sp34[6].z_8 = 0x3333;
  1442. // 00169C4C
  1443. pfpoint3_sp34[7].x_0 = 0x10000;
  1444. pfpoint3_sp34[7].y_4 = 0;
  1445. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1446. pfpoint3_sp34[7].x_0 = 0x18000;
  1447. // 00169C5A
  1448. pfpoint3_sp34[7].y_4 = 0x20000;
  1449. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1450. pfpoint3_sp34[8].x_0 = 0x18000;
  1451. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  1452. // 00169C60
  1453. pfpoint3_sp34[0].x_0 = 0x10000;
  1454. pfpoint3_sp34[0].y_4 = 0;
  1455. pfpoint3_sp34[0].z_8 = 0x3333;
  1456. pfpoint3_sp34[1].x_0 = 0x18000;
  1457. // 00169C68
  1458. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  1459. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  1460. pfpoint3_sp34[15].y_4 = 0;
  1461. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  1462. // 00169C6C
  1463. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  1464. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  1465. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  1466. pfpoint3_sp34[14].y_4 = 0x20000;
  1467. // 00169C74
  1468. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  1469. pfpoint3_sp34[12].y_4 = 0x72AAA;
  1470. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  1471. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  1472. // 00169C7C
  1473. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  1474. pfpoint3_sp34[11].x_0 = 0x10000;
  1475. pfpoint3_sp34[11].y_4 = 0x72AAA;
  1476. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  1477. // sp48=FREE_tInfo
  1478. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  1479. // 00169C90
  1480. // loc_16A21E
  1481. LOGE("PhysicsTest_case");
  1482. for (int r2_i = 0;
  1483. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  1484. r2_i++) {
  1485. // loc_169CC0
  1486. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1487. .m_iType_C) {
  1488. case 0: // loc_169EC0
  1489. {
  1490. // check 手机左移
  1491. // sp4c = r2
  1492. // check 运算
  1493. LOGE("PhysicsTest_case_0");
  1494. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1495. .m_iRot_10 *
  1496. 0x40000 / 0xB4;
  1497. uint64 r3r1_ull = 0x3243F4000;
  1498. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1499. int r4_i = r1r0_ll / 2;
  1500. int i_sp1b0;
  1501. int i_sp214 = r4_i;
  1502. sub_16A57C(i_sp1b0, i_sp214);
  1503. sub_16A6CC(i_sp214, r4_i);
  1504. fpoint3<PointType_18> fpoint3_spc0;
  1505. fpointQ<PointType_18> fpointQ_spb0;
  1506. // check 乘法
  1507. fpoint3_spc0.x_0 =
  1508. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1509. .m_tPoint3D_0.point_0.dx_0 *
  1510. 8;
  1511. fpoint3_spc0.y_4 =
  1512. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1513. .m_tPoint3D_0.dz_8 *
  1514. 8;
  1515. fpoint3_spc0.z_8 =
  1516. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1517. .m_tPoint3D_0.point_0.dy_4 *
  1518. 8;
  1519. fpointQ_spb0.field_0 = 0;
  1520. fpointQ_spb0.field_4 = i_sp1b0;
  1521. fpointQ_spb0.field_8 = 0;
  1522. fpointQ_spb0.field_C = i_sp214;
  1523. CFTTPObject *r4_pobject = new CFTTPObject(
  1524. EPhysicsObjectType_2,
  1525. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1526. .m_iType_C,
  1527. 2, fpoint3_spc0, fpointQ_spb0);
  1528. // 00169F5C
  1529. r4_pobject->field_34 = 0;
  1530. r4_pobject->field_38 = 0;
  1531. r4_pobject->field_3C = 0x40000;
  1532. r4_pobject->field_40 = 0x4000; // dword_16A448
  1533. r4_pobject->field_44 = 0x20000;
  1534. fpoint<PointType_18> fpoint_spac;
  1535. fpoint<PointType_18> fpoint_spa8;
  1536. fpoint<PointType_18> fpoint_spa4;
  1537. fpoint3<PointType_18> fpoint3_sp98;
  1538. fpointQ<PointType_18> fpointQ_sp80;
  1539. fpoint3_sp98.x_0 = 0;
  1540. fpoint_spac.var_0 = 0x3333;
  1541. fpoint_spa8.var_0 = 0x6666;
  1542. fpoint_spa4.var_0 = 0x15555;
  1543. fpointQ_sp80.field_0 = 0;
  1544. fpointQ_sp80.field_4 = 0;
  1545. fpointQ_sp80.field_8 = 0;
  1546. fpointQ_sp80.field_C = 0x40000;
  1547. fpoint3_sp98.y_4 = 0xEAAA;
  1548. fpoint3_sp98.z_8 = 0;
  1549. // fpointQ_sp80
  1550. CFTTPPCone *r5_pcone =
  1551. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  1552. fpoint3_sp98, fpointQ_sp80);
  1553. fpoint3<PointType_18> fpoint3_sp74;
  1554. fpoint3<PointType_18> fpoint3_sp68;
  1555. fpointQ<PointType_18> fpointQ_sp50;
  1556. fpoint3_sp74.x_0 = 0xCCCC;
  1557. fpointQ_sp50.field_0 = 0;
  1558. fpointQ_sp50.field_4 = 0;
  1559. fpointQ_sp50.field_8 = 0;
  1560. fpointQ_sp50.field_C = 0x40000;
  1561. fpoint3_sp74.y_4 = 0x4000;
  1562. fpoint3_sp74.z_8 = 0xCCCC;
  1563. fpoint3_sp68.x_0 = 0;
  1564. fpoint3_sp68.y_4 = 0x2000;
  1565. fpoint3_sp68.z_8 = 0;
  1566. CFTTPPBox *r0_pbox =
  1567. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  1568. r5_pcone->field_64 = 0x15555;
  1569. r0_pbox->field_64 = 0xCCCC;
  1570. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  1571. r0_pbox->filed_4 = r4_pobject;
  1572. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  1573. r5_pcone->filed_4 = r4_pobject;
  1574. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1575. r4_pobject;
  1576. break;
  1577. }
  1578. case 2: // loc_16A030
  1579. {
  1580. LOGE("PhysicsTest_case_2");
  1581. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1582. .m_iRot_10 *
  1583. 0x40000 / 0xB4;
  1584. uint64 r3r1_ull = 0x3243F4000;
  1585. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1586. int r4_i = r1r0_ll / 2;
  1587. int i_sp214;
  1588. int i_sp1b0 = r4_i;
  1589. sub_16A57C(i_sp214, i_sp1b0);
  1590. int i_sp210;
  1591. i_sp1b0 = r4_i;
  1592. sub_16A6CC(i_sp210, i_sp1b0);
  1593. // sp40=i_sp210
  1594. // sp3c=sp214
  1595. fpoint3<PointType_18> fpoint3_sp154;
  1596. fpoint3<PointType_18> fpoint3_sp148;
  1597. fpointQ<PointType_18> fpointQ_sp138;
  1598. fpointQ<PointType_18> fpointQ_sp1b0;
  1599. fpoint3_sp154.x_0 = 0x70000;
  1600. fpoint3_sp154.y_4 = 0x20000;
  1601. fpoint3_sp154.z_8 = 0x6666;
  1602. fpointQ_sp1b0.field_0 = 0x3333;
  1603. fpointQ_sp1b0.field_4 = 0;
  1604. fpointQ_sp1b0.field_8 = 0;
  1605. fpointQ_sp1b0.field_C = 0x40000;
  1606. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  1607. CFTTPPBox *pbox_sp38 =
  1608. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  1609. // 0016A0DC
  1610. pbox_sp38->field_64 = 0x70000;
  1611. fpoint3<PointType_18> fpoint3_sp12c;
  1612. fpoint3<PointType_18> fpoint3_sp120;
  1613. fpointQ<PointType_18> fpointQ_sp110;
  1614. fpoint3_sp120.x_0 = 0xFFFD0000;
  1615. fpoint3_sp12c.x_0 = 0x6666;
  1616. fpoint3_sp12c.y_4 = 0x20000;
  1617. fpoint3_sp12c.z_8 = 0x15555;
  1618. fpoint3_sp120.y_4 = 0x10000;
  1619. fpoint3_sp120.z_8 = 0xAAAA;
  1620. fpointQ_sp1b0.field_0 = 0x3333;
  1621. fpointQ_sp1b0.field_4 = 0;
  1622. fpointQ_sp1b0.field_8 = 0;
  1623. fpointQ_sp1b0.field_C = 0x40000;
  1624. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  1625. // 0016A120
  1626. CFTTPPBox *r4_pbox =
  1627. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  1628. // 0016A122
  1629. fpoint3<PointType_18> fpoint3_sp104;
  1630. fpoint3<PointType_18> fpoint3_spf8;
  1631. fpointQ<PointType_18> fpointQ_spe8;
  1632. fpoint3_sp104.x_0 = 0x6666;
  1633. fpoint3_sp104.y_4 = 0x20000;
  1634. fpoint3_sp104.z_8 = 0x15555;
  1635. fpoint3_spf8.x_0 = 0x30000;
  1636. fpoint3_spf8.y_4 = 0x10000;
  1637. fpoint3_spf8.z_8 = 0xAAAA;
  1638. fpointQ_sp1b0.field_0 = 0x3333;
  1639. fpointQ_sp1b0.field_4 = 0;
  1640. fpointQ_sp1b0.field_8 = 0;
  1641. fpointQ_sp1b0.field_C = 0x40000;
  1642. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  1643. // 0016A164
  1644. CFTTPPBox *r6_pbox =
  1645. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  1646. // 0016A166
  1647. r4_pbox->field_64 = 0x15555;
  1648. r6_pbox->field_64 = 0x15555;
  1649. fpoint3<PointType_18> fpoint3_spdc;
  1650. fpointQ<PointType_18> fpointQ_spcc;
  1651. fpointQ_spcc.field_4 = i_sp214;
  1652. fpointQ_spcc.field_C = i_sp210;
  1653. fpoint3_spdc.x_0 =
  1654. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1655. .m_tPoint3D_0.point_0.dx_0 *
  1656. 8;
  1657. fpoint3_spdc.z_8 =
  1658. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1659. .m_tPoint3D_0.point_0.dy_4 *
  1660. 8;
  1661. fpoint3_spdc.y_4 =
  1662. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1663. .m_tPoint3D_0.dz_8 *
  1664. 8;
  1665. fpointQ_spcc.field_0 = 0;
  1666. fpointQ_spcc.field_8 = 0;
  1667. CFTTPObject *r0_pobject = new CFTTPObject(
  1668. EPhysicsObjectType_2,
  1669. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1670. .m_iType_C,
  1671. 3, fpoint3_spdc, fpointQ_spcc);
  1672. // 0016A1B0
  1673. r0_pobject->field_34 = 0;
  1674. r0_pobject->field_38 = 0;
  1675. r0_pobject->field_3C = 0x70000;
  1676. r0_pobject->field_40 = 0x30000;
  1677. r0_pobject->field_44 = 0x4000;
  1678. r0_pobject->field_A0 = 0x18;
  1679. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  1680. pbox_sp38->filed_4 = r0_pobject;
  1681. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  1682. r4_pbox->filed_4 = r0_pobject;
  1683. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  1684. r6_pbox->filed_4 = r0_pobject;
  1685. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1686. r0_pobject;
  1687. break;
  1688. }
  1689. case 1: // 00169CDA
  1690. {
  1691. // sp4c = r2
  1692. // check 运算
  1693. LOGE("PhysicsTest_case_1");
  1694. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1695. .m_iRot_10 *
  1696. 0x40000 / 0xB4;
  1697. uint64 r3r1_ull = 0x3243F4000;
  1698. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1699. int r4_i = r1r0_ll / 2;
  1700. int i_sp214;
  1701. int i_sp210;
  1702. sub_16A57C(i_sp214, r4_i);
  1703. sub_16A6CC(i_sp210, r4_i);
  1704. fpoint3<PointType_18> fpoint3_sp204;
  1705. fpointQ<PointType_18> fpointQ_sp1f4;
  1706. fpointQ_sp1f4.field_0 = 0;
  1707. fpointQ_sp1f4.field_4 = i_sp214;
  1708. fpointQ_sp1f4.field_8 = 0;
  1709. fpointQ_sp1f4.field_C = i_sp210;
  1710. TPoint3D point3D =
  1711. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1712. .m_tPoint3D_0;
  1713. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  1714. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  1715. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  1716. CFTTPObject *r11_pobject = new CFTTPObject(
  1717. EPhysicsObjectType_2,
  1718. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1719. .m_iType_C,
  1720. 3, fpoint3_sp204, fpointQ_sp1f4);
  1721. int i_sp1b0;
  1722. int i_sp1f0 = 0x7F1AA;
  1723. sub_16A818(&i_sp1b0, &i_sp1f0);
  1724. r11_pobject->field_34 = 0;
  1725. r11_pobject->field_38 = 0;
  1726. r11_pobject->field_3C = i_sp1b0;
  1727. r11_pobject->field_40 = 0x10000;
  1728. r11_pobject->field_44 = 0x10000;
  1729. r11_pobject->field_A0 = 0x18;
  1730. fpoint<PointType_18> fpoint_sp1ec;
  1731. fpoint<PointType_18> fpoint_sp1e8;
  1732. fpoint3<PointType_18> fpoint3_sp1dc;
  1733. fpointQ<PointType_18> fpointQ_sp1cc;
  1734. fpoint_sp1ec.var_0 = 0x10000;
  1735. fpoint3_sp1dc.x_0 = 0;
  1736. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  1737. fpoint3_sp1dc.z_8 = 0;
  1738. fpoint_sp1e8.var_0 = 0x6666;
  1739. fpointQ<PointType_18> fpointQ_sp1b0;
  1740. fpointQ_sp1b0.field_0 = 0x40000;
  1741. fpointQ_sp1b0.field_4 = 0;
  1742. fpointQ_sp1b0.field_8 = 0;
  1743. fpointQ_sp1b0.field_C = 0x40000;
  1744. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1745. // check 前俩个参数传递是否使用栈
  1746. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1747. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1748. fpoint3<PointType_18> fpoint3_sp1a4;
  1749. fpoint3<PointType_18> fpoint3_sp198;
  1750. fpointQ<PointType_18> fpointQ_sp180;
  1751. fpoint3_sp1a4.z_8 = 0x6666;
  1752. // 00169DF4
  1753. fpointQ_sp180.field_0 = 0;
  1754. fpointQ_sp180.field_4 = 0;
  1755. fpointQ_sp180.field_8 = 0;
  1756. fpointQ_sp180.field_C = 0x40000;
  1757. fpoint3_sp1a4.x_0 = 0x20000;
  1758. fpoint3_sp1a4.y_4 = 0x20000;
  1759. fpoint3_sp198.x_0 = 0;
  1760. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1761. fpoint3_sp198.z_8 = 0;
  1762. CFTTPPBox *r5_pbox =
  1763. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1764. // 00169E14
  1765. fpoint3<PointType_18> fpoint3_sp174;
  1766. fpointQ<PointType_18> fpointQ_sp160;
  1767. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1768. fpoint3_sp174.x_0 = 0;
  1769. fpoint3_sp174.z_8 = 0;
  1770. fpointQ_sp160.field_0 = 0;
  1771. fpointQ_sp160.field_4 = 0;
  1772. fpointQ_sp160.field_8 = 0;
  1773. fpointQ_sp160.field_C = 0x40000;
  1774. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1775. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1776. // 00169E32
  1777. r4_pcylinder->field_64 = 0x10000;
  1778. r5_pbox->field_64 = 0x20000;
  1779. r0_ppolyhedron->field_64 = 0xABFFF;
  1780. // 00169E42
  1781. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1782. r5_pbox->filed_4 = r11_pobject;
  1783. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1784. r0_ppolyhedron->filed_4 = r11_pobject;
  1785. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1786. r4_pcylinder->filed_4 = r11_pobject;
  1787. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1788. r11_pobject;
  1789. break;
  1790. }
  1791. }
  1792. }
  1793. }
  1794. // loc_16A232
  1795. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  1796. if (physics_sp218.Process()) {
  1797. // 0016A24E
  1798. // sp18=cBall
  1799. LOGE("PhysicsTest_1");
  1800. cBall.ballPosPrev_4.point_0.dx_0 =
  1801. r6_pobject->fpoint3_0.x_0 /
  1802. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  1803. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  1804. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  1805. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  1806. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  1807. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  1808. fpointQ<PointType_18> fpointQ_sp1b0;
  1809. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  1810. // check 除法
  1811. // 0016A2AA
  1812. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  1813. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  1814. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  1815. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  1816. // check
  1817. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  1818. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  1819. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  1820. // loc_16A344
  1821. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  1822. // loc_16A30C
  1823. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  1824. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  1825. if (FREE_tInfo.filed_0.gamestatus_1828 <= 8) {
  1826. // check
  1827. if ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) {
  1828. LOGE("PhysicsTest_2");
  1829. tGame.field_6C98 = 0;
  1830. tGame.mTLogic_6678.freeproptype_74 =
  1831. physics_sp218.ppobject_0[r5_i]->field_90;
  1832. }
  1833. }
  1834. }
  1835. }
  1836. }
  1837. }
  1838. // loc_16A348
  1839. delete[] pfpoint3_sp34;
  1840. }
  1841. //-------------------------------------------------------------------------------------------------