Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build main
on:
push:
branches:
- '**'
- "**"

permissions:
contents: read
Expand All @@ -19,28 +19,25 @@ jobs:
fetch-depth: 0
submodules: true
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Create result directory
run: mkdir ${{ runner.temp }}/result
- name: Build Decomp Debug Linux32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#decomp.debug.native32.gcc'
- name: Build Decomp Debug Linux32 Clang
run: nix build -L --no-link --keep-going '.?submodules=1#decomp.debug.native32.clang'
- name: Build Decomp Debug Mingw32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#decomp.debug.mingw32.gcc'
- name: Build Decomp Debug Mingw32 Clang
run: nix build -L --no-link --keep-going '.?submodules=1#decomp.debug.mingw32.clang'
- name: Build Retail Release Linux32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#retail.release.native32.gcc'
- name: Build Server Release Linux32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#online-server.release.native32.gcc'
- name: Build Server Release ARM32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#online-server.release.arm32.gcc'
- name: Build Server Release Mingw2 GCC
# -- Windows online-server
- name: Build Server Release Mingw32 GCC
run: nix build -L --keep-going '.?submodules=1#online-server.release.mingw32.gcc' -o ${{ runner.temp }}/result/online-server.release.mingw32.gcc
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: online-server-windows
path: |
${{ runner.temp }}/result/online-server.release.mingw32.gcc/bin
${{ runner.temp }}/result/online-server.release.mingw32.gcc/

# -- Linux online-server
- name: Build Server Release Linux GCC
run: nix build -L --no-link --keep-going '.?submodules=1#online-server.release.native.gcc'
- name: Build Server Release Aarch64 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#online-server.release.aarch64.gcc'
# -- PC Port
- name: Build Decomp Debug Mingw32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#pc-decomp.debug.mingw32.gcc' 2>&1 | grep -A3 'error:'
- name: Build Decomp Debug Linux32 GCC
run: nix build -L --no-link --keep-going '.?submodules=1#pc-decomp.debug.native32.gcc' 2>&1 | grep -A3 'error:'
29 changes: 17 additions & 12 deletions decompile/General/221/221_Full.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void DECOMP_CC_EndEvent_DrawMenu()
int growVal;
int bitIndex;
int levelID;
int elapsedFrames;

gGT = sdata->gGT;
levelID = gGT->levelID;
Expand All @@ -50,9 +51,13 @@ void DECOMP_CC_EndEvent_DrawMenu()
adv = &sdata->advProgress;
boolLose = driver->numCrystals < gGT->numCrystalsInLEV;

// count frames
if(sdata->framesSinceRaceEnded < FPS_DOUBLE(900))
sdata->framesSinceRaceEnded++;
elapsedFrames = sdata->framesSinceRaceEnded;

// count frames if hasn't been 30 seconds
if (elapsedFrames < FPS_DOUBLE(900))
elapsedFrames++;

sdata->framesSinceRaceEnded = elapsedFrames;

// hide hud crystal
sdata->ptrHudCrystal->flags |= 0x80;
Expand All @@ -65,7 +70,7 @@ void DECOMP_CC_EndEvent_DrawMenu()
&posXY[0],
0x264, 0x56, // startX, startY,
0xcd, 0x56, // endX, endY
sdata->framesSinceRaceEnded,
elapsedFrames,
FPS_DOUBLE(0x14));

sdata->ptrMenuCrystal->matrix.t[0] = DECOMP_UI_ConvertX_2(posXY[0], 0x200);
Expand Down Expand Up @@ -93,7 +98,7 @@ void DECOMP_CC_EndEvent_DrawMenu()
&posXY[0],
-0x63, 0x18, // startX, startY,
0x100, 0x18, // endX, endY
sdata->framesSinceRaceEnded,
elapsedFrames,
FPS_DOUBLE(0x14));

// TIME REMAINING
Expand Down Expand Up @@ -160,14 +165,8 @@ void DECOMP_CC_EndEvent_DrawMenu()
tokenInst->matrix.t[0] = DECOMP_UI_ConvertX_2(posXY[0], 0x200);
tokenInst->matrix.t[1] = DECOMP_UI_ConvertY_2(0xA2-0x18, 0x200);

