ovl_Obj_Milk_Bin OK (#161)

* First pass

* second pass

* Everything matches now

* Fix ori

* final pass

* Add description

* Fix warnings (I hope)

* move dlist to top of the file

* Fix conflicts
This commit is contained in:
Anghelo Carvajal 2021-05-25 21:15:41 -04:00 committed by GitHub
parent 6c86016603
commit 2f239c939d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 188 additions and 84 deletions

View File

@ -900,7 +900,7 @@ void func_800BCC68(Vec3f* param_1, GlobalContext* globalCtx);
void func_800BDC5C(SkelAnime* skelAnime, ActorAnimationEntry animation[], s16 index);
// void func_800BDCF4(void);
void func_800BDFB0(void);
void func_800BDFC0(GlobalContext* globalCtx, UNK_TYPE4 uParm2);
void func_800BDFC0(GlobalContext* globalCtx, Gfx* dl);
void func_800BE03C(GlobalContext* globalCtx, Gfx* dl);
// void func_800BE0B8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_800BE184(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);

View File

@ -372,7 +372,7 @@ extern DmaEntry dmadata[1568];
extern ActorInit En_A_Obj_InitVars;
extern ColliderCylinderInit enAObjCylinderInit;
extern InitChainEntry enAObjInitVar;
extern u32 enAObjDisplayLists[2];
extern Gfx* enAObjDisplayLists[2];
extern Color_RGBA8 D_801ADF10;
extern Color_RGBA8 D_801ADF14;
extern Vec3f D_801ADF18;

View File

@ -8877,9 +8877,9 @@ SECTIONS
ovl_Obj_Milk_Bin : AT(RomLocation)
{
build/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.o(.text)
build/asm/overlays/ovl_Obj_Milk_Bin_data.o(.data)
build/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.o(.data)
build/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.o(.rodata)
build/asm/overlays/ovl_Obj_Milk_Bin_rodata.o(.rodata)
build/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin_overlay.o(.ovl)
}
SegmentEnd = .;
SegmentSize = SegmentEnd - SegmentStart;

View File

@ -252,6 +252,9 @@ D_06000EC0 = 0x06000EC0;
D_06000710 = 0x06000710;
D_06000958 = 0x06000958;
/* z_obj_milk_bin */
D_060004B0 = 0x060004B0;
/* z_en_jc_mato */
D_06000390 = 0x06000390;

View File

@ -387,8 +387,8 @@ s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* sphereGroup, Ac
/**
* Fully initializes a ColliderJntSph using the values in `src`, placing the element array in elements.
*/
s32 Collider_InitAndSetJntSph(GlobalContext* globalCtx, ColliderJntSph* sphereGroup, Actor* actor, ColliderJntSphInit* src,
ColliderJntSphElement* elements) {
s32 Collider_InitAndSetJntSph(GlobalContext* globalCtx, ColliderJntSph* sphereGroup, Actor* actor,
ColliderJntSphInit* src, ColliderJntSphElement* elements) {
Collider_InitJntSph(globalCtx, sphereGroup);
Collider_SetJntSph(globalCtx, sphereGroup, actor, src, elements);
return 0;
@ -479,7 +479,8 @@ s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collide
* Sets up the ColliderCylinder using the values in src and sets it to the actor specified in src. Uses default
* OC2_TYPE_1 and COLTYPE_0.
*/
s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInitToActor* src) {
s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider,
ColliderCylinderInitToActor* src) {
Collider_SetBaseToActor(globalCtx, &collider->base, &src->base);
Collider_SetInfo(globalCtx, &collider->info, &src->info);
Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim);
@ -500,7 +501,8 @@ s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collid
/**
* Sets up the ColliderCylinder using the values in src.
*/
s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) {
s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor,
ColliderCylinderInit* src) {
Collider_SetBase(globalCtx, &collider->base, actor, &src->base);
Collider_SetInfo(globalCtx, &collider->info, &src->info);
Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim);
@ -952,7 +954,8 @@ s32 Collider_SetSphere(GlobalContext* globalCtx, ColliderSphere* collider, Actor
/**
* Fully initializes a ColliderSphere using the values in src.
*/
s32 Collider_InitAndSetSphere(GlobalContext* globalCtx, ColliderSphere* collider, Actor* actor, ColliderSphereInit* src) {
s32 Collider_InitAndSetSphere(GlobalContext* globalCtx, ColliderSphere* collider, Actor* actor,
ColliderSphereInit* src) {
Collider_InitSphere(globalCtx, collider);
Collider_SetSphere(globalCtx, collider, actor, src);
return 0;
@ -1708,8 +1711,8 @@ void CollisionCheck_AC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckCo
} else {
Math_Vec3f_Copy(&hitPos, &atPos);
}
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info,
&acPos, &hitPos);
if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) {
return;
@ -1763,7 +1766,8 @@ void CollisionCheck_AC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckConte
} else {
Math_Vec3f_Copy(&hitPos, &atPos);
}
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &ac->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &ac->info, &acPos,
&hitPos);
return;
}
}
@ -1799,8 +1803,8 @@ void CollisionCheck_AC_JntSphVsTris(GlobalContext* globalCtx, CollisionCheckCont
Math_Vec3s_ToVec3f(&atPos, &atElem->dim.worldSphere.center);
CollisionCheck_TrisAvgPoint(acElem, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info,
&acPos, &hitPos);
return;
}
}
@ -1949,7 +1953,8 @@ void CollisionCheck_AC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckConte
/**
* AC overlap check. Calculates the center of each collider element and the point of contact.
*/
void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* colAT, Collider* colAC) {
void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* colAT,
Collider* colAC) {
ColliderCylinder* at = (ColliderCylinder*)colAT;
ColliderCylinder* ac = (ColliderCylinder*)colAC;
f32 overlapSize;
@ -2027,7 +2032,8 @@ void CollisionCheck_AC_CylVsTris(GlobalContext* globalCtx, CollisionCheckContext
Math_Vec3s_ToVec3f(&atPos, &at->dim.pos);
CollisionCheck_TrisAvgPoint(acElem, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
return;
}
}
@ -2061,14 +2067,16 @@ void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext
Math_Vec3s_ToVec3f(&atPos, &at->dim.pos);
CollisionCheck_QuadAvgPoint(ac, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EDE00);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos,
&D_801EDE00);
} else if (Math3D_ColCylinderTri(&at->dim, &D_801EF638, &D_801EDE00) != 0) {
Vec3f atPos;
Vec3f acPos;
Math_Vec3s_ToVec3f(&atPos, &at->dim.pos);
CollisionCheck_QuadAvgPoint(ac, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EDE00);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos,
&D_801EDE00);
}
}
}
@ -2149,8 +2157,8 @@ void CollisionCheck_AC_TrisVsJntSph(GlobalContext* globalCtx, CollisionCheckCont
Math_Vec3s_ToVec3f(&acPos, &acElem->dim.worldSphere.center);
CollisionCheck_TrisAvgPoint(atElem, &atPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info,
&acPos, &hitPos);
if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) {
return;
@ -2223,8 +2231,8 @@ void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContex
CollisionCheck_TrisAvgPoint(atElem, &atPos);
CollisionCheck_TrisAvgPoint(acElem, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info, &acPos,
&D_801EDE20);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &acElem->info,
&acPos, &D_801EDE20);
return;
}
}
@ -2298,7 +2306,8 @@ void CollisionCheck_AC_TrisVsSphere(GlobalContext* globalCtx, CollisionCheckCont
Math_Vec3s_ToVec3f(&acPos, &ac->dim.worldSphere.center);
CollisionCheck_TrisAvgPoint(atElem, &atPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &ac->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &atElem->info, &atPos, &ac->base, &ac->info, &acPos,
&hitPos);
}
}
}
@ -2338,7 +2347,8 @@ void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckCont
}
Math_Vec3s_ToVec3f(&acPos, &acElem->dim.worldSphere.center);
CollisionCheck_QuadAvgPoint(at, &atPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) {
break;
@ -2377,7 +2387,8 @@ void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext
CollisionCheck_QuadAvgPoint(at, &atPos);
Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EDFE0);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos,
&D_801EDFE0);
return;
}
}
@ -2388,7 +2399,8 @@ void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext
CollisionCheck_QuadAvgPoint(at, &atPos);
Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EDFE0);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos,
&D_801EDFE0);
}
}
}
@ -2470,7 +2482,8 @@ void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContex
CollisionCheck_QuadAvgPoint(at, &atPos);
CollisionCheck_QuadAvgPoint(ac, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EE0D8);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos,
&D_801EE0D8);
return;
}
}
@ -2550,7 +2563,8 @@ void CollisionCheck_AC_SphereVsJntSph(GlobalContext* globalCtx, CollisionCheckCo
} else {
Math_Vec3f_Copy(&hitPos, &atPos);
}
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
}
}
}
@ -2630,7 +2644,8 @@ void CollisionCheck_AC_SphereVsTris(GlobalContext* globalCtx, CollisionCheckCont
Math_Vec3s_ToVec3f(&atPos, &at->dim.worldSphere.center);
CollisionCheck_TrisAvgPoint(acElem, &acPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, &hitPos);
CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos,
&hitPos);
return;
}
}
@ -2720,8 +2735,8 @@ void CollisionCheck_SetJntSphHitFX(GlobalContext* globalCtx, CollisionCheckConte
Vec3f hitPos;
Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos);
CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &jntSph->base, &element->info,
&hitPos);
CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &jntSph->base,
&element->info, &hitPos);
element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK;
return;
}
@ -2758,8 +2773,8 @@ void CollisionCheck_SetTrisHitFX(GlobalContext* globalCtx, CollisionCheckContext
Vec3f hitPos;
Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos);
CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &tris->base, &element->info,
&hitPos);
CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &tris->base,
&element->info, &hitPos);
element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK;
return;
}
@ -3001,7 +3016,8 @@ void CollisionCheck_SetOCvsOC(GlobalContext* globalCtx, Collider* left, Collider
/**
* OC overlap check for two JntSphs
*/
void CollisionCheck_OC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l, Collider* r) {
void CollisionCheck_OC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l,
Collider* r) {
ColliderJntSph* left = (ColliderJntSph*)l;
ColliderJntSph* right = (ColliderJntSph*)r;
ColliderJntSphElement* leftElem;
@ -3066,7 +3082,8 @@ void CollisionCheck_OC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckConte
/**
* OC overlap check for a JntSph and Sphere
*/
void CollisionCheck_OC_JntSphVsSphere(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l, Collider* r) {
void CollisionCheck_OC_JntSphVsSphere(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l,
Collider* r) {
ColliderJntSph* left = (ColliderJntSph*)l;
ColliderSphere* right = (ColliderSphere*)r;
ColliderJntSphElement* leftElem;
@ -3115,8 +3132,8 @@ void CollisionCheck_OC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext*
Math_Vec3s_ToVec3f(&leftPos, &left->dim.pos);
Math_Vec3s_ToVec3f(&rightPos, &right->dim.pos);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info, &rightPos,
overlap);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info,
&rightPos, overlap);
}
}
}
@ -3137,8 +3154,8 @@ void CollisionCheck_OC_CylVsSphere(GlobalContext* globalCtx, CollisionCheckConte
Math_Vec3s_ToVec3f(&leftPos, &left->dim.pos);
Math_Vec3s_ToVec3f(&rightPos, &right->dim.worldSphere.center);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info, &rightPos,
overlap);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info,
&rightPos, overlap);
}
}
}
@ -3146,7 +3163,8 @@ void CollisionCheck_OC_CylVsSphere(GlobalContext* globalCtx, CollisionCheckConte
/**
* OC overlap check for a Sphere and JntSph
*/
void CollisionCheck_OC_SphereVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l, Collider* r) {
void CollisionCheck_OC_SphereVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l,
Collider* r) {
CollisionCheck_OC_JntSphVsSphere(globalCtx, colCtxt, r, l);
}
@ -3160,7 +3178,8 @@ void CollisionCheck_OC_SphereVsCyl(GlobalContext* globalCtx, CollisionCheckConte
/**
* OC overlap check for two Spheres
*/
void CollisionCheck_OC_SphereVsSphere(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l, Collider* r) {
void CollisionCheck_OC_SphereVsSphere(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* l,
Collider* r) {
ColliderSphere* left = (ColliderSphere*)l;
ColliderSphere* right = (ColliderSphere*)r;
f32 overlap;
@ -3173,8 +3192,8 @@ void CollisionCheck_OC_SphereVsSphere(GlobalContext* globalCtx, CollisionCheckCo
Math_Vec3s_ToVec3f(&leftPos, &left->dim.worldSphere.center);
Math_Vec3s_ToVec3f(&rightPos, &right->dim.worldSphere.center);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info, &rightPos,
overlap);
CollisionCheck_SetOCvsOC(globalCtx, &left->base, &left->info, &leftPos, &right->base, &right->info,
&rightPos, overlap);
}
}
}
@ -3613,7 +3632,8 @@ void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f
/**
* Sets the specified ColliderTrisElement's dim using the values in src
*/
void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* init) {
void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index,
ColliderTrisElementDimInit* init) {
ColliderTrisElement* element = &collider->elements[index];
Collider_SetTrisElementDim(globalCtx, &element->dim, init);

View File

@ -17,8 +17,8 @@ void EffFootmark_Init(GlobalContext* globalCtx) {
}
}
void EffFootmark_Add(GlobalContext* globalCtx, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red,
u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay) {
void EffFootmark_Add(GlobalContext* globalCtx, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size,
u8 red, u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay) {
s32 i;
EffFootmark* footmark;
EffFootmark* destination = NULL;

View File

@ -93,8 +93,8 @@ s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s3
0xfffffff0;
osCreateMesgQueue(&roomCtxt->loadQueue, roomCtxt->loadMsg, 1);
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, globalCtx->roomAddrs[index].vromStart, size,
0, &roomCtxt->loadQueue, NULL);
DmaMgr_SendRequestImpl(&roomCtxt->dmaRequest, roomCtxt->activeRoomVram, globalCtx->roomAddrs[index].vromStart,
size, 0, &roomCtxt->loadQueue, NULL);
roomCtxt->activeMemPage ^= 1;
return 1;

View File

@ -125,8 +125,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
splashSpawnPos.y += this->dyna.actor.world.pos.y;
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
EffectSsGSplash_Spawn(globalCtx, &splashSpawnPos, NULL, NULL, 0,
((u32)Rand_Next() >> 25) + 280);
EffectSsGSplash_Spawn(globalCtx, &splashSpawnPos, NULL, NULL, 0, ((u32)Rand_Next() >> 25) + 280);
}
}
}

