FREE.cpp 46 KB

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