From 1df6a3ee12025437f562c4905538244062edd34c Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Thu, 12 Jun 2025 21:46:13 +0200 Subject: [PATCH 1/9] Assets: Move limb enums into xmls 1 (#2625) --- assets/xml/objects/object_anubice.xml | 32 ++++++------- assets/xml/objects/object_bl.xml | 10 ++-- assets/xml/objects/object_bw.xml | 24 +++++----- assets/xml/objects/object_gndd.xml | 48 +++++++++---------- assets/xml/objects/object_im.xml | 34 ++++++------- src/overlays/actors/ovl_Demo_Im/z_demo_im.h | 23 +-------- .../actors/ovl_En_Anubice/z_en_anubice.h | 22 +-------- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 8 ++-- src/overlays/actors/ovl_En_Bili/z_en_bili.h | 15 ++---- src/overlays/actors/ovl_En_Bw/z_en_bw.h | 18 +------ .../actors/ovl_En_Viewer/z_en_viewer.h | 28 ----------- 11 files changed, 88 insertions(+), 174 deletions(-) diff --git a/assets/xml/objects/object_anubice.xml b/assets/xml/objects/object_anubice.xml index 492a8e4235..903804f74a 100644 --- a/assets/xml/objects/object_anubice.xml +++ b/assets/xml/objects/object_anubice.xml @@ -1,6 +1,6 @@ - + @@ -69,20 +69,20 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bl.xml b/assets/xml/objects/object_bl.xml index a987840a31..3ae9c89dc0 100644 --- a/assets/xml/objects/object_bl.xml +++ b/assets/xml/objects/object_bl.xml @@ -34,10 +34,10 @@ - - - - - + + + + + diff --git a/assets/xml/objects/object_bw.xml b/assets/xml/objects/object_bw.xml index 27a84f18f2..e7693b47aa 100644 --- a/assets/xml/objects/object_bw.xml +++ b/assets/xml/objects/object_bw.xml @@ -33,20 +33,20 @@ - - - - - - - - - - - + + + + + + + + + + + - + diff --git a/assets/xml/objects/object_gndd.xml b/assets/xml/objects/object_gndd.xml index d284893579..8f119f05ef 100644 --- a/assets/xml/objects/object_gndd.xml +++ b/assets/xml/objects/object_gndd.xml @@ -145,31 +145,31 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/assets/xml/objects/object_im.xml b/assets/xml/objects/object_im.xml index c6ce6b6890..546f38a9a3 100644 --- a/assets/xml/objects/object_im.xml +++ b/assets/xml/objects/object_im.xml @@ -107,23 +107,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h index ac3e06250c..ddbec02833 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -4,32 +4,13 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_im/object_im.h" + struct DemoIm; typedef void (*DemoImActionFunc)(struct DemoIm*, struct PlayState*); typedef void (*DemoImDrawFunc)(struct DemoIm*, struct PlayState*); -typedef enum ImpaLimb { - /* 0x00 */ IMPA_LIMB_NONE, - /* 0x01 */ IMPA_LIMB_ROOT, - /* 0x02 */ IMPA_LIMB_TORSO, - /* 0x03 */ IMPA_LIMB_LEFT_THIGH, - /* 0x04 */ IMPA_LIMB_LEFT_LEG, - /* 0x05 */ IMPA_LIMB_LEFT_FOOT, - /* 0x06 */ IMPA_LIMB_RIGHT_THIGH, - /* 0x07 */ IMPA_LIMB_RIGHT_LEG, - /* 0x08 */ IMPA_LIMB_RIGHT_FOOT, - /* 0x09 */ IMPA_LIMB_CHEST, - /* 0x0A */ IMPA_LIMB_LEFT_SHOULDER, - /* 0x0B */ IMPA_LIMB_LEFT_ARM, - /* 0x0C */ IMPA_LIMB_LEFT_HAND, - /* 0x0D */ IMPA_LIMB_RIGHT_SHOULDER, - /* 0x0E */ IMPA_LIMB_RIGHT_ARM, - /* 0x0F */ IMPA_LIMB_RIGHT_HAND, - /* 0x10 */ IMPA_LIMB_HEAD, - /* 0x11 */ IMPA_LIMB_MAX -} ImpaLimb; - typedef struct DemoIm { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h index 51b143fa1e..fd54405a29 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -4,30 +4,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_anubice/object_anubice.h" + struct EnAnubice; typedef void (*EnAnubiceActionFunc)(struct EnAnubice*, struct PlayState*); -typedef enum AnubiceLimbs { - /* 0 */ ANUBICE_LIMB_NONE, - /* 1 */ ANUBICE_LIMB_ROOT, - /* 2 */ ANUBICE_LIMB_BODY_ROOT, - /* 3 */ ANUBICE_LIMB_CHEST, - /* 4 */ ANUBICE_LIMB_ABDOMEN_ROOT, - /* 5 */ ANUBICE_LIMB_UPPER_ABDOMEN, - /* 6 */ ANUBICE_LIMB_LOWER_ABDOMEN, - /* 7 */ ANUBICE_LIMB_TAIL_ROOT, - /* 8 */ ANUBICE_LIMB_TAIL_BASE, - /* 9 */ ANUBICE_LIMB_TAIL_TIP, - /* 10 */ ANUBICE_LIMB_JEWEL_ROOT, - /* 11 */ ANUBICE_LIMB_JEWEL, - /* 12 */ ANUBICE_LIMB_HEAD_ROOT, - /* 13 */ ANUBICE_LIMB_HEAD, - /* 14 */ ANUBICE_LIMB_JAW_ROOT, - /* 15 */ ANUBICE_LIMB_JAW, - /* 16 */ ANUBICE_LIMB_MAX -} AnubiceLimbs; - typedef struct EnAnubice { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 0e7c532efb..4f7ef8cde7 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -134,7 +134,7 @@ void EnBili_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 17.0f); this->actor.shape.shadowAlpha = 155; SkelAnime_Init(play, &this->skelAnime, &gBiriSkel, &gBiriDefaultAnim, this->jointTable, this->morphTable, - EN_BILI_LIMB_MAX); + BIRI_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -749,11 +749,11 @@ s32 EnBili_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* Vec3f limbScale = { 1.0f, 1.0f, 1.0f }; f32 curFrame = this->skelAnime.curFrame; - if (limbIndex == EN_BILI_LIMB_OUTER_HOOD) { + if (limbIndex == BIRI_LIMB_OUTER_HOOD) { EnBili_PulseLimb3(this, curFrame, &limbScale); - } else if (limbIndex == EN_BILI_LIMB_INNER_HOOD) { + } else if (limbIndex == BIRI_LIMB_INNER_HOOD) { EnBili_PulseLimb2(this, curFrame, &limbScale); - } else if (limbIndex == EN_BILI_LIMB_TENTACLES) { + } else if (limbIndex == BIRI_LIMB_TENTACLES) { EnBili_PulseLimb4(this, curFrame, &limbScale); rot->y = (Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y) + 0x8000; } diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/src/overlays/actors/ovl_En_Bili/z_en_bili.h index b0e58c4679..0675847ee2 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -4,19 +4,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_bl/object_bl.h" + struct EnBili; typedef void (*EnBiliActionFunc)(struct EnBili*, struct PlayState*); -typedef enum EnBiliLimb { - /* 0 */ EN_BILI_LIMB_NONE, - /* 1 */ EN_BILI_LIMB_ROOT, - /* 2 */ EN_BILI_LIMB_INNER_HOOD, - /* 3 */ EN_BILI_LIMB_OUTER_HOOD, - /* 4 */ EN_BILI_LIMB_TENTACLES, - /* 5 */ EN_BILI_LIMB_MAX -} EnBiliLimb; - typedef struct EnBili { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -24,8 +17,8 @@ typedef struct EnBili { /* 0x0194 */ u8 tentaclesTexIndex; /* 0x0195 */ u8 playFlySfx; /* 0x0196 */ s16 timer; - /* 0x0198 */ Vec3s jointTable[EN_BILI_LIMB_MAX]; - /* 0x01B6 */ Vec3s morphTable[EN_BILI_LIMB_MAX]; + /* 0x0198 */ Vec3s jointTable[BIRI_LIMB_MAX]; + /* 0x01B6 */ Vec3s morphTable[BIRI_LIMB_MAX]; /* 0x01D4 */ ColliderCylinder collider; } EnBili; // size = 0x0220 diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h index fe9f8ef90a..e3ae7da245 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -4,25 +4,11 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_bw/object_bw.h" + struct EnBw; typedef void (*EnBwActionFunc)(struct EnBw*, struct PlayState*); -typedef enum TorchSlugLimb { - /* 0 */ TORCH_SLUG_LIMB_NONE, - /* 1 */ TORCH_SLUG_LIMB_BODY, - /* 2 */ TORCH_SLUG_LIMB_LEFT_EYESTALK_ROOT_ROOT, - /* 3 */ TORCH_SLUG_LIMB_LEFT_EYESTALK_ROOT, - /* 4 */ TORCH_SLUG_LIMB_LEFT_UPPER_EYESTALK_ROOT, - /* 5 */ TORCH_SLUG_LIMB_LEFT_UPPER_EYESTALK, - /* 6 */ TORCH_SLUG_LIMB_LEFT_LOWER_EYESTALK, - /* 7 */ TORCH_SLUG_LIMB_RIGHT_EYESTALK_ROOT_ROOT, - /* 8 */ TORCH_SLUG_LIMB_RIGHT_EYESTALK_ROOT, - /* 9 */ TORCH_SLUG_LIMB_RIGHT_UPPER_EYESTALK_ROOT, - /* 10 */ TORCH_SLUG_LIMB_RIGHT_UPPER_EYESTALK, - /* 11 */ TORCH_SLUG_LIMB_RIGHT_LOWER_EYESTALK, - /* 12 */ TORCH_SLUG_LIMB_MAX -} TorchSlugLimb; - typedef struct EnBw { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index 1bb5780203..c23a2edba4 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -59,34 +59,6 @@ typedef struct EnViewerFireEffect { /* 0x30 */ u8 state; } EnViewerFireEffect; // size = 0x34 -typedef enum YoungGanondorfLimb { - /* 0 */ YOUNG_GANONDORF_LIMB_NONE, - /* 1 */ YOUNG_GANONDORF_LIMB_ROOT, - /* 2 */ YOUNG_GANONDORF_LIMB_TORSO, - /* 3 */ YOUNG_GANONDORF_LIMB_LEFT_UPPER_ARM, - /* 4 */ YOUNG_GANONDORF_LIMB_LEFT_FOREARM, - /* 5 */ YOUNG_GANONDORF_LIMB_LEFT_HAND, - /* 6 */ YOUNG_GANONDORF_LIMB_RIGHT_UPPER_ARM, - /* 7 */ YOUNG_GANONDORF_LIMB_RIGHT_FOREARM, - /* 8 */ YOUNG_GANONDORF_LIMB_RIGHT_HAND, - /* 9 */ YOUNG_GANONDORF_LIMB_JEWEL, - /* 10 */ YOUNG_GANONDORF_LIMB_LEFT_UPPER_LIP, - /* 11 */ YOUNG_GANONDORF_LIMB_JAW, - /* 12 */ YOUNG_GANONDORF_LIMB_CHIN, - /* 13 */ YOUNG_GANONDORF_LIMB_RIGHT_UPPER_LIP, - /* 14 */ YOUNG_GANONDORF_LIMB_TEETH, - /* 15 */ YOUNG_GANONDORF_LIMB_HEAD, - /* 16 */ YOUNG_GANONDORF_LIMB_PELVIS, - /* 17 */ YOUNG_GANONDORF_LIMB_LEFT_THIGH, - /* 18 */ YOUNG_GANONDORF_LIMB_LEFT_SHIN, - /* 19 */ YOUNG_GANONDORF_LIMB_LEFT_FOOT, - /* 20 */ YOUNG_GANONDORF_LIMB_KNIFE, - /* 21 */ YOUNG_GANONDORF_LIMB_RIGHT_THIGH, - /* 22 */ YOUNG_GANONDORF_LIMB_RIGHT_SHIN, - /* 23 */ YOUNG_GANONDORF_LIMB_RIGHT_FOOT, - /* 24 */ YOUNG_GANONDORF_LIMB_MAX -} YoungGanondorfLimb; - typedef struct EnViewer { /* 0x0000 */ Actor actor; /* 0x014C */ Skin skin; From e4e14a6bcf1d591ce34ccc3eea01faea18f07316 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Thu, 12 Jun 2025 23:23:47 +0200 Subject: [PATCH 2/9] Assets: Move limb enums into xmls 2 (#2626) --- assets/xml/objects/object_fu.xml | 32 ++++++------- assets/xml/objects/object_ge1.xml | 32 ++++++------- assets/xml/objects/object_geldb.xml | 48 +++++++++---------- assets/xml/objects/object_hata.xml | 42 ++++++++-------- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 12 ++--- src/overlays/actors/ovl_En_Fu/z_en_fu.h | 26 ++-------- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 9 ++-- src/overlays/actors/ovl_En_Ge1/z_en_ge1.h | 26 ++-------- src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 20 ++++---- src/overlays/actors/ovl_En_Ge3/z_en_ge3.h | 7 +-- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 35 +++++++------- src/overlays/actors/ovl_En_GeldB/z_en_geldb.h | 34 ++----------- src/overlays/actors/ovl_En_Hata/z_en_hata.h | 26 +--------- 13 files changed, 133 insertions(+), 216 deletions(-) diff --git a/assets/xml/objects/object_fu.xml b/assets/xml/objects/object_fu.xml index 1bc18759a5..4a5bb6c74d 100644 --- a/assets/xml/objects/object_fu.xml +++ b/assets/xml/objects/object_fu.xml @@ -35,22 +35,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ge1.xml b/assets/xml/objects/object_ge1.xml index bbb5d82a0d..0aaaf59b7b 100644 --- a/assets/xml/objects/object_ge1.xml +++ b/assets/xml/objects/object_ge1.xml @@ -2,24 +2,24 @@ - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_geldb.xml b/assets/xml/objects/object_geldb.xml index f80ad410a6..1488db00b0 100644 --- a/assets/xml/objects/object_geldb.xml +++ b/assets/xml/objects/object_geldb.xml @@ -1,7 +1,7 @@ - + @@ -120,28 +120,28 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_hata.xml b/assets/xml/objects/object_hata.xml index 98887b030d..7a8beff3a4 100644 --- a/assets/xml/objects/object_hata.xml +++ b/assets/xml/objects/object_hata.xml @@ -7,29 +7,29 @@ - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index e8cfb6342f..9495395aa3 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -92,7 +92,7 @@ void EnFu_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelanime, &gWindmillManSkel, &gWindmillManPlayStillAnim, this->jointTable, - this->morphTable, FU_LIMB_MAX); + this->morphTable, WINDMILL_MAN_LIMB_MAX); Animation_PlayLoop(&this->skelanime, &gWindmillManPlayStillAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -276,15 +276,15 @@ s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnFu* this = (EnFu*)thisx; s32 pad; - if (limbIndex == FU_LIMB_UNK) { + if (limbIndex == WINDMILL_MAN_LIMB_UNK) { return false; } switch (limbIndex) { - case FU_LIMB_HEAD: + case WINDMILL_MAN_LIMB_HEAD: rot->x += this->lookAngleOffset.y; rot->z += this->lookAngleOffset.x; break; - case FU_LIMB_CHEST_MUSIC_BOX: + case WINDMILL_MAN_LIMB_CHEST_MUSIC_BOX: break; } @@ -292,7 +292,7 @@ s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po return false; } - if (limbIndex == FU_LIMB_CHEST_MUSIC_BOX) { + if (limbIndex == WINDMILL_MAN_LIMB_CHEST_MUSIC_BOX) { rot->y += Math_SinS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y))) * FIDGET_AMPLITUDE; rot->z += Math_CosS((play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z))) * FIDGET_AMPLITUDE; } @@ -302,7 +302,7 @@ s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnFu_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnFu* this = (EnFu*)thisx; - if (limbIndex == FU_LIMB_HEAD) { + if (limbIndex == WINDMILL_MAN_LIMB_HEAD) { Matrix_MultVec3f(&sMtxSrc, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index d2138f7613..bfd2842e14 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -4,36 +4,18 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_fu/object_fu.h" + struct EnFu; typedef void (*EnFuActionFunc)(struct EnFu*, struct PlayState*); -typedef enum EnFuLimb { - /* 0x00 */ FU_LIMB_ROOT, - /* 0x01 */ FU_LIMB_TORSO, - /* 0x02 */ FU_LIMB_LEFT_THIGH, - /* 0x03 */ FU_LIMB_LEFT_LEG, - /* 0x04 */ FU_LIMB_LEFT_FOOT, - /* 0x05 */ FU_LIMB_RIGHT_THIGH, - /* 0x06 */ FU_LIMB_RIGHT_LEG, - /* 0x07 */ FU_LIMB_RIGHT_FOOT, - /* 0x08 */ FU_LIMB_CHEST_MUSIC_BOX, - /* 0x09 */ FU_LIMB_LEFT_ARM_MUSIC_BOX, - /* 0x0A */ FU_LIMB_UNK, - /* 0x0B */ FU_LIMB_RIGHT_SHOULDER, - /* 0x0C */ FU_LIMB_RIGHT_ARM, - /* 0x0D */ FU_LIMB_RIGHT_HAND_AND_CRANK, - /* 0x0E */ FU_LIMB_HEAD, - /* 0x0F */ FU_LIMB_HORN, - /* 0x10 */ FU_LIMB_MAX -} EnFuLimb; - typedef struct EnFu { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ SkelAnime skelanime; - /* 0x01DC */ Vec3s jointTable[FU_LIMB_MAX]; - /* 0x023C */ Vec3s morphTable[FU_LIMB_MAX]; + /* 0x01DC */ Vec3s jointTable[WINDMILL_MAN_LIMB_MAX]; + /* 0x023C */ Vec3s morphTable[WINDMILL_MAN_LIMB_MAX]; /* 0x029C */ Vec3s lookAngleOffset; // offset applied to neck rotation to look at link when he is close /* 0x02A2 */ Vec3s unk_2A2; /* 0x02A8 */ u16 behaviorFlags; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 6d08efd921..01ebeccfc3 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -107,7 +107,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoWhiteSkel, &gGerudoWhiteIdleAnim, this->jointTable, - this->morphTable, GE1_LIMB_MAX); + this->morphTable, GERUDO_WHITE_LIMB_MAX); Animation_PlayOnce(&this->skelAnime, &gGerudoWhiteIdleAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -780,7 +780,7 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p s32 pad; EnGe1* this = (EnGe1*)thisx; - if (limbIndex == GE1_LIMB_HEAD) { + if (limbIndex == GERUDO_WHITE_LIMB_HEAD) { rot->x += this->headRot.y; rot->z += this->headRot.x; } @@ -792,7 +792,8 @@ s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p // The purpose of the state flag GE1_STATE_STOP_FIDGET is to skip this code, which this actor has in lieu of an idle // animation. - if ((limbIndex == GE1_LIMB_TORSO) || (limbIndex == GE1_LIMB_L_FOREARM) || (limbIndex == GE1_LIMB_R_FOREARM)) { + if ((limbIndex == GERUDO_WHITE_LIMB_TORSO) || (limbIndex == GERUDO_WHITE_LIMB_L_FOREARM) || + (limbIndex == GERUDO_WHITE_LIMB_R_FOREARM)) { rot->y += Math_SinS(play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Y)) * FIDGET_AMPLITUDE; rot->z += Math_CosS(play->state.frames * (limbIndex * FIDGET_FREQ_LIMB + FIDGET_FREQ_Z)) * FIDGET_AMPLITUDE; } @@ -804,7 +805,7 @@ void EnGe1_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, OPEN_DISPS(play->state.gfxCtx, "../z_en_ge1.c", 1419); - if (limbIndex == GE1_LIMB_HEAD) { + if (limbIndex == GERUDO_WHITE_LIMB_HEAD) { gSPDisplayList(POLY_OPA_DISP++, sHairstyleDLists[this->hairstyle]); Matrix_MultVec3f(&D_80A327A8, &this->actor.focus.pos); } diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index 077f0f9cc0..4566dacbbd 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -4,6 +4,8 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_ge1/object_ge1.h" + struct EnGe1; typedef void (*EnGe1AnimFunc)(struct EnGe1*); @@ -18,32 +20,12 @@ typedef enum EnGe1Type { /* 0x46 */ GE1_TYPE_TRAINING_GROUNDS_GUARD } EnGe1Type; -typedef enum EnGe1Limb { - /* 00 */ GE1_LIMB_NONE, - /* 01 */ GE1_LIMB_WAIST, - /* 02 */ GE1_LIMB_L_THIGH, - /* 03 */ GE1_LIMB_L_LOWER_LEG, - /* 04 */ GE1_LIMB_L_FOOT, - /* 05 */ GE1_LIMB_R_THIGH, - /* 06 */ GE1_LIMB_R_LOWER_LEG, - /* 07 */ GE1_LIMB_R_FOOT, - /* 08 */ GE1_LIMB_TORSO, - /* 09 */ GE1_LIMB_L_UPPER_ARM, - /* 10 */ GE1_LIMB_L_FOREARM, - /* 11 */ GE1_LIMB_L_HAND, - /* 12 */ GE1_LIMB_R_UPPER_ARM, - /* 13 */ GE1_LIMB_R_FOREARM, - /* 14 */ GE1_LIMB_R_HAND, - /* 15 */ GE1_LIMB_HEAD, - /* 16 */ GE1_LIMB_MAX -} EnGe1Limb; - typedef struct EnGe1 { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ SkelAnime skelAnime; - /* 0x01DC */ Vec3s jointTable[GE1_LIMB_MAX]; - /* 0x023C */ Vec3s morphTable[GE1_LIMB_MAX]; + /* 0x01DC */ Vec3s jointTable[GERUDO_WHITE_LIMB_MAX]; + /* 0x023C */ Vec3s morphTable[GERUDO_WHITE_LIMB_MAX]; /* 0x029C */ Vec3s headRot; /* 0x02A2 */ Vec3s unk_2A2; /* 0x02A8 */ s16 eyeIndex; diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index ad77c01118..8ac3cdcd54 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -81,7 +81,7 @@ void EnGe3_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, NULL, this->jointTable, this->morphTable, - GELDB_LIMB_MAX); + GERUDO_RED_LIMB_MAX); Animation_PlayLoop(&this->skelAnime, &gGerudoRedStandAnim); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -241,13 +241,13 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p switch (limbIndex) { // Hide swords and veil from object_geldb - case GELDB_LIMB_VEIL: - case GELDB_LIMB_R_SWORD: - case GELDB_LIMB_L_SWORD: + case GERUDO_RED_LIMB_VEIL: + case GERUDO_RED_LIMB_R_SWORD: + case GERUDO_RED_LIMB_L_SWORD: *dList = NULL; return false; // Turn head - case GELDB_LIMB_HEAD: + case GERUDO_RED_LIMB_HEAD: rot->x += this->headRot.y; #if OOT_VERSION >= PAL_1_1 FALLTHROUGH; @@ -256,14 +256,14 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p // depending on what was drawn earlier in the frame. OPEN_DISPS(play->state.gfxCtx, "../z_en_ge3.c", 547); switch (limbIndex) { - case GELDB_LIMB_NECK: + case GERUDO_RED_LIMB_NECK: break; - case GELDB_LIMB_HEAD: + case GERUDO_RED_LIMB_HEAD: gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255); break; - case GELDB_LIMB_R_SWORD: - case GELDB_LIMB_L_SWORD: + case GERUDO_RED_LIMB_R_SWORD: + case GERUDO_RED_LIMB_L_SWORD: gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); @@ -284,7 +284,7 @@ void EnGe3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnGe3* this = (EnGe3*)thisx; Vec3f D_80A351C8 = { 600.0f, 700.0f, 0.0f }; - if (limbIndex == GELDB_LIMB_HEAD) { + if (limbIndex == GERUDO_RED_LIMB_HEAD) { Matrix_MultVec3f(&D_80A351C8, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h index 62b9882055..297129e439 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -3,7 +3,8 @@ #include "ultra64.h" #include "actor.h" -#include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" + +#include "assets/objects/object_geldb/object_geldb.h" struct EnGe3; @@ -13,8 +14,8 @@ typedef struct EnGe3 { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ SkelAnime skelAnime; - /* 0x01DC */ Vec3s jointTable[GELDB_LIMB_MAX]; - /* 0x026C */ Vec3s morphTable[GELDB_LIMB_MAX]; + /* 0x01DC */ Vec3s jointTable[GERUDO_RED_LIMB_MAX]; + /* 0x026C */ Vec3s morphTable[GERUDO_RED_LIMB_MAX]; /* 0x02FC */ s16 eyeIndex; /* 0x02FE */ s16 blinkTimer; /* 0x0300 */ Vec3s headRot; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 11850ccdf5..598cc7f616 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -251,7 +251,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { this->blinkState = 0; this->unkFloat = 10.0f; SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, &gGerudoRedNeutralAnim, this->jointTable, - this->morphTable, GELDB_LIMB_MAX); + this->morphTable, GERUDO_RED_LIMB_MAX); Collider_InitCylinder(play, &this->bodyCollider); Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylinderInit); Collider_InitTris(play, &this->blockCollider); @@ -1464,14 +1464,14 @@ s32 EnGeldB_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* EnGeldB* this = (EnGeldB*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_geldB.c", 2507); - if (limbIndex == GELDB_LIMB_NECK) { + if (limbIndex == GERUDO_RED_LIMB_NECK) { rot->z += this->headRot.x; rot->x += this->headRot.y; rot->y += this->headRot.z; - } else if (limbIndex == GELDB_LIMB_HEAD) { + } else if (limbIndex == GERUDO_RED_LIMB_HEAD) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255); - } else if ((limbIndex == GELDB_LIMB_R_SWORD) || (limbIndex == GELDB_LIMB_L_SWORD)) { + } else if ((limbIndex == GERUDO_RED_LIMB_R_SWORD) || (limbIndex == GERUDO_RED_LIMB_L_SWORD)) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); @@ -1497,7 +1497,7 @@ void EnGeldB_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro EnGeldB* this = (EnGeldB*)thisx; s32 bodyPart = -1; - if (limbIndex == GELDB_LIMB_R_SWORD) { + if (limbIndex == GERUDO_RED_LIMB_R_SWORD) { Matrix_MultVec3f(&swordQuadOffset1, &this->swordCollider.dim.quad[1]); Matrix_MultVec3f(&swordQuadOffset0, &this->swordCollider.dim.quad[0]); Matrix_MultVec3f(&swordQuadOffset3, &this->swordCollider.dim.quad[3]); @@ -1515,42 +1515,43 @@ void EnGeldB_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro EffectBlure_AddVertex(Effect_GetByIndex(this->blureIndex), &swordTip, &swordHilt); } } else { - Actor_SetFeetPos(&this->actor, limbIndex, GELDB_LIMB_L_FOOT, &footOffset, GELDB_LIMB_R_FOOT, &footOffset); + Actor_SetFeetPos(&this->actor, limbIndex, GERUDO_RED_LIMB_L_FOOT, &footOffset, GERUDO_RED_LIMB_R_FOOT, + &footOffset); } - if (limbIndex == GELDB_LIMB_L_FOOT) { + if (limbIndex == GERUDO_RED_LIMB_L_FOOT) { Matrix_MultVec3f(&footOffset, &this->leftFootPos); - } else if (limbIndex == GELDB_LIMB_R_FOOT) { + } else if (limbIndex == GERUDO_RED_LIMB_R_FOOT) { Matrix_MultVec3f(&footOffset, &this->rightFootPos); } if (this->iceTimer != 0) { switch (limbIndex) { - case GELDB_LIMB_NECK: + case GERUDO_RED_LIMB_NECK: bodyPart = 0; break; - case GELDB_LIMB_L_SWORD: + case GERUDO_RED_LIMB_L_SWORD: bodyPart = 1; break; - case GELDB_LIMB_R_SWORD: + case GERUDO_RED_LIMB_R_SWORD: bodyPart = 2; break; - case GELDB_LIMB_L_UPPER_ARM: + case GERUDO_RED_LIMB_L_UPPER_ARM: bodyPart = 3; break; - case GELDB_LIMB_R_UPPER_ARM: + case GERUDO_RED_LIMB_R_UPPER_ARM: bodyPart = 4; break; - case GELDB_LIMB_TORSO: + case GERUDO_RED_LIMB_TORSO: bodyPart = 5; break; - case GELDB_LIMB_WAIST: + case GERUDO_RED_LIMB_WAIST: bodyPart = 6; break; - case GELDB_LIMB_L_FOOT: + case GERUDO_RED_LIMB_L_FOOT: bodyPart = 7; break; - case GELDB_LIMB_R_FOOT: + case GERUDO_RED_LIMB_R_FOOT: bodyPart = 8; break; default: diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index a5ce4286b5..003a6dc5a5 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -4,35 +4,9 @@ #include "ultra64.h" #include "actor.h" -struct EnGeldB; +#include "assets/objects/object_geldb/object_geldb.h" -typedef enum EnGeldBLimb { - /* 0x00 */ GELDB_LIMB_NONE, - /* 0x01 */ GELDB_LIMB_ROOT, - /* 0x02 */ GELDB_LIMB_TORSO, - /* 0x03 */ GELDB_LIMB_NECK, - /* 0x04 */ GELDB_LIMB_PONYTAIL, - /* 0x05 */ GELDB_LIMB_VEIL, - /* 0x06 */ GELDB_LIMB_HEAD, - /* 0x07 */ GELDB_LIMB_R_UPPER_ARM, - /* 0x08 */ GELDB_LIMB_R_FOREARM, - /* 0x09 */ GELDB_LIMB_R_WRIST, - /* 0x0A */ GELDB_LIMB_R_HAND, - /* 0x0B */ GELDB_LIMB_R_SWORD, - /* 0x0C */ GELDB_LIMB_L_UPPER_ARM, - /* 0x0D */ GELDB_LIMB_L_FOREARM, - /* 0x0E */ GELDB_LIMB_L_WRIST, - /* 0x0F */ GELDB_LIMB_L_HAND, - /* 0x10 */ GELDB_LIMB_L_SWORD, - /* 0x11 */ GELDB_LIMB_L_THIGH, - /* 0x12 */ GELDB_LIMB_L_SHIN, - /* 0x13 */ GELDB_LIMB_L_FOOT, - /* 0x14 */ GELDB_LIMB_R_THIGH, - /* 0x15 */ GELDB_LIMB_R_SHIN, - /* 0x16 */ GELDB_LIMB_R_FOOT, - /* 0x17 */ GELDB_LIMB_WAIST, - /* 0x18 */ GELDB_LIMB_MAX -} EnGeldBLimb; +struct EnGeldB; typedef void (*EnGeldBActionFunc)(struct EnGeldB*, struct PlayState*); @@ -40,8 +14,8 @@ typedef struct EnGeldB { /* 0x0000 */ Actor actor; /* 0x014C */ Vec3s bodyPartsPos[10]; /* 0x0188 */ SkelAnime skelAnime; - /* 0x01CC */ Vec3s jointTable[GELDB_LIMB_MAX]; - /* 0x025C */ Vec3s morphTable[GELDB_LIMB_MAX]; + /* 0x01CC */ Vec3s jointTable[GERUDO_RED_LIMB_MAX]; + /* 0x025C */ Vec3s morphTable[GERUDO_RED_LIMB_MAX]; /* 0x02EC */ s32 action; /* 0x02F0 */ char unk_2F0[4]; /* 0x02F4 */ EnGeldBActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index 53d31bab58..38c85e6349 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -4,31 +4,7 @@ #include "ultra64.h" #include "actor.h" - -typedef enum EnHataLimb { - /* 0x00 */ FLAGPOLE_LIMB_NONE, - /* 0x01 */ FLAGPOLE_LIMB_POLE_BASE, - /* 0x02 */ FLAGPOLE_LIMB_POLE, - /* 0x03 */ FLAGPOLE_LIMB_FLAG_1_BASE, - /* 0x04 */ FLAGPOLE_LIMB_FLAG_1_HOIST_END_BASE, - /* 0x05 */ FLAGPOLE_LIMB_FLAG_1_HOIST_MID_BASE, - /* 0x06 */ FLAGPOLE_LIMB_FLAG_1_FLY_MID_BASE, - /* 0x07 */ FLAGPOLE_LIMB_FLAG_1_FLY_END_BASE, - /* 0x08 */ FLAGPOLE_LIMB_FLAG_1_FLY_END, - /* 0x09 */ FLAGPOLE_LIMB_FLAG_1_FLY_MID, - /* 0x0A */ FLAGPOLE_LIMB_FLAG_1_HOIST_MID, - /* 0x0B */ FLAGPOLE_LIMB_FLAG_1_HOIST_END, - /* 0x0C */ FLAGPOLE_LIMB_FLAG_2_BASE, - /* 0x0D */ FLAGPOLE_LIMB_FLAG_2_HOIST_END_BASE, - /* 0x0E */ FLAGPOLE_LIMB_FLAG_2_HOIST_MID_BASE, - /* 0x0F */ FLAGPOLE_LIMB_FLAG_2_FLY_MID_BASE, - /* 0x10 */ FLAGPOLE_LIMB_FLAG_2_FLY_END_BASE, - /* 0x11 */ FLAGPOLE_LIMB_FLAG_2_FLY_END, - /* 0x12 */ FLAGPOLE_LIMB_FLAG_2_FLY_MID, - /* 0x13 */ FLAGPOLE_LIMB_FLAG_2_HOIST_MID, - /* 0x14 */ FLAGPOLE_LIMB_FLAG_2_HOIST_END, - /* 0x15 */ FLAGPOLE_LIMB_MAX -} EnHataLimb; +#include "assets/objects/object_hata/object_hata.h" typedef struct EnHata { /* 0x0000 */ DynaPolyActor dyna; From 8a823a7ad24d25d5ebc390e7436e6859227a0ace Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Fri, 13 Jun 2025 23:45:22 +0200 Subject: [PATCH 3/9] `Camera_KeepOn4` docs 1 (#2627) * `Camera_KeepOn4` docs 1 * add comment * backticks around at, eye --- src/code/z_camera.c | 136 +++++++++++++++++------------------ src/code/z_camera_data.inc.c | 12 ++-- 2 files changed, 75 insertions(+), 73 deletions(-) diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 71f6a0b82e..0dbffa669d 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -3593,7 +3593,7 @@ s32 Camera_KeepOn3(Camera* camera) { playerHeadPos = camPlayerPosRot->pos; playerHeadPos.y += playerHeight; rwData->atTarget = Camera_AddVecGeoToVec3f(&playerHeadPos, &targetToPlayerDir); - angleCnt = ARRAY_COUNT(D_8011D3B0); + angleCnt = ARRAY_COUNT(sCamCheckAroundOffsetsYaw); i = 0; targetToPlayerDir.r = prevTargetPlayerDist; atToEyeAdj.r = roData->minDist + (targetToPlayerDir.r * (1 - 0.5f)) - atToEyeNextDir.r + atToEyeNextDir.r; @@ -3605,8 +3605,8 @@ s32 Camera_KeepOn3(Camera* camera) { !Camera_BGCheck(camera, &rwData->atTarget, &lineChkPointB)) { break; } - atToEyeAdj.yaw = sp80 + D_8011D3B0[i]; - atToEyeAdj.pitch = sp82 + D_8011D3CC[i]; + atToEyeAdj.yaw = sp80 + sCamCheckAroundOffsetsYaw[i]; + atToEyeAdj.pitch = sp82 + sCamCheckAroundOffsetsPitch[i]; lineChkPointB = Camera_AddVecGeoToVec3f(&rwData->atTarget, &atToEyeAdj); i++; } @@ -3664,24 +3664,24 @@ s32 Camera_KeepOn3(Camera* camera) { "ique-cn:128 ntsc-1.0:79 ntsc-1.1:79 ntsc-1.2:79 pal-1.0:79 pal-1.1:79" s32 Camera_KeepOn4(Camera* camera) { - static Vec3f D_8015BD50; + static Vec3f sAtTarget; static Vec3f D_8015BD60; - static Vec3f D_8015BD70; + static Vec3f sEyeCandidate; Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - Actor* spCC[2]; + Actor* lineOCCheckExclusions[2]; f32 t = -0.5f; f32 temp_f0_2; CollisionPoly* spC0; - VecGeo spB8; - UNUSED VecGeo spB0; - VecGeo spA8; + VecGeo vecGeo; + VecGeo atToEyeDir; + VecGeo atToEyeNextDir; s16* itemType = &camera->data2; - s16 spA2; - s16 spA0; + s16 atToEyeBasePitch; + s16 atToEyeBaseYaw; s16 sp9E; - s16 sp9C; + s16 lineOCCheckNumExclusions; PosRot* playerPosRot = &camera->playerPosRot; KeepOn4ReadOnlyData* roData = &camera->paramData.keep4.roData; KeepOn4ReadWriteData* rwData = &camera->paramData.keep4.rwData; @@ -3839,87 +3839,87 @@ s32 Camera_KeepOn4(Camera* camera) { sUpdateCameraDirection = 1; sCameraInterfaceField = roData->interfaceField; - spB0 = OLib_Vec3fDiffToVecGeo(at, eye); - spA8 = OLib_Vec3fDiffToVecGeo(at, eyeNext); - D_8015BD50 = playerPosRot->pos; - D_8015BD50.y += playerHeight; - temp_f0_2 = BgCheck_CameraRaycastDown2(&camera->play->colCtx, &spC0, &i, &D_8015BD50); - if (temp_f0_2 > (roData->unk_00 + D_8015BD50.y)) { - D_8015BD50.y = temp_f0_2 + 10.0f; + atToEyeDir = OLib_Vec3fDiffToVecGeo(at, eye); + atToEyeNextDir = OLib_Vec3fDiffToVecGeo(at, eyeNext); + sAtTarget = playerPosRot->pos; + sAtTarget.y += playerHeight; + temp_f0_2 = BgCheck_CameraRaycastDown2(&camera->play->colCtx, &spC0, &i, &sAtTarget); + if (temp_f0_2 > (roData->unk_00 + sAtTarget.y)) { + sAtTarget.y = temp_f0_2 + 10.0f; } else { - D_8015BD50.y += roData->unk_00; + sAtTarget.y += roData->unk_00; } - sp9C = 0; + lineOCCheckNumExclusions = 0; switch (camera->animState) { case 0: case 20: - spCC[sp9C] = &camera->player->actor; - sp9C++; + lineOCCheckExclusions[lineOCCheckNumExclusions] = &camera->player->actor; + lineOCCheckNumExclusions++; func_80043ABC(camera); camera->stateFlags &= ~(CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG); rwData->unk_10 = roData->unk_1E; rwData->unk_08 = playerPosRot->pos.y - camera->playerPosDelta.y; if (roData->interfaceField & KEEPON4_FLAG_1) { - spA2 = CAM_DEG_TO_BINANG(roData->unk_08); - spA0 = (s16)((s16)(playerPosRot->rot.y - 0x7FFF) - spA8.yaw) > 0 - ? (s16)(playerPosRot->rot.y - 0x7FFF) + CAM_DEG_TO_BINANG(roData->unk_0C) - : (s16)(playerPosRot->rot.y - 0x7FFF) - CAM_DEG_TO_BINANG(roData->unk_0C); + atToEyeBasePitch = CAM_DEG_TO_BINANG(roData->unk_08); + atToEyeBaseYaw = (s16)((s16)(playerPosRot->rot.y - 0x7FFF) - atToEyeNextDir.yaw) > 0 + ? (s16)(playerPosRot->rot.y - 0x7FFF) + CAM_DEG_TO_BINANG(roData->unk_0C) + : (s16)(playerPosRot->rot.y - 0x7FFF) - CAM_DEG_TO_BINANG(roData->unk_0C); } else if (roData->interfaceField & KEEPON4_FLAG_2) { - spA2 = CAM_DEG_TO_BINANG(roData->unk_08); - spA0 = CAM_DEG_TO_BINANG(roData->unk_0C); + atToEyeBasePitch = CAM_DEG_TO_BINANG(roData->unk_08); + atToEyeBaseYaw = CAM_DEG_TO_BINANG(roData->unk_0C); } else if ((roData->interfaceField & KEEPON4_FLAG_3) && camera->target != NULL) { PosRot sp60; sp60 = Actor_GetWorldPosShapeRot(camera->target); - spA2 = CAM_DEG_TO_BINANG(roData->unk_08) - sp60.rot.x; - spA0 = (s16)((s16)(sp60.rot.y - 0x7FFF) - spA8.yaw) > 0 - ? (s16)(sp60.rot.y - 0x7FFF) + CAM_DEG_TO_BINANG(roData->unk_0C) - : (s16)(sp60.rot.y - 0x7FFF) - CAM_DEG_TO_BINANG(roData->unk_0C); - spCC[1] = camera->target; - sp9C++; + atToEyeBasePitch = CAM_DEG_TO_BINANG(roData->unk_08) - sp60.rot.x; + atToEyeBaseYaw = (s16)((s16)(sp60.rot.y - 0x7FFF) - atToEyeNextDir.yaw) > 0 + ? (s16)(sp60.rot.y - 0x7FFF) + CAM_DEG_TO_BINANG(roData->unk_0C) + : (s16)(sp60.rot.y - 0x7FFF) - CAM_DEG_TO_BINANG(roData->unk_0C); + lineOCCheckExclusions[1] = camera->target; + lineOCCheckNumExclusions++; } else if ((roData->interfaceField & KEEPON4_FLAG_7) && camera->target != NULL) { PosRot sp4C; sp4C = Actor_GetWorld(camera->target); - spA2 = CAM_DEG_TO_BINANG(roData->unk_08); + atToEyeBasePitch = CAM_DEG_TO_BINANG(roData->unk_08); sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos); - spA0 = ((s16)(sp9E - spA8.yaw) > 0) ? sp9E + CAM_DEG_TO_BINANG(roData->unk_0C) - : sp9E - CAM_DEG_TO_BINANG(roData->unk_0C); - spCC[1] = camera->target; - sp9C++; + atToEyeBaseYaw = ((s16)(sp9E - atToEyeNextDir.yaw) > 0) ? sp9E + CAM_DEG_TO_BINANG(roData->unk_0C) + : sp9E - CAM_DEG_TO_BINANG(roData->unk_0C); + lineOCCheckExclusions[1] = camera->target; + lineOCCheckNumExclusions++; } else if (roData->interfaceField & KEEPON4_FLAG_6) { - spA2 = CAM_DEG_TO_BINANG(roData->unk_08); - spA0 = spA8.yaw; + atToEyeBasePitch = CAM_DEG_TO_BINANG(roData->unk_08); + atToEyeBaseYaw = atToEyeNextDir.yaw; } else { - spA2 = spA8.pitch; - spA0 = spA8.yaw; + atToEyeBasePitch = atToEyeNextDir.pitch; + atToEyeBaseYaw = atToEyeNextDir.yaw; } - spB8.pitch = spA2; - spB8.yaw = spA0; - spB8.r = roData->unk_04; - D_8015BD70 = Camera_AddVecGeoToVec3f(&D_8015BD50, &spB8); + vecGeo.pitch = atToEyeBasePitch; + vecGeo.yaw = atToEyeBaseYaw; + vecGeo.r = roData->unk_04; + sEyeCandidate = Camera_AddVecGeoToVec3f(&sAtTarget, &vecGeo); if (!(roData->interfaceField & KEEPON4_FLAG_0)) { - angleCnt = ARRAY_COUNT(D_8011D3B0); + angleCnt = ARRAY_COUNT(sCamCheckAroundOffsetsYaw); for (i = 0; i < angleCnt; i++) { - if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &D_8015BD50, &D_8015BD70, - spCC, sp9C) && - !Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) { + if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &sAtTarget, &sEyeCandidate, + lineOCCheckExclusions, lineOCCheckNumExclusions) && + !Camera_BGCheck(camera, &sAtTarget, &sEyeCandidate)) { break; } - spB8.yaw = D_8011D3B0[i] + spA0; - spB8.pitch = D_8011D3CC[i] + spA2; - D_8015BD70 = Camera_AddVecGeoToVec3f(&D_8015BD50, &spB8); + vecGeo.yaw = sCamCheckAroundOffsetsYaw[i] + atToEyeBaseYaw; + vecGeo.pitch = sCamCheckAroundOffsetsPitch[i] + atToEyeBasePitch; + sEyeCandidate = Camera_AddVecGeoToVec3f(&sAtTarget, &vecGeo); } #if DEBUG_FEATURES PRINTF("camera: item: BG&collision check %d time(s)\n", i); #endif } - rwData->unk_04 = (s16)(spB8.pitch - spA8.pitch) / (f32)rwData->unk_10; - rwData->unk_00 = (s16)(spB8.yaw - spA8.yaw) / (f32)rwData->unk_10; - rwData->unk_0C = spA8.yaw; - rwData->unk_0E = spA8.pitch; + rwData->unk_04 = (s16)(vecGeo.pitch - atToEyeNextDir.pitch) / (f32)rwData->unk_10; + rwData->unk_00 = (s16)(vecGeo.yaw - atToEyeNextDir.yaw) / (f32)rwData->unk_10; + rwData->unk_0C = atToEyeNextDir.yaw; + rwData->unk_0E = atToEyeNextDir.pitch; camera->animState++; rwData->unk_12 = 1; break; @@ -3931,16 +3931,16 @@ s32 Camera_KeepOn4(Camera* camera) { camera->xzOffsetUpdateRate = 0.25f; camera->yOffsetUpdateRate = 0.25f; camera->atLERPStepScale = 0.75f; - Camera_LERPCeilVec3f(&D_8015BD50, at, 0.5f, 0.5f, 0.2f); + Camera_LERPCeilVec3f(&sAtTarget, at, 0.5f, 0.5f, 0.2f); if (roData->unk_10 != 0.0f) { - spB8.r = roData->unk_10; - spB8.pitch = 0; - spB8.yaw = playerPosRot->rot.y; - *at = Camera_AddVecGeoToVec3f(at, &spB8); + vecGeo.r = roData->unk_10; + vecGeo.pitch = 0; + vecGeo.yaw = playerPosRot->rot.y; + *at = Camera_AddVecGeoToVec3f(at, &vecGeo); } camera->atLERPStepScale = 0.0f; camera->dist = Camera_LERPCeilF(roData->unk_04, camera->dist, 0.25f, 2.0f); - spB8.r = camera->dist; + vecGeo.r = camera->dist; if (rwData->unk_10 != 0) { camera->stateFlags |= CAM_STATE_LOCK_MODE; rwData->unk_0C += (s16)rwData->unk_00; @@ -3967,9 +3967,9 @@ s32 Camera_KeepOn4(Camera* camera) { } } } - spB8.yaw = Camera_LERPCeilS(rwData->unk_0C, spA8.yaw, roData->unk_14, 4); - spB8.pitch = Camera_LERPCeilS(rwData->unk_0E, spA8.pitch, roData->unk_14, 4); - *eyeNext = Camera_AddVecGeoToVec3f(at, &spB8); + vecGeo.yaw = Camera_LERPCeilS(rwData->unk_0C, atToEyeNextDir.yaw, roData->unk_14, 4); + vecGeo.pitch = Camera_LERPCeilS(rwData->unk_0E, atToEyeNextDir.pitch, roData->unk_14, 4); + *eyeNext = Camera_AddVecGeoToVec3f(at, &vecGeo); *eye = *eyeNext; Camera_BGCheck(camera, at, eye); camera->fov = Camera_LERPCeilF(roData->unk_18, camera->fov, camera->fovUpdateRate, 1.0f); diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 9a9795f453..9f724ec084 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -2574,12 +2574,14 @@ s32 sCameraLetterboxSize = 32; s32 D_8011D3AC = -1; -s16 D_8011D3B0[] = { - 0x0AAA, 0xF556, 0x1555, 0xEAAB, 0x2AAA, 0xD556, 0x3FFF, 0xC001, 0x5555, 0xAAAB, 0x6AAA, 0x9556, 0x7FFF, 0x0000, +// Used in Camera_KeepOn3 and Camera_KeepOn4 to check around an `at` position for an `eye` position such that the +// `at`-`eye` segment is not obstructed by collision or colliders. +s16 sCamCheckAroundOffsetsYaw[] = { + 0x0AAA, -0x0AAA, 0x1555, -0x1555, 0x2AAA, -0x2AAA, 0x3FFF, + -0x3FFF, 0x5555, -0x5555, 0x6AAA, -0x6AAA, 0x7FFF, 0x0000, }; - -s16 D_8011D3CC[] = { - 0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, 0xFD3A, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, 0xFA74, 0x0000, +s16 sCamCheckAroundOffsetsPitch[] = { + 0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, -0x02C6, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, -0x058C, 0x0000, }; s32 sUpdateCameraDirection = 0; From 7547603989320735451c5b0c59dfa56aad7e474d Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sat, 14 Jun 2025 22:06:53 +0200 Subject: [PATCH 4/9] Pause doc: DrawInfoPanel textures (#2628) * Pause doc: DrawInfoPanel textures * plural Widths --- .../icon_item_fra_static.c | 8 +-- .../icon_item_fra_static.h | 18 ++---- .../icon_item_ger_static.c | 8 +-- .../icon_item_ger_static.h | 18 ++---- .../icon_item_jpn_static.c | 8 +-- .../icon_item_jpn_static.h | 18 ++---- .../icon_item_nes_static.c | 8 +-- .../icon_item_nes_static.h | 18 ++---- .../misc/ovl_kaleido_scope/z_kaleido_scope.c | 63 ++++++++++--------- .../misc/ovl_kaleido_scope/z_kaleido_scope.h | 3 + 10 files changed, 78 insertions(+), 92 deletions(-) diff --git a/assets/textures/icon_item_fra_static/icon_item_fra_static.c b/assets/textures/icon_item_fra_static/icon_item_fra_static.c index 80dae50a8d..3cfec8f8d4 100644 --- a/assets/textures/icon_item_fra_static/icon_item_fra_static.c +++ b/assets/textures/icon_item_fra_static/icon_item_fra_static.c @@ -52,19 +52,19 @@ u64 gPauseToPlayMelodyFRATex[TEX_LEN(u64, gPauseToPlayMelodyFRATex_WIDTH, gPause #include "assets/textures/icon_item_fra_static/gPauseToPlayMelodyFRATex.ia8.inc.c" }; -u64 gPauseToSelectItemFRATex[TEX_LEN(u64, gPauseToSelectItemFRATex_WIDTH, gPauseToSelectItemFRATex_HEIGHT, 8)] = { +u64 gPauseToSelectItemFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_fra_static/gPauseToSelectItemFRATex.ia8.inc.c" }; -u64 gPauseToMapFRATex[TEX_LEN(u64, gPauseToMapFRATex_WIDTH, gPauseToMapFRATex_HEIGHT, 8)] = { +u64 gPauseToMapFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_fra_static/gPauseToMapFRATex.ia8.inc.c" }; -u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, gPauseToQuestStatusFRATex_WIDTH, gPauseToQuestStatusFRATex_HEIGHT, 8)] = { +u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_fra_static/gPauseToQuestStatusFRATex.ia8.inc.c" }; -u64 gPauseToEquipmentFRATex[TEX_LEN(u64, gPauseToEquipmentFRATex_WIDTH, gPauseToEquipmentFRATex_HEIGHT, 8)] = { +u64 gPauseToEquipmentFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_fra_static/gPauseToEquipmentFRATex.ia8.inc.c" }; diff --git a/assets/textures/icon_item_fra_static/icon_item_fra_static.h b/assets/textures/icon_item_fra_static/icon_item_fra_static.h index 2a7152a416..7689e75fed 100644 --- a/assets/textures/icon_item_fra_static/icon_item_fra_static.h +++ b/assets/textures/icon_item_fra_static/icon_item_fra_static.h @@ -44,18 +44,12 @@ extern u64 gPauseToDecideFRATex[TEX_LEN(u64, gPauseToDecideFRATex_WIDTH, gPauseT #define gPauseToPlayMelodyFRATex_WIDTH 112 #define gPauseToPlayMelodyFRATex_HEIGHT 16 extern u64 gPauseToPlayMelodyFRATex[TEX_LEN(u64, gPauseToPlayMelodyFRATex_WIDTH, gPauseToPlayMelodyFRATex_HEIGHT, 8)]; -#define gPauseToSelectItemFRATex_WIDTH 128 -#define gPauseToSelectItemFRATex_HEIGHT 16 -extern u64 gPauseToSelectItemFRATex[TEX_LEN(u64, gPauseToSelectItemFRATex_WIDTH, gPauseToSelectItemFRATex_HEIGHT, 8)]; -#define gPauseToMapFRATex_WIDTH 128 -#define gPauseToMapFRATex_HEIGHT 16 -extern u64 gPauseToMapFRATex[TEX_LEN(u64, gPauseToMapFRATex_WIDTH, gPauseToMapFRATex_HEIGHT, 8)]; -#define gPauseToQuestStatusFRATex_WIDTH 128 -#define gPauseToQuestStatusFRATex_HEIGHT 16 -extern u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, gPauseToQuestStatusFRATex_WIDTH, gPauseToQuestStatusFRATex_HEIGHT, 8)]; -#define gPauseToEquipmentFRATex_WIDTH 128 -#define gPauseToEquipmentFRATex_HEIGHT 16 -extern u64 gPauseToEquipmentFRATex[TEX_LEN(u64, gPauseToEquipmentFRATex_WIDTH, gPauseToEquipmentFRATex_HEIGHT, 8)]; + +extern u64 gPauseToSelectItemFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToMapFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToEquipmentFRATex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; + #define gPauseSavePromptFRATex_WIDTH 152 #define gPauseSavePromptFRATex_HEIGHT 16 extern u64 gPauseSavePromptFRATex[TEX_LEN(u64, gPauseSavePromptFRATex_WIDTH, gPauseSavePromptFRATex_HEIGHT, 8)]; diff --git a/assets/textures/icon_item_ger_static/icon_item_ger_static.c b/assets/textures/icon_item_ger_static/icon_item_ger_static.c index 379f7f6816..e8523db713 100644 --- a/assets/textures/icon_item_ger_static/icon_item_ger_static.c +++ b/assets/textures/icon_item_ger_static/icon_item_ger_static.c @@ -52,19 +52,19 @@ u64 gPauseToPlayMelodyGERTex[TEX_LEN(u64, gPauseToPlayMelodyGERTex_WIDTH, gPause #include "assets/textures/icon_item_ger_static/gPauseToPlayMelodyGERTex.ia8.inc.c" }; -u64 gPauseToSelectItemGERTex[TEX_LEN(u64, gPauseToSelectItemGERTex_WIDTH, gPauseToSelectItemGERTex_HEIGHT, 8)] = { +u64 gPauseToSelectItemGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_ger_static/gPauseToSelectItemGERTex.ia8.inc.c" }; -u64 gPauseToMapGERTex[TEX_LEN(u64, gPauseToMapGERTex_WIDTH, gPauseToMapGERTex_HEIGHT, 8)] = { +u64 gPauseToMapGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_ger_static/gPauseToMapGERTex.ia8.inc.c" }; -u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, gPauseToQuestStatusGERTex_WIDTH, gPauseToQuestStatusGERTex_HEIGHT, 8)] = { +u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_ger_static/gPauseToQuestStatusGERTex.ia8.inc.c" }; -u64 gPauseToEquipmentGERTex[TEX_LEN(u64, gPauseToEquipmentGERTex_WIDTH, gPauseToEquipmentGERTex_HEIGHT, 8)] = { +u64 gPauseToEquipmentGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_ger_static/gPauseToEquipmentGERTex.ia8.inc.c" }; diff --git a/assets/textures/icon_item_ger_static/icon_item_ger_static.h b/assets/textures/icon_item_ger_static/icon_item_ger_static.h index bd69237b9a..30a8455717 100644 --- a/assets/textures/icon_item_ger_static/icon_item_ger_static.h +++ b/assets/textures/icon_item_ger_static/icon_item_ger_static.h @@ -44,18 +44,12 @@ extern u64 gPauseToDecideGERTex[TEX_LEN(u64, gPauseToDecideGERTex_WIDTH, gPauseT #define gPauseToPlayMelodyGERTex_WIDTH 104 #define gPauseToPlayMelodyGERTex_HEIGHT 16 extern u64 gPauseToPlayMelodyGERTex[TEX_LEN(u64, gPauseToPlayMelodyGERTex_WIDTH, gPauseToPlayMelodyGERTex_HEIGHT, 8)]; -#define gPauseToSelectItemGERTex_WIDTH 128 -#define gPauseToSelectItemGERTex_HEIGHT 16 -extern u64 gPauseToSelectItemGERTex[TEX_LEN(u64, gPauseToSelectItemGERTex_WIDTH, gPauseToSelectItemGERTex_HEIGHT, 8)]; -#define gPauseToMapGERTex_WIDTH 128 -#define gPauseToMapGERTex_HEIGHT 16 -extern u64 gPauseToMapGERTex[TEX_LEN(u64, gPauseToMapGERTex_WIDTH, gPauseToMapGERTex_HEIGHT, 8)]; -#define gPauseToQuestStatusGERTex_WIDTH 128 -#define gPauseToQuestStatusGERTex_HEIGHT 16 -extern u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, gPauseToQuestStatusGERTex_WIDTH, gPauseToQuestStatusGERTex_HEIGHT, 8)]; -#define gPauseToEquipmentGERTex_WIDTH 128 -#define gPauseToEquipmentGERTex_HEIGHT 16 -extern u64 gPauseToEquipmentGERTex[TEX_LEN(u64, gPauseToEquipmentGERTex_WIDTH, gPauseToEquipmentGERTex_HEIGHT, 8)]; + +extern u64 gPauseToSelectItemGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToMapGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToEquipmentGERTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; + #define gPauseSavePromptGERTex_WIDTH 152 #define gPauseSavePromptGERTex_HEIGHT 16 extern u64 gPauseSavePromptGERTex[TEX_LEN(u64, gPauseSavePromptGERTex_WIDTH, gPauseSavePromptGERTex_HEIGHT, 8)]; diff --git a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c index 92d56b0724..1418c209aa 100644 --- a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c +++ b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c @@ -52,19 +52,19 @@ u64 gPauseToPlayMelodyJPNTex[TEX_LEN(u64, gPauseToPlayMelodyJPNTex_WIDTH, gPause #include "assets/textures/icon_item_jpn_static/gPauseToPlayMelodyJPNTex.ia8.inc.c" }; -u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, gPauseToSelectItemJPNTex_WIDTH, gPauseToSelectItemJPNTex_HEIGHT, 8)] = { +u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_jpn_static/gPauseToSelectItemJPNTex.ia8.inc.c" }; -u64 gPauseToMapJPNTex[TEX_LEN(u64, gPauseToMapJPNTex_WIDTH, gPauseToMapJPNTex_HEIGHT, 8)] = { +u64 gPauseToMapJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_jpn_static/gPauseToMapJPNTex.ia8.inc.c" }; -u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, gPauseToQuestStatusJPNTex_WIDTH, gPauseToQuestStatusJPNTex_HEIGHT, 8)] = { +u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_jpn_static/gPauseToQuestStatusJPNTex.ia8.inc.c" }; -u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, gPauseToEquipmentJPNTex_WIDTH, gPauseToEquipmentJPNTex_HEIGHT, 8)] = { +u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_jpn_static/gPauseToEquipmentJPNTex.ia8.inc.c" }; diff --git a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h index bd21c0a74e..d850c943c0 100644 --- a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h +++ b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h @@ -44,18 +44,12 @@ extern u64 gPauseToDecideJPNTex[TEX_LEN(u64, gPauseToDecideJPNTex_WIDTH, gPauseT #define gPauseToPlayMelodyJPNTex_WIDTH 96 #define gPauseToPlayMelodyJPNTex_HEIGHT 16 extern u64 gPauseToPlayMelodyJPNTex[TEX_LEN(u64, gPauseToPlayMelodyJPNTex_WIDTH, gPauseToPlayMelodyJPNTex_HEIGHT, 8)]; -#define gPauseToSelectItemJPNTex_WIDTH 128 -#define gPauseToSelectItemJPNTex_HEIGHT 16 -extern u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, gPauseToSelectItemJPNTex_WIDTH, gPauseToSelectItemJPNTex_HEIGHT, 8)]; -#define gPauseToMapJPNTex_WIDTH 128 -#define gPauseToMapJPNTex_HEIGHT 16 -extern u64 gPauseToMapJPNTex[TEX_LEN(u64, gPauseToMapJPNTex_WIDTH, gPauseToMapJPNTex_HEIGHT, 8)]; -#define gPauseToQuestStatusJPNTex_WIDTH 128 -#define gPauseToQuestStatusJPNTex_HEIGHT 16 -extern u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, gPauseToQuestStatusJPNTex_WIDTH, gPauseToQuestStatusJPNTex_HEIGHT, 8)]; -#define gPauseToEquipmentJPNTex_WIDTH 128 -#define gPauseToEquipmentJPNTex_HEIGHT 16 -extern u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, gPauseToEquipmentJPNTex_WIDTH, gPauseToEquipmentJPNTex_HEIGHT, 8)]; + +extern u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToMapJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; + #define gPauseSavePromptJPNTex_WIDTH 152 #define gPauseSavePromptJPNTex_HEIGHT 16 extern u64 gPauseSavePromptJPNTex[TEX_LEN(u64, gPauseSavePromptJPNTex_WIDTH, gPauseSavePromptJPNTex_HEIGHT, 8)]; diff --git a/assets/textures/icon_item_nes_static/icon_item_nes_static.c b/assets/textures/icon_item_nes_static/icon_item_nes_static.c index 5e84c69162..aeb95065c5 100644 --- a/assets/textures/icon_item_nes_static/icon_item_nes_static.c +++ b/assets/textures/icon_item_nes_static/icon_item_nes_static.c @@ -52,19 +52,19 @@ u64 gPauseToPlayMelodyENGTex[TEX_LEN(u64, gPauseToPlayMelodyENGTex_WIDTH, gPause #include "assets/textures/icon_item_nes_static/gPauseToPlayMelodyENGTex.ia8.inc.c" }; -u64 gPauseToSelectItemENGTex[TEX_LEN(u64, gPauseToSelectItemENGTex_WIDTH, gPauseToSelectItemENGTex_HEIGHT, 8)] = { +u64 gPauseToSelectItemENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_nes_static/gPauseToSelectItemENGTex.ia8.inc.c" }; -u64 gPauseToMapENGTex[TEX_LEN(u64, gPauseToMapENGTex_WIDTH, gPauseToMapENGTex_HEIGHT, 8)] = { +u64 gPauseToMapENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_nes_static/gPauseToMapENGTex.ia8.inc.c" }; -u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, gPauseToQuestStatusENGTex_WIDTH, gPauseToQuestStatusENGTex_HEIGHT, 8)] = { +u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_nes_static/gPauseToQuestStatusENGTex.ia8.inc.c" }; -u64 gPauseToEquipmentENGTex[TEX_LEN(u64, gPauseToEquipmentENGTex_WIDTH, gPauseToEquipmentENGTex_HEIGHT, 8)] = { +u64 gPauseToEquipmentENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)] = { #include "assets/textures/icon_item_nes_static/gPauseToEquipmentENGTex.ia8.inc.c" }; diff --git a/assets/textures/icon_item_nes_static/icon_item_nes_static.h b/assets/textures/icon_item_nes_static/icon_item_nes_static.h index 007bebf3bc..7c732e0973 100644 --- a/assets/textures/icon_item_nes_static/icon_item_nes_static.h +++ b/assets/textures/icon_item_nes_static/icon_item_nes_static.h @@ -44,18 +44,12 @@ extern u64 gPauseToDecideENGTex[TEX_LEN(u64, gPauseToDecideENGTex_WIDTH, gPauseT #define gPauseToPlayMelodyENGTex_WIDTH 80 #define gPauseToPlayMelodyENGTex_HEIGHT 16 extern u64 gPauseToPlayMelodyENGTex[TEX_LEN(u64, gPauseToPlayMelodyENGTex_WIDTH, gPauseToPlayMelodyENGTex_HEIGHT, 8)]; -#define gPauseToSelectItemENGTex_WIDTH 128 -#define gPauseToSelectItemENGTex_HEIGHT 16 -extern u64 gPauseToSelectItemENGTex[TEX_LEN(u64, gPauseToSelectItemENGTex_WIDTH, gPauseToSelectItemENGTex_HEIGHT, 8)]; -#define gPauseToMapENGTex_WIDTH 128 -#define gPauseToMapENGTex_HEIGHT 16 -extern u64 gPauseToMapENGTex[TEX_LEN(u64, gPauseToMapENGTex_WIDTH, gPauseToMapENGTex_HEIGHT, 8)]; -#define gPauseToQuestStatusENGTex_WIDTH 128 -#define gPauseToQuestStatusENGTex_HEIGHT 16 -extern u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, gPauseToQuestStatusENGTex_WIDTH, gPauseToQuestStatusENGTex_HEIGHT, 8)]; -#define gPauseToEquipmentENGTex_WIDTH 128 -#define gPauseToEquipmentENGTex_HEIGHT 16 -extern u64 gPauseToEquipmentENGTex[TEX_LEN(u64, gPauseToEquipmentENGTex_WIDTH, gPauseToEquipmentENGTex_HEIGHT, 8)]; + +extern u64 gPauseToSelectItemENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToMapENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; +extern u64 gPauseToEquipmentENGTex[TEX_LEN(u64, TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 8)]; + #define gPauseSavePromptENGTex_WIDTH 152 #define gPauseSavePromptENGTex_HEIGHT 16 extern u64 gPauseSavePromptENGTex[TEX_LEN(u64, gPauseSavePromptENGTex_WIDTH, gPauseSavePromptENGTex_HEIGHT, 8)]; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 2a76a40fa2..84b7687bb4 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1653,13 +1653,13 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { } void KaleidoScope_DrawInfoPanel(PlayState* play) { - static void* D_8082AD54[] = + static void* sToEquipTextTextures[] = LANGUAGE_ARRAY(gPauseToEquipJPNTex, gPauseToEquipENGTex, gPauseToEquipGERTex, gPauseToEquipFRATex); - static void* D_8082AD60[] = + static void* sToDecideTextTextures[] = LANGUAGE_ARRAY(gPauseToDecideJPNTex, gPauseToDecideENGTex, gPauseToDecideGERTex, gPauseToDecideFRATex); - static void* D_8082AD6C[] = LANGUAGE_ARRAY(gPauseToPlayMelodyJPNTex, gPauseToPlayMelodyENGTex, - gPauseToPlayMelodyGERTex, gPauseToPlayMelodyFRATex); - static void* D_8082AD78[][LANGUAGE_MAX] = { + static void* sToPlayMelodyTextTextures[] = LANGUAGE_ARRAY(gPauseToPlayMelodyJPNTex, gPauseToPlayMelodyENGTex, + gPauseToPlayMelodyGERTex, gPauseToPlayMelodyFRATex); + static void* sScrollLeftLabels[][LANGUAGE_MAX] = { LANGUAGE_ARRAY(gPauseToEquipmentJPNTex, gPauseToEquipmentENGTex, gPauseToEquipmentGERTex, gPauseToEquipmentFRATex), LANGUAGE_ARRAY(gPauseToSelectItemJPNTex, gPauseToSelectItemENGTex, gPauseToSelectItemGERTex, @@ -1668,7 +1668,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { LANGUAGE_ARRAY(gPauseToQuestStatusJPNTex, gPauseToQuestStatusENGTex, gPauseToQuestStatusGERTex, gPauseToQuestStatusFRATex), }; - static void* D_8082ADA8[][LANGUAGE_MAX] = { + static void* sScrollRightLabels[][LANGUAGE_MAX] = { LANGUAGE_ARRAY(gPauseToMapJPNTex, gPauseToMapENGTex, gPauseToMapGERTex, gPauseToMapFRATex), LANGUAGE_ARRAY(gPauseToQuestStatusJPNTex, gPauseToQuestStatusENGTex, gPauseToQuestStatusGERTex, gPauseToQuestStatusFRATex), @@ -1677,9 +1677,13 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { LANGUAGE_ARRAY(gPauseToSelectItemJPNTex, gPauseToSelectItemENGTex, gPauseToSelectItemGERTex, gPauseToSelectItemFRATex), }; - static u16 D_8082ADD8[] = LANGUAGE_ARRAY(56, 56, 88, 80); - static u16 D_8082ADE0[] = LANGUAGE_ARRAY(48, 64, 88, 72); - static u16 D_8082ADE8[] = LANGUAGE_ARRAY(96, 80, 104, 112); + static u16 sToEquipTextWidths[] = LANGUAGE_ARRAY(gPauseToEquipJPNTex_WIDTH, gPauseToEquipENGTex_WIDTH, + gPauseToEquipGERTex_WIDTH, gPauseToEquipFRATex_WIDTH); + static u16 sToDecideTextWidths[] = LANGUAGE_ARRAY(gPauseToDecideJPNTex_WIDTH, gPauseToDecideENGTex_WIDTH, + gPauseToDecideGERTex_WIDTH, gPauseToDecideFRATex_WIDTH); + static u16 sToPlayMelodyTextWidths[] = + LANGUAGE_ARRAY(gPauseToPlayMelodyJPNTex_WIDTH, gPauseToPlayMelodyENGTex_WIDTH, gPauseToPlayMelodyGERTex_WIDTH, + gPauseToPlayMelodyFRATex_WIDTH); static s16 D_8082ADF0[][4] = { { 180, 210, 255, 220 }, { 100, 100, 150, 220 }, @@ -1974,20 +1978,20 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK2(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = - pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADE0[gSaveContext.language]; + pauseCtx->infoPanelVtx[20].v.ob[0] + sToDecideTextWidths[gSaveContext.language]; pauseCtx->infoPanelVtx[17].v.tc[0] = pauseCtx->infoPanelVtx[19].v.tc[0] = 0x300; - pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = D_8082ADE0[gSaveContext.language] - << 5; + pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = + sToDecideTextWidths[gSaveContext.language] << 5; gSPDisplayList(POLY_OPA_DISP++, gAButtonIconDL); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); - POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_8082AD60[gSaveContext.language], - D_8082ADE0[gSaveContext.language], 16, 4); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sToDecideTextTextures[gSaveContext.language], + sToDecideTextWidths[gSaveContext.language], 16, 4); } else if (pauseCtx->cursorSpecialPos != 0) { if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = -63; @@ -2002,10 +2006,12 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { POLY_OPA_DISP = KaleidoScope_QuadTextureIA8( - POLY_OPA_DISP, D_8082AD78[pauseCtx->pageIndex][gSaveContext.language], 128, 16, 0); + POLY_OPA_DISP, sScrollLeftLabels[pauseCtx->pageIndex][gSaveContext.language], + TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 0); } else { POLY_OPA_DISP = KaleidoScope_QuadTextureIA8( - POLY_OPA_DISP, D_8082ADA8[pauseCtx->pageIndex][gSaveContext.language], 128, 16, 0); + POLY_OPA_DISP, sScrollRightLabels[pauseCtx->pageIndex][gSaveContext.language], + TO_PAGE_LABEL_TEX_WIDTH, TO_PAGE_LABEL_TEX_HEIGHT, 0); } } } else { @@ -2020,20 +2026,20 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK4(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = - pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADD8[gSaveContext.language]; + pauseCtx->infoPanelVtx[20].v.ob[0] + sToEquipTextWidths[gSaveContext.language]; pauseCtx->infoPanelVtx[17].v.tc[0] = pauseCtx->infoPanelVtx[19].v.tc[0] = 0x600; pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = - D_8082ADD8[gSaveContext.language] << 5; + sToEquipTextWidths[gSaveContext.language] << 5; gSPDisplayList(POLY_OPA_DISP++, gCButtonIconsDL); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); - POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_8082AD54[gSaveContext.language], - D_8082ADD8[gSaveContext.language], 16, 4); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sToEquipTextTextures[gSaveContext.language], + sToEquipTextWidths[gSaveContext.language], 16, 4); } else if ((pauseCtx->pageIndex == PAUSE_MAP) && sInDungeonScene) { } else if ((pauseCtx->pageIndex == PAUSE_QUEST) && @@ -2056,20 +2062,21 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { #endif pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = - pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADE8[gSaveContext.language]; + pauseCtx->infoPanelVtx[20].v.ob[0] + sToPlayMelodyTextWidths[gSaveContext.language]; pauseCtx->infoPanelVtx[17].v.tc[0] = pauseCtx->infoPanelVtx[19].v.tc[0] = 0x300; pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = - D_8082ADE8[gSaveContext.language] << 5; + sToPlayMelodyTextWidths[gSaveContext.language] << 5; gSPDisplayList(POLY_OPA_DISP++, gAButtonIconDL); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); - POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_8082AD6C[gSaveContext.language], - D_8082ADE8[gSaveContext.language], 16, 4); + POLY_OPA_DISP = + KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sToPlayMelodyTextTextures[gSaveContext.language], + sToPlayMelodyTextWidths[gSaveContext.language], 16, 4); } } else if (pauseCtx->pageIndex == PAUSE_EQUIP) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = @@ -2082,20 +2089,20 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { pauseCtx->infoPanelVtx[16].v.ob[0] + R_KALEIDO_UNK2(gSaveContext.language); pauseCtx->infoPanelVtx[21].v.ob[0] = pauseCtx->infoPanelVtx[23].v.ob[0] = - pauseCtx->infoPanelVtx[20].v.ob[0] + D_8082ADD8[gSaveContext.language]; + pauseCtx->infoPanelVtx[20].v.ob[0] + sToEquipTextWidths[gSaveContext.language]; pauseCtx->infoPanelVtx[17].v.tc[0] = pauseCtx->infoPanelVtx[19].v.tc[0] = 0x300; pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = - D_8082ADD8[gSaveContext.language] << 5; + sToEquipTextWidths[gSaveContext.language] << 5; gSPDisplayList(POLY_OPA_DISP++, gAButtonIconDL); gDPPipeSync(POLY_OPA_DISP++); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); - POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_8082AD54[gSaveContext.language], - D_8082ADD8[gSaveContext.language], 16, 4); + POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, sToEquipTextTextures[gSaveContext.language], + sToEquipTextWidths[gSaveContext.language], 16, 4); } } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index 8f42eb244d..566b087e68 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -218,6 +218,9 @@ typedef enum ItemQuad { /* 41 */ ITEM_QUAD_MAX } ItemQuad; +#define TO_PAGE_LABEL_TEX_WIDTH 128 +#define TO_PAGE_LABEL_TEX_HEIGHT 16 + void KaleidoScope_DrawQuestStatus(struct PlayState* play, GraphicsContext* gfxCtx); s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point); void KaleidoScope_DrawInventoryEditor(struct PlayState* play); From 2054637cabe89091df35d86538ee8bff37a263c5 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sat, 14 Jun 2025 23:06:12 +0200 Subject: [PATCH 5/9] Name most `object_gi_*` textures (#2629) * Name most `object_gi_*` textures * gGiButterflyTex --- assets/xml/objects/object_gi_boots_2.xml | 2 +- assets/xml/objects/object_gi_butterfly.xml | 2 +- assets/xml/objects/object_gi_clothes.xml | 2 +- assets/xml/objects/object_gi_dekupouch.xml | 2 +- assets/xml/objects/object_gi_fire.xml | 4 ++-- assets/xml/objects/object_gi_frog.xml | 2 +- assets/xml/objects/object_gi_gerudo.xml | 2 +- assets/xml/objects/object_gi_gerudomask.xml | 10 +++++----- assets/xml/objects/object_gi_ghost.xml | 4 ++-- assets/xml/objects/object_gi_gloves.xml | 2 +- assets/xml/objects/object_gi_golonmask.xml | 10 +++++----- assets/xml/objects/object_gi_hoverboots.xml | 2 +- assets/xml/objects/object_gi_ki_tan_mask.xml | 2 +- assets/xml/objects/object_gi_letter.xml | 4 ++-- assets/xml/objects/object_gi_liquid.xml | 6 +++--- assets/xml/objects/object_gi_milk.xml | 2 +- assets/xml/objects/object_gi_niwatori.xml | 4 ++-- assets/xml/objects/object_gi_ocarina.xml | 2 +- assets/xml/objects/object_gi_ocarina_0.xml | 2 +- assets/xml/objects/object_gi_prescription.xml | 2 +- assets/xml/objects/object_gi_rabit_mask.xml | 2 +- assets/xml/objects/object_gi_shield_3.xml | 4 ++-- assets/xml/objects/object_gi_soldout.xml | 2 +- assets/xml/objects/object_gi_soul.xml | 2 +- assets/xml/objects/object_gi_ticketstone.xml | 4 ++-- assets/xml/objects/object_gi_truth_mask.xml | 4 ++-- assets/xml/objects/object_gi_zoramask.xml | 6 +++--- 27 files changed, 46 insertions(+), 46 deletions(-) diff --git a/assets/xml/objects/object_gi_boots_2.xml b/assets/xml/objects/object_gi_boots_2.xml index ae5d148421..539422c518 100644 --- a/assets/xml/objects/object_gi_boots_2.xml +++ b/assets/xml/objects/object_gi_boots_2.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_butterfly.xml b/assets/xml/objects/object_gi_butterfly.xml index 65eed5b0e8..55ad075ff6 100644 --- a/assets/xml/objects/object_gi_butterfly.xml +++ b/assets/xml/objects/object_gi_butterfly.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_clothes.xml b/assets/xml/objects/object_gi_clothes.xml index be9853eb8f..5108c274b9 100644 --- a/assets/xml/objects/object_gi_clothes.xml +++ b/assets/xml/objects/object_gi_clothes.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/objects/object_gi_dekupouch.xml b/assets/xml/objects/object_gi_dekupouch.xml index d717edb8ba..4c2b6f6a11 100644 --- a/assets/xml/objects/object_gi_dekupouch.xml +++ b/assets/xml/objects/object_gi_dekupouch.xml @@ -2,7 +2,7 @@ - + diff --git a/assets/xml/objects/object_gi_fire.xml b/assets/xml/objects/object_gi_fire.xml index 0211f60187..c754877a8e 100644 --- a/assets/xml/objects/object_gi_fire.xml +++ b/assets/xml/objects/object_gi_fire.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_frog.xml b/assets/xml/objects/object_gi_frog.xml index 53384429b4..8591106120 100644 --- a/assets/xml/objects/object_gi_frog.xml +++ b/assets/xml/objects/object_gi_frog.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_gerudo.xml b/assets/xml/objects/object_gi_gerudo.xml index 34986a295e..a767dab10e 100644 --- a/assets/xml/objects/object_gi_gerudo.xml +++ b/assets/xml/objects/object_gi_gerudo.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_gerudomask.xml b/assets/xml/objects/object_gi_gerudomask.xml index 94576b0406..4a98e810f9 100644 --- a/assets/xml/objects/object_gi_gerudomask.xml +++ b/assets/xml/objects/object_gi_gerudomask.xml @@ -1,11 +1,11 @@ - + - - - - + + + + diff --git a/assets/xml/objects/object_gi_ghost.xml b/assets/xml/objects/object_gi_ghost.xml index 5dbf39480f..1c98056d85 100644 --- a/assets/xml/objects/object_gi_ghost.xml +++ b/assets/xml/objects/object_gi_ghost.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_gloves.xml b/assets/xml/objects/object_gi_gloves.xml index 85ad6ddeff..59d07b16d7 100644 --- a/assets/xml/objects/object_gi_gloves.xml +++ b/assets/xml/objects/object_gi_gloves.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_golonmask.xml b/assets/xml/objects/object_gi_golonmask.xml index 68dbddb365..45c2ba24cd 100644 --- a/assets/xml/objects/object_gi_golonmask.xml +++ b/assets/xml/objects/object_gi_golonmask.xml @@ -1,11 +1,11 @@ - + - - - - + + + + diff --git a/assets/xml/objects/object_gi_hoverboots.xml b/assets/xml/objects/object_gi_hoverboots.xml index fed584e742..96a4769ffc 100644 --- a/assets/xml/objects/object_gi_hoverboots.xml +++ b/assets/xml/objects/object_gi_hoverboots.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_ki_tan_mask.xml b/assets/xml/objects/object_gi_ki_tan_mask.xml index b888acfe73..90a2cfca4d 100644 --- a/assets/xml/objects/object_gi_ki_tan_mask.xml +++ b/assets/xml/objects/object_gi_ki_tan_mask.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_letter.xml b/assets/xml/objects/object_gi_letter.xml index 098b8cca79..0034b0466c 100644 --- a/assets/xml/objects/object_gi_letter.xml +++ b/assets/xml/objects/object_gi_letter.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/objects/object_gi_liquid.xml b/assets/xml/objects/object_gi_liquid.xml index 133d8ce902..c40e8110db 100644 --- a/assets/xml/objects/object_gi_liquid.xml +++ b/assets/xml/objects/object_gi_liquid.xml @@ -1,9 +1,9 @@ - - - + + + diff --git a/assets/xml/objects/object_gi_milk.xml b/assets/xml/objects/object_gi_milk.xml index cc72cec9d1..5fedddbe15 100644 --- a/assets/xml/objects/object_gi_milk.xml +++ b/assets/xml/objects/object_gi_milk.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_niwatori.xml b/assets/xml/objects/object_gi_niwatori.xml index edf67f88d8..837ba16628 100644 --- a/assets/xml/objects/object_gi_niwatori.xml +++ b/assets/xml/objects/object_gi_niwatori.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_ocarina.xml b/assets/xml/objects/object_gi_ocarina.xml index dafcb92424..057b6bf5e1 100644 --- a/assets/xml/objects/object_gi_ocarina.xml +++ b/assets/xml/objects/object_gi_ocarina.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_ocarina_0.xml b/assets/xml/objects/object_gi_ocarina_0.xml index e43bb3a87c..a8104984be 100644 --- a/assets/xml/objects/object_gi_ocarina_0.xml +++ b/assets/xml/objects/object_gi_ocarina_0.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_prescription.xml b/assets/xml/objects/object_gi_prescription.xml index 1b4e54ec5d..b83d3dfce2 100644 --- a/assets/xml/objects/object_gi_prescription.xml +++ b/assets/xml/objects/object_gi_prescription.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_rabit_mask.xml b/assets/xml/objects/object_gi_rabit_mask.xml index 65b6cdd4bc..177d640692 100644 --- a/assets/xml/objects/object_gi_rabit_mask.xml +++ b/assets/xml/objects/object_gi_rabit_mask.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_shield_3.xml b/assets/xml/objects/object_gi_shield_3.xml index 3550bd0d89..f1860d200a 100644 --- a/assets/xml/objects/object_gi_shield_3.xml +++ b/assets/xml/objects/object_gi_shield_3.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_soldout.xml b/assets/xml/objects/object_gi_soldout.xml index ba45784761..be9398e25c 100644 --- a/assets/xml/objects/object_gi_soldout.xml +++ b/assets/xml/objects/object_gi_soldout.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/objects/object_gi_soul.xml b/assets/xml/objects/object_gi_soul.xml index 519226270d..f991bf131c 100644 --- a/assets/xml/objects/object_gi_soul.xml +++ b/assets/xml/objects/object_gi_soul.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_gi_ticketstone.xml b/assets/xml/objects/object_gi_ticketstone.xml index ce756e3abc..238081eaa3 100644 --- a/assets/xml/objects/object_gi_ticketstone.xml +++ b/assets/xml/objects/object_gi_ticketstone.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_truth_mask.xml b/assets/xml/objects/object_gi_truth_mask.xml index 32c550560c..2a8608d79b 100644 --- a/assets/xml/objects/object_gi_truth_mask.xml +++ b/assets/xml/objects/object_gi_truth_mask.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/objects/object_gi_zoramask.xml b/assets/xml/objects/object_gi_zoramask.xml index 0788f67f0d..71b29f454b 100644 --- a/assets/xml/objects/object_gi_zoramask.xml +++ b/assets/xml/objects/object_gi_zoramask.xml @@ -1,11 +1,11 @@ - + - - + + From d3ed1378780242c51587cb9524653e89cb2e171d Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sun, 15 Jun 2025 19:55:11 +0200 Subject: [PATCH 6/9] Assets: Move limb enums into xmls 3 (#2630) --- assets/xml/objects/object_in.xml | 40 +++---- assets/xml/objects/object_sk2.xml | 122 ++++++++++---------- assets/xml/objects/object_ta.xml | 34 +++--- assets/xml/objects/object_vali.xml | 58 +++++----- src/overlays/actors/ovl_En_In/z_en_in.c | 14 +-- src/overlays/actors/ovl_En_In/z_en_in.h | 25 +--- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 12 +- src/overlays/actors/ovl_En_Ta/z_en_ta.h | 26 +---- src/overlays/actors/ovl_En_Test/z_en_test.h | 66 +---------- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 12 +- src/overlays/actors/ovl_En_Vali/z_en_vali.h | 38 +----- 11 files changed, 154 insertions(+), 293 deletions(-) diff --git a/assets/xml/objects/object_in.xml b/assets/xml/objects/object_in.xml index 4530adc370..84bc84804b 100644 --- a/assets/xml/objects/object_in.xml +++ b/assets/xml/objects/object_in.xml @@ -216,27 +216,27 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + diff --git a/assets/xml/objects/object_sk2.xml b/assets/xml/objects/object_sk2.xml index 87e7a37831..9ee3768863 100644 --- a/assets/xml/objects/object_sk2.xml +++ b/assets/xml/objects/object_sk2.xml @@ -116,67 +116,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ta.xml b/assets/xml/objects/object_ta.xml index d73e28972a..5ab3863b7f 100644 --- a/assets/xml/objects/object_ta.xml +++ b/assets/xml/objects/object_ta.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_vali.xml b/assets/xml/objects/object_vali.xml index 5e511a1494..240a7e1371 100644 --- a/assets/xml/objects/object_vali.xml +++ b/assets/xml/objects/object_vali.xml @@ -71,34 +71,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 3fb2a8f5e9..9feac621ff 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -992,24 +992,24 @@ s32 EnIn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnIn* this = (EnIn*)thisx; Vec3s limbRot; - if (this->actor.params > 0 && limbIndex != INGO_HEAD_LIMB) { + if (this->actor.params > 0 && limbIndex != INGO_LIMB_HEAD) { if (sAdultEraDLs[limbIndex] != NULL) { *dList = sAdultEraDLs[limbIndex]; } } - if (limbIndex == INGO_HEAD_LIMB) { + if (limbIndex == INGO_LIMB_HEAD) { Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); limbRot = this->interactInfo.headRot; Matrix_RotateZ(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); } - if (limbIndex == INGO_CHEST_LIMB) { + if (limbIndex == INGO_LIMB_CHEST) { limbRot = this->interactInfo.torsoRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); } - if (limbIndex == INGO_CHEST_LIMB || limbIndex == INGO_LEFT_SHOULDER_LIMB || limbIndex == INGO_RIGHT_SHOULDER_LIMB) { + if (limbIndex == INGO_LIMB_CHEST || limbIndex == INGO_LIMB_LEFT_SHOULDER || limbIndex == INGO_LIMB_RIGHT_SHOULDER) { rot->y += Math_SinS(this->unk_330[limbIndex].y) * 200.0f; rot->z += Math_CosS(this->unk_330[limbIndex].z) * 200.0f; } @@ -1022,14 +1022,14 @@ void EnIn_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, OPEN_DISPS(play->state.gfxCtx, "../z_en_in.c", 2335); - if (limbIndex == INGO_HEAD_LIMB) { + if (limbIndex == INGO_LIMB_HEAD) { Matrix_MultVec3f(&D_80A7B9A8, &this->actor.focus.pos); this->actor.focus.rot = this->actor.world.rot; } - if (limbIndex == INGO_LEFT_HAND_LIMB && this->skelAnime.animation == &object_in_Anim_014CA8) { + if (limbIndex == INGO_LIMB_LEFT_HAND && this->skelAnime.animation == &object_in_Anim_014CA8) { gSPDisplayList(POLY_OPA_DISP++, gIngoChildEraBasketDL); } - if (limbIndex == INGO_RIGHT_HAND_LIMB && this->skelAnime.animation == &object_in_Anim_014CA8) { + if (limbIndex == INGO_LIMB_RIGHT_HAND && this->skelAnime.animation == &object_in_Anim_014CA8) { gSPDisplayList(POLY_OPA_DISP++, gIngoChildEraPitchForkDL); } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 78d8f89170..2e4ecff82c 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -3,35 +3,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_in/object_in.h" struct EnIn; typedef void (*EnInActionFunc)(struct EnIn*, struct PlayState*); -typedef enum IngoLimb { - /* 0x00 */ INGO_LIMB_NONE, - /* 0x01 */ INGO_LIMB_ROOT, - /* 0x02 */ INGO_LEFT_THIGH_LIMB, - /* 0x03 */ INGO_LEFT_LEG_LIMB, - /* 0x04 */ INGO_LEFT_FOOT_LIMB, - /* 0x05 */ INGO_RIGHT_THIGH_LIMB, - /* 0x06 */ INGO_RIGHT_LEG_LIMB, - /* 0x07 */ INGO_RIGHT_FOOT_LIMB, - /* 0x08 */ INGO_TORSO_LIMB, - /* 0x09 */ INGO_CHEST_LIMB, - /* 0x0A */ INGO_LEFT_SHOULDER_LIMB, - /* 0x0B */ INGO_LEFT_ARM_LIMB, - /* 0x0C */ INGO_LEFT_HAND_LIMB, - /* 0x0D */ INGO_RIGHT_SHOULDER_LIMB, - /* 0x0E */ INGO_RIGHT_ARM_LIMB, - /* 0x0F */ INGO_RIGHT_HAND_LIMB, - /* 0x10 */ INGO_HEAD_LIMB, - /* 0x11 */ INGO_LEFT_EYEBROW_LIMB, - /* 0x12 */ INGO_RIGHTEYEBROW_LIMB, - /* 0x13 */ INGO_MUSTACHE_LIMB, - /* 0x14 */ INGO_LIMB_MAX -} IngoLimb; - typedef struct EnIn { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 353cb507b4..f8d842b7ee 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -159,7 +159,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gTalonSkel, &gTalonStandAnim, this->jointTable, this->morphTable, - ENTA_LIMB_MAX); + TALON_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -1280,12 +1280,12 @@ s32 EnTa_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po // Turn head and chest towards the target (the rotation steps are calculated in EnTa_Update) switch (limbIndex) { - case ENTA_LIMB_CHEST: + case TALON_LIMB_CHEST: rot->x += this->torsoRot.y; rot->y -= this->torsoRot.x; break; - case ENTA_LIMB_HEAD: + case TALON_LIMB_HEAD: rot->x += this->headRot.y; rot->z += this->headRot.x; break; @@ -1300,8 +1300,8 @@ s32 EnTa_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po // in the else if branch below and rocking always occurs. // So this flag has no effect. this->stateFlags &= ~TALON_STATE_FLAG_SUPPRESS_ROCKING_ANIM; - } else if ((limbIndex == ENTA_LIMB_CHEST) || (limbIndex == ENTA_LIMB_LEFT_ARM) || - (limbIndex == ENTA_LIMB_RIGHT_ARM)) { + } else if ((limbIndex == TALON_LIMB_CHEST) || (limbIndex == TALON_LIMB_LEFT_ARM) || + (limbIndex == TALON_LIMB_RIGHT_ARM)) { s32 fidgetFrequency = limbIndex * FIDGET_FREQ_LIMB; rot->y += Math_SinS(play->state.frames * (fidgetFrequency + FIDGET_FREQ_Y)) * FIDGET_AMPLITUDE; @@ -1315,7 +1315,7 @@ void EnTa_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, static Vec3f headOffset = { 1100.0f, 1000.0f, 0.0f }; EnTa* this = (EnTa*)thisx; - if (limbIndex == ENTA_LIMB_HEAD) { + if (limbIndex == TALON_LIMB_HEAD) { Matrix_MultVec3f(&headOffset, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/src/overlays/actors/ovl_En_Ta/z_en_ta.h index d8888d79b3..ac193819d8 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -3,6 +3,7 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_ta/object_ta.h" struct EnTa; @@ -16,32 +17,11 @@ typedef enum EnTaType { /* 0x0002 */ ENTA_RETURNED_FROM_KAKARIKO } EnTaType; -typedef enum EnTaLimb { - /* 0x00 */ ENTA_LIMB_NONE, - /* 0x01 */ ENTA_LIMB_ROOT, - /* 0x02 */ ENTA_LIMB_LEFT_THIGH, - /* 0x03 */ ENTA_LIMB_LEFT_LEG, - /* 0x04 */ ENTA_LIMB_LEFT_FOOT, - /* 0x05 */ ENTA_LIMB_RIGHT_THIGH, - /* 0x06 */ ENTA_LIMB_RIGHT_LEG, - /* 0x07 */ ENTA_LIMB_RIGHT_FOOT, - /* 0x08 */ ENTA_LIMB_CHEST, - /* 0x09 */ ENTA_LIMB_LEFT_SHOULDER, - /* 0x0A */ ENTA_LIMB_LEFT_ARM, - /* 0x0B */ ENTA_LIMB_LEFT_HAND, - /* 0x0C */ ENTA_LIMB_RIGHT_SHOULDER, - /* 0x0D */ ENTA_LIMB_RIGHT_ARM, - /* 0x0E */ ENTA_LIMB_RIGHT_HAND, - /* 0x0F */ ENTA_LIMB_HEAD, - /* 0x10 */ ENTA_LIMB_TORSO, - /* 0x11 */ ENTA_LIMB_MAX -} EnTaLimb; - typedef struct EnTa { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; - /* 0x0190 */ Vec3s jointTable[ENTA_LIMB_MAX]; - /* 0x01F6 */ Vec3s morphTable[ENTA_LIMB_MAX]; + /* 0x0190 */ Vec3s jointTable[TALON_LIMB_MAX]; + /* 0x01F6 */ Vec3s morphTable[TALON_LIMB_MAX]; /* 0x025C */ EnTaActionFunc actionFunc; /* 0x0260 */ EnTaAnimFunc animFunc; /* 0x0264 */ ColliderCylinder collider; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index 8a0e41abf6..8cd0191654 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -3,76 +3,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_sk2/object_sk2.h" struct EnTest; typedef void (*EnTestActionFunc)(struct EnTest*, struct PlayState*); -typedef enum StalfosLimb { - /* 0x00 */ STALFOS_LIMB_NONE, - /* 0x01 */ STALFOS_LIMB_ROOT, - /* 0x02 */ STALFOS_LIMB_UPPERBODY_ROOT, - /* 0x03 */ STALFOS_LIMB_CORE_LOWER_ROOT, - /* 0x04 */ STALFOS_LIMB_CORE_UPPER_ROOT, - /* 0x05 */ STALFOS_LIMB_NECK_ROOT, - /* 0x06 */ STALFOS_LIMB_HEAD_ROOT, - /* 0x07 */ STALFOS_LIMB_7, - /* 0x08 */ STALFOS_LIMB_8, - /* 0x09 */ STALFOS_LIMB_JAW_ROOT, - /* 0x0A */ STALFOS_LIMB_JAW, - /* 0x0B */ STALFOS_LIMB_HEAD, - /* 0x0C */ STALFOS_LIMB_NECK_UPPER, - /* 0x0D */ STALFOS_LIMB_NECK_LOWER, - /* 0x0E */ STALFOS_LIMB_CORE_UPPER, - /* 0x0F */ STALFOS_LIMB_CHEST, - /* 0x10 */ STALFOS_LIMB_SHOULDER_R_ROOT, - /* 0x11 */ STALFOS_LIMB_SHOULDER_ARMOR_R_ROOT, - /* 0x12 */ STALFOS_LIMB_SHOULDER_ARMOR_R, - /* 0x13 */ STALFOS_LIMB_SHOULDER_L_ROOT, - /* 0x14 */ STALFOS_LIMB_SHOULDER_ARMOR_L_ROOT, - /* 0x15 */ STALFOS_LIMB_SHOULDER_ARMOR_L, - /* 0x16 */ STALFOS_LIMB_ARM_L_ROOT, - /* 0x17 */ STALFOS_LIMB_UPPERARM_L_ROOT, - /* 0x18 */ STALFOS_LIMB_FOREARM_L_ROOT, - /* 0x19 */ STALFOS_LIMB_HAND_L_ROOT, - /* 0x1A */ STALFOS_LIMB_HAND_L, - /* 0x1B */ STALFOS_LIMB_SHIELD, - /* 0x1C */ STALFOS_LIMB_FOREARM_L, - /* 0x1D */ STALFOS_LIMB_UPPERARM_L, - /* 0x1E */ STALFOS_LIMB_ARM_R_ROOT, - /* 0x1F */ STALFOS_LIMB_UPPERARM_R_ROOT, - /* 0x20 */ STALFOS_LIMB_FOREARM_R_ROOT, - /* 0x21 */ STALFOS_LIMB_HAND_R_ROOT, - /* 0x22 */ STALFOS_LIMB_SWORD, - /* 0x23 */ STALFOS_LIMB_HAND_R, - /* 0x24 */ STALFOS_LIMB_FOREARM_R, - /* 0x25 */ STALFOS_LIMB_UPPERARM_R, - /* 0x26 */ STALFOS_LIMB_CORE_LOWER, - /* 0x27 */ STALFOS_LIMB_LOWERBODY_ROOT, - /* 0x28 */ STALFOS_LIMB_WAIST_ROOT, - /* 0x29 */ STALFOS_LIMB_LEGS_ROOT, - /* 0x2A */ STALFOS_LIMB_LEG_L_ROOT, - /* 0x2B */ STALFOS_LIMB_THIGH_L_ROOT, - /* 0x2C */ STALFOS_LIMB_LOWERLEG_L_ROOT, - /* 0x2D */ STALFOS_LIMB_ANKLE_L_ROOT, - /* 0x2E */ STALFOS_LIMB_ANKLE_L, - /* 0x2F */ STALFOS_LIMB_FOOT_L_ROOT, - /* 0x30 */ STALFOS_LIMB_FOOT_L, - /* 0x31 */ STALFOS_LIMB_LOWERLEG_L, - /* 0x32 */ STALFOS_LIMB_THIGH_L, - /* 0x33 */ STALFOS_LIMB_LEG_R_ROOT, - /* 0x34 */ STALFOS_LIMB_THIGH_R_ROOT, - /* 0x35 */ STALFOS_LIMB_LOWERLEG_R_ROOT, - /* 0x36 */ STALFOS_LIMB_ANKLE_R_ROOT, - /* 0x37 */ STALFOS_LIMB_ANKLE_R, - /* 0x38 */ STALFOS_LIMB_FOOT_R_ROOT, - /* 0x39 */ STALFOS_LIMB_FOOT_R, - /* 0x3A */ STALFOS_LIMB_LOWERLEG_R, - /* 0x3B */ STALFOS_LIMB_THIGH_R, - /* 0x3C */ STALFOS_LIMB_WAIST, - /* 0x3D */ STALFOS_LIMB_MAX -} StalfosLimb; - typedef struct EnTest { /* 0x000 */ Actor actor; /* 0x14C */ Vec3s bodyPartsPos[10]; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 643cae1b35..e2b1d53054 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -156,7 +156,7 @@ void EnVali_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 27.0f); this->actor.shape.shadowAlpha = 155; SkelAnime_Init(play, &this->skelAnime, &gBariSkel, &gBariLurkingAnim, this->jointTable, this->morphTable, - EN_VALI_LIMB_MAX); + VALI_LIMB_MAX); Collider_InitQuad(play, &this->leftArmCollider); Collider_SetQuad(play, &this->leftArmCollider, &this->actor, &sQuadInit); @@ -689,14 +689,14 @@ s32 EnVali_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* EnVali* this = (EnVali*)thisx; f32 curFrame; - if ((limbIndex == EN_VALI_LIMB_NUCLEUS) || (limbIndex == EN_VALI_LIMB_OUTER_HOOD) || - (limbIndex == EN_VALI_LIMB_INNER_HOOD)) { + if ((limbIndex == VALI_LIMB_NUCLEUS) || (limbIndex == VALI_LIMB_OUTER_HOOD) || + (limbIndex == VALI_LIMB_INNER_HOOD)) { *dList = NULL; return false; } else { curFrame = this->skelAnime.curFrame; - if ((limbIndex == EN_VALI_LIMB_LEFT_ARM_BASE) || (limbIndex == EN_VALI_LIMB_RIGHT_ARM_BASE)) { + if ((limbIndex == VALI_LIMB_LEFT_ARM_BASE) || (limbIndex == VALI_LIMB_RIGHT_ARM_BASE)) { if (EnVali_SetArmLength(this, curFrame)) { Matrix_Scale(this->armScale, 1.0f, 1.0f, MTXMODE_APPLY); } @@ -714,11 +714,11 @@ void EnVali_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot EnVali* this = (EnVali*)thisx; if (this->actionFunc == EnVali_FloatIdle) { - if ((limbIndex == EN_VALI_LIMB_LEFT_FOREARM_BASE) || (limbIndex == EN_VALI_LIMB_RIGHT_FOREARM_BASE)) { + if ((limbIndex == VALI_LIMB_LEFT_FOREARM_BASE) || (limbIndex == VALI_LIMB_RIGHT_FOREARM_BASE)) { Matrix_MultVec3f(&D_80B28970, &sp3C); Matrix_MultVec3f(&D_80B2897C, &sp30); - if (limbIndex == EN_VALI_LIMB_LEFT_FOREARM_BASE) { + if (limbIndex == VALI_LIMB_LEFT_FOREARM_BASE) { Collider_SetQuadVertices(&this->leftArmCollider, &sp30, &sp3C, &this->leftArmCollider.dim.quad[0], &this->leftArmCollider.dim.quad[1]); } else { diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/src/overlays/actors/ovl_En_Vali/z_en_vali.h index 66ac96d3d1..3659882f61 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -3,44 +3,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_vali/object_vali.h" struct EnVali; typedef void (*EnValiActionFunc)(struct EnVali*, struct PlayState*); -typedef enum EnValiLimb { - /* 0x00 */ EN_VALI_LIMB_NONE, - /* 0x01 */ EN_VALI_LIMB_NUCLEUS_BASE, - /* 0x02 */ EN_VALI_LIMB_NUCLEUS, - /* 0x03 */ EN_VALI_LIMB_RIGHT_MANDIBLE_BASE_BASE, - /* 0x04 */ EN_VALI_LIMB_RIGHT_MANDIBLE_BASE, - /* 0x05 */ EN_VALI_LIMB_RIGHT_MANDIBLE, - /* 0x06 */ EN_VALI_LIMB_LEFT_MANDIBLE_BASE_BASE, - /* 0x07 */ EN_VALI_LIMB_LEFT_MANDIBLE_BASE, - /* 0x08 */ EN_VALI_LIMB_LEFT_MANDIBLE, - /* 0x09 */ EN_VALI_LIMB_LEFT_ARM_BASE, - /* 0x0A */ EN_VALI_LIMB_LEFT_UPPER_ARM_BASE, - /* 0x0B */ EN_VALI_LIMB_LEFT_FOREARM_BASE, - /* 0x0C */ EN_VALI_LIMB_LEFT_CLAW_BODY_BASE, - /* 0x0D */ EN_VALI_LIMB_LEFT_CLAW_TIP_BASE, - /* 0x0E */ EN_VALI_LIMB_LEFT_CLAW_TIP, - /* 0x0F */ EN_VALI_LIMB_LEFT_CLAW_BODY, - /* 0x10 */ EN_VALI_LIMB_LEFT_FOREARM, - /* 0x11 */ EN_VALI_LIMB_LEFT_UPPER_ARM, - /* 0x12 */ EN_VALI_LIMB_RIGHT_ARM_BASE, - /* 0x13 */ EN_VALI_LIMB_RIGHT_UPPER_ARM_BASE, - /* 0x14 */ EN_VALI_LIMB_RIGHT_FOREARM_BASE, - /* 0x15 */ EN_VALI_LIMB_RIGHT_CLAW_BODY_BASE, - /* 0x16 */ EN_VALI_LIMB_RIGHT_CLAW_TIP_BASE, - /* 0x17 */ EN_VALI_LIMB_RIGHT_CLAW_TIP, - /* 0x18 */ EN_VALI_LIMB_RIGHT_CLAW_BODY, - /* 0x19 */ EN_VALI_LIMB_RIGHT_FOREARM, - /* 0x1A */ EN_VALI_LIMB_RIGHT_UPPER_ARM, - /* 0x1B */ EN_VALI_LIMB_INNER_HOOD, - /* 0x1C */ EN_VALI_LIMB_OUTER_HOOD, - /* 0x1D */ EN_VALI_LIMB_MAX -} EnValiLimb; - typedef struct EnVali { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; @@ -48,8 +16,8 @@ typedef struct EnVali { /* 0x0194 */ u8 lightningTimer; /* 0x0195 */ u8 slingshotReactionTimer; /* 0x0196 */ s16 timer; - /* 0x0198 */ Vec3s jointTable[EN_VALI_LIMB_MAX]; - /* 0x0246 */ Vec3s morphTable[EN_VALI_LIMB_MAX]; + /* 0x0198 */ Vec3s jointTable[VALI_LIMB_MAX]; + /* 0x0246 */ Vec3s morphTable[VALI_LIMB_MAX]; /* 0x02F4 */ f32 armScale; /* 0x02F8 */ f32 floatHomeHeight; // Used as a centre for floating when visible (home is used for the lurk height) /* 0x02FC */ ColliderQuad leftArmCollider; From 05a281855740f2c7dc4a9fef482286b3032a9a7e Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sun, 15 Jun 2025 20:32:54 +0200 Subject: [PATCH 7/9] Assets: Move limb enums into xmls 4 (#2631) --- assets/xml/objects/object_ma2.xml | 38 +++++++++++------------ assets/xml/objects/object_md.xml | 34 ++++++++++---------- assets/xml/objects/object_nb.xml | 38 +++++++++++------------ src/overlays/actors/ovl_En_Ma2/z_en_ma2.c | 14 ++++----- src/overlays/actors/ovl_En_Ma2/z_en_ma2.h | 24 +------------- src/overlays/actors/ovl_En_Ma3/z_en_ma3.h | 24 +------------- src/overlays/actors/ovl_En_Md/z_en_md.c | 20 ++++++------ src/overlays/actors/ovl_En_Md/z_en_md.h | 30 +++--------------- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 11 ++++--- src/overlays/actors/ovl_En_Nb/z_en_nb.h | 28 ++--------------- 10 files changed, 88 insertions(+), 173 deletions(-) diff --git a/assets/xml/objects/object_ma2.xml b/assets/xml/objects/object_ma2.xml index 960e9485bf..b6492afd84 100644 --- a/assets/xml/objects/object_ma2.xml +++ b/assets/xml/objects/object_ma2.xml @@ -99,25 +99,25 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_md.xml b/assets/xml/objects/object_md.xml index ea1fca3cda..db5bed45bb 100644 --- a/assets/xml/objects/object_md.xml +++ b/assets/xml/objects/object_md.xml @@ -1,25 +1,25 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_nb.xml b/assets/xml/objects/object_nb.xml index cf2dba8da4..9b909a89eb 100644 --- a/assets/xml/objects/object_nb.xml +++ b/assets/xml/objects/object_nb.xml @@ -2,27 +2,27 @@ - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index ed01e29e4a..45cb07bae2 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -363,23 +363,23 @@ s32 EnMa2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p EnMa2* this = (EnMa2*)thisx; Vec3s limbRot; - if ((limbIndex == MALON_ADULT_LEFT_THIGH_LIMB) || (limbIndex == MALON_ADULT_RIGHT_THIGH_LIMB)) { + if ((limbIndex == MALON_ADULT_LIMB_LEFT_THIGH) || (limbIndex == MALON_ADULT_LIMB_RIGHT_THIGH)) { *dList = NULL; } - if (limbIndex == MALON_ADULT_HEAD_LIMB) { + if (limbIndex == MALON_ADULT_LIMB_HEAD) { Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); limbRot = this->interactInfo.headRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); } - if (limbIndex == MALON_ADULT_CHEST_AND_NECK_LIMB) { + if (limbIndex == MALON_ADULT_LIMB_CHEST_AND_NECK) { limbRot = this->interactInfo.torsoRot; Matrix_RotateY(BINANG_TO_RAD_ALT(-limbRot.y), MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD_ALT(-limbRot.x), MTXMODE_APPLY); } - if ((limbIndex == MALON_ADULT_CHEST_AND_NECK_LIMB) || (limbIndex == MALON_ADULT_LEFT_SHOULDER_LIMB) || - (limbIndex == MALON_ADULT_RIGHT_SHOULDER_LIMB)) { + if ((limbIndex == MALON_ADULT_LIMB_CHEST_AND_NECK) || (limbIndex == MALON_ADULT_LIMB_LEFT_SHOULDER) || + (limbIndex == MALON_ADULT_LIMB_RIGHT_SHOULDER)) { rot->y += Math_SinS(this->upperBodyRot[limbIndex].y) * 200.0f; rot->z += Math_CosS(this->upperBodyRot[limbIndex].z) * 200.0f; } @@ -392,10 +392,10 @@ void EnMa2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, OPEN_DISPS(play->state.gfxCtx, "../z_en_ma2.c", 904); - if (limbIndex == MALON_ADULT_HEAD_LIMB) { + if (limbIndex == MALON_ADULT_LIMB_HEAD) { Matrix_MultVec3f(&vec, &this->actor.focus.pos); } - if ((limbIndex == MALON_ADULT_LEFT_HAND_LIMB) && (this->skelAnime.animation == &gMalonAdultStandStillAnim)) { + if ((limbIndex == MALON_ADULT_LIMB_LEFT_HAND) && (this->skelAnime.animation == &gMalonAdultStandStillAnim)) { gSPDisplayList(POLY_OPA_DISP++, gMalonAdultBasketDL); } diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h index 3e2a9b4b86..777d8c73d5 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -3,34 +3,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_ma2/object_ma2.h" struct EnMa2; typedef void (*EnMa2ActionFunc)(struct EnMa2*, struct PlayState*); -typedef enum AdultMalonLimb { - /* 0x00 */ MALON_ADULT_LIMB_NONE, - /* 0x01 */ MALON_ADULT_ROOT_LIMB, - /* 0x02 */ MALON_ADULT_LOWER_CONTROL_LIMB, - /* 0x03 */ MALON_ADULT_LEFT_THIGH_LIMB, - /* 0x04 */ MALON_ADULT_LEFT_LEG_LIMB, - /* 0x05 */ MALON_ADULT_LEFT_FOOT_LIMB, - /* 0x06 */ MALON_ADULT_RIGHT_THIGH_LIMB, - /* 0x07 */ MALON_ADULT_RIGHT_LEG_LIMB, - /* 0x08 */ MALON_ADULT_RIGHT_FOOT_LIMB, - /* 0x09 */ MALON_ADULT_TORSO_LIMB, - /* 0x0A */ MALON_ADULT_DRESS_LIMB, - /* 0x0B */ MALON_ADULT_CHEST_AND_NECK_LIMB, - /* 0x0C */ MALON_ADULT_LEFT_SHOULDER_LIMB, - /* 0x0D */ MALON_ADULT_LEFT_ARM_LIMB, - /* 0x0E */ MALON_ADULT_LEFT_HAND_LIMB, - /* 0x0F */ MALON_ADULT_RIGHT_SHOULDER_LIMB, - /* 0x10 */ MALON_ADULT_RIGHT_ARM_LIMB, - /* 0x11 */ MALON_ADULT_RIGHT_HAND_LIMB, - /* 0x12 */ MALON_ADULT_HEAD_LIMB, - /* 0x13 */ MALON_ADULT_LIMB_MAX -} AdultMalonLimb; - typedef struct EnMa2 { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h index a6bb2096f3..1d3ec1cdfd 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -3,34 +3,12 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_ma2/object_ma2.h" struct EnMa3; typedef void (*EnMa3ActionFunc)(struct EnMa3*, struct PlayState*); -typedef enum AdultMalonLimb { - /* 0x00 */ MALON_ADULT_LIMB_NONE, - /* 0x01 */ MALON_ADULT_LIMB_ROOT, - /* 0x02 */ MALON_ADULT_LIMB_LOWER_CONTROL, - /* 0x03 */ MALON_ADULT_LIMB_LEFT_THIGH, - /* 0x04 */ MALON_ADULT_LIMB_LEFT_LEG, - /* 0x05 */ MALON_ADULT_LIMB_LEFT_FOOT, - /* 0x06 */ MALON_ADULT_LIMB_RIGHT_THIGH, - /* 0x07 */ MALON_ADULT_LIMB_RIGHT_LEG, - /* 0x08 */ MALON_ADULT_LIMB_RIGHT_FOOT, - /* 0x09 */ MALON_ADULT_LIMB_TORSO, - /* 0x0A */ MALON_ADULT_LIMB_DRESS, - /* 0x0B */ MALON_ADULT_LIMB_CHEST_AND_NECK, - /* 0x0C */ MALON_ADULT_LIMB_LEFT_SHOULDER, - /* 0x0D */ MALON_ADULT_LIMB_LEFT_ARM, - /* 0x0E */ MALON_ADULT_LIMB_LEFT_HAND, - /* 0x0F */ MALON_ADULT_LIMB_RIGHT_SHOULDER, - /* 0x10 */ MALON_ADULT_LIMB_RIGHT_ARM, - /* 0x11 */ MALON_ADULT_LIMB_RIGHT_HAND, - /* 0x12 */ MALON_ADULT_LIMB_HEAD, - /* 0x13 */ MALON_ADULT_LIMB_MAX -} AdultMalonLimb; - typedef struct EnMa3 { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 3059baa7bb..d1633deb65 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -687,7 +687,7 @@ void EnMd_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gMidoSkel, NULL, this->jointTable, this->morphTable, ENMD_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gMidoSkel, NULL, this->jointTable, this->morphTable, MIDO_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -727,7 +727,7 @@ void EnMd_Destroy(Actor* thisx, PlayState* play) { void EnMd_Idle(EnMd* this, PlayState* play) { if (this->skelAnime.animation == &gMidoIdleAnim) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ENMD_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, MIDO_LIMB_MAX); } else if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (this->animSequence != ENMD_ANIM_SEQ_SURPRISE_TO_IDLE)) { EnMd_SetAnimSequence(this, ENMD_ANIM_SEQ_SURPRISE_TO_IDLE); @@ -738,7 +738,7 @@ void EnMd_Idle(EnMd* this, PlayState* play) { void EnMd_Watch(EnMd* this, PlayState* play) { if (this->skelAnime.animation == &gMidoIdleAnim) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ENMD_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, MIDO_LIMB_MAX); } EnMd_UpdateAnimSequence(this); } @@ -790,7 +790,7 @@ void EnMd_BlockPath(EnMd* this, PlayState* play) { } if (this->skelAnime.animation == &gMidoIdleAnim) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ENMD_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, MIDO_LIMB_MAX); } if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && (play->sceneId == SCENE_LOST_WOODS)) { @@ -828,7 +828,7 @@ void EnMd_ListenToOcarina(EnMd* this, PlayState* play) { } void EnMd_Walk(EnMd* this, PlayState* play) { - Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, ENMD_LIMB_MAX); + Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, MIDO_LIMB_MAX); EnMd_UpdateAnimSequence(this); if (!(EnMd_FollowPath(this, play)) || (this->waypoint != 0)) { @@ -871,21 +871,21 @@ s32 EnMd_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po EnMd* this = (EnMd*)thisx; Vec3s limbRot; - if (limbIndex == ENMD_LIMB_HEAD) { + if (limbIndex == MIDO_LIMB_HEAD) { Matrix_Translate(1200.0f, 0.0f, 0.0f, MTXMODE_APPLY); limbRot = this->interactInfo.headRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); Matrix_Translate(-1200.0f, 0.0f, 0.0f, MTXMODE_APPLY); } - if (limbIndex == ENMD_LIMB_TORSO) { + if (limbIndex == MIDO_LIMB_TORSO) { limbRot = this->interactInfo.torsoRot; Matrix_RotateX(BINANG_TO_RAD_ALT(limbRot.x), MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD_ALT(limbRot.y), MTXMODE_APPLY); } - if (((limbIndex == ENMD_LIMB_TORSO) || (limbIndex == ENMD_LIMB_LEFT_UPPER_ARM)) || - (limbIndex == ENMD_LIMB_RIGHT_UPPER_ARM)) { + if (((limbIndex == MIDO_LIMB_TORSO) || (limbIndex == MIDO_LIMB_LEFT_UPPER_ARM)) || + (limbIndex == MIDO_LIMB_RIGHT_UPPER_ARM)) { rot->y += Math_SinS(this->fidgetTableY[limbIndex]) * FIDGET_AMPLITUDE; rot->z += Math_CosS(this->fidgetTableZ[limbIndex]) * FIDGET_AMPLITUDE; } @@ -897,7 +897,7 @@ void EnMd_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnMd* this = (EnMd*)thisx; Vec3f vec = { 400.0f, 0.0f, 0.0f }; - if (limbIndex == ENMD_LIMB_HEAD) { + if (limbIndex == MIDO_LIMB_HEAD) { Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h index 3b5cc079bb..802e6822a8 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -3,30 +3,10 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_md/object_md.h" struct EnMd; -typedef enum EnMdLimb { - ENMD_LIMB_NONE, - ENMD_LIMB_ROOT, - ENMD_LIMB_WAIST, - ENMD_LIMB_LEFT_THIGH, - ENMD_LIMB_LEFT_LEG, - ENMD_LIMB_LEFT_FOOT, - ENMD_LIMB_RIGHT_THIGH, - ENMD_LIMB_RIGHT_LEG, - ENMD_LIMB_RIGHT_FOOT, - ENMD_LIMB_TORSO, - ENMD_LIMB_LEFT_UPPER_ARM, - ENMD_LIMB_LEFT_FOREARM, - ENMD_LIMB_LEFT_HAND, - ENMD_LIMB_RIGHT_UPPER_ARM, - ENMD_LIMB_RIGHT_FOREARM, - ENMD_LIMB_RIGHT_HAND, - ENMD_LIMB_HEAD, - ENMD_LIMB_MAX -} EnMdLimb; - typedef void (*EnMdActionFunc)(struct EnMd*, struct PlayState*); #define ENMD_GET_PATH_INDEX(this) PARAMS_GET_S(this->actor.params, 8, 8) @@ -48,10 +28,10 @@ typedef struct EnMd { /* 0x020E */ s16 eyeTexIndex; /* 0x0210 */ s16 alpha; /* 0x0212 */ s16 waypoint; - /* 0x0214 */ s16 fidgetTableY[ENMD_LIMB_MAX]; - /* 0x0236 */ s16 fidgetTableZ[ENMD_LIMB_MAX]; - /* 0x0258 */ Vec3s jointTable[ENMD_LIMB_MAX]; - /* 0x02BE */ Vec3s morphTable[ENMD_LIMB_MAX]; + /* 0x0214 */ s16 fidgetTableY[MIDO_LIMB_MAX]; + /* 0x0236 */ s16 fidgetTableZ[MIDO_LIMB_MAX]; + /* 0x0258 */ Vec3s jointTable[MIDO_LIMB_MAX]; + /* 0x02BE */ Vec3s morphTable[MIDO_LIMB_MAX]; } EnMd; // size = 0x0324 #endif diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index c2120b1fc9..a91373e78c 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -1011,7 +1011,7 @@ void func_80AB2E70(EnNb* this, PlayState* play) { s32 func_80AB2FC0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnNb* this = (EnNb*)thisx; - if (limbIndex == NB_LIMB_HEAD) { + if (limbIndex == NABOORU_LIMB_HEAD) { *dList = gNabooruHeadMouthOpenDL; } @@ -1476,7 +1476,8 @@ void EnNb_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); EnNb_SetupCollider(thisx, play); - SkelAnime_InitFlex(play, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, NB_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gNabooruSkel, NULL, this->jointTable, this->morphTable, + NABOORU_LIMB_MAX); switch (EnNb_GetType(this)) { case NB_TYPE_DEMO02: @@ -1506,13 +1507,13 @@ s32 EnNb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po s32 ret = false; if (this->headTurnFlag != 0) { - if (limbIndex == NB_LIMB_TORSO) { + if (limbIndex == NABOORU_LIMB_TORSO) { s32 pad; rot->x += interactInfo->torsoRot.y; rot->y -= interactInfo->torsoRot.x; ret = false; - } else if (limbIndex == NB_LIMB_HEAD) { + } else if (limbIndex == NABOORU_LIMB_HEAD) { rot->x += interactInfo->headRot.y; rot->z += interactInfo->headRot.x; ret = false; @@ -1525,7 +1526,7 @@ s32 EnNb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnNb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnNb* this = (EnNb*)thisx; - if (limbIndex == NB_LIMB_HEAD) { + if (limbIndex == NABOORU_LIMB_HEAD) { Vec3f vec1 = { 0.0f, 10.0f, 0.0f }; Vec3f vec2; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index 397c6b63a2..e27a3b0ebb 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -3,40 +3,18 @@ #include "ultra64.h" #include "actor.h" +#include "assets/objects/object_nb/object_nb.h" struct EnNb; -typedef enum EnNbLimb { - /* 0x00 */ NB_LIMB_NONE, - /* 0x01 */ NB_LIMB_ROOT, - /* 0x02 */ NB_LIMB_L_THIGH, - /* 0x03 */ NB_LIMB_L_SHIN, - /* 0x04 */ NB_LIMB_L_FOOT, - /* 0x05 */ NB_LIMB_R_THIGH, - /* 0x06 */ NB_LIMB_R_SHIN, - /* 0x07 */ NB_LIMB_R_FOOT, - /* 0x08 */ NB_LIMB_TORSO, - /* 0x09 */ NB_LIMB_L_UPPER_ARM, - /* 0x0A */ NB_LIMB_L_FOREARM, - /* 0x0B */ NB_LIMB_L_HAND, - /* 0x0C */ NB_LIMB_R_UPPER_ARM, - /* 0x0D */ NB_LIMB_R_FOREARM, - /* 0x0E */ NB_LIMB_R_HAND, - /* 0x0F */ NB_LIMB_HEAD, - /* 0x10 */ NB_LIMB_BLANK, - /* 0x11 */ NB_LIMB_PONYTAIL, - /* 0x12 */ NB_LIMB_WAIST, - /* 0x13 */ NB_LIMB_MAX -} EnNbLimb; - typedef void (*EnNbActionFunc)(struct EnNb*, struct PlayState*); typedef void (*EnNbDrawFunc)(struct EnNb*, struct PlayState*); typedef struct EnNb { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; - /* 0x0190 */ Vec3s jointTable[NB_LIMB_MAX]; - /* 0x0202 */ Vec3s morphTable[NB_LIMB_MAX]; + /* 0x0190 */ Vec3s jointTable[NABOORU_LIMB_MAX]; + /* 0x0202 */ Vec3s morphTable[NABOORU_LIMB_MAX]; /* 0x0274 */ s16 eyeIdx; /* 0x0276 */ s16 blinkTimer; /* 0x0278 */ s32 action; From fd1ea6bc1a0682b887977041e2759fa1f2af079a Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 16 Jun 2025 00:28:37 +0200 Subject: [PATCH 8/9] Macroify PlaySfxGeneral calls: introduce `SFX_PLAY_CENTERED` and `SFX_PLAY_AT_POS` (#2633) * Add `SFX_PLAY_CENTERED` * Add `SFX_PLAY_AT_POS` --- include/sfx.h | 8 + src/audio/game/debug.inc.c | 7 +- src/audio/game/general.c | 14 +- src/code/db_camera.c | 144 +++++---------- src/code/z_actor.c | 12 +- src/code/z_collision_check.c | 48 ++--- src/code/z_demo.c | 9 +- src/code/z_en_item00.c | 6 +- src/code/z_fbdemo_circle.c | 6 +- src/code/z_lib.c | 9 +- src/code/z_map_exp.c | 16 +- src/code/z_message.c | 138 +++++--------- src/code/z_parameter.c | 72 +++----- src/code/z_play.c | 13 +- src/code/z_sfx_source.c | 3 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 9 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 6 +- .../actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c | 3 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 15 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 6 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 6 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 3 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 3 +- .../z_bg_spot01_idomizu.c | 3 +- .../z_bg_spot06_objects.c | 3 +- .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 6 +- .../actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c | 3 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 3 +- src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 37 ++-- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 8 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 4 +- src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 18 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 3 +- src/overlays/actors/ovl_Demo_Du/z_demo_du.c | 9 +- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c | 3 +- src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 12 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 3 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 9 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 3 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 3 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 9 +- .../actors/ovl_En_Bdfire/z_en_bdfire.c | 3 +- src/overlays/actors/ovl_En_Box/z_en_box.c | 9 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 3 +- src/overlays/actors/ovl_En_Ds/z_en_ds.c | 3 +- src/overlays/actors/ovl_En_Du/z_en_du.c | 3 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 16 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 4 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 12 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 6 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 3 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 6 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 135 +++++--------- .../z_en_horse_game_check.c | 15 +- .../ovl_En_Horse_Ganon/z_en_horse_ganon.c | 9 +- .../z_en_horse_link_child.c | 18 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 51 ++---- .../ovl_En_Horse_Zelda/z_en_horse_zelda.c | 3 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 4 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 27 +-- src/overlays/actors/ovl_En_In/z_en_in.c | 12 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 3 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 3 +- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 6 +- .../actors/ovl_En_Lightbox/z_en_lightbox.c | 6 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 24 +-- src/overlays/actors/ovl_En_Ma2/z_en_ma2.c | 3 +- src/overlays/actors/ovl_En_Mag/z_en_mag.c | 6 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 3 +- .../actors/ovl_En_Pu_box/z_en_pu_box.c | 3 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 6 +- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 3 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 6 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 3 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 3 +- src/overlays/actors/ovl_En_Tp/z_en_tp.c | 15 +- src/overlays/actors/ovl_En_Tr/z_en_tr.c | 3 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 7 +- .../actors/ovl_En_Viewer/z_en_viewer.c | 15 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 3 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 3 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 7 +- .../actors/ovl_player_actor/z_player.c | 3 +- .../ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c | 3 +- .../z_eff_ss_dead_sound.c | 3 +- .../ovl_file_choose/z_file_choose.c | 48 ++--- .../ovl_file_choose/z_file_copy_erase.c | 66 +++---- .../ovl_file_choose/z_file_nameset.c | 170 ++++++------------ src/overlays/gamestates/ovl_select/z_select.c | 18 +- .../ovl_kaleido_scope/z_kaleido_collect.c | 9 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 15 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 22 +-- .../misc/ovl_kaleido_scope/z_kaleido_map.c | 18 +- .../misc/ovl_kaleido_scope/z_kaleido_prompt.c | 6 +- .../misc/ovl_kaleido_scope/z_kaleido_scope.c | 40 ++--- 95 files changed, 519 insertions(+), 1070 deletions(-) diff --git a/include/sfx.h b/include/sfx.h index 91f24c1c84..2a9b543c3b 100644 --- a/include/sfx.h +++ b/include/sfx.h @@ -157,6 +157,14 @@ typedef struct SfxParams { #define SFX_DIST_SCALING 10.0f #endif +#define SFX_PLAY_CENTERED(sfxId) \ + Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, \ + &gSfxDefaultReverb); + +#define SFX_PLAY_AT_POS(projectedPos, sfxId) \ + Audio_PlaySfxGeneral(sfxId, projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, \ + &gSfxDefaultReverb); + void Audio_SetSfxBanksMute(u16 muteMask); void Audio_QueueSeqCmdMute(u8 channelIndex); void Audio_ClearBGMMute(u8 channelIndex); diff --git a/src/audio/game/debug.inc.c b/src/audio/game/debug.inc.c index e6d2dd89ca..37596f1092 100644 --- a/src/audio/game/debug.inc.c +++ b/src/audio/game/debug.inc.c @@ -842,9 +842,7 @@ void AudioDebug_ProcessInput_SndCont(void) { break; case 2: case 3: - Audio_PlaySfxGeneral(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG, - &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG); break; case 4: Audio_SetSoundOutputMode(sAudioSndContWork[sAudioSndContSel]); @@ -1245,8 +1243,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) { sfx = (u16)(sAudioSfxParamChgWork[0] << 12) + sAudioSfxParamChgWork[1] + SFX_FLAG; - Audio_PlaySfxGeneral(sfx, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(sfx); } if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) { diff --git a/src/audio/game/general.c b/src/audio/game/general.c index 0e1ca6df5c..980b980152 100644 --- a/src/audio/game/general.c +++ b/src/audio/game/general.c @@ -2816,8 +2816,7 @@ void func_800F4190(Vec3f* pos, u16 sfxId) { void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim) { u8 offset = AudioThread_NextRandom() % randLim; - Audio_PlaySfxGeneral(baseSfxId + offset, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(pos, baseSfxId + offset); } void func_800F4254(Vec3f* pos, u8 level) { @@ -3081,7 +3080,7 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 ioData) { } channelIndex++; } - Audio_PlaySfxGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(pos, sfxId); } void func_800F4E30(Vec3f* pos, f32 arg1) { @@ -3704,12 +3703,10 @@ void Audio_UpdateMalonSinging(f32 dist, u16 seqId) { void func_800F64E0(u8 arg0) { D_80130608 = arg0; if (arg0 != 0) { - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); AUDIOCMD_GLOBAL_MUTE(); } else { - Audio_PlaySfxGeneral(NA_SE_SY_WIN_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_CLOSE); AUDIOCMD_GLOBAL_UNMUTE(0); } } @@ -3818,8 +3815,7 @@ void Audio_SetBaseFilter(u8 filter) { if (filter == 0) { Audio_StopSfxById(NA_SE_PL_IN_BUBBLE); } else if (sAudioBaseFilter == 0) { - Audio_PlaySfxGeneral(NA_SE_PL_IN_BUBBLE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_PL_IN_BUBBLE); } } sAudioBaseFilter = filter; diff --git a/src/code/db_camera.c b/src/code/db_camera.c index 34599c9a1c..3e770316c2 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -373,8 +373,7 @@ void func_800B44E0(DebugCam* debugCam, Camera* cam) { if (debugCam->sub.nPoints < 6) { if (sDebugCamAnim.unk_0A != 0) { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); sDebugCamAnim.unk_0A = 0; } DebugCamera_ScreenTextColored(17, 23, DEBUG_CAM_TEXT_ORANGE, D_8012CEE0[0]); @@ -388,8 +387,7 @@ void func_800B44E0(DebugCam* debugCam, Camera* cam) { !func_800BB2B4(&sDebugCamAnim.lookAtPos, &sDebugCamAnim.roll, &sDebugCamAnim.fov, debugCam->sub.lookAt, &sDebugCamAnim.keyframe, &sDebugCamAnim.curFrame) && sDebugCamAnim.unk_0A == 1) { - Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_HP_RECOVER); sDebugCamAnim.unk_04++; if (debugCam->sub.nFrames > 0 && debugCam->sub.nFrames < sDebugCamAnim.unk_04) { @@ -617,8 +615,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { debugCam->unk_40 = -1; debugCam->sub.demoCtrlActionIdx = 0; sDebugCamAnim.unk_0A = 0; - Audio_PlaySfxGeneral(NA_SE_SY_LOCK_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_LOCK_ON); } else if (debugCam->unk_38 == -1) { debugCam->unk_38 = 1; } else { @@ -938,25 +935,21 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { debugCam->unk_1C.z = 0.0f; debugCam->unk_1C.y = 1.0f; } else if (debugCam->sub.unk_08 == 2) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.unk_08 = 0; func_800B41DC(debugCam, debugCam->sub.unkIdx, cam); } else { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R) && CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); debugCam->sub.nPoints = debugCam->sub.unkIdx + 1; func_800B4088(debugCam, cam); } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R)) { if (debugCam->sub.unkIdx == 0x80) { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); } else { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_PUTAWAY); func_800B42C0(debugCam, cam); if (debugCam->sub.unkIdx == (debugCam->sub.nPoints - 1)) { debugCam->sub.unkIdx++; @@ -1009,8 +1002,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } else { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CRIGHT) && CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { - Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY); PRINTF("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n"); DebugCamera_PrintPoints("Lookat", debugCam->sub.nPoints, debugCam->sub.lookAt); DebugCamera_PrintPoints("Position", debugCam->sub.nPoints, debugCam->sub.position); @@ -1019,15 +1011,13 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { PRINTF("@@@static short Mode = %d;\n@@@\n", debugCam->sub.mode); PRINTF("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n"); } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.unk_08 = (debugCam->sub.unk_08 + 1) % 3; } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CUP) && CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); if (debugCam->sub.unkIdx > 0) { debugCam->sub.unkIdx--; } else { @@ -1035,8 +1025,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } } else { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CUP)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); if (debugCam->sub.unkIdx > 0) { debugCam->sub.unkIdx--; } else { @@ -1057,8 +1046,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L) && CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); if (debugCam->sub.unkIdx < (debugCam->sub.nPoints - 1)) { debugCam->sub.unkIdx++; } else { @@ -1066,8 +1054,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } } else { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); if (debugCam->sub.unkIdx < (debugCam->sub.nPoints - 1)) { debugCam->sub.unkIdx++; } else { @@ -1140,8 +1127,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { case 1: debugCam->unk_3C = true; if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); if (debugCam->sub.unk_0A == 0) { debugCam->sub.unk_0A = 5; } else { @@ -1149,8 +1135,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); if (debugCam->sub.unk_0A == 5) { debugCam->sub.unk_0A = 0; } else { @@ -1158,8 +1143,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); switch (debugCam->sub.unk_0A) { case 1: if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { @@ -1208,8 +1192,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DLEFT)) { if ((D_8012D10C++ % 5) == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); } switch (debugCam->sub.unk_0A) { @@ -1246,8 +1229,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); switch (debugCam->sub.unk_0A) { case 1: @@ -1296,8 +1278,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DRIGHT)) { if ((D_8012D10C++ % 5) == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ATTENTION_ON); } switch (debugCam->sub.unk_0A) { @@ -1460,8 +1441,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { debugCam->fov = 60.0f; debugCam->rollDegrees = debugCam->roll * 1.40625f; if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->unk_78 = (debugCam->unk_78 + 1) % 3; debugCam->unk_38 = -1; } @@ -1745,8 +1725,7 @@ void DebugCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) { void DebugCamera_PrintAllCuts(Camera* cam) { s32 i; - Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY); PRINTF("@@@\n@@@\n@@@/* ****** spline point data ** start here ***** */\n@@@\n"); for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { @@ -1894,8 +1873,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if ((1 << sCurFileIdx) & sMempakFiles) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT) || CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.demoCtrlToggleSwitch ^= 1; } D_8012CEE0[41][9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); @@ -1913,12 +1891,10 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { if (debugCam->sub.demoCtrlToggleSwitch == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); debugCam->sub.demoCtrlMenu++; } else { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); debugCam->sub.demoCtrlMenu = 0; } } @@ -1937,8 +1913,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { } } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); debugCam->sub.demoCtrlMenu = 0; return 1; } @@ -1978,8 +1953,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A) || CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); if (debugCam->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) { debugCam->sub.demoCtrlActionIdx = ACTION_E; } @@ -2004,8 +1978,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A) || CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); debugCam->sub.demoCtrlMenu -= 9; } block_2: @@ -2040,8 +2013,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { sp74[i * 2 + 1] = '\0'; if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); if (sCurFileIdx >= 4) { sCurFileIdx = 0; } else { @@ -2058,8 +2030,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { } } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); if (sCurFileIdx <= 0) { sCurFileIdx = 4; } else { @@ -2103,25 +2074,21 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { DebugCamera_ScreenTextColored(20, 26, DEBUG_CAM_TEXT_WHITE, D_8012CF70); if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx - 1) % 4u; } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx + 1) % 4u; } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); debugCam->sub.demoCtrlToggleSwitch = 0; debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(debugCam->sub.demoCtrlActionIdx, MENU_INFO); } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); debugCam->sub.demoCtrlActionIdx = ACTION_E; return 1; } @@ -2133,8 +2100,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP) || CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); debugCam->sub.demoCtrlActionIdx = ACTION_E; } return 2; @@ -2146,15 +2112,13 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { default: { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx - 1) % 4u; sCurFileIdx = 0; } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx + 1) % 4u; sCurFileIdx = 0; @@ -2193,8 +2157,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (func_800B91B0(cam, debugCam) == 0) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); Letterbox_SetSizeTarget(0); - Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY); } sp5C = OLib_Vec3fDiffToVecGeo(&debugCam->eye, &debugCam->at); debugCam->unk_1C = @@ -2212,8 +2175,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { sDebugCamAnim.unk_0A = 1; sDebugCamAnim.unk_0C = 0; D_8016110C = 0; - Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_HP_RECOVER); } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_L)) { @@ -2229,15 +2191,13 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (sLastFileIdx != -1) { switch (sp74[sCurFileIdx]) { case '?': - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); sDebugCamCuts[idx1] = sDebugCamCuts[idx2]; sp74[sCurFileIdx] = '?'; // useless DebugCamera_ResetCut(idx2, false); break; case '-': - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); sp64 = sDebugCamCuts[idx2]; if (sLastFileIdx < sCurFileIdx) { @@ -2259,8 +2219,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { } break; default: - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); break; } } @@ -2269,8 +2228,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { if (sp74[sCurFileIdx] == '?') { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); sp74[sCurFileIdx] = DebugCamera_InitCut(idx1, &debugCam->sub); if (sp74[sCurFileIdx] == '?') { DebugCamera_ScreenTextColored(15, 24, DEBUG_CAM_TEXT_GREEN, D_8012CF48); @@ -2280,8 +2238,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); sp74[sCurFileIdx] = '?'; DebugCamera_ResetCut(idx1, true); } @@ -2289,8 +2246,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); for (i = 0; i < sDebugCamCuts[idx1].nPoints; i++) { debugCam->sub.lookAt[i] = sDebugCamCuts[idx1].lookAt[i]; @@ -2312,8 +2268,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); if (sCurFileIdx == 0x1E) { sCurFileIdx = 0; } else { @@ -2321,8 +2276,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { } } if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1; } @@ -2336,8 +2290,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { DebugCamera_PrintAllCuts(cam); } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L) && CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY); for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { if (sDebugCamCuts[i].nPoints != 0) { PRINTF("\n@@@ /* CUT [%d]\t*/", i); @@ -2353,8 +2306,7 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); Letterbox_SetSizeTarget(32); D_8016110C = 0; - Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_HP_RECOVER); } DebugCamera_ScreenTextColored(4, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF50[0]); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index dfec9188f9..1e02acdc8c 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2030,8 +2030,7 @@ void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 sp * Play a sound effect at the player's position */ void Player_PlaySfx(Player* player, u16 sfxId) { - Audio_PlaySfxGeneral(sfxId, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, sfxId); } /** @@ -2641,8 +2640,7 @@ void Actor_Draw(PlayState* play, Actor* actor) { void Actor_UpdateFlaggedAudio(Actor* actor) { if (actor->flags & ACTOR_FLAG_SFX_ACTOR_POS_2) { - Audio_PlaySfxGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&actor->projectedPos, actor->sfx); } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) { Sfx_PlaySfxCentered(actor->sfx); } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) { @@ -5670,8 +5668,7 @@ void func_80036E50(u16 textId, s16 arg1) { Flags_SetInfTable(INFTABLE_0C); return; case 0x1033: - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); Flags_SetEventChkInf(EVENTCHKINF_04); Flags_SetInfTable(INFTABLE_0E); return; @@ -6136,8 +6133,7 @@ s32 func_80037CB8(PlayState* play, Actor* actor, s16 arg2) { case TEXT_STATE_CHOICE: case TEXT_STATE_EVENT: if (Message_ShouldAdvance(play) && func_80037C94(play, actor, arg2)) { - Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CANCEL); msgCtx->msgMode = MSGMODE_TEXT_CLOSING; ret = true; } diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 75e6ebef7d..a3b62a06e0 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1566,11 +1566,9 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c if (flags == ATELEM_SFX_NORMAL && collider->colMaterial != COL_MATERIAL_METAL) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } else if (flags == ATELEM_SFX_NORMAL) { // collider->colMaterial == COL_MATERIAL_METAL EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos); @@ -1582,20 +1580,16 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c } else if (flags == ATELEM_SFX_HARD) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } else if (flags == ATELEM_SFX_WOOD) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_DUST, hitPos); if (collider->actor == NULL) { - Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_REFLECTION_WOOD); } else { - Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_REFLECTION_WOOD); } } } @@ -1606,17 +1600,13 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c s32 CollisionCheck_SwordHitAudio(Collider* atCol, ColliderElement* acElem) { if (atCol->actor != NULL && atCol->actor->category == ACTORCAT_PLAYER) { if (acElem->elemMaterial == ELEM_MATERIAL_UNK0) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_IT_SWORD_STRIKE); } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK1) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &atCol->actor->projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_IT_SWORD_STRIKE_HARD); } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK2) { - Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_NONE); } else if (acElem->elemMaterial == ELEM_MATERIAL_UNK3) { - Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_NONE); } } return true; @@ -1693,8 +1683,7 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement } else if (sHitInfo[acCol->colMaterial].effect == HIT_WOOD) { if (atCol->actor == NULL) { CollisionCheck_SpawnShieldParticles(play, hitPos); - Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_REFLECTION_WOOD); } else { CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &atCol->actor->projectedPos); } @@ -1707,11 +1696,9 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement } else { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (acCol->actor == NULL) { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &acCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&acCol->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } } @@ -3525,8 +3512,7 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { CollisionCheck_SpawnShieldParticles(play, v); - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_REFLECT_SW); } /** @@ -3534,8 +3520,7 @@ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetalSfx(PlayState* play, Vec3f* v, Vec3f* pos) { CollisionCheck_SpawnShieldParticles(play, v); - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(pos, NA_SE_IT_SHIELD_REFLECT_SW); } /** @@ -3575,8 +3560,7 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* a woodInit.lightPoint.z = woodInit.position.z; Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &woodInit); - Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(actorPos, NA_SE_IT_REFLECTION_WOOD); } /** diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 5adc6ca48a..d6b34d54c8 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -596,8 +596,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) && (gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) { - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); titleDemoSkipped = true; } @@ -1472,14 +1471,12 @@ void CutsceneCmd_Transition(PlayState* play, CutsceneContext* csCtx, CsCmdTransi play->envCtx.screenFillColor[3] = 255.0f * lerp; if ((lerp == 0.0f) && (gSaveContext.save.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0)) { - Audio_PlaySfxGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WHITE_OUT_S); } else if ((lerp == 0.0f) && ((gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) || (gSaveContext.save.entranceIndex == ENTR_HYRULE_CASTLE_0) || (gSaveContext.save.entranceIndex == ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0))) { - Audio_PlaySfxGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_WHITE_OUT); } else if ((lerp == 0.0f) && (play->sceneId == SCENE_INSIDE_GANONS_CASTLE)) { Sfx_PlaySfxCentered2(NA_SE_EV_WHITE_OUT); } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 43668baebb..1f5d4a5c06 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -965,8 +965,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } if ((*params <= ITEM00_RUPEE_RED) || (*params == ITEM00_RUPEE_ORANGE)) { - Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY); } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); @@ -974,8 +973,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } return; } else { - Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_ITEM); } Flags_SetCollectible(play, this->collectibleFlag); diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 0a7dabdd6b..eb66a2fab8 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -68,8 +68,7 @@ void TransitionCircle_Start(void* thisx) { } else { this->texY = (s32)(125.0f * (1 << 2)); if (this->appearanceType == TCA_RIPPLE) { - Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_OC_SECRET_WARP_OUT); } } @@ -93,8 +92,7 @@ void TransitionCircle_Update(void* thisx, s32 updateRate) { if (this->direction != TRANS_CIRCLE_DIR_IN) { if (this->texY == 0) { if (this->appearanceType == TCA_RIPPLE) { - Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_IN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_OC_SECRET_WARP_IN); } } this->texY += this->speed * 3 / updateRate; diff --git a/src/code/z_lib.c b/src/code/z_lib.c index e4d56b8dad..b9aa15ca4b 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -608,22 +608,19 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) { * Play a sound effect at the center of the screen. */ void Sfx_PlaySfxCentered(u16 sfxId) { - Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(sfxId); } /** * Play a sound effect at the center of the screen. Identical to `Sfx_PlaySfxCentered`. */ void Sfx_PlaySfxCentered2(u16 sfxId) { - Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(sfxId); } /** * Play a sound effect at the requested position. */ void Sfx_PlaySfxAtPos(Vec3f* projectedPos, u16 sfxId) { - Audio_PlaySfxGeneral(sfxId, projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(projectedPos, sfxId); } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index ba6cb77f0a..c1bfd9e7c8 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -455,13 +455,9 @@ void Minimap_Draw(PlayState* play) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) { PRINTF("Game_play_demo_mode_check=%d\n", Play_InCsMode(play)); // clang-format off - if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + if (!R_MINIMAP_DISABLED) { SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_UP); } else { - Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_DOWN); } // clang-format on R_MINIMAP_DISABLED ^= 1; @@ -541,13 +537,9 @@ void Minimap_Draw(PlayState* play) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) { // clang-format off - if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + if (!R_MINIMAP_DISABLED) { SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_UP); } else { - Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_DOWN); } // clang-format on R_MINIMAP_DISABLED ^= 1; diff --git a/src/code/z_message.c b/src/code/z_message.c index 1fc06d7407..eb9f0e8219 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -348,8 +348,7 @@ u8 Message_ShouldAdvance(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_PASS); } return CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_CUP); @@ -373,8 +372,7 @@ void Message_CloseTextbox(PlayState* play) { msgCtx->stateTimer = 2; msgCtx->msgMode = MSGMODE_TEXT_CLOSING; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } } @@ -390,8 +388,7 @@ void Message_HandleChoiceSelection(PlayState* play, char numChoices) { if (msgCtx->choiceIndex > 128) msgCtx->choiceIndex = 0; else - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); // NOLINTEND } else if (input->rel.stick_y <= -30 && !sAnalogStickHeld) { sAnalogStickHeld = true; @@ -400,8 +397,7 @@ void Message_HandleChoiceSelection(PlayState* play, char numChoices) { if (msgCtx->choiceIndex > numChoices) msgCtx->choiceIndex = numChoices; else - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); // NOLINTEND } else if (ABS(input->rel.stick_y) < 30) { sAnalogStickHeld = false; @@ -1013,8 +1009,7 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) { // clang-format off if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } // clang-format on @@ -1155,8 +1150,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { case MESSAGE_WIDE_BOX_BREAK: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (!sTextboxSkipped) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); } else { @@ -1173,8 +1167,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { case MESSAGE_WIDE_TEXTID: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_DONE; Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); } @@ -1221,8 +1214,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { case MESSAGE_WIDE_SFX: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && !sMessageHasSetSfx) { sMessageHasSetSfx = true; - Audio_PlaySfxGeneral(MSG_BUF_DECODED_WIDE[i + 1], &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(MSG_BUF_DECODED_WIDE[i + 1]); } i++; break; @@ -1232,8 +1224,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { case MESSAGE_WIDE_BACKGROUND: // clang-format off if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } // clang-format on gDPPipeSync(gfx++); @@ -1316,8 +1307,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { msgCtx->msgMode = MSGMODE_TEXT_DONE; if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_END); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); if (play->csCtx.state == CS_STATE_IDLE) { Interface_SetDoAction(play, DO_ACTION_RETURN); @@ -1347,8 +1337,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { return; case MESSAGE_WIDE_PERSISTENT: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; } @@ -1359,8 +1348,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT; Font_LoadMessageBoxIcon(&play->msgCtx.font, TEXTBOX_ICON_TRIANGLE); - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_END); } *gfxP = gfx; return; @@ -1382,8 +1370,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { } if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i == msgCtx->textDrawPos - 1 && msgCtx->textDelayTimer == msgCtx->textDelay) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx); charTexIdx += FONT_CHAR_TEX_SIZE; @@ -1481,8 +1468,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_BOX_BREAK: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (!sTextboxSkipped) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); } else { @@ -1499,8 +1485,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_TEXTID: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_DONE; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); } @@ -1561,8 +1546,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { PRINTF(T("サウンド(SE)\n", "Sound (SE)\n")); sfxHi = MSG_BUF_DECODED[i + 1]; sfxHi <<= 8; - Audio_PlaySfxGeneral(sfxHi | MSG_BUF_DECODED[i + 2], &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(sfxHi | MSG_BUF_DECODED[i + 2]); } i += 2; break; @@ -1572,8 +1556,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_BACKGROUND: // clang-format off if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } // clang-format on gDPPipeSync(gfx++); @@ -1656,8 +1639,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { msgCtx->msgMode = MSGMODE_TEXT_DONE; if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_END); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); if (play->csCtx.state == 0) { Interface_SetDoAction(play, DO_ACTION_RETURN); @@ -1687,8 +1669,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { return; case MESSAGE_PERSISTENT: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; } @@ -1699,16 +1680,14 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_END); } *gfxP = gfx; return; default: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i == msgCtx->textDrawPos - 1 && msgCtx->textDelayTimer == msgCtx->textDelay) { - Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_NONE); } #if PLATFORM_IQUE @@ -2861,8 +2840,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { PRINTF("ocarina_set 000000000000000000 = %d\n", ocarinaActionId); msgCtx->ocarinaAction = ocarinaActionId; if (ocarinaActionId >= OCARINA_ACTION_CHECK_SARIA && ocarinaActionId <= OCARINA_ACTION_CHECK_STORMS) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } if (ocarinaActionId == OCARINA_ACTION_SCARECROW_SPAWN_PLAYBACK) { Message_OpenText(play, 0x86F); // Ocarina @@ -3207,9 +3185,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS || msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW_SPAWN) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } else { PRINTF(T("Ocarina_Flog 正解模範演奏=%x\n", @@ -3219,17 +3195,13 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW_SPAWN) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW_SPAWN) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else { @@ -3240,9 +3212,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { @@ -3253,25 +3223,19 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } else { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); } else { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } } else if (msgCtx->ocarinaStaff->state == 0xFF) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -3649,11 +3613,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state); PRINTF_RST(); msgCtx->stateTimer = 20; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } else if (msgCtx->ocarinaStaff->state == 0xFF) { - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL; } @@ -3705,8 +3667,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->ocarinaStaff->state); gSaveContext.save.info.scarecrowLongSongSet = true; } - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); PRINTF("aaaaaaaaaaaaaa\n"); AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF); msgCtx->stateTimer = 10; @@ -3777,8 +3738,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 20; gSaveContext.save.info.scarecrowSpawnSongSet = true; msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_DONE; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); PRINTF_COLOR_YELLOW(); PRINTF("\n====================================================================\n"); MemCpy(gSaveContext.save.info.scarecrowSpawnSong, gScarecrowSpawnSongPtr, @@ -3792,8 +3752,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { CHECK_BTN_ALL(input->press.button, BTN_B)) { PRINTF(T("すでに存在する曲吹いた!!! \n", "Played an existing song!!! \n")); AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); Message_CloseTextbox(play); msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_FAILED; } @@ -3818,8 +3777,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING: case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING: - Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_METRONOME_LV - SFX_FLAG); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); if (((u32)msgCtx->ocarinaStaff->pos != 0) && (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { @@ -3830,11 +3788,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->stateTimer == 0) { if (msgCtx->ocarinaStaff->state == 0) { if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING) { - Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_METRONOME); } else { - Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_METRONOME_2); } msgCtx->msgMode++; } @@ -3853,8 +3809,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_MEMORY_GAME_PLAYER_PLAYING: - Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_METRONOME_LV - SFX_FLAG); msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); if (((u32)msgCtx->ocarinaStaff->pos != 0) && (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { @@ -3865,14 +3820,12 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaStaff->state == 0xFF) { PRINTF(T("輪唱失敗!!!!!!!!!\n", "Musical round failed!!!!!!!!!\n")); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); msgCtx->stateTimer = 10; play->msgCtx.ocarinaMode = OCARINA_MODE_03; } else if (msgCtx->ocarinaStaff->state == OCARINA_SONG_MEMORY_GAME) { PRINTF(T("輪唱成功!!!!!!!!!\n", "Musical round succeeded!!!!!!!!!\n")); - Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_ITEM); msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS; msgCtx->stateTimer = 30; } @@ -3889,8 +3842,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { if (AudioOcarina_MemoryGameNextNote() != 1) { - Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_METRONOME); msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaButtonIndexBufPos = 0; Message_ResetOcarinaNoteState(); @@ -4390,8 +4342,7 @@ void Message_Update(PlayState* play) { } else if (Message_ShouldAdvanceSilent(play)) { PRINTF("select=%d\n", msgCtx->textboxEndType); if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_PASS); #if OOT_NTSC if (gSaveContext.language == LANGUAGE_JPN && !sTextIsCredits) { Message_ContinueTextbox(play, MSG_BUF_DECODED_WIDE[msgCtx->textDrawPos]); @@ -4402,8 +4353,7 @@ void Message_Update(PlayState* play) { Message_ContinueTextbox(play, sNextTextId); #endif } else { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); Message_CloseTextbox(play); } } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 7c97802888..fa8ec09c55 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2191,9 +2191,7 @@ void Interface_SetNaviCall(PlayState* play, u16 naviCallState) { if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && (play->csCtx.state == CS_STATE_IDLE)) { // clang-format off - if (naviCallState == 0x1E) { Audio_PlaySfxGeneral(NA_SE_VO_NAVY_CALL, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + if (naviCallState == 0x1E) { SFX_PLAY_CENTERED(NA_SE_VO_NAVY_CALL); } // clang-format on @@ -2244,8 +2242,7 @@ s32 Health_ChangeBy(PlayState* play, s16 amount) { gSaveContext.save.info.playerData.health, gSaveContext.save.info.playerData.healthCapacity); // clang-format off - if (amount > 0) { Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + if (amount > 0) { SFX_PLAY_CENTERED(NA_SE_SY_HP_RECOVER); } else if (gSaveContext.save.info.playerData.isDoubleDefenseAcquired && (amount < 0)) { amount >>= 1; PRINTF(T("ハート減少半分!!=%d\n", "Heart decrease halved!! = %d\n"), amount); @@ -2382,8 +2379,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { if ((type != MAGIC_ADD) && (gSaveContext.save.info.playerData.magic - amount) < 0) { if (gSaveContext.magicCapacity != 0) { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); } return false; } @@ -2401,8 +2397,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; return true; } else { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); return false; } @@ -2419,8 +2414,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3; return true; } else { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); return false; } @@ -2451,8 +2445,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2; return true; } else { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); return false; } @@ -2520,8 +2513,7 @@ void Magic_Update(PlayState* play) { gSaveContext.save.info.playerData.magic += 4; if (gSaveContext.gameMode == GAMEMODE_NORMAL && !IS_CUTSCENE_LAYER) { - Audio_PlaySfxGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GAUGE_UP - SFX_FLAG); } PRINTF(T("蓄電 MAGIC_NOW=%d (%d)\n", "Storage MAGIC_NOW=%d (%d)\n"), @@ -2611,8 +2603,7 @@ void Magic_Update(PlayState* play) { !play->actorCtx.lensActive) { // Force lens off and set magic meter state to idle play->actorCtx.lensActive = false; - Audio_PlaySfxGeneral(NA_SE_SY_GLASSMODE_OFF, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GLASSMODE_OFF); gSaveContext.magicState = MAGIC_STATE_IDLE; sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; break; @@ -2664,8 +2655,7 @@ void Magic_Update(PlayState* play) { case MAGIC_STATE_ADD: // Add magic until target is reached gSaveContext.save.info.playerData.magic += 4; - Audio_PlaySfxGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GAUGE_UP - SFX_FLAG); if (gSaveContext.save.info.playerData.magic >= gSaveContext.magicTarget) { gSaveContext.save.info.playerData.magic = gSaveContext.magicTarget; gSaveContext.magicState = gSaveContext.prevMagicState; @@ -3711,22 +3701,16 @@ void Interface_Draw(PlayState* play) { } else if (gSaveContext.timerSeconds > 60) { // Beep at "xx:x1" (every 10 seconds) if (sTimerDigits[4] == 1) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_WOMAN); } } else if (gSaveContext.timerSeconds > 10) { // Beep on alternating seconds if ((sTimerDigits[4] % 2) != 0) { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_N); } } else { // Beep every second - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_E); } } } @@ -3775,9 +3759,7 @@ void Interface_Draw(PlayState* play) { sTimerStateTimer = 40; gSaveContext.timerState = TIMER_STATE_UP_FREEZE; } else { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_N); } } } @@ -3912,22 +3894,16 @@ void Interface_Draw(PlayState* play) { } else if (gSaveContext.subTimerSeconds > 60) { // Beep at "xx:x1" (every 10 seconds) if (sTimerDigits[4] == 1) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_MESSAGE_WOMAN); } } else if (gSaveContext.subTimerSeconds > 10) { // Beep on alternating seconds if ((sTimerDigits[4] % 2) != 0) { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_N); } } else { // Beep every second - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_E); } } else { // SUBTIMER_STATE_UP_TICK gSaveContext.subTimerSeconds++; @@ -3944,9 +3920,7 @@ void Interface_Draw(PlayState* play) { // Beep at the minute mark if ((gSaveContext.subTimerSeconds % 60) == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_N); } } } @@ -4192,8 +4166,7 @@ void Interface_Update(PlayState* play) { gSaveContext.save.info.playerData.health += 4; if ((gSaveContext.save.info.playerData.health & 0xF) < 4) { - Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_HP_RECOVER); } PRINTF("now_life=%d max_life=%d\n", gSaveContext.save.info.playerData.health, @@ -4233,8 +4206,7 @@ void Interface_Update(PlayState* play) { if (gSaveContext.save.info.playerData.rupees < CUR_CAPACITY(UPG_WALLET)) { gSaveContext.rupeeAccumulator--; gSaveContext.save.info.playerData.rupees++; - Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_RUPY_COUNT); } else { PRINTF(T("ルピー数MAX = %d\n", "Rupee Amount MAX = %d\n"), CUR_CAPACITY(UPG_WALLET)); gSaveContext.save.info.playerData.rupees = CUR_CAPACITY(UPG_WALLET); @@ -4249,13 +4221,11 @@ void Interface_Update(PlayState* play) { gSaveContext.save.info.playerData.rupees = 0; } - Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_RUPY_COUNT); } else { gSaveContext.rupeeAccumulator++; gSaveContext.save.info.playerData.rupees--; - Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_RUPY_COUNT); } } else { gSaveContext.rupeeAccumulator = 0; diff --git a/src/code/z_play.c b/src/code/z_play.c index 679c5b7772..222e130340 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -95,9 +95,7 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint) { if ((R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) && (gSaveContext.save.cutsceneIndex < 0xFFF0)) { // Play a sfx when the player toggles the camera - Audio_PlaySfxGeneral((viewpoint == VIEWPOINT_LOCKED) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, - &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED((viewpoint == VIEWPOINT_LOCKED) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP); } Play_RequestViewpointBgCam(this); @@ -873,8 +871,7 @@ void Play_Update(PlayState* this) { break; case TRANS_MODE_SANDSTORM: - Audio_PlaySfxGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_SAND_STORM - SFX_FLAG); if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA < 110) { @@ -908,8 +905,7 @@ void Play_Update(PlayState* this) { break; case TRANS_MODE_SANDSTORM_END: - Audio_PlaySfxGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_SAND_STORM - SFX_FLAG); if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA <= 0) { @@ -1043,8 +1039,7 @@ void Play_Update(PlayState* this) { PRINTF(VT_FGCOL(CYAN) T("デモ中につき視点変更を禁止しております\n", "Changing viewpoint is prohibited during the cutscene\n") VT_RST); } else if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); } else { // C-Up toggle for houses, move between pivot camera and fixed camera // Toggle viewpoint between VIEWPOINT_LOCKED and VIEWPOINT_PIVOT diff --git a/src/code/z_sfx_source.c b/src/code/z_sfx_source.c index 2aaadeb365..63022b9815 100644 --- a/src/code/z_sfx_source.c +++ b/src/code/z_sfx_source.c @@ -63,6 +63,5 @@ void SfxSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 dura source->countdown = duration; SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos); - Audio_PlaySfxGeneral(sfxId, &source->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&source->projectedPos, sfxId); } diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 3e8127024b..d087c9a684 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -182,8 +182,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } this->timer = 0; - Audio_PlaySfxGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_IT_ARROW_STICK_CRE); return; } @@ -311,12 +310,10 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } ArmsHook_PullPlayer(this); - Audio_PlaySfxGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_STICK_OBJ); } else { CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos); - Audio_PlaySfxGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_REFLECT); } } else if (CHECK_BTN_ANY(play->state.input[0].press.button, (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT))) { diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index c12522fe52..188322fc16 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -266,14 +266,12 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_B0); Cutscene_SetScript(play, gDcOpeningCs); gSaveContext.cutsceneTrigger = 1; - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_49); } if (this->dyna.actor.params < 0) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 81012e657a..6e82c308d7 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -180,8 +180,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) { func_8003555C(play, &pos1, &velocity, &accel); } Camera_RequestQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3); - Audio_PlaySfxGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_PILLAR_SINK - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index f2e50dcb61..3f825cf6aa 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -176,19 +176,16 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { ((play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); this->state = 0; - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); BgDodoago_SetupAction(this, BgDodoago_OpenJaw); OnePointCutscene_Init(play, 3380, 160, &this->dyna.actor, CAM_ID_MAIN); } else if (play->roomCtx.drawParams[this->state] == 0) { OnePointCutscene_Init(play, 3065, 40, &this->dyna.actor, CAM_ID_MAIN); BgDodoago_SetupAction(this, BgDodoago_LightOneEye); - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); } else { OnePointCutscene_Init(play, 3065, 20, &this->dyna.actor, CAM_ID_MAIN); - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); sTimer += 30; return; } @@ -266,11 +263,9 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) { if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); - Audio_PlaySfxGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_STONE_BOUND); } else { - Audio_PlaySfxGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index b43241f1bd..fe3b49a305 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -298,11 +298,9 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) { } } else { if (this->dropTimer == 1) { - Audio_PlaySfxGeneral(NA_SE_EV_STONEDOOR_STOP, &this->dyna.actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_STONEDOOR_STOP); } else { - Audio_PlaySfxGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_BLOCKSINK - SFX_FLAG); } Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speed); Math_ApproachF(&this->dyna.actor.speed, 100.0f, 1.0f, 0.1f); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index d3f3ccae8b..524fe92113 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -130,8 +130,7 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } else { this->actionFlags |= 4; this->timer1 = 304; - Audio_PlaySfxGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_RED_EYE); } } @@ -146,8 +145,7 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } else { this->actionFlags |= 8; this->timer2 = 304; - Audio_PlaySfxGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_RED_EYE); } } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index acb2bd4f80..f855cfe65f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -176,8 +176,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->unk_198 = 40; this->actionFunc = func_8087AF38; } else { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index bb21a6cb6f..70c09d9dba 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -511,8 +511,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { this->dList = NULL; BgMizuBwall_SpawnDebris(this, play); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->actionFunc = BgMizuBwall_Break; } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index ebeffcc2fb..d417d53efe 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -64,8 +64,7 @@ void BgSpot01Idomizu_UpdateWaterLevel(BgSpot01Idomizu* this, PlayState* play) { } play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; if (this->waterHeight < this->actor.world.pos.y) { - Audio_PlaySfxGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f); } diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index c3c94063c5..f7d198cfae 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -326,8 +326,7 @@ void BgSpot06Objects_LockWait(BgSpot06Objects* this, PlayState* play) { EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 700); this->collider.elements[0].dim.worldSphere.radius = 45; this->actionFunc = BgSpot06Objects_LockPullOutward; - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); Flags_SetSwitch(play, this->switchFlag); OnePointCutscene_Init(play, 4120, 170, &this->dyna.actor, CAM_ID_MAIN); } else { diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 5ac35592bd..bf97d5a47d 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -111,8 +111,7 @@ void func_808BC65C(BgTreemouth* this, PlayState* play) { if (cue->id == 2) { BgTreemouth_SetupAction(this, func_808BC80C); } else if (cue->id == 3) { - Audio_PlaySfxGeneral(NA_SE_EV_WOODDOOR_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_WOODDOOR_OPEN); BgTreemouth_SetupAction(this, func_808BC6F8); } } @@ -218,8 +217,7 @@ void func_808BCAF0(BgTreemouth* this, PlayState* play) { if (cue->id == 2) { BgTreemouth_SetupAction(this, func_808BC80C); } else if (cue->id == 3) { - Audio_PlaySfxGeneral(NA_SE_EV_WOODDOOR_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_WOODDOOR_OPEN); BgTreemouth_SetupAction(this, func_808BC6F8); } } diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index a3ef2197eb..08b39baead 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -95,8 +95,7 @@ void BgVbSima_Update(Actor* thisx, PlayState* play) { this->dyna.actor.world.pos.z += 2.0f * Math_CosS(this->shakeTimer * 0x8000); this->dyna.actor.shape.rot.x = (s16)Math_SinS(this->shakeTimer * 0x7000) * 0x37; this->dyna.actor.shape.rot.z = (s16)Math_SinS(this->shakeTimer * 0x5000) * 0x37; - Audio_PlaySfxGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_BLOCKSINK - SFX_FLAG); } else if (signal == VBSIMA_KILL) { Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index f607fb4150..6bb61d1d01 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -65,8 +65,7 @@ void BgZg_Destroy(Actor* thisx, PlayState* play) { } void func_808C0C50(BgZg* this) { - Audio_PlaySfxGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_METALDOOR_OPEN); } s32 func_808C0C98(BgZg* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 5643da5d98..b1fffc4294 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -404,8 +404,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->fogMode = 1; } if (this->timers[0] < 50) { - Audio_PlaySfxGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); this->subCamAtYOffset = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->subCamShake; Math_ApproachF(&this->subCamShake, 2.0f, 1.0f, 0.8 * 0.01f); } @@ -425,8 +424,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { case BFD_CS_LOOK_GROUND: this->subCamAtYOffset = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->subCamShake; Math_ApproachF(&this->subCamShake, 2.0f, 1.0f, 0.8 * 0.01f); - Audio_PlaySfxGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); if (this->timers[0] == 0) { this->introState = BFD_CS_COLLAPSE; this->subCamEyeNext.x = player2->actor.world.pos.x + 100.0f + 300.0f; @@ -446,8 +444,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->subCamAccel = 0.005f; this->subCamAtYOffset = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->subCamShake; Math_ApproachF(&this->subCamShake, 2.0f, 1.0f, 0.8 * 0.01f); - Audio_PlaySfxGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); if (this->timers[0] == 100) { this->platformSignal = VBSIMA_COLLAPSE; } @@ -483,8 +480,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { PRINTF("WAY_SPD Y = %f\n", this->subCamAtVel.y); PRINTF("WAY_SPD Z = %f\n", this->subCamAtVel.z); if ((this->timers[3] > 190) && !GET_EVENTCHKINF(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) { - Audio_PlaySfxGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); } if (this->timers[3] == 190) { this->subCamAtMaxVelFrac.x = this->subCamAtMaxVelFrac.y = this->subCamAtMaxVelFrac.z = 0.05f; @@ -694,8 +690,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) { this->fwork[BFD_CEILING_BOUNCE] = -18384.0f; this->timers[1] = 10; - Audio_PlaySfxGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_EXPLOSION); Actor_RequestQuakeWithSpeed(play, 3, 10, 0x7530); this->work[BFD_ROCK_TIMER] = 300; } @@ -794,8 +789,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { sp150 = 1; if (this->work[BFD_MOVE_TIMER] & 0x1C) { - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_BURN - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_BURN - SFX_FLAG); } for (i1 = 0; i1 < sp150; i1++) { if (sp150) { // Needed for matching @@ -867,9 +861,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->work[BFD_CEILING_TARGET]++; this->timers[1] = 60; this->work[BFD_CAM_SHAKE_TIMER] = 20; - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_LAND2, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_LAND2); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_5); for (i1 = 0; i1 < 15; i1++) { Vec3f sp144 = { 0.0f, 0.0f, 0.0f }; @@ -910,8 +902,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { Vec3f sp114 = { 0.0f, 0.0f, 0.0f }; Vec3f sp108 = { 0.0f, 0.03f, 0.0f }; - Audio_PlaySfxGeneral(NA_SE_EN_GOMA_LAST - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_GOMA_LAST - SFX_FLAG); sp120.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x; sp120.y = (Rand_CenteredFloat(10.0f) + this->actor.world.pos.y) - 10.0f; @@ -1159,8 +1150,7 @@ void BossFd_Effects(BossFd* this, PlayState* play) { if (this->work[BFD_ROAR_TIMER] != 0) { if (this->work[BFD_ROAR_TIMER] == 37) { - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_ROAR, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_ROAR); } jawAngle = 6000.0f; jawSpeed = 1300.0f; @@ -1180,8 +1170,7 @@ void BossFd_Effects(BossFd* this, PlayState* play) { Vec3f spawnPos1; s16 i; - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_APPEAR - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_APPEAR - SFX_FLAG); if (this->work[BFD_SPLASH_TIMER] != 0) { this->work[BFD_SPLASH_TIMER]--; if ((this->actor.colChkInfo.health == 0) || @@ -1259,8 +1248,7 @@ void BossFd_Effects(BossFd* this, PlayState* play) { this->fogMode = 2; spawnSpeed2.z = 30.0f; - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_FIRE - SFX_FLAG, &sFireAudioVec, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&sFireAudioVec, NA_SE_EN_VALVAISA_FIRE - SFX_FLAG); spawnPos2 = this->headPos; spawnAngleY = BINANG_TO_RAD_ALT(this->actor.world.rot.y); @@ -1322,8 +1310,7 @@ void BossFd_CollisionCheck(BossFd* this, PlayState* play) { } this->work[BFD_DAMAGE_FLASH_TIMER] = 10; this->work[BFD_INVINC_TIMER] = 20; - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_DAMAGE1, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_DAMAGE1); } } diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index c9e41de7d7..7880389683 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -3971,9 +3971,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { if ((hitWithBottle == false) && (acHitElem->atDmgInfo.dmgFlags & DMG_SHIELD)) { spBA = 2; - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SHIELD_REFLECT_MG); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); } else { spBA = 1; @@ -3982,9 +3980,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { Math_Atan2S(sqrtf(SQ(xDistFromGanondorf) + SQ(zDistFromGanondorf)), yDistFromGanondorf); this->unk_1A4++; this->timers[1] = 2; - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SWORD_REFLECT_MG); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); if (hitWithBottle == false) { diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 4a1b0acbba..4a992ea49c 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -745,9 +745,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { player->actor.parent = &this->actor; this->work[MO_TENT_ACTION_STATE] = MO_TENT_GRAB; Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CATCH); - Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_VO_LI_DAMAGE_S); } else { this->work[MO_TENT_ACTION_STATE] = MO_TENT_READY; this->tentMaxAngle = .001f; diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 79eb682a76..9576ae3910 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -1162,11 +1162,9 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) { &this->actor.projectedW); if (this->actor.params == TW_KOUME) { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_54C, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_54C, NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG); } else { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_54C, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_54C, NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG); } break; @@ -1192,15 +1190,11 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) { &this->actor.projectedW); if (this->actor.params == TW_KOUME) { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_558, 4U, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG, &this->unk_558, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_558, NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG); + SFX_PLAY_AT_POS(&this->unk_558, NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG); } else { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_558, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_REFL_FREEZE - SFX_FLAG, &this->unk_558, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_558, NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG); + SFX_PLAY_AT_POS(&this->unk_558, NA_SE_EN_TWINROBA_REFL_FREEZE - SFX_FLAG); } break; } diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 7cbbff4c3e..54f735392a 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -3897,8 +3897,7 @@ void BossVa_SpawnTumor(PlayState* play, BossVaEffect* effect, BossVa* this, Vec3 effect->scale = 0.0f; if (((i % 4) == 0) || (mode == 2)) { - Audio_PlaySfxGeneral(NA_SE_EN_BALINADE_BREAK, &effect->pos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&effect->pos, NA_SE_EN_BALINADE_BREAK); } break; } diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 4bd2cf54e3..f3d3c9c48f 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -338,8 +338,7 @@ void DemoDu_CsPlaySfx_DaruniaHitsLink(PlayState* play) { s32 pad; Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_LINK); - Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_VO_LI_DAMAGE_S_KID); } // Cutscene: Darunia gives Link the Goron's Ruby. @@ -353,8 +352,7 @@ void DemoDu_CsPlaySfx_LinkEscapeFromGorons(PlayState* play) { if (play->csCtx.curFrame == 1400) { Player* player = GET_PLAYER(play); - Audio_PlaySfxGeneral(NA_SE_VO_LI_FALL_L_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_VO_LI_FALL_L_KID); } } @@ -364,8 +362,7 @@ void DemoDu_CsPlaySfx_LinkSurprised(PlayState* play) { if (play->csCtx.curFrame == 174) { Player* player = GET_PLAYER(play); - Audio_PlaySfxGeneral(NA_SE_VO_LI_SURPRISE_KID, &player->actor.projectedPos, 4U, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_VO_LI_SURPRISE_KID); } } diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index e4a944a0a2..1837fc7671 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -56,8 +56,7 @@ void DemoExt_Init(Actor* thisx, PlayState* play) { void DemoExt_PlayVortexSFX(DemoExt* this) { if (this->alphaTimer <= (kREG(35) + 40.0f) - 15.0f) { - Audio_PlaySfxGeneral(NA_SE_EV_FANTOM_WARP_L - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_FANTOM_WARP_L - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index ef3da8a40d..b172a29d3d 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -104,20 +104,17 @@ void DemoIk_Type1PlaySfx(DemoIk* this) { switch (this->actor.params) { case 0: if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO); } break; case 1: if (Animation_OnFrame(&this->skelAnime, 10.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO); } break; case 2: if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO); } break; } @@ -337,8 +334,7 @@ void DemoIk_Type2Init(DemoIk* this, PlayState* play) { void DemoIk_Type2PlaySfxOnFrame(DemoIk* this, f32 frame) { if (Animation_OnFrame(&this->skelAnime, frame)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO); } } diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 81667318e8..29f88da2a1 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -746,8 +746,7 @@ void func_80986570(DemoIm* this, PlayState* play) { u32 sfxId = NA_SE_PL_WALK_GROUND; sfxId += SurfaceType_GetSfxOffset(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - Audio_PlaySfxGeneral(sfxId, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, sfxId); } } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 60d023f6b8..f12d54b9fc 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -274,8 +274,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { this->sparkleCounter = 0; this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 1.0f; if (this->actor.params == DEMOKANKYO_WARP_OUT) { - Audio_PlaySfxGeneral(NA_SE_EV_SARIA_MELODY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_SARIA_MELODY); } break; case DEMOKANKYO_SPARKLES: @@ -390,8 +389,7 @@ void DemoKankyo_DoNothing(DemoKankyo* this, PlayState* play) { void DemoKankyo_UpdateWarpIn(DemoKankyo* this, PlayState* play) { #if OOT_VERSION < PAL_1_0 - Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_LINK_WARP_OUT); #endif DemoKankyo_SetupAction(this, DemoKankyo_DoNothing); } @@ -824,8 +822,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { } } else { #if OOT_VERSION >= PAL_1_0 - Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG); #endif if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpInCameraPoints, &this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) { diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index ece0958ad2..74272d963c 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -128,8 +128,7 @@ void func_80993848(DemoTreLgt* this, PlayState* play) { } if ((currentFrame > 30.0f) && !(this->status & 1)) { this->status |= 1; - Audio_PlaySfxGeneral(NA_SE_EV_TRE_BOX_FLASH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_FLASH); } if (SkelCurve_Update(play, &this->skelCurve)) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 80c94c19b1..8e04441f68 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -126,8 +126,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { if (openGrotto) { this->actor.params &= ~0x0300; DoorAna_SetupAction(this, DoorAna_WaitOpen); - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); } Actor_SetClosestSecretDistance(&this->actor, play); } diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index dd99eb63c0..93d7c0d9cc 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -481,8 +481,7 @@ void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) { if (DoorWarp1_PlayerInRange(this, play)) { Player* player = GET_PLAYER(play); - Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_EV_LINK_WARP); OnePointCutscene_Init(play, 0x25E7, 999, &this->actor, CAM_ID_MAIN); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_10); @@ -596,8 +595,7 @@ void func_80999EE0(DoorWarp1* this, PlayState* play) { void func_80999FE4(DoorWarp1* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { - Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_LINK_WARP); OnePointCutscene_Init(play, 0x25E9, 999, &this->actor, CAM_ID_MAIN); // Using `CAM_ID_NONE` here defaults to the active camera Play_CopyCamera(play, CAM_ID_NONE, sRutoWarpSubCamId); @@ -684,8 +682,7 @@ void func_8099A508(DoorWarp1* this, PlayState* play) { this->unk_1B2--; return; } - Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_EV_LINK_WARP); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, Animation_GetLastFrame(&gWarpCrystalAnim), Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, ANIMTAPER_ACCEL); diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 76462af1de..bb8d0bed57 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -141,8 +141,7 @@ void func_809BC598(EnBdfire* this, PlayState* play) { this->unk_158 = bossDodongo->unk_1A2; quarterTurn = false; if (this->actor.params == 0) { - Audio_PlaySfxGeneral(NA_SE_EN_DODO_K_FIRE - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_K_FIRE - SFX_FLAG); } Math_SmoothStepToF(&this->actor.scale.x, this->unk_188, 0.3f, 0.5f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 23c9321356..c3e37e868a 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -273,8 +273,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { EnBox_SetupAction(this, EnBox_WaitOpen); OnePointCutscene_EndCutscene(play, this->subCamId); } - Audio_PlaySfxGeneral(NA_SE_EV_COFFIN_CAP_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_COFFIN_CAP_BOUND); EnBox_SpawnDust(this, play); } yDiff = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight; @@ -383,8 +382,7 @@ void EnBox_AppearInit(EnBox* this, PlayState* play) { this->unk_1A8 = 0; Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, 0, 0, DEMOKANKYO_SPARKLES); - Audio_PlaySfxGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); } } @@ -486,8 +484,7 @@ void EnBox_Open(EnBox* this, PlayState* play) { } if (sfxId != 0) { - Audio_PlaySfxGeneral(sfxId, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->dyna.actor.projectedPos, sfxId); } if (this->skelanime.jointTable[3].z > 0) { diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 24e881840f..4e259d3295 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -184,8 +184,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { case PLAYER_MASK_TRUTH: if (!GET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); this->prize = DNT_PRIZE_NUTS; this->leader->stageSignal = DNT_LEADER_SIGNAL_UP; reaction = DNT_SIGNAL_LOOK; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 1568736109..ccbafc39da 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -217,8 +217,7 @@ void EnDs_Wait(EnDs* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { if (Actor_GetPlayerExchangeItemId(play) == EXCH_ITEM_ODD_MUSHROOM) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); player->actor.textId = 0x504A; this->actionFunc = EnDs_OfferOddPotion; } else if (GET_ITEMGETINF(ITEMGETINF_30)) { diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index a89c572a83..6a22304ca7 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -362,8 +362,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FE890); play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); play->csCtx.script = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectSongCs); gSaveContext.cutsceneTrigger = 1; this->unk_1E8 = 0; diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 793f6a5e82..db514cb807 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -511,9 +511,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { canBottleReflect2 = canBottleReflect1; if (!canBottleReflect2 && (acHitElem->atDmgInfo.dmgFlags & DMG_SHIELD)) { killMode = BALL_IMPACT; - Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SHIELD_REFLECT_MG); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); } else { if (bossGnd->flyMode == GND_FLY_NEUTRAL) { @@ -540,9 +538,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { RAD_TO_BINANG(Math_FAtan2F(dyPG, sqrtf((dxPG * dxPG) + (dzPG * dzPG)))) + angleModX; this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_BLUE; this->work[FHGFIRE_FX_TIMER] = 2; - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SWORD_REFLECT_MG); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); } break; @@ -576,12 +572,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { if ((fabsf(dxPG) < 30.0f) && (fabsf(dzPG) < 30.0f) && (fabsf(dyPG) < 45.0f)) { killMode = BALL_IMPACT; bossGnd->returnCount = this->work[FHGFIRE_RETURN_COUNT] + 1; - Audio_PlaySfxGeneral(NA_SE_EN_FANTOM_HIT_THUNDER, &bossGnd->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_EN_FANTOM_DAMAGE, &bossGnd->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&bossGnd->actor.projectedPos, NA_SE_EN_FANTOM_HIT_THUNDER); + SFX_PLAY_AT_POS(&bossGnd->actor.projectedPos, NA_SE_EN_FANTOM_DAMAGE); } } break; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 598cc7f616..a3884acc9f 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1409,9 +1409,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { if (key != NULL) { key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos); key->actor.speed = 6.0f; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } } EnGeldB_SetupDefeated(this); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index aa911c2f19..3d89726128 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -786,8 +786,7 @@ void EnGo_FireGenericActionFunc(EnGo* this, PlayState* play) { void EnGo_CurledUp(EnGo* this, PlayState* play) { if ((DECR(this->unk_210) == 0) && EnGo_IsCameraModified(this, play)) { - Audio_PlaySfxGeneral(NA_SE_EN_GOLON_WAKE_UP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_GOLON_WAKE_UP); this->skelAnime.playSpeed = 0.1f; this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f; @@ -822,8 +821,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } if (DECR(this->unk_212) == 0) { - Audio_PlaySfxGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_GOLON_SIT_DOWN); EnGo_SetupAction(this, func_80A405CC); } else if (!EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); @@ -842,8 +840,7 @@ void func_80A40494(EnGo* this, PlayState* play) { frame += this->skelAnime.playSpeed; if (!(frame >= 0.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_DODO_M_GND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_DODO_M_GND); EnGo_SpawnDust(this, 10, 0.4f, 0.1f, 16, 26.0f, 2.0f); EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = 0.0f; @@ -937,8 +934,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40494); } else if (EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); - Audio_PlaySfxGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_GOLON_SIT_DOWN); this->skelAnime.playSpeed = 0.0f; EnGo_SetupAction(this, func_80A405CC); } diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index d437df1c08..39b8da508a 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -622,8 +622,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { FALLTHROUGH; case 0x3054: if (dialogState == TEXT_STATE_NONE) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } break; } @@ -906,8 +905,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { return false; } else { if (this->collider.base.acFlags & AC_HIT) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->actor.flags &= ~ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT; this->collider.base.acFlags &= ~AC_HIT; EnGo2_StopRolling(this, play); diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index d13c4a85f8..b7973fb22a 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -441,8 +441,7 @@ void EnGoma_Dead(EnGoma* this, PlayState* play) { parent->childrenGohmaState[this->actor.params] = -1; } - Audio_PlaySfxGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_EXTINCT); Actor_Kill(&this->actor); Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x30); } diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 77db13b027..286af80803 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -329,14 +329,12 @@ void func_80A4ED34(EnGs* this, PlayState* play) { if (this->unk_200 < 20) { Color_RGBA8_Copy(&this->flashColor, &flashRed); if ((this->unk_200 % 20) == 7) { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_E); } } else { Color_RGBA8_Copy(&this->flashColor, &flashBlue); if ((this->unk_200 % 20) == 7) { - Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WARNING_COUNT_N); } } } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 68be05297e..5a2bf1506e 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -627,8 +627,7 @@ void EnHorse_PlayWalkingSfx(EnHorse* this) { return; } - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_WALK); if (++this->soundTimer >= ARRAY_COUNT(sAnimSoundFrames)) { this->soundTimer = 0; } @@ -636,13 +635,11 @@ void EnHorse_PlayWalkingSfx(EnHorse* this) { } void EnHorse_PlayTrottingSfx(EnHorse* this) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } void EnHorse_PlayGallopingSfx(EnHorse* this) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } f32 EnHorse_SlopeSpeedMultiplier(EnHorse* this, PlayState* play) { @@ -677,13 +674,11 @@ void EnHorse_IdleAnimSounds(EnHorse* this, PlayState* play) { (this->curFrame > 28.0f && this->type == HORSE_HNI)) && !(this->stateFlags & ENHORSE_SANDDUST_SOUND)) { this->stateFlags |= ENHORSE_SANDDUST_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_SANDDUST); } else if (this->animationIdx == ENHORSE_ANIM_REARING && this->curFrame > 25.0f && !(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); } } @@ -1100,8 +1095,7 @@ void EnHorse_StartMountedIdle(EnHorse* this) { if ((this->curFrame > 35.0f && this->type == HORSE_EPONA) || (this->curFrame > 28.0f && this->type == HORSE_HNI)) { if (!(this->stateFlags & ENHORSE_SANDDUST_SOUND)) { this->stateFlags |= ENHORSE_SANDDUST_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_SANDDUST); } } curFrame = this->skin.skelAnime.curFrame; @@ -1153,8 +1147,7 @@ void EnHorse_MountedIdleWhinney(EnHorse* this) { Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_GROAN); } } @@ -1424,8 +1417,7 @@ void EnHorse_StartRearing(EnHorse* this) { this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } Rumble_Request(0.0f, 180, 20, 100); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, @@ -1440,8 +1432,7 @@ void EnHorse_MountedRearing(EnHorse* this, PlayState* play) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); Rumble_Request(0.0f, 180, 20, 100); } } @@ -1474,8 +1465,7 @@ void EnHorse_StartBraking(EnHorse* this, PlayState* play) { this->action = ENHORSE_ACT_STOPPING; this->animationIdx = ENHORSE_ANIM_STOPPING; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SLIP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_SLIP); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); @@ -1496,8 +1486,7 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) { if (Rand_ZeroOne() > 0.5) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } Rumble_Request(0.0f, 180, 20, 100); this->stateFlags &= ~ENHORSE_STOPPING_NEIGH_SOUND; @@ -1627,8 +1616,7 @@ void EnHorse_StartLowJump(EnHorse* this, PlayState* play) { y = jointTable->y; this->riderPos.y -= y * 0.01f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_JUMP); Rumble_Request(0.0f, 170, 10, 10); } @@ -1662,8 +1650,7 @@ void EnHorse_LowJump(EnHorse* this, PlayState* play) { if (SkelAnime_Update(&this->skin.skelAnime) || (curFrame > 17.0f && this->actor.world.pos.y < this->actor.floorHeight - this->actor.velocity.y + 80.0f)) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND); Rumble_Request(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -1702,8 +1689,7 @@ void EnHorse_StartHighJump(EnHorse* this, PlayState* play) { this->riderPos.y -= y * 0.01f; this->stateFlags |= ENHORSE_CALC_RIDER_POS; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_JUMP); Rumble_Request(0.0f, 170, 10, 10); } @@ -1738,8 +1724,7 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) { if (SkelAnime_Update(&this->skin.skelAnime) || (curFrame > 23.0f && this->actor.world.pos.y < this->actor.floorHeight - this->actor.velocity.y + 80.0f)) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND); Rumble_Request(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -1768,8 +1753,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) { R_EPONAS_SONG_PLAYED = false; if (EnHorse_Spawn(this, play)) { #if OOT_VERSION >= PAL_1_0 - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_NEIGH); #endif this->stateFlags &= ~ENHORSE_INACTIVE; gSaveContext.save.info.horseData.sceneId = play->sceneId; @@ -1803,14 +1787,12 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta } else if (this->animationIdx == ENHORSE_ANIM_WHINNEY) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_GROAN); } } else if (this->animationIdx == ENHORSE_ANIM_REARING) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } this->stateFlags &= ~ENHORSE_LAND2_SOUND; } @@ -1846,8 +1828,7 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { if (!func_80A5BBBC(play, this, &this->actor.world.pos)) { if (EnHorse_Spawn(this, play)) { #if OOT_VERSION >= PAL_1_0 - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_NEIGH); #endif this->followTimer = 0; EnHorse_SetFollowAnimation(this, play); @@ -1856,8 +1837,7 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], CAM_DATA_SET_2, NULL, NULL, CAM_ITEM_TYPE_81, 0, 0); } } else { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_NEIGH); this->followTimer = 0; EnHorse_StartMovingAnimation(this, 6, -3.0f, 0.0f); } @@ -1963,8 +1943,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->unk_21C = this->unk_228; #if OOT_VERSION < PAL_1_0 if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } #endif } else if (this->stateFlags & ENHORSE_TURNING_TO_PLAYER) { @@ -1973,8 +1952,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); } } } else { @@ -2001,8 +1979,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } } @@ -2030,8 +2007,7 @@ void EnHorse_InitIngoHorse(EnHorse* this) { EnHorse_UpdateIngoHorseAnim(this); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_IT_INGO_HORSE_NEIGH); } } @@ -2084,12 +2060,10 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { animSpeed = this->actor.speed * 0.5f; } else if (this->animationIdx == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speed * 0.25f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speed * 0.2f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } else { animSpeed = 1.0f; } @@ -2206,8 +2180,7 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) { this->riderPos.y -= y * 0.01f; this->stateFlags |= ENHORSE_CALC_RIDER_POS; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_JUMP); Rumble_Request(0.0f, 170, 10, 10); } @@ -2250,8 +2223,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { if (SkelAnime_Update(&this->skin.skelAnime) || (temp_f2 > 19.0f && this->actor.world.pos.y < (this->actor.floorHeight - this->actor.velocity.y) + 80.0f)) { this->cutsceneFlags |= 1; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND); Rumble_Request(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -2275,8 +2247,7 @@ void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); @@ -2287,8 +2258,7 @@ void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); } } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -2363,8 +2333,7 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cu this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, @@ -2376,8 +2345,7 @@ void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); } } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -2530,13 +2498,11 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { animSpeed = this->actor.speed * 0.5f; } else if (this->animationIdx == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speed * 0.25f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); Rumble_Request(0.0f, 60, 8, 255); } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speed * 0.2f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); Rumble_Request(0.0f, 120, 8, 255); } else { animSpeed = 1.0f; @@ -2638,8 +2604,7 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { if (R_EPONAS_SONG_PLAYED || this->type == HORSE_HNI) { EnHorse_StartIdleRidable(this); - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_NEIGH); } distToHome = Math3D_Vec3f_DistXYZ(&this->actor.home.pos, &this->actor.world.pos); @@ -2749,8 +2714,7 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { this->animationIdx = ENHORSE_ANIM_WHINNEY; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_GROAN); } } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, @@ -2806,11 +2770,9 @@ void EnHorse_BridgeJumpInit(EnHorse* this, PlayState* play) { Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_JUMP); Rumble_Request(0.0f, 170, 10, 10); this->postDrawFunc = NULL; } @@ -2859,8 +2821,7 @@ void EnHorse_CheckBridgeJumpLanding(EnHorse* this, PlayState* play) { this->actor.world.pos.y = sBridgeJumps[this->bridgeJumpIdx].pos.y; func_80028A54(play, 25.0f, &this->actor.world.pos); EnHorse_JumpLanding(this, play); - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND); Rumble_Request(0.0f, 255, 10, 80); } } @@ -3186,8 +3147,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { Math_CosS(this->actor.wallYaw - ((void)0, this->actor.world).rot.y) < -0.3f) { if (this->actor.speed > 4.0f) { this->actor.speed -= 1.0f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_SANDDUST); } } @@ -3391,8 +3351,7 @@ void EnHorse_CheckBoost(EnHorse* thisx, PlayState* play2) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { if (Rand_ZeroOne() < 0.1f) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } } } @@ -3409,8 +3368,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { this->numBoosts++; if (!EN_HORSE_CHECK_4(this)) { - Audio_PlaySfxGeneral(NA_SE_SY_CARROT_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CARROT_RECOVER); } if (this->numBoosts < 6) { @@ -3426,8 +3384,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { this->numBoosts = 6; if (!EN_HORSE_CHECK_4(this)) { - Audio_PlaySfxGeneral(NA_SE_SY_CARROT_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CARROT_RECOVER); } } } @@ -3435,8 +3392,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { if (this->boostTimer == 8 && Rand_ZeroOne() < 0.25f) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } } play->interfaceCtx.numHorseBoosts = this->numBoosts; @@ -3578,8 +3534,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { if (this->colliderJntSph.base.acFlags & AC_HIT) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_21C, NA_SE_EV_HORSE_NEIGH); } } if (this->action != ENHORSE_ACT_INGO_RACE) { diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 56f09ec2d8..db12829566 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -167,8 +167,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) ingoHorse->inRace = 1; this->startFlags |= INGO_RACE_INGO_MOVE; - Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_START_SHOT); } this->startTimer++; @@ -198,8 +197,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) this->result = INGO_RACE_PLAYER_WIN; this->finishTimer = 55; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL); - Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_START_SHOT); } for (i = 0; i < 3; i++) { this->playerCheck[i] = 0; @@ -214,8 +212,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) this->finishTimer = 70; ingoHorse->stateFlags |= ENHORSE_INGO_WON; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL); - Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_START_SHOT); } for (i = 0; i < 3; i++) { this->ingoCheck[i] = 0; @@ -354,8 +351,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play rideHorse->inRace = 1; } else if ((this->startTimer > 81) && !(this->raceFlags & MALONRACE_START_SFX)) { this->raceFlags |= MALONRACE_START_SFX; - Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_START_SHOT); } this->startTimer++; @@ -394,8 +390,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play } else if (this->fenceCheck[15] == 1) { this->lapCount = 2; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL); - Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_START_SHOT); this->result = MALONRACE_SUCCESS; this->finishTimer = 70; gSaveContext.timerState = TIMER_STATE_UP_FREEZE; diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index b5f402ba1d..1301d1fde8 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -166,8 +166,7 @@ void func_80A686A8(EnHorseGanon* this, PlayState* play) { void func_80A68870(EnHorseGanon* this) { if ((this->skin.skelAnime.curFrame > D_80A692B8[this->soundCount]) && (this->soundCount != 0 || !(this->skin.skelAnime.curFrame > D_80A692B8[1]))) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_WALK); this->soundCount++; if (this->soundCount >= 2) { @@ -247,12 +246,10 @@ void func_80A68B20(EnHorseGanon* this) { sp30 = this->actor.speed / 3.0f; } else if (this->currentAnimation == 3) { sp30 = this->actor.speed / 5.0f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } else if (this->currentAnimation == 4) { sp30 = this->actor.speed / 7.0f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } else { sp30 = 1.0f; } diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 7e1282d880..09d7ad03bc 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -107,8 +107,7 @@ void func_80A693D0(EnHorseLinkChild* this) { if ((this->skin.skelAnime.curFrame > D_80A6AF5C[this->unk_1F0]) && !((this->unk_1F0 == 0) && (this->skin.skelAnime.curFrame > D_80A6AF5C[1]))) { - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_WALK); this->unk_1F0++; if (this->unk_1F0 >= ARRAY_COUNT(D_80A6AF5C)) { this->unk_1F0 = 0; @@ -121,15 +120,12 @@ void func_80A6948C(EnHorseLinkChild* this) { func_80A693D0(this); } else if (this->skin.skelAnime.curFrame == 0.0f) { if ((this->animationIdx == 3) || (this->animationIdx == 4)) { - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else if (this->animationIdx == 1) { if (Rand_ZeroOne() > 0.5f) { - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_GROAN, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_GROAN); } else { - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_NEIGH); } } } @@ -368,8 +364,7 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) { distFromLink = Actor_WorldDistXZToActor(&this->actor, &player->actor); if (gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_1) { - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_NEIGH); func_80A6A724(this); return; } @@ -461,8 +456,7 @@ void func_80A6A5A4(EnHorseLinkChild* this, PlayState* play) { if (R_EPONAS_SONG_PLAYED) { R_EPONAS_SONG_PLAYED = false; - Audio_PlaySfxGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_NEIGH); func_80A6A724(this); } else { this->actor.speed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index c3713febb6..a77853b6f6 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -167,8 +167,7 @@ void func_80A6B250(EnHorseNormal* this) { if (D_80A6D4C0[this->unk_200] < this->skin.skelAnime.curFrame && ((this->unk_200 != 0) || !(D_80A6D4C0[1] < this->skin.skelAnime.curFrame))) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_WALK); this->unk_200++; if (this->unk_200 >= ARRAY_COUNT(D_80A6D4C0)) { this->unk_200 = 0; @@ -360,11 +359,9 @@ void func_80A6BC48(EnHorseNormal* this) { void func_80A6BCEC(EnHorseNormal* this) { if (this->animationIdx == 5) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } else if (this->animationIdx == 6) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } } @@ -373,12 +370,10 @@ void func_80A6BD7C(EnHorseNormal* this) { if (this->animationIdx == 0 && frame > 28.0f && !(this->unk_1E4 & 1)) { this->unk_1E4 |= 1; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_SANDDUST); } else if (this->animationIdx == 3 && frame > 25.0f && !(this->unk_1E4 & 2)) { this->unk_1E4 |= 2; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_LAND2); } } @@ -447,11 +442,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { this->unk_1E4 &= ~1; this->unk_1E4 &= ~2; if (phi_t0 == 1) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_GROAN); } else if (phi_t0 == 3) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_NEIGH); } else { func_80A6BCEC(this); } @@ -478,11 +471,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { this->unk_1E4 &= ~1; this->unk_1E4 &= ~2; if (phi_t0 == 1) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_GROAN); } else if (phi_t0 == 3) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_NEIGH); } else { func_80A6BCEC(this); } @@ -517,12 +508,10 @@ void EnHorseNormal_Wait(EnHorseNormal* this, PlayState* play) { this->animationIdx = 0; } else if (rand < 0.8f) { this->animationIdx = 1; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_GROAN); } else { this->animationIdx = 3; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_NEIGH); } Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, @@ -553,13 +542,11 @@ void EnHorseNormal_WaitClone(EnHorseNormal* this, PlayState* play) { } else if (rand < 0.8f) { this->animationIdx = 1; this->unk_1E4 |= 0x20; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_GROAN); } else { this->animationIdx = 3; this->unk_1E4 |= 0x20; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_204, NA_SE_EV_HORSE_NEIGH); } Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, @@ -648,20 +635,16 @@ void func_80A6CC88(PlayState* play, EnHorseNormal* this, Vec3f* arg2) { if (this->animationIdx == 0 && curFrame > 28.0f && !(this->unk_1E4 & 8)) { this->unk_1E4 |= 8; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_SANDDUST, &this->unk_1E8, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_1E8, NA_SE_EV_HORSE_SANDDUST); } else if (this->animationIdx == 3 && curFrame > 25.0f && !(this->unk_1E4 & 0x10)) { this->unk_1E4 |= 0x10; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND2, &this->unk_1E8, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_1E8, NA_SE_EV_HORSE_LAND2); } else if (this->animationIdx == 3 && this->unk_1E4 & 0x20) { this->unk_1E4 &= ~0x20; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_1F4, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_1F4, NA_SE_EV_HORSE_NEIGH); } else if (this->animationIdx == 1 && this->unk_1E4 & 0x20) { this->unk_1E4 &= ~0x20; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_1F4, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->unk_1F4, NA_SE_EV_HORSE_GROAN); } } diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 2906e541cd..72dc359f10 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -212,8 +212,7 @@ void EnHorseZelda_Spur(EnHorseZelda* this) { this->action = 1; this->animationIndex = 0; speedMod = this->actor.speed / 6.0f; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->animationIndex], splaySpeeds[this->animationIndex] * speedMod * 1.5f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->animationIndex]), ANIMMODE_ONCE, 0.0f); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index bcc58becb1..65a3c884d1 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -789,9 +789,7 @@ s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { case 0x709E: case 0x709F: if (!this->playedSfx) { - Audio_PlaySfxGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR, - &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR); this->playedSfx = true; } break; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 2dfee076b2..53f9c938cd 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1059,30 +1059,23 @@ void EnIk_StartMinibossBgm(void) { // Cutscene: Nabooru Knuckle Wakes up void EnIk_UpdateAction2Sfx(EnIk* this) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_WAKEUP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_WAKEUP); } else if (Animation_OnFrame(&this->skelAnime, 33.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_WALK); } else if (Animation_OnFrame(&this->skelAnime, 68.0f) || Animation_OnFrame(&this->skelAnime, 80.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_DEMO); } else if (Animation_OnFrame(&this->skelAnime, 107.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_FINGER_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_FINGER_DEMO); } else if (Animation_OnFrame(&this->skelAnime, 156.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_ARMOR_DEMO); } else if (Animation_OnFrame(&this->skelAnime, 188.0f)) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_WAVE_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_WAVE_DEMO); } } // Cutscene: Summons Axe for Nabooru Knuckle void EnIk_PlayAxeSpawnSfx(EnIk* this, PlayState* play, Vec3f* pos) { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_TRANSFORM, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TWINROBA_TRANSFORM); } void EnIk_SpawnAxeSmoke(EnIk* this, PlayState* play, Vec3f* pos) { @@ -1198,8 +1191,7 @@ void EnIk_HandleEnemyChange(EnIk* this, PlayState* play, s32 animFinished) { } void EnIk_PlayArmorFallSfx(EnIk* this) { - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_STAGGER_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_IRONNACK_STAGGER_DEMO); } void EnIk_PlayDeathSfx(EnIk* this, PlayState* play) { @@ -1208,8 +1200,7 @@ void EnIk_PlayDeathSfx(EnIk* this, PlayState* play) { f32 wDest; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &D_80A78FA0, &wDest); - Audio_PlaySfxGeneral(NA_SE_EN_IRONNACK_DEAD, &D_80A78FA0, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&D_80A78FA0, NA_SE_EN_IRONNACK_DEAD); } // Cutscene: starts after final hit to Nabooru diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 9feac621ff..d12f92ec13 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -652,11 +652,9 @@ void func_80A7A304(EnIn* this, PlayState* play) { this->animationIdx %= 8; this->unk_1E8 = this->animationIdx; if (this->animationIdx == 3 || this->animationIdx == 4) { - Audio_PlaySfxGeneral(NA_SE_IT_LASH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_IT_LASH); if (Rand_ZeroOne() < 0.3f) { - Audio_PlaySfxGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_IT_INGO_HORSE_NEIGH); } } Animation_Change(&this->skelAnime, D_80A7B918[this->animationIdx], 1.0f, 0.0f, @@ -689,8 +687,7 @@ void func_80A7A568(EnIn* this, PlayState* play) { SET_INFTABLE(INFTABLE_AB); } if (gSaveContext.timerState == TIMER_STATE_STOP) { - Audio_PlaySfxGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FOUND); func_80A79C78(this, play); this->actionFunc = func_80A7B024; gSaveContext.timerState = TIMER_STATE_OFF; @@ -707,8 +704,7 @@ void func_80A7A568(EnIn* this, PlayState* play) { phi_a2 = 2; transitionType = TRANS_TYPE_FADE_BLACK; } else { - Audio_PlaySfxGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FOUND); if (!GET_EVENTCHKINF(EVENTCHKINF_1B)) { if (GET_INFTABLE(INFTABLE_AB)) { SET_EVENTCHKINF(EVENTCHKINF_1B); diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index a7cc77a262..9a3f2eaca1 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -759,8 +759,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { (play->msgCtx.unk_E3F2 == OCARINA_SONG_LULLABY)) { this->actionState = ENKANBAN_REPAIR; this->bounceX = 1; - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); } break; } diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 1ad021f692..f381c88492 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -576,8 +576,7 @@ s16 EnKo_UpdateTalkState(PlayState* play, Actor* thisx) { case 0x10B7: case 0x10B8: if (this->unk_210 == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); this->unk_210 = 1; } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 81aacf1335..40b10dc670 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -175,13 +175,11 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { case TEXT_STATE_DONE_FADING: if (this->actor.textId != 0x4014) { if (this->actor.textId == 0x401B && !this->sfxPlayed) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->sfxPlayed = true; } } else if (!this->sfxPlayed) { - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); this->sfxPlayed = true; } break; diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index 097564b021..e46aca4169 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -85,8 +85,7 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { if (thisx->speed) { if (thisx->bgCheckFlags & BGCHECKFLAG_WALL) { thisx->world.rot.y = (thisx->world.rot.y + thisx->wallYaw) - thisx->world.rot.y; - Audio_PlaySfxGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&thisx->projectedPos, NA_SE_EV_BOMB_BOUND); thisx->speed *= 0.7f; thisx->bgCheckFlags &= ~BGCHECKFLAG_WALL; } @@ -97,8 +96,7 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { } else { Math_StepToF(&thisx->speed, 0, IREG(58) / 100.0f); if ((thisx->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (thisx->velocity.y < IREG(59) / 100.0f)) { - Audio_PlaySfxGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&thisx->projectedPos, NA_SE_EV_BOMB_BOUND); thisx->velocity.y *= IREG(60) / 100.0f; thisx->bgCheckFlags &= ~BGCHECKFLAG_GROUND; } else { diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 1a64d485d3..b66ace6f3f 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -93,10 +93,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (!gSaveContext.save.info.playerData.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || (PARAMS_GET_S(this->actor.params, 8, 8) && !(Magic_RequestChange(play, PARAMS_GET_S(this->actor.params, 8, 8), MAGIC_CONSUME_NOW)))) { - Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_ROLLING_CUT); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SWORD_SWING_HARD); Actor_Kill(&this->actor); return; } @@ -108,8 +106,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); func_80A9EFE0(this, func_80A9F9B4); this->unk_1C4 = 8; - Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_ROLLING_CUT_LV1); this->unk_1AC = 1.0f; } else { func_80A9EFE0(this, func_80A9F408); @@ -138,10 +135,8 @@ void func_80A9F350(EnMThunder* this, PlayState* play) { if (player->stateFlags2 & PLAYER_STATE2_17) { if (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) { - Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_ROLLING_CUT); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SWORD_SWING_HARD); } Actor_Kill(&this->actor); @@ -189,10 +184,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (player->unk_858 <= 0.15f) { if ((player->unk_858 >= 0.1f) && (player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H)) { - Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_ROLLING_CUT); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_IT_SWORD_SWING_HARD); } Actor_Kill(&this->actor); return; @@ -222,8 +215,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { NA_SE_IT_ROLLING_CUT_LV1, }; - Audio_PlaySfxGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, sSfxIds[this->unk_1C6]); } this->unk_1AC = 1.0f; diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 45cb07bae2..e6df4523d7 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -315,8 +315,7 @@ void EnMa2_WaitForEponasSong(EnMa2* this, PlayState* play) { this->actionFunc = EnMa2_WaitForOcarina; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->timer = 0x1E; SET_INFTABLE(INFTABLE_PLAYED_SONG_FOR_ADULT_MALON); this->actionFunc = EnMa2_ForceTalkAfterSong; diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 849eee33d8..e52a54d5e4 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -220,8 +220,7 @@ void EnMag_Update(Actor* thisx, PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); this->mainAlpha = 210; this->subAlpha = 255; @@ -258,8 +257,7 @@ void EnMag_Update(Actor* thisx, PlayState* play) { if (play->transitionTrigger != TRANS_TRIGGER_START) { Audio_SetCutsceneFlag(0); - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); gSaveContext.gameMode = GAMEMODE_FILE_SELECT; play->transitionTrigger = TRANS_TRIGGER_START; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index d1633deb65..1695635c59 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -815,8 +815,7 @@ void EnMd_ListenToOcarina(EnMd* this, PlayState* play) { this->actionFunc = EnMd_BlockPath; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); this->actor.textId = 0x1067; Actor_OfferTalk(&this->actor, play, this->collider.dim.radius + 30.0f); diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index 5f72ceeb4d..59ea027c65 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -78,8 +78,7 @@ void EnPubox_Update(Actor* thisx, PlayState* play) { thisx->speed = CLAMP(thisx->speed, -2.5f, 2.5f); Math_SmoothStepToF(&thisx->speed, 0.0f, 1.0f, 1.0f, 0.0f); if (thisx->speed != 0.0f) { - Audio_PlaySfxGeneral(NA_SE_EV_ROCK_SLIDE - SFX_FLAG, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&thisx->projectedPos, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = 0.0f; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 6f897d28b0..b0b2dc7f8a 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -651,8 +651,7 @@ void func_80AEBC30(PlayState* play) { if (play->csCtx.curFrame == 205) { player = GET_PLAYER(play); - Audio_PlaySfxGeneral(NA_SE_EV_DIVE_INTO_WATER, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_EV_DIVE_INTO_WATER); } } @@ -1261,8 +1260,7 @@ void func_80AED4FC(EnRu1* this) { void func_80AED520(EnRu1* this, PlayState* play) { Player* player = GET_PLAYER(play); - Audio_PlaySfxGeneral(NA_SE_PL_PULL_UP_RUTO, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&player->actor.projectedPos, NA_SE_PL_PULL_UP_RUTO); Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_LIFT); } diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 2f39fefa34..2cf677d007 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -694,8 +694,7 @@ void func_80AF68E4(EnSa* this, PlayState* play) { phi_v0 = this->unk_20C; } if (phi_v0 == 0) { - Audio_PlaySfxGeneral(NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_DIRT, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_DIRT); this->unk_20C = 8; } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 44a589c993..628d69d197 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -283,8 +283,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { } if (PARAMS_GET_S(thisx->params, 13, 3) >= 3) { - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); } switch (PARAMS_GET_S(thisx->params, 13, 3)) { @@ -629,8 +628,7 @@ void func_80B0D878(EnSw* this, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; if ((this->unk_394 == 0) && (this->unk_392 == 0)) { - Audio_PlaySfxGeneral(NA_SE_SY_KINSTA_MARK_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_KINSTA_MARK_APPEAR); x = (this->unk_364.x * 10.0f); y = (this->unk_364.y * 10.0f); z = (this->unk_364.z * 10.0f); diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index c01b1a22d2..b7ac898b92 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -466,8 +466,7 @@ void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play) { } if ((this->archeryTimer == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) { - Audio_PlaySfxGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_VO_LI_DOWN); this->movementTimer = 20; this->archeryState = 6; this->actor.speed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index a802541986..b5ca8502b7 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -640,8 +640,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); } else if (this->currentReward == 4) { /* Heart piece */ - Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME); } else { /* Rupee */ Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index f197510c55..59519acfd0 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -261,8 +261,7 @@ void EnTp_Head_ApproachPlayer(EnTp* this, PlayState* play) { Player* player = GET_PLAYER(play); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 30.0f, 1.0f, 0.5f, 0.0f); - Audio_PlaySfxGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TAIL_FLY - SFX_FLAG); if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -403,8 +402,7 @@ void EnTp_Head_TakeOff(EnTp* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 2.5f, 0.1f, 0.2f, 0.0f); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 85.0f + this->horizontalVariation, 1.0f, this->actor.speed * 0.25f, 0.0f); - Audio_PlaySfxGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TAIL_FLY - SFX_FLAG); if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -501,8 +499,7 @@ void EnTp_Head_Wait(EnTp* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.world.pos.y != this->actor.home.pos.y) { - Audio_PlaySfxGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TAIL_FLY - SFX_FLAG); } } @@ -571,8 +568,7 @@ void EnTp_Head_BurrowReturnHome(EnTp* this, PlayState* play) { } if (this->actor.world.pos.y != this->actor.home.pos.y) { - Audio_PlaySfxGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TAIL_FLY - SFX_FLAG); } if (closeToFloor && ((play->gameplayFrames & 1) != 0)) { @@ -721,8 +717,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.z += 0x800; if (this->actor.shape.rot.z == 0) { - Audio_PlaySfxGeneral(NA_SE_EN_TAIL_CRY, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_TAIL_CRY); } if (this->actionIndex >= TAILPASARAN_ACTION_TAIL_FOLLOWHEAD) { diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 84b2dd4cf6..4ec4839c66 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -137,8 +137,7 @@ void EnTr_CrySpellcast(EnTr* this, PlayState* play) { if (this->timer == 11) { // Both cry in the title screen cutscene, but only Kotake in the in-game cutscene if ((this->actor.params != TR_KOUME) || (gSaveContext.sceneLayer == 6)) { - Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_VOICE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EN_TWINROBA_SHOOT_VOICE); } } diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 826d7f0ebe..a03ea5a1fb 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -147,8 +147,7 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { this->actor.velocity.z = cosf(angle) * 10.0f; this->actor.velocity.y *= -0.5f; if (PARAMS_GET_U(this->actor.params, 0, 1)) { - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EN_VALVAISA_LAND); } for (i = 0; i < 10; i++) { Vec3f dustVel = { 0.0f, 0.0f, 0.0f }; @@ -230,9 +229,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { this->actor.world.rot.z * 0.5f, this->actor.params + 1); if (newActor != NULL) { if ((i == 0) && (this->actor.params == 100)) { - Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_ROCK, &newActor->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&newActor->actor.projectedPos, NA_SE_EN_VALVAISA_ROCK); } newActor->actor.parent = this->actor.parent; newActor->actor.velocity = spawnOffset; diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index ce7ea7e2c9..6dffc30ecd 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -246,8 +246,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { case 380: case 409: case 438: - Audio_PlaySfxGeneral(NA_SE_SY_DEMO_CUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DEMO_CUT); break; } } @@ -264,8 +263,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 0, 0, NA_BGM_OPENING_GANON); } if (play->csCtx.curFrame == 960) { - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_GROAN); } } else if (type == ENVIEWER_TYPE_6_HORSE_GANONDORF) { if (gSaveContext.sceneLayer == 5 || gSaveContext.sceneLayer == 10) { @@ -456,8 +454,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { case 0: if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[1] != NULL) && (play->csCtx.actorCues[1]->id == 7)) { - Audio_PlaySfxGeneral(NA_SE_EN_GANON_LAUGH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EN_GANON_LAUGH); Animation_MorphToPlayOnce(&this->skin.skelAnime, &gYoungGanondorfLaughStartAnim, -5.0f); this->state++; } @@ -750,8 +747,7 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { if (type == ENVIEWER_TYPE_0_HORSE_ZELDA) { if (!sHorseSfxPlayed) { sHorseSfxPlayed = true; - Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_HORSE_NEIGH); } Actor_PlaySfx(&this->actor, NA_SE_EV_HORSE_RUN_LEVEL - SFX_FLAG); } @@ -800,8 +796,7 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { } } if (type == ENVIEWER_TYPE_5_GANONDORF) { - Audio_PlaySfxGeneral(NA_SE_EV_BURNING - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_BURNING - SFX_FLAG); EnViewer_DrawFireEffects(this, play); } } diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index b9c396dfcc..3acf9fa616 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -2622,8 +2622,7 @@ void func_80B59828(EnZl3* this, PlayState* play) { void func_80B59A80(EnZl3* this, PlayState* play) { if (func_80B59768(this, play)) { - Audio_PlaySfxGeneral(NA_SE_OC_REVENGE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_OC_REVENGE); } } diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 0ff67cc85c..52d535de7b 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -75,8 +75,7 @@ void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) { } if ((this->actor.params != 0x3FF) && (gSaveContext.timerSeconds == 0)) { - Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_OC_ABYSS); Play_TriggerVoidOut(play); Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index ccebc0615e..064dceebad 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -199,9 +199,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { if (interactionType < 0) { if (player->unk_860 == 0) { player->unk_860 = 210; - Audio_PlaySfxGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_FLAME_IGNITION); } else if (player->unk_860 < 200) { player->unk_860 = 200; } @@ -237,8 +235,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { this->litTimer = (litTimeScale * 50) + 110; } } - Audio_PlaySfxGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->actor.projectedPos, NA_SE_EV_FLAME_IGNITION); } } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 2acc07c120..8d3cde9216 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -13706,8 +13706,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { ((this->getItemId >= GI_RUPEE_PURPLE) && (this->getItemId <= GI_RUPEE_GOLD)) || ((this->getItemId >= GI_RUPEE_GREEN_LOSE) && (this->getItemId <= GI_RUPEE_PURPLE_LOSE)) || (this->getItemId == GI_RECOVERY_HEART)) { - Audio_PlaySfxGeneral(NA_SE_SY_GET_BOXITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_GET_BOXITEM); } else { if ((this->getItemId == GI_HEART_CONTAINER_2) || (this->getItemId == GI_HEART_CONTAINER) || ((this->getItemId == GI_HEART_PIECE) && diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c index b75a7077c8..8e83ca9f11 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c @@ -141,7 +141,6 @@ void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this) { if (this->rPlaySfx && (this->rTextIdx == 1)) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->pos, &this->vec, &w); - Audio_PlaySfxGeneral(NA_SE_EN_EXTINCT, &this->vec, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->vec, NA_SE_EN_EXTINCT); } } diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c index 4a577652b9..fa5df19368 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c @@ -50,6 +50,5 @@ void EffectSsDeadSound_Update(PlayState* play, u32 index, EffectSs* this) { return; } - Audio_PlaySfxGeneral(this->rSfxId, &this->pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_AT_POS(&this->pos, this->rSfxId); } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index fdb36d94bd..534c498178 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -155,10 +155,8 @@ void FileSelect_UpdateInitialLanguageMenu(FileSelectState* this) { if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_START)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); sramCtx->readBuff[2] = gSaveContext.language; Sram_WriteSramHeader(sramCtx); this->configMode++; @@ -166,15 +164,13 @@ void FileSelect_UpdateInitialLanguageMenu(FileSelectState* this) { } if (sInitialLanguageStickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); gSaveContext.language--; if (gSaveContext.language >= LANGUAGE_MAX) { gSaveContext.language = LANGUAGE_MAX - 1; } } else if (sInitialLanguageStickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); gSaveContext.language++; if (gSaveContext.language >= LANGUAGE_MAX) { gSaveContext.language = 0; @@ -527,8 +523,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { GET_NEWF(sramCtx, this->buttonIndex, 5)); if (!SLOT_OCCUPIED(sramCtx, this->buttonIndex)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->kbdButton = FS_KBD_BTN_NONE; @@ -550,16 +545,14 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { this->nameEntryBoxAlpha = 0; MemCpy(&this->fileNames[this->buttonIndex][0], &emptyName, sizeof(emptyName)); } else if (this->n64ddFlags[this->buttonIndex] == this->n64ddFlag) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); this->actionTimer = 8; this->selectMode = SM_FADE_MAIN_TO_SELECT; this->selectedFileIndex = this->buttonIndex; this->menuMode = FS_MENU_MODE_SELECT; this->nextTitleLabel = FS_TITLE_OPEN_FILE; } else if (!this->n64ddFlags[this->buttonIndex]) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } else { #if PLATFORM_N64 if (D_80121212 != 0) { @@ -571,8 +564,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { } } else { if (this->warningLabel == FS_WARNING_NONE) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); this->prevConfigMode = this->configMode; if (this->buttonIndex == FS_BTN_MAIN_COPY) { @@ -593,14 +585,12 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { this->actionTimer = 8; } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } } else { if (ABS(this->stickAdjY) > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (this->stickAdjY > 30) { this->buttonIndex--; @@ -1762,22 +1752,18 @@ void FileSelect_ConfirmFile(GameState* thisx) { if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) { if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) { Rumble_Request(300.0f, 180, 20, 100); - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); this->selectMode = SM_FADE_OUT; func_800F6964(0xF); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); this->selectMode++; } } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); this->selectMode++; } else if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->confirmButtonIndex ^= 1; } } @@ -1882,8 +1868,7 @@ void FileSelect_LoadGame(GameState* thisx) { #if DEBUG_FEATURES if (this->buttonIndex == FS_BTN_SELECT_FILE_1) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); gSaveContext.fileNum = this->buttonIndex; Sram_OpenSave(&this->sramCtx); gSaveContext.gameMode = GAMEMODE_NORMAL; @@ -1892,8 +1877,7 @@ void FileSelect_LoadGame(GameState* thisx) { } else #endif { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); gSaveContext.fileNum = this->buttonIndex; Sram_OpenSave(&this->sramCtx); gSaveContext.gameMode = GAMEMODE_NORMAL; diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index fb14504bd7..e230ab56f7 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -98,24 +98,20 @@ void FileSelect_SelectCopySource(GameState* thisx) { this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode = CM_COPY_RETURN_MAIN; this->warningLabel = FS_WARNING_NONE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (SLOT_OCCUPIED(sramCtx, this->buttonIndex)) { this->actionTimer = 8; this->selectedFileIndex = this->buttonIndex; this->configMode = CM_SETUP_COPY_DEST_1; this->nextTitleLabel = FS_TITLE_COPY_TO; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } else { if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (this->stickAdjY >= 30) { this->buttonIndex--; @@ -270,25 +266,21 @@ void FileSelect_SelectCopyDest(GameState* thisx) { this->nextTitleLabel = FS_TITLE_COPY_FROM; this->actionTimer = 8; this->configMode = CM_EXIT_TO_COPY_SOURCE_1; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (!SLOT_OCCUPIED(sramCtx, this->buttonIndex)) { this->copyDestFileIndex = this->buttonIndex; this->nextTitleLabel = FS_TITLE_COPY_CONFIRM; this->actionTimer = 8; this->configMode = CM_SETUP_COPY_CONFIRM_1; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } else { if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (this->stickAdjY >= 30) { this->buttonIndex--; @@ -553,8 +545,7 @@ void FileSelect_CopyConfirm(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_COPY_TO; this->configMode = CM_RETURN_TO_COPY_DEST; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { dayTime = gSaveContext.save.dayTime; Sram_CopySave(this, sramCtx); @@ -564,11 +555,9 @@ void FileSelect_CopyConfirm(GameState* thisx) { this->actionTimer = 8; this->configMode = CM_COPY_ANIM_1; Rumble_Request(300.0f, 180, 20, 100); - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); } else if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->buttonIndex ^= 1; } } @@ -758,8 +747,7 @@ void FileSelect_CopyAnim3(GameState* thisx) { if (this->actionTimer == 75) { this->connectorAlpha[this->copyDestFileIndex] = 255; - Audio_PlaySfxGeneral(NA_SE_EV_DIAMOND_SWITCH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_DIAMOND_SWITCH); } this->actionTimer--; @@ -769,8 +757,7 @@ void FileSelect_CopyAnim3(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode++; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); } } } @@ -1154,24 +1141,20 @@ void FileSelect_EraseSelect(GameState* thisx) { this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode = CM_EXIT_ERASE_TO_MAIN; this->warningLabel = FS_WARNING_NONE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (SLOT_OCCUPIED(sramCtx, this->buttonIndex)) { this->actionTimer = 8; this->selectedFileIndex = this->buttonIndex; this->configMode = CM_SETUP_ERASE_CONFIRM_1; this->nextTitleLabel = FS_TITLE_ERASE_CONFIRM; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } else { if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (this->stickAdjY >= 30) { this->buttonIndex--; @@ -1391,20 +1374,17 @@ void FileSelect_EraseConfirm(GameState* thisx) { this->nextTitleLabel = FS_TITLE_ERASE_FILE; this->configMode = CM_EXIT_TO_ERASE_SELECT_1; this->actionTimer = 8; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { this->n64ddFlags[this->selectedFileIndex] = this->connectorAlpha[this->selectedFileIndex] = 0; - Audio_PlaySfxGeneral(NA_SE_EV_DIAMOND_SWITCH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_EV_DIAMOND_SWITCH); this->actionTimer = 8; this->configMode = CM_ERASE_ANIM_1; this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE; Rumble_Request(200.0f, 255, 20, 150); sEraseDelayTimer = 15; } else if (ABS(this->stickAdjY) >= 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->buttonIndex ^= 1; } } @@ -1622,8 +1602,7 @@ void FileSelect_EraseAnim1(GameState* thisx) { sEraseDelayTimer--; if (sEraseDelayTimer == 0) { - Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_OC_ABYSS); } } } @@ -1641,8 +1620,7 @@ void FileSelect_EraseAnim2(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode++; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CLOSE); } } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index faf219fd93..d80dd7bc99 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -649,8 +649,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { if (this->configMode == CM_NAME_ENTRY) { if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); // place cursor on END button this->kbdY = 5; this->kbdX = 4; @@ -661,8 +660,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } else { this->newFileNameCharCount--; @@ -675,8 +673,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } } else { @@ -695,18 +692,12 @@ void FileSelect_DrawNameEntry(GameState* thisx) { (gCharPageHira[this->charIndex] == FILENAME_HANDAKUTEN)) { if (!FileSelect_ApplyDiacriticToFilename(&this->state, gCharPageHira[this->charIndex])) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); this->fileNames[this->buttonIndex][this->newFileNameCharCount] = gCharPageHira[this->charIndex]; this->newFileNameCharCount++; @@ -724,18 +715,12 @@ void FileSelect_DrawNameEntry(GameState* thisx) { (gCharPageHira[this->charIndex] == FILENAME_HANDAKUTEN)) { if (!FileSelect_ApplyDiacriticToFilename(&this->state, gCharPageHira[this->charIndex])) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); this->fileNames[this->buttonIndex][this->newFileNameCharCount] = gCharPageKata[this->charIndex]; this->newFileNameCharCount++; @@ -751,9 +736,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { font->fontBuf + gCharPageEng[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); this->fileNames[this->buttonIndex][this->newFileNameCharCount] = gCharPageEng[this->charIndex]; this->newFileNameCharCount++; @@ -770,24 +753,21 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } else { this->charPage = FS_CHAR_PAGE_ENG_TO_HIRA; } - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } else if (this->kbdButton == FS_KBD_BTN_KATA) { if (this->charPage == FS_CHAR_PAGE_HIRA) { this->charPage = FS_CHAR_PAGE_HIRA_TO_KATA; } else { this->charPage = FS_CHAR_PAGE_ENG_TO_KATA; } - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } else if (this->kbdButton == FS_KBD_BTN_ENG) { if (this->charPage == FS_CHAR_PAGE_HIRA) { this->charPage = FS_CHAR_PAGE_HIRA_TO_ENG; } else { this->charPage = FS_CHAR_PAGE_KATA_TO_ENG; } - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } else { if (this->kbdButton == FS_KBD_BTN_BACKSPACE) { if ((this->newFileNameCharCount == 7) && @@ -797,9 +777,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } else { this->newFileNameCharCount--; @@ -812,9 +790,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } else if (this->kbdButton == FS_KBD_BTN_END) { validName = false; @@ -827,9 +803,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } if (validName) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); gSaveContext.fileNum = this->buttonIndex; dayTime = ((void)0, gSaveContext.save.dayTime); Sram_InitSave(this, &this->sramCtx); @@ -839,25 +813,21 @@ void FileSelect_DrawNameEntry(GameState* thisx) { this->connectorAlpha[this->buttonIndex] = 255; Rumble_Request(300.0f, 180, 20, 100); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } } } if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->newFileNameCharCount++; if (this->newFileNameCharCount > 7) { this->newFileNameCharCount = 7; } } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->newFileNameCharCount--; if (this->newFileNameCharCount < 0) { @@ -865,8 +835,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } } else if (CHECK_BTN_ALL(input->press.button, BTN_Z)) { if (FileSelect_ApplyDiacriticToFilename(&this->state, FILENAME_SPACE)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } #else @@ -880,8 +849,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { font->fontBuf + gCharPageEng[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); this->fileNames[this->buttonIndex][this->newFileNameCharCount] = gCharPageEng[this->charIndex]; this->newFileNameCharCount++; @@ -898,9 +866,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } else { this->newFileNameCharCount--; @@ -913,9 +879,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } this->fileNames[this->buttonIndex][i] = FILENAME_SPACE; - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_S); } } else if (this->kbdButton == FS_KBD_BTN_END) { validName = false; @@ -928,9 +892,7 @@ void FileSelect_DrawNameEntry(GameState* thisx) { } if (validName) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); gSaveContext.fileNum = this->buttonIndex; dayTime = ((void)0, gSaveContext.save.dayTime); Sram_InitSave(this, &this->sramCtx); @@ -940,23 +902,20 @@ void FileSelect_DrawNameEntry(GameState* thisx) { this->connectorAlpha[this->buttonIndex] = 255; Rumble_Request(300.0f, 180, 20, 100); } else { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_ERROR); } } } if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->newFileNameCharCount++; if (this->newFileNameCharCount > 7) { this->newFileNameCharCount = 7; } } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->newFileNameCharCount--; if (this->newFileNameCharCount < 0) { @@ -1020,16 +979,13 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { if (gSaveContext.language == LANGUAGE_JPN) { if (this->charPage == FS_CHAR_PAGE_HIRA) { this->charPage = FS_CHAR_PAGE_HIRA_TO_KATA; - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } else if (this->charPage == FS_CHAR_PAGE_KATA) { this->charPage = FS_CHAR_PAGE_KATA_TO_ENG; - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } else if (this->charPage == FS_CHAR_PAGE_ENG) { this->charPage = FS_CHAR_PAGE_ENG_TO_HIRA; - Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN); } } } else { @@ -1037,8 +993,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { if (this->kbdY != 5) { if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->charIndex--; this->kbdX--; if (this->kbdX < 0) { @@ -1046,8 +1001,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { this->charIndex = this->kbdY * 13 + this->kbdX; } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->charIndex++; this->kbdX++; if (this->kbdX >= 13) { @@ -1057,15 +1011,13 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } else if (gSaveContext.language == LANGUAGE_JPN) { if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX--; if (this->kbdX < 0) { this->kbdX = 4; } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX++; if (this->kbdX >= 5) { this->kbdX = 0; @@ -1073,15 +1025,13 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } else { if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX--; if (this->kbdX < 3) { this->kbdX = 4; } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX++; if (this->kbdX >= 5) { this->kbdX = 3; @@ -1090,8 +1040,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } if (this->stickAdjY > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdY--; if (this->kbdY < 0) { if (gSaveContext.language == LANGUAGE_JPN) { @@ -1138,8 +1087,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } } else if (this->stickAdjY < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdY++; if (this->kbdY >= 6) { @@ -1207,8 +1155,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { if (this->kbdY != 5) { if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->charIndex--; this->kbdX--; if (this->kbdX < 0) { @@ -1216,8 +1163,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { this->charIndex = this->kbdY * 13 + this->kbdX; } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->charIndex++; this->kbdX++; if (this->kbdX >= 13) { @@ -1227,15 +1173,13 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } else { if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX--; if (this->kbdX < 3) { this->kbdX = 4; } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdX++; if (this->kbdX >= 5) { this->kbdX = 3; @@ -1244,8 +1188,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } if (this->stickAdjY > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdY--; if (this->kbdY < 0) { // don't go to bottom row @@ -1273,8 +1216,7 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { } } } else if (this->stickAdjY < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); this->kbdY++; if (this->kbdY >= 6) { @@ -1352,8 +1294,7 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { Input* input = &this->state.input[0]; if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); this->configMode = CM_OPTIONS_TO_MAIN; sramCtx->readBuff[0] = gSaveContext.soundSetting; sramCtx->readBuff[1] = gSaveContext.zTargetSetting; @@ -1375,8 +1316,7 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { } if (this->stickAdjX < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (sSelectedSetting == FS_SETTING_AUDIO) { gSaveContext.soundSetting--; @@ -1400,8 +1340,7 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { #endif } } else if (this->stickAdjX > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); if (sSelectedSetting == FS_SETTING_AUDIO) { gSaveContext.soundSetting++; @@ -1427,32 +1366,27 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { #if !OOT_PAL_N64 if ((this->stickAdjY < -30) || (this->stickAdjY > 30)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); sSelectedSetting ^= 1; } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); sSelectedSetting ^= 1; } #else if (this->stickAdjY < -30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); sSelectedSetting++; if (sSelectedSetting >= FS_SETTING_MAX) { sSelectedSetting = 0; } } else if (this->stickAdjY > 30) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_CURSOR); sSelectedSetting--; if (sSelectedSetting >= FS_SETTING_MAX) { sSelectedSetting = FS_SETTING_MAX - 1; } } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_FSEL_DECIDE_L); sSelectedSetting++; if (sSelectedSetting >= FS_SETTING_MAX) { sSelectedSetting = 0; diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index 329af45f22..cb751c32ed 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -387,15 +387,13 @@ void MapSelect_UpdateMenu(MapSelectState* this) { if (this->timerUp == 0) { this->timerUp = 20; this->lockUp = true; - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = R_UPDATE_RATE; } } if (CHECK_BTN_ALL(input->cur.button, BTN_DUP) && this->timerUp == 0) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = R_UPDATE_RATE * 3; } @@ -406,27 +404,23 @@ void MapSelect_UpdateMenu(MapSelectState* this) { if (this->timerDown == 0) { this->timerDown = 20; this->lockDown = true; - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = -R_UPDATE_RATE; } } if (CHECK_BTN_ALL(input->cur.button, BTN_DDOWN) && (this->timerDown == 0)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = -R_UPDATE_RATE * 3; } if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT) || CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = R_UPDATE_RATE; } if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT) || CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) { - Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_IT_SWORD_IMPACT); this->verticalInput = -R_UPDATE_RATE; } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 87a30a53b5..78dcccb573 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -252,8 +252,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { // if the cursor point changed if (pauseCtx->cursorPoint[PAUSE_QUEST] != prevCursorPoint) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } // Update cursor item and slot @@ -351,8 +350,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { cursorItem = ITEM_STONE_OF_AGONY - QUEST_STONE_OF_AGONY + pauseCtx->cursorPoint[PAUSE_QUEST]; @@ -373,8 +371,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; KaleidoScope_SetCursorPos(pauseCtx, cursor * 4, pauseCtx->questVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { // Only the first if may be reached, as QUEST_MEDALLION_FOREST is set above diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 1f573ca3e3..1ac3237125 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -377,8 +377,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); cursorPoint = cursorX = cursorY = 0; while (true) { @@ -424,8 +423,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (pauseCtx->stickAdjX < -30) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); cursorPoint = cursorX = 3; cursorY = 0; @@ -574,21 +572,18 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Interface_LoadItemIcon1(play, 0); } - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); // Wait 10 frames before accepting input again pauseCtx->mainState = PAUSE_MAIN_STATE_EQUIP_CHANGED; sEquipTimer = 10; } else { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); } } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_EQUIP]) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_CHANGED) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index eb4d7e3c7a..7e23b361dc 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -257,8 +257,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); cursorPoint = cursorX = cursorY = 0; while (true) { @@ -288,8 +287,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); cursorPoint = cursorX = ITEM_GRID_COLS - 1; cursorY = 0; @@ -416,20 +414,16 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { if (pauseCtx->equipTargetItem == ITEM_ARROW_LIGHT) { index = 2; } - Audio_PlaySfxGeneral(NA_SE_SY_SET_FIRE_ARROW + index, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_SET_FIRE_ARROW + index); pauseCtx->equipTargetItem = 0xBF + index; sEquipState = 0; pauseCtx->equipAnimAlpha = 0; sEquipMoveTimer = 6; } else { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); } } else { - Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_ERROR); } } } @@ -445,8 +439,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_ITEM]) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { //! @bug cursorSlot is uninitialized @@ -568,8 +561,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { WREG(90) = 320; WREG(87) = WREG(91); sEquipState++; - Audio_PlaySfxGeneral(NA_SE_SY_SYNTH_MAGIC_ARROW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_SYNTH_MAGIC_ARROW); } return; } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index 00c57579b0..cf2b225afe 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -164,8 +164,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorX[PAUSE_MAP] = 0; j = (pauseCtx->cursorSlot[PAUSE_MAP] + 18) * 4; KaleidoScope_SetCursorPos(pauseCtx, j, pauseCtx->mapPageVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } else { if (pauseCtx->stickAdjX < -30) { @@ -195,14 +194,12 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { PRINTF("kscope->cursor_point====%d\n", pauseCtx->cursorPoint[PAUSE_MAP]); j = (pauseCtx->cursorSlot[PAUSE_MAP] + 18) * 4; KaleidoScope_SetCursorPos(pauseCtx, j, pauseCtx->mapPageVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_MAP]) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } @@ -607,8 +604,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSlot[PAUSE_MAP] = PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); D_8082A6D4 = 0; } } else { @@ -625,8 +621,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSlot[PAUSE_MAP] = PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); D_8082A6D4 = 0; } } @@ -637,8 +632,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); } } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index 265a122116..71f4a71a9c 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -19,12 +19,10 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { (pauseCtx->state == PAUSE_STATE_GAME_OVER_CONTINUE_PROMPT)) { if ((pauseCtx->promptChoice == 0) && (stickAdjX >= 30)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); pauseCtx->promptChoice = 4; } else if ((pauseCtx->promptChoice != 0) && (stickAdjX <= -30)) { - Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_CURSOR); pauseCtx->promptChoice = 0; } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 84b7687bb4..99a0b5ff5f 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1020,8 +1020,7 @@ void KaleidoScope_MoveCursorToSpecialPos(PlayState* play, u16 specialPos) { pauseCtx->cursorSpecialPos = specialPos; pauseCtx->pageSwitchInputTimer = 0; - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); } void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point) { @@ -1078,13 +1077,11 @@ void KaleidoScope_SetupPageSwitch(PauseContext* pauseCtx, u8 pt) { if (!pt) { // PAGE_SWITCH_PT_LEFT pauseCtx->nextPageMode = pauseCtx->pageIndex * 2 + 1; - Audio_PlaySfxGeneral(NA_SE_SY_WIN_SCROLL_LEFT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_SCROLL_LEFT); pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT; } else { // PAGE_SWITCH_PT_RIGHT pauseCtx->nextPageMode = pauseCtx->pageIndex * 2; - Audio_PlaySfxGeneral(NA_SE_SY_WIN_SCROLL_RIGHT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_WIN_SCROLL_RIGHT); pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT; } @@ -4095,8 +4092,7 @@ void KaleidoScope_Update(PlayState* play) { } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { pauseCtx->nextPageMode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4143,8 +4139,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->nextPageMode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4154,16 +4149,14 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->state = PAUSE_STATE_SAVE_PROMPT; } else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIdx) { // The player successfully played the song - Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_TRE_BOX_APPEAR); sMainStateAfterSongPlayerPlayingDone = PAUSE_MAIN_STATE_IDLE; sDelayTimer = 30; pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_DONE; } else if (pauseCtx->ocarinaStaff->state == 0xFF) { // The player failed to play the song - Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_OCARINA_ERROR); sMainStateAfterSongPlayerPlayingDone = PAUSE_MAIN_STATE_SONG_PROMPT_INIT; sDelayTimer = 20; @@ -4197,8 +4190,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->nextPageMode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4246,9 +4238,7 @@ void KaleidoScope_Update(PlayState* play) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); #endif } else { - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); Play_SaveSceneFlags(play); gSaveContext.save.info.playerData.savedSceneId = play->sceneId; Sram_WriteSave(&play->sramCtx); @@ -4506,13 +4496,11 @@ void KaleidoScope_Update(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_A)) { if (pauseCtx->promptChoice != 0) { pauseCtx->promptChoice = 0; - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); pauseCtx->state = PAUSE_STATE_GAME_OVER_CONTINUE_PROMPT; gameOverCtx->state++; } else { - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); pauseCtx->promptChoice = 0; Play_SaveSceneFlags(play); gSaveContext.save.info.playerData.savedSceneId = play->sceneId; @@ -4543,8 +4531,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_STATE_GAME_OVER_CONTINUE_PROMPT: if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { if (pauseCtx->promptChoice == 0) { - Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART); Play_SaveSceneFlags(play); switch (gSaveContext.save.entranceIndex) { @@ -4602,8 +4589,7 @@ void KaleidoScope_Update(PlayState* play) { break; } } else { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + SFX_PLAY_CENTERED(NA_SE_SY_DECIDE); } pauseCtx->state = PAUSE_STATE_GAME_OVER_FINISH; From fc2992abf60904fbc026da84c574068e7fea7b4d Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 16 Jun 2025 13:13:31 +0200 Subject: [PATCH 9/9] Pause docs: misc docs (#2636) * doc `KaleidoScope_SetCursorPos` * doc bug in `KaleidoScope_DrawWorldMap` * fix anonymous enum * `D_808321A8` -> `sSavedButtonStatus` * s16 decimal for `sVtxPageMapDungeonQuads``X/Y/Width/Height` * Use `LANGUAGE_` enum for indexing language-indexed regs --- src/code/z_construct.c | 130 +++++++++--------- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 7 + .../misc/ovl_kaleido_scope/z_kaleido_map.c | 6 + .../misc/ovl_kaleido_scope/z_kaleido_scope.c | 36 +++-- 4 files changed, 94 insertions(+), 85 deletions(-) diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 0f737145e1..26d5d092ad 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -270,18 +270,18 @@ void Regs_InitDataImpl(void) { YREG(47) = 0; #if OOT_NTSC - R_KALEIDO_UNK1(0) = -45; - R_KALEIDO_UNK1(1) = -48; - R_KALEIDO_UNK2(0) = 16; - R_KALEIDO_UNK2(1) = 22; - R_KALEIDO_UNK3(0) = -55; - R_KALEIDO_UNK3(1) = -53; - R_KALEIDO_UNK4(0) = 43; - R_KALEIDO_UNK4(1) = 47; - R_KALEIDO_UNK5(0) = -33; - R_KALEIDO_UNK5(1) = -42; - R_KALEIDO_UNK6(0) = -33; - R_KALEIDO_UNK6(1) = -37; + R_KALEIDO_UNK1(LANGUAGE_JPN) = -45; + R_KALEIDO_UNK1(LANGUAGE_ENG) = -48; + R_KALEIDO_UNK2(LANGUAGE_JPN) = 16; + R_KALEIDO_UNK2(LANGUAGE_ENG) = 22; + R_KALEIDO_UNK3(LANGUAGE_JPN) = -55; + R_KALEIDO_UNK3(LANGUAGE_ENG) = -53; + R_KALEIDO_UNK4(LANGUAGE_JPN) = 43; + R_KALEIDO_UNK4(LANGUAGE_ENG) = 47; + R_KALEIDO_UNK5(LANGUAGE_JPN) = -33; + R_KALEIDO_UNK5(LANGUAGE_ENG) = -42; + R_KALEIDO_UNK6(LANGUAGE_JPN) = -33; + R_KALEIDO_UNK6(LANGUAGE_ENG) = -37; #else // Same as above, although these regs are now unused for PAL versions YREG(48) = -45; @@ -369,24 +369,24 @@ void Regs_InitDataImpl(void) { ZREG(47) = 1; #if OOT_NTSC - R_START_LABEL_DD(0) = 86; - R_START_LABEL_DD(1) = 100; + R_START_LABEL_DD(LANGUAGE_JPN) = 86; + R_START_LABEL_DD(LANGUAGE_ENG) = 100; R_START_LABEL_WIDTH = 0; R_START_LABEL_HEIGHT = 0; - R_START_LABEL_Y(0) = 21; - R_START_LABEL_Y(1) = 20; - R_START_LABEL_X(0) = 122; - R_START_LABEL_X(1) = 120; + R_START_LABEL_Y(LANGUAGE_JPN) = 21; + R_START_LABEL_Y(LANGUAGE_ENG) = 20; + R_START_LABEL_X(LANGUAGE_JPN) = 122; + R_START_LABEL_X(LANGUAGE_ENG) = 120; #else - R_START_LABEL_DD(0) = 100; - R_START_LABEL_DD(1) = 89; - R_START_LABEL_DD(2) = 92; - R_START_LABEL_Y(0) = 20; - R_START_LABEL_Y(1) = 20; - R_START_LABEL_Y(2) = 20; - R_START_LABEL_X(0) = 120; - R_START_LABEL_X(1) = 119; - R_START_LABEL_X(2) = 119; + R_START_LABEL_DD(LANGUAGE_ENG) = 100; + R_START_LABEL_DD(LANGUAGE_GER) = 89; + R_START_LABEL_DD(LANGUAGE_FRA) = 92; + R_START_LABEL_Y(LANGUAGE_ENG) = 20; + R_START_LABEL_Y(LANGUAGE_GER) = 20; + R_START_LABEL_Y(LANGUAGE_FRA) = 20; + R_START_LABEL_X(LANGUAGE_ENG) = 120; + R_START_LABEL_X(LANGUAGE_GER) = 119; + R_START_LABEL_X(LANGUAGE_FRA) = 119; #endif R_PAUSE_QUEST_MEDALLION_SHINE_TIME(0) = 1; @@ -528,14 +528,14 @@ void Regs_InitDataImpl(void) { WREG(7) = 0; #if OOT_NTSC - R_B_LABEL_SCALE(0) = 100; - R_B_LABEL_SCALE(1) = 109; - R_B_LABEL_X(0) = 151; - R_B_LABEL_X(1) = 148; - R_B_LABEL_Y(0) = 23; - R_B_LABEL_Y(1) = 22; - R_A_LABEL_Z(0) = -380; - R_A_LABEL_Z(1) = -350; + R_B_LABEL_SCALE(LANGUAGE_JPN) = 100; + R_B_LABEL_SCALE(LANGUAGE_ENG) = 109; + R_B_LABEL_X(LANGUAGE_JPN) = 151; + R_B_LABEL_X(LANGUAGE_ENG) = 148; + R_B_LABEL_Y(LANGUAGE_JPN) = 23; + R_B_LABEL_Y(LANGUAGE_ENG) = 22; + R_A_LABEL_Z(LANGUAGE_JPN) = -380; + R_A_LABEL_Z(LANGUAGE_ENG) = -350; #else // Same as above, although these regs are now unused in PAL versions WREG(8) = 100; @@ -570,36 +570,36 @@ void Regs_InitDataImpl(void) { WREG(36) = 0; #if OOT_PAL - R_B_LABEL_SCALE(0) = 100; - R_B_LABEL_SCALE(1) = 99; - R_B_LABEL_SCALE(2) = 109; - R_B_LABEL_X(0) = B_BUTTON_X - 9; - R_B_LABEL_X(1) = B_BUTTON_X - 11; - R_B_LABEL_X(2) = B_BUTTON_X - 12; - R_B_LABEL_Y(0) = B_BUTTON_Y + 6; - R_B_LABEL_Y(1) = B_BUTTON_Y + 5; - R_B_LABEL_Y(2) = B_BUTTON_Y + 5; - R_A_LABEL_Z(0) = -380; - R_A_LABEL_Z(1) = -360; - R_A_LABEL_Z(2) = -350; - R_KALEIDO_UNK1(0) = -48; - R_KALEIDO_UNK1(1) = 16; - R_KALEIDO_UNK1(2) = -62; - R_KALEIDO_UNK2(0) = 22; - R_KALEIDO_UNK2(1) = -84; - R_KALEIDO_UNK2(2) = 20; - R_KALEIDO_UNK3(0) = -53; - R_KALEIDO_UNK3(1) = 40; - R_KALEIDO_UNK3(2) = -64; - R_KALEIDO_UNK4(0) = 47; - R_KALEIDO_UNK4(1) = -84; - R_KALEIDO_UNK4(2) = 44; - R_KALEIDO_UNK5(0) = -42; - R_KALEIDO_UNK5(1) = 32; - R_KALEIDO_UNK5(2) = -45; - R_KALEIDO_UNK6(0) = -37; - R_KALEIDO_UNK6(1) = 30; - R_KALEIDO_UNK6(2) = -50; + R_B_LABEL_SCALE(LANGUAGE_ENG) = 100; + R_B_LABEL_SCALE(LANGUAGE_GER) = 99; + R_B_LABEL_SCALE(LANGUAGE_FRA) = 109; + R_B_LABEL_X(LANGUAGE_ENG) = B_BUTTON_X - 9; + R_B_LABEL_X(LANGUAGE_GER) = B_BUTTON_X - 11; + R_B_LABEL_X(LANGUAGE_FRA) = B_BUTTON_X - 12; + R_B_LABEL_Y(LANGUAGE_ENG) = B_BUTTON_Y + 6; + R_B_LABEL_Y(LANGUAGE_GER) = B_BUTTON_Y + 5; + R_B_LABEL_Y(LANGUAGE_FRA) = B_BUTTON_Y + 5; + R_A_LABEL_Z(LANGUAGE_ENG) = -380; + R_A_LABEL_Z(LANGUAGE_GER) = -360; + R_A_LABEL_Z(LANGUAGE_FRA) = -350; + R_KALEIDO_UNK1(LANGUAGE_ENG) = -48; + R_KALEIDO_UNK1(LANGUAGE_GER) = 16; + R_KALEIDO_UNK1(LANGUAGE_FRA) = -62; + R_KALEIDO_UNK2(LANGUAGE_ENG) = 22; + R_KALEIDO_UNK2(LANGUAGE_GER) = -84; + R_KALEIDO_UNK2(LANGUAGE_FRA) = 20; + R_KALEIDO_UNK3(LANGUAGE_ENG) = -53; + R_KALEIDO_UNK3(LANGUAGE_GER) = 40; + R_KALEIDO_UNK3(LANGUAGE_FRA) = -64; + R_KALEIDO_UNK4(LANGUAGE_ENG) = 47; + R_KALEIDO_UNK4(LANGUAGE_GER) = -84; + R_KALEIDO_UNK4(LANGUAGE_FRA) = 44; + R_KALEIDO_UNK5(LANGUAGE_ENG) = -42; + R_KALEIDO_UNK5(LANGUAGE_GER) = 32; + R_KALEIDO_UNK5(LANGUAGE_FRA) = -45; + R_KALEIDO_UNK6(LANGUAGE_ENG) = -37; + R_KALEIDO_UNK6(LANGUAGE_GER) = 30; + R_KALEIDO_UNK6(LANGUAGE_FRA) = -50; #endif R_DGN_MINIMAP_X = 204; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 7e23b361dc..a1dda57997 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -110,7 +110,14 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, CLOSE_DISPS(gfxCtx, "../z_kaleido_item.c", 116); } +/** + * Set the cursor to the position of `vtx[index]`. + * The position indicates the cursor's top-left. + * + * @see KaleidoScope_UpdateCursorVtx where this position is used to update all cursor quads. + */ void KaleidoScope_SetCursorPos(PauseContext* pauseCtx, u16 index, Vtx* vtx) { + // PAUSE_QUAD_CURSOR_TL pauseCtx->cursorVtx[0].v.ob[0] = vtx[index].v.ob[0]; pauseCtx->cursorVtx[0].v.ob[1] = vtx[index].v.ob[1]; } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index cf2b225afe..f454594b4d 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -589,7 +589,13 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { PAGE_BG_QUADS + WORLD_MAP_QUAD_POINT_FIRST + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); } else { + + //! @bug This causes a weird DMA request in `KaleidoScope_UpdateNamePanel`, + //! either for unintended data or outside the intended segment. + // This isn't a visual issue in practice because drawing the texture loaded in + // `KaleidoScope_UpdateNamePanel` is only done under `cursorSpecialPos == 0`. pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18; + if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if (pauseCtx->stickAdjX > 30) { pauseCtx->cursorSpecialPos = 0; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 99a0b5ff5f..97fd16e709 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -63,7 +63,7 @@ #define KALEIDO_COLOR_CURSOR_UNK_B 50 #endif -typedef enum { +typedef enum VtxPageInit { /* 0 */ VTX_PAGE_ITEM, /* 1 */ VTX_PAGE_EQUIP, /* 2 */ VTX_PAGE_MAP_DUNGEON, @@ -932,7 +932,7 @@ static void* sPromptChoiceTexs[][2] = { //! non-static, but we make it static here to match the bss order and patch the relocation section later in the build //! as our relocation generator does count COMMON symbols. -static u8 D_808321A8[5]; +static u8 sSavedButtonStatus[5]; static PreRender sPlayerPreRender; void* sPreRenderCvg; @@ -2256,8 +2256,7 @@ static u8 sPageBgColorBlue[][4] = { static s16 sVtxPageItemQuadsX[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; static s16 sVtxPageEquipQuadsX[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; static s16 sVtxPageMapDungeonQuadsX[VTX_PAGE_MAP_DUNGEON_QUADS] = { - 0xFFDC, 0x000C, 0xFFEE, 0x0046, 0x0046, 0x0046, 0xFFA8, 0xFFA8, 0xFFA8, - 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFFA8, 0xFF96, 0xFFC2, 0xFFD8, + -36, 12, -18, 70, 70, 70, -88, -88, -88, -88, -88, -88, -88, -88, -106, -62, -40, }; static s16 sVtxPageQuestQuadsX[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; static s16 sVtxPageMapWorldQuadsX[VTX_PAGE_MAP_WORLD_QUADS] = { @@ -2304,8 +2303,7 @@ static s16 sVtxPagePromptQuadsX[VTX_PAGE_PROMPT_QUADS] = { static s16 sVtxPageItemQuadsWidth[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; static s16 sVtxPageEquipQuadsWidth[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; static s16 sVtxPageMapDungeonQuadsWidth[VTX_PAGE_MAP_DUNGEON_QUADS] = { - 0x0030, 0x0030, 0x0060, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0010, 0x0010, 0x0018, + 48, 48, 96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 16, 16, 24, }; static s16 sVtxPageQuestQuadsWidth[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; static s16 sVtxPagePromptQuadsWidth[VTX_PAGE_PROMPT_QUADS] = { @@ -2318,8 +2316,7 @@ static s16 sVtxPagePromptQuadsWidth[VTX_PAGE_PROMPT_QUADS] = { static s16 sVtxPageItemQuadsY[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; static s16 sVtxPageEquipQuadsY[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; static s16 sVtxPageMapDungeonQuadsY[VTX_PAGE_MAP_DUNGEON_QUADS] = { - 0x001C, 0x001C, 0x002E, 0x001C, 0xFFFE, 0xFFE0, 0x0032, 0x0024, 0x0016, - 0x0008, 0xFFFA, 0xFFEC, 0xFFDE, 0xFFD0, 0x0012, 0x0012, 0x0032, + 28, 28, 46, 28, -2, -32, 50, 36, 22, 8, -6, -20, -34, -48, 18, 18, 50, }; static s16 sVtxPageQuestQuadsY[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; static s16 sVtxPageMapWorldQuadsY[VTX_PAGE_MAP_WORLD_QUADS] = { @@ -2366,8 +2363,7 @@ static s16 sVtxPagePromptQuadsY[VTX_PAGE_PROMPT_QUADS] = { static s16 sVtxPageItemQuadsHeight[CLAMP_MIN(VTX_PAGE_ITEM_QUADS, 1)] = { 0 }; static s16 sVtxPageEquipQuadsHeight[CLAMP_MIN(VTX_PAGE_EQUIP_QUADS, 1)] = { 0 }; static s16 sVtxPageMapDungeonQuadsHeight[VTX_PAGE_MAP_DUNGEON_QUADS] = { - 0x0055, 0x0055, 0x0010, 0x0018, 0x0018, 0x0018, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0018, + 85, 85, 16, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, }; static s16 sVtxPageQuestQuadsHeight[CLAMP_MIN(VTX_PAGE_QUEST_QUADS, 1)] = { 0 }; static s16 sVtxPagePromptQuadsHeight[VTX_PAGE_PROMPT_QUADS] = { @@ -3669,11 +3665,11 @@ void KaleidoScope_Update(PlayState* play) { switch (pauseCtx->state) { case PAUSE_STATE_INIT: - D_808321A8[0] = gSaveContext.buttonStatus[0]; - D_808321A8[1] = gSaveContext.buttonStatus[1]; - D_808321A8[2] = gSaveContext.buttonStatus[2]; - D_808321A8[3] = gSaveContext.buttonStatus[3]; - D_808321A8[4] = gSaveContext.buttonStatus[4]; + sSavedButtonStatus[0] = gSaveContext.buttonStatus[0]; + sSavedButtonStatus[1] = gSaveContext.buttonStatus[1]; + sSavedButtonStatus[2] = gSaveContext.buttonStatus[2]; + sSavedButtonStatus[3] = gSaveContext.buttonStatus[3]; + sSavedButtonStatus[4] = gSaveContext.buttonStatus[4]; pauseCtx->cursorX[PAUSE_MAP] = 0; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot = @@ -4691,11 +4687,11 @@ void KaleidoScope_Update(PlayState* play) { break; } - gSaveContext.buttonStatus[0] = D_808321A8[0]; - gSaveContext.buttonStatus[1] = D_808321A8[1]; - gSaveContext.buttonStatus[2] = D_808321A8[2]; - gSaveContext.buttonStatus[3] = D_808321A8[3]; - gSaveContext.buttonStatus[4] = D_808321A8[4]; + gSaveContext.buttonStatus[0] = sSavedButtonStatus[0]; + gSaveContext.buttonStatus[1] = sSavedButtonStatus[1]; + gSaveContext.buttonStatus[2] = sSavedButtonStatus[2]; + gSaveContext.buttonStatus[3] = sSavedButtonStatus[3]; + gSaveContext.buttonStatus[4] = sSavedButtonStatus[4]; interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; PRINTF_COLOR_YELLOW(); PRINTF("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode);