match: hud_element_render, hud_init_element, inline rodata strings (#547)

* match: hud_element_render, inline rodata strings

* match: hud_init_element

* chore: remove Non Matching comment in game_ui.h
This commit is contained in:
Dominik Peters
2025-05-05 00:28:17 +02:00
committed by GitHub
parent b39ec77a04
commit 4aa7b9a8c1
10 changed files with 545 additions and 106 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fd
<!-- README_SCORE_SUMMARY_BEGIN -->
As of May 4, 2025, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 83.68%
&emsp;&emsp;&emsp;&emsp;Decomp progress: 84.43%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 53.79%
<!-- README_SCORE_SUMMARY_END -->
@@ -121,16 +121,16 @@ As of May 4, 2025, this is our current score:
```
========================================================
ADVENTURE ONE (ASM -> C Decompilation)
-------- 83.68% Complete (85.23% NON_MATCHING) ---------
# Decompiled functions: 1875
# GLOBAL_ASM remaining: 76
-------- 84.43% Complete (85.98% NON_MATCHING) ---------
# Decompiled functions: 1877
# GLOBAL_ASM remaining: 74
# NON_MATCHING functions: 8
# NON_EQUIVALENT WIP functions: 27
--------------------- Game Status ----------------------
Balloons: 39/47, Keys: 4/4, Trophies: 4/5
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
--------------------------------------------------------
We are racing the wizard pig boss Wizpig. (Lap 1/3)
We are racing the wizard pig boss Wizpig. (Lap 3/3)
========================================================
ADVENTURE TWO (Cleanup & Documentation)
------------------- 53.79% Complete --------------------
+6
View File
@@ -885,6 +885,11 @@ typedef struct LevelObjectEntry_Unknown127 {
LevelObjectEntryCommon common;
} LevelObjectEntry_Unknown127;
typedef struct LevelObjectEntry_Hud {
LevelObjectEntryCommon common;
s32 unk8;
} LevelObjectEntry_Hud;
typedef struct LevelObjectEntry {
union {
LevelObjectEntry_Racer racer;
@@ -978,6 +983,7 @@ typedef struct LevelObjectEntry {
LevelObjectEntry800BF524 unk800BF524;
LevelObjectEntry_WavePower wavePower;
LevelObjectEntry_CharacterSelect characterSelect;
LevelObjectEntry_Hud hud;
};
} LevelObjectEntry;
+458 -29
View File
File diff suppressed because it is too large Load Diff
+12 -9
View File
@@ -336,12 +336,12 @@ typedef struct HudElement_RaceTimeLabel {
} HudElement_RaceTimeLabel;
typedef struct HudElement {
Vec3s rotation;
s16 spriteID;
f32 scale;
Vec3f pos;
s16 spriteOffset;
union {
/* 0x00 */ Vec3s rotation;
/* 0x06 */ s16 spriteID;
/* 0x08 */ f32 scale;
/* 0x0C */ Vec3f pos;
/* 0x14 */ s16 spriteOffset;
/* 0x16 */ union {
u8 filler[4]; // Ensures this union is 6 bytes, since Rare never actually use more than four.
HudElement_ChallengeEggs challengeEggs;
HudElement_RaceStartGo raceStartGo;
@@ -382,6 +382,11 @@ typedef struct HudElements {
void *entry[HUD_ELEMENT_COUNT];
} HudElements;
typedef struct HudDrawTexture {
DrawTexture drawTexture;
s32 unk8; // Field is always set to 0 and never read/written outside of hud_element_render
} HudDrawTexture;
extern u8 gGfxTaskYieldData[OS_YIELD_DATA_SIZE];
u8 race_starting(void);
@@ -430,12 +435,10 @@ void hud_treasure(Object_Racer *racer);
void minimap_marker_pos(f32 x, f32 z, f32 angleSin, f32 angleCos, f32 modelAspectRatio);
void hud_timer_render(s32 x, s32 y, s32 minutes, s32 seconds, s32 hundredths, s32 smallFont);
void hud_draw_model(ObjectModel *objModel);
// Non Matching
void hud_element_render(Gfx **dList, MatrixS **mtx, Vertex **vtxList, HudElement *arg3);
void hud_main_time_trial(s32, Object*, s32);
void hud_race_finish_multiplayer(Object_Racer *racer, s32 updateRate);
void func_800A1E48(Object*, s32 updateRate);
void func_8009F034(void);
void hud_init_element(void);
#endif
+4 -3
View File
@@ -2396,7 +2396,8 @@ void obj_update(s32 updateRate) {
func_800179D0();
// @fake
do { } while (0);
do {
} while (0);
if (D_8011AF00 == 1) {
if ((gEventCountdown == 0x50) && (gCutsceneID == 0)) {
sp54 = 0;
@@ -5483,7 +5484,7 @@ s16 func_8001CD28(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
temp = spD4[sp36C];
spD4[sp36C] = spD4[sp36C - 1];
spD4[sp36C - 1] = temp;
temp = sp54[sp36C] ;
temp = sp54[sp36C];
sp54[sp36C] = sp54[sp36C - 1] & 0xFF & 0xFF & 0xFF;
sp54[sp36C - 1] = temp & 0xFF;
sp36C--;
@@ -6342,7 +6343,7 @@ void mode_init_taj_race(void) {
D_8011ADC0 = 1;
levelHeader->laps = 3;
levelHeader->race_type = RACETYPE_DEFAULT;
func_8009F034();
hud_init_element();
// clang-format off
for (i = 0; i < ARRAY_COUNT(racer->lap_times); i++) { racer->lap_times[i] = 0; } // Must be a single line.
// clang-format on
+12 -12
View File
@@ -1537,7 +1537,7 @@ is_drumstick_unlocked = 0x8009F294;
// game_ui.c .text
hud_init = 0x8009F2B0;
func_8009F034 = 0x8009F5F4;
hud_init_element = 0x8009F5F4;
hud_free = 0x800A05FC;
race_starting = 0x800A0750;
hud_render_player = 0x800A0760;
@@ -3397,17 +3397,17 @@ D_800E8520 = 0x800EA030;
jpt_800E8574 = 0x800EA084;
// game_ui .rodata
D_800E86A8 = 0x800EA160; // type:f64 function_owner:func_8009F034
D_800E86B0 = 0x800EA168; // type:f64 function_owner:func_8009F034
D_800E86B8 = 0x800EA170; // type:f32 function_owner:func_8009F034
D_800E86BC = 0x800EA174; // type:f32 function_owner:func_8009F034
D_800E86C0 = 0x800EA178; // type:f32 function_owner:func_8009F034
D_800E86C8 = 0x800EA180; // type:f64 function_owner:func_8009F034
D_800E86D0 = 0x800EA188; // type:f64 function_owner:func_8009F034
D_800E86D8 = 0x800EA190; // type:f64 function_owner:func_8009F034
D_800E86E0 = 0x800EA198; // type:f64 function_owner:func_8009F034
D_800E86E8 = 0x800EA1A0; // type:f64 function_owner:func_8009F034
D_800E86F0 = 0x800EA1A8; // type:f64 function_owner:func_8009F034
D_800E86A8 = 0x800EA160; // type:f64 function_owner:hud_init_element
D_800E86B0 = 0x800EA168; // type:f64 function_owner:hud_init_element
D_800E86B8 = 0x800EA170; // type:f32 function_owner:hud_init_element
D_800E86BC = 0x800EA174; // type:f32 function_owner:hud_init_element
D_800E86C0 = 0x800EA178; // type:f32 function_owner:hud_init_element
D_800E86C8 = 0x800EA180; // type:f64 function_owner:hud_init_element
D_800E86D0 = 0x800EA188; // type:f64 function_owner:hud_init_element
D_800E86D8 = 0x800EA190; // type:f64 function_owner:hud_init_element
D_800E86E0 = 0x800EA198; // type:f64 function_owner:hud_init_element
D_800E86E8 = 0x800EA1A0; // type:f64 function_owner:hud_init_element
D_800E86F0 = 0x800EA1A8; // type:f64 function_owner:hud_init_element
D_800E8718 = 0x800EA1D0;
D_800E8720 = 0x800EA1D8;
D_800E8728 = 0x800EA1E0;
+12 -12
View File
@@ -1530,7 +1530,7 @@ is_in_two_player_adventure = 0x8009ED14;
is_tt_unlocked = 0x8009ED4C;
is_drumstick_unlocked = 0x8009ED64;
hud_init = 0x8009ED80;
func_8009F034 = 0x8009F0C4;
hud_init_element = 0x8009F0C4;
hud_free = 0x800A00CC;
race_starting = 0x800A0220;
hud_render_player = 0x800A0230;
@@ -3158,17 +3158,17 @@ D_800E8680 = 0x800E8710; // type:asciz defined:True
D_800E8688 = 0x800E8718;
D_800E8690 = 0x800E8720;
D_800E8694 = 0x800E8724;
D_800E86A8 = 0x800E8738; // type:f64 function_owner:func_8009F034
D_800E86B0 = 0x800E8740; // type:f64 function_owner:func_8009F034
D_800E86B8 = 0x800E8748; // type:f32 function_owner:func_8009F034
D_800E86BC = 0x800E874C; // type:f32 function_owner:func_8009F034
D_800E86C0 = 0x800E8750; // type:f32 function_owner:func_8009F034
D_800E86C8 = 0x800E8758; // type:f64 function_owner:func_8009F034
D_800E86D0 = 0x800E8760; // type:f64 function_owner:func_8009F034
D_800E86D8 = 0x800E8768; // type:f64 function_owner:func_8009F034
D_800E86E0 = 0x800E8770; // type:f64 function_owner:func_8009F034
D_800E86E8 = 0x800E8778; // type:f64 function_owner:func_8009F034
D_800E86F0 = 0x800E8780; // type:f64 function_owner:func_8009F034
D_800E86A8 = 0x800E8738; // type:f64 function_owner:hud_init_element
D_800E86B0 = 0x800E8740; // type:f64 function_owner:hud_init_element
D_800E86B8 = 0x800E8748; // type:f32 function_owner:hud_init_element
D_800E86BC = 0x800E874C; // type:f32 function_owner:hud_init_element
D_800E86C0 = 0x800E8750; // type:f32 function_owner:hud_init_element
D_800E86C8 = 0x800E8758; // type:f64 function_owner:hud_init_element
D_800E86D0 = 0x800E8760; // type:f64 function_owner:hud_init_element
D_800E86D8 = 0x800E8768; // type:f64 function_owner:hud_init_element
D_800E86E0 = 0x800E8770; // type:f64 function_owner:hud_init_element
D_800E86E8 = 0x800E8778; // type:f64 function_owner:hud_init_element
D_800E86F0 = 0x800E8780; // type:f64 function_owner:hud_init_element
D_800E8718 = 0x800E87A8;
D_800E871C = 0x800E87AC; // type:s32 padding
D_800E8720 = 0x800E87B0;
+12 -12
View File
@@ -1451,7 +1451,7 @@ is_drumstick_unlocked = 0x8009F2A8;
hud_init = 0x8009F2C0;
func_8009F034 = 0x8009F604;
hud_init_element = 0x8009F604;
hud_free = 0x800A060C;
race_starting = 0x800A0760;
hud_render_player = 0x800A0770;
@@ -3088,17 +3088,17 @@ D_800E867C = 0x800E8C9C; // type:asciz defined:True
D_800E8680 = 0x800E8CA0; // type:asciz defined:True
D_800E8688 = 0x800E8CA8;
D_800E8690 = 0x800E8CB0;
D_800E86A8 = 0x800E8CB8; // type:f64 function_owner:func_8009F034
D_800E86B0 = 0x800E8CC0; // type:f64 function_owner:func_8009F034
D_800E86B8 = 0x800E8CC8; // type:f32 function_owner:func_8009F034
D_800E86BC = 0x800E8CCC; // type:f32 function_owner:func_8009F034
D_800E86C0 = 0x800E8CD0; // type:f32 function_owner:func_8009F034
D_800E86C8 = 0x800E8CD8; // type:f64 function_owner:func_8009F034
D_800E86D0 = 0x800E8CE0; // type:f64 function_owner:func_8009F034
D_800E86D8 = 0x800E8CE8; // type:f64 function_owner:func_8009F034
D_800E86E0 = 0x800E8CF0; // type:f64 function_owner:func_8009F034
D_800E86E8 = 0x800E8CF8; // type:f64 function_owner:func_8009F034
D_800E86F0 = 0x800E8D00; // type:f64 function_owner:func_8009F034
D_800E86A8 = 0x800E8CB8; // type:f64 function_owner:hud_init_element
D_800E86B0 = 0x800E8CC0; // type:f64 function_owner:hud_init_element
D_800E86B8 = 0x800E8CC8; // type:f32 function_owner:hud_init_element
D_800E86BC = 0x800E8CCC; // type:f32 function_owner:hud_init_element
D_800E86C0 = 0x800E8CD0; // type:f32 function_owner:hud_init_element
D_800E86C8 = 0x800E8CD8; // type:f64 function_owner:hud_init_element
D_800E86D0 = 0x800E8CE0; // type:f64 function_owner:hud_init_element
D_800E86D8 = 0x800E8CE8; // type:f64 function_owner:hud_init_element
D_800E86E0 = 0x800E8CF0; // type:f64 function_owner:hud_init_element
D_800E86E8 = 0x800E8CF8; // type:f64 function_owner:hud_init_element
D_800E86F0 = 0x800E8D00; // type:f64 function_owner:hud_init_element
D_800E8718 = 0x800E8D28;
D_800E871C = 0x800E8D2C; // type:s32 padding
D_800E8720 = 0x800E8D30;
+12 -12
View File
@@ -1532,7 +1532,7 @@ is_drumstick_unlocked = 0x8009ECD0;
// game_ui.c .text
hud_init = 0x8009ECF0;
func_8009F034 = 0x8009F034;
hud_init_element = 0x8009F034;
hud_free = 0x800A003C;
race_starting = 0x800A0190;
hud_render_player = 0x800A01A0;
@@ -3503,17 +3503,17 @@ D_800E8680 = 0x800E8680; // type:asciz defined:True
D_800E8688 = 0x800E8688;
D_800E8690 = 0x800E8690;
D_800E8694 = 0x800E8694;
D_800E86A8 = 0x800E86A8; // type:f64 function_owner:func_8009F034
D_800E86B0 = 0x800E86B0; // type:f64 function_owner:func_8009F034
D_800E86B8 = 0x800E86B8; // type:f32 function_owner:func_8009F034
D_800E86BC = 0x800E86BC; // type:f32 function_owner:func_8009F034
D_800E86C0 = 0x800E86C0; // type:f32 function_owner:func_8009F034
D_800E86C8 = 0x800E86C8; // type:f64 function_owner:func_8009F034
D_800E86D0 = 0x800E86D0; // type:f64 function_owner:func_8009F034
D_800E86D8 = 0x800E86D8; // type:f64 function_owner:func_8009F034
D_800E86E0 = 0x800E86E0; // type:f64 function_owner:func_8009F034
D_800E86E8 = 0x800E86E8; // type:f64 function_owner:func_8009F034
D_800E86F0 = 0x800E86F0; // type:f64 function_owner:func_8009F034
D_800E86A8 = 0x800E86A8; // type:f64 function_owner:hud_init_element
D_800E86B0 = 0x800E86B0; // type:f64 function_owner:hud_init_element
D_800E86B8 = 0x800E86B8; // type:f32 function_owner:hud_init_element
D_800E86BC = 0x800E86BC; // type:f32 function_owner:hud_init_element
D_800E86C0 = 0x800E86C0; // type:f32 function_owner:hud_init_element
D_800E86C8 = 0x800E86C8; // type:f64 function_owner:hud_init_element
D_800E86D0 = 0x800E86D0; // type:f64 function_owner:hud_init_element
D_800E86D8 = 0x800E86D8; // type:f64 function_owner:hud_init_element
D_800E86E0 = 0x800E86E0; // type:f64 function_owner:hud_init_element
D_800E86E8 = 0x800E86E8; // type:f64 function_owner:hud_init_element
D_800E86F0 = 0x800E86F0; // type:f64 function_owner:hud_init_element
D_800E8718 = 0x800E8718;
D_800E871C = 0x800E871C; // type:s32 padding
D_800E8720 = 0x800E8720;
+12 -12
View File
@@ -1450,7 +1450,7 @@ is_tt_unlocked = 0x8009F1FC;
is_drumstick_unlocked = 0x8009F214;
hud_init = 0x8009F230;
func_8009F034 = 0x8009F574;
hud_init_element = 0x8009F574;
hud_free = 0x800A057C;
race_starting = 0x800A06D0;
hud_render_player = 0x800A06E0;
@@ -3084,17 +3084,17 @@ D_800E867C = 0x800E8C0C; // type:asciz defined:True
D_800E8680 = 0x800E8C10; // type:asciz defined:True
D_800E8688 = 0x800E8C18;
D_800E8690 = 0x800E8C20;
D_800E86A8 = 0x800E8C28; // type:f64 function_owner:func_8009F034
D_800E86B0 = 0x800E8C30; // type:f64 function_owner:func_8009F034
D_800E86B8 = 0x800E8C38; // type:f32 function_owner:func_8009F034
D_800E86BC = 0x800E8C3C; // type:f32 function_owner:func_8009F034
D_800E86C0 = 0x800E8C40; // type:f32 function_owner:func_8009F034
D_800E86C8 = 0x800E8C48; // type:f64 function_owner:func_8009F034
D_800E86D0 = 0x800E8C50; // type:f64 function_owner:func_8009F034
D_800E86D8 = 0x800E8C58; // type:f64 function_owner:func_8009F034
D_800E86E0 = 0x800E8C60; // type:f64 function_owner:func_8009F034
D_800E86E8 = 0x800E8C68; // type:f64 function_owner:func_8009F034
D_800E86F0 = 0x800E8C70; // type:f64 function_owner:func_8009F034
D_800E86A8 = 0x800E8C28; // type:f64 function_owner:hud_init_element
D_800E86B0 = 0x800E8C30; // type:f64 function_owner:hud_init_element
D_800E86B8 = 0x800E8C38; // type:f32 function_owner:hud_init_element
D_800E86BC = 0x800E8C3C; // type:f32 function_owner:hud_init_element
D_800E86C0 = 0x800E8C40; // type:f32 function_owner:hud_init_element
D_800E86C8 = 0x800E8C48; // type:f64 function_owner:hud_init_element
D_800E86D0 = 0x800E8C50; // type:f64 function_owner:hud_init_element
D_800E86D8 = 0x800E8C58; // type:f64 function_owner:hud_init_element
D_800E86E0 = 0x800E8C60; // type:f64 function_owner:hud_init_element
D_800E86E8 = 0x800E8C68; // type:f64 function_owner:hud_init_element
D_800E86F0 = 0x800E8C70; // type:f64 function_owner:hud_init_element
D_800E8718 = 0x800E8C98;
D_800E871C = 0x800E8C9C; // type:s32 padding
D_800E8720 = 0x800E8CA0;