Quake & Distortion Docs (Again) + Math Cleanup (Camera Prep) (#1129)

* more quake docs

* more docs

* more distortion docs

* math cleanup

* fix header

* cleanup

* only partial PR review

* PR Suggestions

* fix master merge

* reverb angle change macros

* more revert

* fix enum
This commit is contained in:
engineer124 2023-05-19 00:29:50 +10:00 committed by GitHub
parent 83ac58d739
commit 180227e7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 811 additions and 729 deletions

View File

@ -739,9 +739,9 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16
s32 Actor_IsTargeted(PlayState* play, Actor* actor); s32 Actor_IsTargeted(PlayState* play, Actor* actor);
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor); s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor);
void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play); void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play);
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown); void Actor_RequestQuake(PlayState* play, s16 y, s16 duration);
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed); void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed);
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown); void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type); void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 bufFlag, u16 duration); void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 bufFlag, u16 duration);
Hilite* func_800BCBF4(Vec3f* arg0, PlayState* play); Hilite* func_800BCBF4(Vec3f* arg0, PlayState* play);
@ -833,7 +833,7 @@ s16 Camera_ClearFlags(Camera* camera, s16 flags);
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s16 timer3); s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s16 timer3);
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
// UNK_TYPE4 func_800E01AC(void); // UNK_TYPE4 func_800E01AC(void);
Vec3f* Camera_GetQuakeOffset(Vec3f* dst, Camera* camera); Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera);
// void func_800E01DC(s32 param_1, u32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); // void func_800E01DC(s32 param_1, u32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
// UNK_TYPE4 func_800E0228(void); // UNK_TYPE4 func_800E0228(void);
void func_800E0238(Camera* camera); void func_800E0238(Camera* camera);
@ -1462,17 +1462,17 @@ f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max); f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph); Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph);
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph); Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec); VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec);
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec); VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec);
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b); VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b);
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b); VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphAddToVec3f(Vec3f* dest, Vec3f* a, VecSph* sph); Vec3f* OLib_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b); Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b);
void OLib_DbCameraVec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode); void OLib_Vec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
void OLib_DbCameraVec3fSum(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode); void OLib_Vec3fAdd(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
Gfx* Gfx_DrawTexRectRGBA16(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy); Gfx* Gfx_DrawTexRectRGBA16(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy);
Gfx* Gfx_DrawTexRectIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy); Gfx* Gfx_DrawTexRectIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy);

View File

@ -532,8 +532,8 @@ typedef enum {
#define ACTOR_FLAG_400 (1 << 10) #define ACTOR_FLAG_400 (1 << 10)
// //
#define ACTOR_FLAG_800 (1 << 11) #define ACTOR_FLAG_800 (1 << 11)
// // Actor will not shake when a quake occurs
#define ACTOR_FLAG_1000 (1 << 12) #define ACTOR_FLAG_IGNORE_QUAKE (1 << 12)
// //
#define ACTOR_FLAG_2000 (1 << 13) #define ACTOR_FLAG_2000 (1 << 13)
// //

View File

@ -374,7 +374,7 @@ typedef struct {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f norm; /* 0x0C */ Vec3f norm;
/* 0x18 */ CollisionPoly* poly; /* 0x18 */ CollisionPoly* poly;
/* 0x1C */ VecSph sphNorm; /* 0x1C */ VecGeo geoNorm;
/* 0x24 */ s32 bgId; /* 0x24 */ s32 bgId;
} CameraCollision; // size = 0x28 } CameraCollision; // size = 0x28
@ -1244,8 +1244,8 @@ typedef struct {
typedef struct { typedef struct {
/* 0x00 */ Vec3f unk_00; /* 0x00 */ Vec3f unk_00;
/* 0x0C */ VecSph unk_0C; /* 0x0C */ VecGeo unk_0C;
/* 0x14 */ VecSph unk_14; /* 0x14 */ VecGeo unk_14;
/* 0x1C */ s16 unk_1C; /* 0x1C */ s16 unk_1C;
} Demo1ReadWriteData; // size = 0x20 } Demo1ReadWriteData; // size = 0x20
@ -1319,7 +1319,7 @@ typedef struct {
/* 0x0C */ f32 unk_0C; /* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14; /* 0x14 */ f32 unk_14;
/* 0x18 */ VecSph unk_18; /* 0x18 */ VecGeo unk_18;
/* 0x20 */ s16 unk_20; /* 0x20 */ s16 unk_20;
/* 0x22 */ s16 timer; /* 0x22 */ s16 timer;
} Demo4ReadWriteData; // size = 0x24 } Demo4ReadWriteData; // size = 0x24
@ -1345,7 +1345,7 @@ typedef struct {
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14; /* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18; /* 0x18 */ f32 unk_18;
/* 0x1C */ VecSph unk_1C; /* 0x1C */ VecGeo unk_1C;
/* 0x24 */ s16 unk_24; /* 0x24 */ s16 unk_24;
/* 0x26 */ s16 timer; /* 0x26 */ s16 timer;
} Demo5ReadWriteData; // size = 0x28 } Demo5ReadWriteData; // size = 0x28
@ -1367,8 +1367,8 @@ typedef struct {
typedef struct { typedef struct {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ VecSph subAtToEye; /* 0x04 */ VecGeo subAtToEye;
/* 0x0C */ VecSph atToEye; /* 0x0C */ VecGeo atToEye;
/* 0x14 */ s16 unk_14; /* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16; /* 0x16 */ s16 unk_16;
/* 0x18 */ s16 unk_18; /* 0x18 */ s16 unk_18;

View File

@ -87,12 +87,32 @@ typedef struct {
/* 0x0C */ Vec3f b; /* 0x0C */ Vec3f b;
} LineSegment; // size = 0x18 } LineSegment; // size = 0x18
// Defines a point in the spherical coordinate system
typedef struct { typedef struct {
/* 0x0 */ f32 r; // radius /* 0x0 */ f32 r; // radius
/* 0x4 */ s16 pitch; // polar (zenith) angle /* 0x4 */ s16 pitch; // depends on coordinate system. See below.
/* 0x6 */ s16 yaw; // azimuthal angle /* 0x6 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x8 } VecSphGeo; // size = 0x8
// Defines a point in the spherical coordinate system.
// Pitch is 0 along the positive y-axis (up)
typedef VecSphGeo VecSph;
// Defines a point in the geographic coordinate system.
// Pitch is 0 along the xz-plane (horizon)
typedef VecSphGeo VecGeo;
// To be used with OLib_Vec3fAdd()
typedef enum {
/* 0 */ OLIB_ADD_COPY, // Copy `b` to dest
/* 1 */ OLIB_ADD_OFFSET, // Add `a` and `b` to dest, and also add the yaw of `a` to the dest
/* 2 */ OLIB_ADD, // Add `a` and `b` to dest
} OlibVec3fAdd;
typedef enum {
/* 0 */ OLIB_DIFF_COPY, // Copy `b` to dest
/* 1 */ OLIB_DIFF_OFFSET, // Sub `a` and `b` to dest, and also subs the yaw of `a` to the dest
/* 2 */ OLIB_DIFF, // Sub `a` and `b` to dest
} OlibVec3fDiff;
#define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t))) #define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t)))
#define F32_LERP(v0, v1, t) ((1.0f - (t)) * (f32)(v0) + (t) * (f32)(v1)) #define F32_LERP(v0, v1, t) ((1.0f - (t)) * (f32)(v0) + (t) * (f32)(v1))

View File

@ -1,68 +1,64 @@
#ifndef Z64QUAKE_H #ifndef Z64QUAKE_H
#define Z64QUAKE_H #define Z64QUAKE_H
#include "z64camera.h"
#include "z64math.h" #include "z64math.h"
struct PlayState; struct PlayState;
struct Camera;
typedef struct { typedef struct {
/* 0x00 */ Vec3f atOffset; /* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset; /* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset; /* 0x18 */ s16 upRollOffset;
/* 0x1A */ s16 zoom; /* 0x1A */ s16 fovOffset;
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used /* 0x1C */ f32 maxOffset; // Set to scaled max data of struct (mag for Vec3f), never used
} QuakeCamCalc; // size = 0x20 } ShakeInfo; // size = 0x20
#define QUAKE_SPEED (1 << 0)
#define QUAKE_VERTICAL_MAG (1 << 1)
#define QUAKE_HORIZONTAL_MAG (1 << 2)
#define QUAKE_ZOOM (1 << 3)
#define QUAKE_ROLL_OFFSET (1 << 4)
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
#define QUAKE_COUNTDOWN (1 << 8)
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
typedef enum { typedef enum {
/* 1 */ QUAKE_TYPE_1 = 1, /* 0 */ QUAKE_TYPE_NONE,
/* 2 */ QUAKE_TYPE_2, /* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations
/* 3 */ QUAKE_TYPE_3, /* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations
/* 4 */ QUAKE_TYPE_4, /* 3 */ QUAKE_TYPE_3, // Periodic, decaying
/* 5 */ QUAKE_TYPE_5, /* 4 */ QUAKE_TYPE_4, // Aperiodic, decaying, random X perturbations
/* 6 */ QUAKE_TYPE_6 /* 5 */ QUAKE_TYPE_5, // Periodic, sustaining
/* 6 */ QUAKE_TYPE_6 // See below
} QuakeType; } QuakeType;
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value); s16 Quake_Request(Camera* camera, u32 type);
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed);
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown); u32 Quake_SetSpeed(s16 index, s16 speed);
s16 Quake_GetCountdown(s16 quakeIndex); u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll);
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset); u32 Quake_SetDuration(s16 index, s16 duration);
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset); u32 Quake_SetOrientation(s16 index, s16 isRelativeToScreen, Vec3s orientation);
s16 Quake_Add(Camera* camera, u32 type);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData); s16 Quake_GetTimeLeft(s16 index);
u32 Quake_Remove(s16 index); s32 Quake_GetNumActiveQuakes(void);
s32 Quake_NumActiveQuakes(void); u32 Quake_RemoveRequest(s16 index);
void Quake_Init(void); void Quake_Init(void);
s16 Quake_Update(Camera* camera, ShakeInfo* camShake);
#define DISTORTION_TYPE_0 (1 << 0) #define DISTORTION_TYPE_HOT_ROOM (1 << 0) // Hot Room
#define DISTORTION_TYPE_NON_ZORA_SWIMMING (1 << 2) #define DISTORTION_TYPE_NON_ZORA_SWIMMING (1 << 2) // Non-Zora swimming
#define DISTORTION_TYPE_ZORA_SWIMMING (1 << 3) #define DISTORTION_TYPE_ZORA_SWIMMING (1 << 3) // Zora swimming, also used for boss warp pad part 1
#define DISTORTION_TYPE_UNDERWATER_ENTRY (1 << 4)
#define DISTORTION_TYPE_5 (1 << 5)
#define DISTORTION_TYPE_6 (1 << 6)
#define DISTORTION_TYPE_7 (1 << 7)
#define DISTORTION_TYPE_8 (1 << 8)
#define DISTORTION_TYPE_9 (1 << 9)
#define DISTORTION_TYPE_A (1 << 10)
#define DISTORTION_TYPE_B (1 << 11)
void Distortion_SetCountdown(s16 countdown); #define DISTORTION_TYPE_UNDERWATER_ENTRY (1 << 4) // Entering water, also used for boss warp pad part 2
s16 Distortion_GetCountdown(void); #define DISTORTION_TYPE_SONG_OF_TIME (1 << 5) // Song of Time effects
#define DISTORTION_TYPE_ZORA_KICK (1 << 6) // PLAYER_MWA_ZORA_PUNCH_KICK
#define DISTORTION_TYPE_UNK_ATTACK (1 << 7) // Impossible to achieve, inferred to be another `PLAYER_MWA_`,
#define DISTORTION_TYPE_GORON_BUTT (1 << 8) // PLAYER_MWA_GORON_PUNCH_BUTT
#define DISTORTION_TYPE_MASK_TRANSFORM_1 (1 << 9) // Mask transformation part 1
#define DISTORTION_TYPE_BOSS_WARP (1 << 10) // Boss warp pad part 3
#define DISTORTION_TYPE_MASK_TRANSFORM_2 (1 << 11) // Mask transformation part 2
void Distortion_Request(s32 type);
void Distortion_SetDuration(s16 duration);
s16 Distortion_GetTimeLeft(void);
s16 Distortion_GetType(void); s16 Distortion_GetType(void);
void Distortion_SetType(s32 type); void Distortion_RemoveRequest(s32 type);
void Distortion_ClearType(s32 type);
void Distortion_Init(PlayState* play); void Distortion_Init(PlayState* play);
void Distortion_Update(void); void Distortion_Update(void);

View File

@ -119,23 +119,23 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) { switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2: case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF);
break; break;
case CS_CAM_REL_3: case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_1: case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_4: case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_5: case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2); OLib_Vec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_DIFF);
break; break;
default: // CS_CAM_REL_0 default: // CS_CAM_REL_0
@ -147,24 +147,24 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) { switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2: case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD);
break; break;
case CS_CAM_REL_3: case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
csCamera->camera->at.y += func_80163660(&player->actor); csCamera->camera->at.y += func_80163660(&player->actor);
break; break;
case CS_CAM_REL_1: case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
break; break;
case CS_CAM_REL_4: case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1); OLib_Vec3fAdd(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD_OFFSET);
break; break;
case CS_CAM_REL_5: case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2); OLib_Vec3fAdd(&target->world, &csCamera->camera->at, &csCamera->camera->at, OLIB_ADD);
break; break;
default: // CS_CAM_REL_0 default: // CS_CAM_REL_0
@ -189,23 +189,23 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) { switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2: case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF);
break; break;
case CS_CAM_REL_3: case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_1: case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_4: case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF_OFFSET);
break; break;
case CS_CAM_REL_5: case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2); OLib_Vec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_DIFF);
break; break;
default: // CS_CAM_REL_0 default: // CS_CAM_REL_0
@ -217,24 +217,24 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) { switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2: case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD);
break; break;
case CS_CAM_REL_3: case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
csCamera->camera->eye.y += func_80163660(&player->actor); csCamera->camera->eye.y += func_80163660(&player->actor);
break; break;
case CS_CAM_REL_1: case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fAdd(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
break; break;
case CS_CAM_REL_4: case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1); OLib_Vec3fAdd(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD_OFFSET);
break; break;
case CS_CAM_REL_5: case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2); OLib_Vec3fAdd(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, OLIB_ADD);
break; break;
default: // CS_CAM_REL_0 default: // CS_CAM_REL_0

View File

@ -2574,7 +2574,7 @@ void Actor_Draw(PlayState* play, Actor* actor) {
(actor->flags & (ACTOR_FLAG_10000000 | ACTOR_FLAG_400000)) ? NULL : &actor->world.pos, play); (actor->flags & (ACTOR_FLAG_10000000 | ACTOR_FLAG_400000)) ? NULL : &actor->world.pos, play);
Lights_Draw(light, play->state.gfxCtx); Lights_Draw(light, play->state.gfxCtx);
if (actor->flags & ACTOR_FLAG_1000) { if (actor->flags & ACTOR_FLAG_IGNORE_QUAKE) {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.quakeOffset.x, Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.quakeOffset.x,
actor->world.pos.y + actor->world.pos.y +
((actor->shape.yOffset * actor->scale.y) + play->mainCamera.quakeOffset.y), ((actor->shape.yOffset * actor->scale.y) + play->mainCamera.quakeOffset.y),
@ -3791,30 +3791,29 @@ void func_800BC620(Vec3f* pos, Vec3f* scale, u8 alpha, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);
} }
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown) { void Actor_RequestQuake(PlayState* play, s16 y, s16 duration) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown); Quake_SetDuration(quakeIndex, duration);
} }
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed) { void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed) {
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, speed); Quake_SetSpeed(quakeIndex, speed);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown); Quake_SetDuration(quakeIndex, duration);
} }
// Actor_RequestRumble? void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration) {
void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown) { if (quakeY >= 5) {
if (y >= 5) {
Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150);
} else { } else {
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
} }
Actor_AddQuake(play, y, countdown); Actor_RequestQuake(play, quakeY, quakeDuration);
} }
typedef struct { typedef struct {

View File

@ -699,7 +699,7 @@ f32 D_801B9E60 = 0.0f;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo1.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo1.s")
// Data for opening chests (default) // Data for opening chests (default)
VecSph D_801B9E64[] = { VecGeo D_801B9E64[] = {
{ 50.0f, 0xEE3A, 0xD558 }, { 50.0f, 0xEE3A, 0xD558 },
{ 75.0f, 0x0000, 0x8008 }, { 75.0f, 0x0000, 0x8008 },
{ 80.0f, 0xEE3A, 0x8008 }, { 80.0f, 0xEE3A, 0x8008 },
@ -713,7 +713,7 @@ Vec3f D_801B9E84[] = {
}; };
// Data for opening chests (goron) // Data for opening chests (goron)
VecSph D_801B9EB4[] = { VecGeo D_801B9EB4[] = {
{ 60.0f, 0xEE3A, 0xD558 }, { 60.0f, 0xEE3A, 0xD558 },
{ 95.0f, 0x0000, 0x8008 }, { 95.0f, 0x0000, 0x8008 },
{ 90.0f, 0xEE3A, 0x8008 }, { 90.0f, 0xEE3A, 0x8008 },

View File

@ -3795,12 +3795,12 @@ s32 sCameraHudVisibility = 2;
s32 sCameraLetterboxSize = 32; s32 sCameraLetterboxSize = 32;
s32 sCameraNegOne = -1; s32 sCameraNegOne = -1;
// VecSph yaw data // VecGeo yaw data
s16 D_801B9E18[] = { s16 D_801B9E18[] = {
0x0AAA, 0xF556, 0x1555, 0xEAAB, 0x2AAA, 0xD556, 0x3FFF, 0xC001, 0x5555, 0xAAAB, 0x6AAA, 0x9556, 0x7FFF, 0x0000, 0x0AAA, 0xF556, 0x1555, 0xEAAB, 0x2AAA, 0xD556, 0x3FFF, 0xC001, 0x5555, 0xAAAB, 0x6AAA, 0x9556, 0x7FFF, 0x0000,
}; };
// VecSph pitch data // VecGeo pitch data
s16 D_801B9E34[] = { s16 D_801B9E34[] = {
0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, 0xFD3A, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, 0xFA74, 0x0000, 0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, 0xFD3A, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, 0xFA74, 0x0000,
}; };

View File

@ -202,10 +202,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_MEDIUM: case CS_MISC_EARTHQUAKE_MEDIUM:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isFirstFrame) { if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000); Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0); Quake_SetPerturbations(sCutsceneQuakeIndex, 6, 4, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800); Quake_SetDuration(sCutsceneQuakeIndex, 800);
} }
break; break;
@ -310,10 +310,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_STRONG: case CS_MISC_EARTHQUAKE_STRONG:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
if (isFirstFrame) { if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 30000); Quake_SetSpeed(sCutsceneQuakeIndex, 30000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0); Quake_SetPerturbations(sCutsceneQuakeIndex, 20, 10, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800); Quake_SetDuration(sCutsceneQuakeIndex, 800);
} }
break; break;
@ -372,10 +372,10 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_EARTHQUAKE_WEAK: case CS_MISC_EARTHQUAKE_WEAK:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
if (isFirstFrame) { if (isFirstFrame) {
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sCutsceneQuakeIndex, 22000); Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0); Quake_SetPerturbations(sCutsceneQuakeIndex, 2, 1, 0, 0);
Quake_SetCountdown(sCutsceneQuakeIndex, 800); Quake_SetDuration(sCutsceneQuakeIndex, 800);
} }
break; break;

View File

