diff --git a/decompile/WorkInProgress/src/233/233_27_CS_Podium_Prize_ThTick2.c b/decompile/General/233/233_27_CS_Podium_Prize_ThTick2.c similarity index 84% rename from decompile/WorkInProgress/src/233/233_27_CS_Podium_Prize_ThTick2.c rename to decompile/General/233/233_27_CS_Podium_Prize_ThTick2.c index 2ea452fb..08d64efd 100644 --- a/decompile/WorkInProgress/src/233/233_27_CS_Podium_Prize_ThTick2.c +++ b/decompile/General/233/233_27_CS_Podium_Prize_ThTick2.c @@ -7,6 +7,7 @@ void CS_Podium_Prize_ThTick2(struct Thread *th) int currScale; // get object from thread + // should replace with struct Prize in 233 int prize = th->object; // get instance from thread @@ -21,7 +22,7 @@ void CS_Podium_Prize_ThTick2(struct Thread *th) if ((frameIndex & 1) == 0) { // scaleX - currScale = inst->scale[0] + 800 + frameIndex * 400; + currScale = inst->scale[0] + FPS_HALF(800) + frameIndex * 400; if ((frameIndex + 1) * 0x28a + 0x2000 < currScale) { @@ -32,7 +33,7 @@ void CS_Podium_Prize_ThTick2(struct Thread *th) else { // scaleX - currScale = inst->scale[0] - 800; + currScale = inst->scale[0] - FPS_HALF(800); if (currScale < 0x1001) { @@ -52,7 +53,7 @@ void CS_Podium_Prize_ThTick2(struct Thread *th) } else { - // execute, then assign per-frame funcPtr to thread + void CS_Podium_Prize_ThTick3(); ThTick_SetAndExec(th, CS_Podium_Prize_ThTick3); } } \ No newline at end of file diff --git a/decompile/General/AltMods/Mods1.c b/decompile/General/AltMods/Mods1.c index d1090f2b..cf7fde15 100644 --- a/decompile/General/AltMods/Mods1.c +++ b/decompile/General/AltMods/Mods1.c @@ -33,6 +33,9 @@ void NewCallback233() { // 233 patches here... + // set in Podium_Prize_ThTick1 + *(short*)0x800afdb4 = 0xf*2; + // prize spin podium *(unsigned short*)0x800af7e4 = 50; // 100/2 (not hex) diff --git a/decompile/WorkInProgress/src/233/233_26_CS_Podium_Prize_ThTick3.c b/decompile/WorkInProgress/src/233/233_26_CS_Podium_Prize_ThTick3.c index c24190d1..723ecc28 100644 --- a/decompile/WorkInProgress/src/233/233_26_CS_Podium_Prize_ThTick3.c +++ b/decompile/WorkInProgress/src/233/233_26_CS_Podium_Prize_ThTick3.c @@ -1,5 +1,7 @@ #include +extern char prizeHintArr[7]; + // Lerp position from center of screen to destination // Then kill thread void CS_Podium_Prize_ThTick3(struct Thread *th) @@ -17,6 +19,7 @@ void CS_Podium_Prize_ThTick3(struct Thread *th) struct Instance *inst = th->inst; // get object from thread + // should replace with struct Prize in 233 int prize = th->object; sVar2 = *(short *)(prize + 0x26) - 1; @@ -28,17 +31,6 @@ void CS_Podium_Prize_ThTick3(struct Thread *th) iVar8 = sVar2 * (0x100 - *(short *)(prize + 0x10)); iVar5 = sVar2 * (0x6c - *(short *)(prize + 0x12)); -#if 0 - if (iVar3 == 0) - { - trap(0x1c00); - } - if ((iVar3 == -1) && (iVar8 == -0x80000000)) - { - trap(0x1800); - } -#endif - iVar8 = (*(short *)(prize + 0x10) + iVar8 / iVar3 - 0x100) * -inst->matrix.t[2]; if (iVar8 < 0) @@ -79,75 +71,30 @@ void CS_Podium_Prize_ThTick3(struct Thread *th) // if you do not go to boss cutscene if (CS_Boss_BoolShouldStart() == 0) { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x4000) == 0) - { - // Map Information - // (part of welcome to adv arena) - hintID = 24; - } - - else - { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x1000) == 0) - { - // Wumpa Fruit Hint - hintID = 22; - } - - else - { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x2000) == 0) - { - // TNT Hint - hintID = 23; - } - else - { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x10) == 0) - { - // Hang Time Turbo Hint - hintID = 14; - } - else - { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x20) == 0) - { - // Power Sliding Hint - hintID = 15; - } - - else - { - // if hint is not unlocked - if ((sdata->advProgress.rewards[4] & 0x40) == 0) - { - // Turbo Boost Hint - hintID = 16; - } - else - { - // If hint is unlocked, skip - if ((sdata->advProgress.rewards[4] & 0x80) != 0) - goto LAB_800afa68; - - // if hint is not unlocked, - // Brake Sliding Hint - hintID = 17; - } - } - } - } - } - } - - // Request Aku Hint, - // also calls VehPhysProc_FreezeEndEvent_Init - MainFrame_RequestMaskHint(hintID, 0); + int rewards = sdata->advProgress.rewards[4]; + + char* arr; + hintID = 0; + + // Give Aku Hint at the first 7 podium + // rewards, teaching how to play + for( + arr = &prizeHintArr[0]; + arr < &prizeHintArr[7]; + arr++ + ) + { + int index = (int)*arr; + + if((rewards & (1 << (index-10))) == 0) + { + hintID = index; + break; + } + } + + if(hintID != 0) + DECOMP_MainFrame_RequestMaskHint(hintID, 0); } LAB_800afa68: @@ -165,4 +112,29 @@ LAB_800afa68: // This thread is now dead th->flags |= 0x800; -} \ No newline at end of file +} + +char prizeHintArr[7] = +{ + // Map Information + // (part of welcome to adv arena) + 24, + + // Wumpa Fruit Hint + 22, + + // TNT Hint + 23, + + // Hang Time Turbo Hint + 14, + + // Power Sliding Hint + 15, + + // Turbo Boost Hint + 16, + + // Brake Sliding Hint + 17 +}; \ No newline at end of file diff --git a/decompile/WorkInProgress/src/233/233_28_CS_Podium_Prize_ThTick1.c b/decompile/WorkInProgress/src/233/233_28_CS_Podium_Prize_ThTick1.c index ec9aa980..2d2973f6 100644 --- a/decompile/WorkInProgress/src/233/233_28_CS_Podium_Prize_ThTick1.c +++ b/decompile/WorkInProgress/src/233/233_28_CS_Podium_Prize_ThTick1.c @@ -3,7 +3,7 @@ // Wait for cutscene to end // Play "boing" sound, initialize variables, // Then start ThTick2 -void CS_Podium_Prize_ThTick1(struct Thread *th) +void DECOMP_CS_Podium_Prize_ThTick1(struct Thread *th) { short interp; int angular; @@ -12,16 +12,18 @@ void CS_Podium_Prize_ThTick1(struct Thread *th) struct Instance *inst = th->inst; // get object from thread + // should replace with struct Prize in 233 short *prize = th->object; if (OVR_233.PodiumInitUnk3 != 0) { - + // if not just beat oxide if (th->modelIndex != 0x38) { // Make visible inst->flags &= ~(HIDE_MODEL); } + interp = DECOMP_VehCalc_InterpBySpeed(prize[0x12], 0x14, 0); prize[0x12] = interp; interp = DECOMP_VehCalc_InterpBySpeed(prize[0x11], 1, 0); @@ -32,25 +34,24 @@ void CS_Podium_Prize_ThTick1(struct Thread *th) angular = MATH_Sin(prize[5]); // posX and posY - inst->matrix.t[0] = prize[0] + (prize[0x11] * angular >> 12); + inst->matrix.t[0] = prize[0] + ((prize[0x11] * angular) >> 12); inst->matrix.t[1] = prize[1] + prize[0x12]; // Cosine(angle) angular = MATH_Cos(prize[5]); // posZ - inst->matrix.t[2] = prize[2] + (prize[0x11] * angular >> 12); + inst->matrix.t[2] = prize[2] + ((prize[0x11] * angular) >> 12); if (OVR_233.isCutsceneOver != 0) { - prize[0x14] = 0xf; prize[0x13] = 0xf; + prize[0x14] = 0xf; prize[0x15] = 0; inst->unk50 = 0x80; inst->unk51 = 0x80; - // instance scale (x, y, z) inst->scale[0] = 0x1000; inst->scale[1] = 0x1000; inst->scale[2] = 0x1000; @@ -59,7 +60,10 @@ void CS_Podium_Prize_ThTick1(struct Thread *th) inst->matrix.t[1] = 0; inst->matrix.t[2] = prize[10]; - ((struct InstDrawPerPlayer *)INST_GETIDPP(inst))->pushBuffer = sdata->gGT->pushBuffer_UI; + struct InstDrawPerPlayer* idpp = + INST_GETIDPP(inst); + + idpp[0].pushBuffer = &sdata->gGT->pushBuffer_UI; // ngin sfx OtherFX_Stop2(175); @@ -69,7 +73,7 @@ void CS_Podium_Prize_ThTick1(struct Thread *th) // 0x9A - "Boing boing" -- when adding to trophy counter OtherFX_Play(0x9a, 1); - // execute, then assign per-frame funcPtr to thread + void CS_Podium_Prize_ThTick2(); ThTick_SetAndExec(th, CS_Podium_Prize_ThTick2); return; } diff --git a/decompile/buildList.txt b/decompile/buildList.txt index 8848b3d1..b5eb5e0f 100644 --- a/decompile/buildList.txt +++ b/decompile/buildList.txt @@ -137,7 +137,10 @@ common, 232, AH_WarpPad_GetSpawnPosRot, 0x0, General/232/232_Block1.c //ommon, 233, CS_DestroyPodium_StartDriving, 0x0, General/233/233_13_CS_DestroyPodium_StartDriving.c // Skip CS_Thread (14-18) // Skip Boss (19-22) -// Skip Podium (23-29) +// Skip Podium (23-25) +//ommon, 233, CS_Podium_Prize_ThTick3, 0x0, General/233/233_26_CS_Podium_Prize_ThTick3.c +common, 233, CS_Podium_Prize_ThTick2, 0x0, General/233/233_27_CS_Podium_Prize_ThTick2.c +//ommon, 233, CS_Podium_Prize_ThTick1, 0x0, General/233/233_28_CS_Podium_Prize_ThTick1.c //ommon, 233, CS_Podium_Prize_ThDestroy, 0x0, General/233/233_29_CS_Podium_Prize_ThDestroy.c //ommon, 233, CS_Podium_Stand_ThTick, 0x0, General/233/233_31_CS_Podium_Stand_ThTick.c //ommon, 233, CS_Podium_Stand_Init, 0x0, General/233/233_32_CS_Podium_Stand_Init.c diff --git a/ghidra/233.c b/ghidra/233.c index 4f58b016..1459bc6d 100644 --- a/ghidra/233.c +++ b/ghidra/233.c @@ -3638,7 +3638,9 @@ void FUN_800afcc4(int param_1) // get object from thread psVar5 = *(short **)(param_1 + 0x30); - if (DAT_800b7770 != 0) { + if (DAT_800b7770 != 0) + { + // if not just beat oxide if (*(short *)(param_1 + 0x44) != 0x38) { // Make visible diff --git a/include/common.h b/include/common.h index f3fe30b3..d0c8a735 100644 --- a/include/common.h +++ b/include/common.h @@ -2,10 +2,10 @@ #define COMMON_H // toggle these in decompile -//#define USE_60FPS -//#define USE_16BY9 -//#define USE_NEW2P -//#define USE_OXIDE +#define USE_60FPS +#define USE_16BY9 +#define USE_NEW2P +#define USE_OXIDE //#define USE_GPU1P //#define USE_VR