1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +00:00

Decompiled ovl_En_Si (#239)

* Decompiled ovl_En_Si

* Description

* Update src/overlays/actors/ovl_En_Si/z_en_si.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update src/overlays/actors/ovl_En_Si/z_en_si.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update src/overlays/actors/ovl_En_Si/z_en_si.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Ethan Roseman 2020-07-07 06:39:06 -04:00 committed by GitHub
parent 7e195a3562
commit f3edd3ee77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 120 additions and 344 deletions

View file

@ -1,3 +1,9 @@
/*
* File: z_en_si.c
* Overlay: En_Si
* Description:
*/
#include "z_en_si.h"
#define FLAGS 0x00000201
@ -8,12 +14,22 @@ void EnSi_Init(Actor* thisx, GlobalContext* globalCtx);
void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSi_Update(Actor* thisx, GlobalContext* globalCtx);
void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx);
s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx);
void func_80AFB768(EnSi* this, GlobalContext* globalCtx);
void func_80AFB89C(EnSi* this, GlobalContext* globalCtx);
void func_80AFB950(EnSi* this, GlobalContext* globalCtx);
/*
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000090, 0x00, 0x00 }, 0x00, 0x05, 0x01 },
{ 20, 18, 2, { 0, 0, 0 } },
};
static CollisionCheckInfoInit2 D_80AFBADC = {
0x00, 0x0000, 0x0000, 0x0000, 0xFF,
};
const ActorInit En_Si_InitVars = {
ACTOR_EN_SI,
ACTORTYPE_ITEMACTION,
@ -25,19 +41,108 @@ const ActorInit En_Si_InitVars = {
(ActorFunc)EnSi_Update,
(ActorFunc)EnSi_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Destroy.s")
void EnSi_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSi* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/func_80AFB748.s")
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
func_80061EFC(&this->actor.colChkInfo, NULL, &D_80AFBADC);
Actor_SetScale(&this->actor, 0.025f);
this->unk_19C = 0;
this->actionFunc = func_80AFB768;
this->actor.shape.unk_08 = 42.0f;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/func_80AFB768.s")
void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnSi* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/func_80AFB89C.s")
Collider_DestroyCylinder(globalCtx, &this->collider);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/func_80AFB950.s")
s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 0x2) {
this->collider.base.acFlags &= ~0x2;
}
return 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Update.s")
void func_80AFB768(EnSi* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Si/EnSi_Draw.s")
if ((this->actor.flags & 0x2000) == 0x2000) {
this->actionFunc = func_80AFB89C;
} else {
Math_SmoothScaleMaxMinF(&this->actor.scale.x, 0.25f, 0.4f, 1.0f, 0.0f);
Actor_SetScale(&this->actor, this->actor.scale.x);
this->actor.shape.rot.y += 0x400;
if (func_8008E988(globalCtx) == 0) {
func_80AFB748(this, globalCtx);
if (this->collider.base.maskB & 0x1) {
this->collider.base.maskB &= ~0x1;
Item_Give(globalCtx, ITEM_SKULL_TOKEN);
player->actor.freeze = 10;
func_8010B680(globalCtx, 0xB4, 0);
func_800F5C64(0x39);
this->actionFunc = func_80AFB950;
} else {
Collider_CylinderUpdate(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
}
}
}
}
void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Math_SmoothScaleMaxMinF(&this->actor.scale.x, 0.25f, 0.4f, 1.0f, 0.0f);
Actor_SetScale(&this->actor, this->actor.scale.x);
this->actor.shape.rot.y += 0x400;
if ((this->actor.flags & 0x2000) != 0x2000) {
Item_Give(globalCtx, ITEM_SKULL_TOKEN);
player->actor.freeze = 10;
func_8010B680(globalCtx, 0xB4, 0);
func_800F5C64(0x39);
this->actionFunc = func_80AFB950;
}
}
void func_80AFB950(EnSi* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s32 temp;
s16 params;
if (func_8010BDBC(&globalCtx->msgCtx) != 2) {
player->actor.freeze = 10;
} else {
params = this->actor.params;
temp = (params & 0x1F00) >> 8;
gSaveContext.gsFlags[temp >> 2] |= (params & 0xFF) << D_8012724C[temp & 3];
Actor_Kill(&this->actor);
}
}
void EnSi_Update(Actor* thisx, GlobalContext* globalCtx) {
EnSi* this = THIS;
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
this->actionFunc(this, globalCtx);
Actor_SetHeight(&this->actor, 16.0f);
}
void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnSi* this = THIS;
if (this->actionFunc != func_80AFB950) {
func_8002ED80(&this->actor, globalCtx, 0);
func_8002EBCC(&this->actor, globalCtx, 0);
func_800694A0(globalCtx, 0x74);
}
}

View file

@ -11,7 +11,8 @@ typedef void (*EnSiActionFunc)(struct EnSi*, GlobalContext*);
typedef struct EnSi {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnSiActionFunc actionFunc;
/* 0x0150 */ char unk_150[0x50];
/* 0x0150 */ ColliderCylinder collider;
/* 0x019C */ u8 unk_19C;
} EnSi; // size = 0x01A0
extern const ActorInit En_Si_InitVars;