en_rsn OK (#41)

* en_rsn OK

* Fixed build error caused by collisioncheck

Co-authored-by: fullgrowngaming <fullgrowngaming@gmail.com>
This commit is contained in:
kyleburnette 2021-02-12 15:26:05 -08:00 committed by GitHub
parent 08e964972f
commit 55c558852f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 98 additions and 19 deletions

View File

@ -896,7 +896,7 @@ void func_800BD9A0(void); // func_800BD9A0
void func_800BD9E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); // func_800BD9E0
void func_800BDAA0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); // func_800BDAA0
void func_800BDB6C(void); // func_800BDB6C
void func_800BDC5C(void); // func_800BDC5C
void func_800BDC5C(SkelAnime* skelAnime, UNK_PTR animation, UNK_TYPE param_3); // func_800BDC5C
void func_800BDCF4(void); // func_800BDCF4
void func_800BDFB0(void); // func_800BDFB0
void func_800BDFC0(GlobalContext* ctxt, UNK_TYPE4 uParm2); // func_800BDFC0

View File

@ -13092,8 +13092,8 @@ void func_80C25D84(void); // func_80C25D84
void EnRsn_Init(void); // func_80C25D94
void EnRsn_Destroy(void); // func_80C25E14
void EnRsn_Update(void); // func_80C25E38
void func_80C25EB0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6); // func_80C25EB0
void func_80C25EF0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // func_80C25EF0
void EnRsn_OverrideLimbDraw(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6); // EnRsn_OverrideLimbDraw
void EnRsn_PostLimbDraw(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // EnRsn_PostLimbDraw
void EnRsn_Draw(void); // func_80C25F4C
#endif

View File

@ -8767,8 +8767,9 @@ SECTIONS
ovl_En_Rsn : AT(RomLocation)
{
build/src/overlays/actors/ovl_En_Rsn/z_en_rsn.o(.text)
build/asm/ovl_En_Rsn_data.o(.data)
build/asm/ovl_En_Rsn_rodata.o(.rodata)
build/src/overlays/actors/ovl_En_Rsn/z_en_rsn.o(.data)
build/src/overlays/actors/ovl_En_Rsn/z_en_rsn.o(.rodata)
build/src/overlays/actors/ovl_En_Rsn/z_en_rsn_overlay.o(.ovl)
}
SegmentEnd = .;
SegmentSize = SegmentEnd - SegmentStart;

View File

@ -48,6 +48,12 @@ D_06018DA0 = 0x06018DA0;
D_0601EF10 = 0x0601EF10;
D_06018C60 = 0x06018C60;
/* z_en_rsn */
D_06009220 = 0x06009220;
D_06009120 = 0x06009120;
D_06005458 = 0x06005458;
D_0600788C = 0x0600788C;
/* en_ending_hero4 */
D_0600D640 = 0x0600D640;
D_06002A84 = 0x06002A84;

View File

@ -9,7 +9,17 @@ void EnRsn_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnRsn_Update(Actor* thisx, GlobalContext* globalCtx);
void EnRsn_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void func_80C25D84(EnRsn* this, GlobalContext* globalCtx);
typedef struct {
/* 0x00 */ AnimationHeader* animation;
/* 0x04 */ f32 playbackSpeed;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 frameCount;
/* 0x10 */ u8 unk_10;
/* 0x14 */ f32 transitionRate;
} EnRsn_AnimationStruct; // size = 0x18
const ActorInit En_Rsn_InitVars = {
ACTOR_EN_RSN,
ACTORTYPE_NPC,
@ -19,22 +29,77 @@ const ActorInit En_Rsn_InitVars = {
(ActorFunc)EnRsn_Init,
(ActorFunc)EnRsn_Destroy,
(ActorFunc)EnRsn_Update,
(ActorFunc)EnRsn_Draw
(ActorFunc)EnRsn_Draw,
};
*/
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/func_80C25D40.asm")
extern SkeletonHeader D_06009220;
extern AnimationHeader D_06009120;
extern AnimationHeader D_0600788C;
extern Gfx D_06005458[];
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/func_80C25D84.asm")
static EnRsn_AnimationStruct animation = { &D_0600788C, 1.0f, 0.0f, 0.0f, 0x00, 0.0f };
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/EnRsn_Init.asm")
void func_80C25D40(EnRsn* this) {
func_800BDC5C(&this->skelAnime, &animation, 0);
this->actionFunc = func_80C25D84;
}
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/EnRsn_Destroy.asm")
void func_80C25D84(EnRsn* this, GlobalContext* globalCtx) {
}
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/EnRsn_Update.asm")
void EnRsn_Init(Actor* thisx, GlobalContext* globalCtx) {
EnRsn* this = THIS;
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/func_80C25EB0.asm")
Actor_SetDrawParams(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, NULL, NULL, 0);
this->actor.flags &= ~1;
func_80C25D40(this);
}
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/func_80C25EF0.asm")
void EnRsn_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnRsn* this = THIS;
GLOBAL_ASM("asm/non_matchings/ovl_En_Rsn_0x80C25D40/EnRsn_Draw.asm")
SkelAnime_Free(&this->skelAnime, globalCtx);
}
void EnRsn_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRsn* this = THIS;
this->actionFunc(this, globalCtx);
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_800E9250(globalCtx, &this->actor, &this->unk1D8, &this->unk1DE, this->actor.topPosRot.pos);
}
s32 EnRsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnRsn* this = THIS;
if (limbIndex == 14) {
SysMatrix_InsertXRotation_s(this->unk1D8.y, 1);
}
return 0;
}
static Vec3f D_80C26028 = { 0.0f, 0.0f, 0.0f };
void EnRsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnRsn* this = THIS;
Vec3f sp18 = D_80C26028;
if (limbIndex == 14) {
SysMatrix_MultiplyVector3fByState(&sp18, &this->actor.topPosRot);
}
}
void EnRsn_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRsn* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C5B0(globalCtx->state.gfxCtx);
if (1) { // debug define?
s32 pad;
gSPSegment(oGfxCtx->polyOpa.p++, 0x08, Lib_PtrSegToVirt(D_06005458));
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
EnRsn_OverrideLimbDraw, EnRsn_PostLimbDraw, &this->actor);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}

View File

@ -5,9 +5,15 @@
struct EnRsn;
typedef void (*EnRsnActionFunc)(struct BgHakaCurtain*, GlobalContext*);
typedef struct EnRsn {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0xA0];
/* 0x144 */ char unk144[0x4C];
/* 0x190 */ SkelAnime skelAnime;
/* 0x1D4 */ EnRsnActionFunc actionFunc;
/* 0x1D8 */ Vec3s unk1D8;
/* 0x1DE */ Vec3s unk1DE;
} EnRsn; // size = 0x1E4
extern const ActorInit En_Rsn_InitVars;

View File

@ -590,3 +590,4 @@ ovl_En_Invisible_Ruppe_0x80C258A0
ovl_Obj_Ending_0x80C25BC0
ovl_En_Rsn_0x80C25D40
z_skelanime
z_collision_check

View File

@ -17091,7 +17091,7 @@
0x80C25D94:("EnRsn_Init",),
0x80C25E14:("EnRsn_Destroy",),
0x80C25E38:("EnRsn_Update",),
0x80C25EB0:("func_80C25EB0",),
0x80C25EF0:("func_80C25EF0",),
0x80C25EB0:("EnRsn_OverrideLimbDraw",),
0x80C25EF0:("EnRsn_PostLimbDraw",),
0x80C25F4C:("EnRsn_Draw",),
}