* Obj_Bean

* Fix non-matching (thanks engineer)

* PR

* undef

* fmt

* PR

* PR

* Merge

* Merge

* PR
This commit is contained in:
Maide 2022-02-05 00:27:29 +00:00 committed by GitHub
parent e257491e19
commit 69d7a2e585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 987 additions and 181 deletions

View File

@ -1632,7 +1632,7 @@ void func_800FE658(f32 arg0);
// void func_800FE788(void);
// void func_800FE798(void);
// void func_800FE7A8(void);
// void func_800FE9B4(void);
s32 func_800FE9B4(GlobalContext* globalCtx);
// void func_800FEA50(void);
void func_800FEAB0(void);
// void func_800FEAC0(void);

View File

@ -379,7 +379,8 @@ typedef enum {
/* -1 */ EXCH_ITEM_MINUS1 = -1, // Unknown usage or function
/* 0x00 */ EXCH_ITEM_NONE,
/* 0x1E */ EXCH_ITEM_1E = 0x1E, // BOTTLE_MUSHROOM
/* 0x2A */ EXCH_ITEM_2A = 0x2A // MOON_TEAR?
/* 0x2A */ EXCH_ITEM_2A = 0x2A, // MOON_TEAR?
/* 0x2E */ EXCH_ITEM_2E = 0x2E
} ExchangeItemID;
#endif

3
spec
View File

@ -1496,8 +1496,7 @@ beginseg
name "ovl_Obj_Bean"
compress
include "build/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.o"
include "build/data/ovl_Obj_Bean/ovl_Obj_Bean.data.o"
include "build/data/ovl_Obj_Bean/ovl_Obj_Bean.reloc.o"
include "build/src/overlays/actors/ovl_Obj_Bean/ovl_Obj_Bean_reloc.o"
endseg
beginseg

View File

