FREE.cpp 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458
  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() {}
  563. //-------------------------------------------------------------------------------------------------
  564. // 001D96E4
  565. int FREE_ProcessLogic() { return 0; }
  566. //-------------------------------------------------------------------------------------------------
  567. // 001DA0A8
  568. void FREE_PlayCommentaryPassReceive() {}
  569. //-------------------------------------------------------------------------------------------------
  570. // 001DA208
  571. void FREE_PlayCommentaryKick() {}
  572. //-------------------------------------------------------------------------------------------------
  573. // 001DA484
  574. void FREE_SetComplete() {}
  575. //-------------------------------------------------------------------------------------------------
  576. // 001DA5C0
  577. void FREE_PlayersUpset(int) {}
  578. //-------------------------------------------------------------------------------------------------
  579. // 001DA620
  580. void FREE_PlayersCelebrate() {}
  581. //-------------------------------------------------------------------------------------------------
  582. // 001DA670
  583. void FREE_CheckCollision() {}
  584. //-------------------------------------------------------------------------------------------------
  585. // 001DA674
  586. //^_^
  587. void FREE_InitProps(void) {}
  588. //-------------------------------------------------------------------------------------------------
  589. // 001DA730
  590. void FREE_UpdateProps() {}
  591. //-------------------------------------------------------------------------------------------------
  592. // 001DA764
  593. void FREE_ShutdownProps() {}
  594. //-------------------------------------------------------------------------------------------------
  595. // 001DA7A4
  596. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  597. //-------------------------------------------------------------------------------------------------
  598. // 001DA7BC
  599. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  600. //-------------------------------------------------------------------------------------------------
  601. // 001DA7D4
  602. void FREE_RenderPropShadows() {}
  603. //-------------------------------------------------------------------------------------------------
  604. // 001DA8C0
  605. void FREE_RenderProps() {}
  606. //-------------------------------------------------------------------------------------------------
  607. // 001DA9AC
  608. void FREE_ProcessPropCollision(TFreeProp *) {}
  609. //-------------------------------------------------------------------------------------------------
  610. // 001DA9AE
  611. void FREE_ProcessPropCollisions() {}
  612. //-------------------------------------------------------------------------------------------------
  613. // 001DA9B0
  614. //^_^
  615. void FREE_RenderInitOnce() {}
  616. //-------------------------------------------------------------------------------------------------
  617. // 001DA9E0
  618. void FREE_RenderShutdownOnce() {}
  619. //-------------------------------------------------------------------------------------------------
  620. // 001DAA00
  621. void FREE_RenderInit() {}
  622. //-------------------------------------------------------------------------------------------------
  623. // 001DAAAC
  624. void FREE_RenderShutdown() {}
  625. //-------------------------------------------------------------------------------------------------
  626. // 001DAAF4
  627. void FREE_RenderListBegin(char const *, bool, bool) {}
  628. //-------------------------------------------------------------------------------------------------
  629. // 001DAB84
  630. void FREE_RenderListEnd() {}
  631. //-------------------------------------------------------------------------------------------------
  632. // 001DABD4
  633. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  634. //-------------------------------------------------------------------------------------------------
  635. // 001DAC40
  636. void FREE_RenderStar(TPoint3D, float, float) {}
  637. //-------------------------------------------------------------------------------------------------
  638. // 001DACE4
  639. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  640. //-------------------------------------------------------------------------------------------------
  641. // 001DAEEC
  642. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  643. //-------------------------------------------------------------------------------------------------
  644. // 001DB0BC
  645. void FREE_RenderRangeCone() {}
  646. //-------------------------------------------------------------------------------------------------
  647. // 001DB3CC
  648. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  649. //-------------------------------------------------------------------------------------------------
  650. // 001DB5C0
  651. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  652. //-------------------------------------------------------------------------------------------------
  653. // 001DB9C8
  654. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  655. //-------------------------------------------------------------------------------------------------
  656. // 001DBBCC
  657. void FREE_Render3DOpaque() {}
  658. //-------------------------------------------------------------------------------------------------
  659. // 001DBBF0
  660. void FREE_RenderHeroPlayer(bool) {}
  661. //-------------------------------------------------------------------------------------------------
  662. // 001DBEEC
  663. void FREE_Render3DDecal() {}
  664. //-------------------------------------------------------------------------------------------------
  665. // 001DBFC4
  666. void FREE_RenderPreSelectedPlayer() {}
  667. //-------------------------------------------------------------------------------------------------
  668. // 001DC0E0
  669. void FREE_RenderProcess() {
  670. MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0=rand()%10;
  671. }
  672. //-------------------------------------------------------------------------------------------------
  673. // 001DC0E4
  674. void FREE_AddVisualFeedback(int i0, EVFEffect e1, int i2) {
  675. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  676. r0_hud->ClearVisualFeedback();
  677. int r0_i = 0;
  678. int r4_i = i2;
  679. int r5_i = e1;
  680. int r6_i = i0;
  681. // int r7_i =0;
  682. int r1_i = r6_i + r6_i * 4;
  683. int* r7_pi = s_iEVFStrings + r1_i * 2;
  684. // loc_1DC120
  685. while (r0_i <= 9) {
  686. // loc_1DC118
  687. r1_i = *(r7_pi + r0_i);
  688. if (r1_i == 0) {
  689. break;
  690. }
  691. // loc_1DC120
  692. r0_i++;
  693. } // loc_1DC118
  694. // loc_1DC124
  695. r0_i = XSYS_Random(r0_i);
  696. r0_i = *(r7_pi + r0_i);
  697. wchar_t* r1_pwc = LOCstring(r0_i);
  698. wchar_t var_218[256];
  699. xstrlcpy(var_218, r1_pwc, 256);
  700. int r3_i;
  701. int r7_i;
  702. // 47AEA8 - 0x477E90
  703. r0_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
  704. // 001DC148
  705. if (r0_i == 1) {
  706. // 001DC14C
  707. xstrlcat(var_218, L" ", 256);
  708. } else {
  709. // loc_1DC152
  710. xstrlcat(var_218, L"!", 256);
  711. }
  712. /*
  713. * 描述:此处分支被合并到下面的cBall变量访问的代码块中了
  714. * 原始汇编: BLX j__Z8xstrlcatPwPKwj
  715. LDR R0, =(cBall_ptr - 0x1DC166)
  716. ADD R0, PC
  717. LDR R0, [R0]
  718. LDR R1, [R0,#(dword_356A7C - 0x356A70)]
  719. * 自已汇编: ...
  720. * LDR R0, =(cBall_ptr - 0xA26A)
  721. MOV.W R4, #0xFFFFFFFF
  722. ADD R0, PC
  723. LDR R0, [R0]
  724. LDRD.W R3, R2, [R0,#4]
  725. LDR R0, [R0,#(dword_27A4C - 0x27A40)]
  726. */
  727. // 356A7C - 0x356A70
  728. // 001DC168
  729. r1_i = cBall.ballPosPrev_4.dz_8;
  730. if (r1_i <= 98304) {
  731. // 001DC16E
  732. r1_i = 98304;
  733. }
  734. r3_i = cBall.ballPosPrev_4.point_0.dx_0;
  735. int r2_i = cBall.ballPosPrev_4.point_0.dy_4;
  736. bool bC1F8 = false;
  737. // 001DC174
  738. if (r4_i + 1 != 0) {
  739. // 001DC176
  740. if (r5_i == 3) {
  741. // 001DC17A
  742. r1_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.dz_8;
  743. r2_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dy_4;
  744. r3_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dx_0;
  745. r4_i = -1;
  746. // 001DC18A
  747. if (r6_i != 12) {
  748. // 001DC1A2
  749. r1_i = r1_i + 98304;
  750. }
  751. // loc_1DC1F8
  752. bC1F8 = true;
  753. } else {
  754. // loc_1DC1B2
  755. r1_i = 98304;
  756. r2_i = 0;
  757. r3_i = 0;
  758. }
  759. // loc_1DC1BA
  760. } else {
  761. // loc_1DC1A8
  762. r4_i = -1;
  763. }
  764. if (bC1F8 == false) {
  765. // loc_1DC1BA
  766. uint r0_ui = (uint)r5_i - 1u;
  767. // 001DC1BC
  768. if (r0_ui >= 2) {
  769. // 001DC1C0
  770. if (r5_i != 3) {
  771. // 001DC1C4
  772. if (r5_i == 0) {
  773. // 001DC1C8
  774. // 4B0E34 - 0x4AB140
  775. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  776. r7_i = 0;
  777. r6_i = 1;
  778. int var_228 = r6_i;
  779. int var_224 = r7_i;
  780. int var_220 = r4_i;
  781. int r12_i = -256;
  782. float r5_f = 1;
  783. r4_i = 100;
  784. r6_i = 1602;
  785. TPoint3D tp3d0;
  786. tp3d0.point_0.dx_0 = r3_i;
  787. tp3d0.point_0.dy_4 = r2_i;
  788. tp3d0.dz_8 = r1_i;
  789. TPoint3D tp3d1;
  790. tp3d1.point_0.dx_0 = r7_i;
  791. tp3d1.point_0.dy_4 = r7_i;
  792. tp3d1.dz_8 = r6_i;
  793. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r4_i, r5_f, r12_i,
  794. var_228, (EVFEffect)var_224, var_220);
  795. }
  796. // loc_1DC25E
  797. return;
  798. }
  799. // F8
  800. } else {
  801. // loc_1DC228
  802. float r6_f = 0.699999988079071;
  803. r7_i = 1;
  804. CStoryHUD* r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  805. int var_228 = r7_i;
  806. int var_224 = r5_i;
  807. int var_220 = r4_i;
  808. r5_i = 60;
  809. r7_i = 0;
  810. r4_i = 1602;
  811. int r12_i = -1;
  812. TPoint3D tp3d0;
  813. tp3d0.point_0.dx_0 = r3_i;
  814. tp3d0.point_0.dy_4 = r2_i;
  815. tp3d0.dz_8 = r1_i;
  816. TPoint3D tp3d1;
  817. tp3d1.point_0.dx_0 = r7_i;
  818. tp3d1.point_0.dy_4 = r7_i;
  819. tp3d1.dz_8 = r4_i;
  820. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r5_i, r6_f, r12_i, var_228,
  821. (EVFEffect)var_224, var_220);
  822. }
  823. }
  824. // loc_1DC1F8
  825. r0_i = -801;
  826. r7_i = 1;
  827. r6_i = -12566464;
  828. int lr_i = r0_i;
  829. // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  830. float r12_f = 0.699999988079071;
  831. r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  832. int var_228 = r7_i;
  833. int var_224 = r5_i;
  834. r7_i = 40;
  835. r5_i = 0;
  836. TPoint3D tp3d0;
  837. tp3d0.point_0.dx_0 = r3_i;
  838. tp3d0.point_0.dy_4 = r2_i;
  839. tp3d0.dz_8 = r1_i;
  840. TPoint3D tp3d1;
  841. tp3d1.point_0.dx_0 = r5_i;
  842. tp3d1.point_0.dy_4 = r5_i;
  843. tp3d1.dz_8 = lr_i;
  844. r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r7_i, r12_f, r6_i, var_228, (EVFEffect)var_224, r4_i);
  845. }
  846. //-------------------------------------------------------------------------------------------------
  847. // 001DC290
  848. void FREE_AddVisualFeedback_Pass() {
  849. TPoint var_1C = cBallProj.field_E8[((cBallProj.field_E4 + 1) % 512)].point3D_0.point_0;
  850. CPlayer* r7_pplayer = tGame.mTMath_6734.pPlayer_134[FREE_iTeam];
  851. int r0_i = XMATH_Distance(&tGame.mTLogic_6678.field_64, &var_1C);
  852. // 3A2278 - 0x39BB88 = 66F0
  853. int r2_i = tGame.mTLogic_6678.field_78; //[2]
  854. TAnimData* anims = CAnimManager::s_tAnimData;
  855. int r1_i = (ushort)anims[r2_i].u_C.filed_C;
  856. r1_i = r1_i & 1032u;
  857. int r4_i;
  858. EVFEffect r5_i;
  859. /*
  860. * 描述: 原汇编r5= 1有归并,自己汇编分成了两处, 寄存嚣分配有出入
  861. * 原始汇编: loc_1DC30A
  862. * MOVS R5, #1
  863. B loc_1DC31A
  864. * 自已汇编: BLE loc_E2EC
  865. MOVS R4, #1
  866. */
  867. // bool bC30A = false;
  868. // 001DC2FC
  869. if (r1_i == 0) {
  870. // loc_1DC302
  871. if (r0_i > 819200) {
  872. // 001DC308
  873. r4_i = 8;
  874. r5_i = EVFEffect_1;
  875. } else {
  876. // loc_1DC30E
  877. r4_i = 9;
  878. if (r0_i < 327680) {
  879. // 001DC316
  880. r4_i = 10;
  881. }
  882. r5_i = EVFEffect_2;
  883. }
  884. } else {
  885. r4_i = 11;
  886. r5_i = EVFEffect_1;
  887. }
  888. // loc_1DC30A
  889. // loc_1DC31A
  890. CPlayer* r0_pplayer = &tGame.CPlayer_3050[0];
  891. r2_i = r7_pplayer - r0_pplayer;
  892. FREE_AddVisualFeedback(r4_i, r5_i, r2_i);
  893. r0_i = XSYS_Random(2);
  894. r0_i = r0_i + 3;
  895. SNDGAME_Crowd_PlayReaction(r0_i);
  896. }
  897. //-------------------------------------------------------------------------------------------------
  898. // 001DC354
  899. void FREE_AddVisualFeedback_Goal() {}
  900. //-------------------------------------------------------------------------------------------------
  901. // 001DC440
  902. void FREE_AddVisualFeedback_Fail() {}
  903. //-------------------------------------------------------------------------------------------------
  904. // 001DC494
  905. void FREE_AddVisualFeedback_Offside() {}
  906. //-------------------------------------------------------------------------------------------------
  907. // 001DC4C8
  908. void FREE_SortPlayers(TFreeGoal *) {}
  909. //-------------------------------------------------------------------------------------------------
  910. // 001DC664
  911. void FREE_SortPlayersDistance(TFreeGoal *) {}
  912. //-------------------------------------------------------------------------------------------------
  913. // 001DC848
  914. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  915. //-------------------------------------------------------------------------------------------------
  916. // 001DC888
  917. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  918. //-------------------------------------------------------------------------------------------------
  919. // 001DCA14
  920. void FREE_ReadXMLLevel(TFreeGoal *, CFTTXmlReaderNode) {}
  921. //-------------------------------------------------------------------------------------------------
  922. // 00169A80 ^_-
  923. //单元测试等级: 游戏运行正常
  924. //单元测试内容: 1-10关
  925. //单元测试结果: 正常
  926. void PhysicsTest() {
  927. LOGE("PhysicsTest_0"); // OK
  928. fpointQ<PointType_18> fpointq_sp240;
  929. fpointq_sp240.field_0 = 0;
  930. fpointq_sp240.field_4 = 0;
  931. fpointq_sp240.field_8 = 0;
  932. fpointq_sp240.field_C = 0x40000;
  933. fpoint3<PointType_18> fpoint3_sp25c;
  934. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  935. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  936. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  937. CFTTPObject *r6_pobject = new CFTTPObject(
  938. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  939. r6_pobject->fpoint3_1C.x_0 =
  940. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  941. r6_pobject->fpoint3_1C.y_4 =
  942. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  943. r6_pobject->fpoint3_1C.z_8 =
  944. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  945. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  946. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  947. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  948. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  949. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  950. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  951. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  952. r6_pobject->field_34 = 0x94D65;
  953. r6_pobject->field_38 = 0x37D2A4D;
  954. fpoint<PointType_18> fpoint_sp23c;
  955. fpoint3<PointType_18> fpoint3_sp230;
  956. fpointQ<PointType_18> fpointQ_sp220;
  957. fpointQ_sp220.field_0 = 0;
  958. fpointQ_sp220.field_4 = 0;
  959. fpointQ_sp220.field_8 = 0;
  960. fpointQ_sp220.field_C = 0x40000;
  961. fpoint3_sp230.x_0 = 0;
  962. fpoint3_sp230.y_4 = 0;
  963. fpoint3_sp230.z_8 = 0;
  964. fpoint_sp23c.var_0 = 0x8000;
  965. // check 传参是否都是用了栈
  966. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  967. fpointQ_sp220); //这里头文件更新
  968. // 00169B60
  969. r6_pobject->field_3C = 0x8000;
  970. r0_psphere->field_64 = 0x8000;
  971. r6_pobject->field_44 = 0x10000;
  972. r6_pobject->field_40 = 0x40000;
  973. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  974. r0_psphere->filed_4 = r6_pobject;
  975. // sp1c=r6_pobject
  976. CFTTPhysics physics_sp218(0x40);
  977. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  978. // 00169B98
  979. pfpoint3_sp34[14].z_8 = 0;
  980. pfpoint3_sp34[15].x_0 = 0;
  981. pfpoint3_sp34[15].y_4 = 0;
  982. pfpoint3_sp34[15].z_8 = 0;
  983. pfpoint3_sp34[13].z_8 = 0;
  984. pfpoint3_sp34[14].x_0 = 0;
  985. pfpoint3_sp34[14].y_4 = 0;
  986. pfpoint3_sp34[14].z_8 = 0;
  987. pfpoint3_sp34[12].y_4 = 0;
  988. pfpoint3_sp34[12].z_8 = 0;
  989. pfpoint3_sp34[13].x_0 = 0;
  990. pfpoint3_sp34[13].y_4 = 0;
  991. // 00169C06
  992. pfpoint3_sp34[11].x_0 = 0;
  993. pfpoint3_sp34[11].y_4 = 0;
  994. pfpoint3_sp34[11].z_8 = 0;
  995. pfpoint3_sp34[12].x_0 = 0;
  996. // 00169C16
  997. pfpoint3_sp34[1].y_4 = 0x20000;
  998. pfpoint3_sp34[2].z_8 = 0x3333;
  999. pfpoint3_sp34[2].x_0 = 0x18000;
  1000. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  1001. // 00169C2C
  1002. pfpoint3_sp34[2].z_8 = 0x3333;
  1003. pfpoint3_sp34[3].x_0 = 0x10000;
  1004. pfpoint3_sp34[3].y_4 = 0x72AAA;
  1005. pfpoint3_sp34[3].z_8 = 0x3333;
  1006. // 00169C34
  1007. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  1008. pfpoint3_sp34[4].y_4 = 0x72AAA;
  1009. pfpoint3_sp34[4].z_8 = 0x3333;
  1010. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  1011. // 00169C3C
  1012. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  1013. pfpoint3_sp34[4].z_8 = 0x3333;
  1014. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  1015. pfpoint3_sp34[5].y_4 = 0x20000;
  1016. // 00169C44
  1017. pfpoint3_sp34[5].z_8 = 0x3333;
  1018. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  1019. pfpoint3_sp34[6].y_4 = 0;
  1020. pfpoint3_sp34[6].z_8 = 0x3333;
  1021. // 00169C4C
  1022. pfpoint3_sp34[7].x_0 = 0x10000;
  1023. pfpoint3_sp34[7].y_4 = 0;
  1024. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1025. pfpoint3_sp34[7].x_0 = 0x18000;
  1026. // 00169C5A
  1027. pfpoint3_sp34[7].y_4 = 0x20000;
  1028. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  1029. pfpoint3_sp34[8].x_0 = 0x18000;
  1030. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  1031. // 00169C60
  1032. pfpoint3_sp34[0].x_0 = 0x10000;
  1033. pfpoint3_sp34[0].y_4 = 0;
  1034. pfpoint3_sp34[0].z_8 = 0x3333;
  1035. pfpoint3_sp34[1].x_0 = 0x18000;
  1036. // 00169C68
  1037. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  1038. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  1039. pfpoint3_sp34[15].y_4 = 0;
  1040. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  1041. // 00169C6C
  1042. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  1043. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  1044. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  1045. pfpoint3_sp34[14].y_4 = 0x20000;
  1046. // 00169C74
  1047. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  1048. pfpoint3_sp34[12].y_4 = 0x72AAA;
  1049. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  1050. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  1051. // 00169C7C
  1052. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  1053. pfpoint3_sp34[11].x_0 = 0x10000;
  1054. pfpoint3_sp34[11].y_4 = 0x72AAA;
  1055. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  1056. // sp48=FREE_tInfo
  1057. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  1058. // 00169C90
  1059. // loc_16A21E
  1060. LOGE("PhysicsTest_case");
  1061. for (int r2_i = 0;
  1062. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  1063. r2_i++) {
  1064. // loc_169CC0
  1065. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1066. .m_iType_C) {
  1067. case 0: // loc_169EC0
  1068. {
  1069. // check 手机左移
  1070. // sp4c = r2
  1071. // check 运算
  1072. LOGE("PhysicsTest_case_0");
  1073. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1074. .m_iRot_10 *
  1075. 0x40000 / 0xB4;
  1076. uint64 r3r1_ull = 0x3243F4000;
  1077. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1078. int r4_i = r1r0_ll / 2;
  1079. int i_sp1b0;
  1080. int i_sp214 = r4_i;
  1081. sub_16A57C(i_sp1b0, i_sp214);
  1082. sub_16A6CC(i_sp214, r4_i);
  1083. fpoint3<PointType_18> fpoint3_spc0;
  1084. fpointQ<PointType_18> fpointQ_spb0;
  1085. // check 乘法
  1086. fpoint3_spc0.x_0 =
  1087. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1088. .m_tPoint3D_0.point_0.dx_0 *
  1089. 8;
  1090. fpoint3_spc0.y_4 =
  1091. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1092. .m_tPoint3D_0.dz_8 *
  1093. 8;
  1094. fpoint3_spc0.z_8 =
  1095. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1096. .m_tPoint3D_0.point_0.dy_4 *
  1097. 8;
  1098. fpointQ_spb0.field_0 = 0;
  1099. fpointQ_spb0.field_4 = i_sp1b0;
  1100. fpointQ_spb0.field_8 = 0;
  1101. fpointQ_spb0.field_C = i_sp214;
  1102. CFTTPObject *r4_pobject = new CFTTPObject(
  1103. EPhysicsObjectType_2,
  1104. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1105. .m_iType_C,
  1106. 2, fpoint3_spc0, fpointQ_spb0);
  1107. // 00169F5C
  1108. r4_pobject->field_34 = 0;
  1109. r4_pobject->field_38 = 0;
  1110. r4_pobject->field_3C = 0x40000;
  1111. r4_pobject->field_40 = 0x4000; // dword_16A448
  1112. r4_pobject->field_44 = 0x20000;
  1113. fpoint<PointType_18> fpoint_spac;
  1114. fpoint<PointType_18> fpoint_spa8;
  1115. fpoint<PointType_18> fpoint_spa4;
  1116. fpoint3<PointType_18> fpoint3_sp98;
  1117. fpointQ<PointType_18> fpointQ_sp80;
  1118. fpoint3_sp98.x_0 = 0;
  1119. fpoint_spac.var_0 = 0x3333;
  1120. fpoint_spa8.var_0 = 0x6666;
  1121. fpoint_spa4.var_0 = 0x15555;
  1122. fpointQ_sp80.field_0 = 0;
  1123. fpointQ_sp80.field_4 = 0;
  1124. fpointQ_sp80.field_8 = 0;
  1125. fpointQ_sp80.field_C = 0x40000;
  1126. fpoint3_sp98.y_4 = 0xEAAA;
  1127. fpoint3_sp98.z_8 = 0;
  1128. // fpointQ_sp80
  1129. CFTTPPCone *r5_pcone =
  1130. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  1131. fpoint3_sp98, fpointQ_sp80);
  1132. fpoint3<PointType_18> fpoint3_sp74;
  1133. fpoint3<PointType_18> fpoint3_sp68;
  1134. fpointQ<PointType_18> fpointQ_sp50;
  1135. fpoint3_sp74.x_0 = 0xCCCC;
  1136. fpointQ_sp50.field_0 = 0;
  1137. fpointQ_sp50.field_4 = 0;
  1138. fpointQ_sp50.field_8 = 0;
  1139. fpointQ_sp50.field_C = 0x40000;
  1140. fpoint3_sp74.y_4 = 0x4000;
  1141. fpoint3_sp74.z_8 = 0xCCCC;
  1142. fpoint3_sp68.x_0 = 0;
  1143. fpoint3_sp68.y_4 = 0x2000;
  1144. fpoint3_sp68.z_8 = 0;
  1145. CFTTPPBox *r0_pbox =
  1146. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  1147. r5_pcone->field_64 = 0x15555;
  1148. r0_pbox->field_64 = 0xCCCC;
  1149. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  1150. r0_pbox->filed_4 = r4_pobject;
  1151. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  1152. r5_pcone->filed_4 = r4_pobject;
  1153. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1154. r4_pobject;
  1155. break;
  1156. }
  1157. case 2: // loc_16A030
  1158. {
  1159. LOGE("PhysicsTest_case_2");
  1160. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1161. .m_iRot_10 *
  1162. 0x40000 / 0xB4;
  1163. uint64 r3r1_ull = 0x3243F4000;
  1164. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1165. int r4_i = r1r0_ll / 2;
  1166. int i_sp214;
  1167. int i_sp1b0 = r4_i;
  1168. sub_16A57C(i_sp214, i_sp1b0);
  1169. int i_sp210;
  1170. i_sp1b0 = r4_i;
  1171. sub_16A6CC(i_sp210, i_sp1b0);
  1172. // sp40=i_sp210
  1173. // sp3c=sp214
  1174. fpoint3<PointType_18> fpoint3_sp154;
  1175. fpoint3<PointType_18> fpoint3_sp148;
  1176. fpointQ<PointType_18> fpointQ_sp138;
  1177. fpointQ<PointType_18> fpointQ_sp1b0;
  1178. fpoint3_sp154.x_0 = 0x70000;
  1179. fpoint3_sp154.y_4 = 0x20000;
  1180. fpoint3_sp154.z_8 = 0x6666;
  1181. fpointQ_sp1b0.field_0 = 0x3333;
  1182. fpointQ_sp1b0.field_4 = 0;
  1183. fpointQ_sp1b0.field_8 = 0;
  1184. fpointQ_sp1b0.field_C = 0x40000;
  1185. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  1186. CFTTPPBox *pbox_sp38 =
  1187. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  1188. // 0016A0DC
  1189. pbox_sp38->field_64 = 0x70000;
  1190. fpoint3<PointType_18> fpoint3_sp12c;
  1191. fpoint3<PointType_18> fpoint3_sp120;
  1192. fpointQ<PointType_18> fpointQ_sp110;
  1193. fpoint3_sp120.x_0 = 0xFFFD0000;
  1194. fpoint3_sp12c.x_0 = 0x6666;
  1195. fpoint3_sp12c.y_4 = 0x20000;
  1196. fpoint3_sp12c.z_8 = 0x15555;
  1197. fpoint3_sp120.y_4 = 0x10000;
  1198. fpoint3_sp120.z_8 = 0xAAAA;
  1199. fpointQ_sp1b0.field_0 = 0x3333;
  1200. fpointQ_sp1b0.field_4 = 0;
  1201. fpointQ_sp1b0.field_8 = 0;
  1202. fpointQ_sp1b0.field_C = 0x40000;
  1203. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  1204. // 0016A120
  1205. CFTTPPBox *r4_pbox =
  1206. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  1207. // 0016A122
  1208. fpoint3<PointType_18> fpoint3_sp104;
  1209. fpoint3<PointType_18> fpoint3_spf8;
  1210. fpointQ<PointType_18> fpointQ_spe8;
  1211. fpoint3_sp104.x_0 = 0x6666;
  1212. fpoint3_sp104.y_4 = 0x20000;
  1213. fpoint3_sp104.z_8 = 0x15555;
  1214. fpoint3_spf8.x_0 = 0x30000;
  1215. fpoint3_spf8.y_4 = 0x10000;
  1216. fpoint3_spf8.z_8 = 0xAAAA;
  1217. fpointQ_sp1b0.field_0 = 0x3333;
  1218. fpointQ_sp1b0.field_4 = 0;
  1219. fpointQ_sp1b0.field_8 = 0;
  1220. fpointQ_sp1b0.field_C = 0x40000;
  1221. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  1222. // 0016A164
  1223. CFTTPPBox *r6_pbox =
  1224. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  1225. // 0016A166
  1226. r4_pbox->field_64 = 0x15555;
  1227. r6_pbox->field_64 = 0x15555;
  1228. fpoint3<PointType_18> fpoint3_spdc;
  1229. fpointQ<PointType_18> fpointQ_spcc;
  1230. fpointQ_spcc.field_4 = i_sp214;
  1231. fpointQ_spcc.field_C = i_sp210;
  1232. fpoint3_spdc.x_0 =
  1233. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1234. .m_tPoint3D_0.point_0.dx_0 *
  1235. 8;
  1236. fpoint3_spdc.z_8 =
  1237. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1238. .m_tPoint3D_0.point_0.dy_4 *
  1239. 8;
  1240. fpoint3_spdc.y_4 =
  1241. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1242. .m_tPoint3D_0.dz_8 *
  1243. 8;
  1244. fpointQ_spcc.field_0 = 0;
  1245. fpointQ_spcc.field_8 = 0;
  1246. CFTTPObject *r0_pobject = new CFTTPObject(
  1247. EPhysicsObjectType_2,
  1248. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1249. .m_iType_C,
  1250. 3, fpoint3_spdc, fpointQ_spcc);
  1251. // 0016A1B0
  1252. r0_pobject->field_34 = 0;
  1253. r0_pobject->field_38 = 0;
  1254. r0_pobject->field_3C = 0x70000;
  1255. r0_pobject->field_40 = 0x30000;
  1256. r0_pobject->field_44 = 0x4000;
  1257. r0_pobject->field_A0 = 0x18;
  1258. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  1259. pbox_sp38->filed_4 = r0_pobject;
  1260. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  1261. r4_pbox->filed_4 = r0_pobject;
  1262. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  1263. r6_pbox->filed_4 = r0_pobject;
  1264. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1265. r0_pobject;
  1266. break;
  1267. }
  1268. case 1: // 00169CDA
  1269. {
  1270. // sp4c = r2
  1271. // check 运算
  1272. LOGE("PhysicsTest_case_1");
  1273. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1274. .m_iRot_10 *
  1275. 0x40000 / 0xB4;
  1276. uint64 r3r1_ull = 0x3243F4000;
  1277. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1278. int r4_i = r1r0_ll / 2;
  1279. int i_sp214;
  1280. int i_sp210;
  1281. sub_16A57C(i_sp214, r4_i);
  1282. sub_16A6CC(i_sp210, r4_i);
  1283. fpoint3<PointType_18> fpoint3_sp204;
  1284. fpointQ<PointType_18> fpointQ_sp1f4;
  1285. fpointQ_sp1f4.field_0 = 0;
  1286. fpointQ_sp1f4.field_4 = i_sp214;
  1287. fpointQ_sp1f4.field_8 = 0;
  1288. fpointQ_sp1f4.field_C = i_sp210;
  1289. TPoint3D point3D =
  1290. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1291. .m_tPoint3D_0;
  1292. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  1293. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  1294. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  1295. CFTTPObject *r11_pobject = new CFTTPObject(
  1296. EPhysicsObjectType_2,
  1297. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1298. .m_iType_C,
  1299. 3, fpoint3_sp204, fpointQ_sp1f4);
  1300. int i_sp1b0;
  1301. int i_sp1f0 = 0x7F1AA;
  1302. sub_16A818(&i_sp1b0, &i_sp1f0);
  1303. r11_pobject->field_34 = 0;
  1304. r11_pobject->field_38 = 0;
  1305. r11_pobject->field_3C = i_sp1b0;
  1306. r11_pobject->field_40 = 0x10000;
  1307. r11_pobject->field_44 = 0x10000;
  1308. r11_pobject->field_A0 = 0x18;
  1309. fpoint<PointType_18> fpoint_sp1ec;
  1310. fpoint<PointType_18> fpoint_sp1e8;
  1311. fpoint3<PointType_18> fpoint3_sp1dc;
  1312. fpointQ<PointType_18> fpointQ_sp1cc;
  1313. fpoint_sp1ec.var_0 = 0x10000;
  1314. fpoint3_sp1dc.x_0 = 0;
  1315. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  1316. fpoint3_sp1dc.z_8 = 0;
  1317. fpoint_sp1e8.var_0 = 0x6666;
  1318. fpointQ<PointType_18> fpointQ_sp1b0;
  1319. fpointQ_sp1b0.field_0 = 0x40000;
  1320. fpointQ_sp1b0.field_4 = 0;
  1321. fpointQ_sp1b0.field_8 = 0;
  1322. fpointQ_sp1b0.field_C = 0x40000;
  1323. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1324. // check 前俩个参数传递是否使用栈
  1325. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1326. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1327. fpoint3<PointType_18> fpoint3_sp1a4;
  1328. fpoint3<PointType_18> fpoint3_sp198;
  1329. fpointQ<PointType_18> fpointQ_sp180;
  1330. fpoint3_sp1a4.z_8 = 0x6666;
  1331. // 00169DF4
  1332. fpointQ_sp180.field_0 = 0;
  1333. fpointQ_sp180.field_4 = 0;
  1334. fpointQ_sp180.field_8 = 0;
  1335. fpointQ_sp180.field_C = 0x40000;
  1336. fpoint3_sp1a4.x_0 = 0x20000;
  1337. fpoint3_sp1a4.y_4 = 0x20000;
  1338. fpoint3_sp198.x_0 = 0;
  1339. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1340. fpoint3_sp198.z_8 = 0;
  1341. CFTTPPBox *r5_pbox =
  1342. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1343. // 00169E14
  1344. fpoint3<PointType_18> fpoint3_sp174;
  1345. fpointQ<PointType_18> fpointQ_sp160;
  1346. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1347. fpoint3_sp174.x_0 = 0;
  1348. fpoint3_sp174.z_8 = 0;
  1349. fpointQ_sp160.field_0 = 0;
  1350. fpointQ_sp160.field_4 = 0;
  1351. fpointQ_sp160.field_8 = 0;
  1352. fpointQ_sp160.field_C = 0x40000;
  1353. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1354. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1355. // 00169E32
  1356. r4_pcylinder->field_64 = 0x10000;
  1357. r5_pbox->field_64 = 0x20000;
  1358. r0_ppolyhedron->field_64 = 0xABFFF;
  1359. // 00169E42
  1360. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1361. r5_pbox->filed_4 = r11_pobject;
  1362. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1363. r0_ppolyhedron->filed_4 = r11_pobject;
  1364. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1365. r4_pcylinder->filed_4 = r11_pobject;
  1366. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1367. r11_pobject;
  1368. break;
  1369. }
  1370. }
  1371. }
  1372. }
  1373. // loc_16A232
  1374. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  1375. if (physics_sp218.Process()) {
  1376. // 0016A24E
  1377. // sp18=cBall
  1378. LOGE("PhysicsTest_1");
  1379. cBall.ballPosPrev_4.point_0.dx_0 =
  1380. r6_pobject->fpoint3_0.x_0 /
  1381. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  1382. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  1383. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  1384. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  1385. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  1386. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  1387. fpointQ<PointType_18> fpointQ_sp1b0;
  1388. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  1389. // check 除法
  1390. // 0016A2AA
  1391. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  1392. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  1393. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  1394. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  1395. // check
  1396. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  1397. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  1398. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  1399. // loc_16A344
  1400. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  1401. // loc_16A30C
  1402. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  1403. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  1404. if (FREE_tInfo.filed_0.ugamestatus_1828 <= 8) {
  1405. // check
  1406. if ((1 << FREE_tInfo.filed_0.ugamestatus_1828) & 0x190) {
  1407. LOGE("PhysicsTest_2");
  1408. tGame.field_6C98 = 0;
  1409. tGame.mTLogic_6678.freeproptype_74 =
  1410. physics_sp218.ppobject_0[r5_i]->field_90;
  1411. }
  1412. }
  1413. }
  1414. }
  1415. }
  1416. }
  1417. // loc_16A348
  1418. delete[] pfpoint3_sp34;
  1419. }
  1420. //-------------------------------------------------------------------------------------------------