FREE.cpp 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535
  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. int s_iEVFStrings[160] = {
  22. 0x184B, 0x184C, 0x1858, 0, 0, 0, 0, 0, 0, 0,
  23. 0x1859, 0x185A, 0, 0, 0, 0, 0, 0, 0, 0, 0x1854,
  24. 0x1855, 0x1856, 0, 0, 0, 0, 0, 0, 0,
  25. 0x184F, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  26. 0x1850, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  27. 0x184E, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  28. 0x186B, 0x186C, 0, 0, 0, 0, 0, 0, 0, 0,
  29. 0x184D, 0x1851, 0x1852, 0x1853, 0x1857, 0x186A, 0, 0, 0, 0,
  30. 0x185B, 0x185C, 0x185D, 0x185E, 0x1864, 0x1869, 0, 0, 0, 0,
  31. 0x1860, 0x1861, 0x1862, 0x1865, 0x1866, 0, 0, 0, 0, 0,
  32. 0x1863, 0x1868, 0x1867, 0x185F, 0, 0, 0, 0, 0, 0,
  33. 0x1867, 0x1861, 0x1859, 0x185A, 0, 0, 0, 0, 0, 0,
  34. 0xFB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1878, 0x1879,
  35. 0, 0, 0, 0, 0, 0, 0, 0, 0x1876, 0x1877, 0, 0, 0, 0, 0, 0, 0, 0,
  36. 0x186D, 0x186E, 0x186F, 0x1870, 0x1871, 0x1873, 0x1874, 0x1875, 0x1872, 0};
  37. // FREE_tInfo 0x1D20
  38. // FREE_tGoal 0x7634
  39. int FREE_iTeam ;
  40. TFreeGoal FREE_tGoal;
  41. TFreeInfo FREE_tInfo;
  42. CFTTModel *FREE_pStarModel;
  43. int FREE_iPropWeather;
  44. const char *s_sPropModels_SNOW[3] = {
  45. "PKG:/data/env/dressing/cone_snow.ftm",
  46. "PKG:/data/env/dressing/mannequin_snow.ftm",
  47. "PKG:/data/env/dressing/rebounder.ftm"};
  48. CFTTModel *FREE_pPropModel[3];
  49. const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
  50. "PKG:/data/env/dressing/mannequin.ftm",
  51. "PKG:/data/env/dressing/rebounder.ftm"};
  52. const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
  53. "PKG:/data/env/dressing/mannequin_s.ftm",
  54. "PKG:/data/env/dressing/rebounder.ftm"};
  55. CFTTModel *FREE_pPropModelShadow[3];
  56. //-------------------------------------------------------------------------------------------------
  57. // 001D2758
  58. int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
  59. //-------------------------------------------------------------------------------------------------
  60. // 001D27EC
  61. void FREE_GetWorldRot(TPoint, TPoint) {}
  62. //-------------------------------------------------------------------------------------------------
  63. // 001D281C
  64. void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
  65. //-------------------------------------------------------------------------------------------------
  66. // 001D2A98
  67. int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
  68. //-------------------------------------------------------------------------------------------------
  69. // 001D2BC0
  70. void FREE_ResolveEndPoint(TPoint3D *, TPoint3D *, TPoint *, int *, bool) {}
  71. //-------------------------------------------------------------------------------------------------
  72. // 001D30B8
  73. void FREE_GetKickPower(EAnimID, int *, int *) {}
  74. //-------------------------------------------------------------------------------------------------
  75. // 001D30FC
  76. void FREE_ProcessControls(bool) {}
  77. //-------------------------------------------------------------------------------------------------
  78. // 001D3EC8
  79. int FREE_CalcKickTargetTime(int) { return 0; }
  80. //-------------------------------------------------------------------------------------------------
  81. // 001D3EEC
  82. void FREE_ResetControls() {}
  83. //-------------------------------------------------------------------------------------------------
  84. // 001D3F24
  85. int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
  86. return 0;
  87. }
  88. //-------------------------------------------------------------------------------------------------
  89. // 001D3FA8
  90. void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
  91. int *var_58 = pi1;
  92. int *var_54 = pi2;
  93. int *var_50 = pi3;
  94. int var_2C = 0;
  95. int var_28 = 0;
  96. TPoint3D var_38;
  97. TPoint3D var_48;
  98. int r0_i = player0->tStr32_44.field_10;
  99. FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
  100. var_28 = 100;
  101. int r4_i = 21627;
  102. var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
  103. r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
  104. // 001D3FF0
  105. if (r0_i < r4_i) {
  106. // 001D3FF4
  107. r4_i = r0_i;
  108. }
  109. // 001D3FF6
  110. var_48.dz_8 = r4_i;
  111. r0_i = 0;
  112. int r7_i = 163840;
  113. int r6_i = 0;
  114. r4_i = 0;
  115. var_48.point_0.dx_0 = r0_i;
  116. int r1_i;
  117. // loc_1D40EA
  118. while (r7_i != 1998848) {
  119. // loc_1D4006
  120. int r2_i = FREE_CalcKickTargetTime(r7_i);
  121. int r9_i = 4096;
  122. // r5 = cball
  123. int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
  124. int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  125. int r10_i = r7_i + r3_i;
  126. // 356A7C - 0x356A70
  127. r0_i = cBall.ballPosPrev_4.dz_8;
  128. int var_3C = r6_i;
  129. int r11_i;
  130. // 001D4024
  131. if (r0_i < 32768) {
  132. // 001D402A
  133. TPoint3D tp1;
  134. // int var_4C = r2_i;
  135. tp1.point_0.dx_0 = r8_i;
  136. tp1.point_0.dy_4 = r3_i;
  137. tp1.dz_8 = r0_i;
  138. TPoint3D tp2;
  139. tp2.point_0.dx_0 = r8_i;
  140. tp2.point_0.dy_4 = r10_i;
  141. tp2.dz_8 = r9_i;
  142. /*
  143. * 描述:此处在连续入栈时STRD和STM有出入
  144. * 原始汇编: STMEA.W SP, {R0,R8,R10}
  145. * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
  146. */
  147. int var_4C = r2_i;
  148. r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
  149. r11_i = r7_i;
  150. r1_i = var_48.point_0.dx_0;
  151. // 001D404A
  152. if (r0_i < var_48.dz_8) {
  153. // 001D4050
  154. r1_i = r7_i;
  155. }
  156. var_48.point_0.dx_0 = r1_i;
  157. r1_i = var_48.point_0.dy_4;
  158. // 001D4056
  159. if (r0_i < r1_i) {
  160. // 001D405A
  161. r11_i = r4_i;
  162. }
  163. // 001D405C
  164. if (r4_i != 0) {
  165. // 001D4060
  166. r11_i = r4_i;
  167. }
  168. // 001D4062
  169. r2_i = cBall.ballPosPrev_4.point_0.dx_0;
  170. r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  171. r1_i = r8_i;
  172. r0_i = cBall.ballPosPrev_4.dz_8;
  173. r8_i = r2_i;
  174. r2_i = var_4C;
  175. } else {
  176. // loc_1D4070
  177. r1_i = r8_i;
  178. r11_i = r4_i;
  179. }
  180. // 001D4076
  181. TPoint3D var_78;
  182. var_78.point_0.dx_0 = r8_i;
  183. var_78.point_0.dy_4 = r3_i;
  184. var_78.dz_8 = r0_i;
  185. TPoint3D var_6C;
  186. var_6C.point_0.dx_0 = r1_i;
  187. var_6C.point_0.dy_4 = r10_i;
  188. var_6C.dz_8 = r9_i;
  189. r4_i = r2_i;
  190. int r5_i =
  191. cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
  192. r0_i = r0_i * 2;
  193. r1_i = (uint)r0_i / (uint)5u;
  194. // r0_i = var_38.dz_8 ;
  195. r0_i = r7_i;
  196. // 001D40A4
  197. if (var_38.dz_8 > r1_i) {
  198. // 001D40AA
  199. r5_i = XMATH_Mag3D(&var_38);
  200. r0_i = var_38.dz_8;
  201. r0_i = r0_i / 49;
  202. r0_i = r0_i * r7_i;
  203. r0_i = r0_i / r4_i;
  204. } // loc_1D40C4
  205. r4_i = r0_i;
  206. r1_i = var_48.point_0.dy_4;
  207. r7_i += 32768;
  208. // 001D40CC
  209. if (r5_i < r1_i) {
  210. // 001D40D0
  211. r4_i = r11_i;
  212. }
  213. // 001D40D2
  214. if (r11_i != 0) {
  215. // 001D40D8
  216. r4_i = r11_i;
  217. }
  218. r6_i = var_3C;
  219. // 001D40DC
  220. if (r0_i <= r6_i) {
  221. // 001D40E0
  222. r0_i = r6_i;
  223. }
  224. r1_i = var_48.dz_8;
  225. // 001D40EA
  226. if (r5_i < r1_i) {
  227. // 001D40E8
  228. r6_i = r0_i;
  229. }
  230. } // loc_1D4006
  231. r0_i = r4_i << 1u;
  232. r1_i = 3;
  233. r0_i = r0_i / r1_i;
  234. int *r1_pi = var_58;
  235. *r1_pi = r0_i;
  236. r1_i = var_48.point_0.dx_0;
  237. // 001D40EA
  238. if (r1_i >= 1146880) {
  239. // 001D40F0
  240. r1_i = 1146880;
  241. }
  242. *var_54 = r1_i;
  243. *var_50 = r6_i;
  244. }
  245. //-------------------------------------------------------------------------------------------------
  246. // 001D4120
  247. void FREE_Init() {}
  248. //-------------------------------------------------------------------------------------------------
  249. // 001D4160
  250. void FREE_Shutdown() {}
  251. //-------------------------------------------------------------------------------------------------
  252. // 001D41B0
  253. void FREE_InitGoal(int, bool, bool, bool) {}
  254. //-------------------------------------------------------------------------------------------------
  255. // 001D4318 //^_-
  256. //单元测试等级:目测游戏表现
  257. //测试内容:启动游戏到第1关传球射门
  258. //测试结果: 游戏表现正常无崩溃且无明显变化,检测到日志输出
  259. //测试分支: 001D4318
  260. void FREE_SetupDifficulty() {
  261. /*
  262. * 描述:此处自己的汇编变量赋值上顺序有不同,多种尝试,不太容易完全一致
  263. */
  264. FREE_tInfo.field_1C9C.m_iCPUPlayerCloseDownCount_1CF8 = FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
  265. FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =FREE_tGoal.m_fCPUCloseDownDist_7480;
  266. FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 = FREE_tGoal.m_iCPUKickResponseTime_749C;
  267. FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C = FREE_tGoal.m_iCPUMoveResponseTime_74A0;
  268. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
  269. //注意!!!!!这里的数据符号不对 注意更新 FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
  270. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
  271. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
  272. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490;
  273. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =FREE_tGoal.m_fCPUGKSaveDistance_7494;
  274. uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
  275. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498;
  276. // 001D43B6
  277. if (r5_c != 0) {
  278. // 001D43B8
  279. // float s0_f = 2.8;
  280. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =FREE_tGoal.m_iCPUGKRating_7484 - 5;
  281. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C + 4;
  282. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
  283. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 -0.200000003f;
  284. // 001D43E6
  285. if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
  286. // 001D43FA
  287. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
  288. } else
  289. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
  290. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490 -5.0f;
  291. }
  292. // locret_1D4410
  293. }
  294. //-------------------------------------------------------------------------------------------------
  295. // 001D4424
  296. void FREE_Initialise() {}
  297. //-------------------------------------------------------------------------------------------------
  298. // 001D49C0
  299. void FREE_UpdateCamera(bool) {}
  300. //-------------------------------------------------------------------------------------------------
  301. // 001D56CC
  302. void FREE_ClipPathBounds(TPoint3D *, TPoint3D *, int, int, int, int) {}
  303. //-------------------------------------------------------------------------------------------------
  304. // 001D5718
  305. // void FREE_GameLoop() {
  306. // int r0_i = 0;
  307. // int r1_i = 0;
  308. // int r2_i = 0;
  309. // // 001D571E
  310. // if (NIS_Active() != 0) {
  311. // // 001D5720
  312. // // NIS_GameLoop();
  313. // CFreeHUD::Process();
  314. // // 47F7D8 - 0x47DFB0
  315. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  316. // // 001D5734
  317. // if (r0_i == 6) {
  318. // // 001D5738
  319. // FREE_ProcessFail();
  320. // r1_i = FREE_tInfo.filed_0.field_182C;
  321. // r1_i = r1_i + 1;
  322. // FREE_tInfo.filed_0.field_182C = r1_i;
  323. // return;
  324. // } else {
  325. // // locret_1D582E
  326. // return;
  327. // }
  328. // }
  329. // // loc_1D5748
  330. // // 47F7D8 - 0x47DFB0 = 1828
  331. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  332. // // 001D5754
  333. // if (r0_i != 8) {
  334. // // 001D5758
  335. // tGame.maybe_sound_0++;
  336. // }
  337. // // loc_1D5764
  338. // // 004877F5
  339. // NISGOAL_tInfo.field_1 = 0;
  340. // // 47DFB1 - 0x47DFB0
  341. // FREE_tInfo.filed_0.b_1 = 1;
  342. // // 001D5776
  343. // if (CReplay::Playing() != 0) {
  344. // // 001D5778
  345. // CReplay::Play();
  346. // }
  347. // // loc_1D577C
  348. // // 47F7D8 - 0x47DFB0
  349. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  350. // // 001D5782
  351. // if (r0_i == 7) {
  352. // // 47F7DC - 0x47DFB0
  353. // r1_i = FREE_tInfo.filed_0.field_182C;
  354. // // 3A27BC - 0x39BB88
  355. // r2_i = tGame.field_6C34;
  356. // // 001D5798
  357. // if (r2_i < r1_i) {
  358. // // 001D579C
  359. // r0_i = tGame.mTLogic_6678.field_50;
  360. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  361. // if (r1_i == r0_i) {
  362. // // 001D57C6
  363. // CGFXFX::EnableStarPlayerEffects();
  364. // }
  365. // } else {
  366. // // loc_1D57B0
  367. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  368. // r1_i = FREE_tInfo.filed_0.field_1830;
  369. // if (r1_i == r0_i) {
  370. // // 001D57C6
  371. // CGFXFX::EnableStarPlayerEffects();
  372. // }
  373. // }
  374. // }
  375. // // loc_1D57CA
  376. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  377. // float r0_f = 0.01666666753590107;
  378. // CGFXFX::Update(r0_f);
  379. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  380. // GFXCAMERA_UpdateMatrices();
  381. // int r4_i = FREE_ProcessLogic();
  382. // // 47FC60 - 0x47DFB0
  383. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  384. // // 001D57F2
  385. // if (r4_i != 0) {
  386. // // 001D57F8
  387. // if (CReplay::Playing() != 0) {
  388. // // loc_1D57FA
  389. // CAM_Update();
  390. // return;
  391. // }
  392. // } else {
  393. // // loc_1D57FA
  394. // CAM_Update();
  395. // return;
  396. // }
  397. // // loc_1D5802
  398. // // 3A2208 - 0x39BB88
  399. // r0_i = tGame.mTLogic_6678.field_8;
  400. // // 001D580E
  401. // if (r0_i == 2) {
  402. // // 001D5812
  403. // // 3A2238 - 0x39BB88
  404. // r0_i = tGame.mTLogic_6678.field_38;
  405. // // 001D5818
  406. // if (r0_i <= 29) {
  407. // // 001D581C
  408. // CReplay::RecordFrame();
  409. // }
  410. // } else {
  411. // // loc_1D5822
  412. // CReplay::RecordFrame();
  413. // }
  414. // // loc_1D5826
  415. // // 3A22A0 - 0x39BB88
  416. // r0_i = tGame.mTLogic_6678.field_A0;
  417. // // 001D582C
  418. // if (r0_i != 0) {
  419. // // locret_1D582E
  420. // return;
  421. // }
  422. // // loc_1D5830
  423. // CPlayerManager::UpdatePlayersLogic();
  424. // FREE_CheckCollision();
  425. // cBall.UpdateFrame();
  426. // // 47F7D8 - 0x47DFB0
  427. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  428. // // 001D584A
  429. // if (r0_i != 4) {
  430. // // 001D584E
  431. // COL_PlayerCollisions();
  432. // }
  433. // // 001D5852
  434. // PhysicsTest();
  435. // cBall.CheckEvents();
  436. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  437. // GFXNET::Update(0.01666666753590107f);
  438. // GL_UpdatePlayMode();
  439. // GM_CalcPlayerDist();
  440. // GM_CalcPlayerBallInterceptions();
  441. // FREE_LogicProcess();
  442. // // 3A2204 - 0x39BB88
  443. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  444. // // 001D5878
  445. // if (r0_i == 0) {
  446. // // 001D587C
  447. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  448. // // 001D5882
  449. // if (r0_i >= 4) {
  450. // // 001D5886
  451. // CPlayerManager::UpdatePlayers();
  452. // }
  453. // // 001D588A
  454. // COMM_Process();
  455. // }
  456. // // loc_1D57FA
  457. // CAM_Update();
  458. // return;
  459. // }
  460. //-------------------------------------------------------------------------------------------------
  461. // 001D58B4
  462. void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
  463. //-------------------------------------------------------------------------------------------------
  464. // 001D5A3E
  465. void FREE_UpdateRewindState() {}
  466. //-------------------------------------------------------------------------------------------------
  467. // 001D5A40
  468. void FREE_RestoreRewindState() {}
  469. //-------------------------------------------------------------------------------------------------
  470. // 001D5AE4
  471. void FREE_BeginRewind() {}
  472. //-------------------------------------------------------------------------------------------------
  473. // 001D5B30
  474. int FREE_RewindFrame() { return 0; }
  475. //-------------------------------------------------------------------------------------------------
  476. // 001D5C0C
  477. void FREE_ClipPathBounds(TPoint *, TPoint *, int, int, int, int) {}
  478. //-------------------------------------------------------------------------------------------------
  479. // 001D656C
  480. void FREE_IdleProcess() {
  481. tGame.mTLogic_6678.field_8 = 1;
  482. LOGE("FREE_IdleProcess");
  483. }
  484. //-------------------------------------------------------------------------------------------------
  485. // 001D66F0
  486. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  487. void COUNTER_UpdateGenericCounters(void) {
  488. LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
  489. }
  490. //-------------------------------------------------------------------------------------------------
  491. // 001D6778 //^_-
  492. //单元测试等级:目测游戏表现
  493. //测试内容:启动游戏到第5关传球射门
  494. //测试结果: 修复后游戏表现正常
  495. void FREE_LogicProcess() {
  496. tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
  497. tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
  498. // 001D679E
  499. if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
  500. // 001D67A2
  501. FREE_IdleProcess();
  502. } else {
  503. // loc_1D67A8
  504. if (tGame.mTLogic_6678.field_8 == 1) {
  505. // 001D67AC
  506. COUNTER_UpdateGenericCounters();
  507. }
  508. // loc_1D67B0
  509. }
  510. // loc_1D67B0
  511. if (tGame.mTLogic_6678.field_10 == 0) {
  512. if (tGame.mTLogic_6678.field_8 != 1) {
  513. // 001D67C4
  514. CPlayerManager::SetPlayersWalking(1);
  515. }
  516. }
  517. // loc_1D67C8
  518. tGame.field_6C34++;
  519. tGame.field_6C38++;
  520. }
  521. //-------------------------------------------------------------------------------------------------
  522. // 001D67E8
  523. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  524. //-------------------------------------------------------------------------------------------------
  525. // 001D6918
  526. void FREE_ProcessShotAnim(CPlayer *) {}
  527. //-------------------------------------------------------------------------------------------------
  528. // 001D6CD8
  529. void FREE_ProcessUserTeam() {}
  530. //-------------------------------------------------------------------------------------------------
  531. // 001D7D74
  532. void FREE_ProcessOppoTeam() {}
  533. //-------------------------------------------------------------------------------------------------
  534. // 001D848C
  535. void FREE_ProcessFree() {}
  536. //-------------------------------------------------------------------------------------------------
  537. // 001D86C4
  538. void FREE_ProcessFail() {}
  539. //-------------------------------------------------------------------------------------------------
  540. // 001D8884
  541. void FREE_PlayCommentaryClearance() {}
  542. //-------------------------------------------------------------------------------------------------
  543. // 001D8944
  544. void FREE_PlayCommentaryInterception() {}
  545. //-------------------------------------------------------------------------------------------------
  546. // 001D8998
  547. void FREE_SetupKickAction(TPoint3D, int, int) {}
  548. //-------------------------------------------------------------------------------------------------
  549. // 001D8AD0
  550. void FREE_CheckGKHandPos(CPlayer *, int) {}
  551. //-------------------------------------------------------------------------------------------------
  552. // 001D8B9C
  553. int FREE_SetupPhaseTransition(bool) { return 0; }
  554. //-------------------------------------------------------------------------------------------------
  555. // 001D8DB4
  556. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  557. //-------------------------------------------------------------------------------------------------
  558. // 001D8E68
  559. void FREE_ProcessInProgressCore() {}
  560. //-------------------------------------------------------------------------------------------------
  561. // 001D956C
  562. void FREE_UpdateSuccess(void) {
  563. // 001D956C
  564. TPoint3D var_30_sp20;
  565. TPoint3D var_40_sp10;
  566. /*
  567. * 描述:寄存嚣加载略有不同,VLDR,VLD1.8这两个不知道到底什么区别
  568. * 原始汇编:VLDR D16, [R2]
  569. * 自己汇编:VLD1.8 {D16}, [R2]
  570. */
  571. TPoint3D var_50_sp0 = FREE_tInfo.filed_0.point3D_1848;
  572. // 001D958E
  573. if (FREE_tInfo.filed_0.field_1840 > -1) {
  574. // 001D959C
  575. int r1_i = var_50_sp0.dz_8;
  576. // 001D95A8
  577. if (r1_i <= 0x1000) {
  578. // 001D95A8
  579. r1_i = 0x1000;
  580. }
  581. var_50_sp0.dz_8 = r1_i;
  582. cBallProj.EnsureProj(FREE_tInfo.filed_0.kickTargetTime_1838 + 10);
  583. int r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  584. int r7_i = 0x7FFFFFFF;
  585. int r8_i = 600;
  586. // r10 = var_50
  587. int r5_i = r0_i - 10;
  588. int r11_i;
  589. // loc_1D963E
  590. while (r5_i <= r0_i + 10) {
  591. // loc_1D95D4
  592. r0_i = cBallProj.field_E4;
  593. // 47F7EC - 0x47DFB0 =183C
  594. r0_i = r0_i + r5_i;
  595. r0_i = r0_i % 512;
  596. var_40_sp10 = cBallProj.field_E8[r0_i].point3D_0;
  597. // r9 = var40
  598. if (FREE_tInfo.filed_0.field_183C[0] != 0) {
  599. // 001D960E
  600. r0_i = XMATH_Distance(&var_40_sp10.point_0, &var_50_sp0.point_0);
  601. } else {
  602. // loc_1D9616
  603. r0_i = XMATH_Distance3D(&var_40_sp10, &var_50_sp0);
  604. }
  605. // loc_1D961C
  606. if (r0_i < r7_i) {
  607. // 001D9620
  608. r7_i = r0_i;
  609. r8_i = r5_i;
  610. r11_i = var_40_sp10.dz_8 - var_50_sp0.dz_8;
  611. var_30_sp20 = var_40_sp10;
  612. }
  613. // loc_1D9636
  614. // 47F7E8 - 0x47DFB0 =1838
  615. r5_i++;
  616. r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  617. }
  618. // 001D9644
  619. if (FREE_tInfo.filed_0.field_183C[0] == 0) {
  620. // 001D9644
  621. cBall.ballMovePrev_10.dz_8 = cBall.ballMovePrev_10.dz_8 - r11_i / r8_i;
  622. }
  623. // loc_1D9660
  624. cBallProj.EnsureProj(r8_i + 1);
  625. FREE_tInfo.filed_0.point3D_1848 = var_30_sp20;
  626. FREE_tInfo.field_1884 = tGame.maybe_sound_0 + r8_i;
  627. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  628. // 47F834 - 0x47DFB0 =1884
  629. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  630. // loc_1D96BC
  631. } else {
  632. // loc_1D96A8
  633. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  634. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  635. }
  636. // loc_1D96BC
  637. }
  638. //-------------------------------------------------------------------------------------------------
  639. // 001D96E4
  640. int FREE_ProcessLogic() { return 0; }
  641. //-------------------------------------------------------------------------------------------------
  642. // 001DA0A8
  643. void FREE_PlayCommentaryPassReceive() {}
  644. //-------------------------------------------------------------------------------------------------
  645. // 001DA208
  646. void FREE_PlayCommentaryKick() {}
  647. //-------------------------------------------------------------------------------------------------
  648. // 001DA484
  649. void FREE_SetComplete() {}
  650. //-------------------------------------------------------------------------------------------------
  651. // 001DA5C0
  652. void FREE_PlayersUpset(int) {}
  653. //-------------------------------------------------------------------------------------------------
  654. // 001DA620
  655. void FREE_PlayersCelebrate() {}
  656. //-------------------------------------------------------------------------------------------------
  657. // 001DA670
  658. void FREE_CheckCollision() {}
  659. //-------------------------------------------------------------------------------------------------
  660. // 001DA674
  661. //^_^
  662. void FREE_InitProps(void) {}
  663. //-------------------------------------------------------------------------------------------------
  664. // 001DA730
  665. void FREE_UpdateProps() {}
  666. //-------------------------------------------------------------------------------------------------
  667. // 001DA764
  668. void FREE_ShutdownProps() {}
  669. //-------------------------------------------------------------------------------------------------
  670. // 001DA7A4
  671. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  672. //-------------------------------------------------------------------------------------------------
  673. // 001DA7BC
  674. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  675. //-------------------------------------------------------------------------------------------------
  676. // 001DA7D4
  677. void FREE_RenderPropShadows() {}
  678. //-------------------------------------------------------------------------------------------------
  679. // 001DA8C0
  680. void FREE_RenderProps() {}
  681. //-------------------------------------------------------------------------------------------------
  682. // 001DA9AC
  683. void FREE_ProcessPropCollision(TFreeProp *) {}
  684. //-------------------------------------------------------------------------------------------------
  685. // 001DA9AE
  686. void FREE_ProcessPropCollisions() {}
  687. //-------------------------------------------------------------------------------------------------
  688. // 001DA9B0
  689. //^_^
  690. void FREE_RenderInitOnce() {}
  691. //-------------------------------------------------------------------------------------------------
  692. // 001DA9E0
  693. void FREE_RenderShutdownOnce() {}
  694. //-------------------------------------------------------------------------------------------------
  695. // 001DAA00
  696. void FREE_RenderInit() {}
  697. //-------------------------------------------------------------------------------------------------
  698. // 001DAAAC
  699. void FREE_RenderShutdown() {}
  700. //-------------------------------------------------------------------------------------------------
  701. // 001DAAF4
  702. void FREE_RenderListBegin(char const *, bool, bool) {}
  703. //-------------------------------------------------------------------------------------------------
  704. // 001DAB84
  705. void FREE_RenderListEnd() {}
  706. //-------------------------------------------------------------------------------------------------
  707. // 001DABD4
  708. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  709. //-------------------------------------------------------------------------------------------------
  710. // 001DAC40
  711. void FREE_RenderStar(TPoint3D, float, float) {}
  712. //-------------------------------------------------------------------------------------------------
  713. // 001DACE4
  714. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  715. //-------------------------------------------------------------------------------------------------
  716. // 001DAEEC
  717. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  718. //-------------------------------------------------------------------------------------------------
  719. // 001DB0BC
  720. void FREE_RenderRangeCone() {}
  721. //-------------------------------------------------------------------------------------------------
  722. // 001DB3CC
  723. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  724. //-------------------------------------------------------------------------------------------------
  725. // 001DB5C0
  726. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  727. //-------------------------------------------------------------------------------------------------
  728. // 001DB9C8
  729. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  730. //-------------------------------------------------------------------------------------------------
  731. // 001DBBCC
  732. void FREE_Render3DOpaque() {}
  733. //-------------------------------------------------------------------------------------------------
  734. // 001DBBF0
  735. void FREE_RenderHeroPlayer(bool) {}
  736. //-------------------------------------------------------------------------------------------------
  737. // 001DBEEC
  738. void FREE_Render3DDecal() {}
  739. //-------------------------------------------------------------------------------------------------
  740. // 001DBFC4
  741. void FREE_RenderPreSelectedPlayer() {}
  742. //-------------------------------------------------------------------------------------------------
  743. // 001DC0E0
  744. void FREE_RenderProcess() {
  745. MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0=rand()%10;
  746. }
  747. //-------------------------------------------------------------------------------------------------
  748. // 001DC0E4
  749. void FREE_AddVisualFeedback(int i0, EVFEffect e1, int i2) {
  750. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  751. r0_hud->ClearVisualFeedback();
  752. int r0_i = 0;
  753. int r4_i = i2;
  754. int r5_i = e1;
  755. int r6_i = i0;
  756. // int r7_i =0;
  757. int r1_i = r6_i + r6_i * 4;
  758. int* r7_pi = s_iEVFStrings + r1_i * 2;
  759. // loc_1DC120
  760. while (r0_i <= 9) {
  761. // loc_1DC118
  762. r1_i = *(r7_pi + r0_i);
  763. if (r1_i == 0) {
  764. break;
  765. }
  766. // loc_1DC120
  767. r0_i++;
  768. } // loc_1DC118
  769. // loc_1DC124
  770. r0_i = XSYS_Random(r0_i);
  771. r0_i = *(r7_pi + r0_i);
  772. wchar_t* r1_pwc = LOCstring(r0_i);
  773. wchar_t var_218[256];
  774. xstrlcpy(var_218, r1_pwc, 256);
  775. int r3_i;
  776. int r7_i;
  777. // 47AEA8 - 0x477E90
  778. r0_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
  779. // 001DC148
  780. if (r0_i == 1) {
  781. // 001DC14C
  782. xstrlcat(var_218, L" ", 256);
  783. } else {
  784. // loc_1DC152
  785. xstrlcat(var_218, L"!", 256);
  786. }
  787. /*
  788. * 描述:此处分支被合并到下面的cBall变量访问的代码块中了
  789. * 原始汇编: BLX j__Z8xstrlcatPwPKwj
  790. LDR R0, =(cBall_ptr - 0x1DC166)
  791. ADD R0, PC
  792. LDR R0, [R0]
  793. LDR R1, [R0,#(dword_356A7C - 0x356A70)]
  794. * 自已汇编: ...
  795. * LDR R0, =(cBall_ptr - 0xA26A)
  796. MOV.W R4, #0xFFFFFFFF
  797. ADD R0, PC
  798. LDR R0, [R0]
  799. LDRD.W R3, R2, [R0,#4]
  800. LDR R0, [R0,#(dword_27A4C - 0x27A40)]
  801. */
  802. // 356A7C - 0x356A70
  803. // 001DC168
  804. r1_i = cBall.ballPosPrev_4.dz_8;
  805. if (r1_i <= 98304) {
  806. // 001DC16E
  807. r1_i = 98304;
  808. }
  809. r3_i = cBall.ballPosPrev_4.point_0.dx_0;
  810. int r2_i = cBall.ballPosPrev_4.point_0.dy_4;
  811. bool bC1F8 = false;
  812. // 001DC174
  813. if (r4_i + 1 != 0) {
  814. // 001DC176
  815. if (r5_i == 3) {
  816. // 001DC17A
  817. r1_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.dz_8;
  818. r2_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dy_4;
  819. r3_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dx_0;
  820. r4_i = -1;
  821. // 001DC18A
  822. if (r6_i != 12) {
  823. // 001DC1A2
  824. r1_i = r1_i + 98304;
  825. }
  826. // loc_1DC1F8
  827. bC1F8 = true;
  828. } else {
  829. // loc_1DC1B2
  830. r1_i = 98304;
  831. r2_i = 0;
  832. r3_i = 0;
  833. }
  834. // loc_1DC1BA
  835. } else {
  836. // loc_1DC1A8
  837. r4_i = -1;
  838. }
  839. if (bC1F8 == false) {
  840. // loc_1DC1BA
  841. uint r0_ui = (uint)r5_i - 1u;
  842. // 001DC1BC
  843. if (r0_ui >= 2) {
  844. // 001DC1C0
  845. if (r5_i != 3) {
  846. // 001DC1C4
  847. if (r5_i == 0) {
  848. // 001DC1C8
  849. // 4B0E34 - 0x4AB140
  850. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  851. r7_i = 0;
  852. r6_i = 1;
  853. int var_228 = r6_i;
  854. int var_224 = r7_i;
  855. int var_220 = r4_i;
  856. int r12_i = -256;
  857. float r5_f = 1;
  858. r4_i = 100;
  859. r6_i = 1602;
  860. TPoint3D tp3d0;
  861. tp3d0.point_0.dx_0 = r3_i;
  862. tp3d0.point_0.dy_4 = r2_i;
  863. tp3d0.dz_8 = r1_i;
  864. TPoint3D tp3d1;
  865. tp3d1.point_0.dx_0 = r7_i;
  866. tp3d1.point_0.dy_4 = r7_i;
  867. tp3d1.dz_8 = r6_i;
  868. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r4_i, r5_f, r12_i,
  869. var_228, (EVFEffect)var_224, var_220);
  870. }
  871. // loc_1DC25E
  872. return;
  873. }
  874. // F8
  875. } else {
  876. // loc_1DC228
  877. float r6_f = 0.699999988079071;
  878. r7_i = 1;
  879. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  880. int var_228 = r7_i;
  881. int var_224 = r5_i;
  882. int var_220 = r4_i;
  883. r5_i = 60;
  884. r7_i = 0;
  885. r4_i = 1602;
  886. int r12_i = -1;
  887. TPoint3D tp3d0;
  888. tp3d0.point_0.dx_0 = r3_i;
  889. tp3d0.point_0.dy_4 = r2_i;
  890. tp3d0.dz_8 = r1_i;
  891. TPoint3D tp3d1;
  892. tp3d1.point_0.dx_0 = r7_i;
  893. tp3d1.point_0.dy_4 = r7_i;
  894. tp3d1.dz_8 = r4_i;
  895. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r5_i, r6_f, r12_i, var_228,
  896. (EVFEffect)var_224, var_220);
  897. }
  898. }
  899. // loc_1DC1F8
  900. r0_i = -801;
  901. r7_i = 1;
  902. r6_i = -12566464;
  903. int lr_i = r0_i;
  904. // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  905. float r12_f = 0.699999988079071;
  906. r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  907. int var_228 = r7_i;
  908. int var_224 = r5_i;
  909. r7_i = 40;
  910. r5_i = 0;
  911. TPoint3D tp3d0;
  912. tp3d0.point_0.dx_0 = r3_i;
  913. tp3d0.point_0.dy_4 = r2_i;
  914. tp3d0.dz_8 = r1_i;
  915. TPoint3D tp3d1;
  916. tp3d1.point_0.dx_0 = r5_i;
  917. tp3d1.point_0.dy_4 = r5_i;
  918. tp3d1.dz_8 = lr_i;
  919. r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r7_i, r12_f, r6_i, var_228, (EVFEffect)var_224, r4_i);
  920. }
  921. //-------------------------------------------------------------------------------------------------
  922. // 001DC290
  923. void FREE_AddVisualFeedback_Pass() {
  924. TPoint var_1C = cBallProj.field_E8[((cBallProj.field_E4 + 1) % 512)].point3D_0.point_0;
  925. CPlayer* r7_pplayer = tGame.mTMath_6734.pPlayer_134[FREE_iTeam];
  926. int r0_i = XMATH_Distance(&tGame.mTLogic_6678.field_64, &var_1C);
  927. // 3A2278 - 0x39BB88 = 66F0
  928. int r2_i = tGame.mTLogic_6678.field_78; //[2]
  929. TAnimData* anims = CAnimManager::s_tAnimData;
  930. int r1_i = (ushort)anims[r2_i].u_C.filed_C;
  931. r1_i = r1_i & 1032u;
  932. int r4_i;
  933. EVFEffect r5_i;
  934. /*
  935. * 描述: 原汇编r5= 1有归并,自己汇编分成了两处, 寄存嚣分配有出入
  936. * 原始汇编: loc_1DC30A
  937. * MOVS R5, #1
  938. B loc_1DC31A
  939. * 自已汇编: BLE loc_E2EC
  940. MOVS R4, #1
  941. */
  942. // bool bC30A = false;
  943. // 001DC2FC
  944. if (r1_i == 0) {
  945. // loc_1DC302
  946. if (r0_i > 819200) {
  947. // 001DC308
  948. r4_i = 8;
  949. r5_i = EVFEffect_1;
  950. } else {
  951. // loc_1DC30E
  952. r4_i = 9;
  953. if (r0_i < 327680) {
  954. // 001DC316
  955. r4_i = 10;
  956. }
  957. r5_i = EVFEffect_2;
  958. }
  959. } else {
  960. r4_i = 11;
  961. r5_i = EVFEffect_1;
  962. }
  963. // loc_1DC30A
  964. // loc_1DC31A
  965. CPlayer* r0_pplayer = &tGame.CPlayer_3050[0];
  966. r2_i = r7_pplayer - r0_pplayer;
  967. FREE_AddVisualFeedback(r4_i, r5_i, r2_i);
  968. r0_i = XSYS_Random(2);
  969. r0_i = r0_i + 3;
  970. SNDGAME_Crowd_PlayReaction(r0_i);
  971. }
  972. //-------------------------------------------------------------------------------------------------
  973. // 001DC354
  974. void FREE_AddVisualFeedback_Goal() {}
  975. //-------------------------------------------------------------------------------------------------
  976. // 001DC440
  977. void FREE_AddVisualFeedback_Fail() {}
  978. //-------------------------------------------------------------------------------------------------
  979. // 001DC494
  980. void FREE_AddVisualFeedback_Offside() {}
  981. //-------------------------------------------------------------------------------------------------
  982. // 001DC4C8
  983. void FREE_SortPlayers(TFreeGoal *) {}
  984. //-------------------------------------------------------------------------------------------------
  985. // 001DC664
  986. void FREE_SortPlayersDistance(TFreeGoal *) {}
  987. //-------------------------------------------------------------------------------------------------
  988. // 001DC848
  989. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  990. //-------------------------------------------------------------------------------------------------
  991. // 001DC888
  992. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  993. //-------------------------------------------------------------------------------------------------
  994. // 001DCA14
  995. void FREE_ReadXMLLevel(TFreeGoal *, CFTTXmlReaderNode) {}
  996. //-------------------------------------------------------------------------------------------------
  997. // 00169A80 ^_-
  998. //单元测试等级: 游戏运行正常
  999. //单元测试内容: 1-10关
  1000. //单元测试结果: 正常
  1001. void PhysicsTest() {
  1002. LOGE("PhysicsTest_0"); // OK
  1003. fpointQ<PointType_18> fpointq_sp240;
  1004. fpointq_sp240.field_0 = 0;
  1005. fpointq_sp240.field_4 = 0;
  1006. fpointq_sp240.field_8 = 0;
  1007. fpointq_sp240.field_C = 0x40000;
  1008. fpoint3<PointType_18> fpoint3_sp25c;
  1009. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  1010. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  1011. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  1012. CFTTPObject *r6_pobject = new CFTTPObject(
  1013. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  1014. r6_pobject->fpoint3_1C.x_0 =
  1015. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  1016. r6_pobject->fpoint3_1C.y_4 =
  1017. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  1018. r6_pobject->fpoint3_1C.z_8 =
  1019. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  1020. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  1021. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  1022. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  1023. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  1024. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  1025. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  1026. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  1027. r6_pobject->field_34 = 0x94D65;
  1028. r6_pobject->field_38 = 0x37D2A4D;
  1029. fpoint<PointType_18> fpoint_sp23c;
  1030. fpoint3<PointType_18> fpoint3_sp230;
  1031. fpointQ<PointType_18> fpointQ_sp220;
  1032. fpointQ_sp220.field_0 = 0;
  1033. fpointQ_sp220.field_4 = 0;
  1034. fpointQ_sp220.field_8 = 0;
  1035. fpointQ_sp220.field_C = 0x40000;
  1036. fpoint3_sp230.x_0 = 0;
  1037. fpoint3_sp230.y_4 = 0;
  1038. fpoint3_sp230.z_8 = 0;
  1039. fpoint_sp23c.var_0 = 0x8000;
  1040. // check 传参是否都是用了栈
  1041. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  1042. fpointQ_sp220); //这里头文件更新
  1043. // 00169B60
  1044. r6_pobject->field_3C = 0x8000;
  1045. r0_psphere->field_64 = 0x8000;
  1046. r6_pobject->field_44 = 0x10000;
  1047. r6_pobject->field_40 = 0x40000;
  1048. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  1049. r0_psphere->filed_4 = r6_pobject;
  1050. // sp1c=r6_pobject
  1051. CFTTPhysics physics_sp218(0x40);
  1052. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  1053. // 00169B98
  1054. pfpoint3_sp34[14].z_8 = 0;
  1055. pfpoint3_sp34[15].x_0 = 0;
  1056. pfpoint3_sp34[15].y_4 = 0;
  1057. pfpoint3_sp34[15].z_8 = 0;
  1058. pfpoint3_sp34[13].z_8 = 0;
  1059. pfpoint3_sp34[14].x_0 = 0;
  1060. pfpoint3_sp34[14].y_4 = 0;
  1061. pfpoint3_sp34[14].z_8 = 0;
  1062. pfpoint3_sp34[12].y_4 = 0;
  1063. pfpoint3_sp34[12].z_8 = 0;
  1064. pfpoint3_sp34[13].x_0 = 0;
  1065. pfpoint3_sp34[13].y_4 = 0;
  1066. // 00169C06
  1067. pfpoint3_sp34[11].x_0 = 0;
  1068. pfpoint3_sp34[11].y_4 = 0;
  1069. pfpoint3_sp34[11].z_8 = 0;
  1070. pfpoint3_sp34[12].x_0 = 0;
  1071. // 00169C16
  1072. pfpoint3_sp34[1].y_4 = 0x20000;
  1073. pfpoint3_sp34[2].z_8 = 0x3333;
  1074. pfpoint3_sp34[2].x_0 = 0x18000;
  1075. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  1076. // 00169C2C
  1077. pfpoint3_sp34[2].z_8 = 0x3333;
  1078. pfpoint3_sp34[3].x_0 = 0x10000;
  1079. pfpoint3_sp34[3].y_4 = 0x72AAA;
  1080. pfpoint3_sp34[3].z_8 = 0x3333;
  1081. // 00169C34
  1082. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  1083. pfpoint3_sp34[4].y_4 = 0x72AAA;
  1084. pfpoint3_sp34[4].z_8 = 0x3333;
  1085. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  1086. // 00169C3C
  1087. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  1088. pfpoint3_sp34[4].z_8 = 0x3333;
  1089. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  1090. pfpoint3_sp34[5].y_4 = 0x20000;
  1091. // 00169C44
  1092. pfpoint3_sp34[5].z_8 = 0x3333;
  1093. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  1094. pfpoint3_sp34[6].y_4 = 0;
  1095. pfpoint3_sp34[6].z_8 = 0x3333;
  1096. // 00169C4C
  1097. pfpoint3_sp34[7].x_0 = 0x10000;
  1098. pfpoint3_sp34[7].y_4 = 0;
  1099. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1100. pfpoint3_sp34[7].x_0 = 0x18000;
  1101. // 00169C5A
  1102. pfpoint3_sp34[7].y_4 = 0x20000;
  1103. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1104. pfpoint3_sp34[8].x_0 = 0x18000;
  1105. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  1106. // 00169C60
  1107. pfpoint3_sp34[0].x_0 = 0x10000;
  1108. pfpoint3_sp34[0].y_4 = 0;
  1109. pfpoint3_sp34[0].z_8 = 0x3333;
  1110. pfpoint3_sp34[1].x_0 = 0x18000;
  1111. // 00169C68
  1112. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  1113. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  1114. pfpoint3_sp34[15].y_4 = 0;
  1115. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  1116. // 00169C6C
  1117. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  1118. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  1119. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  1120. pfpoint3_sp34[14].y_4 = 0x20000;
  1121. // 00169C74
  1122. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  1123. pfpoint3_sp34[12].y_4 = 0x72AAA;
  1124. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  1125. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  1126. // 00169C7C
  1127. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  1128. pfpoint3_sp34[11].x_0 = 0x10000;
  1129. pfpoint3_sp34[11].y_4 = 0x72AAA;
  1130. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  1131. // sp48=FREE_tInfo
  1132. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  1133. // 00169C90
  1134. // loc_16A21E
  1135. LOGE("PhysicsTest_case");
  1136. for (int r2_i = 0;
  1137. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  1138. r2_i++) {
  1139. // loc_169CC0
  1140. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1141. .m_iType_C) {
  1142. case 0: // loc_169EC0
  1143. {
  1144. // check 手机左移
  1145. // sp4c = r2
  1146. // check 运算
  1147. LOGE("PhysicsTest_case_0");
  1148. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1149. .m_iRot_10 *
  1150. 0x40000 / 0xB4;
  1151. uint64 r3r1_ull = 0x3243F4000;
  1152. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1153. int r4_i = r1r0_ll / 2;
  1154. int i_sp1b0;
  1155. int i_sp214 = r4_i;
  1156. sub_16A57C(i_sp1b0, i_sp214);
  1157. sub_16A6CC(i_sp214, r4_i);
  1158. fpoint3<PointType_18> fpoint3_spc0;
  1159. fpointQ<PointType_18> fpointQ_spb0;
  1160. // check 乘法
  1161. fpoint3_spc0.x_0 =
  1162. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1163. .m_tPoint3D_0.point_0.dx_0 *
  1164. 8;
  1165. fpoint3_spc0.y_4 =
  1166. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1167. .m_tPoint3D_0.dz_8 *
  1168. 8;
  1169. fpoint3_spc0.z_8 =
  1170. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1171. .m_tPoint3D_0.point_0.dy_4 *
  1172. 8;
  1173. fpointQ_spb0.field_0 = 0;
  1174. fpointQ_spb0.field_4 = i_sp1b0;
  1175. fpointQ_spb0.field_8 = 0;
  1176. fpointQ_spb0.field_C = i_sp214;
  1177. CFTTPObject *r4_pobject = new CFTTPObject(
  1178. EPhysicsObjectType_2,
  1179. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1180. .m_iType_C,
  1181. 2, fpoint3_spc0, fpointQ_spb0);
  1182. // 00169F5C
  1183. r4_pobject->field_34 = 0;
  1184. r4_pobject->field_38 = 0;
  1185. r4_pobject->field_3C = 0x40000;
  1186. r4_pobject->field_40 = 0x4000; // dword_16A448
  1187. r4_pobject->field_44 = 0x20000;
  1188. fpoint<PointType_18> fpoint_spac;
  1189. fpoint<PointType_18> fpoint_spa8;
  1190. fpoint<PointType_18> fpoint_spa4;
  1191. fpoint3<PointType_18> fpoint3_sp98;
  1192. fpointQ<PointType_18> fpointQ_sp80;
  1193. fpoint3_sp98.x_0 = 0;
  1194. fpoint_spac.var_0 = 0x3333;
  1195. fpoint_spa8.var_0 = 0x6666;
  1196. fpoint_spa4.var_0 = 0x15555;
  1197. fpointQ_sp80.field_0 = 0;
  1198. fpointQ_sp80.field_4 = 0;
  1199. fpointQ_sp80.field_8 = 0;
  1200. fpointQ_sp80.field_C = 0x40000;
  1201. fpoint3_sp98.y_4 = 0xEAAA;
  1202. fpoint3_sp98.z_8 = 0;
  1203. // fpointQ_sp80
  1204. CFTTPPCone *r5_pcone =
  1205. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  1206. fpoint3_sp98, fpointQ_sp80);
  1207. fpoint3<PointType_18> fpoint3_sp74;
  1208. fpoint3<PointType_18> fpoint3_sp68;
  1209. fpointQ<PointType_18> fpointQ_sp50;
  1210. fpoint3_sp74.x_0 = 0xCCCC;
  1211. fpointQ_sp50.field_0 = 0;
  1212. fpointQ_sp50.field_4 = 0;
  1213. fpointQ_sp50.field_8 = 0;
  1214. fpointQ_sp50.field_C = 0x40000;
  1215. fpoint3_sp74.y_4 = 0x4000;
  1216. fpoint3_sp74.z_8 = 0xCCCC;
  1217. fpoint3_sp68.x_0 = 0;
  1218. fpoint3_sp68.y_4 = 0x2000;
  1219. fpoint3_sp68.z_8 = 0;
  1220. CFTTPPBox *r0_pbox =
  1221. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  1222. r5_pcone->field_64 = 0x15555;
  1223. r0_pbox->field_64 = 0xCCCC;
  1224. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  1225. r0_pbox->filed_4 = r4_pobject;
  1226. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  1227. r5_pcone->filed_4 = r4_pobject;
  1228. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1229. r4_pobject;
  1230. break;
  1231. }
  1232. case 2: // loc_16A030
  1233. {
  1234. LOGE("PhysicsTest_case_2");
  1235. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1236. .m_iRot_10 *
  1237. 0x40000 / 0xB4;
  1238. uint64 r3r1_ull = 0x3243F4000;
  1239. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1240. int r4_i = r1r0_ll / 2;
  1241. int i_sp214;
  1242. int i_sp1b0 = r4_i;
  1243. sub_16A57C(i_sp214, i_sp1b0);
  1244. int i_sp210;
  1245. i_sp1b0 = r4_i;
  1246. sub_16A6CC(i_sp210, i_sp1b0);
  1247. // sp40=i_sp210
  1248. // sp3c=sp214
  1249. fpoint3<PointType_18> fpoint3_sp154;
  1250. fpoint3<PointType_18> fpoint3_sp148;
  1251. fpointQ<PointType_18> fpointQ_sp138;
  1252. fpointQ<PointType_18> fpointQ_sp1b0;
  1253. fpoint3_sp154.x_0 = 0x70000;
  1254. fpoint3_sp154.y_4 = 0x20000;
  1255. fpoint3_sp154.z_8 = 0x6666;
  1256. fpointQ_sp1b0.field_0 = 0x3333;
  1257. fpointQ_sp1b0.field_4 = 0;
  1258. fpointQ_sp1b0.field_8 = 0;
  1259. fpointQ_sp1b0.field_C = 0x40000;
  1260. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  1261. CFTTPPBox *pbox_sp38 =
  1262. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  1263. // 0016A0DC
  1264. pbox_sp38->field_64 = 0x70000;
  1265. fpoint3<PointType_18> fpoint3_sp12c;
  1266. fpoint3<PointType_18> fpoint3_sp120;
  1267. fpointQ<PointType_18> fpointQ_sp110;
  1268. fpoint3_sp120.x_0 = 0xFFFD0000;
  1269. fpoint3_sp12c.x_0 = 0x6666;
  1270. fpoint3_sp12c.y_4 = 0x20000;
  1271. fpoint3_sp12c.z_8 = 0x15555;
  1272. fpoint3_sp120.y_4 = 0x10000;
  1273. fpoint3_sp120.z_8 = 0xAAAA;
  1274. fpointQ_sp1b0.field_0 = 0x3333;
  1275. fpointQ_sp1b0.field_4 = 0;
  1276. fpointQ_sp1b0.field_8 = 0;
  1277. fpointQ_sp1b0.field_C = 0x40000;
  1278. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  1279. // 0016A120
  1280. CFTTPPBox *r4_pbox =
  1281. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  1282. // 0016A122
  1283. fpoint3<PointType_18> fpoint3_sp104;
  1284. fpoint3<PointType_18> fpoint3_spf8;
  1285. fpointQ<PointType_18> fpointQ_spe8;
  1286. fpoint3_sp104.x_0 = 0x6666;
  1287. fpoint3_sp104.y_4 = 0x20000;
  1288. fpoint3_sp104.z_8 = 0x15555;
  1289. fpoint3_spf8.x_0 = 0x30000;
  1290. fpoint3_spf8.y_4 = 0x10000;
  1291. fpoint3_spf8.z_8 = 0xAAAA;
  1292. fpointQ_sp1b0.field_0 = 0x3333;
  1293. fpointQ_sp1b0.field_4 = 0;
  1294. fpointQ_sp1b0.field_8 = 0;
  1295. fpointQ_sp1b0.field_C = 0x40000;
  1296. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  1297. // 0016A164
  1298. CFTTPPBox *r6_pbox =
  1299. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  1300. // 0016A166
  1301. r4_pbox->field_64 = 0x15555;
  1302. r6_pbox->field_64 = 0x15555;
  1303. fpoint3<PointType_18> fpoint3_spdc;
  1304. fpointQ<PointType_18> fpointQ_spcc;
  1305. fpointQ_spcc.field_4 = i_sp214;
  1306. fpointQ_spcc.field_C = i_sp210;
  1307. fpoint3_spdc.x_0 =
  1308. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1309. .m_tPoint3D_0.point_0.dx_0 *
  1310. 8;
  1311. fpoint3_spdc.z_8 =
  1312. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1313. .m_tPoint3D_0.point_0.dy_4 *
  1314. 8;
  1315. fpoint3_spdc.y_4 =
  1316. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1317. .m_tPoint3D_0.dz_8 *
  1318. 8;
  1319. fpointQ_spcc.field_0 = 0;
  1320. fpointQ_spcc.field_8 = 0;
  1321. CFTTPObject *r0_pobject = new CFTTPObject(
  1322. EPhysicsObjectType_2,
  1323. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1324. .m_iType_C,
  1325. 3, fpoint3_spdc, fpointQ_spcc);
  1326. // 0016A1B0
  1327. r0_pobject->field_34 = 0;
  1328. r0_pobject->field_38 = 0;
  1329. r0_pobject->field_3C = 0x70000;
  1330. r0_pobject->field_40 = 0x30000;
  1331. r0_pobject->field_44 = 0x4000;
  1332. r0_pobject->field_A0 = 0x18;
  1333. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  1334. pbox_sp38->filed_4 = r0_pobject;
  1335. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  1336. r4_pbox->filed_4 = r0_pobject;
  1337. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  1338. r6_pbox->filed_4 = r0_pobject;
  1339. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1340. r0_pobject;
  1341. break;
  1342. }
  1343. case 1: // 00169CDA
  1344. {
  1345. // sp4c = r2
  1346. // check 运算
  1347. LOGE("PhysicsTest_case_1");
  1348. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1349. .m_iRot_10 *
  1350. 0x40000 / 0xB4;
  1351. uint64 r3r1_ull = 0x3243F4000;
  1352. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1353. int r4_i = r1r0_ll / 2;
  1354. int i_sp214;
  1355. int i_sp210;
  1356. sub_16A57C(i_sp214, r4_i);
  1357. sub_16A6CC(i_sp210, r4_i);
  1358. fpoint3<PointType_18> fpoint3_sp204;
  1359. fpointQ<PointType_18> fpointQ_sp1f4;
  1360. fpointQ_sp1f4.field_0 = 0;
  1361. fpointQ_sp1f4.field_4 = i_sp214;
  1362. fpointQ_sp1f4.field_8 = 0;
  1363. fpointQ_sp1f4.field_C = i_sp210;
  1364. TPoint3D point3D =
  1365. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1366. .m_tPoint3D_0;
  1367. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  1368. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  1369. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  1370. CFTTPObject *r11_pobject = new CFTTPObject(
  1371. EPhysicsObjectType_2,
  1372. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1373. .m_iType_C,
  1374. 3, fpoint3_sp204, fpointQ_sp1f4);
  1375. int i_sp1b0;
  1376. int i_sp1f0 = 0x7F1AA;
  1377. sub_16A818(&i_sp1b0, &i_sp1f0);
  1378. r11_pobject->field_34 = 0;
  1379. r11_pobject->field_38 = 0;
  1380. r11_pobject->field_3C = i_sp1b0;
  1381. r11_pobject->field_40 = 0x10000;
  1382. r11_pobject->field_44 = 0x10000;
  1383. r11_pobject->field_A0 = 0x18;
  1384. fpoint<PointType_18> fpoint_sp1ec;
  1385. fpoint<PointType_18> fpoint_sp1e8;
  1386. fpoint3<PointType_18> fpoint3_sp1dc;
  1387. fpointQ<PointType_18> fpointQ_sp1cc;
  1388. fpoint_sp1ec.var_0 = 0x10000;
  1389. fpoint3_sp1dc.x_0 = 0;
  1390. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  1391. fpoint3_sp1dc.z_8 = 0;
  1392. fpoint_sp1e8.var_0 = 0x6666;
  1393. fpointQ<PointType_18> fpointQ_sp1b0;
  1394. fpointQ_sp1b0.field_0 = 0x40000;
  1395. fpointQ_sp1b0.field_4 = 0;
  1396. fpointQ_sp1b0.field_8 = 0;
  1397. fpointQ_sp1b0.field_C = 0x40000;
  1398. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1399. // check 前俩个参数传递是否使用栈
  1400. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1401. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1402. fpoint3<PointType_18> fpoint3_sp1a4;
  1403. fpoint3<PointType_18> fpoint3_sp198;
  1404. fpointQ<PointType_18> fpointQ_sp180;
  1405. fpoint3_sp1a4.z_8 = 0x6666;
  1406. // 00169DF4
  1407. fpointQ_sp180.field_0 = 0;
  1408. fpointQ_sp180.field_4 = 0;
  1409. fpointQ_sp180.field_8 = 0;
  1410. fpointQ_sp180.field_C = 0x40000;
  1411. fpoint3_sp1a4.x_0 = 0x20000;
  1412. fpoint3_sp1a4.y_4 = 0x20000;
  1413. fpoint3_sp198.x_0 = 0;
  1414. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1415. fpoint3_sp198.z_8 = 0;
  1416. CFTTPPBox *r5_pbox =
  1417. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1418. // 00169E14
  1419. fpoint3<PointType_18> fpoint3_sp174;
  1420. fpointQ<PointType_18> fpointQ_sp160;
  1421. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1422. fpoint3_sp174.x_0 = 0;
  1423. fpoint3_sp174.z_8 = 0;
  1424. fpointQ_sp160.field_0 = 0;
  1425. fpointQ_sp160.field_4 = 0;
  1426. fpointQ_sp160.field_8 = 0;
  1427. fpointQ_sp160.field_C = 0x40000;
  1428. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1429. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1430. // 00169E32
  1431. r4_pcylinder->field_64 = 0x10000;
  1432. r5_pbox->field_64 = 0x20000;
  1433. r0_ppolyhedron->field_64 = 0xABFFF;
  1434. // 00169E42
  1435. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1436. r5_pbox->filed_4 = r11_pobject;
  1437. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1438. r0_ppolyhedron->filed_4 = r11_pobject;
  1439. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1440. r4_pcylinder->filed_4 = r11_pobject;
  1441. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1442. r11_pobject;
  1443. break;
  1444. }
  1445. }
  1446. }
  1447. }
  1448. // loc_16A232
  1449. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  1450. if (physics_sp218.Process()) {
  1451. // 0016A24E
  1452. // sp18=cBall
  1453. LOGE("PhysicsTest_1");
  1454. cBall.ballPosPrev_4.point_0.dx_0 =
  1455. r6_pobject->fpoint3_0.x_0 /
  1456. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  1457. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  1458. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  1459. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  1460. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  1461. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  1462. fpointQ<PointType_18> fpointQ_sp1b0;
  1463. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  1464. // check 除法
  1465. // 0016A2AA
  1466. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  1467. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  1468. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  1469. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  1470. // check
  1471. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  1472. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  1473. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  1474. // loc_16A344
  1475. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  1476. // loc_16A30C
  1477. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  1478. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  1479. if (FREE_tInfo.filed_0.gamestatus_1828 <= 8) {
  1480. // check
  1481. if ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) {
  1482. LOGE("PhysicsTest_2");
  1483. tGame.field_6C98 = 0;
  1484. tGame.mTLogic_6678.freeproptype_74 =
  1485. physics_sp218.ppobject_0[r5_i]->field_90;
  1486. }
  1487. }
  1488. }
  1489. }
  1490. }
  1491. }
  1492. // loc_16A348
  1493. delete[] pfpoint3_sp34;
  1494. }
  1495. //-------------------------------------------------------------------------------------------------