Mods2, 780 bytes

This commit is contained in:
Niko 2024-02-23 11:42:54 -05:00
parent 8a32fcd45b
commit c76321b73f
10 changed files with 38 additions and 22 deletions

View File

@ -19,7 +19,6 @@ extern struct MenuBox menuBox221;
int UI_ConvertX_2(int x, int const_0x200);
int UI_ConvertY_2(int y, int const_0x200);
void DECOMP_UI_DrawNumCrystal(short x, short y, struct Driver* d);
void UI_DrawLimitClock(short x, short y, short fontSize);
void MENUBOX_ClearInput();
void MENUBOX_Show(struct MenuBox*);
@ -109,7 +108,7 @@ void DECOMP_CC_EndEvent_DrawMenu()
posXY[0], posXY[1],
FONT_BIG, (JUSTIFY_CENTER | ORANGE));
UI_DrawLimitClock(posXY[0]-0x33, posXY[1]+0x11, FONT_BIG);
DECOMP_UI_DrawLimitClock(posXY[0]-0x33, posXY[1]+0x11, FONT_BIG);
}

View File

@ -741,7 +741,8 @@ void DECOMP_AA_EndEvent_DisplayTime(short driverId, short param_2)
#endif
UI_Lerp2D_Linear(&posXY[0], lerpStartX, lerpEndY, lerpEndX, lerpEndY, currFrame, endFrame);
UI_DrawRaceClock(posXY[0], posXY[1], 1, driver);
DECOMP_UI_DrawRaceClock(posXY[0], posXY[1], 1, driver);
// "TOTAL"
width = DecalFont_GetLineWidth(sdata->lngStrings[0xc4], 1);

View File