@ -100,16 +100,16 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
} }
/** /**
* Takes the geographic point `sph` and converts it into a x,y,z position * Takes the geographic point `geo` and converts it into a x,y,z position
*/ */
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) { Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo) {
VecSph geo; VecSph sph;
geo.r = sph->r; sph.r = geo->r;
geo.pitch = 0x4000 - sph->pitch; sph.pitch = 0x4000 - geo->pitch;
geo.yaw = sph->yaw; sph.yaw = geo->yaw;
return OLib_VecSphToVec3f(dest, &geo); return OLib_VecSphToVec3f(dest, &sph);
} }
/** /**
@ -117,16 +117,16 @@ Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) {
*/ */
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) { VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
VecSph sph; VecSph sph;
f32 distSquared = SQ(vec->x) + SQ(vec->z); f32 distXZSq = SQ(vec->x) + SQ(vec->z);
f32 dist = sqrtf(distSquared); f32 distXZ = sqrtf(distXZSq);
if ((dist == 0.0f) && (vec->y == 0.0f)) { if ((distXZ == 0.0f) && (vec->y == 0.0f)) {
sph.pitch = 0; sph.pitch = 0;
} else { } else {
sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(func_80086B30(dist, vec->y))); sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(func_80086B30(distXZ, vec->y)));
} }
sph.r = sqrtf(SQ(vec->y) + distSquared); sph.r = sqrtf(SQ(vec->y) + distXZSq);
if ((vec->x == 0.0f) && (vec->z == 0.0f)) { if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
sph.yaw = 0; sph.yaw = 0;
} else { } else {
@ -141,7 +141,7 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
/** /**
* Takes the point `vec`, and converts it to a geographic coordinate * Takes the point `vec`, and converts it to a geographic coordinate
*/ */
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) { VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec) {
VecSph sph; VecSph sph;
OLib_Vec3fToVecSph(&sph, vec); OLib_Vec3fToVecSph(&sph, vec);
@ -156,42 +156,42 @@ VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) {
* Takes the differences of positions `a` and `b`, and converts them to spherical coordinates * Takes the differences of positions `a` and `b`, and converts them to spherical coordinates
*/ */
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) { VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) {
Vec3f sph; Vec3f diff;
sph.x = b->x - a->x; diff.x = b->x - a->x;
sph.y = b->y - a->y; diff.y = b->y - a->y;
sph.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecSph(dest, &sph); return OLib_Vec3fToVecSph(dest, &diff);
} }
/** /**
* Takes the difference of positions `a` and `b`, and converts them to geographic coordinates * Takes the difference of positions `a` and `b`, and converts them to geographic coordinates
*/ */
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b) { VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b) {
Vec3f sph; Vec3f diff;
sph.x = b->x - a->x; diff.x = b->x - a->x;
sph.y = b->y - a->y; diff.y = b->y - a->y;
sph.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecSphGeo(dest, &sph); return OLib_Vec3fToVecGeo(dest, &diff);
} }
/** /**
* Takes the sum of positions `a` (x,y,z coordinates) and `sph` (geographic coordinates), result is in x,y,z position * Takes the sum of positions `a` (x,y,z coordinates) and `geo` (geographic coordinates), result is in x,y,z position
* Identical to Quake_AddVec from OoT * Identical to Quake_AddVec from OoT
*/ */
Vec3f* OLib_VecSphAddToVec3f(Vec3f* dest, Vec3f* a, VecSph* sph) { Vec3f* OLib_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f vec; Vec3f sum;
Vec3f b; Vec3f b;
OLib_VecSphGeoToVec3f(&b, sph); OLib_VecGeoToVec3f(&b, geo);
vec.x = a->x + b.x; sum.x = a->x + b.x;
vec.y = a->y + b.y; sum.y = a->y + b.y;
vec.z = a->z + b.z; sum.z = a->z + b.z;
*dest = vec; *dest = sum;
return dest; return dest;
} }
@ -248,46 +248,50 @@ Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) {
} }
/** /**
* Gets a x,y,z position diff depending on the dbCamera mode * Gets a x,y,z position diff depending on the mode
*/ */
void OLib_DbCameraVec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) { void OLib_Vec3fDiff(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecSph sph; VecGeo geo;
switch (mode) { switch (mode) {
case 1: case OLIB_DIFF_OFFSET:
OLib_Vec3fDiffToVecSphGeo(&sph, &a->pos, b); OLib_Vec3fDiffToVecGeo(&geo, &a->pos, b);
sph.yaw -= a->rot.y; geo.yaw -= a->rot.y;
OLib_VecSphGeoToVec3f(dest, &sph); OLib_VecGeoToVec3f(dest, &geo);
break; break;
case 2:
case OLIB_DIFF:
dest->x = b->x - a->pos.x; dest->x = b->x - a->pos.x;
dest->y = b->y - a->pos.y; dest->y = b->y - a->pos.y;
dest->z = b->z - a->pos.z; dest->z = b->z - a->pos.z;
break; break;
default:
default: // OLIB_DIFF_COPY
*dest = *b; *dest = *b;
break; break;
} }
} }
/** /**
* Gets a x,y,z position sum depending on the dbCamera mode * Gets a x,y,z position sum depending on the mode
*/ */
void OLib_DbCameraVec3fSum(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) { void OLib_Vec3fAdd(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode) {
VecSph sph; VecGeo geo;
switch (mode) { switch (mode) {
case 1: case OLIB_ADD_OFFSET:
OLib_Vec3fToVecSphGeo(&sph, b); OLib_Vec3fToVecGeo(&geo, b);
sph.yaw += a->rot.y; geo.yaw += a->rot.y;
OLib_VecSphAddToVec3f(dest, &a->pos, &sph); OLib_AddVecGeoToVec3f(dest, &a->pos, &geo);
break; break;
case 2:
case OLIB_ADD:
dest->x = a->pos.x + b->x; dest->x = a->pos.x + b->x;
dest->y = a->pos.y + b->y; dest->y = a->pos.y + b->y;
dest->z = a->pos.z + b->z; dest->z = a->pos.z + b->z;
break; break;
default:
default: // OLIB_ADD_COPY
*dest = *b; *dest = *b;
break; break;
} }

View File

@ -507,39 +507,39 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
if (!sIsCameraUnderwater) { if (!sIsCameraUnderwater) {
Camera_SetFlags(camera, CAM_STATE_UNDERWATER); Camera_SetFlags(camera, CAM_STATE_UNDERWATER);
sQuakeIndex = -1; sQuakeIndex = -1;
Distortion_SetType(DISTORTION_TYPE_UNDERWATER_ENTRY); Distortion_Request(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_SetCountdown(80); Distortion_SetDuration(80);
} }
func_801A3EC0(0x20); func_801A3EC0(0x20);
func_800F6834(this, lightIndex); func_800F6834(this, lightIndex);
if ((sQuakeIndex == -1) || (Quake_GetCountdown(sQuakeIndex) == 10)) { if ((sQuakeIndex == -1) || (Quake_GetTimeLeft(sQuakeIndex) == 10)) {
s16 quakeIndex = Quake_Add(camera, QUAKE_TYPE_5); s16 quakeIndex = Quake_Request(camera, QUAKE_TYPE_5);
sQuakeIndex = quakeIndex; sQuakeIndex = quakeIndex;
if (quakeIndex != 0) { if (quakeIndex != 0) {
Quake_SetSpeed(sQuakeIndex, 550); Quake_SetSpeed(sQuakeIndex, 550);
Quake_SetQuakeValues(sQuakeIndex, 1, 1, 180, 0); Quake_SetPerturbations(sQuakeIndex, 1, 1, 180, 0);
Quake_SetCountdown(sQuakeIndex, 1000); Quake_SetDuration(sQuakeIndex, 1000);
} }
} }
if (player->stateFlags3 & PLAYER_STATE3_8000) { if (player->stateFlags3 & PLAYER_STATE3_8000) {
Distortion_SetType(DISTORTION_TYPE_ZORA_SWIMMING); Distortion_Request(DISTORTION_TYPE_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_NON_ZORA_SWIMMING); Distortion_RemoveRequest(DISTORTION_TYPE_NON_ZORA_SWIMMING);
} else { } else {
Distortion_SetType(DISTORTION_TYPE_NON_ZORA_SWIMMING); Distortion_Request(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_ZORA_SWIMMING); Distortion_RemoveRequest(DISTORTION_TYPE_ZORA_SWIMMING);
} }
} else { } else {
if (sIsCameraUnderwater) { if (sIsCameraUnderwater) {
Camera_ClearFlags(camera, CAM_STATE_UNDERWATER); Camera_ClearFlags(camera, CAM_STATE_UNDERWATER);
} }
Distortion_ClearType(DISTORTION_TYPE_NON_ZORA_SWIMMING); Distortion_RemoveRequest(DISTORTION_TYPE_NON_ZORA_SWIMMING);
Distortion_ClearType(DISTORTION_TYPE_UNDERWATER_ENTRY); Distortion_RemoveRequest(DISTORTION_TYPE_UNDERWATER_ENTRY);
Distortion_ClearType(DISTORTION_TYPE_ZORA_SWIMMING); Distortion_RemoveRequest(DISTORTION_TYPE_ZORA_SWIMMING);
if (sQuakeIndex != 0) { if (sQuakeIndex != 0) {
Quake_Remove(sQuakeIndex); Quake_RemoveRequest(sQuakeIndex);
} }
func_800F694C(this); func_800F694C(this);
func_801A3EC0(0); func_801A3EC0(0);

View File

@ -3,35 +3,28 @@
#include "z64view.h" #include "z64view.h"
typedef struct { typedef struct {
/* 0x00 */ s16 randIndex; /* 0x00 */ s16 index;
/* 0x02 */ s16 countdownMax; /* 0x02 */ s16 duration;
/* 0x04 */ Camera* camera; /* 0x04 */ Camera* camera;
/* 0x08 */ u32 type; /* 0x08 */ u32 type;
/* 0x0C */ s16 verticalMag; /* 0x0C */ s16 y;
/* 0x0E */ s16 horizontalMag; /* 0x0E */ s16 x;
/* 0x10 */ s16 zoom; /* 0x10 */ s16 fov;
/* 0x12 */ s16 rollOffset; /* 0x12 */ s16 upRollOffset;
/* 0x14 */ Vec3s shakePlaneOffset; // angle deviations from shaking in the perpendicular plane /* 0x14 */ Vec3s orientation; // alters the orientation of the xy perturbation. Only x (pitch) and y (yaw) are used
/* 0x1A */ s16 speed; /* 0x1A */ s16 speed;
/* 0x1C */ s16 isShakePerpendicular; /* 0x1C */ s16 isRelativeToScreen; // is the quake relative to the screen or on world coordinates
/* 0x1E */ s16 countdown; /* 0x1E */ s16 timer;
/* 0x20 */ s16 camId; /* 0x20 */ s16 camId;
} QuakeRequest; // size = 0x24 } QuakeRequest; // size = 0x24
typedef struct { typedef struct {
/* 0x0 */ PlayState* play; /* 0x0 */ PlayState* play;
/* 0x4 */ s32 type; // bitfield, highest set bit determines type /* 0x4 */ s32 type; // bitfield, highest set bit determines type
/* 0x8 */ s16 countdown; /* 0x8 */ s16 timer;
/* 0xA */ s16 state; /* 0xA */ s16 state;
} DistortionRequest; // size = 0xC } DistortionRequest; // size = 0xC
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rollOffset;
/* 0x1A */ s16 zoom;
} ShakeInfo; // size = 0x1C
typedef s16 (*QuakeCallbackFunc)(QuakeRequest*, ShakeInfo*); typedef s16 (*QuakeCallbackFunc)(QuakeRequest*, ShakeInfo*);
typedef enum { typedef enum {
@ -40,218 +33,241 @@ typedef enum {
/* 2 */ DISTORTION_SETUP /* 2 */ DISTORTION_SETUP
} DistortionState; } DistortionState;
QuakeRequest sQuakeRequest[4]; QuakeRequest sQuakeRequests[4];
DistortionRequest sDistortionRequest; DistortionRequest sDistortionRequest;
static s16 sIsQuakeInitialized = true; static s16 sQuakeUnused = 1;
static s16 sQuakeRequestCount = 0; static s16 sQuakeRequestCount = 0;
f32 Quake_Random(void) { f32 Quake_Random(void) {
return 2.0f * (Rand_ZeroOne() - 0.5f); return 2.0f * (Rand_ZeroOne() - 0.5f);
} }
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 verticalPertubation, f32 horizontalPertubation) { void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 yOffset, f32 xOffset) {
Vec3f* at = &req->camera->at; Vec3f* at = &req->camera->at;
Vec3f* eye = &req->camera->eye; Vec3f* eye = &req->camera->eye;
Vec3f atEyeOffset; Vec3f atEyeOffset;
VecSph atEyeOffsetSph2; VecSph geo;
VecSph eyeAtAngle; VecSph eyeToAtGeo;
// isShakePerpendicular is always set to 1 before reaching this conditional if (req->isRelativeToScreen) {
// alternative is an unused fixed vertical shake
if (req->isShakePerpendicular) {
atEyeOffset.x = 0; atEyeOffset.x = 0;
atEyeOffset.y = 0; atEyeOffset.y = 0;
atEyeOffset.z = 0; atEyeOffset.z = 0;
OLib_Vec3fDiffToVecSphGeo(&eyeAtAngle, eye, at); OLib_Vec3fDiffToVecGeo(&eyeToAtGeo, eye, at);
atEyeOffsetSph2.r = req->verticalMag * verticalPertubation; // y shake
atEyeOffsetSph2.pitch = eyeAtAngle.pitch + req->shakePlaneOffset.x + 0x4000; geo.r = req->y * yOffset;
atEyeOffsetSph2.yaw = eyeAtAngle.yaw + req->shakePlaneOffset.y; // point unit vector up, then add on `req->orientation`
OLib_VecSphAddToVec3f(&atEyeOffset, &atEyeOffset, &atEyeOffsetSph2); geo.pitch = eyeToAtGeo.pitch + req->orientation.x + 0x4000;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y;
// apply y shake
OLib_AddVecGeoToVec3f(&atEyeOffset, &atEyeOffset, &geo);
atEyeOffsetSph2.r = req->horizontalMag * horizontalPertubation; // x shake
atEyeOffsetSph2.pitch = eyeAtAngle.pitch + req->shakePlaneOffset.x; geo.r = req->x * xOffset;
atEyeOffsetSph2.yaw = eyeAtAngle.yaw + req->shakePlaneOffset.y + 0x4000; // point unit vector left, then add on `req->orientation`
OLib_VecSphAddToVec3f(&atEyeOffset, &atEyeOffset, &atEyeOffsetSph2); geo.pitch = eyeToAtGeo.pitch + req->orientation.x;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y + 0x4000;
// apply x shake
OLib_AddVecGeoToVec3f(&atEyeOffset, &atEyeOffset, &geo);
} else { } else {
atEyeOffset.x = 0; atEyeOffset.x = 0;
atEyeOffset.y = req->verticalMag * verticalPertubation; atEyeOffset.y = req->y * yOffset;
atEyeOffset.z = 0; atEyeOffset.z = 0;
atEyeOffsetSph2.r = req->horizontalMag * horizontalPertubation; geo.r = req->x * xOffset;
atEyeOffsetSph2.pitch = req->shakePlaneOffset.x; geo.pitch = req->orientation.x;
atEyeOffsetSph2.yaw = req->shakePlaneOffset.y; geo.yaw = req->orientation.y;
OLib_VecSphAddToVec3f(&atEyeOffset, &atEyeOffset, &atEyeOffsetSph2); OLib_AddVecGeoToVec3f(&atEyeOffset, &atEyeOffset, &geo);
} }
shake->atOffset = shake->eyeOffset = atEyeOffset; shake->atOffset = shake->eyeOffset = atEyeOffset;
shake->rollOffset = req->rollOffset * verticalPertubation; shake->upRollOffset = req->upRollOffset * yOffset;
shake->zoom = req->zoom * verticalPertubation; shake->fovOffset = req->fov * yOffset;
} }
s16 Quake_CallbackType1(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType1(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 perpendicularPertubation = Math_SinS(req->speed * req->countdown); f32 xyOffset = Math_SinS(req->speed * req->timer);
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, Rand_ZeroOne() * perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_CallbackType5(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType5(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 perpendicularPertubation = Math_SinS(req->speed * req->countdown); f32 xyOffset = Math_SinS(req->speed * req->timer);
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_CallbackType6(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType6(QuakeRequest* req, ShakeInfo* shake) {
f32 perpendicularPertubation; f32 xyOffset;
req->countdown--; req->timer--;
perpendicularPertubation = Math_SinS(req->speed * ((req->countdown & 0xF) + 500)); xyOffset = Math_SinS(req->speed * ((req->timer & 0xF) + 500));
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, Rand_ZeroOne() * perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
// Not returning the timer ensures quake type 6 continues indefinitely until manually removed
return 1; return 1;
} }
s16 Quake_CallbackType3(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType3(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 perpendicularPertubation = f32 xyOffset = Math_SinS(req->speed * req->timer) * ((f32)req->timer / req->duration);
Math_SinS(req->speed * req->countdown) * ((f32)req->countdown / (f32)req->countdownMax);
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_CallbackType2(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType2(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 perpendicularPertubation = Quake_Random(); f32 xyOffset = Quake_Random();
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, Rand_ZeroOne() * perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_CallbackType4(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType4(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 perpendicularPertubation = Quake_Random() * ((f32)req->countdown / (f32)req->countdownMax); f32 xyOffset = Quake_Random() * ((f32)req->timer / req->duration);
Quake_UpdateShakeInfo(req, shake, perpendicularPertubation, Rand_ZeroOne() * perpendicularPertubation); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_GetFreeIndex(void) { s16 Quake_GetFreeIndex(void) {
s32 i; s32 i;
s32 ret = 0; s32 index = 0;
s32 min = 0x10000; s32 timerMin = UINT16_MAX + 1; // timer is a short, so start with a value beyond its range
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) { for (i = 0; i < ARRAY_COUNT(sQuakeRequests); i++) {
if (sQuakeRequest[i].type == 0) { if (sQuakeRequests[i].type == QUAKE_TYPE_NONE) {
ret = i; index = i;
break; break;
} }
if (sQuakeRequest[i].countdown < min) { if (timerMin > sQuakeRequests[i].timer) {
min = sQuakeRequest[i].countdown; timerMin = sQuakeRequests[i].timer;
ret = i; index = i;
} }
} }
return ret; return index;
} }
QuakeRequest* Quake_AddImpl(Camera* camera, u32 type) { QuakeRequest* Quake_RequestImpl(Camera* camera, u32 type) {
s16 index = Quake_GetFreeIndex(); s16 index = Quake_GetFreeIndex();
QuakeRequest* req = &sQuakeRequest[index]; QuakeRequest* req = &sQuakeRequests[index];
__osMemset(req, 0, sizeof(QuakeRequest)); __osMemset(req, 0, sizeof(QuakeRequest));
req->camera = camera; req->camera = camera;
req->camId = camera->camId; req->camId = camera->camId;
req->type = type; req->type = type;
req->isShakePerpendicular = true; req->isRelativeToScreen = true;
req->randIndex = ((s16)(Rand_ZeroOne() * 0x10000) & ~3) + index;
// Add a unique random identifier to the upper bits of the index
// The `~3` assumes there are only 4 requests
req->index = index + ((s16)(Rand_ZeroOne() * 0x10000) & ~3);
sQuakeRequestCount++; sQuakeRequestCount++;
return req; return req;
} }
void Quake_RemoveRequest(QuakeRequest* req) { void Quake_Remove(QuakeRequest* req) {
req->type = 0; req->type = QUAKE_TYPE_NONE;
req->countdown = -1; req->timer = -1;
sQuakeRequestCount--; sQuakeRequestCount--;
} }
QuakeRequest* Quake_GetRequest(s16 quakeIndex) { QuakeRequest* Quake_GetRequest(s16 index) {
QuakeRequest* req = &sQuakeRequest[quakeIndex & 3]; QuakeRequest* req = &sQuakeRequests[index & 3];
if (req->type == 0) { if (req->type == QUAKE_TYPE_NONE) {
return NULL; return NULL;
} }
if (quakeIndex != req->randIndex) { if (index != req->index) {
return NULL; return NULL;
} }
return req; return req;
} }
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value) { // valueType for Quake_SetValue()
QuakeRequest* req = Quake_GetRequest(quakeIndex); #define QUAKE_SPEED (1 << 0)
#define QUAKE_Y_OFFSET (1 << 1)
#define QUAKE_X_OFFSET (1 << 2)
#define QUAKE_FOV (1 << 3)
#define QUAKE_ROLL (1 << 4)
#define QUAKE_ORIENTATION_PITCH (1 << 5)
#define QUAKE_ORIENTATION_YAW (1 << 6)
#define QUAKE_ORIENTATION_ROLL (1 << 7)
#define QUAKE_DURATION (1 << 8)
#define QUAKE_IS_RELATIVE_TO_SCREEN (1 << 9)
u32 Quake_SetValue(s16 index, s16 valueType, s16 value) {
QuakeRequest* req = Quake_GetRequest(index);
if (req == NULL) { if (req == NULL) {
return false; return false;
} else { }
switch (valueType) { switch (valueType) {
case QUAKE_SPEED: case QUAKE_SPEED:
req->speed = value; req->speed = value;
break; break;
case QUAKE_VERTICAL_MAG: case QUAKE_Y_OFFSET:
req->verticalMag = value; req->y = value;
break; break;
case QUAKE_HORIZONTAL_MAG: case QUAKE_X_OFFSET:
req->horizontalMag = value; req->x = value;
break; break;
case QUAKE_ZOOM: case QUAKE_FOV:
req->zoom = value; req->fov = value;
break; break;
case QUAKE_ROLL_OFFSET: case QUAKE_ROLL:
req->rollOffset = value; req->upRollOffset = value;
break; break;
case QUAKE_SHAKE_PLANE_OFFSET_X: case QUAKE_ORIENTATION_PITCH:
req->shakePlaneOffset.x = value; req->orientation.x = value;
break; break;
case QUAKE_SHAKE_PLANE_OFFSET_Y: case QUAKE_ORIENTATION_YAW:
req->shakePlaneOffset.y = value; req->orientation.y = value;
break; break;
case QUAKE_SHAKE_PLANE_OFFSET_Z: case QUAKE_ORIENTATION_ROLL:
req->shakePlaneOffset.z = value; req->orientation.z = value;
break; break;
case QUAKE_COUNTDOWN: case QUAKE_DURATION:
req->countdown = value; req->timer = value;
req->countdownMax = req->countdown; req->duration = req->timer;
break; break;
case QUAKE_IS_SHAKE_PERPENDICULAR: case QUAKE_IS_RELATIVE_TO_SCREEN:
req->isShakePerpendicular = value; req->isRelativeToScreen = value;
break; break;
default: default:
@ -260,10 +276,14 @@ u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value) {
return true; return true;
} }
}
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed) { /**
QuakeRequest* req = Quake_GetRequest(quakeIndex); * @param index
* @param speed for periodic types only, the angular frequency of the sine wave (binang / frame)
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetSpeed(s16 index, s16 speed) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->speed = speed; req->speed = speed;
@ -272,45 +292,67 @@ u32 Quake_SetSpeed(s16 quakeIndex, s16 speed) {
return false; return false;
} }
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown) { /**
QuakeRequest* req = Quake_GetRequest(quakeIndex); * @param index quake request index to apply
* @param duration number of frames to apply the quake
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetDuration(s16 index, s16 duration) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->countdown = countdown; req->duration = req->timer = duration;
req->countdownMax = req->countdown;
return true; return true;
} }
return false; return false;
} }
s16 Quake_GetCountdown(s16 quakeIndex) { /**
QuakeRequest* req = Quake_GetRequest(quakeIndex); * @param index quake request index to get
* @return number of frames until the quake is finished
*/
s16 Quake_GetTimeLeft(s16 index) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
return req->countdown; return req->timer;
} }
return 0; return 0;
} }
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset) { /**
QuakeRequest* req = Quake_GetRequest(quakeIndex); * @param index quake request index to apply
* @param y apply up/down shake
* @param x apply left/right shake
* @param fov apply zooming in/out shake (binang)
* @param roll apply rolling shake (binang)
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->verticalMag = verticalMag; req->y = y;
req->horizontalMag = horizontalMag; req->x = x;
req->zoom = zoom; req->fov = fov;
req->rollOffset = rollOffset; req->upRollOffset = roll;
return true; return true;
} }
return false; return false;
} }
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset) { /**
QuakeRequest* req = Quake_GetRequest(quakeIndex); * @param index quake request index to apply
* @param isRelativeToScreen is the quake applied relative to the screen or in absolute world coordinates
* @param orientation orient the x/y shake to a different direction
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetOrientation(s16 index, s16 isRelativeToScreen, Vec3s orientation) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->isShakePerpendicular = isShakePerpendicular; req->isRelativeToScreen = isRelativeToScreen;
req->shakePlaneOffset = shakePlaneOffset; req->orientation = orientation;
return true; return true;
} }
return false; return false;
@ -319,156 +361,167 @@ u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakeP
void Quake_Init(void) { void Quake_Init(void) {
s16 i; s16 i;
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) { for (i = 0; i < ARRAY_COUNT(sQuakeRequests); i++) {
sQuakeRequest[i].type = 0; sQuakeRequests[i].type = QUAKE_TYPE_NONE;
sQuakeRequest[i].countdown = 0; sQuakeRequests[i].timer = 0;
} }
sIsQuakeInitialized = true; sQuakeUnused = 1;
sQuakeRequestCount = 0; sQuakeRequestCount = 0;
} }
s16 Quake_Add(Camera* camera, u32 type) { s16 Quake_Request(Camera* camera, u32 type) {
return Quake_AddImpl(camera, type)->randIndex; return Quake_RequestImpl(camera, type)->index;
} }
u32 Quake_Remove(s16 index) { u32 Quake_RemoveRequest(s16 index) {
QuakeRequest* req = Quake_GetRequest(index); QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
Quake_RemoveRequest(req); Quake_Remove(req);
return true; return true;
} }
return false; return false;
} }
static QuakeCallbackFunc sQuakeCallbacks[] = { static QuakeCallbackFunc sQuakeCallbacks[] = {
NULL, NULL, // QUAKE_TYPE_NONE
Quake_CallbackType1, Quake_CallbackType1, // QUAKE_TYPE_1
Quake_CallbackType2, Quake_CallbackType2, // QUAKE_TYPE_2
Quake_CallbackType3, Quake_CallbackType3, // QUAKE_TYPE_3
Quake_CallbackType4, Quake_CallbackType4, // QUAKE_TYPE_4
Quake_CallbackType5, Quake_CallbackType5, // QUAKE_TYPE_5
Quake_CallbackType6, Quake_CallbackType6, // QUAKE_TYPE_6
}; };
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) { s16 Quake_Update(Camera* camera, ShakeInfo* camShake) {
s32 pad;
QuakeRequest* req;
ShakeInfo shake;
f32 absSpeedDiv; f32 absSpeedDiv;
ShakeInfo shake;
QuakeRequest* req;
f32 maxCurr; f32 maxCurr;
f32 maxNext; f32 maxNext;
s32 index; s32 index;
s32 ret; s32 numQuakesApplied;
u32 eq; u32 isDifferentCamId;
Vec3f originVec; Vec3f zeroVec;
PlayState* play = camera->play; PlayState* play = camera->play;
originVec.x = 0.0f; zeroVec.x = 0.0f;
originVec.y = 0.0f; zeroVec.y = 0.0f;
originVec.z = 0.0f; zeroVec.z = 0.0f;
camData->atOffset.x = 0.0f;
camData->atOffset.y = 0.0f; camShake->atOffset.x = 0.0f;
camData->atOffset.z = 0.0f; camShake->atOffset.y = 0.0f;
camData->eyeOffset.x = 0.0f; camShake->atOffset.z = 0.0f;
camData->eyeOffset.y = 0.0f;
camData->eyeOffset.z = 0.0f; camShake->eyeOffset.x = 0.0f;
camData->rollOffset = 0; camShake->eyeOffset.y = 0.0f;
camData->zoom = 0; camShake->eyeOffset.z = 0.0f;
camData->max = 0.0f;
camShake->upRollOffset = 0;
camShake->fovOffset = 0;
camShake->maxOffset = 0.0f;
if (sQuakeRequestCount == 0) { if (sQuakeRequestCount == 0) {
return 0; return 0;
} }
ret = 0; numQuakesApplied = 0;
for (index = 0; index < ARRAY_COUNT(sQuakeRequest); index++) { for (index = 0; index < ARRAY_COUNT(sQuakeRequests); index++) {
req = &sQuakeRequest[index]; req = &sQuakeRequests[index];
if (req->type != 0) { if (req->type == QUAKE_TYPE_NONE) {
continue;
}
if (play->cameraPtrs[req->camId] == NULL) { if (play->cameraPtrs[req->camId] == NULL) {
Quake_RemoveRequest(req); Quake_Remove(req);
} else { continue;
eq = (camera->camId != req->camera->camId); }
absSpeedDiv = ABS(req->speed) / (f32)0x8000;
isDifferentCamId = (camera->camId != req->camera->camId);
absSpeedDiv = (f32)ABS(req->speed) / 0x8000;
if (sQuakeCallbacks[req->type](req, &shake) == 0) { if (sQuakeCallbacks[req->type](req, &shake) == 0) {
Quake_RemoveRequest(req); // Quake has reached the end of its timer.
} else if (eq == 0) { Quake_Remove(req);
if (fabsf(camData->atOffset.x) < fabsf(shake.atOffset.x)) { continue;
camData->atOffset.x = shake.atOffset.x;
}
if (fabsf(camData->atOffset.y) < fabsf(shake.atOffset.y)) {
camData->atOffset.y = shake.atOffset.y;
}
if (fabsf(camData->atOffset.z) < fabsf(shake.atOffset.z)) {
camData->atOffset.z = shake.atOffset.z;
}
if (fabsf(camData->eyeOffset.x) < fabsf(shake.eyeOffset.x)) {
camData->eyeOffset.x = shake.eyeOffset.x;
}
if (fabsf(camData->eyeOffset.y) < fabsf(shake.eyeOffset.y)) {
camData->eyeOffset.y = shake.eyeOffset.y;
}
if (fabsf(camData->eyeOffset.z) < fabsf(shake.eyeOffset.z)) {
camData->eyeOffset.z = shake.eyeOffset.z;
}
if (camData->rollOffset < shake.rollOffset) {
camData->rollOffset = shake.rollOffset;
}
if (camData->zoom < shake.zoom) {
camData->zoom = shake.zoom;
} }
maxCurr = OLib_Vec3fDist(&shake.atOffset, &originVec) * absSpeedDiv; if (isDifferentCamId) {
// Quake is attached to a different camId
continue;
}
maxNext = OLib_Vec3fDist(&shake.eyeOffset, &originVec) * absSpeedDiv; if (fabsf(camShake->atOffset.x) < fabsf(shake.atOffset.x)) {
camShake->atOffset.x = shake.atOffset.x;
}
if (fabsf(camShake->atOffset.y) < fabsf(shake.atOffset.y)) {
camShake->atOffset.y = shake.atOffset.y;
}
if (fabsf(camShake->atOffset.z) < fabsf(shake.atOffset.z)) {
camShake->atOffset.z = shake.atOffset.z;
}
if (fabsf(camShake->eyeOffset.x) < fabsf(shake.eyeOffset.x)) {
camShake->eyeOffset.x = shake.eyeOffset.x;
}
if (fabsf(camShake->eyeOffset.y) < fabsf(shake.eyeOffset.y)) {
camShake->eyeOffset.y = shake.eyeOffset.y;
}
if (fabsf(camShake->eyeOffset.z) < fabsf(shake.eyeOffset.z)) {
camShake->eyeOffset.z = shake.eyeOffset.z;
}
if (camShake->upRollOffset < shake.upRollOffset) {
camShake->upRollOffset = shake.upRollOffset;
}
if (camShake->fovOffset < shake.fovOffset) {
camShake->fovOffset = shake.fovOffset;
}
maxCurr = OLib_Vec3fDist(&shake.atOffset, &zeroVec) * absSpeedDiv;
maxNext = OLib_Vec3fDist(&shake.eyeOffset, &zeroVec) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext); maxCurr = CLAMP_MIN(maxCurr, maxNext);
maxNext = (camData->rollOffset * (7.0f / 2500.0f)) * absSpeedDiv; maxNext = (camShake->upRollOffset * (7.0f / 2500.0f)) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext); maxCurr = CLAMP_MIN(maxCurr, maxNext);
maxNext = (camData->zoom * (7.0f / 2500.0f)) * absSpeedDiv; maxNext = (camShake->fovOffset * (7.0f / 2500.0f)) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext); maxCurr = CLAMP_MIN(maxCurr, maxNext);
if (camData->max < maxCurr) { if (camShake->maxOffset < maxCurr) {
camData->max = maxCurr; camShake->maxOffset = maxCurr;
} }
ret++; numQuakesApplied++;
} }
} return numQuakesApplied;
}
}
return ret;
} }
void Distortion_Init(PlayState* play) { void Distortion_Init(PlayState* play) {
sDistortionRequest.play = play; sDistortionRequest.play = play;
View_ClearDistortion(&play->view); View_ClearDistortion(&play->view);
sDistortionRequest.type = 0; sDistortionRequest.type = 0;
sDistortionRequest.countdown = 0; sDistortionRequest.timer = 0;
sDistortionRequest.state = DISTORTION_INACTIVE; sDistortionRequest.state = DISTORTION_INACTIVE;
} }
void Distortion_SetCountdown(s16 countdown) { void Distortion_SetDuration(s16 duration) {
sDistortionRequest.countdown = countdown; sDistortionRequest.timer = duration;
sDistortionRequest.state = DISTORTION_SETUP; sDistortionRequest.state = DISTORTION_SETUP;
} }
s16 Distortion_GetCountdown(void) { s16 Distortion_GetTimeLeft(void) {
return sDistortionRequest.countdown; return sDistortionRequest.timer;
} }
s16 Distortion_GetType(void) { s16 Distortion_GetType(void) {
return sDistortionRequest.type; return sDistortionRequest.type;
} }
void Distortion_SetType(s32 type) { void Distortion_Request(s32 type) {
if (sDistortionRequest.type < type) { if (sDistortionRequest.type < type) {
sDistortionRequest.type = type; sDistortionRequest.type = type;
} }
} }
void Distortion_ClearType(s32 type) { void Distortion_RemoveRequest(s32 type) {
if (sDistortionRequest.type == type) { if (sDistortionRequest.type == type) {
sDistortionRequest.type = 0; sDistortionRequest.type = 0;
} }
@ -489,7 +542,7 @@ ConveyorSpeed Distortion_GetUnderwaterCurrentSpeed(Player* player) {
void Distortion_Update(void) { void Distortion_Update(void) {
static s16 depthPhase = 0x3F0; static s16 depthPhase = 0x3F0;
static s16 screenPlanePhase = 0x156; static s16 screenPlanePhase = 0x156;
static s16 countdownMax = 1; static s16 duration = 1;
f32 xyScaleFactor; f32 xyScaleFactor;
f32 zScaleFactor; f32 zScaleFactor;
f32 speedScaleFactor; f32 speedScaleFactor;
@ -511,8 +564,8 @@ void Distortion_Update(void) {
f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f); f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f);
if (sDistortionRequest.type != 0) { if (sDistortionRequest.type != 0) {
if (sDistortionRequest.type & DISTORTION_TYPE_B) { if (sDistortionRequest.type & DISTORTION_TYPE_MASK_TRANSFORM_2) {
sDistortionRequest.countdown = 2; sDistortionRequest.timer = 2;
depthPhase = 0x3F0; depthPhase = 0x3F0;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
@ -528,17 +581,17 @@ void Distortion_Update(void) {
zScale = 0.0f; zScale = 0.0f;
speed = 0.6f; speed = 0.6f;
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / 60.0f; xyScaleFactor = zScaleFactor = sDistortionRequest.timer / 60.0f;
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_A) { } else if (sDistortionRequest.type & DISTORTION_TYPE_BOSS_WARP) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x3F0; depthPhase = 0x3F0;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
} }
depthPhaseStep = 0.0f; depthPhaseStep = 0.0f;
screenPlanePhaseStep = 50.0f / countdownMax; screenPlanePhaseStep = 50.0f / duration;
rotX = 0.0f; rotX = 0.0f;
rotY = 0.0f; rotY = 0.0f;
@ -549,11 +602,11 @@ void Distortion_Update(void) {
zScale = 0.0f; zScale = 0.0f;
speed = 0.4f; speed = 0.4f;
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax; xyScaleFactor = zScaleFactor = ((f32)duration - sDistortionRequest.timer) / (f32)duration;
speedScaleFactor = 0.5f; speedScaleFactor = 0.5f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_9) { } else if (sDistortionRequest.type & DISTORTION_TYPE_MASK_TRANSFORM_1) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x1FC; depthPhase = 0x1FC;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
} }
@ -570,11 +623,11 @@ void Distortion_Update(void) {
zScale = 0.0f; zScale = 0.0f;
speed = 0.1f; speed = 0.1f;
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax; xyScaleFactor = zScaleFactor = ((f32)duration - sDistortionRequest.timer) / (f32)duration;
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_8) { } else if (sDistortionRequest.type & DISTORTION_TYPE_GORON_BUTT) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x2710; depthPhase = 0x2710;
screenPlanePhase = 0x3E8; screenPlanePhase = 0x3E8;
} }
@ -591,15 +644,15 @@ void Distortion_Update(void) {
zScale = 0.01f; zScale = 0.01f;
speed = 1.5f; speed = 1.5f;
if (sDistortionRequest.countdown < 5) { if (sDistortionRequest.timer < 5) {
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax; xyScaleFactor = zScaleFactor = ((f32)duration - sDistortionRequest.timer) / (f32)duration;
} else { } else {
xyScaleFactor = zScaleFactor = 0.0f; xyScaleFactor = zScaleFactor = 0.0f;
} }
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_7) { } else if (sDistortionRequest.type & DISTORTION_TYPE_UNK_ATTACK) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x4B0; depthPhase = 0x4B0;
screenPlanePhase = 0x7D0; screenPlanePhase = 0x7D0;
} }
@ -616,11 +669,11 @@ void Distortion_Update(void) {
zScale = 0.01f; zScale = 0.01f;
speed = 1.5f; speed = 1.5f;
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / (f32)countdownMax; xyScaleFactor = zScaleFactor = sDistortionRequest.timer / (f32)duration;
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_6) { } else if (sDistortionRequest.type & DISTORTION_TYPE_ZORA_KICK) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x9C4; depthPhase = 0x9C4;
screenPlanePhase = 0xBB8; screenPlanePhase = 0xBB8;
} }
@ -637,14 +690,14 @@ void Distortion_Update(void) {
zScale = 0.01f; zScale = 0.01f;
speed = 1.3f; speed = 1.3f;
if (sDistortionRequest.countdown < 4) { if (sDistortionRequest.timer < 4) {
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / (f32)countdownMax; xyScaleFactor = zScaleFactor = sDistortionRequest.timer / (f32)duration;
} else { } else {
xyScaleFactor = zScaleFactor = 0.0f; xyScaleFactor = zScaleFactor = 0.0f;
} }
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_5) { } else if (sDistortionRequest.type & DISTORTION_TYPE_SONG_OF_TIME) {
sDistortionRequest.countdown = 2; sDistortionRequest.timer = 2;
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
depthPhase = 0x9C4; depthPhase = 0x9C4;
screenPlanePhase = 0xBB8; screenPlanePhase = 0xBB8;
@ -670,7 +723,7 @@ void Distortion_Update(void) {
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_UNDERWATER_ENTRY) { } else if (sDistortionRequest.type & DISTORTION_TYPE_UNDERWATER_ENTRY) {
if (sDistortionRequest.state == DISTORTION_SETUP) { if (sDistortionRequest.state == DISTORTION_SETUP) {
countdownMax = sDistortionRequest.countdown; duration = sDistortionRequest.timer;
depthPhase = 0x760; depthPhase = 0x760;
screenPlanePhase = 0x1BC; screenPlanePhase = 0x1BC;
} }
@ -687,14 +740,14 @@ void Distortion_Update(void) {
zScale = 0.2f; zScale = 0.2f;
speed = 0.25f; speed = 0.25f;
countdownRatio = sDistortionRequest.countdown / (f32)countdownMax; countdownRatio = sDistortionRequest.timer / (f32)duration;
zScaleFactor = xyScaleFactor = countdownRatio; zScaleFactor = xyScaleFactor = countdownRatio;
speedScaleFactor = 1.0f; speedScaleFactor = 1.0f;
} else if (sDistortionRequest.type & DISTORTION_TYPE_ZORA_SWIMMING) { } else if (sDistortionRequest.type & DISTORTION_TYPE_ZORA_SWIMMING) {
depthPhase = 0x3F0; depthPhase = 0x3F0;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
sDistortionRequest.countdown = 2; sDistortionRequest.timer = 2;
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (player != NULL) { if (player != NULL) {
@ -749,7 +802,7 @@ void Distortion_Update(void) {
depthPhase = 0x3F0; depthPhase = 0x3F0;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
sDistortionRequest.countdown = 2; sDistortionRequest.timer = 2;
player = GET_PLAYER(play); player = GET_PLAYER(play);
depthPhaseStep = 359.2f; depthPhaseStep = 359.2f;
@ -796,12 +849,12 @@ void Distortion_Update(void) {
xyScaleFactor = speedScaleFactor = (waterYScaleFactor * 0.15f) + 0.35f + (speedRatio * 0.4f); xyScaleFactor = speedScaleFactor = (waterYScaleFactor * 0.15f) + 0.35f + (speedRatio * 0.4f);
zScaleFactor = 0.9f - xyScaleFactor; zScaleFactor = 0.9f - xyScaleFactor;
} else if (sDistortionRequest.type & DISTORTION_TYPE_0) { } else if (sDistortionRequest.type & DISTORTION_TYPE_HOT_ROOM) {
// Gives a small mirage-like appearance // Gives a small mirage-like appearance
depthPhase = 0x3F0; depthPhase = 0x3F0;
screenPlanePhase = 0x156; screenPlanePhase = 0x156;
sDistortionRequest.countdown = 2; sDistortionRequest.timer = 2;
depthPhaseStep = 0.0f; depthPhaseStep = 0.0f;
screenPlanePhaseStep = 150.0f; screenPlanePhaseStep = 150.0f;
@ -840,32 +893,25 @@ void Distortion_Update(void) {
View_ClearDistortion(&play->view); View_ClearDistortion(&play->view);
sDistortionRequest.state = DISTORTION_INACTIVE; sDistortionRequest.state = DISTORTION_INACTIVE;
sDistortionRequest.countdown = 0; sDistortionRequest.timer = 0;
} }
if (sDistortionRequest.countdown != 0) { if (sDistortionRequest.timer != 0) {
sDistortionRequest.countdown--; sDistortionRequest.timer--;
if (sDistortionRequest.countdown == 0) { if (sDistortionRequest.timer == 0) {
sDistortionRequest.type = 0; sDistortionRequest.type = 0;
} }
} }
} }
s32 Quake_NumActiveQuakes(void) { s32 Quake_GetNumActiveQuakes(void) {
QuakeRequest* req = sQuakeRequest;
s32 numActiveQuakes = 0; s32 numActiveQuakes = 0;
s32 i;
if (req[0].type != 0) { for (i = 0; i < ARRAY_COUNT(sQuakeRequests); i++) {
if (sQuakeRequests[i].type != QUAKE_TYPE_NONE) {
numActiveQuakes++; numActiveQuakes++;
} }
if (req[1].type != 0) {
numActiveQuakes++;
}
if (req[2].type != 0) {
numActiveQuakes++;
}
if (req[3].type != 0) {
numActiveQuakes++;
} }
return numActiveQuakes; return numActiveQuakes;

View File

@ -522,10 +522,10 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z; sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z;
Rumble_Request(Math3D_Vec3fDistSq(&sp44, &GET_PLAYER(play)->actor.world.pos), 255, 20, 150); Rumble_Request(Math3D_Vec3fDistSq(&sp44, &GET_PLAYER(play)->actor.world.pos), 255, 20, 150);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12); Quake_SetDuration(quakeIndex, 12);
if (this->unk_179 <= 0) { if (this->unk_179 <= 0) {
func_8019F128(NA_SE_EV_STONEDOOR_STOP); func_8019F128(NA_SE_EV_STONEDOOR_STOP);
@ -537,7 +537,7 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
} }
} }
void func_80A9C18C(BgHakuginPost* this, PlayState* play) { void BgHakuginPost_RequestQuakeAndRumble(BgHakuginPost* this, PlayState* play) {
s32 pad; s32 pad;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Camera* activeCam = GET_ACTIVE_CAM(play); Camera* activeCam = GET_ACTIVE_CAM(play);
@ -547,10 +547,10 @@ void func_80A9C18C(BgHakuginPost* this, PlayState* play) {
this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.z), this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.z),
255, 20, 150); 255, 20, 150);
quakeIndex = Quake_Add(activeCam, QUAKE_TYPE_3); quakeIndex = Quake_Request(activeCam, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 17232); Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, 6, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 6, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetDuration(quakeIndex, 20);
} }
void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) { void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) {
@ -798,7 +798,7 @@ void func_80A9CD14(BgHakuginPost* this, PlayState* play) {
temp_f12 = CLAMP_MAX(temp_f12, 40.0f); temp_f12 = CLAMP_MAX(temp_f12, 40.0f);
this->unk_16C += temp_f12; this->unk_16C += temp_f12;
if (this->unk_168 <= this->unk_16C) { if (this->unk_168 <= this->unk_16C) {
func_80A9C18C(this, play); BgHakuginPost_RequestQuakeAndRumble(this, play);
func_8019F128(NA_SE_EV_STONEDOOR_STOP); func_8019F128(NA_SE_EV_STONEDOOR_STOP);
func_80A9CE00(this); func_80A9CE00(this);
} else { } else {
@ -876,7 +876,7 @@ void func_80A9D0B4(BgHakuginPost* this, PlayState* play) {
func_80A9C634(this, play); func_80A9C634(this, play);
func_80A9B160(&D_80A9E028, play); func_80A9B160(&D_80A9E028, play);
this->unk_16C = this->unk_164; this->unk_16C = this->unk_164;
func_80A9C18C(this, play); BgHakuginPost_RequestQuakeAndRumble(this, play);
func_8019F128(NA_SE_EV_STONEDOOR_STOP); func_8019F128(NA_SE_EV_STONEDOOR_STOP);
func_80A9CC84(this); func_80A9CC84(this);
} else { } else {

View File

@ -228,11 +228,11 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) {
Actor_MoveWithGravity(&this->dyna.actor); Actor_MoveWithGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536); Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12); Quake_SetDuration(quakeIndex, 12);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} }

View File

@ -832,11 +832,11 @@ void func_80B81A80(Actor* thisx, PlayState* play) {
func_80B81B84(this); func_80B81B84(this);
} else if (this->unk_584 == 15) { } else if (this->unk_584 == 15) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536); Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, 6, 0, 100, 0); Quake_SetPerturbations(quakeIndex, 6, 0, 100, 0);
Quake_SetCountdown(quakeIndex, 22); Quake_SetDuration(quakeIndex, 22);
} }
} }
@ -859,11 +859,11 @@ void func_80B81BA0(Actor* thisx, PlayState* play) {
thisx->shape.rot.x += 0x1F4; thisx->shape.rot.x += 0x1F4;
if (!(this->unk_584 & 7)) { if (!(this->unk_584 & 7)) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536); Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0); Quake_SetPerturbations(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
Quake_SetCountdown(quakeIndex, 15); Quake_SetDuration(quakeIndex, 15);
} }
if (Flags_GetSwitch(play, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) { if (Flags_GetSwitch(play, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
@ -929,11 +929,11 @@ void func_80B81DC8(Actor* thisx, PlayState* play) {
CutsceneManager_Stop(this->dyna.actor.csId); CutsceneManager_Stop(this->dyna.actor.csId);
func_80B818B4(this); func_80B818B4(this);
} else if (this->unk_584 == 19) { } else if (this->unk_584 == 19) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 5, 0, 40, 60); Quake_SetPerturbations(quakeIndex, 5, 0, 40, 60);
Quake_SetCountdown(quakeIndex, 17); Quake_SetDuration(quakeIndex, 17);
} }
} }

View File

@ -151,10 +151,10 @@ void func_80BD5A18(BgIkanaShutter* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.978f; this->dyna.actor.velocity.y *= 0.978f;
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536); Quake_SetSpeed(quakeIndex, 21536);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 12); Quake_SetDuration(quakeIndex, 12);
func_80BD5828(this); func_80BD5828(this);
} }

View File

@ -69,19 +69,20 @@ void func_80C0A838(BgIkninSusceil* this, PlayState* play) {
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
} }
void func_80C0A86C(BgIkninSusceil* this, PlayState* play, s16 verticalMag, s16 countdown, s32 arg4) { void BgIkninSusceil_RequestQuakeAndRumble(BgIkninSusceil* this, PlayState* play, s16 quakeY, s16 quakeDuration,
s32 rumbleType) {
s32 pad; s32 pad;
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 31536); Quake_SetSpeed(quakeIndex, 31536);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, quakeY, 0, 0, 0);
Quake_SetCountdown(quakeIndex, countdown); Quake_SetDuration(quakeIndex, quakeDuration);
if (arg4 == 1) { if (rumbleType == 1) {
Rumble_Request(SQ(100.0f), 255, 20, 150); Rumble_Request(SQ(100.0f), 255, 20, 150);
} else if (arg4 == 2) { } else if (rumbleType == 2) {
Rumble_Request(SQ(100.0f), 180, 20, 100); Rumble_Request(SQ(100.0f), 180, 20, 100);
} else if (arg4 == 3) { } else if (rumbleType == 3) {
Rumble_Request(SQ(100.0f), 120, 20, 10); Rumble_Request(SQ(100.0f), 120, 20, 10);
} }
} }
@ -154,7 +155,7 @@ void func_80C0ABA8(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.93f; this->dyna.actor.velocity.y *= 0.93f;
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
func_80C0A86C(this, play, 4, 14, 1); BgIkninSusceil_RequestQuakeAndRumble(this, play, 4, 14, 1);
Flags_UnsetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor)); Flags_UnsetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor));
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
func_80C0AC74(this); func_80C0AC74(this);
@ -197,7 +198,7 @@ void func_80C0AD64(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y *= 0.98f; this->dyna.actor.velocity.y *= 0.98f;
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 365.0f, 0.5f, if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 365.0f, 0.5f,
this->dyna.actor.velocity.y, 1.0f) < 0.1f) { this->dyna.actor.velocity.y, 1.0f) < 0.1f) {
func_80C0A86C(this, play, 1, 14, 3); BgIkninSusceil_RequestQuakeAndRumble(this, play, 1, 14, 3);
CutsceneManager_Stop(this->dyna.actor.csId); CutsceneManager_Stop(this->dyna.actor.csId);
func_80C0AB14(this); func_80C0AB14(this);
} else { } else {
@ -216,7 +217,7 @@ void func_80C0AE5C(BgIkninSusceil* this, PlayState* play) {
this->dyna.actor.velocity.y = CLAMP_MIN(this->dyna.actor.velocity.y, 1.0f); this->dyna.actor.velocity.y = CLAMP_MIN(this->dyna.actor.velocity.y, 1.0f);
this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.velocity.y; this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.velocity.y;
if ((this->dyna.actor.home.pos.y + 365.0f) < this->dyna.actor.world.pos.y) { if ((this->dyna.actor.home.pos.y + 365.0f) < this->dyna.actor.world.pos.y) {
func_80C0A86C(this, play, 3, 14, 2); BgIkninSusceil_RequestQuakeAndRumble(this, play, 3, 14, 2);
func_80C0AB14(this); func_80C0AB14(this);
} }
} }

View File

@ -151,10 +151,10 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) {
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true); Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND);
quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3); quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -32536); Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10); Quake_SetDuration(quakeIndex, 10);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);

View File

@ -1050,7 +1050,7 @@ void Boss03_Charge(Boss03* this, PlayState* play) {
// Attack platform // Attack platform
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 20, 15); Actor_RequestQuakeAndRumble(&this->actor, play, 20, 15);
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96,
ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE); ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE);
@ -1773,7 +1773,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) {
Actor_MoveWithGravity(&this->actor); Actor_MoveWithGravity(&this->actor);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
play_sound(NA_SE_IT_WALL_HIT_HARD); play_sound(NA_SE_IT_WALL_HIT_HARD);
func_800BC848(&this->actor, play, 10, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 10, 10);
} }
} else { } else {
Math_ApproachS(&this->actor.shape.rot.z, -0x6000, 0xA, 0x900); Math_ApproachS(&this->actor.shape.rot.z, -0x6000, 0xA, 0x900);

View File

@ -481,7 +481,7 @@ void func_809ECF58(Boss04* this, PlayState* play) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 15, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 15, 10);
this->unk_6F4 = 15; this->unk_6F4 = 15;
sp3C.x = this->actor.focus.pos.x; sp3C.x = this->actor.focus.pos.x;
sp3C.y = this->actor.focus.pos.y; sp3C.y = this->actor.focus.pos.y;

View File

@ -610,10 +610,10 @@ void func_808A1B48(DoorShutter* this, PlayState* play) {
} }
Actor_PlaySfx(&this->actor, NA_SE_EV_BIGWALL_BOUND); Actor_PlaySfx(&this->actor, NA_SE_EV_BIGWALL_BOUND);
quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3); quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -32536); Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10); Quake_SetDuration(quakeIndex, 10);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);

View File

@ -220,10 +220,10 @@ void EnAni_FallToGround(EnAni* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gAniLandingThenStandingUpAnim, 1.0f, 0.0f, 16.0f, ANIMMODE_ONCE, 0.0f); Animation_Change(&this->skelAnime, &gAniLandingThenStandingUpAnim, 1.0f, 0.0f, 16.0f, ANIMMODE_ONCE, 0.0f);
this->stateFlags |= ANI_STATE_WRITHING; this->stateFlags |= ANI_STATE_WRITHING;
quakeIndex = Quake_Add(play->cameraPtrs[CAM_ID_MAIN], QUAKE_TYPE_3); quakeIndex = Quake_Request(play->cameraPtrs[CAM_ID_MAIN], QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 27000); Quake_SetSpeed(quakeIndex, 27000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetDuration(quakeIndex, 20);
Actor_PlaySfx(&this->actor, NA_SE_IT_HAMMER_HIT); Actor_PlaySfx(&this->actor, NA_SE_IT_HAMMER_HIT);
} }

View File

@ -7,7 +7,7 @@
#include "z_en_bat.h" #include "z_en_bat.h"
#include "objects/object_bat/object_bat.h" #include "objects/object_bat/object_bat.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define THIS ((EnBat*)thisx) #define THIS ((EnBat*)thisx)

View File

@ -540,13 +540,13 @@ void func_80A287E8(EnBigpamet* this, PlayState* play) {
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
this->actor.velocity.y = this->unk_29E * 0.375f; this->actor.velocity.y = this->unk_29E * 0.375f;
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 15, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 15, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 10); Quake_SetDuration(quakeIndex, 10);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);

View File

@ -8,7 +8,7 @@
#include "objects/object_bigpo/object_bigpo.h" #include "objects/object_bigpo/object_bigpo.h"
#include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_200 | ACTOR_FLAG_1000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_200 | ACTOR_FLAG_IGNORE_QUAKE)
#define THIS ((EnBigpo*)thisx) #define THIS ((EnBigpo*)thisx)

View File

@ -742,11 +742,11 @@ void EnBigslime_EndThrowMinislime(EnBigslime* this) {
void EnBigslime_BreakIntoMinislime(EnBigslime* this, PlayState* play) { void EnBigslime_BreakIntoMinislime(EnBigslime* this, PlayState* play) {
s32 i; s32 i;
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 15, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 15, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 15); Quake_SetDuration(quakeIndex, 15);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);

View File

@ -423,8 +423,8 @@ void EnBom_Explode(EnBom* this, PlayState* play) {
} }
} }
static s16 D_80872E98[] = { 3, 5 }; static s16 sQuakeY[] = { 3, 5 };
static s16 D_80872E9C[] = { 10, 15 }; static s16 sQuakeDurations[] = { 10, 15 };
void EnBom_Update(Actor* thisx, PlayState* play) { void EnBom_Update(Actor* thisx, PlayState* play) {
Vec3f effVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f effVelocity = { 0.0f, 0.0f, 0.0f };
@ -545,7 +545,8 @@ void EnBom_Update(Actor* thisx, PlayState* play) {
} }
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, effPos.x, effPos.y - 10.0f, effPos.z, 0, 0, 0, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, effPos.x, effPos.y - 10.0f, effPos.z, 0, 0, 0,
this->isPowderKeg); this->isPowderKeg);
func_800BC848(thisx, play, D_80872E98[this->isPowderKeg], D_80872E9C[this->isPowderKeg]); Actor_RequestQuakeAndRumble(thisx, play, sQuakeY[this->isPowderKeg],
sQuakeDurations[this->isPowderKeg]);
play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] = play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] =
play->envCtx.lightSettings.diffuseColor1[2] = 250; play->envCtx.lightSettings.diffuseColor1[2] = 250;
play->envCtx.lightSettings.ambientColor[0] = play->envCtx.lightSettings.ambientColor[1] = play->envCtx.lightSettings.ambientColor[0] = play->envCtx.lightSettings.ambientColor[1] =

View File

@ -6,7 +6,7 @@
#include "z_en_crow.h" #include "z_en_crow.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define THIS ((EnCrow*)thisx) #define THIS ((EnCrow*)thisx)

View File

@ -7,7 +7,7 @@
#include "z_en_death.h" #include "z_en_death.h"
#include "z64rumble.h" #include "z64rumble.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_1000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_IGNORE_QUAKE)
#define THIS ((EnDeath*)thisx) #define THIS ((EnDeath*)thisx)

View File

@ -328,19 +328,19 @@ void EnEgol_FootstepEffects(EnEgol* this, PlayState* play, f32 leftFootFrame, f3
if (Animation_OnFrame(&this->skelAnime, leftFootFrame) || Animation_OnFrame(&this->skelAnime, rightFootFrame)) { if (Animation_OnFrame(&this->skelAnime, leftFootFrame) || Animation_OnFrame(&this->skelAnime, rightFootFrame)) {
Vec3f spawnPos; Vec3f spawnPos;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s32 quakeSize; s32 quakeYOffset;
s32 pad; s32 pad;
Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_WALK); Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_WALK);
quakeSize = 4 - (s32)(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) * 0.02f); quakeYOffset = 4 - (s32)(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) * 0.02f);
if (quakeSize > 4) { if (quakeYOffset > 4) {
quakeSize = 4; quakeYOffset = 4;
} else if (quakeSize < 1) { } else if (quakeYOffset < 1) {
quakeSize = 1; quakeYOffset = 1;
} }
if (player->stateFlags3 != PLAYER_STATE3_1000000) { if (player->stateFlags3 != PLAYER_STATE3_1000000) {
func_800BC848(&this->actor, play, quakeSize, 2); Actor_RequestQuakeAndRumble(&this->actor, play, quakeYOffset, 2);
} }
if (Animation_OnFrame(&this->skelAnime, leftFootFrame)) { if (Animation_OnFrame(&this->skelAnime, leftFootFrame)) {
Math_Vec3f_Copy(&spawnPos, &this->leftFootPos); Math_Vec3f_Copy(&spawnPos, &this->leftFootPos);
@ -755,7 +755,7 @@ void EnEgol_Laser(EnEgol* this, PlayState* play) {
f32 nz; f32 nz;
s32 pad3; s32 pad3;
s32 i; s32 i;
s32 quakeSize; s32 quakeYOffset;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
nx = COLPOLY_GET_NORMAL(colPoly->normal.x); nx = COLPOLY_GET_NORMAL(colPoly->normal.x);
@ -773,14 +773,14 @@ void EnEgol_Laser(EnEgol* this, PlayState* play) {
if ((this->actor.world.pos.y - 50.0f) <= player->actor.world.pos.y) { if ((this->actor.world.pos.y - 50.0f) <= player->actor.world.pos.y) {
EnEgol_SpawnEffect(this, &hitPos, &rotToNorm, 100, 0.02f, EYEGORE_EFFECT_IMPACT); EnEgol_SpawnEffect(this, &hitPos, &rotToNorm, 100, 0.02f, EYEGORE_EFFECT_IMPACT);
} }
quakeSize = 4 - (s32)(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) * 0.02f); quakeYOffset = 4 - (s32)(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) * 0.02f);
if (quakeSize > 4) { if (quakeYOffset > 4) {
quakeSize = 4; quakeYOffset = 4;
} else if (quakeSize < 1) { } else if (quakeYOffset < 1) {
quakeSize = 1; quakeYOffset = 1;
} }
if (player->stateFlags3 != PLAYER_STATE3_1000000) { if (player->stateFlags3 != PLAYER_STATE3_1000000) {
func_800BC848(&this->actor, play, quakeSize, 2); Actor_RequestQuakeAndRumble(&this->actor, play, quakeYOffset, 2);
} }
Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION);
func_800B31BC(play, &hitPos, 40, -2, 255, 20); func_800B31BC(play, &hitPos, 40, -2, 255, 20);
@ -880,16 +880,16 @@ void EnEgol_Slam(EnEgol* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Vec3f spawnPos; Vec3f spawnPos;
f32 dyToPlayer = fabsf(player->actor.world.pos.y - this->actor.world.pos.y); f32 dyToPlayer = fabsf(player->actor.world.pos.y - this->actor.world.pos.y);
s32 quakeSize; s32 quakeYOffset;
Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION);
quakeSize = 4 - (s32)(dyToPlayer * 0.02f); quakeYOffset = 4 - (s32)(dyToPlayer * 0.02f);
if (quakeSize > 4) { if (quakeYOffset > 4) {
quakeSize = 4; quakeYOffset = 4;
} else if (quakeSize < 1) { } else if (quakeYOffset < 1) {
quakeSize = 1; quakeYOffset = 1;
} }
func_800BC848(&this->actor, play, quakeSize, 2); Actor_RequestQuakeAndRumble(&this->actor, play, quakeYOffset, 2);
if (this->actor.floorBgId == BGCHECK_SCENE) { if (this->actor.floorBgId == BGCHECK_SCENE) {
Math_Vec3f_Copy(&spawnPos, &this->actor.world.pos); Math_Vec3f_Copy(&spawnPos, &this->actor.world.pos);
spawnPos.x += Math_SinS(this->actor.world.rot.y) * 60.0f; spawnPos.x += Math_SinS(this->actor.world.rot.y) * 60.0f;
@ -1064,7 +1064,7 @@ void EnEgol_Death(EnEgol* this, PlayState* play) {
this->subCamAt.y = 60.0f; this->subCamAt.y = 60.0f;
this->subCamAt.z = 260.0f; this->subCamAt.z = 260.0f;
Math_Vec3f_Copy(&atOffset, &this->subCamAt); Math_Vec3f_Copy(&atOffset, &this->subCamAt);
OLib_DbCameraVec3fSum(&this->actor.world, &atOffset, &this->subCamAt, 1); OLib_Vec3fAdd(&this->actor.world, &atOffset, &this->subCamAt, OLIB_ADD_OFFSET);
this->subCamEye.x = this->actor.world.pos.x; this->subCamEye.x = this->actor.world.pos.x;
this->subCamEye.y = this->actor.world.pos.y + 70.0f; this->subCamEye.y = this->actor.world.pos.y + 70.0f;
this->subCamEye.z = this->actor.world.pos.z; this->subCamEye.z = this->actor.world.pos.z;
@ -1080,7 +1080,7 @@ void EnEgol_Death(EnEgol* this, PlayState* play) {
} else { } else {
if (Animation_OnFrame(&this->skelAnime, 46.0f)) { if (Animation_OnFrame(&this->skelAnime, 46.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION);
func_800BC848(&this->actor, play, 10, 5); Actor_RequestQuakeAndRumble(&this->actor, play, 10, 5);
} }
if ((curFrame >= this->animEndFrame) && (this->action != EYEGORE_ACTION_DEAD)) { if ((curFrame >= this->animEndFrame) && (this->action != EYEGORE_ACTION_DEAD)) {
s32 i; s32 i;

View File

@ -8,7 +8,7 @@
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
#include "objects/object_firefly/object_firefly.h" #include "objects/object_firefly/object_firefly.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define THIS ((EnFirefly*)thisx) #define THIS ((EnFirefly*)thisx)

View File

@ -6,7 +6,7 @@
#include "z_en_firefly2.h" #include "z_en_firefly2.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define THIS ((EnFirefly2*)thisx) #define THIS ((EnFirefly2*)thisx)

View File

@ -1046,16 +1046,16 @@ s32 func_80A13564(EnGo* this, f32 arg1, f32 arg2, s32 arg3) {
return ret; return ret;
} }
void func_80A136B8(PlayState* play, s16 speed, s16 verticalMag, s16 countdown) { void EnGo_RequestQuake(PlayState* play, s16 speed, s16 y, s16 duration) {
s16 quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3);
Quake_SetCountdown(quakeIndex, countdown); Quake_SetDuration(quakeIndex, duration);
Quake_SetSpeed(quakeIndex, speed); Quake_SetSpeed(quakeIndex, speed);
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
} }
void func_80A13728(EnGo* this, PlayState* play) { void func_80A13728(EnGo* this, PlayState* play) {
func_80A136B8(play, 27767, 7, 20); EnGo_RequestQuake(play, 27767, 7, 20);
play->actorCtx.unk2 = 4; play->actorCtx.unk2 = 4;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TEST, this->actor.world.pos.x, this->actor.world.pos.y, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TEST, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0); this->actor.world.pos.z, 0, 0, 0, 0);

View File

@ -451,11 +451,11 @@ s32 func_8093F6F8(EnGoroiwa* this, PlayState* play) {
if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y <= sp7C)) { if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y <= sp7C)) {
if (this->unk_1CA == 0) { if (this->unk_1CA == 0) {
if (this->actor.xzDistToPlayer < 400.0f) { if (this->actor.xzDistToPlayer < 400.0f) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 17232); Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, 3, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
} }
this->unk_1C4 = 0.0f; this->unk_1C4 = 0.0f;

View File

@ -523,8 +523,8 @@ s32 func_80998A48(EnGs* this, PlayState* play) {
this->unk_1D4 = 0; this->unk_1D4 = 0;
this->unk_19A |= 1; this->unk_19A |= 1;
this->unk_21C = 5; this->quakeY = 5;
this->unk_21E = 40; this->quakeDuration = 40;
this->unk_197++; this->unk_197++;
this->unk_197 &= 0xF; this->unk_197 &= 0xF;
this->unk_19D = 1; this->unk_19D = 1;
@ -558,8 +558,8 @@ s32 func_80998BBC(EnGs* this, PlayState* play) {
this->unk_1D4 = 0; this->unk_1D4 = 0;
this->unk_19A |= 1; this->unk_19A |= 1;
this->unk_21C = 5; this->quakeY = 5;
this->unk_21E = 40; this->quakeDuration = 40;
this->unk_197--; this->unk_197--;
this->unk_197 &= 0xF; this->unk_197 &= 0xF;
this->unk_19D = 1; this->unk_19D = 1;
@ -585,8 +585,8 @@ s32 func_80998D44(EnGs* this, PlayState* play) {
this->unk_1E0 = -0.8f; this->unk_1E0 = -0.8f;
Actor_PlaySfx(&this->actor, NA_SE_EV_G_STONE_CRUSH); Actor_PlaySfx(&this->actor, NA_SE_EV_G_STONE_CRUSH);
this->unk_19A |= 1; this->unk_19A |= 1;
this->unk_21C = 40; this->quakeY = 40;
this->unk_21E = 11; this->quakeDuration = 11;
this->unk_19D++; this->unk_19D++;
} else if (this->unk_19D == 1) { } else if (this->unk_19D == 1) {
step = Math_SmoothStepToF(&this->unk_1DC, this->unk_1E0, 1.0f, 0.4f, 0.001f); step = Math_SmoothStepToF(&this->unk_1DC, this->unk_1E0, 1.0f, 0.4f, 0.001f);
@ -611,8 +611,8 @@ s32 func_80998D44(EnGs* this, PlayState* play) {
this->unk_216 = 0; this->unk_216 = 0;
this->unk_1E0 = 0.0f; this->unk_1E0 = 0.0f;
this->unk_1D4 = 0; this->unk_1D4 = 0;
this->unk_21C = 10; this->quakeY = 10;
this->unk_21E = 10; this->quakeDuration = 10;
this->unk_1DC = 0.5f; this->unk_1DC = 0.5f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK);
this->unk_19D += 1; this->unk_19D += 1;
@ -641,8 +641,8 @@ s32 func_80998F9C(EnGs* this, PlayState* play) {
this->unk_1EC = 0.0f; this->unk_1EC = 0.0f;
this->unk_19D = 1; this->unk_19D = 1;
this->unk_21C = 2; this->quakeY = 2;
this->unk_21E = 40; this->quakeDuration = 40;
this->unk_216 = 200; this->unk_216 = 200;
} }
@ -714,8 +714,8 @@ s32 func_80998F9C(EnGs* this, PlayState* play) {
this->unk_1F0 = 0.0f; this->unk_1F0 = 0.0f;
this->unk_1EC = 0.5f; this->unk_1EC = 0.5f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK);
this->unk_21C = 20; this->quakeY = 20;
this->unk_21E = 2; this->quakeDuration = 2;
this->unk_19D = 6; this->unk_19D = 6;
} }
} }
@ -800,8 +800,8 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
if (this->unk_1D4 <= 0) { if (this->unk_1D4 <= 0) {
this->unk_19A &= ~4; this->unk_19A &= ~4;
this->unk_21C = 3; this->quakeY = 3;
this->unk_21E = 40; this->quakeDuration = 40;
this->unk_1D4 = 0; this->unk_1D4 = 0;
this->unk_19D++; this->unk_19D++;
} }
@ -834,8 +834,8 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
this->unk_1DC = 0.0f; this->unk_1DC = 0.0f;
this->unk_19D++; this->unk_19D++;
this->unk_21C = 5; this->quakeY = 5;
this->unk_21E = 20; this->quakeDuration = 20;
this->unk_19A |= 1; this->unk_19A |= 1;
this->unk_216 = 200; this->unk_216 = 200;
this->unk_1E0 = (this->unk_197 >> 2) * 0x444; this->unk_1E0 = (this->unk_197 >> 2) * 0x444;
@ -1028,8 +1028,8 @@ void EnGs_Update(Actor* thisx, PlayState* play) {
if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) || if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) ||
(sp2C > SCREEN_HEIGHT)) { (sp2C > SCREEN_HEIGHT)) {
this->unk_216 = 0; this->unk_216 = 0;
} else if (this->unk_21C > 0) { } else if (this->quakeY > 0) {
func_800BC848(&this->actor, play, this->unk_21C, this->unk_21E); Actor_RequestQuakeAndRumble(&this->actor, play, this->quakeY, this->quakeDuration);
} }
} else { } else {
this->unk_216 = 0; this->unk_216 = 0;
@ -1048,8 +1048,8 @@ void EnGs_Update(Actor* thisx, PlayState* play) {
} }
} }
if (this->unk_21C > 0) { if (this->quakeY > 0) {
this->unk_21C = 0; this->quakeY = 0;
} }
func_80999B34(this); func_80999B34(this);

View File

@ -53,8 +53,8 @@ typedef struct EnGs {
/* 0x216 */ s16 unk_216; /* 0x216 */ s16 unk_216;
/* 0x218 */ s16 unk_218; /* 0x218 */ s16 unk_218;
/* 0x21A */ s16 unk_21A; /* 0x21A */ s16 unk_21A;
/* 0x21C */ s16 unk_21C; /* 0x21C */ s16 quakeY;
/* 0x21E */ s16 unk_21E; /* 0x21E */ s16 quakeDuration;
} EnGs; // size = 0x220 } EnGs; // size = 0x220
#endif // Z_EN_GS_H #endif // Z_EN_GS_H

View File

@ -597,11 +597,11 @@ void func_8095EBDC(EnIshi* this, PlayState* play) {
} }
if (sp70 == 1) { if (sp70 == 1) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 17232); Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, 3, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
} }

View File

@ -609,7 +609,7 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) {
this->subCamEyeNext.z = D_80971DCC[this->unk190].z; this->subCamEyeNext.z = D_80971DCC[this->unk190].z;
Math_Vec3f_Copy(&tempVec, &this->subCamEyeNext); Math_Vec3f_Copy(&tempVec, &this->subCamEyeNext);
OLib_DbCameraVec3fSum(&this->picto.actor.home, &tempVec, &this->subCamEyeNext, 1); OLib_Vec3fAdd(&this->picto.actor.home, &tempVec, &this->subCamEyeNext, OLIB_ADD_OFFSET);
Math_Vec3f_Copy(&this->subCamAtNext, &this->unk22C); Math_Vec3f_Copy(&this->subCamAtNext, &this->unk22C);
Math_Vec3f_Copy(&this->subCamEye, &this->subCamEyeNext); Math_Vec3f_Copy(&this->subCamEye, &this->subCamEyeNext);
Math_Vec3f_Copy(&this->subCamAt, &this->subCamAtNext); Math_Vec3f_Copy(&this->subCamAt, &this->subCamAtNext);
@ -722,7 +722,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) {
this->subCamEyeNext.y = D_80971FA0[this->unk190].y; this->subCamEyeNext.y = D_80971FA0[this->unk190].y;
this->subCamEyeNext.z = D_80971FA0[this->unk190].z; this->subCamEyeNext.z = D_80971FA0[this->unk190].z;
Math_Vec3f_Copy(&vec3fCopy, &this->subCamEyeNext); Math_Vec3f_Copy(&vec3fCopy, &this->subCamEyeNext);
OLib_DbCameraVec3fSum(&this->picto.actor.home, &vec3fCopy, &this->subCamEyeNext, 1); OLib_Vec3fAdd(&this->picto.actor.home, &vec3fCopy, &this->subCamEyeNext, OLIB_ADD_OFFSET);
this->subCamAtNext.x = D_80971FE8[this->unk190].x + this->unk22C.x; this->subCamAtNext.x = D_80971FE8[this->unk190].x + this->unk22C.x;
this->subCamAtNext.y = D_80971FE8[this->unk190].y + this->unk22C.y; this->subCamAtNext.y = D_80971FE8[this->unk190].y + this->unk22C.y;
this->subCamAtNext.z = D_80971FE8[this->unk190].z + this->unk22C.z; this->subCamAtNext.z = D_80971FE8[this->unk190].z + this->unk22C.z;
@ -831,7 +831,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
this->subCamEyeNext.y = D_80971E38[this->unk190].y; this->subCamEyeNext.y = D_80971E38[this->unk190].y;
this->subCamEyeNext.z = D_80971E38[this->unk190].z; this->subCamEyeNext.z = D_80971E38[this->unk190].z;
Math_Vec3f_Copy(&localVec3f, &this->subCamEyeNext); Math_Vec3f_Copy(&localVec3f, &this->subCamEyeNext);
OLib_DbCameraVec3fSum(&this->picto.actor.home, &localVec3f, &this->subCamEyeNext, 1); OLib_Vec3fAdd(&this->picto.actor.home, &localVec3f, &this->subCamEyeNext, OLIB_ADD_OFFSET);
if (1) {} if (1) {}
this->subCamAtNext.x = D_80971EEC[this->unk190].x + this->unk22C.x; this->subCamAtNext.x = D_80971EEC[this->unk190].x + this->unk22C.x;
@ -978,7 +978,7 @@ void EnKakasi_DiggingAway(EnKakasi* this, PlayState* play) {
this->subCamEyeNext.z = D_80972030.z; this->subCamEyeNext.z = D_80972030.z;
Math_Vec3f_Copy(&tempunk238, &this->subCamEyeNext); Math_Vec3f_Copy(&tempunk238, &this->subCamEyeNext);
OLib_DbCameraVec3fSum(&this->picto.actor.home, &tempunk238, &this->subCamEyeNext, 1); OLib_Vec3fAdd(&this->picto.actor.home, &tempunk238, &this->subCamEyeNext, OLIB_ADD_OFFSET);
this->subCamAtNext.x = ((f32)D_8097203C.x) + this->unk22C.x; // cast req this->subCamAtNext.x = ((f32)D_8097203C.x) + this->unk22C.x; // cast req
this->subCamAtNext.y = ((f32)D_8097203C.y) + this->unk22C.y; this->subCamAtNext.y = ((f32)D_8097203C.y) + this->unk22C.y;
this->subCamAtNext.z = ((f32)D_8097203C.z) + this->unk22C.z; this->subCamAtNext.z = ((f32)D_8097203C.z) + this->unk22C.z;

View File

@ -174,20 +174,20 @@ void EnMinislime_CheckBackgroundCollision(EnMinislime* this) {
} }
void EnMinislime_AddIceShardEffect(EnMinislime* this) { void EnMinislime_AddIceShardEffect(EnMinislime* this) {
s32 pad;
EnBigslime* bigslime = (EnBigslime*)this->actor.parent; EnBigslime* bigslime = (EnBigslime*)this->actor.parent;
EnBigslimeIceShardEffect* iceShardEffect; EnBigslimeIceShardEffect* iceShardEffect;
s32 i = 10 * this->id + BIGSLIME_NUM_VTX; s32 i = 10 * this->id + BIGSLIME_NUM_VTX;
s32 i_end = i + 10; s32 i_end = i + 10;
VecSph vecSph; s16 pitch;
s16 yaw = 0;
vecSph.yaw = 0;
for (; i < i_end; i++) { for (; i < i_end; i++) {
iceShardEffect = &bigslime->iceShardEffect[i]; iceShardEffect = &bigslime->iceShardEffect[i];
vecSph.pitch = Rand_S16Offset(0x1000, 0x3000); pitch = Rand_S16Offset(0x1000, 0x3000);
iceShardEffect->velocity.x = Math_CosS(vecSph.pitch) * Math_SinS(vecSph.yaw); iceShardEffect->velocity.x = Math_CosS(pitch) * Math_SinS(yaw);
iceShardEffect->velocity.y = Math_SinS(vecSph.pitch); iceShardEffect->velocity.y = Math_SinS(pitch);
iceShardEffect->velocity.z = Math_CosS(vecSph.pitch) * Math_CosS(vecSph.yaw); iceShardEffect->velocity.z = Math_CosS(pitch) * Math_CosS(yaw);
iceShardEffect->pos.x = this->actor.world.pos.x + (400.0f * this->actor.scale.x) * iceShardEffect->velocity.x; iceShardEffect->pos.x = this->actor.world.pos.x + (400.0f * this->actor.scale.x) * iceShardEffect->velocity.x;
iceShardEffect->pos.y = iceShardEffect->pos.y =
this->actor.world.pos.y + (((iceShardEffect->velocity.y * 2.0f) - 1.0f) * 400.0f * this->actor.scale.y); this->actor.world.pos.y + (((iceShardEffect->velocity.y * 2.0f) - 1.0f) * 400.0f * this->actor.scale.y);
@ -198,7 +198,7 @@ void EnMinislime_AddIceShardEffect(EnMinislime* this) {
iceShardEffect->isEnabled = true; iceShardEffect->isEnabled = true;
Math_Vec3f_ScaleAndStore(&iceShardEffect->velocity, Rand_ZeroFloat(3.0f) + 7.0f, &iceShardEffect->velocity); Math_Vec3f_ScaleAndStore(&iceShardEffect->velocity, Rand_ZeroFloat(3.0f) + 7.0f, &iceShardEffect->velocity);
iceShardEffect->scale = (Rand_ZeroFloat(6.0f) + 2.0f) * 0.001f; iceShardEffect->scale = (Rand_ZeroFloat(6.0f) + 2.0f) * 0.001f;
vecSph.yaw += 0x1999; yaw += 0x1999;
} }
this->frozenAlpha = 0; this->frozenAlpha = 0;

View File

@ -1224,10 +1224,10 @@ void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, PlayState* play) {
// Zooms in on Snapper spawn point // Zooms in on Snapper spawn point
Play_SetCameraAtEye(play, this->subCamId, &subCamAt, &subCamEye); Play_SetCameraAtEye(play, this->subCamId, &subCamAt, &subCamEye);
this->quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); this->quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(this->quakeIndex, 18000); Quake_SetSpeed(this->quakeIndex, 18000);
Quake_SetQuakeValues(this->quakeIndex, 2, 0, 0, 0); Quake_SetPerturbations(this->quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(this->quakeIndex, 15); Quake_SetDuration(this->quakeIndex, 15);
Rumble_Request(this->actor.xyzDistToPlayerSq, 120, 20, 10); Rumble_Request(this->actor.xyzDistToPlayerSq, 120, 20, 10);
@ -1249,12 +1249,12 @@ void EnPametfrog_SnapperSpawn(EnPametfrog* this, PlayState* play) {
void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, PlayState* play) {
this->actor.params = GEKKO_GET_SNAPPER; this->actor.params = GEKKO_GET_SNAPPER;
Quake_Remove(this->quakeIndex); Quake_RemoveRequest(this->quakeIndex);
this->quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); this->quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(this->quakeIndex, 20000); Quake_SetSpeed(this->quakeIndex, 20000);
Quake_SetQuakeValues(this->quakeIndex, 17, 0, 0, 0); Quake_SetPerturbations(this->quakeIndex, 17, 0, 0, 0);
Quake_SetCountdown(this->quakeIndex, 12); Quake_SetDuration(this->quakeIndex, 12);
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);

View File

@ -7,7 +7,7 @@
#include "z_en_po_sisters.h" #include "z_en_po_sisters.h"
#include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define THIS ((EnPoSisters*)thisx) #define THIS ((EnPoSisters*)thisx)

View File

@ -4,10 +4,11 @@
* Description: Poe * Description: Poe
*/ */
#include "prevent_bss_reordering.h"
#include "z_en_poh.h" #include "z_en_poh.h"
#include "objects/object_po/object_po.h" #include "objects/object_po/object_po.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_1000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_IGNORE_QUAKE)
#define THIS ((EnPoh*)thisx) #define THIS ((EnPoh*)thisx)

View File

@ -195,7 +195,7 @@ void EnStopHeishi_UpdateHeadThirdDay(EnStopheishi* this) {
this->headTurnTimer1 = 50; this->headTurnTimer1 = 50;
} }
} }
} else if ((this->headTurnTimer1 == 0) && (Quake_NumActiveQuakes() != 0) && (this->headTurnTimer2 >= 6)) { } else if ((this->headTurnTimer1 == 0) && (Quake_GetNumActiveQuakes() != 0) && (this->headTurnTimer2 >= 6)) {
this->headTurnTimer2 = 0; this->headTurnTimer2 = 0;
} }
} }