// play unlock sound after exactly 1 second
if(sdata->framesSinceRaceEnded == FPS_DOUBLE(30))
{
OtherFX_Play(0x67, 1);
}

// grow token after first second
if(sdata->framesSinceRaceEnded > FPS_DOUBLE(30))
if(elapsedFrames > FPS_DOUBLE(30))
{
if(tokenInst->scale[0] < 0x2001)
{
Expand All @@ -177,6 +176,12 @@ void DECOMP_CC_EndEvent_DrawMenu()
tokenInst->scale[2] = growVal;
}
}

// play unlock sound after exactly 1 second
else if(elapsedFrames == FPS_DOUBLE(30))
{
OtherFX_Play(0x67, 1);
}

// PRESS * TO CONTINUE
DecalFont_DrawLine(
Expand Down
86 changes: 38 additions & 48 deletions decompile/General/222/222_Full.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
static int str_number = 0x20; // " \0"
extern struct RectMenu menu222;

// 3528

void DECOMP_AA_EndEvent_DrawMenu(void)
{
struct GameTracker *gGT;
Expand Down Expand Up @@ -71,20 +73,24 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
// if not in Token mode, these won't be used until later;
lerpStartY = 0;
lerpEndY = 0;

// For trophy race, check 1st place
int boolWin = (driver->driverRank == 0);

// If you're in Adventure Mode
if ((gGT->gameMode1 & ADVENTURE_MODE) != 0)
// If C-T-R token race
if ((gGT->gameMode2 & TOKEN_RACE) != 0)
{
// If you won the race, and you have all 3 letters (C, T, and R)
if ((driver->driverRank == 0) && (driver->PickupLetterHUD.numCollected == 3))
// add requirement of C-T-R letters
boolWin = (boolWin) && (driver->PickupLetterHUD.numCollected == 3);

if (boolWin)
{
// lerp C-T-R letters closer to center by 16 pixels
// default (unlocking and frames < 140) or (already unlocked and frames < 300)
lerpStartX = hudCTR->x;
lerpStartY = hudCTR->y;
lerpEndX = lerpStartX + 0x10;
lerpEndY = lerpStartY + 0x10;
currFrame = elapsedFrames;
lerpFrames = FPS_DOUBLE(8);

// If you have not unlocked this CTR Token
Expand All @@ -97,9 +103,9 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
scaleDown = scaleDown >> 10;

// lerp letters off-screen
if (elapsedFrames > FPS_DOUBLE(230))
if (elapsedFrames >= FPS_DOUBLE(230))
{
currFrame = elapsedFrames - FPS_DOUBLE(230);
elapsedFrames -= FPS_DOUBLE(230);

lerpStartX += 0x10;
lerpStartY += 0x50;
Expand All @@ -108,9 +114,9 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
}

// lerp letters to center
else if (elapsedFrames > FPS_DOUBLE(140))
else if (elapsedFrames >= FPS_DOUBLE(140))
{
currFrame = elapsedFrames - FPS_DOUBLE(140);
elapsedFrames -= FPS_DOUBLE(140);

lerpStartX += 0x10;
lerpStartY += 0x10;
Expand Down Expand Up @@ -145,7 +151,7 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
// but they passed "elapsedFrames-50" instead of "elapsedFrames-230", kills effect.
// txtStartX = 0x100;
// txtEndX = -150;
// currFrame = elapsedFrames - 50;
// elapsedFrames -= 50;

// lerp on-screen: CTR TOKEN AWARDED
txtStartX = 0x264;
Expand All @@ -155,7 +161,7 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
&txtPos[0],
txtStartX, 0xA6,
txtEndX, 0xA6,
currFrame, FPS_DOUBLE(8));
elapsedFrames, FPS_DOUBLE(8));

txtColor = (gGT->timer & FPS_DOUBLE(1)) ? 0xFFFF8003 : 0xFFFF8004;

Expand All @@ -169,7 +175,7 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
&letterPos[0],
lerpStartX, lerpStartY,
lerpEndX, lerpEndY,
currFrame, FPS_DOUBLE(8));
elapsedFrames, FPS_DOUBLE(8));

hudToken->flags &= ~HIDE_MODEL;
hudToken->matrix.t[0] = hudT->matrix.t[0];
Expand All @@ -183,10 +189,9 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
// If you already have this CTR Token unlocked
else
{
// or <= ?
if (elapsedFrames > FPS_DOUBLE(300))
if (elapsedFrames >= FPS_DOUBLE(300))
{
currFrame = elapsedFrames - FPS_DOUBLE(300);
elapsedFrames -= FPS_DOUBLE(300);

lerpStartX = hudCTR->x + 0x10;
lerpStartY = hudCTR->y + 0x10;
Expand All @@ -199,7 +204,7 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
&letterPos[0],
lerpStartX, lerpStartY,
lerpEndX, lerpEndY,
currFrame, lerpFrames);
elapsedFrames, lerpFrames);

// variable reuse, frame timers
lerpStartY = 0;
Expand Down Expand Up @@ -256,9 +261,11 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
// Draw how much time it took to finish laps and race
DECOMP_AA_EndEvent_DisplayTime(i, lerpEndY);
}

