diff options
Diffstat (limited to 'src/code_80290C20.c')
| -rw-r--r-- | src/code_80290C20.c | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/code_80290C20.c b/src/code_80290C20.c index 36c061c5a..f824d7216 100644 --- a/src/code_80290C20.c +++ b/src/code_80290C20.c @@ -18,6 +18,9 @@ extern uintptr_t gSegmentTable[]; extern void func_802AAAAC(Player *); extern Player gPlayers[]; +extern s32 D_8015F59C; +extern s32 D_8015F5A0; + s32 func_80290C20(Camera *camera) { if (camera->unk14 == 0) { return 1; @@ -31,42 +34,43 @@ s32 func_80290C20(Camera *camera) { return 0; } -#ifdef MIPS_TO_C +//#ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 void func_802AF5D8(u32, s8, s32); // extern extern s32 D_8015F5A4; -void func_80290CAC(u32 arg0) { - s32 *temp_s0; - s32 *phi_s0; - - temp_s0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; - phi_s0 = temp_s0; - if (*temp_s0 != 0) { - do { - if ((phi_s0->unk6 & 0x8000) != 0) { - D_8015F59C = 1; - } else { - D_8015F59C = 0; - } - if ((phi_s0->unk6 & 0x2000) != 0) { - D_8015F5A0 = 1; - } else { - D_8015F5A0 = 0; - } - if ((phi_s0->unk6 & 0x4000) != 0) { - D_8015F5A4 = 1; - } else { - D_8015F5A4 = 0; - } - func_802AF5D8(phi_s0->unk0, phi_s0->unk4, phi_s0->unk5); - phi_s0 += 8; - } while (phi_s0->unk8 != 0); +struct Unk0CAC { + s32 unk0; + u8 unk4; + u8 unk5; + u16 unk6; +}; + +void func_80290CAC(uintptr_t arg0) { + s32 segment = SEGMENT_NUMBER2(arg0); + s32 offset = SEGMENT_OFFSET(arg0); + struct Unk0CAC *data = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + + while(data->unk0 != 0) { + if ((data->unk6 & 0x8000) != 0) { + D_8015F59C = 1; + } else { + D_8015F59C = 0; + } + if ((data->unk6 & 0x2000) != 0) { + D_8015F5A0 = 1; + } else { + D_8015F5A0 = 0; + } + if ((data->unk6 & 0x4000) != 0) { + D_8015F5A4 = 1; + } else { + D_8015F5A4 = 0; + } + func_802AF5D8(data->unk0, data->unk4, data->unk5); + data++; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80290C20/func_80290CAC.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 |
