diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2022-07-09 05:05:11 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-09 04:05:11 -0700 |
| commit | a8e984d2fd99150f5c9fe08af67f17edc6d8a0d3 (patch) | |
| tree | 1d25fe9d98483d66125a391ea4782257e8343a82 /src | |
| parent | 42b81c1979fd27448c6ca3d9c4b3d99650b14ded (diff) | |
Decomp 800 byte sized funcs and smaller (#241)
* Decomp 800 byte sized funcs and below
Diffstat (limited to 'src')
| -rw-r--r-- | src/code_80005FD0.c | 34 | ||||
| -rw-r--r-- | src/code_80071F00.c | 117 | ||||
| -rw-r--r-- | src/code_80086E70.c | 127 | ||||
| -rw-r--r-- | src/code_80091750.c | 14 |
4 files changed, 89 insertions, 203 deletions
diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 7014b28b2..946aca668 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -10718,31 +10718,15 @@ void func_80019FB4(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019FB4.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80019C50(s32); // extern -? func_80019FB4(s32); // extern - -void func_8001A0A4(s32 arg0, ? arg1, ? arg2, ? arg3, s32 arg4) { +void func_8001A0A4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { func_80019FB4(arg4); func_80019C50(arg4); } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0A4.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80019D2C(s32, s32, s32); // extern -? func_8001A0A4(s8, s32); // extern - -void func_8001A0DC(s32 arg1, s32 arg2, s8 arg3, s32 arg4) { - func_8001A0A4(arg3, arg4); +void func_8001A0DC(s16 *arg0, Camera *arg1, Player *arg2, s8 arg3, s32 arg4) { + func_8001A0A4(arg0, arg1, arg2, arg3, arg4); func_80019D2C(arg1, arg2, arg4); } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0DC.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de @@ -10823,20 +10807,12 @@ block_9: GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A220.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 s32 func_8001A310(s32 arg0, s32 arg1) { - s32 phi_a1; - - phi_a1 = arg1; if ((gCurrentCourseId == 2) && (arg1 != 0) && (arg0 >= 0xE7) && (arg0 < 0x1C2)) { - phi_a1 = 0; + arg1 = 0; } - return phi_a1; + return arg1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A310.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de diff --git a/src/code_80071F00.c b/src/code_80071F00.c index 5f95f7a15..210314349 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -176,39 +176,29 @@ UNUSED void func_80072214(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_054 ^= arg1; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C6C; - -? func_8007223C(s32 arg0, s32 arg1) { - ? phi_v1; +// maybe struct_80165C18_entry (same size) +// However, unk_000 needs to be s32. Could be an onion? +struct struct_8007223C { + s32 s32; + s8 unk4[0xDC]; +}; // Size 0xE0 - phi_v1 = 0; - if ((*(&D_80165C6C + (arg0 * 0xE0)) & arg1) != 0) { +extern struct struct_8007223C D_80165C6C[]; +s32 func_8007223C(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C6C[arg0].s32 & arg1) != 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007223C.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C6C; -? func_80072270(s32 arg0, s32 arg1) { - ? phi_v1; - - phi_v1 = 0; - if ((*(&D_80165C6C + (arg0 * 0xE0)) & arg1) == 0) { +s32 func_80072270(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C6C[arg0].s32 & arg1) == 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072270.s") -#endif void func_800722A4(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_058 |= arg1; @@ -222,39 +212,23 @@ UNUSED void func_800722F8(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_058 ^= arg1; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C70; - -? func_80072320(s32 arg0, s32 arg1) { - ? phi_v1; +extern struct struct_8007223C D_80165C70[]; - phi_v1 = 0; - if ((*(&D_80165C70 + (arg0 * 0xE0)) & arg1) != 0) { +s32 func_80072320(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C70[arg0].s32 & arg1) != 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072320.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C70; - -? func_80072354(s32 arg0, s32 arg1) { - ? phi_v1; - phi_v1 = 0; - if ((*(&D_80165C70 + (arg0 * 0xE0)) & arg1) == 0) { +s32 func_80072354(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C70[arg0].s32 & arg1) == 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072354.s") -#endif // maybe struct_80165C18_entry (same size) // However, unk_000 needs to be s32. Could be an onion? @@ -1490,7 +1464,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80074924.s") void func_80074D94(s32 arg0) { if (D_80165C18[arg0].unk_0AE == 1) { - if ((D_80165740 <= D_80165C18[arg0].unk_02C) && (s16_step_down_towards(&D_80165C18[arg0].unk_0A0, 0, 8) != 0)) { + if ((D_80165740 <= D_80165C18[arg0].unk_028[1]) && (s16_step_down_towards(&D_80165C18[arg0].unk_0A0, 0, 8) != 0)) { func_80086F60(arg0); } func_800877C4(arg0); @@ -1868,9 +1842,9 @@ void func_80075698(s32 arg0) { D_80165C18[arg0].unk_0C0 = 0; D_80165C18[arg0].unk_0B2 = 0; D_80165C18[arg0].unk_0B6 = 0; - D_80165C18[arg0].unk_028 = 0.0f; - D_80165C18[arg0].unk_02C = 0.0f; - D_80165C18[arg0].unk_030 = 0.0f; + D_80165C18[arg0].unk_028[0] = 0.0f; + D_80165C18[arg0].unk_028[1] = 0.0f; + D_80165C18[arg0].unk_028[2] = 0.0f; D_80165C18[arg0].unk_000 = 0.5f; func_80072488(arg0); } @@ -1882,7 +1856,7 @@ void func_80075714(s32 arg0) { break; case 2: D_80165C18[arg0].unk_03C -= D_800EEAD0; - f32_step_up_towards(&D_80165C18[arg0].unk_02C, 100.0f, D_80165C18[arg0].unk_03C); + f32_step_up_towards(&D_80165C18[arg0].unk_028[1], 100.0f, D_80165C18[arg0].unk_03C); func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, D_800EEAD8, 1, 0); if (func_80073B00(arg0, &D_80165C18[arg0].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(arg0); @@ -2039,9 +2013,9 @@ void func_80075B08(s32 arg0) { D_80165C18[arg0].unk_0C0 = 0; D_80165C18[arg0].unk_0B2 = 0; D_80165C18[arg0].unk_0B6 = 0; - D_80165C18[arg0].unk_028 = 0.0f; - D_80165C18[arg0].unk_02C = 0.0f; - D_80165C18[arg0].unk_030 = 0.0f; + D_80165C18[arg0].unk_028[0] = 0.0f; + D_80165C18[arg0].unk_028[1] = 0.0f; + D_80165C18[arg0].unk_028[2] = 0.0f; D_80165C18[arg0].unk_000 = 0.5f; func_80072488(arg0); } @@ -2053,7 +2027,7 @@ void func_80075B84(s32 arg0) { break; case 2: D_80165C18[arg0].unk_03C -= D_800EEAE0; - f32_step_up_towards(&D_80165C18[arg0].unk_02C, 100.0f, D_80165C18[arg0].unk_03C); + f32_step_up_towards(&D_80165C18[arg0].unk_028[1], 100.0f, D_80165C18[arg0].unk_03C); func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, D_800EEAE8, 1, 0); if (func_80073B00(arg0, &D_80165C18[arg0].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(arg0); @@ -5220,10 +5194,6 @@ void func_8007A88C(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007A88C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80079860(s32); // extern -? func_8007A88C(); // extern extern s8 D_801657B4; void func_8007A910(s32 arg0) { @@ -5232,9 +5202,6 @@ void func_8007A910(s32 arg0) { } func_80079860(arg0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007A910.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -5482,27 +5449,14 @@ block_8: GLOBAL_ASM("asm/non_matchings/code_80071F00/gen_random_item.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? gen_random_item(s16, ?); // extern - +void gen_random_item(s16, s16); void func_8007AF40(s32 arg0, s16 arg1) { gen_random_item(arg1, 0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007AF40.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? gen_random_item(s16, ?); // extern void func_8007AF78(s32 arg0, s16 arg1) { gen_random_item(arg1, 1); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007AF78.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -6111,26 +6065,17 @@ void func_8007BD04(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BD04.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8007BBBC(s32); // extern -? func_8007BD04(?); // extern -? func_8008BF18(s32); // extern extern s32 D_80183F28; void func_8007BDA8(void) { - s32 sp18; + s32 pad; s32 temp_a0; func_8007BD04(0); temp_a0 = D_80183F28; - sp18 = temp_a0; func_8007BBBC(temp_a0); func_8008BF18(temp_a0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BDA8.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 diff --git a/src/code_80086E70.c b/src/code_80086E70.c index c647939c5..7ff30fd0b 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -2376,102 +2376,71 @@ void func_8008B78C(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B78C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - void func_8008B7D4(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk10 = arg1; - temp_v0->unk14 = arg2; - temp_v0->unk18 = arg3; + D_80165C18[arg0].unk_010[0] = arg1; + D_80165C18[arg0].unk_010[1] = arg2; + D_80165C18[arg0].unk_010[2] = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B7D4.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; void func_8008B80C(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk28 = arg1; - temp_v0->unk2C = arg2; - temp_v0->unk30 = arg3; + D_80165C18[arg0].unk_028[0] = arg1; + D_80165C18[arg0].unk_028[1] = arg2; + D_80165C18[arg0].unk_028[2] = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B80C.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; void func_8008B844(s32 arg0) { - f32 temp_f0; - void *temp_v0; + f32 temp_f0 = D_80165C18[arg0].unk_010[0]; - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_f0 = temp_v0->unk10; - temp_v0->unk4 = temp_v0->unk28 + temp_f0; - temp_v0->unk8 = temp_v0->unk2C + temp_f0; - temp_v0->unkC = temp_v0->unk30 + temp_f0; + D_80165C18[arg0].unk_004[0] = D_80165C18[arg0].unk_028[0] + temp_f0; + D_80165C18[arg0].unk_004[1] = D_80165C18[arg0].unk_028[1] + temp_f0; + D_80165C18[arg0].unk_004[2] = D_80165C18[arg0].unk_028[2] + temp_f0; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B844.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - -void func_8008B888(s32 arg0, s16 arg1, s16 arg2, s16 arg3) { - void *temp_v0; - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unkBE = arg1; - temp_v0->unkC0 = arg2; - temp_v0->unkC2 = arg3; +void func_8008B888(s32 arg0, u16 arg1, u16 arg2, u16 arg3) { + D_80165C18[arg0].unk_0BE = arg1; + D_80165C18[arg0].unk_0C0 = arg2; + D_80165C18[arg0].unk_0C2 = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B888.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - -void func_8008B8BC(s32 arg0, s16 arg1, s16 arg2, s16 arg3) { - void *temp_v0; +void func_8008B8BC(s32 arg0, u16 arg1, u16 arg2, u16 arg3) { + D_80165C18[arg0].unk_0B2 = arg1; + D_80165C18[arg0].unk_0B4 = arg2; + D_80165C18[arg0].unk_0B6 = arg3; +} - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unkB2 = arg1; - temp_v0->unkB4 = arg2; - temp_v0->unkB6 = arg3; +void func_8008B8F0(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { + D_80165C18[arg0].unk_038 = arg1; + D_80165C18[arg0].unk_03C = arg2; + D_80165C18[arg0].unk_040 = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B8BC.s") -#endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - -void func_8008B8F0(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; +UNUSED void func_8008B928(s32 arg0, s16 arg1, s16 arg2, s16 arg3, void *arg4) { + s16 temp_v0; + s32 temp_t3; + void *temp_s0; - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk38 = arg1; - temp_v0->unk3C = arg2; - temp_v0->unk40 = arg3; -} -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B8F0.s") + temp_s0 = (arg0 * 0xE0) + &D_80165C18; + temp_s0->unk10 = (f32) arg1; + temp_s0->unk14 = (f32) arg2; + temp_s0->unk80 = arg4; + temp_s0->unk18 = (f32) arg3; + temp_s0->unk38 = (f32) (arg4->unkA - arg4->unk2); + temp_s0->unk3C = (f32) (arg4->unkC - arg4->unk4); + temp_s0->unk40 = (f32) (arg4->unkE - arg4->unk6); + temp_v0 = func_80087368(arg1, arg2, arg3); + temp_t3 = -temp_v0 & 0xFFFF; + temp_s0->unkC0 = temp_v0; + temp_s0->unk40 = func_800416D8(temp_s0->unk40, temp_s0->unk38, temp_t3); + temp_s0->unkBE = func_80087324(arg0); +} + +UNUSED void func_8008BA40(s32 arg0, s16 arg1, u16 arg2) { + *(&D_80165C28 + (arg0 * 0xE0)) = (f32) (arg1 + (s16) (random_int(arg2) - ((s32) arg2 / 2))); +} +*/ +#else +GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B928.s") #endif #ifdef MIPS_TO_C diff --git a/src/code_80091750.c b/src/code_80091750.c index 76ff9d05f..db02a30c2 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -608,18 +608,14 @@ void func_800925A0(void) { add_8018D9E0_entry(0xAF, 0, 0, 0); } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern void *find_8018D9E0_entry_dupe(s32); // extern -// removed a temp from this func temp = find_8018D9E0_entry_dupe. +struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32 arg0); + void func_800925CC(void) { - if (find_8018D9E0_entry_dupe(0xAF)->unk4 == 2) { - find_8018D9E0_entry_dupe(0xAF)->unk4 = 3; + struct_8018D9E0_entry *temp = find_8018D9E0_entry_dupe(0xAF); + if (temp->unk4 == 2) { + temp->unk4 = 3; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800925CC.s") -#endif void func_80092604(void) { add_8018D9E0_entry(0xB0, 0, 0, 0); |