elapsedFrames = sdata->framesSinceRaceEnded;

// If it hasn't been 1 second from race ended
if (elapsedFrames < FPS_DOUBLE(29))
if (elapsedFrames < FPS_DOUBLE(30))
return;

// If there is one player
Expand Down Expand Up @@ -399,43 +406,38 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
// If you have not pressed X
if ((sdata->AnyPlayerTap & 0x50) == 0)
return;

// clear gamepad input

// === If Pressed X ===

RECTMENU_ClearInput();

sdata->Loading.OnBegin.AddBitsConfig0 |= ADVENTURE_ARENA;
sdata->Loading.OnBegin.RemBitsConfig0 |= (ADVENTURE_BOSS | TOKEN_RACE);

// if event was not won
if (driver->driverRank > 0)
// If you are in boss mode
if (gGT->gameMode1 < 0)
{
// pass pointer to menu buffer that shows Retry / Exit To Map,
// identical to buffer in 221 dll, except this one in EXE space
RECTMENU_Show(&data.menuRetryExit);
sdata->Loading.OnBegin.AddBitsConfig8 |= SPAWN_AT_BOSS;
}

// record that the menu is now showing
if (!boolWin)
{
RECTMENU_Show(&data.menuRetryExit);
sdata->menuReadyToPass |= 1;
return;
}

// If you won the race
// If you have pressed X to continue...
// === If you won the race ===

sdata->framesSinceRaceEnded = 0;
sdata->numIconsEOR = 1;

// when loading is done, add flag for "In Adventure Arena"
sdata->Loading.OnBegin.AddBitsConfig0 |= ADVENTURE_ARENA;

// Load the levelID for Adventure Hub that you came from
levSpawn = gGT->prevLEV;

// If you are in boss mode
if (gGT->gameMode1 < 0)
{
// when loading is done, add flag for "spawn near boss door"
sdata->Loading.OnBegin.AddBitsConfig8 |= 1;

// when loading is done, remove flag for Boss Mode
sdata->Loading.OnBegin.RemBitsConfig0 |= ADVENTURE_BOSS;

// bitIndex of keys unlocked, and boss beaten
bitIndex = gGT->bossID + 0x5e;

Expand Down Expand Up @@ -476,18 +478,6 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
}
}
}
// if you are in token race
else if ((gGT->gameMode2 & 0x8) != 0)
{
// If you have collected 3 letters (C, T, and R)
if (driver->PickupLetterHUD.numCollected == 3)
{
// set bit to tokens
bitIndex = gGT->levelID + 0x4c;
// when loading is done, remove flag for CTR Challenge
sdata->Loading.OnBegin.RemBitsConfig8 |= TOKEN_RACE;
}
}

// if something needs unlocking
if(bitIndex > 0)
Expand Down
Loading