View File

@ -39,7 +39,7 @@ static InitChainEntry sInitChain[] = {
};
extern CollisionHeader D_06001588;
extern UNK_TYPE D_06001410;
extern Gfx D_06001410[];
void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
@ -131,5 +131,5 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06001410);
func_800BDFC0(globalCtx, D_06001410);
}

View File

@ -48,7 +48,7 @@ static InitChainEntry sInitChain[] = {
};
extern CollisionHeader D_06000F28;
extern UNK_PTR D_06000CE8;
extern Gfx D_06000CE8[];
s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globalCtx) {
return Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x7F) &&
@ -207,5 +207,5 @@ void BgIkanaShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgIkanaShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06000CE8);
func_800BDFC0(globalCtx, D_06000CE8);
}

View File

@ -25,7 +25,7 @@ static InitChainEntry sInitChain[] = {
};
extern CollisionHeader D_060014D8;
extern UNK_TYPE D_06000228;
extern Gfx D_06000228[];
void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) {
BgLbfshot* this = THIS;
@ -41,5 +41,5 @@ void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06000228);
func_800BDFC0(globalCtx, D_06000228);
}

View File

@ -29,7 +29,7 @@ static InitChainEntry sInitChain[] = {
};
extern CollisionHeader D_060019B4;
extern UNK_TYPE D_06000288;
extern Gfx D_06000288[];
void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMbarChair* this = THIS;
@ -49,5 +49,5 @@ void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06000288);
func_800BDFC0(globalCtx, D_06000288);
}

