From 023aafaa929a0f01dfec54030ab0ad6728f16dfb Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Sun, 14 Aug 2022 16:49:51 -0500 Subject: [PATCH] core2/code_B62B0.c done --- include/prop.h | 58 +++-- include/structs.h | 2 +- progress/progress_core2.svg | 6 +- progress/progress_total.svg | 6 +- src/FP/code_45D0.c | 7 +- src/core2/code_47C0.c | 4 +- src/core2/code_7060.c | 2 +- src/core2/code_75480.c | 22 +- src/core2/code_75930.c | 36 ++- src/core2/code_75E90.c | 134 +++++++++- src/core2/code_7AF80.c | 62 ++++- src/core2/code_83340.c | 6 +- src/core2/code_A5BC0.c | 485 ++++++++++++++++++++++++++++++------ src/core2/code_B3A80.c | 12 +- src/core2/code_B5E00.c | 6 +- src/core2/code_B62B0.c | 226 +++++++++++++++-- src/core2/code_C9F00.c | 49 ++-- subyaml/core2.us.v10.yaml | 7 +- 18 files changed, 932 insertions(+), 198 deletions(-) diff --git a/include/prop.h b/include/prop.h index 23f23c15..4fc08cce 100644 --- a/include/prop.h +++ b/include/prop.h @@ -8,34 +8,36 @@ typedef struct sprite_prop_s{ u32 unk0_31:0xC; - u32 pad0_19:0x1; + u32 unk0_19:0x1; u32 unk0_18:0x3; u32 unk0_15:0x3; u32 unk0_12:0x3; u32 unk0_9:0x8; u32 unk0_1:0x1; - u32 pad0_0:0x1; + u32 unk0_0:0x1; s16 unk4[3]; u16 unk8_15: 5; - u16 pad8_10: 6; + u16 unk8_10: 5; + u16 pad8_5: 1; u16 unk8_4: 1; - u16 pad8_3: 2; + u16 unk8_3: 1; + u16 unk8_2: 1; u16 unk8_1:1; u16 unk8_0:1; } SpriteProp; -typedef struct prop_prop_s{ +typedef struct model_prop_s{ u16 unk0_31:12; u16 pad0_19:4; u8 unk0_15; - u8 unk0_7; + u8 unk0_7; s16 unk4[3]; - u8 unkA; + u8 unkA; //scale * 100.0 u8 padB_7 :2; u8 unkB_5 :1; u8 unkB_4 :1; u8 padB_3 :4; -} PropProp; +} ModelProp; typedef struct actor_prop_s{ struct actorMarker_s* marker; @@ -55,6 +57,7 @@ typedef struct actor_prop_s{ typedef void(*MarkerCollisionFunc)(struct actorMarker_s *this, struct actorMarker_s *other); typedef struct actor_s *(*MarkerDrawFunc)(struct actorMarker_s *, Gfx **, Mtx **, Vtx **); typedef void (*ActorUpdateFunc)(struct actor_s *); +typedef void (*ActorFreeFunc)(struct actor_s *); typedef struct actorMarker_s{ ActorProp* propPtr; @@ -78,7 +81,7 @@ typedef struct actorMarker_s{ u32 unk2C_2:1; u32 unk2C_1:1; u32 collidable:1; - void (*unk30)(struct actor_s *); //actor free method + ActorFreeFunc unk30; //actor free method s32 unk34; s16 unk38[3]; u16 pad3E_15:1; @@ -97,7 +100,7 @@ typedef struct actorMarker_s{ BKModel * unk48; vector(Struct70s) * unk4C; s32 unk50; - void (*unk54)(struct actorMarker_s *, struct actorMarker_s *, s16*); + void (*unk54)(struct actorMarker_s *, struct actorMarker_s *, u16*); s32 (*unk58)(struct actorMarker_s *, struct actorMarker_s *); s32 unk5C; } ActorMarker; @@ -184,7 +187,7 @@ typedef struct actor_s{ f32 unk74; u32 unk78_31:9; u32 unk78_22:9; - u32 unk78_13:12; + u32 unk78_13:12; //default_spawn_yaw? u32 stored_animctrl_forwards:1; //animCtrlDirection u32 stored_animctrl_smoothTransistion:1; //animCtrlSmoothTransition union @@ -306,12 +309,13 @@ typedef union prop_s { ActorProp actorProp; SpriteProp spriteProp; - PropProp propProp; + ModelProp modelProp; struct{ u8 pad0[4]; s16 unk4[3]; // s16 unk6; - s16 pad8_15: 11; + s16 pad8_15: 10; + u16 unk8_5: 1; u16 unk8_4: 1; u16 unk8_3: 1; u16 unk8_2: 1; @@ -324,21 +328,29 @@ typedef struct { s16 x; s16 y; s16 z; - u16 unk6_15: 9; //selector_value //volume??? diameter - u16 unk6_6: 6; //category - u16 unk6_0: 1; - u16 unk8; + struct { + u16 bit15: 9; //selector_value //volume??? diameter + u16 bit6: 6; //category + u16 bit0: 1; + }unk6; + u16 unk8; //actor_id? u8 unkA; //marker_id - u8 padB[1]; - u32 unkC_31:9; + struct { + u8 pad_bit7: 2; + u8 bit5: 1; + u8 bit4: 1; + u8 pad_bit3: 3; + u8 bit0: 1; + }unkB; + // u8 padB[1]; + u32 unkC_31:9; //yaw??? u32 unkC_22:23; u32 unk10_31 : 12; - u32 pad10_19 : 12; + u32 unk10_19 : 12; u32 unk10_7 : 1; u32 unk10_6 : 1; - u32 pad10_5 : 1; - u32 unk10_4 : 4; - u32 pad10_0 : 1; + u32 pad10_5 : 4; + u32 unk10_0 : 2; } NodeProp; typedef struct cude_s{ diff --git a/include/structs.h b/include/structs.h index 9efbcbd5..58a5f949 100644 --- a/include/structs.h +++ b/include/structs.h @@ -728,7 +728,7 @@ typedef struct { typedef struct{ s32 (* unk0)(struct actor_marker_s *, f32[3], f32, f32[3], s32); - s32 (* unk4)(struct actor_marker_s *, f32[3], f32, f32[3], s32); + s32 (* unk4)(struct actor_marker_s *, f32[3], f32[3], f32, f32[3], s32, u32); s32 (* unk8)(struct actor_marker_s *, f32[3], f32, f32[3], s32); s32 (* unkC)(struct actor_marker_s *, f32[3], f32, f32[3], s32); } Struct6Cs; diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index 48ea34bd..8fb52ced 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core2 - 79.1247% - 79.1247% + 79.6919% + 79.6919% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 3c95b261..e5339b2c 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 83.0050% - 83.0050% + 83.3305% + 83.3305% \ No newline at end of file diff --git a/src/FP/code_45D0.c b/src/FP/code_45D0.c index 9494f9db..5c3e12fb 100644 --- a/src/FP/code_45D0.c +++ b/src/FP/code_45D0.c @@ -38,9 +38,6 @@ void func_8038AA58(void){} #else void func_8038AA60(void){ switch(D_80392F50.unk0){ - // case 0: - // break; - case 1: if(D_80392F50.unk4 <= 0){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); @@ -68,9 +65,13 @@ void func_8038AA60(void){ } break; + default: + case 0: case 3://L8038A96C + break; } + } #endif diff --git a/src/core2/code_47C0.c b/src/core2/code_47C0.c index 977fa43d..7ea210fc 100644 --- a/src/core2/code_47C0.c +++ b/src/core2/code_47C0.c @@ -806,9 +806,9 @@ void func_8028BCA0(Prop *prop){ func_8032B258(actor, obj_collision_type); } } - else if(prop->unk8_1)//L8028D0B0 //PropProp + else if(prop->unk8_1)//L8028D0B0 //ModelProp { - tmp2 = prop->propProp.unk0_31 + 0x2D1; + tmp2 = prop->modelProp.unk0_31 + 0x2D1; switch (tmp2) { case 0x2E8: diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index df2d237f..35736e93 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -62,7 +62,7 @@ bool func_8028E060(s32 arg0, s32 *arg1){ return TRUE; } else{ - return func_80305344(func_803084F0(), arg1); + return func_80305344(func_803084F0(arg0), arg1); } } diff --git a/src/core2/code_75480.c b/src/core2/code_75480.c index 1cfaf786..169553a0 100644 --- a/src/core2/code_75480.c +++ b/src/core2/code_75480.c @@ -39,12 +39,26 @@ void func_802FC580(s32 arg0, struct8s * arg1){ func_802FC4AC(arg1); } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5A4.s") +void func_802FC5A4(s32 arg0, struct8s *arg1){ + func_802FC468(); +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5C8.s") +void func_802FC5C8(s32 arg0, struct8s *arg1){ + arg1->unk18 = 0; + arg1->unk1C = 0.0f; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5DC.s") +void func_802FC5DC(s32 arg0, struct8s *arg1){ + s32 sp1C; + struct8s *var_v0 = D_80381570[0]; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC630.s") + if(D_803698B4 != 0){ + arg1->unkC = func_802FC410(arg1) + var_v0->unk1C; + } +} + +void func_802FC630(s32 ag0, struct8s* arg1){ + D_803698B4 = 0; +} #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC644.s") diff --git a/src/core2/code_75930.c b/src/core2/code_75930.c index 13be5908..0ee9e653 100644 --- a/src/core2/code_75930.c +++ b/src/core2/code_75930.c @@ -24,19 +24,43 @@ f32 func_802FC8C0(struct8s * arg0) { return 0.0f; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FC918.s") +void func_802FC918(void){ + s32 i = 0; + + D_803698E4--; + while(i < D_803698E4){ + D_80381580[i] = D_80381580[i + 1]; + i++; + } +} #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FC95C.s") -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA30.s") +void func_802FCA30(s32 arg0, struct8s *arg1){ + func_802FC95C(arg1); +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA54.s") +void func_802FCA54(s32 arg0, struct8s *arg1){ + func_802FC918(); +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA78.s") +void func_802FCA78(s32 arg0, struct8s *arg1){ + arg1->unk18 = 0; + arg1->unk1C = 0.0f; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA8C.s") +void func_802FCA8C(s32 arg0, struct8s *arg1){ + s32 sp1C; + struct8s *var_v0 = D_80381580[0]; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCAE0.s") + if(D_803698E4 != 0){ + arg1->unkC = func_802FC8C0(arg1) + var_v0->unk1C; + } +} + +void func_802FCAE0(s32 arg0, struct8s *arg1){ + D_803698E4 = 0; +} #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCAF4.s") diff --git a/src/core2/code_75E90.c b/src/core2/code_75E90.c index c3e887f4..92f50a92 100644 --- a/src/core2/code_75E90.c +++ b/src/core2/code_75E90.c @@ -3,29 +3,147 @@ #include "variables.h" /* .data */ +extern f32 D_803698F0[]; extern s32 D_80369914; /* .bss */ struct8s *D_80381590[4]; /* .code */ -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCE20.s") +f32 func_802FCE20(struct8s * arg0) { + f32 var_f2; + s32 var_v0; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCE88.s") + var_f2 = 0.0f; + for(var_v0 = 0; var_v0 < D_80369914; var_v0++){ + if (arg0 == D_80381590[var_v0]) { + return var_f2; + } + var_f2 += 40.0; + } + return 0.0f; +} +void func_802FCE88(void){ + s32 i = 0; + + D_80369914--; + while(i < D_80369914){ + D_80381590[i] = D_80381590[i + 1]; + i++; + } +} + +#ifndef NONMATCHING #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCECC.s") +#else +void func_802FCECC(struct8s *arg0) { + s32 temp_a1; + s32 temp_t9; + s32 var_v1; + struct8s **var_v0; + void **var_v0_2; + struct8s *temp_a0; + struct8s *sp18; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFA0.s") + for(var_v1 = 0; var_v1 < D_80369914; var_v1++){ + temp_a0 = D_80381590[var_v1]; + if (arg0 == temp_a0) { + sp18 = D_80381590[0]; + func_802FB020(temp_a0, 1); + sp18->unk10 = 3.0f; + if (sp18->unk18 == 0) { + sp18->unk1C = 0.0f; + } + break; + } + } + var_v0 = D_80381590 + D_80369914; + for(var_v1 = 0; var_v1 < D_80369914; var_v1++){ + var_v0[-var_v1] = var_v0[-(var_v1 + 1)]; + } + D_80381590[0] = arg0; + D_80369914++; +} +#endif -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFC4.s") +void func_802FCFA0(s32 arg0, struct8s *arg1){ + func_802FCECC(arg1); +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFE8.s") +void func_802FCFC4(s32 arg0, struct8s *arg1){ + func_802FCE88(); +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFFC.s") +void func_802FCFE8(s32 arg0, struct8s *arg1){ + arg1->unk18 = 0; + arg1->unk1C = 0.0f; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FD050.s") +void func_802FCFFC(s32 arg0, struct8s *arg1){ + s32 sp1C; + struct8s *var_v0 = D_80381590[0]; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FD064.s") + if(D_80369914 != 0){ + arg1->unkC = func_802FCE20(arg1) + var_v0->unk1C; + } +} + +void func_802FD050(s32 arg0, struct8s *arg1){ + D_80369914 = 0; +} + +void func_802FD064(void) { + f32 temp_f0; + struct8s *temp_s2; + s32 var_s1; + + temp_s2 = D_80381590[0]; + if (D_80369914 == 0) + return; + + switch (temp_s2->unk0) { + case 1: + temp_f0 = D_803698F0[temp_s2->unk18]; + temp_s2->unk1C += temp_s2->unk14 * temp_f0; + if (temp_f0 == 0.0) { + temp_s2->unk10 = 3.0f; + temp_s2->unk0 = 2; + } else { + temp_s2->unk18++; + } + break; + + case 2: + if (getGameMode() != GAME_MODE_4_PAUSED) { + temp_s2->unk10 -= time_getDelta(); + if (temp_s2->unk10 < 0.0f) { + temp_s2->unk0 = 3; + for(var_s1 = 1; var_s1 < D_80369914; var_s1++){ + func_802FCFE8(6, D_80381590[var_s1]); + func_802FB020(D_80381590[var_s1], temp_s2->unk0); + } + } + } + break; + + case 3: + if (temp_s2->unk1C < -20.0f) { + func_802FB020(temp_s2, 0); + break; + } else { + temp_s2->unk18 = (temp_s2->unk18 - 1 < 0) ? 0 : temp_s2->unk18 - 1; + temp_f0 = D_803698F0[temp_s2->unk18]; + temp_s2->unk1C -= temp_s2->unk14 * temp_f0; + } + break; + } + for(var_s1 = 1; var_s1 < D_80369914; var_s1++){ + if(temp_s2->unk0 == 2){ + D_80381590[var_s1]->unk0 = temp_s2->unk0; + } + } +} int func_802FD2D4(void){ if(!D_80369914) diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 93271b64..67a51e8f 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -864,7 +864,7 @@ void cubeList_fromFile(Struct61s *file_ptr) { cube = cube_atIndices(sp5C); if (cube->unk0_4) { for(iPtr = cube->prop1Ptr; iPtr < &cube->prop1Ptr[cube->unk0_4] ;iPtr++){ - if (!iPtr->unk6_0) { + if (!iPtr->unk6.bit0) { func_802CAF14(D_8036A9E0, iPtr->unkA, 1); } } @@ -890,7 +890,7 @@ s32 func_80304984(s32 arg0, u32 *arg1) { temp_v0 = func_803049CC(arg0, 0); if (temp_v0 != 0) { - *arg1 = temp_v0->unk6_15; + *arg1 = temp_v0->unk6.bit15; return 1; } return 0; @@ -934,7 +934,7 @@ NodeProp *func_80304D04(s32 arg0, s16 *arg1) { } s32 nodeprop_getRadius(NodeProp *arg0) { - return arg0->unk6_15; + return arg0->unk6.bit15; } void func_80304D4C(NodeProp *arg0, s32 dst[3]) { @@ -1036,17 +1036,17 @@ bool func_8030526C(f32 arg0[3], s32 arg1, s32 arg2){ return func_8030515C(arg0, arg1, arg2, func_802586B0); } -bool func_80305290(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1){ +bool func_80305290(bool (* arg0)(NodeProp *), bool (* arg1)(Prop *)){ Cube *phi_s0; phi_s0 = D_80381FA0.cube_list; while (phi_s0 < &D_80381FA0.cube_list[D_80381FA0.cubeCnt]) { - if (func_8032E398(phi_s0, arg0, arg1) == 0) { - return 0; + if (!func_8032E398(phi_s0, arg0, arg1)) { + return FALSE; } phi_s0++; } - return 1; + return TRUE; } bool func_80305344(s32 arg0, u32 *arg1) { @@ -1575,8 +1575,48 @@ void func_80308230(s32 arg0) { #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803083B0.s") +s32 func_803084F0(s32 arg0){ + s32 var_v1; + switch (arg0) { + case 1: var_v1 = 1; break; + case 0x2: var_v1 = 2; break; + case 0x3: var_v1 = 0x15; break; + case 0x4: var_v1 = 0x76; break; + case 0x5: var_v1 = 0x77; break; + case 0x6: var_v1 = 0x78; break; + case 0x7: var_v1 = 0x79; break; + case 0x8: var_v1 = 0x7A; break; + case 0x9: var_v1 = 0x7B; break; + case 0xA: var_v1 = 0x7C; break; + case 0xB: var_v1 = 0x7D; break; + case 0xC: var_v1 = 0x7E; break; + case 0xD: var_v1 = 0x7F; break; + case 0xE: var_v1 = 0x75; break; + case 0xF: var_v1 = 0x74; break; + case 0x10: var_v1 = 0x73; break; + case 0x11: var_v1 = 0x72; break; + case 0x12: var_v1 = 0x103; break; + case 0x13: var_v1 = 0x104; break; + case 0x14: var_v1 = 0x105; break; + case 0x15: var_v1 = 0x106; break; + case 0x16: var_v1 = 0x107; break; + case 0x17: var_v1 = 0x158; break; + case 0x18: var_v1 = 0x15A; break; + case 0x19: var_v1 = 0x15C; break; + case 0x5B: var_v1 = 0x1CD; break; + case 0x5C: var_v1 = 0x1CE; break; + case 0x5D: var_v1 = 0x1CF; break; + case 0x5E: var_v1 = 0x1D0; break; + case 0x5F: var_v1 = 0x1D1; break; + case 0x60: var_v1 = 0x1D2; break; + case 0x61: var_v1 = 0x1D3; break; + case 0x62: var_v1 = 0x1D4; break; + case 0x65: var_v1 = 0x379; break; + default: case 0: var_v1 = 0; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803084F0.s") + } + return var_v1; +} void func_80308658(Struct_core2_7AF80_1 *arg0, s32 arg1) { Struct_core2_7AF80_1 * i; @@ -1693,7 +1733,7 @@ void func_80308984(void) { } for(iCube = D_80381FA0.cube_list; iCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; iCube++){ for(iNode = iCube->prop1Ptr; iNode < iCube->prop1Ptr + iCube->prop1Cnt; iNode++){ - if (iNode->unk6_6 == 6 && !iNode->unk6_0){ + if (iNode->unk6.bit6 == 6 && !iNode->unk6.bit0){ if((iNode->unk8 >= (u32)sp54) && ((u32)sp50 >= iNode->unk8)) { for(i = 0; iNode->unk8 != (u32)D_8036ABAC[i] && -1 != (u32)D_8036ABAC[i]; i++){ } @@ -1704,8 +1744,8 @@ void func_80308984(void) { for(jCube = iCube; jCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; jCube++){ for(jNode = jCube->prop1Ptr; jNode < jCube->prop1Ptr + jCube->prop1Cnt; jNode++){ if( - jNode->unk6_6 == 6 - && !jNode->unk6_0 + jNode->unk6.bit6 == 6 + && !jNode->unk6.bit0 && jNode->unk8 == D_8036ABC0[i] ) { func_8030895C(jCube - D_80381FA0.cube_list); diff --git a/src/core2/code_83340.c b/src/core2/code_83340.c index a32532f9..273b94fd 100644 --- a/src/core2/code_83340.c +++ b/src/core2/code_83340.c @@ -76,7 +76,7 @@ BKSprite *func_8030A55C(s32 arg0){ f32 func_8030A590(Prop *arg0){ if(arg0->unk8_1){ - PropProp* propProp = &arg0->propProp; + ModelProp* ModelProp = &arg0->modelProp; return D_80382390[arg0->spriteProp.unk0_31].unk8; } else{//L8030A65C @@ -87,8 +87,8 @@ f32 func_8030A590(Prop *arg0){ void func_8030A5EC(Prop *arg0, f32 arg1){ if(arg0->unk8_1){ - PropProp* propProp = &arg0->propProp; - D_80382390[arg0->spriteProp.unk0_31].unk8 = (f32)propProp->unkA*arg1/100.0f; + ModelProp* ModelProp = &arg0->modelProp; + D_80382390[arg0->spriteProp.unk0_31].unk8 = (f32)ModelProp->unkA*arg1/100.0f; } else{//L8030A65C SpriteProp *spriteProp = &arg0->spriteProp; diff --git a/src/core2/code_A5BC0.c b/src/core2/code_A5BC0.c index 8b8745eb..cf375f4b 100644 --- a/src/core2/code_A5BC0.c +++ b/src/core2/code_A5BC0.c @@ -2,13 +2,16 @@ #include "functions.h" #include "variables.h" +#define AssetCacheSize 0x3D5 extern int func_802E74A0(f32[3], f32, s32, s32); +extern s32 func_802E9118(BKCollisionList * collision_list, BKVertexList *vtx_list, f32 arg2[3], s32 arg3, f32 arg4, f32 arg5[3], f32 arg6[3], f32 arg7, f32 arg8[3], s32 arg9, s32 argA); extern f32 func_802EC920(BKVertexList *); extern void func_802C39D4(void); extern bool func_80340020(s32, f32[3], f32[3], f32, s32, BKVertexList *, f32[3], f32[3]); extern void func_80340200(s32, f32[3], f32[3], f32, s32, s32, BKVertexList *, s32); + extern f32 func_8030A590(void); extern void func_8030A5EC(Prop *, f32); @@ -57,7 +60,7 @@ extern s16 D_8036E7FC[]; /* .rodata */ extern f32 D_80378EA0; extern f32 D_80378EA4; - +extern f64 D_80378EA8; extern f64 D_80378EB0; /* .bss */ @@ -71,7 +74,7 @@ f32 D_80383410[3]; ActorMarker *D_8038341C; s32 D_80383420; u8 D_80383428[0x1C]; -u32 D_80383444; +s32 D_80383444; int D_80383448; s32 D_80383450[0x40]; vector(ActorMarker *) *D_80383550; @@ -179,7 +182,7 @@ UNK_TYPE(s32) D_8038355C; // tmp_v0 = func_80330F50(prop->actorProp.marker); // } // else{ -// tmp_v0 = func_8030A55C(prop->propProp.unk0_31); +// tmp_v0 = func_8030A55C(prop->modelProp.unk0_31); // } // if(tmp_v0 == 0) return; @@ -208,7 +211,7 @@ void __marker_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx){ actor = marker_getActor(this); func_8033A28C(actor->unk58_2); if( actor->unk58_2 && !this->unk40_23 && !this->unk40_21 && !D_8036E7B0){ - func_8033A244(D_80378EA0); + func_8033A244(3700.0f); } if(actor->unk124_7 && !actor->despawn_flag && actor->unk58_0){ @@ -225,7 +228,7 @@ void __marker_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx){ func_8033A280(percentage); this->unk8(this, gfx, mtx, vtx); }//L8032D300 - func_8033A244(D_80378EA4); + func_8033A244(30000.0f); func_8033A280(1.0f); } @@ -298,16 +301,16 @@ void func_8032D510(Cube *cube, Gfx **gfx, Mtx **mtx, Vtx **vtx){ }//L8032D62C } else{//L8032D640 - sp94[0] = (f32)iProp->propProp.unk4[0]; - sp94[1] = (f32)iProp->propProp.unk4[1]; - sp94[2] = (f32)iProp->propProp.unk4[2]; + sp94[0] = (f32)iProp->modelProp.unk4[0]; + sp94[1] = (f32)iProp->modelProp.unk4[1]; + sp94[2] = (f32)iProp->modelProp.unk4[2]; if(iProp->unk8_1){ sp88[0] = 0.0f; - sp88[1] = (f32)((s32)iProp->propProp.unk0_15*2); - sp88[2] = (f32)((s32)iProp->propProp.unk0_7*2); + sp88[1] = (f32)((s32)iProp->modelProp.unk0_15*2); + sp88[2] = (f32)((s32)iProp->modelProp.unk0_7*2); func_8030A2D0(gfx, mtx, vtx, - sp94, sp88, (f32)iProp->propProp.unkA/100.0, - iProp->propProp.unk0_31, cube + sp94, sp88, (f32)iProp->modelProp.unkA/100.0, + iProp->modelProp.unk0_31, cube ); } else{//L8032D72C @@ -323,8 +326,8 @@ void func_8032D510(Cube *cube, Gfx **gfx, Mtx **mtx, Vtx **vtx){ }//L8032D7D4 } -ActorProp *func_8032D80C(Cube *cube) { - ActorProp *sp1C; +Prop *func_8032D80C(Cube *cube) { + Prop *sp1C; if (cube->prop2Ptr != NULL) { cube->prop2Cnt++; @@ -334,7 +337,7 @@ ActorProp *func_8032D80C(Cube *cube) { cube->prop2Ptr = malloc(sizeof(Prop)); } sp1C = &cube->prop2Ptr[cube->prop2Cnt-1]; - sp1C->unk8_0 = FALSE; + sp1C->markerFlag = FALSE; func_80330104(cube); return sp1C; } @@ -416,47 +419,121 @@ ActorMarker *func_8032DCAC(void){ return D_8038341C; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DCB8.s") +SpriteProp *func_8032DCB8(Cube *cube) { + SpriteProp *sp1C; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DDD8.s") + sp1C = func_8032D80C(cube); + sp1C->unk8_0 = FALSE; + sp1C->unk8_1 = FALSE; + sp1C->unk8_15 = 0; + sp1C->unk0_1 = 0; + sp1C->unk8_10 = randf() * 32.0f; + sp1C->unk8_3 = FALSE; + sp1C->unk8_2 = FALSE; + sp1C->unk8_4 = TRUE; + return sp1C; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DE2C.s") +void func_8032DDD8(Cube *cube) { + Prop *temp_v0; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DE48.s") + temp_v0 = func_8032D80C(cube); + temp_v0->markerFlag = FALSE; + temp_v0->unk8_1 = TRUE; + temp_v0->unk8_5 = FALSE; + temp_v0->unk8_3 = FALSE; + temp_v0->unk8_2 = FALSE; + temp_v0->unk8_4 = TRUE; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DE5C.s") -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DE78.s") +void func_8032DE2C(ModelProp *model_prop, enum asset_e sprite_id){ + model_prop->unk0_31 = sprite_id - 0x2d1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DE8C.s") +void func_8032DE48(ModelProp *model_prop, enum asset_e *model_id_ptr){\ + *model_id_ptr = ((*(u32*)model_prop) >> 0x14) + 0x2d1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DEA0.s") +void func_8032DE5C(SpriteProp *sprite_prop, enum asset_e sprite_id){ + sprite_prop->unk0_31 = sprite_id - 0x572; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DECC.s") +void func_8032DE78(SpriteProp *sprite_prop, enum asset_e *sprite_id_ptr){ + *sprite_id_ptr = sprite_prop->unk0_31 + 0x572; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DEE0.s") +void func_8032DE8C(SpriteProp *sprite_prop, s32 *arg1){ + *arg1 = sprite_prop->unk0_9; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DEFC.s") +void func_8032DEA0(SpriteProp *sprite_prop, s32 *arg1, s32 *arg2, s32 *arg3){ + *arg1 = sprite_prop->unk0_18; + *arg2 = sprite_prop->unk0_15; + *arg3 = sprite_prop->unk0_12; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF04.s") +void func_8032DECC(SpriteProp *sprite_prop, s32 *arg1){ + *arg1 = ((*(u32*)sprite_prop) << 0x1e) >> 0x1f;//sprite_prop->unk0_0; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF10.s") +void func_8032DEE0(SpriteProp *sprite_prop, s32 arg1){ + sprite_prop->unk0_9 = arg1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF24.s") +void func_8032DEFC(ModelProp *prop_prop, s32 arg1){ + prop_prop->unkA = arg1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF40.s") +void func_8032DF04(ModelProp *prop_prop, s32 *arg1){ + *arg1 = prop_prop->unkA; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF4C.s") +void func_8032DF10(SpriteProp *sprite_prop, bool *arg1){ + *arg1 = sprite_prop->unk0_19; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DF60.s") +void func_8032DF24(SpriteProp *sprite_prop, bool arg1){ + sprite_prop->unk0_1 = arg1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DFA0.s") +void func_8032DF40(ModelProp *prop_prop, s32 arg1, s32 arg2){ + prop_prop->unk0_15 = arg1; + prop_prop->unk0_7 = arg2; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DFBC.s") +void func_8032DF4C(ModelProp *prop_prop, s32 *arg1, s32 *arg2){ + *arg1 = prop_prop->unk0_15; + *arg2 = prop_prop->unk0_7; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DFD8.s") +void func_8032DF60(SpriteProp *sprite_prop, s32 arg1, s32 arg2, s32 arg3){ + sprite_prop->unk0_18 = arg1; + sprite_prop->unk0_15 = arg2; + sprite_prop->unk0_12 = arg3; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032DFF4.s") +void func_8032DFA0(SpriteProp *sprite_prop, bool arg1){ + sprite_prop->unk0_19 = arg1; +} + +void func_8032DFBC(NodeProp *node, s32 src[3]){ + node->x = src[0]; + node->y = src[1]; + node->z = src[2]; +} + +void func_8032DFD8(NodeProp *node, s32 dst[3]){ + dst[0] = node->x; + dst[1] = node->y; + dst[2] = node->z; +} + +void func_8032DFF4(Prop *prop, s32 src[3]){ + prop->unk4[0] = src[0]; + prop->unk4[1] = src[1]; + prop->unk4[2] = src[2]; +} void func_8032E010(ActorProp *prop, s32 dst[3]){ dst[0] = prop->x; @@ -471,8 +548,9 @@ NodeProp *func_8032E02C(Cube *cube, s32 prop_index) { return &cube->prop1Ptr[prop_index]; } - -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E070.s") +void func_8032E070(void){ + D_8038341C = NULL; +} void cube_free(Cube *cube){ Prop *iProp; @@ -495,13 +573,101 @@ void cube_free(Cube *cube){ cube->unk0_4 = 0; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E178.s") +bool func_8032E178(Cube *arg0, s32 *arg1, s32 arg2) { + NodeProp * temp_a2; + NodeProp *var_v1; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E230.s") + if ((arg0 != NULL) && (arg0->prop1Cnt != 0)) { + var_v1 = arg0->prop1Ptr; + temp_a2 = arg0->prop1Ptr + arg0->prop1Cnt; + while (var_v1 < temp_a2) { + if( ((var_v1->unk6.bit0 == 1) + || ((var_v1->unk6.bit0 == 0) && (var_v1->unk10_6 == 1)) + ) + && (var_v1->unk6.bit6 == 6) + && (arg2 == var_v1->unk8) + ) { + *arg1 = var_v1->unk6.bit15; + return TRUE; + } + var_v1++; + } + } + return FALSE; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E2D4.s") +NodeProp *func_8032E230(Cube *cube, s32 arg1) { + NodeProp *i_ptr; + + if (cube != NULL && cube->prop1Cnt != 0){ + for(i_ptr = cube->prop1Ptr; i_ptr < cube->prop1Ptr + cube->prop1Cnt; i_ptr++){ + if( ( (i_ptr->unk6.bit0 == 1) + || ( (i_ptr->unk6.bit0 == 0) && (i_ptr->unk10_6 == 1)) + ) + && (i_ptr->unk6.bit6 == 6) + && (arg1 == i_ptr->unk8) + ) { + return i_ptr; + } + } + } + return NULL; +} + +bool func_8032E2D4(Cube *arg0, s32 arg1[3], s32 arg2) { + NodeProp * temp_a2; + NodeProp *var_v1; + + if ((arg0 != NULL) && (arg0->prop1Cnt != 0)) { + var_v1 = arg0->prop1Ptr; + temp_a2 = arg0->prop1Ptr + arg0->prop1Cnt; + while (var_v1 < temp_a2) { + if( ((var_v1->unk6.bit0 == 1) + || ((var_v1->unk6.bit0 == 0) && (var_v1->unk10_6 == 1)) + ) + && (var_v1->unk6.bit6 == 6) + && (arg2 == var_v1->unk8) + ) { + arg1[0] = var_v1->x; + arg1[1] = var_v1->y; + arg1[2] = var_v1->z; + return TRUE; + } + var_v1++; + } + } + return FALSE; +} + +bool func_8032E398(Cube *cube, bool (*arg1)(NodeProp *), bool (*arg2)(Prop *)) { + NodeProp *var_s0; + Prop *var_s0_2; + NodeProp *var_s1; + Prop *var_s1_2; + + if ((cube->prop1Cnt != 0) && (arg1 != NULL)) { + var_s0 = cube->prop1Ptr; + var_s1 = cube->prop1Ptr + cube->prop1Cnt; + while (var_s0 < var_s1) { + if (!arg1(var_s0)) { + return FALSE; + } + var_s0++; + } + } + if ((cube->prop2Cnt != 0) && (arg2 != NULL)) { + var_s0_2 = cube->prop2Ptr; + var_s1_2 = cube->prop2Ptr + cube->prop2Cnt; + while(var_s0_2 < var_s1_2) { + if (!arg2(var_s0_2)) { + return FALSE; + } + var_s0_2++; + } + } + return TRUE; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E398.s") #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032E49C.s") @@ -737,7 +903,9 @@ void marker_free(ActorMarker *this){ func_80332B2C(this); } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032F464.s") +void func_8032F464(bool arg0){ + D_8036E7B0 = arg0; +} void func_8032F470(s32 *pos, ActorMarker *arg1){ Cube *cubePtr; @@ -938,33 +1106,131 @@ void marker_setCollisionScripts(ActorMarker *this, MarkerCollisionFunc ow_func, this->unk1C = die_func; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300B8.s") +void func_803300B8(ActorMarker *marker, MarkerCollisionFunc method){ + marker->unk54 = method; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300C0.s") +void func_803300C0(ActorMarker *marker, bool (*method)(ActorMarker *, ActorMarker *)){ + marker->unk58 = method; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300C8.s") +void func_803300C8(ActorMarker *marker, ActorUpdateFunc method){ + marker->unk24 = method; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300D0.s") +void func_803300D0(ActorMarker *marker, s32 arg1){ + marker->unk34 = arg1; +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300D8.s") +void func_803300D8(ActorMarker *marker, ActorFreeFunc method){ + marker->unk30 = method; +} -#define AssetCacheSize 0x3D5 - -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803300E0.s") +void func_803300E0(ActorMarker *marker, Struct6Cs *arg1){ + marker->unk18 = arg1; +} void marker_setModelId(ActorMarker *this, enum asset_e modelIndex){ this->modelId = modelIndex; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330104.s") +void func_80330104(Cube *cube) { + s32 temp_a2; + u32 temp_t7; + u32 var_a1; + void **temp_v1_3; + void *temp_v1; + void *temp_v1_2; + ActorProp *var_v1; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330208.s") + if (cube->prop2Cnt != 0) { + var_v1 = (ActorProp *)cube->prop2Ptr; + var_a1 = cube->prop2Cnt; + while(var_a1 != 0){ + if(var_v1->unk8_0 == TRUE){ + var_v1->marker->propPtr = var_v1; + var_v1->marker->cubePtr = cube; + } + var_a1--; + var_v1++; + } + } +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803303B8.s") +void func_80330208(Cube *cube) { + s32 position[3]; + Actor *actor; + NodeProp *end_prop; + NodeProp *i_prop; -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330534.s") + if ((cube != NULL) && (cube->prop1Cnt != 0)) { + i_prop = cube->prop1Ptr; + end_prop = cube->prop1Ptr + cube->prop1Cnt; + func_80326C24(1); + while(i_prop < end_prop){ + if (i_prop->unk6.bit6 == 6) { + position[0] = (s32) i_prop->x; + position[1] = (s32) i_prop->y; + position[2] = (s32) i_prop->z; + actor = func_803055E0(i_prop->unk8, position, i_prop->unkC_31, i_prop->unk10_31, i_prop->unk10_19); + if (actor != NULL) { + actor->unk78_13 = i_prop->unk10_31; + actor->unkF4_8 = i_prop->unk6.bit15; + func_8032AA58(actor, (i_prop->unkC_22 != 0) ? ((f32)i_prop->unkC_22 * 0.01) : 1.0); + } + } + i_prop++; + } + func_80326C24(0); + } +} -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8033056C.s") +void func_803303B8(Cube *cube) { + s32 sp4C[3]; + NodeProp *temp_s2; + NodeProp *var_s0; + + if ((cube != NULL) && (cube->prop1Cnt != 0)){ + var_s0 = cube->prop1Ptr; + temp_s2 = cube->prop1Ptr + cube->prop1Cnt; + while (var_s0 < temp_s2) { + if (var_s0->unk6.bit6 == 7) { + sp4C[0] = (s32) var_s0->x; + sp4C[1] = (s32) var_s0->y; + sp4C[2] = (s32) var_s0->z; + func_803065E4(var_s0->unk8, sp4C, var_s0->unk6.bit15, var_s0->unk10_31, var_s0->unk10_7); + } else if (var_s0->unk6.bit6 == 9) { + sp4C[0] = (s32) var_s0->x; + sp4C[1] = (s32) var_s0->y; + sp4C[2] = (s32) var_s0->z; + func_8030688C(var_s0->unk8, sp4C, var_s0->unk6.bit15, var_s0->unk10_0); + } else if (var_s0->unk6.bit6 == 0xA) { + sp4C[0] = (s32) var_s0->x; + sp4C[1] = (s32) var_s0->y; + sp4C[2] = (s32) var_s0->z; + func_80306AA8(var_s0->unk8, sp4C, var_s0->unk6.bit15); + } + var_s0++; + } + } +} + +bool func_80330534(Actor *actor){ + if(D_80383444 != 0){ + return FALSE; + } + + D_80383444 = actor->modelCacheIndex; + return TRUE; +} + +bool func_8033056C(Actor *actor){ + if((D_80383444 == 0) || (D_80383444 != actor->modelCacheIndex)){ + return FALSE; + } + D_80383444 = 0; + return TRUE; +} //modelCache_Init void func_803305AC(void){ @@ -980,7 +1246,6 @@ void func_803305AC(void){ D_80383444 = 0; } - extern s32 D_8036E7CC; #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803306C8.s") @@ -1152,7 +1417,7 @@ s32 func_80330F74(NodeProp *arg0){ } s32 func_80330F7C(NodeProp *arg0){ - return arg0->unk6_6; + return arg0->unk6.bit6; } s32 func_80330F8C(NodeProp *arg0){ @@ -1163,7 +1428,7 @@ s32 func_80330F94(NodeProp *arg0, s32 arg1[3]){ arg1[0] = arg0->x; arg1[1] = arg0->y; arg1[2] = arg0->z; - return arg0->unk6_15; + return arg0->unk6.bit15; } #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330FBC.s") @@ -1217,7 +1482,7 @@ bool func_80331158(ActorMarker *arg0, s32 arg1, s32 arg2) { actor = marker_getActor(arg0); if ((actor->unk3C & 0x400) && ((s32)actor->unk3C << 4) >= 0){ - return func_802E74A0(actor->position, actor->unk178 * D_80378EB0, arg1, arg2) == 0; + return func_802E74A0(actor->position, actor->unk178 * 1.1, arg1, arg2) == 0; } return FALSE; } @@ -1266,18 +1531,18 @@ s32 func_803311D4(Cube *arg0, f32 *arg1, f32 *arg2, f32 *arg3, u32 arg4) { var_s6 = 0; var_s1 = arg0->prop2Ptr; for(var_s5 = arg0->prop2Cnt; var_s5 > 0; var_s5--) { - if (!var_s1->markerFlag && var_s1->unk8_1 && var_s1->unk8_4) { //propProp - var_s0 = func_8030A4B4(var_s1->propProp.unk0_31); - if ((var_s0 != NULL) || (func_8028F280() && ((var_s0 = func_8030A428(var_s1->propProp.unk0_31)) != NULL))) { + if (!var_s1->markerFlag && var_s1->unk8_1 && var_s1->unk8_4) { //ModelProp + var_s0 = func_8030A4B4(var_s1->modelProp.unk0_31); + if ((var_s0 != NULL) || (func_8028F280() && ((var_s0 = func_8030A428(var_s1->modelProp.unk0_31)) != NULL))) { temp_s2 = func_8033A084(var_s0); if (temp_s2 != 0) { - spAC[0] = (f32) var_s1->propProp.unk4[0]; - spAC[1] = (f32) var_s1->propProp.unk4[1]; - spAC[2] = (f32) var_s1->propProp.unk4[2]; + spAC[0] = (f32) var_s1->modelProp.unk4[0]; + spAC[1] = (f32) var_s1->modelProp.unk4[1]; + spAC[2] = (f32) var_s1->modelProp.unk4[2]; spA0[0] = 0.0f; - spA0[1] = (f32) (var_s1->propProp.unk0_15 * 2); - spA0[2] = (f32) (var_s1->propProp.unk0_7 * 2); - var_v0 = func_802E805C(temp_s2, func_8033A148(var_s0), spAC, spA0, var_s1->propProp.unkA / 100.0, arg1, arg2, arg3, arg4); + spA0[1] = (f32) (var_s1->modelProp.unk0_15 * 2); + spA0[2] = (f32) (var_s1->modelProp.unk0_7 * 2); + var_v0 = func_802E805C(temp_s2, func_8033A148(var_s0), spAC, spA0, var_s1->modelProp.unkA / 100.0, arg1, arg2, arg3, arg4); if (var_v0 != 0) { var_s6 = var_v0; } @@ -1335,7 +1600,83 @@ s32 func_803311D4(Cube *arg0, f32 *arg1, f32 *arg2, f32 *arg3, u32 arg4) { } #endif +#ifndef NONMATCHING #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80331638.s") +#else +s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s32 arg5, u32 flags) { + s32 spD8; + Actor *temp_v0_6; + BKModelBin *temp_v0_2; + BKVertexList *temp_a1; + BKCollisionList *temp_v0_3; + u32 var_s3; + f32 spBC[3]; + f32 spB0[3]; + f32 sp98[3]; + f32 sp8C[3]; + s32 var_v0; + ActorMarker *temp_a0; + Struct6Cs *temp_v0_7; + Prop *var_s0; + + spD8 = 0; + var_s3 = cube->prop2Cnt; + var_s0 = cube->prop2Ptr; + while(var_s3 != 0) { + if (!var_s0->markerFlag && var_s0->unk8_1 && var_s0->unk8_4) { + temp_v0_2 = func_8030A4B4((u32)(*(u16 *)(&var_s0->modelProp)) >> 4); + if (temp_v0_2 != NULL) { + temp_v0_3 = func_8033A084(temp_v0_2); + if (temp_v0_3 != NULL) { + spBC[0] = (f32) var_s0->modelProp.unk4[0]; + spBC[1] = (f32) var_s0->modelProp.unk4[1]; + spBC[2] = (f32) var_s0->modelProp.unk4[2]; + spB0[0] = 0.0f; + spB0[1] = (f32) (var_s0->modelProp.unk0_15 * 2); + spB0[2] = (f32) (var_s0->modelProp.unk0_7 * 2); + var_v0 = func_802E9118(temp_v0_3, func_8033A148(temp_v0_2), spBC, spB0, (f32) ((f32) var_s0->modelProp.unkA / 100.0), arg1, arg2, arg3, arg4, arg5, flags); + if (var_v0 != 0) { + spD8 = var_v0; + } + } + } + } else if (var_s0->markerFlag && var_s0->unk8_3 && var_s0->unk8_4) { + temp_v0_2 = func_80330DE4(var_s0->actorProp.marker); + if (temp_v0_2 != NULL) { + temp_v0_3 = func_8033A084(temp_v0_2); + if (temp_v0_3 != NULL) { + temp_v0_6 = marker_getActor(var_s0->actorProp.marker); + temp_a1 = func_80330C74(temp_v0_6); + sp98[0] = (f32) var_s0->actorProp.x; + sp98[1] = (f32) var_s0->actorProp.y; + sp98[2] = (f32) var_s0->actorProp.z; + sp8C[0] = (f32)var_s0->actorProp.marker->pitch; + sp8C[1] = (f32)var_s0->actorProp.marker->yaw; + sp8C[2] = (f32)var_s0->actorProp.marker->roll; + var_v0 = func_802E9118(temp_v0_3, temp_a1, sp98, sp8C, temp_v0_6->scale, arg1, arg2, arg3, arg4, arg5, flags); + if (var_v0 != 0) { + spD8 = var_v0; + } + } + } + } else if (var_s0->markerFlag) { + temp_a0 = var_s0->actorProp.marker; + temp_v0_7 = temp_a0->unk18; + if (temp_v0_7 != NULL) { + if (temp_v0_7->unk4 != NULL) { + var_v0 = temp_v0_7->unk4(temp_a0, arg1, arg2, arg3, arg4, arg5, flags); + if (var_v0 != 0) { + spD8 = var_v0; + } + } + } + } + var_s0++; + var_s3--; + } + return spD8; +} +#endif #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803319C0.s") @@ -1376,7 +1717,7 @@ f32 func_80331E64(ActorMarker *marker) { f32 func_80331F1C(Prop *arg0){ - return func_802EC920(func_8033A148(func_8030A428(arg0->propProp.unk0_31))); + return func_802EC920(func_8033A148(func_8030A428(arg0->modelProp.unk0_31))); } f32 func_80331F54(ActorMarker *marker) { @@ -1502,8 +1843,8 @@ Prop *func_803322F0(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *ar } } } - else if (phi_s1->unk8_1) {//PropProp - if (func_803327A8(phi_s1->propProp.unk0_31 + 0x2D1) & arg3) { + else if (phi_s1->unk8_1) {//ModelProp + if (func_803327A8(phi_s1->modelProp.unk0_31 + 0x2D1) & arg3) { phi_f24 = func_80332050(phi_s1, marker, 0); phi_f20 = func_80332050(phi_s1, marker, 1) + func_80332220(phi_s1, &func_80331F1C); phi_f22 = func_80332050(phi_s1, marker, 2); diff --git a/src/core2/code_B3A80.c b/src/core2/code_B3A80.c index 0e0a843b..d2af33a8 100644 --- a/src/core2/code_B3A80.c +++ b/src/core2/code_B3A80.c @@ -202,20 +202,20 @@ void func_8033B2A4(s32 arg0) { #ifndef NONMATCHING #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033B338.s") #else -bool func_8033B338(BKSprite **sprite_ptr, BKSpriteDisplayData **arg1) { +bool func_8033B338(void **sprite_ptr, BKSpriteDisplayData **arg1) { if (*sprite_ptr == NULL) { return FALSE; } assetcache_release(*sprite_ptr); *sprite_ptr = NULL; *arg1 = NULL; + + if(sprite_ptr); + return TRUE; } #endif -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033B388.s") -#else bool func_8033B388(BKSprite **sprite_ptr, BKSpriteDisplayData **arg1){ if(*sprite_ptr == NULL) return FALSE; @@ -223,9 +223,11 @@ bool func_8033B388(BKSprite **sprite_ptr, BKSpriteDisplayData **arg1){ func_8033B020(*sprite_ptr); *sprite_ptr = NULL; *arg1 = NULL; + + if(sprite_ptr); + return TRUE; } -#endif s32 assetcache_release(void * arg0){ s32 i; diff --git a/src/core2/code_B5E00.c b/src/core2/code_B5E00.c index b7a6e974..24afd639 100644 --- a/src/core2/code_B5E00.c +++ b/src/core2/code_B5E00.c @@ -40,12 +40,12 @@ void func_8033CE40(void) { s32 var_s0_2; s32 i; - sp48[3] = 0; - D_80383F04 = -1; - for(i = 0; i < 3; i++){ + for(i = 0; i < 4; i++){ D_80383F00[i] = -1; sp48[i] = 0; } + // sp48[3] = 0; + // D_80383F00[3] = -1; for(var_s0 = 0; var_s0 < 4; var_s0++){ if( (func_8033CD90(var_s0) == 0) && (D_80383F00[D_80383D20[var_s0].unk1 - 1] == -1)) { diff --git a/src/core2/code_B62B0.c b/src/core2/code_B62B0.c index 3d5d98f0..d81a60d5 100644 --- a/src/core2/code_B62B0.c +++ b/src/core2/code_B62B0.c @@ -4,8 +4,8 @@ typedef struct{ u16 unk0; - u16 unk2; - u16 unk4[11]; + u16 unk2; //Struct5Cs + u16 unk4[11]; //Struct5Cs } Struct_core2_B62B0_0; typedef struct{ @@ -14,8 +14,212 @@ typedef struct{ } Struct_core2_B62B0_1; /* .data */ -extern Struct_core2_B62B0_0 D_80370AC0[]; -extern Struct_core2_B62B0_1 D_80371DC0[]; +Struct_core2_B62B0_0 D_80370AC0[0xBB] = { + {0x12A, 0x0000, {0x0904, 0x8504, 0x8504, 0x0000, 0x8504, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7484}}, + {0x129, 0x0000, {0x0504, 0x0984, 0x8504, 0x0000, 0x8504, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7484}}, + {0x128, 0x0000, {0x0000, 0x0000, 0x8404, 0x0984, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7404}}, + {0x135, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x1E6, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0000, 0x0984, 0x0A04, 0x0000, 0x1020}}, + {0x1E7, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0000, 0x0984, 0x0A04, 0x0000, 0x1020}}, + {0x1E8, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0000, 0x0984, 0x0A04, 0x0000, 0x1020}}, + {0x1EA, 0x0001, {0x0A08, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0984, 0x0A04, 0x0984, 0x2020}}, + {0x295, 0x0001, {0x0A0C, 0x8988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x2020}}, + {0x1F1, 0x0001, {0x0A10, 0x898C, 0x8100, 0x8988, 0x8A08, 0x8A08, 0x0A84, 0x098C, 0x0A04, 0x0000, 0x2020}}, + {0x1E0, 0x0000, {0x7000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0004, 0x8000, 0x0000, 0x7000}}, + {0x005, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0984, 0x0A04, 0x0000, 0x1020}}, + {0x004, 0x0001, {0x0A88, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x1020}}, + {0x003, 0x0000, {0x0914, 0x990C, 0x2020, 0x8908, 0x8908, 0x8908, 0x0A04, 0x0914, 0x0904, 0x0000, 0x4020}}, + {0x29E, 0x0000, {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0xA000, 0x0004, 0x8000, 0x0000, 0x8000}}, + {MARKER_7_CONGA, 0x0000, {0x0000, 0x0000, 0x3020, 0x9000, 0x0000, 0x0000, 0x0000, 0x0804, 0x9000, 0x0000, 0x3020}}, + {0x013, 0x0002, {0x0504, 0x7584, 0x8100, 0x7584, 0x7604, 0x0A04, 0x0A84, 0x0504, 0x0A04, 0x0000, 0x1020}}, + {0x16B, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0904, 0x0A04, 0x0000, 0x1020}}, + {0x0DD, 0x0002, {0x060C, 0x7588, 0x8100, 0x7588, 0x7608, 0x8604, 0x0A84, 0x050C, 0x0A04, 0x0000, 0x1020}}, + {0x0DE, 0x0001, {0x0908, 0x0988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x090C, 0x0A04, 0x0000, 0x1020}}, + {0x015, 0x0001, {0x0A88, 0x7988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x1424}}, + {0x065, 0x0804, {0x5040, 0x5040, 0x5040, 0x5040, 0x5040, 0x5040, 0x5040, 0x090E, 0x0804, 0x0000, 0x5844}}, + {0x014, 0x0003, {0x3020, 0x3020, 0x3020, 0x9080, 0x9080, 0x9080, 0x0A84, 0x0914, 0x0904, 0x0000, 0x3020}}, + {MARKER_A5_NIPPER, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x5020}}, + {0x16C, 0x0000, {0x0000, 0x0000, 0x0000, 0xB804, 0x0000, 0x0000, 0x0000, 0x0404, 0xB804, 0x0000, 0x5020}}, + {0x0A4, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2020}}, + {0x00F6, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2020}}, + {0x00F7, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2020}}, + {0x0029, 0x0001, {0x0804, 0x0804, 0x2020, 0x0804, 0x0804, 0x0804, 0x0804, 0x0808, 0x0804, 0x0000, 0x3444}}, + {0x01CF, 0x0001, {0x0804, 0x0804, 0x1020, 0x0804, 0x0804, 0x0804, 0x0804, 0x0808, 0x0804, 0x0000, 0x1424}}, + {0x01A6, 0x0000, {0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x0000, 0x0000, 0x3020, 0x3020}}, + {0x01A7, 0x0804, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3020}}, + {0x0069, 0x0001, {0x2020, 0x2020, 0x2020, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x2020}}, + {0x0173, 0x0001, {0x2020, 0x2020, 0x2020, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x4020}}, + {0x00C1, 0x0000, {0x0A09, 0x0985, 0x8100, 0x0985, 0x0A05, 0x0A05, 0x0000, 0x0989, 0x0A05, 0x0986, 0x2020}}, + {0x00C5, 0x0000, {0x0A0D, 0x8989, 0x8100, 0x8989, 0x7A09, 0x7A09, 0x0000, 0x098D, 0x0A05, 0x0986, 0x2020}}, + {0x00C2, 0x0000, {0x0805, 0x0805, 0x8000, 0x0805, 0x0805, 0x0805, 0x0000, 0x0805, 0x0805, 0x0806, 0x3020}}, + {0x00B1, 0x0000, {0x7000, 0x8000, 0x8000, 0x8000, 0x9000, 0x9000, 0x9000, 0x0004, 0x8000, 0x0000, 0x7000}}, + {0x0287, 0x0001, {0x7000, 0x8000, 0x8000, 0x8000, 0x9000, 0x9000, 0x8804, 0x0004, 0x8000, 0x0000, 0x7000}}, + {MARKER_205_TWINKLY_MUNCHER, 0x0000, {0x0000, 0x0000, 0x0000, 0x0404, 0x0404, 0x0404, 0x0000, 0x0408, 0x0404, 0x0000, 0x0000}}, + {0x0245, 0x0000, {0x3004, 0x3004, 0x3004, 0x3004, 0x3004, 0x2004, 0x3004, 0x0000, 0x0000, 0x3004, 0x3004}}, + {0x0250, 0x0000, {0x0A90, 0x8988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0910, 0x0A04, 0x0984, 0x3104}}, + {0x025F, 0x0001, {0x0A88, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0908, 0x0A04, 0x0984, 0x3104}}, + {0x00AD, 0x0001, {0x0A10, 0x998C, 0x0020, 0x9988, 0x8A08, 0x0A04, 0x0A84, 0x0914, 0x0A04, 0x0000, 0x5124}}, + {0x0253, 0x0001, {0x0904, 0x0984, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0984, 0x0A04, 0x0000, 0x3020}}, + {0x0219, 0x0001, {0x0588, 0x7584, 0x8100, 0x7584, 0x7604, 0x7604, 0x0684, 0x0588, 0x0A04, 0x0000, 0x2020}}, + {0x0298, 0x0000, {0x7000, 0x8000, 0x7000, 0x8000, 0x9000, 0x9000, 0xB000, 0x0004, 0x0A04, 0x0000, 0x2020}}, + {0x0218, 0x0001, {0x0588, 0x7584, 0x8100, 0x7584, 0x7604, 0x7604, 0x0684, 0x050C, 0x0A04, 0x0000, 0x2020}}, + {0x0099, 0x0001, {0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x0000, 0x0000, 0x0804, 0x0000, 0x2424}}, + {0x0296, 0x0000, {0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x0000, 0x0000, 0x0804, 0x0000, 0x2424}}, + {0x0096, 0x0001, {0x0A10, 0x890C, 0x8100, 0x8908, 0x8988, 0x8988, 0x0A84, 0x0914, 0x0984, 0x0000, 0x3024}}, + {0x0297, 0x0001, {0x0A10, 0x890C, 0x8100, 0x8908, 0x8988, 0x8988, 0x0A84, 0x0914, 0x0984, 0x0000, 0x3024}}, + {0x0127, 0x0001, {0x0804, 0x0804, 0x8100, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0000, 0x1424}}, + {MARKER_254_PORTRAIT_CHOMPA, 0x0001, {0x0804, 0x0804, 0x2020, 0x0804, 0x0804, 0x0804, 0x0804, 0x080C, 0x0804, 0x0000, 0x3444}}, + {0x01D1, 0x0001, {0x0804, 0x0804, 0x1020, 0x0804, 0x0804, 0x0804, 0x0804, 0x080C, 0x0804, 0x0000, 0x1424}}, + {0x021A, 0x0001, {0x0A08, 0x8988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0000, 0x0988, 0x0A04, 0x0000, 0x2020}}, + {0x00C9, 0x0001, {0x0808, 0x8808, 0x8000, 0x0804, 0x0804, 0x0804, 0x0000, 0x0808, 0x0804, 0x0000, 0x3424}}, + {0x01B7, 0x0000, {0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0000, 0x098C, 0x0404, 0x0804, 0x5000}}, + {0x002E, 0x0004, {0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x0000, 0x0000, 0x8000, 0x3000, 0x3004}}, + {0x01A1, 0x0000, {0x8020, 0x8884, 0x8020, 0x8884, 0x9884, 0x9884, 0x0804, 0x0904, 0x0884, 0x0000, 0x4020}}, + {0x01A2, 0x0000, {0x8020, 0x8904, 0x8020, 0x8904, 0x9904, 0x9904, 0x0804, 0x0984, 0x0904, 0x0000, 0x4020}}, + {0x01A3, 0x0000, {0x9020, 0x9984, 0x9020, 0x9984, 0x9984, 0x9984, 0x0804, 0x0A04, 0x0984, 0x0000, 0x3020}}, + {0x01A4, 0x0000, {0x9020, 0x9A04, 0x9020, 0x9A04, 0x9A04, 0x9A04, 0x0804, 0x0A84, 0x0A04, 0x0000, 0x3020}}, + {0x0185, 0x5060, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5060}}, + {0x0191, 0x0000, {0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, 0x8000, 0x0000, 0x2000}}, + {0x0192, 0x0000, {0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, 0x8000, 0x0000, 0x2000}}, + {0x0193, 0x0000, {0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, 0x8000, 0x0000, 0x2000}}, + {0x01E2, 0x0001, {0x0A08, 0x8988, 0x8100, 0x0984, 0x0A04, 0x0A04, 0x0A84, 0x0988, 0x0A04, 0x0000, 0x2020}}, + {0x01C5, 0x0001, {0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x3020, 0x080C, 0x0804, 0x0000, 0x3020}}, + {0x01F9, 0x0000, {0x2040, 0x2040, 0x2040, 0x2040, 0x2040, 0x2040, 0x2040, 0x0000, 0x0000, 0x0000, 0x2040}}, + {0x01B2, 0x0001, {0x0804, 0x0804, 0x2020, 0x0804, 0x0804, 0x0804, 0x0804, 0x0810, 0x0804, 0x0000, 0x3444}}, + {0x01D0, 0x0001, {0x0804, 0x0804, 0x1020, 0x0804, 0x0804, 0x0804, 0x0804, 0x0810, 0x0804, 0x0000, 0x1424}}, + {0x01B4, 0x8000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000}}, + {0x000E, 0x0001, {0x3000, 0x7504, 0x7080, 0x7504, 0x7584, 0x0804, 0x0804, 0x0488, 0x0804, 0x0000, 0x1020}}, + {0x01AC, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0256, 0x0000, {0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x2020, 0x0000, 0x0000, 0x2020, 0x2020}}, + {MARKER_C_ORANGE_PROJECTILE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2424}}, + {MARKER_DB_BURIED_TREASURE, 0x0000, {0x7000, 0x7000, 0x7000, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0000, 0x7000}}, + {0x0028, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x2020}}, + {0x004A, 0x0404, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404}}, + {0x006E, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x00D7, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x00D9, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x00D6, 0x0000, {0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x00D8, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x006D, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x019B, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x019C, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x019D, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x019E, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x019F, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x01A0, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {MARKER_B9_FP_SNOWMAN_BUTTON,0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000}}, + {MARKER_124_BOGGY_1, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0097, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000}}, + {0x0125, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404}}, + {0x0126, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404}}, + {MARKER_1FD_BLUE_PRESENT_COLLECTABLE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {MARKER_1FE_GREEN_PRESENT_COLLECTABLE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {MARKER_1FF_RED_PRESENT_COLLECTABLE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {MARKER_20B_WOZZA, 0x7000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x7000}}, + {MARKER_20F_WOZZA_IN_CAVE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000}}, + {0x0204, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0207, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0404}}, + {0x0206, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000}}, + {MARKER_BC_GOBI_1, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {0x00BE, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0804, 0x080C, 0x0804, 0x0000, 0x0000}}, + {MARKER_BF_GOBI_2, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {MARKER_C3_GOBI_3, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004}}, + {MARKER_252_LOGGO, 0x0000, {0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0004, 0x0004, 0x0004}}, + {MARKER_48_NAPPER, 0x0004, {0x7000, 0x8000, 0x8000, 0x8000, 0x9000, 0x9000, 0xB000, 0x0000, 0x8000, 0x0000, 0x8004}}, + {0x0132, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0130, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x012E, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x012C, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x01BF, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x7404, 0x7404, 0x0000, 0x0414, 0x7404, 0x0000, 0x0000}}, + {0x01B3, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x01B0, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0814, 0x0000, 0x0000, 0x0000}}, + {MARKER_1AE_ZUBBA, 0x0000, {0x3004, 0x3004, 0x3004, 0x0804, 0x0804, 0x0804, 0x0804, 0x080C, 0x0804, 0x0000, 0x3004}}, + {0x0050, 0x0003, {0x0804, 0x0804, 0x0000, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0804, 0x0000}}, + {0x009A, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x009E, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0804, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x009D, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x00E7, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x009C, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {MARKER_EA_LIGHTHOUSE_DOOR, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x022D, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x022E, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0235, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0804, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0163, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0239, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0804, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0236, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0804, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0237, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0804, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0238, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0804, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0263, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x017D, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x009F, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x00A0, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x00FF, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x0107, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x0108, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0109, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x080C, 0x0804, 0x0000, 0x0000}}, + {0x0118, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x0119, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x011A, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x0000, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x011E, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x8804, 0x8804, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x011F, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x7804, 0x7804, 0x0000, 0x0808, 0x0804, 0x0000, 0x0000}}, + {0x0121, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x8804, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0123, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x01F2, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x01F3, 0x0000, {0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0804, 0x0804, 0x0000, 0x0000}}, + {0x0224, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0xA000, 0x080C, 0x0000, 0x0000, 0x0000}}, + {0x0225, 0x0000, {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0xA000, 0x080C, 0x8000, 0x0000, 0x0000}}, + {0x00A2, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x8804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x01A9, 0x0000, {0x0000, 0x0000, 0x0000, 0x7804, 0x0000, 0x0804, 0x0000, 0x080C, 0x0000, 0x0000, 0x0000}}, + {0x0195, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0196, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0197, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x002F, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0194, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0186, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0183, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0184, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0164, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x0165, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}}, + {0x00E4, 0x0000, {0x8004, 0x8004, 0x8004, 0x8404, 0x8404, 0x8004, 0x8004, 0x0000, 0x8004, 0x8004, 0x8004}}, + {0x00E5, 0x0000, {0x8004, 0x8004, 0x8004, 0x8404, 0x8404, 0x8004, 0x8004, 0x0000, 0x8004, 0x8004, 0x8004}}, + {0x00E6, 0x0000, {0x8004, 0x8004, 0x8004, 0x8404, 0x8404, 0x8004, 0x8004, 0x0000, 0x8004, 0x8004, 0x8004}}, + {0x00B2, 0x0001, {0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x0000, 0x0000, 0x0000, 0x2020}}, + {0x01A5, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001}}, + {0x01A6, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3020}}, + {0x016D, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8004}}, + {0x016E, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8004}}, + {0x016F, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8004}}, + {0x0170, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7004}}, + {0x0171, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7004}}, + {0x0172, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7004}}, + {0x025C, 0x0000, {0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x0000, 0x0804, 0x3804, 0x3804}}, + {0x025D, 0x0000, {0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x3804, 0x0000, 0x0804, 0x3804, 0x3804}}, + {0x027A, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000}}, + {0x027F, 0x0000, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0000, 0x0000, 0x0000}}, + {0x025E, 0x0000, {0x4000, 0x4000, 0x4000, 0xA604, 0x4000, 0x4000, 0x4000, 0x0584, 0xA000, 0x0000, 0x4000}}, + {0x0260, 0x0000, {0x5000, 0x5000, 0x5000, 0x5000, 0x5000, 0x5000, 0x5000, 0x0000, 0xA000, 0x0000, 0x5000}}, + {0x0281, 0x0000, {0x4080, 0x4080, 0x4080, 0xA604, 0x4080, 0x4080, 0x4080, 0x0584, 0xA200, 0x0000, 0x4080}}, + {0x0282, 0x0000, {0x4080, 0x4080, 0x4080, 0x4080, 0x4080, 0xA604, 0xA604, 0x0000, 0xA200, 0x0000, 0x4080}}, + {0x0283, 0x0000, {0x4080, 0x4080, 0x4080, 0x4080, 0x4080, 0x4080, 0x4080, 0x0000, 0xA200, 0x0000, 0x4080}}, + {0x0284, 0x0000, {0x5404, 0x5404, 0x5404, 0x5404, 0x5404, 0x5404, 0x5404, 0x0000, 0xB404, 0x5404, 0x5404}}, +}; + +s32 func_8033D240(ActorMarker *arg0, ActorMarker *arg1); +s32 func_8033D2A8(ActorMarker *arg0, ActorMarker *arg1); + +Struct_core2_B62B0_1 D_80371DC0[11] = { + {func_8033D2A8, HITBOX_4_CLAW}, + {func_8033D2A8, HITBOX_7_ROLL}, + {func_8033D2A8, HITBOX_A_FAST_FALLING}, + {func_8033D2A8, HITBOX_5_PECK}, + {func_8033D2A8, HITBOX_2_BEAK_BARGE}, + {func_8033D2A8, HITBOX_1_BEAK_BUSTER}, + {func_8033D2A8, HITBOX_3_BEAK_BOMB}, + {func_8033D240, 1}, + {func_8033D2A8, HITBOX_6_WONDERWING}, + {func_8033D2A8, HITBOX_9_CROC_BITE}, + {func_8033D240, 0} +}; /* .bss */ s16 D_80383F10[0x2A9]; @@ -61,31 +265,25 @@ void func_8033D2F4(void) { } } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B62B0/func_8033D410.s") -#else bool func_8033D410(ActorMarker *arg0, ActorMarker *arg1) { + s32 var_s2; s32 sp38; s16 temp_t0; s32 temp_s0; - s32 var_s2; - s16 *var_s0; sp38 = D_80383F10[arg1->unk14_20]; if (sp38 == -1) { return FALSE; } - var_s0 = D_80370AC0[sp38].unk4; for(var_s2 = 0; var_s2 < 11; var_s2++){ - if ((var_s0[var_s2] != 0) && (D_80371DC0[var_s2].unk0(arg0, arg1) == D_80371DC0[var_s2].unk4)) { - func_80330078(arg1, arg0, &D_80370AC0[sp38].unk4[var_s2]); - func_80330078(arg0, arg1, &D_80370AC0[sp38].unk4[var_s2]); + if ((D_80370AC0[sp38].unk4[var_s2] != 0) && (D_80371DC0[var_s2].unk0(arg0, arg1) == D_80371DC0[var_s2].unk4)) { + func_80330078(arg1, arg0, D_80370AC0[sp38].unk4 + var_s2); + func_80330078(arg0, arg1, D_80370AC0[sp38].unk4 + var_s2); break; } } return TRUE; } -#endif s32 func_8033D564(struct5Cs *arg0){ return arg0->unk0_15; diff --git a/src/core2/code_C9F00.c b/src/core2/code_C9F00.c index 973eb5d2..3261d1f4 100644 --- a/src/core2/code_C9F00.c +++ b/src/core2/code_C9F00.c @@ -12,27 +12,6 @@ extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32); void func_80351954(Struct68s *arg); void func_80351AD0(Struct68s *arg0, enum asset_e model_id); -typedef struct { - s16 unk0; - s16 unk2; - s16 unk4; - u32 pad6_15:9; - u32 unk6_6:6; - u32 pad6_4:1; - u16 unk8; - union{ - struct{ - u16 padA_15:10; - u16 unkA_5:1; - u16 unkA_4:1; - u16 padA_3:2; - u16 unkA_1:1; - u16 padA_0:1; - }; - u16 unkA; - }; -}Struct_Core2_C9F00_2; - typedef struct { s16 unk0; u8 unk2; @@ -178,7 +157,7 @@ Struct68s * func_8035126C(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3, enum ass } -void func_803513EC(PropProp *arg0, s32 arg1) { +void func_803513EC(ModelProp *arg0, s32 arg1) { f32 sp3C[3]; s32 pad30; f32 sp2C[3]; @@ -213,25 +192,25 @@ void func_80351538(Struct68s *arg0){ } } -bool func_803515EC(Struct_Core2_C9F00_2 *arg0) { +bool func_803515EC(NodeProp *arg0) { Struct_Core2_C9F00_1 *phi_s0; s32 sp48[3]; s32 sp44; - PropProp *sp40; + ModelProp *sp40; s16 temp_v0; s16 phi_v0; - if (arg0->unk6_6 != 6) { + if (arg0->unk6.bit6 != 6) { return 1; } else { for(phi_s0 = D_803725C0; phi_s0->unk0 != 0; phi_s0++){ if( (arg0->unk8 == phi_s0->unk0) && ((phi_s0->unk3 == 0) || (map_get() == phi_s0->unk3)) ){ - sp48[0] = (s32) arg0->unk0; - sp48[1] = (s32) arg0->unk2; - sp48[2] = (s32) arg0->unk4; + sp48[0] = (s32) arg0->x; + sp48[1] = (s32) arg0->y; + sp48[2] = (s32) arg0->z; if(func_803048E0(&sp48, &sp44, &sp40, 2, 0x1F4)){ func_803513EC(sp40, phi_s0->unk2); break; @@ -242,17 +221,19 @@ bool func_803515EC(Struct_Core2_C9F00_2 *arg0) { return TRUE; } -bool func_80351700(Struct_Core2_C9F00_2 * arg0){ - if (((arg0->unkA << 0x1E) >> 0x1F)) { +bool func_80351700(void * arg0){ + if (((*(u16*)((s32)arg0 + 0xA) << 0x1E) >> 0x1F)) { return TRUE; } return TRUE; } -bool func_80351724(Struct_Core2_C9F00_2 * arg0){ - if (((arg0->unkA << 0x1E) >> 0x1F) && ((arg0->unkA << 0x1A) >> 0x1F)) { - arg0->unkA_5 = FALSE; - arg0->unkA_4 = TRUE; +bool func_80351724(void * arg0){ + ActorProp *a_prop; + if (((*(u16*)((s32)arg0 + 0xA) << 0x1E) >> 0x1F) && ((*(u16*)((s32)arg0 + 0xA) << 0x1A) >> 0x1F)) { + a_prop = (ActorProp *)arg0; + a_prop->unk8_5 = FALSE; + a_prop->unk8_4 = TRUE; } return TRUE; } diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml index 071d0ae0..fed75631 100644 --- a/subyaml/core2.us.v10.yaml +++ b/subyaml/core2.us.v10.yaml @@ -333,7 +333,7 @@ segments: - [0xB3A80, c, code_B3A80] - [0xB5040, c, code_B5040] #DONE - [0xB5E00, c, code_B5E00] - - [0xB62B0, c, code_B62B0] + - [0xB62B0, c, code_B62B0] #DONE - [0xB6640, c, code_B6640] #DONE - [0xB66D0, c, string] #DONE - [0xB6C60, c, code_B6C60] #DONE @@ -548,6 +548,7 @@ segments: - [0xE78A0, bin, data_E78A0] - [0xE89F0, bin, data_E89F0] # .data, code_AD110] - [0xE92C0, bin, data_E92C0] + - [0xE9B30, .data, code_B62B0] - [0xEAE90, .data, code_B6CE0] - [0xEAEA0, .data, code_B6EA0] - [0xEAED0, .data, code_B7F40] @@ -752,7 +753,8 @@ segments: - [0xF04F0, .rodata, code_79C80] - [0xF0500, .rodata, code_7A760] - [0xF0520, .rodata, code_7AF80] - - [0xF0540, bin, data_F0540] + # - [0xF0540, bin, data_F0540] + - [0xF05E0, bin, data_F05E0] - [0xF14C0, .rodata, gc/transition] - [0xF1520, .rodata, code_85800] - [0xF1540, .rodata, code_87E30] @@ -767,6 +769,7 @@ segments: - [0xF1E10, .rodata, code_9C170] - [0xF1E60, .rodata, code_9E370] - [0xF1EC0, bin, data_F1EC0] + - [0xF1F10, .rodata, code_A5BC0] - [0xF1F30, .rodata, code_AD110] - [0xF1F50, .rodata, code_AE5D0] - [0xF1F60, bin, data_F1F60]