Skip to content

Commit 6affb14

Browse files
author
Niko
committed
raw track loader
1 parent d6ac5b1 commit 6affb14

24 files changed

+2033
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python ../../../../../tools/mod-builder/main.py
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
// loads bigfile 221 as lev
3+
common, exe, LOAD_TenStages, 0x0, src/LOAD_TenStages.c
4+
5+
// sets lev to bigfile 221
6+
926, 221, 0x8009f6fc, 0x0, src/dataLEV.bin
7+
926, 222, 0x8009f6fc, 0x0, src/dataVRAM.bin
8+
9+
// disable LevInstDef_UnPack
10+
common, exe, LevInstDef_UnPack, 0x0, src/return1.c
11+
12+
// disable map
13+
common, exe, UI_Map_DrawRawIcon, 0x0, src/return3.c
14+
15+
// disable LevInstQueue
16+
// required? or just needed cause I messed up? crashes in relocate attempts
17+
common, exe, RenderBucket_QueueLevInstances, 0x0, src/disableQueueLevInst.c
18+
19+
// Battle weapons
20+
common, exe, BOTS_SetRotation, -0x8, src/battle_hookUpdate.s
21+
common, exe, MainInit_StringToLevID, -0x8, src/battle_hookInit.s
22+
common, exe, rdata_free, 0x0, src/battle_runtime.c
23+
24+
// 230
25+
common, 230, MM_Characters_MenuProc, 0x0, src/230_50_MM_Characters_MenuProc.c
26+
common, 230, MM_MenuProc_Main, 0x0, src/230_31_MM_MenuProc_Main.c
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
#include <common.h>
2+
3+
void DECOMP_MM_MenuProc_Main(struct RectMenu* mainMenu)
4+
{
5+
int choose;
6+
struct GameTracker* gGT = sdata->gGT;
7+
8+
// disabled for CustomLevel3
9+
10+
//// if scrapbook is unlocked
11+
//if ((sdata->gameProgress.unlocks[1] & 0x10) != 0)
12+
//{
13+
//// change D230.rowsMainMenuBasic
14+
//// to D230.rowsMainMenuWithScrapbook
15+
//mainMenu->rows = &D230.rowsMainMenuWithScrapbook[0];
16+
//}
17+
18+
#if 1
19+
char* info = "Raw Track Tester: 1P Version";
20+
DecalFont_DrawLine(info, 5, 197, FONT_SMALL, ORANGE);
21+
DecalFont_DrawLine(__DATE__, 5, 206, FONT_SMALL, ORANGE);
22+
DecalFont_DrawLine(__TIME__, 170, 206, FONT_SMALL, ORANGE);
23+
#endif
24+
25+
MM_ParseCheatCodes();
26+
27+
MM_ToggleRows_Difficulty();
28+
29+
MM_ToggleRows_PlayerCount();
30+
31+
// If you are at the highest hierarchy level of main menu
32+
if (mainMenu->unk1e == 1)
33+
{
34+
MM_Title_MenuUpdate();
35+
36+
if (
37+
(
38+
// If you are in main menu
39+
(D230.MM_State == 1) &&
40+
41+
// if "title" object exists
42+
(D230.titleObj != NULL)
43+
) &&
44+
(FPS_DOUBLE(229) < D230.timerInTitle)
45+
)
46+
{
47+
// "TM" trademark string
48+
DecalFont_DrawLineOT(
49+
sdata->lngStrings[0x244],0x10e,0x9c,FONT_SMALL,ORANGE,
50+
&gGT->backBuffer->otMem.startPlusFour[3]);
51+
}
52+
53+
#if 0
54+
// DISABLED DEMO MODE
55+
#endif
56+
57+
// 900 = 30 seconds at 30fps
58+
gGT->demoCountdownTimer = FPS_DOUBLE(900);
59+
}
60+
61+
MM_Title_Init();
62+
63+
// if drawing ptrNextBox_InHierarchy
64+
if ((mainMenu->state & 0x10) != 0) {
65+
D230.timerInTitle = 1000;
66+
}
67+
68+
if ((mainMenu->state & 0x400) == 0) {
69+
return;
70+
}
71+
72+
struct Title* titleObj = D230.titleObj;
73+
74+
// if "title" object exists
75+
if (titleObj != NULL)
76+
{
77+
// CameraPosOffset X
78+
titleObj->cameraPosOffset[0] = 0;
79+
}
80+
81+
// if you are at highest level of menu hierarchy
82+
if (mainMenu->unk1e != 0)
83+
{
84+
// leave the function
85+
return;
86+
}
87+
88+
// If you are here, then you must not be
89+
// at the highest level of menu hierarchy
90+
91+
// if row is negative, do nothing
92+
if ((mainMenu->rowSelected) < 0) {
93+
return;
94+
}
95+
96+
// clear flags from game mode
97+
gGT->gameMode1 &= ~(BATTLE_MODE | ADVENTURE_MODE | TIME_TRIAL | ADVENTURE_ARENA | ARCADE_MODE | ADVENTURE_CUP);
98+
99+
// clear more game mode flags
100+
gGT->gameMode2 &= ~(CUP_ANY_KIND);
101+
102+
// set a flag that you're in main menu
103+
mainMenu->state |= 4;
104+
105+
// number of laps is 3
106+
gGT->numLaps = 3;
107+
108+
// get LNG index of row selected
109+
choose = (int)mainMenu->rows[mainMenu->rowSelected].stringIndex;
110+
111+
// choose Adventure
112+
if (choose == 0x4c)
113+
{
114+
// Turn on Adventure Mode, turn off item cheats
115+
gGT->gameMode1 |= ADVENTURE_MODE;
116+
gGT->gameMode2 &= ~(CHEAT_WUMPA | CHEAT_MASK | CHEAT_TURBO | CHEAT_ENGINE | CHEAT_BOMBS);
117+
118+
// menu for new/load
119+
mainMenu->ptrNextBox_InHierarchy = &D230.menuAdventure;
120+
mainMenu->state |= 0x10;
121+
return;
122+
}
123+
124+
// If you choose Time Trial in Main Menu
125+
if (choose == 0x4d)
126+
{
127+
// Leave main menu hierarchy
128+
D230.MM_State = 2;
129+
130+
// Set next stage to 2 for Time Trial
131+
D230.desiredMenuIndex = 2;
132+
133+
// set number of players to 1
134+
gGT->numPlyrNextGame = 1;
135+
136+
// set game mode to Time Trial Mode
137+
gGT->gameMode1 |= TIME_TRIAL;
138+
gGT->gameMode2 &= ~(CHEAT_WUMPA | CHEAT_MASK | CHEAT_TURBO | CHEAT_ENGINE | CHEAT_BOMBS);
139+
return;
140+
}
141+
142+
// if one-lap-race cheat is enabled
143+
// works in Arcade, VS, not Adv, not Time Trial
144+
if ((gGT->gameMode2 & CHEAT_ONELAP) != 0)
145+
{
146+
gGT->numLaps = 1;
147+
}
148+
149+
if (choose == 0x4e)
150+
{
151+
// set game mode to Arcade Mode
152+
gGT->gameMode1 |= ARCADE_MODE;
153+
154+
// set next menu
155+
mainMenu->ptrNextBox_InHierarchy = &D230.menuRaceType;
156+
mainMenu->state |= 0x10;
157+
return;
158+
}
159+
160+
// if you entered VS mode
161+
if (choose == 0x4f)
162+
{
163+
// next menu is choosing single+cup
164+
mainMenu->ptrNextBox_InHierarchy = &D230.menuRaceType;
165+
mainMenu->state |= 0x10;
166+
return;
167+
}
168+
169+
// if you chose Battle
170+
if (choose == 0x50)
171+
{
172+
D230.characterSelect_transitionState = 2;
173+
174+
// set game mode to Battle Mode
175+
gGT->gameMode1 |= BATTLE_MODE;
176+
177+
// set next menu to 2P,3P,4P
178+
mainMenu->ptrNextBox_InHierarchy = &D230.menuPlayers2P3P4P;
179+
mainMenu->state |= 0x10;
180+
return;
181+
}
182+
183+
// if you chose High Score
184+
if (choose == 0x51)
185+
{
186+
// Set next stage to high score menu
187+
D230.desiredMenuIndex = 3;
188+
189+
// Leave main menu hierarchy
190+
D230.MM_State = 2;
191+
192+
return;
193+
}
194+
195+
// if you chose Scrapbook
196+
if (choose == 0x234)
197+
{
198+
// Set next stage to Scrapbook
199+
D230.desiredMenuIndex = 5;
200+
201+
// Leave main menu hierarchy
202+
D230.MM_State = 2;
203+
204+
return;
205+
}
206+
}
207+

0 commit comments

Comments
 (0)