View File

@ -49,8 +49,8 @@ static ColliderCylinderInit sCylinderInit = {
{ 10, 40, 0, { 0, 0, 0 } },
};
extern UNK_TYPE4 D_06000710;
extern UNK_TYPE4 D_06000958;
extern Gfx D_06000710[];
extern Gfx D_06000958[];
void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) {
EnCha* this = THIS;
@ -117,8 +117,8 @@ void EnCha_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnCha* this = THIS;
func_800BDFC0(globalCtx, &D_06000710);
func_800BDFC0(globalCtx, D_06000710);
SysMatrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, 1);
SysMatrix_InsertXRotation_s(this->actor.home.rot.x, 1);
func_800BDFC0(globalCtx, &D_06000958);
func_800BDFC0(globalCtx, D_06000958);
}

View File

@ -169,8 +169,8 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnEncount2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnEncount2* this = THIS;
if (this->isPopped != 1) {
func_800BDFC0(globalCtx, &D_06000A00);
func_800BDFC0(globalCtx, &D_06000D78);
func_800BDFC0(globalCtx, D_06000A00);
func_800BDFC0(globalCtx, D_06000D78);
}
EnEncount2_DrawParticles(this, globalCtx);
}

View File

@ -38,7 +38,7 @@ extern const ActorInit En_Encount2_InitVars;
extern CollisionHeader D_06002420;
extern s32 D_06000A00;
extern s32 D_06000D78;
extern Gfx D_06000A00[];
extern Gfx D_06000D78[];
#endif // Z_EN_ENCOUNT2_H

