Update to latest ghidra project

This commit is contained in:
rozlette
2020-01-08 08:32:20 -06:00
parent 8d8df1848e
commit 727a546fcf
17 changed files with 1165 additions and 942 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ void EnAObj_Init(ActorEnAObj* this, GlobalContext* ctxt) {
s0->base.textId = ((s0->base.variable >> 8) & 0xFF) | 0x300;
s0->base.variable = (s0->base.variable & 0xFF) - 9;
Lib_ApplyActorInitVars((Actor*)s0, (ActorInitVar*)&enAObjInitVar);
Actor_SetPostDrawParams(&s0->base.postDrawParams, 0, (actor_post_draw_func*)func_800B3FC0, 12);
Actor_SetDrawParams(&s0->base.drawParams, 0, (actor_post_draw_func*)func_800B3FC0, 12);
Collision_InitCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
Collision_CylinderMoveToActor((Actor*)s0, &s0->collision);
s0->base.unkA0.unk16 = 255;
@@ -26,7 +26,7 @@ void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
if (func_800B84D0((Actor*)this, ctxt) != 0) {
this->update = (actor_func)EnAObj_Update2;
} else {
v0 = this->base.unk92 - this->base.postDrawParams.rotation.y;
v0 = this->base.yawToLink - this->base.drawParams.rot.y;
v1 = (v0 < 0)? -v0 : v0;
if ((v1 < 10240) || ((this->base.variable == 1) && (v1 > 22528))) {
func_800B863C((Actor*)this, ctxt);
@@ -42,7 +42,7 @@ void EnAObj_Update2(ActorEnAObj* this, GlobalContext* ctxt) {
void EnAObj_Main(ActorEnAObj* this, GlobalContext* ctxt) {
(this->update)((Actor*)this, (GlobalContext*)ctxt);
func_800B675C((Actor*)this, 45.0f);
Actor_SetHeight((Actor*)this, 45.0f);
Collision_AddOT(ctxt, &ctxt->collisionContext, (ColCommon*)&this->collision);
}
+5 -5
View File
@@ -25,7 +25,7 @@ void BgCheck2_UpdateActorPosition(BgCheckContext* bgCtxt, s32 index, Actor* acto
bgCtxt->dyna.actorMeshes[index].prevParams.pos.y,
bgCtxt->dyna.actorMeshes[index].prevParams.pos.z);
if (invert_matrix(&prevMatrix, &prevMatrixInv) == 2) return;
if (Matrix_Invert(&prevMatrix, &prevMatrixInv) == 2) return;
Matrix_MakeTranslationRotationYXZScale(&currMatrix,
bgCtxt->dyna.actorMeshes[index].currParams.scale.x,
@@ -38,10 +38,10 @@ void BgCheck2_UpdateActorPosition(BgCheckContext* bgCtxt, s32 index, Actor* acto
bgCtxt->dyna.actorMeshes[index].currParams.pos.y,
bgCtxt->dyna.actorMeshes[index].currParams.pos.z);
Matrix_MultiplyByVectorXYZ(&prevMatrixInv, &actor->unk24.pos, &posWithInv);
Matrix_MultiplyByVectorXYZ(&prevMatrixInv, &actor->currPosRot.pos, &posWithInv);
Matrix_MultiplyByVectorXYZ(&currMatrix, &posWithInv, &newPos);
actor->unk24.pos = newPos;
actor->currPosRot.pos = newPos;
}
void BgCheck2_UpdateActorYRotation(BgCheckContext* bgCtxt, s32 index, Actor* actor) {
@@ -55,8 +55,8 @@ void BgCheck2_UpdateActorYRotation(BgCheckContext* bgCtxt, s32 index, Actor* act
((ActorPlayer*)actor)->unkAD4 += angleChange;
}
actor->postDrawParams.rotation.y += angleChange;
actor->unk24.rot.y += angleChange;
actor->drawParams.rot.y += angleChange;
actor->currPosRot.rot.y += angleChange;
}
void BgCheck2_AttachToMesh(BgCheckContext* bgCtxt, Actor* actor, s32 index) {
+9 -9
View File
@@ -31,8 +31,8 @@ s32 func_800E8FA4(Actor* actor, Vector3f* param_2, Vector3s* param_3, Vector3s*
s16 targetYaw;
s16 yawDiffFromTarget;
targetPitch = Lib_PitchVec3f(&actor->unk3C.pos,param_2);
targetYaw = Lib_YawVec3f(&actor->unk3C.pos,param_2) - actor->unk24.rot.y;
targetPitch = Lib_PitchVec3f(&actor->topPosRot.pos,param_2);
targetYaw = Lib_YawVec3f(&actor->topPosRot.pos,param_2) - actor->currPosRot.rot.y;
Lib_ScaleMaxMin_s(&param_3->x, targetPitch, 6, 2000, 1);
param_3->x = (param_3->x < -6000)? -6000 : ((6000 < param_3->x)? 6000 : param_3->x);
@@ -58,11 +58,11 @@ s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vector3s* param_3, Vector3s
Vector3f local_14;
player = (ctxt->actorContext).actorTypeLists[2].head;
actor->unk3C.pos = actor->unk24.pos;
actor->unk3C.pos.y += param_5;
actor->topPosRot.pos = actor->currPosRot.pos;
actor->topPosRot.pos.y += param_5;
if (((ctxt->cutsceneContext).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->unk92 - actor->postDrawParams.rotation.y;
sVar3 = actor->yawToLink - actor->drawParams.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
func_800E8F08(param_3,param_4);
@@ -73,7 +73,7 @@ s32 func_800E9138(GlobalContext* ctxt, Actor* actor, Vector3s* param_3, Vector3s
if (((ctxt->cutsceneContext).state != 0) || (D_801D0D50 != 0)) {
local_14 = ctxt->view.eye;
} else {
local_14 = player->unk3C.pos;
local_14 = player->topPosRot.pos;
}
func_800E8FA4(actor,&local_14,param_3,param_4);
@@ -86,10 +86,10 @@ s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vector3s* param_3, Vector3s
Vector3f local_14;
player = (ctxt->actorContext).actorTypeLists[2].head;
actor->unk3C.pos = param_5;
actor->topPosRot.pos = param_5;
if (((ctxt->cutsceneContext).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->unk92 - actor->postDrawParams.rotation.y;
sVar3 = actor->yawToLink - actor->drawParams.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
func_800E8F08(param_3,param_4);
@@ -100,7 +100,7 @@ s32 func_800E9250(GlobalContext* ctxt, Actor* actor, Vector3s* param_3, Vector3s
if (((ctxt->cutsceneContext).state != 0) || (D_801D0D50 != 0)) {
local_14 = ctxt->view.eye;
} else {
local_14 = player->unk3C.pos;
local_14 = player->topPosRot.pos;
}
func_800E8FA4(actor,&local_14,param_3,param_4);
+20 -20
View File
@@ -3,7 +3,7 @@
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_PrintLists.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SetPostDrawParams.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SetDrawParams.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_PostDraw.asm")
@@ -99,13 +99,13 @@ GLOBAL_ASM("asm/nonmatching/z_actor//func_800B6680.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_MarkForDeath.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B672C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_InitCurrPosition.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B675C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SetHeight.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B67A0.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SetRotationFromDrawRotation.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B67C0.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_InitDrawRotation.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SetScale.asm")
@@ -137,13 +137,13 @@ GLOBAL_ASM("asm/nonmatching/z_actor//func_800B6C58.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_YawBetweenActors.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B6D00.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_YawBetweenActorsTop.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_YawToPoint.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_PitchBetweenActors.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B6D7C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_PitchBetweenActorsTop.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_PitchToPoint.asm")
@@ -155,7 +155,7 @@ GLOBAL_ASM("asm/nonmatching/z_actor//Actor_XZDistanceBetweenActors.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_XZDistanceToPoint.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B6E6C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_CalcOffsetOrientedToDrawRotation.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_YDistance.asm")
@@ -187,17 +187,17 @@ GLOBAL_ASM("asm/nonmatching/z_actor//func_800B72E0.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B72F8.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B7320.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsLinkFacingActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B7378.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsActorFacedByActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B73E0.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsActorFacingLink.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B742C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsActorFacingActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B748C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsActorFacingLinkAndWithinRange.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B750C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_IsActorFacingActorAndWithinRange.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B75A0.asm")
@@ -327,9 +327,9 @@ GLOBAL_ASM("asm/nonmatching/z_actor//Actor_Init.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B9334.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B948C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_UpdateActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B9780.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_UpdateAll.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_DrawActor.asm")
@@ -337,7 +337,7 @@ GLOBAL_ASM("asm/nonmatching/z_actor//func_800B9D1C.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_DrawAllSetup.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_RecordDrawnActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_RecordUndrawnActor.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//func_800B9E84.asm")
@@ -363,13 +363,13 @@ GLOBAL_ASM("asm/nonmatching/z_actor//Actor_RemoveFromTypeList.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_FreeOverlay.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SpawnNoParentDefaultUnk38Unk20.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_Spawn.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_LoadOverlay.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_Spawn.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SpawnWithParentAndCutscene.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SpawnDefaultUnk38.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SpawnWithParent.asm")
GLOBAL_ASM("asm/nonmatching/z_actor//Actor_SpawnTransitionActors.asm")
+1 -1
View File
@@ -75,7 +75,7 @@ s32 Lib_StepTowardsCheckFramerateScaled_s(s16* start, s16 target, s16 step) {
f32 f0;
if (step != 0) {
f0 = D_801D1508;
f0 = gFramerateDivisorHalf;
if ((s16)(*start - target) > 0) {
step = -step;
+1 -1
View File
@@ -57,7 +57,7 @@ void Room_DrawType1Mesh(GlobalContext* ctxt, Room* room, u32 flags) {
} else if (mesh->format == 2) {
func_8012E32C(ctxt,room,flags);
} else {
func_80086280(D_801DDFAC,0x3c5);
assert_fail(D_801DDFAC,0x3c5);
}
}