Ovl_En_Fsn Ok and Documented (#204)

* First decomp pass: Matched everything w/ data

* Minor cleanup of func_80AE2F78

* Documented

* Format

* Some cleanup and PR suggestions

* Format

* Add the word player to a few functions to specify it is the player trying to buy

* Add controller macros

* Move common shopkeeper defines

* name unk274 and add note to unk27A

* Remove macros and just use flag defines

* Convert Controller Macros to take globalCtx

* Fix merge conflicts
This commit is contained in:
Derek Hensley
2021-07-19 16:26:47 -07:00
committed by GitHub
parent b5c931e432
commit 594a3ceaff
20 changed files with 1846 additions and 191 deletions
+10 -8
View File
@@ -37,19 +37,19 @@ s32 func_800E8FA4(Actor* actor, Vec3f* param_2, Vec3s* param_3, Vec3s* param_4)
targetYaw = Math_Vec3f_Yaw(&actor->focus.pos, param_2) - actor->world.rot.y;
Math_SmoothStepToS(&param_3->x, targetPitch, 6, 2000, 1);
param_3->x = (param_3->x < -6000) ? -6000 : ((6000 < param_3->x) ? 6000 : param_3->x);
param_3->x = CLAMP(param_3->x, -6000, 6000);
yawDiffFromTarget = Math_SmoothStepToS(&param_3->y, targetYaw, 6, 2000, 1);
param_3->y = (param_3->y < -8000) ? -8000 : ((8000 < param_3->y) ? 8000 : param_3->y);
param_3->y = CLAMP(param_3->y, -8000, 8000);
if (yawDiffFromTarget != 0) {
if ((param_3->y < 0 ? -param_3->y : param_3->y) < 8000) {
if (ABS_ALT(param_3->y) < 8000) {
return 0;
}
}
Math_SmoothStepToS(&param_4->y, targetYaw - param_3->y, 4, 2000, 1);
param_4->y = (param_4->y < -12000) ? -12000 : ((12000 < param_4->y) ? 12000 : param_4->y);
param_4->y = CLAMP(param_4->y, -12000, 12000);
return 1;
}
@@ -58,14 +58,15 @@ s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s*
Player* player = PLAYER;
s16 sVar3;
Vec3f local_14;
s16 sVar3A;
actor->focus.pos = actor->world.pos;
actor->focus.pos.y += param_5;
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
sVar3A = ABS_ALT(sVar3);
if (sVar3A >= 0x4300) {
func_800E8F08(param_3, param_4);
return 0;
}
@@ -86,13 +87,14 @@ s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s*
Player* player = PLAYER;
s16 sVar3;
Vec3f local_14;
s16 sVar3A;
actor->focus.pos = param_5;
if (((globalCtx->csCtx).state == 0) && (D_801D0D50 == 0)) {
sVar3 = actor->yawTowardsPlayer - actor->shape.rot.y;
// TODO is this shifting because of a missing cast?
if (0x42ff < (sVar3 < 0 ? ((-sVar3 << 0x10) >> 0x10) : ((sVar3 << 0x10) >> 0x10))) {
sVar3A = ABS_ALT(sVar3);
if (sVar3A >= 0x4300) {
func_800E8F08(param_3, param_4);
return 0;
}
+1 -1
View File
@@ -61,7 +61,7 @@ u8 gItemSlots[] = {
0x1C, 0x2B, 0x21, 0x2A, 0x2D, 0x1B, 0x1F, 0x1A, 0x22, 0x2E, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
};
u16 gItemPrices[] = {
s16 gItemPrices[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20, 0, 20,
5, 20, 20, 50, 50, 200, 20, 20, 20, 200, 5, 0, 200, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};