Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
268 commits
Select commit Hold shift + click to select a range
29b098a
comments
Feb 8, 2025
0f87abe
boss cutscene comments
Feb 8, 2025
8d0a129
comments
Feb 8, 2025
691e415
comments
Feb 8, 2025
afc21b6
comments
Feb 8, 2025
060a215
comments
Feb 8, 2025
a0d16ba
comments
Feb 8, 2025
d8fdb72
comments
Feb 8, 2025
2b73fe5
comments
Feb 8, 2025
5de7d64
comments
Feb 8, 2025
77cc434
comments
Feb 8, 2025
34eab4c
comments
Feb 8, 2025
e358d9a
comments
Feb 8, 2025
2af8efd
comments
Feb 8, 2025
91c515a
comments
Feb 8, 2025
aec8242
comments
Feb 8, 2025
fd074e2
comments
Feb 8, 2025
6dd83ba
comments
Feb 8, 2025
d437f25
comments
Feb 8, 2025
8f6acc6
comments
Feb 8, 2025
4dfe185
comments
Feb 8, 2025
7bcd4dd
comments
Feb 8, 2025
1c800df
comments
Feb 8, 2025
2ea7e09
progress
Feb 8, 2025
e863df9
progress
Feb 8, 2025
7b1e7b2
boss cutscene struct data
Feb 8, 2025
68e42a7
progress
Feb 8, 2025
42b092d
almost got boss cutscenes working, but Roos head is on his feet
Feb 8, 2025
eed385c
progress
Feb 8, 2025
70b7934
progress
Feb 8, 2025
09b6cb6
roo head fix
Feb 8, 2025
3ce1d6d
progress
Feb 9, 2025
e3d19f6
3 new functions
Feb 9, 2025
60ecb9e
TeleportSelf working
Feb 9, 2025
648aa13
TeleportSelf working
Feb 9, 2025
c38f07c
TeleportSelf working
Feb 9, 2025
4d7b51a
TeleportSelf working
Feb 9, 2025
dcf68f4
TeleportSelf working
Feb 9, 2025
1732596
74%
Feb 9, 2025
e82a460
bugfixes
Feb 9, 2025
3efae5e
fix post-roo door spawn
Feb 9, 2025
97529d0
fix post-roo door spawn
Feb 9, 2025
a6eb033
plant bugfix
Feb 9, 2025
d648c5c
optimization, removes entire loop
Feb 11, 2025
cdcf28d
bugfixes
Feb 11, 2025
326e84a
remove dead code
Feb 11, 2025
c7db083
move sps lower to collision function
Feb 12, 2025
c5ec281
new mode found
Feb 12, 2025
56c973d
rename flags
Feb 12, 2025
9f0e267
OnlineCTR fixes
Feb 12, 2025
0307ff6
60fps fixes
Feb 12, 2025
bdfab16
progress
Feb 12, 2025
7edcd3f
gameModeEnd
Feb 13, 2025
51cda2b
comments
Feb 13, 2025
84964d1
overlay rewrite
Feb 13, 2025
d5f6fd0
progress
Feb 15, 2025
6b38281
progress
Feb 15, 2025
f6001fb
progress
Feb 15, 2025
17c682a
start implementing custom levels into decomp
Feb 15, 2025
8539d8f
more custom level progress
Feb 15, 2025
29228ee
more custom level progress
Feb 15, 2025
664ef96
custom level fixes
Feb 15, 2025
fd53c7f
remove Prim expansion for custom levels, put back later
Feb 15, 2025
75dc9dd
custom levels progress
Feb 15, 2025
f71336b
custom levels progress
Feb 15, 2025
e9236a1
custom levels work in decomp builds
Feb 15, 2025
3ed429f
relic fix
Feb 15, 2025
37a89cd
remove map hack, decomp build is nullptr safe
Feb 15, 2025
07aa7e0
rename extra driver models
Feb 15, 2025
e957af8
remove dead code
Feb 15, 2025
ef178b0
debug menu functions in 603
Feb 16, 2025
008ef77
debug menu functions in 603
Feb 16, 2025
78c7856
start of profiler integration into retail
Feb 16, 2025
cdd6173
profiler progress
Feb 16, 2025
38eaf71
debug profiler partially implemented, 1132 byte budget left
Feb 16, 2025
5ee1e2a
debug menu start
Feb 16, 2025
9b7663e
debug menu start
Feb 16, 2025
674c3a3
reset common.h
Feb 16, 2025
63fa227
progress
Feb 16, 2025
439ed10
progress
Feb 16, 2025
2110e50
timer progress
Feb 16, 2025
791dc88
debug progress
Feb 16, 2025
578da25
profiler working
Feb 16, 2025
be035e0
profiler progress
Feb 16, 2025
01fe166
profiler vsync/drawsync
Feb 17, 2025
7da2be7
pc port fixes
Feb 17, 2025
f3ad56c
progress
Feb 17, 2025
069a54c
more profiler
Feb 17, 2025
afe0137
DebugMenu flag renamed
Feb 17, 2025
00026f1
DebugMenu structs
Feb 17, 2025
698e788
progress
Feb 17, 2025
52739b3
debug menu encoding progress
Feb 17, 2025
dd635b9
debug menu progress
Feb 17, 2025
1ca2bb9
debug menu draws
Feb 17, 2025
8d2a96e
debug font in debug menus
Feb 17, 2025
402a773
progress
Feb 17, 2025
2e88730
progress
Feb 17, 2025
06ba88f
folder added
Feb 17, 2025
4482bd9
debug menu progress
Feb 17, 2025
744fc94
pc port workaround transparency
Feb 17, 2025
d6294e4
fixes
Feb 17, 2025
ae3ce29
debug progress
Feb 17, 2025
bc91a66
debug menu loads levels properly
Feb 17, 2025
6480de6
bugfix
Feb 17, 2025
c438fe3
debug menu Square for GO-BACK
Feb 17, 2025
195da30
progress
Feb 17, 2025
70344bd
timers in pc port
Feb 17, 2025
a8ca0af
Faradise garage rewrite
Feb 18, 2025
70db68a
UI progress
Feb 18, 2025
9e057b3
UI_VS progress
Feb 18, 2025
7e833d0
UI_VS progress
Feb 18, 2025
6142dd3
UI_VS progress
Feb 18, 2025
b596e8d
progress
Feb 18, 2025
84aef18
progress
Feb 18, 2025
900b7ff
progress
Feb 18, 2025
d7daeab
quip progress
Feb 18, 2025
a6873ae
quip progress
Feb 18, 2025
6706049
quip progress
Feb 18, 2025
f2ede02
UI_VsReadDriver
Feb 18, 2025
07501f6
progress
Feb 18, 2025
382f341
test for persistent primitives
Feb 19, 2025
4dfc30c
USE_PCDRV (untested)
Feb 19, 2025
7ee2d39
v1 fixes
Feb 19, 2025
9dbf0cb
PCDRV read=0
Feb 19, 2025
d270428
PCDRV size fix
Feb 19, 2025
4a4090b
progress
Feb 19, 2025
764904e
PCDRV draws copyright
Feb 19, 2025
ed1e502
progress
Feb 19, 2025
7ee34cb
progress
Feb 19, 2025
41873c0
LOAD queue refactor, removes hacky fixes from OG game
Feb 19, 2025
ebba10a
PCDRV enters gameplay
Feb 19, 2025
1bf7250
OG bugfix
Feb 19, 2025
edadec4
rename to XnfFile
Feb 20, 2025
3ed373f
rename function
Feb 20, 2025
4e3a2e4
variable rename
Feb 20, 2025
fc9a353
Remove dead code, no more size pointers in load queue
Feb 20, 2025
6c9a1a5
progress
Feb 21, 2025
fbb3a19
LOAD refactor
Feb 21, 2025
47fba8f
pc fix
Feb 21, 2025
e5d180a
pc fix
Feb 21, 2025
6ddafd4
pc port hacks removed
Feb 21, 2025
1653671
save 300 bytes
Feb 21, 2025
81d4fd7
more defrag
Feb 21, 2025
76e1a1c
progress
Feb 21, 2025
5268428
ci: move servers to 64; prioritize mingw32 online-server; fix GCC14 …
PedroHLC Feb 21, 2025
592e8b1
pc port fixes
Feb 21, 2025
a0e8654
USE_DEFRAG -> USE_ALTMODS
Feb 21, 2025
c912b75
fixes
Feb 21, 2025
60d1c45
OnlineCTR organizing
Feb 22, 2025
df99043
debug menu progress
Feb 22, 2025
58a04ee
debug menu progress
Feb 22, 2025
5a8fb43
dbg characters work
Feb 22, 2025
a4e9e71
FakeCrash->FCrash
Feb 23, 2025
42eb769
bugfix
Feb 23, 2025
8b0d182
coll notes
Feb 23, 2025
9af4487
coll notes
Feb 23, 2025
1519371
coll notes
Feb 23, 2025
bad2063
coll notes
Feb 23, 2025
a981d49
coll notes
Feb 23, 2025
70dff9c
coll notes
Feb 23, 2025
f887cdf
coll notes
Feb 23, 2025
b79ebec
coll notes
Feb 23, 2025
251aeeb
coll notes
Feb 23, 2025
b565392
coll notes
Feb 23, 2025
493f1b9
coll notes
Feb 23, 2025
ebfcee1
coll notes
Feb 23, 2025
258a63a
coll notes
Feb 23, 2025
035680a
coll notes
Feb 23, 2025
3b8ea64
coll notes
Feb 23, 2025
57c21fe
progress
Feb 23, 2025
3fcdacf
progress
Feb 23, 2025
e7abe2b
coll progress
Feb 23, 2025
8b21893
coll progress
Feb 23, 2025
b03bbde
coll progress
Feb 23, 2025
af4334e
coll progress
Feb 23, 2025
be0517c
coll progress
Feb 23, 2025
036e850
coll progress
Feb 23, 2025
859b923
coll progress
Feb 23, 2025
8134de5
coll progress
Feb 23, 2025
68452c7
coll progress
Feb 23, 2025
340efdf
coll progress
Feb 23, 2025
00d40da
coll progress
Feb 23, 2025
ae18e6a
coll progress
Feb 23, 2025
eddc08b
coll progress
Feb 23, 2025
7276251
coll progress
Feb 23, 2025
bf9ed2e
coll progress
Feb 23, 2025
f57517c
coll progress
Feb 23, 2025
29ba214
coll progress
Feb 23, 2025
7688868
coll progress
Feb 23, 2025
43a31ca
coll progress
Feb 23, 2025
8c426f8
coll progress
Feb 23, 2025
5f4eb7a
coll progress
Feb 23, 2025
a731c23
notes
Feb 23, 2025
0798bc0
notes
Feb 23, 2025
342de3e
COLL refactor
Feb 23, 2025
1dd1506
comments
Feb 23, 2025
92ff4f6
progress
Feb 24, 2025
d73031c
progress
Feb 24, 2025
f2460d2
progress
Feb 24, 2025
31aa59e
progress
Feb 24, 2025
efe5436
progress
Feb 26, 2025
cf64f2f
vismem progress
Mar 4, 2025
2675f12
vismem progress
Mar 4, 2025
ec40a96
vismem progress
Mar 4, 2025
f412207
vismem progress
Mar 4, 2025
d28700e
vismem progress
Mar 4, 2025
c577fc3
vismem progress
Mar 4, 2025
c364619
vismem progress
Mar 4, 2025
3d60320
cam progress
Mar 4, 2025
9bae19f
cam progress
Mar 4, 2025
75d100e
cam progress BlastedLerp struct
Mar 4, 2025
ae2a147
cleanup
Mar 5, 2025
0ecef8f
cleanup
Mar 5, 2025
48bc970
cleanup
Mar 5, 2025
c158279
cleanup
Mar 5, 2025
e6f82f7
cleanup
Mar 5, 2025
f217dd5
PushBuffer 2 new funcs (thanks Faradise)
Mar 6, 2025
487426b
struct rename
Mar 6, 2025
f80a86e
optimization
Mar 8, 2025
784083b
optimization
Mar 8, 2025
eabcef6
advgarage bugfix
Mar 8, 2025
5771ce5
progress
Mar 8, 2025
f3b30d2
Remove Hardware CriticalSection, use Software CriticalSection
Mar 8, 2025
4bc9924
defrag MAIN, required for byte budget, fixes Software CriticalSection
Mar 8, 2025
9551377
progress
Mar 9, 2025
5ac0778
bugfix
Mar 9, 2025
35b6526
debug menu DEPTH fix
Mar 9, 2025
4761698
profiler 16x9
Mar 9, 2025
a84f638
226 test and profiler print
Mar 9, 2025
88b386d
profiling for 226
Mar 9, 2025
72cd0c9
226 test progress
Mar 9, 2025
72054ba
loading screen optimizations
Mar 9, 2025
e1d8b19
progress
Mar 11, 2025
96e9619
remove critical sections
Mar 11, 2025
2b30a68
bugfix
Mar 11, 2025
0de8ca3
boss spawn fix
Mar 11, 2025
09ce0d0
LOAD full defrag
Mar 12, 2025
931e797
remove outdated benchmark
Mar 12, 2025
ad77d3e
progress
Mar 12, 2025
3f65295
MEMPACK_Init refactor
Mar 12, 2025
96406c2
clearity
Mar 12, 2025
ec6417d
bugfix
Mar 12, 2025
1ff6add
progress
Mar 13, 2025
c08442e
optimization
Mar 13, 2025
96af6c6
bugfix
Mar 13, 2025
0901bc6
RenderStars and Decomp (#208)
FRDS Mar 13, 2025
61ca532
add semicolon
Mar 13, 2025
248a0fb
add another semicolon
Mar 13, 2025
5165e00
pc port fix
Mar 13, 2025
7bd0497
fix VRAM load (#209)
mateusfavarin Mar 14, 2025
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