1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Match func_800EEA50 + some surrounding doc (#916)

* Match func_800EEA50

* Document some audio debug stuff

* more doc

* more doc

* formatting

* Fix enums, and some more bits of doc

* review

* LIM -> MAX

* missed review suggestion...

* more review

* ganon comments

* more review

* 🐍☠️

* more review

* Update functions.h

* quotes

* review

Co-authored-by: zelda2774 <zelda2774@invalid>
This commit is contained in:
zelda2774 2021-08-30 02:08:41 +02:00 committed by GitHub
parent 28e72bb486
commit a75c70358c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1562 additions and 5496 deletions

View file

@ -153,9 +153,9 @@ void BgSpot03Taki_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->bufferIndex = this->bufferIndex == 0;
if (this->state > WATERFALL_CLOSED && this->state < WATERFALL_CLOSING) {
func_800F46E0(&this->dyna.actor.projectedPos, 0.5f);
if (this->state >= WATERFALL_OPENING_IDLE && this->state <= WATERFALL_OPENED) {
Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 0.5f);
} else {
func_800F46E0(&this->dyna.actor.projectedPos, 1.0f);
Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 1.0f);
}
}

View file

@ -490,7 +490,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 30.0f;
swingSizeAccel = 60.0f;
if (((this->sfxTimer % 16) == 0) && (this->timers[0] < 30)) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0);
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
}
} else if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SHAKE) {
if (this->timers[0] > 40) {
@ -503,7 +503,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 30.0f;
swingSizeAccel = 60.0f;
if ((this->sfxTimer % 32) == 0) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0);
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
func_800AA000(0, 100, 5, 2);
func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
}
@ -517,7 +517,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 70.0f;
swingSizeAccel = 70.0f;
if ((this->sfxTimer % 16) == 0) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0);
Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
func_800AA000(0, 160, 5, 4);
func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
}
@ -630,7 +630,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
if ((this->timers[0] == 0) && !HAS_LINK(otherTent)) {
this->work[MO_TENT_ACTION_STATE] = MO_TENT_SWING;
this->timers[0] = 50;
func_800F4BE8();
Audio_ResetIncreasingTranspose();
this->attackAngleMod = Rand_CenteredFloat(0x1000);
}
} else {
@ -772,7 +772,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
this->timers[0] = 150;
this->mashCounter = 0;
this->sfxTimer = 30;
func_800F4BE8();
Audio_ResetIncreasingTranspose();
func_80064520(globalCtx, &globalCtx->csCtx);
this->csCamera = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);

View file

