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

Decompile z_play.c and Match/Document some of z_view.c (#74)

* Decompile z_play.c and Match/Document some of z_view.c

Also fix the last non matching in z_sample.c and update some game state functions.

* Suggestions from PR #74

* Fix undefined reference to Gameplay_DrawOverlay

* Suggestion from PR #74 (2)

* Fix a fake argument in func_800BC450
This commit is contained in:
Roman971 2020-04-16 23:36:12 +02:00 committed by GitHub
parent 9ac1f8130d
commit 262f6c507c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
278 changed files with 5139 additions and 5939 deletions

View file

@ -33,10 +33,9 @@ const ActorInit En_Dog_InitVars = {
};
static ColliderCylinderInit cylinderInit = {
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000,
0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x00, 0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
};
static Sub98Init5 sub98Data = {
@ -54,15 +53,6 @@ static struct_80034EC0_Entry animations[] = {
{ 0x06000928, 1.0f, 0.0f, 6.0f, 0x02, -6.0f }, { 0x06000C28, 1.0f, 0.0f, -1.0f, 0x00, -6.0f },
};
// Bandaid fix for a lw vs lh issue in EnDog_FollowPath. Roman will look at it later.
typedef union {
/* 0x00 */ s32 entry;
struct {
s16 unk_0;
s16 unk_2;
};
} s16ArrEntry;
typedef enum {
/* 0x00 */ DOG_WALK,
/* 0x01 */ DOG_RUN,
@ -164,7 +154,7 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) {
return 0;
}
static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
if ((this->collider.base.collideFlags & 2)) {
this->collider.base.collideFlags &= ~2;
return 2;
@ -186,7 +176,7 @@ static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
return 0;
}
static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) {
s32 EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) {
s32 change;
if (this->path == NULL) {
@ -293,8 +283,8 @@ void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) {
}
void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
s16ArrEntry behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
s16ArrEntry unused[] = { 40, 80, 20 };
s32 behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
s32 unused[] = { 40, 80, 20 };
f32 speed;
s32 frame;
@ -316,16 +306,16 @@ void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
// depending on where he is on his path. En_Hy checks these event flags.
if (this->waypoint < 9) {
// Richard is close to her, text says something about his coat
gSaveContext.event_inf[3] |= 1;
gSaveContext.eventInf[3] |= 1;
} else {
// Richard is far, text says something about running fast
gSaveContext.event_inf[3] &= ~1;
gSaveContext.eventInf[3] &= ~1;
}
} else {
frame = globalCtx->state.frames % 3;
this->nextBehavior = behaviors[frame].entry;
// no clue why they're using the action id to calculate timer. possibly meant to use the unused array?
this->behaviorTimer = Math_Rand_S16Offset(60, behaviors[frame].unk_2);
this->nextBehavior = behaviors[frame];
// no clue why they're using the behavior id to calculate timer. possibly meant to use the unused array?
this->behaviorTimer = Math_Rand_S16Offset(60, behaviors[frame]);
this->actionFunc = EnDog_ChooseMovement;
}
}
@ -451,8 +441,7 @@ void EnDog_Update(EnDog* this, GlobalContext* globalCtx) {
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
}
static UNK_TYPE EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* actor) {
s32 EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
return 0;
}