Match the other D_80189DE0 search functions (#163)

* Match the other D_80189DE0 search functions

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran 2022-02-14 00:04:03 -05:00 committed by GitHub
parent af8ca42a0c
commit 3403482de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 50 deletions

View File

@ -14575,60 +14575,48 @@ void func_800AAE18(struct_8018D9E0_entry *arg0) {
}
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_8018D9E0;
extern ? D_8018DEE0;
/**
* Similar to find_8018D9E0_entry_dupe, there is potential for a
* hard lock in the function if no appropriate D_8018D9E0 entry
* is found.
**/
struct_8018D9E0_entry *func_800AAE68(void) {
struct_8018D9E0_entry *entry = D_8018D9E0;
s32 thing = D_8018EDF3 - 1;
s32 *func_800AAE68(void) {
s32 *temp_v1;
s32 *phi_v1;
phi_v1 = &D_8018D9E0;
loop_1:
if ((D_8018EDF3 - 1 + 0xB) != *phi_v1) {
temp_v1 = phi_v1 + 0x28;
phi_v1 = temp_v1;
if (&D_8018DEE0 < temp_v1) {
loop_3:
goto loop_3;
for(; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) {
if ((thing + 0xB) == entry->type) {
goto escape;
}
goto loop_1;
}
return phi_v1;
// Something VERY wrong has occurred
while(TRUE);
escape:
return entry;
}
/**
* Similar to find_8018D9E0_entry_dupe, there is potential for a
* hard lock in the function if no appropriate D_8018D9E0 entry
* is found.
**/
struct_8018D9E0_entry *func_800AAEB4(s32 arg0) {
struct_8018D9E0_entry *entry = D_8018D9E0;
for(; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) {
if ((arg0 + 0x2B) == entry->type) {
goto escape;
}
}
// Something VERY wrong has occurred
while(TRUE);
escape:
return entry;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAE68.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_8018D9E0;
extern ? D_8018DEE0;
s32 *func_800AAEB4(s32 arg0) {
s32 *temp_v1;
s32 *phi_v1;
phi_v1 = &D_8018D9E0;
loop_1:
if ((arg0 + 0x2B) != *phi_v1) {
temp_v1 = phi_v1 + 0x28;
phi_v1 = temp_v1;
if (&D_8018DEE0 < temp_v1) {
loop_3:
goto loop_3;
}
goto loop_1;
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AAEB4.s")
#endif
/**
* @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
@ -14646,8 +14634,8 @@ struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32 arg0) {
}
}
// I don't know why they'd want a function that could potentially hard lock the game...
while(1);
// Something VERY wrong has occurred
while(TRUE);
escape:
return entry;
}

View File

@ -165,6 +165,7 @@ void func_800A94C8(struct_8018D9E0_entry*, s32, s32);
void func_800A954C(struct_8018D9E0_entry*);
void func_800AADD4(struct_8018D9E0_entry*);
void func_800AAE18(struct_8018D9E0_entry*);
struct_8018D9E0_entry *func_800AAE68();
struct_8018D9E0_entry *func_800AAEB4(s32);
struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32);
struct_8018D9E0_entry *find_8018D9E0_entry(s32);