Match a variety functions (#136)

* Match func_800A4B38

* Match func_800A6034

* Change type of "blue" argument

This allows the function's type signature to look the same as the other
 box drawing function.

* Match func_800AC300

* Matched func_800AAEF4

* Matched func_800AAF30 and func_800AAF70

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-01-13 00:13:01 -05:00
committed by GitHub
parent 29f9f8890a
commit 65e7fc87df
9 changed files with 85 additions and 307 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ struct UnkStruct_800DC5EC *D_800DC5EC = &D_8015F480[0];
struct UnkStruct_800DC5EC *D_800DC5F0 = &D_8015F480[1];
struct UnkStruct_800DC5EC *D_800DC5F4 = &D_8015F480[2];
struct UnkStruct_800DC5EC *D_800DC5F8 = &D_8015F480[3];
s16 D_800DC5FC = 0;
u16 D_800DC5FC = 0;
u8 *D_800DC600 = &osAppNmiBuffer[0];
s32 gIsMirrorMode = 0;
f32 D_800DC608 = 1.0f;
+52 -118
View File
@@ -3824,7 +3824,7 @@ void *func_800987D0(void *arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, s32 arg5
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800987D0.s")
#endif
Gfx *func_80098C18(Gfx *displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, s32 red, s32 green, u32 blue, s32 alpha) {
Gfx *func_80098C18(Gfx *displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, s32 red, s32 green, s32 blue, s32 alpha) {
red &= 0xFF;
green &= 0xFF;
blue &= 0xFF;
@@ -3854,7 +3854,7 @@ Gfx *func_80098C18(Gfx *displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, s32
lry = 0xEF;
}
gSPDisplayList(displayListHead++, D_02008030);
gDPSetFillColor(displayListHead++, (GPACK_RGBA5551(red, green, blue, alpha) << 0x10 | GPACK_RGBA5551(red, green, blue, alpha)));
gDPSetFillColor(displayListHead++, (GPACK_RGBA5551(red, green, (u32)blue, alpha) << 0x10 | GPACK_RGBA5551(red, green, (u32)blue, alpha)));
gDPFillRectangle(displayListHead++, ulx, uly, lrx, lry);
gSPDisplayList(displayListHead++, D_02008058);
return displayListHead;
@@ -11021,41 +11021,24 @@ void func_800A4A24(void *arg0) {
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A4A24.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800A4BC8(); // extern
? func_800A4EF8(); // extern
? func_800A5084(); // extern
? func_800A5360(); // extern
extern u16 D_800DC5FC;
void func_800A4B38(void) {
s32 temp_v0;
void func_800A4B38(struct_8018D9E0_entry *arg0) {
if (D_800DC5FC != 0) {
temp_v0 = gModeSelection;
if (temp_v0 != GRAND_PRIX) {
if (temp_v0 != TIME_TRIALS) {
if (temp_v0 != VERSUS) {
if (temp_v0 != BATTLE) {
return;
}
func_800A5360();
// Duplicate return node #10. Try simplifying control flow for better match
return;
}
func_800A4EF8();
return;
}
func_800A4BC8();
return;
switch (gModeSelection) {
case TIME_TRIALS:
func_800A4BC8(arg0);
break;
case VERSUS:
func_800A4EF8(arg0);
break;
case GRAND_PRIX:
func_800A5084(arg0);
break;
case BATTLE:
func_800A5360(arg0);
break;
}
func_800A5084();
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A4B38.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -11693,41 +11676,19 @@ block_42:
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A5738.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80093754(s32, s32, s32, ?, f32, f32); // extern
? set_text_color(s32, void **); // extern
extern s32 D_800DC540;
extern ? D_800E7500;
extern ? D_800E7524;
extern f32 D_800F1F04;
extern f32 D_800F1F08;
extern f32 D_800F1F0C;
extern s8 D_801657E8;
extern void *gDisplayListHead;
void func_800A6034(void *arg0) {
s32 sp2C;
s16 temp_v0;
void *temp_v1;
void func_800A6034(struct_8018D9E0_entry *arg0) {
char *text;
if (D_801657E8 != 1) {
temp_v1 = gDisplayListHead;
gDisplayListHead = temp_v1 + 8;
temp_v1->unk0 = 0xFA000000;
temp_v1->unk4 = arg0->unk1C & 0xFF;
sp2C = *(&D_800E7500 + (D_800DC540 * 4));
gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, arg0->unk1C);
text = D_800E7500[D_800DC540];
set_text_color(TEXT_BLUE_GREEN_RED_CYCLE_2);
func_80093754(arg0->unkC + 0x41, arg0->unk10 + 0xA0, sp2C, 0, D_800F1F04, 1.0f);
temp_v0 = gCurrentCourseId;
sp2C = *(&D_800E7524 + (temp_v0 * 4));
set_text_color(temp_v0 % 4);
func_80093754(arg0->unkC + 0x41, arg0->unk10 + 0xC3, sp2C, 0, D_800F1F08, D_800F1F0C);
func_80093754(arg0->column + 0x41, arg0->row + 0xA0, text, 0, D_800F1F04, 1.0f);
text = D_800E7524[gCurrentCourseId];
set_text_color((s32) gCurrentCourseId % 4);
func_80093754(arg0->column + 0x41, arg0->row + 0xC3, text, 0, D_800F1F08, D_800F1F0C);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A6034.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -14803,56 +14764,38 @@ loop_3:
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAEB4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_8018D9E0;
extern ? D_8018DEE0;
s32 *func_800AAEF4(s32 arg0) {
s32 *temp_v1;
s32 *phi_v1;
phi_v1 = &D_8018D9E0;
loop_1:
if (arg0 != *phi_v1) {
temp_v1 = phi_v1 + 0x28;
phi_v1 = temp_v1;
if (&D_8018DEE0 < temp_v1) {
loop_3:
goto loop_3;
struct_8018D9E0_entry *func_800AAEF4(s32 arg0) {
struct_8018D9E0_entry *entry = D_8018D9E0;
for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) {
if (entry->type == arg0) {
goto escape;
}
goto loop_1;
}
return phi_v1;
// I don't know why they'd want a function that could potentially hard lock the game...
while(1);
escape:
return entry;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAEF4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_8018D9E0;
extern ? D_8018DEE0;
s32 *func_800AAF30(s32 arg0) {
s32 *temp_v1;
s32 *phi_v1;
phi_v1 = &D_8018D9E0;
loop_1:
if (arg0 != *phi_v1) {
temp_v1 = phi_v1 + 0x28;
phi_v1 = temp_v1;
if (&D_8018DEE0 < temp_v1) {
return NULL;
struct_8018D9E0_entry *func_800AAF30(s32 arg0) {
struct_8018D9E0_entry *entry = D_8018D9E0;
for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) {
if (entry->type == arg0) {
goto escape;
}
goto loop_1;
}
return phi_v1;
return NULL;
escape:
return entry;
}
s32 func_800AAF70(s32 arg0) {
struct_8018D9E0_entry *temp;
temp = func_800AAEB4(arg0);
return temp->unk4;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAF30.s")
#endif
void func_800AAF94(struct_8018D9E0_entry *arg0, s32 arg1) {
struct_8018D9E0_entry *temp_v0;
@@ -15616,20 +15559,11 @@ block_5:
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800ABF68.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_800AC300(void *arg0) {
s32 temp_t7;
temp_t7 = arg0->unk1C + 1;
arg0->unk1C = temp_t7;
if (arg0->unk20 < temp_t7) {
arg0->unk0 = 0;
void func_800AC300(struct_8018D9E0_entry *arg0) {
if (arg0->unk20 < ++arg0->unk1C) {
arg0->type = 0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AC300.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
+26 -8
View File
@@ -48,7 +48,7 @@ void func_800947B4(struct GfxPool*, s32);
void func_80094A64(Mtx*);
void func_80094C60();
void func_80095574();
Gfx *func_80098C18(Gfx*, s32, s32, s32, s32, s32, s32, u32, s32);
Gfx *func_80098C18(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32);
Gfx *draw_box(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32);
Gfx *func_80098FC8(Gfx*, s32, s32, s32, s32);
void func_80099110();
@@ -62,14 +62,12 @@ void func_80099AEC();
void func_80099E54();
void func_80099E60(Mk64_Texture *, s32, s32);
void func_80099EC4();
void func_80099A70();
void func_8009A594(s32, s32, segment_address_t);
void func_8009A640(s32, s32, s32, segment_address_t);
void func_80099A70();
segment_address_t func_8009A878(struct_8018DEE0_entry*);
void func_800A54EC();
void func_8009A76C(s32, s32, s32, s32);
void func_8009A7EC(s32, s32, s32, s32, s32);
void func_800A8250();
segment_address_t func_8009A878(struct_8018DEE0_entry*);
void func_8009A944(struct_8018DEE0_entry*, s32);
Gfx *func_8009BA74(Gfx *, Mk64_Texture*, s32, s32);
s32 func_8009C434(s32, struct_8018DEE0_entry*, s32, s32, s32);
@@ -81,6 +79,13 @@ void func_8009E258();
void func_800A0AD0(struct_8018D9E0_entry*);
void func_800A11D0(struct_8018D9E0_entry*, s32, s32);
void func_800A1924(struct_8018D9E0_entry*);
void func_800A4B38(struct_8018D9E0_entry*);
void func_800A4BC8(struct_8018D9E0_entry*);
void func_800A4EF8(struct_8018D9E0_entry*);
void func_800A5084(struct_8018D9E0_entry*);
void func_800A5360(struct_8018D9E0_entry*);
void func_800A54EC();
void func_800A6034(struct_8018D9E0_entry*);
void func_800A7258(struct_8018D9E0_entry*);
void func_800A72FC(struct_8018D9E0_entry*);
void func_800A7448(struct_8018D9E0_entry*);
@@ -91,6 +96,7 @@ void get_time_record_minutes(s32, char*);
void get_time_record_seconds(s32 , char*);
void get_time_record_centiseconds(s32, char*);
void func_800A8230();
void func_800A8250();
void func_800A86E8(struct_8018D9E0_entry*);
void func_800A8E14(struct_8018D9E0_entry*);
void func_800A8EC0(struct_8018D9E0_entry*);
@@ -99,11 +105,19 @@ void func_800AADD4(struct_8018D9E0_entry*);
void func_800AAE18(struct_8018D9E0_entry*);
struct_8018D9E0_entry *func_800AAEB4(s32);
struct_8018D9E0_entry *func_800AAEF4(s32);
struct_8018D9E0_entry *func_800AAF30(s32);
s32 func_800AAF70(s32);
void func_800AAF94(struct_8018D9E0_entry*, s32);
// code_80057C60.c
void func_80057CE4();
/* File specific defines */
#define D_8018D9E0_SIZE 0x20
#define D_8018DEE0_SIZE 0x10
#define D_8018E118_SIZE 0xC8
/* This is where I'd put my static data, if I had any */
extern Mk64_Texture D_0200157C;
@@ -127,6 +141,7 @@ extern Gfx D_06009410[];
extern s16 gGlyphDisplayWidth[]; // D_800EF690
extern RGBA16 D_800E74A8[5];
extern char *D_800E7500[9];
extern char *D_800E7524[];
extern char *D_800E7678[];
extern char *D_800E76CC[4];
extern char *D_800E76DC[4];
@@ -141,6 +156,9 @@ extern Mk64_Texture_Group *D_800E82B4[5];
extern f32 D_800E8530;
extern f32 D_800E8534;
extern s8 D_800E86D0[20];
extern f32 D_800F1F04;
extern f32 D_800F1F08;
extern f32 D_800F1F0C;
extern f32 D_800F1F30;
extern f32 D_800F24A8;
extern f32 D_800F24AC;
@@ -150,9 +168,9 @@ extern f32 D_800F24B8;
extern f64 D_800F24C0;
extern s32 D_80165754;
extern s8 D_8018D9D9;
extern struct_8018D9E0_entry D_8018D9E0[32]; // D_8018D9E0
extern struct_8018DEE0_entry D_8018DEE0[16]; // D_8018DEE0
extern struct_8018E118_entry D_8018E118[200]; // D_8018E118
extern struct_8018D9E0_entry D_8018D9E0[D_8018D9E0_SIZE]; // D_8018D9E0
extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; // D_8018DEE0
extern struct_8018E118_entry D_8018E118[D_8018E118_SIZE]; // D_8018E118
extern s8 gTextColor; // D_8018E860
extern s8 D_8018ED91;
extern s32 D_8018E850;