View File

@ -145,7 +145,7 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, GlobalContext* globalCtx) {
this->collider.base.acFlags &= ~0x2;
return 1;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
@ -205,8 +205,8 @@ void EnPoFusen_IncrementMalonPop(EnPoFusen* this) {
}
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f,
this->actor.world.pos.z, 255, 255, 200, 2);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, 2);
Audio_PlayActorSound2(&this->actor, 0x180E); // NA_SE_IT_BOMB_EXPLOSION sfx
Actor_MarkForDeath(&this->actor);
}

View File

@ -324,5 +324,5 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
// Gfx_DrawDListOpa with a display list
func_800BDFC0(globalCtx, &D_05017EA0);
func_800BDFC0(globalCtx, D_05017EA0);
}

View File

@ -59,7 +59,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
extern UNK_TYPE D_06000EC0;
extern Gfx D_06000EC0[];
void EnWarpUzu_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWarpUzu* this = THIS;
@ -133,5 +133,5 @@ void EnWarpUzu_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnWarpUzu_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06000EC0);
func_800BDFC0(globalCtx, D_06000EC0);
}

View File

@ -57,7 +57,7 @@ void ObjEnding_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjEnding_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjEnding* this = THIS;
Gfx* dl;
UNK_TYPE4 tempunk4;
Gfx* tempunk4;
if (this->texture != NULL) {
AnimatedMat_Draw(globalCtx, this->texture);

View File

@ -26,7 +26,7 @@ const ActorInit Obj_Hana_InitVars = {
(ActorFunc)ObjHana_Draw,
};
extern UNK_TYPE D_06000500;
extern Gfx D_06000500[];
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
@ -48,5 +48,5 @@ void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06000500);
func_800BDFC0(globalCtx, D_06000500);
}

