FREE.cpp 86 KB

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