mirror of
https://github.com/n64decomp/mk64
synced 2026-09-07 02:39:54 -04:00
Name functions that search for 8018D9E0 entries (#161)
* Name functions that search for 8018D9E0 entries The one with "_dupe" in its name is the one that has the potential hard lock laying around * Add comment for bug in find_8018D9E0_entry_dupe Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
+43
-34
@@ -632,11 +632,11 @@ void func_800925A0(void) {
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern void *func_800AAEF4(s32); // extern
|
||||
// removed a temp from this func temp = func_800AAEF4.
|
||||
extern void *find_8018D9E0_entry_dupe(s32); // extern
|
||||
// removed a temp from this func temp = find_8018D9E0_entry_dupe.
|
||||
void func_800925CC(void) {
|
||||
if (func_800AAEF4(0xAF)->unk4 == 2) {
|
||||
func_800AAEF4(0xAF)->unk4 = 3;
|
||||
if (find_8018D9E0_entry_dupe(0xAF)->unk4 == 2) {
|
||||
find_8018D9E0_entry_dupe(0xAF)->unk4 = 3;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -657,8 +657,8 @@ void func_8009265C(void) {
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
|
||||
? add_8018D9E0_entry(?, ?, ?, ?); /* extern */
|
||||
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
|
||||
extern u16 D_800DC5E4;
|
||||
|
||||
void func_80092688(void) {
|
||||
u16 temp_t6;
|
||||
@@ -1159,7 +1159,7 @@ void func_80093754(s32 column, s32 row, char *text, s32 tracking, f32 x_scale, f
|
||||
}
|
||||
|
||||
void print_text2(s32 column, s32 row, char *text, s32 tracking, f32 x_scale, f32 y_scale, s32 arg6) {
|
||||
s32 temp_v0_3;
|
||||
MkTexture *glyphTexture;
|
||||
s32 characterWidth;
|
||||
s32 glyphIndex;
|
||||
|
||||
@@ -1168,9 +1168,9 @@ void print_text2(s32 column, s32 row, char *text, s32 tracking, f32 x_scale, f32
|
||||
do {
|
||||
glyphIndex = char_to_glyph_index(text);
|
||||
if (glyphIndex >= 0) {
|
||||
temp_v0_3 = segmented_to_virtual(gGlyphTextureLUT[glyphIndex]);
|
||||
func_80099184(temp_v0_3);
|
||||
gDisplayListHead = func_8009BEF0(gDisplayListHead, temp_v0_3, column - (gGlyphDisplayWidth[glyphIndex] / 2), row, arg6, x_scale, y_scale);
|
||||
glyphTexture = segmented_to_virtual(gGlyphTextureLUT[glyphIndex]);
|
||||
func_80099184(glyphTexture);
|
||||
gDisplayListHead = func_8009BEF0(gDisplayListHead, glyphTexture, column - (gGlyphDisplayWidth[glyphIndex] / 2), row, arg6, x_scale, y_scale);
|
||||
if ((glyphIndex >= 0xD5) && (glyphIndex < 0xE0)) {
|
||||
characterWidth = 0x20;
|
||||
} else {
|
||||
@@ -1902,17 +1902,15 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80095574.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
s32 func_80098C18(s32, s32, s32, s32, s32, s32); // extern
|
||||
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
|
||||
extern s32 D_8018E7A8;
|
||||
extern s32 gDisplayListHead;
|
||||
|
||||
void func_800958D4(s32 arg0, s32 arg4, s32 arg5) {
|
||||
void func_800958D4(s32 arg0, s32 ulx, s32 uly, s32 lrx, s32 lry, s32 arg5) {
|
||||
s32 temp_lo;
|
||||
s32 phi_v0;
|
||||
s32 phi_v0_2;
|
||||
|
||||
temp_lo = ((D_8018E7A8 % arg5) << 9) / arg5;
|
||||
temp_lo = (s32) (((s32) D_8018E7A8 % arg5) << 9) / arg5;
|
||||
phi_v0 = temp_lo;
|
||||
if (temp_lo >= 0x101) {
|
||||
phi_v0 = 0x200 - temp_lo;
|
||||
@@ -1921,7 +1919,7 @@ void func_800958D4(s32 arg0, s32 arg4, s32 arg5) {
|
||||
if (phi_v0 >= 0x100) {
|
||||
phi_v0_2 = 0xFF;
|
||||
}
|
||||
gDisplayListHead = func_80098C18(gDisplayListHead, arg4, phi_v0_2, phi_v0_2, phi_v0_2, 0xFF);
|
||||
gDisplayListHead = func_80098C18(gDisplayListHead, ulx, uly, lrx, lry, phi_v0_2, phi_v0_2, phi_v0_2, 0xFF);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800958D4.s")
|
||||
@@ -5925,7 +5923,7 @@ void func_8009CA6C(s32 arg0) {
|
||||
u8 temp_t0;
|
||||
? phi_a1;
|
||||
|
||||
if ((arg0 == 4) || ((arg0 = arg0, (func_800AAF30(0xAA) == 0)) && (arg0 = arg0, (func_800AAF30(0xAB) == 0)) && (arg0 = arg0, (func_800AAF30(0xB9) == 0)) && (arg0 = arg0, (func_800AAF30(0xBA) == 0)) && (arg0 = arg0, (func_800AAF30(0xAC) == 0)) && (arg0 = arg0, (func_800AAF30(0xB0) == 0)))) {
|
||||
if ((arg0 == 4) || ((arg0 = arg0, (find_8018D9E0_entry(0xAA) == 0)) && (arg0 = arg0, (find_8018D9E0_entry(0xAB) == 0)) && (arg0 = arg0, (find_8018D9E0_entry(0xB9) == 0)) && (arg0 = arg0, (find_8018D9E0_entry(0xBA) == 0)) && (arg0 = arg0, (find_8018D9E0_entry(0xAC) == 0)) && (arg0 = arg0, (find_8018D9E0_entry(0xB0) == 0)))) {
|
||||
temp_v1 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->words.w0 = 0x06000000;
|
||||
@@ -6091,7 +6089,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_8009CE1C.s")
|
||||
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
|
||||
? func_8000F124(s8, s32); /* extern */
|
||||
? func_8009CE1C(s32 *, s32, s32); /* extern */
|
||||
void *func_800AAF30(?, s32, s32); /* extern */
|
||||
void *find_8018D9E0_entry(?, s32, s32); /* extern */
|
||||
? func_80290338(); /* extern */
|
||||
? func_80290360(); /* extern */
|
||||
? func_80290388(); /* extern */
|
||||
@@ -6170,7 +6168,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) {
|
||||
}
|
||||
sp18 = temp_v0_2;
|
||||
sp28 = 0;
|
||||
temp_v0_3 = func_800AAF30(0xB0, 0, 2);
|
||||
temp_v0_3 = find_8018D9E0_entry(0xB0, 0, 2);
|
||||
if (temp_v0_3 != 0) {
|
||||
temp_v1_2 = temp_v0_3->unk4;
|
||||
if (temp_v1_2 != 0xA) {
|
||||
@@ -6192,7 +6190,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) {
|
||||
return;
|
||||
}
|
||||
sp28 = 0;
|
||||
temp_v0_4 = func_800AAF30(0xAC, 0);
|
||||
temp_v0_4 = find_8018D9E0_entry(0xAC, 0);
|
||||
if (temp_v0_4 != 0) {
|
||||
temp_v1_3 = temp_v0_4->unk4;
|
||||
if (temp_v1_3 != 0xB) {
|
||||
@@ -6207,7 +6205,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) {
|
||||
return;
|
||||
}
|
||||
sp28 = 0;
|
||||
temp_v0_5 = func_800AAF30(0xC7, 0);
|
||||
temp_v0_5 = find_8018D9E0_entry(0xC7, 0);
|
||||
if (temp_v0_5 != 0) {
|
||||
temp_t6 = temp_v0_5->unk4;
|
||||
switch (temp_t6) { /* switch 1 */
|
||||
@@ -6243,7 +6241,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) {
|
||||
D_800DC5FC = 0;
|
||||
}
|
||||
}
|
||||
temp_v0_6 = func_800AAF30(0xBD, phi_a1_3);
|
||||
temp_v0_6 = find_8018D9E0_entry(0xBD, phi_a1_3);
|
||||
if (temp_v0_6 != 0) {
|
||||
temp_t6_2 = temp_v0_6->unk4;
|
||||
switch (temp_t6_2) { /* switch 2 */
|
||||
@@ -8902,7 +8900,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A09E0.s")
|
||||
void func_800A0AD0(UNUSED struct_8018D9E0_entry *unused) {
|
||||
struct_8018D9E0_entry *temp_t1;
|
||||
// Find struct_8018D9E0_entry with a type/id of 0xDA
|
||||
temp_t1 = func_800AAEF4(0xDA);
|
||||
temp_t1 = find_8018D9E0_entry_dupe(0xDA);
|
||||
if ((gControllerPakMenuSelection != CONTROLLER_PAK_MENU_SELECT_RECORD) && (gControllerPakMenuSelection != CONTROLLER_PAK_MENU_END))
|
||||
{
|
||||
gDPSetPrimColor(gDisplayListHead++, 0, 0, 0xFF, temp_t1->unk20, 0x00, 0xFF);
|
||||
@@ -9027,7 +9025,7 @@ void func_800A0EB8(s32 arg0, s32 arg1) {
|
||||
struct_8018D9E0_entry *temp_t3;
|
||||
s32 phi_t1;
|
||||
|
||||
temp_t3 = func_800AAEF4(0xDA);
|
||||
temp_t3 = find_8018D9E0_entry_dupe(0xDA);
|
||||
if (arg1 == 0) {
|
||||
if (gControllerPakMenuSelection == CONTROLLER_PAK_MENU_END) {
|
||||
phi_t1 = 1;
|
||||
@@ -9227,7 +9225,7 @@ void func_800A1500(struct_8018D9E0_entry *arg0) {
|
||||
s32 phi_a1;
|
||||
|
||||
sp1C = 0;
|
||||
temp_v0 = func_800AAEF4(0x64);
|
||||
temp_v0 = find_8018D9E0_entry_dupe(0x64);
|
||||
temp_v1 = temp_v0->unk4;
|
||||
phi_a1 = sp1C;
|
||||
switch (temp_v1) { /* irregular */
|
||||
@@ -10783,7 +10781,7 @@ void func_800A4550(s32 recordType, s32 column, s32 row) {
|
||||
phi_v0 = recordType * 4;
|
||||
}
|
||||
func_800936B8(column + 0x21, row, *(&D_800E7734 + phi_v0), 0, 0.7f, 0.7f);
|
||||
temp_v0_2 = func_800AAEF4(0xBB);
|
||||
temp_v0_2 = find_8018D9E0_entry_dupe(0xBB);
|
||||
if (recordType < 3) {
|
||||
if ((temp_v0_2->unk20 & (1 << recordType)) != 0) {
|
||||
phi_a0 = (s32) gGlobalTimer % 3;
|
||||
@@ -10866,7 +10864,7 @@ void func_800A474C(s32 recordType, s32 column, s32 row) {
|
||||
}
|
||||
func_800939C8(column + 0x14, row, D_800E7744[recordType], 2, 0.65f, 0.65f);
|
||||
if (sp30 == 0) {
|
||||
temp_v0 = func_800AAEF4(0xBB);
|
||||
temp_v0 = find_8018D9E0_entry_dupe(0xBB);
|
||||
if (recordType < 5) {
|
||||
if (recordType == temp_v0->unk1C) {
|
||||
sp40 = (s32) gGlobalTimer % 3;
|
||||
@@ -11245,7 +11243,7 @@ void func_800A54EC(void) {
|
||||
temp_t2 = gModeSelection;
|
||||
sp40 = temp_t2;
|
||||
temp_v1 = gDisplayListHead;
|
||||
sp48 = func_800AAF30(0xC7);
|
||||
sp48 = find_8018D9E0_entry(0xC7);
|
||||
gDisplayListHead = temp_v1 + 8;
|
||||
temp_v1->words.w1 = (s32) D_802B8880 & 0x1FFFFFFF;
|
||||
temp_v1->words.w0 = 0x03800010;
|
||||
@@ -13213,7 +13211,7 @@ void func_800A8CA4(struct_8018D9E0_entry *arg0) {
|
||||
struct_8018D9E0_entry *temp_v0;
|
||||
s32 phi_s0;
|
||||
|
||||
temp_v0 = func_800AAEF4(0x64);
|
||||
temp_v0 = find_8018D9E0_entry_dupe(0x64);
|
||||
temp_v1 = gDisplayListHead;
|
||||
temp_s2 = arg0->column;
|
||||
temp_s3 = arg0->row;
|
||||
@@ -14743,7 +14741,18 @@ loop_3:
|
||||
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAEB4.s")
|
||||
#endif
|
||||
|
||||
struct_8018D9E0_entry *func_800AAEF4(s32 arg0) {
|
||||
/**
|
||||
* @bug
|
||||
* `arg0` is the desired "type" of the 8018D9E0 entry to
|
||||
* search for. If no entry with that "type" is found, this
|
||||
* function will enter a `while(1)` loop, hard-locking the
|
||||
* game.
|
||||
*
|
||||
* In practice this never appears to happen, but that is
|
||||
* probably as much a matter of luck as it is good
|
||||
* reasoning on the original author(s) part.
|
||||
**/
|
||||
struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32 arg0) {
|
||||
struct_8018D9E0_entry *entry = D_8018D9E0;
|
||||
for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) {
|
||||
if (entry->type == arg0) {
|
||||
@@ -14757,7 +14766,7 @@ escape:
|
||||
return entry;
|
||||
}
|
||||
|
||||
struct_8018D9E0_entry *func_800AAF30(s32 arg0) {
|
||||
struct_8018D9E0_entry *find_8018D9E0_entry(s32 arg0) {
|
||||
struct_8018D9E0_entry *entry = D_8018D9E0;
|
||||
for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) {
|
||||
if (entry->type == arg0) {
|
||||
@@ -14994,7 +15003,7 @@ void func_800AB314(struct_8018D9E0_entry *arg0) {
|
||||
arg0 = arg0;
|
||||
temp_a1 = phi_a1 + 1;
|
||||
temp_v1 = phi_v1 + 4;
|
||||
temp_v1->unk-4 = func_800AAEF4(phi_a1 + 0x5F);
|
||||
temp_v1->unk-4 = find_8018D9E0_entry_dupe(phi_a1 + 0x5F);
|
||||
phi_v1 = temp_v1;
|
||||
phi_a1 = temp_a1;
|
||||
} while (temp_a1 < 4);
|
||||
@@ -16048,7 +16057,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) {
|
||||
return;
|
||||
case 1:
|
||||
arg0 = temp_a1;
|
||||
if (func_800AAEF4(0xB1)->unk4 >= 2) {
|
||||
if (find_8018D9E0_entry_dupe(0xB1)->unk4 >= 2) {
|
||||
arg0->unk4 = 2;
|
||||
return;
|
||||
}
|
||||
@@ -16230,7 +16239,7 @@ block_11:
|
||||
if (temp_t7_2 >= 0x1F) {
|
||||
sp34 = (s32) temp_a1;
|
||||
sp38 = temp_a2;
|
||||
if (func_800AAEF4(0xB0)->unk4 >= 2) {
|
||||
if (find_8018D9E0_entry_dupe(0xB0)->unk4 >= 2) {
|
||||
sp38 = temp_a2;
|
||||
func_8009A640(arg0->D_8018DEE0_index, 0, temp_a2, segmented_to_virtual_dupe(D_800E8380[temp_a1]));
|
||||
arg0->unk4 = 3;
|
||||
|
||||
+2
-2
@@ -156,8 +156,8 @@ void func_800A954C(struct_8018D9E0_entry*);
|
||||
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);
|
||||
struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32);
|
||||
struct_8018D9E0_entry *find_8018D9E0_entry(s32);
|
||||
s32 func_800AAF70(s32);
|
||||
void func_800AAF94(struct_8018D9E0_entry*, s32);
|
||||
void func_800AB260(struct_8018D9E0_entry*);
|
||||
|
||||
+382
-411
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user