FREE.cpp 119 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269
  1. #include "FREE.h"
  2. #include "CBall.h"
  3. #include "CBallProj.h"
  4. #include "CFTTPObject.h"
  5. #include "CFTTPPBox.h"
  6. #include "CFTTPPCone.h"
  7. #include "CFTTPPCylinder.h"
  8. #include "CFTTPPPolyhedron.h"
  9. #include "CFTTPPSphere.h"
  10. #include "CFTTPhysics.h"
  11. #include "CFreeHUD.h"
  12. #include "CGameLoop.h"
  13. #include "CModelManager.h"
  14. #include "COMM.h"
  15. #include "CPlayerManager.h"
  16. #include "CStoryCore.h"
  17. #include "CStoryHUD.h"
  18. #include "GFXCAMERA.h"
  19. #include "GFXNET.h"
  20. #include "GL.h"
  21. #include "GM.h"
  22. #include "GU.h"
  23. #include "LOCstring.h"
  24. #include "SNDGAME.h"
  25. #include "XCTRL.h"
  26. #include "XML.h"
  27. #include "XSYS.h"
  28. #include "fpoint.h"
  29. #include "memctrl.h"
  30. #include "sub.h"
  31. int s_iEVFStrings[160] = {
  32. 0x184B, 0x184C, 0x1858, 0, 0, 0, 0, 0, 0, 0,
  33. 0x1859, 0x185A, 0, 0, 0, 0, 0, 0, 0, 0,
  34. 0x1854, 0x1855, 0x1856, 0, 0, 0, 0, 0, 0, 0,
  35. 0x184F, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  36. 0x1850, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  37. 0x184E, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  38. 0x186B, 0x186C, 0, 0, 0, 0, 0, 0, 0, 0,
  39. 0x184D, 0x1851, 0x1852, 0x1853, 0x1857, 0x186A, 0, 0, 0, 0,
  40. 0x185B, 0x185C, 0x185D, 0x185E, 0x1864, 0x1869, 0, 0, 0, 0,
  41. 0x1860, 0x1861, 0x1862, 0x1865, 0x1866, 0, 0, 0, 0, 0,
  42. 0x1863, 0x1868, 0x1867, 0x185F, 0, 0, 0, 0, 0, 0,
  43. 0x1867, 0x1861, 0x1859, 0x185A, 0, 0, 0, 0, 0, 0,
  44. 0xFB, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  45. 0x1878, 0x1879, 0, 0, 0, 0, 0, 0, 0, 0,
  46. 0x1876, 0x1877, 0, 0, 0, 0, 0, 0, 0, 0,
  47. 0x186D, 0x186E, 0x186F, 0x1870, 0x1871, 0x1873, 0x1874, 0x1875, 0x1872, 0};
  48. // FREE_tInfo 0x1D20
  49. // FREE_tGoal 0x7634
  50. int FREE_iTeam;
  51. TFreeGoal FREE_tGoal;
  52. TFreeInfo FREE_tInfo;
  53. CFTTModel *FREE_pStarModel;
  54. int FREE_iPropWeather;
  55. const char *s_sPropModels_SNOW[3] = {
  56. "PKG:/data/env/dressing/cone_snow.ftm",
  57. "PKG:/data/env/dressing/mannequin_snow.ftm",
  58. "PKG:/data/env/dressing/rebounder.ftm"};
  59. CFTTModel *FREE_pPropModel[3];
  60. const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
  61. "PKG:/data/env/dressing/mannequin.ftm",
  62. "PKG:/data/env/dressing/rebounder.ftm"};
  63. const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
  64. "PKG:/data/env/dressing/mannequin_s.ftm",
  65. "PKG:/data/env/dressing/rebounder.ftm"};
  66. CFTTModel *FREE_pPropModelShadow[3];
  67. //-------------------------------------------------------------------------------------------------
  68. // 001D2758
  69. int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
  70. //-------------------------------------------------------------------------------------------------
  71. // 001D27EC
  72. void FREE_GetWorldRot(TPoint, TPoint) {}
  73. //-------------------------------------------------------------------------------------------------
  74. // 001D281C
  75. void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
  76. //-------------------------------------------------------------------------------------------------
  77. // 001D2A98
  78. int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
  79. //-------------------------------------------------------------------------------------------------
  80. // 001D2BC0
  81. void FREE_ResolveEndPoint(TPoint3D *a1, TPoint3D *a2, TPoint *a3, int *a4,
  82. bool a5) {
  83. LOGE("FREE_ResolveEndPoint%p%p%p%p%d", a1, a2, a3, a4, a5);
  84. }
  85. //-------------------------------------------------------------------------------------------------
  86. // 001D30B8
  87. void FREE_GetKickPower(EAnimID a1, int *a2, int *a3) {
  88. LOGE("FREE_GetKickPower%d%p%p", a1, a2, a3);
  89. }
  90. //-------------------------------------------------------------------------------------------------
  91. // 001D30FC
  92. uint64 g_count = 0;
  93. FILE *g_fpsave = fopen("/data/local/tmp/savedata.txt", "r");
  94. void FREE_ProcessControls(bool b_0) {
  95. // 001D3110
  96. g_count++;
  97. if (FREE_iTeam != 0) return;
  98. // 001D311C
  99. TPoint tPoint_var2C = XCTRL_TouchGetPos(0);
  100. if (g_fpsave == NULL) LOGE("/data/local/tmp/savedata.txt open error");
  101. // fprintf(g_fpsave, "%d %d %d\n", g_count, tPoint_var2C.dx_0,
  102. // tPoint_var2C.dy_4);
  103. // fflush(g_fpsave);
  104. char buf[0x100] = {0};
  105. fgets(buf, 0x100, g_fpsave);
  106. LOGE("%s",buf);
  107. sscanf(buf, "%d %d %d", &g_count, &tPoint_var2C.dx_0, &tPoint_var2C.dy_4);
  108. // 001D312C
  109. if (FREE_tInfo.filed_0.b_C) return;
  110. //
  111. if ((FREE_tInfo.filed_0.gamestatus_1828 | 1) != 9) return;
  112. // 001D3150 && 001D3156 && 001D3158
  113. if (CStoryCore::m_tStageManager.m_p_5CF0 &&
  114. CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 != 0 &&
  115. CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 < 3) {
  116. // 无内容
  117. LOGE("FREE_ProcessControls_1");
  118. } else {
  119. LOGE("FREE_ProcessControls_2");
  120. bool bA_R0 = true;
  121. bool bB_R6 = true;
  122. if (CStoryCore::m_tStageManager.m_p_5CF0 &&
  123. CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 == 3 &&
  124. CFreeHUD::ms_pAnimations) { // 001D316C
  125. LOGE("FREE_ProcessControls_3");
  126. bB_R6 = !CFreeHUD::ms_pAnimations->m_b_B;
  127. bA_R0 = !CFreeHUD::ms_pAnimations->m_b_A;
  128. } // 001D3182
  129. // 001D3182 && 001D318E && 001D319A && 001D31A2(001D319E)
  130. if (bA_R0 && FREE_tInfo.field_188C.cBuff_3DC.b_18 == 0 &&
  131. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 0) { // 001D31A6
  132. // 001D31AC || 001D31B4
  133. int count = XCTRL_TouchGetCount();
  134. // fprintf(g_fpsave, "%d\n", count);
  135. // fflush(g_fpsave);
  136. memset(buf, 0, sizeof(buf));
  137. fgets(buf, 0x100, g_fpsave);
  138. LOGE("%s",buf);
  139. sscanf(buf, "%d", &count);
  140. if (count == 2) {
  141. bool isPressed0 = XCTRL_TouchIsPressed(0);
  142. bool isPressed1 = XCTRL_TouchIsPressed(0);
  143. // fprintf(g_fpsave, "%d %d\n", isPressed0, isPressed1);
  144. // fflush(g_fpsave);
  145. memset(buf, 0, sizeof(buf));
  146. fgets(buf, 0x100, g_fpsave);
  147. LOGE("%s",buf);
  148. sscanf(buf, "%d %d", &isPressed0, &isPressed1);
  149. if (isPressed0 || isPressed1) { // 001D31B6
  150. FREE_tInfo.field_188C.field_40C = FREE_tInfo.field_188C.field_408;
  151. } // 001D31C6
  152. TPoint tPoint_var40[2]; // R6 R9
  153. TPoint tPoint_var50[2]; // R4 R8
  154. // 001D3206 001D31D0
  155. for (int i_R5 = 0; i_R5 < 2; i_R5++) { // 001D31D8
  156. // 001D31DC
  157. LOGE("FREE_ProcessControls_6");
  158. TPoint temp = XCTRL_TouchGetDownPos(i_R5);
  159. // fprintf(g_fpsave, "%d %d\n", temp.dx_0, temp.dy_4);
  160. // fflush(g_fpsave);
  161. memset(buf, 0, sizeof(buf));
  162. fgets(buf, 0x100, g_fpsave);
  163. LOGE("%s",buf);
  164. sscanf(buf, "%d %d", &temp.dx_0, &temp.dy_4);
  165. tPoint_var40[i_R5].copy(temp);
  166. // 001D31F0
  167. temp = XCTRL_TouchGetDownPos(i_R5);
  168. // fprintf(g_fpsave, "%d %d\n", temp.dx_0, temp.dy_4);
  169. // fflush(g_fpsave);
  170. memset(buf, 0, sizeof(buf));
  171. fgets(buf, 0x100, g_fpsave);
  172. LOGE("%s",buf);
  173. sscanf(buf, "%d %d", &temp.dx_0, &temp.dy_4);
  174. tPoint_var50[i_R5].copy(temp);
  175. } // 001D320A
  176. // 001D3210 001D321C
  177. int iDis_R0 = XMATH_Distance(&tPoint_var40[0], &tPoint_var40[1]) -
  178. XMATH_Distance(&tPoint_var50[0], &tPoint_var50[1]);
  179. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
  180. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  181. FREE_tInfo.field_188C.field_408 =
  182. FREE_tInfo.field_188C.field_40C + iDis_R0 / 2;
  183. return;
  184. }
  185. } // 001D36A4
  186. // 001D3252 && 001D325C
  187. else if (bB_R6) { // 001D3260
  188. bool isTouch = XCTRL_TouchIsTouching(0);
  189. // fprintf(g_fpsave, "%d\n", isTouch);
  190. // fflush(g_fpsave);
  191. memset(buf, 0, sizeof(buf));
  192. fgets(buf, 0x100, g_fpsave);
  193. LOGE("%s",buf);
  194. sscanf(buf, "%d", &isTouch);
  195. if (isTouch) {
  196. TPoint tPoint_var40;
  197. // 001D326E
  198. GFXCAMERA_GameToScreen(&tPoint_var40, &cBall.ballPosPrev_4);
  199. // 001D3278
  200. TPoint tPoint_var50 = XCTRL_TouchGetDownPos(0);
  201. // 001D3284(001D3280) && 001D3290 && 001D329C
  202. if ((int)XMATH_Distance(&tPoint_var40, &tPoint_var50) >= 0x61 &&
  203. !FREE_tInfo.field_188C.cBuff_3DC.b_19 &&
  204. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 0) { // 001D32A0
  205. if ((abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >= 0x10 &&
  206. abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >
  207. abs(tPoint_var2C.dy_4 - tPoint_var50.dy_4)) ||
  208. FREE_tInfo.field_188C.cBuff_3DC.b_18) {
  209. // 001D32C6 001D32FE
  210. if (FREE_tInfo.field_188C.cBuff_3DC.b_18) { // 001D3300
  211. FREE_tInfo.field_188C.cBuff_3DC.field_1C =
  212. (tPoint_var2C.dx_0 - FREE_tInfo.field_188C.tPoint_400.dx_0) *
  213. 8;
  214. } // 001D3314
  215. // 001D32C6
  216. if (abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >= 0x10 &&
  217. abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >
  218. abs(tPoint_var2C.dy_4 - tPoint_var50.dy_4)) { // 001D32C8
  219. FREE_tInfo.field_188C.cBuff_3DC.field_20 = tGame.maybe_sound_0;
  220. // 001D32E0
  221. FREE_tInfo.field_188C.tPoint_400.copy(tPoint_var2C);
  222. FREE_tInfo.field_188C.tPoint_400.dx_0 =
  223. FREE_tInfo.field_188C.tPoint_400.dx_0 -
  224. FREE_tInfo.field_188C.cBuff_3DC.field_1C / 8;
  225. } // 001D3314
  226. // 001D3314
  227. if (FREE_tInfo.field_188C.cBuff_3DC.field_1C > 0x2000)
  228. FREE_tInfo.field_188C.cBuff_3DC.field_1C =
  229. FREE_tInfo.field_188C.cBuff_3DC.field_1C - 0x4000;
  230. // 001D332C
  231. FREE_tInfo.field_188C.cBuff_3DC.field_1C = XMATH_Clamp(
  232. FREE_tInfo.field_188C.cBuff_3DC.field_1C, 0xFFFFFAAB, 0x555);
  233. FREE_tInfo.field_188C.cBuff_3DC.b_18 = true;
  234. return;
  235. } // 001D36A4
  236. } // 001D3344
  237. }
  238. } // 001D3344
  239. } // 001D3344
  240. bool b_R6 = false;
  241. FREE_tInfo.field_188C.cBuff_3DC.b_18 = false;
  242. FREE_tInfo.field_188C.cBuff_3DC.b_19 = false;
  243. FREE_tInfo.field_188C.cBuff_3DC.field_20 = 0;
  244. // 001D3358
  245. bool bTouchIsReleased_R10 = XCTRL_TouchIsReleased(0);
  246. // fprintf(g_fpsave, "%d\n", bTouchIsReleased_R10);
  247. // fflush(g_fpsave);
  248. memset(buf, 0, sizeof(buf));
  249. fgets(buf, 0x100, g_fpsave);
  250. LOGE("%s",buf);
  251. sscanf(buf, "%d", &bTouchIsReleased_R10);
  252. // 001D335E
  253. if (bTouchIsReleased_R10) { // 001D3364
  254. LOGE("FREE_ProcessControls_8");
  255. TPoint tPoint_var50;
  256. TPoint tPoint_var70;
  257. // 001D336C
  258. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] > 0) b_R6 = true;
  259. // 001D3376
  260. else if (CStoryCore::m_tStageManager.tStoryStage_0.t_0
  261. .PreSelectEnabled_12) { // 001D337C
  262. // 001D3380
  263. LOGE("FREE_ProcessControls_9");
  264. tPoint_var50 = XCTRL_TouchGetDownPos(0);
  265. // fprintf(g_fpsave, "%d %d\n", tPoint_var50.dx_0, tPoint_var50.dy_4);
  266. // fflush(g_fpsave);
  267. memset(buf, 0, sizeof(buf));
  268. fgets(buf, 0x100, g_fpsave);
  269. LOGE("%s",buf);
  270. sscanf(buf, "%d %d", &tPoint_var50.dx_0, &tPoint_var50.dy_4);
  271. // 001D3390
  272. tPoint_var70 = XCTRL_TouchGetPos(0);
  273. // fprintf(g_fpsave, "%d %d\n", tPoint_var70.dx_0, tPoint_var70.dy_4);
  274. // fflush(g_fpsave);
  275. memset(buf, 0, sizeof(buf));
  276. fgets(buf, 0x100, g_fpsave);
  277. LOGE("%s",buf);
  278. sscanf(buf, "%d %d", &tPoint_var70.dx_0, &tPoint_var70.dy_4);
  279. // 001D33A4 001D33A0
  280. if ((int)XMATH_Distance(&tPoint_var50, &tPoint_var70) <=
  281. 0x0F) { // 001D33AA
  282. int iDis_var88 = 0x7FFFFFFF;
  283. int iIndex_var84 = -1;
  284. // 001D34D0 001D33AC
  285. for (int i_R8 = 0; i_R8 < 11; i_R8++) { // 001D33CA
  286. // 001D33CE && 001D33E0
  287. if (i_R8 != FREE_tInfo.filed_0.field_1830 &&
  288. !FREE_tInfo.filed_0.pFREE_tGoal_1818
  289. ->m_tTeamPlayerInfo_1C[FREE_iTeam][i_R8]
  290. .m_bStatic_28) { // 001D33E4
  291. TPoint3D tPoint3D_var40 =
  292. tGame.allplay_14[FREE_iTeam].teamlist_0[i_R8]->ballPosPrev_4;
  293. TPoint tPoint_var80;
  294. // 001D3408
  295. GFXCAMERA_GameToScreen(&tPoint_var80, &tPoint3D_var40);
  296. tPoint3D_var40.dz_8 += 0x10000;
  297. TPoint tPoint_var58;
  298. // 001D3418
  299. GFXCAMERA_GameToScreen(&tPoint_var58, &tPoint3D_var40);
  300. TPoint tPoint_var60;
  301. tPoint_var60.dx_0 = (tPoint_var80.dx_0 + tPoint_var58.dx_0) / 2;
  302. tPoint_var60.dy_4 = (tPoint_var80.dy_4 + tPoint_var58.dy_4) / 2;
  303. int iDis_R3 = 0x18;
  304. // 001D3440
  305. if ((tPoint_var80.dy_4 - tPoint_var58.dy_4) / 2 > 0x18)
  306. iDis_R3 = (tPoint_var80.dy_4 - tPoint_var58.dy_4) / 2;
  307. uint iDis_R7 = 0x18;
  308. // 001D3440
  309. if (iDis_R3 / 2 > 0x18) iDis_R7 = iDis_R3 / 2;
  310. // 001D345C && 001D3472 && 001D3478
  311. if (tPoint_var70.dx_0 >= tPoint_var60.dx_0 - iDis_R7 &&
  312. tPoint_var70.dx_0 < tPoint_var58.dx_0 + iDis_R7 &&
  313. tPoint_var70.dy_4 >= tPoint_var60.dy_4 - iDis_R3 &&
  314. tPoint_var70.dy_4 < tPoint_var60.dy_4 + iDis_R3) { // 001D347C
  315. // 001D3480
  316. int iDis_R0 = XMATH_Distance(&tPoint_var60, &tPoint_var70);
  317. // 001D3488
  318. if (iDis_var88 > iDis_R0) { // 001D348E
  319. iIndex_var84 = i_R8;
  320. iDis_var88 = iDis_R0;
  321. } // 001D3494
  322. } // 001D34C4
  323. } // 001D34C8
  324. } // 001D34D8
  325. // 001D34DC
  326. if (iIndex_var84 >= 0) { // 001D34E2
  327. // 001D34E8 && 001D34EE
  328. if (CStoryCore::m_tStageManager.m_p_5CF0 &&
  329. CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 ==
  330. 5) { // 001D34F2
  331. // 001D3500
  332. if (iIndex_var84 == FREE_tInfo.filed_0.pFREE_tGoal_1818
  333. ->m_iUserPlayer_7458) { // 001D3504
  334. FREE_tInfo.filed_0.gamestatus_1828 = 8;
  335. FREE_tInfo.filed_0.field_1844 = iIndex_var84;
  336. // 001D3516
  337. CFreeHUD::ShutdownAnimation();
  338. // 001D351C
  339. CFreeHUD::InitTutorial(EStoryTutorial_1);
  340. } // 001D353C
  341. } // 001D353C
  342. else { // 001D3522
  343. // 001D352A
  344. if (FREE_tInfo.filed_0.field_1844 == iIndex_var84)
  345. FREE_tInfo.filed_0.field_1844 = -1;
  346. else
  347. FREE_tInfo.filed_0.field_1844 = iIndex_var84;
  348. } // 001D353C
  349. } // 001D353C
  350. } // 001D353C
  351. b_R6 = false;
  352. } // 001D353E
  353. else
  354. b_R6 = false;
  355. } // 001D353E
  356. // 001D353E
  357. if (b_0) {
  358. LOGE("FREE_ProcessControls_10");
  359. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  360. return;
  361. }
  362. // bool b_R4 = true;
  363. { // 001D3544
  364. // 001D3544
  365. if (!bTouchIsReleased_R10) { // 001D354A
  366. // 001D3550 && 001D355A
  367. bool isPressed = XCTRL_TouchIsPressed(0);
  368. // fprintf(g_fpsave, "%d\n", isPressed);
  369. // fflush(g_fpsave);
  370. memset(buf, 0, sizeof(buf));
  371. fgets(buf, 0x100, g_fpsave);
  372. LOGE("%s",buf);
  373. sscanf(buf, "%d", &isPressed);
  374. if (isPressed && FREE_tInfo.filed_0.gamestatus_1828 == 8) { // 001D355E
  375. TPoint tPoint_var40;
  376. // 001D356A
  377. GFXCAMERA_GameToScreen(&tPoint_var40, &cBall.ballPosPrev_4);
  378. // 001D3574
  379. if ((int)XMATH_Distance(&tPoint_var2C, &tPoint_var40) <=
  380. 0x5F) { // 001D357C
  381. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = tGame.maybe_sound_0;
  382. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 1;
  383. FREE_tInfo.field_188C.PointArr_1C[0].copy(tPoint_var2C);
  384. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] = 0;
  385. // 001D35BC
  386. CGFXFX::SwipeReset();
  387. // 001D35C4
  388. CGFXFX::SwipeAddPoint(tPoint_var2C);
  389. } // 001D362C
  390. } // 001D362C
  391. else { // 001D35CA
  392. // b_R4 = false;
  393. // 001D35D2 && 001D35DC && 001D35E8
  394. bool isTouch = XCTRL_TouchIsTouching(0);
  395. // fprintf(g_fpsave, "%d\n", isTouch);
  396. // fflush(g_fpsave);
  397. memset(buf, 0, sizeof(buf));
  398. fgets(buf, 0x100, g_fpsave);
  399. LOGE("%s",buf);
  400. sscanf(buf, "%d", &isTouch);
  401. if (isTouch && FREE_tInfo.field_188C.field_4.field_2 == 0 &&
  402. (uint)(FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1) <=
  403. 0x58) { // 001D35EC
  404. // 001D35EC && 001D3600
  405. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 1 &&
  406. (int)XMATH_Distance(&tPoint_var2C,
  407. &FREE_tInfo.field_188C.PointArr_1C[0]) <
  408. 0x20) { // 001D3606
  409. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = tGame.maybe_sound_0;
  410. } // 001D362C
  411. else { // 001D3804
  412. // 001D3804 && 001D3818
  413. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >= 6 &&
  414. (int)XMATH_Distance(
  415. &tPoint_var2C,
  416. &FREE_tInfo.field_188C.PointArr_1C
  417. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 6]) <
  418. 4) { // 001D381C
  419. b_R6 = true;
  420. } // 001D362C
  421. else { // 001D3820
  422. TPoint3D tPoint3D_var40;
  423. // 001D382C
  424. GFXCAMERA_ScreenToGame(&tPoint3D_var40, &tPoint_var2C, 0x10000);
  425. // 001D3838 && 001D3846
  426. if (abs(tPoint3D_var40.point_0.dx_0) > 0x178000 ||
  427. abs(tPoint3D_var40.point_0.dy_4) > 0x208000) { // 001D384C
  428. int iX_R7 =
  429. FREE_tInfo.field_188C
  430. .PointArr_1C
  431. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 2]
  432. .dx_0;
  433. int iY_R5 =
  434. FREE_tInfo.field_188C
  435. .PointArr_1C
  436. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 2]
  437. .dx_0;
  438. // 001D3870 001D385E
  439. for (int i_R4 = 0; i_R4 <= 9; i_R4++) { // 001D3874
  440. TPoint tPoint_var50;
  441. tPoint_var50.dx_0 = (tPoint_var2C.dx_0 + iX_R7) / 2;
  442. tPoint_var50.dy_4 = (tPoint_var2C.dy_4 + iY_R5) / 2;
  443. // 001D3896
  444. GFXCAMERA_ScreenToGame(&tPoint3D_var40, &tPoint_var50,
  445. 0x10000);
  446. // 001D38A2 || 001D38B0
  447. if (abs(tPoint3D_var40.point_0.dx_0) > 0x178000 ||
  448. abs(tPoint3D_var40.point_0.dy_4) >
  449. 0x208000) { // 001D38B6
  450. tPoint_var2C = tPoint_var50;
  451. continue;
  452. } // 001D3870
  453. iX_R7 = tPoint_var50.dx_0;
  454. iY_R5 = tPoint_var50.dy_4;
  455. // 001D38C2 || 001D38C8
  456. if (abs(tPoint3D_var40.point_0.dx_0) < 0x168000 &&
  457. abs(tPoint3D_var40.point_0.dy_4) <
  458. 0x1F8000) { // 001D386E
  459. continue;
  460. } // 001D38D4
  461. tPoint_var2C.dx_0 = iX_R7;
  462. tPoint_var2C.dy_4 = iY_R5;
  463. break;
  464. } // 001D38D4
  465. b_R6 = true;
  466. } // 001D38D6
  467. // 001D38EA
  468. FREE_tInfo.field_188C
  469. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]]
  470. .copy(tPoint_var2C);
  471. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]++;
  472. // 001D3920
  473. CGFXFX::SwipeAddPoint(tPoint_var2C);
  474. // 001D3928
  475. CGFXFX::SwipeSetCol(0xFFFFFFFF);
  476. // 001D3930
  477. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >=
  478. 5) { // 001D3936
  479. TPoint tPoint_var50 =
  480. FREE_tInfo.field_188C.PointArr_1C
  481. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 5];
  482. TPoint tPoint_var70 =
  483. FREE_tInfo.field_188C.PointArr_1C
  484. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 3];
  485. TPoint tPoint_var80 =
  486. FREE_tInfo.field_188C.PointArr_1C
  487. [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1];
  488. int iDisX_R5 = abs(tPoint_var50.dy_4 - tPoint_var70.dx_0);
  489. int iDisY_R7 = abs(tPoint_var50.dy_4 - tPoint_var70.dy_4);
  490. int iDisX_R1 = abs(tPoint_var70.dx_0 - tPoint_var80.dx_0);
  491. int iDisY_R0 = abs(tPoint_var70.dy_4 - tPoint_var80.dy_4);
  492. // 001D397A && 001D3992
  493. if (iDisX_R5 + iDisY_R7 >= 4 &&
  494. iDisX_R1 + iDisY_R0 >= 4) { // 001D3998
  495. // 001D399E
  496. int iRot_R5 = GU_GetRot(&tPoint_var50, &tPoint_var70);
  497. // 001D399E
  498. int iRot_R0 = GU_GetRot(&tPoint_var70, &tPoint_var80);
  499. int iValue_R7 = (iRot_R5 + 0x2000 - iRot_R0) & 0x3FFF;
  500. // 001D39C4
  501. if (iValue_R7 >= 0x2000)
  502. iValue_R7 = iValue_R7 - 0x2000;
  503. else
  504. iValue_R7 = 0x2000 - iValue_R7;
  505. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] += iValue_R7;
  506. // 001D39D4
  507. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] >
  508. 0x6000) { // 001D39DC
  509. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
  510. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  511. } // 001D362C
  512. } // 001D362C
  513. } // 001D362C
  514. } // 001D362C
  515. } // 001D362C
  516. } // 001D362C
  517. else { // 001D3618
  518. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
  519. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  520. } // 001D362C
  521. } // 001D362C
  522. } // 001D362C
  523. // 001D362C && 001D3636
  524. if (b_R6 && CFreeHUD::ms_pAnimations) { // 001D3638
  525. // 001D3640
  526. if (!CFreeHUD::ms_pAnimations->CheckKickLength(tPoint_var2C)) {
  527. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  528. return;
  529. }
  530. } // 001D3642
  531. // 001D3642 && 001D364C && 001D3656
  532. if (b_R6 && (uint)FREE_tInfo.filed_0.gamestatus_1828 <= 8 &&
  533. ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) != 0) { // 001D365C
  534. // 001D3686
  535. while (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >= 2) { // 001D366A
  536. // 001D367C 001D3674
  537. if ((int)XMATH_Distance(
  538. &FREE_tInfo.field_188C
  539. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] -
  540. 2],
  541. &FREE_tInfo.field_188C
  542. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] -
  543. 1]) > 1)
  544. break;
  545. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]--;
  546. } // 001D368A
  547. // 001D3692 || 001D3696
  548. if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] < 1 ||
  549. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] < 1) {
  550. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  551. return;
  552. }
  553. // 001D36B4
  554. int iDis_R5 =
  555. XMATH_Distance(&tPoint_var2C, &FREE_tInfo.field_188C.PointArr_1C[0]);
  556. // 001D36D8 001D36CA 001D36C6
  557. FREE_tInfo.field_1C9C.field_1C9C =
  558. (iDis_R5 / FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] > 0x3B) ||
  559. (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] < 7);
  560. // 001D36E8
  561. if (iDis_R5 < 20) {
  562. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  563. return;
  564. }
  565. TPoint3D tPoint3D_var40 = cBall.ballPosPrev_4;
  566. TPoint3D tPoint3D_var50;
  567. TPoint3D tPoint3D_var70;
  568. // 001D372E
  569. FREE_ResolveEndPoint(
  570. &tPoint3D_var40, &tPoint3D_var50,
  571. &FREE_tInfo.field_188C
  572. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1],
  573. &FREE_tInfo.filed_0.field_1840,
  574. FREE_tInfo.field_188C.m_pPlayer_0->tStr32_44.field_8 - 7);
  575. // 001D3736
  576. int iRot_var84 = GU_GetRot(tPoint3D_var40, tPoint3D_var50);
  577. // 001D3742
  578. int iRot_var8C = FREE_tInfo.field_188C.m_pPlayer_0->GetAnimData()->s_64 +
  579. FREE_tInfo.field_188C.m_pPlayer_0->u_0.s_2_0.s_2;
  580. int iValue_R2 = (iRot_var84 + 0x2000 - iRot_var8C) & 0x3FFF;
  581. int iValue_R0 = iValue_R2 - 0x2000;
  582. // 001D375E
  583. if (iValue_R2 >= 0x2000)
  584. iValue_R2 = iValue_R2 - 0x2000;
  585. else
  586. iValue_R2 = 0x2000 - iValue_R2;
  587. // 001D376A
  588. if (iValue_R2 > 0x638) { // 001D37D6
  589. // 001D37DC
  590. while (tPoint3D_var50.dz_8 >= 0x1000) { // 001D378E
  591. // 001D3788
  592. if (abs(iValue_R0) <= 0x638) break;
  593. tPoint3D_var50.dz_8 -= 0x1000;
  594. // 001D37A2
  595. GFXCAMERA_ScreenToGame(
  596. &tPoint3D_var50,
  597. &FREE_tInfo.field_188C
  598. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1],
  599. tPoint3D_var50.dz_8);
  600. // 001D37AA
  601. iRot_var84 = GU_GetRot(tPoint3D_var40, tPoint3D_var50);
  602. // 001D37BA
  603. int iRot_R1 = FREE_tInfo.field_188C.m_pPlayer_0->GetAnimData()->s_64 +
  604. FREE_tInfo.field_188C.m_pPlayer_0->u_0.s_2_0.s_2;
  605. iValue_R0 = (iRot_var84 + 0x2000 - iRot_R1) & 0x3FFF;
  606. iValue_R0 = iValue_R0 - 0x2000;
  607. } // 001D37E2
  608. // 001D37EE
  609. if (abs(iValue_R0) >= 0x694) { // 001D37F4
  610. FREE_tInfo.filed_0.uc_4 = 0x2D;
  611. return;
  612. } // 001D36A4
  613. // 001D39E6
  614. if (abs(iValue_R0) > 0x638) { // 001D39EC
  615. int iIndex_R4 = iValue_R0 >= 0 ? 1 : -1;
  616. iRot_var84 = 0x638 * iIndex_R4 + iRot_var8C;
  617. // 001D39F6
  618. int iDis_R0 =
  619. XMATH_Distance(&tPoint3D_var40.point_0, &tPoint3D_var50.point_0);
  620. // 001D3A10
  621. tPoint3D_var70 =
  622. XMATH_PointProject(tPoint3D_var40, iRot_var84, iDis_R0);
  623. tPoint3D_var50.point_0 = tPoint3D_var70.point_0;
  624. } // 001D3A1E
  625. } // 001D3A1E
  626. // 001D3A34
  627. FREE_ClipPathBounds(&tPoint3D_var40, &tPoint3D_var50, 0xFFE20000,
  628. 0x1E0000, 0xFFE20000 + 0x90000, 0x1E0000 - 0x90000);
  629. FREE_tInfo.filed_0.point3D_1848 = tPoint3D_var50;
  630. CPlayer *pPlayer_R6 = FREE_tInfo.field_188C.m_pPlayer_0;
  631. // 001D3A5A
  632. TAnimData *pAnimData_R4 = pPlayer_R6->GetAnimData();
  633. int iValue_R10 = pAnimData_R4->filed_8;
  634. int iClamp_R5 = 0;
  635. // TPoint3D tPoint3D_var70;
  636. // 001D3A68 && 001D3A72 && 001D3A7A
  637. if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
  638. (pAnimData_R4->u_C.s_C.uc_c & 1) == 0) { // 001D3A7E
  639. // 001D3A96 001D3A80
  640. iClamp_R5 = XMATH_Clamp(pPlayer_R6->GetAnimData()->s_66 * 1000,
  641. 0xFFFFF254, 0xDAC);
  642. // 001D3ACC
  643. GFXCAMERA_ScreenToGame(
  644. &tPoint3D_var70,
  645. &FREE_tInfo.field_188C
  646. .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] / 2 -
  647. 1],
  648. (tPoint3D_var50.dz_8 - cBall.ballPosPrev_4.dz_8) / 2);
  649. // 001D3AD4
  650. int iRot_R0 = GU_GetRot(tPoint3D_var40, tPoint3D_var70);
  651. iRot_R0 = (iRot_var84 + 0x2000 - iRot_R0) & 0x3FFF;
  652. // 001D3AF6
  653. iClamp_R5 = XMATH_Clamp((iRot_R0 - 0x2000) * 0x12, iClamp_R5 - 0xDAC,
  654. iClamp_R5 + 0xDAC);
  655. } // 001D3B00
  656. int iKickPower_var58 = 0;
  657. int iKickPower_var60 = 0;
  658. // 001D3B10
  659. FREE_GetKickPower((EAnimID)pPlayer_R6->tStr32_44.field_10,
  660. &iKickPower_var58, &iKickPower_var60);
  661. // 001D3B26
  662. int iClamp_var8C =
  663. XMATH_InterpolateClamp(iKickPower_var58, 0, 0x640, 0x11BB, 0x547B);
  664. // 001D3B3A
  665. int iClamp_var94 =
  666. XMATH_InterpolateClamp(iKickPower_var60, 0, 0x640, 0x11BB, 0x547B);
  667. int iClamp_R6 = abs(iClamp_R5);
  668. // 001D3B50
  669. int iClampDiv_R9 = iClamp_R6 / 280;
  670. // 001D3B5C
  671. int iDis_R7 =
  672. XMATH_Distance(&cBall.ballPosPrev_4.point_0, &tPoint3D_var50.point_0);
  673. // 001D3B62
  674. if (iDis_R7 < 0x10001) {
  675. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  676. return;
  677. }
  678. // 001D3B6A
  679. if (iDis_R7 > 0x230000) { // 001D3B70
  680. tPoint3D_var70 = tPoint3D_var50 - tPoint3D_var40;
  681. // 001D3B8A
  682. XMATH_Normalize(&tPoint3D_var70, 0x230000);
  683. tPoint3D_var50 = tPoint3D_var50 + tPoint3D_var40;
  684. } // 001D3E62
  685. bool b_R8;
  686. int iClamp_R7 = 0;
  687. int iMoveToSpin_R10;
  688. // 001D3BAC
  689. if (FREE_tInfo.filed_0.field_1840 == -2) { // 001D3BB0
  690. int iClampDiv_var9C = iClampDiv_R9 >= 0 ? iClampDiv_R9 : 0;
  691. // 001D3BCA
  692. XMATH_InterpolateClamp(iDis_R7, 0, 0xF0000, 0x2A3D, 0x547B);
  693. bool b_R2 = false;
  694. // 001D3BD0
  695. if (iDis_R7 < 0x50000) b_R2 = true;
  696. bool b_R3 = false;
  697. // 001D3BD0
  698. if (tPoint3D_var50.dz_8 < 0x4000) b_R3 = true;
  699. b_R8 = b_R2 && b_R3;
  700. // 001D3BE8 && 001D3BE8 && 001D3C04
  701. if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
  702. pAnimData_R4->u_C.s_C.uc_c == 0) { // 001D3C5E
  703. iClamp_R7 = iClamp_R6 / 4 - 1000;
  704. } // 001D3D12
  705. FREE_tInfo.field_1C9C.field_1CA4 =
  706. tPoint3D_var50.dz_8 > 0x17555 ? 1 : 0;
  707. // 001D3D28
  708. iMoveToSpin_R10 = XMATH_Clamp(iDis_R7, iClamp_var8C, iClamp_var94) *
  709. (100 - iClampDiv_var9C) / 100;
  710. // 001D3D6C
  711. int iSpin_R0 = cBall.SetBallMoveToPosSpin(
  712. &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
  713. tPoint3D_var50, -1, iMoveToSpin_R10);
  714. // 0x1D3D70
  715. if (iSpin_R0 >= 0x1FF) iSpin_R0 = 0x1FF;
  716. FREE_tInfo.filed_0.kickTargetTime_1838 = iSpin_R0;
  717. } // 001D3D82
  718. else { // 001D3C18
  719. bool bHideType;
  720. // 001D3C1C || 001D3C24
  721. if (cBall.ballPosPrev_4.dz_8 >= 0x4000 ||
  722. tPoint3D_var50.dz_8 >= 0x4000) { // 001D3C2A
  723. // 001D3C2C
  724. FREE_tInfo.filed_0.kickTargetTime_1838 =
  725. FREE_CalcKickTargetTime(iDis_R7);
  726. bHideType = true;
  727. } // 001D3C38
  728. // 001D3CC6 && 001D3CD2
  729. else if (iDis_R7 >= 0xA0000 && iDis_R7 < 0x140000) { // 001D3CE0
  730. // 001D3CF6
  731. int iPath_R5 = FREE_PassCheckPath(FREE_tInfo.field_188C.m_pPlayer_0,
  732. cBall.ballPosPrev_4.point_0,
  733. tPoint3D_var50.point_0);
  734. // 001D3CFE
  735. FREE_tInfo.filed_0.kickTargetTime_1838 =
  736. FREE_CalcKickTargetTime(iDis_R7);
  737. // 001D3D06
  738. if (iPath_R5 == 0)
  739. bHideType = true;
  740. else
  741. bHideType = false;
  742. } // 001D3C38 or 001D3E84
  743. else { // 001D3E6E
  744. // 001D3E70
  745. FREE_tInfo.filed_0.kickTargetTime_1838 =
  746. FREE_CalcKickTargetTime(iDis_R7);
  747. // 001D3E78
  748. if (iDis_R7 >= 0xA0000)
  749. bHideType = true;
  750. else
  751. bHideType = false;
  752. } // 001D3E84 or 001D3E84
  753. iClamp_R7 = 0;
  754. if (bHideType) { // 001D3C38
  755. // 001D3C38 & 001D3C3E && 001D3C50
  756. if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
  757. pAnimData_R4->u_C.s_C.uc_c == 0)
  758. iClamp_R7 = 0xFFFFF830;
  759. // 001D3CB2
  760. iMoveToSpin_R10 = cBall.SetBallMoveToPosSpin(
  761. &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
  762. tPoint3D_var50, FREE_tInfo.filed_0.kickTargetTime_1838, 0);
  763. b_R8 = false;
  764. } // 001D3D82
  765. else { // 001D3E84
  766. // 001D3EAE
  767. iMoveToSpin_R10 = cBall.SetBallMoveToPosLowSpin(
  768. &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
  769. tPoint3D_var50, FREE_tInfo.filed_0.kickTargetTime_1838, 0);
  770. b_R8 = true;
  771. } // 001D3D82
  772. } // 001D3D82
  773. FREE_tInfo.filed_0.field_183C[0] = b_R8;
  774. FREE_tInfo.filed_0.field_1834 = -1;
  775. // 001D3DA6
  776. int iNewClamp_R5 =
  777. XMATH_InterpolateClamp(iMoveToSpin_R10, 0, 0x547B, 0, 0x3E8);
  778. // 001D3DAE
  779. int iMag_R0 = XMATH_Mag3D(&tPoint3D_var70);
  780. int iUseClamp_R0 = iMag_R0;
  781. // 001D3DB2
  782. if (iMag_R0 > iClamp_var94) { // 001D3DB6
  783. // 001D3DC0
  784. tPoint3D_var70 = XMATH_Normalize(tPoint3D_var70, iClamp_var94);
  785. iUseClamp_R0 = iClamp_var94;
  786. } // 001D3DFC
  787. // 001D3DDE
  788. else if (iMag_R0 < iClamp_var8C) { // 001D3DE2
  789. // 001D3DEA
  790. tPoint3D_var70 = XMATH_Normalize(tPoint3D_var70, iClamp_var8C);
  791. iUseClamp_R0 = iClamp_var8C;
  792. } // 001D3DFC
  793. // 001D3E06
  794. if (tPoint3D_var70.dz_8 > iUseClamp_R0 * 2 / 5) { // 001D3E0A
  795. tPoint3D_var70.dz_8 = iUseClamp_R0 * 2 / 5;
  796. // 001D3E0E
  797. XMATH_Mag3D(&tPoint3D_var70);
  798. } // 001D3E12
  799. FREE_tInfo.field_188C.m_pPlayer_0->aPoint3D_178[1] = tPoint3D_var70;
  800. FREE_tInfo.field_188C.field_4.field_2 = iNewClamp_R5;
  801. FREE_tInfo.field_188C.field_4.filed_4 = iRot_var84;
  802. FREE_tInfo.field_188C.field_4.field_0 = 0x5A;
  803. FREE_tInfo.field_188C.field_4.filed_14 = iClamp_R5; // 弧度
  804. FREE_tInfo.field_188C.field_4.filed_16 = iClamp_R7;
  805. FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  806. // 001D3E62
  807. if (b_R8) FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
  808. } // 001D36A4
  809. } // 001D36A4
  810. }
  811. //-------------------------------------------------------------------------------------------------
  812. // 001D3EC8
  813. int FREE_CalcKickTargetTime(int a1) {
  814. LOGE("FREE_CalcKickTargetTime%d", a1);
  815. return rand();
  816. }
  817. //-------------------------------------------------------------------------------------------------
  818. // 001D3EEC
  819. void FREE_ResetControls() { LOGE("FREE_ResetControls"); }
  820. //-------------------------------------------------------------------------------------------------
  821. // 001D3F24
  822. int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
  823. return 0;
  824. }
  825. //-------------------------------------------------------------------------------------------------
  826. // 001D3FA8
  827. void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
  828. int *var_58 = pi1;
  829. int *var_54 = pi2;
  830. int *var_50 = pi3;
  831. int var_2C = 0;
  832. int var_28 = 0;
  833. TPoint3D var_38;
  834. TPoint3D var_48;
  835. int r0_i = player0->tStr32_44.field_10;
  836. FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
  837. var_28 = 100;
  838. int r4_i = 21627;
  839. var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
  840. r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
  841. // 001D3FF0
  842. if (r0_i < r4_i) {
  843. // 001D3FF4
  844. r4_i = r0_i;
  845. }
  846. // 001D3FF6
  847. var_48.dz_8 = r4_i;
  848. r0_i = 0;
  849. int r7_i = 163840;
  850. int r6_i = 0;
  851. r4_i = 0;
  852. var_48.point_0.dx_0 = r0_i;
  853. int r1_i;
  854. // loc_1D40EA
  855. while (r7_i != 1998848) {
  856. // loc_1D4006
  857. int r2_i = FREE_CalcKickTargetTime(r7_i);
  858. int r9_i = 4096;
  859. // r5 = cball
  860. int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
  861. int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  862. int r10_i = r7_i + r3_i;
  863. // 356A7C - 0x356A70
  864. r0_i = cBall.ballPosPrev_4.dz_8;
  865. int var_3C = r6_i;
  866. int r11_i;
  867. // 001D4024
  868. if (r0_i < 32768) {
  869. // 001D402A
  870. TPoint3D tp1;
  871. // int var_4C = r2_i;
  872. tp1.point_0.dx_0 = r8_i;
  873. tp1.point_0.dy_4 = r3_i;
  874. tp1.dz_8 = r0_i;
  875. TPoint3D tp2;
  876. tp2.point_0.dx_0 = r8_i;
  877. tp2.point_0.dy_4 = r10_i;
  878. tp2.dz_8 = r9_i;
  879. /*
  880. * 描述:此处在连续入栈时STRD和STM有出入
  881. * 原始汇编: STMEA.W SP, {R0,R8,R10}
  882. * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
  883. */
  884. int var_4C = r2_i;
  885. r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
  886. r11_i = r7_i;
  887. r1_i = var_48.point_0.dx_0;
  888. // 001D404A
  889. if (r0_i < var_48.dz_8) {
  890. // 001D4050
  891. r1_i = r7_i;
  892. }
  893. var_48.point_0.dx_0 = r1_i;
  894. r1_i = var_48.point_0.dy_4;
  895. // 001D4056
  896. if (r0_i < r1_i) {
  897. // 001D405A
  898. r11_i = r4_i;
  899. }
  900. // 001D405C
  901. if (r4_i != 0) {
  902. // 001D4060
  903. r11_i = r4_i;
  904. }
  905. // 001D4062
  906. r2_i = cBall.ballPosPrev_4.point_0.dx_0;
  907. r3_i = cBall.ballPosPrev_4.point_0.dy_4;
  908. r1_i = r8_i;
  909. r0_i = cBall.ballPosPrev_4.dz_8;
  910. r8_i = r2_i;
  911. r2_i = var_4C;
  912. } else {
  913. // loc_1D4070
  914. r1_i = r8_i;
  915. r11_i = r4_i;
  916. }
  917. // 001D4076
  918. TPoint3D var_78;
  919. var_78.point_0.dx_0 = r8_i;
  920. var_78.point_0.dy_4 = r3_i;
  921. var_78.dz_8 = r0_i;
  922. TPoint3D var_6C;
  923. var_6C.point_0.dx_0 = r1_i;
  924. var_6C.point_0.dy_4 = r10_i;
  925. var_6C.dz_8 = r9_i;
  926. r4_i = r2_i;
  927. int r5_i =
  928. cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
  929. r0_i = r0_i * 2;
  930. r1_i = (uint)r0_i / (uint)5u;
  931. // r0_i = var_38.dz_8 ;
  932. r0_i = r7_i;
  933. // 001D40A4
  934. if (var_38.dz_8 > r1_i) {
  935. // 001D40AA
  936. r5_i = XMATH_Mag3D(&var_38);
  937. r0_i = var_38.dz_8;
  938. r0_i = r0_i / 49;
  939. r0_i = r0_i * r7_i;
  940. r0_i = r0_i / r4_i;
  941. } // loc_1D40C4
  942. r4_i = r0_i;
  943. r1_i = var_48.point_0.dy_4;
  944. r7_i += 32768;
  945. // 001D40CC
  946. if (r5_i < r1_i) {
  947. // 001D40D0
  948. r4_i = r11_i;
  949. }
  950. // 001D40D2
  951. if (r11_i != 0) {
  952. // 001D40D8
  953. r4_i = r11_i;
  954. }
  955. r6_i = var_3C;
  956. // 001D40DC
  957. if (r0_i <= r6_i) {
  958. // 001D40E0
  959. r0_i = r6_i;
  960. }
  961. r1_i = var_48.dz_8;
  962. // 001D40EA
  963. if (r5_i < r1_i) {
  964. // 001D40E8
  965. r6_i = r0_i;
  966. }
  967. } // loc_1D4006
  968. r0_i = r4_i << 1u;
  969. r1_i = 3;
  970. r0_i = r0_i / r1_i;
  971. int *r1_pi = var_58;
  972. *r1_pi = r0_i;
  973. r1_i = var_48.point_0.dx_0;
  974. // 001D40EA
  975. if (r1_i >= 1146880) {
  976. // 001D40F0
  977. r1_i = 1146880;
  978. }
  979. *var_54 = r1_i;
  980. *var_50 = r6_i;
  981. }
  982. //-------------------------------------------------------------------------------------------------
  983. // 001D4120
  984. void FREE_Init() {}
  985. //-------------------------------------------------------------------------------------------------
  986. // 001D4160
  987. void FREE_Shutdown() {}
  988. //-------------------------------------------------------------------------------------------------
  989. // 001D41B0
  990. void FREE_InitGoal(int, bool, bool, bool) {}
  991. //-------------------------------------------------------------------------------------------------
  992. // 001D4318 //^_-
  993. //单元测试等级:目测游戏表现
  994. //测试内容:启动游戏到第1关传球射门
  995. //测试结果: 游戏表现正常无崩溃且无明显变化,检测到日志输出
  996. //测试分支: 001D4318
  997. void FREE_SetupDifficulty() {
  998. /*
  999. * 描述:此处自己的汇编变量赋值上顺序有不同,多种尝试,不太容易完全一致
  1000. */
  1001. FREE_tInfo.field_1C9C.m_iCPUPlayerCloseDownCount_1CF8 =
  1002. FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
  1003. FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =
  1004. FREE_tGoal.m_fCPUCloseDownDist_7480;
  1005. FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 =
  1006. FREE_tGoal.m_iCPUKickResponseTime_749C;
  1007. FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C =
  1008. FREE_tGoal.m_iCPUMoveResponseTime_74A0;
  1009. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
  1010. //注意!!!!!这里的数据符号不对 注意更新
  1011. // FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
  1012. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
  1013. FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
  1014. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 =
  1015. FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
  1016. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
  1017. FREE_tGoal.m_fCPUGKSaveSpeed_7490;
  1018. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
  1019. FREE_tGoal.m_fCPUGKSaveDistance_7494;
  1020. uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
  1021. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
  1022. FREE_tGoal.m_iCPUGKPosResponseTime_7498;
  1023. // 001D43B6
  1024. if (r5_c != 0) {
  1025. // 001D43B8
  1026. // float s0_f = 2.8;
  1027. FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =
  1028. FREE_tGoal.m_iCPUGKRating_7484 - 5;
  1029. FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 =
  1030. FREE_tGoal.m_iCPUGKSaveResponseTime_748C + 4;
  1031. FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
  1032. FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
  1033. FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
  1034. FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 - 0.200000003f;
  1035. // 001D43E6
  1036. if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
  1037. // 001D43FA
  1038. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
  1039. (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
  1040. } else
  1041. FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
  1042. FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
  1043. FREE_tGoal.m_fCPUGKSaveSpeed_7490 - 5.0f;
  1044. }
  1045. // locret_1D4410
  1046. }
  1047. void GenerateMesh() { LOGE("GenerateMesh"); }
  1048. //-------------------------------------------------------------------------------------------------
  1049. // 001D4424 //^_-
  1050. //单元测试等级:目测游戏表现
  1051. //测试内容:启动游戏到第10关传球射门
  1052. //测试结果: 游戏表现正常无崩溃且无明显变化,未检测到日志输出
  1053. //测试分支: 无
  1054. void FREE_Initialise() {
  1055. // 4B0F74 - 0x4B0F58
  1056. int r0_i = CStoryCore::m_tStages.i_1C;
  1057. // qint var_252C = r0_i;
  1058. XSYS_RandomSetSeed(r0_i);
  1059. CTeam var_418_sp2120[2];
  1060. memcpy(var_418_sp2120, tGame.CTeam_2C60, sizeof(tGame.CTeam_2C60)); // 1008
  1061. TPlayerInfo var_2518_sp20[64];
  1062. memcpy(var_2518_sp20, &tGame.TPlayerInfo_94,
  1063. sizeof(tGame.TPlayerInfo_94)); // 8448
  1064. CGameLoop::InitGameVars();
  1065. COMM_Reset();
  1066. memcpy(tGame.CTeam_2C60, &var_418_sp2120, sizeof(tGame.CTeam_2C60));
  1067. memcpy(&tGame.TPlayerInfo_94, var_2518_sp20, sizeof(tGame.TPlayerInfo_94));
  1068. CGameLoop::ObjectsInit();
  1069. CGameLoop::PlayerObjectsUpdate();
  1070. GL_NewPlayMode(EPlayMode_1, 0, 1);
  1071. GL_NewPlayModeState(EPlayModeState_1);
  1072. // 0x7450
  1073. tGame.mTLogic_6678.team_40 = FREE_iTeam;
  1074. cBall.ballPosPrev_4.point_0.dx_0 =
  1075. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.point_0.dx_0;
  1076. cBall.ballPosPrev_4.point_0.dy_4 =
  1077. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.point_0.dy_4;
  1078. cBall.ballPosPrev_4.dz_8 =
  1079. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.dz_8;
  1080. cBall.Stop();
  1081. int r2_i = 1000;
  1082. tGame.mTLogic_6678.field_86 = 0;
  1083. tGame.field_6C8C = r2_i;
  1084. tGame.field_6C90 = r2_i;
  1085. tGame.field_6C94 = r2_i;
  1086. tGame.field_6C98 = r2_i;
  1087. r2_i = 0xFFE50000;
  1088. CPlayer *r0_player = tGame.allplay_14[FREE_iTeam].teamlist_0[0];
  1089. r0_player->SetPos(0, r2_i);
  1090. r0_i = FREE_iTeam ^ 1;
  1091. r0_player = tGame.allplay_14[r0_i].teamlist_0[0];
  1092. r0_player->SetPos(0, 0x1B0000);
  1093. int r4_i = 0;
  1094. // loc_1D4552
  1095. while (r4_i != 2) {
  1096. // loc_1D453A
  1097. for (int r6_i = 0; r6_i != 11; r6_i++) {
  1098. // loc_1D453E
  1099. r0_player = tGame.allplay_14[r4_i].teamlist_0[r6_i];
  1100. CGameLoop::ExcludePlayer(r0_player, false);
  1101. }
  1102. r4_i++;
  1103. }
  1104. // 001D4556
  1105. r0_i = 0;
  1106. int r1_i = 1;
  1107. // loc_1D456C
  1108. while (r0_i != 3) {
  1109. // loc_1D4560
  1110. CPlayer *r2_player = tGame.field_8[r0_i];
  1111. r0_i++;
  1112. r2_player->tStr32_44.uc_2 = r1_i;
  1113. } // loc_1D4560
  1114. // 001D4570
  1115. GL_ResetPlayers();
  1116. // 47F7D0 - 0x47DFB0 = 1820
  1117. int r5_i = 0;
  1118. // loc_1D46A2
  1119. while (r5_i != 2) {
  1120. // loc_1D4582
  1121. r0_i = CStoryCore::m_tStages.i_1C;
  1122. XSYS_RandomSetSeed(r0_i + r5_i);
  1123. int r8_i = 0;
  1124. // int var_251C_sp1C = r5_i;
  1125. // loc_1D468C
  1126. while (r8_i < (r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818
  1127. ->m_iTeamPlayerIndex_14[r5_i])) {
  1128. // loc_1D4594
  1129. r0_i = (uint)FREE_iTeam ^ (uint)r5_i;
  1130. TFreePlayer *r4_st = &FREE_tInfo.filed_0.pFREE_tGoal_1818
  1131. ->m_tTeamPlayerInfo_1C[r5_i][r8_i];
  1132. r1_i = r4_st->filed_0;
  1133. CPlayer *r5_player = tGame.allplay_14[r0_i].teamlist_0[r1_i];
  1134. r5_player->Reset();
  1135. r5_player->SetPos(r4_st->m_tPoint_4);
  1136. // r0_i = 0;
  1137. r5_player->ballPosPrev_4.dz_8 = 0;
  1138. r5_player->SetMoveDest(r4_st->m_tPoint_4);
  1139. r0_i = 0xFFFF;
  1140. r1_i = 0x168;
  1141. r5_player->tStr58_A0.s_4C = r0_i;
  1142. int r7_i = r4_st->m_iRot_10;
  1143. r0_i = r7_i << 14u;
  1144. int r6_i = r0_i / r1_i;
  1145. // 001D45EC
  1146. if (r7_i >= 0) {
  1147. // 001D45F8
  1148. r5_player->SetRotExplicit(r6_i);
  1149. r5_player->SetRot(r6_i, false);
  1150. r1_i = r6_i;
  1151. // loc_1D4622
  1152. } else {
  1153. // loc_1D4608
  1154. // var2528 =cball
  1155. r1_i = r5_player->GetRotPoint(cBall.ballPosPrev_4);
  1156. r5_player->SetRotExplicit(r1_i);
  1157. r1_i = -1;
  1158. }
  1159. // loc_1D4622
  1160. r5_player->Stop(r1_i);
  1161. // int* r10_pi = &r4_st->m_tAnim_3B4[0].m_iRot_8 ; //3d8
  1162. r6_i = 0;
  1163. r5_player->tStr32_44.uc_2 = r6_i;
  1164. // loc_1D4622
  1165. while (r6_i < r4_st->m_iNodeAnimSetLoopIndex_3B0) // field_3CC
  1166. {
  1167. // loc_1D4636
  1168. // 47F7D0 - 0x47DFB0 =1820
  1169. r0_i = FREE_tInfo.filed_0.field_1820;
  1170. r1_i = r4_st->m_tAnim_3B4[r6_i].m_iTick_0;
  1171. // 001D463E
  1172. if (r0_i == r1_i) {
  1173. // 001D4642
  1174. r1_i = r4_st->m_tAnim_3B4[r6_i].m_iAnimID_4;
  1175. r5_player->SetAnim(r1_i);
  1176. r0_i = r4_st->m_tAnim_3B4[r6_i].m_iAnimID_4;
  1177. r5_player->tStr32_44.field_8 = CAnimManager::GetState(r0_i);
  1178. // 001D465A
  1179. if (r4_st->m_tAnim_3B4[r6_i].m_iRot_8 >= 0) {
  1180. // 001D465E
  1181. r0_i = r0_i << 14u;
  1182. r1_i = r0_i / 360;
  1183. r5_player->SetRot(r1_i, false);
  1184. }
  1185. }
  1186. // loc_1D4672
  1187. // r10_pi = r10_pi+3;
  1188. r6_i++;
  1189. }
  1190. // loc_1D4678
  1191. r5_player->ClearBlend();
  1192. r8_i++;
  1193. } // loc_1D468C
  1194. r5_i++;
  1195. } // loc_1D4582
  1196. // 47F7E0 - 0x47DFB0
  1197. // r8 = r9 =cball
  1198. r0_i = FREE_tInfo.filed_0.field_1830;
  1199. // r1_i = r0_i + 1;
  1200. if (FREE_tInfo.filed_0.field_1830 == -1) {
  1201. // 001D46B8
  1202. r0_i = GM_GetPlayerNearestPoint(FREE_iTeam, cBall.ballPosPrev_4.point_0, 0);
  1203. // 47F7F0 - 0x47DFB0
  1204. FREE_tInfo.filed_0.field_1830 = r0_i;
  1205. FREE_tInfo.filed_0.field_1840 = r0_i;
  1206. }
  1207. // loc_1D46D2
  1208. r5_i = FREE_tInfo.filed_0.field_1834;
  1209. // r1_i = r5_i + 1;
  1210. // 001D46DA
  1211. if (FREE_tInfo.filed_0.field_1834 != -1) {
  1212. // 001D46DE
  1213. r1_i = FREE_iTeam;
  1214. CPlayer *r4_player = tGame.allplay_14[r1_i].teamlist_0[r0_i];
  1215. uint r0_u = CAnimManager::GetState(r5_i);
  1216. // r2_i = r5_i + r5_i * 32;
  1217. int r3_i = r4_player->us_122;
  1218. int r7_i = 0x7454;
  1219. TAnimData *anims = CAnimManager::s_tAnimData;
  1220. r1_i = anims[r5_i].filed_20[0].i_8;
  1221. r1_i = r3_i * r1_i;
  1222. TFreeGoal *r3_goal = FREE_tInfo.filed_0.pFREE_tGoal_1818;
  1223. r2_i = r1_i / 128;
  1224. r3_goal->m_tBallPos_744C.dz_8 = r2_i;
  1225. bool b4748 = false;
  1226. // 001D4704
  1227. if (r0_u <= 17) {
  1228. r3_i = 0x30080; //
  1229. r7_i = 1;
  1230. r0_u = (uint)r7_i << (uint)r0_u;
  1231. // 001D4734
  1232. if ((r0_u & r3_i) != 0) {
  1233. // 001D4738
  1234. tGame.field_6ADC = r4_player;
  1235. tGame.field_6AD8 = 3;
  1236. } else {
  1237. // loc_1D4748
  1238. b4748 = true;
  1239. }
  1240. } else {
  1241. // 001D4746
  1242. b4748 = true;
  1243. }
  1244. if (b4748) {
  1245. // loc_1D4748
  1246. tGame.field_6ADC = NULL;
  1247. tGame.field_6AD8 = 0;
  1248. cBall.ballPosPrev_4.dz_8 = r2_i;
  1249. // 001D4754
  1250. if (r1_i >= 0x100000) {
  1251. // 001D4758
  1252. r0_i = CAnimManager::GetActionTime(r5_i, 0, 0x400);
  1253. r1_i = cBall.ballPosPrev_4.dz_8;
  1254. LOGE("r0-i=%x", r0_i);
  1255. r0_i = r1_i + ((int)(r0_i * r0_i * 98) >> 1);
  1256. } else {
  1257. // loc_1D4790
  1258. r0_i = 0x1000;
  1259. }
  1260. // loc_1D4794
  1261. cBall.ballPosPrev_4.dz_8 = r0_i;
  1262. }
  1263. }
  1264. // loc_1D4798
  1265. // 66C0
  1266. tGame.mTLogic_6678.field_48 = 11;
  1267. // 66FD
  1268. tGame.mTLogic_6678.field_85 = 0;
  1269. // 66B8
  1270. tGame.mTLogic_6678.team_40 = FREE_iTeam;
  1271. // //47FC34 - 0x47DFB0
  1272. // r4_i = FREE_tInfo.field_1CB4;
  1273. // 47FC34 - 0x47DFB0 = 1C84
  1274. FREE_tInfo.field_188C.cBuff_3DC.field_1C = 0;
  1275. FREE_ResetControls();
  1276. // 47F7D0 - 0x47DFB0
  1277. FREE_tInfo.filed_0.field_1820 = 0; // FREE_tInfo.field_1CB4;//
  1278. // 47F7CC - 0x47DFB0
  1279. FREE_tInfo.filed_0.field_181C = 0; // r4_i;FREE_tInfo.field_1CB4
  1280. cBallProj.EnsureProj(30);
  1281. r1_i = cBallProj.field_E4;
  1282. // 47F7C8 - 0x47DFB0
  1283. // TFreeGoal* r0_goal = FREE_tInfo.filed_0.pFREE_tGoal_1818;
  1284. r1_i = ((r1_i + 11) % 512);
  1285. TPoint3D tp3d;
  1286. tp3d.point_0.dx_0 = cBallProj.field_E8[r1_i].point3D_0.point_0.dx_0;
  1287. tp3d.point_0.dy_4 = cBallProj.field_E8[r1_i].point3D_0.point_0.dy_4;
  1288. tp3d.dz_8 = cBallProj.field_E8[r1_i].point3D_0.dz_8;
  1289. // r1_i = r1_i +11;
  1290. r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iKickRot_7464;
  1291. // r1_i = r1_i % 512u;
  1292. r0_i = (uint)r0_i << 14u;
  1293. // r1_i = r1_i + r1_i*4;
  1294. r0_i = r0_i / 360;
  1295. FREE_SetupKickAction(tp3d, 0, r0_i); // 44
  1296. FREE_SetupPhaseTransition(true);
  1297. r0_i = cBall.ballPosPrev_4.point_0.dx_0;
  1298. r1_i = cBall.ballPosPrev_4.point_0.dy_4;
  1299. r2_i = cBall.ballPosPrev_4.dz_8;
  1300. tGame.m_uc_6CD4 = 0; // FREE_tInfo.field_1CB4;//r4_i;
  1301. // 47FC7C - 0x47DFB0
  1302. FREE_tInfo.field_1C9C.field_1CCC = r0_i;
  1303. FREE_tInfo.field_1C9C.field_1CD0 = r1_i;
  1304. FREE_tInfo.field_1C9C.field_1CD4 = r2_i;
  1305. GFXNET::Reset();
  1306. FREE_tInfo.filed_0.gamestatus_1828 = 2;
  1307. // 47F7DC - 0x47DFB0
  1308. FREE_tInfo.filed_0.field_182C = 0;
  1309. // 47F80E - 0x47DFB0
  1310. FREE_tInfo.filed_0.field_185E = 0;
  1311. // 47F80C - 0x47DFB0
  1312. FREE_tInfo.filed_0.field_185C = 0;
  1313. // 47F808 - 0x47DFB0
  1314. FREE_tInfo.filed_0.field_1858 = 0;
  1315. // 47F804 - 0x47DFB0
  1316. FREE_tInfo.filed_0.field_1854[0] = 0;
  1317. FREE_tInfo.filed_0.field_1854[1] = 0;
  1318. FREE_tInfo.filed_0.field_1854[2] = 0;
  1319. FREE_tInfo.filed_0.field_1854[3] = 0;
  1320. CGFXFX::ResetGoldenBootEffects();
  1321. CGFXFX::ResetStarPlayerEffects();
  1322. FREE_ResetControls();
  1323. r1_i = tGame.mTLogic_6678.field_38;
  1324. int r7_i = 30;
  1325. if (r1_i >= 31) {
  1326. tGame.mTLogic_6678.field_38 = r7_i;
  1327. }
  1328. GenerateMesh();
  1329. }
  1330. //-------------------------------------------------------------------------------------------------
  1331. // 001D49C0
  1332. void FREE_UpdateCamera(bool) {}
  1333. //-------------------------------------------------------------------------------------------------
  1334. // 001D56CC
  1335. void FREE_ClipPathBounds(TPoint3D *a1, TPoint3D *a2, int a3, int a4, int a5,
  1336. int a6) {
  1337. LOGE("FREE_ClipPathBounds%p%p%d%d%d%d", a1, a2, a3, a4, a5, a6);
  1338. }
  1339. //-------------------------------------------------------------------------------------------------
  1340. // 001D5718
  1341. // void FREE_GameLoop() {
  1342. // int r0_i = 0;
  1343. // int r1_i = 0;
  1344. // int r2_i = 0;
  1345. // // 001D571E
  1346. // if (NIS_Active() != 0) {
  1347. // // 001D5720
  1348. // // NIS_GameLoop();
  1349. // CFreeHUD::Process();
  1350. // // 47F7D8 - 0x47DFB0
  1351. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  1352. // // 001D5734
  1353. // if (r0_i == 6) {
  1354. // // 001D5738
  1355. // FREE_ProcessFail();
  1356. // r1_i = FREE_tInfo.filed_0.field_182C;
  1357. // r1_i = r1_i + 1;
  1358. // FREE_tInfo.filed_0.field_182C = r1_i;
  1359. // return;
  1360. // } else {
  1361. // // locret_1D582E
  1362. // return;
  1363. // }
  1364. // }
  1365. // // loc_1D5748
  1366. // // 47F7D8 - 0x47DFB0 = 1828
  1367. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  1368. // // 001D5754
  1369. // if (r0_i != 8) {
  1370. // // 001D5758
  1371. // tGame.maybe_sound_0++;
  1372. // }
  1373. // // loc_1D5764
  1374. // // 004877F5
  1375. // NISGOAL_tInfo.field_1 = 0;
  1376. // // 47DFB1 - 0x47DFB0
  1377. // FREE_tInfo.filed_0.b_1 = 1;
  1378. // // 001D5776
  1379. // if (CReplay::Playing() != 0) {
  1380. // // 001D5778
  1381. // CReplay::Play();
  1382. // }
  1383. // // loc_1D577C
  1384. // // 47F7D8 - 0x47DFB0
  1385. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  1386. // // 001D5782
  1387. // if (r0_i == 7) {
  1388. // // 47F7DC - 0x47DFB0
  1389. // r1_i = FREE_tInfo.filed_0.field_182C;
  1390. // // 3A27BC - 0x39BB88
  1391. // r2_i = tGame.field_6C34;
  1392. // // 001D5798
  1393. // if (r2_i < r1_i) {
  1394. // // 001D579C
  1395. // r0_i = tGame.mTLogic_6678.field_50;
  1396. // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  1397. // if (r1_i == r0_i) {
  1398. // // 001D57C6
  1399. // CGFXFX::EnableStarPlayerEffects();
  1400. // }
  1401. // } else {
  1402. // // loc_1D57B0
  1403. // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
  1404. // r1_i = FREE_tInfo.filed_0.field_1830;
  1405. // if (r1_i == r0_i) {
  1406. // // 001D57C6
  1407. // CGFXFX::EnableStarPlayerEffects();
  1408. // }
  1409. // }
  1410. // }
  1411. // // loc_1D57CA
  1412. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  1413. // float r0_f = 0.01666666753590107;
  1414. // CGFXFX::Update(r0_f);
  1415. // GFXCAMERA_ApplyIngameSettings(-1, -1);
  1416. // GFXCAMERA_UpdateMatrices();
  1417. // int r4_i = FREE_ProcessLogic();
  1418. // // 47FC60 - 0x47DFB0
  1419. // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
  1420. // // 001D57F2
  1421. // if (r4_i != 0) {
  1422. // // 001D57F8
  1423. // if (CReplay::Playing() != 0) {
  1424. // // loc_1D57FA
  1425. // CAM_Update();
  1426. // return;
  1427. // }
  1428. // } else {
  1429. // // loc_1D57FA
  1430. // CAM_Update();
  1431. // return;
  1432. // }
  1433. // // loc_1D5802
  1434. // // 3A2208 - 0x39BB88
  1435. // r0_i = tGame.mTLogic_6678.field_8;
  1436. // // 001D580E
  1437. // if (r0_i == 2) {
  1438. // // 001D5812
  1439. // // 3A2238 - 0x39BB88
  1440. // r0_i = tGame.mTLogic_6678.field_38;
  1441. // // 001D5818
  1442. // if (r0_i <= 29) {
  1443. // // 001D581C
  1444. // CReplay::RecordFrame();
  1445. // }
  1446. // } else {
  1447. // // loc_1D5822
  1448. // CReplay::RecordFrame();
  1449. // }
  1450. // // loc_1D5826
  1451. // // 3A22A0 - 0x39BB88
  1452. // r0_i = tGame.mTLogic_6678.field_A0;
  1453. // // 001D582C
  1454. // if (r0_i != 0) {
  1455. // // locret_1D582E
  1456. // return;
  1457. // }
  1458. // // loc_1D5830
  1459. // CPlayerManager::UpdatePlayersLogic();
  1460. // FREE_CheckCollision();
  1461. // cBall.UpdateFrame();
  1462. // // 47F7D8 - 0x47DFB0
  1463. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  1464. // // 001D584A
  1465. // if (r0_i != 4) {
  1466. // // 001D584E
  1467. // COL_PlayerCollisions();
  1468. // }
  1469. // // 001D5852
  1470. // PhysicsTest();
  1471. // cBall.CheckEvents();
  1472. // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  1473. // GFXNET::Update(0.01666666753590107f);
  1474. // GL_UpdatePlayMode();
  1475. // GM_CalcPlayerDist();
  1476. // GM_CalcPlayerBallInterceptions();
  1477. // FREE_LogicProcess();
  1478. // // 3A2204 - 0x39BB88
  1479. // r0_i = (uchar)tGame.mTLogic_6678.field_4;
  1480. // // 001D5878
  1481. // if (r0_i == 0) {
  1482. // // 001D587C
  1483. // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
  1484. // // 001D5882
  1485. // if (r0_i >= 4) {
  1486. // // 001D5886
  1487. // CPlayerManager::UpdatePlayers();
  1488. // }
  1489. // // 001D588A
  1490. // COMM_Process();
  1491. // }
  1492. // // loc_1D57FA
  1493. // CAM_Update();
  1494. // return;
  1495. // }
  1496. //-------------------------------------------------------------------------------------------------
  1497. // 001D58B4
  1498. void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
  1499. //-------------------------------------------------------------------------------------------------
  1500. // 001D5A3E
  1501. void FREE_UpdateRewindState() {}
  1502. //-------------------------------------------------------------------------------------------------
  1503. // 001D5A40
  1504. void FREE_RestoreRewindState() {}
  1505. //-------------------------------------------------------------------------------------------------
  1506. // 001D5AE4
  1507. void FREE_BeginRewind() {}
  1508. //-------------------------------------------------------------------------------------------------
  1509. // 001D5B30
  1510. int FREE_RewindFrame() { return 0; }
  1511. //-------------------------------------------------------------------------------------------------
  1512. // 001D5C0C
  1513. void FREE_ClipPathBounds(TPoint *a1, TPoint *a2, int a3, int a4, int a5,
  1514. int a6) {
  1515. LOGE("FREE_ClipPathBounds%p%p%d%d%d%d", a1, a2, a3, a4, a5, a6);
  1516. }
  1517. //-------------------------------------------------------------------------------------------------
  1518. // 001D656C
  1519. void FREE_IdleProcess() {
  1520. tGame.mTLogic_6678.field_8 = 1;
  1521. LOGE("FREE_IdleProcess");
  1522. }
  1523. //-------------------------------------------------------------------------------------------------
  1524. // 001D66F0
  1525. void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
  1526. void COUNTER_UpdateGenericCounters(void) {
  1527. LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
  1528. }
  1529. //-------------------------------------------------------------------------------------------------
  1530. // 001D6778 //^_-
  1531. //单元测试等级:目测游戏表现
  1532. //测试内容:启动游戏到第5关传球射门
  1533. //测试结果: 修复后游戏表现正常
  1534. void FREE_LogicProcess() {
  1535. tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
  1536. tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
  1537. // 001D679E
  1538. if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
  1539. // 001D67A2
  1540. FREE_IdleProcess();
  1541. } else {
  1542. // loc_1D67A8
  1543. if (tGame.mTLogic_6678.field_8 == 1) {
  1544. // 001D67AC
  1545. COUNTER_UpdateGenericCounters();
  1546. }
  1547. // loc_1D67B0
  1548. }
  1549. // loc_1D67B0
  1550. if (tGame.mTLogic_6678.field_10 == 0) {
  1551. if (tGame.mTLogic_6678.field_8 != 1) {
  1552. // 001D67C4
  1553. CPlayerManager::SetPlayersWalking(1);
  1554. }
  1555. }
  1556. // loc_1D67C8
  1557. tGame.field_6C34++;
  1558. tGame.field_6C38++;
  1559. }
  1560. //-------------------------------------------------------------------------------------------------
  1561. // 001D67E8
  1562. int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
  1563. //-------------------------------------------------------------------------------------------------
  1564. // 001D6918
  1565. void FREE_ProcessShotAnim(CPlayer *) {}
  1566. //-------------------------------------------------------------------------------------------------
  1567. // 001D6CD8
  1568. void FREE_ProcessUserTeam() {}
  1569. //-------------------------------------------------------------------------------------------------
  1570. // 001D7D74
  1571. void FREE_ProcessOppoTeam() {}
  1572. //-------------------------------------------------------------------------------------------------
  1573. // 001D848C
  1574. void FREE_ProcessFree() {}
  1575. //-------------------------------------------------------------------------------------------------
  1576. // 001D86C4
  1577. void FREE_ProcessFail() {}
  1578. //-------------------------------------------------------------------------------------------------
  1579. // 001D8884
  1580. void FREE_PlayCommentaryClearance() {}
  1581. //-------------------------------------------------------------------------------------------------
  1582. // 001D8944
  1583. void FREE_PlayCommentaryInterception() {}
  1584. //-------------------------------------------------------------------------------------------------
  1585. // 001D8998
  1586. void FREE_SetupKickAction(TPoint3D tPoint3D0, int i1, int i2) {
  1587. TPoint3D var_30_sp18 = tPoint3D0;
  1588. int r4_i = FREE_tInfo.filed_0.field_1834;
  1589. CPlayer *r5_player =
  1590. tGame.allplay_14[FREE_iTeam].teamlist_0[FREE_tInfo.filed_0.field_1840];
  1591. int r0_i = r4_i + 1;
  1592. // 001D89DA
  1593. if (r0_i == -1) {
  1594. // 001D89DE
  1595. r0_i = CAnimManager::GetActionAnim(r5_player, EPlayerState_12, &var_30_sp18,
  1596. i2, 0, 10, -1, 0);
  1597. r4_i = r0_i;
  1598. FREE_tInfo.filed_0.field_1834 = r0_i;
  1599. }
  1600. // loc_1D89FE
  1601. TAnimData *r7_pAnimData = &CAnimManager::s_tAnimData[r4_i];
  1602. int r11_i = CAnimManager::GetActionTime(r4_i, 0, 1024);
  1603. TPoint var_38;
  1604. r0_i = r7_pAnimData->s_64;
  1605. int r8_i = i2;
  1606. r4_i = r8_i;
  1607. int r3_i = r8_i - r0_i;
  1608. r5_player->GetAnimActionPoint(&var_38, r7_pAnimData, r3_i & 0x3FFFu, 0);
  1609. // FREE_tInfo.field_1870 = var_30.point_0; 这句是多余的?
  1610. // 47F838 - 0x47DFB0 = 1888
  1611. // 47F828 - 0x47DFB0 = 1878
  1612. r0_i = var_30_sp18.point_0.dx_0;
  1613. int r1_i = var_30_sp18.point_0.dy_4;
  1614. int r2_i = var_30_sp18.dz_8;
  1615. FREE_tInfo.field_1878 = r2_i;
  1616. FREE_tInfo.field_1888 = r4_i;
  1617. r3_i = tGame.maybe_sound_0;
  1618. r2_i = var_38.dx_0;
  1619. int r5_i = var_38.dy_4;
  1620. r5_i = r1_i - r5_i;
  1621. r4_i = r0_i - r2_i;
  1622. // 47F82C - 0x47DFB0 = 187C
  1623. FREE_tInfo.field_187C = r4_i;
  1624. // 47F830 - 0x47DFB0 = 1880
  1625. FREE_tInfo.field_1880 = r5_i;
  1626. r0_i = i1 - r11_i;
  1627. // 001D8A4C
  1628. if (i1 != 0) {
  1629. // 001D8A7C
  1630. r3_i = r3_i + r0_i;
  1631. }
  1632. // 47F834 - 0x47DFB0 = 1884
  1633. FREE_tInfo.field_1884 = r3_i;
  1634. FREE_tInfo.field_1870 = var_30_sp18.point_0;
  1635. // 001D8A8A
  1636. if (i1 == 0) {
  1637. // 001D8A94
  1638. TPoint tPoint;
  1639. tPoint.dx_0 = r4_i;
  1640. tPoint.dy_4 = r5_i;
  1641. r5_player->SetPos(tPoint);
  1642. r5_player->SetMoveDest(tPoint);
  1643. r0_i = r7_pAnimData->s_64;
  1644. r1_i = i2;
  1645. r1_i = r1_i - r0_i;
  1646. r5_player->SetRot(r1_i & 0x3FFFu, 1);
  1647. }
  1648. // loc_1D8ABA
  1649. }
  1650. //-------------------------------------------------------------------------------------------------
  1651. // 001D8AD0
  1652. void FREE_CheckGKHandPos(CPlayer *, int) {}
  1653. //-------------------------------------------------------------------------------------------------
  1654. // 001D8B9C
  1655. int FREE_SetupPhaseTransition(bool a1) {
  1656. LOGE("FREE_SetupPhaseTransition");
  1657. return rand() + a1;
  1658. }
  1659. //-------------------------------------------------------------------------------------------------
  1660. // 001D8DB4
  1661. int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
  1662. //-------------------------------------------------------------------------------------------------
  1663. // 001D8E68
  1664. void FREE_ProcessInProgressCore() {}
  1665. //-------------------------------------------------------------------------------------------------
  1666. // 001D956C
  1667. void FREE_UpdateSuccess(void) {
  1668. // 001D956C
  1669. TPoint3D var_30_sp20;
  1670. TPoint3D var_40_sp10;
  1671. /*
  1672. * 描述:寄存嚣加载略有不同,VLDR,VLD1.8这两个不知道到底什么区别
  1673. * 原始汇编:VLDR D16, [R2]
  1674. * 自己汇编:VLD1.8 {D16}, [R2]
  1675. */
  1676. TPoint3D var_50_sp0 = FREE_tInfo.filed_0.point3D_1848;
  1677. // 001D958E
  1678. if (FREE_tInfo.filed_0.field_1840 > -1) {
  1679. // 001D959C
  1680. int r1_i = var_50_sp0.dz_8;
  1681. // 001D95A8
  1682. if (r1_i <= 0x1000) {
  1683. // 001D95A8
  1684. r1_i = 0x1000;
  1685. }
  1686. var_50_sp0.dz_8 = r1_i;
  1687. cBallProj.EnsureProj(FREE_tInfo.filed_0.kickTargetTime_1838 + 10);
  1688. int r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  1689. int r7_i = 0x7FFFFFFF;
  1690. int r8_i = 600;
  1691. // r10 = var_50
  1692. int r5_i = r0_i - 10;
  1693. int r11_i;
  1694. // loc_1D963E
  1695. while (r5_i <= r0_i + 10) {
  1696. // loc_1D95D4
  1697. r0_i = cBallProj.field_E4;
  1698. // 47F7EC - 0x47DFB0 =183C
  1699. r0_i = r0_i + r5_i;
  1700. r0_i = r0_i % 512;
  1701. var_40_sp10 = cBallProj.field_E8[r0_i].point3D_0;
  1702. // r9 = var40
  1703. if (FREE_tInfo.filed_0.field_183C[0] != 0) {
  1704. // 001D960E
  1705. r0_i = XMATH_Distance(&var_40_sp10.point_0, &var_50_sp0.point_0);
  1706. } else {
  1707. // loc_1D9616
  1708. r0_i = XMATH_Distance3D(&var_40_sp10, &var_50_sp0);
  1709. }
  1710. // loc_1D961C
  1711. if (r0_i < r7_i) {
  1712. // 001D9620
  1713. r7_i = r0_i;
  1714. r8_i = r5_i;
  1715. r11_i = var_40_sp10.dz_8 - var_50_sp0.dz_8;
  1716. var_30_sp20 = var_40_sp10;
  1717. }
  1718. // loc_1D9636
  1719. // 47F7E8 - 0x47DFB0 =1838
  1720. r5_i++;
  1721. r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
  1722. }
  1723. // 001D9644
  1724. if (FREE_tInfo.filed_0.field_183C[0] == 0) {
  1725. // 001D9644
  1726. cBall.ballMovePrev_10.dz_8 = cBall.ballMovePrev_10.dz_8 - r11_i / r8_i;
  1727. }
  1728. // loc_1D9660
  1729. cBallProj.EnsureProj(r8_i + 1);
  1730. FREE_tInfo.filed_0.point3D_1848 = var_30_sp20;
  1731. FREE_tInfo.field_1884 = tGame.maybe_sound_0 + r8_i;
  1732. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  1733. // 47F834 - 0x47DFB0 =1884
  1734. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  1735. // loc_1D96BC
  1736. } else {
  1737. // loc_1D96A8
  1738. FREE_tInfo.filed_0.gamestatus_1828 = 7;
  1739. CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
  1740. }
  1741. // loc_1D96BC
  1742. }
  1743. //-------------------------------------------------------------------------------------------------
  1744. // 001D96E4
  1745. int FREE_ProcessLogic() { return 0; }
  1746. //-------------------------------------------------------------------------------------------------
  1747. // 001DA0A8
  1748. void FREE_PlayCommentaryPassReceive() {}
  1749. //-------------------------------------------------------------------------------------------------
  1750. // 001DA208
  1751. void FREE_PlayCommentaryKick() {}
  1752. //-------------------------------------------------------------------------------------------------
  1753. // 001DA484
  1754. void FREE_SetComplete() {}
  1755. //-------------------------------------------------------------------------------------------------
  1756. // 001DA5C0
  1757. void FREE_PlayersUpset(int) {}
  1758. //-------------------------------------------------------------------------------------------------
  1759. // 001DA620
  1760. void FREE_PlayersCelebrate() {}
  1761. //-------------------------------------------------------------------------------------------------
  1762. // 001DA670
  1763. void FREE_CheckCollision() {}
  1764. //-------------------------------------------------------------------------------------------------
  1765. // 001DA674
  1766. //^_^
  1767. void FREE_InitProps(void) {}
  1768. //-------------------------------------------------------------------------------------------------
  1769. // 001DA730
  1770. void FREE_UpdateProps() {}
  1771. //-------------------------------------------------------------------------------------------------
  1772. // 001DA764
  1773. void FREE_ShutdownProps() {}
  1774. //-------------------------------------------------------------------------------------------------
  1775. // 001DA7A4
  1776. void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
  1777. //-------------------------------------------------------------------------------------------------
  1778. // 001DA7BC
  1779. void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
  1780. //-------------------------------------------------------------------------------------------------
  1781. // 001DA7D4
  1782. void FREE_RenderPropShadows() {}
  1783. //-------------------------------------------------------------------------------------------------
  1784. // 001DA8C0
  1785. void FREE_RenderProps() {}
  1786. //-------------------------------------------------------------------------------------------------
  1787. // 001DA9AC
  1788. void FREE_ProcessPropCollision(TFreeProp *) {}
  1789. //-------------------------------------------------------------------------------------------------
  1790. // 001DA9AE
  1791. void FREE_ProcessPropCollisions() {}
  1792. //-------------------------------------------------------------------------------------------------
  1793. // 001DA9B0
  1794. //^_^
  1795. void FREE_RenderInitOnce() {}
  1796. //-------------------------------------------------------------------------------------------------
  1797. // 001DA9E0
  1798. void FREE_RenderShutdownOnce() {}
  1799. //-------------------------------------------------------------------------------------------------
  1800. // 001DAA00
  1801. void FREE_RenderInit() {}
  1802. //-------------------------------------------------------------------------------------------------
  1803. // 001DAAAC
  1804. void FREE_RenderShutdown() {}
  1805. //-------------------------------------------------------------------------------------------------
  1806. // 001DAAF4
  1807. void FREE_RenderListBegin(char const *, bool, bool) {}
  1808. //-------------------------------------------------------------------------------------------------
  1809. // 001DAB84
  1810. void FREE_RenderListEnd() {}
  1811. //-------------------------------------------------------------------------------------------------
  1812. // 001DABD4
  1813. void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
  1814. //-------------------------------------------------------------------------------------------------
  1815. // 001DAC40
  1816. void FREE_RenderStar(TPoint3D, float, float) {}
  1817. //-------------------------------------------------------------------------------------------------
  1818. // 001DACE4
  1819. void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
  1820. //-------------------------------------------------------------------------------------------------
  1821. // 001DAEEC
  1822. void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
  1823. //-------------------------------------------------------------------------------------------------
  1824. // 001DB0BC
  1825. void FREE_RenderRangeCone() {}
  1826. //-------------------------------------------------------------------------------------------------
  1827. // 001DB3CC
  1828. void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
  1829. //-------------------------------------------------------------------------------------------------
  1830. // 001DB5C0
  1831. void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
  1832. //-------------------------------------------------------------------------------------------------
  1833. // 001DB9C8
  1834. void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
  1835. //-------------------------------------------------------------------------------------------------
  1836. // 001DBBCC
  1837. void FREE_Render3DOpaque() {}
  1838. //-------------------------------------------------------------------------------------------------
  1839. // 001DBBF0
  1840. void FREE_RenderHeroPlayer(bool) {}
  1841. //-------------------------------------------------------------------------------------------------
  1842. // 001DBEEC
  1843. void FREE_Render3DDecal() {}
  1844. //-------------------------------------------------------------------------------------------------
  1845. // 001DBFC4
  1846. void FREE_RenderPreSelectedPlayer() {}
  1847. //-------------------------------------------------------------------------------------------------
  1848. // 001DC0E0
  1849. void FREE_RenderProcess() {
  1850. MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0 =
  1851. rand() % 10;
  1852. }
  1853. //-------------------------------------------------------------------------------------------------
  1854. // 001DC0E4
  1855. void FREE_AddVisualFeedback(int i0, EVFEffect e1, int i2) {
  1856. CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  1857. r0_hud->ClearVisualFeedback();
  1858. int r0_i = 0;
  1859. int r4_i = i2;
  1860. int r5_i = e1;
  1861. int r6_i = i0;
  1862. // int r7_i =0;
  1863. int r1_i = r6_i + r6_i * 4;
  1864. int *r7_pi = s_iEVFStrings + r1_i * 2;
  1865. // loc_1DC120
  1866. while (r0_i <= 9) {
  1867. // loc_1DC118
  1868. r1_i = *(r7_pi + r0_i);
  1869. if (r1_i == 0) {
  1870. break;
  1871. }
  1872. // loc_1DC120
  1873. r0_i++;
  1874. } // loc_1DC118
  1875. // loc_1DC124
  1876. r0_i = XSYS_Random(r0_i);
  1877. r0_i = *(r7_pi + r0_i);
  1878. wchar_t *r1_pwc = LOCstring(r0_i);
  1879. wchar_t var_218[256];
  1880. xstrlcpy(var_218, r1_pwc, 256);
  1881. int r3_i;
  1882. int r7_i;
  1883. // 47AEA8 - 0x477E90
  1884. r0_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
  1885. // 001DC148
  1886. if (r0_i == 1) {
  1887. // 001DC14C
  1888. xstrlcat(var_218, L" ", 256);
  1889. } else {
  1890. // loc_1DC152
  1891. xstrlcat(var_218, L"!", 256);
  1892. }
  1893. /*
  1894. * 描述:此处分支被合并到下面的cBall变量访问的代码块中了
  1895. * 原始汇编: BLX j__Z8xstrlcatPwPKwj
  1896. LDR R0, =(cBall_ptr - 0x1DC166)
  1897. ADD R0, PC
  1898. LDR R0, [R0]
  1899. LDR R1, [R0,#(dword_356A7C - 0x356A70)]
  1900. * 自已汇编: ...
  1901. * LDR R0, =(cBall_ptr - 0xA26A)
  1902. MOV.W R4, #0xFFFFFFFF
  1903. ADD R0, PC
  1904. LDR R0, [R0]
  1905. LDRD.W R3, R2, [R0,#4]
  1906. LDR R0, [R0,#(dword_27A4C - 0x27A40)]
  1907. */
  1908. // 356A7C - 0x356A70
  1909. // 001DC168
  1910. r1_i = cBall.ballPosPrev_4.dz_8;
  1911. if (r1_i <= 98304) {
  1912. // 001DC16E
  1913. r1_i = 98304;
  1914. }
  1915. r3_i = cBall.ballPosPrev_4.point_0.dx_0;
  1916. int r2_i = cBall.ballPosPrev_4.point_0.dy_4;
  1917. bool bC1F8 = false;
  1918. // 001DC174
  1919. if (r4_i + 1 != 0) {
  1920. // 001DC176
  1921. if (r5_i == 3) {
  1922. // 001DC17A
  1923. r1_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.dz_8;
  1924. r2_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dy_4;
  1925. r3_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dx_0;
  1926. r4_i = -1;
  1927. // 001DC18A
  1928. if (r6_i != 12) {
  1929. // 001DC1A2
  1930. r1_i = r1_i + 98304;
  1931. }
  1932. // loc_1DC1F8
  1933. bC1F8 = true;
  1934. } else {
  1935. // loc_1DC1B2
  1936. r1_i = 98304;
  1937. r2_i = 0;
  1938. r3_i = 0;
  1939. }
  1940. // loc_1DC1BA
  1941. } else {
  1942. // loc_1DC1A8
  1943. r4_i = -1;
  1944. }
  1945. if (bC1F8 == false) {
  1946. // loc_1DC1BA
  1947. uint r0_ui = (uint)r5_i - 1u;
  1948. // 001DC1BC
  1949. if (r0_ui >= 2) {
  1950. // 001DC1C0
  1951. if (r5_i != 3) {
  1952. // 001DC1C4
  1953. if (r5_i == 0) {
  1954. // 001DC1C8
  1955. // 4B0E34 - 0x4AB140
  1956. CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  1957. r7_i = 0;
  1958. r6_i = 1;
  1959. int var_228 = r6_i;
  1960. int var_224 = r7_i;
  1961. int var_220 = r4_i;
  1962. int r12_i = -256;
  1963. float r5_f = 1;
  1964. r4_i = 100;
  1965. r6_i = 1602;
  1966. TPoint3D tp3d0;
  1967. tp3d0.point_0.dx_0 = r3_i;
  1968. tp3d0.point_0.dy_4 = r2_i;
  1969. tp3d0.dz_8 = r1_i;
  1970. TPoint3D tp3d1;
  1971. tp3d1.point_0.dx_0 = r7_i;
  1972. tp3d1.point_0.dy_4 = r7_i;
  1973. tp3d1.dz_8 = r6_i;
  1974. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r4_i, r5_f,
  1975. r12_i, var_228, (EVFEffect)var_224,
  1976. var_220);
  1977. }
  1978. // loc_1DC25E
  1979. return;
  1980. }
  1981. // F8
  1982. } else {
  1983. // loc_1DC228
  1984. float r6_f = 0.699999988079071;
  1985. r7_i = 1;
  1986. CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  1987. int var_228 = r7_i;
  1988. int var_224 = r5_i;
  1989. int var_220 = r4_i;
  1990. r5_i = 60;
  1991. r7_i = 0;
  1992. r4_i = 1602;
  1993. int r12_i = -1;
  1994. TPoint3D tp3d0;
  1995. tp3d0.point_0.dx_0 = r3_i;
  1996. tp3d0.point_0.dy_4 = r2_i;
  1997. tp3d0.dz_8 = r1_i;
  1998. TPoint3D tp3d1;
  1999. tp3d1.point_0.dx_0 = r7_i;
  2000. tp3d1.point_0.dy_4 = r7_i;
  2001. tp3d1.dz_8 = r4_i;
  2002. return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r5_i, r6_f,
  2003. r12_i, var_228, (EVFEffect)var_224,
  2004. var_220);
  2005. }
  2006. }
  2007. // loc_1DC1F8
  2008. r0_i = -801;
  2009. r7_i = 1;
  2010. r6_i = -12566464;
  2011. int lr_i = r0_i;
  2012. // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
  2013. float r12_f = 0.699999988079071;
  2014. r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
  2015. int var_228 = r7_i;
  2016. int var_224 = r5_i;
  2017. r7_i = 40;
  2018. r5_i = 0;
  2019. TPoint3D tp3d0;
  2020. tp3d0.point_0.dx_0 = r3_i;
  2021. tp3d0.point_0.dy_4 = r2_i;
  2022. tp3d0.dz_8 = r1_i;
  2023. TPoint3D tp3d1;
  2024. tp3d1.point_0.dx_0 = r5_i;
  2025. tp3d1.point_0.dy_4 = r5_i;
  2026. tp3d1.dz_8 = lr_i;
  2027. r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r7_i, r12_f, r6_i,
  2028. var_228, (EVFEffect)var_224, r4_i);
  2029. }
  2030. //-------------------------------------------------------------------------------------------------
  2031. // 001DC290
  2032. void FREE_AddVisualFeedback_Pass() {
  2033. TPoint var_1C =
  2034. cBallProj.field_E8[((cBallProj.field_E4 + 1) % 512)].point3D_0.point_0;
  2035. CPlayer *r7_pplayer = tGame.mTMath_6734.pPlayer_134[FREE_iTeam];
  2036. int r0_i = XMATH_Distance(&tGame.mTLogic_6678.field_64, &var_1C);
  2037. // 3A2278 - 0x39BB88 = 66F0
  2038. int r2_i = tGame.mTLogic_6678.field_78; //[2]
  2039. TAnimData *anims = CAnimManager::s_tAnimData;
  2040. int r1_i = (ushort)anims[r2_i].u_C.filed_C;
  2041. r1_i = r1_i & 1032u;
  2042. int r4_i;
  2043. EVFEffect r5_i;
  2044. /*
  2045. * 描述: 原汇编r5= 1有归并,自己汇编分成了两处, 寄存嚣分配有出入
  2046. * 原始汇编: loc_1DC30A
  2047. * MOVS R5, #1
  2048. B loc_1DC31A
  2049. * 自已汇编: BLE loc_E2EC
  2050. MOVS R4, #1
  2051. */
  2052. // bool bC30A = false;
  2053. // 001DC2FC
  2054. if (r1_i == 0) {
  2055. // loc_1DC302
  2056. if (r0_i > 819200) {
  2057. // 001DC308
  2058. r4_i = 8;
  2059. r5_i = EVFEffect_1;
  2060. } else {
  2061. // loc_1DC30E
  2062. r4_i = 9;
  2063. if (r0_i < 327680) {
  2064. // 001DC316
  2065. r4_i = 10;
  2066. }
  2067. r5_i = EVFEffect_2;
  2068. }
  2069. } else {
  2070. r4_i = 11;
  2071. r5_i = EVFEffect_1;
  2072. }
  2073. // loc_1DC30A
  2074. // loc_1DC31A
  2075. CPlayer *r0_pplayer = &tGame.CPlayer_3050[0];
  2076. r2_i = r7_pplayer - r0_pplayer;
  2077. FREE_AddVisualFeedback(r4_i, r5_i, r2_i);
  2078. r0_i = XSYS_Random(2);
  2079. r0_i = r0_i + 3;
  2080. SNDGAME_Crowd_PlayReaction(r0_i);
  2081. }
  2082. //-------------------------------------------------------------------------------------------------
  2083. // 001DC354
  2084. void FREE_AddVisualFeedback_Goal() {}
  2085. //-------------------------------------------------------------------------------------------------
  2086. // 001DC440
  2087. void FREE_AddVisualFeedback_Fail() {}
  2088. //-------------------------------------------------------------------------------------------------
  2089. // 001DC494
  2090. void FREE_AddVisualFeedback_Offside() {}
  2091. //-------------------------------------------------------------------------------------------------
  2092. // 001DC4C8
  2093. void FREE_SortPlayers(TFreeGoal *a1) { LOGE("FREE_SortPlayers%p", a1); }
  2094. //-------------------------------------------------------------------------------------------------
  2095. // 001DC664
  2096. void FREE_SortPlayersDistance(TFreeGoal *) {}
  2097. //-------------------------------------------------------------------------------------------------
  2098. // 001DC848
  2099. int FREE_ReadXML(TFreeGoal *, int) { return 0; }
  2100. //-------------------------------------------------------------------------------------------------
  2101. // 001DC888
  2102. bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
  2103. //-------------------------------------------------------------------------------------------------
  2104. // 001DCA14
  2105. void FREE_ReadXMLLevel(int a1, TFreeGoal *tFreeGoal_r0,
  2106. CFTTXmlReaderNode cXMLReaderNode_r1) {
  2107. TPoint3D tPoint3D_50;
  2108. CFTTXmlReaderNode cNode_48;
  2109. auto cXMLReaderNode_4C = cXMLReaderNode_r1;
  2110. // CFTTXmlReaderNode cPropNode_54;
  2111. CFTTXmlReaderNode cNodeTeam_40;
  2112. CFTTXmlReaderNode cNodePlayer_3C;
  2113. TPoint tPoint_34;
  2114. TPoint tZero_74;
  2115. // int iTeam_No_Index_78;
  2116. char pFormatBuf_50[0x20];
  2117. TPoint3D tPoint3D_98;
  2118. TPoint tPoint_98;
  2119. // 001DCA30
  2120. memset(tFreeGoal_r0, 0, sizeof(TFreeGoal)); // sizeof(TFreeGoal) = 0x7634
  2121. // 001DCA3A
  2122. cNode_48 = cXMLReaderNode_r1.GetFirstChild("Info");
  2123. // 001DCA46 <- **if 分支**
  2124. if (cNode_48.IsValid()) {
  2125. // 001DCA48 OK
  2126. tFreeGoal_r0->m_iVersion_0 =
  2127. XMLGetInt(cNode_48, "Version", NULL, 0); // 001DCA56 <- **字段 0 赋值**
  2128. }
  2129. // 001DCA66
  2130. if (XMLExists(cXMLReaderNode_r1, "Ball", "Pos")) {
  2131. // 001DCA68 OK
  2132. // 001DCA7C <- **结构体赋值**
  2133. // tPoint3D_98 = g_vZero3;
  2134. // 001DCA86 <- **call XMLGetPos3D**
  2135. tPoint3D_50 = XMLGetPos3D(
  2136. cXMLReaderNode_r1, "Ball", "Pos",
  2137. g_vZero3); // 001DCA86 <- **函数调用,结构体传参通过栈拷贝**
  2138. // 001DCA94 <- **TPoint3D.dz_8 赋值**
  2139. tFreeGoal_r0->m_tBallPos_744C.dz_8 = tPoint3D_50.dz_8;
  2140. // 001DCA9C <- **TPoint3D.point_0赋值**
  2141. // tFreeGoal_r0->m_tBallPos_744C.point_0 = tPoint3D_40.point_0;
  2142. tFreeGoal_r0->m_tBallPos_744C.point_0.dx_0 = tPoint3D_50.point_0.dx_0;
  2143. tFreeGoal_r0->m_tBallPos_744C.point_0.dy_4 = tPoint3D_50.point_0.dy_4;
  2144. // 001DCAA6 <- **if 分支**
  2145. if (tFreeGoal_r0->m_tBallPos_744C.dz_8 < 0x1000) {
  2146. // 001DCABC OK
  2147. tFreeGoal_r0->m_tBallPos_744C.dz_8 =
  2148. 0x1000; // 001DCAC2 <- **字段 744C 赋值**
  2149. }
  2150. } else {
  2151. // 001DCAAA <- **分支地址**
  2152. // 001DCAB0 <- **TPoint.dy_4 赋值**
  2153. // 001DCAB6 <- **TPoint.dx_0 赋值**
  2154. tFreeGoal_r0->m_tBallPos_744C.point_0 = TPoint(0, 0);
  2155. // 001DCAC2
  2156. tFreeGoal_r0->m_tBallPos_744C.dz_8 = 0x1000;
  2157. }
  2158. // 001DCAD8 <- **字段 745C 赋值**
  2159. tFreeGoal_r0->m_iKickPlayer_745C = XMLGetInt(
  2160. cXMLReaderNode_r1, "KickPlayer", NULL, 0); // 001DCACE <- **函数调用**
  2161. // 001DCAE2 <- **call XMLGetString()**
  2162. char *pKickAnim_r0 = XMLGetString(cXMLReaderNode_r1, "KickAnim", NULL, NULL);
  2163. // 001DCAEA <- **XMLGetString() 返回值判断**
  2164. if (pKickAnim_r0) {
  2165. // 001DCAEC OK
  2166. tFreeGoal_r0->m_iAnimID_7460 = CAnimManager::GetAnimID(
  2167. pKickAnim_r0); // 001DCB02 <- **字段 7460 赋值**
  2168. } else {
  2169. // 001DCAF2
  2170. tFreeGoal_r0->m_iAnimID_7460 = -1;
  2171. }
  2172. // 001DCB1E <- **字段 7464 赋值**
  2173. tFreeGoal_r0->m_iKickRot_7464 =
  2174. XMLGetInt(cXMLReaderNode_r1, "KickRot", 0, 0xB4);
  2175. // 001DCB36 <- **字段 8 赋值**
  2176. const char *sWeatherTypes[3] = {"FINE", "RAIN", "SNOW"};
  2177. tFreeGoal_r0->m_iWeather_8 = XMLGetStringInt(
  2178. cXMLReaderNode_r1, "Weather", NULL, (const char **)sWeatherTypes, 3, -1);
  2179. // 001DCB44 <- **字段 C 赋值**
  2180. tFreeGoal_r0->m_iMaxPhaseCount_C =
  2181. XMLGetInt(cXMLReaderNode_r1, "MaxPhaseCount", NULL, 0);
  2182. // 001DCB5A <- **字段 10 赋值**
  2183. tFreeGoal_r0->m_bIndirect_10 =
  2184. XMLGetInt(cXMLReaderNode_r1, "Indirect", NULL, 0)
  2185. ? true
  2186. : false; // 001DCB52 <- **三目运算**
  2187. // 001DCB64 <- **call XMLGetString()**
  2188. char const *pShotAnim_r0 =
  2189. XMLGetString(cXMLReaderNode_r1, "ShotAnim", NULL, NULL);
  2190. // 001DCB68 <- **返回值判断**
  2191. if (pShotAnim_r0) {
  2192. // 001DCB6A
  2193. tFreeGoal_r0->m_iShotAnimID_7468 = CAnimManager::GetAnimID(
  2194. pShotAnim_r0); // 001DCB82 <- **字段 7468 赋值**
  2195. } else {
  2196. // 001DCB70 OK
  2197. tFreeGoal_r0->m_iShotAnimID_7468 = -1; // 001DCB7E <- **返回值空则赋值 -1**
  2198. }
  2199. // 001DCB92 <- **字段 746C 赋值**
  2200. tFreeGoal_r0->m_iShotAnimPlayer_746C =
  2201. XMLGetInt(cXMLReaderNode_r1, "ShotAnimPlayer", NULL, -1);
  2202. // 001DCB9E <- **call XMLGetFloat()**
  2203. tFreeGoal_r0->m_fShotAnimDistance_7470 =
  2204. XMLGetFloat(cXMLReaderNode_r1, "ShotAnimDistance", NULL, 24.0f);
  2205. // 001DCBB8 <- **字段 7458 赋值**
  2206. tFreeGoal_r0->m_iUserPlayer_7458 =
  2207. XMLGetInt(cXMLReaderNode_r1, "UserPlayer", NULL, 0);
  2208. // 001DCBCA <- **字段 747C 赋值**
  2209. tFreeGoal_r0->m_iCPUPlayerCloseDownCount_747C =
  2210. XMLGetInt(cXMLReaderNode_r1, "CPUPlayerCloseDownCount", NULL, 1);
  2211. // 001DCBDE <- **字段 7480 赋值**
  2212. tFreeGoal_r0->m_fCPUCloseDownDist_7480 =
  2213. XMLGetFloat(cXMLReaderNode_r1, "CPUCloseDownDist", NULL, 4.0f);
  2214. // 001DCBF0 <- **字段 7484 赋值**
  2215. tFreeGoal_r0->m_iCPUGKRating_7484 =
  2216. XMLGetInt(cXMLReaderNode_r1, "CPUGKRating", NULL, 0x32);
  2217. // 001DCC02 <- **字段 7490 赋值**
  2218. tFreeGoal_r0->m_fCPUGKSaveSpeed_7490 =
  2219. XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveSpeed", NULL, 90.0f);
  2220. // 001DCC16 <- **字段 7494 赋值**
  2221. tFreeGoal_r0->m_fCPUGKSaveDistance_7494 =
  2222. XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveDistance", NULL, 4.0f);
  2223. // 001DCC2A <- **字段 7488 赋值**
  2224. tFreeGoal_r0->m_fCPUGKSaveAlwaysDistance_7488 =
  2225. XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveAlwaysDistance", NULL, 0.75f);
  2226. // 001DCC3C <- **字段 748C 赋值**
  2227. tFreeGoal_r0->m_iCPUGKSaveResponseTime_748C =
  2228. XMLGetInt(cXMLReaderNode_r1, "CPUGKSaveResponseTime", NULL, 0xF);
  2229. // 001DCC4E <- **字段 7498 赋值**
  2230. tFreeGoal_r0->m_iCPUGKPosResponseTime_7498 =
  2231. XMLGetInt(cXMLReaderNode_r1, "CPUGKPosResponseTime", NULL, 0xF);
  2232. // 001DCC5C <- **函数返回值赋值**
  2233. int iCPUPlayerResponseTime_r4 =
  2234. XMLGetInt(cXMLReaderNode_r1, "CPUPlayerResponseTime", NULL,
  2235. 0xF); // 001DCC58 <- **函数调用**
  2236. // 001DCC6E <- **字段 749C 赋值**
  2237. tFreeGoal_r0->m_iCPUKickResponseTime_749C =
  2238. XMLGetInt(cXMLReaderNode_r1, "CPUKickResponseTime", NULL,
  2239. iCPUPlayerResponseTime_r4);
  2240. // 001DCC80 <- **字段 74A0 赋值**
  2241. tFreeGoal_r0->m_iCPUMoveResponseTime_74A0 =
  2242. XMLGetInt(cXMLReaderNode_r1, "CPUMoveResponseTime", NULL,
  2243. iCPUPlayerResponseTime_r4);
  2244. // 001DCC92 <- **字段 7478 赋值**
  2245. tFreeGoal_r0->m_iTEAMKickResponseTime_7478 =
  2246. XMLGetInt(cXMLReaderNode_r1, "TEAMKickResponseTime", 0, 0xA);
  2247. // 001DCCA4 <- **字段 7474 赋值**
  2248. tFreeGoal_r0->m_iTEAMMoveResponseTime_7474 =
  2249. XMLGetInt(cXMLReaderNode_r1, "TEAMMoveResponseTime", 0, 5);
  2250. // 001DCCB8 <- **字段 74C4 赋值**
  2251. tFreeGoal_r0->m_fTEAMPassForceShotDist_74C4 =
  2252. XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotDist", NULL, 8.0f);
  2253. // 001DCCCC <- **字段 74C8 赋值**
  2254. tFreeGoal_r0->m_fTEAMPassForceShotSpace_74C8 =
  2255. XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotSpace", NULL, 4.0f);
  2256. // 001DCCDE <- **字段 74CC 赋值**
  2257. tFreeGoal_r0->m_iShootBias_74CC =
  2258. XMLGetInt(cXMLReaderNode_r1, "ShootBias", NULL, 0);
  2259. // 001DCCF0 <- **字段 74D4 赋值**
  2260. tFreeGoal_r0->m_iPassBias_74D4 =
  2261. XMLGetInt(cXMLReaderNode_r1, "PassBias", NULL, 0);
  2262. // 001DCD02 <- **字段 74DC 赋值**
  2263. tFreeGoal_r0->m_iControlWhenShootBias_74DC =
  2264. XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootBias", NULL, 0);
  2265. // 001DCD14 <- **字段 74E4 赋值**
  2266. tFreeGoal_r0->m_iControlWhenPassBias_74E4 =
  2267. XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassBias", NULL, 0);
  2268. // 001DCD26 <- **字段 74D0 赋值**
  2269. tFreeGoal_r0->m_iShootScale_74D0 =
  2270. XMLGetInt(cXMLReaderNode_r1, "ShootScale", NULL, 0);
  2271. // 001DCD38 <- **字段 74D8 赋值**
  2272. tFreeGoal_r0->m_iPassScale_74D8 =
  2273. XMLGetInt(cXMLReaderNode_r1, "PassScale", NULL, 0);
  2274. // 001DCD4A <- **字段 74E0 赋值**
  2275. tFreeGoal_r0->m_iControlWhenShootScale_74E0 =
  2276. XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootScale", NULL, 0);
  2277. // 001DCD5C <- **字段 74E8 赋值**
  2278. tFreeGoal_r0->m_iControlWhenPassScale_74E8 =
  2279. XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassScale", NULL, 0);
  2280. // 001DCD6E <- **字段 74EC 赋值**
  2281. tFreeGoal_r0->m_iControlRepeatReduce_74EC =
  2282. XMLGetInt(cXMLReaderNode_r1, "ControlRepeatReduce", NULL, 10);
  2283. // 001DCD80 <- **字段 74F0 赋值**
  2284. tFreeGoal_r0->m_iPropCount_74F0 =
  2285. XMLGetInt(cXMLReaderNode_r1, "PropCount", NULL, 0);
  2286. // 001DCD9C <- **局部变量赋值**
  2287. CFTTXmlReaderNode cPropNode_44 = cXMLReaderNode_r1.GetFirstChild(
  2288. "Prop"); // cNode_var_54 IDA中伪代码 NextSibling
  2289. // 001DCD9A <- **寄存器R4作为循环计数器**
  2290. // 001DCEC2 <- **循环条件判断**
  2291. for (int i_r4 = 0; i_r4 < tFreeGoal_r0->m_iPropCount_74F0; i_r4++) {
  2292. // 001DCE64
  2293. // 001DCE7A <- **结构体字段赋值**
  2294. const char *sFPropTypes[3] = {"CONE", "MANNEQUIN", "BOARD"};
  2295. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iType_C =
  2296. (EFreePropType)XMLGetStringInt(cPropNode_44, "Type", NULL,
  2297. (const char **)sFPropTypes, 3, 0);
  2298. // 001DCEA0 001DCEA2 <- **TPoint3D结构赋值**
  2299. // 001DCEA2 <-
  2300. // **该地址使用了VSTR指令,推测TPoint3D使用了浮点数,但还原代码时使用TPointF3D结构体,汇编代码并未一致**
  2301. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_tPoint3D_0 =
  2302. XMLGetPos3D(cPropNode_44, "Pos", NULL, g_vZero3);
  2303. // 001DCEB0 <- **字段赋值**
  2304. tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iRot_10 =
  2305. XMLGetInt(cPropNode_44, "Rot", NULL, 0);
  2306. // 001DCEB6 <- **读取下一个node**
  2307. cPropNode_44 = cPropNode_44.GetNextSibling("Prop");
  2308. // 001DCEBC <- **ADDS R6, #0x14; 0x14
  2309. // 说明数组元素是5个int的结构体**
  2310. } // 001DCEC4 <- **循环代码块结束**
  2311. int iPlayerNO_r10;
  2312. // 001DCEF0
  2313. tZero_74 = g_vZero;
  2314. // 001DCEDA 寄存器r3作为循环计数器, iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 ==
  2315. // 0,是己方球队
  2316. for (int iTeamNO_r3 = 0; iTeamNO_r3 != 2; iTeamNO_r3++) {
  2317. // 001DCEF4 OK
  2318. // 001DCEFE <- **call snprintf**
  2319. snprintf(pFormatBuf_50, 0x20, "Team%i", iTeamNO_r3);
  2320. // 001DCF0A <- **局部变量赋值**
  2321. cNodeTeam_40 = cXMLReaderNode_r1.GetFirstChild(pFormatBuf_50);
  2322. // 001DCF0E <- **if 代码块**
  2323. if (cNodeTeam_40.IsValid()) {
  2324. // 001DCF18 OK
  2325. // 001DCF26 <- **局部变量赋值**
  2326. cNodePlayer_3C = cNodeTeam_40.GetFirstChild("Player");
  2327. iPlayerNO_r10 = 0; // 001DCF20 <- **循环计数器**
  2328. // 001DD28A <- **call IsValid()**
  2329. // 001DD294 <- **小于等于 10则跳转**
  2330. while (cNodePlayer_3C.IsValid() && iPlayerNO_r10 < 11) {
  2331. // 001DCF2A OK
  2332. if (XMLExists(cNodePlayer_3C, "Pos", NULL)) {
  2333. // 001DCF2A OK
  2334. // tPoint_98 = tZero_74; // 001DCF42 <- **结构体赋值**
  2335. // 001DCF46 <- **tPoint_64 接收函数返回值**
  2336. tPoint_34 = XMLGetPos(cNodePlayer_3C, "Pos", NULL, g_vZero);
  2337. // 001DCF68 <- **结构体比较,这里的操作符重载函数与原始汇编不一致**
  2338. // if
  2339. // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4
  2340. // != tPoint_34) { 001DCF6C OK 001DCF6E 001DCF72 <- **结构体赋值,
  2341. // 使用结构体操作符重载函数会改变汇编代码结构** LOGI("hook 0 %d",
  2342. // iPlayerNO_r10);
  2343. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2344. .m_tPoint_4.dx_0 =
  2345. tPoint_34
  2346. .dx_0; //这里的pos如果改为 TPoint(0,0)
  2347. //在第一二关时,对方球队的守门员会变得跟自己一方的射门的球员的位置一样
  2348. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2349. .m_tPoint_4.dy_4 =
  2350. tPoint_34.dy_4; // iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 ==
  2351. // 0,是己方球队
  2352. /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
  2353. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dx_0
  2354. = 0;
  2355. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dy_4
  2356. = 0;
  2357. //LOGI("hook 0 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3,
  2358. iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
  2359. }*/
  2360. // }
  2361. } else {
  2362. // 001DCF8A <- **结构体赋值**
  2363. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2364. .m_tPoint_4 = TPoint(0, 0);
  2365. }
  2366. // 001DCFAE
  2367. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2368. .m_iHoldPosTime_C =
  2369. XMLGetInt(cNodePlayer_3C, "HoldPosTime", NULL, 0);
  2370. // 001DCFBA
  2371. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2372. .m_iRot_10 = XMLGetInt(cNodePlayer_3C, "Rot", NULL, -1);
  2373. // 001DCFDC <- ** if **
  2374. if (XMLGetInt(cNodePlayer_3C, "TeamMoveInfluence", NULL,
  2375. iPlayerNO_r10 ? 1 : 0)) {
  2376. // 001DCFDE
  2377. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2378. .m_iTeamMoveInfluence_14 = true;
  2379. } else {
  2380. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2381. .m_iTeamMoveInfluence_14 = false;
  2382. }
  2383. tPoint_98 = TPoint(0, 0); // 001DCFEC <- **结构体赋值**
  2384. // 001DCFE4 <- **tPoint_64 接收返回值**
  2385. tPoint_34 = XMLGetPos(cNodePlayer_3C, "MoveInfluence", NULL, tPoint_98);
  2386. // 001DCFFC <- **结构体比较,重载函数导致汇编不一致**
  2387. // if
  2388. // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0
  2389. // != tPoint_34.dx_0) {
  2390. // 001DD004
  2391. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2392. .m_tPoint_18.dx_0 = tPoint_34.dx_0; // 001DD004
  2393. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2394. .m_tPoint_18.dy_4 = tPoint_34.dy_4; // 001DD00A
  2395. /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
  2396. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0
  2397. = 0;
  2398. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4
  2399. = 0;
  2400. //LOGI("hook 1 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3,
  2401. iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
  2402. }*/
  2403. // } else {
  2404. // 001DD010 OK
  2405. // tPoint_34.dy_4 =
  2406. // tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4;
  2407. // }
  2408. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2409. .m_tPoint_18.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD026
  2410. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2411. .m_tPoint_18.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD032
  2412. // 001DD040 <- **结构体字段赋值**
  2413. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2414. .m_iMoveResponseTime_20 =
  2415. XMLGetInt(cNodePlayer_3C, "MoveResponseTime", NULL, -1);
  2416. // 001DD052
  2417. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2418. .m_iKickResponseTime_24 =
  2419. XMLGetInt(cNodePlayer_3C, "KickResponseTime", NULL, -1);
  2420. // 001DD06A
  2421. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2422. .m_bStatic_28 =
  2423. XMLGetInt(cNodePlayer_3C, "Static", NULL, 0) ? true : false;
  2424. const char *sFPATypes[3] = {"AI", "PASS", "SHOOT"};
  2425. // 001DD084
  2426. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2427. .m_iAction_534 = XMLGetStringInt(cNodePlayer_3C, "Action", NULL,
  2428. (const char **)sFPATypes, 3, 0);
  2429. // 001DD094
  2430. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2431. .m_iActionPassTarget_538 =
  2432. XMLGetInt(cNodePlayer_3C, "ActionPassTarget", NULL, 0);
  2433. // 001DD0A4
  2434. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2435. .m_iActionControlCount_53C =
  2436. XMLGetInt(cNodePlayer_3C, "ActionControlCount", NULL, 0);
  2437. // 001DD0B6
  2438. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2439. .m_iActionControlRot_540 =
  2440. XMLGetInt(cNodePlayer_3C, "ActionControlRot", NULL, -1);
  2441. // 001DD0CE
  2442. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2443. .m_fActionControlKickAhead_544 =
  2444. XMLGetFloat(cNodePlayer_3C, "ActionControlKickAhead", NULL, 0);
  2445. // 001DD0C8 <- **循环计数器初始化**
  2446. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2447. .m_iNodeTDestSetLoopIndex_2C = 0;
  2448. // 001DD0D4 <- **call GetFirstChild()**
  2449. // 001DD1AA <- **call IsValid()**
  2450. for (auto cNode = cNodePlayer_3C.GetFirstChild("Move"); cNode.IsValid();
  2451. cNode = cNode.GetNextSibling("Move")) {
  2452. // 001DD0DA
  2453. int iTempIndex =
  2454. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2455. .m_iNodeTDestSetLoopIndex_2C;
  2456. // 001DD0E4 <- **call XMLExits**
  2457. if (XMLExists(cNode, "Dest", NULL)) {
  2458. // 001DD0EC
  2459. // iTempIndex++;
  2460. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2461. .m_iNodeTDestSetLoopIndex_2C++; // 001DD0F4
  2462. // auto ptr =
  2463. // (char*)(tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerMoveInfo_30)
  2464. // + sizeof(TFreeMoveInfo) * iTempIndex; auto pTFreeMoveInfo =
  2465. // (TFreeMoveInfo*)ptr; pTFreeMoveInfo->m_iTick_0 = XMLGetInt(cNode,
  2466. // "Tick", NULL, 0); 001DD10E <- **字段赋值**
  2467. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2468. .m_tPlayerDesk_30[iTempIndex]
  2469. .m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
  2470. // 001DD11C <- **字段赋值**
  2471. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2472. .m_tPlayerDesk_30[iTempIndex]
  2473. .m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
  2474. // pTFreeMoveInfo->m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
  2475. // tPoint_98 = vZero; //001DD128 <- **结构体赋值**
  2476. // 001DD12C <- **tPoint_64接收返回值**
  2477. tPoint_34 = XMLGetPos(cNode, "Dest", NULL, g_vZero); // tPoint_98);
  2478. // 001DD13C <- **结构体比较**
  2479. // 001DD144
  2480. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2481. .m_tPlayerDesk_30[iTempIndex]
  2482. .m_tDestPoint_4.dx_0 = tPoint_34.dx_0; // player 2 bug
  2483. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2484. .m_tPlayerDesk_30[iTempIndex]
  2485. .m_tDestPoint_4.dy_4 = tPoint_34.dy_4;
  2486. // 001DD158 <- **字段赋值**
  2487. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2488. .m_tPlayerDesk_30[iTempIndex]
  2489. .m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL, 50);
  2490. // pTFreeMoveInfo->m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL,
  2491. // 50);
  2492. tPoint_98 = TPoint(0, 0); // 001DD164
  2493. tPoint_34 = XMLGetPos(cNode, "MoveInfluence", NULL,
  2494. tPoint_98); // 001DD16A <- **call
  2495. // XMLGetPos()** 001DD174 <-
  2496. // **结构体比较** if
  2497. // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14
  2498. // != tPoint_34) {
  2499. // 001DD178
  2500. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2501. .m_tPlayerDesk_30[iTempIndex]
  2502. .m_tMoveInfluence_14.dx_0 =
  2503. tPoint_34.dx_0; // 001DD178 001DD17C <- **赋值**
  2504. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2505. .m_tPlayerDesk_30[iTempIndex]
  2506. .m_tMoveInfluence_14.dy_4 = tPoint_34.dy_4;
  2507. // } else {
  2508. // 001DD182
  2509. // tPoint_34.dy_4 =
  2510. // tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dy_4;
  2511. // }
  2512. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2513. .m_tPlayerDesk_30[iTempIndex]
  2514. .m_tMoveInfluence_14.dx_0 =
  2515. tPoint_34.dx_0 / 0x8000; // 001DD18E
  2516. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2517. .m_tPlayerDesk_30[iTempIndex]
  2518. .m_tMoveInfluence_14.dy_4 =
  2519. tPoint_34.dy_4 / 0x8000; // 001DD198
  2520. } // 001DD1AA <- **if XMLExists 代码块结束**
  2521. } // 001DD1B2 <- **循环结束**
  2522. // 001DD1B6 <- **字段赋值**
  2523. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2524. .m_iNodeAnimSetLoopIndex_3B0 = 0;
  2525. // 001DD1C0 <- **call GetFirstChild()**
  2526. // 001DD264 <- **call IsValid()**
  2527. for (auto cNode = cNodePlayer_3C.GetFirstChild("Anim"); cNode.IsValid();
  2528. cNode = cNode.GetNextSibling("Anim")) {
  2529. // 001DD1C6
  2530. int index =
  2531. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2532. .m_iNodeAnimSetLoopIndex_3B0;
  2533. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2534. .m_iNodeAnimSetLoopIndex_3B0 += 1; // 001DD1CE
  2535. // 001DD1E8 <- **字段赋值**
  2536. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2537. .m_tAnim_3B4[index]
  2538. .m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
  2539. // 001DD1FA <- **字段赋值*
  2540. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2541. .m_tAnim_3B4[index]
  2542. .m_iRot_8 = XMLGetInt(cNode, "Rot", NULL, -1);
  2543. // 001DD208 <- **if 代码块起始地址**
  2544. char *pAnimStr = XMLGetString(cNode, "Anim", NULL, 0);
  2545. if (pAnimStr) {
  2546. // 001DD20A
  2547. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2548. .m_tAnim_3B4[index]
  2549. .m_iAnimID_4 = CAnimManager::GetAnimID(pAnimStr);
  2550. if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2551. .m_tAnim_3B4[index]
  2552. .m_iAnimID_4 == -1) {
  2553. // 001DD216
  2554. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2555. .m_iNodeAnimSetLoopIndex_3B0--; // 001DD21C
  2556. // 001DD220 <- **该地址出现赋值0操作**
  2557. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2558. .m_tAnim_3B4[index]
  2559. .m_iAnimID_4 = 0;
  2560. }
  2561. } else {
  2562. // 001DD250
  2563. tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
  2564. .m_iNodeAnimSetLoopIndex_3B0--; // 001DD252
  2565. }
  2566. }
  2567. cNodePlayer_3C = cNodePlayer_3C.GetNextSibling("Player"); // 001DD274
  2568. iPlayerNO_r10++; // 001DD282 <- **计数器加一**
  2569. }
  2570. // 001DD2A0 <- **字段赋值**
  2571. tFreeGoal_r0->m_iTeamPlayerIndex_14[iTeamNO_r3] = iPlayerNO_r10;
  2572. // 001DD2AC <- **结构体赋值**
  2573. tPoint_98 = TPoint(0xA0000, 0xA0000);
  2574. // 001DD2B4 <- **call XMLGetPos()**
  2575. tPoint_34 = XMLGetPos(cNodeTeam_40, "MoveInfluence", NULL, tPoint_98);
  2576. // 001DD2C6 <-**结构体比较**
  2577. // if
  2578. // (tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0
  2579. // != tPoint_34) {
  2580. // // 001DD2CA OK
  2581. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2582. .m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0;
  2583. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2584. .m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4;
  2585. // } else {
  2586. // // 001DD2DA OK
  2587. // tPoint_34.dy_4 =
  2588. // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4;
  2589. // }
  2590. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2591. .m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD2EE
  2592. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2593. .m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD2FA
  2594. // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dx_0
  2595. // = tPoint_34.dx_0 / 0x8000; // 001DD2EE
  2596. // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4
  2597. // = tPoint_34.dy_4 / 0x8000; // 001DD2FA
  2598. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2599. .m_iMoveInfluenceDelayMin_8 =
  2600. XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMin", 0, 10); // 001DD30E
  2601. tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
  2602. .m_iMoveInfluenceDelayMax_C =
  2603. XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMax", 0, 25); // 001DD324
  2604. }
  2605. }
  2606. // 001DD338
  2607. FREE_SortPlayers(tFreeGoal_r0);
  2608. }
  2609. //-------------------------------------------------------------------------------------------------
  2610. // 00169A80 ^_-
  2611. //单元测试等级: 游戏运行正常
  2612. //单元测试内容: 1-10关
  2613. //单元测试结果: 正常
  2614. void PhysicsTest() {
  2615. LOGE("PhysicsTest_0"); // OK
  2616. fpointQ<PointType_18> fpointq_sp240;
  2617. fpointq_sp240.field_0 = 0;
  2618. fpointq_sp240.field_4 = 0;
  2619. fpointq_sp240.field_8 = 0;
  2620. fpointq_sp240.field_C = 0x40000;
  2621. fpoint3<PointType_18> fpoint3_sp25c;
  2622. fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
  2623. fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
  2624. fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
  2625. CFTTPObject *r6_pobject = new CFTTPObject(
  2626. EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
  2627. r6_pobject->fpoint3_1C.x_0 =
  2628. -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
  2629. r6_pobject->fpoint3_1C.y_4 =
  2630. (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
  2631. r6_pobject->fpoint3_1C.z_8 =
  2632. (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
  2633. r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
  2634. r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
  2635. r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
  2636. r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
  2637. r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
  2638. r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
  2639. r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
  2640. r6_pobject->field_34 = 0x94D65;
  2641. r6_pobject->field_38 = 0x37D2A4D;
  2642. fpoint<PointType_18> fpoint_sp23c;
  2643. fpoint3<PointType_18> fpoint3_sp230;
  2644. fpointQ<PointType_18> fpointQ_sp220;
  2645. fpointQ_sp220.field_0 = 0;
  2646. fpointQ_sp220.field_4 = 0;
  2647. fpointQ_sp220.field_8 = 0;
  2648. fpointQ_sp220.field_C = 0x40000;
  2649. fpoint3_sp230.x_0 = 0;
  2650. fpoint3_sp230.y_4 = 0;
  2651. fpoint3_sp230.z_8 = 0;
  2652. fpoint_sp23c.var_0 = 0x8000;
  2653. // check 传参是否都是用了栈
  2654. CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
  2655. fpointQ_sp220); //这里头文件更新
  2656. // 00169B60
  2657. r6_pobject->field_3C = 0x8000;
  2658. r0_psphere->field_64 = 0x8000;
  2659. r6_pobject->field_44 = 0x10000;
  2660. r6_pobject->field_40 = 0x40000;
  2661. r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
  2662. r0_psphere->filed_4 = r6_pobject;
  2663. // sp1c=r6_pobject
  2664. CFTTPhysics physics_sp218(0x40);
  2665. fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
  2666. // 00169B98
  2667. pfpoint3_sp34[14].z_8 = 0;
  2668. pfpoint3_sp34[15].x_0 = 0;
  2669. pfpoint3_sp34[15].y_4 = 0;
  2670. pfpoint3_sp34[15].z_8 = 0;
  2671. pfpoint3_sp34[13].z_8 = 0;
  2672. pfpoint3_sp34[14].x_0 = 0;
  2673. pfpoint3_sp34[14].y_4 = 0;
  2674. pfpoint3_sp34[14].z_8 = 0;
  2675. pfpoint3_sp34[12].y_4 = 0;
  2676. pfpoint3_sp34[12].z_8 = 0;
  2677. pfpoint3_sp34[13].x_0 = 0;
  2678. pfpoint3_sp34[13].y_4 = 0;
  2679. // 00169C06
  2680. pfpoint3_sp34[11].x_0 = 0;
  2681. pfpoint3_sp34[11].y_4 = 0;
  2682. pfpoint3_sp34[11].z_8 = 0;
  2683. pfpoint3_sp34[12].x_0 = 0;
  2684. // 00169C16
  2685. pfpoint3_sp34[1].y_4 = 0x20000;
  2686. pfpoint3_sp34[2].z_8 = 0x3333;
  2687. pfpoint3_sp34[2].x_0 = 0x18000;
  2688. pfpoint3_sp34[2].y_4 = 0x6AAAA;
  2689. // 00169C2C
  2690. pfpoint3_sp34[2].z_8 = 0x3333;
  2691. pfpoint3_sp34[3].x_0 = 0x10000;
  2692. pfpoint3_sp34[3].y_4 = 0x72AAA;
  2693. pfpoint3_sp34[3].z_8 = 0x3333;
  2694. // 00169C34
  2695. pfpoint3_sp34[4].x_0 = 0xFFFF0000;
  2696. pfpoint3_sp34[4].y_4 = 0x72AAA;
  2697. pfpoint3_sp34[4].z_8 = 0x3333;
  2698. pfpoint3_sp34[4].x_0 = 0xFFFE8000;
  2699. // 00169C3C
  2700. pfpoint3_sp34[4].y_4 = 0x6AAAA;
  2701. pfpoint3_sp34[4].z_8 = 0x3333;
  2702. pfpoint3_sp34[5].x_0 = 0xFFFE8000;
  2703. pfpoint3_sp34[5].y_4 = 0x20000;
  2704. // 00169C44
  2705. pfpoint3_sp34[5].z_8 = 0x3333;
  2706. pfpoint3_sp34[6].x_0 = 0xFFFF0000;
  2707. pfpoint3_sp34[6].y_4 = 0;
  2708. pfpoint3_sp34[6].z_8 = 0x3333;
  2709. // 00169C4C
  2710. pfpoint3_sp34[7].x_0 = 0x10000;
  2711. pfpoint3_sp34[7].y_4 = 0;
  2712. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  2713. pfpoint3_sp34[7].x_0 = 0x18000;
  2714. // 00169C5A
  2715. pfpoint3_sp34[7].y_4 = 0x20000;
  2716. pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
  2717. pfpoint3_sp34[8].x_0 = 0x18000;
  2718. pfpoint3_sp34[8].y_4 = 0x6AAAA;
  2719. // 00169C60
  2720. pfpoint3_sp34[0].x_0 = 0x10000;
  2721. pfpoint3_sp34[0].y_4 = 0;
  2722. pfpoint3_sp34[0].z_8 = 0x3333;
  2723. pfpoint3_sp34[1].x_0 = 0x18000;
  2724. // 00169C68
  2725. pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
  2726. pfpoint3_sp34[15].x_0 = 0xFFFF0000;
  2727. pfpoint3_sp34[15].y_4 = 0;
  2728. pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
  2729. // 00169C6C
  2730. pfpoint3_sp34[13].y_4 = 0x6AAAA;
  2731. pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
  2732. pfpoint3_sp34[14].x_0 = 0xFFFE8000;
  2733. pfpoint3_sp34[14].y_4 = 0x20000;
  2734. // 00169C74
  2735. pfpoint3_sp34[12].x_0 = 0xFFFF0000;
  2736. pfpoint3_sp34[12].y_4 = 0x72AAA;
  2737. pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
  2738. pfpoint3_sp34[13].x_0 = 0xFFFE8000;
  2739. // 00169C7C
  2740. pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
  2741. pfpoint3_sp34[11].x_0 = 0x10000;
  2742. pfpoint3_sp34[11].y_4 = 0x72AAA;
  2743. pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
  2744. // sp48=FREE_tInfo
  2745. if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
  2746. // 00169C90
  2747. // loc_16A21E
  2748. LOGE("PhysicsTest_case");
  2749. for (int r2_i = 0;
  2750. r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
  2751. r2_i++) {
  2752. // loc_169CC0
  2753. switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2754. .m_iType_C) {
  2755. case 0: // loc_169EC0
  2756. {
  2757. // check 手机左移
  2758. // sp4c = r2
  2759. // check 运算
  2760. LOGE("PhysicsTest_case_0");
  2761. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2762. .m_iRot_10 *
  2763. 0x40000 / 0xB4;
  2764. uint64 r3r1_ull = 0x3243F4000;
  2765. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  2766. int r4_i = r1r0_ll / 2;
  2767. int i_sp1b0;
  2768. int i_sp214 = r4_i;
  2769. sub_16A57C(i_sp1b0, i_sp214);
  2770. sub_16A6CC(i_sp214, r4_i);
  2771. fpoint3<PointType_18> fpoint3_spc0;
  2772. fpointQ<PointType_18> fpointQ_spb0;
  2773. // check 乘法
  2774. fpoint3_spc0.x_0 =
  2775. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2776. .m_tPoint3D_0.point_0.dx_0 *
  2777. 8;
  2778. fpoint3_spc0.y_4 =
  2779. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2780. .m_tPoint3D_0.dz_8 *
  2781. 8;
  2782. fpoint3_spc0.z_8 =
  2783. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2784. .m_tPoint3D_0.point_0.dy_4 *
  2785. 8;
  2786. fpointQ_spb0.field_0 = 0;
  2787. fpointQ_spb0.field_4 = i_sp1b0;
  2788. fpointQ_spb0.field_8 = 0;
  2789. fpointQ_spb0.field_C = i_sp214;
  2790. CFTTPObject *r4_pobject = new CFTTPObject(
  2791. EPhysicsObjectType_2,
  2792. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2793. .m_iType_C,
  2794. 2, fpoint3_spc0, fpointQ_spb0);
  2795. // 00169F5C
  2796. r4_pobject->field_34 = 0;
  2797. r4_pobject->field_38 = 0;
  2798. r4_pobject->field_3C = 0x40000;
  2799. r4_pobject->field_40 = 0x4000; // dword_16A448
  2800. r4_pobject->field_44 = 0x20000;
  2801. fpoint<PointType_18> fpoint_spac;
  2802. fpoint<PointType_18> fpoint_spa8;
  2803. fpoint<PointType_18> fpoint_spa4;
  2804. fpoint3<PointType_18> fpoint3_sp98;
  2805. fpointQ<PointType_18> fpointQ_sp80;
  2806. fpoint3_sp98.x_0 = 0;
  2807. fpoint_spac.var_0 = 0x3333;
  2808. fpoint_spa8.var_0 = 0x6666;
  2809. fpoint_spa4.var_0 = 0x15555;
  2810. fpointQ_sp80.field_0 = 0;
  2811. fpointQ_sp80.field_4 = 0;
  2812. fpointQ_sp80.field_8 = 0;
  2813. fpointQ_sp80.field_C = 0x40000;
  2814. fpoint3_sp98.y_4 = 0xEAAA;
  2815. fpoint3_sp98.z_8 = 0;
  2816. // fpointQ_sp80
  2817. CFTTPPCone *r5_pcone =
  2818. new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
  2819. fpoint3_sp98, fpointQ_sp80);
  2820. fpoint3<PointType_18> fpoint3_sp74;
  2821. fpoint3<PointType_18> fpoint3_sp68;
  2822. fpointQ<PointType_18> fpointQ_sp50;
  2823. fpoint3_sp74.x_0 = 0xCCCC;
  2824. fpointQ_sp50.field_0 = 0;
  2825. fpointQ_sp50.field_4 = 0;
  2826. fpointQ_sp50.field_8 = 0;
  2827. fpointQ_sp50.field_C = 0x40000;
  2828. fpoint3_sp74.y_4 = 0x4000;
  2829. fpoint3_sp74.z_8 = 0xCCCC;
  2830. fpoint3_sp68.x_0 = 0;
  2831. fpoint3_sp68.y_4 = 0x2000;
  2832. fpoint3_sp68.z_8 = 0;
  2833. CFTTPPBox *r0_pbox =
  2834. new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
  2835. r5_pcone->field_64 = 0x15555;
  2836. r0_pbox->field_64 = 0xCCCC;
  2837. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
  2838. r0_pbox->filed_4 = r4_pobject;
  2839. r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
  2840. r5_pcone->filed_4 = r4_pobject;
  2841. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  2842. r4_pobject;
  2843. break;
  2844. }
  2845. case 2: // loc_16A030
  2846. {
  2847. LOGE("PhysicsTest_case_2");
  2848. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2849. .m_iRot_10 *
  2850. 0x40000 / 0xB4;
  2851. uint64 r3r1_ull = 0x3243F4000;
  2852. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  2853. int r4_i = r1r0_ll / 2;
  2854. int i_sp214;
  2855. int i_sp1b0 = r4_i;
  2856. sub_16A57C(i_sp214, i_sp1b0);
  2857. int i_sp210;
  2858. i_sp1b0 = r4_i;
  2859. sub_16A6CC(i_sp210, i_sp1b0);
  2860. // sp40=i_sp210
  2861. // sp3c=sp214
  2862. fpoint3<PointType_18> fpoint3_sp154;
  2863. fpoint3<PointType_18> fpoint3_sp148;
  2864. fpointQ<PointType_18> fpointQ_sp138;
  2865. fpointQ<PointType_18> fpointQ_sp1b0;
  2866. fpoint3_sp154.x_0 = 0x70000;
  2867. fpoint3_sp154.y_4 = 0x20000;
  2868. fpoint3_sp154.z_8 = 0x6666;
  2869. fpointQ_sp1b0.field_0 = 0x3333;
  2870. fpointQ_sp1b0.field_4 = 0;
  2871. fpointQ_sp1b0.field_8 = 0;
  2872. fpointQ_sp1b0.field_C = 0x40000;
  2873. sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
  2874. CFTTPPBox *pbox_sp38 =
  2875. new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
  2876. // 0016A0DC
  2877. pbox_sp38->field_64 = 0x70000;
  2878. fpoint3<PointType_18> fpoint3_sp12c;
  2879. fpoint3<PointType_18> fpoint3_sp120;
  2880. fpointQ<PointType_18> fpointQ_sp110;
  2881. fpoint3_sp120.x_0 = 0xFFFD0000;
  2882. fpoint3_sp12c.x_0 = 0x6666;
  2883. fpoint3_sp12c.y_4 = 0x20000;
  2884. fpoint3_sp12c.z_8 = 0x15555;
  2885. fpoint3_sp120.y_4 = 0x10000;
  2886. fpoint3_sp120.z_8 = 0xAAAA;
  2887. fpointQ_sp1b0.field_0 = 0x3333;
  2888. fpointQ_sp1b0.field_4 = 0;
  2889. fpointQ_sp1b0.field_8 = 0;
  2890. fpointQ_sp1b0.field_C = 0x40000;
  2891. sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
  2892. // 0016A120
  2893. CFTTPPBox *r4_pbox =
  2894. new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
  2895. // 0016A122
  2896. fpoint3<PointType_18> fpoint3_sp104;
  2897. fpoint3<PointType_18> fpoint3_spf8;
  2898. fpointQ<PointType_18> fpointQ_spe8;
  2899. fpoint3_sp104.x_0 = 0x6666;
  2900. fpoint3_sp104.y_4 = 0x20000;
  2901. fpoint3_sp104.z_8 = 0x15555;
  2902. fpoint3_spf8.x_0 = 0x30000;
  2903. fpoint3_spf8.y_4 = 0x10000;
  2904. fpoint3_spf8.z_8 = 0xAAAA;
  2905. fpointQ_sp1b0.field_0 = 0x3333;
  2906. fpointQ_sp1b0.field_4 = 0;
  2907. fpointQ_sp1b0.field_8 = 0;
  2908. fpointQ_sp1b0.field_C = 0x40000;
  2909. sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
  2910. // 0016A164
  2911. CFTTPPBox *r6_pbox =
  2912. new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
  2913. // 0016A166
  2914. r4_pbox->field_64 = 0x15555;
  2915. r6_pbox->field_64 = 0x15555;
  2916. fpoint3<PointType_18> fpoint3_spdc;
  2917. fpointQ<PointType_18> fpointQ_spcc;
  2918. fpointQ_spcc.field_4 = i_sp214;
  2919. fpointQ_spcc.field_C = i_sp210;
  2920. fpoint3_spdc.x_0 =
  2921. -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2922. .m_tPoint3D_0.point_0.dx_0 *
  2923. 8;
  2924. fpoint3_spdc.z_8 =
  2925. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2926. .m_tPoint3D_0.point_0.dy_4 *
  2927. 8;
  2928. fpoint3_spdc.y_4 =
  2929. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2930. .m_tPoint3D_0.dz_8 *
  2931. 8;
  2932. fpointQ_spcc.field_0 = 0;
  2933. fpointQ_spcc.field_8 = 0;
  2934. CFTTPObject *r0_pobject = new CFTTPObject(
  2935. EPhysicsObjectType_2,
  2936. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2937. .m_iType_C,
  2938. 3, fpoint3_spdc, fpointQ_spcc);
  2939. // 0016A1B0
  2940. r0_pobject->field_34 = 0;
  2941. r0_pobject->field_38 = 0;
  2942. r0_pobject->field_3C = 0x70000;
  2943. r0_pobject->field_40 = 0x30000;
  2944. r0_pobject->field_44 = 0x4000;
  2945. r0_pobject->field_A0 = 0x18;
  2946. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
  2947. pbox_sp38->filed_4 = r0_pobject;
  2948. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
  2949. r4_pbox->filed_4 = r0_pobject;
  2950. r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
  2951. r6_pbox->filed_4 = r0_pobject;
  2952. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  2953. r0_pobject;
  2954. break;
  2955. }
  2956. case 1: // 00169CDA
  2957. {
  2958. // sp4c = r2
  2959. // check 运算
  2960. LOGE("PhysicsTest_case_1");
  2961. int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2962. .m_iRot_10 *
  2963. 0x40000 / 0xB4;
  2964. uint64 r3r1_ull = 0x3243F4000;
  2965. long long r1r0_ll = r3r1_ull * r0_i >> 32;
  2966. int r4_i = r1r0_ll / 2;
  2967. int i_sp214;
  2968. int i_sp210;
  2969. sub_16A57C(i_sp214, r4_i);
  2970. sub_16A6CC(i_sp210, r4_i);
  2971. fpoint3<PointType_18> fpoint3_sp204;
  2972. fpointQ<PointType_18> fpointQ_sp1f4;
  2973. fpointQ_sp1f4.field_0 = 0;
  2974. fpointQ_sp1f4.field_4 = i_sp214;
  2975. fpointQ_sp1f4.field_8 = 0;
  2976. fpointQ_sp1f4.field_C = i_sp210;
  2977. TPoint3D point3D =
  2978. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2979. .m_tPoint3D_0;
  2980. fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
  2981. fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
  2982. fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
  2983. CFTTPObject *r11_pobject = new CFTTPObject(
  2984. EPhysicsObjectType_2,
  2985. FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
  2986. .m_iType_C,
  2987. 3, fpoint3_sp204, fpointQ_sp1f4);
  2988. int i_sp1b0;
  2989. int i_sp1f0 = 0x7F1AA;
  2990. sub_16A818(&i_sp1b0, &i_sp1f0);
  2991. r11_pobject->field_34 = 0;
  2992. r11_pobject->field_38 = 0;
  2993. r11_pobject->field_3C = i_sp1b0;
  2994. r11_pobject->field_40 = 0x10000;
  2995. r11_pobject->field_44 = 0x10000;
  2996. r11_pobject->field_A0 = 0x18;
  2997. fpoint<PointType_18> fpoint_sp1ec;
  2998. fpoint<PointType_18> fpoint_sp1e8;
  2999. fpoint3<PointType_18> fpoint3_sp1dc;
  3000. fpointQ<PointType_18> fpointQ_sp1cc;
  3001. fpoint_sp1ec.var_0 = 0x10000;
  3002. fpoint3_sp1dc.x_0 = 0;
  3003. fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
  3004. fpoint3_sp1dc.z_8 = 0;
  3005. fpoint_sp1e8.var_0 = 0x6666;
  3006. fpointQ<PointType_18> fpointQ_sp1b0;
  3007. fpointQ_sp1b0.field_0 = 0x40000;
  3008. fpointQ_sp1b0.field_4 = 0;
  3009. fpointQ_sp1b0.field_8 = 0;
  3010. fpointQ_sp1b0.field_C = 0x40000;
  3011. sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
  3012. // check 前俩个参数传递是否使用栈
  3013. CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
  3014. fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
  3015. fpoint3<PointType_18> fpoint3_sp1a4;
  3016. fpoint3<PointType_18> fpoint3_sp198;
  3017. fpointQ<PointType_18> fpointQ_sp180;
  3018. fpoint3_sp1a4.z_8 = 0x6666;
  3019. // 00169DF4
  3020. fpointQ_sp180.field_0 = 0;
  3021. fpointQ_sp180.field_4 = 0;
  3022. fpointQ_sp180.field_8 = 0;
  3023. fpointQ_sp180.field_C = 0x40000;
  3024. fpoint3_sp1a4.x_0 = 0x20000;
  3025. fpoint3_sp1a4.y_4 = 0x20000;
  3026. fpoint3_sp198.x_0 = 0;
  3027. fpoint3_sp198.y_4 = 0xFFFB6AAB;
  3028. fpoint3_sp198.z_8 = 0;
  3029. CFTTPPBox *r5_pbox =
  3030. new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
  3031. // 00169E14
  3032. fpoint3<PointType_18> fpoint3_sp174;
  3033. fpointQ<PointType_18> fpointQ_sp160;
  3034. fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
  3035. fpoint3_sp174.x_0 = 0;
  3036. fpoint3_sp174.z_8 = 0;
  3037. fpointQ_sp160.field_0 = 0;
  3038. fpointQ_sp160.field_4 = 0;
  3039. fpointQ_sp160.field_8 = 0;
  3040. fpointQ_sp160.field_C = 0x40000;
  3041. CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
  3042. pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
  3043. // 00169E32
  3044. r4_pcylinder->field_64 = 0x10000;
  3045. r5_pbox->field_64 = 0x20000;
  3046. r0_ppolyhedron->field_64 = 0xABFFF;
  3047. // 00169E42
  3048. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
  3049. r5_pbox->filed_4 = r11_pobject;
  3050. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
  3051. r0_ppolyhedron->filed_4 = r11_pobject;
  3052. r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
  3053. r4_pcylinder->filed_4 = r11_pobject;
  3054. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
  3055. r11_pobject;
  3056. break;
  3057. }
  3058. }
  3059. }
  3060. }
  3061. // loc_16A232
  3062. physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
  3063. if (physics_sp218.Process()) {
  3064. // 0016A24E
  3065. // sp18=cBall
  3066. LOGE("PhysicsTest_1");
  3067. cBall.ballPosPrev_4.point_0.dx_0 =
  3068. r6_pobject->fpoint3_0.x_0 /
  3069. (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
  3070. cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
  3071. cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
  3072. cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
  3073. cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
  3074. cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
  3075. fpointQ<PointType_18> fpointQ_sp1b0;
  3076. sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
  3077. // check 除法
  3078. // 0016A2AA
  3079. cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
  3080. cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
  3081. cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
  3082. cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
  3083. // check
  3084. cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
  3085. cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
  3086. cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
  3087. // loc_16A344
  3088. for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
  3089. // loc_16A30C
  3090. if (physics_sp218.ppobject_0[r5_i]->field_9E) {
  3091. if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
  3092. if (FREE_tInfo.filed_0.gamestatus_1828 <= 8) {
  3093. // check
  3094. if ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) {
  3095. LOGE("PhysicsTest_2");
  3096. tGame.field_6C98 = 0;
  3097. tGame.mTLogic_6678.freeproptype_74 =
  3098. physics_sp218.ppobject_0[r5_i]->field_90;
  3099. }
  3100. }
  3101. }
  3102. }
  3103. }
  3104. }
  3105. // loc_16A348
  3106. delete[] pfpoint3_sp34;
  3107. }
  3108. //-------------------------------------------------------------------------------------------------