View File

@ -27,7 +27,7 @@ static InitChainEntry sInitChain[] = {
};
extern CollisionHeader D_0600805C;
extern UNK_TYPE D_06003478;
extern Gfx D_06003478[];
void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjKepnKoya* this = THIS;
@ -51,5 +51,5 @@ void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06003478);
func_800BDFC0(globalCtx, D_06003478);
}

View File

@ -1,3 +1,9 @@
/*
* File: z_obj_milk_bin.c
* Overlay: ovl_Obj_Milk_Bin
* Description: Milk jar
*/
#include "z_obj_milk_bin.h"
#define FLAGS 0x00000000
@ -9,7 +15,9 @@ void ObjMilkBin_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
// gMilkBinMilkJarDL
extern Gfx D_060004B0[];
const ActorInit Obj_Milk_Bin_InitVars = {
ACTOR_OBJ_MILK_BIN,
ACTORCAT_PROP,
@ -21,12 +29,77 @@ const ActorInit Obj_Milk_Bin_InitVars = {
(ActorFunc)ObjMilkBin_Update,
(ActorFunc)ObjMilkBin_Draw,
};
*/
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Milk_Bin_0x80C08E40/ObjMilkBin_Init.asm")
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_HARD,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_NONE | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_ON,
},
{ 12, 30, 0, { 0, 0, 0 } },
};
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Milk_Bin_0x80C08E40/ObjMilkBin_Destroy.asm")
void ObjMilkBin_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjMilkBin* this = THIS;
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Milk_Bin_0x80C08E40/ObjMilkBin_Update.asm")
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collider);
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Milk_Bin_0x80C08E40/ObjMilkBin_Draw.asm")
this->actor.shape.yOffset = 1100.0f;
this->disableDraw = 0;
this->type = thisx->params;
if ((this->type == OBJ_MILK_BIN_TYPE_2) && !(gSaveContext.weekEventReg[0x34] & 1)) {
this->disableDraw |= 1;
}
}
void ObjMilkBin_Destroy(Actor* thisx, GlobalContext* globalCtx) {
ObjMilkBin* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx2) {
ObjMilkBin* this = THIS;
GlobalContext* globalCtx = globalCtx2;
if (this->type == OBJ_MILK_BIN_TYPE_1) {
if (gSaveContext.weekEventReg[0x16] & 1) {
if (((gSaveContext.day == 2) && (gSaveContext.isNight == 1)) || (gSaveContext.day >= 3)) {
Actor_MarkForDeath(&this->actor);
return;
}
}
} else if (this->type == OBJ_MILK_BIN_TYPE_2) {
if (gSaveContext.weekEventReg[0x34] & 1) {
this->disableDraw &= ~1;
} else {
this->disableDraw |= 1;
}
}
if (!(this->disableDraw & 1)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
}
}
void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjMilkBin* this = THIS;
if (!(this->disableDraw & 1)) {
func_800BDFC0(globalCtx, D_060004B0);
}
}

View File

@ -7,9 +7,18 @@ struct ObjMilkBin;
typedef struct ObjMilkBin {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x58];
/* 0x144 */ char unk_144[0x4];
/* 0x148 */ ColliderCylinder collider;
/* 0x194 */ s32 disableDraw;
/* 0x198 */ s32 type;
} ObjMilkBin; // size = 0x19C
extern const ActorInit Obj_Milk_Bin_InitVars;
typedef enum {
/* 0 */ OBJ_MILK_BIN_TYPE_DEFAULT,
/* 1 */ OBJ_MILK_BIN_TYPE_1, // This actor will kill itself if the player has obtained the milk bottle and the current time is the night of the second day onwards.
/* 2 */ OBJ_MILK_BIN_TYPE_2 // Disables drawing and collision
} ObjMilkBinType;
#endif // Z_OBJ_MILK_BIN_H