@ -50,8 +50,8 @@ typedef enum {
/* 7 */ MO_CORE_FLOAT_MAX
} BossMoCoreF32Var;
#define MO_SHORT_MAX MAX(MO_TENT_SHORT_MAX, MO_CORE_SHORT_MAX)
#define MO_FLOAT_MAX MAX(MO_TENT_FLOAT_MAX, MO_CORE_FLOAT_MAX)
#define MO_SHORT_MAX MAX((s32)MO_TENT_SHORT_MAX, (s32)MO_CORE_SHORT_MAX)
#define MO_FLOAT_MAX MAX((s32)MO_TENT_FLOAT_MAX, (s32)MO_CORE_FLOAT_MAX)
typedef struct BossMo {
/* 0x0000 */ Actor actor;

View file

@ -176,7 +176,7 @@ static f32 sGrowingScale[] = {
270.0f,
};
static u8 sPitchSmallFrog[] = {
static u8 sSmallFrogNotes[] = {
5, // C-Down Ocarina
2, // A Button Ocarina
9, // C-Right Ocarina
@ -184,7 +184,7 @@ static u8 sPitchSmallFrog[] = {
14, // C Up Ocarina
};
static s8 sPitchLargeFrog[] = {
static s8 sLargeFrogNotes[] = {
-7, // C-Down Ocarina
-10, // A Button Ocarina
-3, // C-Right Ocarina
@ -583,15 +583,15 @@ void EnFr_UpdateActive(Actor* thisx, GlobalContext* globalCtx) {
s32 EnFr_SetupJumpingUp(EnFr* this, s32 frogIndex) {
EnFr* frog = sEnFrPointers.frogs[frogIndex];
u8 audioPitch;
u8 semitone;
if (frog != NULL && frog->isJumpingUp == false) {
audioPitch = frog->growingScaleIndex == 3 ? sPitchLargeFrog[frogIndex] : sPitchSmallFrog[frogIndex];
semitone = frog->growingScaleIndex == 3 ? sLargeFrogNotes[frogIndex] : sSmallFrogNotes[frogIndex];
if (this->songIndex == FROG_CHOIR_SONG) {
frog->isJumpingToFrogSong = true;
}
frog->isJumpingUp = true;
func_800F4BF4(&frog->actor.projectedPos, NA_SE_EV_FROG_JUMP, (s8)audioPitch);
Audio_PlaySoundTransposed(&frog->actor.projectedPos, NA_SE_EV_FROG_JUMP, semitone);
return true;
} else {
return false;

View file

@ -85,19 +85,19 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->type = (this->actor.params >> 0xC) & 0xF;
this->switchFlag = this->actor.params & 0x3F;
this->numEffects = ARRAY_COUNT(this->effects);
// index
// "index"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type);
// save
// "save"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ\t ☆☆☆☆☆ %x\n" VT_RST, this->switchFlag);
switch (this->type) {
case ENGSWITCH_SILVER_TRACKER:
osSyncPrintf("\n\n");
// parent switch spawn
// "parent switch spawn"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params);
sCollectedCount = 0;
this->silverCount = this->actor.params >> 6;
this->silverCount &= 0x3F;
// maximum number of checks
// "maximum number of checks"
osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount);
osSyncPrintf("\n\n");
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
@ -110,7 +110,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ENGSWITCH_SILVER_RUPEE:
osSyncPrintf("\n\n");
// child switch spawn
// "child switch spawn"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 子スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params);
this->colorIdx = 5;
this->numEffects = 20;
@ -128,7 +128,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ENGSWITCH_ARCHERY_POT:
osSyncPrintf("\n\n");
// Horseback archery destructible pot
// "Horseback archery destructible pot"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめぶち抜き壷 ☆☆☆☆☆ \n" VT_RST);
this->actor.gravity = -3.0f;
this->colorIdx = Rand_ZeroFloat(2.99f);
@ -142,9 +142,9 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->objIndex = Object_GetIndex(&globalCtx->objectCtx, this->objId);
if (this->objIndex < 0) {
Actor_Kill(&this->actor);
// what?
// "what?"
osSyncPrintf(VT_FGCOL(PURPLE) " なにみの? %d\n" VT_RST "\n", this->objIndex);
// bank is funny
// "bank is funny"
osSyncPrintf(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params);
}
this->collider.dim.radius = 24;
@ -208,21 +208,21 @@ void EnGSwitch_WaitForObject(EnGSwitch* this, GlobalContext* globalCtx) {
}
void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, GlobalContext* globalCtx) {
static s8 rupeePitches[] = { 0, 2, 4, 5, 7 };
static s8 majorScale[] = { 0, 2, 4, 5, 7 };
if (this->pitchIndex < sCollectedCount) {
if (this->noteIndex < sCollectedCount) {
if (sCollectedCount < 5) {
// sound?
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->pitchIndex);
func_800F4BF4(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, rupeePitches[this->pitchIndex]);
this->pitchIndex = sCollectedCount;
// "sound?"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->noteIndex);
Audio_PlaySoundTransposed(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]);
this->noteIndex = sCollectedCount;
}
}
if (sCollectedCount >= this->silverCount) {
// It is now the end of the century.
// "It is now the end of the century."
// This another reference to Hokuto no Ken.
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 時はまさに世紀末〜 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
// Last!
// "Last!"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ らすとぉ! ☆☆☆☆☆ \n" VT_RST);
if ((globalCtx->sceneNum == SCENE_MEN) && (this->actor.room == 2)) {
Flags_SetTempClear(globalCtx, this->actor.room);
@ -346,7 +346,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) {
gallery->targetState[this->index] = ENSYATEKIHIT_HIT;
func_80078884(NA_SE_EV_HIT_SOUND);
func_80078884(NA_SE_SY_GET_RUPY);
// Yeah !
// "Yeah !"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ いぇぇーす!HIT!! ☆☆☆☆☆ %d\n" VT_RST, gallery->hitCount);
EnGSwitch_Break(this, globalCtx);
this->killTimer = 50;

View file

@ -50,7 +50,7 @@ typedef struct EnGSwitch {
/* 0x0164 */ s16 waitTimer; // time rupee waits before retreating
/* 0x0166 */ s16 moveMode; // Type of movement in the shooting gallery
/* 0x0168 */ s16 moveState; // Appear or retreat (for blue rupees and the stationary green one)
/* 0x016A */ s16 pitchIndex;
/* 0x016A */ s16 noteIndex;
/* 0x016C */ Vec3f targetPos;
/* 0x0178 */ s8 objIndex;
/* 0x017C */ ColliderCylinder collider;

View file

@ -605,7 +605,8 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) {
void func_80A7A304(EnIn* this, GlobalContext* globalCtx) {
if (this->skelAnime.animation == &object_in_Anim_015814 || this->skelAnime.animation == &object_in_Anim_01646C) {
if (this->skelAnime.curFrame == 8.0f) {
func_800F41E0(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0, 2);
Audio_PlaySoundRandom(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0,
NA_SE_VO_IN_LASH_1 - NA_SE_VO_IN_LASH_0 + 1);
}
}
if (this->skelAnime.animation == &object_in_Anim_018C38 && this->skelAnime.curFrame == 20.0f) {

View file

@ -141,7 +141,7 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) {
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) {
if (globalCtx->sceneLoadFlag != 20) {
func_800F68BC(0);
Audio_SetCutsceneFlag(0);
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);

View file

@ -34,7 +34,7 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) {
this->pathIndex = (this->actor.params >> 8) & 0xFF;
this->actor.params = this->actor.params & 0xFF;
if (this->actor.params >= RS_MAX) {
if (this->actor.params >= RS_MAX) { // used for ganon and ganon_boss scenes
func_800F4870(this->actor.params - RS_MAX);
Actor_Kill(&this->actor);
} else if (this->actor.params == RS_UNK_F7) {
@ -51,9 +51,9 @@ void EnRiverSound_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnRiverSound* this = THIS;
if (this->actor.params == RS_SARIAS_SONG) {
func_800F50EC(&this->actor.projectedPos);
Audio_ClearSariaBgmAtPos(&this->actor.projectedPos);
} else if (this->actor.params == RS_UNK_13) {
func_800F5504();
Audio_ClearSariaBgm2();
}
}
@ -236,15 +236,15 @@ void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->playSound = true;
} else if ((this->actor.params == RS_UNK_0) || (this->actor.params == RS_UNK_4) ||
(this->actor.params == RS_UNK_5)) {
func_800F4634(&this->actor.projectedPos, soundPitch[this->soundPitchIndex]);
Audio_PlaySoundRiver(&this->actor.projectedPos, soundPitch[this->soundPitchIndex]);
} else if (this->actor.params == RS_UNK_11) {
func_800F4A54(90);
} else if (this->actor.params == RS_SARIAS_SONG) {
func_800F4E30(&this->actor.projectedPos, this->actor.xzDistToPlayer);
} else if (this->actor.params == RS_UNK_13) {
func_800F52A0(&this->actor.home.pos, 62, 1000);
Audio_PlaySariaBgm(&this->actor.home.pos, 62, 1000);
} else if (this->actor.params == RS_UNK_19) {
func_800F52A0(&this->actor.home.pos, 40, 800);
Audio_PlaySariaBgm(&this->actor.home.pos, 40, 800);
} else if ((this->actor.params == RS_SANDSTORM) || (this->actor.params == RS_CHAMBER_OF_SAGES_1) ||
(this->actor.params == RS_CHAMBER_OF_SAGES_2) || (this->actor.params == RS_RUMBLING)) {
func_800788CC(soundEffects[this->actor.params]);

View file

@ -1443,7 +1443,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
}
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) {
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState =
SKULL_KID_OCARINA_PLAY_NOTES;
@ -1456,7 +1456,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
}
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) {
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
func_80106AA8(globalCtx);
this->songFailTimer = 160;
}
@ -1477,7 +1477,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
break;
case 0x30:
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) {
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState =
SKULL_KID_OCARINA_PLAY_NOTES;

View file

@ -1605,7 +1605,7 @@ void EnZl2_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (thisx->params) {
case 1:
func_800F7260(0x6F);
Audio_SetSoundBanksMute(0x6F);
break;
case 4:
gSaveContext.timer2State = 0;

View file

@ -1018,7 +1018,7 @@ void func_80B55808(EnZl3* this) {
}
void func_80B5582C(EnZl3* this) {
func_800F41E0(&D_80B5A488, NA_SE_VO_Z1_CRY_0, 2);
Audio_PlaySoundRandom(&D_80B5A488, NA_SE_VO_Z1_CRY_0, NA_SE_VO_Z1_CRY_1 - NA_SE_VO_Z1_CRY_0 + 1);
}
void func_80B5585C(EnZl3* this) {

View file

@ -9427,7 +9427,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) {
}
if (this->actor.category == ACTORCAT_PLAYER) {
func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId));
Audio_SetCodeReverb(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId));
if (this->actor.floorBgId == BGCHECK_SCENE) {
func_80074CE8(globalCtx,