View File

@ -350,7 +350,7 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) {
this->actor.shape.rot.y += phi_v0; this->actor.shape.rot.y += phi_v0;
Actor_PlaySfx(&this->actor, NA_SE_IT_BIG_BOMB_EXPLOSION); Actor_PlaySfx(&this->actor, NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 4, 4); Actor_RequestQuakeAndRumble(&this->actor, play, 4, 4);
this->unk_1A0++; this->unk_1A0++;
} else { } else {
Vec3f sp90; Vec3f sp90;

View File

@ -425,7 +425,7 @@ void func_80A916F0(EnTest6* this, PlayState* play) {
CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]);
func_800B7298(play, NULL, PLAYER_CSMODE_END); func_800B7298(play, NULL, PLAYER_CSMODE_END);
EnTest6_DisableMotionBlur(); EnTest6_DisableMotionBlur();
Distortion_ClearType(DISTORTION_TYPE_5); Distortion_RemoveRequest(DISTORTION_TYPE_SONG_OF_TIME);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
@ -491,8 +491,8 @@ void func_80A91760(EnTest6* this, PlayState* play) {
} }
} }
EnTest6_EnableMotionBlur(120); EnTest6_EnableMotionBlur(120);
Distortion_SetType(DISTORTION_TYPE_5); Distortion_Request(DISTORTION_TYPE_SONG_OF_TIME);
Distortion_SetCountdown(80); Distortion_SetDuration(80);
play->unk_18844 = true; play->unk_18844 = true;
this->cueId = 95; this->cueId = 95;
} }
@ -546,7 +546,7 @@ void func_80A91760(EnTest6* this, PlayState* play) {
if (this->unk_27A == 10) { if (this->unk_27A == 10) {
this->unk_14C = 0.1f; this->unk_14C = 0.1f;
EnTest6_DisableMotionBlur(); EnTest6_DisableMotionBlur();
Distortion_ClearType(DISTORTION_TYPE_5); Distortion_RemoveRequest(DISTORTION_TYPE_SONG_OF_TIME);
play->unk_18844 = false; play->unk_18844 = false;
if (this->unk_254 != NULL) { if (this->unk_254 != NULL) {
ZeldaArena_Free(this->unk_254); ZeldaArena_Free(this->unk_254);
@ -646,7 +646,7 @@ void func_80A92118(EnTest6* this, PlayState* play) {
CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]);
func_800B7298(play, NULL, PLAYER_CSMODE_END); func_800B7298(play, NULL, PLAYER_CSMODE_END);
EnTest6_DisableMotionBlur(); EnTest6_DisableMotionBlur();
Distortion_ClearType(DISTORTION_TYPE_5); Distortion_RemoveRequest(DISTORTION_TYPE_SONG_OF_TIME);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
@ -713,8 +713,8 @@ void func_80A92188(EnTest6* this, PlayState* play) {
case 115: case 115:
EnTest6_EnableMotionBlur(20); EnTest6_EnableMotionBlur(20);
Distortion_SetType(DISTORTION_TYPE_5); Distortion_Request(DISTORTION_TYPE_SONG_OF_TIME);
Distortion_SetCountdown(90); Distortion_SetDuration(90);
this->cueId = 2; this->cueId = 2;
break; break;
@ -744,7 +744,7 @@ void func_80A92188(EnTest6* this, PlayState* play) {
case 14: case 14:
case 15: case 15:
EnTest6_EnableMotionBlur(50); EnTest6_EnableMotionBlur(50);
Distortion_ClearType(DISTORTION_TYPE_5); Distortion_RemoveRequest(DISTORTION_TYPE_SONG_OF_TIME);
this->cueId = 0; this->cueId = 0;
break; break;

View File

@ -7,7 +7,7 @@
#include "prevent_bss_reordering.h" #include "prevent_bss_reordering.h"
#include "z_en_thiefbird.h" #include "z_en_thiefbird.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000) #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_80000000)
#define THIS ((EnThiefbird*)thisx) #define THIS ((EnThiefbird*)thisx)

View File

@ -4,6 +4,7 @@
* Description: Beaver Race Ring * Description: Beaver Race Ring
*/ */
#include "prevent_bss_reordering.h"
#include "z_en_twig.h" #include "z_en_twig.h"
#include "objects/object_twig/object_twig.h" #include "objects/object_twig/object_twig.h"

View File

@ -9,7 +9,7 @@
#include "overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h" #include "overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h"
#define FLAGS \ #define FLAGS \
(ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_1000 | ACTOR_FLAG_100000 | \ (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_100000 | \
ACTOR_FLAG_CANT_LOCK_ON | ACTOR_FLAG_80000000) ACTOR_FLAG_CANT_LOCK_ON | ACTOR_FLAG_80000000)
#define THIS ((EnWiz*)thisx) #define THIS ((EnWiz*)thisx)

View File

@ -117,16 +117,16 @@ u32 func_80BB9A1C(ObjChan* this, f32 arg1) {
f32 sp20; f32 sp20;
sp20 = Math_SinS(this->unk1D4) * this->unk1D0; sp20 = Math_SinS(this->unk1D4) * this->unk1D0;
temp_f6 = (Math_CosS(this->unk1D4) * 0.03834952f * this->unk1D0) + arg1; temp_f6 = (Math_CosS(this->unk1D4) * (400 * M_PI / 0x8000) * this->unk1D0) + arg1;
if (temp_f6 != 0.0f) { if (temp_f6 != 0.0f) {
this->unk1D4 = RAD_TO_BINANG(func_80086B30(sp20 * 0.03834952f, temp_f6)); this->unk1D4 = RAD_TO_BINANG(func_80086B30(sp20 * (400 * M_PI / 0x8000), temp_f6));
} else if (sp20 >= 0.0f) { } else if (sp20 >= 0.0f) {
this->unk1D4 = 0x4000; this->unk1D4 = 0x4000;
} else { } else {
this->unk1D4 = -0x4000; this->unk1D4 = -0x4000;
} }
if (Math_CosS(this->unk1D4) != 0.0f) { if (Math_CosS(this->unk1D4) != 0.0f) {
this->unk1D0 = (temp_f6 / (Math_CosS(this->unk1D4) * 0.03834952f)); this->unk1D0 = (temp_f6 / (Math_CosS(this->unk1D4) * (400 * M_PI / 0x8000)));
} else { } else {
this->unk1D0 = sp20; this->unk1D0 = sp20;
} }

View File

@ -174,7 +174,7 @@ void ObjChikuwa_Update(Actor* thisx, PlayState* play) {
func_809B17D0(play, this, &temp->unk_00); func_809B17D0(play, this, &temp->unk_00);
temp_fs0 = Math3D_Vec3fDistSq(&temp->unk_00, &GET_PLAYER(play)->actor.world.pos); temp_fs0 = Math3D_Vec3fDistSq(&temp->unk_00, &GET_PLAYER(play)->actor.world.pos);
if (temp_fs0 < SQ(240.0f)) { if (temp_fs0 < SQ(240.0f)) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
if (temp_fs0 < SQ(120.0f)) { if (temp_fs0 < SQ(120.0f)) {
quakeVerticalMag = 4; quakeVerticalMag = 4;
} else { } else {
@ -182,8 +182,8 @@ void ObjChikuwa_Update(Actor* thisx, PlayState* play) {
} }
Quake_SetSpeed(quakeIndex, 17232); Quake_SetSpeed(quakeIndex, 17232);
Quake_SetQuakeValues(quakeIndex, quakeVerticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, quakeVerticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
} }
} }
} }

View File

@ -458,20 +458,20 @@ void func_80B139F4(ObjDhouse* this, PlayState* play) {
s16 quakeIndex; s16 quakeIndex;
if (this->unk_1370 == 117) { if (this->unk_1370 == 117) {
quakeIndex = Quake_Add(camera, QUAKE_TYPE_3); quakeIndex = Quake_Request(camera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 8, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 17); Quake_SetDuration(quakeIndex, 17);
} else if (this->unk_1370 == 105) { } else if (this->unk_1370 == 105) {
quakeIndex = Quake_Add(camera, QUAKE_TYPE_3); quakeIndex = Quake_Request(camera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 7, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetDuration(quakeIndex, 20);
} else if (this->unk_1370 == 90) { } else if (this->unk_1370 == 90) {
quakeIndex = Quake_Add(camera, QUAKE_TYPE_3); quakeIndex = Quake_Request(camera, QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 5, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 62); Quake_SetDuration(quakeIndex, 62);
} }
this->unk_1370--; this->unk_1370--;

View File

@ -281,7 +281,7 @@ void ObjDora_UpdateCollision(ObjDora* this, PlayState* play) {
this->lastGongHitType = DORA_HIT_STRONG; this->lastGongHitType = DORA_HIT_STRONG;
} }
func_800BC848(&this->actor, play, 5, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 5, 10);
ObjDora_SetupMoveGong(this); ObjDora_SetupMoveGong(this);
if ((ObjDora_IsHalfHour(time) == true) && (this->rupeeDropTimer == 0)) { if ((ObjDora_IsHalfHour(time) == true) && (this->rupeeDropTimer == 0)) {

View File

@ -74,7 +74,7 @@ void ObjHariko_BobHead(ObjHariko* this, PlayState* play) {
} }
void ObjHariko_CheckForQuakes(ObjHariko* this) { void ObjHariko_CheckForQuakes(ObjHariko* this) {
if (Quake_NumActiveQuakes() != 0) { if (Quake_GetNumActiveQuakes() != 0) {
ObjHariko_SetupBobHead(this); ObjHariko_SetupBobHead(this);
} }
} }

View File

@ -293,13 +293,13 @@ void func_80A54600(PlayState* play, Vec3f* arg1, f32 arg2, f32 arg3) {
} }
} }
void ObjHugebombiwa_AddQuake(ObjHugebombiwa* this, PlayState* play, s32 quakeVerticalMag) { void ObjHugebombiwa_RequestQuakeAndRumble(ObjHugebombiwa* this, PlayState* play, s32 quakeVerticalMag) {
s32 pad[2]; s32 pad[2];
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, quakeVerticalMag, 0, 0, 0); Quake_SetPerturbations(quakeIndex, quakeVerticalMag, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
} }
@ -516,7 +516,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) {
ptr->unk_24 = 1; ptr->unk_24 = 1;
func_80A53E60(play, &ptr->unk_0C, ptr->unk_18, ptr->unk_00.y * 9.8f); func_80A53E60(play, &ptr->unk_0C, ptr->unk_18, ptr->unk_00.y * 9.8f);
if ((play->gameplayFrames % 4) == 0) { if ((play->gameplayFrames % 4) == 0) {
ObjHugebombiwa_AddQuake(this, play, (s32)(Rand_ZeroOne() * 5.5f) + 1); ObjHugebombiwa_RequestQuakeAndRumble(this, play, (s32)(Rand_ZeroOne() * 5.5f) + 1);
} }
} }
} }
@ -612,7 +612,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) {
ptr->unk_24 = 1; ptr->unk_24 = 1;
func_80A54600(play, &ptr->unk_0C, ptr->unk_18, ptr->unk_00.y * 10.1f); func_80A54600(play, &ptr->unk_0C, ptr->unk_18, ptr->unk_00.y * 10.1f);
if ((play->gameplayFrames % 4) == 0) { if ((play->gameplayFrames % 4) == 0) {
ObjHugebombiwa_AddQuake(this, play, (s32)(Rand_ZeroOne() * 5.5f) + 1); ObjHugebombiwa_RequestQuakeAndRumble(this, play, (s32)(Rand_ZeroOne() * 5.5f) + 1);
} }
} }
} }

