mirror of
https://github.com/zeldaret/oot
synced 2026-05-31 09:21:59 -04:00
Merge branch 'master' into audio_load
This commit is contained in:
@@ -189,7 +189,7 @@ void Inventory_ChangeEquipment(s16 equipment, u16 value) {
|
||||
}
|
||||
|
||||
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 pad;
|
||||
u16 sp26 = gSaveContext.equips.equipment & gEquipMasks[equipment];
|
||||
|
||||
|
||||
@@ -1275,7 +1275,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
|
||||
|
||||
while (i != 0xFF) {
|
||||
GfxPrint_SetPos(printer, 3, 7 + j++);
|
||||
GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSoundBanks[ind][i].unk_28,
|
||||
GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSoundBanks[ind][i].sfxId,
|
||||
gSoundBanks[ind][i].unk_2A, gSoundBanks[ind][i].unk_20);
|
||||
i = gSoundBanks[ind][i].next;
|
||||
}
|
||||
@@ -1341,7 +1341,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
|
||||
if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) {
|
||||
GfxPrint_Printf(printer, "%2X %5d %5d %5d %02X %04X %04X", entryIndex, (s32)*entry->posX,
|
||||
(s32)*entry->posY, (s32)*entry->posZ, entry->unk_24, entry->unk_26,
|
||||
entry->unk_28);
|
||||
entry->sfxId);
|
||||
} else {
|
||||
GfxPrint_Printf(printer, "FF ----- ----- ----- -- ---- ----");
|
||||
}
|
||||
@@ -1349,7 +1349,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
|
||||
if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) {
|
||||
GfxPrint_Printf(printer, "%2X %5d %5d %5d %3d %3d %04X", entryIndex, (s32)*entry->posX,
|
||||
(s32)*entry->posY, (s32)*entry->posZ, (s32)(chan->volume * 127.1f),
|
||||
chan->newPan, entry->unk_28);
|
||||
chan->newPan, entry->sfxId);
|
||||
} else {
|
||||
GfxPrint_Printf(printer, "FF ----- ----- ----- --- --- ----");
|
||||
}
|
||||
@@ -1357,13 +1357,13 @@ void AudioDebug_Draw(GfxPrint* printer) {
|
||||
if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) {
|
||||
GfxPrint_Printf(printer, "%2X %5d %5d %5d %3d %3d %04X", entryIndex, (s32)*entry->posX,
|
||||
(s32)*entry->posY, (s32)*entry->posZ, (s32)(chan->freqScale * 100.0f),
|
||||
chan->reverb, entry->unk_28);
|
||||
chan->reverb, entry->sfxId);
|
||||
} else {
|
||||
GfxPrint_Printf(printer, "FF ----- ----- ----- --- --- ----");
|
||||
}
|
||||
} else if (sAudioIntInfoBankPage[k] == 4) {
|
||||
if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) {
|
||||
GfxPrint_Printf(printer, "%2X %04X", entryIndex, entry->unk_28);
|
||||
GfxPrint_Printf(printer, "%2X %04X", entryIndex, entry->sfxId);
|
||||
} else {
|
||||
GfxPrint_Printf(printer, "FF ----");
|
||||
}
|
||||
@@ -2581,7 +2581,7 @@ s8 Audio_ComputeSoundReverb(u8 bankIdx, u8 entryIdx, u8 channelIdx) {
|
||||
}
|
||||
|
||||
reverb = *entry->reverbAdd + distAdd + scriptAdd;
|
||||
if ((bankIdx != BANK_OCARINA) || !((entry->unk_28 & 0x1FF) < 2)) {
|
||||
if ((bankIdx != BANK_OCARINA) || !((entry->sfxId & 0x1FF) < 2)) {
|
||||
reverb += sAudioEnvReverb + sAudioCodeReverb + sSpecReverb;
|
||||
}
|
||||
|
||||
@@ -3160,7 +3160,7 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) {
|
||||
}
|
||||
|
||||
for (i = 0; i < D_80130578[D_801333CC][bank]; i++) {
|
||||
if ((D_8016E1B8[bank][i].unk_4 != 0xFF) && (sfxId == gSoundBanks[bank][D_8016E1B8[bank][i].unk_4].unk_28)) {
|
||||
if ((D_8016E1B8[bank][i].unk_4 != 0xFF) && (sfxId == gSoundBanks[bank][D_8016E1B8[bank][i].unk_4].sfxId)) {
|
||||
Audio_QueueCmdS8(_SHIFTL(6, 24, 8) | _SHIFTL(2, 16, 8) | _SHIFTL(phi_s1, 8, 8) | _SHIFTL(6, 0, 8), arg2);
|
||||
}
|
||||
phi_s1++;
|
||||
|
||||
+98
-107
@@ -155,12 +155,12 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) {
|
||||
req = &sSoundRequests[i];
|
||||
switch (aspect) {
|
||||
case 0:
|
||||
if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28)) {
|
||||
if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId)) {
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28) && (&req->pos->x == cmp->posX)) {
|
||||
if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId) && (&req->pos->x == cmp->posX)) {
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
@@ -170,17 +170,17 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (&req->pos->x == cmp->posX && req->sfxId == cmp->unk_28) {
|
||||
if (&req->pos->x == cmp->posX && req->sfxId == cmp->sfxId) {
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (req->unk_8 == cmp->unk_C && req->sfxId == cmp->unk_28) {
|
||||
if (req->unk_8 == cmp->unk_C && req->sfxId == cmp->sfxId) {
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (req->sfxId == cmp->unk_28) {
|
||||
if (req->sfxId == cmp->sfxId) {
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
@@ -191,113 +191,104 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Down to a/v regalloc and some stuff where the compiler gets confused about reusing values. There's some fake matching
|
||||
// stuff to improve regalloc enough to verify equivalence.
|
||||
void Audio_ProcessSoundRequest(void) {
|
||||
u16 flag1;
|
||||
u8 sp55;
|
||||
u8 phi_a1;
|
||||
SoundRequest* req; // sp50
|
||||
SoundBankEntry* temp_v0;
|
||||
u16 sfxId;
|
||||
u8 count;
|
||||
u8 index;
|
||||
SoundRequest* req;
|
||||
SoundBankEntry* entry;
|
||||
Struct_8013331C* sp48;
|
||||
s32 phi_s5;
|
||||
u8 sp43;
|
||||
u8 phi_s1;
|
||||
u16 flag2;
|
||||
s32 bankId;
|
||||
u8 bestValue;
|
||||
u8 bestIndex;
|
||||
|
||||
req = &sSoundRequests[sSoundRequestReadIndex];
|
||||
phi_s1 = 0x80;
|
||||
bestIndex = 0x80;
|
||||
if (req->sfxId == 0) {
|
||||
return;
|
||||
}
|
||||
phi_s5 = SFX_BANK(req->sfxId);
|
||||
if ((1 << phi_s5) & D_801333F0) {
|
||||
bankId = SFX_BANK(req->sfxId);
|
||||
if ((1 << bankId) & D_801333F0) {
|
||||
AudioDebug_ScrPrt((const s8*)D_80133340, req->sfxId);
|
||||
phi_s5 = SFX_BANK(req->sfxId);
|
||||
bankId = SFX_BANK(req->sfxId);
|
||||
}
|
||||
sp55 = 0;
|
||||
phi_a1 = gSoundBanks[phi_s5][0].next;
|
||||
while (phi_a1 != 0xFF && phi_a1 != 0) {
|
||||
if (gSoundBanks[phi_s5][phi_a1].posX == &req->pos->x) {
|
||||
sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
|
||||
if (!(!(sp48->unk_2 & 0x20) || sp48->unk_0 != gSoundBanks[phi_s5][phi_a1].unk_24)) {
|
||||
count = 0;
|
||||
index = gSoundBanks[bankId][0].next;
|
||||
while (index != 0xFF && index != 0) {
|
||||
if (gSoundBanks[bankId][index].posX == &req->pos->x) {
|
||||
if ((D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_2 & 0x20) &&
|
||||
D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_0 ==
|
||||
gSoundBanks[bankId][index].unk_24) {
|
||||
return;
|
||||
}
|
||||
if (gSoundBanks[phi_s5][phi_a1].unk_28 == req->sfxId) {
|
||||
sp55 = D_80130594[D_801333CC][phi_s5];
|
||||
if (gSoundBanks[bankId][index].sfxId == req->sfxId) {
|
||||
count = D_80130594[D_801333CC][bankId];
|
||||
} else {
|
||||
//! @bug possibly uninitialized sp43 ? confirm when matching
|
||||
if (sp55 == 0) {
|
||||
phi_s1 = phi_a1;
|
||||
flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF;
|
||||
sp43 = D_8013331C[SFX_BANK_SHIFT(flag1)][SFX_INDEX(flag1)].unk_0;
|
||||
} else if (gSoundBanks[phi_s5][phi_a1].unk_24 < sp43) {
|
||||
phi_s1 = phi_a1;
|
||||
flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF;
|
||||
sp43 = D_8013331C[SFX_BANK_SHIFT(flag1)][SFX_INDEX(flag1)].unk_0;
|
||||
if (count == 0) {
|
||||
bestIndex = index;
|
||||
sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF;
|
||||
bestValue = D_8013331C[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].unk_0;
|
||||
} else if (gSoundBanks[bankId][index].unk_24 < bestValue) {
|
||||
bestIndex = index;
|
||||
sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF;
|
||||
bestValue = D_8013331C[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].unk_0;
|
||||
}
|
||||
sp55++;
|
||||
if (sp55 == D_80130594[D_801333CC][phi_s5]) {
|
||||
phi_a1 = (sp48->unk_0 >= sp43) ? phi_s1 : 0;
|
||||
count++;
|
||||
if (count == D_80130594[D_801333CC][bankId]) {
|
||||
index = (D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_0 >= bestValue)
|
||||
? bestIndex
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
if (D_80130594[D_801333CC][phi_s5] == sp55) {
|
||||
flag2 = req->sfxId & 0xC00; // Problem is around here
|
||||
if (count == D_80130594[D_801333CC][bankId]) {
|
||||
sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
|
||||
if ((flag2) || (D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_2 & 4) ||
|
||||
(phi_a1 == phi_s1)) {
|
||||
if ((gSoundBanks[phi_s5][phi_a1].unk_26 & 8) && gSoundBanks[phi_s5][phi_a1].unk_2A != 1) {
|
||||
Audio_ClearBGMMute(gSoundBanks[phi_s5][phi_a1].unk_2E);
|
||||
if ((req->sfxId & 0xC00) || (sp48->unk_2 & 4) || (index == bestIndex)) {
|
||||
if ((gSoundBanks[bankId][index].unk_26 & 8) && gSoundBanks[bankId][index].unk_2A != 1) {
|
||||
Audio_ClearBGMMute(gSoundBanks[bankId][index].unk_2E);
|
||||
}
|
||||
gSoundBanks[phi_s5][phi_a1].unk_C = req->unk_8;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_28 = req->sfxId;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_2A = 1;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_2B = 2;
|
||||
gSoundBanks[phi_s5][phi_a1].freqScale = req->freqScale;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_14 = req->unk_10;
|
||||
gSoundBanks[phi_s5][phi_a1].reverbAdd = req->reverbAdd;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_26 = sp48->unk_2;
|
||||
gSoundBanks[phi_s5][phi_a1].unk_24 = sp48->unk_0;
|
||||
if (!sp48->unk_2) {}
|
||||
} else if (gSoundBanks[phi_s5][phi_a1].unk_2A == 5) {
|
||||
gSoundBanks[phi_s5][phi_a1].unk_2A = 4;
|
||||
gSoundBanks[bankId][index].unk_C = req->unk_8;
|
||||
gSoundBanks[bankId][index].sfxId = req->sfxId;
|
||||
gSoundBanks[bankId][index].unk_2A = 1;
|
||||
gSoundBanks[bankId][index].unk_2B = 2;
|
||||
gSoundBanks[bankId][index].freqScale = req->freqScale;
|
||||
gSoundBanks[bankId][index].unk_14 = req->unk_10;
|
||||
gSoundBanks[bankId][index].reverbAdd = req->reverbAdd;
|
||||
gSoundBanks[bankId][index].unk_26 = sp48->unk_2;
|
||||
gSoundBanks[bankId][index].unk_24 = sp48->unk_0;
|
||||
} else if (gSoundBanks[bankId][index].unk_2A == 5) {
|
||||
gSoundBanks[bankId][index].unk_2A = 4;
|
||||
}
|
||||
phi_a1 = 0;
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
if (phi_a1 != 0) {
|
||||
phi_a1 = gSoundBanks[phi_s5][phi_a1].next;
|
||||
if (index != 0) {
|
||||
index = gSoundBanks[bankId][index].next;
|
||||
}
|
||||
}
|
||||
if (gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next != 0xFF && phi_a1 != 0) {
|
||||
phi_a1 = D_8016E1A8[phi_s5];
|
||||
temp_v0 = &gSoundBanks[phi_s5][phi_a1];
|
||||
temp_v0->posX = &req->pos->x;
|
||||
temp_v0->posY = &req->pos->y;
|
||||
temp_v0->posZ = &req->pos->z;
|
||||
temp_v0->unk_C = req->unk_8;
|
||||
temp_v0->freqScale = req->freqScale;
|
||||
temp_v0->unk_14 = req->unk_10;
|
||||
temp_v0->reverbAdd = req->reverbAdd;
|
||||
if (gSoundBanks[bankId][D_8016E1A8[bankId]].next != 0xFF && index != 0) {
|
||||
index = D_8016E1A8[bankId];
|
||||
entry = &gSoundBanks[bankId][index];
|
||||
entry->posX = &req->pos->x;
|
||||
entry->posY = &req->pos->y;
|
||||
entry->posZ = &req->pos->z;
|
||||
entry->unk_C = req->unk_8;
|
||||
entry->freqScale = req->freqScale;
|
||||
entry->unk_14 = req->unk_10;
|
||||
entry->reverbAdd = req->reverbAdd;
|
||||
sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
|
||||
temp_v0->unk_26 = sp48->unk_2;
|
||||
temp_v0->unk_24 = sp48->unk_0;
|
||||
temp_v0->unk_28 = req->sfxId;
|
||||
temp_v0->unk_2A = 1;
|
||||
temp_v0->unk_2B = 2;
|
||||
temp_v0->prev = D_8016E1A0[phi_s5];
|
||||
gSoundBanks[phi_s5][D_8016E1A0[phi_s5]].next = D_8016E1A8[phi_s5];
|
||||
D_8016E1A0[phi_s5] = D_8016E1A8[phi_s5];
|
||||
D_8016E1A8[phi_s5] = gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next;
|
||||
gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].prev = 0xFF;
|
||||
temp_v0->next = 0xFF;
|
||||
entry->unk_26 = sp48->unk_2;
|
||||
entry->unk_24 = sp48->unk_0;
|
||||
entry->sfxId = req->sfxId;
|
||||
entry->unk_2A = 1;
|
||||
entry->unk_2B = 2;
|
||||
entry->prev = D_8016E1A0[bankId];
|
||||
gSoundBanks[bankId][D_8016E1A0[bankId]].next = D_8016E1A8[bankId];
|
||||
D_8016E1A0[bankId] = D_8016E1A8[bankId];
|
||||
D_8016E1A8[bankId] = gSoundBanks[bankId][D_8016E1A8[bankId]].next;
|
||||
gSoundBanks[bankId][D_8016E1A8[bankId]].prev = 0xFF;
|
||||
entry->next = 0xFF;
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Audio_ProcessSoundRequest(void);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s")
|
||||
#endif
|
||||
|
||||
void func_800F7B54(u8 bankId, u8 bankIndex) {
|
||||
SoundBankEntry* entry = &gSoundBanks[bankId][bankIndex];
|
||||
@@ -351,9 +342,9 @@ void func_800F7CEC(u8 arg0) {
|
||||
phi_s4 = gSoundBanks[arg0][0].next;
|
||||
phi_s0 = 0;
|
||||
while (phi_s4 != 0xFF) {
|
||||
if ((1 == gSoundBanks[arg0][phi_s4].unk_2A) && (gSoundBanks[arg0][phi_s4].unk_28 & 0xC00)) {
|
||||
if ((1 == gSoundBanks[arg0][phi_s4].unk_2A) && (gSoundBanks[arg0][phi_s4].sfxId & 0xC00)) {
|
||||
gSoundBanks[arg0][phi_s4].unk_2B--;
|
||||
} else if (!(gSoundBanks[arg0][phi_s4].unk_28 & 0xC00) && (gSoundBanks[arg0][phi_s4].unk_2A == 5)) {
|
||||
} else if (!(gSoundBanks[arg0][phi_s4].sfxId & 0xC00) && (gSoundBanks[arg0][phi_s4].unk_2A == 5)) {
|
||||
Audio_QueueCmdS8((gSoundBanks[arg0][phi_s4].unk_2E << 8) | 0x6020000, 0);
|
||||
func_800F7B54(arg0, phi_s4);
|
||||
}
|
||||
@@ -374,10 +365,10 @@ void func_800F7CEC(u8 arg0) {
|
||||
} else {
|
||||
if (entry->dist > 0x7FFFFFD0) {
|
||||
entry->dist = 0x70000008;
|
||||
osSyncPrintf(D_80133344, entry->unk_28, entry->posX, entry->posZ, *entry->posX,
|
||||
*entry->posY, *entry->posZ);
|
||||
osSyncPrintf(D_80133344, entry->sfxId, entry->posX, entry->posZ, *entry->posX, *entry->posY,
|
||||
*entry->posZ);
|
||||
}
|
||||
temp3 = entry->unk_28;
|
||||
temp3 = entry->sfxId;
|
||||
entry->unk_20 = (u32)entry->dist + (SQ(0xFF - spA9) * 0x1690) + temp3 - temp3;
|
||||
if (*entry->posZ < 0.0f) {
|
||||
entry->unk_20 += (s32)(-*entry->posZ * 6.0f);
|
||||
@@ -386,7 +377,7 @@ void func_800F7CEC(u8 arg0) {
|
||||
if (entry->dist > SQ(1e5f)) {
|
||||
if (entry->unk_2A == 4) {
|
||||
Audio_QueueCmdS8((entry->unk_2E << 8) | 0x6020000, 0);
|
||||
if (entry->unk_28 & 0xC00) {
|
||||
if (entry->sfxId & 0xC00) {
|
||||
func_800F7B54(arg0, phi_s4);
|
||||
phi_s4 = phi_s0;
|
||||
}
|
||||
@@ -431,7 +422,7 @@ void func_800F7CEC(u8 arg0) {
|
||||
} else {
|
||||
entry = &gSoundBanks[arg0][temp_s4_3[0].unk_4];
|
||||
if (entry->unk_2A == 4) {
|
||||
if (entry->unk_28 & 0xC00) {
|
||||
if (entry->sfxId & 0xC00) {
|
||||
func_800F7B54(arg0, temp_s4_3->unk_4);
|
||||
} else {
|
||||
entry->unk_2A = 1;
|
||||
@@ -512,11 +503,11 @@ void func_800F8480(u8 bankId) {
|
||||
}
|
||||
Audio_SetSoundProperties(bankId, bankIndex, D_8016E260);
|
||||
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8), 1);
|
||||
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 4, entry->unk_28 & 0xFF);
|
||||
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 4, entry->sfxId & 0xFF);
|
||||
if (D_80130570[bankId] != 0) {
|
||||
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 5, (entry->unk_28 & 0x100) >> 8);
|
||||
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 5, (entry->sfxId & 0x100) >> 8);
|
||||
}
|
||||
if (entry->unk_28 & 0xC00) {
|
||||
if (entry->sfxId & 0xC00) {
|
||||
entry->unk_2A = 4;
|
||||
} else {
|
||||
entry->unk_2A = 5;
|
||||
@@ -525,7 +516,7 @@ void func_800F8480(u8 bankId) {
|
||||
func_800F7B54(bankId, bankIndex);
|
||||
} else if (entry->unk_2A == 3) {
|
||||
Audio_SetSoundProperties(bankId, bankIndex, D_8016E260);
|
||||
if (entry->unk_28 & 0xC00) {
|
||||
if (entry->sfxId & 0xC00) {
|
||||
entry->unk_2A = 4;
|
||||
} else {
|
||||
entry->unk_2A = 5;
|
||||
@@ -552,7 +543,7 @@ void func_800F87A0(u8 bankId) {
|
||||
}
|
||||
bankIndex = gSoundBanks[bankId][0].next;
|
||||
}
|
||||
cmp.unk_28 = bankId << 12;
|
||||
cmp.sfxId = bankId << 12;
|
||||
Audio_RemoveMatchingSoundRequests(0, &cmp);
|
||||
}
|
||||
|
||||
@@ -581,7 +572,7 @@ void func_800F89A0(u8 bankId, Vec3f* pos) {
|
||||
SoundBankEntry cmp;
|
||||
|
||||
func_800F8884(bankId, pos);
|
||||
cmp.unk_28 = bankId << 12;
|
||||
cmp.sfxId = bankId << 12;
|
||||
cmp.posX = &pos->x;
|
||||
Audio_RemoveMatchingSoundRequests(1, &cmp);
|
||||
}
|
||||
@@ -605,7 +596,7 @@ void func_800F8A44(Vec3f* pos, u16 sfxId) {
|
||||
|
||||
while (bankIndex != 0xFF) {
|
||||
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
|
||||
if (entry->posX == &pos->x && entry->unk_28 == sfxId) {
|
||||
if (entry->posX == &pos->x && entry->sfxId == sfxId) {
|
||||
if (entry->unk_2A >= 3) {
|
||||
Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0);
|
||||
}
|
||||
@@ -621,7 +612,7 @@ void func_800F8A44(Vec3f* pos, u16 sfxId) {
|
||||
}
|
||||
}
|
||||
cmp.posX = &pos->x;
|
||||
cmp.unk_28 = sfxId;
|
||||
cmp.sfxId = sfxId;
|
||||
Audio_RemoveMatchingSoundRequests(3, &cmp);
|
||||
}
|
||||
|
||||
@@ -633,7 +624,7 @@ void func_800F8BA0(u8 arg0, u16 sfxId) {
|
||||
|
||||
while (bankIndex != 0xFF) {
|
||||
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
|
||||
if (entry->unk_C == arg0 && entry->unk_28 == sfxId) {
|
||||
if (entry->unk_C == arg0 && entry->sfxId == sfxId) {
|
||||
if (entry->unk_2A >= 3) {
|
||||
Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0);
|
||||
}
|
||||
@@ -648,7 +639,7 @@ void func_800F8BA0(u8 arg0, u16 sfxId) {
|
||||
}
|
||||
}
|
||||
cmp.unk_C = arg0;
|
||||
cmp.unk_28 = sfxId;
|
||||
cmp.sfxId = sfxId;
|
||||
Audio_RemoveMatchingSoundRequests(4, &cmp);
|
||||
}
|
||||
|
||||
@@ -660,7 +651,7 @@ void Audio_StopSfx(u32 sfxId) {
|
||||
|
||||
while (bankIndex != 0xFF) {
|
||||
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
|
||||
if (entry->unk_28 == sfxId) {
|
||||
if (entry->sfxId == sfxId) {
|
||||
if (entry->unk_2A >= 3) {
|
||||
Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0);
|
||||
}
|
||||
@@ -672,7 +663,7 @@ void Audio_StopSfx(u32 sfxId) {
|
||||
}
|
||||
bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next;
|
||||
}
|
||||
cmp.unk_28 = sfxId;
|
||||
cmp.sfxId = sfxId;
|
||||
Audio_RemoveMatchingSoundRequests(5, &cmp);
|
||||
}
|
||||
|
||||
@@ -722,7 +713,7 @@ u8 Audio_IsSfxPlaying(u32 sfxId) {
|
||||
|
||||
while (bankIndex != 0xFF) {
|
||||
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
|
||||
if (entry->unk_28 == sfxId) {
|
||||
if (entry->sfxId == sfxId) {
|
||||
return true;
|
||||
}
|
||||
bankIndex = entry->next;
|
||||
|
||||
+24
-24
@@ -321,7 +321,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) {
|
||||
f32 var2;
|
||||
s32 i;
|
||||
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
spCE = 0xFF;
|
||||
var1 = 1.0f;
|
||||
@@ -986,19 +986,19 @@ s32 func_8002DD78(Player* player) {
|
||||
}
|
||||
|
||||
s32 func_8002DDA8(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
return (player->stateFlags1 & 0x800) || func_8002DD78(player);
|
||||
}
|
||||
|
||||
s32 func_8002DDE4(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
return player->stateFlags2 & 0x8;
|
||||
}
|
||||
|
||||
s32 func_8002DDF4(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
return player->stateFlags2 & 0x1000;
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ void func_8002DF18(GlobalContext* globalCtx, Player* player) {
|
||||
}
|
||||
|
||||
s32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 csMode) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
player->csMode = csMode;
|
||||
player->unk_448 = actor;
|
||||
@@ -1045,7 +1045,7 @@ s32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 csMode) {
|
||||
}
|
||||
|
||||
s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 csMode) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
func_8002DF38(globalCtx, actor, csMode);
|
||||
player->unk_46A = 1;
|
||||
@@ -1068,7 +1068,7 @@ void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) {
|
||||
* The maximum angle difference that qualifies as "facing" is specified by `maxAngle`.
|
||||
*/
|
||||
s32 Player_IsFacingActor(Actor* actor, s16 maxAngle, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 yawDiff = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y;
|
||||
|
||||
if (ABS(yawDiff) < maxAngle) {
|
||||
@@ -1515,7 +1515,7 @@ u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 exchangeItemId) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
// This is convoluted but it seems like it must be a single if statement to match
|
||||
if ((player->actor.flags & 0x100) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(globalCtx)) ||
|
||||
@@ -1555,7 +1555,7 @@ u32 func_8002F334(Actor* actor, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s8 func_8002F368(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
return player->exchangeItemId;
|
||||
}
|
||||
@@ -1578,7 +1578,7 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
|
||||
if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) &&
|
||||
@@ -1633,7 +1633,7 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (actor->xyzDistToPlayerSq < player->unk_6A4) {
|
||||
player->unk_6A4 = actor->xyzDistToPlayerSq;
|
||||
@@ -1649,7 +1649,7 @@ s32 Actor_IsMounted(GlobalContext* globalCtx, Actor* horse) {
|
||||
}
|
||||
|
||||
u32 Actor_SetRideActor(GlobalContext* globalCtx, Actor* horse, s32 mountSide) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x003C7880)) {
|
||||
player->rideActor = horse;
|
||||
@@ -1669,7 +1669,7 @@ s32 Actor_NotMounted(GlobalContext* globalCtx, Actor* horse) {
|
||||
}
|
||||
|
||||
void func_8002F698(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
player->unk_8A0 = arg6;
|
||||
player->unk_8A1 = arg5;
|
||||
@@ -2027,7 +2027,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
|
||||
ActorEntry* actorEntry;
|
||||
s32 i;
|
||||
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (0) {
|
||||
// This ASSERT is optimized out but it exists due to its presence in rodata
|
||||
@@ -2050,7 +2050,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
|
||||
}
|
||||
|
||||
if (KREG(0) == -100) {
|
||||
refActor = &PLAYER->actor;
|
||||
refActor = &GET_PLAYER(globalCtx)->actor;
|
||||
KREG(0) = 0;
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->world.pos.x,
|
||||
refActor->world.pos.y + 100.0f, refActor->world.pos.z, 0, 0, 0, 1);
|
||||
@@ -2856,7 +2856,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
|
||||
Actor* newHead;
|
||||
ActorOverlay* overlayEntry;
|
||||
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
overlayEntry = actor->overlayEntry;
|
||||
name = overlayEntry->name != NULL ? overlayEntry->name : "";
|
||||
@@ -3425,7 +3425,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 dista
|
||||
* Returns true if the player is targeting the provided actor
|
||||
*/
|
||||
s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((player->stateFlags1 & 0x10) && actor->isTargeted) {
|
||||
return true;
|
||||
@@ -3438,7 +3438,7 @@ s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor) {
|
||||
* Returns true if the player is targeting an actor other than the provided actor
|
||||
*/
|
||||
s32 Actor_OtherIsTargeted(GlobalContext* globalCtx, Actor* actor) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((player->stateFlags1 & 0x10) && !actor->isTargeted) {
|
||||
return true;
|
||||
@@ -3870,7 +3870,7 @@ void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbD
|
||||
}
|
||||
|
||||
s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
f32 var;
|
||||
|
||||
if ((globalCtx->csCtx.state != CS_STATE_IDLE) || (gDbgCamEnabled)) {
|
||||
@@ -3951,7 +3951,7 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) {
|
||||
#include "z_cheap_proc.c"
|
||||
|
||||
u8 func_800353E8(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
return player->unk_845;
|
||||
}
|
||||
@@ -3980,7 +3980,7 @@ Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId,
|
||||
}
|
||||
|
||||
s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 var1;
|
||||
s16 var2;
|
||||
|
||||
@@ -4025,7 +4025,7 @@ void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) {
|
||||
}
|
||||
|
||||
u8 func_800355E4(GlobalContext* globalCtx, Collider* collider) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) {
|
||||
return true;
|
||||
@@ -5510,7 +5510,7 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) {
|
||||
}
|
||||
|
||||
s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, f32 arg4) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 pad;
|
||||
Vec3f sp2C;
|
||||
s16 var;
|
||||
@@ -5540,7 +5540,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
||||
}
|
||||
|
||||
s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 pad;
|
||||
Vec3f sp24;
|
||||
s16 var;
|
||||
|
||||
@@ -4493,7 +4493,7 @@ void BgCheck_DrawStaticPolyList(GlobalContext* globalCtx, CollisionContext* colC
|
||||
* Draw scene collision
|
||||
*/
|
||||
void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* colCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
StaticLookup* lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos);
|
||||
|
||||
if (AREG(23) != 0) {
|
||||
|
||||
+3
-5
@@ -3463,12 +3463,10 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
KeepOn4_Unk20* unk20 = &keep4->unk_20;
|
||||
s32 pad;
|
||||
f32 playerHeight;
|
||||
Player* player;
|
||||
Player* player = GET_PLAYER(camera->globalCtx);
|
||||
s16 angleCnt;
|
||||
s32 i;
|
||||
|
||||
player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
|
||||
|
||||
if (camera->animState == 0 || camera->animState == 0xA || camera->animState == 0x14) {
|
||||
if (camera->globalCtx->view.unk_124 == 0) {
|
||||
camera->unk_14C |= 0x20;
|
||||
@@ -7528,7 +7526,7 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
*/
|
||||
void Camera_Finish(Camera* camera) {
|
||||
Camera* mainCam = camera->globalCtx->cameraPtrs[MAIN_CAM];
|
||||
Player* player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
|
||||
Player* player = GET_PLAYER(camera->globalCtx);
|
||||
|
||||
if (camera->timer == 0) {
|
||||
Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamIdx, CAM_STAT_ACTIVE);
|
||||
@@ -8098,7 +8096,7 @@ s16 func_8005B1A4(Camera* camera) {
|
||||
camera->unk_14C |= 0x8;
|
||||
|
||||
if ((camera->thisIdx == MAIN_CAM) && (camera->globalCtx->activeCamera != MAIN_CAM)) {
|
||||
camera->globalCtx->cameraPtrs[camera->globalCtx->activeCamera]->unk_14C |= 0x8;
|
||||
GET_ACTIVE_CAM(camera->globalCtx)->unk_14C |= 0x8;
|
||||
return camera->globalCtx->activeCamera;
|
||||
}
|
||||
|
||||
|
||||
@@ -2621,8 +2621,8 @@ void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colChkCt
|
||||
/**
|
||||
* Iterates through all AT colliders, testing them for AC collisions with each AC collider, setting the info regarding
|
||||
* the collision for each AC and AT collider that collided. Then spawns hitmarks and plays sound effects for each
|
||||
* successful collision. To collide, an AT collider must share a type (PLAYER, ENEMY, or BOMB) with the AC collider and
|
||||
* the toucher and bumper elements that overlapped must share a dmgFlag.
|
||||
* successful collision. To collide, an AT collider must share a type (AC_TYPE_PLAYER, AC_TYPE_ENEMY, or AC_TYPE_OTHER)
|
||||
* with the AC collider and the toucher and bumper elements that overlapped must share a dmgFlag.
|
||||
*/
|
||||
void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) {
|
||||
Collider** col;
|
||||
|
||||
+5
-5
@@ -161,7 +161,7 @@ void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
||||
|
||||
// Command 3: Misc. Actions
|
||||
void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
f32 temp;
|
||||
u8 sp3F;
|
||||
|
||||
@@ -267,7 +267,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
break;
|
||||
case 16:
|
||||
if (sp3F != 0) {
|
||||
D_8015FCCA = Quake_Add(ACTIVE_CAM, 6);
|
||||
D_8015FCCA = Quake_Add(GET_ACTIVE_CAM(globalCtx), 6);
|
||||
Quake_SetSpeed(D_8015FCCA, 0x7FFF);
|
||||
Quake_SetQuakeValues(D_8015FCCA, 4, 0, 1000, 0);
|
||||
Quake_SetCountdown(D_8015FCCA, 800);
|
||||
@@ -440,7 +440,7 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim
|
||||
|
||||
// Command 0x3E8: Code Execution (& Terminates Cutscene?)
|
||||
void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 temp = 0;
|
||||
|
||||
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
|
||||
@@ -1297,7 +1297,7 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext*
|
||||
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, CAM_STAT_ACTIVE);
|
||||
Camera_ResetAnim(Gameplay_GetCamera(globalCtx, csCtx->unk_14));
|
||||
Camera_SetCSParams(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus,
|
||||
csCtx->cameraPosition, PLAYER, relativeToLink);
|
||||
csCtx->cameraPosition, GET_PLAYER(globalCtx), relativeToLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1334,7 +1334,7 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt
|
||||
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, CAM_STAT_ACTIVE);
|
||||
Camera_ResetAnim(Gameplay_GetCamera(globalCtx, csCtx->unk_14));
|
||||
Camera_SetCSParams(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus,
|
||||
csCtx->cameraPosition, PLAYER, relativeToLink);
|
||||
csCtx->cameraPosition, GET_PLAYER(globalCtx), relativeToLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f*
|
||||
}
|
||||
|
||||
void EffectSsFireTail_SpawnFlameOnPlayer(GlobalContext* globalCtx, f32 scale, s16 bodyPart, f32 colorIntensity) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
EffectSsFireTail_SpawnFlame(globalCtx, &player->actor, &player->bodyPartsPos[bodyPart], scale, bodyPart,
|
||||
colorIntensity);
|
||||
|
||||
@@ -138,7 +138,7 @@ u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) {
|
||||
}
|
||||
|
||||
u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
ElfMessage* msgs;
|
||||
|
||||
if (!LINK_IS_ADULT) {
|
||||
|
||||
@@ -688,7 +688,7 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->getItemId != GI_NONE) {
|
||||
if (!Actor_HasParent(&this->actor, globalCtx)) {
|
||||
|
||||
@@ -11,7 +11,7 @@ s16 sPlayerInitialDirection = 0;
|
||||
s16 sEntranceIconMapIndex = 0;
|
||||
|
||||
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
sPlayerInitialPosX = player->actor.world.pos.x;
|
||||
sPlayerInitialPosZ = player->actor.world.pos.z;
|
||||
@@ -312,7 +312,7 @@ void Map_Init(GlobalContext* globalCtx) {
|
||||
|
||||
void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 tempX, tempZ;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 565);
|
||||
@@ -506,7 +506,7 @@ s16 Map_GetFloorTextIndexOffset(s32 mapIndex, s32 floor) {
|
||||
|
||||
void Map_Update(GlobalContext* globalCtx) {
|
||||
static s16 sLastRoomNum = 99;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 floor;
|
||||
|
||||
@@ -598,7 +598,7 @@ void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) {
|
||||
|
||||
void func_80083108(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 i;
|
||||
s16 sp28 = 0;
|
||||
@@ -2654,7 +2654,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
||||
static void* cUpLabelTextures[] = { gNaviCUpENGTex, gNaviCUpENGTex, gNaviCUpENGTex };
|
||||
static s16 startButtonLeftPos[] = { 132, 130, 130 };
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
s16 temp; // Used as both an alpha value and a button index
|
||||
s16 dxdy;
|
||||
@@ -3018,7 +3018,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 svar1;
|
||||
s16 svar2;
|
||||
s16 svar3;
|
||||
@@ -3806,7 +3806,7 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
static s16 D_80125B64 = 0;
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 alpha;
|
||||
s16 alpha1;
|
||||
u16 action;
|
||||
|
||||
+10
-9
@@ -14,7 +14,7 @@ s16 D_801614C8;
|
||||
u64 D_801614D0[0xA00];
|
||||
|
||||
void func_800BC450(GlobalContext* globalCtx) {
|
||||
Camera_ChangeDataIdx(ACTIVE_CAM, globalCtx->unk_1242B - 1);
|
||||
Camera_ChangeDataIdx(GET_ACTIVE_CAM(globalCtx), globalCtx->unk_1242B - 1);
|
||||
}
|
||||
|
||||
void func_800BC490(GlobalContext* globalCtx, s16 point) {
|
||||
@@ -142,7 +142,7 @@ Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* gfx) {
|
||||
|
||||
void Gameplay_Destroy(GameState* thisx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)thisx;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
globalCtx->state.gfxCtx->callback = NULL;
|
||||
globalCtx->state.gfxCtx->callbackParam = 0;
|
||||
@@ -372,7 +372,7 @@ void Gameplay_Init(GameState* thisx) {
|
||||
; // Empty Loop
|
||||
}
|
||||
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
Camera_InitPlayerSettings(&globalCtx->mainCamera, player);
|
||||
Camera_ChangeMode(&globalCtx->mainCamera, CAM_MODE_NORMAL);
|
||||
|
||||
@@ -394,7 +394,7 @@ void Gameplay_Init(GameState* thisx) {
|
||||
func_800758AC(globalCtx);
|
||||
gSaveContext.seqIndex = globalCtx->soundCtx.seqIndex;
|
||||
gSaveContext.nightSeqIndex = globalCtx->soundCtx.nightSeqIndex;
|
||||
func_8002DF18(globalCtx, PLAYER);
|
||||
func_8002DF18(globalCtx, GET_PLAYER(globalCtx));
|
||||
AnimationContext_Update(globalCtx, &globalCtx->animationCtx);
|
||||
gSaveContext.respawnFlag = 0;
|
||||
|
||||
@@ -1210,10 +1210,11 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(83) != 0)) {
|
||||
if ((globalCtx->skyboxCtx.unk_140 != 0) && (ACTIVE_CAM->setting != CAM_SET_PREREND0)) {
|
||||
if ((globalCtx->skyboxCtx.unk_140 != 0) &&
|
||||
(GET_ACTIVE_CAM(globalCtx)->setting != CAM_SET_PREREND0)) {
|
||||
Vec3f sp74;
|
||||
|
||||
Camera_GetSkyboxOffset(&sp74, ACTIVE_CAM);
|
||||
Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(globalCtx));
|
||||
SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, 0,
|
||||
globalCtx->view.eye.x + sp74.x, globalCtx->view.eye.y + sp74.y,
|
||||
globalCtx->view.eye.z + sp74.z);
|
||||
@@ -1295,7 +1296,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (globalCtx->view.unk_124 != 0) {
|
||||
Camera_Update(ACTIVE_CAM);
|
||||
Camera_Update(GET_ACTIVE_CAM(globalCtx));
|
||||
func_800AB944(&globalCtx->view);
|
||||
globalCtx->view.unk_124 = 0;
|
||||
if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) && !globalCtx->envCtx.skyDisabled) {
|
||||
@@ -1304,7 +1305,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
Camera_Finish(ACTIVE_CAM);
|
||||
Camera_Finish(GET_ACTIVE_CAM(globalCtx));
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_play.c", 4508);
|
||||
}
|
||||
@@ -1726,7 +1727,7 @@ void Gameplay_SetRespawnData(GlobalContext* globalCtx, s32 respawnMode, s16 entr
|
||||
}
|
||||
|
||||
void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 playerParams) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 entranceIndex;
|
||||
s8 roomIndex;
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ s32 Player_InBlockingCsMode(GlobalContext* globalCtx, Player* this) {
|
||||
}
|
||||
|
||||
s32 Player_InCsMode(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
return Player_InBlockingCsMode(globalCtx, this) || (this->unk_6AD == 4);
|
||||
}
|
||||
@@ -419,7 +419,7 @@ void func_8008EE08(Player* this) {
|
||||
}
|
||||
|
||||
void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
func_8008EE08(this);
|
||||
this->unk_664 = actor;
|
||||
@@ -430,7 +430,7 @@ void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) {
|
||||
}
|
||||
|
||||
s32 func_8008EF30(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
return (this->stateFlags1 & 0x800000);
|
||||
}
|
||||
@@ -441,7 +441,7 @@ s32 func_8008EF44(GlobalContext* globalCtx, s32 ammo) {
|
||||
}
|
||||
|
||||
s32 Player_IsBurningStickInRange(GlobalContext* globalCtx, Vec3f* pos, f32 xzRange, f32 yRange) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
Vec3f diff;
|
||||
s32 pad;
|
||||
|
||||
@@ -466,13 +466,13 @@ s32 Player_GetStrength(void) {
|
||||
}
|
||||
|
||||
u8 Player_GetMask(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
return this->currentMask;
|
||||
}
|
||||
|
||||
Player* Player_UnsetMask(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
this->currentMask = PLAYER_MASK_NONE;
|
||||
|
||||
@@ -480,13 +480,13 @@ Player* Player_UnsetMask(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s32 Player_HasMirrorShieldEquipped(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
return (this->currentShield == PLAYER_SHIELD_MIRROR);
|
||||
}
|
||||
|
||||
s32 Player_HasMirrorShieldSetToDraw(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
|
||||
return (this->rightHandType == 10) && (this->currentShield == PLAYER_SHIELD_MIRROR);
|
||||
}
|
||||
@@ -580,7 +580,7 @@ return_neg:
|
||||
}
|
||||
|
||||
s32 func_8008F2F8(GlobalContext* globalCtx) {
|
||||
Player* this = PLAYER;
|
||||
Player* this = GET_PLAYER(globalCtx);
|
||||
TextTriggerEntry* triggerEntry;
|
||||
s32 var;
|
||||
|
||||
|
||||
+5
-5
@@ -329,7 +329,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 628);
|
||||
|
||||
camera = ACTIVE_CAM;
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
sp9C = (camera->setting == CAM_SET_PREREND0);
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
@@ -384,7 +384,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
BgImage* bgImage;
|
||||
s32 i;
|
||||
|
||||
camera = ACTIVE_CAM;
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
camId = camera->camDataIdx;
|
||||
// jfifid
|
||||
camId2 = func_80041C10(&globalCtx->colCtx, camId, BGCHECK_SCENE)[2].y;
|
||||
@@ -392,7 +392,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
camId = camId2;
|
||||
}
|
||||
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
player->actor.params = (player->actor.params & 0xFF00) | camId;
|
||||
|
||||
bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
|
||||
@@ -424,7 +424,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_room.c", 752);
|
||||
|
||||
camera = ACTIVE_CAM;
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
sp98 = (camera->setting == CAM_SET_PREREND0);
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
@@ -589,7 +589,7 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34);
|
||||
|
||||
Scene_ExecuteCommands(globalCtx, roomCtx->curRoom.segment);
|
||||
Player_SetBootData(globalCtx, PLAYER);
|
||||
Player_SetBootData(globalCtx, GET_PLAYER(globalCtx));
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -1437,14 +1437,14 @@ void func_8009BEEC(GlobalContext* globalCtx) {
|
||||
s32 var;
|
||||
|
||||
if (globalCtx->gameplayFrames % 128 == 13) {
|
||||
var = Quake_Add(ACTIVE_CAM, 2);
|
||||
var = Quake_Add(GET_ACTIVE_CAM(globalCtx), 2);
|
||||
Quake_SetSpeed(var, 10000);
|
||||
Quake_SetQuakeValues(var, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(var, 127);
|
||||
}
|
||||
|
||||
if ((globalCtx->gameplayFrames % 64 == 0) && (Rand_ZeroOne() > 0.6f)) {
|
||||
var = Quake_Add(ACTIVE_CAM, 3);
|
||||
var = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
|
||||
Quake_SetSpeed(var, 32000.0f + (Rand_ZeroOne() * 3000.0f));
|
||||
Quake_SetQuakeValues(var, 10.0f - (Rand_ZeroOne() * 9.0f), 0, 0, 0);
|
||||
Quake_SetCountdown(var, 48.0f - (Rand_ZeroOne() * 15.0f));
|
||||
@@ -2081,7 +2081,7 @@ void func_8009EE44(GlobalContext* globalCtx) {
|
||||
|
||||
if ((globalCtx->roomCtx.unk_74[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) {
|
||||
if (globalCtx->roomCtx.unk_74[1] == 50) {
|
||||
func_8002F7DC(&PLAYER->actor, NA_SE_EV_CHICKEN_CRY_M);
|
||||
func_8002F7DC(&GET_PLAYER(globalCtx)->actor, NA_SE_EV_CHICKEN_CRY_M);
|
||||
globalCtx->roomCtx.unk_74[0] = 1;
|
||||
}
|
||||
globalCtx->roomCtx.unk_74[1]++;
|
||||
|
||||
Reference in New Issue
Block a user