FREE.cpp 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  1. #include "FREE.h"
  2. #include "CBall.h"
  3. #include "CFTTPObject.h"
  4. #include "CFTTPPBox.h"
  5. #include "CFTTPPCone.h"
  6. #include "CFTTPPCylinder.h"
  7. #include "CFTTPPPolyhedron.h"
  8. #include "CFTTPPSphere.h"
  9. #include "CFTTPhysics.h"
  10. #include "CModelManager.h"
  11. #include "CPlayerManager.h"
  12. #include "fpoint.h"
  13. #include "memctrl.h"
  14. #include "sub.h"
  15. // FREE_tInfo 0x1D20
  16. // FREE_tGoal 0x7634
  17. TFreeGoal FREE_tGoal;
  18. TFreeInfo FREE_tInfo;
  19. CFTTModel *FREE_pStarModel;
  20. int FREE_iPropWeather;
  21. const char *s_sPropModels_SNOW[3] = {
  22. "PKG:/data/env/dressing/cone_snow.ftm",
  23. "PKG:/data/env/dressing/mannequin_snow.ftm",
  24. "PKG:/data/env/dressing/rebounder.ftm"};
  25. CFTTModel *FREE_pPropModel[3];
  26. const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
  27. "PKG:/data/env/dressing/mannequin.ftm",
  28. "PKG:/data/env/dressing/rebounder.ftm"};
  29. const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
  30. "PKG:/data/env/dressing/mannequin_s.ftm",
  31. "PKG:/data/env/dressing/rebounder.ftm"};
  32. CFTTModel *FREE_pPropModelShadow[3];
  33. //-------------------------------------------------------------------------------------------------
  34. // 001D2758
  35. int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
  36. //-------------------------------------------------------------------------------------------------
  37. // 001D27EC
  38. void FREE_GetWorldRot(TPoint, TPoint) {}
  39. //-------------------------------------------------------------------------------------------------
  40. // 001D281C
  41. void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
  42. //-------------------------------------------------------------------------------------------------
  43. // 001D2A98
  44. int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
  45. //-------------------------------------------------------------------------------------------------
  46. // 001D2BC0
  47. void FREE_ResolveEndPoint(TPoint3D *, TPoint3D *, TPoint *, int *, bool) {}
  48. //-------------------------------------------------------------------------------------------------
  49. // 001D30B8
  50. void FREE_GetKickPower(EAnimID, int *, int *) {}
  51. //-------------------------------------------------------------------------------------------------
  52. // 001D30FC
  53. void FREE_ProcessControls(bool) {}
  54. //-------------------------------------------------------------------------------------------------
  55. // 001D3EC8
  56. int FREE_CalcKickTargetTime(int) { return 0; }
  57. //-------------------------------------------------------------------------------------------------
  58. // 001D3EEC
  59. void FREE_ResetControls() {}
  60. //-------------------------------------------------------------------------------------------------
  61. // 001D3F24
  62. int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
  63. return 0;
  64. }
  65. //-------------------------------------------------------------------------------------------------
  66. // 001D3FA8
  67. void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
  68. int *var_58 = pi1;
  69. int *var_54 = pi2;
  70. int *var_50 = pi3;
  71. int var_2C = 0;
  72. int var_28 = 0;
  73. TPoint3D var_38;
  74. TPoint3D var_48;
  75. int r0_i = player0->tStr32_44.field_10;
  76. FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
  77. var_28 = 100;
  78. int r4_i = 21627;
  79. var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
  80. r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
  81. // 001D3FF0
  82. if (r0_i < r4_i) {
  83. // 001D3FF4
  84. r4_i = r0_i;
  85. }
  86. // 001D3FF6
  87. var_48.dz_8 = r4_i;
  88. r0_i = 0;
  89. int r7_i = 163840;
  90. int r6_i = 0;
  91. r4_i = 0;
  92. var_48.point_0.dx_0 = r0_i;
  93. int r1_i;
  94. // loc_1D40EA
  95. while (r7_i != 1998848) {
  96. // loc_1D4006
  97. int r2_i = FREE_CalcKickTargetTime(r7_i);
  98. int r9_i = 4096;
  99. // r5 = cball
  100. int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
  101. int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  102. int r10_i = r7_i + r3_i;
  103. // 356A7C - 0x356A70
  104. r0_i = cBall.ballPosPrev_4.dz_8;
  105. int var_3C = r6_i;
  106. int r11_i;
  107. // 001D4024
  108. if (r0_i < 32768) {
  109. // 001D402A
  110. TPoint3D tp1;
  111. // int var_4C = r2_i;
  112. tp1.point_0.dx_0 = r8_i;
  113. tp1.point_0.dy_4 = r3_i;
  114. tp1.dz_8 = r0_i;
  115. TPoint3D tp2;
  116. tp2.point_0.dx_0 = r8_i;
  117. tp2.point_0.dy_4 = r10_i;
  118. tp2.dz_8 = r9_i;
  119. /*
  120. * 描述:此处在连续入栈时STRD和STM有出入
  121. * 原始汇编: STMEA.W SP, {R0,R8,R10}
  122. * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
  123. */
  124. int var_4C = r2_i;
  125. r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
  126. r11_i = r7_i;
  127. r1_i = var_48.point_0.dx_0;
  128. // 001D404A
  129. if (r0_i < var_48.dz_8) {
  130. // 001D4050
  131. r1_i = r7_i;
  132. }
  133. var_48.point_0.dx_0 = r1_i;
  134. r1_i = var_48.point_0.dy_4;
  135. // 001D4056
  136. if (r0_i < r1_i) {
  137. // 001D405A
  138. r11_i = r4_i;
  139. }
  140. // 001D405C
  141. if (r4_i != 0) {
  142. // 001D4060
  143. r11_i = r4_i;
  144. }
  145. // 001D4062
  146. r2_i = cBall.ballPosPrev_4.point_0.dx_0;
  147. r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  148. r1_i = r8_i;
  149. r0_i = cBall.ballPosPrev_4.dz_8;
  150. r8_i = r2_i;
  151. r2_i = var_4C;
  152. } else {
  153. // loc_1D4070
  154. r1_i = r8_i;
  155. r11_i = r4_i;
  156. }
  157. // 001D4076
  158. TPoint3D var_78;
  159. var_78.point_0.dx_0 = r8_i;
  160. var_78.point_0.dy_4 = r3_i;
  161. var_78.dz_8 = r0_i;
  162. TPoint3D var_6C;
  163. var_6C.point_0.dx_0 = r1_i;
  164. var_6C.point_0.dy_4 = r10_i;
  165. var_6C.dz_8 = r9_i;
  166. r4_i = r2_i;
  167. int r5_i =
  168. cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
  169. r0_i = r0_i * 2;
  170. r1_i = (uint)r0_i / (uint)5u;
  171. // r0_i = var_38.dz_8 ;
  172. r0_i = r7_i;
  173. // 001D40A4
  174. if (var_38.dz_8 > r1_i) {
  175. // 001D40AA
  176. r5_i = XMATH_Mag3D(&var_38);
  177. r0_i = var_38.dz_8;
  178. r0_i = r0_i / 49;
  179. r0_i = r0_i * r7_i;
  180. r0_i = r0_i / r4_i;
  181. } // loc_1D40C4
  182. r4_i = r0_i;
  183. r1_i = var_48.point_0.dy_4;
  184. r7_i += 32768;
  185. // 001D40CC
  186. if (r5_i < r1_i) {
  187. // 001D40D0
  188. r4_i = r11_i;
  189. }
  190. // 001D40D2
  191. if (r11_i != 0) {
  192. // 001D40D8
  193. r4_i = r11_i;
  194. }
  195. r6_i = var_3C;
  196. // 001D40DC
  197. if (r0_i <= r6_i) {
  198. // 001D40E0
  199. r0_i = r6_i;
  200. }
  201. r1_i = var_48.dz_8;
  202. // 001D40EA
  203. if (r5_i < r1_i) {
  204. // 001D40E8
  205. r6_i = r0_i;
  206. }
  207. } // loc_1D4006
  208. r0_i = r4_i << 1u;
  209. r1_i = 3;
  210. r0_i = r0_i / r1_i;
  211. int *r1_pi = var_58;
  212. *r1_pi = r0_i;
  213. r1_i = var_48.point_0.dx_0;
  214. // 001D40EA
  215. if (r1_i >= 1146880) {
  216. // 001D40F0
  217. r1_i = 1146880;
  218. }
  219. *var_54 = r1_i;
  220. *var_50 = r6_i;
  221. }
  222. //-------------------------------------------------------------------------------------------------
  223. // 001D4120
  224. void FREE_Init() {}
  225. //-------------------------------------------------------------------------------------------------
  226. // 001D4160
  227. void FREE_Shutdown() {}
  228. //-------------------------------------------------------------------------------------------------
  229. // 001D41B0
  230. void FREE_InitGoal(int, bool, bool, bool) {}
  231. //-------------------------------------------------------------------------------------------------
  232. // 001D4318 //^_-
  233. //单元测试等级:目测游戏表现
  234. //测试内容:启动游戏到第1关传球射门
  235. //测试结果: 游戏表现正常无崩溃且无明显变化,检测到日志输出
  236. //测试分支: 001D4318
  237. void FREE_SetupDifficulty() {
  238. /*
  239. * 描述:此处自己的汇编变量赋值上顺序有不同,多种尝试,不太容易完全一致
  240. */
  241. FREE_tInfo.field_1C9C.m_iCPUPlayerCloseDownCount_1CF8 =
  242. FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
  243. FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =
  244. FREE_tGoal.m_fCPUCloseDownDist_7480;
  245. FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 =
  246. FREE_tGoal.m_iCPUKickResponseTime_749C;
  247. FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C =
  248. FREE_tGoal.m_iCPUMoveResponseTime_74A0;
  249. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
  250. //注意!!!!!这里的数据符号不对 注意更新 FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
  251. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
  252. FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
  253. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 =
  254. FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
  255. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
  256. FREE_tGoal.m_fCPUGKSaveSpeed_7490;
  257. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
  258. FREE_tGoal.m_fCPUGKSaveDistance_7494;
  259. uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
  260. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
  261. FREE_tGoal.m_iCPUGKPosResponseTime_7498;
  262. // 001D43B6
  263. if (r5_c != 0) {
  264. // 001D43B8
  265. // float s0_f = 2.8;
  266. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =
  267. FREE_tGoal.m_iCPUGKRating_7484 - 5;
  268. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
  269. FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
  270. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
  271. FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 -0.200000003f;
  272. // 001D43E6
  273. if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
  274. // 001D43FA
  275. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
  276. (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
  277. } else
  278. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
  279. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
  280. FREE_tGoal.m_fCPUGKSaveSpeed_7490 -5.0f;
  281. }
  282. // locret_1D4410
  283. }
  284. //-------------------------------------------------------------------------------------------------
  285. // 001D4424
  286. void FREE_Initialise() {}
  287. //-------------------------------------------------------------------------------------------------
  288. // 001D49C0
  289. void FREE_UpdateCamera(bool) {}
  290. //-------------------------------------------------------------------------------------------------
  291. // 001D56CC
  292. void FREE_ClipPathBounds(TPoint3D *, TPoint3D *, int, int, int, int) {}
  293. //-------------------------------------------------------------------------------------------------
  294. // 001D5718
  295. // void FREE_GameLoop() {
  296. // int r0_i = 0;
  297. // int r1_i = 0;
  298. // int r2_i = 0;
  299. // // 001D571E
  300. // if (NIS_Active() != 0) {
  301. // // 001D5720
  302. // // NIS_GameLoop();
  303. // CFreeHUD::Process();
  304. // // 47F7D8 - 0x47DFB0
  305. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  306. // // 001D5734
  307. // if (r0_i == 6) {
  308. // // 001D5738
  309. // FREE_ProcessFail();
  310. // r1_i = FREE_tInfo.filed_0.field_182C;
  311. // r1_i = r1_i + 1;
  312. // FREE_tInfo.filed_0.field_182C = r1_i;
  313. // return;
  314. // } else {
  315. // // locret_1D582E
  316. // return;
  317. // }
  318. // }
  319. // // loc_1D5748
  320. // // 47F7D8 - 0x47DFB0 = 1828
  321. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  322. // // 001D5754
  323. // if (r0_i != 8) {
  324. // // 001D5758
  325. // tGame.maybe_sound_0++;
  326. // }
  327. // // loc_1D5764
  328. // // 004877F5
  329. // NISGOAL_tInfo.field_1 = 0;
  330. // // 47DFB1 - 0x47DFB0
  331. // FREE_tInfo.filed_0.b_1 = 1;
  332. // // 001D5776
  333. // if (CReplay::Playing() != 0) {
  334. // // 001D5778
  335. // CReplay::Play();
  336. // }
  337. // // loc_1D577C
  338. // // 47F7D8 - 0x47DFB0
  339. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  340. // // 001D5782
  341. // if (r0_i == 7) {
  342. // // 47F7DC - 0x47DFB0
  343. // r1_i = FREE_tInfo.filed_0.field_182C;
  344. // // 3A27BC - 0x39BB88
  345. // r2_i = tGame.field_6C34;
  346. // // 001D5798
  347. // if (r2_i < r1_i) {
  348. // // 001D579C
  349. // r0_i = tGame.mTLogic_6678.field_50;
  350. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  351. // if (r1_i == r0_i) {
  352. // // 001D57C6
  353. // CGFXFX::EnableStarPlayerEffects();
  354. // }
  355. // } else {
  356. // // loc_1D57B0
  357. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  358. // r1_i = FREE_tInfo.filed_0.field_1830;
  359. // if (r1_i == r0_i) {
  360. // // 001D57C6
  361. // CGFXFX::EnableStarPlayerEffects();
  362. // }
  363. // }
  364. // }
  365. // // loc_1D57CA
  366. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  367. // float r0_f = 0.01666666753590107;
  368. // CGFXFX::Update(r0_f);
  369. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  370. // GFXCAMERA_UpdateMatrices();
  371. // int r4_i = FREE_ProcessLogic();
  372. // // 47FC60 - 0x47DFB0
  373. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  374. // // 001D57F2
  375. // if (r4_i != 0) {
  376. // // 001D57F8
  377. // if (CReplay::Playing() != 0) {
  378. // // loc_1D57FA
  379. // CAM_Update();
  380. // return;
  381. // }
  382. // } else {
  383. // // loc_1D57FA
  384. // CAM_Update();
  385. // return;
  386. // }
  387. // // loc_1D5802
  388. // // 3A2208 - 0x39BB88
  389. // r0_i = tGame.mTLogic_6678.field_8;
  390. // // 001D580E
  391. // if (r0_i == 2) {
  392. // // 001D5812
  393. // // 3A2238 - 0x39BB88
  394. // r0_i = tGame.mTLogic_6678.field_38;
  395. // // 001D5818
  396. // if (r0_i <= 29) {
  397. // // 001D581C
  398. // CReplay::RecordFrame();
  399. // }
  400. // } else {
  401. // // loc_1D5822
  402. // CReplay::RecordFrame();
  403. // }
  404. // // loc_1D5826
  405. // // 3A22A0 - 0x39BB88
  406. // r0_i = tGame.mTLogic_6678.field_A0;
  407. // // 001D582C
  408. // if (r0_i != 0) {
  409. // // locret_1D582E
  410. // return;
  411. // }
  412. // // loc_1D5830
  413. // CPlayerManager::UpdatePlayersLogic();
  414. // FREE_CheckCollision();
  415. // cBall.UpdateFrame();
  416. // // 47F7D8 - 0x47DFB0
  417. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  418. // // 001D584A
  419. // if (r0_i != 4) {
  420. // // 001D584E
  421. // COL_PlayerCollisions();
  422. // }
  423. // // 001D5852
  424. // PhysicsTest();
  425. // cBall.CheckEvents();
  426. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  427. // GFXNET::Update(0.01666666753590107f);
  428. // GL_UpdatePlayMode();
  429. // GM_CalcPlayerDist();
  430. // GM_CalcPlayerBallInterceptions();
  431. // FREE_LogicProcess();
  432. // // 3A2204 - 0x39BB88
  433. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  434. // // 001D5878
  435. // if (r0_i == 0) {
  436. // // 001D587C
  437. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  438. // // 001D5882
  439. // if (r0_i >= 4) {
  440. // // 001D5886
  441. // CPlayerManager::UpdatePlayers();
  442. // }
  443. // // 001D588A
  444. // COMM_Process();
  445. // }
  446. // // loc_1D57FA
  447. // CAM_Update();
  448. // return;
  449. // }
  450. //-------------------------------------------------------------------------------------------------
  451. // 001D58B4
  452. void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
  453. //-------------------------------------------------------------------------------------------------
  454. // 001D5A3E
  455. void FREE_UpdateRewindState() {}
  456. //-------------------------------------------------------------------------------------------------
  457. // 001D5A40
  458. void FREE_RestoreRewindState() {}
  459. //-------------------------------------------------------------------------------------------------
  460. // 001D5AE4
  461. void FREE_BeginRewind() {}
  462. //-------------------------------------------------------------------------------------------------
  463. // 001D5B30
  464. int FREE_RewindFrame() { return 0; }
  465. //-------------------------------------------------------------------------------------------------
  466. // 001D5C0C
  467. void FREE_ClipPathBounds(TPoint *, TPoint *, int, int, int, int) {}
  468. //-------------------------------------------------------------------------------------------------
  469. // 001D656C
  470. void FREE_IdleProcess() {
  471. tGame.mTLogic_6678.field_8 = 1;
  472. LOGE("FREE_IdleProcess");
  473. }
  474. //-------------------------------------------------------------------------------------------------
  475. // 001D66F0
  476. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  477. void COUNTER_UpdateGenericCounters(void) {
  478. LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
  479. }
  480. //-------------------------------------------------------------------------------------------------
  481. // 001D6778 //^_-
  482. //单元测试等级:目测游戏表现
  483. //测试内容:启动游戏到第5关传球射门
  484. //测试结果: 修复后游戏表现正常
  485. void FREE_LogicProcess() {
  486. tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
  487. tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
  488. // 001D679E
  489. if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
  490. // 001D67A2
  491. FREE_IdleProcess();
  492. } else {
  493. // loc_1D67A8
  494. if (tGame.mTLogic_6678.field_8 == 1) {
  495. // 001D67AC
  496. COUNTER_UpdateGenericCounters();
  497. }
  498. // loc_1D67B0
  499. }
  500. // loc_1D67B0
  501. if (tGame.mTLogic_6678.field_10 == 0) {
  502. if (tGame.mTLogic_6678.field_8 != 1) {
  503. // 001D67C4
  504. CPlayerManager::SetPlayersWalking(1);
  505. }
  506. }
  507. // loc_1D67C8
  508. tGame.field_6C34++;
  509. tGame.field_6C38++;
  510. }
  511. //-------------------------------------------------------------------------------------------------
  512. // 001D67E8
  513. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  514. //-------------------------------------------------------------------------------------------------
  515. // 001D6918
  516. void FREE_ProcessShotAnim(CPlayer *) {}
  517. //-------------------------------------------------------------------------------------------------
  518. // 001D6CD8
  519. void FREE_ProcessUserTeam() {}
  520. //-------------------------------------------------------------------------------------------------
  521. // 001D7D74
  522. void FREE_ProcessOppoTeam() {}
  523. //-------------------------------------------------------------------------------------------------
  524. // 001D848C
  525. void FREE_ProcessFree() {}
  526. //-------------------------------------------------------------------------------------------------
  527. // 001D86C4
  528. void FREE_ProcessFail() {}
  529. //-------------------------------------------------------------------------------------------------
  530. // 001D8884
  531. void FREE_PlayCommentaryClearance() {}
  532. //-------------------------------------------------------------------------------------------------
  533. // 001D8944
  534. void FREE_PlayCommentaryInterception() {}
  535. //-------------------------------------------------------------------------------------------------
  536. // 001D8998
  537. void FREE_SetupKickAction(TPoint3D, int, int) {}
  538. //-------------------------------------------------------------------------------------------------
  539. // 001D8AD0
  540. void FREE_CheckGKHandPos(CPlayer *, int) {}
  541. //-------------------------------------------------------------------------------------------------
  542. // 001D8B9C
  543. int FREE_SetupPhaseTransition(bool) { return 0; }
  544. //-------------------------------------------------------------------------------------------------
  545. // 001D8DB4
  546. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  547. //-------------------------------------------------------------------------------------------------
  548. // 001D8E68
  549. void FREE_ProcessInProgressCore() {}
  550. //-------------------------------------------------------------------------------------------------
  551. // 001D956C
  552. void FREE_UpdateSuccess() {}
  553. //-------------------------------------------------------------------------------------------------
  554. // 001D96E4
  555. int FREE_ProcessLogic() { return 0; }
  556. //-------------------------------------------------------------------------------------------------
  557. // 001DA0A8
  558. void FREE_PlayCommentaryPassReceive() {}
  559. //-------------------------------------------------------------------------------------------------
  560. // 001DA208
  561. void FREE_PlayCommentaryKick() {}
  562. //-------------------------------------------------------------------------------------------------
  563. // 001DA484
  564. void FREE_SetComplete() {}
  565. //-------------------------------------------------------------------------------------------------
  566. // 001DA5C0
  567. void FREE_PlayersUpset(int) {}
  568. //-------------------------------------------------------------------------------------------------
  569. // 001DA620
  570. void FREE_PlayersCelebrate() {}
  571. //-------------------------------------------------------------------------------------------------
  572. // 001DA670
  573. void FREE_CheckCollision() {}
  574. //-------------------------------------------------------------------------------------------------
  575. // 001DA674
  576. //^_^
  577. void FREE_InitProps(void) {}
  578. //-------------------------------------------------------------------------------------------------
  579. // 001DA730
  580. void FREE_UpdateProps() {}
  581. //-------------------------------------------------------------------------------------------------
  582. // 001DA764
  583. void FREE_ShutdownProps() {}
  584. //-------------------------------------------------------------------------------------------------
  585. // 001DA7A4
  586. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  587. //-------------------------------------------------------------------------------------------------
  588. // 001DA7BC
  589. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  590. //-------------------------------------------------------------------------------------------------
  591. // 001DA7D4
  592. void FREE_RenderPropShadows() {}
  593. //-------------------------------------------------------------------------------------------------
  594. // 001DA8C0
  595. void FREE_RenderProps() {}
  596. //-------------------------------------------------------------------------------------------------
  597. // 001DA9AC
  598. void FREE_ProcessPropCollision(TFreeProp *) {}
  599. //-------------------------------------------------------------------------------------------------
  600. // 001DA9AE
  601. void FREE_ProcessPropCollisions() {}
  602. //-------------------------------------------------------------------------------------------------
  603. // 001DA9B0
  604. //^_^
  605. void FREE_RenderInitOnce() {}
  606. //-------------------------------------------------------------------------------------------------
  607. // 001DA9E0
  608. void FREE_RenderShutdownOnce() {}
  609. //-------------------------------------------------------------------------------------------------
  610. // 001DAA00
  611. void FREE_RenderInit() {}
  612. //-------------------------------------------------------------------------------------------------
  613. // 001DAAAC
  614. void FREE_RenderShutdown() {}
  615. //-------------------------------------------------------------------------------------------------
  616. // 001DAAF4
  617. void FREE_RenderListBegin(char const *, bool, bool) {}
  618. //-------------------------------------------------------------------------------------------------
  619. // 001DAB84
  620. void FREE_RenderListEnd() {}
  621. //-------------------------------------------------------------------------------------------------
  622. // 001DABD4
  623. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  624. //-------------------------------------------------------------------------------------------------
  625. // 001DAC40
  626. void FREE_RenderStar(TPoint3D, float, float) {}
  627. //-------------------------------------------------------------------------------------------------
  628. // 001DACE4
  629. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  630. //-------------------------------------------------------------------------------------------------
  631. // 001DAEEC
  632. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  633. //-------------------------------------------------------------------------------------------------
  634. // 001DB0BC
  635. void FREE_RenderRangeCone() {}
  636. //-------------------------------------------------------------------------------------------------
  637. // 001DB3CC
  638. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  639. //-------------------------------------------------------------------------------------------------
  640. // 001DB5C0
  641. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  642. //-------------------------------------------------------------------------------------------------
  643. // 001DB9C8
  644. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  645. //-------------------------------------------------------------------------------------------------
  646. // 001DBBCC
  647. void FREE_Render3DOpaque() {}
  648. //-------------------------------------------------------------------------------------------------
  649. // 001DBBF0
  650. void FREE_RenderHeroPlayer(bool) {}
  651. //-------------------------------------------------------------------------------------------------
  652. // 001DBEEC
  653. void FREE_Render3DDecal() {}
  654. //-------------------------------------------------------------------------------------------------
  655. // 001DBFC4
  656. void FREE_RenderPreSelectedPlayer() {}
  657. //-------------------------------------------------------------------------------------------------
  658. // 001DC0E0
  659. void FREE_RenderProcess() {}
  660. //-------------------------------------------------------------------------------------------------
  661. // 001DC0E4
  662. void FREE_AddVisualFeedback(int, EVFEffect, int) {}
  663. //-------------------------------------------------------------------------------------------------
  664. // 001DC290
  665. void FREE_AddVisualFeedback_Pass() {}
  666. //-------------------------------------------------------------------------------------------------
  667. // 001DC354
  668. void FREE_AddVisualFeedback_Goal() {}
  669. //-------------------------------------------------------------------------------------------------
  670. // 001DC440
  671. void FREE_AddVisualFeedback_Fail() {}
  672. //-------------------------------------------------------------------------------------------------
  673. // 001DC494
  674. void FREE_AddVisualFeedback_Offside() {}
  675. //-------------------------------------------------------------------------------------------------
  676. // 001DC4C8
  677. void FREE_SortPlayers(TFreeGoal *) {}
  678. //-------------------------------------------------------------------------------------------------
  679. // 001DC664
  680. void FREE_SortPlayersDistance(TFreeGoal *) {}
  681. //-------------------------------------------------------------------------------------------------
  682. // 001DC848
  683. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  684. //-------------------------------------------------------------------------------------------------
  685. // 001DC888
  686. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  687. //-------------------------------------------------------------------------------------------------
  688. // 001DCA14
  689. void FREE_ReadXMLLevel(TFreeGoal *, CFTTXmlReaderNode) {}
  690. //-------------------------------------------------------------------------------------------------
  691. // 00169A80 ^_-
  692. //单元测试等级: 游戏运行正常
  693. //单元测试内容: 1-10关
  694. //单元测试结果: 正常
  695. void PhysicsTest() {
  696. LOGE("PhysicsTest_0"); // OK
  697. fpointQ<PointType_18> fpointq_sp240;
  698. fpointq_sp240.field_0 = 0;
  699. fpointq_sp240.field_4 = 0;
  700. fpointq_sp240.field_8 = 0;
  701. fpointq_sp240.field_C = 0x40000;
  702. fpoint3<PointType_18> fpoint3_sp25c;
  703. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  704. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  705. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  706. CFTTPObject *r6_pobject = new CFTTPObject(
  707. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  708. r6_pobject->fpoint3_1C.x_0 =
  709. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  710. r6_pobject->fpoint3_1C.y_4 =
  711. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  712. r6_pobject->fpoint3_1C.z_8 =
  713. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  714. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  715. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  716. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  717. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  718. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  719. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  720. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  721. r6_pobject->field_34 = 0x94D65;
  722. r6_pobject->field_38 = 0x37D2A4D;
  723. fpoint<PointType_18> fpoint_sp23c;
  724. fpoint3<PointType_18> fpoint3_sp230;
  725. fpointQ<PointType_18> fpointQ_sp220;
  726. fpointQ_sp220.field_0 = 0;
  727. fpointQ_sp220.field_4 = 0;
  728. fpointQ_sp220.field_8 = 0;
  729. fpointQ_sp220.field_C = 0x40000;
  730. fpoint3_sp230.x_0 = 0;
  731. fpoint3_sp230.y_4 = 0;
  732. fpoint3_sp230.z_8 = 0;
  733. fpoint_sp23c.var_0 = 0x8000;
  734. // check 传参是否都是用了栈
  735. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  736. fpointQ_sp220); //这里头文件更新
  737. // 00169B60
  738. r6_pobject->field_3C = 0x8000;
  739. r0_psphere->field_64 = 0x8000;
  740. r6_pobject->field_44 = 0x10000;
  741. r6_pobject->field_40 = 0x40000;
  742. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  743. r0_psphere->filed_4 = r6_pobject;
  744. // sp1c=r6_pobject
  745. CFTTPhysics physics_sp218(0x40);
  746. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  747. // 00169B98
  748. pfpoint3_sp34[14].z_8 = 0;
  749. pfpoint3_sp34[15].x_0 = 0;
  750. pfpoint3_sp34[15].y_4 = 0;
  751. pfpoint3_sp34[15].z_8 = 0;
  752. pfpoint3_sp34[13].z_8 = 0;
  753. pfpoint3_sp34[14].x_0 = 0;
  754. pfpoint3_sp34[14].y_4 = 0;
  755. pfpoint3_sp34[14].z_8 = 0;
  756. pfpoint3_sp34[12].y_4 = 0;
  757. pfpoint3_sp34[12].z_8 = 0;
  758. pfpoint3_sp34[13].x_0 = 0;
  759. pfpoint3_sp34[13].y_4 = 0;
  760. // 00169C06
  761. pfpoint3_sp34[11].x_0 = 0;
  762. pfpoint3_sp34[11].y_4 = 0;
  763. pfpoint3_sp34[11].z_8 = 0;
  764. pfpoint3_sp34[12].x_0 = 0;
  765. // 00169C16
  766. pfpoint3_sp34[1].y_4 = 0x20000;
  767. pfpoint3_sp34[2].z_8 = 0x3333;
  768. pfpoint3_sp34[2].x_0 = 0x18000;
  769. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  770. // 00169C2C
  771. pfpoint3_sp34[2].z_8 = 0x3333;
  772. pfpoint3_sp34[3].x_0 = 0x10000;
  773. pfpoint3_sp34[3].y_4 = 0x72AAA;
  774. pfpoint3_sp34[3].z_8 = 0x3333;
  775. // 00169C34
  776. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  777. pfpoint3_sp34[4].y_4 = 0x72AAA;
  778. pfpoint3_sp34[4].z_8 = 0x3333;
  779. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  780. // 00169C3C
  781. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  782. pfpoint3_sp34[4].z_8 = 0x3333;
  783. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  784. pfpoint3_sp34[5].y_4 = 0x20000;
  785. // 00169C44
  786. pfpoint3_sp34[5].z_8 = 0x3333;
  787. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  788. pfpoint3_sp34[6].y_4 = 0;
  789. pfpoint3_sp34[6].z_8 = 0x3333;
  790. // 00169C4C
  791. pfpoint3_sp34[7].x_0 = 0x10000;
  792. pfpoint3_sp34[7].y_4 = 0;
  793. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  794. pfpoint3_sp34[7].x_0 = 0x18000;
  795. // 00169C5A
  796. pfpoint3_sp34[7].y_4 = 0x20000;
  797. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  798. pfpoint3_sp34[8].x_0 = 0x18000;
  799. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  800. // 00169C60
  801. pfpoint3_sp34[0].x_0 = 0x10000;
  802. pfpoint3_sp34[0].y_4 = 0;
  803. pfpoint3_sp34[0].z_8 = 0x3333;
  804. pfpoint3_sp34[1].x_0 = 0x18000;
  805. // 00169C68
  806. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  807. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  808. pfpoint3_sp34[15].y_4 = 0;
  809. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  810. // 00169C6C
  811. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  812. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  813. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  814. pfpoint3_sp34[14].y_4 = 0x20000;
  815. // 00169C74
  816. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  817. pfpoint3_sp34[12].y_4 = 0x72AAA;
  818. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  819. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  820. // 00169C7C
  821. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  822. pfpoint3_sp34[11].x_0 = 0x10000;
  823. pfpoint3_sp34[11].y_4 = 0x72AAA;
  824. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  825. // sp48=FREE_tInfo
  826. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  827. // 00169C90
  828. // loc_16A21E
  829. LOGE("PhysicsTest_case");
  830. for (int r2_i = 0;
  831. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  832. r2_i++) {
  833. // loc_169CC0
  834. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  835. .m_iType_C) {
  836. case 0: // loc_169EC0
  837. {
  838. // check 手机左移
  839. // sp4c = r2
  840. // check 运算
  841. LOGE("PhysicsTest_case_0");
  842. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  843. .m_iRot_10 *
  844. 0x40000 / 0xB4;
  845. uint64 r3r1_ull = 0x3243F4000;
  846. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  847. int r4_i = r1r0_ll / 2;
  848. int i_sp1b0;
  849. int i_sp214 = r4_i;
  850. sub_16A57C(i_sp1b0, i_sp214);
  851. sub_16A6CC(i_sp214, r4_i);
  852. fpoint3<PointType_18> fpoint3_spc0;
  853. fpointQ<PointType_18> fpointQ_spb0;
  854. // check 乘法
  855. fpoint3_spc0.x_0 =
  856. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  857. .m_tPoint3D_0.point_0.dx_0 *
  858. 8;
  859. fpoint3_spc0.y_4 =
  860. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  861. .m_tPoint3D_0.dz_8 *
  862. 8;
  863. fpoint3_spc0.z_8 =
  864. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  865. .m_tPoint3D_0.point_0.dy_4 *
  866. 8;
  867. fpointQ_spb0.field_0 = 0;
  868. fpointQ_spb0.field_4 = i_sp1b0;
  869. fpointQ_spb0.field_8 = 0;
  870. fpointQ_spb0.field_C = i_sp214;
  871. CFTTPObject *r4_pobject = new CFTTPObject(
  872. EPhysicsObjectType_2,
  873. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  874. .m_iType_C,
  875. 2, fpoint3_spc0, fpointQ_spb0);
  876. // 00169F5C
  877. r4_pobject->field_34 = 0;
  878. r4_pobject->field_38 = 0;
  879. r4_pobject->field_3C = 0x40000;
  880. r4_pobject->field_40 = 0x4000; // dword_16A448
  881. r4_pobject->field_44 = 0x20000;
  882. fpoint<PointType_18> fpoint_spac;
  883. fpoint<PointType_18> fpoint_spa8;
  884. fpoint<PointType_18> fpoint_spa4;
  885. fpoint3<PointType_18> fpoint3_sp98;
  886. fpointQ<PointType_18> fpointQ_sp80;
  887. fpoint3_sp98.x_0 = 0;
  888. fpoint_spac.var_0 = 0x3333;
  889. fpoint_spa8.var_0 = 0x6666;
  890. fpoint_spa4.var_0 = 0x15555;
  891. fpointQ_sp80.field_0 = 0;
  892. fpointQ_sp80.field_4 = 0;
  893. fpointQ_sp80.field_8 = 0;
  894. fpointQ_sp80.field_C = 0x40000;
  895. fpoint3_sp98.y_4 = 0xEAAA;
  896. fpoint3_sp98.z_8 = 0;
  897. // fpointQ_sp80
  898. CFTTPPCone *r5_pcone =
  899. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  900. fpoint3_sp98, fpointQ_sp80);
  901. fpoint3<PointType_18> fpoint3_sp74;
  902. fpoint3<PointType_18> fpoint3_sp68;
  903. fpointQ<PointType_18> fpointQ_sp50;
  904. fpoint3_sp74.x_0 = 0xCCCC;
  905. fpointQ_sp50.field_0 = 0;
  906. fpointQ_sp50.field_4 = 0;
  907. fpointQ_sp50.field_8 = 0;
  908. fpointQ_sp50.field_C = 0x40000;
  909. fpoint3_sp74.y_4 = 0x4000;
  910. fpoint3_sp74.z_8 = 0xCCCC;
  911. fpoint3_sp68.x_0 = 0;
  912. fpoint3_sp68.y_4 = 0x2000;
  913. fpoint3_sp68.z_8 = 0;
  914. CFTTPPBox *r0_pbox =
  915. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  916. r5_pcone->field_64 = 0x15555;
  917. r0_pbox->field_64 = 0xCCCC;
  918. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  919. r0_pbox->filed_4 = r4_pobject;
  920. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  921. r5_pcone->filed_4 = r4_pobject;
  922. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  923. r4_pobject;
  924. break;
  925. }
  926. case 2: // loc_16A030
  927. {
  928. LOGE("PhysicsTest_case_2");
  929. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  930. .m_iRot_10 *
  931. 0x40000 / 0xB4;
  932. uint64 r3r1_ull = 0x3243F4000;
  933. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  934. int r4_i = r1r0_ll / 2;
  935. int i_sp214;
  936. int i_sp1b0 = r4_i;
  937. sub_16A57C(i_sp214, i_sp1b0);
  938. int i_sp210;
  939. i_sp1b0 = r4_i;
  940. sub_16A6CC(i_sp210, i_sp1b0);
  941. // sp40=i_sp210
  942. // sp3c=sp214
  943. fpoint3<PointType_18> fpoint3_sp154;
  944. fpoint3<PointType_18> fpoint3_sp148;
  945. fpointQ<PointType_18> fpointQ_sp138;
  946. fpointQ<PointType_18> fpointQ_sp1b0;
  947. fpoint3_sp154.x_0 = 0x70000;
  948. fpoint3_sp154.y_4 = 0x20000;
  949. fpoint3_sp154.z_8 = 0x6666;
  950. fpointQ_sp1b0.field_0 = 0x3333;
  951. fpointQ_sp1b0.field_4 = 0;
  952. fpointQ_sp1b0.field_8 = 0;
  953. fpointQ_sp1b0.field_C = 0x40000;
  954. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  955. CFTTPPBox *pbox_sp38 =
  956. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  957. // 0016A0DC
  958. pbox_sp38->field_64 = 0x70000;
  959. fpoint3<PointType_18> fpoint3_sp12c;
  960. fpoint3<PointType_18> fpoint3_sp120;
  961. fpointQ<PointType_18> fpointQ_sp110;
  962. fpoint3_sp120.x_0 = 0xFFFD0000;
  963. fpoint3_sp12c.x_0 = 0x6666;
  964. fpoint3_sp12c.y_4 = 0x20000;
  965. fpoint3_sp12c.z_8 = 0x15555;
  966. fpoint3_sp120.y_4 = 0x10000;
  967. fpoint3_sp120.z_8 = 0xAAAA;
  968. fpointQ_sp1b0.field_0 = 0x3333;
  969. fpointQ_sp1b0.field_4 = 0;
  970. fpointQ_sp1b0.field_8 = 0;
  971. fpointQ_sp1b0.field_C = 0x40000;
  972. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  973. // 0016A120
  974. CFTTPPBox *r4_pbox =
  975. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  976. // 0016A122
  977. fpoint3<PointType_18> fpoint3_sp104;
  978. fpoint3<PointType_18> fpoint3_spf8;
  979. fpointQ<PointType_18> fpointQ_spe8;
  980. fpoint3_sp104.x_0 = 0x6666;
  981. fpoint3_sp104.y_4 = 0x20000;
  982. fpoint3_sp104.z_8 = 0x15555;
  983. fpoint3_spf8.x_0 = 0x30000;
  984. fpoint3_spf8.y_4 = 0x10000;
  985. fpoint3_spf8.z_8 = 0xAAAA;
  986. fpointQ_sp1b0.field_0 = 0x3333;
  987. fpointQ_sp1b0.field_4 = 0;
  988. fpointQ_sp1b0.field_8 = 0;
  989. fpointQ_sp1b0.field_C = 0x40000;
  990. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  991. // 0016A164
  992. CFTTPPBox *r6_pbox =
  993. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  994. // 0016A166
  995. r4_pbox->field_64 = 0x15555;
  996. r6_pbox->field_64 = 0x15555;
  997. fpoint3<PointType_18> fpoint3_spdc;
  998. fpointQ<PointType_18> fpointQ_spcc;
  999. fpointQ_spcc.field_4 = i_sp214;
  1000. fpointQ_spcc.field_C = i_sp210;
  1001. fpoint3_spdc.x_0 =
  1002. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1003. .m_tPoint3D_0.point_0.dx_0 *
  1004. 8;
  1005. fpoint3_spdc.z_8 =
  1006. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1007. .m_tPoint3D_0.point_0.dy_4 *
  1008. 8;
  1009. fpoint3_spdc.y_4 =
  1010. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1011. .m_tPoint3D_0.dz_8 *
  1012. 8;
  1013. fpointQ_spcc.field_0 = 0;
  1014. fpointQ_spcc.field_8 = 0;
  1015. CFTTPObject *r0_pobject = new CFTTPObject(
  1016. EPhysicsObjectType_2,
  1017. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1018. .m_iType_C,
  1019. 3, fpoint3_spdc, fpointQ_spcc);
  1020. // 0016A1B0
  1021. r0_pobject->field_34 = 0;
  1022. r0_pobject->field_38 = 0;
  1023. r0_pobject->field_3C = 0x70000;
  1024. r0_pobject->field_40 = 0x30000;
  1025. r0_pobject->field_44 = 0x4000;
  1026. r0_pobject->field_A0 = 0x18;
  1027. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  1028. pbox_sp38->filed_4 = r0_pobject;
  1029. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  1030. r4_pbox->filed_4 = r0_pobject;
  1031. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  1032. r6_pbox->filed_4 = r0_pobject;
  1033. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1034. r0_pobject;
  1035. break;
  1036. }
  1037. case 1: // 00169CDA
  1038. {
  1039. // sp4c = r2
  1040. // check 运算
  1041. LOGE("PhysicsTest_case_1");
  1042. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1043. .m_iRot_10 *
  1044. 0x40000 / 0xB4;
  1045. uint64 r3r1_ull = 0x3243F4000;
  1046. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1047. int r4_i = r1r0_ll / 2;
  1048. int i_sp214;
  1049. int i_sp210;
  1050. sub_16A57C(i_sp214, r4_i);
  1051. sub_16A6CC(i_sp210, r4_i);
  1052. fpoint3<PointType_18> fpoint3_sp204;
  1053. fpointQ<PointType_18> fpointQ_sp1f4;
  1054. fpointQ_sp1f4.field_0 = 0;
  1055. fpointQ_sp1f4.field_4 = i_sp214;
  1056. fpointQ_sp1f4.field_8 = 0;
  1057. fpointQ_sp1f4.field_C = i_sp210;
  1058. TPoint3D point3D =
  1059. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1060. .m_tPoint3D_0;
  1061. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  1062. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  1063. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  1064. CFTTPObject *r11_pobject = new CFTTPObject(
  1065. EPhysicsObjectType_2,
  1066. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1067. .m_iType_C,
  1068. 3, fpoint3_sp204, fpointQ_sp1f4);
  1069. int i_sp1b0;
  1070. int i_sp1f0 = 0x7F1AA;
  1071. sub_16A818(&i_sp1b0, &i_sp1f0);
  1072. r11_pobject->field_34 = 0;
  1073. r11_pobject->field_38 = 0;
  1074. r11_pobject->field_3C = i_sp1b0;
  1075. r11_pobject->field_40 = 0x10000;
  1076. r11_pobject->field_44 = 0x10000;
  1077. r11_pobject->field_A0 = 0x18;
  1078. fpoint<PointType_18> fpoint_sp1ec;
  1079. fpoint<PointType_18> fpoint_sp1e8;
  1080. fpoint3<PointType_18> fpoint3_sp1dc;
  1081. fpointQ<PointType_18> fpointQ_sp1cc;
  1082. fpoint_sp1ec.var_0 = 0x10000;
  1083. fpoint3_sp1dc.x_0 = 0;
  1084. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  1085. fpoint3_sp1dc.z_8 = 0;
  1086. fpoint_sp1e8.var_0 = 0x6666;
  1087. fpointQ<PointType_18> fpointQ_sp1b0;
  1088. fpointQ_sp1b0.field_0 = 0x40000;
  1089. fpointQ_sp1b0.field_4 = 0;
  1090. fpointQ_sp1b0.field_8 = 0;
  1091. fpointQ_sp1b0.field_C = 0x40000;
  1092. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1093. // check 前俩个参数传递是否使用栈
  1094. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1095. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1096. fpoint3<PointType_18> fpoint3_sp1a4;
  1097. fpoint3<PointType_18> fpoint3_sp198;
  1098. fpointQ<PointType_18> fpointQ_sp180;
  1099. fpoint3_sp1a4.z_8 = 0x6666;
  1100. // 00169DF4
  1101. fpointQ_sp180.field_0 = 0;
  1102. fpointQ_sp180.field_4 = 0;
  1103. fpointQ_sp180.field_8 = 0;
  1104. fpointQ_sp180.field_C = 0x40000;
  1105. fpoint3_sp1a4.x_0 = 0x20000;
  1106. fpoint3_sp1a4.y_4 = 0x20000;
  1107. fpoint3_sp198.x_0 = 0;
  1108. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1109. fpoint3_sp198.z_8 = 0;
  1110. CFTTPPBox *r5_pbox =
  1111. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1112. // 00169E14
  1113. fpoint3<PointType_18> fpoint3_sp174;
  1114. fpointQ<PointType_18> fpointQ_sp160;
  1115. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1116. fpoint3_sp174.x_0 = 0;
  1117. fpoint3_sp174.z_8 = 0;
  1118. fpointQ_sp160.field_0 = 0;
  1119. fpointQ_sp160.field_4 = 0;
  1120. fpointQ_sp160.field_8 = 0;
  1121. fpointQ_sp160.field_C = 0x40000;
  1122. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1123. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1124. // 00169E32
  1125. r4_pcylinder->field_64 = 0x10000;
  1126. r5_pbox->field_64 = 0x20000;
  1127. r0_ppolyhedron->field_64 = 0xABFFF;
  1128. // 00169E42
  1129. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1130. r5_pbox->filed_4 = r11_pobject;
  1131. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1132. r0_ppolyhedron->filed_4 = r11_pobject;
  1133. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1134. r4_pcylinder->filed_4 = r11_pobject;
  1135. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1136. r11_pobject;
  1137. break;
  1138. }
  1139. }
  1140. }
  1141. }
  1142. // loc_16A232
  1143. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  1144. if (physics_sp218.Process()) {
  1145. // 0016A24E
  1146. // sp18=cBall
  1147. LOGE("PhysicsTest_1");
  1148. cBall.ballPosPrev_4.point_0.dx_0 =
  1149. r6_pobject->fpoint3_0.x_0 /
  1150. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  1151. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  1152. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  1153. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  1154. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  1155. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  1156. fpointQ<PointType_18> fpointQ_sp1b0;
  1157. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  1158. // check 除法
  1159. // 0016A2AA
  1160. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  1161. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  1162. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  1163. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  1164. // check
  1165. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  1166. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  1167. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  1168. // loc_16A344
  1169. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  1170. // loc_16A30C
  1171. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  1172. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  1173. if (FREE_tInfo.filed_0.ugamestatus_1828 <= 8) {
  1174. // check
  1175. if ((1 << FREE_tInfo.filed_0.ugamestatus_1828) & 0x190) {
  1176. LOGE("PhysicsTest_2");
  1177. tGame.field_6C98 = 0;
  1178. tGame.mTLogic_6678.freeproptype_74 =
  1179. physics_sp218.ppobject_0[r5_i]->field_90;
  1180. }
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. // loc_16A348
  1187. delete[] pfpoint3_sp34;
  1188. }
  1189. //-------------------------------------------------------------------------------------------------