@ -198,7 +198,7 @@ void func_80A68B6C(EnMushi2* this) {
}
s32 func_80A68BA0(EnMushi2* this) {
return (D_80A6B994 > 3) && this->unk_34C == 0;
return (D_80A6B994 > 3) && this->unk_34C == NULL;
}
void func_80A68BC8(EnMushi2* this) {
@ -605,11 +605,11 @@ void func_80A69ADC(Actor* thisx) {
sp44 = Math3D_SignedDistanceFromPlane(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
&bean->actor.world.pos);
&bean->dyna.actor.world.pos);
sp40 = Math3D_SignedDistanceFromPlane(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
&bean->actor.world.pos);
&bean->dyna.actor.world.pos);
sp3C = Math3D_XZLength(sp44, sp40);
if (fabsf(sp3C) > 0.1f) {
@ -651,11 +651,11 @@ void func_80A69D3C(EnMushi2* this) {
sp40 = Math3D_SignedDistanceFromPlane(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
&this->unk_34C->actor.world.pos);
&this->unk_34C->dyna.actor.world.pos);
sp3C = Math3D_SignedDistanceFromPlane(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
&this->unk_34C->actor.world.pos);
&this->unk_34C->dyna.actor.world.pos);
sp38 = Math3D_XZLengthSquared(sp40, sp3C);
if (fabsf(sp38) > 0.010000001f) {
@ -840,7 +840,7 @@ void func_80A6A508(Actor* thisx) {
}
this->unk_368 = Rand_S16Offset(10, 30);
if (this->unk_34C == 0) {
if (this->unk_34C == NULL) {
func_80A69CE0(thisx);
} else {
func_80A69ADC(thisx);
@ -1118,7 +1118,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
f32 phi_f0;
s32 temp;
if ((this->unk_34C != NULL) && (this->unk_34C->actor.update == NULL)) {
if ((this->unk_34C != NULL) && (this->unk_34C->dyna.actor.update == NULL)) {
this->unk_34C = NULL;
}
@ -1137,7 +1137,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_36A--;
}
if ((this->unk_34C != 0) && ((this->actionFunc == func_80A6A5C0) || (this->actionFunc == func_80A6A824)) &&
if ((this->unk_34C != NULL) && ((this->actionFunc == func_80A6A5C0) || (this->actionFunc == func_80A6A824)) &&
(this->unk_354 < SQ(3.0f))) {
this->unk_30C |= 0x80;
func_80A6B078(this);
@ -1176,15 +1176,15 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80A68BC8(this);
}
if (this->unk_34C != 0) {
if (this->unk_34C != NULL) {
sp4C = 0.0f;
this->unk_354 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->unk_34C->actor.world.pos);
this->unk_354 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->unk_34C->dyna.actor.world.pos);
if (this->unk_354 < this->unk_350) {
f32 dist = Math3D_DistPlaneToPos(COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.x),
COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.y),
COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.z),
this->unk_34C->actor.floorPoly->dist, &this->actor.world.pos);
f32 dist = Math3D_DistPlaneToPos(COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.x),
COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.y),
COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.z),
this->unk_34C->dyna.actor.floorPoly->dist, &this->actor.world.pos);
if (fabsf(dist) < 3.0f) {
sp4C = 1.9f;
@ -1203,7 +1203,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
!(this->unk_358 > 0.999f) || !(this->unk_354 < SQ(20.0f)))) {
s32 phi_v0 = true;
if (this->unk_34C == 0) {
if (this->unk_34C == NULL) {
this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER;
} else {
this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER;

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,16 @@
struct ObjBean;
typedef void (*ObjBeanActionFunc)(struct ObjBean*, GlobalContext*);
typedef void (*ObjBeanUnkFunc)(struct ObjBean*);
#define OBJBEAN_GET_7F(thisx, x) (((thisx)->params + (x)) & 0x7F)
#define OBJBEAN_GET_80(thisx) (((thisx)->params >> 7) & 1)
#define OBJBEAN_GET_3F00(thisx) (((thisx)->params >> 8) & 0x3F)
#define OBJBEAN_GET_3F80(thisx, x) ((((thisx)->params >> 7) + (x)) & 0x7F)
#define OBJBEAN_GET_C000(thisx) (((thisx)->params >> 0xE) & 3)
#define OBJBEAN_GET_3(thisx) ((thisx)->home.rot.z & 3)
enum {
/* 0x00 */ ENOBJBEAN_GET_C000_0,
/* 0x01 */ ENOBJBEAN_GET_C000_1,
@ -16,13 +23,40 @@ enum {
};
typedef struct ObjBean {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x18];
/* 0x015C */ ObjBeanActionFunc actionFunc;
/* 0x0160 */ char unk_160[0x80];
/* 0x01E0 */ s8 unk_1E0;
/* 0x01E4 */ s32 unk_1E4;
/* 0x01E8 */ char unk_1E8[0x1C];
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ ObjBeanActionFunc actionFunc;
/* 0x160 */ ColliderCylinder collider;
/* 0x1AC */ s16 unk_1AC;
/* 0x1AE */ s16 unk_1AE;
/* 0x1B0 */ s16 unk_1B0;
/* 0x1B2 */ s16 unk_1B2;
/* 0x1B4 */ s8 unk_1B4;
/* 0x1B8 */ f32 unk_1B8;
/* 0x1BC */ Vec3f unk_1BC;
/* 0x1C8 */ f32 unk_1C8;
/* 0x1CC */ f32 unk_1CC;
/* 0x1D0 */ f32 unk_1D0;
/* 0x1D4 */ Vec3s* unk_1D4;
/* 0x1D8 */ s16 unk_1D8;
/* 0x1DA */ s16 unk_1DA;
/* 0x1DC */ s16 unk_1DC;
/* 0x1DE */ s8 unk_1DE;
/* 0x1DF */ s8 unk_1DF;
/* 0x1E0 */ s8 unk_1E0;
/* 0x1E4 */ s32 unk_1E4;
/* 0x1E8 */ ObjBeanUnkFunc unk_1E8;
/* 0x1EC */ s16 unk_1EC;
/* 0x1EE */ s16 unk_1EE;
/* 0x1F0 */ s16 unk_1F0;
/* 0x1F2 */ s16 unk_1F2;
/* 0x1F4 */ s16 unk_1F4;
/* 0x1F6 */ s16 unk_1F6;
/* 0x1F8 */ s16 unk_1F8;
/* 0x1FA */ s16 unk_1FA;
/* 0x1FC */ s16 unk_1FC;
/* 0x1FE */ u8 unk_1FE;
/* 0x1FF */ u8 unk_1FF;
/* 0x200 */ u8 unk_200;
} ObjBean; // size = 0x204
extern const ActorInit Obj_Bean_InitVars;

View File

@ -2175,14 +2175,6 @@ D_0600033C = 0x0600033C;
D_06005948 = 0x06005948;
D_06005CF8 = 0x06005CF8;
// ovl_Obj_Bean
D_06000090 = 0x06000090;
D_060002D0 = 0x060002D0;
D_060004BC = 0x060004BC;
D_06000530 = 0x06000530;
D_06002208 = 0x06002208;
// ovl_Obj_Bigicicle
D_060009B0 = 0x060009B0;