diff options
| author | briaguya <briaguya@alice> | 2022-06-17 00:39:07 -0400 |
|---|---|---|
| committer | briaguya <briaguya@alice> | 2022-06-17 00:39:07 -0400 |
| commit | dd42cca2cf69f495b082c1efae05cb11aab3cbcd (patch) | |
| tree | a55684a0d899b440c8f196f5c9ed139bba6c84ae /soh/src | |
| parent | bb90be6748a3ab41dc111b734b904b1e69bd60f7 (diff) | |
| parent | 3e6307bf96ea9167057c484b79a4b738f11c3154 (diff) | |
Merge branch 'develop' into z64-devmerge
Diffstat (limited to 'soh/src')
| -rw-r--r-- | soh/src/code/audio_load.c | 14 | ||||
| -rw-r--r-- | soh/src/code/audio_playback.c | 2 | ||||
| -rw-r--r-- | soh/src/code/z_player_lib.c | 3 | ||||
| -rw-r--r-- | soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 2 | ||||
| -rw-r--r-- | soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 21 | ||||
| -rw-r--r-- | soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 | ||||
| -rw-r--r-- | soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c | 4 |
7 files changed, 33 insertions, 17 deletions
diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 59749dff5..e2633b883 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -585,6 +585,8 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { AudioSeq_SequencePlayerDisable(seqPlayer); fontId = 0xFF; + index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; + numFonts = gAudioContext.sequenceFontTable[index++]; if (gUseLegacySD) { index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; @@ -917,7 +919,6 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo void** ptrs = (void**)mem; - #define BASE_OFFSET(x) (void*)((u32)(x) + (u32)(mem)) reloc2 = ptrs[0]; @@ -1495,6 +1496,7 @@ void AudioLoad_InitSlowLoads(void) { s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* isDone) { SoundFontSample* sample; AudioSlowLoad* slowLoad; + sample = AudioLoad_GetFontSample(fontId, instId); if (sample == NULL) { *isDone = 0; @@ -1654,15 +1656,12 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* isDone) { } seqId = AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId); - seqTable = AudioLoad_GetLoadTable(SEQUENCE_TABLE); - slowLoad = &gAudioContext.slowLoads[gAudioContext.slowLoadPos]; if (slowLoad->status == LOAD_STATUS_DONE) { slowLoad->status = LOAD_STATUS_WAITING; } - slowLoad->sample.sampleAddr = NULL; slowLoad->isDone = isDone; @@ -2075,7 +2074,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { if (preload->isFree == false) { sample = preload->sample; - key = sample->sampleAddr + sample->size + sample->medium; + key = (u32)sample->sampleAddr + sample->size + sample->medium; if (key == preload->endAndMediumKey) { // Change storage for sample to the preloaded version. sample->sampleAddr = preload->ramAddr; @@ -2098,12 +2097,12 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { sample = preload->sample; nChunks = (sample->size >> 12) + 1; - key = sample->sampleAddr + sample->size + sample->medium; + key = (u32)sample->sampleAddr + sample->size + sample->medium; if (key != preload->endAndMediumKey) { preload->isFree = true; gAudioContext.preloadSampleStackTop--; } else { - AudioLoad_StartAsyncLoad(sample->sampleAddr, preload->ramAddr, sample->size, sample->medium, + AudioLoad_StartAsyncLoad((u32)sample->sampleAddr, preload->ramAddr, sample->size, sample->medium, nChunks, &gAudioContext.preloadSampleQueue, preload->encodedInfo); break; } @@ -2251,7 +2250,6 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, RelocInfo* relocInfo } sample = gAudioContext.usedSamples[i]; - if (sample->medium == MEDIUM_RAM) { continue; } diff --git a/soh/src/code/audio_playback.c b/soh/src/code/audio_playback.c index a0773a642..b9f868bd3 100644 --- a/soh/src/code/audio_playback.c +++ b/soh/src/code/audio_playback.c @@ -355,8 +355,6 @@ Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) { return inst; } - - return inst; } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index a729bebe9..d40aeab99 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -360,7 +360,8 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { void Player_SetModelsForHoldingShield(Player* this) { if ((this->stateFlags1 & 0x400000) && ((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) { - if (!Player_HoldsTwoHandedWeapon(this) && !Player_IsChildWithHylianShield(this)) { + if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK) || + !Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = 10; this->rightHandDLists = &sPlayerDListGroups[10][gSaveContext.linkAge]; if (this->sheathType == 18) { diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 5e0a780fd..f995179f1 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -110,7 +110,7 @@ void ElfMsg_Destroy(Actor* thisx, GlobalContext* globalCtx) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (this->actor.params & 0x8000) { + if (this->actor.params & 0x8000 || CVar_GetS32("gNoForcedNavi", 0) != 0) { return (this->actor.params & 0xFF) + 0x100; } else { return -((this->actor.params & 0xFF) + 0x100); diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 1559b188c..8319c2bc9 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -9,6 +9,10 @@ #include "objects/object_tk/object_tk.h" #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +#define COLLECTFLAG_GRAVEDIGGING_HEART_PIECE 0x19 +#define ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE 0x1000 + +bool heartPieceSpawned; void EnTk_Init(Actor* thisx, GlobalContext* globalCtx); void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx); @@ -505,6 +509,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { this->currentReward = -1; this->currentSpot = NULL; this->actionFunc = EnTk_Rest; + heartPieceSpawned = false; } void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -611,13 +616,23 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if (!(gSaveContext.itemGetInf[1] & 0x1000)) { - gSaveContext.itemGetInf[1] |= 0x1000; + // If vanilla itemGetInf flag is not set, it's impossible for the new flag to be set, so return true. + // Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true. + // If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag. + if (!heartPieceSpawned && + (!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) || + CVar_GetS32("gGravediggingTourFix", 0) && + !Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) { this->currentReward = 4; + gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE; + heartPieceSpawned = true; } } - Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); + EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]); + if (this->currentReward == 4) { + reward->collectibleFlag = COLLECTFLAG_GRAVEDIGGING_HEART_PIECE; + } } } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 6edef49ba..0b82ef951 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2106,10 +2106,10 @@ LinkAnimationHeader* func_808346C4(GlobalContext* globalCtx, Player* this) { func_808323B4(globalCtx, this); if (this->unk_870 < 0.5f) { - return D_808543A4[Player_HoldsTwoHandedWeapon(this)]; + return D_808543A4[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } else { - return D_808543AC[Player_HoldsTwoHandedWeapon(this)]; + return D_808543AC[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 03a93e949..1b406d8d1 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1601,6 +1601,10 @@ void FileChoose_Main(GameState* thisx) { }; FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; + + if (CVar_GetS32("gTimeFlowFileSelect", 0) != 0) { + gSaveContext.skyboxTime += 0x10; + } OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898); |
