FREE.cpp 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  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 = FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
  242. FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =FREE_tGoal.m_fCPUCloseDownDist_7480;
  243. FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 = FREE_tGoal.m_iCPUKickResponseTime_749C;
  244. FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C = FREE_tGoal.m_iCPUMoveResponseTime_74A0;
  245. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
  246. //注意!!!!!这里的数据符号不对 注意更新 FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
  247. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
  248. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
  249. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490;
  250. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =FREE_tGoal.m_fCPUGKSaveDistance_7494;
  251. uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
  252. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498;
  253. // 001D43B6
  254. if (r5_c != 0) {
  255. // 001D43B8
  256. // float s0_f = 2.8;
  257. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =FREE_tGoal.m_iCPUGKRating_7484 - 5;
  258. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 = FREE_tGoal.m_iCPUGKSaveResponseTime_748C + 4;
  259. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
  260. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 = FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 -0.200000003f;
  261. // 001D43E6
  262. if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
  263. // 001D43FA
  264. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
  265. } else
  266. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
  267. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =FREE_tGoal.m_fCPUGKSaveSpeed_7490 -5.0f;
  268. }
  269. // locret_1D4410
  270. }
  271. //-------------------------------------------------------------------------------------------------
  272. // 001D4424
  273. void FREE_Initialise() {}
  274. //-------------------------------------------------------------------------------------------------
  275. // 001D49C0
  276. void FREE_UpdateCamera(bool) {}
  277. //-------------------------------------------------------------------------------------------------
  278. // 001D56CC
  279. void FREE_ClipPathBounds(TPoint3D *, TPoint3D *, int, int, int, int) {}
  280. //-------------------------------------------------------------------------------------------------
  281. // 001D5718
  282. // void FREE_GameLoop() {
  283. // int r0_i = 0;
  284. // int r1_i = 0;
  285. // int r2_i = 0;
  286. // // 001D571E
  287. // if (NIS_Active() != 0) {
  288. // // 001D5720
  289. // // NIS_GameLoop();
  290. // CFreeHUD::Process();
  291. // // 47F7D8 - 0x47DFB0
  292. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  293. // // 001D5734
  294. // if (r0_i == 6) {
  295. // // 001D5738
  296. // FREE_ProcessFail();
  297. // r1_i = FREE_tInfo.filed_0.field_182C;
  298. // r1_i = r1_i + 1;
  299. // FREE_tInfo.filed_0.field_182C = r1_i;
  300. // return;
  301. // } else {
  302. // // locret_1D582E
  303. // return;
  304. // }
  305. // }
  306. // // loc_1D5748
  307. // // 47F7D8 - 0x47DFB0 = 1828
  308. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  309. // // 001D5754
  310. // if (r0_i != 8) {
  311. // // 001D5758
  312. // tGame.maybe_sound_0++;
  313. // }
  314. // // loc_1D5764
  315. // // 004877F5
  316. // NISGOAL_tInfo.field_1 = 0;
  317. // // 47DFB1 - 0x47DFB0
  318. // FREE_tInfo.filed_0.b_1 = 1;
  319. // // 001D5776
  320. // if (CReplay::Playing() != 0) {
  321. // // 001D5778
  322. // CReplay::Play();
  323. // }
  324. // // loc_1D577C
  325. // // 47F7D8 - 0x47DFB0
  326. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  327. // // 001D5782
  328. // if (r0_i == 7) {
  329. // // 47F7DC - 0x47DFB0
  330. // r1_i = FREE_tInfo.filed_0.field_182C;
  331. // // 3A27BC - 0x39BB88
  332. // r2_i = tGame.field_6C34;
  333. // // 001D5798
  334. // if (r2_i < r1_i) {
  335. // // 001D579C
  336. // r0_i = tGame.mTLogic_6678.field_50;
  337. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  338. // if (r1_i == r0_i) {
  339. // // 001D57C6
  340. // CGFXFX::EnableStarPlayerEffects();
  341. // }
  342. // } else {
  343. // // loc_1D57B0
  344. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  345. // r1_i = FREE_tInfo.filed_0.field_1830;
  346. // if (r1_i == r0_i) {
  347. // // 001D57C6
  348. // CGFXFX::EnableStarPlayerEffects();
  349. // }
  350. // }
  351. // }
  352. // // loc_1D57CA
  353. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  354. // float r0_f = 0.01666666753590107;
  355. // CGFXFX::Update(r0_f);
  356. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  357. // GFXCAMERA_UpdateMatrices();
  358. // int r4_i = FREE_ProcessLogic();
  359. // // 47FC60 - 0x47DFB0
  360. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  361. // // 001D57F2
  362. // if (r4_i != 0) {
  363. // // 001D57F8
  364. // if (CReplay::Playing() != 0) {
  365. // // loc_1D57FA
  366. // CAM_Update();
  367. // return;
  368. // }
  369. // } else {
  370. // // loc_1D57FA
  371. // CAM_Update();
  372. // return;
  373. // }
  374. // // loc_1D5802
  375. // // 3A2208 - 0x39BB88
  376. // r0_i = tGame.mTLogic_6678.field_8;
  377. // // 001D580E
  378. // if (r0_i == 2) {
  379. // // 001D5812
  380. // // 3A2238 - 0x39BB88
  381. // r0_i = tGame.mTLogic_6678.field_38;
  382. // // 001D5818
  383. // if (r0_i <= 29) {
  384. // // 001D581C
  385. // CReplay::RecordFrame();
  386. // }
  387. // } else {
  388. // // loc_1D5822
  389. // CReplay::RecordFrame();
  390. // }
  391. // // loc_1D5826
  392. // // 3A22A0 - 0x39BB88
  393. // r0_i = tGame.mTLogic_6678.field_A0;
  394. // // 001D582C
  395. // if (r0_i != 0) {
  396. // // locret_1D582E
  397. // return;
  398. // }
  399. // // loc_1D5830
  400. // CPlayerManager::UpdatePlayersLogic();
  401. // FREE_CheckCollision();
  402. // cBall.UpdateFrame();
  403. // // 47F7D8 - 0x47DFB0
  404. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  405. // // 001D584A
  406. // if (r0_i != 4) {
  407. // // 001D584E
  408. // COL_PlayerCollisions();
  409. // }
  410. // // 001D5852
  411. // PhysicsTest();
  412. // cBall.CheckEvents();
  413. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  414. // GFXNET::Update(0.01666666753590107f);
  415. // GL_UpdatePlayMode();
  416. // GM_CalcPlayerDist();
  417. // GM_CalcPlayerBallInterceptions();
  418. // FREE_LogicProcess();
  419. // // 3A2204 - 0x39BB88
  420. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  421. // // 001D5878
  422. // if (r0_i == 0) {
  423. // // 001D587C
  424. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  425. // // 001D5882
  426. // if (r0_i >= 4) {
  427. // // 001D5886
  428. // CPlayerManager::UpdatePlayers();
  429. // }
  430. // // 001D588A
  431. // COMM_Process();
  432. // }
  433. // // loc_1D57FA
  434. // CAM_Update();
  435. // return;
  436. // }
  437. //-------------------------------------------------------------------------------------------------
  438. // 001D58B4
  439. void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
  440. //-------------------------------------------------------------------------------------------------
  441. // 001D5A3E
  442. void FREE_UpdateRewindState() {}
  443. //-------------------------------------------------------------------------------------------------
  444. // 001D5A40
  445. void FREE_RestoreRewindState() {}
  446. //-------------------------------------------------------------------------------------------------
  447. // 001D5AE4
  448. void FREE_BeginRewind() {}
  449. //-------------------------------------------------------------------------------------------------
  450. // 001D5B30
  451. int FREE_RewindFrame() { return 0; }
  452. //-------------------------------------------------------------------------------------------------
  453. // 001D5C0C
  454. void FREE_ClipPathBounds(TPoint *, TPoint *, int, int, int, int) {}
  455. //-------------------------------------------------------------------------------------------------
  456. // 001D656C
  457. void FREE_IdleProcess() {
  458. tGame.mTLogic_6678.field_8 = 1;
  459. LOGE("FREE_IdleProcess");
  460. }
  461. //-------------------------------------------------------------------------------------------------
  462. // 001D66F0
  463. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  464. void COUNTER_UpdateGenericCounters(void) {
  465. LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
  466. }
  467. //-------------------------------------------------------------------------------------------------
  468. // 001D6778 //^_-
  469. //单元测试等级:目测游戏表现
  470. //测试内容:启动游戏到第5关传球射门
  471. //测试结果: 修复后游戏表现正常
  472. void FREE_LogicProcess() {
  473. tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
  474. tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
  475. // 001D679E
  476. if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
  477. // 001D67A2
  478. FREE_IdleProcess();
  479. } else {
  480. // loc_1D67A8
  481. if (tGame.mTLogic_6678.field_8 == 1) {
  482. // 001D67AC
  483. COUNTER_UpdateGenericCounters();
  484. }
  485. // loc_1D67B0
  486. }
  487. // loc_1D67B0
  488. if (tGame.mTLogic_6678.field_10 == 0) {
  489. if (tGame.mTLogic_6678.field_8 != 1) {
  490. // 001D67C4
  491. CPlayerManager::SetPlayersWalking(1);
  492. }
  493. }
  494. // loc_1D67C8
  495. tGame.field_6C34++;
  496. tGame.field_6C38++;
  497. }
  498. //-------------------------------------------------------------------------------------------------
  499. // 001D67E8
  500. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  501. //-------------------------------------------------------------------------------------------------
  502. // 001D6918
  503. void FREE_ProcessShotAnim(CPlayer *) {}
  504. //-------------------------------------------------------------------------------------------------
  505. // 001D6CD8
  506. void FREE_ProcessUserTeam() {}
  507. //-------------------------------------------------------------------------------------------------
  508. // 001D7D74
  509. void FREE_ProcessOppoTeam() {}
  510. //-------------------------------------------------------------------------------------------------
  511. // 001D848C
  512. void FREE_ProcessFree() {}
  513. //-------------------------------------------------------------------------------------------------
  514. // 001D86C4
  515. void FREE_ProcessFail() {}
  516. //-------------------------------------------------------------------------------------------------
  517. // 001D8884
  518. void FREE_PlayCommentaryClearance() {}
  519. //-------------------------------------------------------------------------------------------------
  520. // 001D8944
  521. void FREE_PlayCommentaryInterception() {}
  522. //-------------------------------------------------------------------------------------------------
  523. // 001D8998
  524. void FREE_SetupKickAction(TPoint3D, int, int) {}
  525. //-------------------------------------------------------------------------------------------------
  526. // 001D8AD0
  527. void FREE_CheckGKHandPos(CPlayer *, int) {}
  528. //-------------------------------------------------------------------------------------------------
  529. // 001D8B9C
  530. int FREE_SetupPhaseTransition(bool) { return 0; }
  531. //-------------------------------------------------------------------------------------------------
  532. // 001D8DB4
  533. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  534. //-------------------------------------------------------------------------------------------------
  535. // 001D8E68
  536. void FREE_ProcessInProgressCore() {}
  537. //-------------------------------------------------------------------------------------------------
  538. // 001D956C
  539. void FREE_UpdateSuccess() {}
  540. //-------------------------------------------------------------------------------------------------
  541. // 001D96E4
  542. int FREE_ProcessLogic() { return 0; }
  543. //-------------------------------------------------------------------------------------------------
  544. // 001DA0A8
  545. void FREE_PlayCommentaryPassReceive() {}
  546. //-------------------------------------------------------------------------------------------------
  547. // 001DA208
  548. void FREE_PlayCommentaryKick() {}
  549. //-------------------------------------------------------------------------------------------------
  550. // 001DA484
  551. void FREE_SetComplete() {}
  552. //-------------------------------------------------------------------------------------------------
  553. // 001DA5C0
  554. void FREE_PlayersUpset(int) {}
  555. //-------------------------------------------------------------------------------------------------
  556. // 001DA620
  557. void FREE_PlayersCelebrate() {}
  558. //-------------------------------------------------------------------------------------------------
  559. // 001DA670
  560. void FREE_CheckCollision() {}
  561. //-------------------------------------------------------------------------------------------------
  562. // 001DA674
  563. //^_^
  564. void FREE_InitProps(void) {}
  565. //-------------------------------------------------------------------------------------------------
  566. // 001DA730
  567. void FREE_UpdateProps() {}
  568. //-------------------------------------------------------------------------------------------------
  569. // 001DA764
  570. void FREE_ShutdownProps() {}
  571. //-------------------------------------------------------------------------------------------------
  572. // 001DA7A4
  573. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  574. //-------------------------------------------------------------------------------------------------
  575. // 001DA7BC
  576. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  577. //-------------------------------------------------------------------------------------------------
  578. // 001DA7D4
  579. void FREE_RenderPropShadows() {}
  580. //-------------------------------------------------------------------------------------------------
  581. // 001DA8C0
  582. void FREE_RenderProps() {}
  583. //-------------------------------------------------------------------------------------------------
  584. // 001DA9AC
  585. void FREE_ProcessPropCollision(TFreeProp *) {}
  586. //-------------------------------------------------------------------------------------------------
  587. // 001DA9AE
  588. void FREE_ProcessPropCollisions() {}
  589. //-------------------------------------------------------------------------------------------------
  590. // 001DA9B0
  591. //^_^
  592. void FREE_RenderInitOnce() {}
  593. //-------------------------------------------------------------------------------------------------
  594. // 001DA9E0
  595. void FREE_RenderShutdownOnce() {}
  596. //-------------------------------------------------------------------------------------------------
  597. // 001DAA00
  598. void FREE_RenderInit() {}
  599. //-------------------------------------------------------------------------------------------------
  600. // 001DAAAC
  601. void FREE_RenderShutdown() {}
  602. //-------------------------------------------------------------------------------------------------
  603. // 001DAAF4
  604. void FREE_RenderListBegin(char const *, bool, bool) {}
  605. //-------------------------------------------------------------------------------------------------
  606. // 001DAB84
  607. void FREE_RenderListEnd() {}
  608. //-------------------------------------------------------------------------------------------------
  609. // 001DABD4
  610. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  611. //-------------------------------------------------------------------------------------------------
  612. // 001DAC40
  613. void FREE_RenderStar(TPoint3D, float, float) {}
  614. //-------------------------------------------------------------------------------------------------
  615. // 001DACE4
  616. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  617. //-------------------------------------------------------------------------------------------------
  618. // 001DAEEC
  619. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  620. //-------------------------------------------------------------------------------------------------
  621. // 001DB0BC
  622. void FREE_RenderRangeCone() {}
  623. //-------------------------------------------------------------------------------------------------
  624. // 001DB3CC
  625. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  626. //-------------------------------------------------------------------------------------------------
  627. // 001DB5C0
  628. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  629. //-------------------------------------------------------------------------------------------------
  630. // 001DB9C8
  631. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  632. //-------------------------------------------------------------------------------------------------
  633. // 001DBBCC
  634. void FREE_Render3DOpaque() {}
  635. //-------------------------------------------------------------------------------------------------
  636. // 001DBBF0
  637. void FREE_RenderHeroPlayer(bool) {}
  638. //-------------------------------------------------------------------------------------------------
  639. // 001DBEEC
  640. void FREE_Render3DDecal() {}
  641. //-------------------------------------------------------------------------------------------------
  642. // 001DBFC4
  643. void FREE_RenderPreSelectedPlayer() {}
  644. //-------------------------------------------------------------------------------------------------
  645. // 001DC0E0
  646. void FREE_RenderProcess() {}
  647. //-------------------------------------------------------------------------------------------------
  648. // 001DC0E4
  649. void FREE_AddVisualFeedback(int, EVFEffect, int) {}
  650. //-------------------------------------------------------------------------------------------------
  651. // 001DC290
  652. void FREE_AddVisualFeedback_Pass() {}
  653. //-------------------------------------------------------------------------------------------------
  654. // 001DC354
  655. void FREE_AddVisualFeedback_Goal() {}
  656. //-------------------------------------------------------------------------------------------------
  657. // 001DC440
  658. void FREE_AddVisualFeedback_Fail() {}
  659. //-------------------------------------------------------------------------------------------------
  660. // 001DC494
  661. void FREE_AddVisualFeedback_Offside() {}
  662. //-------------------------------------------------------------------------------------------------
  663. // 001DC4C8
  664. void FREE_SortPlayers(TFreeGoal *) {}
  665. //-------------------------------------------------------------------------------------------------
  666. // 001DC664
  667. void FREE_SortPlayersDistance(TFreeGoal *) {}
  668. //-------------------------------------------------------------------------------------------------
  669. // 001DC848
  670. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  671. //-------------------------------------------------------------------------------------------------
  672. // 001DC888
  673. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  674. //-------------------------------------------------------------------------------------------------
  675. // 001DCA14
  676. void FREE_ReadXMLLevel(TFreeGoal *, CFTTXmlReaderNode) {}
  677. //-------------------------------------------------------------------------------------------------
  678. // 00169A80 ^_-
  679. //单元测试等级: 游戏运行正常
  680. //单元测试内容: 1-10关
  681. //单元测试结果: 正常
  682. void PhysicsTest() {
  683. LOGE("PhysicsTest_0"); // OK
  684. fpointQ<PointType_18> fpointq_sp240;
  685. fpointq_sp240.field_0 = 0;
  686. fpointq_sp240.field_4 = 0;
  687. fpointq_sp240.field_8 = 0;
  688. fpointq_sp240.field_C = 0x40000;
  689. fpoint3<PointType_18> fpoint3_sp25c;
  690. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  691. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  692. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  693. CFTTPObject *r6_pobject = new CFTTPObject(
  694. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  695. r6_pobject->fpoint3_1C.x_0 =
  696. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  697. r6_pobject->fpoint3_1C.y_4 =
  698. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  699. r6_pobject->fpoint3_1C.z_8 =
  700. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  701. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  702. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  703. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  704. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  705. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  706. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  707. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  708. r6_pobject->field_34 = 0x94D65;
  709. r6_pobject->field_38 = 0x37D2A4D;
  710. fpoint<PointType_18> fpoint_sp23c;
  711. fpoint3<PointType_18> fpoint3_sp230;
  712. fpointQ<PointType_18> fpointQ_sp220;
  713. fpointQ_sp220.field_0 = 0;
  714. fpointQ_sp220.field_4 = 0;
  715. fpointQ_sp220.field_8 = 0;
  716. fpointQ_sp220.field_C = 0x40000;
  717. fpoint3_sp230.x_0 = 0;
  718. fpoint3_sp230.y_4 = 0;
  719. fpoint3_sp230.z_8 = 0;
  720. fpoint_sp23c.var_0 = 0x8000;
  721. // check 传参是否都是用了栈
  722. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  723. fpointQ_sp220); //这里头文件更新
  724. // 00169B60
  725. r6_pobject->field_3C = 0x8000;
  726. r0_psphere->field_64 = 0x8000;
  727. r6_pobject->field_44 = 0x10000;
  728. r6_pobject->field_40 = 0x40000;
  729. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  730. r0_psphere->filed_4 = r6_pobject;
  731. // sp1c=r6_pobject
  732. CFTTPhysics physics_sp218(0x40);
  733. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  734. // 00169B98
  735. pfpoint3_sp34[14].z_8 = 0;
  736. pfpoint3_sp34[15].x_0 = 0;
  737. pfpoint3_sp34[15].y_4 = 0;
  738. pfpoint3_sp34[15].z_8 = 0;
  739. pfpoint3_sp34[13].z_8 = 0;
  740. pfpoint3_sp34[14].x_0 = 0;
  741. pfpoint3_sp34[14].y_4 = 0;
  742. pfpoint3_sp34[14].z_8 = 0;
  743. pfpoint3_sp34[12].y_4 = 0;
  744. pfpoint3_sp34[12].z_8 = 0;
  745. pfpoint3_sp34[13].x_0 = 0;
  746. pfpoint3_sp34[13].y_4 = 0;
  747. // 00169C06
  748. pfpoint3_sp34[11].x_0 = 0;
  749. pfpoint3_sp34[11].y_4 = 0;
  750. pfpoint3_sp34[11].z_8 = 0;
  751. pfpoint3_sp34[12].x_0 = 0;
  752. // 00169C16
  753. pfpoint3_sp34[1].y_4 = 0x20000;
  754. pfpoint3_sp34[2].z_8 = 0x3333;
  755. pfpoint3_sp34[2].x_0 = 0x18000;
  756. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  757. // 00169C2C
  758. pfpoint3_sp34[2].z_8 = 0x3333;
  759. pfpoint3_sp34[3].x_0 = 0x10000;
  760. pfpoint3_sp34[3].y_4 = 0x72AAA;
  761. pfpoint3_sp34[3].z_8 = 0x3333;
  762. // 00169C34
  763. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  764. pfpoint3_sp34[4].y_4 = 0x72AAA;
  765. pfpoint3_sp34[4].z_8 = 0x3333;
  766. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  767. // 00169C3C
  768. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  769. pfpoint3_sp34[4].z_8 = 0x3333;
  770. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  771. pfpoint3_sp34[5].y_4 = 0x20000;
  772. // 00169C44
  773. pfpoint3_sp34[5].z_8 = 0x3333;
  774. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  775. pfpoint3_sp34[6].y_4 = 0;
  776. pfpoint3_sp34[6].z_8 = 0x3333;
  777. // 00169C4C
  778. pfpoint3_sp34[7].x_0 = 0x10000;
  779. pfpoint3_sp34[7].y_4 = 0;
  780. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  781. pfpoint3_sp34[7].x_0 = 0x18000;
  782. // 00169C5A
  783. pfpoint3_sp34[7].y_4 = 0x20000;
  784. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  785. pfpoint3_sp34[8].x_0 = 0x18000;
  786. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  787. // 00169C60
  788. pfpoint3_sp34[0].x_0 = 0x10000;
  789. pfpoint3_sp34[0].y_4 = 0;
  790. pfpoint3_sp34[0].z_8 = 0x3333;
  791. pfpoint3_sp34[1].x_0 = 0x18000;
  792. // 00169C68
  793. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  794. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  795. pfpoint3_sp34[15].y_4 = 0;
  796. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  797. // 00169C6C
  798. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  799. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  800. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  801. pfpoint3_sp34[14].y_4 = 0x20000;
  802. // 00169C74
  803. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  804. pfpoint3_sp34[12].y_4 = 0x72AAA;
  805. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  806. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  807. // 00169C7C
  808. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  809. pfpoint3_sp34[11].x_0 = 0x10000;
  810. pfpoint3_sp34[11].y_4 = 0x72AAA;
  811. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  812. // sp48=FREE_tInfo
  813. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  814. // 00169C90
  815. // loc_16A21E
  816. LOGE("PhysicsTest_case");
  817. for (int r2_i = 0;
  818. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  819. r2_i++) {
  820. // loc_169CC0
  821. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  822. .m_iType_C) {
  823. case 0: // loc_169EC0
  824. {
  825. // check 手机左移
  826. // sp4c = r2
  827. // check 运算
  828. LOGE("PhysicsTest_case_0");
  829. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  830. .m_iRot_10 *
  831. 0x40000 / 0xB4;
  832. uint64 r3r1_ull = 0x3243F4000;
  833. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  834. int r4_i = r1r0_ll / 2;
  835. int i_sp1b0;
  836. int i_sp214 = r4_i;
  837. sub_16A57C(i_sp1b0, i_sp214);
  838. sub_16A6CC(i_sp214, r4_i);
  839. fpoint3<PointType_18> fpoint3_spc0;
  840. fpointQ<PointType_18> fpointQ_spb0;
  841. // check 乘法
  842. fpoint3_spc0.x_0 =
  843. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  844. .m_tPoint3D_0.point_0.dx_0 *
  845. 8;
  846. fpoint3_spc0.y_4 =
  847. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  848. .m_tPoint3D_0.dz_8 *
  849. 8;
  850. fpoint3_spc0.z_8 =
  851. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  852. .m_tPoint3D_0.point_0.dy_4 *
  853. 8;
  854. fpointQ_spb0.field_0 = 0;
  855. fpointQ_spb0.field_4 = i_sp1b0;
  856. fpointQ_spb0.field_8 = 0;
  857. fpointQ_spb0.field_C = i_sp214;
  858. CFTTPObject *r4_pobject = new CFTTPObject(
  859. EPhysicsObjectType_2,
  860. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  861. .m_iType_C,
  862. 2, fpoint3_spc0, fpointQ_spb0);
  863. // 00169F5C
  864. r4_pobject->field_34 = 0;
  865. r4_pobject->field_38 = 0;
  866. r4_pobject->field_3C = 0x40000;
  867. r4_pobject->field_40 = 0x4000; // dword_16A448
  868. r4_pobject->field_44 = 0x20000;
  869. fpoint<PointType_18> fpoint_spac;
  870. fpoint<PointType_18> fpoint_spa8;
  871. fpoint<PointType_18> fpoint_spa4;
  872. fpoint3<PointType_18> fpoint3_sp98;
  873. fpointQ<PointType_18> fpointQ_sp80;
  874. fpoint3_sp98.x_0 = 0;
  875. fpoint_spac.var_0 = 0x3333;
  876. fpoint_spa8.var_0 = 0x6666;
  877. fpoint_spa4.var_0 = 0x15555;
  878. fpointQ_sp80.field_0 = 0;
  879. fpointQ_sp80.field_4 = 0;
  880. fpointQ_sp80.field_8 = 0;
  881. fpointQ_sp80.field_C = 0x40000;
  882. fpoint3_sp98.y_4 = 0xEAAA;
  883. fpoint3_sp98.z_8 = 0;
  884. // fpointQ_sp80
  885. CFTTPPCone *r5_pcone =
  886. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  887. fpoint3_sp98, fpointQ_sp80);
  888. fpoint3<PointType_18> fpoint3_sp74;
  889. fpoint3<PointType_18> fpoint3_sp68;
  890. fpointQ<PointType_18> fpointQ_sp50;
  891. fpoint3_sp74.x_0 = 0xCCCC;
  892. fpointQ_sp50.field_0 = 0;
  893. fpointQ_sp50.field_4 = 0;
  894. fpointQ_sp50.field_8 = 0;
  895. fpointQ_sp50.field_C = 0x40000;
  896. fpoint3_sp74.y_4 = 0x4000;
  897. fpoint3_sp74.z_8 = 0xCCCC;
  898. fpoint3_sp68.x_0 = 0;
  899. fpoint3_sp68.y_4 = 0x2000;
  900. fpoint3_sp68.z_8 = 0;
  901. CFTTPPBox *r0_pbox =
  902. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  903. r5_pcone->field_64 = 0x15555;
  904. r0_pbox->field_64 = 0xCCCC;
  905. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  906. r0_pbox->filed_4 = r4_pobject;
  907. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  908. r5_pcone->filed_4 = r4_pobject;
  909. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  910. r4_pobject;
  911. break;
  912. }
  913. case 2: // loc_16A030
  914. {
  915. LOGE("PhysicsTest_case_2");
  916. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  917. .m_iRot_10 *
  918. 0x40000 / 0xB4;
  919. uint64 r3r1_ull = 0x3243F4000;
  920. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  921. int r4_i = r1r0_ll / 2;
  922. int i_sp214;
  923. int i_sp1b0 = r4_i;
  924. sub_16A57C(i_sp214, i_sp1b0);
  925. int i_sp210;
  926. i_sp1b0 = r4_i;
  927. sub_16A6CC(i_sp210, i_sp1b0);
  928. // sp40=i_sp210
  929. // sp3c=sp214
  930. fpoint3<PointType_18> fpoint3_sp154;
  931. fpoint3<PointType_18> fpoint3_sp148;
  932. fpointQ<PointType_18> fpointQ_sp138;
  933. fpointQ<PointType_18> fpointQ_sp1b0;
  934. fpoint3_sp154.x_0 = 0x70000;
  935. fpoint3_sp154.y_4 = 0x20000;
  936. fpoint3_sp154.z_8 = 0x6666;
  937. fpointQ_sp1b0.field_0 = 0x3333;
  938. fpointQ_sp1b0.field_4 = 0;
  939. fpointQ_sp1b0.field_8 = 0;
  940. fpointQ_sp1b0.field_C = 0x40000;
  941. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  942. CFTTPPBox *pbox_sp38 =
  943. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  944. // 0016A0DC
  945. pbox_sp38->field_64 = 0x70000;
  946. fpoint3<PointType_18> fpoint3_sp12c;
  947. fpoint3<PointType_18> fpoint3_sp120;
  948. fpointQ<PointType_18> fpointQ_sp110;
  949. fpoint3_sp120.x_0 = 0xFFFD0000;
  950. fpoint3_sp12c.x_0 = 0x6666;
  951. fpoint3_sp12c.y_4 = 0x20000;
  952. fpoint3_sp12c.z_8 = 0x15555;
  953. fpoint3_sp120.y_4 = 0x10000;
  954. fpoint3_sp120.z_8 = 0xAAAA;
  955. fpointQ_sp1b0.field_0 = 0x3333;
  956. fpointQ_sp1b0.field_4 = 0;
  957. fpointQ_sp1b0.field_8 = 0;
  958. fpointQ_sp1b0.field_C = 0x40000;
  959. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  960. // 0016A120
  961. CFTTPPBox *r4_pbox =
  962. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  963. // 0016A122
  964. fpoint3<PointType_18> fpoint3_sp104;
  965. fpoint3<PointType_18> fpoint3_spf8;
  966. fpointQ<PointType_18> fpointQ_spe8;
  967. fpoint3_sp104.x_0 = 0x6666;
  968. fpoint3_sp104.y_4 = 0x20000;
  969. fpoint3_sp104.z_8 = 0x15555;
  970. fpoint3_spf8.x_0 = 0x30000;
  971. fpoint3_spf8.y_4 = 0x10000;
  972. fpoint3_spf8.z_8 = 0xAAAA;
  973. fpointQ_sp1b0.field_0 = 0x3333;
  974. fpointQ_sp1b0.field_4 = 0;
  975. fpointQ_sp1b0.field_8 = 0;
  976. fpointQ_sp1b0.field_C = 0x40000;
  977. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  978. // 0016A164
  979. CFTTPPBox *r6_pbox =
  980. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  981. // 0016A166
  982. r4_pbox->field_64 = 0x15555;
  983. r6_pbox->field_64 = 0x15555;
  984. fpoint3<PointType_18> fpoint3_spdc;
  985. fpointQ<PointType_18> fpointQ_spcc;
  986. fpointQ_spcc.field_4 = i_sp214;
  987. fpointQ_spcc.field_C = i_sp210;
  988. fpoint3_spdc.x_0 =
  989. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  990. .m_tPoint3D_0.point_0.dx_0 *
  991. 8;
  992. fpoint3_spdc.z_8 =
  993. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  994. .m_tPoint3D_0.point_0.dy_4 *
  995. 8;
  996. fpoint3_spdc.y_4 =
  997. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  998. .m_tPoint3D_0.dz_8 *
  999. 8;
  1000. fpointQ_spcc.field_0 = 0;
  1001. fpointQ_spcc.field_8 = 0;
  1002. CFTTPObject *r0_pobject = new CFTTPObject(
  1003. EPhysicsObjectType_2,
  1004. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1005. .m_iType_C,
  1006. 3, fpoint3_spdc, fpointQ_spcc);
  1007. // 0016A1B0
  1008. r0_pobject->field_34 = 0;
  1009. r0_pobject->field_38 = 0;
  1010. r0_pobject->field_3C = 0x70000;
  1011. r0_pobject->field_40 = 0x30000;
  1012. r0_pobject->field_44 = 0x4000;
  1013. r0_pobject->field_A0 = 0x18;
  1014. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  1015. pbox_sp38->filed_4 = r0_pobject;
  1016. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  1017. r4_pbox->filed_4 = r0_pobject;
  1018. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  1019. r6_pbox->filed_4 = r0_pobject;
  1020. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1021. r0_pobject;
  1022. break;
  1023. }
  1024. case 1: // 00169CDA
  1025. {
  1026. // sp4c = r2
  1027. // check 运算
  1028. LOGE("PhysicsTest_case_1");
  1029. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1030. .m_iRot_10 *
  1031. 0x40000 / 0xB4;
  1032. uint64 r3r1_ull = 0x3243F4000;
  1033. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  1034. int r4_i = r1r0_ll / 2;
  1035. int i_sp214;
  1036. int i_sp210;
  1037. sub_16A57C(i_sp214, r4_i);
  1038. sub_16A6CC(i_sp210, r4_i);
  1039. fpoint3<PointType_18> fpoint3_sp204;
  1040. fpointQ<PointType_18> fpointQ_sp1f4;
  1041. fpointQ_sp1f4.field_0 = 0;
  1042. fpointQ_sp1f4.field_4 = i_sp214;
  1043. fpointQ_sp1f4.field_8 = 0;
  1044. fpointQ_sp1f4.field_C = i_sp210;
  1045. TPoint3D point3D =
  1046. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1047. .m_tPoint3D_0;
  1048. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  1049. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  1050. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  1051. CFTTPObject *r11_pobject = new CFTTPObject(
  1052. EPhysicsObjectType_2,
  1053. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  1054. .m_iType_C,
  1055. 3, fpoint3_sp204, fpointQ_sp1f4);
  1056. int i_sp1b0;
  1057. int i_sp1f0 = 0x7F1AA;
  1058. sub_16A818(&i_sp1b0, &i_sp1f0);
  1059. r11_pobject->field_34 = 0;
  1060. r11_pobject->field_38 = 0;
  1061. r11_pobject->field_3C = i_sp1b0;
  1062. r11_pobject->field_40 = 0x10000;
  1063. r11_pobject->field_44 = 0x10000;
  1064. r11_pobject->field_A0 = 0x18;
  1065. fpoint<PointType_18> fpoint_sp1ec;
  1066. fpoint<PointType_18> fpoint_sp1e8;
  1067. fpoint3<PointType_18> fpoint3_sp1dc;
  1068. fpointQ<PointType_18> fpointQ_sp1cc;
  1069. fpoint_sp1ec.var_0 = 0x10000;
  1070. fpoint3_sp1dc.x_0 = 0;
  1071. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  1072. fpoint3_sp1dc.z_8 = 0;
  1073. fpoint_sp1e8.var_0 = 0x6666;
  1074. fpointQ<PointType_18> fpointQ_sp1b0;
  1075. fpointQ_sp1b0.field_0 = 0x40000;
  1076. fpointQ_sp1b0.field_4 = 0;
  1077. fpointQ_sp1b0.field_8 = 0;
  1078. fpointQ_sp1b0.field_C = 0x40000;
  1079. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  1080. // check 前俩个参数传递是否使用栈
  1081. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  1082. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  1083. fpoint3<PointType_18> fpoint3_sp1a4;
  1084. fpoint3<PointType_18> fpoint3_sp198;
  1085. fpointQ<PointType_18> fpointQ_sp180;
  1086. fpoint3_sp1a4.z_8 = 0x6666;
  1087. // 00169DF4
  1088. fpointQ_sp180.field_0 = 0;
  1089. fpointQ_sp180.field_4 = 0;
  1090. fpointQ_sp180.field_8 = 0;
  1091. fpointQ_sp180.field_C = 0x40000;
  1092. fpoint3_sp1a4.x_0 = 0x20000;
  1093. fpoint3_sp1a4.y_4 = 0x20000;
  1094. fpoint3_sp198.x_0 = 0;
  1095. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  1096. fpoint3_sp198.z_8 = 0;
  1097. CFTTPPBox *r5_pbox =
  1098. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  1099. // 00169E14
  1100. fpoint3<PointType_18> fpoint3_sp174;
  1101. fpointQ<PointType_18> fpointQ_sp160;
  1102. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  1103. fpoint3_sp174.x_0 = 0;
  1104. fpoint3_sp174.z_8 = 0;
  1105. fpointQ_sp160.field_0 = 0;
  1106. fpointQ_sp160.field_4 = 0;
  1107. fpointQ_sp160.field_8 = 0;
  1108. fpointQ_sp160.field_C = 0x40000;
  1109. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  1110. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  1111. // 00169E32
  1112. r4_pcylinder->field_64 = 0x10000;
  1113. r5_pbox->field_64 = 0x20000;
  1114. r0_ppolyhedron->field_64 = 0xABFFF;
  1115. // 00169E42
  1116. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  1117. r5_pbox->filed_4 = r11_pobject;
  1118. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  1119. r0_ppolyhedron->filed_4 = r11_pobject;
  1120. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  1121. r4_pcylinder->filed_4 = r11_pobject;
  1122. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  1123. r11_pobject;
  1124. break;
  1125. }
  1126. }
  1127. }
  1128. }
  1129. // loc_16A232
  1130. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  1131. if (physics_sp218.Process()) {
  1132. // 0016A24E
  1133. // sp18=cBall
  1134. LOGE("PhysicsTest_1");
  1135. cBall.ballPosPrev_4.point_0.dx_0 =
  1136. r6_pobject->fpoint3_0.x_0 /
  1137. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  1138. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  1139. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  1140. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  1141. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  1142. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  1143. fpointQ<PointType_18> fpointQ_sp1b0;
  1144. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  1145. // check 除法
  1146. // 0016A2AA
  1147. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  1148. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  1149. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  1150. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  1151. // check
  1152. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  1153. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  1154. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  1155. // loc_16A344
  1156. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  1157. // loc_16A30C
  1158. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  1159. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  1160. if (FREE_tInfo.filed_0.ugamestatus_1828 <= 8) {
  1161. // check
  1162. if ((1 << FREE_tInfo.filed_0.ugamestatus_1828) & 0x190) {
  1163. LOGE("PhysicsTest_2");
  1164. tGame.field_6C98 = 0;
  1165. tGame.mTLogic_6678.freeproptype_74 =
  1166. physics_sp218.ppobject_0[r5_i]->field_90;
  1167. }
  1168. }
  1169. }
  1170. }
  1171. }
  1172. }
  1173. // loc_16A348
  1174. delete[] pfpoint3_sp34;
  1175. }
  1176. //-------------------------------------------------------------------------------------------------