@ -206,7 +206,8 @@ void DECOMP_RR_EndEvent_DrawMenu(void)
// interpolate fly-in
UI_Lerp2D_Linear(&pos[0], startX, 0x32, 0x100, endY, startFrame, FPS_DOUBLE(0x14));
UI_DrawRaceClock(pos[0], pos[1] - 8, 1, d);
DECOMP_UI_DrawRaceClock(pos[0], pos[1] - 8, 1, d);
if ((gGT->unknownFlags_1d44 & 0x2000000) != 0)
{
// if race ended less than 491 frames ago

View File

@ -73,7 +73,8 @@ AddStuff:
// draw race clock in top-left corner
UI_Lerp2D_Linear(&pos[0], 0x14, 8, startX_also_strFlags, 8, framesSinceRaceEnded, FPS_DOUBLE(0x14));
UI_DrawRaceClock((int)pos[0], (int)pos[1], 0, gGT->drivers[0]);
DECOMP_UI_DrawRaceClock((int)pos[0], (int)pos[1], 0, gGT->drivers[0]);
return;
}
@ -276,7 +277,7 @@ void DECOMP_TT_EndEvent_DisplayTime(int paramX, short paramY, u_int UI_DrawRaceC
// "YOUR TIME"
DecalFont_DrawLine(sdata->lngStrings[197], paramX, ((u_int)pos[1] - 0x4c), FONT_BIG, (JUSTIFY_CENTER | ORANGE));
UI_DrawRaceClock(pos[0], pos[1], UI_DrawRaceClockFlags, d);
DECOMP_UI_DrawRaceClock(pos[0], pos[1], UI_DrawRaceClockFlags, d);
rectangle.x = (pos[0] - textWidth) - 6;
rectangle.y = pos[1] - 0x50;

View File

@ -0,0 +1 @@
// not used yet

View File

@ -1,7 +1,10 @@
#include <common.h>
void UI_VsQuipReadDriver();
void UI_BattleDrawHeadArrows();
void Mods1_EndOfFile();
void Mods2_EndOfFile();
void ModsMain()
{
@ -14,8 +17,11 @@ void ModsMain()
printf("\n\n");
printf("Bytes Free for Mods\n");
// UI defrag
// UI defrag Block1
printf("Mods1: %d\n", (int)UI_VsQuipReadDriver - (int)Mods1_EndOfFile);
// UI defrag Block2
printf("Mods2: %d\n", (int)UI_BattleDrawHeadArrows - (int)Mods2_EndOfFile);
// add more...

View File

@ -0,0 +1,11 @@
#include <common.h>
#include "UI_DrawRaceClock.c"
#include "UI_DrawLimitClock.c"
#include "../AltMods/Mods2.c"
void Mods2_EndOfFile()
{
// leave empty
}

View File

@ -1,12 +1,12 @@
// 542+38+14+18+16+19+1+1+2+2+1+3+2+4+2+2+2+16+3+47-12 = 723 rewritten so far
// 542 for every 'common' and ','
// 541+38+14+18+16+19+1+1+1+2+2+1+3+2+4+2+2+2+16+3+47-12 = 723 rewritten so far
// 541 for every 'common' and ','
// additions for every file that has multiple functions,
// 38 for 230_Block1
// 14 for 230_Block2
// 18 for 230_Block3
// 16 for 232 adv hub
// 19 for the 20 UI functions
// most others for 231 or VehPtr
// +1 for UI Block #2
// +1 for DebugFont
// +1 for 222
// +2 for 223
@ -663,8 +663,10 @@ common, exe, UI_DrawDriverIcon, 0x0, General/UI/UI_DrawDriverIcon.c
common, exe, UI_Lerp2D_Angular, 0x0, General/UI/UI_Lerp2D_Angular.c
common, exe, UI_Lerp2D_HUD, 0x0, General/UI/UI_Lerp2D_HUD.c
common, exe, UI_Lerp2D_Linear, 0x0, General/UI/UI_Lerp2D_Linear.c
common, exe, UI_DrawRaceClock, 0x0, General/UI/UI_DrawRaceClock.c
common, exe, UI_DrawLimitClock, 0x0, General/UI/UI_DrawLimitClock.c
// squish 2 functions
common, exe, UI_DrawRaceClock, 0x0, General/UI/UI_AAA_BigBlock2.c
// UI_BattleDrawHeadArrows
// UI_TrackerSelf

View File

@ -67,7 +67,7 @@ void FUN_8009f710(void)
FUN_80022878(*(undefined4 *)(DAT_8008d878 + 0x5b4),(int)(short)uStack64,(int)(short)uStack62,1,
0xffff8000);
// Draw the Countdown Clock. First two params are PosX and PosY
// UI_DrawLimitClock
FUN_8004f894((int)(((uint)uStack64 - 0x33) * 0x10000) >> 0x10,
(int)(((uint)uStack62 + 0x11) * 0x10000) >> 0x10,1);

View File

@ -11588,7 +11588,7 @@ LAB_8004f378:
}
// countdown clock, used for Battle Mode and Crystal Challenge
// UI_DrawLimitClock (battle + crystal challenge)
// param1: X coordinate on the screen
// param2: Y coordinate on the screen
// param3: text size
@ -15253,7 +15253,7 @@ LAB_80053c98:
// if you have a time limit (battle)
if ((*(uint *)PTR_DAT_8008d2ac & 0x10000) != 0)
{
// draw countdown clock
// UI_DrawLimitClock
FUN_8004f894(0xd7,0x68,2);
}
}
@ -15582,15 +15582,9 @@ void FUN_8005435c(void)
// TIME
FUN_80022878(*(undefined4 *)(DAT_8008d878 + 0x48),0x14,8,2,0);
// "TIME" and the actual time are printed at the same
// X-coordinate, so we know 0x14 is the X, which only
// leaves the next parameter as the only possible value for
// the Y-coordinate.
// draw countdown clock
// UI_DrawLimitClock
FUN_8004f894(0x14,0x10,1);
// If game is paused
if ((*(uint *)PTR_DAT_8008d2ac & 0xf) != 0) {
return;