Merge branch 'develop' into z64-devmerge

This commit is contained in:
briaguya 2022-06-17 00:39:07 -04:00
commit dd42cca2cf
24 changed files with 355 additions and 299 deletions

View file

@ -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;
}

View file

@ -355,8 +355,6 @@ Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) {
return inst;
}
return inst;
}

View file

@ -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) {