12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269 |
- #include "FREE.h"
- #include "CBall.h"
- #include "CBallProj.h"
- #include "CFTTPObject.h"
- #include "CFTTPPBox.h"
- #include "CFTTPPCone.h"
- #include "CFTTPPCylinder.h"
- #include "CFTTPPPolyhedron.h"
- #include "CFTTPPSphere.h"
- #include "CFTTPhysics.h"
- #include "CFreeHUD.h"
- #include "CGameLoop.h"
- #include "CModelManager.h"
- #include "COMM.h"
- #include "CPlayerManager.h"
- #include "CStoryCore.h"
- #include "CStoryHUD.h"
- #include "GFXCAMERA.h"
- #include "GFXNET.h"
- #include "GL.h"
- #include "GM.h"
- #include "GU.h"
- #include "LOCstring.h"
- #include "SNDGAME.h"
- #include "XCTRL.h"
- #include "XML.h"
- #include "XSYS.h"
- #include "fpoint.h"
- #include "memctrl.h"
- #include "sub.h"
- int s_iEVFStrings[160] = {
- 0x184B, 0x184C, 0x1858, 0, 0, 0, 0, 0, 0, 0,
- 0x1859, 0x185A, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x1854, 0x1855, 0x1856, 0, 0, 0, 0, 0, 0, 0,
- 0x184F, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x1850, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x184E, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x186B, 0x186C, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x184D, 0x1851, 0x1852, 0x1853, 0x1857, 0x186A, 0, 0, 0, 0,
- 0x185B, 0x185C, 0x185D, 0x185E, 0x1864, 0x1869, 0, 0, 0, 0,
- 0x1860, 0x1861, 0x1862, 0x1865, 0x1866, 0, 0, 0, 0, 0,
- 0x1863, 0x1868, 0x1867, 0x185F, 0, 0, 0, 0, 0, 0,
- 0x1867, 0x1861, 0x1859, 0x185A, 0, 0, 0, 0, 0, 0,
- 0xFB, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x1878, 0x1879, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x1876, 0x1877, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x186D, 0x186E, 0x186F, 0x1870, 0x1871, 0x1873, 0x1874, 0x1875, 0x1872, 0};
- // FREE_tInfo 0x1D20
- // FREE_tGoal 0x7634
- int FREE_iTeam;
- TFreeGoal FREE_tGoal;
- TFreeInfo FREE_tInfo;
- CFTTModel *FREE_pStarModel;
- int FREE_iPropWeather;
- const char *s_sPropModels_SNOW[3] = {
- "PKG:/data/env/dressing/cone_snow.ftm",
- "PKG:/data/env/dressing/mannequin_snow.ftm",
- "PKG:/data/env/dressing/rebounder.ftm"};
- CFTTModel *FREE_pPropModel[3];
- const char *s_sPropModels[3] = {"PKG:/data/env/dressing/cone.ftm",
- "PKG:/data/env/dressing/mannequin.ftm",
- "PKG:/data/env/dressing/rebounder.ftm"};
- const char *s_sPropModels_Shadow[3] = {"PKG:/data/env/dressing/cone.ftm",
- "PKG:/data/env/dressing/mannequin_s.ftm",
- "PKG:/data/env/dressing/rebounder.ftm"};
- CFTTModel *FREE_pPropModelShadow[3];
- //-------------------------------------------------------------------------------------------------
- // 001D2758
- int FREE_GetLevelFilename(char *, int, char *, bool &) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001D27EC
- void FREE_GetWorldRot(TPoint, TPoint) {}
- //-------------------------------------------------------------------------------------------------
- // 001D281C
- void FREE_CalcKickAngle(TPoint3D *, TPoint3D, TPoint3D, int, int, int *) {}
- //-------------------------------------------------------------------------------------------------
- // 001D2A98
- int FREE_PassCheckPath(CPlayer *, TPoint, TPoint) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001D2BC0
- void FREE_ResolveEndPoint(TPoint3D *a1, TPoint3D *a2, TPoint *a3, int *a4,
- bool a5) {
- LOGE("FREE_ResolveEndPoint%p%p%p%p%d", a1, a2, a3, a4, a5);
- }
- //-------------------------------------------------------------------------------------------------
- // 001D30B8
- void FREE_GetKickPower(EAnimID a1, int *a2, int *a3) {
- LOGE("FREE_GetKickPower%d%p%p", a1, a2, a3);
- }
- //-------------------------------------------------------------------------------------------------
- // 001D30FC
- uint64 g_count = 0;
- FILE *g_fpsave = fopen("/data/local/tmp/savedata.txt", "r");
- void FREE_ProcessControls(bool b_0) {
- // 001D3110
- g_count++;
- if (FREE_iTeam != 0) return;
- // 001D311C
- TPoint tPoint_var2C = XCTRL_TouchGetPos(0);
- if (g_fpsave == NULL) LOGE("/data/local/tmp/savedata.txt open error");
- // fprintf(g_fpsave, "%d %d %d\n", g_count, tPoint_var2C.dx_0,
- // tPoint_var2C.dy_4);
- // fflush(g_fpsave);
- char buf[0x100] = {0};
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d %d", &g_count, &tPoint_var2C.dx_0, &tPoint_var2C.dy_4);
- // 001D312C
- if (FREE_tInfo.filed_0.b_C) return;
- //
- if ((FREE_tInfo.filed_0.gamestatus_1828 | 1) != 9) return;
- // 001D3150 && 001D3156 && 001D3158
- if (CStoryCore::m_tStageManager.m_p_5CF0 &&
- CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 != 0 &&
- CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 < 3) {
- // 无内容
- LOGE("FREE_ProcessControls_1");
- } else {
- LOGE("FREE_ProcessControls_2");
- bool bA_R0 = true;
- bool bB_R6 = true;
- if (CStoryCore::m_tStageManager.m_p_5CF0 &&
- CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 == 3 &&
- CFreeHUD::ms_pAnimations) { // 001D316C
- LOGE("FREE_ProcessControls_3");
- bB_R6 = !CFreeHUD::ms_pAnimations->m_b_B;
- bA_R0 = !CFreeHUD::ms_pAnimations->m_b_A;
- } // 001D3182
- // 001D3182 && 001D318E && 001D319A && 001D31A2(001D319E)
- if (bA_R0 && FREE_tInfo.field_188C.cBuff_3DC.b_18 == 0 &&
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 0) { // 001D31A6
- // 001D31AC || 001D31B4
- int count = XCTRL_TouchGetCount();
- // fprintf(g_fpsave, "%d\n", count);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d", &count);
- if (count == 2) {
- bool isPressed0 = XCTRL_TouchIsPressed(0);
- bool isPressed1 = XCTRL_TouchIsPressed(0);
- // fprintf(g_fpsave, "%d %d\n", isPressed0, isPressed1);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d", &isPressed0, &isPressed1);
- if (isPressed0 || isPressed1) { // 001D31B6
- FREE_tInfo.field_188C.field_40C = FREE_tInfo.field_188C.field_408;
- } // 001D31C6
- TPoint tPoint_var40[2]; // R6 R9
- TPoint tPoint_var50[2]; // R4 R8
- // 001D3206 001D31D0
- for (int i_R5 = 0; i_R5 < 2; i_R5++) { // 001D31D8
- // 001D31DC
- LOGE("FREE_ProcessControls_6");
- TPoint temp = XCTRL_TouchGetDownPos(i_R5);
- // fprintf(g_fpsave, "%d %d\n", temp.dx_0, temp.dy_4);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d", &temp.dx_0, &temp.dy_4);
- tPoint_var40[i_R5].copy(temp);
- // 001D31F0
- temp = XCTRL_TouchGetDownPos(i_R5);
- // fprintf(g_fpsave, "%d %d\n", temp.dx_0, temp.dy_4);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d", &temp.dx_0, &temp.dy_4);
- tPoint_var50[i_R5].copy(temp);
- } // 001D320A
- // 001D3210 001D321C
- int iDis_R0 = XMATH_Distance(&tPoint_var40[0], &tPoint_var40[1]) -
- XMATH_Distance(&tPoint_var50[0], &tPoint_var50[1]);
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- FREE_tInfo.field_188C.field_408 =
- FREE_tInfo.field_188C.field_40C + iDis_R0 / 2;
- return;
- }
- } // 001D36A4
- // 001D3252 && 001D325C
- else if (bB_R6) { // 001D3260
- bool isTouch = XCTRL_TouchIsTouching(0);
- // fprintf(g_fpsave, "%d\n", isTouch);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d", &isTouch);
- if (isTouch) {
- TPoint tPoint_var40;
- // 001D326E
- GFXCAMERA_GameToScreen(&tPoint_var40, &cBall.ballPosPrev_4);
- // 001D3278
- TPoint tPoint_var50 = XCTRL_TouchGetDownPos(0);
- // 001D3284(001D3280) && 001D3290 && 001D329C
- if ((int)XMATH_Distance(&tPoint_var40, &tPoint_var50) >= 0x61 &&
- !FREE_tInfo.field_188C.cBuff_3DC.b_19 &&
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 0) { // 001D32A0
- if ((abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >= 0x10 &&
- abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >
- abs(tPoint_var2C.dy_4 - tPoint_var50.dy_4)) ||
- FREE_tInfo.field_188C.cBuff_3DC.b_18) {
- // 001D32C6 001D32FE
- if (FREE_tInfo.field_188C.cBuff_3DC.b_18) { // 001D3300
- FREE_tInfo.field_188C.cBuff_3DC.field_1C =
- (tPoint_var2C.dx_0 - FREE_tInfo.field_188C.tPoint_400.dx_0) *
- 8;
- } // 001D3314
- // 001D32C6
- if (abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >= 0x10 &&
- abs(tPoint_var2C.dx_0 - tPoint_var50.dx_0) >
- abs(tPoint_var2C.dy_4 - tPoint_var50.dy_4)) { // 001D32C8
- FREE_tInfo.field_188C.cBuff_3DC.field_20 = tGame.maybe_sound_0;
- // 001D32E0
- FREE_tInfo.field_188C.tPoint_400.copy(tPoint_var2C);
- FREE_tInfo.field_188C.tPoint_400.dx_0 =
- FREE_tInfo.field_188C.tPoint_400.dx_0 -
- FREE_tInfo.field_188C.cBuff_3DC.field_1C / 8;
- } // 001D3314
- // 001D3314
- if (FREE_tInfo.field_188C.cBuff_3DC.field_1C > 0x2000)
- FREE_tInfo.field_188C.cBuff_3DC.field_1C =
- FREE_tInfo.field_188C.cBuff_3DC.field_1C - 0x4000;
- // 001D332C
- FREE_tInfo.field_188C.cBuff_3DC.field_1C = XMATH_Clamp(
- FREE_tInfo.field_188C.cBuff_3DC.field_1C, 0xFFFFFAAB, 0x555);
- FREE_tInfo.field_188C.cBuff_3DC.b_18 = true;
- return;
- } // 001D36A4
- } // 001D3344
- }
- } // 001D3344
- } // 001D3344
- bool b_R6 = false;
- FREE_tInfo.field_188C.cBuff_3DC.b_18 = false;
- FREE_tInfo.field_188C.cBuff_3DC.b_19 = false;
- FREE_tInfo.field_188C.cBuff_3DC.field_20 = 0;
- // 001D3358
- bool bTouchIsReleased_R10 = XCTRL_TouchIsReleased(0);
- // fprintf(g_fpsave, "%d\n", bTouchIsReleased_R10);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d", &bTouchIsReleased_R10);
- // 001D335E
- if (bTouchIsReleased_R10) { // 001D3364
- LOGE("FREE_ProcessControls_8");
- TPoint tPoint_var50;
- TPoint tPoint_var70;
- // 001D336C
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] > 0) b_R6 = true;
- // 001D3376
- else if (CStoryCore::m_tStageManager.tStoryStage_0.t_0
- .PreSelectEnabled_12) { // 001D337C
- // 001D3380
- LOGE("FREE_ProcessControls_9");
- tPoint_var50 = XCTRL_TouchGetDownPos(0);
- // fprintf(g_fpsave, "%d %d\n", tPoint_var50.dx_0, tPoint_var50.dy_4);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d", &tPoint_var50.dx_0, &tPoint_var50.dy_4);
- // 001D3390
- tPoint_var70 = XCTRL_TouchGetPos(0);
- // fprintf(g_fpsave, "%d %d\n", tPoint_var70.dx_0, tPoint_var70.dy_4);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d %d", &tPoint_var70.dx_0, &tPoint_var70.dy_4);
- // 001D33A4 001D33A0
- if ((int)XMATH_Distance(&tPoint_var50, &tPoint_var70) <=
- 0x0F) { // 001D33AA
- int iDis_var88 = 0x7FFFFFFF;
- int iIndex_var84 = -1;
- // 001D34D0 001D33AC
- for (int i_R8 = 0; i_R8 < 11; i_R8++) { // 001D33CA
- // 001D33CE && 001D33E0
- if (i_R8 != FREE_tInfo.filed_0.field_1830 &&
- !FREE_tInfo.filed_0.pFREE_tGoal_1818
- ->m_tTeamPlayerInfo_1C[FREE_iTeam][i_R8]
- .m_bStatic_28) { // 001D33E4
- TPoint3D tPoint3D_var40 =
- tGame.allplay_14[FREE_iTeam].teamlist_0[i_R8]->ballPosPrev_4;
- TPoint tPoint_var80;
- // 001D3408
- GFXCAMERA_GameToScreen(&tPoint_var80, &tPoint3D_var40);
- tPoint3D_var40.dz_8 += 0x10000;
- TPoint tPoint_var58;
- // 001D3418
- GFXCAMERA_GameToScreen(&tPoint_var58, &tPoint3D_var40);
- TPoint tPoint_var60;
- tPoint_var60.dx_0 = (tPoint_var80.dx_0 + tPoint_var58.dx_0) / 2;
- tPoint_var60.dy_4 = (tPoint_var80.dy_4 + tPoint_var58.dy_4) / 2;
- int iDis_R3 = 0x18;
- // 001D3440
- if ((tPoint_var80.dy_4 - tPoint_var58.dy_4) / 2 > 0x18)
- iDis_R3 = (tPoint_var80.dy_4 - tPoint_var58.dy_4) / 2;
- uint iDis_R7 = 0x18;
- // 001D3440
- if (iDis_R3 / 2 > 0x18) iDis_R7 = iDis_R3 / 2;
- // 001D345C && 001D3472 && 001D3478
- if (tPoint_var70.dx_0 >= tPoint_var60.dx_0 - iDis_R7 &&
- tPoint_var70.dx_0 < tPoint_var58.dx_0 + iDis_R7 &&
- tPoint_var70.dy_4 >= tPoint_var60.dy_4 - iDis_R3 &&
- tPoint_var70.dy_4 < tPoint_var60.dy_4 + iDis_R3) { // 001D347C
- // 001D3480
- int iDis_R0 = XMATH_Distance(&tPoint_var60, &tPoint_var70);
- // 001D3488
- if (iDis_var88 > iDis_R0) { // 001D348E
- iIndex_var84 = i_R8;
- iDis_var88 = iDis_R0;
- } // 001D3494
- } // 001D34C4
- } // 001D34C8
- } // 001D34D8
- // 001D34DC
- if (iIndex_var84 >= 0) { // 001D34E2
- // 001D34E8 && 001D34EE
- if (CStoryCore::m_tStageManager.m_p_5CF0 &&
- CStoryCore::m_tStageManager.m_p_5CF0->TutorialType_CrowdSFX_2e8 ==
- 5) { // 001D34F2
- // 001D3500
- if (iIndex_var84 == FREE_tInfo.filed_0.pFREE_tGoal_1818
- ->m_iUserPlayer_7458) { // 001D3504
- FREE_tInfo.filed_0.gamestatus_1828 = 8;
- FREE_tInfo.filed_0.field_1844 = iIndex_var84;
- // 001D3516
- CFreeHUD::ShutdownAnimation();
- // 001D351C
- CFreeHUD::InitTutorial(EStoryTutorial_1);
- } // 001D353C
- } // 001D353C
- else { // 001D3522
- // 001D352A
- if (FREE_tInfo.filed_0.field_1844 == iIndex_var84)
- FREE_tInfo.filed_0.field_1844 = -1;
- else
- FREE_tInfo.filed_0.field_1844 = iIndex_var84;
- } // 001D353C
- } // 001D353C
- } // 001D353C
- b_R6 = false;
- } // 001D353E
- else
- b_R6 = false;
- } // 001D353E
- // 001D353E
- if (b_0) {
- LOGE("FREE_ProcessControls_10");
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- return;
- }
- // bool b_R4 = true;
- { // 001D3544
- // 001D3544
- if (!bTouchIsReleased_R10) { // 001D354A
- // 001D3550 && 001D355A
- bool isPressed = XCTRL_TouchIsPressed(0);
- // fprintf(g_fpsave, "%d\n", isPressed);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d", &isPressed);
- if (isPressed && FREE_tInfo.filed_0.gamestatus_1828 == 8) { // 001D355E
- TPoint tPoint_var40;
- // 001D356A
- GFXCAMERA_GameToScreen(&tPoint_var40, &cBall.ballPosPrev_4);
- // 001D3574
- if ((int)XMATH_Distance(&tPoint_var2C, &tPoint_var40) <=
- 0x5F) { // 001D357C
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = tGame.maybe_sound_0;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 1;
- FREE_tInfo.field_188C.PointArr_1C[0].copy(tPoint_var2C);
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] = 0;
- // 001D35BC
- CGFXFX::SwipeReset();
- // 001D35C4
- CGFXFX::SwipeAddPoint(tPoint_var2C);
- } // 001D362C
- } // 001D362C
- else { // 001D35CA
- // b_R4 = false;
- // 001D35D2 && 001D35DC && 001D35E8
- bool isTouch = XCTRL_TouchIsTouching(0);
- // fprintf(g_fpsave, "%d\n", isTouch);
- // fflush(g_fpsave);
- memset(buf, 0, sizeof(buf));
- fgets(buf, 0x100, g_fpsave);
- LOGE("%s",buf);
- sscanf(buf, "%d", &isTouch);
- if (isTouch && FREE_tInfo.field_188C.field_4.field_2 == 0 &&
- (uint)(FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1) <=
- 0x58) { // 001D35EC
- // 001D35EC && 001D3600
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] == 1 &&
- (int)XMATH_Distance(&tPoint_var2C,
- &FREE_tInfo.field_188C.PointArr_1C[0]) <
- 0x20) { // 001D3606
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = tGame.maybe_sound_0;
- } // 001D362C
- else { // 001D3804
- // 001D3804 && 001D3818
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >= 6 &&
- (int)XMATH_Distance(
- &tPoint_var2C,
- &FREE_tInfo.field_188C.PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 6]) <
- 4) { // 001D381C
- b_R6 = true;
- } // 001D362C
- else { // 001D3820
- TPoint3D tPoint3D_var40;
- // 001D382C
- GFXCAMERA_ScreenToGame(&tPoint3D_var40, &tPoint_var2C, 0x10000);
- // 001D3838 && 001D3846
- if (abs(tPoint3D_var40.point_0.dx_0) > 0x178000 ||
- abs(tPoint3D_var40.point_0.dy_4) > 0x208000) { // 001D384C
- int iX_R7 =
- FREE_tInfo.field_188C
- .PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 2]
- .dx_0;
- int iY_R5 =
- FREE_tInfo.field_188C
- .PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 2]
- .dx_0;
- // 001D3870 001D385E
- for (int i_R4 = 0; i_R4 <= 9; i_R4++) { // 001D3874
- TPoint tPoint_var50;
- tPoint_var50.dx_0 = (tPoint_var2C.dx_0 + iX_R7) / 2;
- tPoint_var50.dy_4 = (tPoint_var2C.dy_4 + iY_R5) / 2;
- // 001D3896
- GFXCAMERA_ScreenToGame(&tPoint3D_var40, &tPoint_var50,
- 0x10000);
- // 001D38A2 || 001D38B0
- if (abs(tPoint3D_var40.point_0.dx_0) > 0x178000 ||
- abs(tPoint3D_var40.point_0.dy_4) >
- 0x208000) { // 001D38B6
- tPoint_var2C = tPoint_var50;
- continue;
- } // 001D3870
- iX_R7 = tPoint_var50.dx_0;
- iY_R5 = tPoint_var50.dy_4;
- // 001D38C2 || 001D38C8
- if (abs(tPoint3D_var40.point_0.dx_0) < 0x168000 &&
- abs(tPoint3D_var40.point_0.dy_4) <
- 0x1F8000) { // 001D386E
- continue;
- } // 001D38D4
- tPoint_var2C.dx_0 = iX_R7;
- tPoint_var2C.dy_4 = iY_R5;
- break;
- } // 001D38D4
- b_R6 = true;
- } // 001D38D6
- // 001D38EA
- FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]]
- .copy(tPoint_var2C);
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]++;
- // 001D3920
- CGFXFX::SwipeAddPoint(tPoint_var2C);
- // 001D3928
- CGFXFX::SwipeSetCol(0xFFFFFFFF);
- // 001D3930
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >=
- 5) { // 001D3936
- TPoint tPoint_var50 =
- FREE_tInfo.field_188C.PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 5];
- TPoint tPoint_var70 =
- FREE_tInfo.field_188C.PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 3];
- TPoint tPoint_var80 =
- FREE_tInfo.field_188C.PointArr_1C
- [FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1];
- int iDisX_R5 = abs(tPoint_var50.dy_4 - tPoint_var70.dx_0);
- int iDisY_R7 = abs(tPoint_var50.dy_4 - tPoint_var70.dy_4);
- int iDisX_R1 = abs(tPoint_var70.dx_0 - tPoint_var80.dx_0);
- int iDisY_R0 = abs(tPoint_var70.dy_4 - tPoint_var80.dy_4);
- // 001D397A && 001D3992
- if (iDisX_R5 + iDisY_R7 >= 4 &&
- iDisX_R1 + iDisY_R0 >= 4) { // 001D3998
- // 001D399E
- int iRot_R5 = GU_GetRot(&tPoint_var50, &tPoint_var70);
- // 001D399E
- int iRot_R0 = GU_GetRot(&tPoint_var70, &tPoint_var80);
- int iValue_R7 = (iRot_R5 + 0x2000 - iRot_R0) & 0x3FFF;
- // 001D39C4
- if (iValue_R7 >= 0x2000)
- iValue_R7 = iValue_R7 - 0x2000;
- else
- iValue_R7 = 0x2000 - iValue_R7;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] += iValue_R7;
- // 001D39D4
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[2] >
- 0x6000) { // 001D39DC
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- } // 001D362C
- } // 001D362C
- } // 001D362C
- } // 001D362C
- } // 001D362C
- } // 001D362C
- else { // 001D3618
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] = -1;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- } // 001D362C
- } // 001D362C
- } // 001D362C
- // 001D362C && 001D3636
- if (b_R6 && CFreeHUD::ms_pAnimations) { // 001D3638
- // 001D3640
- if (!CFreeHUD::ms_pAnimations->CheckKickLength(tPoint_var2C)) {
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- return;
- }
- } // 001D3642
- // 001D3642 && 001D364C && 001D3656
- if (b_R6 && (uint)FREE_tInfo.filed_0.gamestatus_1828 <= 8 &&
- ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) != 0) { // 001D365C
- // 001D3686
- while (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] >= 2) { // 001D366A
- // 001D367C 001D3674
- if ((int)XMATH_Distance(
- &FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] -
- 2],
- &FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] -
- 1]) > 1)
- break;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1]--;
- } // 001D368A
- // 001D3692 || 001D3696
- if (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[0] < 1 ||
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] < 1) {
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- return;
- }
- // 001D36B4
- int iDis_R5 =
- XMATH_Distance(&tPoint_var2C, &FREE_tInfo.field_188C.PointArr_1C[0]);
- // 001D36D8 001D36CA 001D36C6
- FREE_tInfo.field_1C9C.field_1C9C =
- (iDis_R5 / FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] > 0x3B) ||
- (FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] < 7);
- // 001D36E8
- if (iDis_R5 < 20) {
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- return;
- }
- TPoint3D tPoint3D_var40 = cBall.ballPosPrev_4;
- TPoint3D tPoint3D_var50;
- TPoint3D tPoint3D_var70;
- // 001D372E
- FREE_ResolveEndPoint(
- &tPoint3D_var40, &tPoint3D_var50,
- &FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1],
- &FREE_tInfo.filed_0.field_1840,
- FREE_tInfo.field_188C.m_pPlayer_0->tStr32_44.field_8 - 7);
- // 001D3736
- int iRot_var84 = GU_GetRot(tPoint3D_var40, tPoint3D_var50);
- // 001D3742
- int iRot_var8C = FREE_tInfo.field_188C.m_pPlayer_0->GetAnimData()->s_64 +
- FREE_tInfo.field_188C.m_pPlayer_0->u_0.s_2_0.s_2;
- int iValue_R2 = (iRot_var84 + 0x2000 - iRot_var8C) & 0x3FFF;
- int iValue_R0 = iValue_R2 - 0x2000;
- // 001D375E
- if (iValue_R2 >= 0x2000)
- iValue_R2 = iValue_R2 - 0x2000;
- else
- iValue_R2 = 0x2000 - iValue_R2;
- // 001D376A
- if (iValue_R2 > 0x638) { // 001D37D6
- // 001D37DC
- while (tPoint3D_var50.dz_8 >= 0x1000) { // 001D378E
- // 001D3788
- if (abs(iValue_R0) <= 0x638) break;
- tPoint3D_var50.dz_8 -= 0x1000;
- // 001D37A2
- GFXCAMERA_ScreenToGame(
- &tPoint3D_var50,
- &FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] - 1],
- tPoint3D_var50.dz_8);
- // 001D37AA
- iRot_var84 = GU_GetRot(tPoint3D_var40, tPoint3D_var50);
- // 001D37BA
- int iRot_R1 = FREE_tInfo.field_188C.m_pPlayer_0->GetAnimData()->s_64 +
- FREE_tInfo.field_188C.m_pPlayer_0->u_0.s_2_0.s_2;
- iValue_R0 = (iRot_var84 + 0x2000 - iRot_R1) & 0x3FFF;
- iValue_R0 = iValue_R0 - 0x2000;
- } // 001D37E2
- // 001D37EE
- if (abs(iValue_R0) >= 0x694) { // 001D37F4
- FREE_tInfo.filed_0.uc_4 = 0x2D;
- return;
- } // 001D36A4
- // 001D39E6
- if (abs(iValue_R0) > 0x638) { // 001D39EC
- int iIndex_R4 = iValue_R0 >= 0 ? 1 : -1;
- iRot_var84 = 0x638 * iIndex_R4 + iRot_var8C;
- // 001D39F6
- int iDis_R0 =
- XMATH_Distance(&tPoint3D_var40.point_0, &tPoint3D_var50.point_0);
- // 001D3A10
- tPoint3D_var70 =
- XMATH_PointProject(tPoint3D_var40, iRot_var84, iDis_R0);
- tPoint3D_var50.point_0 = tPoint3D_var70.point_0;
- } // 001D3A1E
- } // 001D3A1E
- // 001D3A34
- FREE_ClipPathBounds(&tPoint3D_var40, &tPoint3D_var50, 0xFFE20000,
- 0x1E0000, 0xFFE20000 + 0x90000, 0x1E0000 - 0x90000);
- FREE_tInfo.filed_0.point3D_1848 = tPoint3D_var50;
- CPlayer *pPlayer_R6 = FREE_tInfo.field_188C.m_pPlayer_0;
- // 001D3A5A
- TAnimData *pAnimData_R4 = pPlayer_R6->GetAnimData();
- int iValue_R10 = pAnimData_R4->filed_8;
- int iClamp_R5 = 0;
- // TPoint3D tPoint3D_var70;
- // 001D3A68 && 001D3A72 && 001D3A7A
- if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
- (pAnimData_R4->u_C.s_C.uc_c & 1) == 0) { // 001D3A7E
- // 001D3A96 001D3A80
- iClamp_R5 = XMATH_Clamp(pPlayer_R6->GetAnimData()->s_66 * 1000,
- 0xFFFFF254, 0xDAC);
- // 001D3ACC
- GFXCAMERA_ScreenToGame(
- &tPoint3D_var70,
- &FREE_tInfo.field_188C
- .PointArr_1C[FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] / 2 -
- 1],
- (tPoint3D_var50.dz_8 - cBall.ballPosPrev_4.dz_8) / 2);
- // 001D3AD4
- int iRot_R0 = GU_GetRot(tPoint3D_var40, tPoint3D_var70);
- iRot_R0 = (iRot_var84 + 0x2000 - iRot_R0) & 0x3FFF;
- // 001D3AF6
- iClamp_R5 = XMATH_Clamp((iRot_R0 - 0x2000) * 0x12, iClamp_R5 - 0xDAC,
- iClamp_R5 + 0xDAC);
- } // 001D3B00
- int iKickPower_var58 = 0;
- int iKickPower_var60 = 0;
- // 001D3B10
- FREE_GetKickPower((EAnimID)pPlayer_R6->tStr32_44.field_10,
- &iKickPower_var58, &iKickPower_var60);
- // 001D3B26
- int iClamp_var8C =
- XMATH_InterpolateClamp(iKickPower_var58, 0, 0x640, 0x11BB, 0x547B);
- // 001D3B3A
- int iClamp_var94 =
- XMATH_InterpolateClamp(iKickPower_var60, 0, 0x640, 0x11BB, 0x547B);
- int iClamp_R6 = abs(iClamp_R5);
- // 001D3B50
- int iClampDiv_R9 = iClamp_R6 / 280;
- // 001D3B5C
- int iDis_R7 =
- XMATH_Distance(&cBall.ballPosPrev_4.point_0, &tPoint3D_var50.point_0);
- // 001D3B62
- if (iDis_R7 < 0x10001) {
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- return;
- }
- // 001D3B6A
- if (iDis_R7 > 0x230000) { // 001D3B70
- tPoint3D_var70 = tPoint3D_var50 - tPoint3D_var40;
- // 001D3B8A
- XMATH_Normalize(&tPoint3D_var70, 0x230000);
- tPoint3D_var50 = tPoint3D_var50 + tPoint3D_var40;
- } // 001D3E62
- bool b_R8;
- int iClamp_R7 = 0;
- int iMoveToSpin_R10;
- // 001D3BAC
- if (FREE_tInfo.filed_0.field_1840 == -2) { // 001D3BB0
- int iClampDiv_var9C = iClampDiv_R9 >= 0 ? iClampDiv_R9 : 0;
- // 001D3BCA
- XMATH_InterpolateClamp(iDis_R7, 0, 0xF0000, 0x2A3D, 0x547B);
- bool b_R2 = false;
- // 001D3BD0
- if (iDis_R7 < 0x50000) b_R2 = true;
- bool b_R3 = false;
- // 001D3BD0
- if (tPoint3D_var50.dz_8 < 0x4000) b_R3 = true;
- b_R8 = b_R2 && b_R3;
- // 001D3BE8 && 001D3BE8 && 001D3C04
- if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
- pAnimData_R4->u_C.s_C.uc_c == 0) { // 001D3C5E
- iClamp_R7 = iClamp_R6 / 4 - 1000;
- } // 001D3D12
- FREE_tInfo.field_1C9C.field_1CA4 =
- tPoint3D_var50.dz_8 > 0x17555 ? 1 : 0;
- // 001D3D28
- iMoveToSpin_R10 = XMATH_Clamp(iDis_R7, iClamp_var8C, iClamp_var94) *
- (100 - iClampDiv_var9C) / 100;
- // 001D3D6C
- int iSpin_R0 = cBall.SetBallMoveToPosSpin(
- &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
- tPoint3D_var50, -1, iMoveToSpin_R10);
- // 0x1D3D70
- if (iSpin_R0 >= 0x1FF) iSpin_R0 = 0x1FF;
- FREE_tInfo.filed_0.kickTargetTime_1838 = iSpin_R0;
- } // 001D3D82
- else { // 001D3C18
- bool bHideType;
- // 001D3C1C || 001D3C24
- if (cBall.ballPosPrev_4.dz_8 >= 0x4000 ||
- tPoint3D_var50.dz_8 >= 0x4000) { // 001D3C2A
- // 001D3C2C
- FREE_tInfo.filed_0.kickTargetTime_1838 =
- FREE_CalcKickTargetTime(iDis_R7);
- bHideType = true;
- } // 001D3C38
- // 001D3CC6 && 001D3CD2
- else if (iDis_R7 >= 0xA0000 && iDis_R7 < 0x140000) { // 001D3CE0
- // 001D3CF6
- int iPath_R5 = FREE_PassCheckPath(FREE_tInfo.field_188C.m_pPlayer_0,
- cBall.ballPosPrev_4.point_0,
- tPoint3D_var50.point_0);
- // 001D3CFE
- FREE_tInfo.filed_0.kickTargetTime_1838 =
- FREE_CalcKickTargetTime(iDis_R7);
- // 001D3D06
- if (iPath_R5 == 0)
- bHideType = true;
- else
- bHideType = false;
- } // 001D3C38 or 001D3E84
- else { // 001D3E6E
- // 001D3E70
- FREE_tInfo.filed_0.kickTargetTime_1838 =
- FREE_CalcKickTargetTime(iDis_R7);
- // 001D3E78
- if (iDis_R7 >= 0xA0000)
- bHideType = true;
- else
- bHideType = false;
- } // 001D3E84 or 001D3E84
- iClamp_R7 = 0;
- if (bHideType) { // 001D3C38
- // 001D3C38 & 001D3C3E && 001D3C50
- if (iValue_R10 != 7 && iValue_R10 != 0x10 &&
- pAnimData_R4->u_C.s_C.uc_c == 0)
- iClamp_R7 = 0xFFFFF830;
- // 001D3CB2
- iMoveToSpin_R10 = cBall.SetBallMoveToPosSpin(
- &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
- tPoint3D_var50, FREE_tInfo.filed_0.kickTargetTime_1838, 0);
- b_R8 = false;
- } // 001D3D82
- else { // 001D3E84
- // 001D3EAE
- iMoveToSpin_R10 = cBall.SetBallMoveToPosLowSpin(
- &tPoint3D_var70, iClamp_R5, iClamp_R7, cBall.ballPosPrev_4,
- tPoint3D_var50, FREE_tInfo.filed_0.kickTargetTime_1838, 0);
- b_R8 = true;
- } // 001D3D82
- } // 001D3D82
- FREE_tInfo.filed_0.field_183C[0] = b_R8;
- FREE_tInfo.filed_0.field_1834 = -1;
- // 001D3DA6
- int iNewClamp_R5 =
- XMATH_InterpolateClamp(iMoveToSpin_R10, 0, 0x547B, 0, 0x3E8);
- // 001D3DAE
- int iMag_R0 = XMATH_Mag3D(&tPoint3D_var70);
- int iUseClamp_R0 = iMag_R0;
- // 001D3DB2
- if (iMag_R0 > iClamp_var94) { // 001D3DB6
- // 001D3DC0
- tPoint3D_var70 = XMATH_Normalize(tPoint3D_var70, iClamp_var94);
- iUseClamp_R0 = iClamp_var94;
- } // 001D3DFC
- // 001D3DDE
- else if (iMag_R0 < iClamp_var8C) { // 001D3DE2
- // 001D3DEA
- tPoint3D_var70 = XMATH_Normalize(tPoint3D_var70, iClamp_var8C);
- iUseClamp_R0 = iClamp_var8C;
- } // 001D3DFC
- // 001D3E06
- if (tPoint3D_var70.dz_8 > iUseClamp_R0 * 2 / 5) { // 001D3E0A
- tPoint3D_var70.dz_8 = iUseClamp_R0 * 2 / 5;
- // 001D3E0E
- XMATH_Mag3D(&tPoint3D_var70);
- } // 001D3E12
- FREE_tInfo.field_188C.m_pPlayer_0->aPoint3D_178[1] = tPoint3D_var70;
- FREE_tInfo.field_188C.field_4.field_2 = iNewClamp_R5;
- FREE_tInfo.field_188C.field_4.filed_4 = iRot_var84;
- FREE_tInfo.field_188C.field_4.field_0 = 0x5A;
- FREE_tInfo.field_188C.field_4.filed_14 = iClamp_R5; // 弧度
- FREE_tInfo.field_188C.field_4.filed_16 = iClamp_R7;
- FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- // 001D3E62
- if (b_R8) FREE_tInfo.field_188C.cBuff_3DC.cBuff_0[1] = 0;
- } // 001D36A4
- } // 001D36A4
- }
- //-------------------------------------------------------------------------------------------------
- // 001D3EC8
- int FREE_CalcKickTargetTime(int a1) {
- LOGE("FREE_CalcKickTargetTime%d", a1);
- return rand();
- }
- //-------------------------------------------------------------------------------------------------
- // 001D3EEC
- void FREE_ResetControls() { LOGE("FREE_ResetControls"); }
- //-------------------------------------------------------------------------------------------------
- // 001D3F24
- int FREE_PassIsLowKick(TFreeControl *, TPoint3D *, TPoint3D *, int) {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- // 001D3FA8
- void FREE_ControlGetKickLimits(CPlayer *player0, int *pi1, int *pi2, int *pi3) {
- int *var_58 = pi1;
- int *var_54 = pi2;
- int *var_50 = pi3;
- int var_2C = 0;
- int var_28 = 0;
- TPoint3D var_38;
- TPoint3D var_48;
- int r0_i = player0->tStr32_44.field_10;
- FREE_GetKickPower((EAnimID)r0_i, &var_28, &var_2C);
- var_28 = 100;
- int r4_i = 21627;
- var_48.point_0.dy_4 = XMATH_InterpolateClamp(100, 0, 1600, 0, r4_i);
- r0_i = XMATH_InterpolateClamp(var_2C, 0, 1600, 0, r4_i);
- // 001D3FF0
- if (r0_i < r4_i) {
- // 001D3FF4
- r4_i = r0_i;
- }
- // 001D3FF6
- var_48.dz_8 = r4_i;
- r0_i = 0;
- int r7_i = 163840;
- int r6_i = 0;
- r4_i = 0;
- var_48.point_0.dx_0 = r0_i;
- int r1_i;
- // loc_1D40EA
- while (r7_i != 1998848) {
- // loc_1D4006
- int r2_i = FREE_CalcKickTargetTime(r7_i);
- int r9_i = 4096;
- // r5 = cball
- int r8_i = cBall.ballPosPrev_4.point_0.dx_0;
- int r3_i = cBall.ballPosPrev_4.point_0.dy_4;
- int r10_i = r7_i + r3_i;
- // 356A7C - 0x356A70
- r0_i = cBall.ballPosPrev_4.dz_8;
- int var_3C = r6_i;
- int r11_i;
- // 001D4024
- if (r0_i < 32768) {
- // 001D402A
- TPoint3D tp1;
- // int var_4C = r2_i;
- tp1.point_0.dx_0 = r8_i;
- tp1.point_0.dy_4 = r3_i;
- tp1.dz_8 = r0_i;
- TPoint3D tp2;
- tp2.point_0.dx_0 = r8_i;
- tp2.point_0.dy_4 = r10_i;
- tp2.dz_8 = r9_i;
- /*
- * 描述:此处在连续入栈时STRD和STM有出入
- * 原始汇编: STMEA.W SP, {R0,R8,R10}
- * 自已汇编: STRD.W R10, R8, [SP,#0x78+var_78]
- */
- int var_4C = r2_i;
- r0_i = cBall.SetBallMoveToPosLow(&var_38, tp1, tp2, r2_i, -1);
- r11_i = r7_i;
- r1_i = var_48.point_0.dx_0;
- // 001D404A
- if (r0_i < var_48.dz_8) {
- // 001D4050
- r1_i = r7_i;
- }
- var_48.point_0.dx_0 = r1_i;
- r1_i = var_48.point_0.dy_4;
- // 001D4056
- if (r0_i < r1_i) {
- // 001D405A
- r11_i = r4_i;
- }
- // 001D405C
- if (r4_i != 0) {
- // 001D4060
- r11_i = r4_i;
- }
- // 001D4062
- r2_i = cBall.ballPosPrev_4.point_0.dx_0;
- r3_i = cBall.ballPosPrev_4.point_0.dy_4;
- r1_i = r8_i;
- r0_i = cBall.ballPosPrev_4.dz_8;
- r8_i = r2_i;
- r2_i = var_4C;
- } else {
- // loc_1D4070
- r1_i = r8_i;
- r11_i = r4_i;
- }
- // 001D4076
- TPoint3D var_78;
- var_78.point_0.dx_0 = r8_i;
- var_78.point_0.dy_4 = r3_i;
- var_78.dz_8 = r0_i;
- TPoint3D var_6C;
- var_6C.point_0.dx_0 = r1_i;
- var_6C.point_0.dy_4 = r10_i;
- var_6C.dz_8 = r9_i;
- r4_i = r2_i;
- int r5_i =
- cBall.SetBallMoveToPosSpin(&var_38, 0, -2000, var_78, var_6C, r2_i, 0);
- r0_i = r0_i * 2;
- r1_i = (uint)r0_i / (uint)5u;
- // r0_i = var_38.dz_8 ;
- r0_i = r7_i;
- // 001D40A4
- if (var_38.dz_8 > r1_i) {
- // 001D40AA
- r5_i = XMATH_Mag3D(&var_38);
- r0_i = var_38.dz_8;
- r0_i = r0_i / 49;
- r0_i = r0_i * r7_i;
- r0_i = r0_i / r4_i;
- } // loc_1D40C4
- r4_i = r0_i;
- r1_i = var_48.point_0.dy_4;
- r7_i += 32768;
- // 001D40CC
- if (r5_i < r1_i) {
- // 001D40D0
- r4_i = r11_i;
- }
- // 001D40D2
- if (r11_i != 0) {
- // 001D40D8
- r4_i = r11_i;
- }
- r6_i = var_3C;
- // 001D40DC
- if (r0_i <= r6_i) {
- // 001D40E0
- r0_i = r6_i;
- }
- r1_i = var_48.dz_8;
- // 001D40EA
- if (r5_i < r1_i) {
- // 001D40E8
- r6_i = r0_i;
- }
- } // loc_1D4006
- r0_i = r4_i << 1u;
- r1_i = 3;
- r0_i = r0_i / r1_i;
- int *r1_pi = var_58;
- *r1_pi = r0_i;
- r1_i = var_48.point_0.dx_0;
- // 001D40EA
- if (r1_i >= 1146880) {
- // 001D40F0
- r1_i = 1146880;
- }
- *var_54 = r1_i;
- *var_50 = r6_i;
- }
- //-------------------------------------------------------------------------------------------------
- // 001D4120
- void FREE_Init() {}
- //-------------------------------------------------------------------------------------------------
- // 001D4160
- void FREE_Shutdown() {}
- //-------------------------------------------------------------------------------------------------
- // 001D41B0
- void FREE_InitGoal(int, bool, bool, bool) {}
- //-------------------------------------------------------------------------------------------------
- // 001D4318 //^_-
- //单元测试等级:目测游戏表现
- //测试内容:启动游戏到第1关传球射门
- //测试结果: 游戏表现正常无崩溃且无明显变化,检测到日志输出
- //测试分支: 001D4318
- void FREE_SetupDifficulty() {
- /*
- * 描述:此处自己的汇编变量赋值上顺序有不同,多种尝试,不太容易完全一致
- */
- FREE_tInfo.field_1C9C.m_iCPUPlayerCloseDownCount_1CF8 =
- FREE_tGoal.m_iCPUPlayerCloseDownCount_747C;
- FREE_tInfo.field_1C9C.m_fCPUCloseDownDist_1CFC =
- FREE_tGoal.m_fCPUCloseDownDist_7480;
- FREE_tInfo.field_1C9C.m_iCPUKickResponseTime_1D18 =
- FREE_tGoal.m_iCPUKickResponseTime_749C;
- FREE_tInfo.field_1C9C.m_iCPUMoveResponseTime_1D1C =
- FREE_tGoal.m_iCPUMoveResponseTime_74A0;
- FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 = FREE_tGoal.m_iCPUGKRating_7484;
- //注意!!!!!这里的数据符号不对 注意更新
- // FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488为float
- FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
- FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488;
- FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 =
- FREE_tGoal.m_iCPUGKSaveResponseTime_748C;
- FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
- FREE_tGoal.m_fCPUGKSaveSpeed_7490;
- FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
- FREE_tGoal.m_fCPUGKSaveDistance_7494;
- uchar r5_c = FREE_tInfo.field_1C9C.field_1CF6;
- FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
- FREE_tGoal.m_iCPUGKPosResponseTime_7498;
- // 001D43B6
- if (r5_c != 0) {
- // 001D43B8
- // float s0_f = 2.8;
- FREE_tInfo.field_1C9C.m_iCPUGKRating_1D00 =
- FREE_tGoal.m_iCPUGKRating_7484 - 5;
- FREE_tInfo.field_1C9C.m_iCPUGKSaveResponseTime_1D08 =
- FREE_tGoal.m_iCPUGKSaveResponseTime_748C + 4;
- FREE_tInfo.field_1C9C.m_iCPUGKPosResponseTime_1D14 =
- FREE_tGoal.m_iCPUGKPosResponseTime_7498 + 4;
- FREE_tInfo.field_1C9C.m_fCPUGKSaveAlwaysDistance_1D04 =
- FREE_tGoal.m_fCPUGKSaveAlwaysDistance_7488 - 0.200000003f;
- // 001D43E6
- if ((float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f > 2.8f) {
- // 001D43FA
- FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 =
- (float)FREE_tGoal.m_fCPUGKSaveDistance_7494 - 0.200000003f;
- } else
- FREE_tInfo.field_1C9C.m_fCPUGKSaveDistance_1D10 = 2.8f;
- FREE_tInfo.field_1C9C.m_fCPUGKSaveSpeed_1D0C =
- FREE_tGoal.m_fCPUGKSaveSpeed_7490 - 5.0f;
- }
- // locret_1D4410
- }
- void GenerateMesh() { LOGE("GenerateMesh"); }
- //-------------------------------------------------------------------------------------------------
- // 001D4424 //^_-
- //单元测试等级:目测游戏表现
- //测试内容:启动游戏到第10关传球射门
- //测试结果: 游戏表现正常无崩溃且无明显变化,未检测到日志输出
- //测试分支: 无
- void FREE_Initialise() {
- // 4B0F74 - 0x4B0F58
- int r0_i = CStoryCore::m_tStages.i_1C;
- // qint var_252C = r0_i;
- XSYS_RandomSetSeed(r0_i);
- CTeam var_418_sp2120[2];
- memcpy(var_418_sp2120, tGame.CTeam_2C60, sizeof(tGame.CTeam_2C60)); // 1008
- TPlayerInfo var_2518_sp20[64];
- memcpy(var_2518_sp20, &tGame.TPlayerInfo_94,
- sizeof(tGame.TPlayerInfo_94)); // 8448
- CGameLoop::InitGameVars();
- COMM_Reset();
- memcpy(tGame.CTeam_2C60, &var_418_sp2120, sizeof(tGame.CTeam_2C60));
- memcpy(&tGame.TPlayerInfo_94, var_2518_sp20, sizeof(tGame.TPlayerInfo_94));
- CGameLoop::ObjectsInit();
- CGameLoop::PlayerObjectsUpdate();
- GL_NewPlayMode(EPlayMode_1, 0, 1);
- GL_NewPlayModeState(EPlayModeState_1);
- // 0x7450
- tGame.mTLogic_6678.team_40 = FREE_iTeam;
- cBall.ballPosPrev_4.point_0.dx_0 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.point_0.dx_0;
- cBall.ballPosPrev_4.point_0.dy_4 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.point_0.dy_4;
- cBall.ballPosPrev_4.dz_8 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tBallPos_744C.dz_8;
- cBall.Stop();
- int r2_i = 1000;
- tGame.mTLogic_6678.field_86 = 0;
- tGame.field_6C8C = r2_i;
- tGame.field_6C90 = r2_i;
- tGame.field_6C94 = r2_i;
- tGame.field_6C98 = r2_i;
- r2_i = 0xFFE50000;
- CPlayer *r0_player = tGame.allplay_14[FREE_iTeam].teamlist_0[0];
- r0_player->SetPos(0, r2_i);
- r0_i = FREE_iTeam ^ 1;
- r0_player = tGame.allplay_14[r0_i].teamlist_0[0];
- r0_player->SetPos(0, 0x1B0000);
- int r4_i = 0;
- // loc_1D4552
- while (r4_i != 2) {
- // loc_1D453A
- for (int r6_i = 0; r6_i != 11; r6_i++) {
- // loc_1D453E
- r0_player = tGame.allplay_14[r4_i].teamlist_0[r6_i];
- CGameLoop::ExcludePlayer(r0_player, false);
- }
- r4_i++;
- }
- // 001D4556
- r0_i = 0;
- int r1_i = 1;
- // loc_1D456C
- while (r0_i != 3) {
- // loc_1D4560
- CPlayer *r2_player = tGame.field_8[r0_i];
- r0_i++;
- r2_player->tStr32_44.uc_2 = r1_i;
- } // loc_1D4560
- // 001D4570
- GL_ResetPlayers();
- // 47F7D0 - 0x47DFB0 = 1820
- int r5_i = 0;
- // loc_1D46A2
- while (r5_i != 2) {
- // loc_1D4582
- r0_i = CStoryCore::m_tStages.i_1C;
- XSYS_RandomSetSeed(r0_i + r5_i);
- int r8_i = 0;
- // int var_251C_sp1C = r5_i;
- // loc_1D468C
- while (r8_i < (r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818
- ->m_iTeamPlayerIndex_14[r5_i])) {
- // loc_1D4594
- r0_i = (uint)FREE_iTeam ^ (uint)r5_i;
- TFreePlayer *r4_st = &FREE_tInfo.filed_0.pFREE_tGoal_1818
- ->m_tTeamPlayerInfo_1C[r5_i][r8_i];
- r1_i = r4_st->filed_0;
- CPlayer *r5_player = tGame.allplay_14[r0_i].teamlist_0[r1_i];
- r5_player->Reset();
- r5_player->SetPos(r4_st->m_tPoint_4);
- // r0_i = 0;
- r5_player->ballPosPrev_4.dz_8 = 0;
- r5_player->SetMoveDest(r4_st->m_tPoint_4);
- r0_i = 0xFFFF;
- r1_i = 0x168;
- r5_player->tStr58_A0.s_4C = r0_i;
- int r7_i = r4_st->m_iRot_10;
- r0_i = r7_i << 14u;
- int r6_i = r0_i / r1_i;
- // 001D45EC
- if (r7_i >= 0) {
- // 001D45F8
- r5_player->SetRotExplicit(r6_i);
- r5_player->SetRot(r6_i, false);
- r1_i = r6_i;
- // loc_1D4622
- } else {
- // loc_1D4608
- // var2528 =cball
- r1_i = r5_player->GetRotPoint(cBall.ballPosPrev_4);
- r5_player->SetRotExplicit(r1_i);
- r1_i = -1;
- }
- // loc_1D4622
- r5_player->Stop(r1_i);
- // int* r10_pi = &r4_st->m_tAnim_3B4[0].m_iRot_8 ; //3d8
- r6_i = 0;
- r5_player->tStr32_44.uc_2 = r6_i;
- // loc_1D4622
- while (r6_i < r4_st->m_iNodeAnimSetLoopIndex_3B0) // field_3CC
- {
- // loc_1D4636
- // 47F7D0 - 0x47DFB0 =1820
- r0_i = FREE_tInfo.filed_0.field_1820;
- r1_i = r4_st->m_tAnim_3B4[r6_i].m_iTick_0;
- // 001D463E
- if (r0_i == r1_i) {
- // 001D4642
- r1_i = r4_st->m_tAnim_3B4[r6_i].m_iAnimID_4;
- r5_player->SetAnim(r1_i);
- r0_i = r4_st->m_tAnim_3B4[r6_i].m_iAnimID_4;
- r5_player->tStr32_44.field_8 = CAnimManager::GetState(r0_i);
- // 001D465A
- if (r4_st->m_tAnim_3B4[r6_i].m_iRot_8 >= 0) {
- // 001D465E
- r0_i = r0_i << 14u;
- r1_i = r0_i / 360;
- r5_player->SetRot(r1_i, false);
- }
- }
- // loc_1D4672
- // r10_pi = r10_pi+3;
- r6_i++;
- }
- // loc_1D4678
- r5_player->ClearBlend();
- r8_i++;
- } // loc_1D468C
- r5_i++;
- } // loc_1D4582
- // 47F7E0 - 0x47DFB0
- // r8 = r9 =cball
- r0_i = FREE_tInfo.filed_0.field_1830;
- // r1_i = r0_i + 1;
- if (FREE_tInfo.filed_0.field_1830 == -1) {
- // 001D46B8
- r0_i = GM_GetPlayerNearestPoint(FREE_iTeam, cBall.ballPosPrev_4.point_0, 0);
- // 47F7F0 - 0x47DFB0
- FREE_tInfo.filed_0.field_1830 = r0_i;
- FREE_tInfo.filed_0.field_1840 = r0_i;
- }
- // loc_1D46D2
- r5_i = FREE_tInfo.filed_0.field_1834;
- // r1_i = r5_i + 1;
- // 001D46DA
- if (FREE_tInfo.filed_0.field_1834 != -1) {
- // 001D46DE
- r1_i = FREE_iTeam;
- CPlayer *r4_player = tGame.allplay_14[r1_i].teamlist_0[r0_i];
- uint r0_u = CAnimManager::GetState(r5_i);
- // r2_i = r5_i + r5_i * 32;
- int r3_i = r4_player->us_122;
- int r7_i = 0x7454;
- TAnimData *anims = CAnimManager::s_tAnimData;
- r1_i = anims[r5_i].filed_20[0].i_8;
- r1_i = r3_i * r1_i;
- TFreeGoal *r3_goal = FREE_tInfo.filed_0.pFREE_tGoal_1818;
- r2_i = r1_i / 128;
- r3_goal->m_tBallPos_744C.dz_8 = r2_i;
- bool b4748 = false;
- // 001D4704
- if (r0_u <= 17) {
- r3_i = 0x30080; //
- r7_i = 1;
- r0_u = (uint)r7_i << (uint)r0_u;
- // 001D4734
- if ((r0_u & r3_i) != 0) {
- // 001D4738
- tGame.field_6ADC = r4_player;
- tGame.field_6AD8 = 3;
- } else {
- // loc_1D4748
- b4748 = true;
- }
- } else {
- // 001D4746
- b4748 = true;
- }
- if (b4748) {
- // loc_1D4748
- tGame.field_6ADC = NULL;
- tGame.field_6AD8 = 0;
- cBall.ballPosPrev_4.dz_8 = r2_i;
- // 001D4754
- if (r1_i >= 0x100000) {
- // 001D4758
- r0_i = CAnimManager::GetActionTime(r5_i, 0, 0x400);
- r1_i = cBall.ballPosPrev_4.dz_8;
- LOGE("r0-i=%x", r0_i);
- r0_i = r1_i + ((int)(r0_i * r0_i * 98) >> 1);
- } else {
- // loc_1D4790
- r0_i = 0x1000;
- }
- // loc_1D4794
- cBall.ballPosPrev_4.dz_8 = r0_i;
- }
- }
- // loc_1D4798
- // 66C0
- tGame.mTLogic_6678.field_48 = 11;
- // 66FD
- tGame.mTLogic_6678.field_85 = 0;
- // 66B8
- tGame.mTLogic_6678.team_40 = FREE_iTeam;
- // //47FC34 - 0x47DFB0
- // r4_i = FREE_tInfo.field_1CB4;
- // 47FC34 - 0x47DFB0 = 1C84
- FREE_tInfo.field_188C.cBuff_3DC.field_1C = 0;
- FREE_ResetControls();
- // 47F7D0 - 0x47DFB0
- FREE_tInfo.filed_0.field_1820 = 0; // FREE_tInfo.field_1CB4;//
- // 47F7CC - 0x47DFB0
- FREE_tInfo.filed_0.field_181C = 0; // r4_i;FREE_tInfo.field_1CB4
- cBallProj.EnsureProj(30);
- r1_i = cBallProj.field_E4;
- // 47F7C8 - 0x47DFB0
- // TFreeGoal* r0_goal = FREE_tInfo.filed_0.pFREE_tGoal_1818;
- r1_i = ((r1_i + 11) % 512);
- TPoint3D tp3d;
- tp3d.point_0.dx_0 = cBallProj.field_E8[r1_i].point3D_0.point_0.dx_0;
- tp3d.point_0.dy_4 = cBallProj.field_E8[r1_i].point3D_0.point_0.dy_4;
- tp3d.dz_8 = cBallProj.field_E8[r1_i].point3D_0.dz_8;
- // r1_i = r1_i +11;
- r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iKickRot_7464;
- // r1_i = r1_i % 512u;
- r0_i = (uint)r0_i << 14u;
- // r1_i = r1_i + r1_i*4;
- r0_i = r0_i / 360;
- FREE_SetupKickAction(tp3d, 0, r0_i); // 44
- FREE_SetupPhaseTransition(true);
- r0_i = cBall.ballPosPrev_4.point_0.dx_0;
- r1_i = cBall.ballPosPrev_4.point_0.dy_4;
- r2_i = cBall.ballPosPrev_4.dz_8;
- tGame.m_uc_6CD4 = 0; // FREE_tInfo.field_1CB4;//r4_i;
- // 47FC7C - 0x47DFB0
- FREE_tInfo.field_1C9C.field_1CCC = r0_i;
- FREE_tInfo.field_1C9C.field_1CD0 = r1_i;
- FREE_tInfo.field_1C9C.field_1CD4 = r2_i;
- GFXNET::Reset();
- FREE_tInfo.filed_0.gamestatus_1828 = 2;
- // 47F7DC - 0x47DFB0
- FREE_tInfo.filed_0.field_182C = 0;
- // 47F80E - 0x47DFB0
- FREE_tInfo.filed_0.field_185E = 0;
- // 47F80C - 0x47DFB0
- FREE_tInfo.filed_0.field_185C = 0;
- // 47F808 - 0x47DFB0
- FREE_tInfo.filed_0.field_1858 = 0;
- // 47F804 - 0x47DFB0
- FREE_tInfo.filed_0.field_1854[0] = 0;
- FREE_tInfo.filed_0.field_1854[1] = 0;
- FREE_tInfo.filed_0.field_1854[2] = 0;
- FREE_tInfo.filed_0.field_1854[3] = 0;
- CGFXFX::ResetGoldenBootEffects();
- CGFXFX::ResetStarPlayerEffects();
- FREE_ResetControls();
- r1_i = tGame.mTLogic_6678.field_38;
- int r7_i = 30;
- if (r1_i >= 31) {
- tGame.mTLogic_6678.field_38 = r7_i;
- }
- GenerateMesh();
- }
- //-------------------------------------------------------------------------------------------------
- // 001D49C0
- void FREE_UpdateCamera(bool) {}
- //-------------------------------------------------------------------------------------------------
- // 001D56CC
- void FREE_ClipPathBounds(TPoint3D *a1, TPoint3D *a2, int a3, int a4, int a5,
- int a6) {
- LOGE("FREE_ClipPathBounds%p%p%d%d%d%d", a1, a2, a3, a4, a5, a6);
- }
- //-------------------------------------------------------------------------------------------------
- // 001D5718
- // void FREE_GameLoop() {
- // int r0_i = 0;
- // int r1_i = 0;
- // int r2_i = 0;
- // // 001D571E
- // if (NIS_Active() != 0) {
- // // 001D5720
- // // NIS_GameLoop();
- // CFreeHUD::Process();
- // // 47F7D8 - 0x47DFB0
- // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
- // // 001D5734
- // if (r0_i == 6) {
- // // 001D5738
- // FREE_ProcessFail();
- // r1_i = FREE_tInfo.filed_0.field_182C;
- // r1_i = r1_i + 1;
- // FREE_tInfo.filed_0.field_182C = r1_i;
- // return;
- // } else {
- // // locret_1D582E
- // return;
- // }
- // }
- // // loc_1D5748
- // // 47F7D8 - 0x47DFB0 = 1828
- // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
- // // 001D5754
- // if (r0_i != 8) {
- // // 001D5758
- // tGame.maybe_sound_0++;
- // }
- // // loc_1D5764
- // // 004877F5
- // NISGOAL_tInfo.field_1 = 0;
- // // 47DFB1 - 0x47DFB0
- // FREE_tInfo.filed_0.b_1 = 1;
- // // 001D5776
- // if (CReplay::Playing() != 0) {
- // // 001D5778
- // CReplay::Play();
- // }
- // // loc_1D577C
- // // 47F7D8 - 0x47DFB0
- // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
- // // 001D5782
- // if (r0_i == 7) {
- // // 47F7DC - 0x47DFB0
- // r1_i = FREE_tInfo.filed_0.field_182C;
- // // 3A27BC - 0x39BB88
- // r2_i = tGame.field_6C34;
- // // 001D5798
- // if (r2_i < r1_i) {
- // // 001D579C
- // r0_i = tGame.mTLogic_6678.field_50;
- // r1_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
- // if (r1_i == r0_i) {
- // // 001D57C6
- // CGFXFX::EnableStarPlayerEffects();
- // }
- // } else {
- // // loc_1D57B0
- // r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iUserPlayer_7458;
- // r1_i = FREE_tInfo.filed_0.field_1830;
- // if (r1_i == r0_i) {
- // // 001D57C6
- // CGFXFX::EnableStarPlayerEffects();
- // }
- // }
- // }
- // // loc_1D57CA
- // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
- // float r0_f = 0.01666666753590107;
- // CGFXFX::Update(r0_f);
- // GFXCAMERA_ApplyIngameSettings(-1, -1);
- // GFXCAMERA_UpdateMatrices();
- // int r4_i = FREE_ProcessLogic();
- // // 47FC60 - 0x47DFB0
- // FREE_UpdateCamera(FREE_tInfo.field_1C9C.field_1CB0 == false);
- // // 001D57F2
- // if (r4_i != 0) {
- // // 001D57F8
- // if (CReplay::Playing() != 0) {
- // // loc_1D57FA
- // CAM_Update();
- // return;
- // }
- // } else {
- // // loc_1D57FA
- // CAM_Update();
- // return;
- // }
- // // loc_1D5802
- // // 3A2208 - 0x39BB88
- // r0_i = tGame.mTLogic_6678.field_8;
- // // 001D580E
- // if (r0_i == 2) {
- // // 001D5812
- // // 3A2238 - 0x39BB88
- // r0_i = tGame.mTLogic_6678.field_38;
- // // 001D5818
- // if (r0_i <= 29) {
- // // 001D581C
- // CReplay::RecordFrame();
- // }
- // } else {
- // // loc_1D5822
- // CReplay::RecordFrame();
- // }
- // // loc_1D5826
- // // 3A22A0 - 0x39BB88
- // r0_i = tGame.mTLogic_6678.field_A0;
- // // 001D582C
- // if (r0_i != 0) {
- // // locret_1D582E
- // return;
- // }
- // // loc_1D5830
- // CPlayerManager::UpdatePlayersLogic();
- // FREE_CheckCollision();
- // cBall.UpdateFrame();
- // // 47F7D8 - 0x47DFB0
- // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
- // // 001D584A
- // if (r0_i != 4) {
- // // 001D584E
- // COL_PlayerCollisions();
- // }
- // // 001D5852
- // PhysicsTest();
- // cBall.CheckEvents();
- // // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
- // GFXNET::Update(0.01666666753590107f);
- // GL_UpdatePlayMode();
- // GM_CalcPlayerDist();
- // GM_CalcPlayerBallInterceptions();
- // FREE_LogicProcess();
- // // 3A2204 - 0x39BB88
- // r0_i = (uchar)tGame.mTLogic_6678.field_4;
- // // 001D5878
- // if (r0_i == 0) {
- // // 001D587C
- // r0_i = FREE_tInfo.filed_0.gamestatus_1828;
- // // 001D5882
- // if (r0_i >= 4) {
- // // 001D5886
- // CPlayerManager::UpdatePlayers();
- // }
- // // 001D588A
- // COMM_Process();
- // }
- // // loc_1D57FA
- // CAM_Update();
- // return;
- // }
- //-------------------------------------------------------------------------------------------------
- // 001D58B4
- void FREE_StoreRewindState() { tGame.mTLogic_6678.field_8 = rand() % 10; }
- //-------------------------------------------------------------------------------------------------
- // 001D5A3E
- void FREE_UpdateRewindState() {}
- //-------------------------------------------------------------------------------------------------
- // 001D5A40
- void FREE_RestoreRewindState() {}
- //-------------------------------------------------------------------------------------------------
- // 001D5AE4
- void FREE_BeginRewind() {}
- //-------------------------------------------------------------------------------------------------
- // 001D5B30
- int FREE_RewindFrame() { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001D5C0C
- void FREE_ClipPathBounds(TPoint *a1, TPoint *a2, int a3, int a4, int a5,
- int a6) {
- LOGE("FREE_ClipPathBounds%p%p%d%d%d%d", a1, a2, a3, a4, a5, a6);
- }
- //-------------------------------------------------------------------------------------------------
- // 001D656C
- void FREE_IdleProcess() {
- tGame.mTLogic_6678.field_8 = 1;
- LOGE("FREE_IdleProcess");
- }
- //-------------------------------------------------------------------------------------------------
- // 001D66F0
- void FREE_SetupKick(TFreeControl *, TPoint3D *) {}
- void COUNTER_UpdateGenericCounters(void) {
- LOGE("COUNTER_UpdateGenericCountersrand=%x", rand());
- }
- //-------------------------------------------------------------------------------------------------
- // 001D6778 //^_-
- //单元测试等级:目测游戏表现
- //测试内容:启动游戏到第5关传球射门
- //测试结果: 修复后游戏表现正常
- void FREE_LogicProcess() {
- tGame.mTLogic_6678.field_AC = cBall.ballPosPrev_4.point_0.dx_0;
- tGame.mTLogic_6678.field_B0 = cBall.ballPosPrev_4.point_0.dy_4;
- // 001D679E
- if (tGame.mTLogic_6678.field_8 > 2 && tGame.mTLogic_6678.field_8 < 5) {
- // 001D67A2
- FREE_IdleProcess();
- } else {
- // loc_1D67A8
- if (tGame.mTLogic_6678.field_8 == 1) {
- // 001D67AC
- COUNTER_UpdateGenericCounters();
- }
- // loc_1D67B0
- }
- // loc_1D67B0
- if (tGame.mTLogic_6678.field_10 == 0) {
- if (tGame.mTLogic_6678.field_8 != 1) {
- // 001D67C4
- CPlayerManager::SetPlayersWalking(1);
- }
- }
- // loc_1D67C8
- tGame.field_6C34++;
- tGame.field_6C38++;
- }
- //-------------------------------------------------------------------------------------------------
- // 001D67E8
- int FREE_GetPassTargetPlayer(CPlayer *, int *) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001D6918
- void FREE_ProcessShotAnim(CPlayer *) {}
- //-------------------------------------------------------------------------------------------------
- // 001D6CD8
- void FREE_ProcessUserTeam() {}
- //-------------------------------------------------------------------------------------------------
- // 001D7D74
- void FREE_ProcessOppoTeam() {}
- //-------------------------------------------------------------------------------------------------
- // 001D848C
- void FREE_ProcessFree() {}
- //-------------------------------------------------------------------------------------------------
- // 001D86C4
- void FREE_ProcessFail() {}
- //-------------------------------------------------------------------------------------------------
- // 001D8884
- void FREE_PlayCommentaryClearance() {}
- //-------------------------------------------------------------------------------------------------
- // 001D8944
- void FREE_PlayCommentaryInterception() {}
- //-------------------------------------------------------------------------------------------------
- // 001D8998
- void FREE_SetupKickAction(TPoint3D tPoint3D0, int i1, int i2) {
- TPoint3D var_30_sp18 = tPoint3D0;
- int r4_i = FREE_tInfo.filed_0.field_1834;
- CPlayer *r5_player =
- tGame.allplay_14[FREE_iTeam].teamlist_0[FREE_tInfo.filed_0.field_1840];
- int r0_i = r4_i + 1;
- // 001D89DA
- if (r0_i == -1) {
- // 001D89DE
- r0_i = CAnimManager::GetActionAnim(r5_player, EPlayerState_12, &var_30_sp18,
- i2, 0, 10, -1, 0);
- r4_i = r0_i;
- FREE_tInfo.filed_0.field_1834 = r0_i;
- }
- // loc_1D89FE
- TAnimData *r7_pAnimData = &CAnimManager::s_tAnimData[r4_i];
- int r11_i = CAnimManager::GetActionTime(r4_i, 0, 1024);
- TPoint var_38;
- r0_i = r7_pAnimData->s_64;
- int r8_i = i2;
- r4_i = r8_i;
- int r3_i = r8_i - r0_i;
- r5_player->GetAnimActionPoint(&var_38, r7_pAnimData, r3_i & 0x3FFFu, 0);
- // FREE_tInfo.field_1870 = var_30.point_0; 这句是多余的?
- // 47F838 - 0x47DFB0 = 1888
- // 47F828 - 0x47DFB0 = 1878
- r0_i = var_30_sp18.point_0.dx_0;
- int r1_i = var_30_sp18.point_0.dy_4;
- int r2_i = var_30_sp18.dz_8;
- FREE_tInfo.field_1878 = r2_i;
- FREE_tInfo.field_1888 = r4_i;
- r3_i = tGame.maybe_sound_0;
- r2_i = var_38.dx_0;
- int r5_i = var_38.dy_4;
- r5_i = r1_i - r5_i;
- r4_i = r0_i - r2_i;
- // 47F82C - 0x47DFB0 = 187C
- FREE_tInfo.field_187C = r4_i;
- // 47F830 - 0x47DFB0 = 1880
- FREE_tInfo.field_1880 = r5_i;
- r0_i = i1 - r11_i;
- // 001D8A4C
- if (i1 != 0) {
- // 001D8A7C
- r3_i = r3_i + r0_i;
- }
- // 47F834 - 0x47DFB0 = 1884
- FREE_tInfo.field_1884 = r3_i;
- FREE_tInfo.field_1870 = var_30_sp18.point_0;
- // 001D8A8A
- if (i1 == 0) {
- // 001D8A94
- TPoint tPoint;
- tPoint.dx_0 = r4_i;
- tPoint.dy_4 = r5_i;
- r5_player->SetPos(tPoint);
- r5_player->SetMoveDest(tPoint);
- r0_i = r7_pAnimData->s_64;
- r1_i = i2;
- r1_i = r1_i - r0_i;
- r5_player->SetRot(r1_i & 0x3FFFu, 1);
- }
- // loc_1D8ABA
- }
- //-------------------------------------------------------------------------------------------------
- // 001D8AD0
- void FREE_CheckGKHandPos(CPlayer *, int) {}
- //-------------------------------------------------------------------------------------------------
- // 001D8B9C
- int FREE_SetupPhaseTransition(bool a1) {
- LOGE("FREE_SetupPhaseTransition");
- return rand() + a1;
- }
- //-------------------------------------------------------------------------------------------------
- // 001D8DB4
- int FREE_PlayerGetUrgency(CPlayer *, int) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001D8E68
- void FREE_ProcessInProgressCore() {}
- //-------------------------------------------------------------------------------------------------
- // 001D956C
- void FREE_UpdateSuccess(void) {
- // 001D956C
- TPoint3D var_30_sp20;
- TPoint3D var_40_sp10;
- /*
- * 描述:寄存嚣加载略有不同,VLDR,VLD1.8这两个不知道到底什么区别
- * 原始汇编:VLDR D16, [R2]
- * 自己汇编:VLD1.8 {D16}, [R2]
- */
- TPoint3D var_50_sp0 = FREE_tInfo.filed_0.point3D_1848;
- // 001D958E
- if (FREE_tInfo.filed_0.field_1840 > -1) {
- // 001D959C
- int r1_i = var_50_sp0.dz_8;
- // 001D95A8
- if (r1_i <= 0x1000) {
- // 001D95A8
- r1_i = 0x1000;
- }
- var_50_sp0.dz_8 = r1_i;
- cBallProj.EnsureProj(FREE_tInfo.filed_0.kickTargetTime_1838 + 10);
- int r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
- int r7_i = 0x7FFFFFFF;
- int r8_i = 600;
- // r10 = var_50
- int r5_i = r0_i - 10;
- int r11_i;
- // loc_1D963E
- while (r5_i <= r0_i + 10) {
- // loc_1D95D4
- r0_i = cBallProj.field_E4;
- // 47F7EC - 0x47DFB0 =183C
- r0_i = r0_i + r5_i;
- r0_i = r0_i % 512;
- var_40_sp10 = cBallProj.field_E8[r0_i].point3D_0;
- // r9 = var40
- if (FREE_tInfo.filed_0.field_183C[0] != 0) {
- // 001D960E
- r0_i = XMATH_Distance(&var_40_sp10.point_0, &var_50_sp0.point_0);
- } else {
- // loc_1D9616
- r0_i = XMATH_Distance3D(&var_40_sp10, &var_50_sp0);
- }
- // loc_1D961C
- if (r0_i < r7_i) {
- // 001D9620
- r7_i = r0_i;
- r8_i = r5_i;
- r11_i = var_40_sp10.dz_8 - var_50_sp0.dz_8;
- var_30_sp20 = var_40_sp10;
- }
- // loc_1D9636
- // 47F7E8 - 0x47DFB0 =1838
- r5_i++;
- r0_i = FREE_tInfo.filed_0.kickTargetTime_1838;
- }
- // 001D9644
- if (FREE_tInfo.filed_0.field_183C[0] == 0) {
- // 001D9644
- cBall.ballMovePrev_10.dz_8 = cBall.ballMovePrev_10.dz_8 - r11_i / r8_i;
- }
- // loc_1D9660
- cBallProj.EnsureProj(r8_i + 1);
- FREE_tInfo.filed_0.point3D_1848 = var_30_sp20;
- FREE_tInfo.field_1884 = tGame.maybe_sound_0 + r8_i;
- FREE_tInfo.filed_0.gamestatus_1828 = 7;
- // 47F834 - 0x47DFB0 =1884
- CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
- // loc_1D96BC
- } else {
- // loc_1D96A8
- FREE_tInfo.filed_0.gamestatus_1828 = 7;
- CStoryCore::m_tStageManager.pStory_5cf4->CreateNPPhoto();
- }
- // loc_1D96BC
- }
- //-------------------------------------------------------------------------------------------------
- // 001D96E4
- int FREE_ProcessLogic() { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001DA0A8
- void FREE_PlayCommentaryPassReceive() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA208
- void FREE_PlayCommentaryKick() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA484
- void FREE_SetComplete() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA5C0
- void FREE_PlayersUpset(int) {}
- //-------------------------------------------------------------------------------------------------
- // 001DA620
- void FREE_PlayersCelebrate() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA670
- void FREE_CheckCollision() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA674
- //^_^
- void FREE_InitProps(void) {}
- //-------------------------------------------------------------------------------------------------
- // 001DA730
- void FREE_UpdateProps() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA764
- void FREE_ShutdownProps() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA7A4
- void FREE_RenderPropShadow(EFreePropType, CFTTMatrix32 *) {}
- //-------------------------------------------------------------------------------------------------
- // 001DA7BC
- void FREE_RenderProp(EFreePropType, CFTTMatrix32 *) {}
- //-------------------------------------------------------------------------------------------------
- // 001DA7D4
- void FREE_RenderPropShadows() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA8C0
- void FREE_RenderProps() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA9AC
- void FREE_ProcessPropCollision(TFreeProp *) {}
- //-------------------------------------------------------------------------------------------------
- // 001DA9AE
- void FREE_ProcessPropCollisions() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA9B0
- //^_^
- void FREE_RenderInitOnce() {}
- //-------------------------------------------------------------------------------------------------
- // 001DA9E0
- void FREE_RenderShutdownOnce() {}
- //-------------------------------------------------------------------------------------------------
- // 001DAA00
- void FREE_RenderInit() {}
- //-------------------------------------------------------------------------------------------------
- // 001DAAAC
- void FREE_RenderShutdown() {}
- //-------------------------------------------------------------------------------------------------
- // 001DAAF4
- void FREE_RenderListBegin(char const *, bool, bool) {}
- //-------------------------------------------------------------------------------------------------
- // 001DAB84
- void FREE_RenderListEnd() {}
- //-------------------------------------------------------------------------------------------------
- // 001DABD4
- void FREE_RenderAddVert(TFVF_PFLOAT_CINT_TFLOAT *, CFTTMatrix32 *) {}
- //-------------------------------------------------------------------------------------------------
- // 001DAC40
- void FREE_RenderStar(TPoint3D, float, float) {}
- //-------------------------------------------------------------------------------------------------
- // 001DACE4
- void FREE_RenderTarget(TPoint3D, int, uint, bool) {}
- //-------------------------------------------------------------------------------------------------
- // 001DAEEC
- void FREE_RenderDottedArc(TPoint3D, int, int, int, int, int, uint) {}
- //-------------------------------------------------------------------------------------------------
- // 001DB0BC
- void FREE_RenderRangeCone() {}
- //-------------------------------------------------------------------------------------------------
- // 001DB3CC
- void FREE_RenderDottedLine(TPoint3D, TPoint3D, int, uint, uint) {}
- //-------------------------------------------------------------------------------------------------
- // 001DB5C0
- void FREE_RenderTutorialLine(TPoint3D const &, TPoint3D const &, int) {}
- //-------------------------------------------------------------------------------------------------
- // 001DB9C8
- void FREE_RenderEditPlayerLine(TPoint3D const &, TPoint3D const &) {}
- //-------------------------------------------------------------------------------------------------
- // 001DBBCC
- void FREE_Render3DOpaque() {}
- //-------------------------------------------------------------------------------------------------
- // 001DBBF0
- void FREE_RenderHeroPlayer(bool) {}
- //-------------------------------------------------------------------------------------------------
- // 001DBEEC
- void FREE_Render3DDecal() {}
- //-------------------------------------------------------------------------------------------------
- // 001DBFC4
- void FREE_RenderPreSelectedPlayer() {}
- //-------------------------------------------------------------------------------------------------
- // 001DC0E0
- void FREE_RenderProcess() {
- MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0 =
- rand() % 10;
- }
- //-------------------------------------------------------------------------------------------------
- // 001DC0E4
- void FREE_AddVisualFeedback(int i0, EVFEffect e1, int i2) {
- CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
- r0_hud->ClearVisualFeedback();
- int r0_i = 0;
- int r4_i = i2;
- int r5_i = e1;
- int r6_i = i0;
- // int r7_i =0;
- int r1_i = r6_i + r6_i * 4;
- int *r7_pi = s_iEVFStrings + r1_i * 2;
- // loc_1DC120
- while (r0_i <= 9) {
- // loc_1DC118
- r1_i = *(r7_pi + r0_i);
- if (r1_i == 0) {
- break;
- }
- // loc_1DC120
- r0_i++;
- } // loc_1DC118
- // loc_1DC124
- r0_i = XSYS_Random(r0_i);
- r0_i = *(r7_pi + r0_i);
- wchar_t *r1_pwc = LOCstring(r0_i);
- wchar_t var_218[256];
- xstrlcpy(var_218, r1_pwc, 256);
- int r3_i;
- int r7_i;
- // 47AEA8 - 0x477E90
- r0_i = MP_cMyProfile.m_TProfileData.m_CGameSettings_2b80.filed_0.filed_0;
- // 001DC148
- if (r0_i == 1) {
- // 001DC14C
- xstrlcat(var_218, L" ", 256);
- } else {
- // loc_1DC152
- xstrlcat(var_218, L"!", 256);
- }
- /*
- * 描述:此处分支被合并到下面的cBall变量访问的代码块中了
- * 原始汇编: BLX j__Z8xstrlcatPwPKwj
- LDR R0, =(cBall_ptr - 0x1DC166)
- ADD R0, PC
- LDR R0, [R0]
- LDR R1, [R0,#(dword_356A7C - 0x356A70)]
- * 自已汇编: ...
- * LDR R0, =(cBall_ptr - 0xA26A)
- MOV.W R4, #0xFFFFFFFF
- ADD R0, PC
- LDR R0, [R0]
- LDRD.W R3, R2, [R0,#4]
- LDR R0, [R0,#(dword_27A4C - 0x27A40)]
- */
- // 356A7C - 0x356A70
- // 001DC168
- r1_i = cBall.ballPosPrev_4.dz_8;
- if (r1_i <= 98304) {
- // 001DC16E
- r1_i = 98304;
- }
- r3_i = cBall.ballPosPrev_4.point_0.dx_0;
- int r2_i = cBall.ballPosPrev_4.point_0.dy_4;
- bool bC1F8 = false;
- // 001DC174
- if (r4_i + 1 != 0) {
- // 001DC176
- if (r5_i == 3) {
- // 001DC17A
- r1_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.dz_8;
- r2_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dy_4;
- r3_i = tGame.CPlayer_3050[r4_i].ballPosPrev_4.point_0.dx_0;
- r4_i = -1;
- // 001DC18A
- if (r6_i != 12) {
- // 001DC1A2
- r1_i = r1_i + 98304;
- }
- // loc_1DC1F8
- bC1F8 = true;
- } else {
- // loc_1DC1B2
- r1_i = 98304;
- r2_i = 0;
- r3_i = 0;
- }
- // loc_1DC1BA
- } else {
- // loc_1DC1A8
- r4_i = -1;
- }
- if (bC1F8 == false) {
- // loc_1DC1BA
- uint r0_ui = (uint)r5_i - 1u;
- // 001DC1BC
- if (r0_ui >= 2) {
- // 001DC1C0
- if (r5_i != 3) {
- // 001DC1C4
- if (r5_i == 0) {
- // 001DC1C8
- // 4B0E34 - 0x4AB140
- CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
- r7_i = 0;
- r6_i = 1;
- int var_228 = r6_i;
- int var_224 = r7_i;
- int var_220 = r4_i;
- int r12_i = -256;
- float r5_f = 1;
- r4_i = 100;
- r6_i = 1602;
- TPoint3D tp3d0;
- tp3d0.point_0.dx_0 = r3_i;
- tp3d0.point_0.dy_4 = r2_i;
- tp3d0.dz_8 = r1_i;
- TPoint3D tp3d1;
- tp3d1.point_0.dx_0 = r7_i;
- tp3d1.point_0.dy_4 = r7_i;
- tp3d1.dz_8 = r6_i;
- return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r4_i, r5_f,
- r12_i, var_228, (EVFEffect)var_224,
- var_220);
- }
- // loc_1DC25E
- return;
- }
- // F8
- } else {
- // loc_1DC228
- float r6_f = 0.699999988079071;
- r7_i = 1;
- CStoryHUD *r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
- int var_228 = r7_i;
- int var_224 = r5_i;
- int var_220 = r4_i;
- r5_i = 60;
- r7_i = 0;
- r4_i = 1602;
- int r12_i = -1;
- TPoint3D tp3d0;
- tp3d0.point_0.dx_0 = r3_i;
- tp3d0.point_0.dy_4 = r2_i;
- tp3d0.dz_8 = r1_i;
- TPoint3D tp3d1;
- tp3d1.point_0.dx_0 = r7_i;
- tp3d1.point_0.dy_4 = r7_i;
- tp3d1.dz_8 = r4_i;
- return r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r5_i, r6_f,
- r12_i, var_228, (EVFEffect)var_224,
- var_220);
- }
- }
- // loc_1DC1F8
- r0_i = -801;
- r7_i = 1;
- r6_i = -12566464;
- int lr_i = r0_i;
- // lostphp.com/hexconvert该网站转换,反编译后与原汇编一致
- float r12_f = 0.699999988079071;
- r0_hud = CStoryCore::m_tStageManager.pStory_5cf4;
- int var_228 = r7_i;
- int var_224 = r5_i;
- r7_i = 40;
- r5_i = 0;
- TPoint3D tp3d0;
- tp3d0.point_0.dx_0 = r3_i;
- tp3d0.point_0.dy_4 = r2_i;
- tp3d0.dz_8 = r1_i;
- TPoint3D tp3d1;
- tp3d1.point_0.dx_0 = r5_i;
- tp3d1.point_0.dy_4 = r5_i;
- tp3d1.dz_8 = lr_i;
- r0_hud->AddVisualFeedback(var_218, 0, tp3d0, tp3d1, r7_i, r12_f, r6_i,
- var_228, (EVFEffect)var_224, r4_i);
- }
- //-------------------------------------------------------------------------------------------------
- // 001DC290
- void FREE_AddVisualFeedback_Pass() {
- TPoint var_1C =
- cBallProj.field_E8[((cBallProj.field_E4 + 1) % 512)].point3D_0.point_0;
- CPlayer *r7_pplayer = tGame.mTMath_6734.pPlayer_134[FREE_iTeam];
- int r0_i = XMATH_Distance(&tGame.mTLogic_6678.field_64, &var_1C);
- // 3A2278 - 0x39BB88 = 66F0
- int r2_i = tGame.mTLogic_6678.field_78; //[2]
- TAnimData *anims = CAnimManager::s_tAnimData;
- int r1_i = (ushort)anims[r2_i].u_C.filed_C;
- r1_i = r1_i & 1032u;
- int r4_i;
- EVFEffect r5_i;
- /*
- * 描述: 原汇编r5= 1有归并,自己汇编分成了两处, 寄存嚣分配有出入
- * 原始汇编: loc_1DC30A
- * MOVS R5, #1
- B loc_1DC31A
- * 自已汇编: BLE loc_E2EC
- MOVS R4, #1
- */
- // bool bC30A = false;
- // 001DC2FC
- if (r1_i == 0) {
- // loc_1DC302
- if (r0_i > 819200) {
- // 001DC308
- r4_i = 8;
- r5_i = EVFEffect_1;
- } else {
- // loc_1DC30E
- r4_i = 9;
- if (r0_i < 327680) {
- // 001DC316
- r4_i = 10;
- }
- r5_i = EVFEffect_2;
- }
- } else {
- r4_i = 11;
- r5_i = EVFEffect_1;
- }
- // loc_1DC30A
- // loc_1DC31A
- CPlayer *r0_pplayer = &tGame.CPlayer_3050[0];
- r2_i = r7_pplayer - r0_pplayer;
- FREE_AddVisualFeedback(r4_i, r5_i, r2_i);
- r0_i = XSYS_Random(2);
- r0_i = r0_i + 3;
- SNDGAME_Crowd_PlayReaction(r0_i);
- }
- //-------------------------------------------------------------------------------------------------
- // 001DC354
- void FREE_AddVisualFeedback_Goal() {}
- //-------------------------------------------------------------------------------------------------
- // 001DC440
- void FREE_AddVisualFeedback_Fail() {}
- //-------------------------------------------------------------------------------------------------
- // 001DC494
- void FREE_AddVisualFeedback_Offside() {}
- //-------------------------------------------------------------------------------------------------
- // 001DC4C8
- void FREE_SortPlayers(TFreeGoal *a1) { LOGE("FREE_SortPlayers%p", a1); }
- //-------------------------------------------------------------------------------------------------
- // 001DC664
- void FREE_SortPlayersDistance(TFreeGoal *) {}
- //-------------------------------------------------------------------------------------------------
- // 001DC848
- int FREE_ReadXML(TFreeGoal *, int) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001DC888
- bool FREE_ReadXML(TFreeGoal *, char *) { return 0; }
- //-------------------------------------------------------------------------------------------------
- // 001DCA14
- void FREE_ReadXMLLevel(int a1, TFreeGoal *tFreeGoal_r0,
- CFTTXmlReaderNode cXMLReaderNode_r1) {
- TPoint3D tPoint3D_50;
- CFTTXmlReaderNode cNode_48;
- auto cXMLReaderNode_4C = cXMLReaderNode_r1;
- // CFTTXmlReaderNode cPropNode_54;
- CFTTXmlReaderNode cNodeTeam_40;
- CFTTXmlReaderNode cNodePlayer_3C;
- TPoint tPoint_34;
- TPoint tZero_74;
- // int iTeam_No_Index_78;
- char pFormatBuf_50[0x20];
- TPoint3D tPoint3D_98;
- TPoint tPoint_98;
- // 001DCA30
- memset(tFreeGoal_r0, 0, sizeof(TFreeGoal)); // sizeof(TFreeGoal) = 0x7634
- // 001DCA3A
- cNode_48 = cXMLReaderNode_r1.GetFirstChild("Info");
- // 001DCA46 <- **if 分支**
- if (cNode_48.IsValid()) {
- // 001DCA48 OK
- tFreeGoal_r0->m_iVersion_0 =
- XMLGetInt(cNode_48, "Version", NULL, 0); // 001DCA56 <- **字段 0 赋值**
- }
- // 001DCA66
- if (XMLExists(cXMLReaderNode_r1, "Ball", "Pos")) {
- // 001DCA68 OK
- // 001DCA7C <- **结构体赋值**
- // tPoint3D_98 = g_vZero3;
- // 001DCA86 <- **call XMLGetPos3D**
- tPoint3D_50 = XMLGetPos3D(
- cXMLReaderNode_r1, "Ball", "Pos",
- g_vZero3); // 001DCA86 <- **函数调用,结构体传参通过栈拷贝**
- // 001DCA94 <- **TPoint3D.dz_8 赋值**
- tFreeGoal_r0->m_tBallPos_744C.dz_8 = tPoint3D_50.dz_8;
- // 001DCA9C <- **TPoint3D.point_0赋值**
- // tFreeGoal_r0->m_tBallPos_744C.point_0 = tPoint3D_40.point_0;
- tFreeGoal_r0->m_tBallPos_744C.point_0.dx_0 = tPoint3D_50.point_0.dx_0;
- tFreeGoal_r0->m_tBallPos_744C.point_0.dy_4 = tPoint3D_50.point_0.dy_4;
- // 001DCAA6 <- **if 分支**
- if (tFreeGoal_r0->m_tBallPos_744C.dz_8 < 0x1000) {
- // 001DCABC OK
- tFreeGoal_r0->m_tBallPos_744C.dz_8 =
- 0x1000; // 001DCAC2 <- **字段 744C 赋值**
- }
- } else {
- // 001DCAAA <- **分支地址**
- // 001DCAB0 <- **TPoint.dy_4 赋值**
- // 001DCAB6 <- **TPoint.dx_0 赋值**
- tFreeGoal_r0->m_tBallPos_744C.point_0 = TPoint(0, 0);
- // 001DCAC2
- tFreeGoal_r0->m_tBallPos_744C.dz_8 = 0x1000;
- }
- // 001DCAD8 <- **字段 745C 赋值**
- tFreeGoal_r0->m_iKickPlayer_745C = XMLGetInt(
- cXMLReaderNode_r1, "KickPlayer", NULL, 0); // 001DCACE <- **函数调用**
- // 001DCAE2 <- **call XMLGetString()**
- char *pKickAnim_r0 = XMLGetString(cXMLReaderNode_r1, "KickAnim", NULL, NULL);
- // 001DCAEA <- **XMLGetString() 返回值判断**
- if (pKickAnim_r0) {
- // 001DCAEC OK
- tFreeGoal_r0->m_iAnimID_7460 = CAnimManager::GetAnimID(
- pKickAnim_r0); // 001DCB02 <- **字段 7460 赋值**
- } else {
- // 001DCAF2
- tFreeGoal_r0->m_iAnimID_7460 = -1;
- }
- // 001DCB1E <- **字段 7464 赋值**
- tFreeGoal_r0->m_iKickRot_7464 =
- XMLGetInt(cXMLReaderNode_r1, "KickRot", 0, 0xB4);
- // 001DCB36 <- **字段 8 赋值**
- const char *sWeatherTypes[3] = {"FINE", "RAIN", "SNOW"};
- tFreeGoal_r0->m_iWeather_8 = XMLGetStringInt(
- cXMLReaderNode_r1, "Weather", NULL, (const char **)sWeatherTypes, 3, -1);
- // 001DCB44 <- **字段 C 赋值**
- tFreeGoal_r0->m_iMaxPhaseCount_C =
- XMLGetInt(cXMLReaderNode_r1, "MaxPhaseCount", NULL, 0);
- // 001DCB5A <- **字段 10 赋值**
- tFreeGoal_r0->m_bIndirect_10 =
- XMLGetInt(cXMLReaderNode_r1, "Indirect", NULL, 0)
- ? true
- : false; // 001DCB52 <- **三目运算**
- // 001DCB64 <- **call XMLGetString()**
- char const *pShotAnim_r0 =
- XMLGetString(cXMLReaderNode_r1, "ShotAnim", NULL, NULL);
- // 001DCB68 <- **返回值判断**
- if (pShotAnim_r0) {
- // 001DCB6A
- tFreeGoal_r0->m_iShotAnimID_7468 = CAnimManager::GetAnimID(
- pShotAnim_r0); // 001DCB82 <- **字段 7468 赋值**
- } else {
- // 001DCB70 OK
- tFreeGoal_r0->m_iShotAnimID_7468 = -1; // 001DCB7E <- **返回值空则赋值 -1**
- }
- // 001DCB92 <- **字段 746C 赋值**
- tFreeGoal_r0->m_iShotAnimPlayer_746C =
- XMLGetInt(cXMLReaderNode_r1, "ShotAnimPlayer", NULL, -1);
- // 001DCB9E <- **call XMLGetFloat()**
- tFreeGoal_r0->m_fShotAnimDistance_7470 =
- XMLGetFloat(cXMLReaderNode_r1, "ShotAnimDistance", NULL, 24.0f);
- // 001DCBB8 <- **字段 7458 赋值**
- tFreeGoal_r0->m_iUserPlayer_7458 =
- XMLGetInt(cXMLReaderNode_r1, "UserPlayer", NULL, 0);
- // 001DCBCA <- **字段 747C 赋值**
- tFreeGoal_r0->m_iCPUPlayerCloseDownCount_747C =
- XMLGetInt(cXMLReaderNode_r1, "CPUPlayerCloseDownCount", NULL, 1);
- // 001DCBDE <- **字段 7480 赋值**
- tFreeGoal_r0->m_fCPUCloseDownDist_7480 =
- XMLGetFloat(cXMLReaderNode_r1, "CPUCloseDownDist", NULL, 4.0f);
- // 001DCBF0 <- **字段 7484 赋值**
- tFreeGoal_r0->m_iCPUGKRating_7484 =
- XMLGetInt(cXMLReaderNode_r1, "CPUGKRating", NULL, 0x32);
- // 001DCC02 <- **字段 7490 赋值**
- tFreeGoal_r0->m_fCPUGKSaveSpeed_7490 =
- XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveSpeed", NULL, 90.0f);
- // 001DCC16 <- **字段 7494 赋值**
- tFreeGoal_r0->m_fCPUGKSaveDistance_7494 =
- XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveDistance", NULL, 4.0f);
- // 001DCC2A <- **字段 7488 赋值**
- tFreeGoal_r0->m_fCPUGKSaveAlwaysDistance_7488 =
- XMLGetFloat(cXMLReaderNode_r1, "CPUGKSaveAlwaysDistance", NULL, 0.75f);
- // 001DCC3C <- **字段 748C 赋值**
- tFreeGoal_r0->m_iCPUGKSaveResponseTime_748C =
- XMLGetInt(cXMLReaderNode_r1, "CPUGKSaveResponseTime", NULL, 0xF);
- // 001DCC4E <- **字段 7498 赋值**
- tFreeGoal_r0->m_iCPUGKPosResponseTime_7498 =
- XMLGetInt(cXMLReaderNode_r1, "CPUGKPosResponseTime", NULL, 0xF);
- // 001DCC5C <- **函数返回值赋值**
- int iCPUPlayerResponseTime_r4 =
- XMLGetInt(cXMLReaderNode_r1, "CPUPlayerResponseTime", NULL,
- 0xF); // 001DCC58 <- **函数调用**
- // 001DCC6E <- **字段 749C 赋值**
- tFreeGoal_r0->m_iCPUKickResponseTime_749C =
- XMLGetInt(cXMLReaderNode_r1, "CPUKickResponseTime", NULL,
- iCPUPlayerResponseTime_r4);
- // 001DCC80 <- **字段 74A0 赋值**
- tFreeGoal_r0->m_iCPUMoveResponseTime_74A0 =
- XMLGetInt(cXMLReaderNode_r1, "CPUMoveResponseTime", NULL,
- iCPUPlayerResponseTime_r4);
- // 001DCC92 <- **字段 7478 赋值**
- tFreeGoal_r0->m_iTEAMKickResponseTime_7478 =
- XMLGetInt(cXMLReaderNode_r1, "TEAMKickResponseTime", 0, 0xA);
- // 001DCCA4 <- **字段 7474 赋值**
- tFreeGoal_r0->m_iTEAMMoveResponseTime_7474 =
- XMLGetInt(cXMLReaderNode_r1, "TEAMMoveResponseTime", 0, 5);
- // 001DCCB8 <- **字段 74C4 赋值**
- tFreeGoal_r0->m_fTEAMPassForceShotDist_74C4 =
- XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotDist", NULL, 8.0f);
- // 001DCCCC <- **字段 74C8 赋值**
- tFreeGoal_r0->m_fTEAMPassForceShotSpace_74C8 =
- XMLGetFloat(cXMLReaderNode_r1, "TEAMPassForceShotSpace", NULL, 4.0f);
- // 001DCCDE <- **字段 74CC 赋值**
- tFreeGoal_r0->m_iShootBias_74CC =
- XMLGetInt(cXMLReaderNode_r1, "ShootBias", NULL, 0);
- // 001DCCF0 <- **字段 74D4 赋值**
- tFreeGoal_r0->m_iPassBias_74D4 =
- XMLGetInt(cXMLReaderNode_r1, "PassBias", NULL, 0);
- // 001DCD02 <- **字段 74DC 赋值**
- tFreeGoal_r0->m_iControlWhenShootBias_74DC =
- XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootBias", NULL, 0);
- // 001DCD14 <- **字段 74E4 赋值**
- tFreeGoal_r0->m_iControlWhenPassBias_74E4 =
- XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassBias", NULL, 0);
- // 001DCD26 <- **字段 74D0 赋值**
- tFreeGoal_r0->m_iShootScale_74D0 =
- XMLGetInt(cXMLReaderNode_r1, "ShootScale", NULL, 0);
- // 001DCD38 <- **字段 74D8 赋值**
- tFreeGoal_r0->m_iPassScale_74D8 =
- XMLGetInt(cXMLReaderNode_r1, "PassScale", NULL, 0);
- // 001DCD4A <- **字段 74E0 赋值**
- tFreeGoal_r0->m_iControlWhenShootScale_74E0 =
- XMLGetInt(cXMLReaderNode_r1, "ControlWhenShootScale", NULL, 0);
- // 001DCD5C <- **字段 74E8 赋值**
- tFreeGoal_r0->m_iControlWhenPassScale_74E8 =
- XMLGetInt(cXMLReaderNode_r1, "ControlWhenPassScale", NULL, 0);
- // 001DCD6E <- **字段 74EC 赋值**
- tFreeGoal_r0->m_iControlRepeatReduce_74EC =
- XMLGetInt(cXMLReaderNode_r1, "ControlRepeatReduce", NULL, 10);
- // 001DCD80 <- **字段 74F0 赋值**
- tFreeGoal_r0->m_iPropCount_74F0 =
- XMLGetInt(cXMLReaderNode_r1, "PropCount", NULL, 0);
- // 001DCD9C <- **局部变量赋值**
- CFTTXmlReaderNode cPropNode_44 = cXMLReaderNode_r1.GetFirstChild(
- "Prop"); // cNode_var_54 IDA中伪代码 NextSibling
- // 001DCD9A <- **寄存器R4作为循环计数器**
- // 001DCEC2 <- **循环条件判断**
- for (int i_r4 = 0; i_r4 < tFreeGoal_r0->m_iPropCount_74F0; i_r4++) {
- // 001DCE64
- // 001DCE7A <- **结构体字段赋值**
- const char *sFPropTypes[3] = {"CONE", "MANNEQUIN", "BOARD"};
- tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iType_C =
- (EFreePropType)XMLGetStringInt(cPropNode_44, "Type", NULL,
- (const char **)sFPropTypes, 3, 0);
- // 001DCEA0 001DCEA2 <- **TPoint3D结构赋值**
- // 001DCEA2 <-
- // **该地址使用了VSTR指令,推测TPoint3D使用了浮点数,但还原代码时使用TPointF3D结构体,汇编代码并未一致**
- tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_tPoint3D_0 =
- XMLGetPos3D(cPropNode_44, "Pos", NULL, g_vZero3);
- // 001DCEB0 <- **字段赋值**
- tFreeGoal_r0->m_tFreeProp_74F4[i_r4].m_iRot_10 =
- XMLGetInt(cPropNode_44, "Rot", NULL, 0);
- // 001DCEB6 <- **读取下一个node**
- cPropNode_44 = cPropNode_44.GetNextSibling("Prop");
- // 001DCEBC <- **ADDS R6, #0x14; 0x14
- // 说明数组元素是5个int的结构体**
- } // 001DCEC4 <- **循环代码块结束**
- int iPlayerNO_r10;
- // 001DCEF0
- tZero_74 = g_vZero;
- // 001DCEDA 寄存器r3作为循环计数器, iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 ==
- // 0,是己方球队
- for (int iTeamNO_r3 = 0; iTeamNO_r3 != 2; iTeamNO_r3++) {
- // 001DCEF4 OK
- // 001DCEFE <- **call snprintf**
- snprintf(pFormatBuf_50, 0x20, "Team%i", iTeamNO_r3);
- // 001DCF0A <- **局部变量赋值**
- cNodeTeam_40 = cXMLReaderNode_r1.GetFirstChild(pFormatBuf_50);
- // 001DCF0E <- **if 代码块**
- if (cNodeTeam_40.IsValid()) {
- // 001DCF18 OK
- // 001DCF26 <- **局部变量赋值**
- cNodePlayer_3C = cNodeTeam_40.GetFirstChild("Player");
- iPlayerNO_r10 = 0; // 001DCF20 <- **循环计数器**
- // 001DD28A <- **call IsValid()**
- // 001DD294 <- **小于等于 10则跳转**
- while (cNodePlayer_3C.IsValid() && iPlayerNO_r10 < 11) {
- // 001DCF2A OK
- if (XMLExists(cNodePlayer_3C, "Pos", NULL)) {
- // 001DCF2A OK
- // tPoint_98 = tZero_74; // 001DCF42 <- **结构体赋值**
- // 001DCF46 <- **tPoint_64 接收函数返回值**
- tPoint_34 = XMLGetPos(cNodePlayer_3C, "Pos", NULL, g_vZero);
- // 001DCF68 <- **结构体比较,这里的操作符重载函数与原始汇编不一致**
- // if
- // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4
- // != tPoint_34) { 001DCF6C OK 001DCF6E 001DCF72 <- **结构体赋值,
- // 使用结构体操作符重载函数会改变汇编代码结构** LOGI("hook 0 %d",
- // iPlayerNO_r10);
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_4.dx_0 =
- tPoint_34
- .dx_0; //这里的pos如果改为 TPoint(0,0)
- //在第一二关时,对方球队的守门员会变得跟自己一方的射门的球员的位置一样
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_4.dy_4 =
- tPoint_34.dy_4; // iTeamNO_r3 == 1,是对方球队;iTeamNO_r3 ==
- // 0,是己方球队
- /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dx_0
- = 0;
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_4.dy_4
- = 0;
- //LOGI("hook 0 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3,
- iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
- }*/
- // }
- } else {
- // 001DCF8A <- **结构体赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_4 = TPoint(0, 0);
- }
- // 001DCFAE
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iHoldPosTime_C =
- XMLGetInt(cNodePlayer_3C, "HoldPosTime", NULL, 0);
- // 001DCFBA
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iRot_10 = XMLGetInt(cNodePlayer_3C, "Rot", NULL, -1);
- // 001DCFDC <- ** if **
- if (XMLGetInt(cNodePlayer_3C, "TeamMoveInfluence", NULL,
- iPlayerNO_r10 ? 1 : 0)) {
- // 001DCFDE
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iTeamMoveInfluence_14 = true;
- } else {
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iTeamMoveInfluence_14 = false;
- }
- tPoint_98 = TPoint(0, 0); // 001DCFEC <- **结构体赋值**
- // 001DCFE4 <- **tPoint_64 接收返回值**
- tPoint_34 = XMLGetPos(cNodePlayer_3C, "MoveInfluence", NULL, tPoint_98);
- // 001DCFFC <- **结构体比较,重载函数导致汇编不一致**
- // if
- // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0
- // != tPoint_34.dx_0) {
- // 001DD004
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_18.dx_0 = tPoint_34.dx_0; // 001DD004
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_18.dy_4 = tPoint_34.dy_4; // 001DD00A
- /*if (iTeamNO_r3 == 1 && iPlayerNO_r10 == 2) {
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dx_0
- = 0;
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4
- = 0;
- //LOGI("hook 1 [team] %d, [player] %d, x:%d, y:%d", iTeamNO_r3,
- iPlayerNO_r10, tPoint_64.dx_0, tPoint_64.dy_4 );
- }*/
- // } else {
- // 001DD010 OK
- // tPoint_34.dy_4 =
- // tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPoint_18.dy_4;
- // }
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_18.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD026
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPoint_18.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD032
- // 001DD040 <- **结构体字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iMoveResponseTime_20 =
- XMLGetInt(cNodePlayer_3C, "MoveResponseTime", NULL, -1);
- // 001DD052
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iKickResponseTime_24 =
- XMLGetInt(cNodePlayer_3C, "KickResponseTime", NULL, -1);
- // 001DD06A
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_bStatic_28 =
- XMLGetInt(cNodePlayer_3C, "Static", NULL, 0) ? true : false;
- const char *sFPATypes[3] = {"AI", "PASS", "SHOOT"};
- // 001DD084
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iAction_534 = XMLGetStringInt(cNodePlayer_3C, "Action", NULL,
- (const char **)sFPATypes, 3, 0);
- // 001DD094
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iActionPassTarget_538 =
- XMLGetInt(cNodePlayer_3C, "ActionPassTarget", NULL, 0);
- // 001DD0A4
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iActionControlCount_53C =
- XMLGetInt(cNodePlayer_3C, "ActionControlCount", NULL, 0);
- // 001DD0B6
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iActionControlRot_540 =
- XMLGetInt(cNodePlayer_3C, "ActionControlRot", NULL, -1);
- // 001DD0CE
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_fActionControlKickAhead_544 =
- XMLGetFloat(cNodePlayer_3C, "ActionControlKickAhead", NULL, 0);
- // 001DD0C8 <- **循环计数器初始化**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeTDestSetLoopIndex_2C = 0;
- // 001DD0D4 <- **call GetFirstChild()**
- // 001DD1AA <- **call IsValid()**
- for (auto cNode = cNodePlayer_3C.GetFirstChild("Move"); cNode.IsValid();
- cNode = cNode.GetNextSibling("Move")) {
- // 001DD0DA
- int iTempIndex =
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeTDestSetLoopIndex_2C;
- // 001DD0E4 <- **call XMLExits**
- if (XMLExists(cNode, "Dest", NULL)) {
- // 001DD0EC
- // iTempIndex++;
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeTDestSetLoopIndex_2C++; // 001DD0F4
- // auto ptr =
- // (char*)(tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerMoveInfo_30)
- // + sizeof(TFreeMoveInfo) * iTempIndex; auto pTFreeMoveInfo =
- // (TFreeMoveInfo*)ptr; pTFreeMoveInfo->m_iTick_0 = XMLGetInt(cNode,
- // "Tick", NULL, 0); 001DD10E <- **字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
- // 001DD11C <- **字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
- // pTFreeMoveInfo->m_iFace_C = XMLGetInt(cNode, "Face", NULL, -1);
- // tPoint_98 = vZero; //001DD128 <- **结构体赋值**
- // 001DD12C <- **tPoint_64接收返回值**
- tPoint_34 = XMLGetPos(cNode, "Dest", NULL, g_vZero); // tPoint_98);
- // 001DD13C <- **结构体比较**
- // 001DD144
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tDestPoint_4.dx_0 = tPoint_34.dx_0; // player 2 bug
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tDestPoint_4.dy_4 = tPoint_34.dy_4;
- // 001DD158 <- **字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL, 50);
- // pTFreeMoveInfo->m_iUrgency_10 = XMLGetInt(cNode, "Urgency", NULL,
- // 50);
- tPoint_98 = TPoint(0, 0); // 001DD164
- tPoint_34 = XMLGetPos(cNode, "MoveInfluence", NULL,
- tPoint_98); // 001DD16A <- **call
- // XMLGetPos()** 001DD174 <-
- // **结构体比较** if
- // (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14
- // != tPoint_34) {
- // 001DD178
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tMoveInfluence_14.dx_0 =
- tPoint_34.dx_0; // 001DD178 001DD17C <- **赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tMoveInfluence_14.dy_4 = tPoint_34.dy_4;
- // } else {
- // 001DD182
- // tPoint_34.dy_4 =
- // tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10].m_tPlayerDesk_30[iTempIndex].m_tMoveInfluence_14.dy_4;
- // }
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tMoveInfluence_14.dx_0 =
- tPoint_34.dx_0 / 0x8000; // 001DD18E
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tPlayerDesk_30[iTempIndex]
- .m_tMoveInfluence_14.dy_4 =
- tPoint_34.dy_4 / 0x8000; // 001DD198
- } // 001DD1AA <- **if XMLExists 代码块结束**
- } // 001DD1B2 <- **循环结束**
- // 001DD1B6 <- **字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeAnimSetLoopIndex_3B0 = 0;
- // 001DD1C0 <- **call GetFirstChild()**
- // 001DD264 <- **call IsValid()**
- for (auto cNode = cNodePlayer_3C.GetFirstChild("Anim"); cNode.IsValid();
- cNode = cNode.GetNextSibling("Anim")) {
- // 001DD1C6
- int index =
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeAnimSetLoopIndex_3B0;
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeAnimSetLoopIndex_3B0 += 1; // 001DD1CE
- // 001DD1E8 <- **字段赋值**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tAnim_3B4[index]
- .m_iTick_0 = XMLGetInt(cNode, "Tick", NULL, 0);
- // 001DD1FA <- **字段赋值*
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tAnim_3B4[index]
- .m_iRot_8 = XMLGetInt(cNode, "Rot", NULL, -1);
- // 001DD208 <- **if 代码块起始地址**
- char *pAnimStr = XMLGetString(cNode, "Anim", NULL, 0);
- if (pAnimStr) {
- // 001DD20A
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tAnim_3B4[index]
- .m_iAnimID_4 = CAnimManager::GetAnimID(pAnimStr);
- if (tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tAnim_3B4[index]
- .m_iAnimID_4 == -1) {
- // 001DD216
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeAnimSetLoopIndex_3B0--; // 001DD21C
- // 001DD220 <- **该地址出现赋值0操作**
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_tAnim_3B4[index]
- .m_iAnimID_4 = 0;
- }
- } else {
- // 001DD250
- tFreeGoal_r0->m_tTeamPlayerInfo_1C[iTeamNO_r3][iPlayerNO_r10]
- .m_iNodeAnimSetLoopIndex_3B0--; // 001DD252
- }
- }
- cNodePlayer_3C = cNodePlayer_3C.GetNextSibling("Player"); // 001DD274
- iPlayerNO_r10++; // 001DD282 <- **计数器加一**
- }
- // 001DD2A0 <- **字段赋值**
- tFreeGoal_r0->m_iTeamPlayerIndex_14[iTeamNO_r3] = iPlayerNO_r10;
- // 001DD2AC <- **结构体赋值**
- tPoint_98 = TPoint(0xA0000, 0xA0000);
- // 001DD2B4 <- **call XMLGetPos()**
- tPoint_34 = XMLGetPos(cNodeTeam_40, "MoveInfluence", NULL, tPoint_98);
- // 001DD2C6 <-**结构体比较**
- // if
- // (tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0
- // != tPoint_34) {
- // // 001DD2CA OK
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0;
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4;
- // } else {
- // // 001DD2DA OK
- // tPoint_34.dy_4 =
- // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4;
- // }
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_tMoveInfluencePoint_0.dx_0 = tPoint_34.dx_0 / 0x8000; // 001DD2EE
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_tMoveInfluencePoint_0.dy_4 = tPoint_34.dy_4 / 0x8000; // 001DD2FA
- // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dx_0
- // = tPoint_34.dx_0 / 0x8000; // 001DD2EE
- // tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3].m_tMoveInfluencePoint_0.dy_4
- // = tPoint_34.dy_4 / 0x8000; // 001DD2FA
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_iMoveInfluenceDelayMin_8 =
- XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMin", 0, 10); // 001DD30E
- tFreeGoal_r0->m_tMoveInfluence_74A4[iTeamNO_r3]
- .m_iMoveInfluenceDelayMax_C =
- XMLGetInt(cNodeTeam_40, "MoveInfluenceDelayMax", 0, 25); // 001DD324
- }
- }
- // 001DD338
- FREE_SortPlayers(tFreeGoal_r0);
- }
- //-------------------------------------------------------------------------------------------------
- // 00169A80 ^_-
- //单元测试等级: 游戏运行正常
- //单元测试内容: 1-10关
- //单元测试结果: 正常
- void PhysicsTest() {
- LOGE("PhysicsTest_0"); // OK
- fpointQ<PointType_18> fpointq_sp240;
- fpointq_sp240.field_0 = 0;
- fpointq_sp240.field_4 = 0;
- fpointq_sp240.field_8 = 0;
- fpointq_sp240.field_C = 0x40000;
- fpoint3<PointType_18> fpoint3_sp25c;
- fpoint3_sp25c.x_0 = -cBall.point3D_2C.point_0.dx_0 * 8;
- fpoint3_sp25c.y_4 = cBall.point3D_2C.dz_8 * 8;
- fpoint3_sp25c.z_8 = cBall.point3D_2C.point_0.dy_4 * 8;
- CFTTPObject *r6_pobject = new CFTTPObject(
- EPhysicsObjectType_0, EFreePropType_3, 1, fpoint3_sp25c, fpointq_sp240);
- r6_pobject->fpoint3_1C.x_0 =
- -((cBall.ballPosPrev_4.point_0.dx_0 - cBall.point3D_2C.point_0.dx_0) * 8);
- r6_pobject->fpoint3_1C.y_4 =
- (cBall.ballPosPrev_4.dz_8 - cBall.point3D_2C.dz_8) * 8;
- r6_pobject->fpoint3_1C.z_8 =
- (cBall.ballPosPrev_4.point_0.dy_4 - cBall.point3D_2C.point_0.dy_4) * 8;
- r6_pobject->fpointQ_C.field_0 = cBall.quat_68.d3_8 * 64;
- r6_pobject->fpointQ_C.field_4 = cBall.quat_68.d2_4 * 64;
- r6_pobject->fpointQ_C.field_8 = cBall.quat_68.d1_0 * 64;
- r6_pobject->fpointQ_C.field_C = cBall.quat_68.d4_C * 64;
- r6_pobject->fpoint3_28.x_0 = cBall.point3D_1C.point_0.dx_0 * -101;
- r6_pobject->fpoint3_28.y_4 = cBall.point3D_1C.dz_8 * 0x65;
- r6_pobject->fpoint3_28.z_8 = cBall.point3D_1C.point_0.dy_4 * 0x65;
- r6_pobject->field_34 = 0x94D65;
- r6_pobject->field_38 = 0x37D2A4D;
- fpoint<PointType_18> fpoint_sp23c;
- fpoint3<PointType_18> fpoint3_sp230;
- fpointQ<PointType_18> fpointQ_sp220;
- fpointQ_sp220.field_0 = 0;
- fpointQ_sp220.field_4 = 0;
- fpointQ_sp220.field_8 = 0;
- fpointQ_sp220.field_C = 0x40000;
- fpoint3_sp230.x_0 = 0;
- fpoint3_sp230.y_4 = 0;
- fpoint3_sp230.z_8 = 0;
- fpoint_sp23c.var_0 = 0x8000;
- // check 传参是否都是用了栈
- CFTTPPSphere *r0_psphere = new CFTTPPSphere(fpoint_sp23c, fpoint3_sp230,
- fpointQ_sp220); //这里头文件更新
- // 00169B60
- r6_pobject->field_3C = 0x8000;
- r0_psphere->field_64 = 0x8000;
- r6_pobject->field_44 = 0x10000;
- r6_pobject->field_40 = 0x40000;
- r6_pobject->pprimitive_98[r6_pobject->uc_9C++] = r0_psphere;
- r0_psphere->filed_4 = r6_pobject;
- // sp1c=r6_pobject
- CFTTPhysics physics_sp218(0x40);
- fpoint3<PointType_18> *pfpoint3_sp34 = new fpoint3<PointType_18>[0x10];
- // 00169B98
- pfpoint3_sp34[14].z_8 = 0;
- pfpoint3_sp34[15].x_0 = 0;
- pfpoint3_sp34[15].y_4 = 0;
- pfpoint3_sp34[15].z_8 = 0;
- pfpoint3_sp34[13].z_8 = 0;
- pfpoint3_sp34[14].x_0 = 0;
- pfpoint3_sp34[14].y_4 = 0;
- pfpoint3_sp34[14].z_8 = 0;
- pfpoint3_sp34[12].y_4 = 0;
- pfpoint3_sp34[12].z_8 = 0;
- pfpoint3_sp34[13].x_0 = 0;
- pfpoint3_sp34[13].y_4 = 0;
- // 00169C06
- pfpoint3_sp34[11].x_0 = 0;
- pfpoint3_sp34[11].y_4 = 0;
- pfpoint3_sp34[11].z_8 = 0;
- pfpoint3_sp34[12].x_0 = 0;
- // 00169C16
- pfpoint3_sp34[1].y_4 = 0x20000;
- pfpoint3_sp34[2].z_8 = 0x3333;
- pfpoint3_sp34[2].x_0 = 0x18000;
- pfpoint3_sp34[2].y_4 = 0x6AAAA;
- // 00169C2C
- pfpoint3_sp34[2].z_8 = 0x3333;
- pfpoint3_sp34[3].x_0 = 0x10000;
- pfpoint3_sp34[3].y_4 = 0x72AAA;
- pfpoint3_sp34[3].z_8 = 0x3333;
- // 00169C34
- pfpoint3_sp34[4].x_0 = 0xFFFF0000;
- pfpoint3_sp34[4].y_4 = 0x72AAA;
- pfpoint3_sp34[4].z_8 = 0x3333;
- pfpoint3_sp34[4].x_0 = 0xFFFE8000;
- // 00169C3C
- pfpoint3_sp34[4].y_4 = 0x6AAAA;
- pfpoint3_sp34[4].z_8 = 0x3333;
- pfpoint3_sp34[5].x_0 = 0xFFFE8000;
- pfpoint3_sp34[5].y_4 = 0x20000;
- // 00169C44
- pfpoint3_sp34[5].z_8 = 0x3333;
- pfpoint3_sp34[6].x_0 = 0xFFFF0000;
- pfpoint3_sp34[6].y_4 = 0;
- pfpoint3_sp34[6].z_8 = 0x3333;
- // 00169C4C
- pfpoint3_sp34[7].x_0 = 0x10000;
- pfpoint3_sp34[7].y_4 = 0;
- pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[7].x_0 = 0x18000;
- // 00169C5A
- pfpoint3_sp34[7].y_4 = 0x20000;
- pfpoint3_sp34[7].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[8].x_0 = 0x18000;
- pfpoint3_sp34[8].y_4 = 0x6AAAA;
- // 00169C60
- pfpoint3_sp34[0].x_0 = 0x10000;
- pfpoint3_sp34[0].y_4 = 0;
- pfpoint3_sp34[0].z_8 = 0x3333;
- pfpoint3_sp34[1].x_0 = 0x18000;
- // 00169C68
- pfpoint3_sp34[14].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[15].x_0 = 0xFFFF0000;
- pfpoint3_sp34[15].y_4 = 0;
- pfpoint3_sp34[15].z_8 = 0xFFFFCCCD;
- // 00169C6C
- pfpoint3_sp34[13].y_4 = 0x6AAAA;
- pfpoint3_sp34[13].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[14].x_0 = 0xFFFE8000;
- pfpoint3_sp34[14].y_4 = 0x20000;
- // 00169C74
- pfpoint3_sp34[12].x_0 = 0xFFFF0000;
- pfpoint3_sp34[12].y_4 = 0x72AAA;
- pfpoint3_sp34[12].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[13].x_0 = 0xFFFE8000;
- // 00169C7C
- pfpoint3_sp34[10].z_8 = 0xFFFFCCCD;
- pfpoint3_sp34[11].x_0 = 0x10000;
- pfpoint3_sp34[11].y_4 = 0x72AAA;
- pfpoint3_sp34[11].z_8 = 0xFFFFCCCD;
- // sp48=FREE_tInfo
- if (FREE_tInfo.filed_0.pFREE_tGoal_1818) {
- // 00169C90
- // loc_16A21E
- LOGE("PhysicsTest_case");
- for (int r2_i = 0;
- r2_i < FREE_tInfo.filed_0.pFREE_tGoal_1818->m_iPropCount_74F0;
- r2_i++) {
- // loc_169CC0
- switch (FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iType_C) {
- case 0: // loc_169EC0
- {
- // check 手机左移
- // sp4c = r2
- // check 运算
- LOGE("PhysicsTest_case_0");
- int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iRot_10 *
- 0x40000 / 0xB4;
- uint64 r3r1_ull = 0x3243F4000;
- long long r1r0_ll = r3r1_ull * r0_i >> 32;
- int r4_i = r1r0_ll / 2;
- int i_sp1b0;
- int i_sp214 = r4_i;
- sub_16A57C(i_sp1b0, i_sp214);
- sub_16A6CC(i_sp214, r4_i);
- fpoint3<PointType_18> fpoint3_spc0;
- fpointQ<PointType_18> fpointQ_spb0;
- // check 乘法
- fpoint3_spc0.x_0 =
- -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.point_0.dx_0 *
- 8;
- fpoint3_spc0.y_4 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.dz_8 *
- 8;
- fpoint3_spc0.z_8 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.point_0.dy_4 *
- 8;
- fpointQ_spb0.field_0 = 0;
- fpointQ_spb0.field_4 = i_sp1b0;
- fpointQ_spb0.field_8 = 0;
- fpointQ_spb0.field_C = i_sp214;
- CFTTPObject *r4_pobject = new CFTTPObject(
- EPhysicsObjectType_2,
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iType_C,
- 2, fpoint3_spc0, fpointQ_spb0);
- // 00169F5C
- r4_pobject->field_34 = 0;
- r4_pobject->field_38 = 0;
- r4_pobject->field_3C = 0x40000;
- r4_pobject->field_40 = 0x4000; // dword_16A448
- r4_pobject->field_44 = 0x20000;
- fpoint<PointType_18> fpoint_spac;
- fpoint<PointType_18> fpoint_spa8;
- fpoint<PointType_18> fpoint_spa4;
- fpoint3<PointType_18> fpoint3_sp98;
- fpointQ<PointType_18> fpointQ_sp80;
- fpoint3_sp98.x_0 = 0;
- fpoint_spac.var_0 = 0x3333;
- fpoint_spa8.var_0 = 0x6666;
- fpoint_spa4.var_0 = 0x15555;
- fpointQ_sp80.field_0 = 0;
- fpointQ_sp80.field_4 = 0;
- fpointQ_sp80.field_8 = 0;
- fpointQ_sp80.field_C = 0x40000;
- fpoint3_sp98.y_4 = 0xEAAA;
- fpoint3_sp98.z_8 = 0;
- // fpointQ_sp80
- CFTTPPCone *r5_pcone =
- new CFTTPPCone(fpoint_spac, fpoint_spa8, fpoint_spa4,
- fpoint3_sp98, fpointQ_sp80);
- fpoint3<PointType_18> fpoint3_sp74;
- fpoint3<PointType_18> fpoint3_sp68;
- fpointQ<PointType_18> fpointQ_sp50;
- fpoint3_sp74.x_0 = 0xCCCC;
- fpointQ_sp50.field_0 = 0;
- fpointQ_sp50.field_4 = 0;
- fpointQ_sp50.field_8 = 0;
- fpointQ_sp50.field_C = 0x40000;
- fpoint3_sp74.y_4 = 0x4000;
- fpoint3_sp74.z_8 = 0xCCCC;
- fpoint3_sp68.x_0 = 0;
- fpoint3_sp68.y_4 = 0x2000;
- fpoint3_sp68.z_8 = 0;
- CFTTPPBox *r0_pbox =
- new CFTTPPBox(fpoint3_sp74, fpoint3_sp68, fpointQ_sp50);
- r5_pcone->field_64 = 0x15555;
- r0_pbox->field_64 = 0xCCCC;
- r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r0_pbox;
- r0_pbox->filed_4 = r4_pobject;
- r4_pobject->pprimitive_98[r4_pobject->uc_9C++] = r5_pcone;
- r5_pcone->filed_4 = r4_pobject;
- physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
- r4_pobject;
- break;
- }
- case 2: // loc_16A030
- {
- LOGE("PhysicsTest_case_2");
- int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iRot_10 *
- 0x40000 / 0xB4;
- uint64 r3r1_ull = 0x3243F4000;
- long long r1r0_ll = r3r1_ull * r0_i >> 32;
- int r4_i = r1r0_ll / 2;
- int i_sp214;
- int i_sp1b0 = r4_i;
- sub_16A57C(i_sp214, i_sp1b0);
- int i_sp210;
- i_sp1b0 = r4_i;
- sub_16A6CC(i_sp210, i_sp1b0);
- // sp40=i_sp210
- // sp3c=sp214
- fpoint3<PointType_18> fpoint3_sp154;
- fpoint3<PointType_18> fpoint3_sp148;
- fpointQ<PointType_18> fpointQ_sp138;
- fpointQ<PointType_18> fpointQ_sp1b0;
- fpoint3_sp154.x_0 = 0x70000;
- fpoint3_sp154.y_4 = 0x20000;
- fpoint3_sp154.z_8 = 0x6666;
- fpointQ_sp1b0.field_0 = 0x3333;
- fpointQ_sp1b0.field_4 = 0;
- fpointQ_sp1b0.field_8 = 0;
- fpointQ_sp1b0.field_C = 0x40000;
- sub_16A88C(fpointQ_sp138, fpointQ_sp1b0);
- CFTTPPBox *pbox_sp38 =
- new CFTTPPBox(fpoint3_sp154, fpoint3_sp148, fpointQ_sp138);
- // 0016A0DC
- pbox_sp38->field_64 = 0x70000;
- fpoint3<PointType_18> fpoint3_sp12c;
- fpoint3<PointType_18> fpoint3_sp120;
- fpointQ<PointType_18> fpointQ_sp110;
- fpoint3_sp120.x_0 = 0xFFFD0000;
- fpoint3_sp12c.x_0 = 0x6666;
- fpoint3_sp12c.y_4 = 0x20000;
- fpoint3_sp12c.z_8 = 0x15555;
- fpoint3_sp120.y_4 = 0x10000;
- fpoint3_sp120.z_8 = 0xAAAA;
- fpointQ_sp1b0.field_0 = 0x3333;
- fpointQ_sp1b0.field_4 = 0;
- fpointQ_sp1b0.field_8 = 0;
- fpointQ_sp1b0.field_C = 0x40000;
- sub_16A88C(fpointQ_sp110, fpointQ_sp1b0);
- // 0016A120
- CFTTPPBox *r4_pbox =
- new CFTTPPBox(fpoint3_sp12c, fpoint3_sp120, fpointQ_sp110);
- // 0016A122
- fpoint3<PointType_18> fpoint3_sp104;
- fpoint3<PointType_18> fpoint3_spf8;
- fpointQ<PointType_18> fpointQ_spe8;
- fpoint3_sp104.x_0 = 0x6666;
- fpoint3_sp104.y_4 = 0x20000;
- fpoint3_sp104.z_8 = 0x15555;
- fpoint3_spf8.x_0 = 0x30000;
- fpoint3_spf8.y_4 = 0x10000;
- fpoint3_spf8.z_8 = 0xAAAA;
- fpointQ_sp1b0.field_0 = 0x3333;
- fpointQ_sp1b0.field_4 = 0;
- fpointQ_sp1b0.field_8 = 0;
- fpointQ_sp1b0.field_C = 0x40000;
- sub_16A88C(fpointQ_spe8, fpointQ_sp1b0);
- // 0016A164
- CFTTPPBox *r6_pbox =
- new CFTTPPBox(fpoint3_sp104, fpoint3_spf8, fpointQ_spe8);
- // 0016A166
- r4_pbox->field_64 = 0x15555;
- r6_pbox->field_64 = 0x15555;
- fpoint3<PointType_18> fpoint3_spdc;
- fpointQ<PointType_18> fpointQ_spcc;
- fpointQ_spcc.field_4 = i_sp214;
- fpointQ_spcc.field_C = i_sp210;
- fpoint3_spdc.x_0 =
- -FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.point_0.dx_0 *
- 8;
- fpoint3_spdc.z_8 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.point_0.dy_4 *
- 8;
- fpoint3_spdc.y_4 =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0.dz_8 *
- 8;
- fpointQ_spcc.field_0 = 0;
- fpointQ_spcc.field_8 = 0;
- CFTTPObject *r0_pobject = new CFTTPObject(
- EPhysicsObjectType_2,
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iType_C,
- 3, fpoint3_spdc, fpointQ_spcc);
- // 0016A1B0
- r0_pobject->field_34 = 0;
- r0_pobject->field_38 = 0;
- r0_pobject->field_3C = 0x70000;
- r0_pobject->field_40 = 0x30000;
- r0_pobject->field_44 = 0x4000;
- r0_pobject->field_A0 = 0x18;
- r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = pbox_sp38;
- pbox_sp38->filed_4 = r0_pobject;
- r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r4_pbox;
- r4_pbox->filed_4 = r0_pobject;
- r0_pobject->pprimitive_98[r0_pobject->uc_9C++] = r6_pbox;
- r6_pbox->filed_4 = r0_pobject;
- physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
- r0_pobject;
- break;
- }
- case 1: // 00169CDA
- {
- // sp4c = r2
- // check 运算
- LOGE("PhysicsTest_case_1");
- int r0_i = FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iRot_10 *
- 0x40000 / 0xB4;
- uint64 r3r1_ull = 0x3243F4000;
- long long r1r0_ll = r3r1_ull * r0_i >> 32;
- int r4_i = r1r0_ll / 2;
- int i_sp214;
- int i_sp210;
- sub_16A57C(i_sp214, r4_i);
- sub_16A6CC(i_sp210, r4_i);
- fpoint3<PointType_18> fpoint3_sp204;
- fpointQ<PointType_18> fpointQ_sp1f4;
- fpointQ_sp1f4.field_0 = 0;
- fpointQ_sp1f4.field_4 = i_sp214;
- fpointQ_sp1f4.field_8 = 0;
- fpointQ_sp1f4.field_C = i_sp210;
- TPoint3D point3D =
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_tPoint3D_0;
- fpoint3_sp204.x_0 = -point3D.point_0.dx_0 * 8;
- fpoint3_sp204.y_4 = 0x15555 + point3D.dz_8 * 8 + 0x44000;
- fpoint3_sp204.z_8 = point3D.point_0.dy_4 * 8;
- CFTTPObject *r11_pobject = new CFTTPObject(
- EPhysicsObjectType_2,
- FREE_tInfo.filed_0.pFREE_tGoal_1818->m_tFreeProp_74F4[r2_i]
- .m_iType_C,
- 3, fpoint3_sp204, fpointQ_sp1f4);
- int i_sp1b0;
- int i_sp1f0 = 0x7F1AA;
- sub_16A818(&i_sp1b0, &i_sp1f0);
- r11_pobject->field_34 = 0;
- r11_pobject->field_38 = 0;
- r11_pobject->field_3C = i_sp1b0;
- r11_pobject->field_40 = 0x10000;
- r11_pobject->field_44 = 0x10000;
- r11_pobject->field_A0 = 0x18;
- fpoint<PointType_18> fpoint_sp1ec;
- fpoint<PointType_18> fpoint_sp1e8;
- fpoint3<PointType_18> fpoint3_sp1dc;
- fpointQ<PointType_18> fpointQ_sp1cc;
- fpoint_sp1ec.var_0 = 0x10000;
- fpoint3_sp1dc.x_0 = 0;
- fpoint3_sp1dc.y_4 = 0x30000 + 0x15555;
- fpoint3_sp1dc.z_8 = 0;
- fpoint_sp1e8.var_0 = 0x6666;
- fpointQ<PointType_18> fpointQ_sp1b0;
- fpointQ_sp1b0.field_0 = 0x40000;
- fpointQ_sp1b0.field_4 = 0;
- fpointQ_sp1b0.field_8 = 0;
- fpointQ_sp1b0.field_C = 0x40000;
- sub_16A88C(fpointQ_sp1cc, fpointQ_sp1b0);
- // check 前俩个参数传递是否使用栈
- CFTTPPCylinder *r4_pcylinder = new CFTTPPCylinder(
- fpoint_sp1ec, fpoint_sp1e8, fpoint3_sp1dc, fpointQ_sp1cc);
- fpoint3<PointType_18> fpoint3_sp1a4;
- fpoint3<PointType_18> fpoint3_sp198;
- fpointQ<PointType_18> fpointQ_sp180;
- fpoint3_sp1a4.z_8 = 0x6666;
- // 00169DF4
- fpointQ_sp180.field_0 = 0;
- fpointQ_sp180.field_4 = 0;
- fpointQ_sp180.field_8 = 0;
- fpointQ_sp180.field_C = 0x40000;
- fpoint3_sp1a4.x_0 = 0x20000;
- fpoint3_sp1a4.y_4 = 0x20000;
- fpoint3_sp198.x_0 = 0;
- fpoint3_sp198.y_4 = 0xFFFB6AAB;
- fpoint3_sp198.z_8 = 0;
- CFTTPPBox *r5_pbox =
- new CFTTPPBox(fpoint3_sp1a4, fpoint3_sp198, fpointQ_sp180);
- // 00169E14
- fpoint3<PointType_18> fpoint3_sp174;
- fpointQ<PointType_18> fpointQ_sp160;
- fpoint3_sp174.y_4 = 0xFFFB6AAB + 0x10000;
- fpoint3_sp174.x_0 = 0;
- fpoint3_sp174.z_8 = 0;
- fpointQ_sp160.field_0 = 0;
- fpointQ_sp160.field_4 = 0;
- fpointQ_sp160.field_8 = 0;
- fpointQ_sp160.field_C = 0x40000;
- CFTTPPPolyhedron *r0_ppolyhedron = new CFTTPPPolyhedron(
- pfpoint3_sp34, 0x10, fpoint3_sp174, fpointQ_sp160);
- // 00169E32
- r4_pcylinder->field_64 = 0x10000;
- r5_pbox->field_64 = 0x20000;
- r0_ppolyhedron->field_64 = 0xABFFF;
- // 00169E42
- r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r5_pbox;
- r5_pbox->filed_4 = r11_pobject;
- r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r0_ppolyhedron;
- r0_ppolyhedron->filed_4 = r11_pobject;
- r11_pobject->pprimitive_98[r11_pobject->uc_9C++] = r4_pcylinder;
- r4_pcylinder->filed_4 = r11_pobject;
- physics_sp218.ppobject_0[physics_sp218.object_counts_4++] =
- r11_pobject;
- break;
- }
- }
- }
- }
- // loc_16A232
- physics_sp218.ppobject_0[physics_sp218.object_counts_4++] = r6_pobject;
- if (physics_sp218.Process()) {
- // 0016A24E
- // sp18=cBall
- LOGE("PhysicsTest_1");
- cBall.ballPosPrev_4.point_0.dx_0 =
- r6_pobject->fpoint3_0.x_0 /
- (-8); //这里fpoint3_0猜测可能为ballPosPrev_4
- cBall.ballPosPrev_4.point_0.dy_4 = r6_pobject->fpoint3_0.z_8 / 8;
- cBall.ballPosPrev_4.dz_8 = r6_pobject->fpoint3_0.y_4 / 8;
- cBall.ballMovePrev_10.point_0.dx_0 = r6_pobject->fpoint3_1C.x_0 / (-8);
- cBall.ballMovePrev_10.point_0.dy_4 = r6_pobject->fpoint3_1C.z_8 / 8;
- cBall.ballMovePrev_10.dz_8 = r6_pobject->fpoint3_1C.y_4 / 8;
- fpointQ<PointType_18> fpointQ_sp1b0;
- sub_16A88C(fpointQ_sp1b0, r6_pobject->fpointQ_C);
- // check 除法
- // 0016A2AA
- cBall.quat_68.d1_0 = fpointQ_sp1b0.field_0 / 64;
- cBall.quat_68.d2_4 = fpointQ_sp1b0.field_4 / 64;
- cBall.quat_68.d3_8 = fpointQ_sp1b0.field_8 / 64;
- cBall.quat_68.d4_C = fpointQ_sp1b0.field_C / 64;
- // check
- cBall.point3D_1C.point_0.dx_0 = r6_pobject->fpoint3_28.x_0 / (-101);
- cBall.point3D_1C.point_0.dy_4 = r6_pobject->fpoint3_28.z_8 / 101;
- cBall.point3D_1C.dz_8 = r6_pobject->fpoint3_28.y_4 / 101;
- // loc_16A344
- for (int r5_i = 0; r5_i < physics_sp218.object_counts_4; r5_i++) {
- // loc_16A30C
- if (physics_sp218.ppobject_0[r5_i]->field_9E) {
- if (physics_sp218.ppobject_0[r5_i]->field_90 != EFreePropType_3) {
- if (FREE_tInfo.filed_0.gamestatus_1828 <= 8) {
- // check
- if ((1 << FREE_tInfo.filed_0.gamestatus_1828) & 0x190) {
- LOGE("PhysicsTest_2");
- tGame.field_6C98 = 0;
- tGame.mTLogic_6678.freeproptype_74 =
- physics_sp218.ppobject_0[r5_i]->field_90;
- }
- }
- }
- }
- }
- }
- // loc_16A348
- delete[] pfpoint3_sp34;
- }
- //-------------------------------------------------------------------------------------------------
|