mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-07-28 23:28:57 -04:00
Merge branch 'develop' into z64-devmerge
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -355,8 +355,6 @@ Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) {
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user