1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-22 06:52:03 +00:00

Decompile a bunch of objects (#603)

* Mostly done but shifted

* still messed up

* Almost OK

* OBJECT_JYA_OBJ OK, OBJECT_GR OK

* Done

* Merge master and format

* Cleanup

* Cleanup 2

* Start object MB dont merge yet

* Object_MB OK

* Object_ydan_objects OK

* General 'ydan' actor cleanup

* Forgot some small things

* Object_EC OK

* add .gitkeep and run format

* Object_sd OK but no textures cause of a zap issue

* PR fixes

* Fix object_sd

* fix ydan

* delete .gitkeep files

* OBJECT_BOX as far as it can go with current ZAP

* Fix undefined_syms

* Start child link object

* Push progress, dont merge yet

* Object_mori_objects OK

* Fixed?

* Fix conflicts again

* Seems like i missed some textures

* Extract data for BgBombwall

* More field

* ZAP YEP 2.0

* Object_Box OK

* Object_SD ok.  Ready to merge

* remove ASM and merge master

* remove ASM

* remove files wrongfully added to docs/

* Almost done

* Change comment in z_player_lib.c

* forgot some DLists in player_lib.c

* Fix conflict, run format

* Same as before but this time with Tex and TLUT

* Last few things

* fix object_GR and add limbs to object_sd

* Nane -> Name

* gChildDekuShieldMtx is now a matrix and not a blob

* PR fixes (Fig)

* add a space for comment in z_player_lib.c

* re push and new lines

* PR fixes (AngheloAlf)

* PR fixes (Roman)

* Fix Heishi2

* PR fixes (Fig)

* Replace spacing in a file

* PR fixes (Roman)
This commit is contained in:
louist103 2021-05-26 18:59:21 -04:00 committed by GitHub
parent 36fead60a0
commit 201c9ec1cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 1499 additions and 1128 deletions

View file

@ -5,6 +5,7 @@
*/
#include "z_en_mb.h"
#include "objects/object_mb/object_mb.h"
#define FLAGS 0x00000015
@ -27,26 +28,6 @@ const ActorInit En_Mb_InitVars = {
(ActorFunc)EnMb_Draw,
};
extern FlexSkeletonHeader D_06008F38;
extern FlexSkeletonHeader D_06014190;
extern AnimationHeader D_060028E0;
extern AnimationHeader D_0600EBE4;
extern AnimationHeader D_060041A8;
extern AnimationHeader D_06009FC0;
extern AnimationHeader D_06002C10;
extern AnimationHeader D_06002F10;
extern AnimationHeader D_06009280;
extern AnimationHeader D_06001950;
extern AnimationHeader D_0600BE58;
extern AnimationHeader D_0600D5D4;
extern AnimationHeader D_0600E18C;
extern AnimationHeader D_0600B4BC;
extern AnimationHeader D_0600ABE0;
extern AnimationHeader D_0600095C;
extern AnimationHeader D_060016B4;
extern AnimationHeader D_060041A8;
extern AnimationHeader D_0600C44C;
void func_80AA68FC(EnMb* this, GlobalContext* globalCtx);
void func_80AA6898(EnMb* this);
void func_80AA7134(EnMb* this, GlobalContext* globalCtx);
@ -248,7 +229,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->actor.params) {
case -1:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_008F38, &gEnMbStandStillAnim, this->jointTable,
this->morphTable, 28);
this->actor.colChkInfo.health = 2;
this->actor.colChkInfo.mass = MASS_HEAVY;
@ -257,7 +238,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80AA6830(this);
break;
case 0:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014190, &D_0600EBE4, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_014190, &gEnMbAnim_00EBE4, this->jointTable,
this->morphTable, 28);
this->actor.colChkInfo.health = 6;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
@ -283,7 +264,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80AA6898(this);
break;
default:
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable,
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gEnMbSkel_008F38, &gEnMbStandStillAnim, this->jointTable,
this->morphTable, 28);
Actor_SetScale(&this->actor, 0.014f);
this->path = (thisx->params & 0xFF00) >> 8;
@ -406,7 +387,7 @@ void func_80AA66A0(EnMb* this, GlobalContext* globalCtx) {
}
void func_80AA6830(EnMb* this) {
Animation_MorphToLoop(&this->skelAnime, &D_060041A8, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &gEnMbLookLeftAndRightAnim, -4.0f);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(30, 50);
this->unk_320 = 6;
@ -414,7 +395,7 @@ void func_80AA6830(EnMb* this) {
}
void func_80AA6898(EnMb* this) {
Animation_PlayLoop(&this->skelAnime, &D_0600EBE4);
Animation_PlayLoop(&this->skelAnime, &gEnMbAnim_00EBE4);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(30, 50);
this->unk_320 = 6;
@ -422,7 +403,7 @@ void func_80AA6898(EnMb* this) {
}
void func_80AA68FC(EnMb* this, GlobalContext* globalCtx) {
Animation_MorphToLoop(&this->skelAnime, &D_060041A8, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &gEnMbLookLeftAndRightAnim, -4.0f);
this->actor.speedXZ = 0.0f;
this->unk_32A = Rand_S16Offset(40, 80);
this->unk_320 = 6;
@ -431,8 +412,8 @@ void func_80AA68FC(EnMb* this, GlobalContext* globalCtx) {
}
void func_80AA6974(EnMb* this) {
Animation_Change(&this->skelAnime, &D_06009FC0, 0.0f, 0.0f, Animation_GetLastFrame(&D_06009FC0), ANIMMODE_LOOP,
-4.0f);
Animation_Change(&this->skelAnime, &gEnMbWalkAnim, 0.0f, 0.0f, Animation_GetLastFrame(&gEnMbWalkAnim),
ANIMMODE_LOOP, -4.0f);
this->actor.speedXZ = 0.59999996f;
this->unk_32A = Rand_S16Offset(50, 70);
this->unk_332 = 1;
@ -443,20 +424,20 @@ void func_80AA6974(EnMb* this) {
void func_80AA6A18(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_06009FC0);
frameCount = Animation_GetLastFrame(&gEnMbWalkAnim);
this->actor.speedXZ = 0.59999996f;
this->unk_32A = Rand_S16Offset(50, 70);
this->unk_332 = 1;
this->unk_320 = 9;
Animation_Change(&this->skelAnime, &D_06009FC0, 0.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f);
Animation_Change(&this->skelAnime, &gEnMbWalkAnim, 0.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f);
EnMb_SetupAction(this, func_80AA8AEC);
}
void func_80AA6AC8(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_06002C10);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002C10, -4.0f);
frameCount = Animation_GetLastFrame(&gEnMbReadyAttackAnim);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbReadyAttackAnim, -4.0f);
this->unk_320 = 10;
this->actor.speedXZ = 0.0f;
this->unk_32E = (s16)frameCount + 6;
@ -469,7 +450,7 @@ void func_80AA6AC8(EnMb* this) {
}
void func_80AA6B80(EnMb* this) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
this->attackParams = 1;
this->unk_320 = 10;
@ -483,9 +464,9 @@ void func_80AA6BF0(EnMb* this) {
s16 yawDiff;
s32 yawDiffABS;
frames = Animation_GetLastFrame(&D_0600B4BC);
frames = Animation_GetLastFrame(&gEnMbAnim_00B4BC);
this->unk_320 = 10;
Animation_Change(&this->skelAnime, &D_0600B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
this->unk_32E = 1;
yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer);
@ -507,7 +488,7 @@ void func_80AA6BF0(EnMb* this) {
}
void func_80AA6CC0(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_06009280);
Animation_PlayOnce(&this->skelAnime, &gEnMbResumePatrolAnim);
this->unk_320 = 11;
this->unk_32A = 0;
this->unk_32E = 5;
@ -516,7 +497,7 @@ void func_80AA6CC0(EnMb* this) {
}
void func_80AA6D20(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_06009280);
Animation_PlayOnce(&this->skelAnime, &gEnMbResumePatrolAnim);
this->unk_320 = 0xB;
this->actor.bgCheckFlags &= ~1;
this->unk_32A = 0;
@ -530,14 +511,14 @@ void func_80AA6D20(EnMb* this) {
void func_80AA6DA4(EnMb* this) {
f32 frameCount;
frameCount = Animation_GetLastFrame(&D_0600EBE4);
frameCount = Animation_GetLastFrame(&gEnMbAnim_00EBE4);
this->unk_320 = 11;
Animation_Change(&this->skelAnime, &D_0600EBE4, 5.0f, 0.0f, frameCount, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00EBE4, 5.0f, 0.0f, frameCount, ANIMMODE_ONCE_INTERP, 0.0f);
EnMb_SetupAction(this, func_80AA7478);
}
void func_80AA6E1C(EnMb* this) {
Animation_PlayOnce(&this->skelAnime, &D_0600C44C);
Animation_PlayOnce(&this->skelAnime, &gEnMbAnim_00C44C);
this->unk_320 = 3;
this->unk_32A = 0;
this->unk_32E = 20;
@ -548,16 +529,16 @@ void func_80AA6E1C(EnMb* this) {
void func_80AA6E7C(EnMb* this) {
f32 frames;
frames = Animation_GetLastFrame(&D_0600D5D4);
frames = Animation_GetLastFrame(&gEnMbAnim_00D5D4);
this->unk_320 = 2;
this->unk_32A = 0;
this->unk_32E = 6;
Animation_Change(&this->skelAnime, &D_0600D5D4, 1.0f, 4.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00D5D4, 1.0f, 4.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f);
EnMb_SetupAction(this, func_80AA840C);
}
void func_80AA6F04(EnMb* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600BE58, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_00BE58, -4.0f);
this->unk_320 = 1;
this->actor.flags &= ~1;
this->collider1.dim.height = 80;
@ -576,7 +557,7 @@ void func_80AA6F8C(EnMb* this) {
this->unk_328 = 40;
} else {
if (this->actor.params != 0) {
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06001950, 0.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, &gEnMbAnim_001950, 0.0f);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
}
@ -668,8 +649,8 @@ void func_80AA7310(EnMb* this, GlobalContext* globalCtx) {
if (this->unk_32A == 0) {
this->unk_32E--;
if (this->unk_32E == 0) {
Animation_Change(&this->skelAnime, &D_06002C10, -1.0f, Animation_GetLastFrame(&D_06002C10), 0.0f,
ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbReadyAttackAnim, -1.0f,
Animation_GetLastFrame(&gEnMbReadyAttackAnim), 0.0f, ANIMMODE_ONCE, 0.0f);
this->unk_32A = 1;
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM);
@ -717,8 +698,9 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) {
(ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer <= 200.0f)) {
func_80AA6AC8(this);
} else {
endFrame = Animation_GetLastFrame(&D_06002C10);
Animation_Change(&this->skelAnime, &D_06002C10, -1.0f, endFrame, 0.0f, ANIMMODE_ONCE, 0.0f);
endFrame = Animation_GetLastFrame(&gEnMbReadyAttackAnim);
Animation_Change(&this->skelAnime, &gEnMbReadyAttackAnim, -1.0f, endFrame, 0.0f, ANIMMODE_ONCE,
0.0f);
this->actor.speedXZ = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM);
}
@ -731,8 +713,9 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) {
}
if (SkelAnime_Update(&this->skelAnime) != 0) {
if (this->unk_32A == 0) {
endFrame = Animation_GetLastFrame(&D_06002F10);
Animation_Change(&this->skelAnime, &D_06002F10, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, 0.0f);
endFrame = Animation_GetLastFrame(&gEnMbChargePlayerAnim);
Animation_Change(&this->skelAnime, &gEnMbChargePlayerAnim, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP,
0.0f);
this->unk_32A = 1;
} else {
yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos) - this->actor.yawTowardsPlayer;
@ -760,7 +743,7 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) {
currentFrame = this->skelAnime.curFrame;
if (SkelAnime_Update(&this->skelAnime)) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
}
@ -818,8 +801,8 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) {
if (this->unk_32E != 0) {
this->unk_32E--;
if (this->unk_32E == 0) {
f32 pad1 = Animation_GetLastFrame(&D_0600ABE0);
Animation_Change(&this->skelAnime, &D_0600ABE0, 1.5f, 0.0f, pad1, ANIMMODE_ONCE_INTERP, 0.0f);
f32 pad1 = Animation_GetLastFrame(&gEnMbAnim_00ABE0);
Animation_Change(&this->skelAnime, &gEnMbAnim_00ABE0, 1.5f, 0.0f, pad1, ANIMMODE_ONCE_INTERP, 0.0f);
}
} else {
sp74 = this->effSpawnPos;
@ -853,7 +836,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) {
sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y);
currentFrame = (s32)this->skelAnime.curFrame;
if (SkelAnime_Update(&this->skelAnime) != 0) {
Animation_PlayLoop(&this->skelAnime, &D_06002F10);
Animation_PlayLoop(&this->skelAnime, &gEnMbChargePlayerAnim);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_ATTACK);
}
if (this->unk_32E != 0) {
@ -998,7 +981,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) {
void func_80AA8378(EnMb* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->unk_32E != 0) {
Animation_PlayOnce(&this->skelAnime, &D_0600E18C);
Animation_PlayOnce(&this->skelAnime, &gEnMbAnim_00E18C);
this->unk_32E = 0;
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
Camera_AddQuake(&globalCtx->mainCamera, 2, 25, 5);
@ -1016,13 +999,13 @@ void func_80AA840C(EnMb* this, GlobalContext* globalCtx) {
this->unk_32E--;
if (this->unk_32E == 0) {
if (this->unk_32A == 0) {
Animation_Change(&this->skelAnime, &D_0600E18C, 3.0f, 0.0f, Animation_GetLastFrame(&D_0600E18C),
ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00E18C, 3.0f, 0.0f,
Animation_GetLastFrame(&gEnMbAnim_00E18C), ANIMMODE_ONCE_INTERP, 0.0f);
this->unk_32A = 1;
this->unk_32E = 6;
} else {
Animation_Change(&this->skelAnime, &D_0600E18C, 3.0f, 0.0f, Animation_GetLastFrame(&D_0600E18C),
ANIMMODE_ONCE_INTERP, 0.0f);
Animation_Change(&this->skelAnime, &gEnMbAnim_00E18C, 3.0f, 0.0f,
Animation_GetLastFrame(&gEnMbAnim_00E18C), ANIMMODE_ONCE_INTERP, 0.0f);
}
}
} else {
@ -1205,10 +1188,10 @@ void func_80AA8E88(EnMb* this) {
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffABS = ABS(yawDiff);
if (yawDiffABS <= 0x4000) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001950, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_001950, -4.0f);
this->actor.speedXZ = -8.0f;
} else {
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600095C, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbAnim_00095C, -4.0f);
this->actor.speedXZ = 8.0f;
}
this->unk_32A = 30;
@ -1236,10 +1219,10 @@ void func_80AA8FC8(EnMb* this) {
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffAbs = ABS(yawDiff);
if (yawDiffAbs <= 0x4000) {
Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbFallBackAnim, -4.0f);
this->actor.speedXZ = -8.0f;
} else {
Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbFallBackAnim, -4.0f);
this->actor.speedXZ = 8.0f;
}
this->actor.world.rot.y = this->actor.shape.rot.y;

View file

@ -16,7 +16,7 @@ typedef struct EnMb {
/* 0x01D0 */ Vec3s jointTable[28];
/* 0x0278 */ Vec3s morphTable[28];
/* 0x0320 */ s32 unk_320;
/* 0x0324 */ EnMbActionFunc actionFunc;
/* 0x0324 */ EnMbActionFunc actionFunc;
/* 0x0328 */ s16 unk_328;
/* 0x032A */ s16 unk_32A;
/* 0x032C */ s16 soundTimer;
@ -24,7 +24,7 @@ typedef struct EnMb {
/* 0x0330 */ s16 unk_330;
/* 0x0332 */ s16 unk_332;
/* 0x0334 */ s16 attackParams;
/* 0x0338 */ Vec3f effSpawnPos;
/* 0x0338 */ Vec3f effSpawnPos;
/* 0x0344 */ Vec3f waypointPos;
/* 0x0350 */ char unk_34A[0xC];
/* 0x035C */ s8 waypoint;