View File

@ -134,10 +134,10 @@ void func_8093D7A0(ObjLift* this, PlayState* play) {
if (OBJLIFT_GET_7(&this->dyna.actor) == 7) { if (OBJLIFT_GET_7(&this->dyna.actor) == 7) {
func_8093D9C0(this); func_8093D9C0(this);
} else { } else {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_1); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
Quake_SetSpeed(quakeIndex, 10000); Quake_SetSpeed(quakeIndex, 10000);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetDuration(quakeIndex, 20);
func_8093D88C(this); func_8093D88C(this);
} }

View File

@ -61,13 +61,13 @@ void ObjTokeiStep_SetSysMatrix(ObjTokeiStepPanel* panel) {
mtx->zw = panel->pos.z; mtx->zw = panel->pos.z;
} }
void ObjTokeiStep_AddQuake(ObjTokeiStep* this, PlayState* play) { void ObjTokeiStep_RequestQuakeAndRumble(ObjTokeiStep* this, PlayState* play) {
s32 pad[2]; s32 pad[2];
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); s16 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeIndex, 1, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 1, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
} }
@ -180,7 +180,7 @@ s32 ObjTokeiStep_OpenProcess(ObjTokeiStep* this, PlayState* play) {
} }
if (panel->numBounces == 1) { if (panel->numBounces == 1) {
ObjTokeiStep_SpawnDust(this2, panel, play); ObjTokeiStep_SpawnDust(this2, panel, play);
ObjTokeiStep_AddQuake(this2, play); ObjTokeiStep_RequestQuakeAndRumble(this2, play);
} }
} }
} }

