Skip to content

Commit 18b2196

Browse files
authored
Fix warnings (#200)
* Fix a bunch of warnings * Fix more warnings. Some warnings aren't obvious how to fix. * fix a bunch of downcast warnings in DATA * fix a few more, mostly forward decls * move forward decls to decomp_/functions.h * unfinished stuff, doesn't compile but trying to fix warnings. RB_Hazard_HurtDriver's return type is ambiguous atm * fix signatures and compiles * renamed RB_Hazard_HurtDriver to DECOMP_ * fixed a bunch more warnings. * fixed more warnings, re-decomped a couple of functions, begin D231 * fixed more warnings * fix more warnings * more warnings * more warnings * fix more warnings, changed some signatures, fixed return->return (int) for some LInC functions * Fixed a bunch more warnings * fixed a bunch more warnings * Fixed a bunch more warnings, only have a few tricky ones left. * Fixed a few more warnings * fix some pc rebuild warnings * fixed signature types and some local variable types * more type fixes * fixed a bunch more warnings, fixed missing function parameters for some callbacks * I think that's all? * fix road hazards and warp orbs * fix spider web * Update CrashTeamRacingPC.vcxproj.user * fix a return type in signature * fixed a warnings from the merge * added some comments. I think the credits ghost bug is due to byteBudget/clobbering * small changes trying to figure out the credits bug * commit for large test * fix another warning * switched file naming convention for BOTS * Fix file naming convention for more files, rewrite of byteBudget/main.py * Fixed a bunch more naming conventions * fix more naming schemes. ModsX.c/ModsMain.c is nonfunctional until further notice * moving functions to rdata is causing problems, disabled the decomp for MATH_Sin, LibraryOfModels_Store, PROC_SearchForModel * re-enable 233 cs credits functions * update bytebudget to display more info * fix pc port include paths * fix naming of main functions for bytebudget * Fix credits bug. * fix more naming * fix more naming conventions * Fixed the rest of the naming in Vehicle. a couple of functions are overbudget. * fix more naming * repaired mods * disable online/defrag * disable mixrng decomp * Decomp for MainFrame_HaveAllPads. * re-enable mixrng getvalue * fix 230/1 and modify byteBudget to recognize howl naming * add comments * add 23x entries for "FULL" bytebudget.
1 parent 18286ac commit 18b2196

File tree

735 files changed

+6901
-4716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

735 files changed

+6901
-4716
lines changed

decompile/General/221/221_Full.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ const short hub[8] =
1515

1616
extern struct MenuRow rows221[3];
1717
extern struct RectMenu menu221;
18-
19-
int DECOMP_UI_ConvertX_2(int x, int const_0x200);
20-
int DECOMP_UI_ConvertY_2(int y, int const_0x200);
21-
void DECOMP_UI_DrawNumCrystal(short x, short y, struct Driver* d);
22-
void RECTMENU_ClearInput();
23-
void RECTMENU_Show(struct RectMenu*);
2418

2519
void DECOMP_CC_EndEvent_DrawMenu()
2620
{

decompile/General/222/222_Full.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
static int str_number = 0x20; // " \0"
44
extern struct RectMenu menu222;
55

6-
void DECOMP_AA_EndEvent_DisplayTime(short driverId, short param_2);
7-
86
void DECOMP_AA_EndEvent_DrawMenu(void)
97
{
108
struct GameTracker *gGT;
@@ -315,7 +313,7 @@ void DECOMP_AA_EndEvent_DrawMenu(void)
315313

316314
// print a single character, a number 1-8,
317315
DecalFont_DrawLine(
318-
&str_number, letterPos[0] + 0x20, 0x5f, 2, 4);
316+
(char*)&str_number, letterPos[0] + 0x20, 0x5f, 2, 4);
319317

320318
// Draw the driver's character icon
321319
DECOMP_UI_DrawDriverIcon(

decompile/General/223/223_Full.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
// this goes to footer
88
static int str_number = 0x20; // " \0"
99

10-
void DECOMP_RR_EndEvent_UnlockAward();
11-
void DECOMP_RR_EndEvent_DrawHighScore(short startX, int startY);
12-
1310
// required to start on 8009f71c until we rewrite MainGameEnd_Initialize
1411
void JunkPadding223()
1512
{
@@ -606,7 +603,7 @@ void DECOMP_RR_EndEvent_DrawHighScore(short startX, int startY)
606603
str_number = (char)i + '1';
607604

608605
// Draw String for Rank ('1', '2', '3', '4', '5')
609-
DecalFont_DrawLine(&str_number, startX - 0x32, timebox_Y - 1, 2, 4);
606+
DecalFont_DrawLine((char*)&str_number, startX - 0x32, timebox_Y - 1, 2, 4);
610607

611608
u_int iconColor = 0x808080;
612609

decompile/General/224/224_Full.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ extern struct RectMenu menu224;
77
extern struct MenuRow rowsWithSave[6];
88
extern struct MenuRow rowsNoSave[5];
99

10-
void DECOMP_TT_EndEvent_DisplayTime(int paramX, short paramY, u_int UI_DrawRaceClockFlags);
11-
1210
void DECOMP_TT_EndEvent_DrawMenu(void)
1311
{
1412
int framesSinceRaceEnded;
@@ -412,7 +410,7 @@ void DECOMP_TT_EndEvent_DrawHighScore(short startX, int startY)
412410
str_number = (char)i + '1';
413411

414412
// Draw String for Rank ('1', '2', '3', '4', '5')
415-
DecalFont_DrawLine(&str_number, startX - 0x32, timebox_Y - 1, 2, 4);
413+
DecalFont_DrawLine((char*)&str_number, startX - 0x32, timebox_Y - 1, 2, 4);
416414

417415
u_int iconColor = 0x808080;
418416

decompile/General/225/225_Full.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
4141
short sVar9;
4242
int iVar10;
4343
int iVar11;
44-
u_int uVar13;
4544
int iVar14;
4645
u_short uStack112;
4746
short sStack104;
@@ -76,6 +75,7 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
7675
// lng index for BATTLE
7776
iVar10 = 0x50;
7877

78+
short yCoord;
7979
// if you are not in battle mode
8080
if ((gGT->gameMode1 & 0x20) == 0)
8181
{
@@ -85,7 +85,7 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
8585
// number of battle teams
8686
uStack96 = numPlyr;
8787

88-
uVar13 = VsPosY_Config[VsPosY_NUM*VsConfigIndex + VsPosY_TITLE];
88+
yCoord = VsPosY_Config[VsPosY_NUM*VsConfigIndex + VsPosY_TITLE];
8989
}
9090
// if you are in battle mode
9191
else
@@ -100,7 +100,7 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
100100
asStack128[gGT->drivers[iVar11]->BattleHUD.teamID]++;
101101
}
102102

103-
uVar13 = 0xd8 - ((gGT->battleSetup.numTeams + -1) * 10 + numPlyr * 0x1a + 0x28) >> 1;
103+
yCoord = 0xd8 - ((gGT->battleSetup.numTeams + -1) * 10 + numPlyr * 0x1a + 0x28) >> 1;
104104
}
105105

106106
// Disable drawing lines between multiplayer screens
@@ -123,11 +123,11 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
123123
// fly-in interpolation
124124
DECOMP_UI_Lerp2D_Linear(
125125
&pos[0],
126-
0x296, uVar13,
127-
uVar7, uVar13,
126+
0x296, yCoord,
127+
uVar7, yCoord,
128128
iVar11, FPS_DOUBLE(5));
129129

130-
iVar14 = uVar13 + 0x28;
130+
iVar14 = yCoord + 0x28;
131131

132132
// "Versus" or "Battle"
133133
DecalFont_DrawLine(
@@ -263,12 +263,13 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
263263
iVar2 = iVar10 + 1;
264264

265265
// string for each player rank and count from standings (0x1e80)
266-
sprintf(0x1f800000, "%d%s-%2.02ld", iVar2,
266+
sprintf((char*)0x1f800000, "%d%s-%2.02ld", iVar2, //todo: replace 0x1f800000 with reference to scratchpad
267267
sdata->lngStrings[0x19+iVar10],
268268
(gGT->standingsPoints[gGT->battleSetup.unk1dc8[iVar11] * 3 + iVar10]));
269269

270270
// Draw string
271-
DecalFont_DrawLine(0x1f800000, (pos[0] + 0x79), ((uStack112 - (iVar6 * 4 + -0xd)) + iVar10 * 8), 2, uVar7);
271+
//todo: replace 0x1f800000 with reference to scratchpad
272+
DecalFont_DrawLine((char*)0x1f800000, (pos[0] + 0x79), ((uStack112 - (iVar6 * 4 + -0xd)) + iVar10 * 8), 2, uVar7);
272273
}
273274
}
274275

@@ -291,18 +292,20 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
291292
iStack44 = iStack44 + FPS_DOUBLE(5);
292293

293294
sStack80 = gGT->battleSetup.unk_afterTeams[gGT->battleSetup.unk1dc8[iVar11]];
294-
sprintf(0x1f800000, "%d%s", sVar1 + 1, sdata->lngStrings[0x19+sVar1]);
295+
//todo: replace 0x1f800000 with reference to scratchpad
296+
sprintf((char*)0x1f800000, "%d%s", sVar1 + 1, sdata->lngStrings[0x19+sVar1]);
295297

296298
// Draw String
297-
DecalFont_DrawLine(0x1f800000, (pos[0] - 0x24), (uStack112 + 5), 1, 0xffff8000);
299+
//todo: replace 0x1f800000 with reference to scratchpad
300+
DecalFont_DrawLine((char*)0x1f800000, (pos[0] - 0x24), (uStack112 + 5), 1, 0xffff8000);
298301
}
299302
}
300303

301-
for (uVar13 = 0; uVar13 < numPlyr; uVar13++)
304+
for (unsigned char plCount = 0; plCount < (unsigned char)numPlyr; plCount++)
302305
{
303306
// get pointer to instance of Big Number in HUD
304-
bigNum = gGT->drivers[uVar13]->instBigNum;
305-
view = &gGT->pushBuffer[uVar13];
307+
bigNum = gGT->drivers[plCount]->instBigNum;
308+
view = &gGT->pushBuffer[plCount];
306309

307310
// if the pointer is valid
308311
if (bigNum != NULL)
@@ -319,7 +322,7 @@ void DECOMP_VB_EndEvent_DrawMenu(void)
319322
// if this is not battle mode, get first place racer, else get battle winner
320323
uVar3 = ((gGT->gameMode1 & 0x20) == 0) ? gGT->driversInRaceOrder[0]->driverID : gGT->winnerIndex[0];
321324

322-
if (uVar3 != uVar13)
325+
if (uVar3 != plCount)
323326
goto LAB_8009ff4c;
324327

325328
// === PushBuffer is the winner ===

decompile/General/230/230_Block1.c renamed to decompile/General/230/230_00_38_MM_Battle_DrawIcon_Character.c

File renamed without changes.

decompile/General/230/230_02_MM_Title_MenuUpdate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void DECOMP_MM_Title_MenuUpdate(void)
125125
case 0:
126126

127127
DECOMP_MM_Title_KillThread();
128-
DECOMP_GAMEPROG_NewProfile_InsideAdv(&sdata->advProgress.rewards);
128+
DECOMP_GAMEPROG_NewProfile_InsideAdv(&sdata->advProgress);
129129

130130
sdata->advProfileIndex = 0xffff;
131131

decompile/General/230/230_Block2.c renamed to decompile/General/230/230_40_54_MM_Characters_AnimateColors.c

File renamed without changes.

decompile/General/230/230_44_MM_Characters_DrawWindows.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ void DECOMP_MM_Characters_DrawWindows(int boolShowDrivers)
125125

126126
iVar6 = iVar14;
127127

128-
struct InstDrawPerPlayer* idpp =
129-
INST_GETIDPP(iVar10);
128+
struct InstDrawPerPlayer* idpp = INST_GETIDPP(iVar10);
130129

131130
// clear pushBuffer in every InstDrawPerPlayer
132131
idpp[0].pushBuffer = 0;
@@ -215,7 +214,7 @@ void DECOMP_MM_Characters_DrawWindows(int boolShowDrivers)
215214
rot[2] = D230.csm_instRot[2];
216215

217216
// converted to TEST in rebuildPS1
218-
ConvertRotToMatrix(&iVar10->matrix.m[0][0], &rot[0]);
217+
ConvertRotToMatrix(&iVar10->matrix, &rot[0]);
219218
}
220219
return;
221220
}

0 commit comments

Comments
 (0)