View File

@ -72,7 +72,7 @@ void OceffWipe5_Draw(Actor* thisx, PlayState* play) {
s32 i; s32 i;
s32 pad2; s32 pad2;
Vec3f activeCamEye = GET_ACTIVE_CAM(play)->eye; Vec3f activeCamEye = GET_ACTIVE_CAM(play)->eye;
Camera* cam = GET_ACTIVE_CAM(play); Camera* activeCam = GET_ACTIVE_CAM(play);
Vec3f quakeOffset; Vec3f quakeOffset;
u8 alpha; u8 alpha;
s32 colorIndex = OCEFF_WIPE5_GET_SONG_TYPE(thisx) * 3; s32 colorIndex = OCEFF_WIPE5_GET_SONG_TYPE(thisx) * 3;
@ -88,7 +88,7 @@ void OceffWipe5_Draw(Actor* thisx, PlayState* play) {
colorIndex = 0; colorIndex = 0;
} }
Camera_GetQuakeOffset(&quakeOffset, cam); Camera_GetQuakeOffset(&quakeOffset, activeCam);
if (this->counter < 32) { if (this->counter < 32) {
z = Math_SinS(this->counter << 9) * phi_fv1; z = Math_SinS(this->counter << 9) * phi_fv1;

View File

@ -859,9 +859,9 @@
0x800BC5B8:("Actor_IsTargeted",), 0x800BC5B8:("Actor_IsTargeted",),
0x800BC5EC:("Actor_OtherIsTargeted",), 0x800BC5EC:("Actor_OtherIsTargeted",),
0x800BC620:("func_800BC620",), 0x800BC620:("func_800BC620",),
0x800BC770:("Actor_AddQuake",), 0x800BC770:("Actor_RequestQuake",),
0x800BC7D8:("Actor_AddQuakeWithSpeed",), 0x800BC7D8:("Actor_RequestQuakeWithSpeed",),
0x800BC848:("func_800BC848",), 0x800BC848:("Actor_RequestQuakeAndRumble",),
0x800BC8B8:("Actor_DrawDoorLock",), 0x800BC8B8:("Actor_DrawDoorLock",),
0x800BCB50:("Actor_SpawnShieldParticlesMetal",), 0x800BCB50:("Actor_SpawnShieldParticlesMetal",),
0x800BCB70:("Actor_SetColorFilter",), 0x800BCB70:("Actor_SetColorFilter",),
@ -2072,17 +2072,17 @@
0x8010C36C:("OLib_ClampMaxDist",), 0x8010C36C:("OLib_ClampMaxDist",),
0x8010C3D4:("OLib_Vec3fDistNormalize",), 0x8010C3D4:("OLib_Vec3fDistNormalize",),
0x8010C484:("OLib_VecSphToVec3f",), 0x8010C484:("OLib_VecSphToVec3f",),
0x8010C530:("OLib_VecSphGeoToVec3f",), 0x8010C530:("OLib_VecGeoToVec3f",),
0x8010C574:("OLib_Vec3fToVecSph",), 0x8010C574:("OLib_Vec3fToVecSph",),
0x8010C6C8:("OLib_Vec3fToVecSphGeo",), 0x8010C6C8:("OLib_Vec3fToVecGeo",),
0x8010C710:("OLib_Vec3fDiffToVecSph",), 0x8010C710:("OLib_Vec3fDiffToVecSph",),
0x8010C764:("OLib_Vec3fDiffToVecSphGeo",), 0x8010C764:("OLib_Vec3fDiffToVecGeo",),
0x8010C7B8:("OLib_VecSphAddToVec3f",), 0x8010C7B8:("OLib_AddVecGeoToVec3f",),
0x8010C838:("OLib_Vec3fDiffRad",), 0x8010C838:("OLib_Vec3fDiffRad",),
0x8010C8C8:("OLib_Vec3fDiffDegF",), 0x8010C8C8:("OLib_Vec3fDiffDegF",),
0x8010C930:("OLib_Vec3fDiffBinAng",), 0x8010C930:("OLib_Vec3fDiffBinAng",),
0x8010C9C8:("OLib_DbCameraVec3fDiff",), 0x8010C9C8:("OLib_Vec3fDiff",),
0x8010CAA0:("OLib_DbCameraVec3fSum",), 0x8010CAA0:("OLib_Vec3fAdd",),
0x8010CB80:("Gfx_DrawTexRectRGBA16",), 0x8010CB80:("Gfx_DrawTexRectRGBA16",),
0x8010CD98:("Gfx_DrawTexRectIA8",), 0x8010CD98:("Gfx_DrawTexRectIA8",),
0x8010CFBC:("Gfx_DrawTexRectIA8_DropShadow",), 0x8010CFBC:("Gfx_DrawTexRectIA8_DropShadow",),
@ -2289,28 +2289,28 @@
0x8012A4D0:("Quake_CallbackType2",), 0x8012A4D0:("Quake_CallbackType2",),
0x8012A540:("Quake_CallbackType4",), 0x8012A540:("Quake_CallbackType4",),
0x8012A5D8:("Quake_GetFreeIndex",), 0x8012A5D8:("Quake_GetFreeIndex",),
0x8012A638:("Quake_AddImpl",), 0x8012A638:("Quake_RequestImpl",),
0x8012A6F0:("Quake_RemoveRequest",), 0x8012A6F0:("Quake_Remove",),
0x8012A718:("Quake_GetRequest",), 0x8012A718:("Quake_GetRequest",),
0x8012A774:("Quake_SetValue",), 0x8012A774:("Quake_SetValue",),
0x8012A8A8:("Quake_SetSpeed",), 0x8012A8A8:("Quake_SetSpeed",),
0x8012A8F0:("Quake_SetCountdown",), 0x8012A8F0:("Quake_SetDuration",),
0x8012A940:("Quake_GetCountdown",), 0x8012A940:("Quake_GetTimeLeft",),
0x8012A978:("Quake_SetQuakeValues",), 0x8012A978:("Quake_SetPerturbations",),
0x8012A9E0:("Quake_SetQuakeValues2",), 0x8012A9E0:("Quake_SetOrientation",),
0x8012AA48:("Quake_Init",), 0x8012AA48:("Quake_Init",),
0x8012AA9C:("Quake_Add",), 0x8012AA9C:("Quake_Request",),
0x8012AAC0:("Quake_Remove",), 0x8012AAC0:("Quake_RemoveRequest",),
0x8012AB08:("Quake_Calc",), 0x8012AB08:("Quake_Update",),
0x8012AE68:("Distortion_Init",), 0x8012AE68:("Distortion_Init",),
0x8012AEAC:("Distortion_SetCountdown",), 0x8012AEAC:("Distortion_SetDuration",),
0x8012AED4:("Distortion_GetCountdown",), 0x8012AED4:("Distortion_GetTimeLeft",),
0x8012AEE4:("Distortion_GetType",), 0x8012AEE4:("Distortion_GetType",),
0x8012AEF4:("Distortion_SetType",), 0x8012AEF4:("Distortion_Request",),
0x8012AF18:("Distortion_ClearType",), 0x8012AF18:("Distortion_RemoveRequest",),
0x8012AF38:("Distortion_GetUnderwaterCurrentSpeed",), 0x8012AF38:("Distortion_GetUnderwaterCurrentSpeed",),
0x8012AF9C:("Distortion_Update",), 0x8012AF9C:("Distortion_Update",),
0x8012BBE8:("Quake_NumActiveQuakes",), 0x8012BBE8:("Quake_GetNumActiveQuakes",),
0x8012BC50:("Gfx_SetFog",), 0x8012BC50:("Gfx_SetFog",),
0x8012BD8C:("Gfx_SetFogWithSync",), 0x8012BD8C:("Gfx_SetFogWithSync",),
0x8012BF08:("Gfx_SetFog2",), 0x8012BF08:("Gfx_SetFog2",),
@ -9710,7 +9710,7 @@
0x80A134B0:("func_80A134B0",), 0x80A134B0:("func_80A134B0",),
0x80A134F4:("func_80A134F4",), 0x80A134F4:("func_80A134F4",),
0x80A13564:("func_80A13564",), 0x80A13564:("func_80A13564",),
0x80A136B8:("func_80A136B8",), 0x80A136B8:("EnGo_RequestQuake",),
0x80A13728:("func_80A13728",), 0x80A13728:("func_80A13728",),
0x80A137C0:("func_80A137C0",), 0x80A137C0:("func_80A137C0",),
0x80A139E4:("func_80A139E4",), 0x80A139E4:("func_80A139E4",),
@ -10620,7 +10620,7 @@
0x80A53E60:("func_80A53E60",), 0x80A53E60:("func_80A53E60",),
0x80A541F4:("func_80A541F4",), 0x80A541F4:("func_80A541F4",),
0x80A54600:("func_80A54600",), 0x80A54600:("func_80A54600",),
0x80A54980:("ObjHugebombiwa_AddQuake",), 0x80A54980:("ObjHugebombiwa_RequestQuakeAndRumble",),
0x80A54A0C:("func_80A54A0C",), 0x80A54A0C:("func_80A54A0C",),
0x80A54AC0:("ObjHugebombiwa_Init",), 0x80A54AC0:("ObjHugebombiwa_Init",),
0x80A54BC4:("ObjHugebombiwa_Destroy",), 0x80A54BC4:("ObjHugebombiwa_Destroy",),
@ -11433,7 +11433,7 @@
0x80A9BC0C:("func_80A9BC0C",), 0x80A9BC0C:("func_80A9BC0C",),
0x80A9BD24:("func_80A9BD24",), 0x80A9BD24:("func_80A9BD24",),
0x80A9C058:("func_80A9C058",), 0x80A9C058:("func_80A9C058",),
0x80A9C18C:("func_80A9C18C",), 0x80A9C18C:("BgHakuginPost_RequestQuakeAndRumble",),
0x80A9C228:("func_80A9C228",), 0x80A9C228:("func_80A9C228",),
0x80A9C634:("func_80A9C634",), 0x80A9C634:("func_80A9C634",),
0x80A9C854:("func_80A9C854",), 0x80A9C854:("func_80A9C854",),
@ -12211,7 +12211,7 @@
0x80AD566C:("EnTrt2_TransformLimbDraw",), 0x80AD566C:("EnTrt2_TransformLimbDraw",),
0x80AD56E8:("func_80AD56E8",), 0x80AD56E8:("func_80AD56E8",),
0x80AD5BB0:("ObjTokeiStep_SetSysMatrix",), 0x80AD5BB0:("ObjTokeiStep_SetSysMatrix",),
0x80AD5BE8:("ObjTokeiStep_AddQuake",), 0x80AD5BE8:("ObjTokeiStep_RequestQuakeAndRumble",),
0x80AD5C70:("ObjTokeiStep_SpawnDust",), 0x80AD5C70:("ObjTokeiStep_SpawnDust",),
0x80AD5DFC:("ObjTokeiStep_InitSteps",), 0x80AD5DFC:("ObjTokeiStep_InitSteps",),
0x80AD5EB8:("ObjTokeiStep_InitStepsOpen",), 0x80AD5EB8:("ObjTokeiStep_InitStepsOpen",),
@ -16662,7 +16662,7 @@
0x80C0A740:("func_80C0A740",), 0x80C0A740:("func_80C0A740",),
0x80C0A804:("func_80C0A804",), 0x80C0A804:("func_80C0A804",),
0x80C0A838:("func_80C0A838",), 0x80C0A838:("func_80C0A838",),
0x80C0A86C:("func_80C0A86C",), 0x80C0A86C:("BgIkninSusceil_RequestQuakeAndRumble",),
0x80C0A95C:("func_80C0A95C",), 0x80C0A95C:("func_80C0A95C",),
0x80C0AA70:("BgIkninSusceil_Init",), 0x80C0AA70:("BgIkninSusceil_Init",),
0x80C0AAE0:("BgIkninSusceil_Destroy",), 0x80C0AAE0:("BgIkninSusceil_Destroy",),

View File

@ -1326,7 +1326,7 @@
0x801C0EA0:("D_801C0EA0","UNK_TYPE1","",0x1), 0x801C0EA0:("D_801C0EA0","UNK_TYPE1","",0x1),
0x801C0EAC:("sSheathLimbModelShieldOnBackPos","Vec3f","",0xC), 0x801C0EAC:("sSheathLimbModelShieldOnBackPos","Vec3f","",0xC),
0x801C0EB8:("sSheathLimbModelShieldOnBackZyxRot","Vec3s","",0x6), 0x801C0EB8:("sSheathLimbModelShieldOnBackZyxRot","Vec3s","",0x6),
0x801C0EC0:("sIsQuakeInitialized","UNK_TYPE2","",0x2), 0x801C0EC0:("sQuakeUnused","UNK_TYPE2","",0x2),
0x801C0EC4:("sQuakeRequestCount","s16","",0x2), 0x801C0EC4:("sQuakeRequestCount","s16","",0x2),
0x801C0EC8:("sQuakeCallbacks","quake_callback_func","[7]",0x1c), 0x801C0EC8:("sQuakeCallbacks","quake_callback_func","[7]",0x1c),
0x801C0EE4:("D_801C0EE4","s16","",0x2), 0x801C0EE4:("D_801C0EE4","s16","",0x2),
@ -4006,7 +4006,7 @@
0x801F59E8:("sPlayerGetItemRefPos","Vec3f","",0xC), 0x801F59E8:("sPlayerGetItemRefPos","Vec3f","",0xC),
0x801F59F4:("sPlayerLeftHandType","s32","",0x4), 0x801F59F4:("sPlayerLeftHandType","s32","",0x4),
0x801F59F8:("sPlayerRightHandType","s32","",0x4), 0x801F59F8:("sPlayerRightHandType","s32","",0x4),
0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90), 0x801F5A00:("sQuakeRequests","QuakeRequest","[4]",0x90),
0x801F5A90:("sDistortionRequest","DistortionRequest","",0xc), 0x801F5A90:("sDistortionRequest","DistortionRequest","",0xc),
0x801F5AA0:("sMatAnimStep","s32","",0x4), 0x801F5AA0:("sMatAnimStep","s32","",0x4),
0x801F5AA4:("sMatAnimFlags","u32","",0x4), 0x801F5AA4:("sMatAnimFlags","u32","",0x4),
@ -5679,8 +5679,8 @@
0x80872E8C:("D_80872E8C","UNK_TYPE1","",0x1), 0x80872E8C:("D_80872E8C","UNK_TYPE1","",0x1),
0x80872E90:("D_80872E90","UNK_TYPE4","",0x4), 0x80872E90:("D_80872E90","UNK_TYPE4","",0x4),
0x80872E94:("D_80872E94","UNK_TYPE4","",0x4), 0x80872E94:("D_80872E94","UNK_TYPE4","",0x4),
0x80872E98:("D_80872E98","UNK_TYPE1","",0x1), 0x80872E98:("sQuakeY","UNK_TYPE1","",0x1),
0x80872E9C:("D_80872E9C","UNK_TYPE1","",0x1), 0x80872E9C:("sQuakeDurations","UNK_TYPE1","",0x1),
0x80872EA0:("D_80872EA0","UNK_TYPE4","",0x4), 0x80872EA0:("D_80872EA0","UNK_TYPE4","",0x4),
0x80872EAC:("D_80872EAC","UNK_TYPE4","",0x4), 0x80872EAC:("D_80872EAC","UNK_TYPE4","",0x4),
0x80872EB8:("D_80872EB8","UNK_TYPE4","",0x4), 0x80872EB8:("D_80872EB8","UNK_TYPE4","",0x4),

View File

@ -321,7 +321,10 @@ wordReplace = {
"func_800B86C8": "Actor_ChangeFocus", "func_800B86C8": "Actor_ChangeFocus",
"func_800DF840": "Camera_ChangeMode", "func_800DF840": "Camera_ChangeMode",
"func_800B90F4": "Actor_DeactivateLens", "func_800B90F4": "Actor_DeactivateLens",
"func_800BC770": "Actor_AddQuake", "Actor_AddQuake": "Actor_RequestQuake",
"func_800BC770": "Actor_RequestQuake",
"Actor_AddQuakeWithSpeed": "Actor_RequestQuakeWithSpeed",
"func_800BC848": "Actor_RequestQuakeAndRumble",
"func_800DF840": "Camera_ChangeMode", "func_800DF840": "Camera_ChangeMode",
"zelda_malloc": "ZeldaArena_Malloc", "zelda_malloc": "ZeldaArena_Malloc",
"zelda_mallocR": "ZeldaArena_MallocR", "zelda_mallocR": "ZeldaArena_MallocR",
@ -635,12 +638,22 @@ wordReplace = {
"func_80114E90": "Inventory_HasEmptyBottle", "func_80114E90": "Inventory_HasEmptyBottle",
"func_80114F2C": "Inventory_HasItemInBottle", "func_80114F2C": "Inventory_HasItemInBottle",
"func_80123C90": "Player_SetEquipmentData", "func_80123C90": "Player_SetEquipmentData",
"Quake2_ClearType": "Distortion_ClearType", "Quake2_SetType": "Distortion_Request",
"Quake2_SetType": "Distortion_SetType", "Distortion_SetType": "Distortion_Request",
"Quake2_SetCountdown": "Distortion_SetCountdown", "Quake2_SetCountdown": "Distortion_SetDuration",
"Distortion_SetCountdown": "Distortion_SetDuration",
"Distortion_GetCountdown": "Distortion_GetTimeLeft",
"Quake2_ClearType": "Distortion_RemoveRequest",
"Distortion_ClearType": "Distortion_RemoveRequest",
"func_800BE680": "Actor_DrawDamageEffects", "func_800BE680": "Actor_DrawDamageEffects",
"func_8012F22C": "Inventory_GetSkullTokenCount", "func_8012F22C": "Inventory_GetSkullTokenCount",
"Quake_RemoveFromIdx": "Quake_Remove", "Quake_Add": "Quake_Request",
"Quake_SetQuakeValues": "Quake_SetPerturbations",
"Quake_SetCountdown": "Quake_SetDuration",
"Quake_GetCountdown": "Quake_GetTimeLeft",
"Quake_NumActiveQuakes": "Quake_GetNumActiveQuakes",
"Quake_RemoveFromIdx": "Quake_RemoveRequest",
"OLib_DbCameraVec3fSum":"OLib_Vec3fAdd",
"func_8013AB00": "SubS_DrawTransformFlex", "func_8013AB00": "SubS_DrawTransformFlex",
"func_8013A860": "SubS_DrawTransformFlexLimb", "func_8013A860": "SubS_DrawTransformFlexLimb",

View File

@ -373,9 +373,9 @@ asm/non_matchings/code/z_actor/Actor_TestFloorInDirection.s,Actor_TestFloorInDir
asm/non_matchings/code/z_actor/Actor_IsTargeted.s,Actor_IsTargeted,0x800BC5B8,0xD asm/non_matchings/code/z_actor/Actor_IsTargeted.s,Actor_IsTargeted,0x800BC5B8,0xD
asm/non_matchings/code/z_actor/Actor_OtherIsTargeted.s,Actor_OtherIsTargeted,0x800BC5EC,0xD asm/non_matchings/code/z_actor/Actor_OtherIsTargeted.s,Actor_OtherIsTargeted,0x800BC5EC,0xD
asm/non_matchings/code/z_actor/func_800BC620.s,func_800BC620,0x800BC620,0x54 asm/non_matchings/code/z_actor/func_800BC620.s,func_800BC620,0x800BC620,0x54
asm/non_matchings/code/z_actor/Actor_AddQuake.s,Actor_AddQuake,0x800BC770,0x1A asm/non_matchings/code/z_actor/Actor_RequestQuake.s,Actor_RequestQuake,0x800BC770,0x1A
asm/non_matchings/code/z_actor/Actor_AddQuakeWithSpeed.s,Actor_AddQuakeWithSpeed,0x800BC7D8,0x1C asm/non_matchings/code/z_actor/Actor_RequestQuakeWithSpeed.s,Actor_RequestQuakeWithSpeed,0x800BC7D8,0x1C
asm/non_matchings/code/z_actor/func_800BC848.s,func_800BC848,0x800BC848,0x1C asm/non_matchings/code/z_actor/Actor_RequestQuakeAndRumble.s,Actor_RequestQuakeAndRumble,0x800BC848,0x1C
asm/non_matchings/code/z_actor/Actor_DrawDoorLock.s,Actor_DrawDoorLock,0x800BC8B8,0xA6 asm/non_matchings/code/z_actor/Actor_DrawDoorLock.s,Actor_DrawDoorLock,0x800BC8B8,0xA6
asm/non_matchings/code/z_actor/Actor_SpawnShieldParticlesMetal.s,Actor_SpawnShieldParticlesMetal,0x800BCB50,0x8 asm/non_matchings/code/z_actor/Actor_SpawnShieldParticlesMetal.s,Actor_SpawnShieldParticlesMetal,0x800BCB50,0x8
asm/non_matchings/code/z_actor/Actor_SetColorFilter.s,Actor_SetColorFilter,0x800BCB70,0x21 asm/non_matchings/code/z_actor/Actor_SetColorFilter.s,Actor_SetColorFilter,0x800BCB70,0x21
@ -1586,17 +1586,17 @@ asm/non_matchings/code/z_olib/OLib_ClampMinDist.s,OLib_ClampMinDist,0x8010C304,0
asm/non_matchings/code/z_olib/OLib_ClampMaxDist.s,OLib_ClampMaxDist,0x8010C36C,0x1A asm/non_matchings/code/z_olib/OLib_ClampMaxDist.s,OLib_ClampMaxDist,0x8010C36C,0x1A
asm/non_matchings/code/z_olib/OLib_Vec3fDistNormalize.s,OLib_Vec3fDistNormalize,0x8010C3D4,0x2C asm/non_matchings/code/z_olib/OLib_Vec3fDistNormalize.s,OLib_Vec3fDistNormalize,0x8010C3D4,0x2C
asm/non_matchings/code/z_olib/OLib_VecSphToVec3f.s,OLib_VecSphToVec3f,0x8010C484,0x2B asm/non_matchings/code/z_olib/OLib_VecSphToVec3f.s,OLib_VecSphToVec3f,0x8010C484,0x2B
asm/non_matchings/code/z_olib/OLib_VecSphGeoToVec3f.s,OLib_VecSphGeoToVec3f,0x8010C530,0x11 asm/non_matchings/code/z_olib/OLib_VecGeoToVec3f.s,OLib_VecGeoToVec3f,0x8010C530,0x11
asm/non_matchings/code/z_olib/OLib_Vec3fToVecSph.s,OLib_Vec3fToVecSph,0x8010C574,0x55 asm/non_matchings/code/z_olib/OLib_Vec3fToVecSph.s,OLib_Vec3fToVecSph,0x8010C574,0x55
asm/non_matchings/code/z_olib/OLib_Vec3fToVecSphGeo.s,OLib_Vec3fToVecSphGeo,0x8010C6C8,0x12 asm/non_matchings/code/z_olib/OLib_Vec3fToVecGeo.s,OLib_Vec3fToVecGeo,0x8010C6C8,0x12
asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecSph.s,OLib_Vec3fDiffToVecSph,0x8010C710,0x15 asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecSph.s,OLib_Vec3fDiffToVecSph,0x8010C710,0x15
asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecSphGeo.s,OLib_Vec3fDiffToVecSphGeo,0x8010C764,0x15 asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecGeo.s,OLib_Vec3fDiffToVecGeo,0x8010C764,0x15
asm/non_matchings/code/z_olib/OLib_VecSphAddToVec3f.s,OLib_VecSphAddToVec3f,0x8010C7B8,0x20 asm/non_matchings/code/z_olib/OLib_AddVecGeoToVec3f.s,OLib_AddVecGeoToVec3f,0x8010C7B8,0x20
asm/non_matchings/code/z_olib/OLib_Vec3fDiffRad.s,OLib_Vec3fDiffRad,0x8010C838,0x24 asm/non_matchings/code/z_olib/OLib_Vec3fDiffRad.s,OLib_Vec3fDiffRad,0x8010C838,0x24
asm/non_matchings/code/z_olib/OLib_Vec3fDiffDegF.s,OLib_Vec3fDiffDegF,0x8010C8C8,0x1A asm/non_matchings/code/z_olib/OLib_Vec3fDiffDegF.s,OLib_Vec3fDiffDegF,0x8010C8C8,0x1A
asm/non_matchings/code/z_olib/OLib_Vec3fDiffBinAng.s,OLib_Vec3fDiffBinAng,0x8010C930,0x26 asm/non_matchings/code/z_olib/OLib_Vec3fDiffBinAng.s,OLib_Vec3fDiffBinAng,0x8010C930,0x26
asm/non_matchings/code/z_olib/OLib_DbCameraVec3fDiff.s,OLib_DbCameraVec3fDiff,0x8010C9C8,0x36 asm/non_matchings/code/z_olib/OLib_Vec3fDiff.s,OLib_Vec3fDiff,0x8010C9C8,0x36
asm/non_matchings/code/z_olib/OLib_DbCameraVec3fSum.s,OLib_DbCameraVec3fSum,0x8010CAA0,0x34 asm/non_matchings/code/z_olib/OLib_Vec3fAdd.s,OLib_Vec3fAdd,0x8010CAA0,0x34
asm/non_matchings/code/z_parameter/Gfx_DrawTexRectRGBA16.s,Gfx_DrawTexRectRGBA16,0x8010CB80,0x86 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectRGBA16.s,Gfx_DrawTexRectRGBA16,0x8010CB80,0x86
asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8.s,Gfx_DrawTexRectIA8,0x8010CD98,0x89 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8.s,Gfx_DrawTexRectIA8,0x8010CD98,0x89
asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8_DropShadow.s,Gfx_DrawTexRectIA8_DropShadow,0x8010CFBC,0xC6 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8_DropShadow.s,Gfx_DrawTexRectIA8_DropShadow,0x8010CFBC,0xC6
@ -1803,28 +1803,28 @@ asm/non_matchings/code/z_quake/Quake_CallbackType3.s,Quake_CallbackType3,0x8012A
asm/non_matchings/code/z_quake/Quake_CallbackType2.s,Quake_CallbackType2,0x8012A4D0,0x1C asm/non_matchings/code/z_quake/Quake_CallbackType2.s,Quake_CallbackType2,0x8012A4D0,0x1C
asm/non_matchings/code/z_quake/Quake_CallbackType4.s,Quake_CallbackType4,0x8012A540,0x26 asm/non_matchings/code/z_quake/Quake_CallbackType4.s,Quake_CallbackType4,0x8012A540,0x26
asm/non_matchings/code/z_quake/Quake_GetFreeIndex.s,Quake_GetFreeIndex,0x8012A5D8,0x18 asm/non_matchings/code/z_quake/Quake_GetFreeIndex.s,Quake_GetFreeIndex,0x8012A5D8,0x18
asm/non_matchings/code/z_quake/Quake_AddImpl.s,Quake_AddImpl,0x8012A638,0x2E asm/non_matchings/code/z_quake/Quake_RequestImpl.s,Quake_RequestImpl,0x8012A638,0x2E
asm/non_matchings/code/z_quake/Quake_RemoveRequest.s,Quake_RemoveRequest,0x8012A6F0,0xA asm/non_matchings/code/z_quake/Quake_Remove.s,Quake_Remove,0x8012A6F0,0xA
asm/non_matchings/code/z_quake/Quake_GetRequest.s,Quake_GetRequest,0x8012A718,0x17 asm/non_matchings/code/z_quake/Quake_GetRequest.s,Quake_GetRequest,0x8012A718,0x17
asm/non_matchings/code/z_quake/Quake_SetValue.s,Quake_SetValue,0x8012A774,0x4D asm/non_matchings/code/z_quake/Quake_SetValue.s,Quake_SetValue,0x8012A774,0x4D
asm/non_matchings/code/z_quake/Quake_SetSpeed.s,Quake_SetSpeed,0x8012A8A8,0x12 asm/non_matchings/code/z_quake/Quake_SetSpeed.s,Quake_SetSpeed,0x8012A8A8,0x12
asm/non_matchings/code/z_quake/Quake_SetCountdown.s,Quake_SetCountdown,0x8012A8F0,0x14 asm/non_matchings/code/z_quake/Quake_SetDuration.s,Quake_SetDuration,0x8012A8F0,0x14
asm/non_matchings/code/z_quake/Quake_GetCountdown.s,Quake_GetCountdown,0x8012A940,0xE asm/non_matchings/code/z_quake/Quake_GetTimeLeft.s,Quake_GetTimeLeft,0x8012A940,0xE
asm/non_matchings/code/z_quake/Quake_SetQuakeValues.s,Quake_SetQuakeValues,0x8012A978,0x1A asm/non_matchings/code/z_quake/Quake_SetPerturbations.s,Quake_SetPerturbations,0x8012A978,0x1A
asm/non_matchings/code/z_quake/Quake_SetQuakeValues2.s,Quake_SetQuakeValues2,0x8012A9E0,0x1A asm/non_matchings/code/z_quake/Quake_SetOrientation.s,Quake_SetOrientation,0x8012A9E0,0x1A
asm/non_matchings/code/z_quake/Quake_Init.s,Quake_Init,0x8012AA48,0x15 asm/non_matchings/code/z_quake/Quake_Init.s,Quake_Init,0x8012AA48,0x15
asm/non_matchings/code/z_quake/Quake_Add.s,Quake_Add,0x8012AA9C,0x9 asm/non_matchings/code/z_quake/Quake_Request.s,Quake_Request,0x8012AA9C,0x9
asm/non_matchings/code/z_quake/Quake_Remove.s,Quake_Remove,0x8012AAC0,0x12 asm/non_matchings/code/z_quake/Quake_RemoveRequest.s,Quake_RemoveRequest,0x8012AAC0,0x12
asm/non_matchings/code/z_quake/Quake_Calc.s,Quake_Calc,0x8012AB08,0xD8 asm/non_matchings/code/z_quake/Quake_Update.s,Quake_Update,0x8012AB08,0xD8
asm/non_matchings/code/z_quake/Distortion_Init.s,Distortion_Init,0x8012AE68,0x11 asm/non_matchings/code/z_quake/Distortion_Init.s,Distortion_Init,0x8012AE68,0x11
asm/non_matchings/code/z_quake/Distortion_SetCountdown.s,Distortion_SetCountdown,0x8012AEAC,0xA asm/non_matchings/code/z_quake/Distortion_SetDuration.s,Distortion_SetDuration,0x8012AEAC,0xA
asm/non_matchings/code/z_quake/Distortion_GetCountdown.s,Distortion_GetCountdown,0x8012AED4,0x4 asm/non_matchings/code/z_quake/Distortion_GetTimeLeft.s,Distortion_GetTimeLeft,0x8012AED4,0x4
asm/non_matchings/code/z_quake/Distortion_GetType.s,Distortion_GetType,0x8012AEE4,0x4 asm/non_matchings/code/z_quake/Distortion_GetType.s,Distortion_GetType,0x8012AEE4,0x4
asm/non_matchings/code/z_quake/Distortion_SetType.s,Distortion_SetType,0x8012AEF4,0x9 asm/non_matchings/code/z_quake/Distortion_Request.s,Distortion_Request,0x8012AEF4,0x9
asm/non_matchings/code/z_quake/Distortion_ClearType.s,Distortion_ClearType,0x8012AF18,0x8 asm/non_matchings/code/z_quake/Distortion_RemoveRequest.s,Distortion_RemoveRequest,0x8012AF18,0x8
asm/non_matchings/code/z_quake/Distortion_GetUnderwaterCurrentSpeed.s,Distortion_GetUnderwaterCurrentSpeed,0x8012AF38,0x19 asm/non_matchings/code/z_quake/Distortion_GetUnderwaterCurrentSpeed.s,Distortion_GetUnderwaterCurrentSpeed,0x8012AF38,0x19
asm/non_matchings/code/z_quake/Distortion_Update.s,Distortion_Update,0x8012AF9C,0x313 asm/non_matchings/code/z_quake/Distortion_Update.s,Distortion_Update,0x8012AF9C,0x313
asm/non_matchings/code/z_quake/Quake_NumActiveQuakes.s,Quake_NumActiveQuakes,0x8012BBE8,0x1A asm/non_matchings/code/z_quake/Quake_GetNumActiveQuakes.s,Quake_GetNumActiveQuakes,0x8012BBE8,0x1A
asm/non_matchings/code/z_rcp/Gfx_SetFog.s,Gfx_SetFog,0x8012BC50,0x4F asm/non_matchings/code/z_rcp/Gfx_SetFog.s,Gfx_SetFog,0x8012BC50,0x4F
asm/non_matchings/code/z_rcp/Gfx_SetFogWithSync.s,Gfx_SetFogWithSync,0x8012BD8C,0x5F asm/non_matchings/code/z_rcp/Gfx_SetFogWithSync.s,Gfx_SetFogWithSync,0x8012BD8C,0x5F
asm/non_matchings/code/z_rcp/Gfx_SetFog2.s,Gfx_SetFog2,0x8012BF08,0xD asm/non_matchings/code/z_rcp/Gfx_SetFog2.s,Gfx_SetFog2,0x8012BF08,0xD

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
373 asm/non_matchings/code/z_actor/Actor_IsTargeted.s Actor_IsTargeted 0x800BC5B8 0xD
374 asm/non_matchings/code/z_actor/Actor_OtherIsTargeted.s Actor_OtherIsTargeted 0x800BC5EC 0xD
375 asm/non_matchings/code/z_actor/func_800BC620.s func_800BC620 0x800BC620 0x54
376 asm/non_matchings/code/z_actor/Actor_AddQuake.s asm/non_matchings/code/z_actor/Actor_RequestQuake.s Actor_AddQuake Actor_RequestQuake 0x800BC770 0x1A
377 asm/non_matchings/code/z_actor/Actor_AddQuakeWithSpeed.s asm/non_matchings/code/z_actor/Actor_RequestQuakeWithSpeed.s Actor_AddQuakeWithSpeed Actor_RequestQuakeWithSpeed 0x800BC7D8 0x1C
378 asm/non_matchings/code/z_actor/func_800BC848.s asm/non_matchings/code/z_actor/Actor_RequestQuakeAndRumble.s func_800BC848 Actor_RequestQuakeAndRumble 0x800BC848 0x1C
379 asm/non_matchings/code/z_actor/Actor_DrawDoorLock.s Actor_DrawDoorLock 0x800BC8B8 0xA6
380 asm/non_matchings/code/z_actor/Actor_SpawnShieldParticlesMetal.s Actor_SpawnShieldParticlesMetal 0x800BCB50 0x8
381 asm/non_matchings/code/z_actor/Actor_SetColorFilter.s Actor_SetColorFilter 0x800BCB70 0x21
1586 asm/non_matchings/code/z_olib/OLib_ClampMaxDist.s OLib_ClampMaxDist 0x8010C36C 0x1A
1587 asm/non_matchings/code/z_olib/OLib_Vec3fDistNormalize.s OLib_Vec3fDistNormalize 0x8010C3D4 0x2C
1588 asm/non_matchings/code/z_olib/OLib_VecSphToVec3f.s OLib_VecSphToVec3f 0x8010C484 0x2B
1589 asm/non_matchings/code/z_olib/OLib_VecSphGeoToVec3f.s asm/non_matchings/code/z_olib/OLib_VecGeoToVec3f.s OLib_VecSphGeoToVec3f OLib_VecGeoToVec3f 0x8010C530 0x11
1590 asm/non_matchings/code/z_olib/OLib_Vec3fToVecSph.s OLib_Vec3fToVecSph 0x8010C574 0x55
1591 asm/non_matchings/code/z_olib/OLib_Vec3fToVecSphGeo.s asm/non_matchings/code/z_olib/OLib_Vec3fToVecGeo.s OLib_Vec3fToVecSphGeo OLib_Vec3fToVecGeo 0x8010C6C8 0x12
1592 asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecSph.s OLib_Vec3fDiffToVecSph 0x8010C710 0x15
1593 asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecSphGeo.s asm/non_matchings/code/z_olib/OLib_Vec3fDiffToVecGeo.s OLib_Vec3fDiffToVecSphGeo OLib_Vec3fDiffToVecGeo 0x8010C764 0x15
1594 asm/non_matchings/code/z_olib/OLib_VecSphAddToVec3f.s asm/non_matchings/code/z_olib/OLib_AddVecGeoToVec3f.s OLib_VecSphAddToVec3f OLib_AddVecGeoToVec3f 0x8010C7B8 0x20
1595 asm/non_matchings/code/z_olib/OLib_Vec3fDiffRad.s OLib_Vec3fDiffRad 0x8010C838 0x24
1596 asm/non_matchings/code/z_olib/OLib_Vec3fDiffDegF.s OLib_Vec3fDiffDegF 0x8010C8C8 0x1A
1597 asm/non_matchings/code/z_olib/OLib_Vec3fDiffBinAng.s OLib_Vec3fDiffBinAng 0x8010C930 0x26
1598 asm/non_matchings/code/z_olib/OLib_DbCameraVec3fDiff.s asm/non_matchings/code/z_olib/OLib_Vec3fDiff.s OLib_DbCameraVec3fDiff OLib_Vec3fDiff 0x8010C9C8 0x36
1599 asm/non_matchings/code/z_olib/OLib_DbCameraVec3fSum.s asm/non_matchings/code/z_olib/OLib_Vec3fAdd.s OLib_DbCameraVec3fSum OLib_Vec3fAdd 0x8010CAA0 0x34
1600 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectRGBA16.s Gfx_DrawTexRectRGBA16 0x8010CB80 0x86
1601 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8.s Gfx_DrawTexRectIA8 0x8010CD98 0x89
1602 asm/non_matchings/code/z_parameter/Gfx_DrawTexRectIA8_DropShadow.s Gfx_DrawTexRectIA8_DropShadow 0x8010CFBC 0xC6
1803 asm/non_matchings/code/z_quake/Quake_CallbackType2.s Quake_CallbackType2 0x8012A4D0 0x1C
1804 asm/non_matchings/code/z_quake/Quake_CallbackType4.s Quake_CallbackType4 0x8012A540 0x26
1805 asm/non_matchings/code/z_quake/Quake_GetFreeIndex.s Quake_GetFreeIndex 0x8012A5D8 0x18
1806 asm/non_matchings/code/z_quake/Quake_AddImpl.s asm/non_matchings/code/z_quake/Quake_RequestImpl.s Quake_AddImpl Quake_RequestImpl 0x8012A638 0x2E
1807 asm/non_matchings/code/z_quake/Quake_RemoveRequest.s asm/non_matchings/code/z_quake/Quake_Remove.s Quake_RemoveRequest Quake_Remove 0x8012A6F0 0xA
1808 asm/non_matchings/code/z_quake/Quake_GetRequest.s Quake_GetRequest 0x8012A718 0x17
1809 asm/non_matchings/code/z_quake/Quake_SetValue.s Quake_SetValue 0x8012A774 0x4D
1810 asm/non_matchings/code/z_quake/Quake_SetSpeed.s Quake_SetSpeed 0x8012A8A8 0x12
1811 asm/non_matchings/code/z_quake/Quake_SetCountdown.s asm/non_matchings/code/z_quake/Quake_SetDuration.s Quake_SetCountdown Quake_SetDuration 0x8012A8F0 0x14
1812 asm/non_matchings/code/z_quake/Quake_GetCountdown.s asm/non_matchings/code/z_quake/Quake_GetTimeLeft.s Quake_GetCountdown Quake_GetTimeLeft 0x8012A940 0xE
1813 asm/non_matchings/code/z_quake/Quake_SetQuakeValues.s asm/non_matchings/code/z_quake/Quake_SetPerturbations.s Quake_SetQuakeValues Quake_SetPerturbations 0x8012A978 0x1A
1814 asm/non_matchings/code/z_quake/Quake_SetQuakeValues2.s asm/non_matchings/code/z_quake/Quake_SetOrientation.s Quake_SetQuakeValues2 Quake_SetOrientation 0x8012A9E0 0x1A
1815 asm/non_matchings/code/z_quake/Quake_Init.s Quake_Init 0x8012AA48 0x15
1816 asm/non_matchings/code/z_quake/Quake_Add.s asm/non_matchings/code/z_quake/Quake_Request.s Quake_Add Quake_Request 0x8012AA9C 0x9
1817 asm/non_matchings/code/z_quake/Quake_Remove.s asm/non_matchings/code/z_quake/Quake_RemoveRequest.s Quake_Remove Quake_RemoveRequest 0x8012AAC0 0x12
1818 asm/non_matchings/code/z_quake/Quake_Calc.s asm/non_matchings/code/z_quake/Quake_Update.s Quake_Calc Quake_Update 0x8012AB08 0xD8
1819 asm/non_matchings/code/z_quake/Distortion_Init.s Distortion_Init 0x8012AE68 0x11
1820 asm/non_matchings/code/z_quake/Distortion_SetCountdown.s asm/non_matchings/code/z_quake/Distortion_SetDuration.s Distortion_SetCountdown Distortion_SetDuration 0x8012AEAC 0xA
1821 asm/non_matchings/code/z_quake/Distortion_GetCountdown.s asm/non_matchings/code/z_quake/Distortion_GetTimeLeft.s Distortion_GetCountdown Distortion_GetTimeLeft 0x8012AED4 0x4
1822 asm/non_matchings/code/z_quake/Distortion_GetType.s Distortion_GetType 0x8012AEE4 0x4
1823 asm/non_matchings/code/z_quake/Distortion_SetType.s asm/non_matchings/code/z_quake/Distortion_Request.s Distortion_SetType Distortion_Request 0x8012AEF4 0x9
1824 asm/non_matchings/code/z_quake/Distortion_ClearType.s asm/non_matchings/code/z_quake/Distortion_RemoveRequest.s Distortion_ClearType Distortion_RemoveRequest 0x8012AF18 0x8
1825 asm/non_matchings/code/z_quake/Distortion_GetUnderwaterCurrentSpeed.s Distortion_GetUnderwaterCurrentSpeed 0x8012AF38 0x19
1826 asm/non_matchings/code/z_quake/Distortion_Update.s Distortion_Update 0x8012AF9C 0x313
1827 asm/non_matchings/code/z_quake/Quake_NumActiveQuakes.s asm/non_matchings/code/z_quake/Quake_GetNumActiveQuakes.s Quake_NumActiveQuakes Quake_GetNumActiveQuakes 0x8012BBE8 0x1A
1828 asm/non_matchings/code/z_rcp/Gfx_SetFog.s Gfx_SetFog 0x8012BC50 0x4F
1829 asm/non_matchings/code/z_rcp/Gfx_SetFogWithSync.s Gfx_SetFogWithSync 0x8012BD8C 0x5F
1830 asm/non_matchings/code/z_rcp/Gfx_SetFog2.s Gfx_SetFog2 0x8012BF08 0xD