diff --git a/Makefile b/Makefile index 5103d58691..125bcb5a11 100644 --- a/Makefile +++ b/Makefile @@ -309,9 +309,14 @@ endif INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR) # Check code syntax with host compiler -CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces +CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-missing-braces CHECK_WARNINGS += -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=incompatible-pointer-types +# Actors and effets are mostly callback functions and often don't use all arguments, +# ignore those warnings entirely in these directories. +$(BUILD_DIR)/src/overlays/actors/%.o: CHECK_WARNINGS += -Wno-unused-parameter +$(BUILD_DIR)/src/overlays/effects/%.o: CHECK_WARNINGS += -Wno-unused-parameter + # The `cpp` command behaves differently on macOS (it behaves as if # `-traditional-cpp` was passed) so we use `gcc -E` instead. CPP := gcc -E diff --git a/include/actor.h b/include/actor.h index 985f32abb3..58d64f80c4 100644 --- a/include/actor.h +++ b/include/actor.h @@ -787,7 +787,7 @@ u8 Actor_ApplyDamage(Actor* actor); void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag); void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag); void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); -Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, +Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* arg5, struct PlayState* play, s16 params, Gfx* dList); void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); s32 Flags_GetEventChkInf(s32 flag); diff --git a/include/environment.h b/include/environment.h index 6c23dfb336..ae33a3f5d6 100644 --- a/include/environment.h +++ b/include/environment.h @@ -261,7 +261,7 @@ void Environment_DrawSkyboxFilters(struct PlayState* play); s32 Environment_ZBufValToFixedPoint(s32 zBufferVal); u16 Environment_GetPixelDepth(s32 x, s32 y); void Environment_GraphCallback(struct GraphicsContext* gfxCtx, void* param); -void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 unused); +void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 arg2); u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep); u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minStep); f32 Environment_LerpWeight(u16 max, u16 min, u16 val); @@ -273,15 +273,15 @@ void Environment_Update(struct PlayState* play, EnvironmentContext* envCtx, Ligh struct GameOverContext* gameOverCtx, struct GraphicsContext* gfxCtx); void Environment_DrawSunAndMoon(struct PlayState* play); void Environment_DrawSunLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, - struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused); + struct GraphicsContext* gfxCtx, Vec3f pos, s32 arg5); void Environment_DrawLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, - struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 scale, f32 colorIntensity, + struct GraphicsContext* gfxCtx, Vec3f pos, s32 arg5, s16 scale, f32 colorIntensity, s16 glareStrength, u8 isSun); void Environment_DrawRain(struct PlayState* play, struct View* view, struct GraphicsContext* gfxCtx); void Environment_ChangeLightSetting(struct PlayState* play, u32 lightSetting); void Environment_UpdateLightningStrike(struct PlayState* play); void Environment_AddLightningBolts(struct PlayState* play, u8 num); -void Environment_DrawLightning(struct PlayState* play, s32 unused); +void Environment_DrawLightning(struct PlayState* play, s32 arg1); void Environment_PlaySceneSequence(struct PlayState* play); void Environment_DrawCustomLensFlare(struct PlayState* play); void Environment_InitGameOverLights(struct PlayState* play); diff --git a/include/gfx.h b/include/gfx.h index 6e1fcabe17..01a33f974b 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -4,6 +4,7 @@ #include "ultra64.h" #include "ultra64/gbi.h" #include "alignment.h" +#include "attributes.h" #include "sched.h" #include "thga.h" #include "versions.h" @@ -109,10 +110,10 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, #else -#define OPEN_DISPS(gfxCtx, file, line) \ - { \ - GraphicsContext* __gfxCtx = gfxCtx; \ - s32 __dispPad +#define OPEN_DISPS(gfxCtx, file, line) \ + { \ + UNUSED GraphicsContext* __gfxCtx = gfxCtx; \ + UNUSED s32 __dispPad #define CLOSE_DISPS(gfxCtx, file, line) \ do {} while (0); \ @@ -123,7 +124,7 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, #endif -void Graph_ThreadEntry(void*); +void Graph_ThreadEntry(void* arg); extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" diff --git a/include/stack_pad.h b/include/stack_pad.h new file mode 100644 index 0000000000..c616460e46 --- /dev/null +++ b/include/stack_pad.h @@ -0,0 +1,21 @@ +#ifndef STACK_PAD_H +#define STACK_PAD_H + +#include "attributes.h" + +#ifndef GLUE +#define GLUE(a, b) a##b +#endif +#ifndef GLUE2 +#define GLUE2(a, b) GLUE(a, b) +#endif + +#ifndef NON_MATCHING +#define STACK_PAD(type) UNUSED type GLUE2(__stack_pad_, __LINE__) +#define STACK_PADS(type, n) STACK_PAD(type)[(n)] +#else +#define STACK_PAD(type) +#define STACK_PADS(type, n) +#endif + +#endif diff --git a/src/audio/game/debug.inc.c b/src/audio/game/debug.inc.c index e6d2dd89ca..557335fe19 100644 --- a/src/audio/game/debug.inc.c +++ b/src/audio/game/debug.inc.c @@ -84,7 +84,7 @@ char* AudioDebug_ToStringBinary(u32 num, u8 bits) { } void AudioDebug_Draw(GfxPrint* printer) { - s32 pad[3]; + STACK_PADS(s32, 3); u8 i; u8 j; u8 ctr; diff --git a/src/audio/game/general.c b/src/audio/game/general.c index 0e1ca6df5c..1fd14a72d1 100644 --- a/src/audio/game/general.c +++ b/src/audio/game/general.c @@ -8,6 +8,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "ultra64.h" #include "versions.h" #include "audio.h" @@ -1461,9 +1462,9 @@ void AudioOcarina_CheckIfStartedSong(void) { */ void AudioOcarina_CheckSongsWithMusicStaff(void) { u16 curOcarinaSongFlag; - u16 pad; + STACK_PAD(s16); u8 noNewValidInput = false; - u16 pad2; + STACK_PAD(s16); s8 staffOcarinaPlayingPosOffset = 0; u8 songIndex; OcarinaNote* curNote; @@ -1636,7 +1637,7 @@ void AudioOcarina_CheckSongsWithoutMusicStaff(void) { } // This unused argument is used in Majora's Mask as a u8 -void AudioOcarina_PlayControllerInput(u8 unused) { +void AudioOcarina_PlayControllerInput(UNUSED u8 arg0) { u32 ocarinaBtnsHeld; // Prevents two different ocarina notes from being played on two consecutive frames @@ -1919,13 +1920,12 @@ void AudioOcarina_PlaybackSong(void) { void AudioOcarina_SetRecordingSong(u8 isRecordingComplete) { u16 i; - u16 i2; - u16 pad; + STACK_PADS(s16, 2); u8 pitch; - OcarinaNote* note; + STACK_PAD(s32); u8 j; u8 k; - s32 t; + STACK_PAD(s32); OcarinaNote* recordedSong; if (sRecordingState == OCARINA_RECORD_SCARECROW_LONG) { @@ -2313,10 +2313,10 @@ void AudioOcarina_ResetStaffs(void) { #if DEBUG_FEATURES #include "debug.inc.c" #else -void AudioDebug_Draw(GfxPrint* printer) { +void AudioDebug_Draw(UNUSED GfxPrint* printer) { } -void AudioDebug_ScrPrt(const char* str, u16 num) { +void AudioDebug_ScrPrt(UNUSED const char* str, UNUSED u16 num) { } #endif @@ -2361,10 +2361,10 @@ void Audio_Update(void) { } } -void func_800F3138(UNK_TYPE arg0) { +void func_800F3138(UNUSED UNK_TYPE arg0) { } -void func_800F3140(UNK_TYPE arg0, UNK_TYPE arg1) { +void func_800F3140(UNUSED UNK_TYPE arg0, UNUSED UNK_TYPE arg1) { } void func_800F314C(s8 seqId) { @@ -2449,7 +2449,7 @@ s8 Audio_ComputeSfxReverb(u8 bankId, u8 entryIdx, u8 channelIdx) { return reverb; } -s8 Audio_ComputeSfxPanSigned(f32 x, f32 z, u8 token) { +s8 Audio_ComputeSfxPanSigned(f32 x, f32 z, UNUSED u8 token) { f32 absX; f32 absZ; f32 pan; @@ -2600,7 +2600,7 @@ u8 func_800F37B8(f32 behindScreenZ, SfxBankEntry* arg1, s8 arg2) { return (phi_v1 * 0x10) + (u8)((phi_f0 * phi_f12) / (10000.0f / 5.2f)); } -s8 func_800F3990(f32 posY, u16 sfxParams) { +s8 func_800F3990(f32 posY, UNUSED u16 sfxParams) { s8 combFilterGain = 0; if (posY >= 0.0f) { @@ -2626,7 +2626,7 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) { u8 baseFilter = 0; SfxBankEntry* entry = &gSfxBanks[bankId][entryIdx]; #if !(OOT_VERSION < NTSC_1_1 || !PLATFORM_N64) - s32 pad; + STACK_PAD(s32); #endif switch (bankId) { @@ -3634,7 +3634,7 @@ void Audio_SetBgmEnemyVolume(f32 dist) { } void Audio_UpdateMalonSinging(f32 dist, u16 seqId) { - s8 pad; + STACK_PAD(u8); s8 melodyVolume; s16 curSeqId; @@ -4082,7 +4082,7 @@ void func_800F7170(void) { AUDIOCMD_GLOBAL_STOP_AUDIOCMDS(); } -void func_800F71BC(s32 arg0) { +void func_800F71BC(UNUSED s32 arg0) { D_80133418 = 1; func_800F6C34(); AudioOcarina_ResetStaffs(); diff --git a/src/audio/game/sequence.c b/src/audio/game/sequence.c index ec9a36e299..d8a72f558e 100644 --- a/src/audio/game/sequence.c +++ b/src/audio/game/sequence.c @@ -21,6 +21,7 @@ #include "audiothread_cmd.h" #include "seqcmd.h" #include "sfx.h" +#include "stack_pad.h" #include "ultra64.h" #include "ultra64/abi.h" #include "audio.h" @@ -43,7 +44,7 @@ ActiveSequence gActiveSeqs[4]; void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration) { u8 channelIndex; u16 skipTicks; - s32 pad; + STACK_PAD(s32); if (!gStartSeqDisabled || (seqPlayerIndex == SEQ_PLAYER_SFX)) { seqArgs &= 0x7F; @@ -105,7 +106,7 @@ void Audio_ProcessSeqCmd(u32 cmd) { u8 channelIndex; u8 i; f32 freqScaleTarget; - s32 pad; + STACK_PAD(s32); #if DEBUG_FEATURES if (gAudioDebugPrintSeqCmd && (cmd & SEQCMD_OP_MASK) != (SEQCMD_OP_SET_SEQPLAYER_IO << 28)) { @@ -483,7 +484,7 @@ void Audio_UpdateActiveSequences(void) { u8 setupVal2; u8 setupVal1; u16 seqId; - s32 pad[2]; + STACK_PADS(s32, 2); u16 channelMask; u32 retMsg; f32 volume; diff --git a/src/audio/game/sfx.c b/src/audio/game/sfx.c index aef0a8eb58..ec44bd9dde 100644 --- a/src/audio/game/sfx.c +++ b/src/audio/game/sfx.c @@ -1,7 +1,9 @@ #include "array_count.h" +#include "attributes.h" #include "audiothread_cmd.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "ultra64.h" #include "audio.h" @@ -72,7 +74,7 @@ void Audio_ClearBGMMute(u8 channelIndex) { } void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd) { - u8 i; + UNUSED_NDEBUG u8 i; SfxRequest* req; if (!gSfxBankMuted[SFX_BANK_SHIFT(sfxId)]) { @@ -306,7 +308,7 @@ void Audio_ChooseActiveSfx(u8 bankId) { SfxBankEntry* entry; ActiveSfx chosenSfx[MAX_CHANNELS_PER_BANK]; ActiveSfx* activeSfx; - s32 pad; + STACK_PAD(s32); numChosenSfx = 0; for (i = 0; i < MAX_CHANNELS_PER_BANK; i++) { @@ -519,7 +521,7 @@ void Audio_PlayActiveSfx(u8 bankId) { void Audio_StopSfxByBank(u8 bankId) { SfxBankEntry* entry; - s32 pad; + STACK_PAD(s32); SfxBankEntry cmp; u8 entryIndex = gSfxBanks[bankId][0].next; @@ -714,7 +716,6 @@ u8 Audio_IsSfxPlaying(u32 sfxId) { void Audio_ResetSfx(void) { u8 bankId; u8 i; - u8 entryIndex; gSfxRequestWriteIndex = 0; gSfxRequestReadIndex = 0; diff --git a/src/audio/internal/effects.c b/src/audio/internal/effects.c index 162b72ce6b..6437109704 100644 --- a/src/audio/internal/effects.c +++ b/src/audio/internal/effects.c @@ -216,7 +216,7 @@ void Audio_NotePortamentoInit(Note* note) { note->playbackState.portamento = note->playbackState.parentLayer->portamento; } -void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut) { +void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, UNUSED s16* volOut) { adsr->action.asByte = 0; adsr->delay = 0; adsr->envelope = envelope; diff --git a/src/audio/internal/heap.c b/src/audio/internal/heap.c index 36674ded24..c1d1ccac14 100644 --- a/src/audio/internal/heap.c +++ b/src/audio/internal/heap.c @@ -1,4 +1,6 @@ #include "alignment.h" +#include "attributes.h" +#include "stack_pad.h" #include "ultra64.h" #include "versions.h" #include "audio.h" @@ -729,7 +731,7 @@ void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff) { } } -void AudioHeap_UpdateReverb(SynthesisReverb* reverb) { +void AudioHeap_UpdateReverb(UNUSED SynthesisReverb* reverb) { } void AudioHeap_UpdateReverbs(void) { @@ -843,7 +845,7 @@ s32 AudioHeap_ResetStep(void) { } void AudioHeap_Init(void) { - s32 pad1[4]; + STACK_PADS(s32, 4); s16* ramAddr; s32 persistentSize; s32 temporarySize; @@ -852,7 +854,7 @@ void AudioHeap_Init(void) { OSIntMask intMask; s32 i; s32 j; - s32 pad2; + STACK_PAD(s32); AudioSpec* spec = &gAudioSpecs[gAudioCtx.specId]; // Audio Specifications gAudioCtx.sampleDmaCount = 0; @@ -1391,7 +1393,7 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { Instrument* inst; SoundEffect* soundEffect; u32* fakematch; - s32 pad[4]; + STACK_PADS(s32, 4); sampleBankTable = gAudioCtx.sampleBankTable; numFonts = gAudioCtx.soundFontTable->header.numEntries; diff --git a/src/audio/internal/load.c b/src/audio/internal/load.c index 9989d14075..2734ecb8eb 100644 --- a/src/audio/internal/load.c +++ b/src/audio/internal/load.c @@ -7,6 +7,7 @@ #include "attributes.h" #include "buffers.h" #include "segment_symbols.h" +#include "stack_pad.h" #include "ultra64.h" #include "versions.h" #include "audio.h" @@ -121,11 +122,11 @@ void AudioLoad_DecreaseSampleDmaTtls(void) { * original name:Nas_WaveDmaCallBack */ void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium) { - s32 pad1; + STACK_PAD(s32); SampleDma* dma; s32 hasDma = false; u32 dmaDevAddr; - u32 pad2; + STACK_PAD(s32); u32 dmaIndex; u32 transfer; s32 bufferPos; @@ -217,7 +218,7 @@ void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, /** * original name: Nas_WaveDmaNew */ -void AudioLoad_InitSampleDmaBuffers(s32 numNotes) { +void AudioLoad_InitSampleDmaBuffers(UNUSED s32 numNotes) { SampleDma* dma; s32 i; s32 t2; @@ -395,12 +396,12 @@ void AudioLoad_InitTable(AudioTable* table, u32 romAddr, u16 unkMediumParam) { * original name: Nas_PreLoadBank */ SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 index; SoundFontData* fontData; s32 numFonts; s32 fontId; - s32 i; + STACK_PAD(s32); if (seqId >= gAudioCtx.numSequences) { return NULL; @@ -424,7 +425,7 @@ SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) { * original name: Nas_PreLoadSeq */ void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1) { - s32 pad; + STACK_PAD(s32); u32 defaultFontId; if (seqId < gAudioCtx.numSequences) { @@ -505,21 +506,21 @@ void AudioLoad_AsyncLoad(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesg /** * original name: Nas_PreLoadSeq_BG */ -void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue) { +void AudioLoad_AsyncLoadSeq(s32 seqId, UNUSED s32 arg1, s32 retData, OSMesgQueue* retQueue) { AudioLoad_AsyncLoad(SEQUENCE_TABLE, seqId, 0, retData, retQueue); } /** * original name: Nas_PreLoadWave_BG */ -void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue) { +void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, UNUSED s32 arg1, s32 retData, OSMesgQueue* retQueue) { AudioLoad_AsyncLoad(SAMPLE_TABLE, sampleBankId, 0, retData, retQueue); } /** * original name: Nas_PreLoadBank_BG */ -void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue) { +void AudioLoad_AsyncLoadFont(s32 fontId, UNUSED s32 arg1, s32 retData, OSMesgQueue* retQueue) { AudioLoad_AsyncLoad(FONT_TABLE, fontId, 0, retData, retQueue); } @@ -610,7 +611,7 @@ s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks /** * original name: __Nas_StartSeq */ -s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { +s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, UNUSED s32 arg2) { SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIdx]; u8* seqData; s32 index; @@ -656,7 +657,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { * original name: __Load_Seq */ u8* AudioLoad_SyncLoadSeq(s32 seqId) { - s32 pad; + STACK_PAD(s32); s32 didAllocate; if (gAudioCtx.seqLoadStatus[AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId)] == LOAD_STATUS_IN_PROGRESS) { @@ -756,7 +757,7 @@ SoundFontData* AudioLoad_SyncLoadFont(u32 fontId) { void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) { u32 size; AudioTable* table; - s32 pad; + STACK_PAD(s32); u32 medium; s32 loadStatus; u32 romAddr; @@ -1060,14 +1061,14 @@ void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium) { /** * original name: Nas_FastDiskCopy */ -void AudioLoad_SyncDmaUnkMedium(u32 devAddr, u8* addr, u32 size, s32 unkMediumParam) { +void AudioLoad_SyncDmaUnkMedium(UNUSED u32 devAddr, UNUSED u8* addr, UNUSED u32 size, UNUSED s32 unkMediumParam) { } /** * original name: Nas_StartDma */ s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ramAddr, u32 size, - OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType) { + OSMesgQueue* reqQueue, s32 medium, UNUSED const char* dmaFuncType) { OSPiHandle* handle; if (gAudioCtx.resetTimer > 16) { @@ -1129,7 +1130,7 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, s8 cachePolicy; u32 devAddr; s32 loadStatus; - s32 pad; + STACK_PAD(s32); u32 realId = AudioLoad_GetRealTableIndex(tableType, id); switch (tableType) { @@ -1268,7 +1269,7 @@ void AudioLoad_InitSoundFont(s32 fontId) { * original name: Nas_InitAudio */ void AudioLoad_Init(void* heap, u32 heapSize) { - s32 pad[18]; + STACK_PADS(s32, 18); s32 numFonts; void* ramAddr; s32 i; @@ -1582,7 +1583,7 @@ void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size) { /** * original name: __Nas_SlowDiskCopy */ -void AudioLoad_DmaSlowCopyUnkMedium(s32 devAddr, u8* ramAddr, s32 size, s32 arg3) { +void AudioLoad_DmaSlowCopyUnkMedium(UNUSED s32 devAddr, UNUSED u8* ramAddr, UNUSED s32 size, UNUSED s32 arg3) { } /** @@ -1739,7 +1740,7 @@ void AudioLoad_ProcessAsyncLoads(s32 resetStatus) { /** * original name: __BgCopyDisk */ -void AudioLoad_ProcessAsyncLoadUnkMedium(AudioAsyncLoad* asyncLoad, s32 resetStatus) { +void AudioLoad_ProcessAsyncLoadUnkMedium(UNUSED AudioAsyncLoad* asyncLoad, UNUSED s32 resetStatus) { } /** @@ -1748,7 +1749,7 @@ void AudioLoad_ProcessAsyncLoadUnkMedium(AudioAsyncLoad* asyncLoad, s32 resetSta void AudioLoad_FinishAsyncLoad(AudioAsyncLoad* asyncLoad) { u32 retMsg = asyncLoad->retMsg; u32 fontId; - u32 pad; + STACK_PAD(s32); OSMesg doneMsg; u32 sampleBankId1; u32 sampleBankId2; @@ -1850,7 +1851,7 @@ void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size) { /** * original name: __Nas_BgDiskCopy */ -void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, void* ramAddr, u32 size, s16 arg3) { +void AudioLoad_AsyncDmaUnkMedium(UNUSED u32 devAddr, UNUSED void* ramAddr, UNUSED u32 size, UNUSED s16 arg3) { } /** @@ -2035,7 +2036,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { u32 preloadIndex; u32 key; u32 nChunks; - s32 pad; + STACK_PAD(s32); if (gAudioCtx.preloadSampleStackTop > 0) { if (resetStatus != 0) { @@ -2300,10 +2301,10 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* * original name: EmemReload */ void AudioLoad_LoadPermanentSamples(void) { - s32 pad; + STACK_PAD(s32); u32 fontId; AudioTable* sampleBankTable; - s32 pad2; + STACK_PAD(s32); s32 i; sampleBankTable = AudioLoad_GetLoadTable(SAMPLE_TABLE); diff --git a/src/audio/internal/playback.c b/src/audio/internal/playback.c index 0329f0ec16..0562ab4ff0 100644 --- a/src/audio/internal/playback.c +++ b/src/audio/internal/playback.c @@ -1,11 +1,12 @@ #include "ultra64.h" #include "audio.h" +#include "stack_pad.h" void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) { f32 volLeft; f32 volRight; s32 halfPanIndex; - u64 pad; + STACK_PADS(s32, 3); u8 strongLeft; u8 strongRight; f32 vel; @@ -153,7 +154,7 @@ void Audio_NoteDisable(Note* note) { } void Audio_ProcessNotes(void) { - s32 pad[2]; + STACK_PADS(s32, 2); NoteAttributes* attrs; NoteSubEu* noteSubEu2; NoteSubEu* noteSubEu; @@ -759,7 +760,7 @@ Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit) { } void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer) { - s32 pad[3]; + STACK_PADS(s32, 3); s16 instId; NotePlaybackState* playbackState = ¬e->playbackState; NoteSubEu* sub = ¬e->noteSubEu; diff --git a/src/audio/internal/seqplayer.c b/src/audio/internal/seqplayer.c index 083acf8899..23fd98aec4 100644 --- a/src/audio/internal/seqplayer.c +++ b/src/audio/internal/seqplayer.c @@ -18,6 +18,7 @@ #include "array_count.h" #include "assert.h" #include "attributes.h" +#include "stack_pad.h" #include "ultra64.h" #include "audio.h" @@ -323,7 +324,7 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) { */ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) { SequenceLayer* layer; - s32 pad; + STACK_PAD(s32); if (channel->layers[layerIndex] == NULL) { layer = AudioSeq_AudioListPopBack(&gAudioCtx.layerFreeList); @@ -432,7 +433,7 @@ void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channel /** * original name: Nas_DeAllocSub */ -void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 channelBitsUnused) { +void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, UNUSED u16 channelBits) { SequenceChannel* channel; s32 i; @@ -476,9 +477,9 @@ void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer) { * original name: Nas_ReleaseGroup */ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) { +#if !(OOT_VERSION < NTSC_1_1 || !PLATFORM_N64) s32 finished = 0; -#if !(OOT_VERSION < NTSC_1_1 || !PLATFORM_N64) if (seqPlayer->finished == 1) { finished = 1; } @@ -1828,7 +1829,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { u8* data; u8* data2; u8* data3; - s32 pad; + STACK_PAD(s32); s32 dummy; s32 delay; diff --git a/src/audio/internal/synthesis.c b/src/audio/internal/synthesis.c index e01fbcc96c..6e1b094d41 100644 --- a/src/audio/internal/synthesis.c +++ b/src/audio/internal/synthesis.c @@ -1,4 +1,6 @@ #include "alignment.h" +#include "attributes.h" +#include "stack_pad.h" #include "ultra64.h" #include "audio.h" @@ -61,7 +63,7 @@ u8 sNumSamplesPerWavePeriod[] = { void AudioSynth_InitNextRingBuf(s32 chunkLen, s32 updateIndex, s32 reverbIndex) { ReverbRingBufferItem* bufItem; - s32 pad[3]; + STACK_PADS(s32, 3); SynthesisReverb* reverb = &gAudioCtx.synthesisReverbs[reverbIndex]; s32 temp_a0_2; s32 temp_a0_4; @@ -156,7 +158,6 @@ Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen) Acmd* cmdP; s32 i; s32 j; - SynthesisReverb* reverb; cmdP = cmdStart; for (i = gAudioCtx.audioBufferParameters.ticksPerUpdate; i > 0; i--) { @@ -480,7 +481,7 @@ void AudioSynth_LoadFilterSize(Acmd* cmd, s32 size, void* addr) { aFilter(cmd, 2, size, addr); } -Acmd* AudioSynth_LoadRingBuffer1(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) { +Acmd* AudioSynth_LoadRingBuffer1(Acmd* cmd, UNUSED s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) { ReverbRingBufferItem* ringBufferItem = &reverb->items[reverb->curFrame][updateIndex]; cmd = @@ -494,7 +495,7 @@ Acmd* AudioSynth_LoadRingBuffer1(Acmd* cmd, s32 aiBufLen, SynthesisReverb* rever return cmd; } -Acmd* AudioSynth_LoadRingBuffer2(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) { +Acmd* AudioSynth_LoadRingBuffer2(Acmd* cmd, UNUSED s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) { ReverbRingBufferItem* bufItem = &reverb->items2[reverb->curFrame][updateIndex]; cmd = AudioSynth_LoadRingBufferPart(cmd, DMEM_WET_LEFT_CH, bufItem->startPos, bufItem->lengthA, reverb); @@ -707,9 +708,9 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat return cmd; } -Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s16* aiBuf, +Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, UNUSED s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updateIndex) { - s32 pad1[3]; + STACK_PADS(s32, 3); Sample* sample; AdpcmLoop* loopInfo; s32 nSamplesUntilLoopEnd; @@ -723,7 +724,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS s32 gain; s32 frameIndex; s32 skipBytes; - s32 temp_v1_6; + STACK_PAD(s32); s16* combFilterState; s32 nSamplesToDecode; u32 sampleAddr; @@ -734,7 +735,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS s32 nSamplesToProcess; s32 phi_s4; s32 nFirstFrameSamplesToIgnore; - s32 pad2[7]; + STACK_PADS(s32, 7); s32 frameSize; s32 nFramesToDecode; s32 skipInitialSamples; @@ -758,7 +759,6 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS s32 finished; s32 aligned; s16 addr; - u16 unused; bookOffset = noteSubEu->bitField1.bookOffset; finished = noteSubEu->bitField0.finished; @@ -1158,7 +1158,7 @@ Acmd* AudioSynth_FinalResample(Acmd* cmd, NoteSynthesisState* synthState, s32 si } Acmd* AudioSynth_ProcessEnvelope(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s32 aiBufLen, - u16 dmemSrc, s32 haasEffectDelaySide, s32 flags) { + u16 dmemSrc, s32 haasEffectDelaySide, UNUSED s32 flags) { u32 dmemDests; u16 curVolLeft; u16 targetVolLeft; @@ -1170,7 +1170,7 @@ Acmd* AudioSynth_ProcessEnvelope(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS s16 rampReverb; s16 sourceReverbVol; u16 targetVolRight; - s32 pad; + STACK_PAD(s32); curVolLeft = synthState->curVolLeft; targetVolLeft = noteSubEu->targetVolLeft; diff --git a/src/audio/internal/thread.c b/src/audio/internal/thread.c index d021c4386b..a0d80cb3b7 100644 --- a/src/audio/internal/thread.c +++ b/src/audio/internal/thread.c @@ -4,6 +4,7 @@ #include "array_count.h" #include "audiothread_cmd.h" +#include "stack_pad.h" #include "ultra64.h" #include "versions.h" #include "audio.h" @@ -41,7 +42,7 @@ AudioTask* AudioThread_UpdateImpl(void) { #endif u32 samplesRemainingInAi; s32 abiCmdCnt; - s32 pad; + STACK_PAD(s32); s32 j; s32 sp5C; s16* curAiBuffer; @@ -211,7 +212,7 @@ AudioTask* AudioThread_UpdateImpl(void) { */ void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) { s32 i; - s32 pad[3]; + STACK_PADS(s32, 3); u32 flags; switch (cmd->op) { @@ -557,7 +558,7 @@ void Audio_GetSampleBankIdsOfFont(s32 fontId, u32* sampleBankId1, u32* sampleBan * original name: Nap_CheckSpecChange */ s32 func_800E5EDC(void) { - s32 pad; + STACK_PAD(s32); s32 specId; if (osRecvMesg(gAudioCtx.audioResetQueueP, (OSMesg*)&specId, OS_MESG_NOBLOCK) == -1) { @@ -585,7 +586,7 @@ void func_800E5F34(void) { s32 AudioThread_ResetAudioHeap(s32 specId) { s32 resetStatus; OSMesg msg; - s32 pad; + STACK_PAD(s32); func_800E5F34(); resetStatus = gAudioCtx.resetStatus; diff --git a/src/boot/inflate.c b/src/boot/inflate.c index 188c3f235a..b8919d1ce6 100644 --- a/src/boot/inflate.c +++ b/src/boot/inflate.c @@ -299,7 +299,7 @@ void* gzip_malloc(size_t size) { return ret; } -void gzip_free(void* ptr) { +void gzip_free(UNUSED void* ptr) { gzip_malloc_tmp = 0; gzip_malloc_addr = gzip_mem_buff; } diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 185ee77c62..1f903997e5 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,5 +1,6 @@ #include "is_debug.h" +#include "attributes.h" #include "ultra64.h" #include "versions.h" @@ -66,7 +67,7 @@ void func_800015F4(void) { #endif #if DEBUG_FEATURES -void* is_proutSyncPrintf(void* arg, const char* str, size_t count) { +void* is_proutSyncPrintf(UNUSED void* arg, const char* str, size_t count) { u32 data; s32 pos; s32 start; @@ -95,7 +96,7 @@ void* is_proutSyncPrintf(void* arg, const char* str, size_t count) { u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xFFFFFFC); s32 shift = ((3 - (start & 3)) * 8); - if (*str) { + if (*str != '\0') { osEPiReadIo(sISVHandle, addr, &data); osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xFF << shift))); diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 601d5145eb..f3dcfc5f3e 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -1,6 +1,7 @@ #include "yaz0.h" #include "alignment.h" +#include "stack_pad.h" #include "ultra64.h" #include "dma.h" @@ -14,7 +15,7 @@ size_t sYaz0CurSize; u8* sYaz0MaxPtr; void* Yaz0_FirstDMA(void) { - s32 pad[2]; + STACK_PADS(s32, 2); size_t dmaSize; size_t bufferSize; diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index a517f561ce..70fdd32bcd 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -1,5 +1,6 @@ #include "libu64/debug.h" #include "alignment.h" +#include "attributes.h" #include "carthandle.h" #include "line_numbers.h" #include "padmgr.h" @@ -29,6 +30,9 @@ typedef struct LocaleCartInfo { void Locale_Init(void) { #if !PLATFORM_GC ALIGNED(4) u8 regionInfo[4]; +#if PLATFORM_IQUE + UNUSED +#endif u8 countryCode; osEPiReadIo(gCartHandle, 0x3C, (u32*)regionInfo); diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 226465a3f6..b121c9427d 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -36,6 +36,7 @@ #include "printf.h" #include "segment_symbols.h" #include "stack.h" +#include "stack_pad.h" #include "stackcheck.h" #include "terminal.h" #include "translation.h" @@ -131,7 +132,7 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { s32 ret; size_t buffSize = gDmaMgrDmaBuffSize; #if DEBUG_FEATURES - UNUSED s32 pad; + STACK_PAD(s32); #endif if (buffSize == 0) { @@ -177,7 +178,7 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { SET_IOMSG(ioMsg, &queue, rom, ram, size); - { UNUSED s32 pad2; } + { STACK_PAD(s32); } if (gDmaMgrVerbose == 10) { PRINTF(T("%10lld ノーマルDMA %08x %08x %08x (%d)\n", "%10lld Normal DMA %08x %08x %08x (%d)\n"), @@ -249,7 +250,7 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { */ void DmaMgr_DmaFromDriveRom(void* ram, uintptr_t rom, size_t size) { #if PLATFORM_N64 - s32 pad; + STACK_PAD(s32); #endif OSPiHandle* handle = osDriveRomInit(); OSMesgQueue queue; @@ -324,7 +325,7 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er * @param vrom Virtual ROM location * @return Pointer to associated filename */ -const char* DmaMgr_FindFileName(uintptr_t vrom) { +const char* DmaMgr_FindFileName(UNUSED_NDEBUG uintptr_t vrom) { #if DEBUG_FEATURES DmaEntry* iter = gDmaDataTable; const char** name = sDmaMgrFileNames; @@ -348,7 +349,7 @@ const char* DmaMgr_FindFileName(uintptr_t vrom) { } #endif -const char* DmaMgr_GetFileName(uintptr_t vrom) { +const char* DmaMgr_GetFileName(UNUSED_NDEBUG uintptr_t vrom) { #if PLATFORM_GC && DEBUG_FEATURES const char* ret = DmaMgr_FindFileName(vrom); @@ -379,7 +380,9 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { u8 found = false; DmaEntry* iter; UNUSED_NDEBUG const char* filename; +#if !PLATFORM_GC s32 i = 0; +#endif #if DEBUG_FEATURES // Get the filename (for debugging) @@ -504,7 +507,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { } } -void DmaMgr_ThreadEntry(void* arg) { +void DmaMgr_ThreadEntry(UNUSED void* arg) { OSMesg msg; DmaRequest* req; @@ -550,9 +553,9 @@ void DmaMgr_ThreadEntry(void* arg) { * @param msg Message to send to `queue` once the transfer is complete. * @return 0 */ -s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, +s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, UNUSED u32 unk, OSMesgQueue* queue, OSMesg msg) { - static s32 sDmaMgrQueueFullLogged = 0; + UNUSED_NDEBUG static s32 sDmaMgrQueueFullLogged = 0; #if PLATFORM_IQUE PRINTF("dmacopy_bg(%x, %x, %x, %x, %x, %x, %x)\n", req, ram, vrom, size, unk, queue, msg); @@ -625,9 +628,9 @@ s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size) { } void DmaMgr_Init(void) { - const char** name; - s32 idx; - DmaEntry* iter; + UNUSED_NDEBUG const char** name; + UNUSED_NDEBUG s32 idx; + UNUSED_NDEBUG DmaEntry* iter; // DMA the dma data table to RAM DmaMgr_DmaRomToRam((uintptr_t)_dmadataSegmentRomStart, _dmadataSegmentStart, @@ -700,7 +703,7 @@ s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* s32 ret; OSMesgQueue queue; OSMesg msg; - s32 pad; + STACK_PAD(s32); req.filename = file; req.line = line; diff --git a/src/code/PreRender.c b/src/code/PreRender.c index ddf6b473ea..067e6ba7c8 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -12,6 +12,7 @@ #include "prerender.h" #include "printf.h" #include "regs.h" +#include "stack_pad.h" void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) { this->widthSave = width; @@ -725,7 +726,7 @@ void PreRender_DivotFilter(PreRender* this) { u8* buffR = alloca(this->width); u8* buffG = alloca(this->width); u8* buffB = alloca(this->width); - s32 pad2[3]; + STACK_PADS(s32, 3); s32 pxR; s32 pxG; s32 pxB; diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index 01b0072d9b..499f3ff95a 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -6,6 +6,7 @@ */ #include "array_count.h" +#include "attributes.h" #include "audiomgr.h" #include "printf.h" #include "regs.h" @@ -86,7 +87,7 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { * * @see Audio_PreNMI */ -void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) { +void AudioMgr_HandlePreNMI(UNUSED AudioMgr* audioMgr) { PRINTF( T("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n", "Audio manager received OS_SC_PRE_NMI_MSG\n")); Audio_PreNMI(); diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c index 4b2d17e72c..89e4fe3aa2 100644 --- a/src/code/code_n64dd_800AD4C0.c +++ b/src/code/code_n64dd_800AD4C0.c @@ -82,5 +82,5 @@ n64ddStruct_800FEE70_pointers* func_800AD560(void) { void func_800AD590(void) { } -void func_800AD598(s32 arg0, s32 arg1, s32 arg2) { +void func_800AD598(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2) { } diff --git a/src/code/db_camera.c b/src/code/db_camera.c index 34599c9a1c..282778eb04 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -9,6 +9,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "camera.h" #include "cutscene.h" @@ -448,7 +449,7 @@ void DebugCamera_PrintF32Bytes(f32 value) { } void DebugCamera_PrintU16Bytes(u16 value) { - u16 pad; + STACK_PAD(s16); u16 b = value; char* a = (char*)&b; @@ -456,7 +457,7 @@ void DebugCamera_PrintU16Bytes(u16 value) { } void DebugCamera_PrintS16Bytes(s16 value) { - u16 pad; + STACK_PAD(s16); s16 b = value; char* a = (char*)&b; @@ -590,7 +591,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { UNUSED Vec3f* at; Vec3f* phi_s0; Vec3f spD8; - s32 pad; + STACK_PAD(s32); Vec3f* sp90; Vec3f* sp80; Vec3f* sp7C; @@ -1672,7 +1673,7 @@ s32 DebugCamera_LoadCallback(char* c) { } s32 DebugCamera_SaveCallback(char* c) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 ret; u32 freeSize; s32 off; @@ -1742,7 +1743,7 @@ void DebugCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) { DebugCamera_ScreenTextColored(20 + x, y, colorIndex, str + 0x14); } -void DebugCamera_PrintAllCuts(Camera* cam) { +void DebugCamera_PrintAllCuts(UNUSED Camera* cam) { s32 i; Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -1772,8 +1773,7 @@ char D_8012D128[] = GFXP_KATAKANA "ト-タル "; char D_8012D13C[] = GFXP_KATAKANA "キ- / "; s32 func_800B91B0(Camera* cam, DebugCam* debugCam) { - s32 pointCount; - s32 curPoint; + STACK_PADS(s32, 2); while (sDebugCamCuts[D_8016110C].letter == '?') { D_8016110C++; @@ -1843,7 +1843,7 @@ s32 func_800B91B0(Camera* cam, DebugCam* debugCam) { return D_8016110C | 0x8000; } -void DebugCamera_Reset(Camera* cam, DebugCam* debugCam) { +void DebugCamera_Reset(UNUSED Camera* cam, DebugCam* debugCam) { s32 i; D_801612EA = '*'; diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index e7afa4ec81..df34477c52 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -45,6 +45,7 @@ "gc-us-mq:160 ique-cn:160" #include "libc64/sleep.h" +#include "attributes.h" #include "libc64/sprintf.h" #include "alloca.h" #include "array_count.h" @@ -53,6 +54,7 @@ #include "padmgr.h" #include "fault.h" #include "stack.h" +#include "stack_pad.h" #include "stackcheck.h" #include "terminal.h" #include "translation.h" @@ -663,7 +665,7 @@ OSThread* Fault_FindFaultedThread(void) { } void Fault_Wait5Seconds(void) { - s32 pad; + STACK_PAD(s32); OSTime start = osGetTime(); do { @@ -827,7 +829,7 @@ void Fault_WaitForButtonCombo(void) { } } -void Fault_DrawMemDumpContents(const char* title, uintptr_t addr, u32 arg2) { +void Fault_DrawMemDumpContents(const char* title, uintptr_t addr, UNUSED u32 arg2) { uintptr_t alignedAddr = addr; u32* writeAddr; s32 y; @@ -1109,7 +1111,7 @@ void Fault_LogStackTrace(OSThread* thread, s32 height) { uintptr_t ra = thread->context.ra; uintptr_t pc = thread->context.pc; uintptr_t addr; - s32 pad; + STACK_PAD(s32); osSyncPrintf("STACK TRACE\nSP PC (VPC)\n"); for (line = 1; line < height && (ra != 0 || sp != 0) && pc != (uintptr_t)__osCleanupThread; line++) { @@ -1185,10 +1187,10 @@ void Fault_UpdatePad(void) { #define FAULT_MSG_FAULT ((OSMesg)2) #define FAULT_MSG_UNK ((OSMesg)3) -void Fault_ThreadEntry(void* arg) { +void Fault_ThreadEntry(UNUSED void* arg) { OSMesg msg; OSThread* faultedThread; - s32 pad; + STACK_PAD(s32); // Direct OS event messages to the fault event queue osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultInstance->queue, FAULT_MSG_CPU_BREAK); @@ -1327,7 +1329,7 @@ void Fault_HungupFaultClient(const char* exp1, const char* exp2) { */ NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) { FaultClient client; - s32 pad; + STACK_PAD(s32); Fault_AddClient(&client, Fault_HungupFaultClient, (void*)exp1, (void*)exp2); *(u32*)0x11111111 = 0; // trigger an exception via unaligned memory access diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index 2d31b0f323..d09c43196f 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -8,6 +8,7 @@ #include "padmgr.h" #include "segmented_address.h" #include "stack.h" +#include "stack_pad.h" #include "stackcheck.h" #include "terminal.h" #include "thread.h" @@ -454,7 +455,7 @@ void Fault_WaitForButtonCombo(void) { s32 x; s32 y; s32 count; - s32 pad[4]; + STACK_PADS(s32, 4); // "KeyWaitB (L R Z Up Down Up Down Left Left Right Right B A START)" osSyncPrintf(VT_FGCOL(WHITE) T("KeyWaitB (LRZ ", "KeyWaitB (L R Z ") VT_FGCOL(WHITE) T("上", "Up ") @@ -625,7 +626,7 @@ void func_800AF0E0(void) { Fault_DrawText(40, 180, "Arena_failcnt = %d", gTotalAllocFailures); } -void Fault_DrawMemDumpContents(const char* title, void* memory, u32 arg2) { +void Fault_DrawMemDumpContents(const char* title, void* memory, UNUSED u32 arg2) { s32 x; s32 y; u32* ptr = (u32*)((uintptr_t)memory & ~3); @@ -661,7 +662,7 @@ void Fault_DrawMemDumpSP(OSThread* thread) { void func_800AF3DC(void) { static s32 B_80122570[16]; - static s32 B_801225B0[8]; // Unused + UNUSED static s32 B_801225B0[8]; s32 i; Fault_DrawRecBlack(22, 16, 276, 208); @@ -750,7 +751,7 @@ void Fault_ProcessClients(void) { #define FAULT_MSG_FAULT ((OSMesg)2) #define FAULT_MSG_UNK ((OSMesg)3) -void Fault_ThreadEntry(void* arg0) { +void Fault_ThreadEntry(UNUSED void* arg0) { OSMesg msg; OSThread* faultedThread; diff --git a/src/code/flg_set.c b/src/code/flg_set.c index f102d702c8..b4f3e8535f 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -7,6 +7,7 @@ #include "controller.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" typedef struct FlagSetEntry { /* 0x00 */ u16* value; @@ -83,7 +84,7 @@ void FlagSet_Update(PlayState* play) { { GfxPrint printer; - s32 pad; + STACK_PAD(s32); polyOpa = POLY_OPA_DISP; gfx = Gfx_Open(polyOpa); diff --git a/src/code/game.c b/src/code/game.c index 1f4ff8cdbf..e16cd8ee80 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libc64/os_malloc.h" #include "libu64/debug.h" #include "libu64/gfxprint.h" @@ -20,6 +21,7 @@ #include "regs.h" #include "rumble.h" #include "speed_meter.h" +#include "stack_pad.h" #include "sys_debug_controller.h" #include "terminal.h" #include "translation.h" @@ -97,7 +99,7 @@ void GameState_SetFBFilter(Gfx** gfxP) { *gfxP = gfx; } -void func_800C4344(GameState* gameState) { +void func_800C4344(UNUSED_NDEBUG GameState* gameState) { #if DEBUG_FEATURES Input* selectedInput; s32 hexDumpSize; @@ -212,7 +214,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { } if (R_ENABLE_AUDIO_DBG & 1) { - s32 pad; + STACK_PAD(s32); GfxPrint printer; GfxPrint_Init(&printer); @@ -225,7 +227,8 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { if (R_ENABLE_ARENA_DBG < 0) { #if PLATFORM_GC && DEBUG_FEATURES - s32 pad; + STACK_PAD(s32); + DebugArena_Display(); SystemArena_Display(); #endif @@ -477,7 +480,8 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g gameState->size = (u32)(gameState->init = NULL); { - s32 requiredScopeTemp; + STACK_PAD(s32); + endTime = osGetTime(); PRINTF(T("game_set_next_game_null 処理時間 %d us\n", "game_set_next_game_null processing time %d us\n"), OS_CYCLES_TO_USEC(endTime - startTime)); diff --git a/src/code/graph.c b/src/code/graph.c index 56fc7af60c..ce387fca53 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libc64/sprintf.h" #include "libu64/debug.h" #include "array_count.h" @@ -16,6 +17,7 @@ #include "regs.h" #include "setup_state.h" #include "speed_meter.h" +#include "stack_pad.h" #include "sys_cfb.h" #include "sys_debug_controller.h" #include "sys_ucode.h" @@ -184,7 +186,7 @@ void Graph_Init(GraphicsContext* gfxCtx) { #endif } -void Graph_Destroy(GraphicsContext* gfxCtx) { +void Graph_Destroy(UNUSED GraphicsContext* gfxCtx) { #if DEBUG_FEATURES func_800D3210(); Fault_RemoveClient(&sGraphFaultClient); @@ -446,7 +448,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { { OSTime timeNow = osGetTime(); - s32 pad; + STACK_PAD(s32); gRSPGfxTimeTotal = gRSPGfxTimeAcc; gRSPAudioTimeTotal = gRSPAudioTimeAcc; @@ -478,7 +480,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { #endif } -void Graph_ThreadEntry(void* arg0) { +void Graph_ThreadEntry(UNUSED void* arg) { GraphicsContext gfxCtx; GameState* gameState; u32 size; @@ -526,7 +528,7 @@ void Graph_ThreadEntry(void* arg0) { } void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) { - TwoHeadGfxArena* thga = &gfxCtx->polyOpa; + UNUSED_NDEBUG TwoHeadGfxArena* thga = &gfxCtx->polyOpa; if (HREG(59) == 1) { PRINTF("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start, @@ -536,7 +538,7 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) { } void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) { - TwoHeadGfxArena* thga = &gfxCtx->polyOpa; + UNUSED_NDEBUG TwoHeadGfxArena* thga = &gfxCtx->polyOpa; if (HREG(59) == 1) { PRINTF("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start, diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index bb9fc7841e..b221dcbec1 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -34,6 +34,7 @@ */ #include "libu64/debug.h" #include "array_count.h" +#include "attributes.h" #include "irqmgr.h" #include "printf.h" #include "stackcheck.h" @@ -248,7 +249,7 @@ void IrqMgr_HandlePreNMI480(IrqMgr* irqMgr) { } } -void IrqMgr_HandlePreNMI500(IrqMgr* irqMgr) { +void IrqMgr_HandlePreNMI500(UNUSED IrqMgr* irqMgr) { IrqMgr_CheckStacks(); } diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c index 338c6b15d9..b0cba21740 100644 --- a/src/code/jpegdecoder.c +++ b/src/code/jpegdecoder.c @@ -1,4 +1,5 @@ #include "jpeg.h" +#include "stack_pad.h" s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk); s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount); @@ -11,7 +12,7 @@ u8 sJpegBitStreamDontSkip; u32 sJpegBitStreamCurWord; s32 JpegDecoder_Decode(JpegDecoder* decoder, u16* mcuBuff, s32 count, u8 isFollowing, JpegDecoderState* state) { - s16 pad; + STACK_PAD(s16); s16 unk0; s16 unk1; s16 unk2; diff --git a/src/code/mempak.c b/src/code/mempak.c index 850c478b93..a3c67d391d 100644 --- a/src/code/mempak.c +++ b/src/code/mempak.c @@ -8,8 +8,10 @@ * 'ZELDA DEMO TOOL', encoded according to the N64 Font Code described in section 26.3 of the N64 Programming Manual. */ #include "mempak.h" +#include "attributes.h" #include "padmgr.h" #include "printf.h" +#include "stack_pad.h" #define MEMPAK_MAX_FILES 11 @@ -41,7 +43,7 @@ u8 sMempakExtName[PFS_FILE_EXT_LEN] = { 0 }; */ s32 Mempak_Init(s32 controllerNum) { OSMesgQueue* serialEventQueue; - s32 pad; + STACK_PAD(s32); s32 ret = false; serialEventQueue = PadMgr_AcquireSerialEventQueue(&gPadMgr); @@ -55,7 +57,7 @@ s32 Mempak_Init(s32 controllerNum) { return ret; } -s32 Mempak_GetFreeBytes(s32 controllerNum) { +s32 Mempak_GetFreeBytes(UNUSED s32 controllerNum) { return sMempakFreeBytes; } @@ -69,7 +71,7 @@ s32 Mempak_GetFreeBytes(s32 controllerNum) { * @param end End file letter (inclusive) * @return a bitfield where set bits indicate that the file exists */ -s32 Mempak_FindFiles(s32 controllerNum, char start, char end) { +s32 Mempak_FindFiles(UNUSED s32 controllerNum, char start, char end) { OSMesgQueue* serialEventQueue; s32 error; char letter; @@ -108,11 +110,11 @@ s32 Mempak_FindFiles(s32 controllerNum, char start, char end) { * @param size Size in bytes * @return true if the operation completed successfully, false otherwise */ -s32 Mempak_Write(s32 controllerNum, char letter, void* buffer, s32 offset, s32 size) { +s32 Mempak_Write(UNUSED s32 controllerNum, char letter, void* buffer, s32 offset, s32 size) { OSMesgQueue* serialEventQueue; s32 error; s32 ret = false; - s32 pad; + STACK_PAD(s32); serialEventQueue = PadMgr_AcquireSerialEventQueue(&gPadMgr); @@ -139,11 +141,11 @@ s32 Mempak_Write(s32 controllerNum, char letter, void* buffer, s32 offset, s32 s * @param size Size in bytes * @return true if the operation completed successfully, false otherwise */ -s32 Mempak_Read(s32 controllerNum, char letter, void* buffer, s32 offset, s32 size) { +s32 Mempak_Read(UNUSED s32 controllerNum, char letter, void* buffer, s32 offset, s32 size) { OSMesgQueue* serialEventQueue; s32 error; s32 ret = false; - s32 pad; + STACK_PAD(s32); serialEventQueue = PadMgr_AcquireSerialEventQueue(&gPadMgr); @@ -171,12 +173,12 @@ s32 Mempak_Read(s32 controllerNum, char letter, void* buffer, s32 offset, s32 si * @param size File size * @return true if the operation completed successfully, false otherwise */ -s32 Mempak_CreateFile(s32 controllerNum, char* letter, s32 size) { +s32 Mempak_CreateFile(UNUSED s32 controllerNum, char* letter, s32 size) { OSMesgQueue* serialEventQueue; s32 error; s32 ret = false; s32 i; - s32 pad; + STACK_PAD(s32); serialEventQueue = PadMgr_AcquireSerialEventQueue(&gPadMgr); @@ -236,7 +238,7 @@ s32 Mempak_CreateFile(s32 controllerNum, char* letter, s32 size) { * @param letter Memory pak file letter, in the range 'A' to ('A' + MEMPAK_MAX_FILES) * @return true if the operation completed successfully, false otherwise */ -s32 Mempak_DeleteFile(s32 controllerNum, char letter) { +s32 Mempak_DeleteFile(UNUSED s32 controllerNum, char letter) { OSMesgQueue* serialEventQueue; s32 error; s32 ret = false; @@ -261,11 +263,11 @@ s32 Mempak_DeleteFile(s32 controllerNum, char letter) { * @param letter Memory pak file letter, in the range 'A' to ('A' + MEMPAK_MAX_FILES) * @return the size of the file, or 0 if the operation failed for any reason */ -s32 Mempak_GetFileSize(s32 controllerNum, char letter) { +s32 Mempak_GetFileSize(UNUSED s32 controllerNum, char letter) { OSMesgQueue* serialEventQueue = PadMgr_AcquireSerialEventQueue(&gPadMgr); OSPfsState state; s32 error = osPfsFileState(&sMempakPfsHandle, sMempakFiles[MEMPAK_LETTER_TO_INDEX(letter)], &state); - s32 pad; + STACK_PAD(s32); PadMgr_ReleaseSerialEventQueue(&gPadMgr, serialEventQueue); diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 01a952c876..e8d063f97f 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -292,18 +292,19 @@ void PadMgr_RumbleSet(PadMgr* padMgr, u8* enable) { void PadMgr_UpdateInputs(PadMgr* padMgr) { s32 i; Input* input; - OSContPad* pad; // original name: "padnow1" + OSContPad* contPad; // original name: "padnow1" s32 buttonDiff; PadMgr_LockPadData(padMgr); - for (input = &padMgr->inputs[0], pad = &padMgr->pads[0], i = 0; i < padMgr->nControllers; i++, input++, pad++) { + for (input = &padMgr->inputs[0], contPad = &padMgr->pads[0], i = 0; i < padMgr->nControllers; + i++, input++, contPad++) { input->prev = input->cur; - switch (pad->errno) { + switch (contPad->errno) { case 0: // No error, copy inputs - input->cur = *pad; + input->cur = *contPad; if (!padMgr->ctrlrIsConnected[i]) { padMgr->ctrlrIsConnected[i] = true; PADMGR_LOG(i, T("認識しました", "Recognized")); @@ -320,7 +321,7 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) { input->cur.button = 0; input->cur.stick_x = 0; input->cur.stick_y = 0; - input->cur.errno = pad->errno; + input->cur.errno = contPad->errno; if (padMgr->ctrlrIsConnected[i]) { // If we get no response, consider the controller disconnected padMgr->ctrlrIsConnected[i] = false; @@ -331,7 +332,7 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) { break; default: // Unknown error response - LOG_HEX("padnow1->errno", pad->errno, "../padmgr.c", 396); + LOG_HEX("padnow1->errno", contPad->errno, "../padmgr.c", 396); Fault_AddHungupAndCrash("../padmgr.c", LN3(379, 382, 397, 397)); break; } diff --git a/src/code/sched.c b/src/code/sched.c index fe1d14a0c2..87f09710b8 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -40,6 +40,7 @@ * @see irqmgr.c */ #include "libu64/debug.h" +#include "attributes.h" #include "libu64/rcp_utils.h" #include "array_count.h" #include "fault.h" @@ -161,7 +162,7 @@ void Sched_SwapFrameBuffer(Scheduler* sc, CfbInfo* cfbInfo) { #endif } -void Sched_HandlePreNMI(Scheduler* sc) { +void Sched_HandlePreNMI(UNUSED_NDEBUG Scheduler* sc) { #if DEBUG_FEATURES OSTime now; @@ -192,7 +193,7 @@ void Sched_HandlePreNMI(Scheduler* sc) { #endif } -void Sched_HandleNMI(Scheduler* sc) { +void Sched_HandleNMI(UNUSED Scheduler* sc) { // black the screen and reset the VI y scale just in time for NMI reset #if OOT_VERSION < PAL_1_0 osViSetYScale(1.0f); @@ -688,7 +689,8 @@ void Sched_ThreadEntry(void* arg) { } } -void Sched_Init(Scheduler* sc, void* stack, OSPri priority, u8 viModeType, UNK_TYPE arg4, IrqMgr* irqMgr) { +void Sched_Init(Scheduler* sc, void* stack, OSPri priority, UNUSED u8 viModeType, UNUSED UNK_TYPE arg4, + IrqMgr* irqMgr) { bzero(sc, sizeof(Scheduler)); sc->isFirstSwap = true; diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index 0216275f17..a30cf3d56d 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -1,12 +1,14 @@ #pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0" \ "pal-1.0:0 pal-1.1:0" #include "libc64/malloc.h" +#include "attributes.h" #include "libu64/debug.h" #include "array_count.h" #include "gfx.h" #include "printf.h" #include "regs.h" #include "speed_meter.h" +#include "stack_pad.h" #include "terminal.h" #include "zelda_arena.h" #include "game.h" @@ -112,18 +114,18 @@ void SpeedMeter_Init(SpeedMeter* this) { SpeedMeter_InitImpl(this, 32, 22); } -void SpeedMeter_Destroy(SpeedMeter* this) { +void SpeedMeter_Destroy(UNUSED SpeedMeter* this) { } void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) { - s32 pad[2]; + STACK_PADS(s32, 2); u32 baseX = 32; s32 width; s32 i; s32 uly; s32 lry; View view; - u32 pad2[3]; + STACK_PADS(s32, 3); Gfx* gfx; uly = this->y; @@ -224,8 +226,8 @@ void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxC } } -void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state) { - s32 pad1[2]; +void SpeedMeter_DrawAllocEntries(UNUSED SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state) { + STACK_PADS(s32, 2); u32 ulx = 30; u32 lrx = 290; SpeedMeterAllocEntry entry; diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 5f41973ffe..fe22673d7c 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -1,6 +1,7 @@ #include "sys_math3d.h" #include "printf.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "ultra64.h" @@ -160,7 +161,7 @@ void Math3D_FindPointOnPlaneIntersect(f32 planeAAxis1Norm, f32 planeAAxis2Norm, */ s32 Math3D_PlaneVsPlaneNewLine(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, InfiniteLine* intersect) { - char pad[4]; + STACK_PAD(s32); Vec3f planeANormal; Vec3f planeBNormal; f32 dirX; @@ -1641,7 +1642,7 @@ s32 Math3D_CylVsLineSeg(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, V f32 fracB; f32 fracBase; f32 zero = 0.0f; - f32 pad; + STACK_PAD(s32); f32 cylRadiusSq; f32 radSqDiff; f32 distCent2; @@ -1833,7 +1834,7 @@ s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect) { Vec3f cylIntersectCenter; Vec3f midpointv0v1; Vec3f diffMidpointIntersect; - s32 pad; + STACK_PAD(s32); cylBottom = (f32)cyl->pos.y + cyl->yShift; cylTop = cyl->height + cylBottom; diff --git a/src/code/sys_math3d_draw.c b/src/code/sys_math3d_draw.c index 2b8776ec68..40e4414d78 100644 --- a/src/code/sys_math3d_draw.c +++ b/src/code/sys_math3d_draw.c @@ -1,8 +1,9 @@ #include "sys_math3d.h" +#include "attributes.h" #include "play_state.h" -void Math3D_DrawSphere(PlayState* play, Sphere16* sph) { +void Math3D_DrawSphere(UNUSED PlayState* play, UNUSED Sphere16* sph) { } -void Math3D_DrawCylinder(PlayState* play, Cylinder16* cyl) { +void Math3D_DrawCylinder(UNUSED PlayState* play, UNUSED Cylinder16* cyl) { } diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index b773d20e47..9b904167f1 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -4,6 +4,7 @@ #include "fault.h" #endif #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "ultra64.h" #include "z_lib.h" @@ -788,7 +789,7 @@ void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag) { f32 temp; f32 temp2; f32 temp3; - f32 temp4; + STACK_PAD(s32); temp = mf->xz; temp *= temp; @@ -841,7 +842,7 @@ void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) { f32 temp; f32 temp2; f32 temp3; - f32 temp4; + STACK_PAD(s32); temp = mf->xx; temp *= temp; diff --git a/src/code/sys_rumble.c b/src/code/sys_rumble.c index 57f61c9214..b07610b42e 100644 --- a/src/code/sys_rumble.c +++ b/src/code/sys_rumble.c @@ -13,6 +13,7 @@ * @note Original filename is likely sys_vibrate.c or similar as it is ordered after sys_ucode.c */ #include "rumble.h" +#include "attributes.h" #include "padmgr.h" /** @@ -147,7 +148,7 @@ void RumbleMgr_Init(RumbleMgr* rumbleMgr) { rumbleMgr->updateEnabled = true; } -void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) { +void RumbleMgr_Destroy(UNUSED_NDEBUG RumbleMgr* rumbleMgr) { #if DEBUG_FEATURES bzero(rumbleMgr, sizeof(RumbleMgr)); #endif diff --git a/src/code/title_setup.c b/src/code/title_setup.c index c4020bbd14..e1850e86d5 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,4 +1,5 @@ #include "console_logo_state.h" +#include "attributes.h" #include "setup_state.h" #include "printf.h" #include "translation.h" @@ -11,7 +12,7 @@ void Setup_InitImpl(SetupState* this) { SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, ConsoleLogoState); } -void Setup_Destroy(GameState* thisx) { +void Setup_Destroy(UNUSED GameState* thisx) { } void Setup_Init(GameState* thisx) { diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index 8d1ff6cd77..0eba706bad 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -1,8 +1,10 @@ #include "libu64/mtxuty-cvt.h" #include "ultra64/gs2dex.h" #include "array_count.h" +#include "attributes.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "translation.h" #include "ucode_disas.h" #include "ultra64.h" @@ -218,7 +220,7 @@ void UCodeDisas_Init(UCodeDisas* this) { } } -void UCodeDisas_Destroy(UCodeDisas* this) { +void UCodeDisas_Destroy(UNUSED UCodeDisas* this) { } void UCodeDisas_SetCurUCodeImpl(UCodeDisas* this, void* ptr) { @@ -328,7 +330,7 @@ void UCodeDisas_PrintVertices(UCodeDisas* this, Vtx* vtx, s32 count, s32 start) } void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { - u32 pad; + STACK_PAD(s32); uintptr_t addr; u32 rdpHalf; u16 linkDlLow; @@ -1016,7 +1018,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { } case G_MOVEWORD: { - u32 pad; + STACK_PAD(s32); Gdma dma = ptr->dma; Gmovewd movewd = ptr->movewd; @@ -1202,7 +1204,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) { } break; case G_MOVEWORD: { - u32 pad[2]; + STACK_PADS(s32, 2); Gmovewd movewd = ptr->movewd; switch (movewd.index) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index dfec9188f9..ba4ef9044f 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,4 +1,5 @@ #include "libc64/math64.h" +#include "attributes.h" #include "libu64/overlay.h" #include "array_count.h" #include "fault.h" @@ -11,6 +12,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -68,7 +70,7 @@ void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, shape->shadowAlpha = 255; } -void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist, Color_RGBA8* color) { +void ActorShadow_Draw(Actor* actor, UNUSED Lights* lights, PlayState* play, Gfx* dlist, Color_RGBA8* color) { f32 temp1; f32 temp2; MtxF sp60; @@ -130,10 +132,10 @@ void ActorShadow_DrawHorse(Actor* actor, Lights* lights, PlayState* play) { } void ActorShadow_DrawFoot(PlayState* play, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { - s32 pad1; + STACK_PAD(s32); f32 sp58; f32 temp; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 1661); @@ -343,7 +345,7 @@ void Attention_InitReticle(Attention* attention, s32 actorCategory, PlayState* p } } -void Attention_SetNaviState(Attention* attention, Actor* actor, s32 actorCategory, PlayState* play) { +void Attention_SetNaviState(Attention* attention, Actor* actor, s32 actorCategory, UNUSED PlayState* play) { attention->naviHoverPos.x = actor->focus.pos.x; attention->naviHoverPos.y = actor->focus.pos.y + (actor->lockOnArrowOffset * actor->scale.y); attention->naviHoverPos.z = actor->focus.pos.z; @@ -500,7 +502,7 @@ void Attention_Draw(Attention* attention, PlayState* play) { } void Attention_Update(Attention* attention, Player* player, Actor* playerFocusActor, PlayState* play) { - s32 pad; + STACK_PAD(s32); Actor* actor; // used for both the Navi hover actor and reticle actor s32 category; Vec3f projectedFocusPos; @@ -776,11 +778,11 @@ void Flags_SetCollectible(PlayState* play, s32 flag) { } } -void TitleCard_Init(PlayState* play, TitleCardContext* titleCtx) { +void TitleCard_Init(UNUSED PlayState* play, TitleCardContext* titleCtx) { titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0; } -void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, +void TitleCard_InitBossName(UNUSED PlayState* play, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, u8 height) { titleCtx->texture = texture; titleCtx->x = x; @@ -809,7 +811,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* titleCtx->delayTimer = delay; } -void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { +void TitleCard_Update(UNUSED PlayState* play, TitleCardContext* titleCtx) { if (DECR(titleCtx->delayTimer) == 0) { if (DECR(titleCtx->durationTimer) == 0) { Math_StepToS(&titleCtx->alpha, 0, 30); @@ -957,8 +959,8 @@ void Actor_Init(Actor* actor, PlayState* play) { } void Actor_Destroy(Actor* actor, PlayState* play) { - ActorOverlay* overlayEntry; - char* name; + UNUSED_NDEBUG ActorOverlay* overlayEntry; + UNUSED_NDEBUG char* name; if (actor->destroy != NULL) { actor->destroy(actor, play); @@ -1131,7 +1133,7 @@ f32 Player_GetHeight(Player* player) { } f32 func_8002DCE4(Player* player) { - s32 pad; + STACK_PAD(s32); if (player->stateFlags1 & PLAYER_STATE1_23) { return 8.0f; @@ -1186,13 +1188,13 @@ void Actor_SwapHookshotAttachment(PlayState* play, Actor* srcActor, Actor* destA srcActor->flags &= ~ACTOR_FLAG_HOOKSHOT_ATTACHED; } -void Actor_RequestHorseCameraSetting(PlayState* play, Player* player) { +void Actor_RequestHorseCameraSetting(PlayState* play, UNUSED Player* player) { if ((play->roomCtx.curRoom.type != ROOM_TYPE_4) && Play_CamIsNotFixed(play)) { Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); } } -void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) { +void Actor_MountHorse(UNUSED PlayState* play, Player* player, Actor* horse) { player->rideActor = horse; player->stateFlags1 |= PLAYER_STATE1_23; horse->child = &player->actor; @@ -1741,7 +1743,7 @@ s32 Attention_ShouldReleaseLockOn(Actor* actor, Player* player, s32 ignoreLeash) * * @return true if the talk offer was accepted, false otherwise */ -s32 Actor_TalkOfferAccepted(Actor* actor, PlayState* play) { +s32 Actor_TalkOfferAccepted(Actor* actor, UNUSED PlayState* play) { if (actor->flags & ACTOR_FLAG_TALK) { actor->flags &= ~ACTOR_FLAG_TALK; return true; @@ -1801,7 +1803,7 @@ s32 Actor_OfferTalkNearColChkInfoCylinder(Actor* actor, PlayState* play) { return Actor_OfferTalk(actor, play, cylRadius); } -u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play) { +u32 Actor_TextboxIsClosing(UNUSED Actor* actor, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { return true; } else { @@ -1824,7 +1826,7 @@ void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y) { *y = projectedPos.y * cappedInvW * -(SCREEN_HEIGHT / 2) + (SCREEN_HEIGHT / 2); } -u32 Actor_HasParent(Actor* actor, PlayState* play) { +u32 Actor_HasParent(Actor* actor, UNUSED PlayState* play) { if (actor->parent != NULL) { return true; } else { @@ -1890,7 +1892,7 @@ s32 Actor_OfferCarry(Actor* actor, PlayState* play) { return Actor_OfferGetItemNearby(actor, play, GI_NONE); } -u32 Actor_HasNoParent(Actor* actor, PlayState* play) { +u32 Actor_HasNoParent(Actor* actor, UNUSED PlayState* play) { if (actor->parent == NULL) { return true; } else { @@ -1898,7 +1900,7 @@ u32 Actor_HasNoParent(Actor* actor, PlayState* play) { } } -void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play) { +void func_8002F5C4(Actor* actorA, Actor* actorB, UNUSED PlayState* play) { Actor* parent = actorA->parent; if (parent->id == ACTOR_PLAYER) { @@ -1921,7 +1923,7 @@ void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play) { } } -s32 Actor_IsMounted(PlayState* play, Actor* horse) { +s32 Actor_IsMounted(UNUSED PlayState* play, Actor* horse) { if (horse->child != NULL) { return true; } else { @@ -1943,7 +1945,7 @@ u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { return false; } -s32 Actor_NotMounted(PlayState* play, Actor* horse) { +s32 Actor_NotMounted(UNUSED PlayState* play, Actor* horse) { if (horse->child == NULL) { return true; } else { @@ -1962,7 +1964,8 @@ s32 Actor_NotMounted(PlayState* play, Actor* horse) { * @param type PlayerKnockbackType * @param damage additional amount of damage to deal to the player */ -void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage) { +void Actor_SetPlayerKnockback(PlayState* play, UNUSED Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, + u32 damage) { Player* player = GET_PLAYER(play); player->knockbackDamage = damage; @@ -2537,7 +2540,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } void Actor_FaultPrint(Actor* actor, char* command) { - ActorOverlay* overlayEntry; + UNUSED_NDEBUG ActorOverlay* overlayEntry; char* name; if ((actor == NULL) || (actor->overlayEntry == NULL)) { @@ -2841,7 +2844,7 @@ s32 Actor_CullingCheck(PlayState* play, Actor* actor) { * This interactive 3D graph visualizes the shape of the culling volume and has sliders for the 3 properties mentioned * above: https://www.desmos.com/3d/4ztkxqky2a. */ -s32 Actor_CullingVolumeTest(PlayState* play, Actor* actor, Vec3f* projPos, f32 projW) { +s32 Actor_CullingVolumeTest(UNUSED PlayState* play, Actor* actor, Vec3f* projPos, f32 projW) { f32 invW; if ((projPos->z > -actor->cullingVolumeScale) && @@ -2890,8 +2893,8 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { actor = actorListEntry->head; while (actor != NULL) { - ActorOverlay* overlayEntry = actor->overlayEntry; - char* actorName; + UNUSED_NDEBUG ActorOverlay* overlayEntry = actor->overlayEntry; + UNUSED_NDEBUG char* actorName; #if DEBUG_FEATURES actorName = overlayEntry->name != NULL ? overlayEntry->name : ""; @@ -3007,7 +3010,7 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) { u8 sEnemyActorCategories[] = { ACTORCAT_ENEMY, ACTORCAT_BOSS }; -void Actor_FreezeAllEnemies(PlayState* play, ActorContext* actorCtx, s32 duration) { +void Actor_FreezeAllEnemies(UNUSED PlayState* play, ActorContext* actorCtx, s32 duration) { Actor* actor; s32 i; @@ -3159,13 +3162,13 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) { Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params) { - s32 pad; + STACK_PAD(s32); Actor* actor; ActorProfile* profile; s32 objectSlot; ActorOverlay* overlayEntry; uintptr_t temp; - char* name; + UNUSED_NDEBUG char* name; u32 overlaySize; overlayEntry = &gActorOverlayTable[actorId]; @@ -3635,7 +3638,7 @@ s16 FaceChange_UpdateRandomSet(FaceChange* faceChange, s16 changeTimerBase, s16 return faceChange->face; } -void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { +void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, UNUSED PlayState* play) { if ((bodyBreak->matrices = ZELDA_ARENA_MALLOC((count + 1) * sizeof(*bodyBreak->matrices), "../z_actor.c", 7540)) != NULL && (bodyBreak->dLists = ZELDA_ARENA_MALLOC((count + 1) * sizeof(*bodyBreak->dLists), "../z_actor.c", 7543)) != @@ -3792,7 +3795,7 @@ void func_80033480(PlayState* play, Vec3f* posBase, f32 randRangeDiameter, s32 a } } -Actor* Actor_GetCollidedExplosive(PlayState* play, Collider* collider) { +Actor* Actor_GetCollidedExplosive(UNUSED PlayState* play, Collider* collider) { if ((collider->acFlags & AC_HIT) && (collider->ac->category == ACTORCAT_EXPLOSIVE)) { collider->acFlags &= ~AC_HIT; return collider->ac; @@ -4388,8 +4391,7 @@ s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex) { */ s16 Npc_UpdateAutoTurn(Actor* actor, NpcInteractInfo* interactInfo, f32 distanceRange, s16 maxYawForPlayerTracking, s16 trackingMode) { - - s32 pad; + STACK_PAD(s32); s16 yaw; s16 yawDiff; @@ -4606,7 +4608,7 @@ void Actor_UpdateFidgetTables(PlayState* play, s16* fidgetTableY, s16* fidgetTab } } -void Actor_Noop(Actor* actor, PlayState* play) { +void Actor_Noop(UNUSED Actor* actor, UNUSED PlayState* play) { } s32 func_80035124(Actor* actor, PlayState* play) { @@ -4820,8 +4822,8 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3) { /** * Spawns En_Part (Dissipating Flames) actor as a child of the given actor. */ -Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, PlayState* play, - s16 params, Gfx* dList) { +Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, UNUSED s16* arg5, + PlayState* play, s16 params, Gfx* dList) { EnPart* spawnedEnPart; spawnedEnPart = (EnPart*)Actor_SpawnAsChild(&play->actorCtx, actor, play, ACTOR_EN_PART, spawnPos->x, spawnPos->y, @@ -4852,7 +4854,7 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) { f32 sp28; f32 sp24; CollisionPoly* floorPoly; - s32 pad; + STACK_PAD(s32); floorPoly = actor->floorPoly; floorPolyNormalX = COLPOLY_GET_NORMAL(floorPoly->normal.x); @@ -6115,12 +6117,12 @@ u16 func_80037C30(PlayState* play, s16 arg1) { return func_80035BFC(play, arg1); } -s32 func_80037C5C(PlayState* play, s16 arg1, u16 textId) { +s32 func_80037C5C(UNUSED PlayState* play, s16 arg1, u16 textId) { func_80036E50(textId, arg1); return false; } -s32 func_80037C94(PlayState* play, Actor* actor, s32 arg2) { +s32 func_80037C94(PlayState* play, Actor* actor, UNUSED s32 arg2) { return func_800374E0(play, actor, actor->textId); } diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 1e3c6c96ba..13ab613745 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,4 +1,5 @@ #include "fault.h" +#include "attributes.h" #include "printf.h" #include "segment_symbols.h" #include "z_actor_dlftbls.h" @@ -97,7 +98,7 @@ void ActorOverlayTable_LogPrint(void) { #endif } -void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { +void ActorOverlayTable_FaultPrint(UNUSED void* arg0, UNUSED void* arg1) { ActorOverlay* overlayEntry; u32 overlaySize; uintptr_t ramStart; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 9e71fa6287..e0bd6f2f20 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -5,6 +5,7 @@ #include "printf.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "terminal.h" #include "translation.h" @@ -151,7 +152,7 @@ void DynaSSNodeList_SetSSListHead(DynaSSNodeList* nodeList, SSList* ssList, s16* /** * Initialize DynaSSNodeList */ -void DynaSSNodeList_Initialize(PlayState* play, DynaSSNodeList* nodeList) { +void DynaSSNodeList_Initialize(UNUSED PlayState* play, DynaSSNodeList* nodeList) { nodeList->tbl = NULL; nodeList->count = 0; } @@ -247,7 +248,7 @@ void func_80038A28(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest) { f32 nx; f32 ny; f32 nz; - s32 pad; + STACK_PAD(s32); f32 xx; f32 zz; f32 yz; @@ -525,7 +526,7 @@ void StaticLookup_AddPolyToSSList(CollisionContext* colCtx, SSList* ssList, Coll while (true) { // if at the end of the list if (curNode->next == SS_NULL) { - s32 pad; + STACK_PAD(s32); newNodeId = SSNodeList_GetNextNodeIdx(&colCtx->polyNodes); SSNode_SetValue(&colCtx->polyNodes.tbl[newNodeId], &polyId, SS_NULL); @@ -659,8 +660,9 @@ f32 BgCheck_RaycastDownStatic(StaticLookup* lookup, CollisionContext* colCtx, u1 * returns true if `wallPolyPtr` was changed * `invXZlength` is 1 / sqrt( sq(poly.normal.x) + sq(poly.normal.z) ) */ -s32 BgCheck_ComputeWallDisplacement(CollisionContext* colCtx, CollisionPoly* poly, f32* posX, f32* posZ, f32 nx, f32 ny, - f32 nz, f32 invXZlength, f32 planeDist, f32 radius, CollisionPoly** wallPolyPtr) { +s32 BgCheck_ComputeWallDisplacement(CollisionContext* colCtx, CollisionPoly* poly, f32* posX, f32* posZ, f32 nx, + UNUSED f32 ny, f32 nz, f32 invXZlength, f32 planeDist, f32 radius, + CollisionPoly** wallPolyPtr) { CollisionPoly* wallPoly; u32 surfaceData; u32 hasFlag27; @@ -708,7 +710,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 f32 nx; f32 ny; f32 nz; - s32 pad; + STACK_PAD(s32); Vec3s* vtxList; f32 temp_f16; f32 zMin; @@ -902,7 +904,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly) { s32 result = false; - u16 nextId; + STACK_PAD(s32); CollisionPoly* curPoly; CollisionPoly* polyList; f32 ceilingY; @@ -1067,7 +1069,7 @@ s32 BgCheck_SphVsFirstStaticPolyList(SSNode* node, u16 xpFlags, CollisionContext Vec3s* vtxList = colCtx->colHeader->vtxList; while (true) { - u16 nextId; + STACK_PAD(s16); s16 curPolyId = node->polyId; CollisionPoly* curPoly = &polyList[curPolyId]; @@ -1397,7 +1399,7 @@ s32 BgCheck_PolyIntersectsSubdivision(Vec3f* min, Vec3f* max, CollisionPoly* pol * Initialize StaticLookup Table * returns size of table, in bytes */ -u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, PlayState* play, StaticLookup* lookupTbl) { +u32 BgCheck_InitializeStaticLookup(CollisionContext* colCtx, UNUSED PlayState* play, StaticLookup* lookupTbl) { Vec3s* vtxList; CollisionPoly* polyList; s32 polyMax; @@ -1556,7 +1558,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader u32 memSize; UNUSED_NDEBUG u32 lookupTblMemSize; s32 customNodeListMax; - SSNodeList* nodeList; + STACK_PAD(s32); u32 customMemSize; s32 useCustomSubdivisions; s32 i; @@ -1714,7 +1716,7 @@ s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos) { f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* pos, Actor* actor, u32 downChkFlags, f32 chkDist) { f32 yIntersectDyna; - s32* temp_a0; + STACK_PAD(s32); StaticLookup* lookupTbl; Vec3f checkPos; StaticLookup* lookup; @@ -2466,7 +2468,7 @@ s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec * ignores `actor` dyna poly * returns true if any poly intersects the sphere, else false * `outPoly` returns the pointer of the first poly found that intersects - * `outBgId` returns the bgId of the entity that owns `outPoly` + * @bug `outBgId` always returns BGCHECK_SCENE due to a bug in `BgCheck_SphVsFirstDynaPoly` */ s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* center, f32 radius, Actor* actor, u16 bciFlags) { @@ -2623,7 +2625,7 @@ void DynaLookup_ResetVtxStartIndex(u16* vtxStartIndex) { /** * Initialize BgActor */ -void BgActor_Initialize(PlayState* play, BgActor* bgActor) { +void BgActor_Initialize(UNUSED PlayState* play, BgActor* bgActor) { bgActor->actor = NULL; bgActor->colHeader = NULL; ScaleRotPos_Initialize(&bgActor->prevTransform); @@ -2689,7 +2691,7 @@ void DynaPoly_AllocVtxList(PlayState* play, Vec3s** vtxList, s32 numVtx) { /** * Update BgActor's prevTransform */ -void DynaPoly_SetBgActorPrevTransform(PlayState* play, BgActor* bgActor) { +void DynaPoly_SetBgActorPrevTransform(UNUSED PlayState* play, BgActor* bgActor) { bgActor->prevTransform = bgActor->curTransform; } @@ -2737,7 +2739,7 @@ void DynaPoly_Alloc(PlayState* play, DynaCollisionContext* dyna) { * Set BgActor * original name: DynaPolyInfo_setActor */ -s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader) { +s32 DynaPoly_SetBgActor(UNUSED PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader) { s32 bgId; s32 foundSlot = false; @@ -2779,28 +2781,28 @@ DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId) { return (DynaPolyActor*)colCtx->dyna.bgActors[bgId].actor; } -void DynaPoly_DisableCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId) { +void DynaPoly_DisableCollision(UNUSED PlayState* play, DynaCollisionContext* dyna, s32 bgId) { if (DynaPoly_IsBgIdBgActor(bgId)) { dyna->bgActorFlags[bgId] |= BGACTOR_COLLISION_DISABLED; dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; } } -void DynaPoly_EnableCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId) { +void DynaPoly_EnableCollision(UNUSED PlayState* play, DynaCollisionContext* dyna, s32 bgId) { if (DynaPoly_IsBgIdBgActor(bgId)) { dyna->bgActorFlags[bgId] &= ~BGACTOR_COLLISION_DISABLED; dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; } } -void DynaPoly_DisableCeilingCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId) { +void DynaPoly_DisableCeilingCollision(UNUSED PlayState* play, DynaCollisionContext* dyna, s32 bgId) { if (DynaPoly_IsBgIdBgActor(bgId)) { dyna->bgActorFlags[bgId] |= BGACTOR_CEILING_COLLISION_DISABLED; dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; } } -void DynaPoly_EnableCeilingCollision(PlayState* play, DynaCollisionContext* dyna, s32 bgId) { +void DynaPoly_EnableCeilingCollision(UNUSED PlayState* play, DynaCollisionContext* dyna, s32 bgId) { if (DynaPoly_IsBgIdBgActor(bgId)) { dyna->bgActorFlags[bgId] &= ~BGACTOR_CEILING_COLLISION_DISABLED; dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; @@ -2848,25 +2850,25 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI } } -void DynaPoly_InvalidateLookup(PlayState* play, DynaCollisionContext* dyna) { +void DynaPoly_InvalidateLookup(UNUSED PlayState* play, DynaCollisionContext* dyna) { dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; } /** * original name: DynaPolyInfo_expandSRT */ -void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex, +void DynaPoly_AddBgActorToLookup(UNUSED PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex, s32* polyStartIndex) { MtxF mtx; Actor* actor; - s32 pad; + STACK_PAD(s32); f32 radiusSq; f32 numVtxInverse; s32 i; Vec3f pos; Sphere16* sphere; Vec3s* dVtxList; - Vec3s* point; + STACK_PAD(s32); Vec3f newCenterPoint; f32 newRadiusSq; CollisionHeader* pbgdata; @@ -2954,7 +2956,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 for (i = 0; i < pbgdata->numVertices; i++) { Vec3f vtx; Vec3f vtxT; // Vtx after mtx transform - s32 pad2; + STACK_PAD(s32); Math_Vec3s_ToVec3f(&vtx, &pbgdata->vtxList[i]); SkinMatrix_Vec3fMtxFMultXYZ(&mtx, &vtx, &vtxT); @@ -3279,7 +3281,7 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { vtxList = dynaRaycastDown->dyna->bgActors[*dynaRaycastDown->bgId].colHeader->vtxList; for (i2 = 0; i2 < 3; i2++) { - s32 pad; + STACK_PAD(s32); Math_Vec3s_ToVec3f(&vtx, &vtxList[COLPOLY_VTX_INDEX(poly->vtxData[i2])]); SkinMatrix_Vec3fMtxFMultXYZ(&srpMtx, &vtx, &polyVtx[i2]); @@ -3317,7 +3319,7 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCollisionContext* dyna, SSList* ssList, f32* outX, f32* outZ, CollisionPoly** outPoly, s32* outBgId, Vec3f* pos, f32 radius, s32 bgId) { - f32 temp; + STACK_PAD(s32); f32 intersect; s32 result = false; CollisionPoly* poly; @@ -3561,8 +3563,8 @@ s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* * `outPoly` returns the poly collided with * `outY` returns the y coordinate needed to not collide with `outPoly` */ -s32 BgCheck_CheckDynaCeilingList(CollisionContext* colCtx, u16 xpFlags, DynaCollisionContext* dyna, SSList* ssList, - f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly) { +s32 BgCheck_CheckDynaCeilingList(UNUSED CollisionContext* colCtx, u16 xpFlags, DynaCollisionContext* dyna, + SSList* ssList, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly) { s16 polyId; SSNode* curNode; CollisionPoly* poly; @@ -3574,7 +3576,7 @@ s32 BgCheck_CheckDynaCeilingList(CollisionContext* colCtx, u16 xpFlags, DynaColl f32 nz; s32 result = false; f32 intersectDist; - u16 padding; + STACK_PAD(s16); if (ssList->head == SS_NULL) { return false; @@ -3634,7 +3636,7 @@ s32 BgCheck_CheckDynaCeiling(CollisionContext* colCtx, u16 xpFlags, f32* outY, V s32 result = false; f32 resultY; f32 tempY = chkDist + pos->y; - BgActor* bgActor; + STACK_PAD(s32); CollisionPoly* poly; resultY = tempY; @@ -3767,7 +3769,7 @@ s32 BgCheck_CheckLineAgainstBgActor(CollisionContext* colCtx, u16 xpFlags, Vec3f s32 BgCheck_CheckLineAgainstDyna(CollisionContext* colCtx, u16 xpFlags, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, f32* distSq, s32* outBgId, Actor* actor, f32 chkDist, s32 bccFlags) { - s32 pad; + STACK_PAD(s32); s32 i; s32 result = false; Linef line; @@ -3871,9 +3873,10 @@ s32 BgCheck_SphVsFirstDynaPolyInBgActor(CollisionContext* colCtx, u16 xpFlags, C /** * Gets first dyna poly intersecting sphere `center` `radius` * returns true if poly detected, else false - * `outPoly` returns the first intersecting poly, while `outBgId` returns the BgActor index of that poly + * `outPoly` returns the first intersecting poly + * @bug the bg ID is never written out to `outBgId` */ -s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, +s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, UNUSED s32* outBgId, Vec3f* center, f32 radius, Actor* actor, u16 bciFlags) { s32 i = 0; Sphere16 testSphere; @@ -4267,7 +4270,7 @@ f32 sZorasDomainWaterBoxMaxZ = -967.0f; s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { if (play->sceneId == SCENE_ZORAS_DOMAIN) { - s32 pad; + STACK_PAD(s32); if (sZorasDomainWaterBoxMinX < x && x < sZorasDomainWaterBoxMaxX && sZorasDomainWaterBoxMinY < *ySurface && *ySurface < sZorasDomainWaterBoxMaxY && sZorasDomainWaterBoxMinZ < z && z < sZorasDomainWaterBoxMaxZ) { @@ -4323,7 +4326,7 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, s32 room; s32 i; WaterBox* waterBox; - WaterBox* waterBoxList = colHeader->waterBoxes; // unused, needed for matching + UNUSED WaterBox* waterBoxList = colHeader->waterBoxes; // needed for matching if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) { *outWaterBox = NULL; @@ -4356,7 +4359,7 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, /** * WaterBox get BgCam index */ -u32 WaterBox_GetBgCamIndex(CollisionContext* colCtx, WaterBox* waterBox) { +u32 WaterBox_GetBgCamIndex(UNUSED CollisionContext* colCtx, WaterBox* waterBox) { u32 bgCamIndex = waterBox->properties & 0xFF; return bgCamIndex; @@ -4379,7 +4382,7 @@ u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox) { /** * WaterBox get lighting settings */ -u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox) { +u32 WaterBox_GetLightIndex(UNUSED CollisionContext* colCtx, WaterBox* waterBox) { u32 lightIndex = (waterBox->properties >> 8) & 0x1F; return lightIndex; @@ -4459,8 +4462,8 @@ s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec /** * Draw a list of dyna polys, specified by `ssList` */ -void BgCheck_DrawDynaPolyList(PlayState* play, CollisionContext* colCtx, DynaCollisionContext* dyna, SSList* ssList, - u8 r, u8 g, u8 b) { +void BgCheck_DrawDynaPolyList(PlayState* play, UNUSED CollisionContext* colCtx, DynaCollisionContext* dyna, + SSList* ssList, u8 r, u8 g, u8 b) { s16 curPolyId; CollisionPoly* poly; SSNode* curNode; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index ce1fa53c00..1b48c47f72 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -11,6 +11,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "terminal.h" #include "translation.h" @@ -508,7 +509,7 @@ s32 func_80043F94(Camera* camera, Vec3f* from, CamColChk* to) { void func_80044340(Camera* camera, Vec3f* arg1, Vec3f* arg2) { CamColChk sp20; - Vec3s unused; + STACK_PADS(s32, 2); sp20.pos = *arg2; func_80043F94(camera, arg1, &sp20); @@ -519,9 +520,9 @@ void func_80044340(Camera* camera, Vec3f* arg1, Vec3f* arg2) { * Checks if `from` to `to` is looking from the outside of a poly towards the front */ s32 Camera_CheckOOB(Camera* camera, Vec3f* from, Vec3f* to) { - s32 pad; + STACK_PAD(s32); Vec3f intersect; - s32 pad2; + STACK_PAD(s32); s32 bgId; CollisionPoly* poly; CollisionContext* colCtx = &camera->play->colCtx; @@ -541,7 +542,7 @@ s32 Camera_CheckOOB(Camera* camera, Vec3f* from, Vec3f* to) { * and bgId to `bgId`. If no floor is found, then the normal is a flat surface pointing upwards. */ f32 Camera_GetFloorYNorm(Camera* camera, Vec3f* floorNorm, Vec3f* chkPos, s32* bgId) { - s32 pad; + STACK_PAD(s32); CollisionPoly* floorPoly; f32 floorY = BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, bgId, chkPos); @@ -655,7 +656,7 @@ s32 Camera_GetBgCamIndex(Camera* camera, s32* bgId, CollisionPoly* poly) { */ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) { CollisionPoly* floorPoly; - s32 pad; + STACK_PAD(s32); s32 bgId; PosRot playerPosRot; @@ -838,7 +839,7 @@ Vec3f Camera_CalcUpFromPitchYawRoll(s16 pitch, s16 yaw, s16 roll) { Vec3f rollMtxRow1; Vec3f rollMtxRow2; Vec3f rollMtxRow3; - f32 pad; + STACK_PAD(s32); // Axis to roll around u.x = cosP * sinY; @@ -885,10 +886,10 @@ f32 Camera_ClampLERPScale(Camera* camera, f32 maxLERPScale) { return ret; } -void Camera_CopyDataToRegs(Camera* camera, s16 mode) { - CameraModeValue* values; - CameraModeValue* valueP; - s32 i; +void Camera_CopyDataToRegs(Camera* camera, UNUSED_NDEBUG s16 mode) { + UNUSED_NDEBUG CameraModeValue* values; + UNUSED_NDEBUG CameraModeValue* valueP; + UNUSED_NDEBUG s32 i; #if DEBUG_FEATURES if (PREG(82)) { @@ -1083,7 +1084,7 @@ s32 Camera_CalcAtDefault(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, s16 calc Vec3f* at = &camera->at; Vec3f playerToAtOffsetTarget; Vec3f atTarget; - s32 pad2; + STACK_PAD(s32); PosRot* playerPosRot = &camera->playerPosRot; f32 playerHeight = Player_GetHeight(camera->player); @@ -1118,7 +1119,7 @@ s32 func_800458D4(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, f32* arg3, s16 f32 deltaY; Vec3f* at = &camera->at; f32 temp; - s32 pad; + STACK_PAD(s32); playerToAtOffsetTarget.y = Player_GetHeight(camera->player) + yOffset; playerToAtOffsetTarget.x = 0.0f; @@ -1158,7 +1159,7 @@ s32 func_80045B08(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, s16 arg3) { f32 phi_f2; Vec3f playerToAtOffsetTarget; Vec3f atTarget; - f32 pad; + STACK_PAD(s32); f32 temp_ret; PosRot* playerPosRot = &camera->playerPosRot; @@ -1368,8 +1369,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, f32* yP Vec3f* at = &camera->at; Vec3f playerToAtOffsetTarget; Vec3f atTarget; - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); f32 playerHeight = Player_GetHeight(camera->player); Player* player = camera->player; PosRot horsePosRot; @@ -1448,7 +1448,7 @@ f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 tim } s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) { - f32 pad; + f32 interpValue; f32 stepScale; f32 t; s16 phi_v0; @@ -1463,8 +1463,8 @@ s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) { stepScale = (1.0f / camera->pitchUpdateRateInv) * 3.0f; } else { t = absCur * (1.0f / CAM_MAX_PITCH); - pad = Camera_InterpolateCurve(0.8f, 1.0f - t); - stepScale = (1.0f / camera->pitchUpdateRateInv) * pad; + interpValue = Camera_InterpolateCurve(0.8f, 1.0f - t); + stepScale = (1.0f / camera->pitchUpdateRateInv) * interpValue; } return Camera_LERPCeilS(target, arg1, stepScale, 0xA); } @@ -1595,7 +1595,7 @@ void func_80046E20(Camera* camera, VecGeo* eyeAdjustment, f32 minDist, f32 arg3, } } -s32 Camera_Noop(Camera* camera) { +s32 Camera_Noop(UNUSED Camera* camera) { return true; } @@ -1613,7 +1613,7 @@ s32 Camera_Normal1(Camera* camera) { VecGeo eyeAdjustment; VecGeo atEyeGeo; VecGeo atEyeNextGeo; - PosRot* playerPosRot = &camera->playerPosRot; + UNUSED PosRot* playerPosRot = &camera->playerPosRot; Normal1ReadOnlyData* roData = &camera->paramData.norm1.roData; Normal1ReadWriteData* rwData = &camera->paramData.norm1.rwData; f32 playerHeight; @@ -1846,7 +1846,7 @@ s32 Camera_Normal2(Camera* camera) { PosRot* playerPosRot = &camera->playerPosRot; Normal2ReadOnlyData* roData = &camera->paramData.norm2.roData; Normal2ReadWriteData* rwData = &camera->paramData.norm2.rwData; - s32 pad; + STACK_PAD(s32); BgCamFuncData* bgCamFuncData; f32 playerHeight; f32 yNormal; @@ -2007,7 +2007,7 @@ s32 Camera_Normal3(Camera* camera) { VecGeo sp74; PosRot* playerPosRot = &camera->playerPosRot; f32 temp_f0; - f32 temp_f6; + STACK_PAD(s32); s16 phi_a0; s16 t2; Normal3ReadOnlyData* roData = &camera->paramData.norm3.roData; @@ -2162,9 +2162,9 @@ s32 Camera_Parallel1(Camera* camera) { s16 phi_a0; Parallel1ReadOnlyData* roData = &camera->paramData.para1.roData; Parallel1ReadWriteData* rwData = &camera->paramData.para1.rwData; - f32 pad2; + STACK_PAD(s32); f32 playerHeight; - s32 pad3; + f32 value; playerHeight = Player_GetHeight(camera->player); if (RELOAD_PARAMS(camera) || CAM_DEBUG_RELOAD_PARAMS) { @@ -2249,8 +2249,8 @@ s32 Camera_Parallel1(Camera* camera) { tangle = Camera_GetPitchAdjFromFloorHeightDiffs(camera, atToEyeDir.yaw - 0x7FFF, true); spB8 = ((1.0f / roData->unk_0C) * 0.3f); - pad2 = (((1.0f / roData->unk_0C) * 0.7f) * (1.0f - camera->speedRatio)); - rwData->unk_10 = Camera_LERPCeilS(tangle, rwData->unk_10, spB8 + pad2, 0xF); + value = (((1.0f / roData->unk_0C) * 0.7f) * (1.0f - camera->speedRatio)); + rwData->unk_10 = Camera_LERPCeilS(tangle, rwData->unk_10, spB8 + value, 0xF); } else { rwData->unk_10 = 0; } @@ -2361,7 +2361,7 @@ s32 Camera_Jump1(Camera* camera) { Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - s32 pad2; + STACK_PAD(s32); f32 spA4; Vec3f newEye; VecGeo eyeAtOffset; @@ -2370,10 +2370,10 @@ s32 Camera_Jump1(Camera* camera) { VecGeo eyeDiffTarget; PosRot* playerPosRot = &camera->playerPosRot; UNUSED PosRot playerhead; - s16 tangle; + STACK_PAD(s16); Jump1ReadOnlyData* roData = &camera->paramData.jump1.roData; Jump1ReadWriteData* rwData = &camera->paramData.jump1.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -2523,7 +2523,7 @@ s32 Camera_Jump2(Camera* camera) { s16 playerYawRot180; Jump2ReadOnlyData* roData = &camera->paramData.jump2.roData; Jump2ReadWriteData* rwData = &camera->paramData.jump2.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -2689,7 +2689,7 @@ s32 Camera_Jump3(Camera* camera) { Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - s32 prevMode; + UNUSED_NDEBUG s32 prevMode; f32 spC4; f32 spC0; f32 spBC; @@ -2699,8 +2699,7 @@ s32 Camera_Jump3(Camera* camera) { Jump3ReadOnlyData* roData = &camera->paramData.jump3.roData; VecGeo eyeAtOffset; VecGeo eyeNextAtOffset; - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); CameraModeValue* values; f32 t2; f32 phi_f0; @@ -2708,9 +2707,9 @@ s32 Camera_Jump3(Camera* camera) { f32 playerHeight; PosRot playerhead; f32 yNormal; - f32 temp_f18; + STACK_PAD(s32); s32 modeSwitch; - f32 temp_f2_2; + STACK_PAD(s32); Jump3ReadWriteData* rwData = &camera->paramData.jump3.rwData; playerHeight = Player_GetHeight(camera->player); @@ -2889,7 +2888,7 @@ s32 Camera_Battle1(Camera* camera) { Vec3f targetPos; f32 var3; f32 var2; - f32 temp_f0_2; + STACK_PAD(s32); f32 temp_f12_2; f32 spFC; f32 spF8; @@ -2916,7 +2915,7 @@ s32 Camera_Battle1(Camera* camera) { f32 fov; Battle1ReadOnlyData* roData = &camera->paramData.batt1.roData; Battle1ReadWriteData* rwData = &camera->paramData.batt1.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; skipEyeAtCalc = false; @@ -3167,7 +3166,7 @@ s32 Camera_Battle4(Camera* camera) { VecGeo eyeNextAtOffset; Battle4ReadOnlyData* roData = &camera->paramData.batt4.roData; Battle4ReadWriteData* rwData = &camera->paramData.batt4.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -3265,7 +3264,7 @@ s32 Camera_KeepOn1(Camera* camera) { s16 isOffGround; KeepOn1ReadOnlyData* roData = &camera->paramData.keep1.roData; KeepOn1ReadWriteData* rwData = &camera->paramData.keep1.rwData; - s16 t3; + STACK_PAD(s32); f32 playerHeight; sp88 = 0; @@ -3499,7 +3498,7 @@ s32 Camera_KeepOn3(Camera* camera) { PosRot* camPlayerPosRot = &camera->playerPosRot; KeepOn3ReadOnlyData* roData = &camera->paramData.keep3.roData; KeepOn3ReadWriteData* rwData = &camera->paramData.keep3.rwData; - s32 pad; + s32 value; f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -3613,10 +3612,10 @@ s32 Camera_KeepOn3(Camera* camera) { } PRINTF("camera: talk: BG&collision check %d time(s)\n", i); camera->stateFlags &= ~(CAM_STATE_CHECK_BG | CAM_STATE_EXTERNAL_FINISHED); - pad = ((rwData->animTimer + 1) * rwData->animTimer) >> 1; - rwData->eyeToAtTargetYaw = (f32)(s16)(atToEyeAdj.yaw - atToEyeNextDir.yaw) / pad; - rwData->eyeToAtTargetPitch = (f32)(s16)(atToEyeAdj.pitch - atToEyeNextDir.pitch) / pad; - rwData->eyeToAtTargetR = (atToEyeAdj.r - atToEyeNextDir.r) / pad; + value = ((rwData->animTimer + 1) * rwData->animTimer) >> 1; + rwData->eyeToAtTargetYaw = (f32)(s16)(atToEyeAdj.yaw - atToEyeNextDir.yaw) / value; + rwData->eyeToAtTargetPitch = (f32)(s16)(atToEyeAdj.pitch - atToEyeNextDir.pitch) / value; + rwData->eyeToAtTargetR = (atToEyeAdj.r - atToEyeNextDir.r) / value; return 1; } @@ -3665,7 +3664,7 @@ s32 Camera_KeepOn3(Camera* camera) { s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; - static Vec3f D_8015BD60; + UNUSED static Vec3f D_8015BD60; static Vec3f D_8015BD70; Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; @@ -3685,7 +3684,7 @@ s32 Camera_KeepOn4(Camera* camera) { PosRot* playerPosRot = &camera->playerPosRot; KeepOn4ReadOnlyData* roData = &camera->paramData.keep4.roData; KeepOn4ReadWriteData* rwData = &camera->paramData.keep4.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; Player* player = GET_PLAYER(camera->play); s16 angleCnt; @@ -3988,7 +3987,7 @@ s32 Camera_KeepOn0(Camera* camera) { VecGeo eyeAtOffset; KeepOn0ReadOnlyData* roData = &camera->paramData.keep0.roData; KeepOn0ReadWriteData* rwData = &camera->paramData.keep0.rwData; - s32 pad; + STACK_PAD(s32); BgCamFuncData* bgCamFuncData; UNUSED Vec3s bgCamRot; s16 fov; @@ -4056,10 +4055,10 @@ s32 Camera_KeepOn0(Camera* camera) { s32 Camera_Fixed1(Camera* camera) { Fixed1ReadOnlyData* roData = &camera->paramData.fixd1.roData; Fixed1ReadWriteData* rwData = &camera->paramData.fixd1.rwData; - s32 pad; + STACK_PAD(s32); VecGeo eyeOffset; VecGeo eyeAtOffset; - s32 pad2; + STACK_PAD(s32); Vec3f adjustedPos; BgCamFuncData* bgCamFuncData; Vec3f* eye = &camera->eye; @@ -4135,7 +4134,7 @@ s32 Camera_Fixed2(Camera* camera) { BgCamFuncData* bgCamFuncData; Fixed2ReadOnlyData* roData = &camera->paramData.fixd2.roData; Fixed2ReadWriteData* rwData = &camera->paramData.fixd2.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -4214,7 +4213,7 @@ s32 Camera_Fixed3(Camera* camera) { UNUSED VecGeo eyeAtOffset; Fixed3ReadOnlyData* roData = &camera->paramData.fixd3.roData; Fixed3ReadWriteData* rwData = &camera->paramData.fixd3.rwData; - s32 pad; + STACK_PAD(s32); bgCamFuncData = (BgCamFuncData*)Camera_GetBgCamFuncData(camera); @@ -4286,7 +4285,7 @@ s32 Camera_Fixed4(Camera* camera) { VecGeo atTargetEyeNextOffset; PosRot* playerPosRot = &camera->playerPosRot; BgCamFuncData* bgCamFuncData; - Vec3f* posOffset = &camera->playerToAtOffset; + UNUSED Vec3f* posOffset = &camera->playerToAtOffset; Fixed4ReadOnlyData* roData = &camera->paramData.fixd4.roData; Fixed4ReadWriteData* rwData = &camera->paramData.fixd4.rwData; f32 playerYOffset; @@ -4382,7 +4381,7 @@ s32 Camera_Subj3(Camera* camera) { Subj3ReadOnlyData* roData = &camera->paramData.subj3.roData; Subj3ReadWriteData* rwData = &camera->paramData.subj3.rwData; CameraModeValue* values; - Vec3f* pad2; + STACK_PAD(s32); f32 playerHeight; sp60 = Actor_GetFocus(&camera->player->actor); @@ -4510,14 +4509,13 @@ s32 Camera_Subj4(Camera* camera) { Vec3f temp1; Vec3f zoomAtTarget; f32 temp2; - s32 pad1; + STACK_PAD(s32); f32 eyeLerp; PosRot playerPosRot; VecGeo targetOffset; VecGeo atEyeOffset; s16 eyeToAtYaw; - s32 pad2; - f32 temp; + STACK_PADS(s32, 2); Subj4ReadOnlyData* roData = &camera->paramData.subj4.roData; Subj4ReadWriteData* rwData = &camera->paramData.subj4.rwData; @@ -4680,7 +4678,7 @@ s32 Camera_Data3(Camera* camera) { } s32 Camera_Data4(Camera* camera) { - s32 pad2[2]; + STACK_PADS(s32, 2); Data4ReadOnlyData* roData = &camera->paramData.data4.roData; VecGeo eyeAtOffset; VecGeo atOffset; @@ -4690,7 +4688,7 @@ s32 Camera_Data4(Camera* camera) { Vec3f* eyeNext = &camera->eyeNext; BgCamFuncData* bgCamFuncData; Vec3f lookAt; - s32 pad; + STACK_PAD(s32); Data4ReadWriteData* rwData = &camera->paramData.data4.rwData; Vec3f* eye = &camera->eye; f32 playerHeight; @@ -4767,9 +4765,9 @@ s32 Camera_Unique1(Camera* camera) { UNUSED PosRot playerhead; Unique1ReadOnlyData* roData = &camera->paramData.uniq1.roData; Unique1ReadWriteData* rwData = &camera->paramData.uniq1.rwData; - s32 pad; + STACK_PAD(s32); f32 playerHeight; - s32 pad2; + STACK_PAD(s32); playerHeight = Player_GetHeight(camera->player); if (RELOAD_PARAMS(camera) || CAM_DEBUG_RELOAD_PARAMS) { @@ -4854,11 +4852,11 @@ s32 Camera_Unique2(Camera* camera) { Vec3f playerPos; VecGeo eyeOffset; VecGeo eyeAtOffset; - s32 pad; + STACK_PAD(s32); f32 lerpRateFactor; Unique2ReadOnlyData* roData = &camera->paramData.uniq2.roData; Unique2ReadWriteData* rwData = &camera->paramData.uniq2.rwData; - s32 pad2; + STACK_PAD(s32); f32 playerHeight; playerHeight = Player_GetHeight(camera->player); @@ -5219,7 +5217,7 @@ s32 Camera_Unique6(Camera* camera) { * camera rotates to follow player */ s32 Camera_Unique7(Camera* camera) { - s32 pad; + STACK_PAD(s32); Unique7ReadOnlyData* roData = &camera->paramData.uniq7.roData; PosRot* playerPosRot = &camera->playerPosRot; VecGeo playerPosEyeOffset; @@ -5296,7 +5294,7 @@ s32 Camera_Unique9(Camera* camera) { s16 action; s16 atFlags; s16 eyeFlags; - s16 pad2; + STACK_PAD(s16); PosRot targethead; PosRot playerhead; PosRot playerPosRot; @@ -5816,7 +5814,7 @@ void Camera_RotateAroundPoint(PosRot* at, Vec3f* pos, Vec3f* dst) { * until all keyFrames have been exhausted. */ s32 Camera_Demo1(Camera* camera) { - s32 pad; + STACK_PAD(s32); Demo1ReadOnlyData* roData = &camera->paramData.demo1.roData; f32* cameraFOV = &camera->fov; Vec3f* at = &camera->at; @@ -5908,13 +5906,13 @@ s32 Camera_Demo3(Camera* camera) { Vec3f sp68; Vec3f sp5C; f32 temp_f0; - s32 pad; + STACK_PAD(s32); u8 skipUpdateEye = false; f32 yOffset = Player_GetHeight(camera->player); s16 angle; Demo3ReadOnlyData* roData = &camera->paramData.demo3.roData; Demo3ReadWriteData* rwData = &camera->paramData.demo3.rwData; - s32 pad2; + STACK_PAD(s32); camera->stateFlags &= ~CAM_STATE_CAM_FUNC_FINISH; @@ -6124,7 +6122,7 @@ s32 Camera_Demo5(Camera* camera) { VecGeo eyePlayerGeo; s16 targetScreenPosX; s16 targetScreenPosY; - s32 pad1; + STACK_PAD(s32); PosRot playerhead; PosRot targethead; Player* player; @@ -6132,7 +6130,7 @@ s32 Camera_Demo5(Camera* camera) { s32 framesDiff; s32 temp_v0; s16 t; - s32 pad2; + STACK_PAD(s32); playerhead = Actor_GetFocus(&camera->player->actor); player = camera->player; @@ -6755,7 +6753,7 @@ s32 Camera_Demo8(Camera* camera) { * to be relative to the main camera's player, the current camera's player, or the main camera's target */ s32 Camera_Demo9(Camera* camera) { - s32 pad; + STACK_PAD(s32); s32 finishAction; s16 onePointTimer; OnePointCamData* onePointCamData = &camera->paramData.demo9.onePointCamData; @@ -6764,7 +6762,7 @@ s32 Camera_Demo9(Camera* camera) { Vec3f newEye; Vec3f newAt; f32 newRoll; - s32 pad3; + STACK_PAD(s32); Camera* mainCam; Vec3f* eye = &camera->eye; PosRot* mainCamPlayerPosRot; @@ -6993,7 +6991,7 @@ s32 Camera_Special5(Camera* camera) { Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; PosRot spA8; - s16 pad; + STACK_PAD(s16); s16 spA4; CamColChk sp7C; VecGeo sp74; @@ -7205,12 +7203,12 @@ s32 Camera_Special6(Camera* camera) { BgCamFuncData* bgCamFuncData; Vec3s bgCamRot; s16 fov; - f32 sp54; + STACK_PAD(s32); f32 timerF; f32 timerDivisor; Special6ReadOnlyData* roData = &camera->paramData.spec6.roData; Special6ReadWriteData* rwData = &camera->paramData.spec6.rwData; - s32 pad; + STACK_PAD(s32); if (RELOAD_PARAMS(camera) || CAM_DEBUG_RELOAD_PARAMS) { CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values; @@ -7301,7 +7299,7 @@ s32 Camera_Special8(Camera* camera) { } s32 Camera_Special9(Camera* camera) { - s32 pad; + STACK_PAD(s32); Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; @@ -7309,14 +7307,14 @@ s32 Camera_Special9(Camera* camera) { VecGeo eyeAdjustment; VecGeo atEyeOffsetGeo; f32 playerYOffset; - s32 pad3; + STACK_PAD(s32); PosRot* playerPosRot = &camera->playerPosRot; PosRot referencePosRot; f32 yNormal; DoorParams* doorParams = &camera->paramData.doorParams; Special9ReadOnlyData* roData = &camera->paramData.spec9.roData; Special9ReadWriteData* rwData = &camera->paramData.spec9.rwData; - s32 pad4; + STACK_PAD(s32); BgCamFuncData* bgCamFuncData; playerYOffset = Player_GetHeight(camera->player); @@ -7472,14 +7470,14 @@ void Camera_Destroy(Camera* camera) { } } -void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState* play) { +void Camera_Init(Camera* camera, UNUSED View* view, UNUSED CollisionContext* colCtx, PlayState* play) { Camera* camP; s16 curUID; s16 j; memset(camera, 0, sizeof(Camera)); if (sInitRegs) { - s32 i; + UNUSED_NDEBUG s32 i; #if DEBUG_FEATURES for (i = 0; i < sOREGInitCnt; i++) { @@ -7587,7 +7585,7 @@ void func_80057FC4(Camera* camera) { } } -void Camera_Stub80058140(Camera* camera) { +void Camera_Stub80058140(UNUSED Camera* camera) { } void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { @@ -7632,7 +7630,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { } { - s32 pad[2]; + STACK_PADS(s32, 2); camera->bgCamIndexBeforeUnderwater = -1; camera->waterCamSetting = -1; @@ -7664,9 +7662,9 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { } s16 Camera_ChangeStatus(Camera* camera, s16 status) { - CameraModeValue* values; - CameraModeValue* valueP; - s32 i; + UNUSED_NDEBUG CameraModeValue* values; + UNUSED_NDEBUG CameraModeValue* valueP; + UNUSED_NDEBUG s32 i; #if DEBUG_FEATURES if (PREG(82)) { @@ -7952,7 +7950,7 @@ void Camera_UpdateDistortion(Camera* camera) { f32 speedFactor; f32 depthPhaseStep; f32 screenPlanePhaseStep; - s32 pad[5]; + STACK_PADS(s32, 5); f32 xScale; f32 yScale; f32 zScale; @@ -8604,7 +8602,7 @@ s32 Camera_RequestSetting(Camera* camera, s16 setting) { s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) { s16 requestedCamSetting; - s16 settingChangeSuccessful; + UNUSED_NDEBUG s16 settingChangeSuccessful; if ((requestedBgCamIndex == -1) || (requestedBgCamIndex == camera->bgCamIndex)) { camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; @@ -8687,7 +8685,7 @@ s16 Camera_GetCamDirYaw(Camera* camera) { return camDir.y; } -s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration) { +s32 Camera_RequestQuake(Camera* camera, UNUSED s32 unused, s16 y, s32 duration) { s16 quakeIndex; quakeIndex = Quake_Request(camera, QUAKE_TYPE_3); @@ -8701,7 +8699,7 @@ s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration) { } s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param) { - s32 pad[3]; + STACK_PADS(s32, 3); if (param != NULL) { switch (viewFlag) { @@ -8799,7 +8797,7 @@ s16 Camera_UnsetStateFlag(Camera* camera, s16 stateFlag) { * A bgCamIndex of -1 uses the default door camera setting (CAM_SET_DOORC) * Otherwise, change the door camera setting by reading the bgCam indexed at bgCamIndex */ -s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, +s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, UNUSED f32 arg3, s16 timer1, s16 timer2, s16 timer3) { DoorParams* doorParams = &camera->paramData.doorParams; @@ -8875,7 +8873,7 @@ Vec3f Camera_GetQuakeOffset(Camera* camera) { } void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, - UNK_TYPE arg6) { + UNUSED UNK_TYPE arg6) { if (setDataFlags & 0x1) { camera->data0 = data0; } diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 9a9795f453..8f5d7bd8a9 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -1,4 +1,5 @@ #include "array_count.h" +#include "attributes.h" #include "ultra64.h" typedef struct CameraModeValue { diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 158948a2eb..2e62c807d8 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,7 +1,9 @@ #include "gfx.h" +#include "attributes.h" #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -91,7 +93,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, } #endif -s32 Collider_InitBase(PlayState* play, Collider* col) { +s32 Collider_InitBase(UNUSED PlayState* play, Collider* col) { static Collider init = { NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COL_MATERIAL_HIT3, COLSHAPE_MAX, }; @@ -100,14 +102,14 @@ s32 Collider_InitBase(PlayState* play, Collider* col) { return true; } -s32 Collider_DestroyBase(PlayState* play, Collider* col) { +s32 Collider_DestroyBase(UNUSED PlayState* play, UNUSED Collider* col) { return true; } /** * Uses default OC2_TYPE_1 and COL_MATERIAL_HIT0 */ -s32 Collider_SetBaseToActor(PlayState* play, Collider* col, ColliderInitToActor* src) { +s32 Collider_SetBaseToActor(UNUSED PlayState* play, Collider* col, ColliderInitToActor* src) { col->actor = src->actor; col->atFlags = src->atFlags; col->acFlags = src->acFlags; @@ -120,7 +122,7 @@ s32 Collider_SetBaseToActor(PlayState* play, Collider* col, ColliderInitToActor* /** * Uses default OC2_TYPE_1 */ -s32 Collider_SetBaseType1(PlayState* play, Collider* col, Actor* actor, ColliderInitType1* src) { +s32 Collider_SetBaseType1(UNUSED PlayState* play, Collider* col, Actor* actor, ColliderInitType1* src) { col->actor = actor; col->colMaterial = src->colMaterial; col->atFlags = src->atFlags; @@ -131,7 +133,7 @@ s32 Collider_SetBaseType1(PlayState* play, Collider* col, Actor* actor, Collider return true; } -s32 Collider_SetBase(PlayState* play, Collider* col, Actor* actor, ColliderInit* src) { +s32 Collider_SetBase(UNUSED PlayState* play, Collider* col, Actor* actor, ColliderInit* src) { col->actor = actor; col->colMaterial = src->colMaterial; col->atFlags = src->atFlags; @@ -142,34 +144,34 @@ s32 Collider_SetBase(PlayState* play, Collider* col, Actor* actor, ColliderInit* return true; } -void Collider_ResetATBase(PlayState* play, Collider* col) { +void Collider_ResetATBase(UNUSED PlayState* play, Collider* col) { col->at = NULL; col->atFlags &= ~(AT_HIT | AT_BOUNCED); } -void Collider_ResetACBase(PlayState* play, Collider* col) { +void Collider_ResetACBase(UNUSED PlayState* play, Collider* col) { col->ac = NULL; col->acFlags &= ~(AC_HIT | AC_BOUNCED); } -void Collider_ResetOCBase(PlayState* play, Collider* col) { +void Collider_ResetOCBase(UNUSED PlayState* play, Collider* col) { col->oc = NULL; col->ocFlags1 &= ~OC1_HIT; col->ocFlags2 &= ~OC2_HIT_PLAYER; } -s32 Collider_InitElementDamageInfoAT(PlayState* play, ColliderElementDamageInfoAT* atDmgInfo) { +s32 Collider_InitElementDamageInfoAT(UNUSED PlayState* play, ColliderElementDamageInfoAT* atDmgInfo) { static ColliderElementDamageInfoAT init = { 0x00000000, 0, 0 }; *atDmgInfo = init; return true; } -s32 Collider_DestroyElementDamageInfoAT(PlayState* play, ColliderElementDamageInfoAT* atDmgInfo) { +s32 Collider_DestroyElementDamageInfoAT(UNUSED PlayState* play, UNUSED ColliderElementDamageInfoAT* atDmgInfo) { return true; } -s32 Collider_SetElementDamageInfoAT(PlayState* play, ColliderElementDamageInfoAT* dest, +s32 Collider_SetElementDamageInfoAT(UNUSED PlayState* play, ColliderElementDamageInfoAT* dest, ColliderElementDamageInfoAT* src) { dest->dmgFlags = src->dmgFlags; dest->effect = src->effect; @@ -177,21 +179,21 @@ s32 Collider_SetElementDamageInfoAT(PlayState* play, ColliderElementDamageInfoAT return true; } -void Collider_ResetATElement_Unk(PlayState* play, ColliderElement* elem) { +void Collider_ResetATElement_Unk(UNUSED PlayState* play, UNUSED ColliderElement* elem) { } -s32 Collider_InitElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC* acDmgInfo) { +s32 Collider_InitElementDamageInfoAC(UNUSED PlayState* play, ColliderElementDamageInfoAC* acDmgInfo) { static ColliderElementDamageInfoAC init = { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }; *acDmgInfo = init; return true; } -s32 Collider_DestroyElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC* acDmgInfo) { +s32 Collider_DestroyElementDamageInfoAC(UNUSED PlayState* play, UNUSED ColliderElementDamageInfoAC* acDmgInfo) { return true; } -s32 Collider_SetElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC* acDmgInfo, +s32 Collider_SetElementDamageInfoAC(UNUSED PlayState* play, ColliderElementDamageInfoAC* acDmgInfo, ColliderElementDamageInfoACInit* init) { acDmgInfo->dmgFlags = init->dmgFlags; acDmgInfo->effect = init->effect; @@ -243,7 +245,7 @@ void Collider_ResetATElement(PlayState* play, ColliderElement* elem) { Collider_ResetATElement_Unk(play, elem); } -void Collider_ResetACElement(PlayState* play, ColliderElement* elem) { +void Collider_ResetACElement(UNUSED PlayState* play, ColliderElement* elem) { elem->acDmgInfo.hitPos.x = elem->acDmgInfo.hitPos.y = elem->acDmgInfo.hitPos.z = 0; elem->acElemFlags &= ~ACELEM_HIT; elem->acElemFlags &= ~ACELEM_DRAW_HITMARK; @@ -251,11 +253,11 @@ void Collider_ResetACElement(PlayState* play, ColliderElement* elem) { elem->acHitElem = NULL; } -void Collider_ResetOCElement(PlayState* play, ColliderElement* elem) { +void Collider_ResetOCElement(UNUSED PlayState* play, ColliderElement* elem) { elem->ocElemFlags &= ~OCELEM_HIT; } -s32 Collider_InitJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim) { +s32 Collider_InitJntSphElementDim(UNUSED PlayState* play, ColliderJntSphElementDim* dim) { static ColliderJntSphElementDim init = { { { 0, 0, 0 }, 0 }, { { 0, 0, 0 }, 0 }, @@ -266,11 +268,12 @@ s32 Collider_InitJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim return true; } -s32 Collider_DestroyJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dim) { +s32 Collider_DestroyJntSphElementDim(UNUSED PlayState* play, UNUSED ColliderJntSphElementDim* dim) { return true; } -s32 Collider_SetJntSphElementDim(PlayState* play, ColliderJntSphElementDim* dest, ColliderJntSphElementDimInit* src) { +s32 Collider_SetJntSphElementDim(UNUSED PlayState* play, ColliderJntSphElementDim* dest, + ColliderJntSphElementDimInit* src) { dest->limb = src->limb; dest->modelSphere = src->modelSphere; dest->scale = src->scale * 0.01f; @@ -503,18 +506,18 @@ s32 Collider_ResetJntSphOC(PlayState* play, Collider* col) { return true; } -s32 Collider_InitCylinderDim(PlayState* play, Cylinder16* dim) { +s32 Collider_InitCylinderDim(UNUSED PlayState* play, Cylinder16* dim) { Cylinder16 init = { 0, 0, 0, { 0, 0, 0 } }; *dim = init; return true; } -s32 Collider_DestroyCylinderDim(PlayState* play, Cylinder16* dim) { +s32 Collider_DestroyCylinderDim(UNUSED PlayState* play, UNUSED Cylinder16* dim) { return true; } -s32 Collider_SetCylinderDim(PlayState* play, Cylinder16* dest, Cylinder16* src) { +s32 Collider_SetCylinderDim(UNUSED PlayState* play, Cylinder16* dest, Cylinder16* src) { *dest = *src; return true; } @@ -603,7 +606,7 @@ s32 Collider_ResetCylinderOC(PlayState* play, Collider* col) { return true; } -s32 Collider_InitTrisElementDim(PlayState* play, TriNorm* dim) { +s32 Collider_InitTrisElementDim(UNUSED PlayState* play, TriNorm* dim) { static TriNorm init = { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { { 0.0f, 0.0f, 0.0f }, 0.0f }, @@ -613,11 +616,11 @@ s32 Collider_InitTrisElementDim(PlayState* play, TriNorm* dim) { return true; } -s32 Collider_DestroyTrisElementDim(PlayState* play, TriNorm* dim) { +s32 Collider_DestroyTrisElementDim(UNUSED PlayState* play, UNUSED TriNorm* dim) { return true; } -s32 Collider_SetTrisElementDim(PlayState* play, TriNorm* dest, ColliderTrisElementDimInit* src) { +s32 Collider_SetTrisElementDim(UNUSED PlayState* play, TriNorm* dest, ColliderTrisElementDimInit* src) { Vec3f* destVtx; Vec3f* srcVtx; f32 nx; @@ -834,7 +837,7 @@ s32 Collider_ResetTrisOC(PlayState* play, Collider* col) { return true; } -s32 Collider_InitQuadDim(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_InitQuadDim(UNUSED PlayState* play, ColliderQuadDim* dim) { static ColliderQuadDim init = { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0, 0, 0 }, @@ -846,11 +849,11 @@ s32 Collider_InitQuadDim(PlayState* play, ColliderQuadDim* dim) { return true; } -s32 Collider_DestroyQuadDim(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_DestroyQuadDim(UNUSED PlayState* play, UNUSED ColliderQuadDim* dim) { return true; } -s32 Collider_ResetQuadACDist(PlayState* play, ColliderQuadDim* dim) { +s32 Collider_ResetQuadACDist(UNUSED PlayState* play, ColliderQuadDim* dim) { dim->acDistSq = 1.0e38f; return true; } @@ -864,7 +867,7 @@ void Collider_SetQuadMidpoints(ColliderQuadDim* dim) { dim->baMid.z = (dim->quad[1].z + dim->quad[0].z) * 0.5f; } -s32 Collider_SetQuadDim(PlayState* play, ColliderQuadDim* dest, ColliderQuadDimInit* src) { +s32 Collider_SetQuadDim(UNUSED PlayState* play, ColliderQuadDim* dest, ColliderQuadDimInit* src) { dest->quad[0] = src->quad[0]; dest->quad[1] = src->quad[1]; dest->quad[2] = src->quad[2]; @@ -977,7 +980,7 @@ s32 Collider_QuadSetNearestAC(PlayState* play, ColliderQuad* quad, Vec3f* hitPos * Initializes an OcLine to default values * OcLines are entirely unused. */ -s32 Collider_InitLine(PlayState* play, OcLine* line) { +s32 Collider_InitLine(UNUSED PlayState* play, OcLine* line) { Vec3f init = { 0.0f, 0.0f, 0.0f }; Math_Vec3f_Copy(&line->line.a, &init); @@ -989,7 +992,7 @@ s32 Collider_InitLine(PlayState* play, OcLine* line) { * Destroys an OcLine * OcLines are entirely unused. */ -s32 Collider_DestroyLine(PlayState* play, OcLine* line) { +s32 Collider_DestroyLine(UNUSED PlayState* play, UNUSED OcLine* line) { return true; } @@ -997,7 +1000,7 @@ s32 Collider_DestroyLine(PlayState* play, OcLine* line) { * Sets up an OcLine with endpoints a and b. * OcLines are entirely unused. */ -s32 Collider_SetLinePoints(PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b) { +s32 Collider_SetLinePoints(UNUSED PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b) { Math_Vec3f_Copy(&ocLine->line.a, a); Math_Vec3f_Copy(&ocLine->line.b, b); return true; @@ -1017,7 +1020,7 @@ s32 Collider_SetLine(PlayState* play, OcLine* dest, OcLine* src) { * Resets the OcLine's collision flags. * OcLines are entirely unused. */ -s32 Collider_ResetLineOC(PlayState* play, OcLine* line) { +s32 Collider_ResetLineOC(UNUSED PlayState* play, OcLine* line) { line->ocFlags &= ~OCLINE_HIT; return true; } @@ -1036,13 +1039,13 @@ void CollisionCheck_InitContext(PlayState* play, CollisionCheckContext* colChkCt #endif } -void CollisionCheck_DestroyContext(PlayState* play, CollisionCheckContext* colChkCtx) { +void CollisionCheck_DestroyContext(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx) { } /** * Clears all collider lists in CollisionCheckContext when not in SAC mode. */ -void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkCtx) { +void CollisionCheck_ClearContext(UNUSED PlayState* play, CollisionCheckContext* colChkCtx) { Collider** colP; OcLine** lineP; @@ -1072,14 +1075,14 @@ void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkC /** * Enables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. */ -void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colChkCtx) { +void CollisionCheck_EnableSAC(UNUSED PlayState* play, CollisionCheckContext* colChkCtx) { colChkCtx->sacFlags |= SAC_ENABLE; } /** * Disables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. */ -void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx) { +void CollisionCheck_DisableSAC(UNUSED PlayState* play, CollisionCheckContext* colChkCtx) { colChkCtx->sacFlags &= ~SAC_ENABLE; } @@ -1423,14 +1426,14 @@ s32 CollisionCheck_NoSharedFlags(ColliderElement* atElem, ColliderElement* acEle * Spawns no blood drops. * Used by collider types HIT1, HIT3, HIT5, METAL, NONE, WOOD, HARD, and TREE */ -void CollisionCheck_NoBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_NoBlood(UNUSED PlayState* play, UNUSED Collider* collider, UNUSED Vec3f* v) { } /** * Spawns blue blood drops. * Used by collider types HIT0 and HIT8. */ -void CollisionCheck_BlueBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_BlueBlood(PlayState* play, UNUSED Collider* collider, Vec3f* v) { static EffectSparkInit sparkInit; s32 effectIndex; @@ -1483,7 +1486,7 @@ void CollisionCheck_BlueBlood(PlayState* play, Collider* collider, Vec3f* v) { * Spawns green blood drops. * Used by collider types HIT2 and HIT6. No actor has type HIT2. */ -void CollisionCheck_GreenBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_GreenBlood(PlayState* play, UNUSED Collider* collider, Vec3f* v) { static EffectSparkInit sparkInit; s32 effectIndex; @@ -1536,7 +1539,7 @@ void CollisionCheck_GreenBlood(PlayState* play, Collider* collider, Vec3f* v) { * Spawns a burst of water. * Used by collider type HIT4, which no actor has. */ -void CollisionCheck_WaterBurst(PlayState* play, Collider* collider, Vec3f* pos) { +void CollisionCheck_WaterBurst(PlayState* play, UNUSED Collider* collider, Vec3f* pos) { EffectSsSibuki_SpawnBurst(play, pos); CollisionCheck_SpawnWaterDroplets(play, pos); } @@ -1545,7 +1548,7 @@ void CollisionCheck_WaterBurst(PlayState* play, Collider* collider, Vec3f* pos) * Spawns red blood drops. * Used by collider type HIT7, which no actor has. */ -void CollisionCheck_RedBlood(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_RedBlood(PlayState* play, UNUSED Collider* collider, Vec3f* v) { CollisionCheck_SpawnRedBlood(play, v); } @@ -1553,7 +1556,7 @@ void CollisionCheck_RedBlood(PlayState* play, Collider* collider, Vec3f* v) { * Spawns red blood drops. * Unused. */ -void CollisionCheck_RedBloodUnused(PlayState* play, Collider* collider, Vec3f* v) { +void CollisionCheck_RedBloodUnused(PlayState* play, UNUSED Collider* collider, Vec3f* v) { CollisionCheck_SpawnRedBlood(play, v); } @@ -1727,8 +1730,8 @@ void CollisionCheck_SetBounce(Collider* atCol, Collider* acCol) { /** * Performs the AC collision between the AT element and AC element that collided. */ -s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* atCol, ColliderElement* atElem, Vec3f* atPos, Collider* acCol, - ColliderElement* acElem, Vec3f* acPos, Vec3f* hitPos) { +s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* atCol, ColliderElement* atElem, UNUSED Vec3f* atPos, + Collider* acCol, ColliderElement* acElem, UNUSED Vec3f* acPos, Vec3f* hitPos) { if (acCol->acFlags & AC_HARD && atCol->actor != NULL && acCol->actor != NULL) { CollisionCheck_SetBounce(atCol, acCol); } @@ -1763,7 +1766,7 @@ s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* atCol, ColliderElement* return true; } -void CollisionCheck_ATJntSphVsACJntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATJntSphVsACJntSph(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { ColliderJntSph* atJntSph = (ColliderJntSph*)atCol; ColliderJntSphElement* atJntSphElem; @@ -1817,7 +1820,7 @@ void CollisionCheck_ATJntSphVsACJntSph(PlayState* play, CollisionCheckContext* c } } -void CollisionCheck_ATJntSphVsACCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATJntSphVsACCyl(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { ColliderJntSph* atJntSph = (ColliderJntSph*)atCol; ColliderJntSphElement* atJntSphElem; @@ -1875,7 +1878,7 @@ void CollisionCheck_ATJntSphVsACCyl(PlayState* play, CollisionCheckContext* colC } } -void CollisionCheck_ATCylVsACJntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATCylVsACJntSph(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { ColliderCylinder* atCyl = (ColliderCylinder*)atCol; ColliderJntSph* acJntSph = (ColliderJntSph*)acCol; @@ -1899,7 +1902,6 @@ void CollisionCheck_ATCylVsACJntSph(PlayState* play, CollisionCheckContext* colC Vec3f hitPos; Vec3f atPos; Vec3f acPos; - f32 acToHit; atPos.x = atCyl->dim.pos.x; atPos.y = atCyl->dim.pos.y; @@ -1936,7 +1938,7 @@ void CollisionCheck_ATCylVsACJntSph(PlayState* play, CollisionCheckContext* colC } } -void CollisionCheck_ATJntSphVsACTris(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATJntSphVsACTris(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { ColliderJntSph* atJntSph = (ColliderJntSph*)atCol; ColliderJntSphElement* atJntSphElem; @@ -1978,7 +1980,7 @@ void CollisionCheck_ATJntSphVsACTris(PlayState* play, CollisionCheckContext* col } } -void CollisionCheck_ATTrisVsACJntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATTrisVsACJntSph(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { ColliderTris* atTris = (ColliderTris*)atCol; ColliderTrisElement* atTrisElem; @@ -2020,7 +2022,7 @@ void CollisionCheck_ATTrisVsACJntSph(PlayState* play, CollisionCheckContext* col } } -void CollisionCheck_ATJntSphVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATJntSphVsACQuad(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static TriNorm tri1; static TriNorm tri2; @@ -2067,7 +2069,7 @@ void CollisionCheck_ATJntSphVsACQuad(PlayState* play, CollisionCheckContext* col } } -void CollisionCheck_ATQuadVsACJntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATQuadVsACJntSph(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static TriNorm tri1; static TriNorm tri2; @@ -2119,7 +2121,8 @@ void CollisionCheck_ATQuadVsACJntSph(PlayState* play, CollisionCheckContext* col } } -void CollisionCheck_ATCylVsACCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { +void CollisionCheck_ATCylVsACCyl(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, + Collider* acCol) { ColliderCylinder* atCyl = (ColliderCylinder*)atCol; ColliderCylinder* acCyl = (ColliderCylinder*)acCol; f32 overlapSize; @@ -2157,7 +2160,8 @@ void CollisionCheck_ATCylVsACCyl(PlayState* play, CollisionCheckContext* colChkC } } -void CollisionCheck_ATCylVsACTris(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { +void CollisionCheck_ATCylVsACTris(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, + Collider* acCol) { ColliderCylinder* atCyl = (ColliderCylinder*)atCol; ColliderTris* acTris = (ColliderTris*)acCol; ColliderTrisElement* acTrisElem; @@ -2191,7 +2195,8 @@ void CollisionCheck_ATCylVsACTris(PlayState* play, CollisionCheckContext* colChk } } -void CollisionCheck_ATTrisVsACCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { +void CollisionCheck_ATTrisVsACCyl(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, + Collider* acCol) { static Vec3f hitPos; ColliderTris* atTris = (ColliderTris*)atCol; ColliderTrisElement* atTrisElem; @@ -2228,7 +2233,8 @@ void CollisionCheck_ATTrisVsACCyl(PlayState* play, CollisionCheckContext* colChk #pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-jp:252 gc-jp-ce:252 gc-jp-mq:252 gc-us:252 gc-us-mq:252" \ "ique-cn:252 ntsc-1.0:252 ntsc-1.1:252 ntsc-1.2:252 pal-1.0:252 pal-1.1:252" -void CollisionCheck_ATCylVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { +void CollisionCheck_ATCylVsACQuad(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, + Collider* acCol) { static TriNorm tri1; static TriNorm tri2; static Vec3f hitPos; @@ -2281,7 +2287,8 @@ void CollisionCheck_ATCylVsACQuad(PlayState* play, CollisionCheckContext* colChk } } -void CollisionCheck_ATQuadVsACCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { +void CollisionCheck_ATQuadVsACCyl(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, + Collider* acCol) { static TriNorm tri1; static TriNorm tri2; static Vec3f hitPos; @@ -2341,11 +2348,11 @@ void CollisionCheck_ATQuadVsACCyl(PlayState* play, CollisionCheckContext* colChk } #if DEBUG_FEATURES -static s8 sBssDummy3; -static s8 sBssDummy4; +UNUSED static s8 sBssDummy3; +UNUSED static s8 sBssDummy4; #endif -void CollisionCheck_ATTrisVsACTris(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATTrisVsACTris(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static Vec3f hitPos; ColliderTris* atTris = (ColliderTris*)atCol; @@ -2390,7 +2397,7 @@ void CollisionCheck_ATTrisVsACTris(PlayState* play, CollisionCheckContext* colCh } } -void CollisionCheck_ATTrisVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATTrisVsACQuad(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static Vec3f hitPos; static TriNorm tri1; @@ -2437,7 +2444,7 @@ void CollisionCheck_ATTrisVsACQuad(PlayState* play, CollisionCheckContext* colCh } } -void CollisionCheck_ATQuadVsACTris(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATQuadVsACTris(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static Vec3f hitPos; static TriNorm tri1; @@ -2489,7 +2496,7 @@ void CollisionCheck_ATQuadVsACTris(PlayState* play, CollisionCheckContext* colCh } } -void CollisionCheck_ATQuadVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol, +void CollisionCheck_ATQuadVsACQuad(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* atCol, Collider* acCol) { static TriNorm acTris[2]; static Vec3f hitPos; @@ -2548,7 +2555,7 @@ void CollisionCheck_ATQuadVsACQuad(PlayState* play, CollisionCheckContext* colCh } } -void CollisionCheck_SetJntSphHitFX(PlayState* play, CollisionCheckContext* colChkCtx, Collider* col) { +void CollisionCheck_SetJntSphHitFX(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* col) { ColliderJntSph* jntSph = (ColliderJntSph*)col; ColliderJntSphElement* jntSphElem; @@ -2566,7 +2573,7 @@ void CollisionCheck_SetJntSphHitFX(PlayState* play, CollisionCheckContext* colCh } } -void CollisionCheck_SetCylHitFX(PlayState* play, CollisionCheckContext* colChkCtx, Collider* col) { +void CollisionCheck_SetCylHitFX(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* col) { ColliderCylinder* cyl = (ColliderCylinder*)col; if ((cyl->elem.acElemFlags & ACELEM_DRAW_HITMARK) && (cyl->elem.acHitElem != NULL) && @@ -2579,7 +2586,7 @@ void CollisionCheck_SetCylHitFX(PlayState* play, CollisionCheckContext* colChkCt } } -void CollisionCheck_SetTrisHitFX(PlayState* play, CollisionCheckContext* colChkCtx, Collider* col) { +void CollisionCheck_SetTrisHitFX(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* col) { ColliderTris* tris = (ColliderTris*)col; ColliderTrisElement* trisElem; @@ -2597,7 +2604,7 @@ void CollisionCheck_SetTrisHitFX(PlayState* play, CollisionCheckContext* colChkC } } -void CollisionCheck_SetQuadHitFX(PlayState* play, CollisionCheckContext* colChkCtx, Collider* col) { +void CollisionCheck_SetQuadHitFX(PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* col) { ColliderQuad* quad = (ColliderQuad*)col; Vec3f hitPos; @@ -2742,7 +2749,7 @@ s32 CollisionCheck_GetMassType(u8 mass) { */ void CollisionCheck_SetOCvsOC(Collider* leftCol, ColliderElement* leftElem, Vec3f* leftPos, Collider* rightCol, ColliderElement* rightElem, Vec3f* rightPos, f32 overlap) { - f32 pad; + STACK_PAD(s32); f32 leftDispRatio; f32 rightDispRatio; f32 xzDist; @@ -2831,8 +2838,8 @@ void CollisionCheck_SetOCvsOC(Collider* leftCol, ColliderElement* leftElem, Vec3 } } -void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* leftCol, - Collider* rightCol) { +void CollisionCheck_OC_JntSphVsJntSph(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, + Collider* leftCol, Collider* rightCol) { ColliderJntSph* leftJntSph = (ColliderJntSph*)leftCol; ColliderJntSphElement* leftJntSphElem; ColliderJntSph* rightJntSph = (ColliderJntSph*)rightCol; @@ -2866,7 +2873,7 @@ void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co } } -void CollisionCheck_OC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* leftCol, +void CollisionCheck_OC_JntSphVsCyl(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* leftCol, Collider* rightCol) { ColliderJntSph* leftJntSph = (ColliderJntSph*)leftCol; ColliderJntSphElement* leftJntSphElem; @@ -2899,7 +2906,7 @@ void CollisionCheck_OC_CylVsJntSph(PlayState* play, CollisionCheckContext* colCh CollisionCheck_OC_JntSphVsCyl(play, colChkCtx, rightCol, leftCol); } -void CollisionCheck_OC_CylVsCyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* leftCol, +void CollisionCheck_OC_CylVsCyl(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* leftCol, Collider* rightCol) { ColliderCylinder* leftCyl = (ColliderCylinder*)leftCol; ColliderCylinder* rightCyl = (ColliderCylinder*)rightCol; @@ -3078,7 +3085,7 @@ void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, C /** * Apply AC damage effect */ -void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCtx, Collider* col, +void CollisionCheck_ApplyDamage(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* col, ColliderElement* elem) { DamageTable* tbl; f32 damage; @@ -3190,8 +3197,8 @@ void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colChkCtx) { /** * Checks if the line ab intersects any of the ColliderJntSph's elements */ -s32 CollisionCheck_LineOC_JntSph(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, - Vec3f* b) { +s32 CollisionCheck_LineOC_JntSph(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* collider, + Vec3f* a, Vec3f* b) { static Linef lineSeg; ColliderJntSph* jntSph = (ColliderJntSph*)collider; s32 i; @@ -3214,8 +3221,8 @@ s32 CollisionCheck_LineOC_JntSph(PlayState* play, CollisionCheckContext* colChkC /** * Checks if the line segment ab intersects the ColliderCylinder */ -s32 CollisionCheck_LineOC_Cyl(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, - Vec3f* b) { +s32 CollisionCheck_LineOC_Cyl(UNUSED PlayState* play, UNUSED CollisionCheckContext* colChkCtx, Collider* collider, + Vec3f* a, Vec3f* b) { static Vec3f intersectA; static Vec3f intersectB; ColliderCylinder* cylinder = (ColliderCylinder*)collider; @@ -3600,8 +3607,7 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a f32 actorDotItemXZ; f32 zero = 0.0f; f32 closeDist; - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); actorToItem.x = itemPos->x - actorPos->x; actorToItem.y = itemPos->y - actorPos->y - offset; diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 0f737145e1..828204c047 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -1,4 +1,5 @@ #include "map.h" +#include "attributes.h" #include "printf.h" #include "regs.h" #include "segment_symbols.h" @@ -711,6 +712,6 @@ void Regs_InitDataImpl(void) { R_GAME_OVER_RUMBLE_DECREASE_RATE = -63; } -void Regs_InitData(PlayState* play) { +void Regs_InitData(UNUSED PlayState* play) { Regs_InitDataImpl(); } diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 6de85056c2..529ac06dd6 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libu64/gfxprint.h" #include "libu64/pad.h" #include "array_count.h" @@ -8,6 +9,7 @@ #include "gfxalloc.h" #include "regs.h" #include "rumble.h" +#include "stack_pad.h" #include "ultra64.h" #include "debug.h" @@ -125,7 +127,7 @@ void Regs_Init(void) { } // Function is stubbed. Name is assumed by similarities in signature to `DebugCamera_ScreenTextColored` and usage. -void DebugCamera_ScreenText(u8 x, u8 y, const char* text) { +void DebugCamera_ScreenText(UNUSED u8 x, UNUSED u8 y, UNUSED const char* text) { } void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { @@ -264,7 +266,7 @@ void Regs_DrawEditor(GfxPrint* printer) { s32 i; s32 pageStart = (gRegEditor->regPage - 1) * REGS_PER_PAGE; s32 pageDataStart = ((gRegEditor->regGroup * REG_PAGES) + gRegEditor->regPage - 1) * REGS_PER_PAGE; - s32 pad; + STACK_PAD(s32); char regGroupName[3]; regGroupName[0] = 'R'; @@ -295,7 +297,7 @@ void Debug_DrawText(GraphicsContext* gfxCtx) { Gfx* gfx; Gfx* opaStart; GfxPrint printer; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_debug.c", 628); diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 5adc6ca48a..fd129c9a43 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -3,6 +3,7 @@ #include "libu64/gfxprint.h" #include "array_count.h" +#include "attributes.h" #include "controller.h" #include "gfx.h" #include "gfxalloc.h" @@ -19,6 +20,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "audio.h" @@ -164,9 +166,9 @@ s16 sQuakeIndex; void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx); #if DEBUG_FEATURES -void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx) { +void Cutscene_DrawDebugInfo(UNUSED PlayState* play, Gfx** dlist, CutsceneContext* csCtx) { GfxPrint printer; - s32 pad[2]; + STACK_PADS(s32, 2); GfxPrint_Init(&printer); GfxPrint_Open(&printer, *dlist); @@ -185,17 +187,17 @@ void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx } #endif -void Cutscene_InitContext(PlayState* play, CutsceneContext* csCtx) { +void Cutscene_InitContext(UNUSED PlayState* play, CutsceneContext* csCtx) { csCtx->state = CS_STATE_IDLE; csCtx->timer = 0.0f; } -void Cutscene_StartManual(PlayState* play, CutsceneContext* csCtx) { +void Cutscene_StartManual(UNUSED PlayState* play, CutsceneContext* csCtx) { csCtx->state = CS_STATE_START; csCtx->playerCue = NULL; } -void Cutscene_StopManual(PlayState* play, CutsceneContext* csCtx) { +void Cutscene_StopManual(UNUSED PlayState* play, CutsceneContext* csCtx) { if (csCtx->state != CS_STATE_RUN_UNSTOPPABLE) { csCtx->state = CS_STATE_STOP; } @@ -243,10 +245,10 @@ void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { } } -void CutsceneHandler_DoNothing(PlayState* play, CutsceneContext* csCtx) { +void CutsceneHandler_DoNothing(UNUSED PlayState* play, UNUSED CutsceneContext* csCtx) { } -u32 Cutscene_StepTimer(PlayState* play, CutsceneContext* csCtx, f32 target) { +u32 Cutscene_StepTimer(UNUSED PlayState* play, CutsceneContext* csCtx, f32 target) { return Math_StepToF(&csCtx->timer, target, 0.1f); } @@ -541,19 +543,19 @@ void CutsceneCmd_SetLightSetting(PlayState* play, CutsceneContext* csCtx, CsCmdL } } -void CutsceneCmd_StartSequence(PlayState* play, CutsceneContext* csCtx, CsCmdStartSeq* cmd) { +void CutsceneCmd_StartSequence(UNUSED PlayState* play, CutsceneContext* csCtx, CsCmdStartSeq* cmd) { if (csCtx->curFrame == cmd->startFrame) { Audio_PlaySequenceInCutscene(cmd->seqIdPlusOne - 1); } } -void CutsceneCmd_StopSequence(PlayState* play, CutsceneContext* csCtx, CsCmdStopSeq* cmd) { +void CutsceneCmd_StopSequence(UNUSED PlayState* play, CutsceneContext* csCtx, CsCmdStopSeq* cmd) { if (csCtx->curFrame == cmd->startFrame) { Audio_StopSequenceInCutscene(cmd->seqIdPlusOne - 1); } } -void CutsceneCmd_FadeOutSequence(PlayState* play, CutsceneContext* csCtx, CsCmdFadeOutSeq* cmd) { +void CutsceneCmd_FadeOutSequence(UNUSED PlayState* play, CutsceneContext* csCtx, CsCmdFadeOutSeq* cmd) { u8 fadeOutDuration; if ((csCtx->curFrame == cmd->startFrame) && (csCtx->curFrame < cmd->endFrame)) { @@ -567,13 +569,13 @@ void CutsceneCmd_FadeOutSequence(PlayState* play, CutsceneContext* csCtx, CsCmdF } } -void CutsceneCmd_RumbleController(PlayState* play, CutsceneContext* csCtx, CsCmdRumble* cmd) { +void CutsceneCmd_RumbleController(UNUSED PlayState* play, CutsceneContext* csCtx, CsCmdRumble* cmd) { if (csCtx->curFrame == cmd->startFrame) { Rumble_Request(0.0f, cmd->sourceStrength, cmd->duration, cmd->decreaseRate); } } -void CutsceneCmd_SetTime(PlayState* play, CutsceneContext* csCtx, CsCmdTime* cmd) { +void CutsceneCmd_SetTime(UNUSED PlayState* play, CutsceneContext* csCtx, CsCmdTime* cmd) { s16 hours; s16 minutes; @@ -1637,7 +1639,7 @@ s32 CutsceneCmd_UpdateCamAtSpline(PlayState* play, CutsceneContext* csCtx, u8* s return size; } -s32 CutsceneCmd_SetCamEye(PlayState* play, CutsceneContext* csCtx, u8* script, u8 unused) { +s32 CutsceneCmd_SetCamEye(PlayState* play, CutsceneContext* csCtx, u8* script, UNUSED u8 arg3) { CsCmdCam* cmd = (CsCmdCam*)script; s32 size; Vec3f at; @@ -1686,7 +1688,7 @@ s32 CutsceneCmd_SetCamEye(PlayState* play, CutsceneContext* csCtx, u8* script, u return size; } -s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8 unused) { +s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, UNUSED u8 arg3) { CsCmdCam* cmd = (CsCmdCam*)script; s32 size; Vec3f at; @@ -1734,7 +1736,7 @@ s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8 void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) { u8 dialogState; #if PLATFORM_N64 - s32 pad; + STACK_PAD(s32); #endif s16 endFrame; @@ -2373,7 +2375,7 @@ u16 D_8015FCCC; char D_8015FCD0[20]; // unreferenced u8 D_8015FCE4; // only written to, never read -void func_80069048(PlayState* play) { +void func_80069048(UNUSED PlayState* play) { s16 i; D_8015FCCC = 0; @@ -2383,7 +2385,7 @@ void func_80069048(PlayState* play) { D_8015FCE4 = 0; } -void func_8006907C(PlayState* play) { +void func_8006907C(UNUSED PlayState* play) { if (D_8015FCCC != 0) { D_8015FCCC = 0; } diff --git a/src/code/z_draw.c b/src/code/z_draw.c index f2c600f6a2..926b430059 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -1,5 +1,6 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "draw.h" #include "play_state.h" @@ -385,7 +386,7 @@ void GetItem_Draw(PlayState* play, s16 giDrawId) { // All remaining functions in this file are draw functions referenced in the table and called by the function above void GetItem_DrawMaskOrBombchu(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556); @@ -397,7 +398,7 @@ void GetItem_DrawMaskOrBombchu(PlayState* play, s16 giDrawId) { } void GetItem_DrawSoldOut(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572); @@ -409,7 +410,7 @@ void GetItem_DrawSoldOut(PlayState* play, s16 giDrawId) { } void GetItem_DrawBlueFire(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588); @@ -433,7 +434,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 giDrawId) { } void GetItem_DrawPoes(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628); @@ -459,7 +460,7 @@ void GetItem_DrawPoes(PlayState* play, s16 giDrawId) { } void GetItem_DrawFairy(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670); @@ -484,7 +485,7 @@ void GetItem_DrawFairy(PlayState* play, s16 giDrawId) { } void GetItem_DrawMirrorShield(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 712); @@ -504,7 +505,7 @@ void GetItem_DrawMirrorShield(PlayState* play, s16 giDrawId) { } void GetItem_DrawSkullToken(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742); @@ -537,7 +538,7 @@ void GetItem_DrawEggOrMedallion(PlayState* play, s16 giDrawId) { } void GetItem_DrawCompass(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811); @@ -553,7 +554,7 @@ void GetItem_DrawCompass(PlayState* play, s16 giDrawId) { } void GetItem_DrawPotion(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 834); @@ -577,7 +578,7 @@ void GetItem_DrawPotion(PlayState* play, s16 giDrawId) { } void GetItem_DrawGoronSword(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 868); @@ -593,7 +594,7 @@ void GetItem_DrawGoronSword(PlayState* play, s16 giDrawId) { } void GetItem_DrawDekuNuts(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 890); @@ -609,7 +610,7 @@ void GetItem_DrawDekuNuts(PlayState* play, s16 giDrawId) { } void GetItem_DrawRecoveryHeart(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 913); @@ -625,7 +626,7 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 giDrawId) { } void GetItem_DrawFish(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 936); @@ -641,7 +642,7 @@ void GetItem_DrawFish(PlayState* play, s16 giDrawId) { } void GetItem_DrawOpa0(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959); @@ -653,7 +654,7 @@ void GetItem_DrawOpa0(PlayState* play, s16 giDrawId) { } void GetItem_DrawOpa0Xlu1(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975); @@ -682,7 +683,7 @@ void GetItem_DrawXlu01(PlayState* play, s16 giDrawId) { } void GetItem_DrawOpa10Xlu2(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015); @@ -699,7 +700,7 @@ void GetItem_DrawOpa10Xlu2(PlayState* play, s16 giDrawId) { } void GetItem_DrawMagicArrow(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039); @@ -716,7 +717,7 @@ void GetItem_DrawMagicArrow(PlayState* play, s16 giDrawId) { } void GetItem_DrawMagicSpell(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1063); @@ -734,7 +735,7 @@ void GetItem_DrawMagicSpell(PlayState* play, s16 giDrawId) { } void GetItem_DrawOpa1023(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088); @@ -749,7 +750,7 @@ void GetItem_DrawOpa1023(PlayState* play, s16 giDrawId) { } void GetItem_DrawOpa10Xlu32(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108); @@ -767,7 +768,7 @@ void GetItem_DrawOpa10Xlu32(PlayState* play, s16 giDrawId) { } void GetItem_DrawSmallRupee(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1133); @@ -787,7 +788,7 @@ void GetItem_DrawSmallRupee(PlayState* play, s16 giDrawId) { } void GetItem_DrawScale(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1162); @@ -825,7 +826,7 @@ void GetItem_DrawBulletBag(PlayState* play, s16 giDrawId) { } void GetItem_DrawWallet(PlayState* play, s16 giDrawId) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index a5df803229..d38317a4e1 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -1,7 +1,9 @@ #include "libc64/math64.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "translation.h" @@ -189,7 +191,7 @@ void EffectBlure_Init2(void* thisx, void* initParamsx) { } } -void EffectBlure_Destroy(void* thisx) { +void EffectBlure_Destroy(UNUSED void* thisx) { } s32 EffectBlure_Update(void* thisx) { @@ -379,7 +381,7 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3 } } -void EffectBlure_SetupSmooth(EffectBlure* this, GraphicsContext* gfxCtx) { +void EffectBlure_SetupSmooth(UNUSED EffectBlure* this, GraphicsContext* gfxCtx) { OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 809); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_38); @@ -608,8 +610,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem f32 temp_f22 = temp_f2 - 2.0f * temp_f0 + temp_f28; // t^3 - 2t^2 + t f32 temp_f24 = 2.0f * temp_f2 - temp_f0 * 3.0f + 1.0f; // 2t^3 - 3t^2 + 1 f32 temp_f26 = temp_f0 * 3.0f - 2.0f * temp_f2; // 3t^2 - 2t^3 - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); // p = (2t^3 - 3t^2 + 1)p0 + (3t^2 - 2t^3)p1 + (t^3 - 2t^2 + t)m0 + (t^3 - t^2)m1 spE0.x = (temp_f24 * sp1CC.x) + (temp_f26 * sp18C.x) + (temp_f22 * sp1B4.x) + (temp_f20 * sp174.x); @@ -711,7 +712,7 @@ void EffectBlure_DrawSmooth(EffectBlure* this2, GraphicsContext* gfxCtx) { CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 1263); } -void EffectBlure_SetupSimple(GraphicsContext* gfxCtx, EffectBlure* this, Vtx* vtx) { +void EffectBlure_SetupSimple(GraphicsContext* gfxCtx, UNUSED EffectBlure* this, UNUSED Vtx* vtx) { OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1280); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_38); @@ -719,7 +720,7 @@ void EffectBlure_SetupSimple(GraphicsContext* gfxCtx, EffectBlure* this, Vtx* vt CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 1285); } -void EffectBlure_SetupSimpleAlt(GraphicsContext* gfxCtx, EffectBlure* this, Vtx* vtx) { +void EffectBlure_SetupSimpleAlt(GraphicsContext* gfxCtx, EffectBlure* this, UNUSED Vtx* vtx) { OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1294); gDPPipeSync(POLY_XLU_DISP++); diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index ae6a84c47d..adc4cc77b0 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -1,5 +1,6 @@ #include "libc64/qrand.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -102,7 +103,7 @@ void EffectSpark_Init(void* thisx, void* initParamsx) { } } -void EffectSpark_Destroy(void* thisx) { +void EffectSpark_Destroy(UNUSED void* thisx) { } // original name: "EffectSparkInfo_proc" diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index b29cb0a32f..5c4ae03a70 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -1,4 +1,5 @@ #include "gfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -53,7 +54,7 @@ void func_80026400(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { } void func_80026608(PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 159); @@ -108,7 +109,7 @@ void func_80026860(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { } void func_80026A6C(PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 217); diff --git a/src/code/z_effect.c b/src/code/z_effect.c index a725cd3172..2bfec80fbe 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -1,4 +1,5 @@ #include "gfx.h" +#include "attributes.h" #include "printf.h" #include "translation.h" #include "effect.h" @@ -215,7 +216,7 @@ void Effect_UpdateAll(PlayState* play) { } } -void Effect_Delete(PlayState* play, s32 index) { +void Effect_Delete(UNUSED PlayState* play, s32 index) { if (index == TOTAL_EFFECT_COUNT) { return; } @@ -241,7 +242,7 @@ void Effect_Delete(PlayState* play, s32 index) { } } -void Effect_DeleteAll(PlayState* play) { +void Effect_DeleteAll(UNUSED PlayState* play) { s32 i; PRINTF(T("エフェクト総て解放\n", "All effects release\n")); diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 363367a85c..6158d817f9 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -1,5 +1,6 @@ #include "libu64/overlay.h" #include "array_count.h" +#include "attributes.h" #include "printf.h" #include "sfx.h" #include "terminal.h" @@ -43,7 +44,7 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) { } } -void EffectSs_ClearAll(PlayState* play) { +void EffectSs_ClearAll(UNUSED PlayState* play) { u32 i; EffectSs* effectSs; EffectSsOverlay* overlay; diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index fea0102140..c02861ea57 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -1,11 +1,13 @@ #include "libc64/qrand.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -60,7 +62,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) { MtxF mfScale; MtxF mfResult; MtxF mfTransBillboard; - s32 pad1; + STACK_PAD(s32); Mtx* mtx; void* objectPtr = play->objectCtx.slots[this->rgObjectSlot].segment; @@ -692,8 +694,8 @@ void EffectSsSibuki_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* a void EffectSsSibuki_SpawnBurst(PlayState* play, Vec3f* pos) { s16 i; - Vec3f unusedZeroVec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f unusedZeroVec2 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec2 = { 0.0f, 0.0f, 0.0f }; Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; s16 randDirection = Rand_ZeroOne() * 1.99f; diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 12d31b4f0a..da9e784533 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -1,7 +1,9 @@ #include "z_en_a_obj.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -83,7 +85,7 @@ void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) { void EnAObj_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; - s32 pad; + STACK_PAD(s32); EnAObj* this = (EnAObj*)thisx; f32 shadowScale = 6.0f; @@ -200,7 +202,7 @@ void EnAObj_WaitFinishedTalking(EnAObj* this, PlayState* play) { } } -void EnAObj_SetupWaitTalk(EnAObj* this, s16 type) { +void EnAObj_SetupWaitTalk(EnAObj* this, UNUSED s16 type) { EnAObj_SetupAction(this, EnAObj_WaitTalk); } @@ -220,7 +222,7 @@ void EnAObj_WaitTalk(EnAObj* this, PlayState* play) { } } -void EnAObj_SetupBlockRot(EnAObj* this, s16 type) { +void EnAObj_SetupBlockRot(EnAObj* this, UNUSED s16 type) { this->rotateState = 0; this->rotateWaitTimer = 10; this->dyna.actor.world.rot.y = 0; @@ -228,7 +230,7 @@ void EnAObj_SetupBlockRot(EnAObj* this, s16 type) { EnAObj_SetupAction(this, EnAObj_BlockRot); } -void EnAObj_BlockRot(EnAObj* this, PlayState* play) { +void EnAObj_BlockRot(EnAObj* this, UNUSED PlayState* play) { if (this->rotateState == 0) { if (this->dyna.interactFlags != 0) { this->rotateState++; @@ -267,11 +269,11 @@ void EnAObj_BlockRot(EnAObj* this, PlayState* play) { } } -void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type) { +void EnAObj_SetupBoulderFragment(EnAObj* this, UNUSED s16 type) { EnAObj_SetupAction(this, EnAObj_BoulderFragment); } -void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) { +void EnAObj_BoulderFragment(EnAObj* this, UNUSED PlayState* play) { Math_SmoothStepToF(&this->dyna.actor.speed, 1.0f, 1.0f, 0.5f, 0.0f); this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1; this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1; @@ -294,13 +296,13 @@ void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) { } } -void EnAObj_SetupBlock(EnAObj* this, s16 type) { +void EnAObj_SetupBlock(EnAObj* this, UNUSED s16 type) { this->dyna.actor.cullingVolumeDownward = 1200.0f; this->dyna.actor.cullingVolumeScale = 720.0f; EnAObj_SetupAction(this, EnAObj_Block); } -void EnAObj_Block(EnAObj* this, PlayState* play) { +void EnAObj_Block(EnAObj* this, UNUSED PlayState* play) { this->dyna.actor.speed += this->dyna.unk_150; this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -2.5f, 2.5f); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 43668baebb..da7f68a3d5 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -10,6 +10,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "draw.h" @@ -388,12 +389,12 @@ void EnItem00_SetupAction(EnItem00* this, EnItem00ActionFunc actionFunc) { void EnItem00_Init(Actor* thisx, PlayState* play) { EnItem00* this = (EnItem00*)thisx; - s32 pad; + STACK_PAD(s32); f32 yOffset = 980.0f; f32 shadowScale = 6.0f; s32 getItemId = GI_NONE; s16 spawnParam8000 = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); - s32 pad1; + STACK_PAD(s32); this->collectibleFlag = PARAMS_GET_S(this->actor.params, 8, 6); @@ -614,7 +615,7 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_8001DFC8(EnItem00* this, PlayState* play) { +void func_8001DFC8(EnItem00* this, UNUSED PlayState* play) { if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_RECOVERY_HEART) && (this->despawnTimer < 0)) || (this->actor.params == ITEM00_HEART_PIECE)) { @@ -690,7 +691,7 @@ void func_8001E1C8(EnItem00* this, PlayState* play) { } void func_8001E304(EnItem00* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f pos; s32 rotOffset; @@ -787,7 +788,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { s16 i; u32* temp; EnItem00* this = (EnItem00*)thisx; - s32 pad; + STACK_PAD(s32); if (this->despawnTimer > 0) { this->despawnTimer--; @@ -1067,7 +1068,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { * Draw Function used for Rupee types of En_Item00. */ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 texIndex; OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1546); @@ -1120,7 +1121,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) { * Draw Function used for the Heart Container type of En_Item00. */ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1623); @@ -1141,7 +1142,7 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { * Draw Function used for the Piece of Heart type of En_Item00. */ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1658); @@ -1192,7 +1193,7 @@ s16 func_8001F404(s16 dropId) { // External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor. EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) { - s32 pad[2]; + STACK_PADS(s32, 2); EnItem00* spawnedActor = NULL; s16 param4000 = params & 0x4000; s16 param8000 = params & 0x8000; @@ -1236,7 +1237,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) { EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) { EnItem00* spawnedActor = NULL; - s32 pad; + STACK_PAD(s32); s16 param4000 = params & 0x4000; s16 param8000 = params & 0x8000; s16 param3F00 = params & 0x3F00; @@ -1268,7 +1269,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) { } void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params) { - s32 pad; + STACK_PAD(s32); EnItem00* spawnedActor; s16 dropQuantity; s16 param8000; diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index b37c4aeb39..c9efa5978b 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -11,6 +11,7 @@ */ #include "transition_tile.h" +#include "attributes.h" #include "libc64/malloc.h" #include "libc64/sleep.h" #include "libu64/debug.h" @@ -258,9 +259,9 @@ void TransitionTile_Suck(TransitionTile* this) { } } -void TransitionTile_Update(TransitionTile* this) { +void TransitionTile_Update(UNUSED TransitionTile* this) { } -s32 func_800B23F0(TransitionTile* this) { +s32 func_800B23F0(UNUSED TransitionTile* this) { return 0; } diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 0a7dabdd6b..4756f33116 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,5 +1,6 @@ #include "transition_circle.h" +#include "attributes.h" #include "color.h" #include "gfx.h" #include "sfx.h" @@ -84,7 +85,7 @@ void* TransitionCircle_Init(void* thisx) { return this; } -void TransitionCircle_Destroy(void* thisx) { +void TransitionCircle_Destroy(UNUSED void* thisx) { } void TransitionCircle_Update(void* thisx, s32 updateRate) { diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index 4798a225a8..268c7ee164 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -1,5 +1,6 @@ #include "transition_fade.h" +#include "attributes.h" #include "main.h" #include "printf.h" #include "regs.h" @@ -57,7 +58,7 @@ void* TransitionFade_Init(void* thisx) { return this; } -void TransitionFade_Destroy(void* thisx) { +void TransitionFade_Destroy(UNUSED void* thisx) { } void TransitionFade_Update(void* thisx, s32 updateRate) { diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c index b1a5b2e679..045149fdc4 100644 --- a/src/code/z_fbdemo_triforce.c +++ b/src/code/z_fbdemo_triforce.c @@ -1,6 +1,8 @@ #include "transition_triforce.h" +#include "attributes.h" #include "printf.h" +#include "stack_pad.h" #include "z_math.h" #include "transition_instances.h" @@ -34,7 +36,7 @@ void* TransitionTriforce_Init(void* thisx) { return this; } -void TransitionTriforce_Destroy(void* thisx) { +void TransitionTriforce_Destroy(UNUSED void* thisx) { } void TransitionTriforce_Update(void* thisx, s32 updateRate) { @@ -78,7 +80,7 @@ void TransitionTriforce_Draw(void* thisx, Gfx** gfxP) { Mtx* modelView; f32 scale; TransitionTriforce* this = (TransitionTriforce*)thisx; - s32 pad; + STACK_PAD(s32); f32 rotation = this->transPos * 360.0f; modelView = this->modelView[this->frame]; diff --git a/src/code/z_fbdemo_wipe1.c b/src/code/z_fbdemo_wipe1.c index 6a5dd62e5c..40c9ece1a5 100644 --- a/src/code/z_fbdemo_wipe1.c +++ b/src/code/z_fbdemo_wipe1.c @@ -1,7 +1,9 @@ #include "transition_wipe.h" +#include "attributes.h" #include "gfx.h" #include "save.h" +#include "stack_pad.h" #include "transition_instances.h" typedef enum TransitionWipeDirection { @@ -39,7 +41,7 @@ void* TransitionWipe_Init(void* thisx) { return this; } -void TransitionWipe_Destroy(void* thisx) { +void TransitionWipe_Destroy(UNUSED void* thisx) { } void TransitionWipe_Update(void* thisx, s32 updateRate) { @@ -65,7 +67,7 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) { Mtx* modelView; TransitionWipe* this = (TransitionWipe*)thisx; Color_RGBA8_u32* color; - s32 pad[3]; + STACK_PADS(s32, 3); Gfx* texScroll; modelView = this->modelView[this->frame]; diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index da1325ee17..512314d776 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -26,9 +26,11 @@ */ #include "gfx.h" +#include "attributes.h" #include "printf.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "zelda_arena.h" @@ -52,9 +54,9 @@ void SkelCurve_Clear(SkelCurve* skelCurve) { * * @return bool always true */ -s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* skeletonHeaderSeg, - CurveAnimationHeader* animation) { - SkelCurveLimb** limbs; +s32 SkelCurve_Init(UNUSED PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* skeletonHeaderSeg, + UNUSED CurveAnimationHeader* animation) { + STACK_PAD(s32); CurveSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelCurve->limbCount = skeletonHeader->limbCount; @@ -70,7 +72,7 @@ s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* s /** * Frees the joint table. */ -void SkelCurve_Destroy(PlayState* play, SkelCurve* skelCurve) { +void SkelCurve_Destroy(UNUSED PlayState* play, SkelCurve* skelCurve) { if (skelCurve->jointTable != NULL) { ZELDA_ARENA_FREE(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146); } @@ -100,7 +102,7 @@ typedef enum SkelCurveVecType { * * @return bool true when the animation has finished. */ -s32 SkelCurve_Update(PlayState* play, SkelCurve* skelCurve) { +s32 SkelCurve_Update(UNUSED PlayState* play, SkelCurve* skelCurve) { s16* jointData; u8* knotCounts; CurveAnimationHeader* animation; @@ -196,7 +198,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY); if (lod == 0) { - s32 pad1; + STACK_PAD(s32); dList = limb->dList[0]; if (dList != NULL) { @@ -204,7 +206,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov gSPDisplayList(POLY_OPA_DISP++, dList); } } else if (lod == 1) { - s32 pad2; + STACK_PAD(s32); dList = limb->dList[0]; if (dList != NULL) { @@ -238,7 +240,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov CLOSE_DISPS(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 371); } -void SkelCurve_Draw(Actor* actor, PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw, +void SkelCurve_Draw(UNUSED Actor* actor, PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, void* data) { if (skelCurve->jointTable != NULL) { SkelCurve_DrawLimb(play, 0, skelCurve, overrideLimbDraw, postLimbDraw, lod, data); diff --git a/src/code/z_horse.c b/src/code/z_horse.c index ab556c3d13..89f1b41d99 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -1,4 +1,6 @@ #include "array_count.h" +#include "attributes.h" +#include "stack_pad.h" #include "terminal.h" #include "z_lib.h" #include "printf.h" @@ -33,7 +35,7 @@ s32 Horse_CanSpawn(s32 sceneId) { /** * Sets horseData to a neutral spawn in Hyrule Field */ -void Horse_ResetHorseData(PlayState* play) { +void Horse_ResetHorseData(UNUSED PlayState* play) { gSaveContext.save.info.horseData.sceneId = SCENE_HYRULE_FIELD; gSaveContext.save.info.horseData.pos.x = -1840; gSaveContext.save.info.horseData.pos.y = 72; @@ -45,7 +47,7 @@ void Horse_ResetHorseData(PlayState* play) { * Forces the player horse to spawn in a safe spot if the current spawn is in Lake Hylia * This prevents the horse from spawning underwater after obtaining the Water Medallion */ -void Horse_FixLakeHyliaPosition(PlayState* play) { +void Horse_FixLakeHyliaPosition(UNUSED PlayState* play) { if (gSaveContext.save.info.horseData.sceneId == SCENE_LAKE_HYLIA) { gSaveContext.save.info.horseData.sceneId = SCENE_LAKE_HYLIA; gSaveContext.save.info.horseData.pos.x = -2065; @@ -98,7 +100,7 @@ void Horse_SetupInGameplay(PlayState* play, Player* player) { } else if ((gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_7) && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) { // Completed Horse Race - Actor* horseActor = + UNUSED_NDEBUG Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, HORSE_PTYPE_1); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389); } else if ((play->sceneId == gSaveContext.save.info.horseData.sceneId) && @@ -129,7 +131,7 @@ void Horse_SetupInGameplay(PlayState* play, Player* player) { } else if ((play->sceneId == SCENE_LON_LON_RANCH) && !(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED)) { // Player spawns in Lon-Lon Ranch without owning Epona - Actor* horseActor = + UNUSED_NDEBUG Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, HORSE_PTYPE_1); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443); } else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED) { @@ -174,7 +176,7 @@ void Horse_SetupInCutscene(PlayState* play, Player* player) { { SCENE_HYRULE_FIELD, 0xFFF6, { -4043, 313, 6933 }, 0x0000, HORSE_PTYPE_7 }, // Unused. Hopping Lon Lon // Ranch North Gate }; - s32 pad; + STACK_PAD(s32); s32 i; if ((gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_11 || diff --git a/src/code/z_inventory.c b/src/code/z_inventory.c index 8ae2bcbf20..26b48a2e9e 100644 --- a/src/code/z_inventory.c +++ b/src/code/z_inventory.c @@ -1,5 +1,6 @@ #include "ultra64.h" #include "printf.h" +#include "stack_pad.h" #include "translation.h" #include "play_state.h" #include "player.h" @@ -288,7 +289,7 @@ void Inventory_ChangeEquipment(s16 equipment, u16 value) { u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); u16 equipValue = gSaveContext.save.info.equips.equipment & gEquipMasks[equipment]; PRINTF(T("装備アイテム抹消 = %d zzz=%d\n", "Erasing equipment item = %d zzz=%d\n"), equipment, equipValue); diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 4413e8ae69..8f0300eb08 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -4,6 +4,7 @@ #include "attributes.h" #include "gfx.h" #include "printf.h" +#include "stack_pad.h" #include "sys_ucode.h" #include "terminal.h" #include "translation.h" @@ -46,7 +47,7 @@ void Jpeg_ScheduleDecoderTask(JpegContext* ctx) { }; JpegWork* workBuf = ctx->workBuf; - s32 pad[2]; + STACK_PADS(s32, 2); workBuf->taskData.address = OS_K0_TO_PHYSICAL(&workBuf->data); workBuf->taskData.mode = ctx->mode; @@ -238,7 +239,7 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* ctx) { } } -s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize) { +s32 Jpeg_Decode(void* data, void* zbuffer, void* work, UNUSED_NDEBUG u32 workSize) { s32 y; s32 x; u32 j; diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index b3ef531649..1647c58e61 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -1,3 +1,4 @@ +#include "attributes.h" #include "controller.h" #include "letterbox.h" #if PLATFORM_N64 @@ -5,6 +6,7 @@ #endif #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "audio.h" #include "play_state.h" #include "save.h" @@ -67,7 +69,7 @@ void KaleidoSetup_Update(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; Input* input = &play->state.input[0]; #if PLATFORM_N64 - s32 pad; + STACK_PAD(s32); #endif if (!IS_PAUSED(pauseCtx) && play->gameOverCtx.state == GAMEOVER_INACTIVE && @@ -189,7 +191,7 @@ void KaleidoSetup_Init(PlayState* play) { #endif } -void KaleidoSetup_Destroy(PlayState* play) { +void KaleidoSetup_Destroy(UNUSED PlayState* play) { #if PLATFORM_N64 if ((B_80121220 != NULL) && (B_80121220->unk_40 != NULL)) { B_80121220->unk_40(); diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 280bfa3df8..1330cbeb0f 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -1,4 +1,5 @@ #include "kanread.h" +#include "attributes.h" #include "message_data_static.h" #include "printf.h" #include "segment_symbols.h" @@ -12,11 +13,13 @@ * Loads a texture from kanji for the requested `character` into the character texture buffer * at `codePointIndex`. The value of `character` is the SHIFT-JIS encoding of the character. */ -void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex) { #if OOT_NTSC +void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex) { DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex], (uintptr_t)_kanjiSegmentRomStart + Kanji_OffsetFromShiftJIS(character), FONT_CHAR_TEX_SIZE, "../z_kanfont.c", UNK_LINE); +#else +void Font_LoadCharWide(UNUSED Font* font, UNUSED u16 character, UNUSED u16 codePointIndex) { #endif } @@ -63,7 +66,9 @@ void Font_LoadOrderedFont(Font* font) { s32 fontBufIndex; u32 offset; const char* messageDataStart; +#if PLATFORM_IQUE u16* msgBufWide; +#endif #if OOT_NTSC && !PLATFORM_IQUE messageDataStart = (const char*)_jpn_message_data_staticSegmentStart; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 83699c82f3..d9e9bdea3d 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -4,6 +4,7 @@ #include "libc64/qrand.h" #include "libu64/gfxprint.h" #include "array_count.h" +#include "attributes.h" #include "buffers.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -17,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_math3d.h" #include "sys_matrix.h" @@ -273,14 +275,14 @@ u16 Environment_GetPixelDepth(s32 x, s32 y) { return pixelDepth; } -void Environment_GraphCallback(GraphicsContext* gfxCtx, void* param) { +void Environment_GraphCallback(UNUSED GraphicsContext* gfxCtx, void* param) { PlayState* play = (PlayState*)param; sSunScreenDepth = Environment_GetPixelDepth(sSunDepthTestX, sSunDepthTestY); Lights_GlowCheck(play); } -void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) { +void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, UNUSED s32 arg2) { u8 i; PlayState* play = play2; @@ -630,7 +632,7 @@ f32 Environment_LerpWeightAccelDecel(u16 endFrame, u16 startFrame, u16 curFrame, return ret; } -void Environment_UpdateStorm(EnvironmentContext* envCtx, u8 unused) { +void Environment_UpdateStorm(EnvironmentContext* envCtx, UNUSED u8 arg1) { if (envCtx->stormRequest != STORM_REQUEST_NONE) { switch (envCtx->stormState) { case STORM_STATE_OFF: @@ -860,9 +862,9 @@ void Environment_DisableUnderwaterLights(PlayState* play) { } #if DEBUG_FEATURES -void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) { +void Environment_PrintDebugInfo(UNUSED PlayState* play, Gfx** gfx) { GfxPrint printer; - s32 pad[2]; + STACK_PADS(s32, 2); GfxPrint_Init(&printer); GfxPrint_Open(&printer, *gfx); @@ -920,7 +922,7 @@ void Environment_PlayTimeBasedSequence(PlayState* play); void Environment_UpdateRain(PlayState* play); void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, PauseContext* pauseCtx, - MessageContext* msgCtx, GameOverContext* gameOverCtx, GraphicsContext* gfxCtx) { + MessageContext* msgCtx, GameOverContext* gameOverCtx, UNUSED GraphicsContext* gfxCtx) { f32 timeChangeBlend; f32 configChangeBlend = 0.0f; u16 i; @@ -1507,8 +1509,8 @@ void Environment_DrawSunAndMoon(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 2429); } -void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, - Vec3f pos, s32 unused) { +void Environment_DrawSunLensFlare(PlayState* play, UNUSED EnvironmentContext* envCtx, UNUSED View* view, + UNUSED GraphicsContext* gfxCtx, Vec3f pos, UNUSED s32 arg5) { if ((play->envCtx.precipitation[PRECIP_RAIN_CUR] == 0) && (play->envCtx.skyboxConfig == 0)) { Environment_DrawLensFlare(play, &play->envCtx, &play->view, play->state.gfxCtx, pos, 2000, 370, Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 120.0f, 400, @@ -1525,7 +1527,7 @@ typedef enum LensFlareType { } LensFlareType; void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, - Vec3f pos, s32 unused, s16 scale, f32 colorIntensity, s16 glareStrength, u8 isSun) { + Vec3f pos, UNUSED s32 arg5, s16 scale, f32 colorIntensity, s16 glareStrength, u8 isSun) { s16 i; f32 tempX; f32 tempY; @@ -1545,7 +1547,7 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View f32 halfPosY; f32 halfPosZ; f32 cosAngle; - s32 pad; + STACK_PAD(s32); f32 lensFlareAlphaScaleTarget; u32 isOffScreen = false; f32 alpha; @@ -1738,7 +1740,7 @@ f32 Environment_RandCentered(void) { void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) { s16 i; - s32 pad; + STACK_PAD(s32); Vec3f vec; f32 temp1; f32 temp2; @@ -1751,7 +1753,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx) f32 z50; f32 x280; f32 z280; - Vec3f unused = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Player* player = GET_PLAYER(play); @@ -1996,7 +1998,7 @@ void Environment_UpdateLightningStrike(PlayState* play) { * Request the number of lightning bolts specified by `num` * Note: only 3 lightning bolts can be active at the same time. */ -void Environment_AddLightningBolts(PlayState* play, u8 num) { +void Environment_AddLightningBolts(UNUSED PlayState* play, u8 num) { s16 boltsAdded = 0; s16 i; @@ -2015,7 +2017,7 @@ void Environment_AddLightningBolts(PlayState* play, u8 num) { /** * Draw any active lightning bolt entries contained in `sLightningBolts` */ -void Environment_DrawLightning(PlayState* play, s32 unused) { +void Environment_DrawLightning(PlayState* play, UNUSED s32 arg1) { static void* lightningTextures[] = { gEffLightning1Tex, gEffLightning2Tex, gEffLightning3Tex, gEffLightning4Tex, gEffLightning5Tex, gEffLightning6Tex, @@ -2026,9 +2028,9 @@ void Environment_DrawLightning(PlayState* play, s32 unused) { f32 dz; f32 x; f32 z; - s32 pad[2]; - Vec3f unused1 = { 0.0f, 0.0f, 0.0f }; - Vec3f unused2 = { 0.0f, 0.0f, 0.0f }; + STACK_PADS(s32, 2); + UNUSED Vec3f zeroVec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec2 = { 0.0f, 0.0f, 0.0f }; OPEN_DISPS(play->state.gfxCtx, "../z_kankyo.c", 3253); @@ -2258,7 +2260,7 @@ void Environment_DrawCustomLensFlare(PlayState* play) { } void Environment_InitGameOverLights(PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); sGameOverLightsIntensity = 0; @@ -2418,7 +2420,7 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) { s32 envA = play->envCtx.sandstormEnvA; Color_RGBA8 primColor; Color_RGBA8 envColor; - s32 pad; + STACK_PAD(s32); f32 sp98; switch (sandstormState) { diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index 8ebefa7e62..9252650058 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -1,6 +1,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "lifemeter.h" @@ -305,7 +306,7 @@ static void* sHeartDDTextures[] = { }; void Health_DrawMeter(PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); void* heartBgImg; u32 curColorSet; f32 offsetX; @@ -321,7 +322,7 @@ void Health_DrawMeter(PlayState* play) { s32 curHeartFraction = gSaveContext.save.info.playerData.health % 0x10; s16 totalHeartCount = gSaveContext.save.info.playerData.healthCapacity / 0x10; s16 fullHeartCount = gSaveContext.save.info.playerData.health / 0x10; - s32 pad2; + STACK_PAD(s32); f32 beatingHeartPulsingSize = interfaceCtx->beatingHeartOscillator * 0.1f; s32 curCombineModeSet = 0; u8* curBgImgLoaded = NULL; diff --git a/src/code/z_lights.c b/src/code/z_lights.c index 4059faacaa..517e56a94e 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -1,7 +1,9 @@ #include "avoid_ub.h" +#include "attributes.h" #include "buffers.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "light.h" #include "play_state.h" @@ -132,7 +134,7 @@ void Lights_BindPoint(Lights* lights, LightParams* params, Vec3f* vec) { } } -void Lights_BindDirectional(Lights* lights, LightParams* params, Vec3f* vec) { +void Lights_BindDirectional(Lights* lights, LightParams* params, UNUSED Vec3f* vec) { Light* light = Lights_FindSlot(lights); if (light != NULL) { @@ -225,7 +227,7 @@ Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx) return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]); } -void LightContext_InitList(PlayState* play, LightContext* lightCtx) { +void LightContext_InitList(UNUSED PlayState* play, LightContext* lightCtx) { lightCtx->listHead = NULL; } @@ -242,7 +244,7 @@ void LightContext_DestroyList(PlayState* play, LightContext* lightCtx) { * Note: Due to the limited number of slots in a Lights group, inserting too many lights in the * list may result in older entries not being bound to a Light when calling Lights_BindAll */ -LightNode* LightContext_InsertLight(PlayState* play, LightContext* lightCtx, LightInfo* info) { +LightNode* LightContext_InsertLight(UNUSED PlayState* play, LightContext* lightCtx, LightInfo* info) { LightNode* node; node = Lights_FindBufSlot(); @@ -262,7 +264,7 @@ LightNode* LightContext_InsertLight(PlayState* play, LightContext* lightCtx, Lig return node; } -void LightContext_RemoveLight(PlayState* play, LightContext* lightCtx, LightNode* node) { +void LightContext_RemoveLight(UNUSED PlayState* play, LightContext* lightCtx, LightNode* node) { if (node != NULL) { if (node->prev != NULL) { node->prev->next = node->next; @@ -364,7 +366,7 @@ void Lights_GlowCheck(PlayState* play) { } void Lights_DrawGlow(PlayState* play) { - s32 pad; + STACK_PAD(s32); LightNode* node = play->lightCtx.listHead; OPEN_DISPS(play->state.gfxCtx, "../z_lights.c", 887); @@ -376,7 +378,7 @@ void Lights_DrawGlow(PlayState* play) { while (node != NULL) { if ((node->info->type == LIGHT_POINT_GLOW)) { - s32 pad[6]; + STACK_PADS(s32, 6); LightPoint* params = &node->info->params.point; if (params->drawGlow) { diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index ba6cb77f0a..b172fffa3a 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -9,6 +9,7 @@ #include "regs.h" #include "segment_symbols.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -361,7 +362,7 @@ void Map_Init(PlayState* play) { } void Minimap_DrawCompassIcons(PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s16 tempX, tempZ; @@ -408,7 +409,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { } void Minimap_Draw(PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); InterfaceContext* interfaceCtx = &play->interfaceCtx; s32 mapIndex = gSaveContext.mapIndex; diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 5abc554de4..6b5b723d46 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -1,4 +1,5 @@ #include "libu64/debug.h" +#include "attributes.h" #include "libu64/overlay.h" #include "map.h" #include "printf.h" @@ -74,7 +75,7 @@ void MapMark_Init(PlayState* play) { #endif } -void MapMark_ClearPointers(PlayState* play) { +void MapMark_ClearPointers(UNUSED PlayState* play) { #if PLATFORM_N64 if ((B_80121220 != NULL) && (B_80121220->unk_30 != NULL)) { B_80121220->unk_30(&sLoadedMarkDataTable); diff --git a/src/code/z_message.c b/src/code/z_message.c index 1fc06d7407..3d59d7fdaf 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -14,6 +14,7 @@ #include "printf.h" #include "segment_symbols.h" #include "sequence.h" +#include "stack_pad.h" #include "regs.h" #include "terminal.h" #include "translation.h" @@ -416,7 +417,7 @@ void Message_DrawTextChar(PlayState* play, void* textureImage, Gfx** p) { Gfx* gfx = *p; s16 x = msgCtx->textPosX; s16 y = msgCtx->textPosY; - s32 pad; + STACK_PAD(s32); gDPPipeSync(gfx++); @@ -1007,7 +1008,7 @@ f32 sFontWidths[144] = { }; u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) { - s32 pad; + STACK_PAD(s32); Gfx* gfx = *p; MessageContext* msgCtx = &play->msgCtx; @@ -1433,7 +1434,7 @@ void Message_DrawTextWide(PlayState* play, Gfx** gfxP) { */ void Message_DrawText(PlayState* play, Gfx** gfxP) { MessageContext* msgCtx = &play->msgCtx; - s16 pad; + STACK_PAD(s16); u8 character; u16 j; u16 i; @@ -1768,19 +1769,27 @@ void Message_Decode(PlayState* play) { s32 charTexIdx = 0; s16 i; #if !(PLATFORM_GC && OOT_PAL) +#if OOT_NTSC s16 j; +#else + STACK_PAD(s16); +#endif #endif s16 decodedBufPos = 0; s16 numLines = 0; s16 digits[4]; - s32 pad; + STACK_PAD(s32); s16 playerNameLen; s16 loadChar; u16 value; u8 curChar; #if !(PLATFORM_GC && OOT_PAL) +#if OOT_NTSC u16 curCharWide; u8* fontBuf; +#else + STACK_PADS(s32, 2); +#endif #endif msgCtx->textDelayTimer = 0; @@ -2783,7 +2792,7 @@ void Message_ContinueTextbox(PlayState* play, u16 textId) { MessageContext* msgCtx = &play->msgCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; #if PLATFORM_N64 - s32 pad2[3]; + STACK_PADS(s32, 3); #endif PRINTF_COLOR_GREEN(); @@ -4046,7 +4055,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { void Message_DrawDebugVariableChanged(s16* var, GraphicsContext* gfxCtx) { static s16 sVarLastValue = 0; static s16 sFillTimer = 0; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_message_PAL.c", 3485); @@ -4073,9 +4082,9 @@ void Message_DrawDebugVariableChanged(s16* var, GraphicsContext* gfxCtx) { } void Message_DrawDebugText(PlayState* play, Gfx** p) { - s32 pad; + STACK_PAD(s32); GfxPrint printer; - s32 pad1; + STACK_PAD(s32); GfxPrint_Init(&printer); GfxPrint_Open(&printer, *p); @@ -4095,7 +4104,7 @@ void Message_Draw(PlayState* play) { Gfx* plusOne; Gfx* polyOpaP; #if OOT_VERSION < GC_US - s32 pad; + STACK_PAD(s32); #endif #if DEBUG_FEATURES s16 watchVar; @@ -4141,31 +4150,30 @@ void Message_Update(PlayState* play) { static s16 sTextboxEndIconYOffset[] = { 59, 59, 59, 59, 34, 59, }; - static s16 D_80153D3C[] = { - // additional unreferenced data + UNUSED static s16 D_80153D3C[] = { 0x0400, 0x0400, 0x0200, 0x0000, 0x1038, 0x0008, 0x200A, 0x088B, 0x0007, 0x0009, 0x000A, 0x107E, 0x2008, 0x2007, 0x0015, 0x0016, 0x0017, 0x0003, 0x0000, 0x270B, 0x00C8, 0x012C, 0x012D, 0xFFDA, 0x0014, 0x0016, 0x0014, 0x0016, }; #if OOT_VERSION < GC_US - static s32 sUnknown = 0; + UNUSED static s32 sUnknown = 0; #elif PLATFORM_IQUE - static u16 sUnknown = 0; + UNUSED static u16 sUnknown = 0; #endif static char D_80153D74 = 0; MessageContext* msgCtx = &play->msgCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; Player* player = GET_PLAYER(play); - Input* input = &play->state.input[0]; + UNUSED_NDEBUG Input* input = &play->state.input[0]; s16 var; s16 focusScreenPosX; s16 averageY; s16 playerFocusScreenPosY; s16 actorFocusScreenPosY; #if OOT_VERSION < GC_US - s32 pad1; + STACK_PAD(s32); #endif #if OOT_NTSC && OOT_VERSION < GC_US - s32 pad2; + STACK_PAD(s32); #endif #if DEBUG_FEATURES diff --git a/src/code/z_moji.c b/src/code/z_moji.c index e26ce68e7f..8b23e81459 100644 --- a/src/code/z_moji.c +++ b/src/code/z_moji.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "printf.h" +#include "stack_pad.h" // how big to draw the characters on screen #define DISP_CHAR_WIDTH 8 @@ -61,7 +62,7 @@ void Moji_SetPosition(s32 gridX, s32 gridY) { } void Moji_DrawChar(GraphicsContext* gfxCtx, char c) { - s32 pad[2]; + STACK_PADS(s32, 2); OPEN_DISPS(gfxCtx, "../z_moji.c", 86); diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 12dc2d2568..305632f9c6 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,5 +1,6 @@ #include "one_point_cutscene.h" +#include "attributes.h" #include "libc64/math64.h" #include "libc64/qrand.h" #include "array_count.h" @@ -62,7 +63,7 @@ static CutsceneCameraPoint sCrawlspaceForwardsEyePoints[9] = { { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 63, 119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, }; -static s16 sCrawlspaceUnused = 9; +UNUSED static s16 sCrawlspaceUnused = 9; static s16 sCrawlspaceTimer = 90; static s16 sCrawlspaceActionParam = 1; static CutsceneCameraPoint sCrawlspaceBackwardsEyePoints[10] = { @@ -133,7 +134,7 @@ static CutsceneCameraPoint D_80120820[12] = { { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 18, 123 } }, { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 10, 123 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, }; -static s16 D_801208E0 = 12; +UNUSED static s16 D_801208E0 = 12; static s16 D_801208E4 = 90; static s16 D_801208E8 = 8; @@ -5390,5 +5391,5 @@ s32 OnePointCutscene_CheckForCategory(PlayState* play, s32 actorCategory) { } // unused, also empty. -void OnePointCutscene_Noop(PlayState* play, s32 arg1) { +void OnePointCutscene_Noop(UNUSED PlayState* play, UNUSED s32 arg1) { } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 7c97802888..2605b9a981 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -13,6 +13,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -1125,9 +1126,9 @@ void Interface_SetSceneRestrictions(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; s16 i = 0; u8 sceneId; - s32 pad1; - s32 pad2; - s32 pad3; +#if OOT_VERSION != IQUE_CN + STACK_PADS(s32, 3); +#endif interfaceCtx->restrictions.all = 0; interfaceCtx->restrictions.dinsNayrus = 0; @@ -2236,7 +2237,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) { /** * @return false if player is out of health */ -s32 Health_ChangeBy(PlayState* play, s16 amount) { +s32 Health_ChangeBy(UNUSED PlayState* play, s16 amount) { u16 heartCount; UNUSED_NDEBUG u16 healthLevel; @@ -2349,7 +2350,7 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { PRINTF(T("合計 = (%d)\n", "Total = (%d)\n"), AMMO(item)); } -void Magic_Fill(PlayState* play) { +void Magic_Fill(UNUSED PlayState* play) { if (gSaveContext.save.info.playerData.isMagicAcquired) { gSaveContext.prevMagicState = gSaveContext.magicState; gSaveContext.magicFillTarget = @@ -2358,7 +2359,7 @@ void Magic_Fill(PlayState* play) { } } -void Magic_Reset(PlayState* play) { +void Magic_Reset(UNUSED PlayState* play) { if ((gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { if (gSaveContext.magicState == MAGIC_STATE_ADD) { gSaveContext.prevMagicState = gSaveContext.magicState; @@ -2772,7 +2773,7 @@ void Interface_SetSubTimer(s16 seconds) { /** * Set the subTimer to 1 second left */ -void Interface_SetSubTimerToFinalSecond(PlayState* play) { +void Interface_SetSubTimerToFinalSecond(UNUSED PlayState* play) { if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) { if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) { // The running-man race counts up and finished at MARATHON_TIME_LIMIT @@ -2813,6 +2814,9 @@ void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) { void Interface_DrawItemButtons(PlayState* play) { static void* cUpLabelTextures[] = LANGUAGE_ARRAY(gNaviCUpJPNTex, gNaviCUpENGTex, gNaviCUpENGTex, gNaviCUpENGTex); #if OOT_VERSION >= PAL_1_0 +#if OOT_NTSC + UNUSED +#endif static s16 startButtonLeftPos[] = { 132, 130, 130 }; #endif InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -3192,14 +3196,14 @@ void Interface_Draw(PlayState* play) { static s16 timerDigitLeftPos[] = { 16, 25, 34, 42, 51 }; static s16 sDigitWidths[] = { 9, 9, 8, 9, 9 }; // unused, most likely colors - static s16 D_80125B1C[][3] = { + UNUSED static s16 D_80125B1C[][3] = { { 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 }, }; static s16 rupeeDigitsFirst[] = { 1, 0, 0 }; static s16 rupeeDigitsCount[] = { 2, 3, 3 }; static s16 spoilingItemEntrances[] = { ENTR_LOST_WOODS_2, ENTR_ZORAS_DOMAIN_3, ENTR_ZORAS_DOMAIN_3 }; - static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused - static s16 D_80125B5C[] = { 91, 91 }; // unused + UNUSED static f32 D_80125B54[] = { -40.0f, -35.0f }; + UNUSED static s16 D_80125B5C[] = { 91, 91 }; static s16 sTimerNextSecondTimer; static s16 sTimerStateTimer; static s16 sSubTimerNextSecondTimer; diff --git a/src/code/z_play.c b/src/code/z_play.c index 679c5b7772..843b9a0349 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libc64/qrand.h" #include "libu64/debug.h" #include "array_count.h" @@ -23,6 +24,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -297,7 +299,7 @@ void Play_Init(GameState* thisx) { s32 playerStartBgCamIndex; s32 i; u8 baseSceneLayer; - s32 pad[2]; + STACK_PADS(s32, 2); if (gSaveContext.save.entranceIndex == ENTR_LOAD_OPENING) { gSaveContext.save.entranceIndex = 0; @@ -551,7 +553,7 @@ void Play_Init(GameState* thisx) { void Play_Update(PlayState* this) { Input* input = this->state.input; s32 isPaused; - s32 pad1; + STACK_PAD(s32); #if DEBUG_FEATURES if ((SREG(1) < 0) || (DREG(0) != 0)) { @@ -563,7 +565,7 @@ void Play_Update(PlayState* this) { if ((R_HREG_MODE == HREG_MODE_PRINT_OBJECT_TABLE) && (R_PRINT_OBJECT_TABLE_TRIGGER < 0)) { u32 i; - s32 pad2; + STACK_PAD(s32); R_PRINT_OBJECT_TABLE_TRIGGER = 0; PRINTF("object_exchange_rom_address %u\n", gObjectTableSize); @@ -1124,7 +1126,7 @@ skip: void Play_DrawOverlayElements(PlayState* this) { #if PLATFORM_N64 - s32 pad; + STACK_PAD(s32); #endif if (IS_PAUSED(&this->pauseCtx)) { @@ -1472,7 +1474,7 @@ f32 func_800BFCB8(PlayState* this, MtxF* mf, Vec3f* pos) { f32 nx = COLPOLY_GET_NORMAL(poly.normal.x); f32 ny = COLPOLY_GET_NORMAL(poly.normal.y); f32 nz = COLPOLY_GET_NORMAL(poly.normal.z); - s32 pad[5]; + STACK_PADS(s32, 5); temp1 = sqrtf(1.0f - SQ(nx)); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index d56eb84102..8167c43102 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1,8 +1,10 @@ #include "libc64/math64.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -800,7 +802,7 @@ s32 func_8008EF44(PlayState* play, s32 ammo) { int Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange) { Player* this = GET_PLAYER(play); Vec3f diff; - s32 pad; + STACK_PAD(s32); if ((this->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->unk_860 != 0)) { Math_Vec3f_Diff(MELEE_WEAPON_INFO_TIP(&this->meleeWeaponInfo[0]), pos, &diff); @@ -848,7 +850,7 @@ int Player_HasMirrorShieldSetToDraw(PlayState* play) { return (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (this->currentShield == PLAYER_SHIELD_MIRROR); } -s32 Player_ActionToMagicSpell(Player* this, s32 itemAction) { +s32 Player_ActionToMagicSpell(UNUSED Player* this, s32 itemAction) { s32 magicSpell = itemAction - PLAYER_IA_MAGIC_SPELL_15; if ((magicSpell >= 0) && (magicSpell < 6)) { @@ -893,7 +895,7 @@ int Player_HoldsBrokenKnife(Player* this) { (gSaveContext.save.info.playerData.swordHealth <= 0.0f); } -s32 Player_ActionToBottle(Player* this, s32 itemAction) { +s32 Player_ActionToBottle(UNUSED Player* this, s32 itemAction) { s32 bottle = itemAction - PLAYER_IA_BOTTLE; if ((bottle >= 0) && (bottle < 13)) { @@ -907,7 +909,7 @@ s32 Player_GetBottleHeld(Player* this) { return Player_ActionToBottle(this, this->heldItemAction); } -s32 Player_ActionToExplosive(Player* this, s32 itemAction) { +s32 Player_ActionToExplosive(UNUSED Player* this, s32 itemAction) { s32 explosive = itemAction - PLAYER_IA_BOMB; if ((explosive >= 0) && (explosive < 2)) { @@ -921,7 +923,7 @@ s32 Player_GetExplosiveHeld(Player* this) { return Player_ActionToExplosive(this, this->heldItemAction); } -s32 func_8008F2BC(Player* this, s32 itemAction) { +s32 func_8008F2BC(UNUSED Player* this, s32 itemAction) { s32 sword = 0; if (itemAction != PLAYER_IA_SWORD_CS) { @@ -1204,7 +1206,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_DEAD) && (Player_ActionToMagicSpell(this, this->itemAction) < 0)) { - s32 pad; + STACK_PAD(s32); sp7C = D_80126058[(void)0, gSaveContext.save.linkAge]; sp78 = D_80126060[(void)0, gSaveContext.save.linkAge]; @@ -1333,12 +1335,12 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** Matrix_RotateZ(BINANG_TO_RAD(this->upperLimbRot.z), MTXMODE_APPLY); } } else if (limbIndex == PLAYER_LIMB_L_THIGH) { - s32 pad; + STACK_PAD(s32); func_8008F87C(play, this, &this->skelAnime, pos, rot, PLAYER_LIMB_L_THIGH, PLAYER_LIMB_L_SHIN, PLAYER_LIMB_L_FOOT); } else if (limbIndex == PLAYER_LIMB_R_THIGH) { - s32 pad; + STACK_PAD(s32); func_8008F87C(play, this, &this->skelAnime, pos, rot, PLAYER_LIMB_R_THIGH, PLAYER_LIMB_R_SHIN, PLAYER_LIMB_R_FOOT); @@ -1651,7 +1653,7 @@ Color_RGB8 sBottleColors[] = { { 80, 80, 255 }, // Fairy }; -void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { +void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, UNUSED Vec3s* rot, void* thisx) { Player* this = (Player*)thisx; if (*dList != NULL) { @@ -1814,7 +1816,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve if (heldActor != NULL) { static Vec3f D_80126190 = { 100.0f, 1640.0f, 0.0f }; MtxF sp44; - s32 pad; + STACK_PAD(s32); Matrix_MultVec3f(&D_80126190, &heldActor->world.pos); Matrix_RotateZYX(0, -0x4000, -0x4000, MTXMODE_APPLY); @@ -1916,7 +1918,8 @@ u8 sPauseModelGroupBySword[] = { PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BIGGORON }; -s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) { +s32 Player_OverrideLimbDrawPause(UNUSED PlayState* play, s32 limbIndex, Gfx** dList, UNUSED Vec3f* pos, + UNUSED Vec3s* rot, void* arg) { u8* playerSwordAndShield = arg; //! @bug `playerSwordAndShield[0]` can be 0 (`PLAYER_SWORD_NONE`), which indexes `sPauseModelGroupBySword[-1]`. //! The result happens to be 0 (`PLAYER_MODELGROUP_0`) in vanilla, but weird values are likely to cause a crash. @@ -1999,7 +2002,7 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, // Also matches if some of the previous graphics commands are moved inside this block too. Possible macro? if (1) { - s32 pad[2]; + STACK_PADS(s32, 2); gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); } diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index 6bf73b0577..8f7f4cef35 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -1,4 +1,5 @@ #include "gfx.h" +#include "attributes.h" #include "gfx_setupdl.h" #include "prenmi_state.h" #include "printf.h" @@ -61,7 +62,7 @@ void PreNMI_Main(GameState* thisx) { this->state.inPreNMIState = true; } -void PreNMI_Destroy(GameState* thisx) { +void PreNMI_Destroy(UNUSED GameState* thisx) { } void PreNMI_Init(GameState* thisx) { diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 18ebfbcc38..2f41f01664 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -2,6 +2,7 @@ #include "array_count.h" #include "printf.h" #include "quake.h" +#include "stack_pad.h" #include "terminal.h" #include "z_lib.h" #include "olib.h" @@ -83,7 +84,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) { } s16 Quake_CallbackType1(QuakeRequest* req, ShakeInfo* shake) { - s32 pad; + STACK_PAD(s32); if (req->timer > 0) { f32 xyOffset = Math_SinS(req->speed * req->timer); @@ -105,7 +106,7 @@ s16 Quake_CallbackType5(QuakeRequest* req, ShakeInfo* shake) { } s16 Quake_CallbackType6(QuakeRequest* req, ShakeInfo* shake) { - s32 pad; + STACK_PAD(s32); f32 xyOffset; req->timer--; diff --git a/src/code/z_room.c b/src/code/z_room.c index 5549922b6a..89b6f55e50 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,4 +1,6 @@ #include "libu64/debug.h" +#include "attributes.h" +#include "stack_pad.h" #include "ultra64/gs2dex.h" #include "array_count.h" #include "buffers.h" @@ -53,7 +55,7 @@ void (*sRoomDrawHandlers[ROOM_SHAPE_TYPE_MAX])(PlayState* play, Room* room, u32 Room_DrawCullable, // ROOM_SHAPE_TYPE_CULLABLE }; -void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3) { +void func_80095AA0(UNUSED PlayState* play, UNUSED Room* room, UNUSED Input* input, UNUSED s32 arg3) { } void Room_DrawNormal(PlayState* play, Room* room, u32 flags) { @@ -123,14 +125,14 @@ void Room_DrawCullable(PlayState* play, Room* room, u32 flags) { RoomShapeCullableEntryLinked* head = NULL; RoomShapeCullableEntryLinked* tail = NULL; RoomShapeCullableEntryLinked* iter; - s32 pad; + STACK_PAD(s32); RoomShapeCullableEntryLinked* insert; s32 j; s32 i; Vec3f pos; Vec3f projectedPos; f32 projectedW; - s32 pad2; + STACK_PAD(s32); RoomShapeCullableEntry* roomShapeCullableEntries; RoomShapeCullableEntry* roomShapeCullableEntryIter; f32 entryBoundsNearZ; @@ -572,7 +574,7 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) { } } -void Room_Init(PlayState* play, Room* room) { +void Room_Init(UNUSED PlayState* play, Room* room) { room->num = -1; room->segment = NULL; } @@ -592,7 +594,7 @@ u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx) { u32 frontRoomSize; u32 backRoomSize; u32 cumulRoomSize; - s32 pad; + STACK_PAD(s32); // Set roomBufferSize to the largest room { diff --git a/src/code/z_rumble.c b/src/code/z_rumble.c index fcc39adee8..a2924ad232 100644 --- a/src/code/z_rumble.c +++ b/src/code/z_rumble.c @@ -12,10 +12,11 @@ * @note Original filename is likely z_vibrate.c or similar as it is ordered after z_ss_sram.c and before z_view.c */ #include "rumble.h" +#include "attributes.h" #include "padmgr.h" #include "z_math.h" -static s32 sUnused[4]; +UNUSED static s32 sUnused[4]; RumbleMgr sRumbleMgr; /** @@ -23,7 +24,7 @@ RumbleMgr sRumbleMgr; * * Unlike every other function in this file, this runs on the padmgr thread. */ -void Rumble_Update(PadMgr* padMgr, void* arg) { +void Rumble_Update(PadMgr* padMgr, UNUSED void* arg) { RumbleMgr_Update(&sRumbleMgr); PadMgr_RumbleSet(padMgr, sRumbleMgr.rumbleEnable); } diff --git a/src/code/z_sample.c b/src/code/z_sample.c index dc7c4836b0..6c4c41e410 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -1,4 +1,5 @@ #include "gfx.h" +#include "attributes.h" #include "gfx_setupdl.h" #include "controller.h" #include "regs.h" @@ -53,7 +54,7 @@ void Sample_Main(GameState* thisx) { Sample_HandleStateChange(this); } -void Sample_Destroy(GameState* thisx) { +void Sample_Destroy(UNUSED GameState* thisx) { } void Sample_SetupView(SampleState* this) { diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 65503d0ccb..1fdbbf24be 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,4 +1,5 @@ #include "array_count.h" +#include "attributes.h" #include "avoid_ub.h" #include "printf.h" #include "regs.h" @@ -6,6 +7,7 @@ #include "seqcmd.h" #include "segment_symbols.h" #include "segmented_address.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "versions.h" @@ -72,7 +74,7 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) { void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { PlayState* play2 = play; - s32 pad; + STACK_PAD(s32); u32 spaceSize; s32 i; @@ -356,7 +358,7 @@ BAD_RETURN(s32) Scene_CommandTransitionActorEntryList(PlayState* play, SceneCmd* play->transitionActors.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data); } -void Scene_ResetTransitionActorList(GameState* state, TransitionActorList* transitionActors) { +void Scene_ResetTransitionActorList(UNUSED GameState* state, TransitionActorList* transitionActors) { transitionActors->count = 0; } @@ -438,7 +440,7 @@ BAD_RETURN(s32) Scene_CommandExitList(PlayState* play, SceneCmd* cmd) { play->exitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.data); } -BAD_RETURN(s32) Scene_CommandUndefined9(PlayState* play, SceneCmd* cmd) { +BAD_RETURN(s32) Scene_CommandUndefined9(UNUSED PlayState* play, UNUSED SceneCmd* cmd) { } BAD_RETURN(s32) Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) { diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 97741c50b6..a905e1bbbb 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -8,6 +8,7 @@ #include "segment_symbols.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -276,7 +277,7 @@ void* sDCLavaFloorTextures[] = { void Scene_DrawConfigDodongosCavern(PlayState* play) { u32 gameplayFrames; - s32 pad; + STACK_PAD(s32); Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx[3])); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4905); diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 10e0df1a44..6eca0950ba 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,10 +1,12 @@ #include "libu64/debug.h" +#include "attributes.h" #include "avoid_ub.h" #include "gfx.h" #include "printf.h" #include "regs.h" #include "segmented_address.h" #include "segment_symbols.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -78,7 +80,7 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3 void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) { LodLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* dList; Vec3f pos; Vec3s rot; @@ -189,7 +191,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg, s32 lod) { LodLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* newDList; Gfx* limbDList; Vec3f pos; @@ -294,7 +296,7 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3 void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg) { StandardLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* dList; Vec3f pos; Vec3s rot; @@ -405,7 +407,7 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg) { StandardLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* newDList; Gfx* limbDList; Vec3f pos; @@ -560,7 +562,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Gfx* gfx) { StandardLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* dList; Vec3f pos; Vec3s rot; @@ -666,7 +668,7 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Gfx* gfx) { StandardLimb* rootLimb; - s32 pad; + STACK_PAD(s32); Gfx* newDList; Gfx* limbDList; Vec3f pos; @@ -822,7 +824,7 @@ void AnimTaskQueue_Reset(AnimTaskQueue* animTaskQueue) { * Every time the group number changes, a single bit moves 1 position to the left. This is an implementation detail * that allows for `sDisabledTransformTaskGroups` to compare against a set of bit flags. */ -void AnimTaskQueue_SetNextGroup(PlayState* play) { +void AnimTaskQueue_SetNextGroup(UNUSED PlayState* play) { sCurAnimTaskGroup <<= 1; } @@ -834,7 +836,7 @@ void AnimTaskQueue_SetNextGroup(PlayState* play) { * LoadPlayerFrame and ActorMovement, which don't alter the appearance of an existing animation, * will always run even if a group has its transformative tasks disabled. */ -void AnimTaskQueue_DisableTransformTasksForGroup(PlayState* play) { +void AnimTaskQueue_DisableTransformTasksForGroup(UNUSED PlayState* play) { sDisabledTransformTaskGroups |= sCurAnimTaskGroup; } @@ -882,7 +884,7 @@ void AnimTaskQueue_AddLoadPlayerFrame(PlayState* play, LinkAnimationHeader* anim if (task != NULL) { LinkAnimationHeader* linkAnimHeader = SEGMENTED_TO_VIRTUAL(animation); - s32 pad; + STACK_PAD(s32); osCreateMesgQueue(&task->data.loadPlayerFrame.msgQueue, &task->data.loadPlayerFrame.msg, 1); DMA_REQUEST_ASYNC(&task->data.loadPlayerFrame.req, frameTable, @@ -986,7 +988,7 @@ void AnimTaskQueue_AddActorMovement(PlayState* play, Actor* actor, SkelAnime* sk /** * Wait for the DMA request submitted by `AnimTaskQueue_AddLoadPlayerFrame` to complete. */ -void AnimTask_LoadPlayerFrame(PlayState* play, AnimTaskData* data) { +void AnimTask_LoadPlayerFrame(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskLoadPlayerFrame* task = &data->loadPlayerFrame; osRecvMesg(&task->msgQueue, NULL, OS_MESG_BLOCK); @@ -995,7 +997,7 @@ void AnimTask_LoadPlayerFrame(PlayState* play, AnimTaskData* data) { /** * Copy all data from the `src` frame table to the `dest` table. */ -void AnimTask_Copy(PlayState* play, AnimTaskData* data) { +void AnimTask_Copy(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskCopy* task = &data->copy; if (!(task->group & sDisabledTransformTaskGroups)) { @@ -1012,7 +1014,7 @@ void AnimTask_Copy(PlayState* play, AnimTaskData* data) { /** * Interpolate between the `base` and `mod` frame tables. */ -void AnimTask_Interp(PlayState* play, AnimTaskData* data) { +void AnimTask_Interp(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskInterp* task = &data->interp; if (!(task->group & sDisabledTransformTaskGroups)) { @@ -1023,7 +1025,7 @@ void AnimTask_Interp(PlayState* play, AnimTaskData* data) { /** * Copy all data from the `src` frame table to the `dest` table according to the copy map. */ -void AnimTask_CopyUsingMap(PlayState* play, AnimTaskData* data) { +void AnimTask_CopyUsingMap(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskCopyUsingMap* task = &data->copyUsingMap; if (!(task->group & sDisabledTransformTaskGroups)) { @@ -1043,7 +1045,7 @@ void AnimTask_CopyUsingMap(PlayState* play, AnimTaskData* data) { /** * Copy all data from the `src` frame table to the `dest` table according to the inverted copy map. */ -void AnimTask_CopyUsingMapInverted(PlayState* play, AnimTaskData* data) { +void AnimTask_CopyUsingMapInverted(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskCopyUsingMapInverted* task = &data->copyUsingMapInverted; if (!(task->group & sDisabledTransformTaskGroups)) { @@ -1064,7 +1066,7 @@ void AnimTask_CopyUsingMapInverted(PlayState* play, AnimTaskData* data) { * Move an actor according to the translation of its root limb for the current animation frame. * The actor's current shape yaw will factor into the resulting movement. */ -void AnimTask_ActorMovement(PlayState* play, AnimTaskData* data) { +void AnimTask_ActorMovement(UNUSED PlayState* play, AnimTaskData* data) { AnimTaskActorMovement* task = &data->actorMovement; Actor* actor = task->actor; Vec3f diff; @@ -1105,7 +1107,7 @@ void AnimTaskQueue_Update(PlayState* play, AnimTaskQueue* animTaskQueue) { */ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, LinkAnimationHeader* animation, s32 flags, Vec3s* jointTable, Vec3s* morphTable, - s32 limbBufCount) { + UNUSED_NDEBUG s32 limbBufCount) { FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); s32 headerJointCount = skeletonHeader->sh.limbCount; s32 limbCount; @@ -1251,7 +1253,7 @@ s32 LinkAnimation_Once(PlayState* play, SkelAnime* skelAnime) { /** * Sets a new morph and resets the morph weight for the current animation. */ -void Animation_SetMorph(PlayState* play, SkelAnime* skelAnime, f32 morphFrames) { +void Animation_SetMorph(UNUSED PlayState* play, SkelAnime* skelAnime, f32 morphFrames) { skelAnime->morphWeight = 1.0f; skelAnime->morphRate = 1.0f / morphFrames; } @@ -1439,8 +1441,9 @@ s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame) { /** * Initializes a normal skeleton to a looping animation, dynamically allocating the frame tables if not provided. */ -BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) SkelAnime_Init(UNUSED PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, + UNUSED_NDEBUG s32 limbCount) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1; @@ -1469,8 +1472,9 @@ BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHe /** * Initializes a flex skeleton to a looping animation, dynamically allocating the frame tables if not given. */ -BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) SkelAnime_InitFlex(UNUSED PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, + UNUSED_NDEBUG s32 limbCount) { FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->sh.limbCount + 1; @@ -1503,7 +1507,7 @@ BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSk /** * Initializes a skeleton with SkinLimbs to a looping animation, dynamically allocating the frame tables. */ -BAD_RETURN(s32) SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, +BAD_RETURN(s32) SkelAnime_InitSkin(UNUSED PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); @@ -1905,7 +1909,7 @@ s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame) { /** * Frees the frame tables for a skelAnime with dynamically allocated tables. */ -void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) { +void SkelAnime_Free(SkelAnime* skelAnime, UNUSED PlayState* play) { if (skelAnime->jointTable != NULL) { ZELDA_ARENA_FREE(skelAnime->jointTable, "../z_skelanime.c", 3729); } else { diff --git a/src/code/z_skin.c b/src/code/z_skin.c index e5ddf71f46..35d38456bb 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,5 +1,7 @@ #include "gfx.h" +#include "attributes.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_math.h" #include "play_state.h" @@ -50,7 +52,7 @@ void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* mod void Skin_ApplyLimbModifications(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3) { s32 modifCount; SkinLimb** skeleton; - SkinLimb* limb; + STACK_PAD(s32); SkinAnimatedLimbData* data; SkinLimbModif* modif; SkinLimbVtx* vtxEntry; @@ -164,10 +166,10 @@ void Skin_DrawAnimatedLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s /** * Draw a limb of type SKIN_LIMB_TYPE_NORMAL, of the skeleton `skin` at index `limbIndex` */ -void Skin_DrawLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlistOverride, s32 drawFlags) { +void Skin_DrawLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlistOverride, UNUSED s32 drawFlags) { Gfx* gfx = dlistOverride; SkinLimb** skeleton; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_skin.c", 395); diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index c6ddc1a793..2d7d9be417 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -1,5 +1,7 @@ #include "array_count.h" +#include "attributes.h" #include "segmented_address.h" +#include "stack_pad.h" #include "zelda_arena.h" #include "actor.h" #include "play_state.h" @@ -11,7 +13,7 @@ /** * Initialises the Vtx buffers used for limb at index `limbIndex` */ -void Skin_InitAnimatedLimb(PlayState* play, Skin* skin, s32 limbIndex) { +void Skin_InitAnimatedLimb(UNUSED PlayState* play, Skin* skin, s32 limbIndex) { s32 i; SkinLimb** skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment); SkinAnimatedLimbData* animatedLimbData = @@ -116,7 +118,7 @@ void Skin_Free(PlayState* play, Skin* skin) { } s32 func_800A698C(Skin* skin, SkinLimb** skeleton, MtxF* limbMatrices, u8 parentIndex, u8 limbIndex) { - s32 pad; + STACK_PAD(s32); SkinLimb* limb = SEGMENTED_TO_VIRTUAL(skeleton[limbIndex]); MtxF* mtx; s32 ret; @@ -153,7 +155,7 @@ s32 func_800A698C(Skin* skin, SkinLimb** skeleton, MtxF* limbMatrices, u8 parent */ s32 Skin_ApplyAnimTransformations(Skin* skin, MtxF* limbMatrices, Actor* actor, s32 setTranslation) { s32 i; - s32 pad; + STACK_PAD(s32); f32 yRot; f32 xRot; f32 zRot; diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 1dbb9a26b0..dc1100d79b 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -2,6 +2,7 @@ #include "gfx.h" #include "printf.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -616,7 +617,7 @@ void SkinMatrix_SetRotateAxis(MtxF* mf, s16 angle, f32 axisX, f32 axisY, f32 axi f32 xy; f32 yz; f32 xz; - f32 pad; + STACK_PAD(s32); sinA = Math_SinS(angle); cosA = Math_CosS(angle); diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 17bfb5baa4..eed909008f 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,6 +1,7 @@ #include "sram.h" #include "array_count.h" +#include "attributes.h" #include "file_select_state.h" #include "controller.h" #include "memory_utils.h" @@ -603,7 +604,7 @@ void Sram_OpenSave(SramContext* sramCtx) { * Write the contents of the Save Context to a main and backup slot in SRAM. * Note: The whole Save Context is written even though only the `save` substruct is read back later */ -void Sram_WriteSave(SramContext* sramCtx) { +void Sram_WriteSave(UNUSED SramContext* sramCtx) { u16 offset; u16 checksum; u16 j; @@ -1012,7 +1013,7 @@ void Sram_WriteSramHeader(SramContext* sramCtx) { SRAM_WRITE(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_HEADER_SIZE); } -void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { +void Sram_InitSram(UNUSED_NDEBUG GameState* gameState, SramContext* sramCtx) { u16 i; PRINTF("sram_initialize( Game *game, Sram *sram )\n"); @@ -1072,5 +1073,5 @@ void Sram_Alloc(GameState* gameState, SramContext* sramCtx) { ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295); } -void Sram_Init(GameState* gameState, SramContext* sramCtx) { +void Sram_Init(UNUSED GameState* gameState, UNUSED SramContext* sramCtx) { } diff --git a/src/code/z_view.c b/src/code/z_view.c index 4c37194cfd..fa55b46f68 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -8,6 +8,7 @@ #include "main.h" #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -159,7 +160,7 @@ void View_ApplyLetterbox(View* view) { s32 uly; s32 lrx; s32 lry; - s32 pad; + STACK_PAD(s32); letterboxSize = Letterbox_GetSize(); @@ -486,14 +487,14 @@ s32 View_ApplyOrthoToOverlay(View* view) { */ s32 View_ApplyPerspectiveToOverlay(View* view) { GraphicsContext* gfxCtx = view->gfxCtx; - s32 pad; + STACK_PAD(s32); f32 aspect; s32 width; s32 height; Vp* vp; Mtx* projection; Mtx* viewing; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_view.c", 816); diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index 6eceeaa7e7..97de934493 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -1,5 +1,6 @@ #include "vi_mode.h" +#include "attributes.h" #include "libu64/debug.h" #include "ultra64/viint.h" #include "controller.h" @@ -245,7 +246,7 @@ void ViMode_Init(ViMode* viMode) { ViMode_Save(viMode); } -void ViMode_Destroy(ViMode* viMode) { +void ViMode_Destroy(UNUSED ViMode* viMode) { } void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures) { diff --git a/src/code/z_viscvg.c b/src/code/z_viscvg.c index 1616b661c0..c35d6f101f 100644 --- a/src/code/z_viscvg.c +++ b/src/code/z_viscvg.c @@ -21,6 +21,7 @@ */ #include "gfx.h" +#include "attributes.h" #include "vis.h" /** @@ -101,7 +102,7 @@ void VisCvg_Init(VisCvg* this) { this->vis.primColor.a = 255; } -void VisCvg_Destroy(VisCvg* this) { +void VisCvg_Destroy(UNUSED VisCvg* this) { } void VisCvg_Draw(VisCvg* this, Gfx** gfxP) { diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index 632d00a6e7..d59e1d3678 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -53,7 +53,7 @@ void VisMono_Destroy(VisMono* this) { SYSTEM_ARENA_FREE(this->dList, "../z_vismono.c", 137); } -void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) { +void VisMono_DesaturateTLUT(UNUSED VisMono* this, u16* tlut) { s32 i; for (i = 0; i < 256; i++) { @@ -74,7 +74,7 @@ void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) { } } -Gfx* VisMono_DesaturateDList(VisMono* this, Gfx* gfx) { +Gfx* VisMono_DesaturateDList(UNUSED VisMono* this, Gfx* gfx) { s32 y; s32 height = VISMONO_CFBFRAG_HEIGHT; u16* cfbFrag = D_0F000000; diff --git a/src/code/z_viszbuf.c b/src/code/z_viszbuf.c index aa72289742..8275d33e37 100644 --- a/src/code/z_viszbuf.c +++ b/src/code/z_viszbuf.c @@ -33,6 +33,8 @@ */ #include "gfx.h" +#include "attributes.h" +#include "stack_pad.h" #include "vis.h" // Height of the fragments the z-buffer is split into. @@ -62,12 +64,12 @@ void VisZBuf_Init(VisZBuf* this) { // clang-format on } -void VisZBuf_Destroy(VisZBuf* this) { +void VisZBuf_Destroy(UNUSED VisZBuf* this) { } void VisZBuf_Draw(VisZBuf* this, Gfx** gfxP) { Gfx* gfx = *gfxP; - s32 pad; + STACK_PAD(s32); u16* zbufFrag = D_0E000000; s32 fmt; s32 y; diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index 3387db500f..1db579d656 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -3,6 +3,7 @@ #include "array_count.h" #include "printf.h" #include "segment_symbols.h" +#include "stack_pad.h" #include "terminal.h" #include "ultra64.h" #include "environment.h" @@ -86,7 +87,7 @@ s32 Skybox_CalculateFace256(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxS s32 zPoints[9 * 5]; s32 tcS[9 * 5]; s32 tcT[9 * 5]; - s32 pad; + STACK_PAD(s32); // Collect all vertex positions for this face switch (faceNum) { @@ -250,7 +251,7 @@ s32 Skybox_CalculateFace128(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 roomVtxS s32 zPoints[5 * 5]; s32 tcS[5 * 5]; s32 tcT[5 * 5]; - s32 pad; + STACK_PAD(s32); // Collect all vertex positions for this face switch (faceNum) { @@ -466,7 +467,7 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { s16 i; u8 skybox1Index; u8 skybox2Index; - s32 pad; + STACK_PAD(s32); s32 skyboxConfig; switch (skyboxId) { diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index 46c38291f6..6f82d15537 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -1,4 +1,5 @@ #include "gfx.h" +#include "attributes.h" #include "gfx_setupdl.h" #include "sys_matrix.h" #include "skybox.h" @@ -99,5 +100,5 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId CLOSE_DISPS(gfxCtx, "../z_vr_box_draw.c", 125); } -void Skybox_Update(SkyboxContext* skyboxCtx) { +void Skybox_Update(UNUSED SkyboxContext* skyboxCtx) { } diff --git a/src/libc64/__osMalloc_gc.c b/src/libc64/__osMalloc_gc.c index d6e4e17d13..9d11e4aa92 100644 --- a/src/libc64/__osMalloc_gc.c +++ b/src/libc64/__osMalloc_gc.c @@ -1,8 +1,10 @@ #include "libc64/os_malloc.h" #include "alignment.h" +#include "attributes.h" #include "fault.h" #include "printf.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" @@ -479,7 +481,7 @@ void* __osMallocR(Arena* arena, u32 size) { return alloc; } -void __osFree_NoLock(Arena* arena, void* ptr) { +void __osFree_NoLock(UNUSED_NDEBUG Arena* arena, void* ptr) { ArenaNode* node; ArenaNode* next; ArenaNode* prev; @@ -623,7 +625,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { ArenaNode* overNext2; ArenaNode localCopy; u32 blockSize; - s32 pad; + STACK_PAD(s32); newSize = ALIGN16(newSize); osSyncPrintf("__osRealloc(%08x, %d)\n", ptr, newSize); @@ -713,7 +715,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { } #if DEBUG_FEATURES -void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) { +void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, UNUSED const char* file, UNUSED int line) { return __osRealloc(arena, ptr, newSize); } #endif diff --git a/src/libleo/api/cacreateleomanager.c b/src/libleo/api/cacreateleomanager.c index 4ae1c7bd9e..4146493873 100644 --- a/src/libleo/api/cacreateleomanager.c +++ b/src/libleo/api/cacreateleomanager.c @@ -11,8 +11,8 @@ s32 LeoCACreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) OSPiHandle* driveRomHandle; UNUSED OSPiHandle* leoDiskHandle; volatile LEOCmdInquiry cmdBlockInq; - volatile LEOCmd cmdBlockID; - LEODiskID thisID; + UNUSED volatile LEOCmd cmdBlockID; + UNUSED LEODiskID thisID; u32 stat; u32 data; diff --git a/src/libleo/api/cjcreateleomanager.c b/src/libleo/api/cjcreateleomanager.c index 1daf54ca12..5ab8af37a2 100644 --- a/src/libleo/api/cjcreateleomanager.c +++ b/src/libleo/api/cjcreateleomanager.c @@ -11,8 +11,8 @@ s32 LeoCJCreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) OSPiHandle* driveRomHandle; UNUSED OSPiHandle* leoDiskHandle; volatile LEOCmdInquiry cmdBlockInq; - volatile LEOCmd cmdBlockID; - LEODiskID thisID; + UNUSED volatile LEOCmd cmdBlockID; + UNUSED LEODiskID thisID; u32 stat; u32 data; diff --git a/src/libleo/api/driveexist.c b/src/libleo/api/driveexist.c index f658817a3d..b75e4dbdee 100644 --- a/src/libleo/api/driveexist.c +++ b/src/libleo/api/driveexist.c @@ -2,10 +2,11 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "attributes.h" u32 LeoDriveExist(void) { u32 data; - u32 saveMask; + UNUSED u32 saveMask; u32 stat; u32 latency; u32 pulse; diff --git a/src/libleo/leo/leocmdex.c b/src/libleo/leo/leocmdex.c index d7887d4944..851abd343b 100644 --- a/src/libleo/leo/leocmdex.c +++ b/src/libleo/leo/leocmdex.c @@ -25,10 +25,10 @@ s32 currentCommand; u8 leoRead_system_area(void); -void leomain(void* arg0) { +void leomain(UNUSED void* arg0) { u32 cur_status; u32 sense_code; - u8 disktype_bak; + UNUSED u8 disktype_bak; ((u8*)&LEO_country_code)[0] = *(vu8*)OS_PHYSICAL_TO_K1(0x10); ((u8*)&LEO_country_code)[1] = *(vu8*)OS_PHYSICAL_TO_K1(0x90); diff --git a/src/libleo/leo/leoint.c b/src/libleo/leo/leoint.c index 33ac3d2010..1dd2a42fbb 100644 --- a/src/libleo/leo/leoint.c +++ b/src/libleo/leo/leoint.c @@ -2,6 +2,7 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "attributes.h" extern vu16 LEOrw_flags; @@ -17,7 +18,7 @@ u32 leoChk_mecha_int(void); void leosetup_BM(void); u32 leochk_err_reg(void); -void leointerrupt(void* arg) { +void leointerrupt(UNUSED void* arg) { u32 result; u32 tg_blocks; diff --git a/src/libleo/leo/leoread.c b/src/libleo/leo/leoread.c index 11dc28c41c..f3f52b4bfc 100644 --- a/src/libleo/leo/leoread.c +++ b/src/libleo/leo/leoread.c @@ -2,6 +2,7 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "attributes.h" extern vu16 LEOrw_flags; @@ -16,7 +17,7 @@ void leoRead_common(unsigned int offset) { u32 tg_lba = LEOcur_command->data.readWrite.lba; u32 tg_blocks = LEOcur_command->data.readWrite.transferBlks; u32 message; - u16 retry_cnt; + UNUSED u16 retry_cnt; if ((tg_lba | tg_blocks) & 0xFFFF0000) { goto invalid_lba; diff --git a/src/libleo/leo/leoseek.c b/src/libleo/leo/leoseek.c index 2f530ac726..78d2ecfa0a 100644 --- a/src/libleo/leo/leoseek.c +++ b/src/libleo/leo/leoseek.c @@ -2,9 +2,10 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "attributes.h" void leoSeek(void) { - u32 tgt_tk; // Unused + UNUSED u32 tgt_tk; u8 sense_code; u8 retry_cntr = 20; diff --git a/src/libleo/leo/leotimer.c b/src/libleo/leo/leotimer.c index f6c7fdfc05..e2433c431b 100644 --- a/src/libleo/leo/leotimer.c +++ b/src/libleo/leo/leotimer.c @@ -21,8 +21,8 @@ static const u8 ymdupper[6] = { 99, 12, 31, 23, 59, 59 }; static const u8 dayupper[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; void leoReadTimer(void) { - u8* rdparam; - u8 data[4]; + UNUSED u8* rdparam; + UNUSED u8 data[4]; u8 sense_code; __LOCTime time; @@ -47,7 +47,7 @@ void leoReadTimer(void) { } void leoSetTimer(void) { - LEOCmdReadTimer rd_timer; + UNUSED LEOCmdReadTimer rd_timer; u8* p_tmp = &LEOcur_command->data.time.yearlo; u32 year; u32 month; diff --git a/src/libleo/leo/leoutil.c b/src/libleo/leo/leoutil.c index e90ea1f678..76a7c34ce9 100644 --- a/src/libleo/leo/leoutil.c +++ b/src/libleo/leo/leoutil.c @@ -2,6 +2,7 @@ #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" #include "array_count.h" +#include "attributes.h" #include "ultra64.h" u16 leoLba_to_phys(u32 lba) { @@ -10,7 +11,7 @@ u16 leoLba_to_phys(u32 lba) { u16 zone_scyl; u16 zone_tk; u16 bad_tk_num; - u32 counter; + UNUSED u32 counter; u16 def_offset; u16 defect; u8 def_zone_no; diff --git a/src/libleo/leo/leowrite.c b/src/libleo/leo/leowrite.c index 91b2163f0b..218ad228f4 100644 --- a/src/libleo/leo/leowrite.c +++ b/src/libleo/leo/leowrite.c @@ -2,6 +2,7 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" +#include "attributes.h" extern u16 LEOrw_flags; // N.B. NOT volatile in this file! @@ -9,8 +10,8 @@ void leoWrite(void) { u32 message; u32 start_lba; u32 xfer_blk; - u32 write_bytes = 0; - u8 retry_count = 0; + UNUSED u32 write_bytes = 0; + UNUSED u8 retry_count = 0; start_lba = LEOcur_command->data.readWrite.lba; xfer_blk = LEOcur_command->data.readWrite.transferBlks; diff --git a/src/libu64/debug.c b/src/libu64/debug.c index e1ed15fe45..a7f06988ac 100644 --- a/src/libu64/debug.c +++ b/src/libu64/debug.c @@ -1,4 +1,5 @@ #include "fault.h" +#include "attributes.h" #include "printf.h" #include "terminal.h" #include "translation.h" @@ -112,7 +113,7 @@ void LogUtils_LogThreadId(const char* name, int line) { #endif void LogUtils_HungupThread(const char* name, int line) { - OSId threadId = osGetThreadId(NULL); + UNUSED_NDEBUG OSId threadId = osGetThreadId(NULL); #if PLATFORM_N64 || DEBUG_FEATURES osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); diff --git a/src/libu64/gfxprint.c b/src/libu64/gfxprint.c index c47d52a3a5..1003399082 100644 --- a/src/libu64/gfxprint.c +++ b/src/libu64/gfxprint.c @@ -376,7 +376,7 @@ void GfxPrint_Init(GfxPrint* this) { #endif } -void GfxPrint_Destroy(GfxPrint* this) { +void GfxPrint_Destroy(UNUSED GfxPrint* this) { } void GfxPrint_Open(GfxPrint* this, Gfx* dList) { diff --git a/src/libu64/load_gc.c b/src/libu64/load_gc.c index e99c83d1df..95d35a19b6 100644 --- a/src/libu64/load_gc.c +++ b/src/libu64/load_gc.c @@ -1,11 +1,12 @@ #include "libu64/overlay.h" #include "ultra64.h" #include "printf.h" +#include "stack_pad.h" #include "translation.h" #include "dma.h" size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) { - s32 pad[3]; + STACK_PADS(s32, 3); uintptr_t end; OverlayRelocationSection* ovlRelocs; u32 relocSectionOffset = 0; diff --git a/src/libu64/loadfragment2_n64.c b/src/libu64/loadfragment2_n64.c index 72ecabaf37..1f36eebc0e 100644 --- a/src/libu64/loadfragment2_n64.c +++ b/src/libu64/loadfragment2_n64.c @@ -8,6 +8,7 @@ */ #include "libc64/malloc.h" #include "libu64/overlay.h" +#include "stack_pad.h" #include "translation.h" #include "dma.h" @@ -143,7 +144,7 @@ void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlReloc } size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 size = vromEnd - vromStart; uintptr_t end; OverlayRelocationSection* ovlRelocs; diff --git a/src/libu64/stackcheck.c b/src/libu64/stackcheck.c index 69fe224ee8..7b4d6700c8 100644 --- a/src/libu64/stackcheck.c +++ b/src/libu64/stackcheck.c @@ -10,7 +10,9 @@ StackEntry* sStackInfoListEnd = NULL; void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace, const char* name) { +#if !PLATFORM_N64 StackEntry* iter; +#endif u32* addr; if (entry == NULL) { diff --git a/src/libultra/audio/drvrnew.c b/src/libultra/audio/drvrnew.c index e549347e0f..5db284343b 100644 --- a/src/libultra/audio/drvrnew.c +++ b/src/libultra/audio/drvrnew.c @@ -2,6 +2,7 @@ #include "synthInternals.h" #include "stdbool.h" #include "stddef.h" +#include "attributes.h" // WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC WITH SCALING IN MICROCODE!!! #define SCALE 16384 @@ -211,7 +212,7 @@ void alEnvmixerNew(ALEnvMixer* e, ALHeap* hp) { } void alLoadNew(ALLoadFilter* f, ALDMANew dmaNew, ALHeap* hp) { - s32 i; + UNUSED s32 i; // init filter superclass alFilterNew(&f->filter, alAdpcmPull, alLoadParam, AL_ADPCM); diff --git a/src/libultra/audio/env.c b/src/libultra/audio/env.c index 654c682ab3..bdb0165277 100644 --- a/src/libultra/audio/env.c +++ b/src/libultra/audio/env.c @@ -3,6 +3,7 @@ #include "stdbool.h" #include "stddef.h" #include "ultra64/convert.h" +#include "attributes.h" #define EQPOWER_LENGTH 128 static s16 eqpower[EQPOWER_LENGTH] = { @@ -20,7 +21,7 @@ static Acmd* _pullSubFrame(void* filter, s16* inp, s16* outp, s32 outCount, s32 static s16 _getRate(f64 vol, f64 tgt, s32 count, u16* ratel); static f32 _getVol(f32 ivol, s32 samples, s16 ratem, u16 ratel); -Acmd* alEnvmixerPull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* p) { +Acmd* alEnvmixerPull(void* filter, UNUSED s16* outp, s32 outCount, s32 sampleOffset, Acmd* p) { Acmd* ptr = p; ALEnvMixer* e = (ALEnvMixer*)filter; s16 inp; diff --git a/src/libultra/audio/heapalloc.c b/src/libultra/audio/heapalloc.c index 708134ec2b..22e58d91f7 100644 --- a/src/libultra/audio/heapalloc.c +++ b/src/libultra/audio/heapalloc.c @@ -1,8 +1,9 @@ #include "libaudio.h" #include "synthInternals.h" #include "stddef.h" +#include "attributes.h" -void* alHeapDBAlloc(u8* file, s32 line, ALHeap* hp, s32 num, s32 size) { +void* alHeapDBAlloc(UNUSED u8* file, UNUSED s32 line, ALHeap* hp, s32 num, s32 size) { s32 bytes; u8* ptr = NULL; diff --git a/src/libultra/audio/load.c b/src/libultra/audio/load.c index 02be1f47cd..16ec504cf4 100644 --- a/src/libultra/audio/load.c +++ b/src/libultra/audio/load.c @@ -4,6 +4,7 @@ #include "stddef.h" #include "stdint.h" #include "ultra64/R4300.h" +#include "attributes.h" #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) @@ -14,7 +15,7 @@ static Acmd* _decodeChunk(Acmd* ptr, ALLoadFilter* f, s32 tsam, s32 nbytes, s16 outp, s16 inp, u32 flags); -Acmd* alAdpcmPull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* p) { +Acmd* alAdpcmPull(void* filter, s16* outp, s32 outCount, UNUSED s32 sampleOffset, Acmd* p) { Acmd* ptr = p; s16 inp; s32 tsam; @@ -155,7 +156,7 @@ Acmd* alAdpcmPull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* return ptr; } -Acmd* alRaw16Pull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* p) { +Acmd* alRaw16Pull(void* filter, s16* outp, s32 outCount, UNUSED s32 sampleOffset, Acmd* p) { Acmd* ptr = p; s32 nbytes; s32 dramLoc; @@ -166,7 +167,7 @@ Acmd* alRaw16Pull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* s32 nSam; s32 op; ALLoadFilter* f = (ALLoadFilter*)filter; - ALFilter* a = (ALFilter*)filter; + UNUSED ALFilter* a = (ALFilter*)filter; if (outCount == 0) { return ptr; diff --git a/src/libultra/audio/reverb.c b/src/libultra/audio/reverb.c index 9edf3ab9a6..980a4aab01 100644 --- a/src/libultra/audio/reverb.c +++ b/src/libultra/audio/reverb.c @@ -4,6 +4,7 @@ #include "stddef.h" #include "stdint.h" #include "ultra64/convert.h" +#include "attributes.h" #define RANGE 2.0 @@ -26,10 +27,10 @@ Acmd* alFxPull(void* filter, s16* outp, s32 outCount, s32 sampleOffset, Acmd* p) s16 output; s16* in_ptr; s16* out_ptr; - s16 gain; + UNUSED s16 gain; s16* prev_out_ptr = NULL; ALDelay* d; - ALDelay* pd; + UNUSED ALDelay* pd; // pull channels going into this effect first ptr = (*source->handler)(source, outp, outCount, sampleOffset, p); diff --git a/src/libultra/audio/synthesizer.c b/src/libultra/audio/synthesizer.c index 62c07582ed..a9dc2123ef 100644 --- a/src/libultra/audio/synthesizer.c +++ b/src/libultra/audio/synthesizer.c @@ -1,6 +1,7 @@ #include "libaudio.h" #include "synthInternals.h" #include "stddef.h" +#include "attributes.h" #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) @@ -11,9 +12,9 @@ static s32 _timeToSamplesNoRound(ALSynth* synth, s32 micros); void alSynNew(ALSynth* drvr, ALSynConfig* c) { s32 i; - ALVoice* vv; + UNUSED ALVoice* vv; PVoice* pv; - ALVoice* vvoices; + UNUSED ALVoice* vvoices; PVoice* pvoices; ALHeap* hp = c->heap; ALSave* save; diff --git a/src/libultra/io/motor.c b/src/libultra/io/motor.c index 78ce191b7b..4d38714bae 100644 --- a/src/libultra/io/motor.c +++ b/src/libultra/io/motor.c @@ -1,4 +1,5 @@ #include "ultra64.h" +#include "attributes.h" #define MOTOR_ID 0x80 @@ -6,8 +7,8 @@ OSPifRam __MotorDataBuf[MAXCONTROLLERS]; #endif -s32 __osMotorAccess(OSPfs* pfs, s32 vibrate) { #ifndef BBPLAYER +s32 __osMotorAccess(OSPfs* pfs, s32 vibrate) { s32 i; s32 ret; u8* ptr = (u8*)&__MotorDataBuf[pfs->channel]; @@ -47,6 +48,7 @@ s32 __osMotorAccess(OSPfs* pfs, s32 vibrate) { return ret; #else +s32 __osMotorAccess(UNUSED OSPfs* pfs, UNUSED s32 vibrate) { return PFS_ERR_INVALID; #endif } @@ -76,8 +78,8 @@ void _MakeMotorData(s32 channel, OSPifRam* mdata) { } #endif -s32 osMotorInit(OSMesgQueue* ctrlrqueue, OSPfs* pfs, s32 channel) { #ifndef BBPLAYER +s32 osMotorInit(OSMesgQueue* ctrlrqueue, OSPfs* pfs, s32 channel) { s32 ret; u8 temp[BLOCKSIZE]; @@ -133,6 +135,7 @@ s32 osMotorInit(OSMesgQueue* ctrlrqueue, OSPfs* pfs, s32 channel) { pfs->status = PFS_MOTOR_INITIALIZED; return 0; // "Recognized rumble pak" #else +s32 osMotorInit(UNUSED OSMesgQueue* ctrlrqueue, UNUSED OSPfs* pfs, UNUSED s32 channel) { return PFS_ERR_DEVICE; #endif } diff --git a/src/libultra/io/sptask.c b/src/libultra/io/sptask.c index b728146bda..a976df1eaf 100644 --- a/src/libultra/io/sptask.c +++ b/src/libultra/io/sptask.c @@ -1,4 +1,5 @@ #include "ultra64.h" +#include "attributes.h" #define _osVirtualToPhysical(ptr) \ if (ptr != NULL) { \ @@ -52,7 +53,7 @@ void osSpTaskLoad(OSTask* intp) { } } -void osSpTaskStartGo(OSTask* tp) { +void osSpTaskStartGo(UNUSED OSTask* tp) { while (__osSpDeviceBusy()) { ; } diff --git a/src/n64dd/n64dd_801C8000.c b/src/n64dd/n64dd_801C8000.c index 2212fe43fb..fa69c33aa8 100644 --- a/src/n64dd/n64dd_801C8000.c +++ b/src/n64dd/n64dd_801C8000.c @@ -3,6 +3,8 @@ #include "n64dd.h" #include "array_count.h" +#include "attributes.h" +#include "stack_pad.h" #include "versions.h" #include "z_locale.h" @@ -188,7 +190,7 @@ void func_801C8424(struct_801E0D18* arg0) { } } -void func_801C84D4(void* arg) { +void func_801C84D4(UNUSED void* arg) { while (true) { struct_801E0D18* sp24; @@ -315,7 +317,7 @@ s32 func_801C885C(void) { } s32 func_801C88AC(void) { - s32 phi_v0; + STACK_PAD(s32); B_801E0D18.unk_64 = 4; func_801C85F0(&B_801E0D18, 1); diff --git a/src/n64dd/n64dd_801C8940.c b/src/n64dd/n64dd_801C8940.c index 132222b689..988e81de16 100644 --- a/src/n64dd/n64dd_801C8940.c +++ b/src/n64dd/n64dd_801C8940.c @@ -3,6 +3,7 @@ #include "libc64/sleep.h" #include "attributes.h" +#include "stack_pad.h" s32 D_801D2EA0 = 0; u8* D_801D2EA4 = NULL; @@ -176,7 +177,7 @@ s32 func_801C8DC0(struct_801E0D18* arg0) { } s32 func_801C8E70(struct_801E0D18* arg0) { - s32 temp_a0; + STACK_PAD(s32); s32 temp_v0; while (true) { diff --git a/src/n64dd/n64dd_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c index 8252def9e5..52abf26e6a 100644 --- a/src/n64dd/n64dd_801CA0B0.c +++ b/src/n64dd/n64dd_801CA0B0.c @@ -228,7 +228,7 @@ void func_801CA6A0(struct_801CA704* arg0) { arg0->charTexBuf = NULL; } -void func_801CA6D8(struct_801CA704* arg0) { +void func_801CA6D8(UNUSED struct_801CA704* arg0) { } s32 func_801CA6E4(struct_801CA704* arg0, const char* fmt, va_list args) { diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c index ea1b73249e..1bc2aa163c 100644 --- a/src/n64dd/z_n64dd.c +++ b/src/n64dd/z_n64dd.c @@ -10,6 +10,7 @@ #include "irqmgr.h" #include "line_numbers.h" #include "stack.h" +#include "stack_pad.h" #include "stackcheck.h" #include "sys_freeze.h" #include "versions.h" @@ -68,7 +69,7 @@ u32 func_801C6E80(void) { #endif } -void func_801C6EA0(Gfx** gfxP) { +void func_801C6EA0(UNUSED Gfx** gfxP) { } void func_801C6EAC(void) { @@ -205,7 +206,7 @@ void func_801C7B28_ne2(void) { #endif void func_801C7268(void) { - s32 pad; + STACK_PAD(s32); s32 sp20; s32 sp1C; @@ -281,7 +282,7 @@ void func_801C746C(void* arg0, void* arg1, void* arg2) { } void func_801C75BC(void* arg0, void* arg1, void* arg2) { - s32 temp; + STACK_PAD(s32); if (arg0 == NULL && arg1 == NULL && arg2 == NULL) { return; @@ -423,7 +424,7 @@ void func_801C79CC(void* arg0, s32 arg1, s32 arg2) { (&func_801C8000)(&B_801D9D50); } -void func_801C7A10(LEODiskID* arg0) { +void func_801C7A10(UNUSED LEODiskID* arg0) { } // Checks diskId, sets B_801D9DC8 and returns true if diskId is correct @@ -544,7 +545,7 @@ void func_801C7E78(void) { s32 func_801C7E80(void) { s32 sp24; s32 sp20; - s32 sp1C; + STACK_PAD(s32); uintptr_t sp18; if (B_801D9D48 != NULL) { diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 3e8127024b..dfc99236f9 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -1,10 +1,12 @@ #include "z_arms_hook.h" +#include "attributes.h" #include "libc64/math64.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "play_state.h" @@ -55,10 +57,10 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -static Vec3f sUnusedVec1 = { 0.0f, 0.5f, 0.0f }; -static Vec3f sUnusedVec2 = { 0.0f, 0.5f, 0.0f }; +UNUSED static Vec3f sUnusedVec1 = { 0.0f, 0.5f, 0.0f }; +UNUSED static Vec3f sUnusedVec2 = { 0.0f, 0.5f, 0.0f }; -static Color_RGB8 sUnusedColors[] = { +UNUSED static Color_RGB8 sUnusedColors[] = { { 255, 255, 100 }, { 255, 255, 50 }, }; @@ -193,7 +195,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { Vec3f newPos; f32 bodyDistDiff; f32 phi_f16; - s32 pad1; + STACK_PAD(s32); f32 curActorOffsetXYZ; f32 attachPointOffsetXYZ; f32 velocity; @@ -294,7 +296,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { !func_8002F9EC(play, &this->actor, poly, bgId, &intersectPos)) { f32 polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x); f32 polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z); - s32 pad; + STACK_PAD(s32); Math_Vec3f_Copy(&this->actor.world.pos, &intersectPos); this->actor.world.pos.x += 10.0f * polyNormalX; @@ -333,7 +335,7 @@ void ArmsHook_Update(Actor* thisx, PlayState* play) { } void ArmsHook_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ArmsHook* this = (ArmsHook*)thisx; Player* player = GET_PLAYER(play); Vec3f sp78; diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 664e00223b..2392dd80f9 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "translation.h" @@ -178,7 +179,7 @@ void ArrowFire_Hit(ArrowFire* this, PlayState* play) { void ArrowFire_Fly(ArrowFire* this, PlayState* play) { EnArrow* arrow; f32 distanceScaled; - s32 pad; + STACK_PAD(s32); arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index b8a064f9b9..52a93c3e9a 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "translation.h" @@ -178,7 +179,7 @@ void ArrowIce_Hit(ArrowIce* this, PlayState* play) { void ArrowIce_Fly(ArrowIce* this, PlayState* play) { EnArrow* arrow; f32 distanceScaled; - s32 pad; + STACK_PAD(s32); arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { @@ -225,7 +226,7 @@ void ArrowIce_Update(Actor* thisx, PlayState* play) { void ArrowIce_Draw(Actor* thisx, PlayState* play) { ArrowIce* this = (ArrowIce*)thisx; - s32 pad; + STACK_PAD(s32); Actor* transform; u32 stateFrames = play->state.frames; EnArrow* arrow = (EnArrow*)this->actor.parent; diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 51e3fdb42b..6b45d062cc 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "translation.h" @@ -177,7 +178,7 @@ void ArrowLight_Hit(ArrowLight* this, PlayState* play) { void ArrowLight_Fly(ArrowLight* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; f32 distanceScaled; - s32 pad; + STACK_PAD(s32); if ((arrow == NULL) || (arrow->actor.update == NULL)) { Actor_Kill(&this->actor); @@ -223,7 +224,7 @@ void ArrowLight_Update(Actor* thisx, PlayState* play) { void ArrowLight_Draw(Actor* thisx, PlayState* play) { ArrowLight* this = (ArrowLight*)thisx; - s32 pad; + STACK_PAD(s32); u32 stateFrames = play->state.frames; EnArrow* arrow = (EnArrow*)this->actor.parent; Actor* transform; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 047ad13ba0..00179e91aa 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -12,6 +12,7 @@ #include "quake.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -135,7 +136,7 @@ void BgBdanObjects_SetProperty(BgBdanObjects* this, s32 arg1) { } void BgBdanObjects_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgBdanObjects* this = (BgBdanObjects*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 280730bcda..b7585e5c60 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -11,6 +11,7 @@ #include "printf.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -102,7 +103,7 @@ static InitChainEntry sInitChain[] = { static Vec3f D_8086E0E0 = { 0.0f, 140.0f, 0.0f }; void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -111,7 +112,7 @@ void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHea #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -152,7 +153,7 @@ void func_8086D0EC(BgBdanSwitch* this) { void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - s32 pad; + STACK_PAD(s32); s16 type; s32 flag; @@ -236,7 +237,7 @@ void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) { } void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 type; if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { @@ -501,7 +502,7 @@ void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { } void BgBdanSwitch_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgBdanSwitch* this = (BgBdanSwitch*)thisx; s32 type; diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index e773a20c4c..de0655a1f9 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -9,6 +9,7 @@ #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "play_state.h" @@ -41,7 +42,7 @@ void BgBomGuard_SetupAction(BgBomGuard* this, BgBomGuardActionFunc actionFunc) { void BgBomGuard_Init(Actor* thisx, PlayState* play) { BgBomGuard* this = (BgBomGuard*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 15a2ffb841..59ac74bf5d 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -90,8 +91,7 @@ ActorProfile Bg_Bombwall_Profile = { }; void BgBombwall_InitDynapoly(BgBombwall* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -121,7 +121,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) { s32 j; Vec3f vecs[3]; Vec3f sp80; - s32 pad; + STACK_PAD(s32); BgBombwall* this = (BgBombwall*)thisx; f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index 57a5b0b9e6..b0f34d1d82 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -14,6 +14,7 @@ #include "quake.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -59,8 +60,7 @@ static s16 sTargetRot[] = { 0x0000, 0x0000, 0x3FFF, -0x3FFF }; void BgBowlWall_Init(Actor* thisx, PlayState* play) { BgBowlWall* this = (BgBowlWall*)thisx; - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -88,7 +88,7 @@ void BgBowlWall_Destroy(Actor* thisx, PlayState* play) { } void BgBowlWall_SpawnBullseyes(BgBowlWall* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWallTubo* bullseye; Actor* lookForGirl; s16 type; @@ -133,7 +133,7 @@ void BgBowlWall_WaitForHit(BgBowlWall* this, PlayState* play) { } void BgBowlWall_FallDoEffects(BgBowlWall* this, PlayState* play) { - s16 pad; + STACK_PAD(s16); Vec3f effectAccel = { 0.0f, 0.1f, 0.0f }; Vec3f effectVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f effectPos; diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index c12522fe52..bd4fc53196 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -6,6 +6,7 @@ #include "z_bg_breakwall.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -13,6 +14,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -92,7 +94,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwall* this = (BgBreakwall*)thisx; - s32 pad; + STACK_PAD(s32); s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -146,7 +148,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos s32 i; s16 angle1; s16 angle2 = 0; - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; // unused + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3s actorRotList[] = { { 0, 0, 0 }, { 0, 0, 0x4000 }, { 0, 0, -0x4000 }, { 0, 0, 0 } }; Vec3f actorScaleList[] = { { 0.004f, 0.004f, 0.004f }, @@ -160,7 +162,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos { { -40.0f, 14.0f, 0.0f }, { -50.0f, 57.0f, 0.0f }, { -30.0f, 57.0f, 0.0f }, { -40.0f, 70.0f, 0.0f } }, { { -55.0f, -15.0f, 0.0f }, { -55.0f, -32.0f, 0.0f }, { -30.0f, -32.0f, 0.0f }, { -20.0f, -10.0f, 0.0f } }, }; - s32 pad; + STACK_PAD(s32); for (k = 3; k >= 0; k--) { if ((k == 0) || (k == 3)) { @@ -304,7 +306,7 @@ static Vec3f sColQuadList[][4] = { }; void BgBreakwall_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgBreakwall* this = (BgBreakwall*)thisx; if (this->bombableWallDList != NULL) { diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index 71f37f61a5..bc5c8ce4d8 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -10,6 +10,7 @@ #include "one_point_cutscene.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -59,7 +60,7 @@ typedef enum BgDdanJdState { #define SHORTCUT_Y_SPEED 5 void BgDdanJd_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgDdanJd* this = (BgDdanJd*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 81012e657a..9c9e95bb0a 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -13,6 +13,7 @@ #include "rand.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -74,7 +75,7 @@ void BgDdanKd_SetupAction(BgDdanKd* this, BgDdanKdActionFunc actionFunc) { void BgDdanKd_Init(Actor* thisx, PlayState* play) { BgDdanKd* this = (BgDdanKd*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; this->prevExplosive = NULL; diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index f2e50dcb61..1980676362 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -5,6 +5,7 @@ */ #include "z_bg_dodoago.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "array_count.h" @@ -15,6 +16,7 @@ #include "rand.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -94,7 +96,7 @@ static s16 sFirstExplosiveFlag = false; static u8 sDisableBombCatcher; -static u8 sUnused[90]; // unknown length +UNUSED static u8 sUnused[90]; // unknown length static s32 sTimer; @@ -127,7 +129,7 @@ static InitChainEntry sInitChain[] = { void BgDodoago_Init(Actor* thisx, PlayState* play) { BgDodoago* this = (BgDodoago*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 44dc02ca0d..4a626e894d 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -5,6 +5,7 @@ */ #include "z_bg_dy_yoseizo.h" +#include "attributes.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "libc64/qrand.h" @@ -75,7 +76,7 @@ void BgDyYoseizo_SpawnEffect(BgDyYoseizo* this, Vec3f* initPos, Vec3f* initVeloc void BgDyYoseizo_UpdateEffects(BgDyYoseizo* this, PlayState* play); void BgDyYoseizo_DrawEffects(BgDyYoseizo* this, PlayState* play); -static s32 sUnusedGetItemIds[] = { GI_FARORES_WIND, GI_NAYRUS_LOVE, GI_DINS_FIRE }; +UNUSED static s32 sUnusedGetItemIds[] = { GI_FARORES_WIND, GI_NAYRUS_LOVE, GI_DINS_FIRE }; ActorProfile Bg_Dy_Yoseizo_Profile = { /**/ ACTOR_BG_DY_YOSEIZO, diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index b43241f1bd..23a36dd090 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -5,6 +5,7 @@ */ #include "z_bg_ganon_otyuka.h" +#include "attributes.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #include "array_count.h" @@ -324,7 +325,7 @@ void BgGanonOtyuka_Update(Actor* thisx, PlayState* play) { } void BgGanonOtyuka_Draw(Actor* thisx, PlayState* play) { - BgGanonOtyuka* this = (BgGanonOtyuka*)thisx; + UNUSED BgGanonOtyuka* this = (BgGanonOtyuka*)thisx; s16 i; Gfx* phi_s2; Gfx* phi_s1; diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 8e7ad4c3d6..dcbd750640 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -45,7 +46,7 @@ ActorProfile Bg_Gate_Shutter_Profile = { void BgGateShutter_Init(Actor* thisx, PlayState* play) { BgGateShutter* this = (BgGateShutter*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 3cf1b45e31..5616f94dcc 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "player.h" @@ -48,7 +49,7 @@ static InitChainEntry sInitChain[] = { void BgGjyoBridge_Init(Actor* thisx, PlayState* play) { BgGjyoBridge* this = (BgGjyoBridge*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader; colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index d3f3ccae8b..3afe5774d4 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -17,7 +17,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2); void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2); -void BgGndDarkmeiro_Update(Actor* thisx, PlayState* play2); +void BgGndDarkmeiro_Update(Actor* thisx, PlayState* play); void BgGndDarkmeiro_DrawInvisiblePath(Actor* thisx, PlayState* play); void BgGndDarkmeiro_DrawSwitchBlock(Actor* thisx, PlayState* play); void BgGndDarkmeiro_DrawStaticBlock(Actor* thisx, PlayState* play); @@ -177,11 +177,10 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play) { BgGndDarkmeiro_ToggleBlock(this, play); } -void BgGndDarkmeiro_Update(Actor* thisx, PlayState* play2) { +void BgGndDarkmeiro_Update(Actor* thisx, PlayState* play) { BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; - PlayState* play = play2; - this->updateFunc(this, play2); + this->updateFunc(this, play); } void BgGndDarkmeiro_DrawInvisiblePath(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index 441870154f..a563776d42 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -40,7 +41,7 @@ ActorProfile Bg_Gnd_Firemeiro_Profile = { }; void BgGndFiremeiro_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgGndFiremeiro* this = (BgGndFiremeiro*)thisx; CollisionHeader* colHeader = NULL; @@ -92,7 +93,7 @@ void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play) { } void BgGndFiremeiro_Shake(BgGndFiremeiro* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 randSign; if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index 2e587cde55..123e19fbed 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -6,11 +6,13 @@ #include "z_bg_gnd_iceblock.h" +#include "attributes.h" #include "libc64/qrand.h" #include "libu64/debug.h" #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -56,7 +58,7 @@ static InitChainEntry sInitChain[] = { static u8 sBlockPositions[2]; void BgGndIceblock_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgGndIceblock* this = (BgGndIceblock*)thisx; CollisionHeader* colHeader = NULL; @@ -79,7 +81,7 @@ void BgGndIceblock_Init(Actor* thisx, PlayState* play) { } void BgGndIceblock_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgGndIceblock* this = (BgGndIceblock*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -355,15 +357,15 @@ void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play) { } void BgGndIceblock_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgGndIceblock* this = (BgGndIceblock*)thisx; this->actionFunc(this, play); } void BgGndIceblock_Draw(Actor* thisx, PlayState* play) { - s32 pad; - BgGndIceblock* this = (BgGndIceblock*)thisx; + STACK_PAD(s32); + UNUSED BgGndIceblock* this = (BgGndIceblock*)thisx; Gfx_DrawDListOpa(play, gWaterTrialIceBlockDL); } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index acb2bd4f80..58f237cc45 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -70,7 +71,7 @@ static InitChainEntry sInitChain[] = { }; void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -171,7 +172,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index b487e1280d..f3285bb008 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -50,7 +51,7 @@ static InitChainEntry sInitChain[] = { void BgHaka_Init(Actor* thisx, PlayState* play) { BgHaka* this = (BgHaka*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -136,7 +137,7 @@ void BgHaka_IdleOpened(BgHaka* this, PlayState* play) { void BgHaka_IdleLockedClosed(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if (this->dyna.actor.params != 0) { this->dyna.actor.params--; diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index cdda12ba15..686c628bdc 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -81,7 +82,7 @@ static InitChainEntry sInitChain[] = { }; void BgHakaGate_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHakaGate* this = (BgHakaGate*)thisx; CollisionHeader* colHeader = NULL; @@ -146,7 +147,7 @@ void BgHakaGate_Init(Actor* thisx, PlayState* play) { } void BgHakaGate_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHakaGate* this = (BgHakaGate*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -311,7 +312,7 @@ void BgHakaGate_FalseSkull(BgHakaGate* this, PlayState* play) { } void BgHakaGate_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHakaGate* this = (BgHakaGate*)thisx; this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 4e6d67df94..b2f11fbed2 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "quake.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -53,7 +54,7 @@ static InitChainEntry sInitChain[] = { void BgHakaHuta_Init(Actor* thisx, PlayState* play) { BgHakaHuta* this = (BgHakaHuta*)thisx; - s16 pad; + STACK_PAD(s16); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index a0c3e37a58..2a2ad96b65 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -6,6 +6,7 @@ #include "z_bg_haka_megane.h" +#include "attributes.h" #include "ichain.h" #include "play_state.h" @@ -131,7 +132,7 @@ void BgHakaMegane_Update(Actor* thisx, PlayState* play) { } void BgHakaMegane_Draw(Actor* thisx, PlayState* play) { - BgHakaMegane* this = (BgHakaMegane*)thisx; + UNUSED BgHakaMegane* this = (BgHakaMegane*)thisx; if (ACTOR_FLAGS_CHECK_ALL(thisx, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, sDLists[thisx->params]); diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 061cdaf5d5..ff0f707503 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -6,9 +6,11 @@ #include "z_bg_haka_meganebg.h" +#include "attributes.h" #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -48,8 +50,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -// Unused -static u32 D_8087E3FC[] = { +UNUSED static u32 D_8087E3FC[] = { 0x00000000, 0x00000000, 0x00000000, 0xC8C800FF, 0xFF0000FF, }; @@ -61,7 +62,7 @@ static Gfx* D_8087E410[] = { }; void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHakaMeganeBG* this = (BgHakaMeganeBG*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 667f1f309b..ea91006c71 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -52,7 +53,7 @@ static InitChainEntry sInitChain[] = { void BgHakaShip_Init(Actor* thisx, PlayState* play) { BgHakaShip* this = (BgHakaShip*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -237,7 +238,7 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_ship.c", 568); if (this->actionFunc == BgHakaShip_CutsceneStationary || this->actionFunc == BgHakaShip_Move) { - s32 pad; + STACK_PAD(s32); Vec3f sp2C; sp2C.x = this->dyna.actor.world.pos.x + -367.0f; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 250f4ce32a..6b5a8fc04d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -119,7 +120,7 @@ static InitChainEntry sInitChain[] = { void BgHakaTrap_Init(Actor* thisx, PlayState* play) { static UNK_TYPE D_80881014 = 0; BgHakaTrap* this = (BgHakaTrap*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); @@ -531,7 +532,7 @@ void BgHakaTrap_Draw(Actor* thisx, PlayState* play) { }; static Color_RGBA8 D_8088103C = { 0, 0, 0, 0 }; BgHakaTrap* this = (BgHakaTrap*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f sp2C; if (this->actionFunc == func_808802D8) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index d4b20752d5..88325f3939 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -90,7 +91,7 @@ static InitChainEntry sInitChain[] = { void BgHakaTubo_Init(Actor* thisx, PlayState* play) { BgHakaTubo* this = (BgHakaTubo*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -231,7 +232,7 @@ void BgHakaTubo_Update(Actor* thisx, PlayState* play) { } void BgHakaTubo_DrawFlameCircle(BgHakaTubo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_haka_tubo.c", 476); diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index 8143404e10..1b211635bb 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -116,9 +117,9 @@ void BgHakaWater_Update(Actor* thisx, PlayState* play) { void BgHakaWater_Draw(Actor* thisx, PlayState* play) { BgHakaWater* this = (BgHakaWater*)thisx; - s32 pad; + STACK_PAD(s32); f32 temp; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_haka_water.c", 287); Gfx_SetupDL_25Xlu(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 5be3889889..f4e6720e34 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -11,6 +11,7 @@ #include "one_point_cutscene.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -82,7 +83,7 @@ static InitChainEntry sInitChain[] = { }; void BgHakaZou_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHakaZou* this = (BgHakaZou*)thisx; Actor_ProcessInitChain(thisx, sInitChain); @@ -236,7 +237,7 @@ void func_80882CC4(BgHakaZou* this, PlayState* play) { Vec3f actorSpawnPos; f32 sin; f32 cos; - s32 pad; + STACK_PAD(s32); sin = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f; cos = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f; diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 88b063ae2c..e5059b9152 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -17,6 +17,7 @@ #include "rand.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -93,7 +94,7 @@ void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { } void BgHeavyBlock_SetupDynapoly(BgHeavyBlock* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; this->dyna.actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_CARRY_X_ROT_INFLUENCE; @@ -304,7 +305,7 @@ void BgHeavyBlock_SpawnPieces(BgHeavyBlock* this, PlayState* play) { { 0.0f, 300.0f, -20.0f }, { 50.0f, 200.0f, -20.0f }, { -50.0f, 200.0f, -20.0f }, { 0.0f, 100.0f, 30.0f }, { 0.0f, 100.0f, -70.0f }, { 0.0f, 0.0f, -20.0f }, }; - s32 pad; + STACK_PAD(s32); Vec3f pos; f32 sinPitch; f32 cosPitch; @@ -361,7 +362,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); f32 cosYaw; f32 zOffset; f32 sinYaw; @@ -467,7 +468,7 @@ void BgHeavyBlock_DoNothing(BgHeavyBlock* this, PlayState* play) { } void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x8AD0, 6, 2000, 100) != 0) { Math_StepToF(&this->dyna.actor.speed, 0.0f, 20.0f); @@ -504,7 +505,7 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { static Vec3f D_80884EC8 = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80884ED4 = { 0.0f, 400.0f, 0.0f }; BgHeavyBlock* this = (BgHeavyBlock*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); OPEN_DISPS(play->state.gfxCtx, "../z_bg_heavy_block.c", 904); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 7abcc1f912..082d713edb 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -79,7 +80,7 @@ ActorProfile Bg_Hidan_Curtain_Profile = { }; void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanCurtain* this = (BgHidanCurtain*)thisx; BgHidanCurtainParams* hcParams; @@ -131,7 +132,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { } void BgHidanCurtain_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanCurtain* this = (BgHidanCurtain*)thisx; Collider_DestroyCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 412b2a5426..f5f02927f1 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -9,6 +9,7 @@ #include "libc64/qrand.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -106,7 +107,7 @@ static InitChainEntry sInitChain[] = { void BgHidanDalm_Init(Actor* thisx, PlayState* play) { BgHidanDalm* this = (BgHidanDalm*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 9ca446025c..3ab2e39f6d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -184,7 +185,7 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play void BgHidanFirewall_Update(Actor* thisx, PlayState* play) { BgHidanFirewall* this = (BgHidanFirewall*)thisx; - s32 pad; + STACK_PAD(s32); this->unk_150 = (this->unk_150 + 1) % 8; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index b8d10809f8..bca19beba4 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -8,6 +8,7 @@ #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -44,10 +45,10 @@ static InitChainEntry sInitChain[] = { }; void BgHidanFslift_Init(Actor* thisx, PlayState* play) { - s32 pad1; + STACK_PAD(s32); BgHidanFslift* this = (BgHidanFslift*)thisx; CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 0a01e35dcd..336aa565d7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -13,6 +13,7 @@ #include "one_point_cutscene.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -118,7 +119,7 @@ void BgHidanFwbig_Init(Actor* thisx, PlayState* play2) { } void BgHidanFwbig_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanFwbig* this = (BgHidanFwbig*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -230,7 +231,7 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, PlayState* play) { } void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanFwbig* this = (BgHidanFwbig*)thisx; if (this->collider.base.atFlags & AT_HIT) { @@ -260,7 +261,7 @@ void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { } void BgHidanFwbig_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 height; OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_fwbig.c", 630); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 3f2e87ed3f..208a42c1d1 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -16,6 +16,7 @@ #include "regs.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "versions.h" @@ -144,7 +145,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { BgHidanHamstep* this = (BgHidanHamstep*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Vec3f sp48[3]; s32 i; @@ -304,8 +305,7 @@ void func_808887C4(BgHidanHamstep* this, PlayState* play) { } void func_80888860(BgHidanHamstep* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); s32 quakeIndex; Actor_MoveXZGravity(&this->dyna.actor); @@ -337,7 +337,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) { } void func_808889B8(BgHidanHamstep* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent; func_80888734(this); @@ -354,8 +354,7 @@ void func_808889B8(BgHidanHamstep* this, PlayState* play) { } void func_80888A58(BgHidanHamstep* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); s32 quakeIndex; Actor_MoveXZGravity(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 3559b572fb..454dcc7f15 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -76,7 +77,7 @@ void BgHidanKousi_SetupAction(BgHidanKousi* this, BgHidanKousiActionFunc actionF void BgHidanKousi_Init(Actor* thisx, PlayState* play) { BgHidanKousi* this = (BgHidanKousi*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -110,7 +111,7 @@ void BgHidanKousi_Destroy(Actor* thisx, PlayState* play) { } void func_80889ACC(BgHidanKousi* this) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3s* rot = &this->dyna.actor.world.rot; f32 temp1 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_SinS(rot->y); f32 temp2 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_CosS(rot->y); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 4f1be80a62..b235238011 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -86,9 +87,9 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play &gFireTempleBombableWallCol, &gFireTempleLargeBombableWallCol, }; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); if (collisionHeaders[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] != NULL) { DynaPolyActor_Init(&this->dyna, 0); @@ -102,7 +103,7 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState* play) { static s16 sphereRadii[] = { 80, 45, 80 }; static s16 sphereYPositions[] = { 0, 500, 500 }; - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); @@ -160,7 +161,7 @@ void BgHidanKowarerukabe_Destroy(Actor* thisx, PlayState* play) { } void BgHidanKowarerukabe_SpawnDust(BgHidanKowarerukabe* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f pos; pos = this->dyna.actor.world.pos; @@ -315,7 +316,7 @@ void BgHidanKowarerukabe_Break(BgHidanKowarerukabe* this, PlayState* play) { void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { BgHidanKowarerukabe* this = (BgHidanKowarerukabe*)thisx; - s32 pad; + STACK_PAD(s32); if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) { BgHidanKowarerukabe_Break(this, play); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 872ed0608c..34ea33f782 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -12,6 +12,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -81,7 +82,7 @@ static InitChainEntry sInitChain[] = { void BgHidanRock_Init(Actor* thisx, PlayState* play) { BgHidanRock* this = (BgHidanRock*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); @@ -362,7 +363,7 @@ static void* sVerticalFlamesTexs[] = { }; void func_8088BC40(PlayState* play, BgHidanRock* this) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_rock.c", 808); @@ -390,7 +391,7 @@ void func_8088BC40(PlayState* play, BgHidanRock* this) { void BgHidanRock_Draw(Actor* thisx, PlayState* play) { BgHidanRock* this = (BgHidanRock*)thisx; - s32 pad; + STACK_PAD(s32); if (this->type == 0) { Gfx_DrawDListOpa(play, gFireTempleStoneBlock1DL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index df5936d41e..48a711ed2a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -133,7 +134,7 @@ static void* sFireballsTexs[] = { void BgHidanRsekizou_Init(Actor* thisx, PlayState* play) { BgHidanRsekizou* this = (BgHidanRsekizou*)thisx; s32 i; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader; colHeader = NULL; @@ -161,7 +162,7 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) { BgHidanRsekizou* this = (BgHidanRsekizou*)thisx; s32 i; ColliderJntSphElement* element; - s32 pad; + STACK_PAD(s32); f32 yawSine; f32 yawCosine; @@ -238,7 +239,7 @@ Gfx* BgHidanRsekizou_DrawFireball(PlayState* play, BgHidanRsekizou* this, s16 fr void BgHidanRsekizou_Draw(Actor* thisx, PlayState* play) { BgHidanRsekizou* this = (BgHidanRsekizou*)thisx; s32 i; - s32 pad; + STACK_PAD(s32); MtxF mf; OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_rsekizou.c", 564); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index bb7cf7edf5..9521af0f50 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -158,7 +159,7 @@ void func_8088CEC0(BgHidanSekizou* this, s32 arg1, s16 arg2) { } void BgHidanSekizou_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanSekizou* this = (BgHidanSekizou*)thisx; s32 i; CollisionHeader* colHeader = NULL; @@ -342,7 +343,7 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* mtx, f } Gfx* func_8088DC50(PlayState* play, BgHidanSekizou* this, s16 arg2, s16 arg3, Gfx* arg4) { - s32 pad; + STACK_PAD(s32); s16 temp_v1; s32 phi_s1; s32 phi_s2; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index a44cfa3491..9df22f8a5f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -13,6 +13,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -95,7 +96,7 @@ static void* sFireballsTexs[] = { void BgHidanSima_Init(Actor* thisx, PlayState* play) { BgHidanSima* this = (BgHidanSima*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; s32 i; @@ -220,7 +221,7 @@ void func_8088E90C(BgHidanSima* this) { void BgHidanSima_Update(Actor* thisx, PlayState* play) { BgHidanSima* this = (BgHidanSima*)thisx; - s32 pad; + STACK_PAD(s32); this->actionFunc(this, play); if (this->dyna.actor.params != 0) { @@ -244,7 +245,7 @@ Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) { s32 phi_s5; f32 cos; f32 sin; - s32 pad[2]; + STACK_PADS(s32, 2); Matrix_MtxFCopy(&mtxF, &gIdentityMtxF); cos = Math_CosS(this->dyna.actor.world.rot.y + 0x8000); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index a540872b96..c13d692cd6 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "sfx.h" #include "play_state.h" +#include "stack_pad.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -40,7 +41,7 @@ static InitChainEntry sInitChain[] = { }; void BgHidanSyoku_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgHidanSyoku* this = (BgHidanSyoku*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 7398d9e8e0..467b6e0dcc 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -6,10 +6,12 @@ #include "z_bg_ice_objects.h" +#include "attributes.h" #include "libc64/qrand.h" #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -50,7 +52,7 @@ static InitChainEntry sInitChain[] = { }; void BgIceObjects_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgIceObjects* this = (BgIceObjects*)thisx; CollisionHeader* colHeader = NULL; @@ -64,7 +66,7 @@ void BgIceObjects_Init(Actor* thisx, PlayState* play) { } void BgIceObjects_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgIceObjects* this = (BgIceObjects*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -233,15 +235,15 @@ void BgIceObjects_Stuck(BgIceObjects* this, PlayState* play) { } void BgIceObjects_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgIceObjects* this = (BgIceObjects*)thisx; this->actionFunc(this, play); } void BgIceObjects_Draw(Actor* thisx, PlayState* play) { - s32 pad; - BgIceObjects* this = (BgIceObjects*)thisx; + STACK_PAD(s32); + UNUSED BgIceObjects* this = (BgIceObjects*)thisx; Gfx_DrawDListOpa(play, object_ice_objects_DL_000190); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 0c6578ec26..812c561175 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -99,7 +100,7 @@ static ColliderCylinderInit sCylinderInit2 = { void BgIceShelter_InitColliders(BgIceShelter* this, PlayState* play) { static s16 cylinderRadii[] = { 47, 33, 44, 41, 100 }; static s16 cylinderHeights[] = { 80, 54, 90, 60, 200 }; - s32 pad; + STACK_PAD(s32); s32 type = BGICESHELTER_GET_TYPE(&this->dyna.actor); // All types use at least one collider in order to detect blue fire @@ -126,7 +127,7 @@ void BgIceShelter_InitColliders(BgIceShelter* this, PlayState* play) { } void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -135,7 +136,7 @@ void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHea #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -251,7 +252,7 @@ void BgIceShelter_SpawnSteamAround(BgIceShelter* this, PlayState* play, f32 part s16 angle; s16 frameCounter; s32 i; - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f steamPos; Vec3f steamVel; Vec3f steamAccel; @@ -299,7 +300,7 @@ void BgIceShelter_SpawnSteamAlong(BgIceShelter* this, PlayState* play, f32 parti static f32 signs[] = { -1.0f, 1.0f }; Vec3f* icePos; s16 frameCounter; - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f steamPos; Vec3f steamVel; Vec3f steamAccel; @@ -345,7 +346,7 @@ void BgIceShelter_SetupIdle(BgIceShelter* this) { * Checks for collision with blue fire. Also used to freeze King Zora's actor. */ void BgIceShelter_Idle(BgIceShelter* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 type = BGICESHELTER_GET_TYPE(&this->dyna.actor); // Freeze King Zora @@ -411,8 +412,7 @@ static void (*sSteamSpawnFuncs[])(BgIceShelter* this, PlayState* play, f32 parti * Progressively reduces the height and opacity of the red ice, while spawning steam effects at its base. */ void BgIceShelter_Melt(BgIceShelter* this, PlayState* play) { - - s32 pad; + STACK_PAD(s32); s32 type = BGICESHELTER_GET_TYPE(&this->dyna.actor); f32 particleSpawningChance; diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 8933b3c7a1..c53c1df3f3 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -53,7 +54,7 @@ void func_80891AC0(BgIceShutter* this) { void BgIceShutter_Init(Actor* thisx, PlayState* play) { BgIceShutter* this = (BgIceShutter*)thisx; - f32 sp24; + STACK_PAD(s32); CollisionHeader* colHeader; s32 sp28; diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 8f619e0ed2..c901bf7ca7 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -10,6 +10,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -70,7 +71,7 @@ static InitChainEntry sInitChain[] = { void BgIceTurara_Init(Actor* thisx, PlayState* play) { BgIceTurara* this = (BgIceTurara*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 61ea3e0e4c..5af7093cdd 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -43,8 +44,7 @@ void BgInGate_SetupAction(BgInGate* this, BgInGateActionFunc actionFunc) { void BgInGate_Init(Actor* thisx, PlayState* play) { BgInGate* this = (BgInGate*)thisx; - - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 6ff102aa41..6b126f8215 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -76,7 +77,7 @@ static InitChainEntry sInitChain[] = { }; void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -85,7 +86,7 @@ void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeade #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 046da7d10f..02707241e4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -51,7 +52,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad1; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -60,7 +61,7 @@ void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, Collis #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index feb7cba7b7..62d61ef7d8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "play_state.h" @@ -135,7 +136,7 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) { { 60.0f, 1800.0f, -310.0f }, }; BgJyaBigmirror* this = (BgJyaBigmirror*)thisx; - s32 puzzleSolved; + STACK_PAD(s32); s32 lightBeamToggles[3]; s32 i; s32 mirRayObjectSlot; diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 261bb07fb5..c7bfb3bb2b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "player.h" @@ -44,7 +45,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaBlock_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaBlock* this = (BgJyaBlock*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index e19f90863a..9bf5154819 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -8,6 +8,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -76,7 +77,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaBombchuiwa_SetupCollider(BgJyaBombchuiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 87a1aa3a78..4844a1df2a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "effect.h" @@ -72,7 +73,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad1; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -81,7 +82,7 @@ void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHe #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -91,7 +92,7 @@ void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHe } void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 81fe1e598f..3c328fbb2d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -7,6 +7,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -134,7 +135,7 @@ void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) { } void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -143,7 +144,7 @@ void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader* #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -167,7 +168,7 @@ void BgJyaCobra_SpawnRay(BgJyaCobra* this, PlayState* play) { } void func_80895A70(BgJyaCobra* this) { - s32 pad; + STACK_PAD(s32); BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; MirRay* mirRay; @@ -215,7 +216,7 @@ void func_80895A70(BgJyaCobra* this) { void func_80895BEC(BgJyaCobra* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); Vec3f sp2C; func_808958F0(&sp2C, &this->unk_174, Math_SinS(this->unk_170), Math_CosS(this->unk_170)); @@ -563,7 +564,7 @@ void func_80896CB4(PlayState* play) { } void func_80896D78(BgJyaCobra* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3s sp44; OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 924); @@ -583,7 +584,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { } void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 params = PARAMS_GET_U(this->dyna.actor.params, 0, 2); Vec3f sp64; Vec3s* phi_a3; diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index fb25354ccd..d9071d791e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" #include "player.h" @@ -87,7 +88,7 @@ void BgJyaGoroiwa_UpdateCollider(BgJyaGoroiwa* this) { } void BgJyaGoroiwa_InitCollider(BgJyaGoroiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); @@ -201,7 +202,7 @@ void BgJyaGoroiwa_Wait(BgJyaGoroiwa* this, PlayState* play) { } void BgJyaGoroiwa_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaGoroiwa* this = (BgJyaGoroiwa*)thisx; Player* player = GET_PLAYER(play); s32 bgId; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index dd514e850b..5855a09eea 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -11,6 +11,7 @@ #include "array_count.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -85,7 +86,7 @@ static Vec3f D_808987A0[] = { 0.0f, 14.0f, 0.0f }; static Vec3f D_808987AC[] = { 0.0f, 8.0f, 0.0f }; void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); @@ -125,7 +126,7 @@ void BgJyaHaheniron_SpawnFragments(PlayState* play, Vec3f* vec1, Vec3f* vec2) { } void BgJyaHaheniron_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaHaheniron* this = (BgJyaHaheniron*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -142,7 +143,7 @@ void BgJyaHaheniron_Init(Actor* thisx, PlayState* play) { } void BgJyaHaheniron_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaHaheniron* this = (BgJyaHaheniron*)thisx; if (this->actor.params == 0) { @@ -205,7 +206,7 @@ void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, PlayState* play) { } void BgJyaHaheniron_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaHaheniron* this = (BgJyaHaheniron*)thisx; this->timer++; @@ -218,7 +219,7 @@ void BgJyaHaheniron_Draw(Actor* thisx, PlayState* play) { gObjectJyaIronDL_000AE0, gObjectJyaIronDL_000600, }; - s32 pad; + STACK_PAD(s32); BgJyaHaheniron* this = (BgJyaHaheniron*)thisx; if (this->actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index cf13895832..b8eb345638 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -5,12 +5,14 @@ */ #include "z_bg_jya_ironobj.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Ik/z_en_ik.h" #include "libc64/qrand.h" #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_en_item00.h" #include "z_lib.h" @@ -33,7 +35,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play); void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk); void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk); -static int sUnused = 0; +UNUSED static int sUnused = 0; ActorProfile Bg_Jya_Ironobj_Profile = { /**/ ACTOR_BG_JYA_IRONOBJ, @@ -91,7 +93,7 @@ static InitChainEntry sInitChain[] = { static CollisionHeader* sCollisionHeaders[] = { &gPillarCol, &gThroneCol }; void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitCylinder(play, &this->colliderCylinder); Collider_SetCylinder(play, &this->colliderCylinder, &this->dyna.actor, &sCylinderInit); @@ -115,7 +117,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 coss; s16 rotY; f32 sins; - s32 pad[2]; + STACK_PADS(s32, 2); #if DEBUG_FEATURES if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { @@ -182,7 +184,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 coss; s16 rotY; f32 sins; - s32 pad[2]; + STACK_PADS(s32, 2); #if DEBUG_FEATURES if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { @@ -234,7 +236,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk void BgJyaIronobj_Init(Actor* thisx, PlayState* play) { BgJyaIronobj* this = (BgJyaIronobj*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 652ec8e8e6..63cbf0c5d1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -11,6 +11,7 @@ #include "printf.h" #include "quake.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -50,7 +51,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -59,7 +60,7 @@ void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHea #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -110,7 +111,7 @@ void func_8089993C(BgJyaKanaami* this) { } void func_80899950(BgJyaKanaami* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 quakeIndex; this->unk_168 += 0x20; diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 83e58b79b8..f7b1e46972 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -10,6 +10,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -51,7 +52,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaLift_InitDynapoly(BgJyaLift* this, PlayState* play, CollisionHeader* collisionHeader, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index da22420786..efbdc0c31d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -15,6 +15,7 @@ #include "one_point_cutscene.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -125,7 +126,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaMegami_InitDynaPoly(BgJyaMegami* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -134,7 +135,7 @@ void BgJyaMegami_InitDynaPoly(BgJyaMegami* this, PlayState* play, CollisionHeade } void BgJyaMegami_InitCollider(BgJyaMegami* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); @@ -247,7 +248,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, PlayState* play) { u32 i; Vec3f sp8C; BgJyaMegamiPieceInit* temp2; - s32 pad; + STACK_PAD(s32); this->explosionTimer++; if (this->explosionTimer == 30) { @@ -335,7 +336,7 @@ static Gfx* sDLists[] = { }; void BgJyaMegami_DrawExplode(BgJyaMegami* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgJyaMegamiPiece* piece; u32 i; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 148d6c0098..f3c0e4760f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -10,6 +10,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -70,7 +71,7 @@ static InitChainEntry sInitChain[] = { }; void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -79,7 +80,7 @@ void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, Collis #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index b130738664..d45368ca2d 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -70,7 +71,7 @@ static InitChainEntry sInitChain[] = { void BgMenkuriEye_Init(Actor* thisx, PlayState* play) { BgMenkuriEye* this = (BgMenkuriEye*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(play, &this->collider); @@ -127,7 +128,7 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) { void BgMenkuriEye_Draw(Actor* thisx, PlayState* play) { BgMenkuriEye* this = (BgMenkuriEye*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_menkuri_eye.c", 292); Gfx_SetupDL_25Xlu(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index 1b17110214..ce393a7dac 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "sfx.h" #include "play_state.h" +#include "stack_pad.h" #include "assets/objects/object_menkuri_objects/object_menkuri_objects.h" @@ -37,7 +38,7 @@ static InitChainEntry sInitChain[] = { void BgMenkuriKaiten_Init(Actor* thisx, PlayState* play) { BgMenkuriKaiten* this = (BgMenkuriKaiten*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index bb21a6cb6f..c4a8e35aab 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -5,6 +5,7 @@ */ #include "z_bg_mizu_bwall.h" +#include "attributes.h" #include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h" #include "libc64/qrand.h" @@ -14,6 +15,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -183,7 +185,7 @@ void BgMizuBwall_RotateVec3f(Vec3f* out, Vec3f* in, f32 sin, f32 cos) { } void BgMizuBwall_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuBwall* this = (BgMizuBwall*)thisx; CollisionHeader* colHeader = NULL; @@ -410,7 +412,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuBwall* this = (BgMizuBwall*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -453,7 +455,7 @@ void BgMizuBwall_SetAlpha(BgMizuBwall* this, PlayState* play) { void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) { s32 i; - s32 pad; + STACK_PAD(s32); s16 rand1; s16 rand2; Vec3f* thisPos = &this->dyna.actor.world.pos; @@ -531,7 +533,7 @@ void BgMizuBwall_DoNothing(BgMizuBwall* this, PlayState* play) { } void BgMizuBwall_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuBwall* this = (BgMizuBwall*)thisx; this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index c8c325298c..b9ec14406c 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -6,6 +6,7 @@ #include "one_point_cutscene.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -56,11 +57,11 @@ static InitChainEntry sInitChain[] = { }; void BgMizuShutter_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuShutter* this = (BgMizuShutter*)thisx; - s32 pad2; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; - s32 pad3; + STACK_PAD(s32); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->displayList = sDisplayLists[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)]; @@ -96,7 +97,7 @@ void BgMizuShutter_Init(Actor* thisx, PlayState* play) { } void BgMizuShutter_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuShutter* this = (BgMizuShutter*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -159,14 +160,14 @@ void BgMizuShutter_WaitForTimer(BgMizuShutter* this, PlayState* play) { } void BgMizuShutter_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuShutter* this = (BgMizuShutter*)thisx; this->actionFunc(this, play); } void BgMizuShutter_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuShutter* this = (BgMizuShutter*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mizu_shutter.c", 410); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 03d4ac5628..f0c415006b 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -10,6 +10,7 @@ #include "sfx.h" #include "play_state.h" #include "player.h" +#include "stack_pad.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" @@ -41,10 +42,10 @@ static InitChainEntry sInitChain[] = { }; void BgMizuUzu_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMizuUzu* this = (BgMizuUzu*)thisx; CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 4b08d9479f..3818c5da80 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -6,6 +6,7 @@ #include "z_bg_mizu_water.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -14,6 +15,7 @@ #include "regs.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -55,8 +57,8 @@ ActorProfile Bg_Mizu_Water_Profile = { /**/ BgMizuWater_Draw, }; -static f32 sUnused1 = 0; -static f32 sUnused2 = 110.0f; +UNUSED static f32 sUnused1 = 0; +UNUSED static f32 sUnused2 = 110.0f; static u32 sWaterBoxIndices[] = { 2, 3, 5, 7, 12, 20, 21, 22 }; @@ -182,7 +184,7 @@ void BgMizuWater_Destroy(Actor* thisx, PlayState* play) { } void BgMizuWater_WaitForAction(BgMizuWater* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 waterLevelActionIndex; s16 prevSwitchFlag; @@ -231,7 +233,7 @@ void BgMizuWater_WaitForAction(BgMizuWater* this, PlayState* play) { } void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 prevSwitchFlag; s32 waterLevelActionIndex; WaterBox* waterBoxes; @@ -313,7 +315,7 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) { s32 posY; s32 unk0; s32 unk1; - s32 pad; + STACK_PAD(s32); #if DEBUG_FEATURES if (bREG(15) == 0) { @@ -345,7 +347,7 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) { } void BgMizuWater_Draw(Actor* thisx, PlayState* play) { - BgMizuWater* this = (BgMizuWater*)thisx; + UNUSED BgMizuWater* this = (BgMizuWater*)thisx; s32 gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mizu_water.c", 738); diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index cd9fc555c7..d2d3d8749c 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -6,6 +6,7 @@ #include "z_bg_mjin.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -108,7 +109,7 @@ void BgMjin_Update(Actor* thisx, PlayState* play) { } void BgMjin_Draw(Actor* thisx, PlayState* play) { - BgMjin* this = (BgMjin*)thisx; + UNUSED BgMjin* this = (BgMjin*)thisx; Gfx* dlist; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mjin.c", 250); diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index baf9156bb7..ccc48ddea8 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -13,6 +13,7 @@ #include "printf.h" #include "quake.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "play_state.h" @@ -63,7 +64,7 @@ void BgMoriBigst_SetupAction(BgMoriBigst* this, BgMoriBigstActionFunc actionFunc } void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -72,7 +73,7 @@ void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeade #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -82,7 +83,7 @@ void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeade } void BgMoriBigst_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriBigst* this = (BgMoriBigst*)thisx; PRINTF(T("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", @@ -109,7 +110,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { } void BgMoriBigst_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriBigst* this = (BgMoriBigst*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -157,7 +158,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, PlayState* play) { } void BgMoriBigst_StalfosFight(BgMoriBigst* this, PlayState* play) { - Player* player = GET_PLAYER(play); + STACK_PAD(s32); if ((this->dyna.actor.home.rot.z == 0) && ((this->dyna.actor.home.pos.y - 5.0f) <= GET_PLAYER(play)->actor.world.pos.y)) { @@ -182,7 +183,7 @@ void BgMoriBigst_Fall(BgMoriBigst* this, PlayState* play) { } void BgMoriBigst_SetupLanding(BgMoriBigst* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 quakeIndex; BgMoriBigst_SetupAction(this, BgMoriBigst_Landing); @@ -237,7 +238,7 @@ void BgMoriBigst_SetupDone(BgMoriBigst* this, PlayState* play) { } void BgMoriBigst_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriBigst* this = (BgMoriBigst*)thisx; Actor_SetFocus(&this->dyna.actor, 50.0f); @@ -253,7 +254,7 @@ void BgMoriBigst_Update(Actor* thisx, PlayState* play) { } void BgMoriBigst_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriBigst* this = (BgMoriBigst*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_bigst.c", 541); diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 8532ce180b..a844f78176 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -6,6 +6,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "audio.h" @@ -96,7 +97,7 @@ void func_808A18FC(BgMoriElevator* this, f32 distTo) { void BgMoriElevator_Init(Actor* thisx, PlayState* play) { BgMoriElevator* this = (BgMoriElevator*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; this->unk_172 = sIsSpawned; @@ -208,7 +209,7 @@ void BgMoriElevator_SetupSetPosition(BgMoriElevator* this) { } void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (BgMoriElevator_IsPlayerRiding(this, play)) { if (play->roomCtx.curRoom.num == 2) { @@ -267,7 +268,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) { } void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriElevator* this = (BgMoriElevator*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_elevator.c", 575); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index ad41dfc212..ff3cf0386c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -91,7 +92,7 @@ static InitChainEntry sInitChainLadder[] = { }; void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -100,7 +101,7 @@ void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionH #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -110,7 +111,7 @@ void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionH } void BgMoriHashigo_InitCollider(BgMoriHashigo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); @@ -166,7 +167,7 @@ s32 BgMoriHashigo_InitLadder(BgMoriHashigo* this, PlayState* play) { } void BgMoriHashigo_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashigo* this = (BgMoriHashigo*)thisx; if (this->dyna.actor.params == HASHIGO_CLASP) { @@ -194,7 +195,7 @@ void BgMoriHashigo_Init(Actor* thisx, PlayState* play) { } void BgMoriHashigo_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashigo* this = (BgMoriHashigo*)thisx; if (this->dyna.actor.params == HASHIGO_LADDER) { @@ -283,7 +284,7 @@ void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) { } void BgMoriHashigo_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashigo* this = (BgMoriHashigo*)thisx; if (this->hitTimer > 0) { @@ -295,7 +296,7 @@ void BgMoriHashigo_Update(Actor* thisx, PlayState* play) { } void BgMoriHashigo_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashigo* this = (BgMoriHashigo*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 516); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index fa25e2df8d..494fa3ee03 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -61,7 +62,7 @@ void BgMoriHashira4_SetupAction(BgMoriHashira4* this, BgMoriHashira4ActionFunc a } void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -70,7 +71,7 @@ void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, Collisio #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -80,7 +81,7 @@ void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, Collisio } void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashira4* this = (BgMoriHashira4*)thisx; this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 8, 6); @@ -111,7 +112,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { } void BgMoriHashira4_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashira4* this = (BgMoriHashira4*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -161,7 +162,7 @@ void BgMoriHashira4_GateOpen(BgMoriHashira4* this, PlayState* play) { } void BgMoriHashira4_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashira4* this = (BgMoriHashira4*)thisx; if (this->actionFunc != NULL) { @@ -170,7 +171,7 @@ void BgMoriHashira4_Update(Actor* thisx, PlayState* play) { } void BgMoriHashira4_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriHashira4* this = (BgMoriHashira4*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashira4.c", 339); diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 2cd35ab1ee..5ffe138fab 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -11,6 +11,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -57,7 +58,7 @@ void BgMoriIdomizu_SetWaterLevel(PlayState* play, s16 waterLevel) { } void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; if (sIsSpawned) { @@ -93,7 +94,7 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { } void BgMoriIdomizu_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; if (this->isLoaded) { @@ -159,7 +160,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { } void BgMoriIdomizu_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; if (this->actionFunc != NULL) { @@ -168,7 +169,7 @@ void BgMoriIdomizu_Update(Actor* thisx, PlayState* play) { } void BgMoriIdomizu_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; u32 gameplayFrames = play->gameplayFrames; diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 3f41bf1e79..1da9d91871 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -58,7 +59,7 @@ void BgMoriKaitenkabe_CrossProduct(Vec3f* dest, Vec3f* v1, Vec3f* v2) { } void BgMoriKaitenkabe_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriKaitenkabe* this = (BgMoriKaitenkabe*)thisx; CollisionHeader* colHeader = NULL; @@ -80,7 +81,7 @@ void BgMoriKaitenkabe_Init(Actor* thisx, PlayState* play) { } void BgMoriKaitenkabe_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriKaitenkabe* this = (BgMoriKaitenkabe*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -163,14 +164,14 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play) { } void BgMoriKaitenkabe_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriKaitenkabe* this = (BgMoriKaitenkabe*)thisx; this->actionFunc(this, play); } void BgMoriKaitenkabe_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriKaitenkabe* this = (BgMoriKaitenkabe*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 347); diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 8693802846..62cafb658f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -14,6 +14,7 @@ #include "quake.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -61,7 +62,7 @@ static InitChainEntry sInitChain[] = { }; void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx; CollisionHeader* colHeader = NULL; @@ -98,7 +99,7 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { } void BgMoriRakkatenjo_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -164,7 +165,7 @@ void BgMoriRakkatenjo_SetupFall(BgMoriRakkatenjo* this) { void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) { static f32 bounceVel[] = { 4.0f, 1.5f, 0.4f, 0.1f }; - s32 pad; + STACK_PAD(s32); Actor* thisx = &this->dyna.actor; s32 quakeIndex; @@ -239,7 +240,7 @@ void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2) { } void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 497); diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 30f2044980..9071f946ae 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -13,6 +13,7 @@ #include "one_point_cutscene.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -207,7 +208,7 @@ static InitChainEntry sInitChain[] = { }; void BgPoEvent_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgPoEvent* this = (BgPoEvent*)thisx; Actor_ProcessInitChain(thisx, sInitChain); @@ -234,7 +235,7 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) { } void BgPoEvent_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgPoEvent* this = (BgPoEvent*)thisx; if (this->type >= 2) { @@ -593,7 +594,7 @@ void BgPoEvent_PaintingBurn(BgPoEvent* this, PlayState* play) { } void BgPoEvent_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgPoEvent* this = (BgPoEvent*)thisx; this->actionFunc(this, play); @@ -607,13 +608,13 @@ void BgPoEvent_Draw(Actor* thisx, PlayState* play) { gPoSistersAmyBlockDL, gPoSistersAmyBethBlockDL, gPoSistersJoellePaintingDL, gPoSistersBethPaintingDL, gPoSistersAmyPaintingDL, }; - s32 pad; + STACK_PAD(s32); BgPoEvent* this = (BgPoEvent*)thisx; u8 alpha; Vec3f sp58; Vec3f sp4C; f32 sp48; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_po_event.c", 1481); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index cf9c454583..8db0c68910 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "light.h" #include "play_state.h" @@ -86,7 +87,7 @@ static InitChainEntry sInitChain[] = { void BgPoSyokudai_Init(Actor* thisx, PlayState* play) { BgPoSyokudai* this = (BgPoSyokudai*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(thisx, sInitChain); @@ -140,7 +141,7 @@ void BgPoSyokudai_Destroy(Actor* thisx, PlayState* play) { void BgPoSyokudai_Update(Actor* thisx, PlayState* play) { BgPoSyokudai* this = (BgPoSyokudai*)thisx; - s32 pad; + STACK_PAD(s32); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index 49f017a0f9..13ac651fc7 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -46,10 +47,10 @@ void BgPushbox_SetupAction(BgPushbox* this, BgPushboxActionFunc actionFunc) { } void BgPushbox_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgPushbox* this = (BgPushbox*)thisx; CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); @@ -84,7 +85,7 @@ void BgPushbox_Update(Actor* thisx, PlayState* play) { } void BgPushbox_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_pushbox.c", 263); diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 52f858a343..37fbdf3502 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "audio.h" #include "cutscene_flags.h" @@ -57,7 +58,7 @@ static InitChainEntry sInitChain[] = { void BgRelayObjects_Init(Actor* thisx, PlayState* play) { static u32 D_808A9508 = 0; BgRelayObjects* this = (BgRelayObjects*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index 248043de43..c1ba177133 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #include "assets/objects/object_spot00_break/object_spot00_break.h" @@ -40,7 +41,7 @@ static InitChainEntry sInitChain[] = { void BgSpot00Break_Init(Actor* thisx, PlayState* play) { BgSpot00Break* this = (BgSpot00Break*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 8b6ab5ac96..de5edcbb95 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "cutscene_flags.h" @@ -62,7 +63,7 @@ static InitChainEntry sInitChain[] = { void BgSpot00Hanebasi_Init(Actor* thisx, PlayState* play) { BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f chainPos; CollisionHeader* colHeader = NULL; @@ -211,7 +212,7 @@ void BgSpot00Hanebasi_SetTorchLightInfo(BgSpot00Hanebasi* this, PlayState* play) } void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; Player* player; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 4f65271474..25adb1951d 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -12,6 +12,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -120,7 +121,7 @@ void func_808AAD3C(PlayState* play, Vec3f* vec, u32 arg2) { } void func_808AAE6C(BgSpot01Idohashira* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f sp30 = this->dyna.actor.world.pos; sp30.y += kREG(15); @@ -130,7 +131,7 @@ void func_808AAE6C(BgSpot01Idohashira* this, PlayState* play) { } void func_808AAF34(BgSpot01Idohashira* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if (this->unk_170 != 0) { Vec3f dest; @@ -167,7 +168,7 @@ s32 BgSpot01Idohashira_NotInCsMode(PlayState* play) { } CsCmdActorCue* BgSpot01Idohashira_GetCue(PlayState* play, s32 cueChannel) { - s32 pad[2]; + STACK_PADS(s32, 2); CsCmdActorCue* cue = NULL; if (!BgSpot01Idohashira_NotInCsMode(play)) { @@ -203,11 +204,11 @@ s32 func_808AB29C(BgSpot01Idohashira* this, PlayState* play) { Vec3f* thisPos; f32 endX; f32 temp_f0; - s32 pad2; + STACK_PAD(s32); Vec3f initPos; f32 endZ; f32 tempY; - f32 tempZ; + STACK_PAD(s32); cue = BgSpot01Idohashira_GetCue(play, 2); @@ -308,7 +309,7 @@ void BgSpot01Idohashira_Update(Actor* thisx, PlayState* play) { } void BgSpot01Idohashira_Init(Actor* thisx, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); BgSpot01Idohashira* this = (BgSpot01Idohashira*)thisx; CollisionHeader* colHeader; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index b68a23208f..2e13de506e 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "save.h" @@ -45,10 +46,10 @@ void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, BgSpot01IdosokoActionFun } void BgSpot01Idosoko_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot01Idosoko* this = (BgSpot01Idosoko*)thisx; CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 3f50e2e866..dcb8af5a7d 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "translation.h" #include "play_state.h" #include "save.h" @@ -96,7 +97,7 @@ s32 func_808AC22C(Path* pathList, Vec3f* pos, s32 path, s32 waypoint) { void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { CollisionHeader* colHeader = NULL; Actor* thisx = &this->dyna.actor; - s32 pad; + STACK_PAD(s32); Vec3f position; if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index ffe4ee021a..359913af61 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -62,7 +63,7 @@ static InitChainEntry sInitChain[] = { }; void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot02Objects* this = (BgSpot02Objects*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index e77823866c..6144854808 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "audio.h" #include "play_state.h" @@ -54,7 +55,7 @@ void BgSpot03Taki_ApplyOpeningAlpha(BgSpot03Taki* this, s32 bufferIndex) { void BgSpot03Taki_Init(Actor* thisx, PlayState* play) { BgSpot03Taki* this = (BgSpot03Taki*)thisx; - s16 pad; + STACK_PAD(s16); CollisionHeader* colHeader = NULL; this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); @@ -125,7 +126,7 @@ void BgSpot03Taki_Update(Actor* thisx, PlayState* play) { void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) { BgSpot03Taki* this = (BgSpot03Taki*)thisx; - s32 pad; + STACK_PAD(s32); u32 gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 321); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 1303fad735..59585303b4 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" #include "save.h" @@ -47,10 +48,10 @@ static Gfx* sDLists[] = { }; void BgSpot05Soko_Init(Actor* thisx, PlayState* play) { - s32 pad1; + STACK_PAD(s32); BgSpot05Soko* this = (BgSpot05Soko*)thisx; CollisionHeader* colHeader = NULL; - s32 pad2; + STACK_PAD(s32); Actor_ProcessInitChain(thisx, sInitChain); this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index c3c94063c5..e19dd21979 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -13,6 +13,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -107,7 +108,7 @@ static InitChainEntry sInitChainWaterPlane[] = { void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { BgSpot06Objects* this = (BgSpot06Objects*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; this->switchFlag = PARAMS_GET_U(thisx->params, 0, 8); @@ -296,9 +297,9 @@ void BgSpot06Objects_LockSpawnBubbles(BgSpot06Objects* this, PlayState* play, s3 * This is where the fish shaped lock waits to be pulled out by the hookshot. Once it does it will spawn bubbles. */ void BgSpot06Objects_LockWait(BgSpot06Objects* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 i; - s32 pad2; + STACK_PAD(s32); Vec3f effectPos; f32 sin; f32 cos; @@ -361,7 +362,7 @@ void BgSpot06Objects_LockPullOutward(BgSpot06Objects* this, PlayState* play) { */ void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, PlayState* play) { f32 cos; - f32 pad; + STACK_PAD(s32); this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; @@ -439,7 +440,7 @@ void BgSpot06Objects_Update(Actor* thisx, PlayState* play) { * Draw the Lake Hylia water plane, and scroll its texture */ void BgSpot06Objects_DrawLakeHyliaWater(BgSpot06Objects* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot06_objects.c", 844); @@ -505,7 +506,7 @@ void BgSpot06Objects_WaterPlaneCutsceneWait(BgSpot06Objects* this, PlayState* pl * This is where the Lake Hylia water plane rises in the cutscene after the Water Temple is cleared. */ void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); this->dyna.actor.world.pos.y = this->lakeHyliaWaterLevel + WATER_LEVEL_RAISED; diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index bc054e20b9..a14f7ccd62 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "play_state.h" @@ -43,7 +44,7 @@ static InitChainEntry sInitChain[] = { void BgSpot07Taki_Init(Actor* thisx, PlayState* play) { BgSpot07Taki* this = (BgSpot07Taki*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index ce59f55d04..2067308f4f 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -11,6 +11,7 @@ #include "array_count.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -103,14 +104,14 @@ static InitChainEntry sInitChain[] = { }; void func_808B02D0(BgSpot08Bakudankabe* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); } void func_808B0324(BgSpot08Bakudankabe* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 i; Vec3f burstDepthY; Vec3f burstDepthX; @@ -167,7 +168,7 @@ void func_808B0324(BgSpot08Bakudankabe* this, PlayState* play) { void BgSpot08Bakudankabe_Init(Actor* thisx, PlayState* play) { BgSpot08Bakudankabe* this = (BgSpot08Bakudankabe*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index ee7036a491..2695d08cce 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -10,6 +10,7 @@ #include "libc64/qrand.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "translation.h" @@ -52,7 +53,7 @@ void BgSpot08Iceblock_SetupAction(BgSpot08Iceblock* this, BgSpot08IceblockAction } void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -61,7 +62,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -187,7 +188,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { f32 playerCentroidDist; s32 rollDataIndex; MtxF mtx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { @@ -268,7 +269,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { } void BgSpot08Iceblock_SpawnTwinFloe(BgSpot08Iceblock* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 sin; f32 cos; diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 8fa33c1d22..2d98204e09 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "play_state.h" @@ -104,9 +105,9 @@ s32 func_808B1BA0(BgSpot09Obj* this, PlayState* play) { } s32 func_808B1BEC(BgSpot09Obj* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; - s32 pad2[2]; + STACK_PADS(s32, 2); if (D_808B1F90[this->dyna.actor.params] != NULL) { DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 427d9d4a6c..78ef692977 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -5,11 +5,13 @@ */ #include "z_bg_spot11_bakudankabe.h" +#include "attributes.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "effect.h" @@ -61,7 +63,7 @@ static Vec3f D_808B272C = { 2259.0f, 108.0f, -1550.0f }; static Vec3f D_808B2738 = { 2259.0f, 108.0f, -1550.0f }; void func_808B2180(BgSpot11Bakudankabe* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); @@ -118,7 +120,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, PlayState* play) { void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) { BgSpot11Bakudankabe* this = (BgSpot11Bakudankabe*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -155,7 +157,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { } void BgSpot11Bakudankabe_Draw(Actor* thisx, PlayState* play) { - BgSpot11Bakudankabe* this = (BgSpot11Bakudankabe*)thisx; + UNUSED BgSpot11Bakudankabe* this = (BgSpot11Bakudankabe*)thisx; Gfx_DrawDListOpa(play, gDesertColossusBombableWallDL); } diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index d4a2be3391..0f90175805 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -14,6 +14,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" @@ -139,7 +140,7 @@ void func_808B2AB8(BgSpot11Oasis* this, PlayState* play) { void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) { BgSpot11Oasis* this = (BgSpot11Oasis*)thisx; - s32 pad; + STACK_PAD(s32); u32 gameplayFrames; this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index f6eae41733..3e5b2ebedd 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -11,6 +11,7 @@ #include "printf.h" #include "quake.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -53,7 +54,7 @@ static InitChainEntry sInitChain[] = { }; void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -62,7 +63,7 @@ void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHea #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -118,7 +119,7 @@ void func_808B317C(BgSpot12Gate* this) { } void func_808B318C(BgSpot12Gate* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f); if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 71674bc12b..c99153a191 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -10,6 +10,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -50,7 +51,7 @@ static InitChainEntry sInitChain[] = { }; void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -59,7 +60,7 @@ void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collisi #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 650cc50723..cb9d19ae4b 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -10,6 +10,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "translation.h" #include "z_lib.h" @@ -68,7 +69,7 @@ static Vec3f sBoxGroundCheckPoints[] = { }; void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -77,7 +78,7 @@ void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collis #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index a95f92eba9..c151023887 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "save.h" @@ -39,9 +40,9 @@ ActorProfile Bg_Spot15_Saku_Profile = { }; void BgSpot15Saku_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot15Saku* this = (BgSpot15Saku*)thisx; - s32 pad2; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d3b44d8aeb..a0178d7ff9 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -11,6 +11,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "translation.h" @@ -168,7 +169,7 @@ void func_808B4C30(BgSpot16Bombstone* this) { } void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->colliderJntSph); Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements); @@ -179,7 +180,7 @@ void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { } void func_808B4D04(BgSpot16Bombstone* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitCylinder(play, &this->colliderCylinder); Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit); @@ -455,7 +456,7 @@ void func_808B5934(BgSpot16Bombstone* this) { } void func_808B5950(BgSpot16Bombstone* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); func_808B56BC(this, play); func_808B57E0(this, play); @@ -561,7 +562,7 @@ void BgSpot16Bombstone_Update(Actor* thisx, PlayState* play) { void BgSpot16Bombstone_Draw(Actor* thisx, PlayState* play) { BgSpot16Bombstone* this = (BgSpot16Bombstone*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot16_bombstone.c", 1253); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index dbeb445596..20bd6b29e6 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -130,7 +131,7 @@ void BgSpot16Doughnut_UpdateExpanding(Actor* thisx, PlayState* play) { void BgSpot16Doughnut_Draw(Actor* thisx, PlayState* play) { BgSpot16Doughnut* this = (BgSpot16Doughnut*)thisx; u32 scroll = play->gameplayFrames & 0xFFFF; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot16_doughnut.c", 210); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h index c453dd1cd0..025d1e8211 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h @@ -9,7 +9,7 @@ struct BgSpot16Doughnut; typedef struct BgSpot16Doughnut { /* 0x0000 */ Actor actor; /* 0x014C */ u16 fireFlag; - /* 0x014E */ char pad[0x02]; + /* 0x014E */ char unk_14E[0x2]; /* 0x0150 */ u8 envColorAlpha; } BgSpot16Doughnut; // size = 0x0154 diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 7c5546156c..18291da22c 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -12,6 +12,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -47,7 +48,7 @@ static InitChainEntry sInitChain[] = { }; void func_808B6BC0(BgSpot17Bakudankabe* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 i; Vec3f burstDepthY; Vec3f burstDepthX; @@ -103,7 +104,7 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, PlayState* play) { void BgSpot17Bakudankabe_Init(Actor* thisx, PlayState* play) { BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index 7d580c9b46..f158f17312 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "play_state.h" @@ -62,7 +63,7 @@ void func_808B746C(Actor* thisx, PlayState* play) { } void func_808B7478(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot17_funen.c", 153); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 5e4c7896f7..e570092e8e 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -6,6 +6,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "terminal.h" #include "translation.h" @@ -144,7 +145,7 @@ static InitChainEntry sInitChain[] = { }; void BgSpot18Basket_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot18Basket* this = (BgSpot18Basket*)thisx; CollisionHeader* colHeader = NULL; @@ -320,7 +321,7 @@ void func_808B7F74(BgSpot18Basket* this) { } void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 tempUnk214; s16 arrayValue; @@ -438,7 +439,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } void BgSpot18Basket_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot18Basket* this = (BgSpot18Basket*)thisx; s32 bgId; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index 9a30eb90df..622742b41f 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -7,6 +7,7 @@ #include "z_bg_spot18_futa.h" #include "ichain.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -40,7 +41,7 @@ static InitChainEntry sInitChain[] = { void BgSpot18Futa_Init(Actor* thisx, PlayState* play) { BgSpot18Futa* this = (BgSpot18Futa*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index e5ebde92cf..fcc2dd522a 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "translation.h" #include "z_lib.h" @@ -140,7 +141,7 @@ s32 func_808B8A5C(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8A98(BgSpot18Obj* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -256,7 +257,7 @@ void func_808B8EE0(BgSpot18Obj* this) { } void func_808B8F08(BgSpot18Obj* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Math_StepToF(&this->dyna.actor.speed, 1.2f, 0.1f); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index b6eacf13f4..7af2bdc08c 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" #include "save.h" @@ -45,7 +46,7 @@ static InitChainEntry sInitChain[] = { }; void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSpot18Shutter* this = (BgSpot18Shutter*)thisx; s32 param = PARAMS_GET_U(this->dyna.actor.params, 8, 1); CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index f2dfdc363f..0efba21298 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -6,11 +6,13 @@ #include "z_bg_sst_floor.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -25,7 +27,7 @@ void BgSstFloor_Destroy(Actor* thisx, PlayState* play); void BgSstFloor_Update(Actor* thisx, PlayState* play); void BgSstFloor_Draw(Actor* thisx, PlayState* play); -static s32 sUnkValues[] = { 0, 0, 0 }; // Unused, probably a zero vector +UNUSED static s32 sUnkValues[] = { 0, 0, 0 }; // Probably a zero vector ActorProfile Bg_Sst_Floor_Profile = { /**/ ACTOR_BG_SST_FLOOR, @@ -44,7 +46,7 @@ static InitChainEntry sInitChain[] = { }; void BgSstFloor_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSstFloor* this = (BgSstFloor*)thisx; CollisionHeader* colHeader = NULL; @@ -55,14 +57,14 @@ void BgSstFloor_Init(Actor* thisx, PlayState* play) { } void BgSstFloor_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSstFloor* this = (BgSstFloor*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } void BgSstFloor_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgSstFloor* this = (BgSstFloor*)thisx; Player* player = GET_PLAYER(play); CollisionHeader* colHeader = SEGMENTED_TO_VIRTUAL(&gBongoDrumCol); diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index f11e24ef52..acc231224e 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "save.h" @@ -136,7 +137,7 @@ void func_808BA274(BgTokiHikari* this, PlayState* play) { void func_808BA2CC(Actor* thisx, PlayState* play) { BgTokiHikari* this = (BgTokiHikari*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_bg_toki_hikari.c", 350); Matrix_Translate(0.0f, 276.0f, 1122.0f, MTXMODE_NEW); diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 144388d38e..1db1143d52 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -12,6 +12,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "cutscene_flags.h" #include "play_state.h" @@ -78,7 +79,7 @@ void BgTokiSwd_SetupAction(BgTokiSwd* this, BgTokiSwdActionFunc actionFunc) { } void BgTokiSwd_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgTokiSwd* this = (BgTokiSwd*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -174,7 +175,7 @@ void BgTokiSwd_Update(Actor* thisx, PlayState* play) { void BgTokiSwd_Draw(Actor* thisx, PlayState* play2) { PlayState* play = play2; BgTokiSwd* this = (BgTokiSwd*)thisx; - s32 pad[3]; + STACK_PADS(s32, 3); OPEN_DISPS(play->state.gfxCtx, "../z_bg_toki_swd.c", 727); diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 5ac35592bd..e1b8249d96 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -5,6 +5,7 @@ */ #include "z_bg_treemouth.h" +#include "attributes.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "libc64/qrand.h" @@ -12,6 +13,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "effect.h" @@ -62,8 +64,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(cullingVolumeDownward, 300, ICHAIN_STOP), }; -// unused -static f32 D_808BD9C4[] = { +UNUSED static f32 D_808BD9C4[] = { -2746.0f, 545.0f, 4694.0f, -2654.0f, 146.0f, 4534.0f, }; @@ -72,7 +73,7 @@ void BgTreemouth_SetupAction(BgTreemouth* this, BgTreemouthActionFunc actionFunc } void BgTreemouth_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgTreemouth* this = (BgTreemouth*)thisx; CollisionHeader* colHeader = NULL; @@ -241,7 +242,7 @@ void BgTreemouth_Update(Actor* thisx, PlayState* play) { } void BgTreemouth_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); u16 alpha = 500; OPEN_DISPS(play->state.gfxCtx, "../z_bg_treemouth.c", 893); diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index ce538ce9b4..19ae238ff8 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -10,6 +10,7 @@ #include "regs.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #include "assets/objects/object_umajump/object_umajump.h" @@ -37,7 +38,7 @@ static InitChainEntry sInitChain[] = { }; void BgUmaJump_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgUmaJump* this = (BgUmaJump*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index a3ef2197eb..000061795f 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -44,7 +45,7 @@ static InitChainEntry sInitChain[] = { }; void BgVbSima_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgVbSima* this = (BgVbSima*)thisx; CollisionHeader* colHeader = NULL; @@ -55,7 +56,7 @@ void BgVbSima_Init(Actor* thisx, PlayState* play) { } void BgVbSima_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgVbSima* this = (BgVbSima*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -81,7 +82,7 @@ void BgVbSima_SpawnEmber(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, void BgVbSima_Update(Actor* thisx, PlayState* play) { static Color_RGBA8 colorYellow = { 255, 255, 0, 255 }; static Color_RGBA8 colorRed = { 255, 10, 0, 255 }; - s32 pad; + STACK_PAD(s32); BgVbSima* this = (BgVbSima*)thisx; BossFd* bossFd = (BossFd*)this->dyna.actor.parent; f32 minus1 = -1.0f; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 1d563eda76..453f5496d0 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -48,7 +49,7 @@ static InitChainEntry sInitChain[] = { }; void BgYdanHasi_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgYdanHasi* this = (BgYdanHasi*)thisx; CollisionHeader* colHeader = NULL; WaterBox* waterBox; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 8d683a9422..84460277bc 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -82,7 +83,7 @@ static InitChainEntry sInitChain[] = { }; void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BgYdanMaruta* this = (BgYdanMaruta*)thisx; Vec3f sp4C[3]; s32 i; diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index f607fb4150..cb7ad4b0de 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -12,6 +12,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -118,7 +119,7 @@ void BgZg_Update(Actor* thisx, PlayState* play) { } void BgZg_Init(Actor* thisx, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); BgZg* this = (BgZg*)thisx; CollisionHeader* colHeader; diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 56db81767b..dd23168436 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -14,6 +14,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "z_lib.h" @@ -142,7 +143,7 @@ void func_808C12C4(u8* arg1, s16 arg2) { } void func_808C1554(u16* arg0, u16* floorTex, s32 arg2, f32 arg3) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 i; s16 i2; u16 sp54[2048]; @@ -555,7 +556,7 @@ void BossDodongo_Damaged(BossDodongo* this, PlayState* play) { void BossDodongo_Explode(BossDodongo* this, PlayState* play) { static Color_RGBA8 dustPrimColor = { 255, 255, 0, 255 }; static Color_RGBA8 dustEnvColor = { 255, 10, 0, 255 }; - s16 pad; + STACK_PAD(s16); Vec3f dustVel; Vec3f dustAcell; Vec3f dustPos; @@ -632,9 +633,9 @@ void BossDodongo_GetUp(BossDodongo* this, PlayState* play) { } void BossDodongo_BlowFire(BossDodongo* this, PlayState* play) { - s32 pad; - Vec3f unusedZeroVec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f unusedZeroVec2 = { 0.0f, 0.0f, 0.0f }; + STACK_PAD(s32); + UNUSED Vec3f zeroVec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec2 = { 0.0f, 0.0f, 0.0f }; SkelAnime_Update(&this->skelAnime); @@ -853,7 +854,7 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) { s16 i; Player* player = GET_PLAYER(play); Player* player2 = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); this->unk_1E2 = 0; this->unk_19E++; @@ -1154,7 +1155,7 @@ void BossDodongo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s void BossDodongo_Draw(Actor* thisx, PlayState* play) { BossDodongo* this = (BossDodongo*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_dodongo.c", 3922); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -1183,7 +1184,7 @@ f32 func_808C4F6C(BossDodongo* this, PlayState* play) { f32 xDiff; f32 zDiff; f32 sp2C; - s32 pad; + STACK_PAD(s32); f32 temp_f2; f32 rotation; Player* player = GET_PLAYER(play); @@ -1206,7 +1207,7 @@ f32 func_808C50A8(BossDodongo* this, PlayState* play) { f32 xDiff; f32 zDiff; f32 sp2C; - s32 pad; + STACK_PAD(s32); f32 temp_f2; f32 rotation; Player* player = GET_PLAYER(play); @@ -1259,7 +1260,7 @@ void BossDodongo_SpawnFire(BossDodongo* this, PlayState* play, s16 params) { } void BossDodongo_UpdateDamage(BossDodongo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ColliderElement* acHitElem; u8 swordDamage; s32 damage; @@ -1589,7 +1590,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { { -890.0f, 0.0f, -3804.0f }, { -1390.0f, 0.0f, -3304.0f } }; Vec3f* sp78; - s32 pad74; + STACK_PAD(s32); if (this->unk_1A2 == 0) { sp78 = &spAC[this->unk_1A0]; @@ -1703,7 +1704,7 @@ void BossDodongo_UpdateEffects(PlayState* play) { } void BossDodongo_DrawEffects(PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 i; u8 materialFlag = 0; BossDodongoEffect* eff; diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c index ce2d694b11..eb702e7852 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c @@ -1,3 +1,4 @@ +#include "attributes.h" #include "collision_check.h" static u8 D_808C7000[] = { @@ -235,4 +236,4 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -static Vec3f sUnkZeroVec = { 0.0f, 0.0f, 0.0f }; +UNUSED static Vec3f sUnkZeroVec = { 0.0f, 0.0f, 0.0f }; diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 5643da5d98..e22e848159 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -23,6 +23,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -194,7 +195,7 @@ void BossFd_UpdateCamera(BossFd* this, PlayState* play) { } void BossFd_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd* this = (BossFd*)thisx; s16 i; @@ -247,7 +248,7 @@ void BossFd_Init(Actor* thisx, PlayState* play) { } void BossFd_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd* this = (BossFd*)thisx; SkelAnime_Free(&this->skelAnimeHead, play); @@ -290,7 +291,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 angleToTarget; f32 pitchToTarget; - Vec3f* holePosition1; + STACK_PAD(s32); f32 temp_y; f32 temp_x; f32 temp_z; @@ -783,7 +784,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { Vec3f sp170; Vec3f sp164 = { 0.0f, 0.03f, 0.0f }; Vec3f sp158; - f32 pad154; + STACK_PAD(s32); s16 temp_rand2; s16 sp150; @@ -1032,9 +1033,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { } else { for (i2 = 0; i2 < 3; i2++) { f32 phi_f20 = 0.0f; - f32 padB4; - f32 padB0; - f32 padAC; + STACK_PADS(s32, 3); Math_ApproachZeroF(&this->rightArmRot[i2].y, 0.1f, 100.0f); Math_ApproachZeroF(&this->leftArmRot[i2].y, 0.1f, 100.0f); @@ -1112,7 +1111,7 @@ void BossFd_Effects(BossFd* this, PlayState* play) { play->envCtx.prevLightSetting = 0; Math_ApproachF(&play->envCtx.lightBlend, 1.0f, 1.0f, 0.05f); } else if (this->fogMode == 2) { - s16 pad; + STACK_PAD(s16); this->fogMode--; play->envCtx.lightSettingOverride = 0; @@ -1122,7 +1121,7 @@ void BossFd_Effects(BossFd* this, PlayState* play) { play->envCtx.lightSetting = 3; play->envCtx.prevLightSetting = 0; } else if (this->fogMode == 10) { - s16 pad; + STACK_PAD(s16); this->fogMode = 1; play->envCtx.lightSettingOverride = 0; @@ -1368,7 +1367,7 @@ void BossFd_Update(Actor* thisx, PlayState* play) { f32 headGlow; f32 rManeGlow; f32 lManeGlow; - s32 pad; + STACK_PAD(s32); Math_ApproachF(&this->fwork[BFD_BODY_TEX2_ALPHA], (this->work[BFD_VAR_TIMER] & 0x10) ? 30.0f : 158.0f, 1.0f, 8.0f); @@ -1661,7 +1660,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) { } void BossFd_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd* this = (BossFd*)thisx; PRINTF("FD DRAW START\n"); @@ -1727,7 +1726,7 @@ s32 BossFd_OverrideLeftArmDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 } static s16 sBodyIndex[] = { 0, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5 }; -static s16 sManeIndex[] = { 0, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10 }; // Unused +UNUSED static s16 sManeIndex[] = { 0, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10 }; void BossFd_DrawMane(PlayState* play, BossFd* this, Vec3f* manePos, Vec3f* maneRot, f32* maneScale, u8 mode) { f32 sp140[] = { 0.0f, 10.0f, 17.0f, 20.0f, 19.5f, 18.0f, 17.0f, 15.0f, 15.0f, 15.0f }; diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index efc154e97f..7c32077667 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -19,6 +19,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -189,7 +190,7 @@ void BossFd2_SpawnDust(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, V } void BossFd2_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd2* this = (BossFd2*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -207,7 +208,7 @@ void BossFd2_Init(Actor* thisx, PlayState* play) { } void BossFd2_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd2* this = (BossFd2*)thisx; SkelAnime_Free(&this->skelAnime, play); @@ -413,7 +414,7 @@ void BossFd2_SetupBreatheFire(BossFd2* this, PlayState* play) { this->work[FD2_ACTION_STATE] = 0; } -static Vec3f sUnkVec = { 0.0f, 0.0f, 50.0f }; // Unused? BossFd uses a similar array for its fire breath sfx. +UNUSED static Vec3f sUnkVec = { 0.0f, 0.0f, 50.0f }; // Unused? BossFd uses a similar array for its fire breath sfx. void BossFd2_BreatheFire(BossFd2* this, PlayState* play) { s16 i; @@ -663,9 +664,7 @@ void BossFd2_Death(BossFd2* this, PlayState* play) { Vec3f sp64; BossFd* bossFd = (BossFd*)this->actor.parent; Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); - f32 pad3; - f32 pad2; - f32 pad1; + STACK_PADS(s32, 3); SkelAnime* skelAnime = &this->skelAnime; SkelAnime_Update(skelAnime); @@ -1175,7 +1174,7 @@ void BossFd2_UpdateMane(BossFd2* this, PlayState* play, Vec3f* head, Vec3f* pos, } void BossFd2_DrawMane(BossFd2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossFd* bossFd = (BossFd*)this->actor.parent; s16 i; @@ -1208,7 +1207,7 @@ void BossFd2_DrawMane(BossFd2* this, PlayState* play) { void BossFd2_Draw(Actor* thisx, PlayState* play) { static void* eyeTextures[] = { gHoleVolvagiaEyeOpenTex, gHoleVolvagiaEyeHalfTex, gHoleVolvagiaEyeClosedTex }; - s32 pad; + STACK_PAD(s32); BossFd2* this = (BossFd2*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_boss_fd2.c", 2617); diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index c9e41de7d7..077726ec18 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -17,6 +17,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "versions.h" @@ -220,7 +221,7 @@ void BossGanonEff_SpawnLightRay(PlayState* play, Vec3f* pos, Vec3f* velocity, Ve for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_NONE) { - s32 pad; + STACK_PAD(s32); eff->type = GDF_EFF_LIGHT_RAY; eff->pos = *pos; @@ -511,7 +512,7 @@ void BossGanon_Destroy(Actor* thisx, PlayState* play) { } void BossGanon_SetupIntroCutscene(BossGanon* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2); if (animObjectSlot < 0) { @@ -566,7 +567,7 @@ void BossGanon_SetIntroCsCamera(BossGanon* this, u8 camPosIndex) { void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { u8 moveCam = false; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); f32 sin; f32 cos; Camera* mainCam; @@ -1200,7 +1201,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { } void BossGanon_SetupDeathCutscene(BossGanon* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2); if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) { @@ -1216,7 +1217,7 @@ void BossGanon_SetupDeathCutscene(BossGanon* this, PlayState* play) { } void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2); if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) { @@ -1254,7 +1255,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { s16 i; u8 moveCam = false; Player* player = GET_PLAYER(play); - s16 pad; + STACK_PAD(s16); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment); @@ -2019,7 +2020,7 @@ void BossGanon_SetupChargeBigMagic(BossGanon* this, PlayState* play) { } void BossGanon_ChargeBigMagic(BossGanon* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 targetPosX; f32 targetPosZ; Vec3f sp80; @@ -2230,7 +2231,7 @@ void BossGanon_SetupWait(BossGanon* this, PlayState* play) { void BossGanon_Wait(BossGanon* this, PlayState* play) { f32 sin; - s32 pad; + STACK_PAD(s32); f32 cos; Player* player = GET_PLAYER(play); @@ -3807,7 +3808,7 @@ void BossGanon_DrawShadowTexture(void* tex, BossGanon* this, PlayState* play) { } void BossGanon_Draw(Actor* thisx, PlayState* play) { - s32 i; + STACK_PAD(s32); BossGanon* this = (BossGanon*)thisx; void* shadowTex; @@ -3868,7 +3869,7 @@ s32 BossGanon_CheckFallingPlatforms(BossGanon* this, PlayState* play, Vec3f* che f32 zDiff = platform->dyna.actor.world.pos.z - checkPos->z; if ((fabsf(xDiff) < 60.0f) && (yDiff < 20.0f) && (yDiff > -20.0f) && (fabsf(zDiff) < 60.0f)) { - s32 pad; + STACK_PAD(s32); platform->isFalling = true; platform->visibleSides = OTYUKA_SIDE_ALL; @@ -3900,9 +3901,9 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { f32 yDistFromGanondorf; f32 zDistFromGanondorf; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); BossGanon* ganondorf = (BossGanon*)this->actor.parent; - s32 pad1; + STACK_PAD(s32); this->unk_1A2++; ganondorf->envLightMode = 1; @@ -4155,7 +4156,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, PlayState* play) { BossGanon* this = (BossGanon*)thisx; s16 i; f32 alpha; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon.c", 9849); @@ -4335,7 +4336,7 @@ void func_808E2544(Actor* thisx, PlayState* play) { s16 sp80; BossGanon* this = (BossGanon*)thisx; BossGanon* dorf = (BossGanon*)this->actor.parent; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); this->unk_1A2++; @@ -4619,7 +4620,7 @@ void BossGanon_UpdateEffects(PlayState* play) { Player* player = GET_PLAYER(play); GanondorfEffect* eff = play->specialEffects; s16 i; - s32 pad; + STACK_PAD(s32); f32 xDiff; f32 yDiff; f32 zDiff; @@ -4628,8 +4629,7 @@ void BossGanon_UpdateEffects(PlayState* play) { Vec3f spA0; s16 bodyPart; f32 distToPlayer; - s32 pad2; - s32 pad3; + STACK_PADS(s32, 2); spA0.x = 0.0f; spA0.y = 0.0f; @@ -4707,7 +4707,7 @@ void BossGanon_UpdateEffects(PlayState* play) { Math_ApproachF(&eff->unk_38, eff->unk_40, 1.0f, (eff->unk_40 / 15.0f) * 4.0f); } else if (eff->type == GDF_EFF_SHOCK) { - s32 pad4; + STACK_PAD(s32); if (eff->unk_2E == GDF_SHOCK_DORF_YELLOW) { bodyPart = (s16)Rand_ZeroFloat(13.9f) + 1; @@ -4840,7 +4840,7 @@ static s32 sUnknown[3] = { 0 }; void BossGanon_DrawEffects(PlayState* play) { u8 materialFlag = 0; s16 i; - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx = play->state.gfxCtx; GanondorfEffect* eff = play->specialEffects; GanondorfEffect* effFirst = eff; diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index cafa822410..f82230a7cb 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -15,6 +15,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "tex_len.h" @@ -392,7 +393,7 @@ void func_808FD080(s32 idx, ColliderJntSph* collider, Vec3f* arg2) { } void BossGanon2_SetObjectSegment(BossGanon2* this, PlayState* play, s32 objectId, u8 setRSPSegment) { - s32 pad; + STACK_PAD(s32); s32 objectSlot = Object_GetSlot(&play->objectCtx, objectId); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); @@ -445,7 +446,7 @@ void func_808FD27C(PlayState* play, Vec3f* position, Vec3f* velocity, f32 scale) void BossGanon2_Init(Actor* thisx, PlayState* play) { BossGanon2* this = (BossGanon2*)thisx; - s32 pad; + STACK_PAD(s32); s16 i; play->specialEffects = sEffects; @@ -495,12 +496,12 @@ void func_808FD5C4(BossGanon2* this, PlayState* play) { } void func_808FD5F4(BossGanon2* this, PlayState* play) { - s16 pad; + STACK_PAD(s16); u8 sp8D; Player* player; s32 objectSlot; s32 zero = 0; - s32 pad2; + STACK_PAD(s32); sp8D = false; player = GET_PLAYER(play); @@ -1230,7 +1231,7 @@ void func_808FF898(BossGanon2* this, PlayState* play) { if (SQ(this->unk_218.x - gj->dyna.actor.world.pos.x) + SQ(this->unk_218.z - gj->dyna.actor.world.pos.z) < SQ(100.0f)) { - s32 pad; + STACK_PAD(s32); Vec3f sp28; Matrix_RotateY(BINANG_TO_RAD_ALT(this->actor.shape.rot.y) + 0.5f, MTXMODE_NEW); @@ -1354,7 +1355,7 @@ void func_808FFCFC(BossGanon2* this, PlayState* play) { } void func_808FFDB0(BossGanon2* this, PlayState* play) { - s32 sp28; + STACK_PAD(s32); s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON2); if (Object_IsLoaded(&play->objectCtx, objectSlot)) { @@ -1653,7 +1654,7 @@ void func_80900890(BossGanon2* this, PlayState* play) { Message_StartTextbox(play, 0x70D7, NULL); } if ((this->unk_1A2[1] < 30) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { - s32 pad; + STACK_PAD(s32); mainCam2 = Play_GetCamera(play, CAM_ID_MAIN); mainCam2->eye = this->subCamEye; @@ -2011,7 +2012,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { this->subCamAt.y = 1117.0f; this->subCamAt.z = -11.0f; } else { - f32 phi_f0; + STACK_PAD(s32); s32 phi_a1; if (this->unk_398 < 30) { @@ -2201,7 +2202,7 @@ void func_80902348(BossGanon2* this, PlayState* play) { } if (this->unk_324 > 0.0f) { - s16 pad; + STACK_PAD(s16); player = GET_PLAYER(play); temp_f2 = -200.0f - player->actor.world.pos.x; @@ -2308,7 +2309,7 @@ static s16 D_80907074[] = { 0, 1, 2, 2, 1, 0 }; void BossGanon2_Update(Actor* thisx, PlayState* play) { BossGanon2* this = (BossGanon2*)thisx; - s32 pad; + STACK_PAD(s32); s16 i; if ((this->unk_337 == 0) || (this->unk_337 == 2)) { @@ -2568,7 +2569,7 @@ void func_809034E4(Vec3f* arg0, Vec3f* arg1) { f32 phi_f30; f32 temp_f28; f32 temp_f26; - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f sp18C[20]; Vec3f sp9C[20]; @@ -2864,7 +2865,7 @@ void func_8090464C(BossGanon2* this, PlayState* play) { } s32 BossGanon2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { - s32 pad; + STACK_PAD(s32); BossGanon2* this = (BossGanon2*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5355); @@ -2914,7 +2915,7 @@ static Vec3f D_8090712C = { 0.0f, 0.0f, 3000.0f }; static Vec3f D_80907138 = { 0.0f, 0.0f, 0.0f }; void BossGanon2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - s8 pad; + STACK_PAD(u8); s8 temp_v0; BossGanon2* this = (BossGanon2*)thisx; Vec3f sp4C; @@ -3184,7 +3185,7 @@ void BossGanon2_Draw(Actor* thisx, PlayState* play) { if ((this->unk_312 != 0) || (D_80907080 != 0)) { func_80903F38(this, play); if (this->unk_312 == 0) { - s32 pad; + STACK_PAD(s32); D_80907080 -= 40; if (D_80907080 <= 0) { @@ -3208,7 +3209,7 @@ void BossGanon2_Draw(Actor* thisx, PlayState* play) { } void BossGanon2_UpdateEffects(BossGanon2* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Player* player = GET_PLAYER(play); BossGanon2Effect* effect = play->specialEffects; s16 i; @@ -3225,7 +3226,7 @@ void BossGanon2_UpdateEffects(BossGanon2* this, PlayState* play) { effect->velocity.y += effect->accel.y; effect->velocity.z += effect->accel.z; if (effect->type == 1) { - s32 pad2; + STACK_PAD(s32); if (effect->unk_2E == 0) { effect->unk_38.z += 1.0f; @@ -3290,7 +3291,7 @@ void BossGanon2_DrawEffects(PlayState* play) { Vec3f spA0; f32 temp_f0; f32 angle; - s32 pad; + STACK_PAD(s32); Gfx_SetupDL_25Xlu(play->state.gfxCtx); spA0.x = play->envCtx.dirLight1.params.dir.x; @@ -3472,7 +3473,7 @@ void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlaySta } // padding -static u32 D_809071FC[2] = { 0 }; +UNUSED static u32 D_809071FC[2] = { 0 }; #define gGanonLightOrbTex_WIDTH 64 #define gGanonLightOrbTex_HEIGHT 64 diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 09f84081de..62abb4cfcd 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -24,6 +24,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -297,7 +298,7 @@ void BossGanondrof_SetColliderPos(Vec3f* pos, ColliderCylinder* collider) { } void BossGanondrof_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossGanondrof* this = (BossGanondrof*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -333,7 +334,7 @@ void BossGanondrof_Init(Actor* thisx, PlayState* play) { } void BossGanondrof_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossGanondrof* this = (BossGanondrof*)thisx; PRINTF("DT1\n"); @@ -355,7 +356,7 @@ void BossGanondrof_SetupIntro(BossGanondrof* this, PlayState* play) { void BossGanondrof_Intro(BossGanondrof* this, PlayState* play) { s16 i; - s32 pad; + STACK_PAD(s32); EnfHG* horse = (EnfHG*)this->actor.child; SkelAnime_Update(&this->skelAnime); @@ -964,7 +965,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { u8 bodyDecayLevel = 0; f32 camX; f32 camZ; - f32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); @@ -1313,9 +1314,9 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) { f32 legRotTargetY; f32 legRotTargetZ; f32 legSplitTarget; - s32 pad2; + STACK_PAD(s32); s16 i; - s32 pad; + STACK_PAD(s32); EnfHG* horse; BossGanondrof* this = (BossGanondrof*)thisx; @@ -1507,7 +1508,7 @@ Gfx* BossGanondrof_EmptyDList(GraphicsContext* gfxCtx) { } void BossGanondrof_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossGanondrof* this = (BossGanondrof*)thisx; EnfHG* horse; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 0d83b2b4a3..c9bcd1a6f7 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -23,6 +23,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -370,7 +371,7 @@ static InitChainEntry sInitChain[] = { }; void BossGoma_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossGoma* this = (BossGoma*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -704,7 +705,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { Camera* mainCam; Player* player = GET_PLAYER(play); f32 s; - s32 pad; + STACK_PAD(s32); Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f); @@ -1929,7 +1930,7 @@ void BossGoma_UpdateEyeEnvColor(BossGoma* this) { void BossGoma_Update(Actor* thisx, PlayState* play) { BossGoma* this = (BossGoma*)thisx; - s32 pad; + STACK_PAD(s32); this->visualState = VISUALSTATE_DEFAULT; this->frameCount++; @@ -2078,7 +2079,7 @@ void BossGoma_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r Vec3f childPos; Vec3s childRot; BossGoma* this = (BossGoma*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); MtxF mtx; if (limbIndex == BOSSGOMA_LIMB_TAIL4) { // tail end/last part diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 4a1b0acbba..a5da377b26 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -24,6 +24,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -423,7 +424,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) { } void BossMo_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossMo* this = (BossMo*)thisx; if (this->actor.params >= BOSSMO_TENTACLE) { @@ -580,7 +581,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { Vec3f ripplePos; f32 randAngle; f32 randFloat; - s32 pad; + STACK_PAD(s32); if (this->timers[0] > 50) { rippleCount = 1; @@ -894,9 +895,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { if (this->meltIndex < 41) { Vec3f sp120; s16 indS0; - s32 pad118; - s32 pad114; - s32 pad110; + STACK_PADS(s32, 3); for (indS0 = 0; indS0 < 10; indS0++) { sp120 = this->tentPos[this->meltIndex]; @@ -1100,12 +1099,12 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { Math_ApproachF(&this->tentSpeed, 0.1f, 1.0f, 0.005f); this->actor.velocity.y = 0.0; } else { - f32 padEC; + f32 spEC; this->fwork[MO_TENT_MAX_STRETCH] = 0.2f; this->fwork[MO_TENT_MAX_STRETCH] += Math_SinS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.05f; - padEC = Math_CosS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.0005f; - Math_ApproachF(&this->actor.scale.x, 0.002f + padEC, 0.5f, 0.0005f); + spEC = Math_CosS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.0005f; + Math_ApproachF(&this->actor.scale.x, 0.002f + spEC, 0.5f, 0.0005f); this->actor.world.pos.y += this->actor.velocity.y; this->actor.velocity.y -= 1.0f; if (this->actor.world.pos.y < -250.0f) { @@ -1233,7 +1232,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { f32 dz; f32 tempX; f32 tempY; - s32 pad84; + STACK_PAD(s32); f32 sp80; f32 sp7C; f32 sp78; @@ -1242,9 +1241,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { Vec3f bubblePos; Vec3f bubblePos2; Camera* mainCam2; - f32 pad50; - f32 pad4C; - f32 pad48; + STACK_PADS(s32, 3); if (this->csState < MO_INTRO_REVEAL) { this->subCamFov = 80.0f; @@ -1882,19 +1879,18 @@ void BossMo_Core(BossMo* this, PlayState* play) { f32 spD4; f32 spD0; f32 spCC; - s32 padC8; + STACK_PAD(s32); s32 temp; // not on stack f32 xScaleTarget; // not on stack f32 yScaleTarget; Vec3f effectPos; Vec3f effectVelocity; Vec3f effectAccel; - s32 pad94; - s32 pad90; + STACK_PADS(s32, 2); s16 j; s16 index; // not on stack f32 sp88; - s32 pad84; + STACK_PAD(s32); this->waterTex1x += -1.0f; this->waterTex1y += -1.0f; @@ -2247,7 +2243,7 @@ void BossMo_Core(BossMo* this, PlayState* play) { } void BossMo_UpdateCore(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossMo* this = (BossMo*)thisx; s16 i; Player* player = GET_PLAYER(play); @@ -2297,7 +2293,7 @@ void BossMo_UpdateCore(Actor* thisx, PlayState* play) { void BossMo_UpdateTent(Actor* thisx, PlayState* play) { s16 i; s16 index; - s32 pad; + STACK_PAD(s32); BossMo* this = (BossMo*)thisx; Player* player = GET_PLAYER(play); f32 phi_f0; @@ -2390,7 +2386,7 @@ void BossMo_UpdateTent(Actor* thisx, PlayState* play) { Vec3f sp7C; Vec3f bubblePos; Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); this->baseBubblesTimer--; sp88.x = 0.0; @@ -2501,8 +2497,7 @@ void BossMo_DrawTentacle(BossMo* this, PlayState* play) { BossMo_InitRand(1, 29100, 9786); for (i = 0; i < 41; i++, matrix++) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); if (i < 2) { Matrix_Push(); @@ -2604,7 +2599,7 @@ void BossMo_DrawTentacle(BossMo* this, PlayState* play) { } void BossMo_DrawWater(BossMo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 6582); if (1) {} @@ -2633,7 +2628,7 @@ void BossMo_DrawWater(BossMo* this, PlayState* play) { } void BossMo_DrawCore(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossMo* this = (BossMo*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 6688); @@ -2759,7 +2754,7 @@ void BossMo_DrawCore(Actor* thisx, PlayState* play) { } void BossMo_DrawTent(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossMo* this = (BossMo*)thisx; u16 texCoordScale; @@ -2940,7 +2935,7 @@ void BossMo_UpdateEffects(BossMo* this, PlayState* play) { void BossMo_DrawEffects(BossMoEffect* effect, PlayState* play) { u8 materialFlag = 0; s16 i; - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx = play->state.gfxCtx; BossMoEffect* effectHead = effect; diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index e0c2239361..3858cec5de 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -5,6 +5,7 @@ */ #include "z_boss_sst.h" +#include "attributes.h" #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" @@ -18,6 +19,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "versions.h" @@ -254,8 +256,8 @@ static Vec3f sSubCamEyePoints[] = { static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; static u32 sBodyStatic = false; -// Unreferenced. Maybe two zero vectors? -static u32 sUnkValues[] = { 0, 0, 0, 0, 0, 0 }; +// Maybe two zero vectors? +UNUSED static u32 sUnkValues[] = { 0, 0, 0, 0, 0, 0 }; static Color_RGBA8 sBodyColor = { 255, 255, 255, 255 }; static Color_RGBA8 sStaticColor = { 0, 0, 0, 255 }; @@ -360,7 +362,7 @@ void BossSst_Init(Actor* thisx, PlayState* play2) { } void BossSst_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossSst* this = (BossSst*)thisx; Collider_DestroyJntSph(play, &this->colliderJntSph); @@ -1202,7 +1204,7 @@ void BossSst_HeadSetupFinish(BossSst* this) { void BossSst_HeadFinish(BossSst* this, PlayState* play) { static Color_RGBA8 colorIndigo = { 80, 80, 150, 255 }; static Color_RGBA8 colorDarkIndigo = { 40, 40, 80, 255 }; - static Color_RGBA8 colorUnused[2] = { + UNUSED static Color_RGBA8 colorUnused[2] = { { 0, 0, 0, 255 }, { 100, 100, 100, 0 }, }; @@ -2610,7 +2612,7 @@ void BossSst_HeadCollisionCheck(BossSst* this, PlayState* play) { } void BossSst_UpdateHand(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossSst* this = (BossSst*)thisx; BossSstHandTrail* trail; @@ -2780,7 +2782,7 @@ void BossSst_DrawHand(Actor* thisx, PlayState* play) { s32 i; s32 idx; s32 end; - s32 pad; + STACK_PAD(s32); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -2892,7 +2894,7 @@ void BossSst_PostHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro } void BossSst_DrawHead(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); BossSst* this = (BossSst*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_boss_sst.c", 6810); @@ -2971,7 +2973,7 @@ void BossSst_SpawnHeadShadow(BossSst* this) { { -160.0f, 0.0f, 250.0f }, { 160.0f, 0.0f, 250.0f }, }; - s32 pad; + STACK_PAD(s32); s32 i; f32 sn; f32 cs; diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 79eb682a76..5eab149270 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -16,6 +16,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -2337,7 +2338,7 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) { f32 xDiff; f32 yDiff; f32 zDiff; - s32 pad; + STACK_PAD(s32); s16 i; s16 yaw; @@ -2411,9 +2412,7 @@ void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) { } void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) { - s32 pad; - s32 pad2; - s32 pad3; + STACK_PADS(s32, 3); s16 msgId2; s16 msgId1; u8 kotakeAnim; @@ -2874,7 +2873,7 @@ void BossTw_Update(Actor* thisx, PlayState* play) { BossTw* this = (BossTw*)thisx; Player* player = GET_PLAYER(play); s16 i; - s32 pad; + STACK_PAD(s32); this->collider.base.colMaterial = COL_MATERIAL_HIT3; Math_ApproachF(&this->fogR, play->lightCtx.fogColor[0], 1.0f, 10.0f); @@ -3288,7 +3287,7 @@ void BossTw_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot } void func_80941BC0(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6341); @@ -3326,7 +3325,7 @@ void func_80941BC0(BossTw* this, PlayState* play) { } void func_80942180(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6468); @@ -3371,7 +3370,7 @@ void func_80942180(BossTw* this, PlayState* play) { } void func_809426F0(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 i; OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6587); @@ -3691,7 +3690,7 @@ void BossTw_TwinrovaPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve } void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s16 temp_t0; s16 temp_a0; @@ -3792,7 +3791,7 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) { } void BossTw_SpawnPortalDraw(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7546); @@ -3833,7 +3832,7 @@ void BossTw_SpawnPortalDraw(BossTw* this, PlayState* play) { } void func_80944C50(BossTw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 scale; OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7645); @@ -4237,7 +4236,7 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) { case TW_ICE_BLAST_GROUND: if (this->timers[0] != 0) { - s32 pad; + STACK_PAD(s32); if (this->timers[0] == 1) { sEnvType = 0; @@ -4899,7 +4898,7 @@ void BossTw_DrawEffects(PlayState* play) { u8 materialFlag = 0; s16 i; s16 j; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s16 phi_s4; BossTwEffect* currentEffect; @@ -5388,7 +5387,7 @@ void BossTw_TwinrovaFly(BossTw* this, PlayState* play) { f32 xDiff; f32 yDiff; f32 zDiff; - s32 pad; + STACK_PAD(s32); f32 yaw; f32 xzDist; diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 7cbbff4c3e..89791c2588 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -18,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" @@ -1255,7 +1256,7 @@ void BossVa_SetupBodyPhase3(BossVa* this) { } void BossVa_BodyPhase3(BossVa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 i; s16 sp62; @@ -1948,7 +1949,7 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) { s16 sp8E; u32 sp88; Vec3f sp7C; - s32 pad3; + STACK_PAD(s32); boomerang = BossVa_FindBoomerang(play); @@ -2181,8 +2182,7 @@ void BossVa_SetupZapperDeath(BossVa* this, PlayState* play) { void BossVa_ZapperDeath(BossVa* this, PlayState* play) { f32 sp3C = 55.0f; - f32 tmpf1; - f32 tmpf2; + STACK_PAD(s32); BossVa_AttachToBody(this); if (((play->gameplayFrames % 32) == 0) && (sCsState <= DEATH_BODY_TUMORS)) { @@ -2269,7 +2269,7 @@ void BossVa_SetupZapperEnraged(BossVa* this, PlayState* play) { void BossVa_ZapperEnraged(BossVa* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 tmp16; s16 sp6C; s16 sp6A; @@ -2561,7 +2561,7 @@ void BossVa_BariPhase3Attack(BossVa* this, PlayState* play) { EnBoom* boomerang; Vec3f sp54 = GET_BODY(this)->unk_1D8; s16 sp52; - s32 pad; + STACK_PAD(s32); this->unk_1A4 += Rand_ZeroOne() * 0.5f; sp52 = this->timer2 & 0x1FF; @@ -2651,7 +2651,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { s16 sp52; s16 sp50; f32 sp4C; - s32 pad; + STACK_PAD(s32); this->unk_1A4 += Rand_ZeroOne() * 0.5f; sp52 = this->timer2 & 0x1FF; @@ -2762,7 +2762,7 @@ void BossVa_SetupBariPhase3Stunned(BossVa* this, PlayState* play) { } void BossVa_BariPhase3Stunned(BossVa* this, PlayState* play) { - s32 sp44_pad; + STACK_PAD(s32); Vec3f sp40 = GET_BODY(this)->unk_1D8; this->actor.world.rot.x = Math_Vec3f_Pitch(&GET_BODY(this)->actor.world.pos, &this->actor.world.pos); @@ -2885,7 +2885,7 @@ void BossVa_Update(Actor* thisx, PlayState* play2) { s32 BossVa_BodyOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { BossVa* this = (BossVa*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4156); @@ -2914,7 +2914,7 @@ s32 BossVa_BodyOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec void BossVa_BodyPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { BossVa* this = (BossVa*)thisx; Vec3f sp78 = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4192); @@ -2990,7 +2990,7 @@ s32 BossVa_SupportOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, void BossVa_SupportPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { BossVa* this = (BossVa*)thisx; Vec3f sp20 = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); if (this->onCeiling) { switch (limbIndex) { @@ -3161,7 +3161,7 @@ s32 BossVa_BariOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec } void BossVa_BariPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - BossVa* this = (BossVa*)thisx; + UNUSED BossVa* this = (BossVa*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4494); @@ -3189,7 +3189,7 @@ void BossVa_Draw(Actor* thisx, PlayState* play) { Vec3f sp8C = { -15.0f, 40.0f, 0.0f }; Vec3f sp80 = { 15.0f, 40.0f, 0.0f }; Vec3f sp74 = { -15.0f, 40.0f, 0.0f }; - Color_RGBA8 unused = { 250, 250, 230, 200 }; + UNUSED Color_RGBA8 unused = { 250, 250, 230, 200 }; OPEN_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4542); @@ -3299,7 +3299,7 @@ void BossVa_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4673); } -static s32 sUnkValue = 0x009B0000; // Unreferenced? Possibly a color +UNUSED static s32 sUnkValue = 0x009B0000; // Possibly a color void BossVa_UpdateEffects(PlayState* play) { BossVaEffect* effect = sEffects; @@ -3950,7 +3950,7 @@ void BossVa_SpawnGore(PlayState* play, BossVaEffect* effect, Vec3f* pos, s16 yaw void BossVa_SpawnZapperCharge(PlayState* play, BossVaEffect* effect, BossVa* this, Vec3f* pos, Vec3s* rot, s16 scale, u8 mode) { - Vec3f unused = { 0.0f, -1000.0f, 0.0f }; + UNUSED Vec3f unused = { 0.0f, -1000.0f, 0.0f }; s16 i; for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) { diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 076c395093..2b71cc14c2 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -14,6 +14,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "z_lib.h" @@ -83,7 +84,7 @@ void Demo6K_SetupAction(Demo6K* this, Demo6KActionFunc actionFunc) { void Demo6K_Init(Actor* thisx, PlayState* play) { Demo6K* this = (Demo6K*)thisx; - s32 pad; + STACK_PAD(s32); s32 params = this->actor.params; s32 objectSlot; s32 i; @@ -574,7 +575,7 @@ void Demo6K_Update(Actor* thisx, PlayState* play) { void func_80967FFC(Actor* thisx, PlayState* play) { Demo6K* this = (Demo6K*)thisx; - s32 pad; + STACK_PAD(s32); u16 timer1 = this->timer1; OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1070); @@ -611,7 +612,7 @@ void func_80967FFC(Actor* thisx, PlayState* play) { void func_80968298(Actor* thisx, PlayState* play) { static u8 skipIndices[] = { 6, 7, 11, 16, 20, 24, 28, 33, 35, 41, 45, 50, 57, 58, 62, 255 }; Demo6K* this = (Demo6K*)thisx; - s32 pad; + STACK_PAD(s32); u32 timer1 = this->timer1; f32 scale = this->unk_164 * this->unk_168; Vtx* vertices = SEGMENTED_TO_VIRTUAL(object_demo_6kVtx_0035E0); @@ -659,7 +660,7 @@ void func_80968298(Actor* thisx, PlayState* play) { void func_8096865C(Actor* thisx, PlayState* play) { Demo6K* this = (Demo6K*)thisx; - s32 pad; + STACK_PAD(s32); Gfx* displayList; OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1208); @@ -725,7 +726,7 @@ void func_809688C4(Actor* thisx, PlayState* play2) { } void func_80968B70(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); Demo6K* this = (Demo6K*)thisx; u32 timer2 = this->timer2; u8 primColor[4]; @@ -776,7 +777,7 @@ void func_80968FB0(Actor* thisx, PlayState* play) { Gfx* displayList = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Gfx)); u16 frames = play->gameplayFrames; f32 scaleFactor; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1386); diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 4bd2cf54e3..23e7b32ade 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -1,4 +1,5 @@ #include "z_demo_du.h" +#include "attributes.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" @@ -9,6 +10,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -29,7 +31,7 @@ void DemoDu_Destroy(Actor* thisx, PlayState* play); void DemoDu_Update(Actor* thisx, PlayState* play); void DemoDu_Draw(Actor* thisx, PlayState* play); -static s32 sUnused = 0; +UNUSED static s32 sUnused = 0; #include "z_demo_du_cutscene_data.inc.c" @@ -62,7 +64,7 @@ void DemoDu_Destroy(Actor* thisx, PlayState* play) { void DemoDu_UpdateEyes(DemoDu* this) { s16* blinkTimer = &this->blinkTimer; s16* eyeTexIndex = &this->eyeTexIndex; - s32 pad[3]; + STACK_PADS(s32, 3); if (DECR(*blinkTimer) == 0) { *blinkTimer = Rand_S16Offset(60, 60); @@ -147,7 +149,7 @@ s32 DemoDu_CheckForNoCue(DemoDu* this, PlayState* play, u16 cueId, s32 cueChanne void DemoDu_SetStartPosRotFromCue(DemoDu* this, PlayState* play, s32 cueChannel) { CsCmdActorCue* cue = DemoDu_GetCue(play, cueChannel); - s32 pad; + STACK_PAD(s32); if (cue != NULL) { this->actor.world.pos.x = cue->startPos.x; @@ -210,7 +212,7 @@ void func_80969FB4(DemoDu* this, PlayState* play) { // Gives the Fire Medallion to Link too. void DemoDu_CsFireMedallion_AdvanceTo01(DemoDu* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if ((gSaveContext.chamberCutsceneNum == CHAMBER_CS_FIRE) && !IS_CUTSCENE_LAYER) { Player* player = GET_PLAYER(play); @@ -335,7 +337,7 @@ void DemoDu_CsPlaySfx_DaruniaFalling(PlayState* play) { // Cutscene: Darunia gives Link the Goron's Ruby. void DemoDu_CsPlaySfx_DaruniaHitsLink(PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_LINK); Audio_PlaySfxGeneral(NA_SE_VO_LI_DAMAGE_S_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, @@ -394,7 +396,7 @@ void DemoDu_CsGoronsRuby_UpdateFaceTextures(DemoDu* this, PlayState* play) { } void func_8096A630(DemoDu* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f pos = this->actor.world.pos; pos.y += kREG(5); @@ -410,13 +412,13 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, PlayState* play) }; if (Animation_OnFrame(&this->skelAnime, 31.0f) || Animation_OnFrame(&this->skelAnime, 41.0f)) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 i; Player* player = GET_PLAYER(play); Vec3f* pos = &player->bodyPartsPos[PLAYER_BODYPART_L_FOREARM]; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.3f, 0.0f }; - s32 pad2; + STACK_PAD(s32); for (i = 4; i >= 0; --i) { Color_RGBA8 primColor = { 190, 150, 110, 255 }; @@ -452,7 +454,7 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, PlayState* play) } void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CutsceneContext* csCtx = &play->csCtx; if (csCtx->state != CS_STATE_IDLE) { @@ -717,7 +719,7 @@ void DemoDu_UpdateCs_GR_13(DemoDu* this, PlayState* play) { } void DemoDu_InitCs_AfterGanon(DemoDu* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 lastFrame = Animation_GetLastFrame(&gDaruniaSageFormationAnim); SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0); @@ -823,7 +825,7 @@ void DemoDu_Draw_02(Actor* thisx, PlayState* play2) { DemoDu* this = (DemoDu*)thisx; s16 eyeTexIndex = this->eyeTexIndex; void* eyeTexture = sEyeTextures[eyeTexIndex]; - s32 pad; + STACK_PAD(s32); s16 mouthTexIndex = this->mouthTexIndex; void* mouthTexture = sMouthTextures[mouthTexIndex]; SkelAnime* skelAnime = &this->skelAnime; @@ -1018,7 +1020,7 @@ void DemoDu_Draw_01(Actor* thisx, PlayState* play2) { DemoDu* this = (DemoDu*)thisx; s16 eyeTexIndex = this->eyeTexIndex; void* eyeTexture = sEyeTextures[eyeTexIndex]; - s32 pad; + STACK_PAD(s32); s16 mouthTexIndex = this->mouthTexIndex; void* mouthTexture = sMouthTextures[mouthTexIndex]; SkelAnime* skelAnime = &this->skelAnime; diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 817234eea7..1883de8710 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -7,10 +7,12 @@ #include "z_demo_ec.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -205,7 +207,7 @@ void func_8096D64C(DemoEc* this, PlayState* play) { } void DemoEc_UpdateEyes(DemoEc* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyeTexIndex = &this->eyeTexIndex; @@ -265,7 +267,7 @@ void DemoEc_DrawSkeleton(DemoEc* this, PlayState* play, void* eyeTexture, void* PostLimbDraw postLimbDraw) { GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_demo_ec.c", 565); @@ -289,7 +291,7 @@ void DemoEc_DrawSkeleton(DemoEc* this, PlayState* play, void* eyeTexture, void* void DemoEc_DrawSkeletonCustomColor(DemoEc* this, PlayState* play, Gfx* arg2, Gfx* arg3, u8* color1, u8* color2, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw) { - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; @@ -325,7 +327,7 @@ void DemoEc_DrawSkeletonCustomColor(DemoEc* this, PlayState* play, Gfx* arg2, Gf } void DemoEc_UseDrawObject(DemoEc* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 drawObjectSlot = this->drawObjectSlot; GraphicsContext* gfxCtx = play->state.gfxCtx; @@ -1095,7 +1097,7 @@ void DemoEc_UpdateFishingOwner(DemoEc* this, PlayState* play) { } void DemoEc_FishingOwnerPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { - DemoEc* this = (DemoEc*)thisx; + UNUSED DemoEc* this = (DemoEc*)thisx; if ((limbIndex == 8) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_STOLE_HAT)) { gSPDisplayList((*gfx)++, SEGMENTED_TO_VIRTUAL(gFishingOwnerHatDL)); @@ -1142,7 +1144,7 @@ void DemoEc_DrawBombchuShopOwner(DemoEc* this, PlayState* play) { } void DemoEc_InitGorons(DemoEc* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); AnimationHeader* animation; f32 goronScale; Vec3f* scale = &this->actor.scale; @@ -1271,10 +1273,10 @@ void DemoEc_InitNpc(DemoEc* this, PlayState* play) { } void DemoEc_InitCommon(DemoEc* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 primary; s32 type; - s16 pad2; + STACK_PAD(s16); s16 sp28; s32 primaryObjectSlot; s32 secondaryObjectSlot; diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index b0594e2e53..e5aca69bee 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -10,6 +10,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -1048,7 +1049,7 @@ void DemoEffect_UpdateBlueOrbGrow(DemoEffect* this, PlayState* play) { * This function updates the position and scale of the actor based on the current cutscene command. */ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { - u16 pad; + STACK_PAD(s32); s32 isLargeSize; isLargeSize = PARAMS_GET_S(this->actor.params, 8, 4); @@ -1407,8 +1408,7 @@ void DemoEffect_MoveJewelSplit(PosRot* world, DemoEffect* this) { */ void DemoEffect_MoveJewelSpherical(f32 degrees, f32 frameDivisor, Vec3f startPos, Vec3f endPos, f32 radius, Vec3s rotation, DemoEffect* this) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); f32 distance; f32 xPos; f32 ySpherical; @@ -1759,7 +1759,7 @@ void DemoEffect_DrawCrystalLight(Actor* thisx, PlayState* play) { } void DemoEffect_DrawFireBall(Actor* thisx, PlayState* play) { - DemoEffect* this = (DemoEffect*)thisx; + UNUSED DemoEffect* this = (DemoEffect*)thisx; u32 frames = play->gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2701); @@ -1780,7 +1780,7 @@ void DemoEffect_DrawFireBall(Actor* thisx, PlayState* play) { */ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 pad; + STACK_PAD(s32); u32 frames = play->gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2737); @@ -1835,7 +1835,7 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; uintptr_t flashDList = (uintptr_t)gEffFlash1DL; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2842); @@ -1870,7 +1870,7 @@ void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) { void DemoEffect_DrawBlueOrb(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2892); gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 188, 255, 255, this->blueOrb.alpha); @@ -1886,7 +1886,7 @@ void DemoEffect_DrawBlueOrb(Actor* thisx, PlayState* play) { void DemoEffect_DrawLgtShower(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 pad; + STACK_PAD(s32); u32 frames = play->gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2921); @@ -1922,7 +1922,7 @@ void DemoEffect_DrawLightRing(Actor* thisx, PlayState* play2) { void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 pad; + STACK_PAD(s32); Vtx* vertices = SEGMENTED_TO_VIRTUAL(gTriforceVtx); u32 frames = play->gameplayFrames; @@ -1995,7 +1995,7 @@ void DemoEffect_DrawGetItem(Actor* thisx, PlayState* play) { } s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s32 limbIndex, void* thisx) { - s32 pad; + STACK_PAD(s32); DemoEffect* this = (DemoEffect*)thisx; u32 frames = play->gameplayFrames; @@ -2038,7 +2038,7 @@ void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) { } void DemoEffect_FaceTowardPoint(DemoEffect* this, Vec3f startPos, Vec3f endPos) { - s32 pad; + STACK_PAD(s32); f32 x = endPos.x - startPos.x; f32 z = endPos.z - startPos.z; f32 xzDistance = sqrtf(SQ(x) + SQ(z)); diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index fe2fd1a13d..4c15bde57b 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -12,6 +12,7 @@ #include "printf.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -97,7 +98,7 @@ void func_80977EA8(PlayState* play, Gfx* dlist) { } void func_80977F80(DemoGeff* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 objectSlot = this->objectSlot; GraphicsContext* gfxCtx = play->state.gfxCtx; @@ -206,7 +207,7 @@ void func_809783D4(DemoGeff* this, PlayState* play) { s32 params = thisx->params; s16 objectId = sObjectIds[params]; s32 objectSlot = Object_GetSlot(objCtx, objectId); - s32 pad; + STACK_PAD(s32); if (objectSlot < 0) { PRINTF(VT_FGCOL(RED) T("Demo_Geff_main_bank:バンクを読めない arg_data = %d!\n", diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 03d2fdbf89..8a28db3675 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -15,6 +15,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -261,7 +262,7 @@ static InitChainEntry sInitChain[] = { }; void DemoGj_InitCommon(DemoGj* this, PlayState* play, CollisionHeader* header) { - s32 pad[3]; + STACK_PADS(s32, 3); CollisionHeader* newHeader; if (header != NULL) { @@ -304,12 +305,12 @@ void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) { } void DemoGj_DrawRotated(DemoGj* this, PlayState* play, Gfx* displayList) { - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx; s16 x = this->rotationVec.x; s16 y = this->rotationVec.y; s16 z = this->rotationVec.z; - s32 pad2; + STACK_PAD(s32); Mtx* matrix; gfxCtx = play->state.gfxCtx; @@ -477,7 +478,7 @@ s32 DemoGj_IsGanondorfFloatingInAir(DemoGj* this, PlayState* play) { void DemoGj_SetupMovement(DemoGj* this, PlayState* play) { Actor* actor = &this->dyna.actor; - s32 pad; + STACK_PAD(s32); Vec3f* pos = &actor->world.pos; Vec3s* unk_172; f32 xDistance; @@ -1012,7 +1013,7 @@ void func_8097AEE8(DemoGj* this, PlayState* play) { ColliderCylinder* collider1 = &this->colliderCylinders[1]; ColliderCylinder* collider2 = &this->colliderCylinders[2]; Vec3f* actorPos = &this->dyna.actor.world.pos; - s32 pad; + STACK_PAD(s32); s16 yaw = this->dyna.actor.world.rot.y; f32 cos = Math_CosS(yaw); f32 sin = Math_SinS(yaw); @@ -1031,11 +1032,11 @@ void func_8097AEE8(DemoGj* this, PlayState* play) { } void DemoGj_SetCylindersAsAC(DemoGj* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Collider* collider0 = &this->colliderCylinders[0].base; Collider* collider1 = &this->colliderCylinders[1].base; Collider* collider2 = &this->colliderCylinders[2].base; - s32 pad2[3]; + STACK_PADS(s32, 3); CollisionCheck_SetAC(play, &play->colChkCtx, collider0); CollisionCheck_SetAC(play, &play->colChkCtx, collider1); @@ -1146,7 +1147,7 @@ void func_8097B450(DemoGj* this, PlayState* play) { ColliderCylinder* collider1 = &this->colliderCylinders[1]; ColliderCylinder* collider2 = &this->colliderCylinders[2]; Vec3f* actorPos = &this->dyna.actor.world.pos; - s32 pad; + STACK_PAD(s32); s16 yaw = this->dyna.actor.world.rot.y; f32 cos = Math_CosS(yaw); f32 sin = Math_SinS(yaw); @@ -1165,11 +1166,11 @@ void func_8097B450(DemoGj* this, PlayState* play) { } void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Collider* cylinder0 = &this->colliderCylinders[0].base; Collider* cylinder1 = &this->colliderCylinders[1].base; Collider* cylinder2 = &this->colliderCylinders[2].base; - s32 pad2[3]; + STACK_PADS(s32, 3); CollisionCheck_SetAC(play, &play->colChkCtx, cylinder0); CollisionCheck_SetAC(play, &play->colChkCtx, cylinder1); @@ -1308,7 +1309,7 @@ void func_8097B9BC(DemoGj* this, PlayState* play) { void func_8097BA48(DemoGj* this, PlayState* play) { Actor* thisx = &this->dyna.actor; ColliderCylinder* collider = &this->colliderCylinders[0]; - s32 pad[2]; + STACK_PADS(s32, 2); if (func_809797E4(this, 4)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 2266a7c61e..773244dda4 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -12,6 +12,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -103,7 +104,7 @@ void DemoGo_Destroy(Actor* thisx, PlayState* play) { void func_8097C930(DemoGo* this) { s16* something = &this->unk_192; s16* other = &this->unk_190; - s32 pad[3]; + STACK_PADS(s32, 3); if (DECR(*something) == 0) { *something = Rand_S16Offset(60, 60); @@ -119,7 +120,7 @@ void func_8097C9B8(DemoGo* this) { } void func_8097C9DC(DemoGo* this) { - s32 pad[2]; + STACK_PADS(s32, 2); if (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_MORIBLIN_WALK); @@ -131,7 +132,7 @@ void func_8097CA30(DemoGo* this, PlayState* play) { } void func_8097CA78(DemoGo* this, PlayState* play) { - s16 pad; + STACK_PAD(s16); Vec3f vec = this->actor.world.pos; func_80033480(play, &vec, kREG(11) + 100.0f, kREG(12) + 0xA, kREG(13) + 0x12C, kREG(14), 0); func_8097C9B8(this); @@ -143,7 +144,7 @@ void func_8097CB0C(DemoGo* this, PlayState* play) { CutsceneContext* csCtx = &play->csCtx; CsCmdActorCue* cue; f32 lerp; - s32 pad; + STACK_PAD(s32); Vec3f startPos; Vec3f endPos; @@ -353,11 +354,11 @@ void func_8097D290(DemoGo* this, PlayState* play) { } void func_8097D29C(DemoGo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 eyeTexIdx = this->unk_190; SkelAnime* skelAnime = &this->skelAnime; void* eyeTexture = sEyeTextures[eyeTexIdx]; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_go.c", 732); diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 444e683285..2fba2d4313 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -10,6 +10,7 @@ #include "rumble.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -63,13 +64,13 @@ void DemoGt_SpawnDust(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel } void func_8097D7D8(PlayState* play, Vec3f* pos, Vec3f* velOffset, f32 scale, s32 arg4, s32 arg5, s16 life) { - s32 pad; + STACK_PAD(s32); if (!FrameAdvance_IsEnabled(play)) { s32 frames = play->gameplayFrames; if (ABS(frames % arg4) == arg5) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f velocity = { 0.0f, 6.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; @@ -97,7 +98,7 @@ Actor* DemoGt_SpawnCloudRing(PlayState* play, Vec3f* pos, s16 params) { } void DemoGt_SpawnExplosionWithSound(PlayState* play, Vec3f* pos, f32 scale) { - s32 pad; + STACK_PAD(s32); Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; @@ -277,7 +278,7 @@ void func_8097E1D4(PlayState* play, Vec3f* arg1, s16 arg2) { void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* accel, f32 arg4, f32 scale, s32 arg6, s32 arg7, s16 life) { - s32 pad2[3]; + STACK_PADS(s32, 3); s16 increment; s32 frames; s32 i; @@ -317,7 +318,7 @@ u8 DemoGt_IsCutsceneIdle(PlayState* play) { } CsCmdActorCue* DemoGt_GetCue(PlayState* play, u32 cueChannel) { - s32 pad[2]; + STACK_PADS(s32, 2); CsCmdActorCue* cue = NULL; if (!DemoGt_IsCutsceneIdle(play)) { @@ -371,7 +372,7 @@ void func_8097E824(DemoGt* this, s32 arg1) { s16 phi_a3; Vec3f* pos = &this->dyna.actor.world.pos; Vec3s* unk16C = &this->unk_16C; - s32 pad; + STACK_PAD(s32); f32 tempf3; f32 tempf2; f32 tempf1; @@ -470,7 +471,7 @@ static InitChainEntry sInitChain[] = { }; void func_8097EDD8(DemoGt* this, PlayState* play, CollisionHeader* collision) { - s32 pad[3]; + STACK_PADS(s32, 3); CollisionHeader* colHeader; if (collision != NULL) { @@ -515,12 +516,12 @@ void func_8097EF34(DemoGt* this, PlayState* play) { void func_8097EF40(DemoGt* this, PlayState* play) { u16 csCurFrame = play->csCtx.curFrame; - s32 pad1[3]; + STACK_PADS(s32, 3); Vec3f dustPos; Vec3f velocity = { 0.0f, -16.0f, 0.0f }; Vec3f accel = { 0.0f, 1.2f, 0.0f }; Vec3f* pos = &this->dyna.actor.world.pos; - s32 pad; + STACK_PAD(s32); if ((DEBUG_FEATURES && (kREG(1) == 20)) || (csCurFrame == 220)) { dustPos.x = pos->x + 256.0f; @@ -538,12 +539,12 @@ void func_8097EF40(DemoGt* this, PlayState* play) { } void func_8097F0AC(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f sp38; - s16 pad1[3]; + STACK_PADS(s16, 3); Vec3f sp24; u16 csCurFrame = play->csCtx.curFrame; - s32 pad2; + STACK_PAD(s32); #if DEBUG_FEATURES if (csCurFrame == 140 || kREG(1) == 19) @@ -646,7 +647,7 @@ void DemoGt_Update8(DemoGt* this, PlayState* play) { } void DemoGt_Draw1(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx = play->state.gfxCtx; u32 gameplayFrames = play->gameplayFrames; DemoGt* this = (DemoGt*)thisx; @@ -723,7 +724,7 @@ void func_8097F960(DemoGt* this, PlayState* play) { } void func_8097F96C(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; Actor* actor; u16 csCurFrame = play->csCtx.curFrame; @@ -747,12 +748,12 @@ void func_8097F96C(DemoGt* this, PlayState* play) { } void func_8097FA1C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { -12.0f, -17.0, 5.0 }; - s32 pad1[3]; + STACK_PADS(s32, 3); if (((csCurFrame > 502) && !(csCurFrame >= 581)) || (DEBUG_FEATURES && (kREG(1) == 5))) { dustPos.x = pos->x + 300.0f; @@ -763,7 +764,7 @@ void func_8097FA1C(DemoGt* this, PlayState* play) { } void func_8097FAFC(DemoGt* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); u16 csCurFrame = play->csCtx.curFrame; Vec3f pos; f32 new_var = -200.0; @@ -791,12 +792,12 @@ void func_8097FAFC(DemoGt* this, PlayState* play) { } void func_8097FC1C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if (csCurFrame > 682 || (DEBUG_FEATURES && (kREG(1) == 7))) { dustPos.x = pos->x + 260.0f; @@ -807,7 +808,7 @@ void func_8097FC1C(DemoGt* this, PlayState* play) { } void func_8097FCE4(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f vec; u16 csCurFrame = play->csCtx.curFrame; @@ -912,7 +913,7 @@ void func_80980178(DemoGt* this, PlayState* play) { } void func_80980184(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; Actor* actor; @@ -935,7 +936,7 @@ void func_80980184(DemoGt* this, PlayState* play) { } void func_80980218(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; Actor* actor; @@ -958,12 +959,12 @@ void func_80980218(DemoGt* this, PlayState* play) { } void func_809802AC(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 0.0f, 0.0f, -10.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if (csCurFrame > 109 && csCurFrame < 140) { dustPos.x = pos->x - 100.0f; @@ -974,12 +975,12 @@ void func_809802AC(DemoGt* this, PlayState* play) { } void func_8098036C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* world = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if ((csCurFrame > 284) && (csCurFrame < 421)) { dustPos.x = world->x + 760.0f; @@ -990,12 +991,12 @@ void func_8098036C(DemoGt* this, PlayState* play) { } void func_80980430(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if (csCurFrame > 709 || (DEBUG_FEATURES && (kREG(1) == 8))) { dustPos.x = pos->x + 760.0f; @@ -1006,12 +1007,12 @@ void func_80980430(DemoGt* this, PlayState* play) { } void func_80980504(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if ((csCurFrame > 704) || (DEBUG_FEATURES && (kREG(1) == 9))) { dustPos.x = pos->x + 830.0f; @@ -1022,12 +1023,12 @@ void func_80980504(DemoGt* this, PlayState* play) { } void func_809805D8(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* homePos = &this->dyna.actor.home.pos; Vec3f velOffset = { 15.0f, -26.0, 0.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if (((csCurFrame > 739) && (csCurFrame < 781)) || (DEBUG_FEATURES && (kREG(1) == 11))) { dustPos.x = homePos->x + 550.0f; @@ -1038,12 +1039,12 @@ void func_809805D8(DemoGt* this, PlayState* play) { } void func_809806B8(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if ((csCurFrame > 964) || (DEBUG_FEATURES && (kREG(1) == 12))) { dustPos.x = pos->x + 460.0f; @@ -1054,12 +1055,12 @@ void func_809806B8(DemoGt* this, PlayState* play) { } void func_8098078C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); if ((csCurFrame > 939) || (DEBUG_FEATURES && (kREG(1) == 14))) { dustPos.x = pos->x + 360.0f; @@ -1070,7 +1071,7 @@ void func_8098078C(DemoGt* this, PlayState* play) { } void func_8098085C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f sp28; u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; @@ -1099,12 +1100,12 @@ void func_809809C0(DemoGt* this, PlayState* play2) { s32 gameplayFrames = play->gameplayFrames; u16 csCurFrame = play->csCtx.curFrame; Vec3f sp54; - s16 pad[3]; + STACK_PADS(s16, 3); if (((csCurFrame > 469) && (csCurFrame < 481)) || (DEBUG_FEATURES && (kREG(1) == 3))) { Vec3f sp40 = { 20.0f, 6.0f, 0.0f }; Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; - s16 pad2[3]; + STACK_PADS(s16, 3); sp54.x = this2->dyna.actor.world.pos.x + 790.0f; sp54.y = this2->dyna.actor.world.pos.y + 60.0f; @@ -1117,7 +1118,7 @@ void func_809809C0(DemoGt* this, PlayState* play2) { } void func_80980AD4(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; @@ -1132,7 +1133,7 @@ void func_80980AD4(DemoGt* this, PlayState* play) { } void func_80980B68(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; @@ -1146,7 +1147,7 @@ void func_80980B68(DemoGt* this, PlayState* play) { } void func_80980BFC(DemoGt* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; @@ -1227,14 +1228,14 @@ void func_80980F58(DemoGt* this, PlayState* play) { } void func_80980F8C(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f sp58; Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; if ((csCurFrame > 259) && (csCurFrame < 289)) { Vec3f velOfset = { 0.0f, -17.0f, 0.0f }; - s32 pad[3]; + STACK_PADS(s32, 3); sp58.x = 640.0f; sp58.y = 2100.0f; @@ -1285,7 +1286,7 @@ void DemoGt_Draw4(Actor* thisx, PlayState* play2) { f32 sp6C; s16 sp6A; s16 sp68; - s16 pad2; + STACK_PAD(s16); Mtx* sp60; Vec3f sp54; Vec3f sp48; @@ -1350,14 +1351,14 @@ void func_80981424(DemoGt* this, PlayState* play) { } void func_80981458(DemoGt* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Vec3f sp58; Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; if (((csCurFrame > 855) && (csCurFrame < 891)) || (DEBUG_FEATURES && (kREG(1) == 13))) { Vec3f velOffset = { 0.0f, -30.0f, 0.0f }; - s32 pad1[3]; + STACK_PADS(s32, 3); sp58.x = 0.0f; sp58.y = 1170.0f; @@ -1406,7 +1407,7 @@ void DemoGt_Draw5(Actor* thisx, PlayState* play) { f32 sp6C; s16 sp6A; s16 sp68; - s16 pad1; + STACK_PAD(s16); Mtx* sp60; Vec3f sp54; Vec3f sp48; diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index ef3da8a40d..db0e040220 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -5,6 +5,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -169,7 +170,7 @@ void DemoIk_MoveToStartPos(DemoIk* this, PlayState* play, s32 cueChannel) { } void DemoIk_Type1Init(DemoIk* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); FlexSkeletonHeader* skeleton; AnimationHeader* animation; f32 phi_f0; @@ -291,7 +292,7 @@ void DemoIk_Type1PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s } void DemoIk_Type1Draw(DemoIk* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; @@ -307,7 +308,7 @@ void DemoIk_Type1Draw(DemoIk* this, PlayState* play) { } void DemoIk_Type2Init(DemoIk* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); FlexSkeletonHeader* skeleton; AnimationHeader* animation; @@ -454,7 +455,7 @@ void DemoIk_Type2PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s } void DemoIk_Type2Draw(DemoIk* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; @@ -476,7 +477,7 @@ static DemoIkActionFunc sActionFuncs[] = { }; void DemoIk_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoIk* this = (DemoIk*)thisx; if (this->actionMode < 0 || this->actionMode >= ARRAY_COUNT(sActionFuncs) || @@ -498,7 +499,7 @@ static DemoIkDrawFunc sDrawFuncs[] = { }; void DemoIk_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoIk* this = (DemoIk*)thisx; if (this->drawMode < 0 || this->drawMode >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawMode] == NULL) { @@ -522,7 +523,7 @@ ActorProfile Demo_Ik_Profile = { }; void DemoIk_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoIk* this = (DemoIk*)thisx; if (this->actor.params == 0 || this->actor.params == 1 || this->actor.params == 2) { diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 81667318e8..7aa945797d 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -14,6 +14,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -119,7 +120,7 @@ ActorProfile Demo_Im_Profile = { }; void func_80984BE0(DemoIm* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyeIndex = &this->eyeIndex; @@ -175,14 +176,14 @@ void DemoIm_DestroyCollider(Actor* thisx, PlayState* play) { } void DemoIm_UpdateCollider(DemoIm* this, PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } void func_80984DB8(DemoIm* this) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3s* headRot = &this->interactInfo.headRot; Vec3s* torsoRot = &this->interactInfo.torsoRot; @@ -240,7 +241,7 @@ s32 DemoIm_IsCutsceneIdle(PlayState* play) { } CsCmdActorCue* DemoIm_GetCue(PlayState* play, s32 cueChannel) { - s32 pad[2]; + STACK_PADS(s32, 2); CsCmdActorCue* cue = NULL; if (!DemoIm_IsCutsceneIdle(play)) { @@ -341,7 +342,7 @@ void func_80985430(DemoIm* this, PlayState* play) { } void func_8098544C(DemoIm* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if ((gSaveContext.chamberCutsceneNum == CHAMBER_CS_SHADOW) && !IS_CUTSCENE_LAYER) { Player* player = GET_PLAYER(play); @@ -540,7 +541,7 @@ void func_80985C94(DemoIm* this, PlayState* play) { } void DemoIm_DrawTranslucent(DemoIm* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* eyeTex = sEyeTextures[eyeIndex]; SkelAnime* skelAnime = &this->skelAnime; @@ -752,7 +753,7 @@ void func_80986570(DemoIm* this, PlayState* play) { } void func_809865F8(DemoIm* this, PlayState* play, s32 arg2) { - s32 pad[2]; + STACK_PADS(s32, 2); if (arg2 != 0) { f32* unk_278 = &this->unk_278; @@ -925,7 +926,7 @@ void func_80986BF8(DemoIm* this, PlayState* play) { void func_80986C30(DemoIm* this, PlayState* play) { if (func_80986A5C(this, play)) { - s32 pad; + STACK_PAD(s32); play->csCtx.script = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs); gSaveContext.cutsceneTrigger = 1; @@ -1216,7 +1217,7 @@ void DemoIm_DrawNothing(DemoIm* this, PlayState* play) { } void DemoIm_DrawSolid(DemoIm* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* eyeTexture = sEyeTextures[eyeIndex]; SkelAnime* skelAnime = &this->skelAnime; diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 60d023f6b8..4a0d470f1b 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -7,6 +7,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -80,8 +81,7 @@ static s16 sObjectIds[] = { OBJECT_GAMEPLAY_KEEP, OBJECT_GAMEPLAY_KEEP, OBJECT_GAMEPLAY_KEEP, }; -// unused, presumed to be floats -static f32 D_8098C314[] = { +UNUSED static f32 D_8098C314[] = { 0.0f, 150.0f, }; @@ -554,7 +554,7 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1186); for (i = 0; i < 30; i++) { - s32 pad[2]; + STACK_PADS(s32, 2); dx = play->view.at.x - play->view.eye.x; dy = play->view.at.y - play->view.eye.y; @@ -625,7 +625,7 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) { Matrix_Scale(sRainScale * 0.001f, sRainScale * 0.001f, sRainScale * 0.001f, MTXMODE_APPLY); for (j = 0; j < 5; j++) { - s32 pad1; + STACK_PAD(s32); if (play->sceneId != SCENE_TEMPLE_OF_TIME) { if (this->unk_150[i].unk_0.x >= 0.0f) { @@ -660,7 +660,7 @@ void DemoKankyo_DrawRain(Actor* thisx, PlayState* play) { void DemoKankyo_DrawRock(Actor* thisx, PlayState* play) { DemoKankyo* this = (DemoKankyo*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1376); @@ -681,7 +681,7 @@ void DemoKankyo_DrawRock(Actor* thisx, PlayState* play) { void DemoKankyo_DrawClouds(Actor* thisx, PlayState* play) { DemoKankyo* this = (DemoKankyo*)thisx; s16 i; - s32 pad; + STACK_PAD(s32); f32 dx; f32 dy; f32 dz; @@ -716,7 +716,7 @@ void DemoKankyo_DrawClouds(Actor* thisx, PlayState* play) { void DemoKankyo_DrawDoorOfTime(Actor* thisx, PlayState* play) { DemoKankyo* this = (DemoKankyo*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1487); @@ -732,8 +732,8 @@ void DemoKankyo_DrawDoorOfTime(Actor* thisx, PlayState* play) { } void DemoKankyo_DrawLightPlane(Actor* thisx, PlayState* play) { - DemoKankyo* this = (DemoKankyo*)thisx; - s32 pad; + UNUSED DemoKankyo* this = (DemoKankyo*)thisx; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_demo_kankyo.c", 1514); @@ -778,9 +778,8 @@ void DemoKankyo_Vec3fAddPosRot(PosRot* posRot, Vec3f* vec, Vec3f* dst) { void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { static f32 sWarpRoll; static f32 sWarpFoV; - // the following 2 vars are unused - static u32 D_8098CF90; - static u32 D_8098CF94; + UNUSED static s32 D_8098CF90; + UNUSED static s32 D_8098CF94; static Vec3f D_8098CF98; PlayState* play2 = (PlayState*)play; @@ -917,10 +916,9 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { void DemoKankyo_DrawSparkles(Actor* thisx, PlayState* play) { static f32 sSparklesRoll; static f32 sSparklesFoV; - // the following 3 vars are unused - static u32 D_8098CFAC; - static u32 D_8098CFB0; - static u32 D_8098CFB4; + UNUSED static s32 D_8098CFAC; + UNUSED static s32 D_8098CFB0; + UNUSED static s32 D_8098CFB4; static Vec3f D_8098CFB8; DemoKankyo* this = (DemoKankyo*)thisx; diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 3ba0504137..a9b266b72e 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -12,6 +12,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -89,7 +90,7 @@ s32 DemoKekkai_CheckEventFlag(s32 params) { } void DemoKekkai_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoKekkai* this = (DemoKekkai*)thisx; this->sfxFlag = 0; @@ -140,7 +141,7 @@ void DemoKekkai_Init(Actor* thisx, PlayState* play) { } void DemoKekkai_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoKekkai* this = (DemoKekkai*)thisx; Collider_DestroyCylinder(play, &this->collider1); @@ -219,7 +220,7 @@ void DemoKekkai_Update(Actor* thisx, PlayState* play2) { void DemoKekkai_TrialBarrierDispel(Actor* thisx, PlayState* play) { static u16 csFrames[] = { 0, 280, 280, 280, 280, 280, 280 }; - s32 pad; + STACK_PAD(s32); DemoKekkai* this = (DemoKekkai*)thisx; if (play->csCtx.curFrame == csFrames[this->actor.params]) { @@ -257,7 +258,7 @@ static CutsceneData* sSageCutscenes[] = { }; void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoKekkai* this = (DemoKekkai*)thisx; if (this->collider1.base.atFlags & AT_HIT) { @@ -338,7 +339,7 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) { } void DemoKekkai_DrawTowerBarrier(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DemoKekkai* this = (DemoKekkai*)thisx; s32 scroll; diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index fb44ec0376..3a3867374a 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -15,6 +15,7 @@ #include "segmented_address.h" #include "sfx.h" #include "sequence.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -119,7 +120,7 @@ void DemoSa_Destroy(Actor* thisx, PlayState* play) { } void func_8098E480(DemoSa* this) { - s32 pad[2]; + STACK_PADS(s32, 2); s16* eyeIndex = &this->eyeIndex; s16* blinkTimer = &this->blinkTimer; @@ -218,7 +219,7 @@ void func_8098E6EC(DemoSa* this, PlayState* play, s32 cueChannel) { } void func_8098E76C(DemoSa* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 morphFrames, s32 arg4) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 frameCount = Animation_GetLastFrame(animHeaderSeg); f32 playbackSpeed; f32 unk0; @@ -268,7 +269,7 @@ void func_8098E944(DemoSa* this, PlayState* play) { } void func_8098E960(DemoSa* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Player* player; if ((gSaveContext.chamberCutsceneNum == CHAMBER_CS_FOREST) && !IS_CUTSCENE_LAYER) { @@ -372,7 +373,7 @@ void func_8098ECCC(DemoSa* this, PlayState* play) { } void func_8098ECF4(DemoSa* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); SkelAnime* skelAnime = &this->skelAnime; f32 frameCount = Animation_GetLastFrame(&gSariaSealGanonAnim); @@ -483,11 +484,11 @@ void func_8098F16C(DemoSa* this, PlayState* play) { } void DemoSa_DrawXlu(DemoSa* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* sp78 = sEyeTextures[eyeIndex]; s16 mouthIndex = this->mouthIndex; - s32 pad2; + STACK_PAD(s32); void* sp6C = sMouthTextures[mouthIndex]; SkelAnime* skelAnime = &this->skelAnime; @@ -826,10 +827,10 @@ void DemoSa_DrawNothing(DemoSa* this, PlayState* play) { } void DemoSa_DrawOpa(DemoSa* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* eyeTex = sEyeTextures[eyeIndex]; - s32 pad2; + STACK_PAD(s32); s16 mouthIndex = this->mouthIndex; void* mouthTex = sMouthTextures[mouthIndex]; SkelAnime* skelAnime = &this->skelAnime; diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 1c6ea8559b..5b43eda59c 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "audio.h" #include "play_state.h" @@ -101,7 +102,7 @@ void DemoShd_Update(Actor* thisx, PlayState* play) { void DemoShd_Draw(Actor* thisx, PlayState* play) { DemoShd* this = (DemoShd*)thisx; - s32 pad; + STACK_PAD(s32); u32 unk_14E = this->unk_14E; OPEN_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 726); diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index ece0958ad2..63b84cf8f7 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -5,6 +5,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "curve.h" #include "play_state.h" @@ -90,7 +91,7 @@ void func_8099375C(DemoTreLgt* this, PlayState* play) { void func_809937B4(DemoTreLgt* this, PlayState* play, f32 currentFrame) { SkelCurve* skelCurve = &this->skelCurve; - s32 pad[2]; + STACK_PADS(s32, 2); this->action = DEMO_TRE_LGT_ACTION_ANIMATE; @@ -143,7 +144,7 @@ void DemoTreLgt_Update(Actor* thisx, PlayState* play) { } s32 DemoTreLgt_OverrideLimbDraw(PlayState* play, SkelCurve* skelCurve, s32 limbIndex, void* thisx) { - s32 pad; + STACK_PAD(s32); DemoTreLgt* this = (DemoTreLgt*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_demo_tre_lgt.c", 423); diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 5483a07db7..7057290e89 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -47,7 +48,7 @@ static InitChainEntry sInitChain[] = { }; void DoorGerudo_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DoorGerudo* this = (DoorGerudo*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 3d0b9603dd..975384dee0 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -16,6 +16,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "quake.h" #include "versions.h" @@ -426,7 +427,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { DoorShutter* this = (DoorShutter*)thisx; PlayState* play = play2; s32 styleType; - s32 pad; + STACK_PAD(s32); s32 objectSlot; s32 i; @@ -524,7 +525,7 @@ void DoorShutter_WaitForObject(DoorShutter* this, PlayState* play) { * or returns the max float value if the player is too far left/right (`maxDistSides`) or above/below (`maxDistY`). */ f32 DoorShutter_GetPlayerDistance(PlayState* play, DoorShutter* this, f32 offsetY, f32 maxDistSides, f32 maxDistY) { - s32 pad; + STACK_PAD(s32); Vec3f playerPos; Vec3f relPlayerPos; Player* player = GET_PLAYER(play); @@ -1014,7 +1015,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) { if (this->dyna.actor.objectSlot == this->requiredObjectSlot && (this->styleType == DOORSHUTTER_STYLE_PHANTOM_GANON || DoorShutter_ShouldDraw(this, play))) { - s32 pad[2]; + STACK_PADS(s32, 2); DoorShutterGfxInfo* gfxInfo = &sGfxInfo[this->gfxType]; OPEN_DISPS(play->state.gfxCtx, "../z_door_shutter.c", 2048); diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index c4c9d2f25e..d014ace60c 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #include "assets/objects/object_toki_objects/object_toki_objects.h" @@ -35,7 +36,7 @@ static InitChainEntry sInitChain[] = { }; void DoorToki_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); DoorToki* this = (DoorToki*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index dd99eb63c0..f1b937888e 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -8,6 +8,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -311,7 +312,6 @@ void DoorWarp1_BlueCrystal(DoorWarp1* this, PlayState* play) { } void func_80999214(DoorWarp1* this, PlayState* play) { - s32 temp_f4; f32 darkness; s16 i; @@ -894,7 +894,7 @@ void DoorWarp1_Update(Actor* thisx, PlayState* play) { } void DoorWarp1_DrawBlueCrystal(DoorWarp1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_door_warp1.c", 2078); @@ -912,7 +912,7 @@ void DoorWarp1_DrawBlueCrystal(DoorWarp1* this, PlayState* play) { } void DoorWarp1_DrawPurpleCrystal(DoorWarp1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f eye; eye.x = -(Math_SinS(play->state.frames * 200) * 120.0f) * 80.0f; @@ -936,8 +936,7 @@ void DoorWarp1_DrawPurpleCrystal(DoorWarp1* this, PlayState* play) { } void DoorWarp1_DrawWarp(DoorWarp1* this, PlayState* play) { - s32 pad; - u32 pad1; + STACK_PADS(s32, 2); u32 spEC = play->state.frames * 10; f32 spE8 = (this->unk_194 >= 1.0f) ? 0.0f : 1.0f - this->unk_194; f32 spE4 = (this->unk_198 >= 1.0f) ? 0.0f : 1.0f - this->unk_198; diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index 53790dd7f4..b4824ede86 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -1,10 +1,12 @@ #include "z_efc_erupc.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" #include "sfx.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -174,7 +176,7 @@ void EfcErupc_Draw(Actor* thisx, PlayState* play) { void EfcErupc_DrawEffects(EfcErupcEffect* effect, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; s16 i; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_efc_erupc.c", 368); for (i = 0; i < EFC_ERUPC_EFFECT_COUNT; i++, effect++) { @@ -194,7 +196,7 @@ void EfcErupc_DrawEffects(EfcErupcEffect* effect, PlayState* play) { CLOSE_DISPS(gfxCtx, "../z_efc_erupc.c", 399); } -static Color_RGB8 D_8099D770[] = { +UNUSED static Color_RGB8 D_8099D770[] = { { 255, 128, 0 }, { 255, 0, 0 }, { 255, 255, 0 }, diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 6b382ca364..ea96262e6e 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -5,6 +5,7 @@ */ #include "z_en_am.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "libc64/qrand.h" @@ -13,6 +14,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -221,7 +223,7 @@ s32 EnAm_CanMove(EnAm* this, PlayState* play, f32 distance, s16 yaw) { void EnAm_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; - s32 pad; + STACK_PAD(s32); EnAm* this = (EnAm*)thisx; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -256,7 +258,7 @@ void EnAm_Init(Actor* thisx, PlayState* play) { } void EnAm_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnAm* this = (EnAm*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -272,7 +274,7 @@ void EnAm_SpawnEffects(EnAm* this, PlayState* play) { Vec3f pos; Color_RGBA8 primColor = { 100, 100, 100, 0 }; Color_RGBA8 envColor = { 40, 40, 40, 0 }; - s32 pad; + STACK_PAD(s32); for (i = 4; i > 0; i--) { pos.x = this->dyna.actor.world.pos.x + ((Rand_ZeroOne() - 0.5f) * 65.0f); @@ -382,7 +384,7 @@ void EnAm_SetupRicochet(EnAm* this, PlayState* play) { void EnAm_Sleep(EnAm* this, PlayState* play) { f32 cos; - s32 pad; + STACK_PAD(s32); f32 rand; f32 sin; Player* player = GET_PLAYER(play); @@ -797,7 +799,7 @@ void EnAm_TransformSwordHitbox(Actor* thisx, PlayState* play) { } void EnAm_UpdateDamage(EnAm* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (this->deathTimer == 0) { if (this->blockCollider.base.acFlags & AC_BOUNCED) { @@ -847,7 +849,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; static Color_RGBA8 dustPrimColor = { 150, 150, 150, 255 }; static Color_RGBA8 dustEnvColor = { 100, 100, 100, 150 }; - s32 pad; + STACK_PAD(s32); EnAm* this = (EnAm*)thisx; EnBom* bomb; Vec3f dustPos; @@ -869,7 +871,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { if (this->deathTimer == 0) { f32 dustPosScale = play->gameplayFrames * 10; - s32 pad1; + STACK_PAD(s32); EnAm_SpawnEffects(this, play); bomb = @@ -940,8 +942,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) { } } -static Vec3f sUnused1 = { 1100.0f, -700.0f, 0.0f }; -static Vec3f sUnused2 = { 0.0f, 0.0f, 0.0f }; +UNUSED static Vec3f sUnused1 = { 1100.0f, -700.0f, 0.0f }; +UNUSED static Vec3f sUnused2 = { 0.0f, 0.0f, 0.0f }; void EnAm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnAm* this = (EnAm*)thisx; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 17d4eb62f2..680b37671d 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -80,7 +81,7 @@ static InitChainEntry sInitChain[] = { }; void EnAni_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnAni* this = (EnAni*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -178,7 +179,7 @@ void func_809B064C(EnAni* this, PlayState* play) { } void func_809B07F8(EnAni* this, PlayState* play) { - s16 pad; + STACK_PAD(s16); s16 yawDiff; u16 textId; @@ -240,7 +241,7 @@ void func_809B0A6C(EnAni* this, PlayState* play) { void EnAni_Update(Actor* thisx, PlayState* play) { EnAni* this = (EnAni*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -322,7 +323,7 @@ void EnAni_Draw(Actor* thisx, PlayState* play) { gRoofManEyeClosedTex, }; EnAni* this = (EnAni*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ani.c", 719); diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index dd527d95bd..c85b21e4aa 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -15,6 +15,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -333,7 +334,7 @@ void EnAnubice_Die(EnAnubice* this, PlayState* play) { f32 rotX; Vec3f baseFireEffectPos = { 0.0f, 0.0f, 0.0f }; Vec3f rotatedFireEffectPos = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); SkelAnime_Update(&this->skelAnime); Math_ApproachZeroF(&this->actor.shape.shadowScale, 0.4f, 0.25f); diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index 39cc72c383..34c77254f3 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -12,6 +12,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -104,7 +105,7 @@ void func_809B26EC(EnAnubiceFire* this, PlayState* play) { } void func_809B27D8(EnAnubiceFire* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; Vec3f pos; @@ -160,7 +161,7 @@ void func_809B2B48(EnAnubiceFire* this, PlayState* play) { Vec3f pos; Color_RGBA8 primColor = { 255, 255, 0, 255 }; Color_RGBA8 envColor = { 255, 0, 0, 255 }; - s32 pad; + STACK_PAD(s32); s32 i; if (this->unk_15C == 0) { @@ -184,7 +185,7 @@ void func_809B2B48(EnAnubiceFire* this, PlayState* play) { void EnAnubiceFire_Update(Actor* thisx, PlayState* play) { EnAnubiceFire* this = (EnAnubiceFire*)thisx; - s32 pad; + STACK_PAD(s32); s32 i; Actor_SetScale(&this->actor, this->scale); @@ -231,7 +232,7 @@ void EnAnubiceFire_Draw(Actor* thisx, PlayState* play) { gDust4Tex, gDust5Tex, gDust6Tex, gDust7Tex, gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, }; EnAnubiceFire* this = (EnAnubiceFire*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); s32 i; OPEN_DISPS(play->state.gfxCtx, "../z_en_anubice_fire.c", 503); diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 48517bfe41..76f51badde 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_math3d.h" #include "sys_matrix.h" @@ -401,7 +402,7 @@ void func_809B4640(EnArrow* this, PlayState* play) { } void EnArrow_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnArrow* this = (EnArrow*)thisx; Player* player = GET_PLAYER(play); @@ -465,7 +466,7 @@ void func_809B4800(EnArrow* this, PlayState* play) { } void EnArrow_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnArrow* this = (EnArrow*)thisx; u8 alpha; f32 scale; diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index a7fd550149..6f7fdff61d 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -5,6 +5,7 @@ */ #include "z_en_attack_niw.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "libc64/qrand.h" @@ -13,6 +14,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "versions.h" #include "z_lib.h" #include "effect.h" @@ -52,7 +54,7 @@ static InitChainEntry sInitChain[] = { void EnAttackNiw_Init(Actor* thisx, PlayState* play) { EnAttackNiw* this = (EnAttackNiw*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); @@ -355,7 +357,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) { Vec3f sp30; - s32 pad; + STACK_PAD(s32); Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.depthInWater; @@ -395,7 +397,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { s32 func_809B5F98(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnAttackNiw* this = (EnAttackNiw*)thisx; - Vec3f sp0 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp0 = { 0.0f, 0.0f, 0.0f }; if (limbIndex == 13) { rot->y += (s16)this->unk_2BC; diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 462e8a5f1d..a630b1ed6c 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -6,12 +6,14 @@ #include "z_en_ba.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" @@ -105,7 +107,7 @@ static InitChainEntry sInitChain[] = { void EnBa_Init(Actor* thisx, PlayState* play) { EnBa* this = (EnBa*)thisx; Vec3f sp38 = D_809B80E4; - s32 pad; + STACK_PAD(s32); s16 i; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -154,7 +156,7 @@ void EnBa_SetupIdle(EnBa* this) { void EnBa_Idle(EnBa* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 i; - s32 pad; + STACK_PAD(s32); Vec3s sp5C; if ((this->actor.colChkInfo.mass == MASS_IMMOVABLE) && (this->actor.xzDistToPlayer > 175.0f)) { @@ -494,10 +496,10 @@ static void* D_809B8118[] = { void EnBa_Draw(Actor* thisx, PlayState* play) { EnBa* this = (EnBa*)thisx; - s32 pad; + STACK_PAD(s32); s16 i; Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 14); - Vec3f unused = { 0.0f, 0.0f, 448.0f }; + UNUSED Vec3f unk = { 0.0f, 0.0f, 448.0f }; OPEN_DISPS(play->state.gfxCtx, "../z_en_ba.c", 933); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 0c055c9be9..2cf2c27c90 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -326,7 +327,7 @@ void EnBb_KillFlameTrail(EnBb* this) { void EnBb_Init(Actor* thisx, PlayState* play) { EffectBlureInit1 blureInit; - s32 pad; + STACK_PAD(s32); EnBb* this = (EnBb*)thisx; Actor_ProcessInitChain(thisx, sInitChain); @@ -418,7 +419,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) { } void EnBb_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBb* this = (EnBb*)thisx; Collider_DestroyJntSph(play, &this->collider); @@ -485,8 +486,8 @@ void EnBb_SetupDeath(EnBb* this, PlayState* play) { void EnBb_Death(EnBb* this, PlayState* play) { s16 enpartType = 3; - Vec3f sp40 = { 0.0f, 0.5f, 0.0f }; - Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp40 = { 0.0f, 0.5f, 0.0f }; + UNUSED Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; if (this->actor.params <= ENBB_BLUE) { Math_SmoothStepToF(&this->flameScaleY, 0.0f, 1.0f, 30.0f, 0.0f); @@ -1243,10 +1244,10 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { void EnBb_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnBb* this = (EnBb*)thisx; - Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; - Vec3f sp40 = { 0.0f, -0.6f, 0.0f }; - Color_RGBA8 sp3C = { 0, 0, 255, 255 }; - Color_RGBA8 sp38 = { 0, 0, 0, 0 }; + UNUSED Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp40 = { 0.0f, -0.6f, 0.0f }; + UNUSED Color_RGBA8 sp3C = { 0, 0, 255, 255 }; + UNUSED Color_RGBA8 sp38 = { 0, 0, 0, 0 }; f32 sp34 = -15.0f; if (this->actor.params <= ENBB_BLUE) { @@ -1296,7 +1297,7 @@ static Vec3f sFireIceOffsets[] = { }; void EnBb_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBb* this = (EnBb*)thisx; Vec3f blureBase1 = { 0.0f, 5000.0f, 0.0f }; Vec3f blureBase2 = { 0.0f, 2000.0f, 0.0f }; diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 76462af1de..e8abd25535 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -13,6 +13,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "light.h" @@ -54,7 +55,7 @@ void EnbdFire_SetupDraw(EnBdfire* this, EnBdfireDrawFunc drawFunc) { void EnBdfire_Init(Actor* thisx, PlayState* play) { EnBdfire* this = (EnBdfire*)thisx; - s32 pad; + STACK_PAD(s32); Actor_SetScale(&this->actor, 0.6f); EnbdFire_SetupDraw(this, EnBdfire_DrawFire); @@ -206,7 +207,7 @@ void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) { object_kingdodongo_Tex_02C4E0, object_kingdodongo_Tex_02D4E0, }; s16 texIndex; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_bdfire.c", 612); texIndex = this->unk_156 & 7; diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 1ab5979a3c..824e4cbce5 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,6 +1,7 @@ #include "z_en_bigokuta.h" #include "array_count.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -9,6 +10,7 @@ #include "rumble.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -172,7 +174,7 @@ static InitChainEntry sInitChain[] = { }; // possibly color data -static u32 sUnused[] = { 0xFFFFFFFF, 0x969696FF }; +UNUSED static u32 sUnk[] = { 0xFFFFFFFF, 0x969696FF }; void EnBigokuta_Init(Actor* thisx, PlayState* play) { EnBigokuta* this = (EnBigokuta*)thisx; @@ -497,7 +499,7 @@ void func_809BDB90(EnBigokuta* this, PlayState* play) { void func_809BDC08(EnBigokuta* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 phi_v0; - s16 pad; + STACK_PAD(s16); s16 phi_v1; Vec3f sp28; diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 813f16ce12..270882d0a8 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "player.h" @@ -62,7 +63,7 @@ void EnBlkobj_SetupAction(EnBlkobj* this, EnBlkobjActionFunc actionFunc) { } void EnBlkobj_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBlkobj* this = (EnBlkobj*)thisx; CollisionHeader* colHeader = NULL; @@ -79,7 +80,7 @@ void EnBlkobj_Init(Actor* thisx, PlayState* play) { } void EnBlkobj_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBlkobj* this = (EnBlkobj*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -128,7 +129,7 @@ void EnBlkobj_DoNothing(EnBlkobj* this, PlayState* play) { } void EnBlkobj_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBlkobj* this = (EnBlkobj*)thisx; this->actionFunc(this, play); @@ -153,7 +154,7 @@ void EnBlkobj_DrawAlpha(PlayState* play, Gfx* dList, s32 alpha) { } void EnBlkobj_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBlkobj* this = (EnBlkobj*)thisx; s32 illusionAlpha; u32 gameplayFrames; diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index bf1c9ee479..6bb4e4ed0b 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -237,7 +238,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) { Vec3f effPos; Vec3f dustAccel = { 0.0f, 0.6f, 0.0f }; Color_RGBA8 dustColor = { 255, 255, 255, 255 }; - s32 pad; + STACK_PAD(s32); PlayState* play = play2; EnBom* this = (EnBom*)thisx; @@ -368,7 +369,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) { } void EnBom_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBom* this = (EnBom*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_bom.c", 913); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 2fff5313e5..e6ff17ac9f 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -9,6 +9,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "effect.h" @@ -392,7 +393,7 @@ static s16 sPrizeRot[] = { 0x4268, 0x4268, -0x03E8, 0x0000, 0x4268, 0x0000 }; void EnBomBowlMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { s16 prizeTemp; - s32 pad; + STACK_PAD(s32); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 6e9dc91695..9ba27d13ed 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -8,6 +8,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" @@ -492,7 +493,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play2) { } void EnBomChu_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBomChu* this = (EnBomChu*)thisx; f32 colorIntensity; s32 blinkHalfPeriod; diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 117343703e..f330522dc0 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -13,6 +13,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -99,7 +100,7 @@ void EnBombf_SetupAction(EnBombf* this, EnBombfActionFunc actionFunc) { void EnBombf_Init(Actor* thisx, PlayState* play) { f32 shapeUnk10 = 0.0f; - s32 pad; + STACK_PAD(s32); EnBombf* this = (EnBombf*)thisx; Actor_SetScale(thisx, 0.01f); @@ -156,10 +157,9 @@ void EnBombf_SetupGrowBomb(EnBombf* this, s16 params) { void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { EnBombf* bombFlower; - s32 pad; - s32 pad1; + STACK_PADS(s32, 2); Player* player = GET_PLAYER(play); - s32 pad2; + STACK_PAD(s32); if (this->flowerBombScale >= 1.0f) { if (Actor_HasParent(&this->actor, play)) { @@ -330,7 +330,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { Vec3f effPos; Vec3f dustAccel = { 0.0f, 0.6f, 0.0f }; Color_RGBA8 dustColor = { 255, 255, 255, 255 }; - s32 pad[2]; + STACK_PADS(s32, 2); EnBombf* this = (EnBombf*)thisx; if (this->isFuseEnabled && (this->timer != 0)) { @@ -491,7 +491,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) { } void EnBombf_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBombf* this = (EnBombf*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034); diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index f679755105..140112e5cf 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -122,13 +123,13 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { s16 yawDiff; s16 pitchTarget; s16 pitchDiff; - s32 pad1; + STACK_PAD(s32); f32 distXYZScale; f32 distFromLink; DynaPolyActor* hitActor; s32 hitDynaID; Vec3f hitPoint; - s32 pad2; + STACK_PAD(s32); player = GET_PLAYER(play); target = this->moveTo; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 23c9321356..43f6eb9084 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -1,4 +1,5 @@ #include "z_en_box.h" +#include "attributes.h" #include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h" #include "libc64/qrand.h" @@ -9,6 +10,7 @@ #include "printf.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" @@ -89,7 +91,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_0, ICHAIN_STOP), }; -static UNK_TYPE sUnused; +UNUSED static UNK_TYPE sUnused; void EnBox_SetupAction(EnBox* this, EnBoxActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -412,7 +414,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { f32 frameCount; AnimationHeader* anim; s32 linkAge; - s32 pad; + STACK_PAD(s32); Vec3f sp4C; Player* player; @@ -567,7 +569,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { void EnBox_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { EnBox* this = (EnBox*)thisx; - s32 pad; + STACK_PAD(s32); if (limbIndex == 1) { MATRIX_FINALIZE_AND_LOAD((*gfx)++, play->state.gfxCtx, "../z_en_box.c", 1492); diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 1dc0ea5e6e..7122200989 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -66,7 +67,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 60, 120, MASS_IMMOVABLE }; void EnBrob_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBrob* this = (EnBrob*)thisx; CollisionHeader* colHeader = NULL; diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 30de9c5bbb..4f6af1bdd7 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -341,7 +342,7 @@ void func_809CC774(EnBubble* this) { void EnBubble_Init(Actor* thisx, PlayState* play) { EnBubble* this = (EnBubble*)thisx; - u32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawCircle, 0.2f); Collider_InitJntSph(play, &this->colliderJntSph); diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 7f6b4ae99e..59ddf7224b 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -14,6 +14,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "versions.h" @@ -174,7 +175,7 @@ void EnBw_Init(Actor* thisx, PlayState* play) { } void EnBw_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnBw* this = (EnBw*)thisx; Collider_DestroyCylinder(play, &this->collider1); @@ -764,7 +765,7 @@ void EnBw_Update(Actor* thisx, PlayState* play2) { EnBw* this = (EnBw*)thisx; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; - s32 pad[3]; // probably an unused Vec3f + STACK_PADS(s32, 3); // probably an unused Vec3f Color_RGBA8 sp50 = { 255, 200, 0, 255 }; Color_RGBA8 sp4C = { 255, 80, 0, 255 }; Color_RGBA8 sp48 = { 0, 0, 0, 255 }; diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 942cfdd6fb..0906cf3a0b 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -6,12 +6,14 @@ #include "z_en_bx.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -82,12 +84,12 @@ static ColliderQuadInit sQuadInit = { void EnBx_Init(Actor* thisx, PlayState* play) { EnBx* this = (EnBx*)thisx; Vec3f sp48 = { 0.015f, 0.015f, 0.015f }; - Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { ICHAIN_F32(lockOnArrowOffset, 5300, ICHAIN_STOP), }; s32 i; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); thisx->scale.x = thisx->scale.z = 0.01f; @@ -215,7 +217,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { object_bxa_Tex_0029F0, }; EnBx* this = (EnBx*)thisx; - s32 pad; + STACK_PAD(s32); Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx)); s16 i; s16 off; diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index f3b7f3dc19..e6be77b226 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -8,6 +8,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -89,8 +90,8 @@ static ColliderCylinderInit sLaserCylinderInit = { { 15, 30, 10, { 0, 0, 0 } }, }; -static UNK_TYPE4 D_809D5C98 = 0; // unused -static UNK_TYPE4 D_809D5C9C = 0; // unused +UNUSED static UNK_TYPE4 D_809D5C98 = 0; +UNUSED static UNK_TYPE4 D_809D5C9C = 0; static EnClearTagEffect sEffects[CLEAR_TAG_EFFECT_COUNT]; @@ -360,7 +361,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { s16 worldRotationTargetY; f32 loseTargetLockDistance; s16 worldRotationTargetZ; - s32 pad; + STACK_PAD(s32); // Check if the Arwing should crash. if (this->collider.base.acFlags & AC_HIT) { @@ -698,7 +699,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { * Arwing clear tag types will draw the Arwing, the backfire, and a shadow. */ void EnClearTag_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnClearTag* this = (EnClearTag*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_clear_tag.c", 983); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 2c27b88f2c..24bdc5f80b 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -11,6 +11,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "ocarina.h" @@ -121,7 +122,7 @@ void EnCow_SetTailPos(EnCow* this) { void EnCow_Init(Actor* thisx, PlayState* play) { EnCow* this = (EnCow*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 72.0f); @@ -391,7 +392,7 @@ void EnCow_Update(Actor* thisx, PlayState* play2) { void EnCow_UpdateTail(Actor* thisx, PlayState* play) { EnCow* this = (EnCow*)thisx; - s32 pad; + STACK_PAD(s32); if (SkelAnime_Update(&this->skelAnime)) { if (this->skelAnime.animation == &gCowTailIdleAnim) { diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 0182ad038f..0465e741af 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -4,6 +4,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -441,7 +442,7 @@ void EnCrow_UpdateDamage(EnCrow* this, PlayState* play) { void EnCrow_Update(Actor* thisx, PlayState* play) { EnCrow* this = (EnCrow*)thisx; - f32 pad; + STACK_PAD(s32); f32 height; f32 scale; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index ce9f69f5cd..098bf5c2ce 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -6,6 +6,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -136,7 +137,7 @@ void EnCs_ChangeAnim(EnCs* this, s32 index, s32* currentIndex) { void EnCs_Init(Actor* thisx, PlayState* play) { EnCs* this = (EnCs*)thisx; - s32 pad; + STACK_PAD(s32); if (!IS_DAY) { Actor_Kill(&this->actor); @@ -177,8 +178,7 @@ void EnCs_Destroy(Actor* thisx, PlayState* play) { } s32 EnCs_GetTalkState(EnCs* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); s32 talkState = 1; switch (Message_GetState(&play->msgCtx)) { @@ -240,7 +240,7 @@ s32 EnCs_GetTextId(EnCs* this, PlayState* play) { } void EnCs_HandleTalking(EnCs* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 sp2A; s16 sp28; @@ -432,7 +432,7 @@ void EnCs_Talk(EnCs* this, PlayState* play) { void EnCs_Update(Actor* thisx, PlayState* play) { static s32 eyeBlinkFrames[] = { 70, 1, 1 }; EnCs* this = (EnCs*)thisx; - s32 pad; + STACK_PAD(s32); if (this->currentAnimIndex == 0) { if (((s32)this->skelAnime.curFrame == 9) || ((s32)this->skelAnime.curFrame == 23)) { @@ -473,7 +473,7 @@ void EnCs_Draw(Actor* thisx, PlayState* play) { gGraveyardKidEyesClosedTex, }; EnCs* this = (EnCs*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_cs.c", 968); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 628e7de831..114243e23a 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -8,6 +8,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -167,7 +168,7 @@ void EnDaiku_ChangeAnim(EnDaiku* this, s32 index, s32* currentIndex) { void EnDaiku_Init(Actor* thisx, PlayState* play) { EnDaiku* this = (EnDaiku*)thisx; - s32 pad; + STACK_PAD(s32); s32 noKill = true; s32 isRescued = false; @@ -454,7 +455,7 @@ void EnDaiku_EscapeRotate(EnDaiku* this, PlayState* play) { } void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f eyePosDeltaLocal; Vec3f eyePosDeltaWorld; @@ -488,7 +489,7 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { } void EnDaiku_UpdateSubCamera(EnDaiku* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); this->subCamAtNext.x = this->actor.world.pos.x; this->subCamAtNext.y = this->actor.world.pos.y + 60.0f; @@ -530,12 +531,12 @@ void EnDaiku_EscapeSuccess(EnDaiku* this, PlayState* play) { * The carpenter is running away */ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { - s32 pad1; + STACK_PAD(s32); Path* path; s16 ry; f32 dx; f32 dz; - s32 pad2; + STACK_PAD(s32); f32 dxz; Vec3s* pointPos; diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 7401a84e38..fd10cecc60 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -13,6 +13,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -147,7 +148,7 @@ void EnDaikuKakariko_ChangeAnim(EnDaikuKakariko* this, s32 index, s32* currentIn void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { static u16 initFlags[] = { 0x0080, 0x00B0, 0x0070, 0x0470 }; // List of initial values for this->flags EnDaikuKakariko* this = (EnDaikuKakariko*)thisx; - s32 pad; + STACK_PAD(s32); if (LINK_AGE_IN_YEARS == YEARS_CHILD) { switch (play->sceneId) { @@ -376,7 +377,7 @@ void EnDaikuKakariko_StopRunning(EnDaikuKakariko* this, PlayState* play) { } void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Path* path; Vec3s* pathPos; f32 xDist; @@ -480,9 +481,9 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { void EnDaikuKakariko_Update(Actor* thisx, PlayState* play) { EnDaikuKakariko* this = (EnDaikuKakariko*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); - s32 pad2; + STACK_PAD(s32); if (this->currentAnimIndex == 3) { if (((s32)this->skelAnime.curFrame == 6) || ((s32)this->skelAnime.curFrame == 15)) { diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index d30784b4c1..4c8e8bffc7 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -6,6 +6,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -1124,7 +1125,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { } void EnDekubaba_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDekubaba* this = (EnDekubaba*)thisx; if (this->collider.base.atFlags & AT_HIT) { diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index f1cce28c07..11e413abc3 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -18,7 +18,7 @@ typedef struct EnDekubaba { /* 0x014C */ Vec3f bodyPartsPos[4]; /* 0x017C */ SkelAnime skelAnime; /* 0x01C0 */ EnDekubabaActionFunc actionFunc; - /* 0x01C4 */ char pad[0x2]; + /* 0x01C4 */ char unk_1C4[0x2]; /* 0x01C6 */ s16 timer; /* 0x01C8 */ s16 targetSwayAngle; /* 0x01CA */ s16 stemSectionAngle[3]; // Used to calculate the position of the stem sections and head with spherical trigonometry diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index dac88693bc..1d241f75c2 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -116,7 +117,7 @@ static InitChainEntry sInitChain[] = { void EnDekunuts_Init(Actor* thisx, PlayState* play) { EnDekunuts* this = (EnDekunuts*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); if (thisx->params == DEKUNUTS_FLOWER) { @@ -431,8 +432,7 @@ void EnDekunuts_BeStunned(EnDekunuts* this, PlayState* play) { void EnDekunuts_Die(EnDekunuts* this, PlayState* play) { static Vec3f effectVelAndAccel = { 0.0f, 0.0f, 0.0f }; - - s32 pad; + STACK_PAD(s32); Vec3f effectPos; if (SkelAnime_Update(&this->skelAnime)) { @@ -479,7 +479,7 @@ void EnDekunuts_ColliderCheck(EnDekunuts* this, PlayState* play) { void EnDekunuts_Update(Actor* thisx, PlayState* play) { EnDekunuts* this = (EnDekunuts*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actor.params != DEKUNUTS_FLOWER) { EnDekunuts_ColliderCheck(this, play); diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 7870669259..800427f367 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -14,6 +14,7 @@ #include "rand.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -184,7 +185,7 @@ void EnDh_Init(Actor* thisx, PlayState* play) { } void EnDh_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDh* this = (EnDh*)thisx; func_800F5B58(); @@ -364,7 +365,7 @@ void EnDh_Attack(EnDh* this, PlayState* play) { break; case 3: if ((this->actor.xzDistToPlayer <= 100.0f) && (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360))) { - s32 pad; + STACK_PAD(s32); Animation_Change(&this->skelAnime, &object_dh_Anim_004658, 1.0f, 20.0f, Animation_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f); @@ -501,7 +502,7 @@ void EnDh_Death(EnDh* this, PlayState* play) { } void EnDh_CollisionCheck(EnDh* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 lastHealth; @@ -534,10 +535,10 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) { } void EnDh_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDh* this = (EnDh*)thisx; Player* player = GET_PLAYER(play); - s32 pad40; + STACK_PAD(s32); EnDh_CollisionCheck(this, play); this->actionFunc(this, play); @@ -580,7 +581,7 @@ void EnDh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } void EnDh_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDh* this = (EnDh*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_dh.c", 1099); diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 559e4a7213..d66d2e70aa 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -5,6 +5,7 @@ */ #include "z_en_dha.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "libc64/qrand.h" @@ -12,6 +13,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_en_item00.h" @@ -186,7 +188,7 @@ void EnDha_Init(Actor* thisx, PlayState* play) { } void EnDha_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDha* this = (EnDha*)thisx; Collider_DestroyJntSph(play, &this->collider); @@ -203,12 +205,11 @@ void EnDha_SetupWait(EnDha* this) { } void EnDha_Wait(EnDha* this, PlayState* play) { - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; // unused + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f armPosMultiplier1 = { 0.0f, 0.0f, 55.0f }; Vec3f armPosMultiplier2 = { 0.0f, 0.0f, -54.0f }; Player* player = GET_PLAYER(play); - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); Vec3f playerPos = player->actor.world.pos; Vec3s angle; s16 yaw; @@ -431,7 +432,7 @@ void EnDha_UpdateHealth(EnDha* this, PlayState* play) { } void EnDha_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDha* this = (EnDha*)thisx; if (this->actor.parent == NULL) { @@ -485,7 +486,7 @@ void EnDha_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } void EnDha_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDha* this = (EnDha*)thisx; Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index bcb49b9250..3f5a598545 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -16,6 +16,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -567,7 +568,7 @@ Gfx* EnDivingGame_EmptyDList(GraphicsContext* gfxCtx) { s32 EnDivingGame_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnDivingGame* this = (EnDivingGame*)thisx; - s32 pad; + STACK_PAD(s32); if (limbIndex == 6) { rot->x += this->torsoRot.y; @@ -588,7 +589,7 @@ s32 EnDivingGame_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V void EnDivingGame_Draw(Actor* thisx, PlayState* play) { EnDivingGame* this = (EnDivingGame*)thisx; - GraphicsContext* gfxCtx = play->state.gfxCtx; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_diving_game.c", 1212); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 8dd85d8c2e..e2a6b26077 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -515,7 +516,7 @@ void EnDns_PostBurrow(EnDns* this, PlayState* play) { void EnDns_Update(Actor* thisx, PlayState* play) { EnDns* this = (EnDns*)thisx; - s16 pad; + STACK_PAD(s16); this->dustTimer++; this->actor.textId = sStartingTextIds[DNS_GET_TYPE(&this->actor)]; diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 24e881840f..714a3a5fc2 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -16,6 +16,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -87,7 +88,7 @@ void EnDntDemo_Init(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnDntDemo* this = (EnDntDemo*)thisx; s32 i; - s32 pad; + STACK_PAD(s32); PRINTF("\n\n"); PRINTF(VT_FGCOL(GREEN) @@ -342,7 +343,7 @@ void EnDntDemo_Prize(EnDntDemo* this, PlayState* play) { } void EnDntDemo_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntDemo* this = (EnDntDemo*)thisx; if (this->unkTimer2 != 0) { diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index dfaa49be28..30241652b0 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -19,6 +19,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -111,7 +112,7 @@ void EnDntJiji_Init(Actor* thisx, PlayState* play) { } void EnDntJiji_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntJiji* this = (EnDntJiji*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -387,7 +388,7 @@ void EnDntJiji_Return(EnDntJiji* this, PlayState* play) { } void EnDntJiji_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntJiji* this = (EnDntJiji*)thisx; Actor_SetScale(&this->actor, 0.015f); diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 353f42e63c..b3db01f18e 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -5,6 +5,7 @@ */ #include "z_en_dnt_nomal.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h" #include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" @@ -19,6 +20,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -138,7 +140,7 @@ static Color_RGBA8 sLeafColors[] = { }; void EnDntNomal_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntNomal* this = (EnDntNomal*)thisx; this->type = this->actor.params; @@ -179,7 +181,7 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) { } void EnDntNomal_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntNomal* this = (EnDntNomal*)thisx; if (this->type == ENDNTNOMAL_TARGET) { @@ -238,7 +240,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { f32 dz; Vec3f scoreAccel = { 0.0f, 0.0f, 0.0f }; Vec3f scoreVel = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); this->targetVtx[0].x = targetX; this->targetVtx[0].y = targetY - 24.0f; @@ -781,7 +783,7 @@ void EnDntNomal_StageReturn(EnDntNomal* this, PlayState* play) { } void EnDntNomal_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDntNomal* this = (EnDntNomal*)thisx; if (this->timer1 != 0) { @@ -896,7 +898,7 @@ void EnDntNomal_DrawStageScrub(Actor* thisx, PlayState* play) { static void* blinkTex[] = { gDntStageEyeOpenTex, gDntStageEyeHalfTex, gDntStageEyeShutTex }; EnDntNomal* this = (EnDntNomal*)thisx; Vec3f dustScale = { 0.25f, 0.25f, 0.25f }; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_dnt_nomal.c", 1790); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 2f276b25f4..8a8e9195f7 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -11,6 +11,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -288,7 +289,7 @@ s32 EnDodojr_TryEatBomb(EnDodojr* this) { void EnDodojr_UpdateCrawl(EnDodojr* this, PlayState* play) { f32 angles[] = { 0.0f, 210.0f, 60.0f, 270.0f, 120.0f, 330.0f, 180.0f, 30.0f, 240.0f, 90.0f, 300.0f, 150.0f }; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f crawlTargetPos; s16 angleIndex; diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index c7446c4f19..eef54c7a67 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -1,4 +1,5 @@ #include "z_en_dodongo.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" @@ -8,6 +9,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -254,7 +256,7 @@ void EnDodongo_SetupAction(EnDodongo* this, EnDodongoActionFunc actionFunc) { } void EnDodongo_SpawnBombSmoke(EnDodongo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.3f, 0.0f }; Vec3f pos = this->headPos; @@ -361,7 +363,7 @@ void EnDodongo_Init(Actor* thisx, PlayState* play) { } void EnDodongo_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDodongo* this = (EnDodongo*)thisx; Effect_Delete(play, this->blureIdx); @@ -437,11 +439,11 @@ void EnDodongo_EndBreatheFire(EnDodongo* this, PlayState* play) { } void EnDodongo_BreatheFire(EnDodongo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; Vec3f pos; - s16 pad2; + STACK_PAD(s16); s16 fireFrame; if ((s32)this->skelAnime.curFrame == 24) { @@ -471,7 +473,7 @@ void EnDodongo_SwallowBomb(EnDodongo* this, PlayState* play) { Vec3f deathFireAccel = { 0.0f, 1.0f, 0.0f }; s16 i; Vec3f pos; - s32 pad; + STACK_PAD(s32); if (this->actor.child != NULL) { this->actor.child->world.pos = this->mouthPos; @@ -540,7 +542,7 @@ void EnDodongo_SwallowBomb(EnDodongo* this, PlayState* play) { } void EnDodongo_Walk(EnDodongo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 playbackSpeed; Player* player = GET_PLAYER(play); s16 yawDiff = (s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y); @@ -758,7 +760,7 @@ void EnDodongo_UpdateQuad(EnDodongo* this, PlayState* play) { Vec3f sp88 = { -1000.0f, -200.0f, 1500.0f }; Vec3f sp7C = { -1000.0f, -200.0f, -1500.0f }; Vec3f sp70 = { 0.0f, 0.0f, 0.0f }; - s32 pad4C[9]; // Possibly 3 more Vec3fs? + STACK_PADS(s32, 9); // Possibly 3 more Vec3fs? s32 a = 0; s32 b = 1; // These indices are needed to match. s32 c = 2; // Might be a way to quickly test vertex arrangements @@ -779,7 +781,7 @@ void EnDodongo_UpdateQuad(EnDodongo* this, PlayState* play) { } void EnDodongo_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnDodongo* this = (EnDodongo*)thisx; EnDodongo_CollisionCheck(this, play); diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 4f25c38d08..40a45a24d8 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -6,9 +6,11 @@ #include "z_en_dog.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" #include "save.h" @@ -250,7 +252,7 @@ s32 EnDog_Orient(EnDog* this, PlayState* play) { void EnDog_Init(Actor* thisx, PlayState* play) { EnDog* this = (EnDog*)thisx; s16 followingDog; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, 13); @@ -311,7 +313,7 @@ void EnDog_Destroy(Actor* thisx, PlayState* play) { void EnDog_FollowPath(EnDog* this, PlayState* play) { s32 behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK }; - s32 unused[] = { 40, 80, 20 }; + UNUSED s32 unused[] = { 40, 80, 20 }; f32 speedXZ; s32 frame; @@ -457,7 +459,7 @@ void EnDog_Wait(EnDog* this, PlayState* play) { void EnDog_Update(Actor* thisx, PlayState* play) { EnDog* this = (EnDog*)thisx; - s32 pad; + STACK_PAD(s32); EnDog_PlayAnimAndSFX(this); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.h b/src/overlays/actors/ovl_En_Dog/z_en_dog.h index 7595d752ae..7902f4516b 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.h +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.h @@ -17,9 +17,9 @@ typedef struct EnDog { /* 0x01E4 */ u8 reverse; /* 0x01E6 */ s16 waypoint; /* 0x01E8 */ s16 unusedAngle; - /* 0x01EA */ s16 pad1; + /* 0x01EA */ char unk_1EA[0x2]; /* 0x01EC */ s16 behaviorTimer; - /* 0x01EE */ s16 pad2; + /* 0x01EE */ char unk_1EE[0x2]; /* 0x01F0 */ s16 nextBehavior; /* 0x01F2 */ s16 behavior; /* 0x01F4 */ Vec3s jointTable[13]; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 1568736109..a5d892ed70 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -225,7 +226,7 @@ void EnDs_Wait(EnDs* this, PlayState* play) { player->actor.textId = 0x500C; this->actionFunc = EnDs_OfferBluePotion; } else { - s16 pad; + STACK_PAD(s16); if (INV_CONTENT(ITEM_ODD_MUSHROOM) == ITEM_ODD_MUSHROOM) { player->actor.textId = 0x5049; diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index a89c572a83..ddcf8bfc11 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -5,6 +5,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -291,7 +292,7 @@ void func_809FE104(EnDu* this) { void EnDu_Init(Actor* thisx, PlayState* play) { EnDu* this = (EnDu*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0); @@ -565,7 +566,7 @@ void func_809FECE4(EnDu* this, PlayState* play) { void EnDu_Update(Actor* thisx, PlayState* play) { EnDu* this = (EnDu*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index a3ae11bf61..34ca065ee7 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -11,6 +11,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -105,7 +106,7 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play) { 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02, 0x00 }; EnDyExtra* this = (EnDyExtra*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); Vtx* vertices = SEGMENTED_TO_VIRTUAL(gGreatFairySpiralBeamVtx); s32 i; u8 unk[3]; diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index f0a5b4466e..64ca6db0e3 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -5,6 +5,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_en_item00.h" #include "z_lib.h" #include "effect.h" @@ -129,7 +130,7 @@ static InitChainEntry sInitChain[] = { */ void EnEiyer_Init(Actor* thisx, PlayState* play) { EnEiyer* this = (EnEiyer*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 600.0f, ActorShadow_DrawCircle, 65.0f); @@ -421,7 +422,7 @@ void EnEiyer_Ambush(EnEiyer* this, PlayState* play) { void EnEiyer_Glide(EnEiyer* this, PlayState* play) { f32 curFrame; - s32 pad; + STACK_PAD(s32); s16 yawChange; SkelAnime_Update(&this->skelanime); @@ -647,7 +648,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { void EnEiyer_Update(Actor* thisx, PlayState* play) { EnEiyer* this = (EnEiyer*)thisx; - s32 pad; + STACK_PAD(s32); EnEiyer_UpdateDamage(this, play); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index b40e670140..f3b1f6a780 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -16,6 +16,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" @@ -335,7 +336,7 @@ f32 EnElf_GetColorValue(s32 colorFlag) { void EnElf_Init(Actor* thisx, PlayState* play) { EnElf* this = (EnElf*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 colorConfig; s32 i; @@ -456,7 +457,7 @@ void func_80A029A8(EnElf* this, s16 increment) { } void EnElf_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnElf* this = (EnElf*)thisx; LightContext_RemoveLight(play, &play->lightCtx, this->lightNodeGlow); @@ -560,7 +561,7 @@ void func_80A02F2C(EnElf* this, Vec3f* targetPos) { } void func_80A03018(EnElf* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Player* player = GET_PLAYER(play); s16 targetYaw; Vec3f* unk_28C = &this->unk_28C; @@ -622,7 +623,7 @@ void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { void func_80A0329C(EnElf* this, PlayState* play) { Player* refActor = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); f32 heightDiff; @@ -1207,7 +1208,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { void EnElf_SpawnSparkles(EnElf* this, PlayState* play, s32 sparkleLife) { static Vec3f sparkleVelocity = { 0.0f, -0.05f, 0.0f }; static Vec3f sparkleAccel = { 0.0f, -0.025f, 0.0f }; - s32 pad; + STACK_PAD(s32); Vec3f sparklePos; Color_RGBA8 primColor; Color_RGBA8 envColor; @@ -1229,7 +1230,7 @@ void EnElf_SpawnSparkles(EnElf* this, PlayState* play, s32 sparkleLife) { } void func_80A04D90(EnElf* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 bgId; this->actor.floorHeight = BgCheck_EntityRaycastDown5(play, &play->colCtx, &this->actor.floorPoly, &bgId, @@ -1394,7 +1395,7 @@ void func_80A052F4(Actor* thisx, PlayState* play) { void func_80A053F0(Actor* thisx, PlayState* play) { u8 unk2C7; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); EnElf* this = (EnElf*)thisx; @@ -1488,7 +1489,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { } void EnElf_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnElf* this = (EnElf*)thisx; this->actionFunc(this, play); @@ -1503,7 +1504,7 @@ void EnElf_Update(Actor* thisx, PlayState* play) { s32 EnElf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); f32 scale; Vec3f mtxMult; EnElf* this = (EnElf*)thisx; @@ -1532,11 +1533,11 @@ s32 EnElf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p } void EnElf_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 alphaScale; s32 envAlpha; EnElf* this = (EnElf*)thisx; - s32 pad1; + STACK_PAD(s32); Gfx* dListHead; Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index d43571b7d6..8bb214c625 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -5,6 +5,7 @@ #include "printf.h" #include "rand.h" #include "regs.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -38,7 +39,7 @@ ActorProfile En_Encount1_Profile = { }; void EnEncount1_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnEncount1* this = (EnEncount1*)thisx; f32 spawnRange; @@ -323,7 +324,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) { } void EnEncount1_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnEncount1* this = (EnEncount1*)thisx; if (this->timer != 0) { diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index b1f714e5df..a8903afd72 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -8,6 +8,7 @@ #include "quake.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -75,7 +76,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { } void EnEncount2_Wait(EnEncount2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 quakeIndex; s16 spawnerState; Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 6c232529e7..5762f89e2d 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -13,6 +13,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -63,7 +64,7 @@ void EnExItem_Destroy(Actor* thisx, PlayState* play) { } void EnExItem_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnExItem* this = (EnExItem*)thisx; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; @@ -276,7 +277,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { } void EnExItem_BowlPrize(EnExItem* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 tmpf1; f32 tmpf2; f32 tmpf3; @@ -436,7 +437,7 @@ void EnExItem_TargetPrizeFinish(EnExItem* this, PlayState* play) { } void EnExItem_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnExItem* this = (EnExItem*)thisx; if (this->timer != 0) { @@ -452,7 +453,7 @@ void EnExItem_Update(Actor* thisx, PlayState* play) { } void EnExItem_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnExItem* this = (EnExItem*)thisx; s32 magicType; diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index c9dd249402..541b22ea76 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -1,4 +1,5 @@ #include "z_en_ex_ruppy.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h" #include "libc64/qrand.h" @@ -8,6 +9,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -40,7 +42,7 @@ static s16 sEnExRuppyCollectibleTypes[] = { }; // Unused, as the function sets these directly -static s16 sRupeeValues[] = { +UNUSED static s16 sRupeeValues[] = { 1, 5, 20, 500, 50, }; @@ -260,7 +262,7 @@ void EnExRuppy_EnterWater(EnExRuppy* this, PlayState* play) { void EnExRuppy_Sink(EnExRuppy* this, PlayState* play) { EnDivingGame* divingGame; Vec3f pos; - s32 pad; + STACK_PAD(s32); if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) { pos = this->actor.world.pos; @@ -280,8 +282,8 @@ void EnExRuppy_Sink(EnExRuppy* this, PlayState* play) { void EnExRuppy_WaitInGame(EnExRuppy* this, PlayState* play) { EnDivingGame* divingGame; - Vec3f D_80A0B388 = { 0.0f, 0.1f, 0.0f }; - Vec3f D_80A0B394 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f D_80A0B388 = { 0.0f, 0.1f, 0.0f }; + UNUSED Vec3f D_80A0B394 = { 0.0f, 0.0f, 0.0f }; f32 localConst = 30.0f; if (this->timer == 0) { @@ -328,7 +330,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, PlayState* play) { f32 distToBlowUp = 50.0f; s16 explosionScale; s16 explosionScaleStep; - s32 pad; + STACK_PAD(s32); if (this->type == 2) { distToBlowUp = 30.0f; @@ -392,7 +394,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) { static void* rupeeTextures[] = { gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex, }; - s32 pad; + STACK_PAD(s32); EnExRuppy* this = (EnExRuppy*)thisx; if (!this->invisible) { diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 8050aef560..f80e1ef1c3 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -6,6 +6,7 @@ #include "z_en_fd.h" +#include "attributes.h" #include "libc64/math64.h" #include "libc64/qrand.h" #include "gfx.h" @@ -13,6 +14,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -342,7 +344,7 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, PlayState* play) { s32 bgId; Vec3f colPoint; s16 angle; - s32 pad; + STACK_PAD(s32); // Check to see if `actor` is within 400 units of `this` if (Math_Vec3f_DistXYZ(&this->actor.world.pos, &actor->world.pos) > 400.0f) { @@ -672,7 +674,7 @@ void EnFd_WaitForCore(EnFd* this, PlayState* play) { void EnFd_Update(Actor* thisx, PlayState* play) { EnFd* this = (EnFd*)thisx; - s32 pad; + STACK_PAD(s32); if (this->firstUpdateFlag) { func_800F5ACC(NA_BGM_MINI_BOSS); @@ -733,8 +735,8 @@ s32 EnFd_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnFd_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) { EnFd* this = (EnFd*)thisx; - Vec3f unused0 = { 6800.0f, 0.0f, 0.0f }; - Vec3f unused1 = { 6800.0f, 0.0f, 0.0f }; + UNUSED Vec3f unused0 = { 6800.0f, 0.0f, 0.0f }; + UNUSED Vec3f unused1 = { 6800.0f, 0.0f, 0.0f }; Vec3f initialPos = { 0.0f, 0.0f, 0.0f }; Vec3f pos = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; @@ -783,7 +785,7 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { { 255, 0, 0, 255 }, }; u32 frames; - s32 pad; + STACK_PAD(s32); frames = play->state.frames; @@ -902,7 +904,7 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) { }; s16 i; s16 idx; - s16 pad; + STACK_PAD(s16); s16 materialFlag; EnFdEffect* eff = this->effects; diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index a26b54a64a..92e9630463 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -1,9 +1,11 @@ #include "z_en_fd_fire.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -131,7 +133,7 @@ s32 EnFdFire_CheckCollider(EnFdFire* this, PlayState* play) { void EnFdFire_Init(Actor* thisx, PlayState* play) { EnFdFire* this = (EnFdFire*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); @@ -219,7 +221,7 @@ void EnFdFire_Disappear(EnFdFire* this, PlayState* play) { void EnFdFire_Update(Actor* thisx, PlayState* play) { EnFdFire* this = (EnFdFire*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actionFunc != EnFdFire_Disappear) { if ((this->actor.parent->update == NULL) || EnFdFire_CheckCollider(this, play)) { @@ -247,10 +249,10 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { { 255, 10, 0, 255 }, { 0, 10, 255, 255 }, }; - s32 pad; + STACK_PAD(s32); EnFdFire* this = (EnFdFire*)thisx; Vec3f scale = { 0.0f, 0.0f, 0.0f }; - Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; s16 sp8E; f32 sp88; f32 sp84; diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 793f6a5e82..38683c9fa5 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -19,6 +19,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -99,7 +100,7 @@ void EnFhgFire_SetUpdate(EnFhgFire* this, EnFhgFireUpdateFunc updateFunc) { } void EnFhgFire_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFhgFire* this = (EnFhgFire*)thisx; Player* player = GET_PLAYER(play); @@ -181,7 +182,7 @@ void EnFhgFire_Init(Actor* thisx, PlayState* play) { } void EnFhgFire_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFhgFire* this = (EnFhgFire*)thisx; if ((this->actor.params == FHGFIRE_LIGHTNING_SHOCK) || (this->actor.params == FHGFIRE_LIGHTNING_BURST) || @@ -701,7 +702,7 @@ void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) { } void EnFhgFire_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFhgFire* this = (EnFhgFire*)thisx; this->work[FHGFIRE_VARIANCE_TIMER]++; @@ -716,12 +717,12 @@ void EnFhgFire_Update(Actor* thisx, PlayState* play) { this->updateFunc(this, play); } -static void* sDustTextures[] = { +UNUSED static void* sDustTextures[] = { gDust1Tex, gDust2Tex, gDust3Tex, gDust4Tex, gDust5Tex, gDust6Tex, gDust7Tex, gDust8Tex, }; void EnFhgFire_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFhgFire* this = (EnFhgFire*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_fhg_fire.c", 1723); diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index f07d0ac868..409b751d99 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -8,6 +8,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -84,10 +85,9 @@ static ColliderCylinderInit D_80A12CCC = { }; void EnFireRock_Init(Actor* thisx, PlayState* play) { - PlayState* play2 = play; + STACK_PAD(s32); Player* player = GET_PLAYER(play); EnFireRock* this = (EnFireRock*)thisx; - s16 temp; this->type = this->actor.params; if (this->type != FIRE_ROCK_CEILING_SPOT_SPAWNER) { @@ -244,7 +244,6 @@ void EnFireRock_SpawnMoreBrokenPieces(EnFireRock* this, PlayState* play) { EnFireRock* spawnedFireRock; s32 nextRockType; s32 i; - s32 temp; nextRockType = FIRE_ROCK_SPAWNED_FALLING1; switch (this->type) { @@ -399,7 +398,7 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { void EnFireRock_Draw(Actor* thisx, PlayState* play) { EnFireRock* this = (EnFireRock*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_fire_rock.c", 747); Matrix_Translate(thisx->world.pos.x + this->relativePos.x, thisx->world.pos.y + this->relativePos.y, diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index ce2cb23937..78b918fa28 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -176,7 +177,7 @@ void EnFish_SetYOffset(EnFish* this) { } s32 EnFish_InBottleRange(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f sp1C; @@ -239,7 +240,7 @@ void EnFish_Respawning_SetupFollowChild(EnFish* this) { } void EnFish_Respawning_FollowChild(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFish_SetYOffset(this); Math_SmoothStepToF(&this->actor.speed, 1.8f, 0.08f, 0.4f, 0.0f); @@ -275,8 +276,8 @@ void EnFish_Respawning_SetupFleePlayer(EnFish* this) { } void EnFish_Respawning_FleePlayer(EnFish* this, PlayState* play) { - s32 pad; - s16 pad2; + STACK_PAD(s32); + STACK_PAD(s16); s16 frames; s16 yaw; s16 playerClose; @@ -330,9 +331,9 @@ void EnFish_Respawning_SetupApproachPlayer(EnFish* this) { } void EnFish_Respawning_ApproachPlayer(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); - s32 pad2; + STACK_PAD(s32); Vec3f sp38; s16 yaw; s16 temp_a0_2; @@ -409,7 +410,7 @@ void EnFish_Dropped_Fall(EnFish* this, PlayState* play) { * height and whether the sound should play again. */ void EnFish_Dropped_SetupFlopOnGround(EnFish* this) { - s32 pad; + STACK_PAD(s32); f32 randomFloat; s32 playSfx; @@ -444,7 +445,7 @@ void EnFish_Dropped_SetupFlopOnGround(EnFish* this) { } void EnFish_Dropped_FlopOnGround(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 frames = play->state.frames; s16 targetXRot; @@ -496,7 +497,7 @@ void EnFish_Dropped_SetupSwimAway(EnFish* this) { } void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Math_SmoothStepToF(&this->actor.speed, 2.8f, 0.1f, 0.4f, 0.0f); @@ -549,9 +550,9 @@ void EnFish_Unique_SwimIdle(EnFish* this, PlayState* play) { f32 playSpeed; u32 frames = play->gameplayFrames; f32* speed; - s32 pad2; + STACK_PAD(s32); f32 extraPlaySpeed; - s32 pad3; + STACK_PAD(s32); if (this->actor.xzDistToPlayer < 60.0f) { if (this->timer < 12) { @@ -617,7 +618,7 @@ void EnFish_Cutscene_FlopOnGround(EnFish* this, PlayState* play) { } void EnFish_Cutscene_WiggleFlyingThroughAir(EnFish* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 sp28 = Math_SinS(this->slowPhase); f32 sp24 = Math_SinS(this->fastPhase); @@ -629,8 +630,7 @@ void EnFish_Cutscene_WiggleFlyingThroughAir(EnFish* this, PlayState* play) { } void EnFish_UpdateCutscene(EnFish* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); CsCmdActorCue* cue = play->csCtx.actorCues[1]; Vec3f startPos; Vec3f endPos; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 2c102649c3..f18eb7650c 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -136,7 +137,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { EnFloormas* this = (EnFloormas*)thisx; PlayState* play = play2; s32 invisble; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); @@ -534,7 +535,7 @@ void EnFloormas_Run(EnFloormas* this, PlayState* play) { } void EnFloormas_Turn(EnFloormas* this, PlayState* play) { - char pad[4]; + STACK_PAD(s32); f32 sp30; f32 sp2C; @@ -986,7 +987,7 @@ void EnFloormas_Freeze(EnFloormas* this, PlayState* play) { } void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 isSmall; if (this->collider.base.acFlags & AC_HIT) { @@ -1032,7 +1033,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { void EnFloormas_Update(Actor* thisx, PlayState* play) { EnFloormas* this = (EnFloormas*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actionFunc != EnFloormas_SmallWait) { if (this->collider.base.atFlags & AT_HIT) { diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 17889ad568..f50e06391d 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1,6 +1,7 @@ #include "z_en_fr.h" #include "array_count.h" +#include "attributes.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -11,6 +12,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -298,9 +300,9 @@ void EnFr_DrawActive(EnFr* this) { void EnFr_Update(Actor* thisx, PlayState* play) { EnFr* this = (EnFr*)thisx; - s32 pad; + STACK_PAD(s32); s32 frogIndex; - s32 pad2; + STACK_PAD(s32); if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; @@ -1070,7 +1072,7 @@ s32 EnFr_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po } void EnFr_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - EnFr* this = (EnFr*)thisx; + UNUSED EnFr* this = (EnFr*)thisx; if ((limbIndex == 7) || (limbIndex == 8)) { OPEN_DISPS(play->state.gfxCtx, "../z_en_fr.c", 1735); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index e8cfb6342f..aa3f754159 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -87,7 +88,7 @@ typedef enum EnFuFace { } EnFuFace; void EnFu_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFu* this = (EnFu*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); @@ -249,7 +250,7 @@ void EnFu_WaitAdult(EnFu* this, PlayState* play) { } void EnFu_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnFu* this = (EnFu*)thisx; Collider_UpdateCylinder(&this->actor, &this->collider); @@ -274,7 +275,7 @@ void EnFu_Update(Actor* thisx, PlayState* play) { s32 EnFu_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnFu* this = (EnFu*)thisx; - s32 pad; + STACK_PAD(s32); if (limbIndex == FU_LIMB_UNK) { return false; @@ -310,7 +311,7 @@ void EnFu_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void EnFu_Draw(Actor* thisx, PlayState* play) { static void* sEyesSegments[] = { gWindmillManEyeClosedTex, gWindmillManEyeAngryTex }; static void* sMouthSegments[] = { gWindmillManMouthOpenTex, gWindmillManMouthAngryTex }; - s32 pad; + STACK_PAD(s32); EnFu* this = (EnFu*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_fu.c", 773); diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index fc0c1363bb..d30b791024 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -6,6 +6,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -681,7 +682,7 @@ static EnFzSpawnIceSmokeFunc iceSmokeSpawnFuncs[] = { void EnFz_Update(Actor* thisx, PlayState* play) { EnFz* this = (EnFz*)thisx; - s32 pad; + STACK_PAD(s32); this->counter++; @@ -730,7 +731,7 @@ void EnFz_Draw(Actor* thisx, PlayState* play) { gFreezardHeadChippedDL, // Entire head chipped off (1 or 2 health) }; EnFz* this = (EnFz*)thisx; - s32 pad; + STACK_PAD(s32); s32 index; index = (6 - this->actor.colChkInfo.health) >> 1; diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index bc8c75c255..6b8a4844c8 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -5,6 +5,7 @@ */ #include "z_en_g_switch.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" @@ -17,6 +18,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -80,7 +82,7 @@ static ColliderCylinderInit sCylinderInit = { }; // Unused, but probably intended to be this -static s16 sRupeeTypes[] = { +UNUSED static s16 sRupeeTypes[] = { ITEM00_RUPEE_GREEN, ITEM00_RUPEE_BLUE, ITEM00_RUPEE_RED, ITEM00_RUPEE_ORANGE, ITEM00_RUPEE_PURPLE, }; @@ -97,7 +99,7 @@ ActorProfile En_G_Switch_Profile = { }; void EnGSwitch_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGSwitch* this = (EnGSwitch*)thisx; if (play) {} @@ -187,7 +189,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { } void EnGSwitch_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGSwitch* this = (EnGSwitch*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -394,7 +396,7 @@ void EnGSwitch_ArcheryPot(EnGSwitch* this, PlayState* play) { f32 rand; s32 phi_s0; s32 scale; - s32 pad; + STACK_PAD(s32); pos.x = sn * 8.0f; pos.y = 10.0f + Rand_CenteredFloat(5.0f); @@ -438,7 +440,7 @@ void EnGSwitch_Kill(EnGSwitch* this, PlayState* play) { } void EnGSwitch_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGSwitch* this = (EnGSwitch*)thisx; this->actionFunc(this, play); @@ -571,7 +573,7 @@ void EnGSwitch_DrawEffects(EnGSwitch* this, PlayState* play) { EnGSwitchEffect* effect = this->effects; s16 i; f32 scale; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_en_g_switch.c", 1073); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index c7f32b7bd7..6c396fdd2a 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -7,9 +7,11 @@ #include "z_en_ganon_mant.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "tex_len.h" @@ -70,7 +72,7 @@ static f32 sBackSwayCoefficients[GANON_MANT_NUM_JOINTS] = { 0.0f, 1.0f, 0.5f, 0.25f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, }; -static f32 D_80A24DB4[] = { +UNUSED static f32 D_80A24DB4[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, }; @@ -79,7 +81,7 @@ static f32 sSideSwayCoefficients[GANON_MANT_NUM_JOINTS] = { 0.0f, 1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.1f, 0.0f, }; -static f32 D_80A24E00[] = { +UNUSED static f32 D_80A24E00[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, }; @@ -87,7 +89,7 @@ static f32 sDistMultipliers[GANON_MANT_NUM_JOINTS] = { 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, }; -static f32 D_80A24E48[] = { +UNUSED static f32 D_80A24E48[] = { 1.8f, }; @@ -103,7 +105,7 @@ static u16 sVerticesMap[GANON_MANT_NUM_STRANDS * GANON_MANT_NUM_JOINTS] = { MAP_STRAND_TO_VTX(3), MAP_STRAND_TO_VTX(2), MAP_STRAND_TO_VTX(1), MAP_STRAND_TO_VTX(0), }; -static u64 sForceAlignment = 0; +UNUSED static u64 sForceAlignment = 0; #define gMantTex_WIDTH 32 #define gMantTex_HEIGHT 64 @@ -150,7 +152,7 @@ void EnGanonMant_Destroy(Actor* thisx, PlayState* play) { * Randomly zeros portions of the cloak texture */ void EnGanonMant_Tear(EnGanonMant* this) { - s32 pad; + STACK_PAD(s32); s16 i; s16 areaX; s16 areaY; @@ -194,7 +196,7 @@ void EnGanonMant_UpdateStrand(PlayState* play, EnGanonMant* this, Vec3f* root, V f32 xDiff; f32 zDiff; f32 gravity; - s32 pad[4]; + STACK_PADS(s32, 4); f32 yaw; s16 i; f32 x; @@ -393,7 +395,7 @@ void EnGanonMant_Update(Actor* thisx, PlayState* play) { } void EnGanonMant_DrawCloak(PlayState* play, EnGanonMant* this) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ganon_mant.c", 564); diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index 0830301e04..466a22e9c2 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -6,6 +6,7 @@ #include "z_en_ganon_organ.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -34,7 +35,7 @@ ActorProfile En_Ganon_Organ_Profile = { /**/ EnGanonOrgan_Draw, }; -static u64 sForceAlignment = 0; +UNUSED static u64 sForceAlignment = 0; #define sRoomCarpetTex_WIDTH 64 #define sRoomCarpetTex_HEIGHT 16 diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index ccf8740470..7dd0ccf1ac 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -14,6 +14,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "light.h" @@ -166,7 +167,7 @@ void func_80A2F180(EnGb* this) { void EnGb_Init(Actor* thisx, PlayState* play) { EnGb* this = (EnGb*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; s32 i; f32 rand; @@ -199,7 +200,7 @@ void EnGb_Init(Actor* thisx, PlayState* play) { this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100; for (i = 0; i < ARRAY_COUNT(sCagedSoulPositions); i++) { - s32 pad; + STACK_PAD(s32); this->cagedSouls[i].infoIdx = (s32)Rand_ZeroFloat(30.0f) % 3; this->cagedSouls[i].unk_14.x = this->cagedSouls[i].translation.x = @@ -298,7 +299,7 @@ void func_80A2F83C(EnGb* this, PlayState* play) { } } if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) { - s32 pad; + STACK_PAD(s32); switch (Actor_GetPlayerExchangeItemId(play)) { case EXCH_ITEM_NONE: @@ -438,7 +439,7 @@ void EnGb_Update(Actor* thisx, PlayState* play2) { void EnGb_Draw(Actor* thisx, PlayState* play) { EnGb* this = (EnGb*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_gb.c", 763); @@ -532,7 +533,7 @@ void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) { } void EnGb_DrawCagedSouls(EnGb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 i; OPEN_DISPS(play->state.gfxCtx, "../z_en_gb.c", 914); diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 6d08efd921..395d5f71d8 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -12,6 +12,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -102,7 +103,7 @@ static void* sEyeTextures[] = { }; void EnGe1_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGe1* this = (EnGe1*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); @@ -700,7 +701,7 @@ void EnGe1_Wait_Archery(EnGe1* this, PlayState* play) { // General functions void EnGe1_TurnToFacePlayer(EnGe1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 angleDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(angleDiff) <= 0x4000) { @@ -731,7 +732,7 @@ void EnGe1_LookAtPlayer(EnGe1* this, PlayState* play) { } void EnGe1_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGe1* this = (EnGe1*)thisx; Collider_UpdateCylinder(&this->actor, &this->collider); @@ -777,7 +778,7 @@ void EnGe1_StopFidget(EnGe1* this) { } s32 EnGe1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { - s32 pad; + STACK_PAD(s32); EnGe1* this = (EnGe1*)thisx; if (limbIndex == GE1_LIMB_HEAD) { @@ -813,7 +814,7 @@ void EnGe1_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } void EnGe1_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGe1* this = (EnGe1*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_ge1.c", 1442); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index c40402d602..522fa6a7b0 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -6,11 +6,13 @@ #include "z_en_ge2.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -128,7 +130,7 @@ void EnGe2_ChangeAction(EnGe2* this, s32 i) { void EnGe2_Init(Actor* thisx, PlayState* play) { EnGe2* this = (EnGe2*)thisx; - s16 params = this->actor.params; + UNUSED s16 params = this->actor.params; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, 22); @@ -405,7 +407,7 @@ void EnGe2_Stand(EnGe2* this, PlayState* play) { } void EnGe2_TurnToFacePlayer(EnGe2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 angleDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(angleDiff) <= 0x4000) { @@ -500,8 +502,7 @@ void EnGe2_SetupCapturePlayer(EnGe2* this, PlayState* play) { } void EnGe2_MaintainColliderAndSetAnimState(EnGe2* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -660,7 +661,7 @@ void EnGe2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void EnGe2_Draw(Actor* thisx, PlayState* play) { static void* eyeTextures[] = { gGerudoPurpleEyeOpenTex, gGerudoPurpleEyeHalfTex, gGerudoPurpleEyeClosedTex }; - s32 pad; + STACK_PAD(s32); EnGe2* this = (EnGe2*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_ge2.c", 1274); diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index ad77c01118..4a37ee6742 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -104,7 +105,7 @@ void EnGe3_Destroy(Actor* thisx, PlayState* play) { } void EnGe3_TurnToFacePlayer(EnGe3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 angleDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(angleDiff) <= 0x4000) { @@ -182,8 +183,7 @@ void EnGe3_ForceTalk(EnGe3* this, PlayState* play) { } void EnGe3_UpdateCollision(EnGe3* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 11850ccdf5..7391fcf88c 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -6,6 +6,7 @@ #include "z_en_geldb.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -14,6 +15,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -227,14 +229,14 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP), }; -static Vec3f sUnusedOffset = { 1100.0f, -700.0f, 0.0f }; +UNUSED static Vec3f sUnusedOffset = { 1100.0f, -700.0f, 0.0f }; void EnGeldB_SetupAction(EnGeldB* this, EnGeldBActionFunc actionFunc) { this->actionFunc = actionFunc; } void EnGeldB_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EffectBlureInit1 blureInit; EnGeldB* this = (EnGeldB*)thisx; @@ -277,7 +279,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { } void EnGeldB_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGeldB* this = (EnGeldB*)thisx; func_800F5B58(); @@ -442,7 +444,7 @@ void EnGeldB_SetupReady(EnGeldB* this) { void EnGeldB_Ready(EnGeldB* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 angleToLink; SkelAnime_Update(&this->skelAnime); @@ -673,7 +675,7 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) { s16 phi_v1; s32 afterPrevFrame; s32 prevFrame; - s32 pad; + STACK_PAD(s32); s32 beforeCurFrame; Player* player = GET_PLAYER(play); @@ -787,7 +789,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, PlayState* play) { void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) { s16 phi_v1; s32 prevFrame; - s32 pad; + STACK_PAD(s32); s32 beforeCurFrame; s32 afterPrevFrame; @@ -1155,7 +1157,7 @@ void EnGeldB_SetupBlock(EnGeldB* this) { void EnGeldB_Block(EnGeldB* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 angleToLink; s16 angleFacingLink; @@ -1381,7 +1383,7 @@ void EnGeldB_TurnHead(EnGeldB* this, PlayState* play) { } void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnItem00* key; if (this->blockCollider.base.acFlags & AC_BOUNCED) { @@ -1425,7 +1427,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { } void EnGeldB_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGeldB* this = (EnGeldB*)thisx; EnGeldB_CollisionCheck(this, play); @@ -1581,7 +1583,7 @@ void EnGeldB_Draw(Actor* thisx, PlayState* play) { }; static void* eyeTextures[] = { gGerudoRedEyeOpenTex, gGerudoRedEyeHalfTex, gGerudoRedEyeShutTex, gGerudoRedEyeHalfTex }; - s32 pad; + STACK_PAD(s32); EnGeldB* this = (EnGeldB*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_geldB.c", 2672); diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 4bfe862466..b358d7d18f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -6,6 +6,7 @@ #include "z_en_girla.h" +#include "attributes.h" #include "printf.h" #include "rand.h" #include "sys_matrix.h" @@ -907,7 +908,7 @@ void EnGirlA_Noop(EnGirlA* this, PlayState* play) { void EnGirlA_SetItemDescription(PlayState* play, EnGirlA* this) { ShopItemEntry* tmp = &sShopItemEntries[this->actor.params]; - s32 params = this->actor.params; + UNUSED s32 params = this->actor.params; if ((this->actor.params >= SI_KEATON_MASK) && (this->actor.params <= SI_MASK_OF_TRUTH)) { s32 maskId = this->actor.params - SI_KEATON_MASK; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 3c0b766413..6999a97fa3 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -13,6 +13,7 @@ #include "printf.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -204,7 +205,7 @@ void func_80A3DBF4(EnGm* this, PlayState* play) { void func_80A3DC44(EnGm* this, PlayState* play) { f32 dx; f32 dz; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); EnGm_SetTextID(this); @@ -333,7 +334,7 @@ void func_80A3E090(EnGm* this) { void EnGm_Draw(Actor* thisx, PlayState* play) { static void* eyeTextures[] = { gGoronCsEyeOpenTex, gGoronCsEyeHalfTex, gGoronCsEyeClosedTex }; EnGm* this = (EnGm*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_gm.c", 613); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index aa911c2f19..80e24c4789 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -9,6 +9,7 @@ #include "one_point_cutscene.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -640,9 +641,9 @@ void func_80A3F908(EnGo* this, PlayState* play) { void EnGo_Init(Actor* thisx, PlayState* play) { EnGo* this = (EnGo*)thisx; - s32 pad; - Vec3f D_80A41B9C = { 0.0f, 0.0f, 0.0f }; // unused - Vec3f D_80A41BA8 = { 0.0f, 0.0f, 0.0f }; // unused + STACK_PAD(s32); + UNUSED Vec3f D_80A41B9C = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f D_80A41BA8 = { 0.0f, 0.0f, 0.0f }; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, NULL, NULL, 0); @@ -1041,7 +1042,7 @@ void func_80A40DCC(EnGo* this, PlayState* play) { } void EnGo_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnGo* this = (EnGo*)thisx; Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index d437df1c08..84bb879ba6 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -11,6 +11,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -178,7 +179,7 @@ static EnGo2DustEffectData sDustEffectData[2][4] = { }, }; -static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; +UNUSED static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; void EnGo2_SpawnEffectDust(EnGo2* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, u8 initialTimer, f32 scale, f32 scaleStep) { @@ -588,7 +589,7 @@ u16 EnGo2_GetTextIdGoronDmtBiggoron(PlayState* play, EnGo2* this) { } s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { - s32 unusedPad; + STACK_PAD(s32); u8 dialogState = this->dialogState; switch (EnGo2_GetDialogState(this, play)) { @@ -1535,7 +1536,7 @@ void EnGo2_BiggoronAnimation(EnGo2* this) { void EnGo2_Init(Actor* thisx, PlayState* play) { EnGo2* this = (EnGo2*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, 18); @@ -2036,7 +2037,7 @@ s32 EnGo2_DrawCurledUp(EnGo2* this, PlayState* play) { } s32 EnGo2_DrawRolling(EnGo2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f D_80A48560 = { 0.0f, 0.0f, 0.0f }; f32 speedXZ; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 2bec2f55d9..043a11102a 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -3,6 +3,7 @@ #include "ultra64.h" #include "actor.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Go/z_en_go.h" struct EnGo2; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index d13c4a85f8..8ee59938b6 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -15,6 +15,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -722,7 +723,7 @@ void EnGoma_SetFloorRot(EnGoma* this) { void EnGoma_Update(Actor* thisx, PlayState* play) { EnGoma* this = (EnGoma*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); if (this->actionTimer != 0) { @@ -806,7 +807,7 @@ Gfx* EnGoma_NoBackfaceCullingDlist(GraphicsContext* gfxCtx) { void EnGoma_Draw(Actor* thisx, PlayState* play) { EnGoma* this = (EnGoma*)thisx; s32 y; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_goma.c", 2040); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 06e1dae817..8b9e0a7551 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -8,12 +8,14 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" +#include "attributes.h" #include "ichain.h" #include "printf.h" #include "quake.h" #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -99,14 +101,16 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; -static f32 sSpeeds[] = { 10.0f, 9.2f }; - #if DEBUG_FEATURES #define EN_GOROIWA_SPEED(this) (R_EN_GOROIWA_SPEED * 0.01f) +#define SPEEDS_QUALIFIERS UNUSED #else #define EN_GOROIWA_SPEED(this) sSpeeds[(this)->isInKokiri] +#define SPEEDS_QUALIFIERS #endif +SPEEDS_QUALIFIERS static f32 sSpeeds[] = { 10.0f, 9.2f }; + void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { static f32 yOffsets[] = { 0.0f, 59.5f }; Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; @@ -117,7 +121,7 @@ void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { } void EnGoroiwa_InitCollider(EnGoroiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); @@ -261,7 +265,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) { } s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -322,7 +326,7 @@ void EnGoroiwa_SpawnWaterEffects(PlayState* play, Vec3f* contactPos) { s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Path* path; s32 result; - s32 pad; + STACK_PAD(s32); Vec3s* nextPointPos; Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f); @@ -338,7 +342,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; - s32 pad; + STACK_PAD(s32); Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; s32 nextPointReached; @@ -368,7 +372,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; @@ -379,7 +383,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; f32 nextPointY; @@ -389,7 +393,7 @@ s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { CollisionPoly* floorPoly; Vec3f checkPos; f32 floorY; - s32 pad2; + STACK_PAD(s32); s32 floorBgId; Vec3f dustPos; WaterBox* waterBox; @@ -455,7 +459,7 @@ s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { static Vec3f unitY = { 0.0f, 1.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); Vec3f* rollAxisPtr; f32 rollAngleDiff; Vec3f rollAxis; @@ -516,7 +520,7 @@ void EnGoroiwa_SpawnFragments(EnGoroiwa* this, PlayState* play) { static f32 yOffsets[] = { 0.0f, 59.5f }; s16 angle1; s16 angle2; - s32 pad; + STACK_PAD(s32); Vec3f* thisPos = &this->actor.world.pos; Vec3f effectPos; Vec3f fragmentVelocity; @@ -751,7 +755,7 @@ void EnGoroiwa_MoveDown(EnGoroiwa* this, PlayState* play) { void EnGoroiwa_Update(Actor* thisx, PlayState* play) { EnGoroiwa* this = (EnGoroiwa*)thisx; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s32 bgId; if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 77db13b027..daacd34f4e 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -13,6 +13,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -582,7 +583,7 @@ void EnGs_Update(Actor* thisx, PlayState* play2) { void EnGs_Draw(Actor* thisx, PlayState* play) { EnGs* this = (EnGs*)thisx; - s32 tmp; + STACK_PAD(s32); u32 frames; if (!(this->unk_19E & 8)) { diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 9dd16fe237..e4970fbaf2 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -12,6 +12,7 @@ #include "printf.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -87,7 +88,7 @@ void EnGuest_Destroy(Actor* thisx, PlayState* play) { void EnGuest_Update(Actor* thisx, PlayState* play) { EnGuest* this = (EnGuest*)thisx; - s32 pad; + STACK_PAD(s32); if (Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; @@ -153,7 +154,7 @@ void func_80A5057C(EnGuest* this, PlayState* play) { void func_80A505CC(Actor* thisx, PlayState* play) { EnGuest* this = (EnGuest*)thisx; - s32 pad; + STACK_PAD(s32); Player* player; player = GET_PLAYER(play); @@ -229,7 +230,7 @@ void EnGuest_Draw(Actor* thisx, PlayState* play) { gHylianMan2MustachedEyeClosedTex, }; EnGuest* this = (EnGuest*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_guest.c", 404); diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 2b4133c39f..9d2ee033ab 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -6,10 +6,12 @@ #include "z_en_hata.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -36,7 +38,8 @@ ActorProfile En_Hata_Profile = { }; // Unused Collider and CollisionCheck data -static ColliderCylinderInit sCylinderInit = { + +UNUSED static ColliderCylinderInit sCylinderInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -56,11 +59,11 @@ static ColliderCylinderInit sCylinderInit = { { 16, 246, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; +UNUSED static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; void EnHata_Init(Actor* thisx, PlayState* play) { EnHata* this = (EnHata*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; f32 frameCount = Animation_GetLastFrame(&gFlagpoleFlapAnim); diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index e377c17ae5..2d738f171f 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -15,6 +15,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -406,9 +407,9 @@ void EnHeishi1_Update(Actor* thisx, PlayState* play) { EnHeishi1* this = (EnHeishi1*)thisx; s16 path; u8 i; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); - s32 pad2; + STACK_PAD(s32); Camera* activeCam; this->activeTimer++; @@ -506,7 +507,7 @@ s32 EnHeishi1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 } void EnHeishi1_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHeishi1* this = (EnHeishi1*)thisx; Vec3f matrixScale = { 0.3f, 0.3f, 0.3f }; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 3d6a7cb7dc..e6e535d9e2 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -14,6 +14,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -291,7 +292,7 @@ void func_80A535BC(EnHeishi2* this, PlayState* play) { } void func_80A53638(EnHeishi2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 frameCount = this->skelAnime.curFrame; BgSpot15Saku* actor = (BgSpot15Saku*)play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; @@ -456,7 +457,7 @@ void func_80A53C90(EnHeishi2* this, PlayState* play) { } void func_80A53D0C(EnHeishi2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 frameCount; BgGateShutter* gate; @@ -618,7 +619,7 @@ void func_80A54320(EnHeishi2* this, PlayState* play) { } void func_80A543A0(EnHeishi2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 frameCount = this->skelAnime.curFrame; BgGateShutter* gate = (BgGateShutter*)(play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head); SkelAnime_Update(&this->skelAnime); @@ -663,7 +664,7 @@ void func_80A544AC(EnHeishi2* this, PlayState* play) { } void func_80A5455C(EnHeishi2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f pos; f32 rotY; EnBom* bomb; @@ -779,7 +780,7 @@ void func_80A549E8(EnHeishi2* this, PlayState* play) { } void EnHeishi2_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHeishi2* this = (EnHeishi2*)thisx; s32 i; diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 075c5f8cb0..9444e09569 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "versions.h" @@ -230,7 +231,7 @@ void func_80A55D00(EnHeishi3* this, PlayState* play) { void EnHeishi3_Update(Actor* thisx, PlayState* play) { EnHeishi3* this = (EnHeishi3*)thisx; - s32 pad; + STACK_PAD(s32); Actor_SetFocus(&this->actor, 60.0f); this->unk_274++; diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index ced83c19c4..bdac618ed2 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -3,6 +3,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "face_reaction.h" @@ -358,7 +359,7 @@ void func_80A56B40(EnHeishi4* this, PlayState* play) { void EnHeishi4_Update(Actor* thisx, PlayState* play) { EnHeishi4* this = (EnHeishi4*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); thisx->world.pos.x = this->pos.x; diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 72a6fb9d63..7677a1667e 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -8,6 +8,7 @@ #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -78,7 +79,7 @@ static InitChainEntry sInitChain[] = { void EnHintnuts_Init(Actor* thisx, PlayState* play) { EnHintnuts* this = (EnHintnuts*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); if (this->actor.params == 0xA) { @@ -485,7 +486,7 @@ void EnHintnuts_ColliderCheck(EnHintnuts* this, PlayState* play) { void EnHintnuts_Update(Actor* thisx, PlayState* play) { EnHintnuts* this = (EnHintnuts*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actor.params != 0xA) { EnHintnuts_ColliderCheck(this, play); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 2fa5d13382..c5f76e1e5d 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -13,6 +13,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_math3d.h" #include "sys_matrix.h" @@ -143,7 +144,7 @@ static InitChainEntry sInitChain[] = { }; void EnHonotrap_FlameCollisionCheck(EnHonotrap* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); Collider_UpdateCylinder(&this->actor, &this->collider.cyl); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.cyl.base); @@ -170,7 +171,7 @@ void EnHonotrap_GetNormal(Vec3f* normal, Vec3f* vec) { } void EnHonotrap_InitEye(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHonotrap* this = (EnHonotrap*)thisx; s32 i; s32 j; @@ -201,7 +202,7 @@ void EnHonotrap_InitEye(Actor* thisx, PlayState* play) { } void EnHonotrap_InitFlame(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHonotrap* this = (EnHonotrap*)thisx; Actor_SetScale(&this->actor, 0.0001f); @@ -235,7 +236,7 @@ void EnHonotrap_Init(Actor* thisx, PlayState* play) { } void EnHonotrap_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHonotrap* this = (EnHonotrap*)thisx; if (this->actor.params == HONOTRAP_TYPE_EYE) { @@ -422,7 +423,7 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { } void EnHonotrap_FlameChase(EnHonotrap* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); Math_StepToF(&this->actor.speed, 3.0f, 0.1f); @@ -459,7 +460,7 @@ void EnHonotrap_SetupFlameVanish(EnHonotrap* this) { } void EnHonotrap_FlameVanish(EnHonotrap* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 targetReached = Math_StepToF(&this->actor.scale.x, 0.0001f, 0.00015f); this->actor.scale.z = this->actor.scale.y = this->actor.scale.x; @@ -523,7 +524,7 @@ void EnHonotrap_DrawEye(Actor* thisx, PlayState* play) { } void EnHonotrap_DrawFlame(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHonotrap* this = (EnHonotrap*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_honotrap.c", 1000); diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index e3359b4181..4d519b22d0 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -5,6 +5,7 @@ */ #include "z_en_horse.h" +#include "attributes.h" #include "overlays/actors/ovl_En_In/z_en_in.h" #include "libc64/math64.h" @@ -20,6 +21,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "versions.h" #include "z_lib.h" @@ -584,7 +586,7 @@ void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceIn if (distSq < SQ(300.0f)) { if (this->actor.xzDistToPlayer < 130.0f || this->colliderJntSph.elements[0].base.ocElemFlags & OCELEM_HIT) { - s32 pad; + STACK_PAD(s32); if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) { this->actor.world.rot.y -= 280; @@ -1636,7 +1638,7 @@ void EnHorse_Stub1(EnHorse* this) { } void EnHorse_LowJump(EnHorse* this, PlayState* play) { - Vec3f pad; + STACK_PADS(s32, 3); Vec3s* jointTable; f32 curFrame; f32 y; @@ -1711,7 +1713,7 @@ void EnHorse_Stub2(EnHorse* this) { } void EnHorse_HighJump(EnHorse* this, PlayState* play) { - Vec3f pad; + STACK_PADS(s32, 3); Vec3s* jointTable; f32 curFrame; f32 y; @@ -2959,7 +2961,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { f32 dist; f32 waterHeight; WaterBox* waterBox; - s32 pad; + STACK_PAD(s32); if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &waterHeight, &waterBox) == 1 && @@ -3060,7 +3062,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { s32 EnHorse_GetMountSide(EnHorse* this, PlayState* play); void EnHorse_MountDismount(EnHorse* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 mountSide; Player* player = GET_PLAYER(play); @@ -3154,12 +3156,11 @@ void EnHorse_BgCheckSlowMoving(EnHorse* this, PlayState* play) { } void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); Vec3f startPos; Vec3f endPos; Vec3f obstaclePos; - f32 pad3; + STACK_PAD(s32); f32 intersectDist; CollisionPoly* wall = NULL; CollisionPoly* obstacleFloor = NULL; @@ -3168,7 +3169,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { f32 behindObstacleHeight; f32 ny; s32 movingFast; - s32 pad5; + STACK_PAD(s32); DynaPolyActor* dynaPoly; Vec3f intersect; Vec3f obstacleTop; @@ -3358,7 +3359,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { void EnHorse_CheckBoost(EnHorse* thisx, PlayState* play2) { EnHorse* this = (EnHorse*)thisx; PlayState* play = play2; - s32 pad; + STACK_PAD(s32); if (this->action == ENHORSE_ACT_MOUNTED_WALK || this->action == ENHORSE_ACT_MOUNTED_TROT || this->action == ENHORSE_ACT_MOUNTED_GALLOP) { @@ -3443,7 +3444,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { } void EnHorse_UpdatePlayerDir(EnHorse* this, PlayState* play) { - EnHorse* pad; + STACK_PAD(s32); s16 angle; f32 s; f32 c; @@ -3721,14 +3722,13 @@ void EnHorse_RandomOffset(Vec3f* src, f32 dist, Vec3f* dst) { void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) { EnHorse* this = (EnHorse*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f sp94 = { 0.0f, 0.0f, 0.0f }; Vec3f hoofOffset = { 5.0f, -4.0f, 5.0f }; Vec3f riderOffset = { 600.0f, -1670.0f, 0.0f }; Vec3f sp70; - Vec3f sp64 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp58 = { 0.0f, -1.0f, 0.0f }; - + UNUSED Vec3f sp64 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp58 = { 0.0f, -1.0f, 0.0f }; f32 frame = this->skin.skelAnime.curFrame; Vec3f center; Vec3f newCenter; @@ -3862,8 +3862,7 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } -// unused -static s32 D_80A667DC[] = { 0, 3, 7, 14 }; +UNUSED static s32 D_80A667DC[] = { 0, 3, 7, 14 }; s32 EnHorse_OverrideLimbDraw(Actor* thisx, PlayState* play, s32 limbIndex, Skin* arg3) { static void* eyeTextures[] = { diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 56f09ec2d8..00684a9430 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -5,6 +5,7 @@ */ #include "z_en_horse_game_check.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "libu64/debug.h" @@ -14,6 +15,7 @@ #include "sfx.h" #include "seqcmd.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "translation.h" #include "z_lib.h" @@ -84,7 +86,7 @@ static f32 sFinishLine[4] = { -200.0f, 80.0f, -2300.0f, -1470.0f }; static f32 sRanchExit[4] = { 800.0f, 1000.0f, -2900.0f, -2700.0f }; -static Vec3f sUnusedZeroVec = { 0.0f, 0.0f, 0.0f }; +UNUSED static Vec3f sUnusedZeroVec = { 0.0f, 0.0f, 0.0f }; static Vec3f sFencePos[] = { { 820.0f, -44.0f, -1655.0f }, { 1497.0f, -21.0f, -1198.0f }, { 1655.0f, -44.0f, -396.0f }, @@ -456,7 +458,7 @@ static EnHorseGameCheckFunc sUpdateFuncs[] = { }; void EnHorseGameCheck_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx; if ((play->sceneId == SCENE_LON_LON_RANCH) && @@ -469,7 +471,7 @@ void EnHorseGameCheck_Init(Actor* thisx, PlayState* play) { } void EnHorseGameCheck_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx; if (sDestroyFuncs[this->actor.params] != NULL) { @@ -478,7 +480,7 @@ void EnHorseGameCheck_Destroy(Actor* thisx, PlayState* play) { } void EnHorseGameCheck_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx; if (sUpdateFuncs[this->type] != NULL) { diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index b5f402ba1d..a780ebe137 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "z_lib.h" #include "play_state.h" @@ -281,9 +282,9 @@ void func_80A68DB0(EnHorseGanon* this, PlayState* play) { } void func_80A68E14(EnHorseGanon* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CollisionPoly* poly; - s32 pad2; + STACK_PAD(s32); Vec3f checkPos; s32 bgId; @@ -296,7 +297,7 @@ void func_80A68E14(EnHorseGanon* this, PlayState* play) { void EnHorseGanon_Update(Actor* thisx, PlayState* play) { EnHorseGanon* this = (EnHorseGanon*)thisx; - s32 pad; + STACK_PAD(s32); sActionFuncs[this->action](this, play); Actor_MoveXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 7e1282d880..f9643cc273 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -14,6 +14,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "z_lib.h" #include "actor.h" @@ -159,7 +160,7 @@ static InitChainEntry sInitChain[] = { void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) { EnHorseLinkChild* this = (EnHorseLinkChild*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.005f); @@ -568,7 +569,7 @@ static u8 sEyeIndexOrder[] = { 0, 1, 2, 1 }; void EnHorseLinkChild_Update(Actor* thisx, PlayState* play) { EnHorseLinkChild* this = (EnHorseLinkChild*)thisx; - s32 pad; + STACK_PAD(s32); sActionFuncs[this->action](this, play); Actor_MoveXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index c3713febb6..023cbbde99 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -6,6 +6,7 @@ #include "z_en_horse_normal.h" +#include "attributes.h" #include "libc64/math64.h" #include "libc64/qrand.h" #include "array_count.h" @@ -15,6 +16,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -143,24 +145,20 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; -// Unused -static EnHorseNormalUnkStruct1 D_80A6D428[] = { +UNUSED static EnHorseNormalUnkStruct1 D_80A6D428[] = { { { 1058, 1, 384 }, 7 }, { { 1653, 39, -381 }, 6 }, { { 1606, 1, -1048 }, 6 }, { { 1053, 1, -1620 }, 6 }, { { -1012, 1, -1633 }, 7 }, { { -1655, 1, -918 }, 6 }, { { -1586, 1, -134 }, 6 }, { { -961, 1, 403 }, 7 }, }; -// Unused -static EnHorseNormalUnkStruct2 D_80A6D468 = { ARRAY_COUNT(D_80A6D428), D_80A6D428 }; +UNUSED static EnHorseNormalUnkStruct2 D_80A6D468 = { ARRAY_COUNT(D_80A6D428), D_80A6D428 }; -// Unused -static EnHorseNormalUnkStruct1 D_80A6D470[] = { +UNUSED static EnHorseNormalUnkStruct1 D_80A6D470[] = { { { 88, 0, 2078 }, 10 }, { { 2482, 376, 4631 }, 7 }, { { 2228, -28, 6605 }, 12 }, { { 654, -100, 8864 }, 7 }, { { -297, -500, 10667 }, 12 }, { { -5303, -420, 10640 }, 10 }, { { -6686, -500, 7760 }, 10 }, { { -5260, 100, 5411 }, 7 }, { { -3573, -269, 3893 }, 10 }, }; -// Unused -static EnHorseNormalUnkStruct2 D_80A6D4B8 = { ARRAY_COUNT(D_80A6D470), D_80A6D470 }; +UNUSED static EnHorseNormalUnkStruct2 D_80A6D4B8 = { ARRAY_COUNT(D_80A6D470), D_80A6D470 }; void func_80A6B250(EnHorseNormal* this) { static s32 D_80A6D4C0[] = { 0, 16 }; @@ -200,7 +198,7 @@ static InitChainEntry sInitChain[] = { void EnHorseNormal_Init(Actor* thisx, PlayState* play) { EnHorseNormal* this = (EnHorseNormal*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01f); @@ -307,7 +305,7 @@ void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) { Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points); f32 dx; f32 dz; - s32 pad; + STACK_PAD(s32); pointPos += this->waypoint; dx = pointPos->x - this->actor.world.pos.x; @@ -386,7 +384,7 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { static s32 D_80A6D4F4[] = { 0, 1, 4, 5, 6, 2, 3 }; static s32 D_80A6D510[] = { 0, 0, 2, 2, 1, 1, 1, 3, 3 }; s32 phi_t0 = this->animationIdx; - s32 pad; + STACK_PAD(s32); switch (D_80A6D510[this->animationIdx]) { case 0: @@ -573,9 +571,9 @@ void EnHorseNormal_WaitClone(EnHorseNormal* this, PlayState* play) { } void func_80A6C8E0(EnHorseNormal* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CollisionPoly* groundPoly; - s32 pad2; + STACK_PAD(s32); Vec3f checkPos; s32 bgId; @@ -593,7 +591,7 @@ static EnHorseNormalActionFunc sActionFuncs[] = { void EnHorseNormal_Update(Actor* thisx, PlayState* play) { EnHorseNormal* this = (EnHorseNormal*)thisx; - s32 pad; + STACK_PAD(s32); sActionFuncs[this->action](this, play); Actor_MoveXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 2906e541cd..c4f3b421c9 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -12,6 +12,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "z_lib.h" #include "play_state.h" @@ -124,7 +125,7 @@ void EnHorseZelda_GetFieldPosition(HorsePosSpeed* data, s32 index, Vec3f* fieldP } void EnHorseZelda_Move(EnHorseZelda* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f fieldPos; s16 yawDiff; @@ -227,9 +228,9 @@ void EnHorseZelda_Gallop(EnHorseZelda* this, PlayState* play) { } void EnHorseZelda_SetRotate(EnHorseZelda* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CollisionPoly* poly; - s32 pad2; + STACK_PAD(s32); Vec3f checkPos; s32 bgId; @@ -242,7 +243,7 @@ void EnHorseZelda_SetRotate(EnHorseZelda* this, PlayState* play) { void EnHorseZelda_Update(Actor* thisx, PlayState* play) { EnHorseZelda* this = (EnHorseZelda*)thisx; - s32 pad; + STACK_PAD(s32); sActionFuncs[this->action](this, play); this->actor.speed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 757eab0a77..97ee82fb64 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -68,7 +69,7 @@ void func_80A6E3A0(EnHs* this, EnHsActionFunc actionFunc) { void EnHs_Init(Actor* thisx, PlayState* play) { EnHs* this = (EnHs*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable, @@ -237,7 +238,7 @@ void func_80A6E9AC(EnHs* this, PlayState* play) { void EnHs_Update(Actor* thisx, PlayState* play) { EnHs* this = (EnHs*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 453ab7f659..c1fbae1aa7 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -60,7 +61,7 @@ static ColliderCylinderInit sCylinderInit = { void EnHs2_Init(Actor* thisx, PlayState* play) { EnHs2* this = (EnHs2*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable, @@ -116,7 +117,7 @@ void func_80A6F1A4(EnHs2* this, PlayState* play) { void EnHs2_Update(Actor* thisx, PlayState* play) { EnHs2* this = (EnHs2*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index bcc58becb1..14650a79e3 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -12,6 +12,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -771,7 +772,7 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { EnHy* this = (EnHy*)thisx; - s16 beggarItems[] = { ITEM_BOTTLE_BLUE_FIRE, ITEM_BOTTLE_FISH, ITEM_BOTTLE_BUG, ITEM_BOTTLE_FAIRY }; + UNUSED s16 beggarItems[] = { ITEM_BOTTLE_BLUE_FIRE, ITEM_BOTTLE_FISH, ITEM_BOTTLE_BUG, ITEM_BOTTLE_FAIRY }; s16 beggarRewards[] = { 150, 100, 50, 25 }; switch (Message_GetState(&play->msgCtx)) { @@ -1368,7 +1369,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) { s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnHy* this = (EnHy*)thisx; - s32 pad; + STACK_PAD(s32); Vec3s limbRot; u8 headInfoIndex; void* eyeTex; @@ -1416,7 +1417,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnHy* this = (EnHy*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f focusOffset = { 400.0f, 0.0f, 0.0f }; OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2255); diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 86e86a8065..ffa4c8578e 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -6,12 +6,14 @@ #include "z_en_ice_hono.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -166,7 +168,7 @@ void EnIceHono_InitSmallFlame(Actor* thisx, PlayState* play) { void EnIceHono_Init(Actor* thisx, PlayState* play) { EnIceHono* this = (EnIceHono*)thisx; - s16 params = this->actor.params; + UNUSED s32 params = this->actor.params; switch (this->actor.params) { case -1: @@ -353,9 +355,9 @@ void EnIceHono_SmallFlameMove(EnIceHono* this, PlayState* play) { void EnIceHono_Update(Actor* thisx, PlayState* play) { EnIceHono* this = (EnIceHono*)thisx; - s32 pad1; + STACK_PAD(s32); f32 intensity; - s32 pad2; + STACK_PAD(s32); f32 sin154; f32 sin156; @@ -390,7 +392,7 @@ void EnIceHono_Update(Actor* thisx, PlayState* play) { void EnIceHono_Draw(Actor* thisx, PlayState* play) { EnIceHono* this = (EnIceHono*)thisx; - u32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ice_hono.c", 695); Gfx_SetupDL_25Xlu(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 2dfee076b2..1b3126ead8 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -6,6 +6,7 @@ #include "z_en_ik.h" +#include "attributes.h" #include "libc64/qrand.h" #include "array_count.h" #include "gfx.h" @@ -15,6 +16,7 @@ #include "rumble.h" #include "sfx.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -218,7 +220,7 @@ void EnIk_SetupAction(EnIk* this, EnIkActionFunc actionFunc) { void EnIk_InitImpl(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; - s32 pad; + STACK_PAD(s32); EffectBlureInit1 blureInit; thisx->update = EnIk_UpdateEnemy; @@ -730,7 +732,6 @@ void EnIk_Die(EnIk* this, PlayState* play) { } void EnIk_UpdateDamage(EnIk* this, PlayState* play) { - if ((this->unk_2F8 == 3) || (this->unk_2F8 == 2)) { return; } @@ -745,9 +746,9 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { this->shieldCollider.base.acFlags &= ~AC_BOUNCED; this->bodyCollider.base.acFlags &= ~AC_HIT; } else if (this->bodyCollider.base.acFlags & AC_HIT) { - s16 pad; + STACK_PAD(s16); u8 prevHealth; - s32 damageReaction; + STACK_PAD(s32); Vec3f sparksPos = this->actor.world.pos; sparksPos.y += 50.0f; @@ -822,7 +823,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { void EnIk_UpdateEnemy(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); u8 prevInvincibilityTimer; @@ -920,8 +921,7 @@ s32 EnIk_OverrideLimbDrawEnemy(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 return false; } -// unused -static Vec3f D_80A78470 = { 300.0f, 0.0f, 0.0f }; +UNUSED static Vec3f D_80A78470 = { 300.0f, 0.0f, 0.0f }; static Vec3f D_80A7847C[] = { { 800.0f, -200.0f, -5200.0f }, @@ -1097,7 +1097,7 @@ void EnIk_SpawnAxeSmoke(EnIk* this, PlayState* play, Vec3f* pos) { }; if (!this->isAxeSummoned) { - s32 pad; + STACK_PAD(s32); Vec3f effectVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f effectAccel = { 0.0f, 0.3f, 0.0f }; s32 i; @@ -1204,7 +1204,7 @@ void EnIk_PlayArmorFallSfx(EnIk* this) { void EnIk_PlayDeathSfx(EnIk* this, PlayState* play) { static Vec3f D_80A78FA0; - s32 pad[2]; + STACK_PADS(s32, 2); f32 wDest; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &D_80A78FA0, &wDest); @@ -1214,7 +1214,7 @@ void EnIk_PlayDeathSfx(EnIk* this, PlayState* play) { // Cutscene: starts after final hit to Nabooru void EnIk_SetupCsAction3(EnIk* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 endFrame = Animation_GetLastFrame(&gIronKnuckleNabooruDeathAnim); SkelAnime_InitFlex(play, &this->skelAnime, &gIronKnuckleDefeatSkel, NULL, this->jointTable, this->morphTable, @@ -1324,7 +1324,7 @@ void EnIk_PostLimbDrawDefeat(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* void EnIk_CsDrawDefeat(EnIk* this, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; - s32 pad[2]; + STACK_PADS(s32, 2); OPEN_DISPS(gfxCtx, "../z_en_ik_inAwake.c", 322); @@ -1488,7 +1488,7 @@ void EnIk_CsDrawNothing(EnIk* this, PlayState* play) { void EnIk_CsDrawIntro(EnIk* this, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; SkelAnime* skelAnime = &this->skelAnime; - s32 pad[2]; + STACK_PADS(s32, 2); OPEN_DISPS(gfxCtx, "../z_en_ik_inConfrontion.c", 630); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 3fb2a8f5e9..9d1cba2264 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1,4 +1,5 @@ #include "z_en_in.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "libc64/qrand.h" @@ -788,7 +789,7 @@ void func_80A7A940(EnIn* this, PlayState* play) { } void func_80A7AA40(EnIn* this, PlayState* play) { - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f subCamAt; Vec3f subCamEye; diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index dd215680c9..d840f624f7 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -5,6 +5,7 @@ */ #include "z_en_insect.h" +#include "attributes.h" #include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h" #include "libc64/qrand.h" @@ -13,6 +14,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "terminal.h" #include "translation.h" @@ -123,7 +125,7 @@ f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { } s32 EnInsect_InBottleRange(EnInsect* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f pos; @@ -273,7 +275,7 @@ void EnInsect_SetupSlowDown(EnInsect* this) { } void EnInsect_SlowDown(EnInsect* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 type; f32 playSpeed; @@ -310,8 +312,7 @@ void EnInsect_SetupCrawl(EnInsect* this) { } void EnInsect_Crawl(EnInsect* this, PlayState* play) { - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); s16 yaw; s16 type = PARAMS_GET_U(this->actor.params, 0, 2); @@ -355,9 +356,8 @@ void EnInsect_SetupRunFromPlayer(EnInsect* this) { } void EnInsect_RunFromPlayer(EnInsect* this, PlayState* play) { - s32 pad1; - s32 pad2; - s16 pad3; + STACK_PADS(s32, 2); + STACK_PAD(s16); s16 frames; s16 yaw; s16 playerIsClose = this->actor.xzDistToPlayer < 40.0f; @@ -438,8 +438,8 @@ void EnInsect_SetupDig(EnInsect* this) { void EnInsect_Dig(EnInsect* this, PlayState* play) { static Vec3f accel = { 0.0f, 0.0f, 0.0f }; - static Vec3f unused = { 0.0f, 0.0f, 0.0f }; - s32 pad[2]; + UNUSED static Vec3f unused = { 0.0f, 0.0f, 0.0f }; + STACK_PADS(s32, 2); Vec3f velocity; Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f); @@ -479,9 +479,9 @@ void EnInsect_SetupWalkOnWater(EnInsect* this) { } void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { - f32 temp_f0; + STACK_PAD(s32); s16 temp_v1; - s16 pad; + STACK_PAD(s16); s16 type; Vec3f ripplePoint; @@ -575,11 +575,11 @@ void EnInsect_SetupDropped(EnInsect* this) { } void EnInsect_Dropped(EnInsect* this, PlayState* play) { - s32 temp_a0; + STACK_PAD(s32); s32 sp50; f32 phi_f0; EnInsect* thisTemp = this; - s32 temp_a1; + STACK_PAD(s32); f32 distanceSq; f32 phi_f2; s16 type; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index aedb18900b..d15a173801 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -17,6 +17,7 @@ #include "rand.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "quake.h" #include "terminal.h" @@ -152,7 +153,7 @@ s32 EnIshi_SnapToFloor(EnIshi* this, PlayState* play, f32 arg2) { void EnIshi_SpawnFragmentsSmall(EnIshi* this, PlayState* play) { static s16 scales[] = { 16, 13, 11, 9, 7, 5 }; - s32 pad; + STACK_PAD(s32); Vec3f velocity; Vec3f pos; s16 phi_v0; @@ -362,7 +363,7 @@ void EnIshi_SetupWait(EnIshi* this) { void EnIshi_Wait(EnIshi* this, PlayState* play) { static u16 liftSfxIds[] = { NA_SE_PL_PULL_UP_ROCK, NA_SE_PL_PULL_UP_BIGROCK }; - s32 pad; + STACK_PAD(s32); s16 type = PARAMS_GET_U(this->actor.params, 0, 1); if (Actor_HasParent(&this->actor, play)) { @@ -433,9 +434,9 @@ void EnIshi_SetupFly(EnIshi* this) { } void EnIshi_Fly(EnIshi* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 type = PARAMS_GET_U(this->actor.params, 0, 1); - s32 pad2; + STACK_PAD(s32); s32 quakeIndex; Vec3f contactPos; diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 2faea7fb6e..55ca1492c4 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -7,6 +7,7 @@ #include "z_en_it.h" #include "play_state.h" +#include "stack_pad.h" #define FLAGS 0 @@ -65,7 +66,7 @@ void EnIt_Destroy(Actor* thisx, PlayState* play) { void EnIt_Update(Actor* thisx, PlayState* play) { EnIt* this = (EnIt*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 917c765c7e..02b3805119 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -5,6 +5,7 @@ */ #include "z_en_jj.h" +#include "attributes.h" #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" #include "gfx.h" @@ -52,11 +53,11 @@ ActorProfile En_Jj_Profile = { /**/ EnJj_Draw, }; -static s32 sUnused = 0; +UNUSED static s32 sUnused = 0; #include "z_en_jj_cutscene_data.inc.c" -static s32 sUnused2[] = { 0, 0 }; +UNUSED static s32 sUnused2[] = { 0, 0 }; static ColliderCylinderInit sCylinderInit = { { diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 7e570bdd56..71740956a1 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "regs.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -63,7 +64,7 @@ void En_Js_SetupAction(EnJs* this, EnJsActionFunc actionFunc) { void EnJs_Init(Actor* thisx, PlayState* play) { EnJs* this = (EnJs*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gCarpetMerchantSkel, &gCarpetMerchantSlappingKneeAnim, this->jointTable, @@ -174,8 +175,7 @@ void func_80A89304(EnJs* this, PlayState* play) { void EnJs_Update(Actor* thisx, PlayState* play) { EnJs* this = (EnJs*)thisx; - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index fc3ff48de1..90fe348f79 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -5,12 +5,14 @@ */ #include "z_en_jsjutan.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "tex_len.h" @@ -45,7 +47,7 @@ static u8 sShadowTex[0x800]; static Vec3s D_80A8EE10[0x90]; -static s32 sUnused[2] = { 0, 0 }; +UNUSED static u64 sForceAlignment = 0; #define sCarpetTex_WIDTH 32 #define sCarpetTex_HEIGHT 64 @@ -103,7 +105,7 @@ static CollisionHeader sCol = { void EnJsjutan_Init(Actor* thisx, PlayState* play) { EnJsjutan* this = (EnJsjutan*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* header = NULL; this->dyna.actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 71a3eae57f..020342f387 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -14,6 +14,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -329,7 +330,7 @@ void func_80A8FBB8(EnKakasi* this, PlayState* play) { void EnKakasi_Update(Actor* thisx, PlayState* play) { EnKakasi* this = (EnKakasi*)thisx; - s32 pad; + STACK_PAD(s32); s32 i; this->unk_198++; diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index e4b3dbf9e6..c7369706c0 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -11,6 +11,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -71,7 +72,7 @@ ActorProfile En_Kakasi2_Profile = { void EnKakasi2_Init(Actor* thisx, PlayState* play) { EnKakasi2* this = (EnKakasi2*)thisx; - s32 pad; + STACK_PAD(s32); f32 spawnRangeY; f32 spawnRangeXZ; diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 6752e92d1c..146e4c074b 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -14,6 +14,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -421,7 +422,7 @@ void func_80A91A90(EnKakasi3* this, PlayState* play) { void EnKakasi3_Update(Actor* thisx, PlayState* play) { EnKakasi3* this = (EnKakasi3*)thisx; - s32 pad; + STACK_PAD(s32); s32 i; if (BREG(2) != 0) { diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index a7cc77a262..4bf13cd884 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -16,6 +16,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "z_lib.h" @@ -257,7 +258,7 @@ void EnKanban_Init(Actor* thisx, PlayState* play) { } void EnKanban_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnKanban* this = (EnKanban*)thisx; if (this->actionState == ENKANBAN_SIGN) { @@ -822,7 +823,7 @@ static f32 sCutAngles[] = { /* CUT_VERT_R */ 0.00f * M_PI, }; -static s32 sUnused[] = { 0, 0, 0 }; // Unused zero vector? +UNUSED static s32 sUnused[] = { 0, 0, 0 }; // Unused zero vector? static Vtx sShadowVtx[] = { #include "assets/overlays/ovl_En_Kanban/sShadowVtx.inc.c" diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 3a128a5b12..03fd287859 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -419,7 +420,7 @@ void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play) { } void EnKarebaba_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnKarebaba* this = (EnKarebaba*)thisx; f32 height; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 1ad021f692..d5915f9410 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -11,6 +11,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -1301,7 +1302,7 @@ void func_80A995CC(EnKo* this, PlayState* play) { void EnKo_Update(Actor* thisx, PlayState* play) { ColliderCylinder* collider; EnKo* this = (EnKo*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actionFunc != func_80A99048) { if ((s32)this->modelAlpha != 0) { @@ -1334,7 +1335,7 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void* eyeTexture; Vec3s limbRot; u8 headId; - s32 pad; + STACK_PAD(s32); if (limbIndex == 15) { gSPSegment((*gfx)++, 0x06, play->objectCtx.slots[this->headObjectSlot].segment); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 9a5a41119f..ac1e0f3050 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -14,6 +14,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -111,7 +112,7 @@ void EnKusa_SetupAction(EnKusa* this, EnKusaActionFunc actionFunc) { } s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { - s32 pad; + STACK_PAD(s32); CollisionPoly* groundPoly; Vec3f pos; s32 bgId; @@ -185,7 +186,7 @@ void EnKusa_SpawnFragments(EnKusa* this, PlayState* play) { s32 i; s32 scaleIndex; Vec3f* dir; - s32 pad; + STACK_PAD(s32); for (i = 0; i < ARRAY_COUNT(sUnitDirections); i++) { dir = &sUnitDirections[i]; @@ -308,7 +309,7 @@ void EnKusa_SetupMain(EnKusa* this) { } void EnKusa_Main(EnKusa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (Actor_HasParent(&this->actor, play)) { EnKusa_SetupLiftedUp(this); @@ -382,7 +383,7 @@ void EnKusa_SetupFall(EnKusa* this) { } void EnKusa_Fall(EnKusa* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f contactPos; if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) { diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 81aacf1335..84825325e9 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -12,6 +12,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" @@ -291,9 +292,9 @@ s32 EnKz_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera void func_80A9CB18(EnKz* this, PlayState* play) { Player* player = GET_PLAYER(play); +#if OOT_VERSION < PAL_1_0 f32 yaw; -#if OOT_VERSION < PAL_1_0 yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); yaw -= this->actor.shape.rot.y; if (fabsf(yaw) > 1820.0f) { @@ -391,7 +392,7 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) { void EnKz_Init(Actor* thisx, PlayState* play) { EnKz* this = (EnKz*)thisx; - s32 pad; + STACK_PAD(s32); SkelAnime_InitFlex(play, &this->skelanime, &gKzSkel, NULL, this->jointTable, this->morphTable, 12); ActorShape_Init(&this->actor.shape, 0.0, NULL, 0.0); @@ -435,7 +436,7 @@ void EnKz_PreMweepWait(EnKz* this, PlayState* play) { } void EnKz_SetupMweep(EnKz* this, PlayState* play) { - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; // unused + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f subCamAt; Vec3f subCamEye; @@ -455,7 +456,7 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) { } void EnKz_Mweep(EnKz* this, PlayState* play) { - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; // unused + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f subCamAt; Vec3f subCamEye; @@ -536,7 +537,7 @@ void EnKz_StartTimer(EnKz* this, PlayState* play) { void EnKz_Update(Actor* thisx, PlayState* play) { EnKz* this = (EnKz*)thisx; - s32 pad; + STACK_PAD(s32); if (LINK_IS_ADULT && !GET_INFTABLE(INFTABLE_138)) { SET_INFTABLE(INFTABLE_138); diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 8d9640a2ad..9191320f04 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "light.h" @@ -161,7 +162,7 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { void EnLight_Draw(Actor* thisx, PlayState* play) { EnLight* this = (EnLight*)thisx; - s32 pad; + STACK_PAD(s32); FlameParams* flameParams; Gfx* dList; diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index 097564b021..35a75c5f42 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -8,6 +8,7 @@ #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -35,7 +36,7 @@ ActorProfile En_Lightbox_Profile = { void EnLightbox_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; EnLightbox* this = (EnLightbox*)thisx; - s32 pad[4]; + STACK_PADS(s32, 4); switch (thisx->params) { case 0: diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index eef5e1c0b9..273d0ea593 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -6,6 +6,7 @@ #include "z_en_m_fire1.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -49,7 +50,7 @@ static ColliderCylinderInit sCylinderInit = { void EnMFire1_Init(Actor* thisx, PlayState* play) { EnMFire1* this = (EnMFire1*)thisx; - s32 pad; + STACK_PAD(s32); if (this->actor.params < 0) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION); @@ -67,7 +68,7 @@ void EnMFire1_Destroy(Actor* thisx, PlayState* play) { void EnMFire1_Update(Actor* thisx, PlayState* play) { EnMFire1* this = (EnMFire1*)thisx; - s32 pad; + STACK_PAD(s32); if (Math_StepToF(&this->timer, 1.0f, 0.2f)) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 1709fb037c..ef9f34d4df 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -270,7 +271,7 @@ void EnMa1_UpdateSinging(EnMa1* this) { void EnMa1_Init(Actor* thisx, PlayState* play) { EnMa1* this = (EnMa1*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gMalonChildSkel, NULL, NULL, NULL, 0); @@ -406,7 +407,7 @@ void EnMa1_DoNothing(EnMa1* this, PlayState* play) { void EnMa1_Update(Actor* thisx, PlayState* play) { EnMa1* this = (EnMa1*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -470,7 +471,7 @@ void EnMa1_Draw(Actor* thisx, PlayState* play) { EnMa1* this = (EnMa1*)thisx; Camera* activeCam; f32 distFromCamEye; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ma1.c", 1226); diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index ed01e29e4a..508149d164 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -11,6 +11,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -245,7 +246,7 @@ void EnMa2_UpdateSinging(EnMa2* this, PlayState* play) { void EnMa2_Init(Actor* thisx, PlayState* play) { EnMa2* this = (EnMa2*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gMalonAdultSkel, NULL, NULL, NULL, 0); @@ -344,7 +345,7 @@ void EnMa2_ForceTalkAfterSong(EnMa2* this, PlayState* play) { void EnMa2_Update(Actor* thisx, PlayState* play) { EnMa2* this = (EnMa2*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -409,7 +410,7 @@ void EnMa2_Draw(Actor* thisx, PlayState* play) { EnMa2* this = (EnMa2*)thisx; Camera* activeCam; f32 distFromCamEye; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ma2.c", 955); diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index a685945a2a..048268bbee 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "versions.h" @@ -262,7 +263,7 @@ void EnMa3_ChangeAnim(EnMa3* this, s32 index) { void EnMa3_Init(Actor* thisx, PlayState* play) { EnMa3* this = (EnMa3*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gMalonAdultSkel, NULL, NULL, NULL, 0); @@ -342,7 +343,7 @@ s32 EnMa3_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 inter void EnMa3_Update(Actor* thisx, PlayState* play) { EnMa3* this = (EnMa3*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -424,7 +425,7 @@ void EnMa3_Draw(Actor* thisx, PlayState* play) { EnMa3* this = (EnMa3*)thisx; Camera* activeCam; f32 distFromCamEye; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ma3.c", 978); diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 849eee33d8..c6f9505b8b 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -18,6 +18,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "versions.h" #include "audio.h" @@ -207,7 +208,7 @@ void EnMag_CheckSramResetCode(PlayState* play, EnMag* this) { #endif void EnMag_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); Input* input = &play->state.input[0]; EnMag* this = (EnMag*)thisx; @@ -442,7 +443,7 @@ void EnMag_DrawImageRGBA32(Gfx** gfxP, s16 centerX, s16 centerY, u8* source, u32 u32 textureHeight; s32 remainingSize; s32 textureSize; - s32 pad; + STACK_PAD(s32); s32 i; Gfx_SetupDL_56Ptr(&gfx); @@ -578,7 +579,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { }; EnMag* this = (EnMag*)thisx; Font* font = &this->font; - s32 pad; + STACK_PAD(s32); Gfx* gfx = *gfxP; u16 i, j, k; u16 rectLeft; @@ -885,7 +886,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { } void EnMag_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); Gfx* gfx; Gfx* gfxRef; diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 56e96bf293..7a2a10c454 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -6,6 +6,7 @@ #include "z_en_mb.h" +#include "attributes.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -14,6 +15,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "versions.h" #include "z_en_item00.h" @@ -274,7 +276,7 @@ void EnMb_SetupAction(EnMb* this, EnMbActionFunc actionFunc) { void EnMb_Init(Actor* thisx, PlayState* play) { EnMb* this = (EnMb*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s16 relYawFromPlayer; @@ -694,7 +696,7 @@ void EnMb_SpearPatrolTurnTowardsWaypoint(EnMb* this, PlayState* play) { * Slow down and resume walking. */ void EnMb_SpearEndChargeQuick(EnMb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.5f, 1.0f, 0.0f); if (this->actor.speed > 1.0f) { @@ -840,7 +842,7 @@ void EnMb_SpearGuardPrepareAndCharge(EnMb* this, PlayState* play) { void EnMb_ClubAttack(EnMb* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); Vec3f effSpawnPos; Vec3f effWhiteShockwaveDynamics = { 0.0f, 0.0f, 0.0f }; f32 flamesParams[] = { 18.0f, 18.0f, 0.0f }; @@ -1108,7 +1110,7 @@ void EnMb_ClubDamagedWhileKneeling(EnMb* this, PlayState* play) { this->timer3--; if (this->timer3 == 0) { if (this->timer1 == 0) { - s32 pad; + STACK_PAD(s32); Animation_Change(&this->skelAnime, &gEnMbClubStandUpAnim, 3.0f, 0.0f, Animation_GetLastFrame(&gEnMbClubStandUpAnim), ANIMMODE_ONCE_INTERP, 0.0f); @@ -1166,8 +1168,7 @@ void EnMb_ClubDead(EnMb* this, PlayState* play) { void EnMb_SpearGuardWalk(EnMb* this, PlayState* play) { s32 prevFrame; s32 beforeCurFrame; - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); Player* player = GET_PLAYER(play); s16 relYawTowardsPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; s16 yawTowardsHome; @@ -1282,7 +1283,7 @@ void EnMb_SpearPatrolWalkTowardsWaypoint(EnMb* this, PlayState* play) { void EnMb_ClubWaitPlayerNear(EnMb* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 relYawFromPlayer = this->actor.world.rot.y - this->actor.yawTowardsPlayer; SkelAnime_Update(&this->skelAnime); @@ -1482,7 +1483,7 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { void EnMb_Update(Actor* thisx, PlayState* play) { EnMb* this = (EnMb*)thisx; - s32 pad; + STACK_PAD(s32); EnMb_CheckColliding(this, play); if (thisx->colChkInfo.damageReaction != ENMB_DMG_REACT_FREEZE) { @@ -1512,7 +1513,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) { } void EnMb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - static Vec3f unused = { 1100.0f, -700.0f, 0.0f }; + UNUSED static Vec3f unused = { 1100.0f, -700.0f, 0.0f }; static Vec3f feetPos = { 0.0f, 0.0f, 0.0f }; static Vec3f effSpawnOffsetFromLeftHand = { 0.0f, -8000.0f, 0.0f }; static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 3059baa7bb..631a670ed3 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -12,6 +12,7 @@ #include "gfx.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -684,7 +685,7 @@ void EnMd_UpdateAlphaByDistance(EnMd* this, PlayState* play) { void EnMd_Init(Actor* thisx, PlayState* play) { EnMd* this = (EnMd*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gMidoSkel, NULL, this->jointTable, this->morphTable, ENMD_LIMB_MAX); @@ -854,7 +855,7 @@ void EnMd_Walk(EnMd* this, PlayState* play) { void EnMd_Update(Actor* thisx, PlayState* play) { EnMd* this = (EnMd*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 59257e93d3..712a680b36 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -61,7 +62,7 @@ static ColliderCylinderInit sCylinderInit = { void EnMk_Init(Actor* thisx, PlayState* play) { EnMk* this = (EnMk*)thisx; - s32 swimFlag; + STACK_PAD(s32); this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; @@ -222,7 +223,7 @@ void func_80AAD014(EnMk* this, PlayState* play) { void EnMk_Wait(EnMk* this, PlayState* play) { s16 angle; - s32 swimFlag; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 playerExchangeItem; @@ -292,7 +293,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) { void EnMk_Update(Actor* thisx, PlayState* play) { EnMk* this = (EnMk*)thisx; - s32 pad; + STACK_PAD(s32); Vec3s vec; Player* player; s16 swimFlag; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 9881334a0a..03ba124e59 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -170,7 +171,7 @@ void EnMm_ChangeAnim(EnMm* this, s32 index, s32* currentIndex) { } void EnMm_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnMm* this = (EnMm*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -207,7 +208,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { } void EnMm_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnMm* this = (EnMm*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -224,7 +225,7 @@ s32 func_80AADA70(void) { } s32 func_80AADAA0(EnMm* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 sp1C = 1; @@ -512,7 +513,7 @@ void func_80AAE598(EnMm* this, PlayState* play) { } void EnMm_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnMm* this = (EnMm*)thisx; this->actionFunc(this, play); @@ -523,7 +524,7 @@ void EnMm_Update(Actor* thisx, PlayState* play) { void EnMm_Draw(Actor* thisx, PlayState* play) { static void* mouthTextures[] = { gRunningManMouthOpenTex, gRunningManMouthClosedTex }; - s32 pad; + STACK_PAD(s32); EnMm* this = (EnMm*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_mm.c", 1065); diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 187b576594..8e3433c4bf 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -306,7 +307,7 @@ void func_80AAF668(EnMm2* this, PlayState* play) { void EnMm2_Update(Actor* thisx, PlayState* play) { EnMm2* this = (EnMm2*)thisx; - s32 pad; + STACK_PAD(s32); if (this->unk_1F4 & 1) { Actor_TrackPlayer(play, &this->actor, &this->unk_1E8, &this->unk_1EE, this->actor.focus.pos); diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index e9012fb1e4..0e249ff65a 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -13,6 +13,7 @@ #include "face_reaction.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #include "assets/objects/object_ms/object_ms.h" @@ -79,7 +80,7 @@ void EnMs_SetOfferText(EnMs* this, PlayState* play) { void EnMs_Init(Actor* thisx, PlayState* play) { EnMs* this = (EnMs*)thisx; - s32 pad; + STACK_PAD(s32); if (LINK_AGE_IN_YEARS != YEARS_CHILD) { Actor_Kill(&this->actor); @@ -168,7 +169,7 @@ void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play) { void EnMs_Update(Actor* thisx, PlayState* play) { EnMs* this = (EnMs*)thisx; - s32 pad; + STACK_PAD(s32); this->activeTimer++; Actor_SetFocus(&this->actor, 20.0f); diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 78229fc754..420d400b58 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -8,6 +8,7 @@ #include "libc64/qrand.h" #include "gfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -141,7 +142,7 @@ s16 EnMu_UpdateTalkState(PlayState* play, Actor* thisx) { void EnMu_Init(Actor* thisx, PlayState* play) { EnMu* this = (EnMu*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 160.0f); SkelAnime_InitFlex(play, &this->skelAnime, &object_mu_Skel_004F70, &object_mu_Anim_0003F4, NULL, NULL, 0); @@ -166,7 +167,7 @@ void EnMu_Pose(EnMu* this, PlayState* play) { void EnMu_Update(Actor* thisx, PlayState* play) { EnMu* this = (EnMu*)thisx; - s32 pad; + STACK_PAD(s32); f32 talkDist; Vec3s pos; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index c2120b1fc9..7b776ea8cb 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -5,6 +5,7 @@ */ #include "z_en_nb.h" +#include "attributes.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "libc64/math64.h" @@ -17,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -123,7 +125,7 @@ s32 EnNb_GetType(EnNb* this) { void EnNb_UpdatePath(EnNb* this, PlayState* play) { Vec3s* pointPos; Path* pathList; - s32 pad; + STACK_PAD(s32); s32 path; pathList = play->pathList; @@ -157,7 +159,7 @@ void EnNb_SetupCollider(Actor* thisx, PlayState* play) { } void EnNb_UpdateCollider(EnNb* this, PlayState* play) { - s32 pad[4]; + STACK_PADS(s32, 4); ColliderCylinder* collider = &this->collider; Collider_UpdateCylinder(&this->actor, collider); @@ -187,7 +189,7 @@ void func_80AB1040(EnNb* this, PlayState* play) { } void func_80AB10C4(EnNb* this) { - s32 pad2[2]; + STACK_PADS(s32, 2); Vec3s* headRot; Vec3s* torsoRot; @@ -200,7 +202,7 @@ void func_80AB10C4(EnNb* this) { } void EnNb_UpdateEyes(EnNb* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyeIdx = &this->eyeIdx; @@ -363,7 +365,7 @@ void EnNb_ComeUpImpl(EnNb* this, PlayState* play) { } void EnNb_SetupChamberCsImpl(EnNb* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Player* player; if ((gSaveContext.chamberCutsceneNum == CHAMBER_CS_SPIRIT) && !IS_CUTSCENE_LAYER) { @@ -579,7 +581,7 @@ void EnNb_CreateLightOrb(EnNb* this, PlayState* play) { } void EnNb_DrawTransparency(EnNb* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeSegIdx = this->eyeIdx; void* eyeTex = sEyeTextures[eyeSegIdx]; SkelAnime* skelAnime = &this->skelAnime; @@ -620,7 +622,7 @@ void EnNb_SetPosInPortal(EnNb* this, PlayState* play) { CsCmdActorCue* cue = EnNb_GetCue(play, 1); Vec3f* pos = &this->actor.world.pos; f32 lerp; - s32 pad; + STACK_PAD(s32); Vec3f startPos; Vec3f endPos; @@ -737,7 +739,7 @@ void EnNb_SetupConfrontation(EnNb* this, PlayState* play) { } void EnNb_PlayKnuckleDefeatSFX(EnNb* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if (play->csCtx.curFrame == 548) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_NB_CRY_0); @@ -746,7 +748,7 @@ void EnNb_PlayKnuckleDefeatSFX(EnNb* this, PlayState* play) { } void EnNb_PlayKneelingOnGroundSFX(EnNb* this) { - s32 pad[2]; + STACK_PADS(s32, 2); if ((this->skelAnime.mode == 2) && (Animation_OnFrame(&this->skelAnime, 18.0f) || Animation_OnFrame(&this->skelAnime, 25.0f))) { @@ -755,7 +757,7 @@ void EnNb_PlayKneelingOnGroundSFX(EnNb* this) { } void EnNb_PlayLookRightSFX(EnNb* this) { - s32 pad[2]; + STACK_PADS(s32, 2); if ((this->skelAnime.mode == 2) && Animation_OnFrame(&this->skelAnime, 9.0f)) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_STONE); @@ -763,7 +765,7 @@ void EnNb_PlayLookRightSFX(EnNb* this) { } void EnNb_PlayLookLeftSFX(EnNb* this) { - s32 pad[2]; + STACK_PADS(s32, 2); if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_STONE); @@ -787,7 +789,7 @@ void func_80AB26C8(EnNb* this) { } void func_80AB26DC(EnNb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); AnimationHeader* animation = &gNabooruCollapseFromStandingToKneelingTransitionAnim; f32 lastFrame = Animation_GetLastFrame(animation); @@ -992,7 +994,7 @@ void EnNb_ConfrontationDestroy(EnNb* this, PlayState* play) { } void func_80AB2E70(EnNb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); SkelAnime* skelAnime = &this->skelAnime; OPEN_DISPS(play->state.gfxCtx, "../z_en_nb_inConfrontion.c", 572); @@ -1009,7 +1011,7 @@ void func_80AB2E70(EnNb* this, PlayState* play) { } s32 func_80AB2FC0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { - EnNb* this = (EnNb*)thisx; + UNUSED EnNb* this = (EnNb*)thisx; if (limbIndex == NB_LIMB_HEAD) { *dList = gNabooruHeadMouthOpenDL; @@ -1019,11 +1021,11 @@ s32 func_80AB2FC0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s } void func_80AB2FE4(EnNb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 eyeIdx = this->eyeIdx; SkelAnime* skelAnime = &this->skelAnime; void* eyeTexture = sEyeTextures[eyeIdx]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_nb_inConfrontion.c", 623); @@ -1150,7 +1152,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, PlayState* play) { this->action = NB_CROUCH_CRAWLSPACE; this->drawMode = NB_DRAW_DEFAULT; } else { - s32 pad; + STACK_PAD(s32); EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, 0.0f, 0); this->headTurnFlag = 1; @@ -1241,7 +1243,7 @@ void EnNb_SetupIdleCrawlspace(EnNb* this, s32 animFinished) { void func_80AB3838(EnNb* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { - s32 pad; + STACK_PAD(s32); this->action = NB_IN_DIALOG; } else { @@ -1265,9 +1267,9 @@ void EnNb_SetupPathMovement(EnNb* this, PlayState* play) { } void EnNb_SetTextIdAsChild(EnNb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); u8 choiceIndex; - s32 pad1; + STACK_PAD(s32); u16 textId; textId = this->actor.textId; @@ -1335,7 +1337,7 @@ void func_80AB3A7C(EnNb* this, PlayState* play, s32 animFinished) { void func_80AB3B04(EnNb* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { - s32 pad; + STACK_PAD(s32); this->action = NB_ACTION_30; } else { @@ -1471,7 +1473,7 @@ void EnNb_Update(Actor* thisx, PlayState* play) { } void EnNb_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNb* this = (EnNb*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); @@ -1507,7 +1509,7 @@ s32 EnNb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (this->headTurnFlag != 0) { if (limbIndex == NB_LIMB_TORSO) { - s32 pad; + STACK_PAD(s32); rot->x += interactInfo->torsoRot.y; rot->y -= interactInfo->torsoRot.x; @@ -1543,11 +1545,11 @@ void EnNb_DrawNothing(EnNb* this, PlayState* play) { } void EnNb_DrawDefault(EnNb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 eyeIdx = this->eyeIdx; SkelAnime* skelAnime = &this->skelAnime; void* eyeTexture = sEyeTextures[eyeIdx]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_nb.c", 992); diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 5acaf3f9ed..b646e6f886 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -19,6 +19,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -143,7 +144,7 @@ static InitChainEntry sInitChain[] = { void EnNiw_Init(Actor* thisx, PlayState* play) { EnNiw* this = (EnNiw*)thisx; - s32 pad; + STACK_PAD(s32); s32 i; if (this->actor.params < 0) { @@ -497,7 +498,7 @@ void func_80AB6450(EnNiw* this, PlayState* play) { } void func_80AB6570(EnNiw* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 posY = Rand_CenteredFloat(100.0f); f32 posZ = Rand_CenteredFloat(100.0f); s16 tmp; @@ -899,17 +900,17 @@ void func_80AB747C(EnNiw* this, PlayState* play) { } void EnNiw_Update(Actor* thisx, PlayState* play) { - s32 pad1; + STACK_PAD(s32); EnNiw* this = (EnNiw*)thisx; Player* player = GET_PLAYER(play); s16 i; s16 featherCount; - Vec3f zeroVec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f zeroVec2 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec2 = { 0.0f, 0.0f, 0.0f }; Vec3f pos; Vec3f vel; Vec3f accel; - s32 pad2; + STACK_PAD(s32); f32 scale; f32 dist; @@ -985,7 +986,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { if (thisx->floorHeight <= BGCHECK_Y_MIN || thisx->floorHeight >= 32000.0f) { Vec3f cam; f32 camResult; - s32 pad3[10]; + STACK_PADS(s32, 10); PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Up and down? ☆☆☆☆☆ %f\n") VT_RST, thisx->floorHeight); @@ -1127,7 +1128,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { s32 EnNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnNiw* this = (EnNiw*)thisx; - Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; if (limbIndex == 13) { rot->y += (s16)this->unk_2DC; @@ -1152,7 +1153,7 @@ s32 EnNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnNiw_Draw(Actor* thisx, PlayState* play) { EnNiw* this = (EnNiw*)thisx; Vec3f scale = { 0.15f, 0.15f, 0.15f }; - GraphicsContext* gfxCtx = play->state.gfxCtx; + STACK_PAD(s32); Gfx_SetupDL_25Opa(play->state.gfxCtx); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, @@ -1218,7 +1219,7 @@ void EnNiw_UpdateEffects(EnNiw* this, PlayState* play) { void EnNiw_DrawEffects(EnNiw* this, PlayState* play) { u8 materialFlag = 0; s16 i; - s32 pad; + STACK_PAD(s32); GraphicsContext* gfxCtx = play->state.gfxCtx; EnNiwEffect* effect = &this->effects[0]; diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 8949be2892..2fb558fe59 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -13,6 +13,7 @@ #include "printf.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -68,10 +69,10 @@ static ColliderCylinderInit sCylinderInit = { void EnNiwGirl_Init(Actor* thisx, PlayState* play) { EnNiwGirl* this = (EnNiwGirl*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f vec1; Vec3f vec2; - s32 pad2; + STACK_PAD(s32); SkelAnime_InitFlex(play, &this->skelAnime, &gNiwGirlSkel, &gNiwGirlRunAnim, this->jointTable, this->morphTable, 17); Collider_InitCylinder(play, &this->collider); @@ -267,7 +268,7 @@ static Vec3f sConstVec3f = { 0.2f, 0.2f, 0.2f }; void EnNiwGirl_Draw(Actor* thisx, PlayState* play) { static void* eyeTextures[] = { gNiwGirlEyeOpenTex, gNiwGirlEyeHalfTex, gNiwGirlEyeClosedTex }; EnNiwGirl* this = (EnNiwGirl*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f sp4C = sConstVec3f; OPEN_DISPS(play->state.gfxCtx, "../z_en_niw_girl.c", 573); diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 2ea1ace664..727775e12e 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -9,6 +9,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "versions.h" @@ -84,7 +85,7 @@ static ColliderCylinderInit sCylinderInit = { }; void EnNiwLady_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNiwLady* this = (EnNiwLady*)thisx; this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE); @@ -169,7 +170,7 @@ void EnNiwLady_ChoseAnimation(EnNiwLady* this, PlayState* play, s32 arg2) { void func_80AB9F24(EnNiwLady* this, PlayState* play) { f32 frames; - s32 pad; + STACK_PAD(s32); if (Object_IsLoaded(&play->objectCtx, this->aneObjectSlot) && Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) { @@ -217,7 +218,7 @@ void func_80ABA21C(EnNiwLady* this, PlayState* play) { void func_80ABA244(EnNiwLady* this, PlayState* play) { EnNiw* currentCucco; - s32 pad[2]; + STACK_PADS(s32, 2); s32 phi_s1; this->cuccosInPen = 0; @@ -532,7 +533,7 @@ void func_80ABAD7C(EnNiwLady* this, PlayState* play) { } void EnNiwLady_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNiwLady* this = (EnNiwLady*)thisx; Player* player = GET_PLAYER(play); @@ -596,7 +597,7 @@ Gfx* EnNiwLady_EmptyDList(GraphicsContext* gfxCtx) { s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnNiwLady* this = (EnNiwLady*)thisx; - s32 pad; + STACK_PAD(s32); if (limbIndex == 15) { rot->x += this->headRot.y; diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 9417316e4c..5e3ab02954 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -74,7 +75,7 @@ static Gfx* sDLists[] = { void EnNutsball_Init(Actor* thisx, PlayState* play) { EnNutsball* this = (EnNutsball*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitCylinder(play, &this->collider); @@ -155,7 +156,7 @@ void func_80ABBBA8(EnNutsball* this, PlayState* play) { void EnNutsball_Update(Actor* thisx, PlayState* play) { EnNutsball* this = (EnNutsball*)thisx; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if (!(player->stateFlags1 & (PLAYER_STATE1_TALKING | PLAYER_STATE1_DEAD | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || (this->actionFunc == func_80ABBB34)) { diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 4d5ec7f3ca..69f2d7c0ee 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -9,6 +9,7 @@ #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -209,7 +210,7 @@ void EnNwc_DrawChicks(EnNwc* this, PlayState* play) { } void EnNwc_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNwc* this = (EnNwc*)thisx; ColliderJntSphElementInit elementInits[16]; ColliderJntSphElementInit* element; @@ -236,7 +237,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { } void EnNwc_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNwc* this = (EnNwc*)thisx; Collider_FreeJntSph(play, &this->collider); @@ -247,7 +248,7 @@ void EnNwc_Idle(EnNwc* this, PlayState* play) { } void EnNwc_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNwc* this = (EnNwc*)thisx; this->updateFunc(this, play); @@ -255,7 +256,7 @@ void EnNwc_Update(Actor* thisx, PlayState* play) { } void EnNwc_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNwc* this = (EnNwc*)thisx; EnNwc_DrawChicks(this, play); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 38167bef26..378862b34a 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -8,6 +8,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_en_item00.h" @@ -538,7 +539,7 @@ static Vec3f sFireOffsets[] = { }; void EnNy_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnNy* this = (EnNy*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_ny.c", 837); diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index d58918ea82..016152343f 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -6,6 +6,7 @@ #include "z_en_okarina_effect.h" +#include "attributes.h" #include "printf.h" #include "regs.h" #include "sequence.h" @@ -45,7 +46,7 @@ void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, EnOkarinaEffectActionFun } void EnOkarinaEffect_Destroy(Actor* thisx, PlayState* play) { - EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; + UNUSED EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; play->envCtx.precipitation[PRECIP_SOS_MAX] = 0; #if OOT_VERSION < PAL_1_0 diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 1503bb265c..8d10a9d9f3 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -5,6 +5,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -129,7 +130,7 @@ static InitChainEntry sInitChain[] = { void EnOkuta_Init(Actor* thisx, PlayState* play) { EnOkuta* this = (EnOkuta*)thisx; - s32 pad; + STACK_PAD(s32); WaterBox* outWaterBox; f32 ySurface; s32 floorBgId; @@ -303,7 +304,7 @@ void EnOkuta_WaitToAppear(EnOkuta* this, PlayState* play) { } void EnOkuta_Appear(EnOkuta* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (SkelAnime_Update(&this->skelAnime)) { if (this->actor.xzDistToPlayer < 160.0f) { @@ -328,7 +329,7 @@ void EnOkuta_Appear(EnOkuta* this, PlayState* play) { } void EnOkuta_Hide(EnOkuta* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 30.0f); if (SkelAnime_Update(&this->skelAnime)) { @@ -717,7 +718,7 @@ s32 EnOkuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* void EnOkuta_Draw(Actor* thisx, PlayState* play) { EnOkuta* this = (EnOkuta*)thisx; - s32 pad; + STACK_PAD(s32); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index ab3c142984..89caae0034 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1,4 +1,5 @@ #include "z_en_ossan.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "overlays/actors/ovl_En_GirlA/z_en_girla.h" #include "overlays/actors/ovl_En_Tana/z_en_tana.h" @@ -12,6 +13,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -142,8 +144,7 @@ ActorProfile En_Ossan_Profile = { /**/ NULL, }; -// Unused collider -static ColliderCylinderInitType1 sCylinderInit = { +UNUSED static ColliderCylinderInitType1 sCylinderInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -168,8 +169,7 @@ static s16 sMaskPaymentPrice[] = { 10, 30, 20, 50 }; // item yaw offsets static s16 sItemShelfRot[] = { 0xEAAC, 0xEAAC, 0xEAAC, 0xEAAC, 0x1554, 0x1554, 0x1554, 0x1554 }; -// unused values? -static s16 D_80AC8904[] = { 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025 }; +UNUSED static s16 D_80AC8904[] = { 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025 }; #if DEBUG_FEATURES static char* sShopkeeperPrintName[] = { @@ -594,7 +594,7 @@ s32 EnOssan_TryGetObjBankIndices(EnOssan* this, PlayState* play, s16* objectIds) void EnOssan_Init(Actor* thisx, PlayState* play) { EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); s16* objectIds; if (this->actor.params == OSSAN_TYPE_TALON && (LINK_AGE_IN_YEARS != YEARS_CHILD)) { @@ -914,7 +914,7 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla if (this->actor.params == OSSAN_TYPE_MASK && dialogState == TEXT_STATE_CHOICE) { if (!EnOssan_TestEndInteraction(this, play, &play->state.input[0]) && Message_ShouldAdvance(play)) { - s32 pad; + STACK_PAD(s32); switch (play->msgCtx.choiceIndex) { case 0: @@ -1256,7 +1256,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe } void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* player) { - s32 pad[2]; + STACK_PADS(s32, 2); u8 prevIndex; u8 nextIndex; @@ -1718,7 +1718,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player selectedItem = this->shelfSlots[this->cursorIndex]; selectedItem->updateStockedItemFunc(play, selectedItem); if (!EnOssan_TestEndInteraction(this, play, &play->state.input[0])) { - s32 pad; + STACK_PAD(s32); switch (play->msgCtx.choiceIndex) { case 0: @@ -2364,7 +2364,7 @@ void EnOssan_DrawStickDirectionPrompts(PlayState* play, EnOssan* this) { void EnOssan_DrawBazaarShopkeeper(Actor* thisx, PlayState* play) { static void* sBazaarShopkeeperEyeTextures[] = { gOssanEyeOpenTex, gOssanEyeHalfTex, gOssanEyeClosedTex }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4320); @@ -2386,7 +2386,7 @@ s32 EnOssan_OverrideLimbDrawKokiriShopkeeper(PlayState* play, s32 limbIndex, Gfx gKokiriShopkeeperEyeOpenTex, }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4354); @@ -2419,7 +2419,7 @@ Gfx* EnOssan_SetEnvColor(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b, u8 a) { void EnOssan_DrawKokiriShopkeeper(Actor* thisx, PlayState* play) { EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4409); @@ -2440,7 +2440,7 @@ void EnOssan_DrawKokiriShopkeeper(Actor* thisx, PlayState* play) { void EnOssan_DrawGoronShopkeeper(Actor* thisx, PlayState* play) { static void* sGoronShopkeeperEyeTextures[] = { gGoronCsEyeOpenTex, gGoronCsEyeHalfTex, gGoronCsEyeClosedTex }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4455); @@ -2468,7 +2468,7 @@ s32 EnOssan_OverrideLimbDrawZoraShopkeeper(PlayState* play, s32 limbIndex, Gfx** void EnOssan_DrawZoraShopkeeper(Actor* thisx, PlayState* play) { static void* sZoraShopkeeperEyeTextures[] = { gZoraEyeOpenTex, gZoraEyeHalfTex, gZoraEyeClosedTex }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4506); @@ -2492,7 +2492,7 @@ void EnOssan_DrawPotionShopkeeper(Actor* thisx, PlayState* play) { gPotionShopkeeperEyeClosedTex, }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4544); @@ -2509,7 +2509,7 @@ void EnOssan_DrawPotionShopkeeper(Actor* thisx, PlayState* play) { void EnOssan_DrawHappyMaskShopkeeper(Actor* thisx, PlayState* play) { static void* sHappyMaskShopkeeperEyeTextures[] = { gHappyMaskSalesmanEyeClosedTex, gHappyMaskSalesmanEyeOpenTex }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4578); @@ -2532,7 +2532,7 @@ void EnOssan_DrawBombchuShopkeeper(Actor* thisx, PlayState* play) { gBombchuShopkeeperEyeClosedTex, }; EnOssan* this = (EnOssan*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4611); diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index cd5da7dd2f..f71f28555b 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -17,6 +17,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -127,7 +128,7 @@ static InitChainEntry sInitChain[] = { void EnOwl_Init(Actor* thisx, PlayState* play) { EnOwl* this = (EnOwl*)thisx; - ColliderCylinder* collider; + STACK_PAD(s32); s32 owlType; s32 switchFlag; @@ -939,8 +940,6 @@ void func_80ACBF50(EnOwl* this, PlayState* play) { void func_80ACC00C(EnOwl* this, PlayState* play) { s32 owlType; - s32 temp_v0; - s32 temp_v0_2; Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); this->actor.shape.rot.y = this->actor.world.rot.y; @@ -1094,7 +1093,7 @@ s32 func_80ACC624(EnOwl* this, PlayState* play) { } void EnOwl_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnOwl* this = (EnOwl*)thisx; s16 phi_a1; @@ -1332,7 +1331,7 @@ void EnOwl_PostLimbUpdate(PlayState* play, s32 limbIndex, Gfx** gfx, Vec3s* rot, void EnOwl_Draw(Actor* thisx, PlayState* play) { static void* eyeTextures[] = { gObjOwlEyeOpenTex, gObjOwlEyeHalfTex, gObjOwlEyeClosedTex }; EnOwl* this = (EnOwl*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_owl.c", 2247); diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index a4225d0ff4..80cc9156a5 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -8,6 +8,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -876,7 +877,7 @@ void EnPeehat_SetStateExplode(EnPeehat* this) { } void EnPeehat_StateExplode(EnPeehat* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if (this->animTimer == 5) { EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index caf492b8be..44af539297 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "light.h" @@ -70,7 +71,7 @@ static InitChainEntry sInitChain[] = { }; void EnPoDesert_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnPoDesert* this = (EnPoDesert*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -198,7 +199,7 @@ void EnPoDesert_Disappear(EnPoDesert* this, PlayState* play) { void EnPoDesert_Update(Actor* thisx, PlayState* play) { EnPoDesert* this = (EnPoDesert*)thisx; - s32 pad; + STACK_PAD(s32); SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 2989292f7f..d6e702c10c 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -167,7 +168,7 @@ static MtxF sLimb7Mtx; void EnPoField_Init(Actor* thisx, PlayState* play) { EnPoField* this = (EnPoField*)thisx; - s32 pad; + STACK_PAD(s32); if (sNumSpawned != 10) { sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; @@ -561,8 +562,7 @@ void EnPoField_Damage(EnPoField* this, PlayState* play) { void EnPoField_Death(EnPoField* this, PlayState* play) { Vec3f sp6C; f32 sp68; - s32 pad; - s32 pad1; + STACK_PADS(s32, 2); f32 temp_f0; this->actionTimer++; @@ -792,7 +792,7 @@ void EnPoField_UpdateFlame(EnPoField* this, PlayState* play) { void EnPoField_DrawFlame(EnPoField* this, PlayState* play) { f32 sp4C; - s32 pad; + STACK_PAD(s32); if (this->flameTimer != 0) { OPEN_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 1669); @@ -866,7 +866,7 @@ void func_80AD6330(EnPoField* this) { } void EnPoField_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnPoField* this = (EnPoField*)thisx; EnPoField_TestForDamage(this, play); @@ -985,7 +985,7 @@ void EnPoField_UpdateDead(Actor* thisx, PlayState* play) { void EnPoField_DrawSoul(Actor* thisx, PlayState* play) { EnPoField* this = (EnPoField*)thisx; - s32 pad; + STACK_PAD(s32); EnPoFieldInfo* info = &sPoFieldInfo[this->actor.params]; OPEN_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 2077); diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index b2effdffed..9a8a013ec7 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -308,7 +309,7 @@ void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) { void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { Vec3f vec; f32 multiplier; - s32 pad; + STACK_PAD(s32); this->actionTimer++; if (this->actionTimer < 8) { @@ -341,7 +342,7 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) { if (this->hookshotSlotFull != 0) { Vec3f sp60; - s32 pad1; + STACK_PAD(s32); sp60.x = this->actor.world.pos.x; sp60.y = this->actor.floorHeight; @@ -367,7 +368,7 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { void EnPoRelay_Update(Actor* thisx, PlayState* play) { EnPoRelay* this = (EnPoRelay*)thisx; - s32 pad; + STACK_PAD(s32); SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index fcd5a3ce27..3dc1193ef7 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -14,6 +14,7 @@ #include "sequence.h" #include "sfx.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -195,7 +196,7 @@ static Vec3f D_80ADD7F8 = { 1000.0f, -1700.0f, 0.0f }; void EnPoSisters_Init(Actor* thisx, PlayState* play) { EnPoSisters* this = (EnPoSisters*)thisx; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); @@ -417,8 +418,7 @@ void func_80AD9AA8(EnPoSisters* this, PlayState* play) { this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x800); Actor* actor3 = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0xC00); - s32 pad; - s32 pad1; + STACK_PADS(s32, 2); if (actor1 == NULL || actor2 == NULL || actor3 == NULL) { if (actor1 != NULL) { @@ -682,7 +682,7 @@ void func_80ADA7F0(EnPoSisters* this, PlayState* play) { } void func_80ADA8C0(EnPoSisters* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { @@ -954,9 +954,6 @@ void func_80ADB51C(EnPoSisters* this, PlayState* play) { } void func_80ADB770(EnPoSisters* this, PlayState* play) { - s32 temp_v0; - s32 phi_a0; - if (this->unk_19A != 0) { this->unk_19A--; } @@ -1192,7 +1189,7 @@ void func_80ADC10C(EnPoSisters* this, PlayState* play) { } void EnPoSisters_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnPoSisters* this = (EnPoSisters*)thisx; s16 temp; @@ -1319,7 +1316,7 @@ s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) { EnPoSisters* this = (EnPoSisters*)thisx; s32 i; - s32 pad; + STACK_PAD(s32); if (this->actionFunc == func_80ADAFC0 && this->unk_19A >= 8 && limbIndex == 9) { MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_sisters.c", 2876); @@ -1359,13 +1356,13 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s void EnPoSisters_Draw(Actor* thisx, PlayState* play) { EnPoSisters* this = (EnPoSisters*)thisx; - s32 pad1; + STACK_PAD(s32); f32 phi_f20; s32 i; u8 phi_s5; Color_RGBA8* temp_s1 = &D_80ADD700[this->unk_194]; Color_RGBA8* temp_s7 = &D_80ADD6F0[this->unk_194]; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_po_sisters.c", 2989); func_80ADC55C(this); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index b6e7232852..09ab3d23a9 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -198,7 +199,7 @@ static Vec3f D_80AE1B60 = { 0.0f, 3.0f, 0.0f }; static Vec3f D_80AE1B6C = { 0.0f, 0.0f, 0.0f }; void EnPoh_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnItem00* collectible; EnPoh* this = (EnPoh*)thisx; @@ -620,8 +621,7 @@ void func_80ADF15C(EnPoh* this, PlayState* play) { Vec3f vec; f32 multiplier; f32 newScale; - s32 pad; - s32 pad1; + STACK_PADS(s32, 2); this->unk_198++; if (this->unk_198 < 8) { @@ -999,7 +999,7 @@ void func_80AE089C(EnPoh* this) { void EnPoh_UpdateLiving(Actor* thisx, PlayState* play) { EnPoh* this = (EnPoh*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f checkPos; s32 bgId; @@ -1186,7 +1186,7 @@ void EnPoh_DrawSoul(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_OPA_DISP++, this->info->lanternDisplayList); if (this->infoIdx == EN_POH_INFO_COMPOSER) { Color_RGBA8* envColor = (this->actor.params == EN_POH_SHARP) ? &D_80AE1B4C : &D_80AE1B50; - s32 pad; + STACK_PAD(s32); gSPDisplayList(POLY_OPA_DISP++, gPoeComposerLanternBottomDL); gDPPipeSync(POLY_OPA_DISP++); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 3091697443..84d852f4a2 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -360,11 +361,11 @@ void EnRd_SetupWalkToPlayer(EnRd* this, PlayState* play) { } void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { - Vec3f D_80AE4918 = { 0.0f, 0.0f, 0.0f }; - Color_RGBA8 D_80AE4924 = { 200, 200, 255, 255 }; - Color_RGBA8 D_80AE4928 = { 0, 0, 255, 0 }; + UNUSED Vec3f D_80AE4918 = { 0.0f, 0.0f, 0.0f }; + UNUSED Color_RGBA8 D_80AE4924 = { 200, 200, 255, 255 }; + UNUSED Color_RGBA8 D_80AE4928 = { 0, 0, 255, 0 }; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headYRotation - this->upperBodyYRotation; this->skelAnime.playSpeed = this->actor.speed; @@ -442,7 +443,7 @@ void EnRd_SetupWalkToHome(EnRd* this, PlayState* play) { void EnRd_WalkToHome(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 targetY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { @@ -499,7 +500,7 @@ void EnRd_SetupWalkToParent(EnRd* this) { * fade away. */ void EnRd_WalkToParent(EnRd* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 targetY; Vec3f parentPos; @@ -548,7 +549,7 @@ void EnRd_SetupGrab(EnRd* this) { } void EnRd_Grab(EnRd* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); if (SkelAnime_Update(&this->skelAnime)) { @@ -629,9 +630,9 @@ void EnRd_SetupAttemptPlayerFreeze(EnRd* this) { } void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) { - Vec3f D_80AE492C = { 0.0f, 0.0f, 0.0f }; - Color_RGBA8 D_80AE4938 = { 200, 200, 255, 255 }; - Color_RGBA8 D_80AE493C = { 0, 0, 255, 0 }; + UNUSED Vec3f D_80AE492C = { 0.0f, 0.0f, 0.0f }; + UNUSED Color_RGBA8 D_80AE4938 = { 200, 200, 255, 255 }; + UNUSED Color_RGBA8 D_80AE493C = { 0, 0, 255, 0 }; Player* player = GET_PLAYER(play); s16 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headYRotation - this->upperBodyYRotation; @@ -823,7 +824,7 @@ void EnRd_TurnTowardsPlayer(EnRd* this, PlayState* play) { } void EnRd_UpdateDamage(EnRd* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) && @@ -877,10 +878,10 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { } void EnRd_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnRd* this = (EnRd*)thisx; Player* player = GET_PLAYER(play); - s32 pad2; + STACK_PAD(s32); EnRd_UpdateDamage(this, play); @@ -993,9 +994,9 @@ void EnRd_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } void EnRd_Draw(Actor* thisx, PlayState* play) { - static Vec3f D_80AE494C = { 300.0f, 0.0f, 0.0f }; + UNUSED static Vec3f D_80AE494C = { 300.0f, 0.0f, 0.0f }; static Vec3f sShadowScale = { 0.25f, 0.25f, 0.25f }; - s32 pad; + STACK_PAD(s32); EnRd* this = (EnRd*)thisx; Vec3f thisPos = thisx->world.pos; diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 1cb43e2481..d5c878119f 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -16,6 +16,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -127,7 +128,7 @@ static ColliderCylinderInit sCylinderInit = { }; void EnReeba_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnReeba* this = (EnReeba*)thisx; s32 surfaceType; @@ -174,7 +175,7 @@ void EnReeba_Init(Actor* thisx, PlayState* play) { } void EnReeba_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnReeba* this = (EnReeba*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -698,7 +699,7 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) { } void EnReeba_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnReeba* this = (EnReeba*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_reeba.c", 1062); diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 83b51453e5..bc3bb78031 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -11,6 +11,7 @@ #include "printf.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -48,7 +49,7 @@ void EnRl_Destroy(Actor* thisx, PlayState* play) { } void func_80AE72D0(EnRl* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* timer = &this->timer; s16* eyeTextureIndex = &this->eyeTextureIndex; @@ -129,7 +130,7 @@ void func_80AE7544(EnRl* this, PlayState* play) { } void func_80AE7590(EnRl* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player; Vec3f pos; s16 sceneId = play->sceneId; @@ -322,7 +323,7 @@ void func_80AE7D40(EnRl* this, PlayState* play) { } void func_80AE7D94(EnRl* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 temp = this->eyeTextureIndex; void* tex = D_80AE81A0[temp]; SkelAnime* skelAnime = &this->skelAnime; @@ -372,7 +373,7 @@ void func_80AE7FD0(EnRl* this, PlayState* play) { } void func_80AE7FDC(EnRl* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 temp = this->eyeTextureIndex; void* tex = D_80AE81A0[temp]; SkelAnime* skelAnime = &this->skelAnime; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 5ed4a1ea37..7f55d1a22e 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -14,6 +14,7 @@ #include "rand.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -221,7 +222,7 @@ void EnRr_Init(Actor* thisx, PlayState* play2) { } void EnRr_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnRr* this = (EnRr*)thisx; Collider_DestroyCylinder(play, &this->collider1); @@ -682,7 +683,7 @@ void EnRr_Damage(EnRr* this, PlayState* play) { } void EnRr_Death(EnRr* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 i; if (this->frameCount < 40) { @@ -786,7 +787,7 @@ void EnRr_Stunned(EnRr* this, PlayState* play) { } void EnRr_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnRr* this = (EnRr*)thisx; s32 i; @@ -870,7 +871,7 @@ static Vec3f sEffectOffsets[] = { }; void EnRr_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f zeroVec; EnRr* this = (EnRr*)thisx; s32 i; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 6f897d28b0..4bb3ca35af 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -5,6 +5,7 @@ */ #include "z_en_ru1.h" +#include "attributes.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "libc64/math64.h" @@ -17,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -125,7 +127,7 @@ static void* sMouthTextures[] = { gRutoChildMouthOpenTex, }; -static s32 sUnused = 0; +UNUSED static s32 sUnused = 0; #include "z_en_ru1_cutscene_data.inc.c" @@ -205,14 +207,14 @@ ActorProfile En_Ru1_Profile = { }; void EnRu1_UpdateStandingOC(EnRu1* this, PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); Collider_UpdateCylinder(&this->actor, &this->standingCollider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->standingCollider.base); } void EnRu1_UpdateSittingOC(EnRu1* this, PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); Collider_UpdateCylinder(&this->actor, &this->sittingCollider); if (this->isSittingOCActive) { @@ -223,7 +225,7 @@ void EnRu1_UpdateSittingOC(EnRu1* this, PlayState* play) { } void EnRu1_UpdateSittingAT(EnRu1* this, PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); Collider_UpdateCylinder(&this->actor, &this->sittingCollider); CollisionCheck_SetAT(play, &play->colChkCtx, &this->sittingCollider.base); @@ -267,7 +269,7 @@ void EnRu1_Destroy(Actor* thisx, PlayState* play) { } void EnRu1_UpdateEyes(EnRu1* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyes = &this->eyes; @@ -307,7 +309,7 @@ s32 EnRu1_IsCsStateIdle(PlayState* play) { } CsCmdActorCue* EnRu1_GetCue(PlayState* play, s32 cueChannel) { - s32 pad[2]; + STACK_PADS(s32, 2); CsCmdActorCue* cue = NULL; if (!EnRu1_IsCsStateIdle(play)) { @@ -422,7 +424,7 @@ void func_80AEB220(EnRu1* this, PlayState* play) { #endif void EnRu1_AnimationChange(EnRu1* this, AnimationHeader* animation, u8 mode, f32 morphFrames, s32 playReversed) { - s32 pad[2]; + STACK_PADS(s32, 2); AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation); f32 frameCount = Animation_GetLastFrame(animHeader); f32 playbackSpeed; @@ -487,7 +489,6 @@ s32 func_80AEB480(PlayState* play, u16 cueId) { void EnRu1_SpawnRipple(EnRu1* this, PlayState* play, s16 radiusMax, s16 life) { Vec3f pos; - Actor* thisx = &this->actor; pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y + this->actor.depthInWater; @@ -586,7 +587,7 @@ void func_80AEB974(EnRu1* this, PlayState* play) { Vec3f* thisPos; f32 sp30; CsCmdActorCue* cue = EnRu1_GetCueChannel3(play); - s32 pad; + STACK_PAD(s32); if (cue != NULL) { sp30 = func_80AEB7E0(cue, play); @@ -602,12 +603,12 @@ void func_80AEBA0C(EnRu1* this, PlayState* play) { } void func_80AEBA2C(EnRu1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f* unk_364 = &this->unk_364; Vec3f* thisPos; f32 temp_ret_2; CsCmdActorCue* cue = EnRu1_GetCueChannel3(play); - s32 pad2; + STACK_PAD(s32); if (cue != NULL) { temp_ret_2 = func_80AEB7E0(cue, play); @@ -681,7 +682,7 @@ void func_80AEBD1C(EnRu1* this, PlayState* play) { } void func_80AEBD94(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 frameCount; if (func_80AEB480(play, 3)) { @@ -695,7 +696,7 @@ void func_80AEBD94(EnRu1* this, PlayState* play) { } void func_80AEBE3C(EnRu1* this, PlayState* play, s32 arg2) { - s32 pad[2]; + STACK_PADS(s32, 2); if (arg2 != 0) { f32 frameCount = Animation_GetLastFrame(&gRutoChildTreadWaterAnim); @@ -709,7 +710,7 @@ void func_80AEBE3C(EnRu1* this, PlayState* play, s32 arg2) { } void func_80AEBEC8(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 frameCount; if (func_80AEB458(play, 6)) { @@ -723,7 +724,7 @@ void func_80AEBEC8(EnRu1* this, PlayState* play) { void func_80AEBF60(EnRu1* this, PlayState* play) { if (func_80AEB480(play, 6)) { - s32 pad; + STACK_PAD(s32); func_80AEB7D0(this); this->action = ENRU1_ACTION_05; @@ -891,7 +892,7 @@ s32 func_80AEC5FC(EnRu1* this, PlayState* play) { } void func_80AEC650(EnRu1* this) { - s32 pad[2]; + STACK_PADS(s32, 2); if (this->unk_280 == 0) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { @@ -915,7 +916,7 @@ void func_80AEC6E4(EnRu1* this, PlayState* play) { } void func_80AEC780(EnRu1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); if ((func_80AEC5FC(this, play)) && (!Play_InCsMode(play)) && @@ -975,7 +976,7 @@ void func_80AEC9C4(EnRu1* this) { void func_80AECA18(EnRu1* this) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { - s32 pad; + STACK_PAD(s32); this->action = ENRU1_ACTION_13; this->unk_26C = 0.0f; @@ -1050,13 +1051,13 @@ void func_80AECC84(EnRu1* this, PlayState* play) { } void func_80AECCB0(EnRu1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f* pos; s16 yawTowardsPlayer; f32 spawnX; f32 spawnY; f32 spawnZ; - s32 pad2[2]; + STACK_PADS(s32, 2); yawTowardsPlayer = this->actor.yawTowardsPlayer; pos = &this->actor.world.pos; @@ -1080,11 +1081,11 @@ void func_80AECE04(EnRu1* this, PlayState* play) { } void func_80AECE20(EnRu1* this, PlayState* play) { - s32 pad2; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f* playerPos = &player->actor.world.pos; s16 shapeRotY = player->actor.shape.rot.y; - s32 pad; + STACK_PAD(s32); f32 unk_27C = this->unk_27C; Vec3f* pos = &this->actor.world.pos; @@ -1094,7 +1095,7 @@ void func_80AECE20(EnRu1* this, PlayState* play) { } void func_80AECEB4(EnRu1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f* player_unk_450 = &player->unk_450; Vec3f* pos = &this->actor.world.pos; @@ -1111,7 +1112,7 @@ s32 func_80AECF6C(EnRu1* this, PlayState* play) { s16 temp_f16; f32 temp1; f32 temp2; - s32 pad2[5]; + STACK_PADS(s32, 5); this->unk_26C += 1.0f; if ((player->actor.speed == 0.0f) && (this->unk_26C >= 3.0f)) { @@ -1320,7 +1321,7 @@ void func_80AED6F8(PlayState* play) { void func_80AED738(EnRu1* this, PlayState* play) { if (func_80AED624(this, play)) { - s32 pad; + STACK_PAD(s32); this->unk_2A4 += 1.0f; if (this->unk_2A4 < 20.0f) { @@ -1335,7 +1336,7 @@ void func_80AED738(EnRu1* this, PlayState* play) { } void func_80AED83C(EnRu1* this) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3s* headRot; Vec3s* torsoRot; @@ -1352,7 +1353,7 @@ void EnRu1_UpdateHeadRotation(EnRu1* this) { s16* headRotTimer = &this->headRotTimer; s16* headRotY = &this->interactInfo.headRot.y; s16* headTurnSpeed = &this->headTurnSpeed; - s32 pad[2]; + STACK_PADS(s32, 2); if (DECR(*headRotTimer) == 0) { *headRotTimer = Rand_S16Offset(0xA, 0x19); @@ -1431,7 +1432,7 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { } } if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) { - s32 pad; + STACK_PAD(s32); speedXZ = &this->actor.speed; velocityY = &this->actor.velocity.y; @@ -1511,7 +1512,7 @@ void func_80AEE02C(EnRu1* this) { } void EnRu1_UpdateWaterState(EnRu1* this) { - s32 pad; + STACK_PAD(s32); f32 bobMagnitude; f32 startY; EnRu1* thisx = this; // necessary to match @@ -1602,7 +1603,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { } s32 func_80AEE394(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); CollisionContext* colCtx; DynaPolyActor* dynaPolyActor; s32 floorBgId; @@ -1635,7 +1636,7 @@ void func_80AEE488(EnRu1* this, PlayState* play) { this->action = ENRU1_ACTION_31; func_80AED520(this, play); } else if (!func_80AEE394(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { - s32 pad; + STACK_PAD(s32); this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); @@ -1647,7 +1648,7 @@ void func_80AEE568(EnRu1* this, PlayState* play) { if (!func_80AEE394(this, play)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed == 0.0f) && (this->actor.minVelocityY == 0.0f)) { - s32 pad; + STACK_PAD(s32); func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); @@ -1664,7 +1665,7 @@ void func_80AEE568(EnRu1* this, PlayState* play) { } void func_80AEE628(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s8 curRoomNum = play->roomCtx.curRoom.num; if (EnRu1_IsCsStateIdle(play)) { @@ -1677,7 +1678,7 @@ void func_80AEE628(EnRu1* this, PlayState* play) { } s32 func_80AEE6D0(EnRu1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s8 curRoomNum = play->roomCtx.curRoom.num; if (!GET_INFTABLE(INFTABLE_144) && (func_80AEB124(play) != NULL)) { @@ -1698,7 +1699,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { } void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { - s32 pad[9]; + STACK_PADS(s32, 9); Player* player; f32* carryIdleTimer = &this->carryIdleTimer; @@ -1715,7 +1716,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { this->action = ENRU1_ACTION_28; *carryIdleTimer = 0.0f; } else if (func_80AEE6D0(this, play)) { - s32 pad; + STACK_PAD(s32); *carryIdleTimer = 0.0f; } else { @@ -1755,7 +1756,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { - s32 pad; + STACK_PAD(s32); func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); @@ -2082,7 +2083,7 @@ void func_80AEF820(EnRu1* this, UNK_TYPE arg1) { } void func_80AEF890(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s8 curRoomNum; if (!(DEBUG_FEATURES && IS_CUTSCENE_LAYER) && EnRu1_IsCsStateIdle(play)) { @@ -2193,7 +2194,7 @@ void func_80AEFC24(EnRu1* this, PlayState* play) { void EnRu1_InitInSapphireRoom(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) { - s32 pad; + STACK_PAD(s32); EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->action = ENRU1_ACTION_41; @@ -2321,7 +2322,7 @@ void EnRu1_Update(Actor* thisx, PlayState* play) { } void EnRu1_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnRu1* this = (EnRu1*)thisx; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); @@ -2413,13 +2414,13 @@ void EnRu1_DrawNothing(EnRu1* this, PlayState* play) { } void EnRu1_DrawOpa(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyes = this->eyes; void* eyeTex = sEyeTextures[eyes]; s16 mouth = this->mouth; SkelAnime* skelAnime = &this->skelAnime; void* mouthTex = sMouthTextures[mouth]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1282); @@ -2438,13 +2439,13 @@ void EnRu1_DrawOpa(EnRu1* this, PlayState* play) { } void EnRu1_DrawXlu(EnRu1* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyes = this->eyes; void* eyeTex = sEyeTextures[eyes]; s16 mouth = this->mouth; SkelAnime* skelAnime = &this->skelAnime; void* mouthTex = sMouthTextures[mouth]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1324); diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c index 32717457ef..67d0ece9b2 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c @@ -1,4 +1,5 @@ #include "z_en_ru1.h" +#include "attributes.h" #include "cutscene_commands.h" // clang-format off @@ -110,7 +111,7 @@ static CutsceneData gRutoFirstMeetingCs[] = { CS_END_OF_SCRIPT(), }; -static u32 D_80AF10A0 = 0; +UNUSED static u32 D_80AF10A0 = 0; static CutsceneData gRutoObtainingSapphireCs[] = { CS_HEADER(14, 1299), @@ -199,7 +200,7 @@ static CutsceneData gRutoObtainingSapphireCs[] = { CS_END_OF_SCRIPT(), }; -static u32 D_80AF1724 = 0; +UNUSED static u32 D_80AF1724 = 0; static CutsceneData gRutoFoundSapphireCs[] = { CS_HEADER(7, 1160), diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 6e35bd842f..d172f559cb 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -16,6 +16,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -162,7 +163,7 @@ void EnRu2_InitCollider(Actor* thisx, PlayState* play) { } void EnRu2_UpdateCollider(EnRu2* this, PlayState* play) { - s32 pad[5]; + STACK_PADS(s32, 5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -175,7 +176,7 @@ void EnRu2_Destroy(Actor* thisx, PlayState* play) { } void EnRu2_UpdateEyes(EnRu2* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyeIndex = &this->eyeIndex; @@ -355,7 +356,7 @@ void EnRu2_SpawnWaterMedallion(EnRu2* this, PlayState* play) { * This function will loop endlessly if the current sage cutscene is not for the Water Medallion. */ void EnRu2_CheckWaterMedallionCutscene(EnRu2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Player* player; s16 yaw; @@ -598,7 +599,7 @@ void EnRu2_AwaitSpawnLightBall(EnRu2* this, PlayState* play) { } void EnRu2_DrawXlu(EnRu2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* tex = sEyeTextures[eyeIndex]; SkelAnime* skelAnime = &this->skelAnime; @@ -823,12 +824,12 @@ void EnRu2_EncounterBeginningHandler(EnRu2* this, PlayState* play) { } void EnRu2_DialogCameraHandler(EnRu2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); MessageContext* msgCtx; - s32 pad2; + STACK_PAD(s32); u8 dialogState; Player* player; - s32 pad3; + STACK_PAD(s32); msgCtx = &play->msgCtx; dialogState = Message_GetState(msgCtx); @@ -959,7 +960,7 @@ void EnRu2_DrawNothing(EnRu2* this, PlayState* play) { } void EnRu2_DrawOpa(EnRu2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeIndex = this->eyeIndex; void* tex = sEyeTextures[eyeIndex]; SkelAnime* skelAnime = &this->skelAnime; diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 2f39fefa34..53a6f4f3c7 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -5,6 +5,7 @@ #include "gfx.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -492,7 +493,7 @@ void func_80AF6170(CsCmdActorCue* cue, Vec3f* dst) { void EnSa_Init(Actor* thisx, PlayState* play) { EnSa* this = (EnSa*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 12.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gSariaSkel, NULL, this->jointTable, this->morphTable, 17); @@ -740,7 +741,7 @@ void func_80AF6B20(EnSa* this, PlayState* play) { void EnSa_Update(Actor* thisx, PlayState* play) { EnSa* this = (EnSa*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -779,7 +780,7 @@ void EnSa_Update(Actor* thisx, PlayState* play) { s32 EnSa_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { EnSa* this = (EnSa*)thisx; - s32 pad; + STACK_PAD(s32); Vec3s limbRot; if (limbIndex == 16) { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 6ece8b50b5..fa0b3fdcf2 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -11,6 +11,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -294,7 +295,7 @@ void EnSb_Lunge(EnSb* this, PlayState* play) { } void EnSb_Bounce(EnSb* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 currentFrame; f32 frameCount; @@ -453,7 +454,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { void EnSb_Update(Actor* thisx, PlayState* play) { EnSb* this = (EnSb*)thisx; - s32 pad; + STACK_PAD(s32); if (this->isDead) { if (this->actor.depthInWater > 0.0f) { diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index 3ba16d656c..3c50ab2ea5 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "play_state.h" +#include "stack_pad.h" #define FLAGS 0 @@ -54,9 +55,9 @@ void EnSceneChange_Update(Actor* thisx, PlayState* play) { } void EnSceneChange_Draw(Actor* thisx, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Gfx* displayList; - s32 pad2[2]; + STACK_PADS(s32, 2); Gfx* displayListHead; displayList = GRAPH_ALLOC(play->state.gfxCtx, 0x3C0); diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index 1276b7f5ee..62ec891427 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -6,10 +6,12 @@ #include "z_en_sda.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "player.h" @@ -80,8 +82,8 @@ static Vec3f D_80AFA180[] = { { 1.0f, -2.0f, -0.2f }, { 0.0f, -3.0f, -0.5f }, }; -// Unused, identical to D_80AFA180 -static Vec3f D_80AFA288[] = { +// Identical to D_80AFA180 +UNUSED static Vec3f D_80AFA288[] = { { -1.0f, 2.0f, -0.2f }, { 0.0f, 2.0f, -0.5f }, { 1.0f, 2.0f, -0.2f }, { -2.0f, 1.0f, -0.5f }, { -1.0f, 1.0f, -0.2f }, { 0.0f, 1.0f, -0.2f }, { 1.0f, 1.0f, -0.2f }, { 2.0f, 1.0f, -0.5f }, { -2.0f, 0.0f, -0.5f }, { -1.0f, 0.0f, -0.2f }, { 0.0f, 0.0f, 0.0f }, { 1.0f, 0.0f, -0.2f }, @@ -90,7 +92,7 @@ static Vec3f D_80AFA288[] = { { 1.0f, -2.0f, -0.2f }, { 0.0f, -3.0f, -0.5f }, }; -static u32 D_80AFA390[] = { 0, 0 }; +UNUSED static u32 D_80AFA390[] = { 0, 0 }; #include "assets/overlays/ovl_En_Sda/ovl_En_Sda.c" @@ -103,7 +105,7 @@ void EnSda_Destroy(Actor* thisx, PlayState* play) { } void EnSda_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSda* this = (EnSda*)thisx; Player* player; @@ -339,7 +341,7 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl } void func_80AF9C70(u8* shadowTexture, Player* player, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 tempx; f32 tempz; s16 phi_s1; diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index b56bca6f67..689434a909 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -52,7 +53,7 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { EnSiofuki* this = (EnSiofuki*)thisx; s32 type; CollisionHeader* colHeader = NULL; - s32 pad; + STACK_PAD(s32); if ((thisx->room == 10) && Flags_GetSwitch(play, 0x1E)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 5d21c25fb4..027b13f100 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "z_en_item00.h" #include "z_lib.h" @@ -456,7 +457,7 @@ void EnSkb_Death(EnSkb* this, PlayState* play) { } void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { - s16 pad; + STACK_PAD(s16); s32 i; Vec3f flamePos; s16 scale; @@ -523,7 +524,7 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { void EnSkb_Update(Actor* thisx, PlayState* play) { EnSkb* this = (EnSkb*)thisx; - s32 pad; + STACK_PAD(s32); EnSkb_CheckDamage(this, play); Actor_MoveXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 492b973735..c99a2547eb 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -9,6 +9,7 @@ #include "regs.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -386,7 +387,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { s16 type = PARAMS_GET_U(thisx->params, 10, 6); EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; - s32 pad; + STACK_PAD(s32); Actor_ProcessInitChain(thisx, sInitChain); switch (type) { @@ -485,7 +486,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { } void EnSkj_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSkj* this = (EnSkj*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -515,7 +516,7 @@ f32 EnSkj_GetItemYRange(EnSkj* this) { } s32 EnSkj_ShootNeedle(EnSkj* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f pos; Vec3f pos2; EnSkjneedle* needle; @@ -832,7 +833,7 @@ void EnSkj_SetupStand(EnSkj* this) { void EnSkj_Fight(EnSkj* this, PlayState* play) { Vec3f pos1; Vec3f pos2; - s32 pad[3]; + STACK_PADS(s32, 3); f32 prevPosX; f32 prevPosZ; f32 phi_f14; @@ -1055,7 +1056,7 @@ void EnSkj_SetupTalk(EnSkj* this) { } void EnSkj_SariaSongTalk(EnSkj* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if (GET_ITEMGETINF(ITEMGETINF_16)) { @@ -1310,7 +1311,7 @@ void EnSkj_LeaveOcarinaGame(EnSkj* this, PlayState* play) { void EnSkj_Update(Actor* thisx, PlayState* play) { Vec3f dropPos; - s32 pad; + STACK_PAD(s32); EnSkj* this = (EnSkj*)thisx; D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play); @@ -1673,7 +1674,7 @@ Gfx* EnSkj_OpaqueDL(GraphicsContext* gfxCtx, u32 alpha) { } void EnSkj_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSkj* this = (EnSkj*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_skj.c", 2475); diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 11c33d8469..04341095a9 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" @@ -106,7 +107,7 @@ void EnSkjneedle_Update(Actor* thisx, PlayState* play2) { } void EnSkjneedle_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_skj_needle.c", 200); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index f3649fa697..9c9bc2cf25 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -208,7 +209,7 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) { &sCylinderInit1, &sCylinderInit1, &sCylinderInit1, &sCylinderInit2, &sCylinderInit2, &sCylinderInit2, }; s32 i; - s32 pad; + STACK_PAD(s32); for (i = 0; i < ARRAY_COUNT(cylinders); i++) { Collider_InitCylinder(play, &this->colliderCylinders[i]); @@ -240,7 +241,7 @@ f32 EnSsh_SetAnimation(EnSsh* this, s32 animIndex) { f32 playbackSpeed[] = { 1.0f, 4.0f, 1.0f, 1.0f, 8.0f, 6.0f, 2.0f }; u8 mode[] = { 3, 3, 1, 3, 1, 1, 1 }; f32 frameCount = Animation_GetLastFrame(animation[animIndex]); - s32 pad; + STACK_PAD(s32); Animation_Change(&this->skelAnime, animation[animIndex], playbackSpeed[animIndex], 0.0f, frameCount, mode[animIndex], -6.0f); @@ -401,7 +402,7 @@ s32 EnSsh_IsCloseToLink(EnSsh* this, PlayState* play) { s32 EnSsh_IsCloseToHome(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * vel; if (nextY >= this->actor.home.pos.y) { return 1; @@ -411,7 +412,7 @@ s32 EnSsh_IsCloseToHome(EnSsh* this) { s32 EnSsh_IsCloseToGround(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * vel; if ((nextY - this->actor.floorHeight) <= this->floorHeightOffset) { return 1; @@ -620,7 +621,7 @@ void EnSsh_SetColliders(EnSsh* this, PlayState* play) { void EnSsh_Init(Actor* thisx, PlayState* play) { f32 frameCount; - s32 pad; + STACK_PAD(s32); EnSsh* this = (EnSsh*)thisx; frameCount = Animation_GetLastFrame(&object_ssh_Anim_000304); @@ -652,7 +653,7 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { } void EnSsh_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSsh* this = (EnSsh*)thisx; s32 i; @@ -820,7 +821,7 @@ void EnSsh_Start(EnSsh* this, PlayState* play) { } void EnSsh_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSsh* this = (EnSsh*)thisx; EnSsh_UpdateColliderScale(this); @@ -891,7 +892,7 @@ void EnSsh_Draw(Actor* thisx, PlayState* play) { object_ssh_Tex_000C60, object_ssh_Tex_001060, }; - s32 pad; + STACK_PAD(s32); EnSsh* this = (EnSsh*)thisx; EnSsh_CheckBodyStickHit(this, play); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index f32ce0ba67..3dc883ba23 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -11,6 +11,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -299,7 +300,7 @@ void EnSt_InitColliders(EnSt* this, PlayState* play) { }; s32 i; - s32 pad; + STACK_PAD(s32); for (i = 0; i < ARRAY_COUNT(cylinders); i++) { Collider_InitCylinder(play, &this->colliderCylinders[i]); @@ -805,7 +806,7 @@ void EnSt_Sway(EnSt* this) { void EnSt_Init(Actor* thisx, PlayState* play) { EnSt* this = (EnSt*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); @@ -1033,7 +1034,7 @@ void EnSt_StartOnCeilingOrGround(EnSt* this, PlayState* play) { void EnSt_Update(Actor* thisx, PlayState* play) { EnSt* this = (EnSt*)thisx; - s32 pad; + STACK_PAD(s32); Color_RGBA8 color = { 0, 0, 0, 0 }; if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) { diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 5cd96b9c63..3bb0444ba5 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -143,7 +144,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { } void EnSth_SetupShapeColliderUpdate2AndDraw(EnSth* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); Collider_InitCylinder(play, &this->collider); @@ -154,7 +155,7 @@ void EnSth_SetupShapeColliderUpdate2AndDraw(EnSth* this, PlayState* play) { } void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16* params; EnSth_SetupShapeColliderUpdate2AndDraw(this, play); @@ -186,7 +187,7 @@ void EnSth_WaitForObject(EnSth* this, PlayState* play) { } void EnSth_FacePlayer(EnSth* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 diffRot = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(diffRot) <= 0x4000) { @@ -321,7 +322,7 @@ void EnSth_Update(Actor* thisx, PlayState* play) { void EnSth_Update2(Actor* thisx, PlayState* play) { EnSth* this = (EnSth*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -397,7 +398,7 @@ void EnSth_Draw(Actor* thisx, PlayState* play) { { 190, 110, 0 }, { 0, 180, 110 }, { 0, 255, 80 }, { 255, 160, 60 }, { 190, 230, 250 }, { 240, 230, 120 }, }; EnSth* this = (EnSth*)thisx; - Color_RGB8* envColor1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_sth.c", 2133); diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index c8c301cb2d..ec84c802fe 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -92,12 +93,11 @@ s32 func_80B0B81C(Vec3f* vortexPosRot, Vec3f* playerPosRot, Vec3f* posDifference void EnStream_SuckPlayer(EnStream* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad48; + STACK_PAD(s32); Vec3f posDifference; f32 xzDist; f32 yDistWithOffset; - s32 pad30; - s32 pad2C; + STACK_PADS(s32, 2); if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &posDifference, this->actor.scale.y) != 0) { xzDist = sqrtf(SQ(posDifference.x) + SQ(posDifference.z)); @@ -123,7 +123,7 @@ void EnStream_SuckPlayer(EnStream* this, PlayState* play) { void EnStream_WaitForPlayer(EnStream* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 pad; + STACK_PAD(s16); Vec3f temp; if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &temp, this->actor.scale.y) != 0) { diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 44a589c993..d9c3265b9e 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -6,6 +6,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_en_item00.h" @@ -90,7 +91,7 @@ s32 func_80B0BE20(EnSw* this, CollisionPoly* poly) { Vec3f sp38; f32 sp34; f32 temp_f0; - s32 pad; + STACK_PAD(s32); this->actor.floorPoly = poly; polyNormal.x = COLPOLY_GET_NORMAL(poly->normal.x); @@ -132,7 +133,7 @@ s32 func_80B0BE20(EnSw* this, CollisionPoly* poly) { CollisionPoly* func_80B0C020(PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32* arg4) { CollisionPoly* sp3C; - s32 pad; + STACK_PAD(s32); if (!BgCheck_EntityLineTest1(&play->colCtx, arg1, arg2, arg3, &sp3C, true, true, true, false, arg4)) { return NULL; @@ -156,7 +157,7 @@ s32 func_80B0C0CC(EnSw* this, PlayState* play, s32 arg2) { Vec3f sp90; Vec3f sp84; Vec3f sp78; - s32 pad; + STACK_PAD(s32); s32 sp70; s32 sp6C; s32 phi_s1; @@ -233,8 +234,8 @@ s32 func_80B0C0CC(EnSw* this, PlayState* play, s32 arg2) { void EnSw_Init(Actor* thisx, PlayState* play) { EnSw* this = (EnSw*)thisx; s32 phi_v0; - Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; - s32 pad; + UNUSED Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; + STACK_PAD(s32); if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { phi_v0 = PARAMS_GET_S(thisx->params - 0x8000, 13, 3) + 1; @@ -728,7 +729,7 @@ s32 func_80B0DEA8(EnSw* this, PlayState* play, s32 arg2) { } s32 func_80B0DFFC(EnSw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CollisionPoly* sp60; s32 sp5C; Vec3f sp50; @@ -833,7 +834,7 @@ s32 func_80B0E430(EnSw* this, f32 arg1, s16 arg2, s32 arg3, PlayState* play) { } void func_80B0E5E0(EnSw* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); f32 rand; if (func_80B0E430(this, 6.0f, 0x3E8, 1, play)) { @@ -852,7 +853,7 @@ void func_80B0E5E0(EnSw* this, PlayState* play) { void func_80B0E728(EnSw* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if (DECR(this->unk_442) != 0) { if (func_80B0DEA8(this, play, 1)) { @@ -885,7 +886,7 @@ void func_80B0E728(EnSw* this, PlayState* play) { } void func_80B0E90C(EnSw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); func_80B0E314(this, this->unk_448, 0.0f); if (this->actor.speed == 0.0f) { @@ -896,7 +897,7 @@ void func_80B0E90C(EnSw* this, PlayState* play) { } void func_80B0E9BC(EnSw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (func_80B0E430(this, 6.0f, 0x3E8, 0, play)) { func_80B0E314(this, this->unk_448, 2.0f); @@ -1004,7 +1005,7 @@ void func_80B0EDB8(PlayState* play, Color_RGBA8* arg1, s16 arg2, s16 arg3) { } void func_80B0EEA4(PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_sw.c", 2205); diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index 045c8afbc0..8a31c91e1f 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -7,6 +7,7 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -338,7 +339,7 @@ void EnSyatekiItm_EndGame(EnSyatekiItm* this, PlayState* play) { } void EnSyatekiItm_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSyatekiItm* this = (EnSyatekiItm*)thisx; this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 3c983d700f..3b26ac3212 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -9,6 +9,7 @@ #include "regs.h" #include "seqcmd.h" #include "sequence.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "play_state.h" @@ -170,7 +171,7 @@ static s16 sTextIds[] = { 0x2B, 0x2E, 0xC8, 0x2D }; static s16 sTextBoxCount[] = { TEXT_STATE_CHOICE, TEXT_STATE_EVENT, TEXT_STATE_EVENT, TEXT_STATE_EVENT }; void EnSyatekiMan_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSyatekiMan* this = (EnSyatekiMan*)thisx; PRINTF("\n\n"); @@ -479,7 +480,7 @@ void EnSyatekiMan_Blink(EnSyatekiMan* this) { } void EnSyatekiMan_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSyatekiMan* this = (EnSyatekiMan*)thisx; if (this->timer != 0) { @@ -517,7 +518,7 @@ s32 EnSyatekiMan_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V } void EnSyatekiMan_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnSyatekiMan* this = (EnSyatekiMan*)thisx; Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index c01b1a22d2..e09b3b331b 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -6,6 +6,7 @@ #include "z_en_syateki_niw.h" +#include "attributes.h" #include "libc64/math64.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -13,6 +14,7 @@ #include "printf.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -523,7 +525,7 @@ void EnSyatekiNiw_SetupRemove(EnSyatekiNiw* this, PlayState* play) { } void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 rotYTargetOffset; s16 screenX; s16 screenY; @@ -583,10 +585,10 @@ void EnSyatekiNiw_CheckHit(EnSyatekiNiw* this, PlayState* play) { void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) { EnSyatekiNiw* this = (EnSyatekiNiw*)thisx; - s32 pad; + STACK_PAD(s32); s16 i; - Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp84 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f sp84 = { 0.0f, 0.0f, 0.0f }; Vec3f pos; Vec3f vel; Vec3f accel; @@ -684,7 +686,7 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) { s32 SyatekiNiw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnSyatekiNiw* this = (EnSyatekiNiw*)thisx; - Vec3f unusedZeroVec = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f unusedZeroVec = { 0.0f, 0.0f, 0.0f }; if (limbIndex == 13) { rot->y += (s16)this->headRot.x; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 353cb507b4..38fc1c33da 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -18,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -1246,7 +1247,7 @@ void EnTa_AnimRunToEnd(EnTa* this) { void EnTa_Update(Actor* thisx, PlayState* play) { EnTa* this = (EnTa*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -1327,7 +1328,7 @@ void EnTa_Draw(Actor* thisx, PlayState* play) { gTalonEyeClosedTex, }; EnTa* this = (EnTa*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_ta.c", 2381); diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index 31df49fbc1..023d8d32ac 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -6,6 +6,7 @@ #include "z_en_tana.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" @@ -68,7 +69,7 @@ static void* sStoneTextures[] = { }; void EnTana_Init(Actor* thisx, PlayState* play) { - EnTana* this = (EnTana*)thisx; + UNUSED EnTana* this = (EnTana*)thisx; PRINTF("☆☆☆ %s ☆☆☆\n", sShelfTypes[thisx->params]); Actor_SetScale(thisx, 1.0f); @@ -83,7 +84,7 @@ void EnTana_Update(Actor* thisx, PlayState* play) { } void EnTana_DrawWoodenShelves(Actor* thisx, PlayState* play) { - EnTana* this = (EnTana*)thisx; + UNUSED EnTana* this = (EnTana*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_tana.c", 148); @@ -95,7 +96,7 @@ void EnTana_DrawWoodenShelves(Actor* thisx, PlayState* play) { } void EnTana_DrawStoneShelves(Actor* thisx, PlayState* play) { - EnTana* this = (EnTana*)thisx; + UNUSED EnTana* this = (EnTana*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_tana.c", 163); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index f81eba1e5d..dcb49e91ae 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -12,6 +12,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -374,7 +375,7 @@ void EnTest_ChooseRandomAction(EnTest* this, PlayState* play) { } void EnTest_ChooseAction(EnTest* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s16 yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y; @@ -581,7 +582,7 @@ void EnTest_SetupWalkAndBlock(EnTest* this) { } void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 checkDist = 0.0f; s32 absPlaySpeed; s32 prevFrame; @@ -615,7 +616,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { } if (ABS(this->actor.speed) < 3.0f) { - s32 pad; + STACK_PAD(s32); Animation_Change(&this->skelAnime, &gStalfosSlowAdvanceAnim, 0.0f, this->skelAnime.curFrame, Animation_GetLastFrame(&gStalfosSlowAdvanceAnim), 0, -6.0f); @@ -805,7 +806,7 @@ void func_80860EC0(EnTest* this) { // a variation of sidestep void func_80860F84(EnTest* this, PlayState* play) { s16 playerYaw180; - s32 pad; + STACK_PAD(s32); s32 prevFrame; s32 beforeCurFrame; s16 yawDiff; @@ -1377,12 +1378,12 @@ void func_808627C4(EnTest* this, PlayState* play) { // a variation of sidestep void func_808628C8(EnTest* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); - s32 pad1; + STACK_PAD(s32); s32 prevFrame; s32 beforeCurFrame; - s32 pad2; + STACK_PAD(s32); f32 checkDist = 0.0f; s16 newYaw; f32 absPlaySpeed; @@ -1719,7 +1720,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { EnTest* this = (EnTest*)thisx; f32 oldWeight; u32 floorProperty; - s32 pad; + STACK_PAD(s32); EnTest_UpdateDamage(this, play); @@ -1861,7 +1862,7 @@ s32 EnTest_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3f* } void EnTest_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - static Vec3f unused1 = { 1100.0f, -700.0f, 0.0f }; + UNUSED static Vec3f unused1 = { 1100.0f, -700.0f, 0.0f }; static Vec3f D_80864658 = { 300.0f, 0.0f, 0.0f }; static Vec3f D_80864664 = { 3400.0f, 0.0f, 0.0f }; static Vec3f D_80864670 = { 0.0f, 0.0f, 0.0f }; @@ -1869,17 +1870,17 @@ void EnTest_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot static Vec3f D_80864688 = { 3000.0f, -2000.0f, -1000.0f }; static Vec3f D_80864694 = { 3000.0f, -2000.0f, 1000.0f }; static Vec3f D_808646A0 = { -1300.0f, 1100.0f, 0.0f }; - static Vec3f unused2 = { -3000.0f, 1900.0f, 800.0f }; - static Vec3f unused3 = { -3000.0f, -1100.0f, 800.0f }; - static Vec3f unused4 = { 1900.0f, 1900.0f, 800.0f }; - static Vec3f unused5 = { -3000.0f, -1100.0f, 800.0f }; - static Vec3f unused6 = { 1900.0f, -1100.0f, 800.0f }; - static Vec3f unused7 = { 1900.0f, 1900.0f, 800.0f }; + UNUSED static Vec3f unused2 = { -3000.0f, 1900.0f, 800.0f }; + UNUSED static Vec3f unused3 = { -3000.0f, -1100.0f, 800.0f }; + UNUSED static Vec3f unused4 = { 1900.0f, 1900.0f, 800.0f }; + UNUSED static Vec3f unused5 = { -3000.0f, -1100.0f, 800.0f }; + UNUSED static Vec3f unused6 = { 1900.0f, -1100.0f, 800.0f }; + UNUSED static Vec3f unused7 = { 1900.0f, 1900.0f, 800.0f }; s32 bodyPart = -1; Vec3f sp70; Vec3f sp64; EnTest* this = (EnTest*)thisx; - s32 pad; + STACK_PAD(s32); Vec3f sp50; BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 60, 60, dList, BODYBREAK_OBJECT_SLOT_DEFAULT); diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index e0e7ef04b2..8573945514 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -7,6 +7,7 @@ #include "z_en_tg.h" #include "gfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "face_reaction.h" #include "play_state.h" @@ -142,7 +143,7 @@ void EnTg_SpinIfNotTalking(EnTg* this, PlayState* play) { void EnTg_Update(Actor* thisx, PlayState* play) { EnTg* this = (EnTg*)thisx; - s32 pad; + STACK_PAD(s32); f32 temp; Vec3s sp2C; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 1f45f2541b..e7e98f1a83 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -15,6 +15,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -909,7 +910,7 @@ void EnTite_CheckDamage(Actor* thisx, PlayState* play) { void EnTite_Update(Actor* thisx, PlayState* play) { EnTite* this = (EnTite*)thisx; - char pad[0x4]; + STACK_PAD(s32); CollisionPoly* floorPoly; WaterBox* waterBox; f32 waterSurfaceY; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index a802541986..b7a2771ae7 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -6,6 +6,7 @@ #include "z_en_tk.h" +#include "attributes.h" #include "libc64/math64.h" #include "libc64/qrand.h" #include "array_count.h" @@ -14,6 +15,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -478,8 +480,8 @@ s32 EnTk_ChooseReward(EnTk* this) { void EnTk_DigEff(EnTk* this) { Vec3f pos = { 0.0f, 0.0f, 0.0f }; - Vec3f speed = { 0.0f, 0.0f, 0.0f }; - Vec3f accel = { 0.0f, 0.3f, 0.0f }; + UNUSED Vec3f speed = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f accel = { 0.0f, 0.3f, 0.0f }; if (this->skelAnime.curFrame >= 32.0f && this->skelAnime.curFrame < 40.0f) { pos.x = (Rand_ZeroOne() - 0.5f) * 12.0f + this->v3f_304.x; @@ -491,7 +493,7 @@ void EnTk_DigEff(EnTk* this) { void EnTk_Init(Actor* thisx, PlayState* play) { EnTk* this = (EnTk*)thisx; - s32 pad; + STACK_PAD(s32); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); @@ -667,7 +669,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { void EnTk_Update(Actor* thisx, PlayState* play) { EnTk* this = (EnTk*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 3f10462ead..0c1bfc176c 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -14,6 +14,7 @@ #include "rand.h" #include "sfx.h" #include "sequence.h" +#include "stack_pad.h" #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" @@ -147,7 +148,7 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) { } void EnTorch2_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* this = (Player*)thisx; Effect_Delete(play, this->meleeWeaponEffectIndex); @@ -223,11 +224,10 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { Camera* mainCam; s16 sp66; s8 stickY; - u32 pad54; + u32 temp; Actor* attackItem; - s16 sp5A; + s16 sp5A = player->actor.shape.rot.y - this->actor.shape.rot.y; - sp5A = player->actor.shape.rot.y - this->actor.shape.rot.y; input->cur.button = 0; mainCam = Play_GetCamera(play, CAM_ID_MAIN); attackItem = EnTorch2_GetAttackItem(play, this); @@ -573,12 +573,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Updates Dark Link's "controller". The conditional seems to cause him to // stop targeting and hold shield if he's been holding it long enough. - pad54 = input->prev.button ^ input->cur.button; - input->press.button = input->cur.button & pad54; + temp = input->prev.button ^ input->cur.button; + input->press.button = input->cur.button & temp; if (CHECK_BTN_ANY(input->cur.button, BTN_R)) { input->cur.button = ((sCounterState == 0) && (this->meleeWeaponState == 0)) ? BTN_R : input->cur.button ^ BTN_R; } - input->rel.button = input->prev.button & pad54; + input->rel.button = input->prev.button & temp; input->prev.button = input->cur.button & (u16) ~(BTN_A | BTN_B); PadUtils_UpdateRelXY(input); @@ -771,7 +771,7 @@ void EnTorch2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r void EnTorch2_Draw(Actor* thisx, PlayState* play2) { PlayState* play = play2; Player* this = (Player*)thisx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_torch2.c", 1050); func_80093C80(play); diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 361ef77182..e94c1f7507 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -104,7 +105,7 @@ static Vec3f sMultVec = { 800.0f, 1000.0f, 0.0f }; void EnToryo_Init(Actor* thisx, PlayState* play) { EnToryo* this = (EnToryo*)thisx; - s32 pad; + STACK_PAD(s32); switch (play->sceneId) { case SCENE_GERUDO_VALLEY: @@ -149,7 +150,7 @@ void EnToryo_Destroy(Actor* thisx, PlayState* play) { } s32 EnToryo_TalkRespond(EnToryo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s32 ret = 1; @@ -222,8 +223,7 @@ s32 EnToryo_TalkRespond(EnToryo* this, PlayState* play) { } s32 EnToryo_DoneTalking(EnToryo* this, PlayState* play) { - s32 pad; - Player* player = GET_PLAYER(play); + STACK_PADS(s32, 2); s32 ret = 5; switch (Message_GetState(&play->msgCtx)) { diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index f197510c55..defd49d374 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -13,6 +13,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "versions.h" @@ -316,7 +317,7 @@ void EnTp_SetupDie(EnTp* this) { void EnTp_Die(EnTp* this, PlayState* play) { EnTp* now; s16 i; - s32 pad; + STACK_PAD(s32); Vec3f effectVelAccel = { 0.0f, 0.5f, 0.0f }; Vec3f effectPos = { 0.0f, 0.0f, 0.0f }; @@ -397,7 +398,7 @@ void EnTp_Head_SetupTakeOff(EnTp* this) { * Flies up and loops around until it makes for Player */ void EnTp_Head_TakeOff(EnTp* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Math_SmoothStepToF(&this->actor.speed, 2.5f, 0.1f, 0.2f, 0.0f); @@ -675,7 +676,7 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { } void EnTp_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnTp* this = (EnTp*)thisx; Vec3f kiraVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f kiraAccel = { 0.0f, -0.6f, 0.0f }; @@ -758,7 +759,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { } void EnTp_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnTp* this = (EnTp*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_tp.c", 1451); diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 84b2dd4cf6..e585685442 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -6,10 +6,12 @@ #include "z_en_tr.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" @@ -49,7 +51,7 @@ ActorProfile En_Tr_Profile = { // The first elements of these animation arrays are for Koume, the second for Kotake -static AnimationHeader* unused[] = { +UNUSED static AnimationHeader* unused[] = { &gKotakeKoumeStandingBroomOverRightShoulderAnim, &gKotakeKoumeStandingBroomOverLeftShoulderAnim, }; @@ -383,7 +385,7 @@ void EnTr_ChooseAction1(EnTr* this, PlayState* play) { } void EnTr_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnTr* this = (EnTr*)thisx; Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); @@ -438,7 +440,7 @@ s32 EnTr_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po } void EnTr_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnTr* this = (EnTr*)thisx; if (1) {} diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 22b44abdfc..642297aee2 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -6,7 +6,9 @@ #include "z_en_trap.h" +#include "attributes.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -71,7 +73,7 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { s16 zSpeed; s16 xSpeed; EnTrap* this = (EnTrap*)thisx; - ColliderCylinder* unused = &this->collider; // required to match + UNUSED ColliderCylinder* collider = &this->collider; // required to match this->upperParams = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; @@ -134,7 +136,7 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { s16 angleToCollidedActor; s16 touchingActor; s16 blockedOnReturn; - s32 pad; + STACK_PAD(s32); s16 angleToWall; Vec3f icePos; Vec3f posAhead; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index b7afe53f41..bbf5be4fa0 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -11,6 +11,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -285,7 +286,7 @@ void EnTuboTrap_Fly(EnTuboTrap* this, PlayState* play) { void EnTuboTrap_Update(Actor* thisx, PlayState* play) { EnTuboTrap* this = (EnTuboTrap*)thisx; - s32 pad; + STACK_PAD(s32); this->actionFunc(this, play); Actor_MoveXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 643cae1b35..4dba505b40 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -148,7 +149,7 @@ static InitChainEntry sInitChain[] = { }; void EnVali_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVali* this = (EnVali*)thisx; s32 bgId; @@ -550,7 +551,7 @@ void EnVali_UpdateDamage(EnVali* this, PlayState* play) { } void EnVali_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVali* this = (EnVali*)thisx; if ((this->bodyCollider.base.atFlags & AT_HIT) || (this->leftArmCollider.base.atFlags & AT_HIT) || @@ -793,7 +794,7 @@ static Gfx D_80B289A8[] = { }; void EnVali_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVali* this = (EnVali*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_vali.c", 1505); diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 826d7f0ebe..6ecc715171 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -13,6 +13,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -61,9 +62,9 @@ static ColliderCylinderInit sCylinderInit = { }; void EnVbBall_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVbBall* this = (EnVbBall*)thisx; - s32 pad2; + STACK_PAD(s32); f32 angle; if (this->actor.params >= 200) { // Volvagia's bones @@ -88,7 +89,7 @@ void EnVbBall_Init(Actor* thisx, PlayState* play) { } void EnVbBall_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVbBall* this = (EnVbBall*)thisx; if (this->actor.params < 200) { @@ -133,8 +134,7 @@ void EnVbBall_SpawnDust(PlayState* play, BossFdEffect* effect, Vec3f* position, void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { BossFd* bossFd = (BossFd*)this->actor.parent; - f32 pad2; - f32 pad1; + STACK_PADS(s32, 2); f32 angle; s16 i; @@ -178,7 +178,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { EnVbBall* this = (EnVbBall*)thisx; BossFd* bossFd = (BossFd*)this->actor.parent; f32 radius; - f32 pad2; + STACK_PAD(s32); s16 spawnNum; s16 i; @@ -309,7 +309,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { } void EnVbBall_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnVbBall* this = (EnVbBall*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_vb_ball.c", 604); diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index ce7ea7e2c9..46e9681544 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -18,6 +18,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -632,7 +633,7 @@ s32 EnViewer_ZeldaOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, } void EnViewer_ZeldaPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - s32 pad; + STACK_PAD(s32); if (play->sceneId == SCENE_TEMPLE_OF_TIME) { if (limbIndex == 16) { @@ -718,7 +719,7 @@ static EnViewerDrawFunc sDrawFuncs[] = { void EnViewer_Draw(Actor* thisx, PlayState* play) { EnViewer* this = (EnViewer*)thisx; - s32 pad; + STACK_PAD(s32); s16 type; OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1760); diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 128a0af5f4..8e5c511cf7 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -14,6 +14,7 @@ #include "rand.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -192,7 +193,7 @@ void EnVm_Wait(EnVm* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 dist; s16 headRot; - s16 pad; + STACK_PAD(s16); s16 pitch; switch (this->unk_25E) { @@ -481,7 +482,7 @@ void EnVm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Vec3f sp80 = D_80B2EAF8; Vec3f sp74 = D_80B2EB04; Vec3f sp68 = D_80B2EB10; - s32 pad; + STACK_PAD(s32); Vec3f posResult; CollisionPoly* poly; s32 bgId; diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index cda2c07dc0..b5275a12c9 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -14,6 +14,7 @@ #include "sfx.h" #include "printf.h" #include "quake.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -74,7 +75,7 @@ void EnWallTubo_FindGirl(EnWallTubo* this, PlayState* play) { void EnWallTubo_DetectChu(EnWallTubo* this, PlayState* play) { EnBomChu* chu; - s32 pad; + STACK_PAD(s32); Vec3f effAccel = { 0.0f, 0.1f, 0.0f }; Vec3f effVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f chuPosDiff; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 7373f441a6..294ab49a7b 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -554,7 +555,7 @@ void EnWallmas_ColUpdate(EnWallmas* this, PlayState* play) { void EnWallmas_Update(Actor* thisx, PlayState* play) { EnWallmas* this = (EnWallmas*)thisx; - char pad[4]; + STACK_PAD(s32); EnWallmas_ColUpdate(this, play); this->actionFunc(this, play); @@ -598,7 +599,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) { } void EnWallmas_DrawXlu(EnWallmas* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 xzScale; MtxF mf; diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 3fe70749c9..3ce6a67095 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -8,6 +8,7 @@ #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "versions.h" @@ -139,7 +140,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, PlayState* play, u8 skyboxConfig, u8 changeSkyboxNextConfig, u8 lightConfig, u8 changeLightNextConfig, u16 changeDuration, u8 weatherMode) { - s32 pad; + STACK_PAD(s32); u8 ret = false; Player* player = GET_PLAYER(play); @@ -185,7 +186,7 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, PlayState* play, u8 s u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, PlayState* play, u8 skyboxConfig, u8 changeSkyboxNextConfig, u8 lightConfig, u8 changeLightNextConfig, u16 changeDuration) { - s32 pad; + STACK_PAD(s32); u8 ret = false; Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 35e232c69b..5fc45a4e71 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "z_en_item00.h" #include "z_lib.h" #include "effect.h" @@ -594,7 +595,7 @@ void func_80B3368C(EnWeiyer* this, PlayState* play) { void EnWeiyer_Update(Actor* thisx, PlayState* play) { EnWeiyer* this = (EnWeiyer*)thisx; - s32 pad; + STACK_PAD(s32); this->actor.home.pos.y = this->actor.depthInWater + this->actor.world.pos.y - 5.0f; func_80B3368C(this, play); diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index c651e4ff4a..47b1826cbe 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -17,6 +17,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -229,7 +230,7 @@ void EnWf_SetupAction(EnWf* this, EnWfActionFunc actionFunc) { } void EnWf_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWf* this = (EnWf*)thisx; Actor_ProcessInitChain(thisx, sInitChain); @@ -303,7 +304,7 @@ void EnWf_Destroy(Actor* thisx, PlayState* play) { s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 wallYawDiff; s16 playerYawDiff; @@ -440,7 +441,7 @@ void EnWf_SetupWait(EnWf* this) { void EnWf_Wait(EnWf* this, PlayState* play) { Player* player; - s32 pad; + STACK_PAD(s32); s16 angle; player = GET_PLAYER(play); @@ -513,7 +514,7 @@ void EnWf_SetupRunAtPlayer(EnWf* this, PlayState* play) { void EnWf_RunAtPlayer(EnWf* this, PlayState* play) { s32 prevFrame; s32 beforeCurFrame; - s32 pad; + STACK_PAD(s32); f32 baseRange = 0.0f; s16 playerFacingAngleDiff; Player* player = GET_PLAYER(play); @@ -652,7 +653,7 @@ void EnWf_SetupRunAroundPlayer(EnWf* this) { void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { s16 angle1; s16 angle2; - s32 pad; + STACK_PAD(s32); f32 baseRange = 0.0f; s32 prevFrame; s32 beforeCurFrame; @@ -1031,7 +1032,7 @@ void EnWf_SetupBlocking(EnWf* this) { void EnWf_Blocking(EnWf* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if (this->actionTimer != 0) { this->actionTimer--; @@ -1320,7 +1321,7 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { } void EnWf_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWf* this = (EnWf*)thisx; EnWf_UpdateDamage(this, play); @@ -1495,7 +1496,7 @@ s32 EnWf_DodgeRanged(PlayState* play, EnWf* this) { if (actor != NULL) { s16 angleToFacing; - s16 pad; + STACK_PAD(s16); f32 dist; angleToFacing = Actor_WorldYawTowardActor(&this->actor, actor) - this->actor.shape.rot.y; diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 7cfe974b8a..22e3503974 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -6,9 +6,11 @@ #include "z_en_wonder_item.h" +#include "attributes.h" #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_en_item00.h" @@ -69,7 +71,7 @@ static Vec3f sTagPointsFree[9]; static Vec3f sTagPointsOrdered[9]; void EnWonderItem_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWonderItem* this = (EnWonderItem*)thisx; if ((this->collider.dim.radius != 0) || (this->collider.dim.height != 0)) { @@ -123,7 +125,7 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { DMG_BOOMERANG, DMG_HOOKSHOT, }; - s32 pad; + STACK_PAD(s32); s16 colTypeIndex; EnWonderItem* this = (EnWonderItem*)thisx; s16 rotZover10; @@ -363,7 +365,7 @@ void EnWonderItem_Update(Actor* thisx, PlayState* play) { 255, 255, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 128, 128, 128, 128, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 0, 0, 128, 0, 0, 0, 128, }; // These seem to be mistyped. Logically they should be s16[13][3] and be indexed as [colorIndex][i] - s32 pad; + STACK_PAD(s32); EnWonderItem* this = (EnWonderItem*)thisx; s32 colorIndex; diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 137cbf619e..6625886ec6 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -8,6 +8,7 @@ #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "debug_display.h" @@ -45,7 +46,7 @@ void EnWonderTalk2_Destroy(Actor* thisx, PlayState* play) { } void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWonderTalk2* this = (EnWonderTalk2*)thisx; PRINTF("\n\n"); @@ -285,7 +286,7 @@ void EnWonderTalk2_DoNothing(EnWonderTalk2* this, PlayState* play) { } void EnWonderTalk2_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnWonderTalk2* this = (EnWonderTalk2*)thisx; this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 2d351c9184..8da1617c7d 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -327,7 +328,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { if (!(this->actor.flags & ACTOR_FLAG_INSIDE_CULLING_VOLUME)) { u8 new_var = this->unk_14E[0]; u8 phi_v0 = 0; - s32 pad; + STACK_PAD(s32); if (this->unk_14C < 0) { phi_v0 = 0x80; diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 60a247490b..bec3f2c294 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -5,6 +5,7 @@ */ #include "z_en_xc.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" @@ -16,6 +17,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -85,7 +87,7 @@ void EnXc_InitCollider(Actor* thisx, PlayState* play) { void EnXc_UpdateCollider(Actor* thisx, PlayState* play) { EnXc* this = (EnXc*)thisx; Collider* colliderBase = &this->collider.base; - s32 pad[3]; + STACK_PADS(s32, 3); Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, colliderBase); @@ -106,7 +108,7 @@ void EnXc_CalculateHeadTurn(EnXc* this, PlayState* play) { } void EnXc_SetEyePattern(EnXc* this) { - s32 pad[3]; + STACK_PADS(s32, 3); s16* blinkTimer = &this->blinkTimer; s16* eyePattern = &this->eyeIdx; @@ -121,7 +123,7 @@ void EnXc_SetEyePattern(EnXc* this) { } void EnXc_SpawnNut(EnXc* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f* pos = &this->actor.world.pos; s16 angle = this->actor.shape.rot.y; f32 x = (Math_SinS(angle) * 30.0f) + pos->x; @@ -212,7 +214,7 @@ void func_80B3C620(EnXc* this, PlayState* play, s32 cueChannel) { } void EnXc_ChangeAnimation(EnXc* this, AnimationHeader* animation, u8 mode, f32 morphFrames, s32 reverseFlag) { - s32 pad[2]; + STACK_PADS(s32, 2); AnimationHeader* animationSeg = SEGMENTED_TO_VIRTUAL(animation); f32 frameCount = Animation_GetLastFrame(&animationSeg->common); f32 playbackSpeed; @@ -304,7 +306,7 @@ void func_80B3C9EC(EnXc* this) { void func_80B3CA38(EnXc* this, PlayState* play) { // If Player is adult but hasn't learned Minuet of Forest if (!GET_EVENTCHKINF(EVENTCHKINF_50) && LINK_IS_ADULT) { - s32 pad; + STACK_PAD(s32); this->action = SHEIK_ACTION_INIT; } else { @@ -322,7 +324,7 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { if (playerPosZ < -2225.0f) { if (!Play_InCsMode(play)) { - s32 pad; + STACK_PAD(s32); play->csCtx.script = SEGMENTED_TO_VIRTUAL(gMeadowMinuetCs); gSaveContext.cutsceneTrigger = 1; @@ -339,7 +341,7 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { void func_80B3CB58(EnXc* this, PlayState* play) { // If hasn't learned Bolero and Player is Adult if (!GET_EVENTCHKINF(EVENTCHKINF_51) && LINK_IS_ADULT) { - s32 pad; + STACK_PAD(s32); this->action = SHEIK_ACTION_INIT; } else { @@ -357,7 +359,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) && (posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) && !Play_InCsMode(play)) { - s32 pad; + STACK_PAD(s32); play->csCtx.script = SEGMENTED_TO_VIRTUAL(gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; @@ -373,7 +375,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { if (!(CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && DEBUG_FEATURES) && !GET_EVENTCHKINF(EVENTCHKINF_52) && LINK_IS_ADULT) { - s32 pad; + STACK_PAD(s32); this->action = SHEIK_ACTION_SERENADE; PRINTF(T("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n", "Water serenade Sheik's birth!!!!!!!!!!!!!!!!!!\n")); @@ -390,7 +392,7 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { if (CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !GET_EVENTCHKINF(EVENTCHKINF_52) && !(stateFlags & PLAYER_STATE1_29) && !Play_InCsMode(play)) { - s32 pad; + STACK_PAD(s32); Cutscene_SetScript(play, gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; @@ -412,9 +414,9 @@ void EnXc_DoNothing(EnXc* this, PlayState* play) { static Vec3f sSfxPos; void EnXc_SetWalkingSFX(EnXc* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); u32 sfxId; - s32 pad2; + STACK_PAD(s32); if (Animation_OnFrame(&this->skelAnime, 11.0f) || Animation_OnFrame(&this->skelAnime, 23.0f)) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { @@ -426,9 +428,9 @@ void EnXc_SetWalkingSFX(EnXc* this, PlayState* play) { } void EnXc_SetNutThrowSFX(EnXc* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); u32 sfxId; - s32 pad2; + STACK_PAD(s32); if (Animation_OnFrame(&this->skelAnime, 7.0f)) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { @@ -472,7 +474,7 @@ void EnXc_SetColossusAppearSFX(EnXc* this, PlayState* play) { Sfx_PlaySfxAtPos(&sSfxPos, NA_SE_EV_JUMP_CONC); } else if (csCurFrame == 164) { Vec3f pos = { -1069.0f, 38.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sSfxPos, wDest); Sfx_PlaySfxAtPos(&sSfxPos, NA_SE_PL_WALK_GROUND + SURFACE_SFX_OFFSET_STONE); @@ -494,7 +496,7 @@ void EnXc_SetColossusWindSFX(PlayState* play) { static s32 D_80B41D90 = 0; static Vec3f sPos = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80B42DB0; - s32 pad; + STACK_PAD(s32); s16 sceneId = play->sceneId; if (sceneId == SCENE_DESERT_COLOSSUS) { @@ -502,7 +504,7 @@ void EnXc_SetColossusWindSFX(PlayState* play) { u16 csCurFrame = csCtx->curFrame; if ((csCurFrame >= 120) && (csCurFrame < 164)) { - s32 pad; + STACK_PAD(s32); Vec3f* eye = &play->view.eye; if (D_80B41D90 != 0) { @@ -564,7 +566,7 @@ void EnXc_DestroyFlame(EnXc* this) { void EnXc_InitFlame(EnXc* this, PlayState* play) { static s32 D_80B41DA8 = 1; - s32 pad; + STACK_PAD(s32); s16 sceneId = play->sceneId; if (sceneId == SCENE_DEATH_MOUNTAIN_CRATER) { @@ -676,14 +678,14 @@ void func_80B3D750(EnXc* this, PlayState* play) { } void EnXc_SetupFallFromSkyAction(EnXc* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); CutsceneContext* csCtx = &play->csCtx; if (csCtx->state != 0) { CsCmdActorCue* cue = csCtx->actorCues[4]; if (cue != NULL && cue->id == 2) { - s32 pad; + STACK_PAD(s32); Vec3f* pos = &this->actor.world.pos; SkelAnime* skelAnime = &this->skelAnime; f32 frameCount = Animation_GetLastFrame(&gSheikFallingFromSkyAnim); @@ -785,7 +787,7 @@ void EnXc_SetupInitialHarpAction(EnXc* this, s32 animFinished) { } void EnXc_SetupPlayingHarpAction(EnXc* this, PlayState* play, s32 animFinished) { - s32 pad; + STACK_PAD(s32); SkelAnime* skelAnime; AnimationHeader* animation; f32 frameCount; @@ -823,7 +825,7 @@ void EnXc_SetupHarpPutawayAction(EnXc* this, PlayState* play) { curFrame = this->skelAnime.curFrame; animFrameCount = this->skelAnime.endFrame; if (curFrame >= animFrameCount) { - s32 pad; + STACK_PAD(s32); Animation_Change(&this->skelAnime, &gSheikInitialHarpAnim, -1.0f, Animation_GetLastFrame(&gSheikInitialHarpAnim), 0.0f, ANIMMODE_ONCE, 0.0f); @@ -914,7 +916,7 @@ void EnXc_SetupDisappear(EnXc* this, PlayState* play) { // Sheik fades away if end of Bolero CS, kill actor otherwise if (sceneId == SCENE_DEATH_MOUNTAIN_CRATER) { - s32 pad; + STACK_PAD(s32); this->action = SHEIK_ACTION_FADE; this->drawMode = SHEIK_DRAW_NOTHING; @@ -1108,7 +1110,7 @@ s32 EnXc_PullingOutHarpOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dL } s32 EnXc_HarpOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { - EnXc* this = (EnXc*)thisx; + UNUSED EnXc* this = (EnXc*)thisx; if (limbIndex == 12) { *dList = gSheikHarpDL; @@ -1119,12 +1121,12 @@ s32 EnXc_HarpOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f void EnXc_DrawPullingOutHarp(Actor* thisx, PlayState* play) { EnXc* this = (EnXc*)thisx; - s32 pad; + STACK_PAD(s32); s16 eyePattern = this->eyeIdx; void* eyeTexture = sEyeTextures[eyePattern]; SkelAnime* skelAnime = &this->skelAnime; GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_en_oA2_inSpot05.c", 1444); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture)); @@ -1141,12 +1143,12 @@ void EnXc_DrawPullingOutHarp(Actor* thisx, PlayState* play) { void EnXc_DrawHarp(Actor* thisx, PlayState* play) { EnXc* this = (EnXc*)thisx; - s32 pad; + STACK_PAD(s32); s16 eyePattern = this->eyeIdx; void* eyeTexture = sEyeTextures[eyePattern]; SkelAnime* skelAnime = &this->skelAnime; GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_en_oA2_inSpot05.c", 1511); @@ -1584,7 +1586,7 @@ void EnXc_PlayTriforceSFX(Actor* thisx, PlayState* play) { EnXc* this = (EnXc*)thisx; if (this->unk_2A8) { - s32 pad; + STACK_PAD(s32); Vec3f src; Vec3f pos; Vec3f sp1C = { 0.0f, 0.0f, 0.0f }; @@ -1747,7 +1749,7 @@ s32 EnXc_TriforceOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V } void EnXc_TriforcePostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { - s32 pad[2]; + STACK_PADS(s32, 2); EnXc* this = (EnXc*)thisx; if (limbIndex == 15) { @@ -1760,12 +1762,12 @@ void EnXc_TriforcePostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 void EnXc_DrawTriforce(Actor* thisx, PlayState* play) { EnXc* this = (EnXc*)thisx; - s32 pad; + STACK_PAD(s32); s16 eyeIdx = this->eyeIdx; void* eyeTexture = sEyeTextures[eyeIdx]; SkelAnime* skelAnime = &this->skelAnime; GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_en_oA2_inMetamol.c", 565); if (this->unk_2BC != 0) { @@ -1841,7 +1843,7 @@ void func_80B406F8(Actor* thisx) { } void EnXc_SetupIdleInNocturne(EnXc* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ActorShape* actorShape = &this->actor.shape; SkelAnime* skelAnime = &this->skelAnime; f32 frameCount = Animation_GetLastFrame(&gSheikIdleAnim); @@ -1865,7 +1867,7 @@ void EnXc_SetupDefenseStance(Actor* thisx) { } void EnXc_SetupContortions(EnXc* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); SkelAnime* skelAnime = &this->skelAnime; #if DEBUG_FEATURES @@ -1882,7 +1884,7 @@ void EnXc_SetupContortions(EnXc* this, PlayState* play) { } void EnXc_SetupFallInNocturne(EnXc* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); SkelAnime* skelAnime = &this->skelAnime; f32 frameCount = Animation_GetLastFrame(&gSheikIdleAnim); @@ -1897,7 +1899,7 @@ void EnXc_SetupFallInNocturne(EnXc* this, PlayState* play) { } void EnXc_SetupHittingGroundInNocturne(EnXc* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 frameCount = Animation_GetLastFrame(&gSheikHittingGroundAnim); func_80B3C9DC(this); @@ -1909,7 +1911,7 @@ void EnXc_SetupHittingGroundInNocturne(EnXc* this, PlayState* play) { } void func_80B40A78(EnXc* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 frameCount = Animation_GetLastFrame(&gSheikHittingGroundAnim); func_80B3C9DC(this); @@ -1921,7 +1923,7 @@ void func_80B40A78(EnXc* this, PlayState* play) { } void EnXc_SetupKneelInNocturne(EnXc* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 frameCount = Animation_GetLastFrame(&gSheikKneelingAnim); func_80B3C9DC(this); @@ -1933,7 +1935,7 @@ void EnXc_SetupKneelInNocturne(EnXc* this, PlayState* play) { } void func_80B40BB4(EnXc* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32 frameCount = Animation_GetLastFrame(&gSheikIdleAnim); func_80B3C9DC(this); func_80B3C588(this, play, 4); @@ -2225,7 +2227,7 @@ void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { void EnXc_SetupDialogueAction(EnXc* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { - s32 pad; + STACK_PAD(s32); this->action = SHEIK_ACTION_IN_DIALOGUE; } else { @@ -2413,7 +2415,7 @@ s32 EnXc_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (this->unk_30C != 0) { if (limbIndex == 9) { - s32 pad; + STACK_PAD(s32); rot->x += this->interactInfo.torsoRot.y; rot->y -= this->interactInfo.torsoRot.x; @@ -2445,7 +2447,7 @@ void EnXc_DrawNothing(Actor* thisx, PlayState* play) { } void EnXc_DrawDefault(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnXc* this = (EnXc*)thisx; s16 eyeIdx = this->eyeIdx; void* eyeSegment = sEyeTextures[eyeIdx]; diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index ee1d8b8161..d5ad6dcd80 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -10,6 +10,7 @@ #include "regs.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "z_lib.h" @@ -135,7 +136,7 @@ void func_80B42F74(EnYabusameMark* this, PlayState* play) { Vec3f effectVelocity = { 0.0f, 0.0f, 0.0f }; Vec3f arrowHitPos; Vec3f distanceFromCenter; - s32 pad; + STACK_PAD(s32); s32 scoreIndex; f32 scoreDistance100; f32 scoreDistance60; diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 772eceb114..e0d4803b32 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -125,7 +126,7 @@ void EnYukabyun_Break(EnYukabyun* this, PlayState* play) { void EnYukabyun_Update(Actor* thisx, PlayState* play) { EnYukabyun* this = (EnYukabyun*)thisx; - s32 pad; + STACK_PAD(s32); if (((this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || ((this->collider.base.ocFlags1 & OC1_HIT) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 7fa645e64a..a86a72c523 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -6,6 +6,7 @@ #include "z_en_zf.h" +#include "attributes.h" #include "libc64/qrand.h" #include "array_count.h" #include "gfx.h" @@ -15,6 +16,7 @@ #include "regs.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" @@ -293,7 +295,7 @@ s16 EnZf_SecondaryFloorCheck(EnZf* this, PlayState* play, f32 dist) { } void EnZf_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZf* this = (EnZf*)thisx; Player* player = GET_PLAYER(play); EffectBlureInit1 blureInit; @@ -458,7 +460,7 @@ s16 EnZf_FindNextPlatformAwayFromPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, P continue; } if (playerPlatform == -1) { - s16 pad; + STACK_PAD(s16); if (Math_Vec3f_DistXYZ(&player->actor.world.pos, &sPlatformPositions[curLoopPlatform]) < playerMaxDist) { continue; @@ -730,7 +732,7 @@ void func_80B45384(EnZf* this) { void func_80B4543C(EnZf* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s16 angleToPlayer = (this->actor.yawTowardsPlayer - this->headRot) - this->actor.shape.rot.y; angleToPlayer = ABS(angleToPlayer); @@ -999,7 +1001,7 @@ void func_80B4604C(EnZf* this) { } void func_80B46098(EnZf* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 phi_f2; Player* player = GET_PLAYER(play); s16 temp_v0; @@ -1076,7 +1078,7 @@ void func_80B462E4(EnZf* this, PlayState* play) { void func_80B463E4(EnZf* this, PlayState* play) { s16 angleBehindPlayer; s16 phi_v0_3; - s32 pad; + STACK_PAD(s32); s32 prevFrame; s32 beforeCurFrame; s32 absPlaySpeed; @@ -1500,10 +1502,10 @@ void EnZf_HopAway(EnZf* this, PlayState* play) { f32 sp74; f32 sp70 = 1.0f; f32 phi_f20 = 550.0f; - s32 pad; + STACK_PAD(s32); f32 phi_f20_2; f32 phi_f0; - s32 pad2; + STACK_PAD(s32); s16 sp5A; s32 sp54; s32 temp_v1_2; @@ -1810,7 +1812,7 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { this->actor.speed = -this->actor.speed; } } else { - s16 pad; + STACK_PAD(s16); if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3FFF)) { @@ -1903,7 +1905,7 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { } else if ((this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) && (D_80B4A1B4 == this->actor.params)) { EnZf_SetupHopAndTaunt(this); } else { - s16 pad; + STACK_PAD(s16); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -2020,7 +2022,7 @@ void EnZf_UpdateHeadRotation(EnZf* this, PlayState* play) { } void EnZf_UpdateDamage(EnZf* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 dropParams; if ((this->bodyCollider.base.acFlags & AC_HIT) && (this->action <= ENZF_ACTION_STUNNED)) { @@ -2067,9 +2069,9 @@ void EnZf_UpdateDamage(EnZf* this, PlayState* play) { } void EnZf_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZf* this = (EnZf*)thisx; - s32 pad2; + STACK_PAD(s32); EnZf_UpdateDamage(this, play); if (this->actor.colChkInfo.damageReaction != ENZF_DMG_REACT_IMMUNE) { @@ -2188,7 +2190,7 @@ s32 EnZf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po } void EnZf_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { - static Vec3f sUnused = { 1100.0f, -700.0f, 0.0f }; + UNUSED static Vec3f sUnused = { 1100.0f, -700.0f, 0.0f }; static Vec3f footOffset = { 300.0f, 0.0f, 0.0f }; static Vec3f D_80B4A2A4 = { 300.0f, -1700.0f, 0.0f }; // Sword tip? static Vec3f D_80B4A2B0 = { -600.0f, 300.0f, 0.0f }; // Sword hilt? @@ -2277,7 +2279,7 @@ static Gfx D_80B4A2F8[] = { }; void EnZf_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZf* this = (EnZf*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_en_zf.c", 3533); diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index 8de9163341..f26e7efc17 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -12,6 +12,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -152,7 +153,7 @@ void func_80B4AE18(EnZl1* this) { void func_80B4AF18(EnZl1* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); Actor_TrackPlayer(play, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); @@ -172,9 +173,7 @@ void func_80B4AF18(EnZl1* this, PlayState* play) { void func_80B4B010(EnZl1* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad2; - s32 pad3; - s32 pad; + STACK_PADS(s32, 3); Vec3f subCamAt = { -460.0f, 118.0f, 0.0f }; Vec3f subCamEye = { -406.0f, 110.0f, 0.0f }; Vec3f playerPos = { -398.0f, 84.0f, 0.0f }; @@ -213,10 +212,10 @@ void func_80B4B010(EnZl1* this, PlayState* play) { void func_80B4B240(EnZl1* this, PlayState* play) { Vec3f subCamAt = { -427.0f, 108.0, 26.0 }; Vec3f subCamEye = { -340.0f, 108.0f, 98.0f }; - s32 pad; + STACK_PAD(s32); Vec3f sp58 = { -434.0f, 84.0f, 0.0f }; u8 sp54[] = { 0x00, 0x00, 0x02 }; - s32 pad2; + STACK_PAD(s32); Player* player = GET_PLAYER(play); AnimationHeader* animHeaderSeg; MessageContext* msgCtx = &play->msgCtx; @@ -381,13 +380,13 @@ void func_80B4B8B4(EnZl1* this, PlayState* play) { }; Vec3f subCamAt = { -421.0f, 143.0f, -5.0f }; Vec3f subCamEye = { -512.0f, 105.0f, -4.0f }; - s32 pad2; + STACK_PAD(s32); f32 cueDuration; CsCmdActorCue* cue; Vec3f sp74; Vec3f sp68; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); f32 frameCount; Vec3f sp48; @@ -438,7 +437,7 @@ void func_80B4B8B4(EnZl1* this, PlayState* play) { } void func_80B4BBC4(EnZl1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 frameCount = Animation_GetLastFrame(&gChildZelda1Anim_00438); Player* player = GET_PLAYER(play); @@ -467,13 +466,13 @@ void func_80B4BC78(EnZl1* this, PlayState* play) { u8 sp84[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, }; - s32 pad2; + STACK_PAD(s32); f32 cueDuration; Vec3f sp70; Vec3f sp64; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; CsCmdActorCue* cue; - s32 pad; + STACK_PAD(s32); f32 frameCount; if (SkelAnime_Update(&this->skelAnime) && (this->skelAnime.animation == &gChildZelda1Anim_10B38)) { @@ -518,7 +517,7 @@ void func_80B4BC78(EnZl1* this, PlayState* play) { } void func_80B4BF2C(EnZl1* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); MessageContext* msgCtx = &play->msgCtx; Player* player = GET_PLAYER(play); @@ -595,7 +594,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) { } void EnZl1_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZl1* this = (EnZl1*)thisx; if ((this->actionFunc != func_80B4B8B4) && (this->actionFunc != func_80B4BC78)) { diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c index 4c763e5583..9a0b9093d4 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c @@ -1,6 +1,7 @@ +#include "attributes.h" #include "cutscene_commands.h" -static CutsceneCameraDirection D_80B4D5C0[] = { +UNUSED static CutsceneCameraDirection D_80B4D5C0[] = { { { -440.0f, 117.0f, 0.0f }, { -490.0f, 120.0f, 0.0f }, 0, 45 }, { { -484.0f, 122.0f, -29.0f }, { -480.0f, 116.0f, 18.0f }, 0, 80 }, { { -413.0f, 136.0f, -72.0f }, { -403.0f, 141.0f, -89.0f }, 0, 25 }, @@ -198,7 +199,7 @@ static CutsceneCameraPoint D_80B4E4CC[] = { { -1, 0, 0, 20.799965f, { -549, 124, 29 } }, { -1, 0, 0, 20.799965f, { -549, 124, 29 } }, }; -static CutsceneCameraMove D_80B4E54C[] = { +UNUSED static CutsceneCameraMove D_80B4E54C[] = { { D_80B4D72C, D_80B4D7AC, 0 }, { D_80B4D82C, D_80B4D8CC, 0 }, { D_80B4D96C, D_80B4DA4C, 0 }, { D_80B4DB2C, D_80B4DBBC, 0 }, { D_80B4DC4C, D_80B4DD3C, 0 }, { D_80B4DE2C, D_80B4DF0C, 0 }, { D_80B4DFEC, D_80B4E08C, 0 }, { D_80B4E12C, D_80B4E1BC, 0 }, { D_80B4E24C, D_80B4E2CC, 0 }, diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 817ac9c3dd..6c4ba53113 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -14,6 +14,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -119,7 +120,7 @@ void EnZl2_Destroy(Actor* thisx, PlayState* play) { } void EnZl2_UpdateEyes(EnZl2* this) { - s32 pad[4]; + STACK_PADS(s32, 4); s16* eyeTexIndex2 = &this->eyeTexIndex2; s16* blinkTimer = &this->blinkTimer; s16* eyeTexIndex = &this->eyeTexIndex; @@ -352,7 +353,7 @@ void func_80B4EF64(EnZl2* this, s16 arg1, s32 arg2) { } if (arg2 == 2) { - s32 pad; + STACK_PAD(s32); if ((this->action == 5) || (this->action == 30)) { s32 temp_t0; @@ -458,14 +459,14 @@ void func_80B4F230(EnZl2* this, s16 arg1, s32 arg2) { } s32 func_80B4F45C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { - s32 pad; + STACK_PAD(s32); EnZl2* this = (EnZl2*)thisx; if (limbIndex == 14) { Mtx* sp74 = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 7); MtxF sp34; Vec3s sp2C; - s16 pad2; + STACK_PAD(s16); s16* unk_1DC = this->unk_1DC; gSPSegment((*gfx)++, 0x0C, sp74); @@ -566,7 +567,7 @@ s32 func_80B4F45C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s void EnZl2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { EnZl2* this = (EnZl2*)thisx; - s32 pad[2]; + STACK_PADS(s32, 2); if (limbIndex == 10) { if ((this->unk_254 != 0) && (play->csCtx.curFrame >= 900)) { @@ -774,7 +775,7 @@ void func_80B50278(EnZl2* this, PlayState* play) { } void func_80B50304(EnZl2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); ActorShape* shape = &this->actor.shape; CsCmdActorCue* cue = EnZl2_GetCue(play, 0); f32 cueXDelta; @@ -1471,7 +1472,7 @@ void func_80B51D0C(EnZl2* this, PlayState* play) { } void func_80B51D24(EnZl2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); u32 sfxId; SkelAnime* skelAnime = &this->skelAnime; @@ -1521,7 +1522,7 @@ void func_80B51EA8(EnZl2* this) { void func_80B51EBC(EnZl2* this, PlayState* play) { ActorShape* shape = &this->actor.shape; CsCmdActorCue* cue = EnZl2_GetCue(play, 0); - s32 pad[2]; + STACK_PADS(s32, 2); this->actor.world.rot.y = shape->rot.y = cue->rot.y; func_80B4FD00(this, &gZelda2Anime1Anim_00B224, 0, 0.0f, 0); @@ -1610,10 +1611,10 @@ void func_80B52114(EnZl2* this, PlayState* play) { } void func_80B521A0(EnZl2* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjectContext* objectCtx = &play->objectCtx; s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME1); - s32 pad2; + STACK_PAD(s32); #if DEBUG_FEATURES if (objectSlot < 0) { @@ -1645,7 +1646,7 @@ void EnZl2_Update(Actor* thisx, PlayState* play) { void EnZl2_Init(Actor* thisx, PlayState* play) { EnZl2* this = (EnZl2*)thisx; ActorShape* shape = &thisx->shape; - s32 pad; + STACK_PAD(s32); ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); shape->shadowAlpha = 0; @@ -1678,7 +1679,7 @@ void func_80B523BC(EnZl2* this, PlayState* play) { } void func_80B523C8(EnZl2* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); s16 eyeTexIndex = this->eyeTexIndex; s16 eyeTexIndex2 = this->eyeTexIndex2; void* eyeTex = sEyeTextures[eyeTexIndex]; @@ -1686,7 +1687,7 @@ void func_80B523C8(EnZl2* this, PlayState* play) { SkelAnime* skelAnime = &this->skelAnime; s16 mouthTexIndex = this->mouthTexIndex; void* mouthTex = sMouthTextures[mouthTexIndex]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_zl2.c", 1623); @@ -1705,13 +1706,13 @@ void func_80B523C8(EnZl2* this, PlayState* play) { } void func_80B525D4(EnZl2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeTexIndex = this->eyeTexIndex; void* eyeTex = sEyeTextures[eyeTexIndex]; s16 mouthTexIndex = this->mouthTexIndex; SkelAnime* skelAnime = &this->skelAnime; void* mouthTex = sMouthTextures[mouthTexIndex]; - s32 pad1; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_zl2.c", 1663); diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index b9c396dfcc..65d5921f09 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -19,6 +19,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -82,7 +83,7 @@ void func_80B533B0(Actor* thisx, PlayState* play) { void func_80B533FC(EnZl3* this, PlayState* play) { ColliderCylinder* collider = &this->collider; - s32 pad[4]; + STACK_PADS(s32, 4); Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(play, &play->colChkCtx, &collider->base); @@ -114,7 +115,7 @@ BossGanon2* func_80B53488(EnZl3* this, PlayState* play) { } void EnZl3_UpdateEyes(EnZl3* this) { - s32 pad[2]; + STACK_PADS(s32, 2); s16* eyeTexIndex = &this->eyeTexIndex; s16* blinkTimer = &this->blinkTimer; @@ -158,7 +159,7 @@ void func_80B536B4(EnZl3* this) { } void func_80B536C4(EnZl3* this) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3s* headRot = &this->interactInfo.headRot; Vec3s* torsoRot = &this->interactInfo.torsoRot; @@ -181,7 +182,7 @@ s32 func_80B537E8(EnZl3* this) { s16* rotY = &this->actor.world.rot.y; s16* unk_3D0 = &this->unk_3D0; s16 retVal; - s16 pad[2]; + STACK_PADS(s16, 2); Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsPlayer - *rotY)), 5, 6200, 100); retVal = Math_SmoothStepToS(rotY, yawTowardsPlayer, 5, *unk_3D0, 100); @@ -290,7 +291,6 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { s32 action = this->action; s32 phi_a1; s32 idx25C; - s16 temp_t1; s32 temp_a0; s32 phi_v0; s32 phi_v1; @@ -337,25 +337,25 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (idx == 2 && (action == 5 || action == 24)) { if (phi_v1 != 0) { - s32 pad; + STACK_PAD(s32); phi_v0 -= (phi_v1 - phi_v0) / 10; } } else if (idx == 2 && action == 22 && skelAnime->mode == 2) { if (phi_v1 != 0) { - s32 pad; + STACK_PAD(s32); phi_v0 -= (phi_v1 - phi_v0) / 10; } } else if (idx == 2 && (action == 20 || action == 21) && skelAnime->mode == 2) { if (phi_v1 != 0) { - s32 pad; + STACK_PAD(s32); phi_v0 -= (phi_v1 - phi_v0) / 10; } } else { if (phi_v1 != 0) { - s32 pad; + STACK_PAD(s32); phi_v0 += (phi_v1 - phi_v0) / 16; } @@ -619,7 +619,7 @@ void func_80B54360(EnZl3* this, s16 arg1, s32 arg2) { } s32 func_80B5458C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { - s32 pad[2]; + STACK_PADS(s32, 2); EnZl3* this = (EnZl3*)thisx; Vec3s* headRot = &this->interactInfo.headRot; Vec3s* torsoRot = &this->interactInfo.torsoRot; @@ -629,7 +629,7 @@ s32 func_80B5458C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s MtxF sp38; Vec3s sp30; s16* unk_28C = this->unk_28C; - s32 pad2; + STACK_PAD(s32); rot->x += headRot->y; rot->z += headRot->x; @@ -724,11 +724,11 @@ s32 func_80B5458C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { EnZl3* this = (EnZl3*)thisx; - s32 pad; + STACK_PAD(s32); if (limbIndex == 13) { Vec3f sp34 = D_80B5A46C; - s32 pad2; + STACK_PAD(s32); Matrix_MultVec3f(&sp34, &this->unk_31C); } else if (limbIndex == 14) { @@ -836,7 +836,7 @@ void func_80B55054(EnZl3* this) { f32* temp_v0 = &this->unk_2EC; if (*temp_v0 < 19.0f) { - s32 pad; + STACK_PAD(s32); ((DoorWarp1*)child)->crystalAlpha = (20.0f - *temp_v0) * 12.75f; *temp_v0 += 1.0f; @@ -1060,7 +1060,7 @@ void func_80B5585C(EnZl3* this) { } void func_80B558A8(EnZl3* this) { - s32 pad[4]; + STACK_PADS(s32, 4); s16 thisRotY = this->actor.world.rot.y; Vec3f* unk_338 = &this->unk_338; @@ -1581,7 +1581,7 @@ void func_80B56DEC(EnZl3* this) { } void func_80B56E38(EnZl3* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s32 sfxId; SkelAnime* sp20 = &this->skelAnime; @@ -1667,9 +1667,9 @@ s16 func_80B57104(EnZl3* this, s32 arg1) { } s32 func_80B571A8(EnZl3* this) { - s32 pad; + STACK_PAD(s32); s32 unk_314 = this->unk_314; - s32 pad2; + STACK_PAD(s32); if (func_80B56F8C(this, unk_314 + 1) == 0) { return this->actor.shape.rot.y; @@ -1679,7 +1679,7 @@ s32 func_80B571A8(EnZl3* this) { } s32 func_80B571FC(EnZl3* this) { - s32 pad; + STACK_PAD(s32); s32 unk_314 = this->unk_314; if (func_80B56F8C(this, unk_314) == 0) { @@ -1762,7 +1762,7 @@ s32 func_80B57458(EnZl3* this, PlayState* play) { f32 thisZ = thisPos->z; Player* player = GET_PLAYER(play); Vec3f* playerPos = &player->actor.world.pos; - s32 pad; + STACK_PAD(s32); f32 playerX = playerPos->x; f32 playerZ = playerPos->z; f32 temp_f12 = playerX - thisX; @@ -1827,7 +1827,7 @@ void func_80B5764C(EnZl3* this, PlayState* play) { s32 func_80B576C8(EnZl3* this, PlayState* play) { if (func_80B575F0(this, play)) { - s32 pad; + STACK_PAD(s32); if (this->unk_3D8 == 0) { return 1; @@ -1857,7 +1857,7 @@ void func_80B57754(EnZl3* this, PlayState* play) { } void func_80B577BC(PlayState* play, Vec3f* vec) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Vec3f* playerPos = &player->actor.world.pos; f32 posX = vec->x; @@ -1870,7 +1870,7 @@ void func_80B577BC(PlayState* play, Vec3f* vec) { static Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; static Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; -static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; +UNUSED static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; void func_80B57858(PlayState* play) { func_80B577BC(play, &D_80B5A498); @@ -1878,7 +1878,7 @@ void func_80B57858(PlayState* play) { } s32 func_80B57890(EnZl3* this, PlayState* play) { - s8 pad[2]; + STACK_PADS(u8, 2); u8 spawn = play->spawn; s16 sceneId = play->sceneId; s32 result = func_80B54DB4(this); @@ -1947,9 +1947,9 @@ void func_80B57AAC(EnZl3* this, s32 arg1, AnimationHeader* arg2) { } void func_80B57AE0(EnZl3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 shapeRotY = this->actor.shape.rot.y; - s32 pad2; + STACK_PAD(s32); Vec3f* unk_354 = &this->unk_354; Vec3f* unk_348 = &this->unk_348; Vec3s* temp_v0; @@ -2012,13 +2012,13 @@ void func_80B57D60(EnZl3* this, PlayState* play) { } s32 func_80B57D80(EnZl3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16* sp32 = &this->actor.shape.rot.y; NpcInteractInfo* interactInfo = &this->interactInfo; Player* player = GET_PLAYER(play); s32 unk_314 = this->unk_314; s16 temp_v0 = func_80B57104(this, unk_314); - s32 pad2; + STACK_PAD(s32); s16 phi_v1; interactInfo->trackPos.y = player->actor.world.pos.y; @@ -2039,7 +2039,7 @@ s32 func_80B57D80(EnZl3* this, PlayState* play) { void func_80B57EAC(EnZl3* this, PlayState* play) { if (func_80B57324(this, play)) { - s32 pad; + STACK_PAD(s32); this->action = 26; } else { @@ -2074,7 +2074,7 @@ s32 func_80B57F84(EnZl3* this, PlayState* play) { } void func_80B58014(EnZl3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s8 invincibilityTimer = player->invincibilityTimer; @@ -2083,7 +2083,7 @@ void func_80B58014(EnZl3* this, PlayState* play) { this->action = 29; func_80B538B0(this); } else if (func_80B57C8C(this) && func_80B57F84(this, play)) { - s32 pad; + STACK_PAD(s32); OnePointCutscene_Init(play, 4000, -99, &this->actor, CAM_ID_MAIN); this->unk_3D0 = 0; @@ -2131,7 +2131,7 @@ void func_80B58268(EnZl3* this, PlayState* play) { void func_80B582C8(EnZl3* this, PlayState* play) { f32* unk_3CC = &this->unk_3CC; - s32 pad; + STACK_PAD(s32); if (*unk_3CC == kREG(14) + 10.0f) { *unk_3CC += 1.0f; @@ -2158,7 +2158,7 @@ void func_80B582C8(EnZl3* this, PlayState* play) { static u32 D_80B5A4BC = 0; void func_80B584B4(EnZl3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); s8 invincibilityTimer = player->invincibilityTimer; Actor* nearbyEnTest = Actor_FindNearby(play, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f); @@ -2186,7 +2186,7 @@ void func_80B584B4(EnZl3* this, PlayState* play) { } void func_80B58624(EnZl3* this, PlayState* play) { - s32 pad[3]; + STACK_PADS(s32, 3); f32* unk_3CC = &this->unk_3CC; if (*unk_3CC == (kREG(18) + 10.0f)) { @@ -2194,7 +2194,7 @@ void func_80B58624(EnZl3* this, PlayState* play) { func_80B54E14(this, &gZelda2Anime2Anim_008050, 0, -12.0f, 0); func_80B5772C(this, play); } else if (*unk_3CC == kREG(19) + 20.0f) { - s32 pad2; + STACK_PAD(s32); *unk_3CC += 1.0f; this->actor.textId = 0x71AC; @@ -2298,7 +2298,7 @@ void func_80B58AAC(EnZl3* this, PlayState* play) { } void func_80B58C08(EnZl3* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f* unk_348 = &this->unk_348; Vec3f* unk_354 = &this->unk_354; Vec3f* thisPos = &this->actor.world.pos; @@ -2628,7 +2628,7 @@ void func_80B59A80(EnZl3* this, PlayState* play) { } void func_80B59AD0(EnZl3* this, PlayState* play) { - Actor* thisx = &this->actor; + UNUSED Actor* thisx = &this->actor; Flags_SetSwitch(play, 0x36); Interface_SetSubTimer(180); @@ -2671,10 +2671,10 @@ void func_80B59B6C(EnZl3* this, PlayState* play) { } void func_80B59DB8(EnZl3* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjectContext* objectCtx = &play->objectCtx; s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME2); - s32 pad2; + STACK_PAD(s32); #if DEBUG_FEATURES if (objectSlot < 0) { @@ -2714,7 +2714,7 @@ void EnZl3_Update(Actor* thisx, PlayState* play) { void EnZl3_Init(Actor* thisx, PlayState* play) { EnZl3* this = (EnZl3*)thisx; ActorShape* shape = &this->actor.shape; - s32 pad; + STACK_PAD(s32); PRINTF(T("ゼルダ姫のEn_Zl3_Actor_ct通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n", "I'm going through Princess Zelda's En_Zl3_Actor_ct!!!!!!!!!!!!!!!!!!!!!!!!!\n")); @@ -2758,13 +2758,13 @@ void func_80B59FE8(EnZl3* this, PlayState* play) { } void func_80B59FF4(EnZl3* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeTexIndex = this->eyeTexIndex; void* eyeTex = sEyeTextures[eyeTexIndex]; s16 mouthTexIndex = this->mouthTexIndex; SkelAnime* skelAnime = &this->skelAnime; void* mouthTex = sMouthTextures[mouthTexIndex]; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_zl3.c", 2165); @@ -2783,13 +2783,13 @@ void func_80B59FF4(EnZl3* this, PlayState* play) { } void func_80B5A1D0(EnZl3* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 eyeTexIndex = this->eyeTexIndex; void* eyeTex = sEyeTextures[eyeTexIndex]; s16 mouthTexIndex = this->mouthTexIndex; SkelAnime* skelAnime = &this->skelAnime; void* mouthTex = sMouthTextures[mouthTexIndex]; - s32 pad2; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_zl3.c", 2205); diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index be729698f4..9136b081b5 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -14,6 +14,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "audio.h" @@ -374,7 +375,7 @@ s32 EnZl4_InMovingAnim(EnZl4* this) { } void EnZl4_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZl4* this = (EnZl4*)thisx; SkelAnime_InitFlex(play, &this->skelAnime, &gChildZeldaSkel, NULL, this->jointTable, this->morphTable, 18); @@ -410,7 +411,7 @@ void EnZl4_Init(Actor* thisx, PlayState* play) { } void EnZl4_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZl4* this = (EnZl4*)thisx; Collider_DestroyCylinder(play, &this->collider); @@ -1276,7 +1277,7 @@ void EnZl4_TheEnd(EnZl4* this, PlayState* play) { } void EnZl4_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnZl4* this = (EnZl4*)thisx; if (this->actionFunc != EnZl4_TheEnd) { diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 85f0f300e9..43f3dce162 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -6,12 +6,14 @@ #include "z_en_zo.h" +#include "attributes.h" #include "libc64/qrand.h" #include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "face_reaction.h" @@ -44,7 +46,7 @@ void EnZo_Dive(EnZo* this, PlayState* play); void EnZo_SpawnRipple(EnZo* this, Vec3f* pos, f32 scale, f32 targetScale, u8 alpha) { EnZoEffect* effect; - Vec3f vec = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec = { 0.0f, 0.0f, 0.0f }; s16 i; effect = this->effects; @@ -63,7 +65,7 @@ void EnZo_SpawnRipple(EnZo* this, Vec3f* pos, f32 scale, f32 targetScale, u8 alp void EnZo_SpawnBubble(EnZo* this, Vec3f* pos) { EnZoEffect* effect; - Vec3f vec = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec = { 0.0f, 0.0f, 0.0f }; Vec3f vel = { 0.0f, 1.0f, 0.0f }; s16 i; f32 waterSurface; @@ -731,7 +733,7 @@ void EnZo_Dive(EnZo* this, PlayState* play) { void EnZo_Update(Actor* thisx, PlayState* play) { EnZo* this = (EnZo*)thisx; - u32 pad; + STACK_PAD(s32); Vec3f pos; if ((s32)this->alpha != 0) { diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 5b37333bc9..8775c5b10b 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -19,6 +19,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" #include "player.h" @@ -125,11 +126,10 @@ void EnfHG_SetupIntro(EnfHG* this, PlayState* play) { void EnfHG_Intro(EnfHG* this, PlayState* play) { static Vec3f audioVec = { 0.0f, 0.0f, 50.0f }; - s32 pad64; + STACK_PAD(s32); Player* player = GET_PLAYER(play); BossGanondrof* bossGnd = (BossGanondrof*)this->actor.parent; - s32 pad58; - s32 pad54; + STACK_PADS(s32, 2); if (this->cutsceneState != INTRO_FINISH) { SkelAnime_Update(&this->skin.skelAnime); @@ -696,7 +696,7 @@ void EnfHG_Done(EnfHG* this, PlayState* play) { } void EnfHG_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); EnfHG* this = (EnfHG*)thisx; u8 i; @@ -732,7 +732,7 @@ void EnfHG_PostDraw(Actor* thisx, PlayState* play, Skin* skin) { void EnfHG_Draw(Actor* thisx, PlayState* play) { EnfHG* this = (EnfHG*)thisx; BossGanondrof* bossGnd = (BossGanondrof*)this->actor.parent; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_en_fhg.c", 2439); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index 20c26abb89..9f08c12694 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "versions.h" @@ -237,7 +238,7 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { // Used in the Temple of Time void EndTitle_DrawNintendoLogo(Actor* thisx, PlayState* play) { EndTitle* this = (EndTitle*)thisx; - s32 pad; + STACK_PAD(s32); s32 csCurFrame = play->csCtx.curFrame; if ((csCurFrame > FRAMERATE_CONST(1100, 950)) && (this->endAlpha < 255)) { diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 9f94310a35..c2ae6ecec5 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -23,6 +23,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -375,7 +376,7 @@ static ColliderJntSphInit sJntSphInit = { static f32 sFishGroupVar = 0.0f; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -static Vec3f sUnusedVec = { 0.0f, 0.0f, 2000.0f }; +UNUSED static Vec3f sUnusedVec = { 0.0f, 0.0f, 2000.0f }; static Fishing* sFishingMain; static u8 sReelLock; @@ -863,7 +864,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { #endif if (thisx->params < EN_FISH_PARAM) { - s32 pad; + STACK_PAD(s32); #if PLATFORM_N64 // Anti-piracy check, if the check fails the line can't be reeled in if @@ -1420,7 +1421,7 @@ void Fishing_DrawEffects(FishingEffect* effect, PlayState* play2) { } void Fishing_DrawStreamSplash(PlayState* play) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_fishing.c", 2572); @@ -1520,7 +1521,7 @@ void Fishing_UpdateLine(PlayState* play, Vec3f* basePos, Vec3f* pos, Vec3f* rot, } if (sLureEquipped == FS_LURE_SINKING) { - s32 pad; + STACK_PAD(s32); if (spD8 < phi_f12) { phi_f12 = WATER_SURFACE_Y(play) + ((sqrtf(sqDistXZ) - 920.0f) * 0.147f); @@ -1829,7 +1830,7 @@ void Fishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) { Vec3f hookPos[2]; s16 i; s16 spooled = sRodLineSpooled; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); OPEN_DISPS(play->state.gfxCtx, "../z_fishing.c", 3287); @@ -3640,7 +3641,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { if (((input->rel.stick_y < -50) && (sStickAdjYPrev > -40)) || CHECK_BTN_ALL(input->press.button, BTN_A)) { f32 temp_f0; - s32 pad; + STACK_PAD(s32); f32 rumbleStrength; if (input->rel.stick_y < -50) { @@ -4462,7 +4463,7 @@ void Fishing_DrawPondProps(PlayState* play) { u8 materialFlag = 0; FishingProp* prop = &sPondProps[0]; s16 i; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_fishing.c", 7704); @@ -4743,7 +4744,7 @@ void Fishing_DrawGroupFishes(PlayState* play) { FishingGroupFish* fish = &sGroupFishes[0]; f32 scale; s16 i; - s32 pad; + STACK_PAD(s32); if (sLinkAge == LINK_AGE_CHILD) { scale = 0.003325f; @@ -5287,7 +5288,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { #if DEBUG_FEATURES if (KREG(0) != 0) { - s32 pad[3]; + STACK_PADS(s32, 3); KREG(0) = 0; sLureEquipped = FS_LURE_STOCK; @@ -5716,14 +5717,14 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { sFishingStormShade; if ((u8)sStormStrength > 0) { - s32 pad; + STACK_PAD(s32); Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); s16 i; - s32 pad1; + STACK_PAD(s32); Vec3f pos; Vec3f rot; Vec3f projectedPos; - s32 pad2; + STACK_PAD(s32); rot.x = M_PI / 2.0f + 0.1f; rot.y = 1.0f; diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 99db32656c..511f8a5921 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -14,6 +14,7 @@ #include "effect.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -101,7 +102,7 @@ void ItemEtcetera_SetupAction(ItemEtcetera* this, ItemEtceteraActionFunc actionF void ItemEtcetera_Init(Actor* thisx, PlayState* play) { ItemEtcetera* this = (ItemEtcetera*)thisx; - s32 pad; + STACK_PAD(s32); s32 type; s32 objectSlot; diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 7e6630f4f8..e9223278a1 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -6,6 +6,7 @@ #include "z_item_ocarina.h" +#include "attributes.h" #include "libu64/debug.h" #include "segmented_address.h" #include "sfx.h" @@ -204,7 +205,7 @@ void ItemOcarina_Update(Actor* thisx, PlayState* play) { } void ItemOcarina_Draw(Actor* thisx, PlayState* play) { - ItemOcarina* this = (ItemOcarina*)thisx; + UNUSED ItemOcarina* this = (ItemOcarina*)thisx; func_8002EBCC(thisx, play, 0); func_8002ED80(thisx, play, 0); diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 9dda7af3f0..0868b75ec2 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -6,11 +6,13 @@ #include "z_item_shield.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" @@ -64,8 +66,8 @@ ActorProfile Item_Shield_Profile = { /**/ ItemShield_Draw, }; -static Color_RGBA8 unused = { 255, 255, 0, 255 }; -static Color_RGBA8 unused2 = { 255, 0, 0, 255 }; +UNUSED static Color_RGBA8 unused = { 255, 255, 0, 255 }; +UNUSED static Color_RGBA8 unused2 = { 255, 0, 0, 255 }; void ItemShield_SetupAction(ItemShield* this, ItemShieldActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -196,7 +198,7 @@ void func_80B86CA8(ItemShield* this, PlayState* play) { } void func_80B86F68(ItemShield* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); MtxF* shield = &player->shieldMf; diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 13acab8d46..36cb5140e3 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -7,9 +7,11 @@ #include "z_magic_dark.h" #include "array_count.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "z_lib.h" @@ -60,8 +62,7 @@ static Gfx sDiamondModelDL[8] = { #include "assets/overlays/ovl_Magic_Dark/sDiamondModelDL.inc.c" }; -// unused -static Color_RGBA8 D_80B88B10[] = { { 50, 100, 150, 200 }, { 255, 200, 150, 100 } }; +UNUSED static Color_RGBA8 D_80B88B10[] = { { 50, 100, 150, 200 }, { 255, 200, 150, 100 } }; void MagicDark_Init(Actor* thisx, PlayState* play) { MagicDark* this = (MagicDark*)thisx; @@ -100,7 +101,7 @@ void MagicDark_DiamondUpdate(Actor* thisx, PlayState* play) { MagicDark* this = (MagicDark*)thisx; u8 phi_a0; Player* player = GET_PLAYER(play); - s16 pad; + STACK_PAD(s16); s16 nayrusLoveTimer = gSaveContext.nayrusLoveTimer; s32 msgMode = play->msgCtx.msgMode; @@ -203,7 +204,7 @@ void MagicDark_DimLighting(PlayState* play, f32 intensity) { void MagicDark_OrbUpdate(Actor* thisx, PlayState* play) { MagicDark* this = (MagicDark*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_MAGIC_SOUL_BALL - SFX_FLAG); @@ -231,7 +232,7 @@ void MagicDark_OrbUpdate(Actor* thisx, PlayState* play) { void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { MagicDark* this = (MagicDark*)thisx; - s32 pad; + STACK_PAD(s32); u16 gameplayFrames = play->gameplayFrames; OPEN_DISPS(play->state.gfxCtx, "../z_magic_dark.c", 525); diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index a5938c8fca..513a7b19b4 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "tex_len.h" #include "z_lib.h" @@ -145,7 +146,7 @@ void MagicFire_UpdateBeforeCast(Actor* thisx, PlayState* play) { void MagicFire_Update(Actor* thisx, PlayState* play) { MagicFire* this = (MagicFire*)thisx; Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if (1) {} this->actor.world.pos = player->actor.world.pos; @@ -244,9 +245,9 @@ void MagicFire_Update(Actor* thisx, PlayState* play) { void MagicFire_Draw(Actor* thisx, PlayState* play) { MagicFire* this = (MagicFire*)thisx; - s32 pad1; + STACK_PAD(s32); u32 gameplayFrames = play->gameplayFrames; - s32 pad2; + STACK_PAD(s32); s32 i; u8 alpha; diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index aff6fcd55a..9a7d3c6f13 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "curve.h" #include "play_state.h" @@ -150,7 +151,7 @@ void MagicWind_Update(Actor* thisx, PlayState* play) { } s32 MagicWind_OverrideLimbDraw(PlayState* play, SkelCurve* skelCurve, s32 limbIndex, void* thisx) { - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_magic_wind.c", 615); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 06254d6ca6..becb889147 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "translation.h" @@ -175,7 +176,7 @@ void MirRay_MakeShieldLight(MirRay* this, PlayState* play) { } void MirRay_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); MirRay* this = (MirRay*)thisx; MirRayDataEntry* dataEntry = &sMirRayData[this->actor.params]; @@ -252,7 +253,7 @@ void MirRay_Destroy(Actor* thisx, PlayState* play) { } void MirRay_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); MirRay* this = (MirRay*)thisx; Player* player = GET_PLAYER(play); @@ -281,7 +282,7 @@ void MirRay_SetIntensity(MirRay* this, PlayState* play) { f32 temp_f0; f32 temp_f0_2; f32 temp_f2_2; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); MtxF* shieldMtx = &player->shieldMf; @@ -487,7 +488,7 @@ void MirRay_Draw(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); s32 i; MirRayShieldReflection reflection[6]; - s32 pad; + STACK_PAD(s32); this->reflectIntensity = 0.0f; if ((D_80B8E670 == 0) && !this->unLit && Player_HasMirrorShieldSetToDraw(play)) { diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 7ccb70299d..46cf8ef951 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -13,6 +13,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -152,7 +153,7 @@ void ObjBean_InitCollider(Actor* thisx, PlayState* play) { } void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -161,7 +162,7 @@ void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* colli #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -628,7 +629,6 @@ void func_80B90010(ObjBean* this) { // Control is returned to the player and the leaves start to flatten out void func_80B90050(ObjBean* this, PlayState* play) { s16 temp_a0; - f32 temp_f2; this->unk_1B6.x += 0x3E80; this->unk_1B6.y += -0xC8; @@ -885,7 +885,7 @@ void func_80B90A34(ObjBean* this, PlayState* play) { } } void ObjBean_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjBean* this = (ObjBean*)thisx; if (this->timer > 0) { diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 5f76c6e02a..6dd82d6f69 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "play_state.h" @@ -47,7 +48,7 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { DynaPolyActor* dynaPolyActor; Vec3f sp4C; s32 bgId; - s32 pad; + STACK_PAD(s32); if (BgCheck_EntityLineTest2(&play->colCtx, &this->actor.home.pos, &this->actor.world.pos, &sp4C, &this->actor.floorPoly, false, false, true, true, &bgId, &this->actor)) { diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 1ebc95cff8..5934eadc4c 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -12,6 +12,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -132,7 +133,7 @@ void ObjBombiwa_Break(ObjBombiwa* this, PlayState* play) { void ObjBombiwa_Update(Actor* thisx, PlayState* play) { ObjBombiwa* this = (ObjBombiwa*)thisx; - s32 pad; + STACK_PAD(s32); if ((func_80033684(play, &this->actor) != NULL) || ((this->collider.base.acFlags & AC_HIT) && (this->collider.elem.acHitElem->atDmgInfo.dmgFlags & DMG_HAMMER))) { diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index 3484ffcefa..e3e88f5940 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "play_state.h" #include "save.h" @@ -50,7 +51,7 @@ static ColliderCylinderInitToActor sCylinderInit = { void ObjDekujr_Init(Actor* thisx, PlayState* play) { ObjDekujr* this = (ObjDekujr*)thisx; - s32 pad; + STACK_PAD(s32); if (gSaveContext.save.cutsceneIndex < 0xFFF0) { if (!LINK_IS_ADULT) { @@ -144,7 +145,7 @@ void ObjDekujr_ComeUp(ObjDekujr* this, PlayState* play) { void ObjDekujr_Update(Actor* thisx, PlayState* play) { ObjDekujr* this = (ObjDekujr*)thisx; - s32 pad; + STACK_PAD(s32); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index ad572f17be..6e48a5dd4a 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -9,6 +9,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "play_state.h" @@ -52,7 +53,7 @@ void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc } void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s16 pad1; + STACK_PAD(s16); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flag); @@ -61,7 +62,7 @@ void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collisio #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 97c898f466..8c613aa46b 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "rand.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -104,7 +105,7 @@ void ObjHamishi_Shake(ObjHamishi* this) { } void ObjHamishi_Break(ObjHamishi* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f velocity; Vec3f pos; s16 phi_s0 = 1000; diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 3d8af090e5..9cc8efd04b 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -64,7 +65,7 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) { } void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 transformFlags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, transformFlags); @@ -73,7 +74,7 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 3dac2d7fe4..df637c3e4e 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -113,7 +114,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { } void ObjIcePoly_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjIcePoly* this = (ObjIcePoly*)thisx; if ((this->actor.params >= 0) && (this->actor.params < 3)) { @@ -124,7 +125,7 @@ void ObjIcePoly_Destroy(Actor* thisx, PlayState* play) { void ObjIcePoly_Idle(ObjIcePoly* this, PlayState* play) { static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; - s32 pad; + STACK_PAD(s32); Vec3f pos; if (this->iceCollider.base.acFlags & AC_HIT) { @@ -193,14 +194,14 @@ void ObjIcePoly_Melt(ObjIcePoly* this, PlayState* play) { } void ObjIcePoly_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjIcePoly* this = (ObjIcePoly*)thisx; this->actionFunc(this, play); } void ObjIcePoly_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjIcePoly* this = (ObjIcePoly*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_obj_ice_poly.c", 421); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index b4dd823735..3ca9f8e0e9 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -5,12 +5,14 @@ */ #include "z_obj_kibako.h" +#include "attributes.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "libc64/qrand.h" #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_en_item00.h" #include "z_lib.h" @@ -100,7 +102,7 @@ void ObjKibako_InitCollider(Actor* thisx, PlayState* play) { } void ObjKibako_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjKibako* this = (ObjKibako*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -195,7 +197,7 @@ void ObjKibako_SetupIdle(ObjKibako* this) { } void ObjKibako_Idle(ObjKibako* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if (Actor_HasParent(&this->actor, play)) { ObjKibako_SetupHeld(this); @@ -259,8 +261,7 @@ void ObjKibako_SetupThrown(ObjKibako* this) { } void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || (this->collider.base.atFlags & AT_HIT)) { @@ -284,15 +285,15 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { } void ObjKibako_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjKibako* this = (ObjKibako*)thisx; this->actionFunc(this, play); } void ObjKibako_Draw(Actor* thisx, PlayState* play) { - s32 pad; - ObjKibako* this = (ObjKibako*)thisx; + STACK_PAD(s32); + UNUSED ObjKibako* this = (ObjKibako*)thisx; Gfx_DrawDListOpa(play, gSmallWoodenBoxDL); } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index c8c0a1211f..dfecb66a04 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_en_item00.h" #include "z_lib.h" @@ -76,7 +77,7 @@ void ObjKibako2_InitCollider(Actor* thisx, PlayState* play) { } void ObjKibako2_Break(ObjKibako2* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f* thisPos; Vec3f pos; Vec3f velocity; @@ -127,7 +128,7 @@ void ObjKibako2_SpawnCollectible(ObjKibako2* this, PlayState* play) { void ObjKibako2_Init(Actor* thisx, PlayState* play) { ObjKibako2* this = (ObjKibako2*)thisx; - s16 pad; + STACK_PAD(s16); CollisionHeader* colHeader = NULL; u32 bgId; diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index a6c35ed922..0f1e96cbc7 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -13,6 +13,7 @@ #include "printf.h" #include "quake.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_lib.h" #include "effect.h" @@ -73,7 +74,7 @@ void ObjLift_SetupAction(ObjLift* this, ObjLiftActionFunc actionFunc) { } void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* collision, s32 flags) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, flags); @@ -82,7 +83,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -95,7 +96,7 @@ void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { Vec3f pos; Vec3f velocity; Vec3f* temp_s3; - s32 pad0; + STACK_PAD(s32); s32 i; temp_s3 = &this->dyna.actor.world.pos; @@ -150,7 +151,7 @@ void ObjLift_SetupWait(ObjLift* this) { } void ObjLift_Wait(ObjLift* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 quakeIndex; if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { @@ -205,7 +206,7 @@ void ObjLift_SetupFall(ObjLift* this) { } void ObjLift_Fall(ObjLift* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 bgId; Vec3f pos; diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 3a99282723..e5e7960a75 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -15,6 +15,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -104,7 +105,7 @@ static InitChainEntry sInitChain[] = { }; void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); @@ -151,7 +152,7 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) f32 x; f32 y; f32 z; - s32 pad; + STACK_PAD(s32); if (this->alpha >= (100 << 6)) { x = (CLAMP_MAX((1.0f - 1.0f / (255 << 6) * this->alpha) * 400.0f, 60.0f) - 30.0f + 30.0f) * Rand_ZeroOne(); diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 238bf69cf6..d6044356b0 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -10,6 +10,7 @@ #include "libc64/qrand.h" #include "ichain.h" #include "printf.h" +#include "stack_pad.h" #include "translation.h" #include "play_state.h" @@ -152,7 +153,7 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) { Actor* actor = &this->actor; s32 i; Vec3f pos; - s32 pad; + STACK_PAD(s32); s32 maxChildren = ObjMure_GetMaxChildSpawns(this); for (i = 0; i < maxChildren; i++) { diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index ff37f4b8e1..45df2fae52 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -7,6 +7,7 @@ #include "z_obj_mure3.h" #include "ichain.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "z_en_item00.h" #include "z_lib.h" @@ -148,7 +149,7 @@ void func_80B9ADCC(ObjMure3* this, PlayState* play) { } void ObjMure3_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjMure3* this = (ObjMure3*)thisx; if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index b328e2b6c1..ea040bd368 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -15,6 +15,7 @@ #include "regs.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -100,7 +101,7 @@ static Vec2f sFaceDirection[] = { }; void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -109,7 +110,7 @@ void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeade #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -326,14 +327,14 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { } void ObjOshihiki_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjOshihiki* this = (ObjOshihiki*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } void ObjOshihiki_SetFloors(ObjOshihiki* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Vec3f colCheckPoint; Vec3f colCheckOffset; s32 i; @@ -434,7 +435,7 @@ s32 ObjOshihiki_CheckWall(PlayState* play, s16 angle, f32 direction, ObjOshihiki } s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjOshihiki* blockUnder = ObjOshihiki_GetBlockUnder(this, play); if ((blockUnder != NULL) && (blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH) && @@ -465,7 +466,7 @@ void ObjOshihiki_SetupOnScene(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); this->stateFlags |= PUSHBLOCK_ON_SCENE; @@ -626,7 +627,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_Update(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjOshihiki* this = (ObjOshihiki*)thisx; this->stateFlags &= @@ -649,7 +650,7 @@ void ObjOshihiki_Update(Actor* thisx, PlayState* play) { } void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjOshihiki* this = (ObjOshihiki*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_obj_oshihiki.c", 1289); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index f8cc6397f8..b26bff63a7 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -15,6 +15,7 @@ #include "rumble.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -207,7 +208,7 @@ void ObjSwitch_RotateY(Vec3f* dest, Vec3f* src, s16 rotY) { } void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); @@ -216,7 +217,7 @@ void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* c #if DEBUG_FEATURES if (this->dyna.bgId == BG_ACTOR_MAX) { - s32 pad2; + STACK_PAD(s32); PRINTF(T("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "Warning : move BG registration failed (%s %d)(name %d)(arg_data 0x%04x)\n"), @@ -266,7 +267,7 @@ Actor* ObjSwitch_SpawnIce(ObjSwitch* this, PlayState* play) { } void ObjSwitch_SetOn(ObjSwitch* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 subType; if (Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor))) { @@ -810,7 +811,7 @@ void ObjSwitch_DrawCrystal(Actor* thisx, PlayState* play) { gCrystalSwitchCoreOpaDL // OBJSWITCH_SUBTYPE_SYNC }; ObjSwitch* this = (ObjSwitch*)thisx; - s32 pad; + STACK_PAD(s32); s32 subType = OBJSWITCH_SUBTYPE(&this->dyna.actor); func_8002ED80(&this->dyna.actor, play, 0); diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index ccebc0615e..b6ff5df1cb 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -13,6 +13,7 @@ #include "ichain.h" #include "one_point_cutscene.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "play_state.h" @@ -90,7 +91,7 @@ static s32 sLitTorchCount; void ObjSyokudai_Init(Actor* thisx, PlayState* play) { static u8 sColMaterialsStand[] = { COL_MATERIAL_METAL, COL_MATERIAL_WOOD, COL_MATERIAL_WOOD }; - s32 pad; + STACK_PAD(s32); ObjSyokudai* this = (ObjSyokudai*)thisx; s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); @@ -121,7 +122,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { } void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjSyokudai* this = (ObjSyokudai*)thisx; Collider_DestroyCylinder(play, &this->standCollider); @@ -145,8 +146,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { s32 interactionType; u32 dmgFlags; Vec3f tipToFlame; - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); litTimeScale = torchCount; if (torchCount == 10) { @@ -271,7 +271,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { static Gfx* displayLists[] = { gGoldenTorchDL, gTimedTorchDL, gWoodenTorchDL }; - s32 pad; + STACK_PAD(s32); ObjSyokudai* this = (ObjSyokudai*)thisx; s32 timerMax; diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index 2e3f6e0186..fb9ca98e5b 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -115,7 +116,7 @@ void ObjTimeblock_ToggleSwitchFlag(PlayState* play, s32 flag) { void ObjTimeblock_Init(Actor* thisx, PlayState* play) { ObjTimeblock* this = (ObjTimeblock*)thisx; - s32 pad; + STACK_PAD(s32); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -157,7 +158,7 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { } void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjTimeblock* this = (ObjTimeblock*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 4a2ba2d3d9..5c912e88f8 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -11,6 +11,7 @@ #include "ichain.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "z_en_item00.h" #include "z_lib.h" @@ -167,7 +168,7 @@ void ObjTsubo_Destroy(Actor* thisx, PlayState* play2) { } void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); f32 rand; s16 angle; Vec3f pos; @@ -204,7 +205,7 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { } void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); s16 angle; Vec3f pos = this->actor.world.pos; Vec3f velocity; @@ -250,7 +251,7 @@ void ObjTsubo_SetupIdle(ObjTsubo* this) { } void ObjTsubo_Idle(ObjTsubo* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s16 temp_v0; s32 phi_v1; @@ -319,7 +320,7 @@ void ObjTsubo_SetupThrown(ObjTsubo* this) { } void ObjTsubo_Thrown(ObjTsubo* this, PlayState* play) { - s32 pad[2]; + STACK_PADS(s32, 2); if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || (this->collider.base.atFlags & AT_HIT)) { diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 0d5e46873a..4db3ddad35 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -12,6 +12,7 @@ #include "one_point_cutscene.h" #include "printf.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" @@ -94,7 +95,7 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { if (DynaPolyActor_IsPlayerAbove(&this->dyna)) { return 0; } else { - s32 pad; + STACK_PAD(s32); Actor* temp_a3 = this->dyna.actor.child; Player* player = GET_PLAYER(play); Vec3f sp20; diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 5f8f580e4e..2423d8904f 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -6,6 +6,7 @@ #include "z_object_kankyo.h" +#include "attributes.h" #include "libc64/qrand.h" #include "array_count.h" #include "gfx.h" @@ -13,6 +14,7 @@ #include "segmented_address.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" @@ -80,7 +82,7 @@ void ObjectKankyo_SetupAction(ObjectKankyo* this, ObjectKankyoActionFunc action) void ObjectKankyo_Init(Actor* thisx, PlayState* play) { ObjectKankyo* this = (ObjectKankyo*)thisx; - s32 pad; + STACK_PAD(s32); s16 i; for (i = 0; i < ARRAY_COUNT(this->effects); i++) { @@ -199,8 +201,8 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, PlayState* play) { f32 baseX; f32 baseY; f32 baseZ; - Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; f32 random; s16 i; Vec3f viewForwards; @@ -513,8 +515,8 @@ void ObjectKankyo_DrawFairies(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjectKankyo* this = (ObjectKankyo*)thisx; f32 alphaScale; - Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; s16 i; if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER)) { @@ -606,11 +608,10 @@ void ObjectKankyo_DrawSnow(Actor* thisx, PlayState* play2) { f32 baseX; f32 baseY; f32 baseZ; - Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; - Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; + UNUSED Vec3f vec2 = { 0.0f, 0.0f, 0.0f }; s16 i; - s32 pad; - s32 pad2; + STACK_PADS(s32, 2); if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER)) { OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 958); @@ -765,7 +766,7 @@ void ObjectKankyo_Lightning(ObjectKankyo* this, PlayState* play) { } void ObjectKankyo_DrawLightning(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); ObjectKankyo* this = (ObjectKankyo*)thisx; OPEN_DISPS(play->state.gfxCtx, "../z_object_kankyo.c", 1182); diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 15f6308e1e..aa49d4b121 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -6,11 +6,13 @@ #include "z_oceff_spot.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "printf.h" #include "regs.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "tex_len.h" @@ -71,7 +73,7 @@ void OceffSpot_SetupAction(OceffSpot* this, OceffSpotActionFunc actionFunc) { } void OceffSpot_Init(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); OceffSpot* this = (OceffSpot*)thisx; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -94,7 +96,7 @@ void OceffSpot_Init(Actor* thisx, PlayState* play) { } void OceffSpot_Destroy(Actor* thisx, PlayState* play) { - s32 pad; + STACK_PAD(s32); OceffSpot* this = (OceffSpot*)thisx; Player* player = GET_PLAYER(play); @@ -148,7 +150,7 @@ void OceffSpot_GrowCylinder(OceffSpot* this, PlayState* play) { void OceffSpot_Update(Actor* thisx, PlayState* play) { OceffSpot* this = (OceffSpot*)thisx; - s32 pad; + STACK_PAD(s32); Player* player = GET_PLAYER(play); f32 temp; @@ -176,7 +178,7 @@ void OceffSpot_Update(Actor* thisx, PlayState* play) { } void OceffSpot_Draw(Actor* thisx, PlayState* play) { - OceffSpot* this = (OceffSpot*)thisx; + UNUSED OceffSpot* this = (OceffSpot*)thisx; u32 scroll = play->state.frames & 0xFFFF; OPEN_DISPS(play->state.gfxCtx, "../z_oceff_spot.c", 466); diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index e7e623f024..cf53345b33 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -6,6 +6,7 @@ #include "z_oceff_storm.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" @@ -66,7 +67,7 @@ void OceffStorm_Init(Actor* thisx, PlayState* play) { } void OceffStorm_Destroy(Actor* thisx, PlayState* play) { - OceffStorm* this = (OceffStorm*)thisx; + UNUSED OceffStorm* this = (OceffStorm*)thisx; Player* player = GET_PLAYER(play); Magic_Reset(play); diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index e07daebbfd..059f8c8098 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -6,9 +6,11 @@ #include "z_oceff_wipe.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "tex_len.h" @@ -46,7 +48,7 @@ void OceffWipe_Init(Actor* thisx, PlayState* play) { } void OceffWipe_Destroy(Actor* thisx, PlayState* play) { - OceffWipe* this = (OceffWipe*)thisx; + UNUSED OceffWipe* this = (OceffWipe*)thisx; Player* player = GET_PLAYER(play); Magic_Reset(play); @@ -93,7 +95,7 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) { u32 scroll = play->state.frames & 0xFF; OceffWipe* this = (OceffWipe*)thisx; f32 z; - s32 pad; + STACK_PAD(s32); u8 alphaTable[3]; s32 i; Vec3f eye; diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index b71ddef91a..44197f9e78 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -6,9 +6,11 @@ #include "z_oceff_wipe2.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "tex_len.h" @@ -46,7 +48,7 @@ void OceffWipe2_Init(Actor* thisx, PlayState* play) { } void OceffWipe2_Destroy(Actor* thisx, PlayState* play) { - OceffWipe2* this = (OceffWipe2*)thisx; + UNUSED OceffWipe2* this = (OceffWipe2*)thisx; Player* player = GET_PLAYER(play); Magic_Reset(play); @@ -95,7 +97,7 @@ void OceffWipe2_Draw(Actor* thisx, PlayState* play) { OceffWipe2* this = (OceffWipe2*)thisx; f32 z; u8 alpha; - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f eye; Vtx* vtxPtr; Vec3f quakeOffset; diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index eb62318ce7..0bf1fdbed1 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -6,9 +6,11 @@ #include "z_oceff_wipe3.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "tex_len.h" @@ -65,7 +67,7 @@ void OceffWipe3_Init(Actor* thisx, PlayState* play) { } void OceffWipe3_Destroy(Actor* thisx, PlayState* play) { - OceffWipe3* this = (OceffWipe3*)thisx; + UNUSED OceffWipe3* this = (OceffWipe3*)thisx; Player* player = GET_PLAYER(play); Magic_Reset(play); @@ -90,7 +92,7 @@ void OceffWipe3_Draw(Actor* thisx, PlayState* play) { OceffWipe3* this = (OceffWipe3*)thisx; f32 z; u8 alpha; - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f eye; Vtx* vtxPtr; Vec3f quakeOffset; diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 00b97cc756..f843b02b40 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -6,9 +6,11 @@ #include "z_oceff_wipe4.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "tex_len.h" @@ -46,7 +48,7 @@ void OceffWipe4_Init(Actor* thisx, PlayState* play) { } void OceffWipe4_Destroy(Actor* thisx, PlayState* play) { - OceffWipe4* this = (OceffWipe4*)thisx; + UNUSED OceffWipe4* this = (OceffWipe4*)thisx; Magic_Reset(play); @@ -92,7 +94,7 @@ void OceffWipe4_Draw(Actor* thisx, PlayState* play) { OceffWipe4* this = (OceffWipe4*)thisx; f32 z; u8 alpha; - s32 pad[2]; + STACK_PADS(s32, 2); Vec3f eye; Vtx* vtxPtr; Vec3f quakeOffset; diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 1ba86361ed..192ea98a39 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -12,6 +12,7 @@ #include "printf.h" #include "segmented_address.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math3d.h" #include "terminal.h" #include "translation.h" @@ -142,7 +143,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); s32 params = PARAMS_GET_U(this->actor.params, 0, 8); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { @@ -177,7 +178,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { Vec3s cylinderPos; Player* player = GET_PLAYER(play); EnItem00* collectible; - s32 pad; + STACK_PAD(s32); if (this->collider.base.acFlags & AC_HIT) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 68a2683ca9..d58e6539a0 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -5,6 +5,7 @@ */ #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" +#include "attributes.h" #include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h" #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" @@ -34,6 +35,7 @@ #include "rumble.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_math3d.h" #include "sys_matrix.h" @@ -1967,7 +1969,7 @@ void func_808328EC(Player* this, u16 sfxId) { */ void Player_ProcessAnimSfxList(Player* this, AnimSfxEntry* entry) { s32 cont; - s32 pad; + STACK_PAD(s32); do { s32 absData = ABS(entry->data); @@ -3878,7 +3880,7 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) { s32 ignoreLeash = false; s32 zButtonHeld = CHECK_BTN_ALL(sControlInput->cur.button, BTN_Z); Actor* nextLockOnActor; - s32 pad; + STACK_PAD(s32); s32 usingHoldTargeting; s32 isTalking; @@ -4279,7 +4281,7 @@ static s32 (*sActionHandlerFuncs[])(Player* this, PlayState* play) = { * */ s32 Player_TryActionHandlerList(PlayState* play, Player* this, s8* actionHandlerList, s32 updateUpperBody) { - s32 i; + STACK_PAD(s32); if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_DEAD | PLAYER_STATE1_29))) { if (updateUpperBody) { @@ -4509,7 +4511,7 @@ static u32 D_80854488[][2] = { }; void func_80837948(PlayState* play, Player* this, s32 arg2) { - s32 pad; + STACK_PAD(s32); u32 dmgFlags; s32 temp; @@ -4811,7 +4813,7 @@ void func_808382BC(Player* this) { } s32 func_808382DC(Player* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); s32 sp68 = false; s32 sp64; @@ -5367,7 +5369,7 @@ s32 Player_PosVsWallLineTest(PlayState* play, Player* this, Vec3f* offset, Colli s32 Player_ActionHandler_1(Player* this, PlayState* play) { Actor* attachedActor; - s32 pad3; + STACK_PAD(s32); s32 doorDirection; f32 sp78; f32 sp74; @@ -5937,7 +5939,7 @@ s32 Player_StartCsAction(PlayState* play, Player* this) { } void func_8083AE40(Player* this, s16 objectId) { - s32 pad; + STACK_PAD(s32); u32 size; if (objectId != OBJECT_INVALID) { @@ -7250,7 +7252,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) &gPlayerAnim_link_normal_down_slope_slip, &gPlayerAnim_link_normal_up_slope_slip, }; - s32 pad; + STACK_PAD(s32); s16 playerVelYaw; Vec3f slopeNormal; s16 downwardSlopeYaw; @@ -7296,7 +7298,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) } // unknown data (unused) -static s32 D_80854598[] = { +UNUSED static s32 D_80854598[] = { 0xFFDB0871, 0xF8310000, 0x00940470, 0xF3980000, 0xFFB504A9, 0x0C9F0000, 0x08010402, }; @@ -7506,7 +7508,7 @@ s32 func_8083EC18(Player* this, PlayState* play, u32 wallFlags) { s32 i; f32 sp48; Vec3f* sp44 = &sp50[0]; - s32 pad; + STACK_PAD(s32); CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallBgId, &play->colCtx, sp50); @@ -8446,7 +8448,7 @@ void func_80841138(Player* this, PlayState* play) { f32 temp2; if (this->unk_864 < 1.0f) { - s32 pad; + STACK_PAD(s32); temp1 = R_UPDATE_RATE * 0.5f; func_8084029C(this, REG(35) / 1000.0f); @@ -8755,7 +8757,7 @@ void func_80841EE4(Player* this, PlayState* play) { f32 temp2; if (this->unk_864 < 1.0f) { - s32 pad; + STACK_PAD(s32); temp1 = R_UPDATE_RATE * 0.5f; @@ -9043,7 +9045,7 @@ static LinkAnimationHeader* D_808545CC[] = { }; void func_80842D20(PlayState* play, Player* this) { - s32 pad; + STACK_PAD(s32); s32 sp28; if (Player_Action_80843188 != this->actionFunc) { @@ -9691,7 +9693,7 @@ void Player_Action_Roll(Player* this, PlayState* play) { s32 interruptResult; s32 animDone; DynaPolyActor* wallPolyActor; - s32 pad; + STACK_PAD(s32); f32 speedTarget; s16 yawTarget; @@ -11194,7 +11196,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { CollisionPoly* wallPoly; s32 wallBgId; s16 yawDiff; - s32 pad; + STACK_PAD(s32); sInteractWallCheckOffset.y = 18.0f; sInteractWallCheckOffset.z = this->ageProperties->wallCheckRadius + 10.0f; @@ -11320,9 +11322,9 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { f32 invFloorPolyNormalY; f32 floorPolyNormalZ; f32 sin; - s32 pad2; + STACK_PAD(s32); f32 cos; - s32 pad3; + STACK_PAD(s32); if (this->actor.floorBgId != BGCHECK_SCENE) { DynaPoly_SetPlayerOnTop(&play->colCtx, this->actor.floorBgId); @@ -11362,7 +11364,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { u8 seqMode; - s32 pad; + STACK_PAD(s32); Actor* focusActor; s32 camMode; @@ -11683,7 +11685,7 @@ static f32 sFloorConveyorSpeeds[CONVEYOR_SPEED_MAX - 1] = { }; void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { - s32 pad; + STACK_PAD(s32); sControlInput = input; @@ -11815,7 +11817,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { f32 speedXZTarget = this->speedXZ; s16 yawTarget = this->yaw; s16 yawDiff = this->actor.world.rot.y - yawTarget; - s32 pad; + STACK_PAD(s32); if ((ABS(yawDiff) > 0x6000) && (this->actor.speed != 0.0f)) { speedXZTarget = 0.0f; @@ -12100,7 +12102,7 @@ s32 Player_UpdateNoclip(Player* this, PlayState* play); void Player_Update(Actor* thisx, PlayState* play) { Player* this = (Player*)thisx; s32 dogParams; - s32 pad; + STACK_PAD(s32); Input input; #if DEBUG_FEATURES @@ -12157,7 +12159,7 @@ void Player_Update(Actor* thisx, PlayState* play) { skip_update:; #endif { - s32 pad; + STACK_PAD(s32); MREG(52) = this->actor.world.pos.x; MREG(53) = this->actor.world.pos.y; @@ -12263,7 +12265,7 @@ void Player_Draw(Actor* thisx, PlayState* play2) { if (!(this->stateFlags2 & PLAYER_STATE2_29)) { OverrideLimbDrawOpa overrideLimbDraw = Player_OverrideLimbDrawGameplayDefault; s32 lod; - s32 pad; + STACK_PAD(s32); if ((this->csAction != PLAYER_CSACTION_NONE) || (Player_CheckHostileLockOn(this) && 0) || (this->actor.projectedPos.z < 160.0f)) { @@ -13819,7 +13821,7 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { this->stateFlags2 &= ~(PLAYER_STATE2_23 | PLAYER_STATE2_24 | PLAYER_STATE2_25); this->unk_6A8 = NULL; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_02) { - s32 pad; + STACK_PAD(s32); gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex = sWarpSongEntrances[play->msgCtx.lastPlayedSong]; gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = @@ -14211,7 +14213,7 @@ void Player_Action_ExchangeItem(Player* this, PlayState* play) { } if (this->av2.actionVar2 == 0) { - s32 pad; + STACK_PAD(s32); Message_StartTextbox(play, this->actor.textId, &this->actor); @@ -14343,7 +14345,7 @@ void Player_Action_StartWarpSongArrive(Player* this, PlayState* play) { } void Player_Action_BlueWarpArrive(Player* this, PlayState* play) { - s32 pad; + STACK_PAD(s32); if ((this->av1.isLakeHyliaCs) && (play->csCtx.curFrame < 305)) { // Delay falling down until frame 306 of the Lake Hylia cutscene after completing Water Temple @@ -15510,8 +15512,7 @@ void func_808519C0(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80845964(play, this, cue, 0.0f, 0, 1); } -// unused -static LinkAnimationHeader* D_80855190[] = { +UNUSED static LinkAnimationHeader* D_80855190[] = { &gPlayerAnim_link_demo_back_to_past, &gPlayerAnim_clink_demo_goto_future, }; @@ -16021,7 +16022,7 @@ void func_80852C0C(PlayState* play, Player* this, s32 csAction) { void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { CsCmdActorCue* cue = play->csCtx.playerCue; - s32 pad; + STACK_PAD(s32); if (play->csCtx.state == CS_STATE_STOP) { Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); @@ -16154,7 +16155,7 @@ s32 Player_InflictDamage(PlayState* play, s32 damage) { */ void Player_StartTalking(PlayState* play, Actor* actor) { Player* this = GET_PLAYER(play); - s32 pad; + STACK_PAD(s32); if ((this->talkActor != NULL) || (actor == this->naviActor) || ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c index aa9ae498eb..ea5bff1f23 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -67,7 +68,7 @@ u32 EffectSsBlast_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; MtxF mf; - s32 pad; + STACK_PAD(s32); f32 scale; OPEN_DISPS(gfxCtx, "../z_eff_ss_blast.c", 170); diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c index f78c1e2f56..3bac9faa9b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c @@ -11,6 +11,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -63,7 +64,7 @@ void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfResult; MtxF mfTransBillboard; Mtx* mtx; - s32 pad; + STACK_PAD(s32); f32 scale; s16 intensity; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c index 176f68acc1..a4c5ae7e98 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -80,7 +81,7 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this) { MtxF mfResult; MtxF mfTransBillboard; Mtx* mtx; - s32 pad; + STACK_PAD(s32); f32 scale; OPEN_DISPS(gfxCtx, "../z_eff_ss_bomb2.c", 298); @@ -120,7 +121,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) { MtxF mtx2F; Mtx* mtx2; Mtx* mtx; - s32 pad[3]; + STACK_PADS(s32, 3); f32 scale; f32 depth; f32 layer2Scale = 0.925f; diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c index f89b0840b8..a40977c316 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c @@ -12,6 +12,7 @@ #include "effect.h" #include "play_state.h" #include "skin_matrix.h" +#include "stack_pad.h" #include "assets/objects/object_dodongo/object_dodongo.h" @@ -77,7 +78,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfScale; MtxF mfResult; MtxF mfTransBillboard; - s32 pad; + STACK_PAD(s32); void* objectPtr; Mtx* mtx; f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c index b75a7077c8..2f105c1581 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c @@ -13,6 +13,7 @@ #include "effect.h" #include "play_state.h" #include "skin_matrix.h" +#include "stack_pad.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -104,7 +105,7 @@ void EffectSsDeadDb_Draw(PlayState* play, u32 index, EffectSs* this) { void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this) { f32 w; - f32 pad; + STACK_PAD(s32); this->rTextIdx = (f32)((this->rReg11 - this->life) * 9) / this->rReg11; this->rScale += this->rScaleStep; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c index 5f6da1295f..9a4b18e974 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -53,10 +54,9 @@ u32 EffectSsDeadDs_Init(PlayState* play, u32 index, EffectSs* this, void* initPa } void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + STACK_PAD(s32); f32 scale; - s32 pad1; - s32 pad2; + STACK_PADS(s32, 2); MtxF mf; f32 yIntersect; Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c index f06b5f3031..5d4becb7b5 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -96,7 +97,7 @@ void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfScale; MtxF mfResult; MtxF mfTransBillboard; - s32 pad; + STACK_PAD(s32); Mtx* mtx; f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c index d632dfaa52..aa0e25779e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c @@ -9,6 +9,7 @@ #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -76,7 +77,7 @@ void EffectSsEnFire_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; f32 scale; s16 camYaw; - s32 pad[3]; + STACK_PADS(s32, 3); s16 intensity; s16 redGreen; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c index d4b07ef730..16d7e5e531 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "rand.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "translation.h" @@ -101,7 +102,7 @@ u32 EffectSsEnIce_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsEnIce_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; Vec3f hiliteLightDir; u32 gameplayFrames; diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index f2eaceaee8..bd76dec849 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -33,7 +34,7 @@ EffectSsProfile Effect_Ss_Extra_Profile = { u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsExtraInitParams* initParams = (EffectSsExtraInitParams*)initParamsx; - s32 pad; + STACK_PAD(s32); s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_YABUSAME_POINT); if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { @@ -65,7 +66,7 @@ static void* sTextures[] = { }; void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + STACK_PAD(s32); f32 scale = this->rScale / 100.0f; void* objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c index c9bfbe981a..5ffc0c188f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -52,7 +53,7 @@ u32 EffectSsFcircle_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsFcircle_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 yScale; f32 xzScale; f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c index b44cc99533..cb9e89cf5e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c @@ -13,6 +13,7 @@ #include "printf.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "effect.h" @@ -43,7 +44,7 @@ static Gfx sShockDL[15]; u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsFhgFlashInitParams* initParams = (EffectSsFhgFlashInitParams*)initParamsx; - s32 pad; + STACK_PAD(s32); s32 objectSlot; Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f farAwayVec = { 0.0f, -1000.0f, 0.0f }; @@ -99,7 +100,7 @@ static Color_RGB8 sLightBallColors[] = { void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; void* objectPtr; @@ -127,7 +128,7 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this) void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; scale = this->rScale / 100.0f; @@ -203,7 +204,7 @@ void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) { } if (this->life < 100) { - s32 pad; + STACK_PAD(s32); this->rAlpha -= 50; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c index 8a5e416a6a..a7d8572b3a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -76,7 +77,7 @@ u32 EffectSsFireTail_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); s16 yaw; Vec3f scale; f32 temp1; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c index 19f535ef71..090535a0f9 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -47,7 +48,7 @@ EffectSsProfile Effect_Ss_G_Magma2_Profile = { u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_KINGDODONGO); - s32 pad; + STACK_PAD(s32); if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; @@ -81,7 +82,7 @@ u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initP void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; void* objectPtr; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c index ef0565c8f8..44d49b232c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -39,7 +40,7 @@ EffectSsProfile Effect_Ss_G_Ripple_Profile = { }; u32 EffectSsGRipple_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { - s32 pad; + STACK_PAD(s32); Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; WaterBox* waterBox; EffectSsGRippleInitParams* initParams = (EffectSsGRippleInitParams*)initParamsx; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c index 783224c9e0..d9547fed3a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "z_lib.h" #include "effect.h" #include "play_state.h" @@ -89,7 +90,7 @@ void EffectSsGSpk_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfTransBillboard; Mtx* mtx; f32 scale; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_eff_ss_g_spk.c", 208); diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index 550c4a08d3..6cb6130484 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -78,7 +79,7 @@ u32 EffectSsHahen_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale = this->rScale * 0.001f; OPEN_DISPS(gfxCtx, "../z_eff_hahen.c", 208); @@ -101,7 +102,7 @@ void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) { // in the original game this function is hardcoded to be used only by the skull pots in Shadow Temple void EffectSsHahen_DrawGray(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale = this->rScale * 0.001f; OPEN_DISPS(gfxCtx, "../z_eff_hahen.c", 253); diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c index e1fa2a982e..a291494001 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -86,7 +87,7 @@ void EffectSsHitMark_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfTransBillboard; Mtx* mtx; f32 scale; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_eff_ss_hitmark.c", 297); diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c index 4bad83b5f0..7e8f0f0dcc 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" +#include "stack_pad.h" #include "sys_math.h" #include "sys_matrix.h" #include "effect.h" @@ -53,7 +54,7 @@ u32 EffectSsIcePiece_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsIcePiece_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; u32 frames; f32 alpha; diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index bfa4d40db8..1e5180f53a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -10,6 +10,7 @@ #include "gfx_setupdl.h" #include "printf.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "z_lib.h" @@ -33,7 +34,7 @@ EffectSsProfile Effect_Ss_Ice_Smoke_Profile = { u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsIceSmokeInitParams* initParams = (EffectSsIceSmokeInitParams*)initParamsx; - s32 pad; + STACK_PAD(s32); s32 objectSlot; objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c index ce06859168..8eb89f3509 100644 --- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "effect.h" #include "play_state.h" @@ -50,7 +51,7 @@ u32 EffectSsKFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 xzScale; f32 yScale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index cf5f3a2b88..75964e00b4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -12,6 +12,7 @@ #include "gfx_setupdl.h" #include "line_numbers.h" #include "printf.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "translation.h" #include "versions.h" @@ -105,7 +106,7 @@ f32 func_809A9818(f32 arg0, f32 arg1) { void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { static Color_RGB8 colors[] = { { 255, 255, 255 }, { 235, 170, 130 } }; GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); f32 scale; s32 colorIdx; diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c index a4093ead1b..885f49d077 100644 --- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c +++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "rand.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -89,7 +90,7 @@ u32 EffectSsKiraKira_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsKiraKira_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx; f32 scale; - s32 pad; + STACK_PAD(s32); MtxF mfTrans; MtxF mfRotY; MtxF mfScale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c index 5e2ff3aaf0..3e0442b27e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c +++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c @@ -10,6 +10,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -129,7 +130,7 @@ void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this) { } void EffectSsLightning_Update(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + STACK_PAD(s32); Vec3f pos; s16 yaw; f32 scale; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index aecdd6c936..528136f59e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -11,6 +11,7 @@ #include "gfx_setupdl.h" #include "regs.h" #include "segmented_address.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -91,7 +92,7 @@ void EffectSsSibuki_Draw(PlayState* play, u32 index, EffectSs* this) { void EffectSsSibuki_Update(PlayState* play, u32 index, EffectSs* this) { Player* player = GET_PLAYER(play); - s32 pad[2]; + STACK_PADS(s32, 2); f32 xzVelScale; if (this->pos.y <= player->actor.floorHeight) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index beac5fd414..69d3a4d9f2 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -10,6 +10,7 @@ #include "effect.h" #include "play_state.h" #include "player.h" +#include "stack_pad.h" #define rUnused regs[1] @@ -35,7 +36,7 @@ u32 EffectSsSolderSrchBall_Init(PlayState* play, u32 index, EffectSs* this, void } void EffectSsSolderSrchBall_Update(PlayState* play, u32 index, EffectSs* this) { - s32 pad; + STACK_PAD(s32); f32 playerPosDiffX; f32 playerPosDiffY; f32 playerPosDiffZ; diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index d7758d3b97..24e056d04c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -8,6 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "z_lib.h" #include "effect.h" @@ -60,7 +61,7 @@ u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initPar void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_eff_ss_stick.c", 153); diff --git a/src/overlays/gamestates/ovl_file_choose/file_select.h b/src/overlays/gamestates/ovl_file_choose/file_select.h index 016c04dce5..31e9565ed1 100644 --- a/src/overlays/gamestates/ovl_file_choose/file_select.h +++ b/src/overlays/gamestates/ovl_file_choose/file_select.h @@ -2,6 +2,7 @@ #define FILE_SELECT_H #include "stddef.h" +#include "attributes.h" #include "ultra64.h" #include "gfx.h" #include "versions.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index fdb36d94bd..0fcf99cdad 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -20,6 +20,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -79,7 +80,7 @@ static InitialLanguageCursorInfo sInitialLanguageCursors[] = { }; #endif -static s16 sUnused = 106; +UNUSED static s16 sUnused = 106; static s16 sScreenFillAlpha = 255; @@ -190,7 +191,7 @@ void FileSelect_DrawImageRGBA32(GraphicsContext* gfxCtx, s16 centerX, s16 center u32 textureHeight; s32 remainingSize; s32 textureSize; - s32 pad; + STACK_PAD(s32); s32 i; OPEN_DISPS(gfxCtx, "../z_file_choose.c", UNK_LINE); @@ -401,12 +402,14 @@ void FileSelect_InitModeUpdate(GameState* thisx) { #endif } -void FileSelect_InitModeDraw(GameState* thisx) { #if OOT_PAL_N64 +void FileSelect_InitModeDraw(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; Gfx_SetupDL_39Opa(this->state.gfxCtx); FileSelect_DrawInitialLanguageMenu(this); +#else +void FileSelect_InitModeDraw(UNUSED GameState* thisx) { #endif } @@ -644,7 +647,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) { /** * Update function for `CM_UNUSED_31` */ -void FileSelect_UnusedCM31(GameState* thisx) { +void FileSelect_UnusedCM31(UNUSED GameState* thisx) { } /** @@ -741,8 +744,8 @@ void FileSelect_PulsateCursor(GameState* thisx) { static s16 cursorAlphaTargets[] = { 70, 200 }; FileSelectState* this = (FileSelectState*)thisx; s16 alphaStep; - SramContext* sramCtx = &this->sramCtx; - Input* debugInput = &this->state.input[2]; + UNUSED_NDEBUG SramContext* sramCtx = &this->sramCtx; + UNUSED_NDEBUG Input* debugInput = &this->state.input[2]; #if OOT_PAL && DEBUG_FEATURES if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) { @@ -1388,7 +1391,7 @@ void FileSelect_DrawWindowContents(GameState* thisx) { s16 quadVtxIndex; s16 temp; s16 isActive; - s16 pad; + STACK_PAD(s16); OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 1940); @@ -2341,12 +2344,12 @@ void FileSelect_InitContext(GameState* thisx) { #endif } -void FileSelect_Destroy(GameState* thisx) { +void FileSelect_Destroy(UNUSED GameState* thisx) { } void FileSelect_Init(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; - s32 pad; + STACK_PAD(s32); u32 size = (uintptr_t)_title_staticSegmentRomEnd - (uintptr_t)_title_staticSegmentRomStart; #if PLATFORM_N64 diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index fb14504bd7..f11a83e9ac 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -1,4 +1,5 @@ #include "file_select.h" +#include "attributes.h" #include "file_select_state.h" #include "controller.h" @@ -375,7 +376,7 @@ void FileSelect_ExitToCopySource1(GameState* thisx) { */ void FileSelect_ExitToCopySource2(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; - SramContext* sramCtx = &this->sramCtx; + UNUSED SramContext* sramCtx = &this->sramCtx; s16 i; s16 yStep; #if PLATFORM_IQUE @@ -781,7 +782,9 @@ void FileSelect_CopyAnim3(GameState* thisx) { */ void FileSelect_CopyAnim4(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; +#if PLATFORM_IQUE s16* array; +#endif #if !PLATFORM_IQUE this->fileInfoAlpha[this->selectedFileIndex] -= 25; diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index faf219fd93..a84b7ef004 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -10,6 +10,7 @@ #include "regs.h" #include "rumble.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "translation.h" @@ -67,7 +68,9 @@ s16 D_80812544[] = { void FileSelect_SetKeyboardVtx(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; +#if OOT_PAL s16 phi_t2; +#endif s16 phi_t0; s16 phi_t3; s16 phi_s1; @@ -195,7 +198,7 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { Font* font = &this->font; s16 phi_s0; s16 phi_t1; -#if OOT_PAL +#if OOT_PAL && OOT_VERSION >= PAL_1_1 u8 temp; #endif s16 phi_v0; @@ -538,7 +541,7 @@ s32 FileSelect_ApplyDiacriticToCharacter(GameState* thisx, s16 diacritic, s16 ch */ s32 FileSelect_ApplyDiacriticToFilename(GameState* thisx, s16 diacritic) { FileSelectState* this = (FileSelectState*)thisx; - s32 pad; + STACK_PAD(s32); if (!FileSelect_ApplyDiacriticToCharacter(&this->state, diacritic, this->newFileNameCharCount)) { if (this->newFileNameCharCount != 0) { @@ -1010,8 +1013,12 @@ void FileSelect_UpdateKeyboardCursor(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; s16 prevKbdX; #if !(PLATFORM_GC && OOT_PAL) +#if OOT_NTSC Input* input = &this->state.input[0]; - s32 pad; +#else + STACK_PAD(s32); +#endif + STACK_PAD(s32); #endif #if OOT_NTSC @@ -1591,14 +1598,14 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) { s16 cursorBlue; #if !OOT_PAL_N64 s16 i; - s16 j; + STACK_PAD(s16); s16 vtx; #else s16 startIndex; s32 endIndex; s32 i; s32 vtx; - s32 pad; + STACK_PAD(s32); #endif OPEN_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 848); diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index f300c1ea7b..bf79ceb083 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -5,6 +5,7 @@ */ #include "gfx.h" +#include "attributes.h" #include "regs.h" #include "sys_matrix.h" #include "title_setup_state.h" @@ -24,7 +25,7 @@ void TitleSetup_SetupTitleScreen(TitleSetupState* this) { SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState); } -void func_80803C5C(TitleSetupState* this) { +void func_80803C5C(UNUSED TitleSetupState* this) { } void TitleSetup_Main(GameState* thisx) { @@ -35,7 +36,7 @@ void TitleSetup_Main(GameState* thisx) { func_80803C5C(this); } -void TitleSetup_Destroy(GameState* thisx) { +void TitleSetup_Destroy(UNUSED GameState* thisx) { } void TitleSetup_Init(GameState* thisx) { diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index 329af45f22..101e4d8c01 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -5,6 +5,7 @@ */ #include "libc64/qrand.h" +#include "attributes.h" #include "libu64/gfxprint.h" #include "alloca.h" #include "array_count.h" @@ -22,6 +23,7 @@ #include "seqcmd.h" #include "sequence.h" #include "sfx.h" +#include "stack_pad.h" #include "terminal.h" #include "translation.h" #include "ultra64.h" @@ -65,13 +67,13 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) { } #if PLATFORM_N64 -void func_80800AD0_unknown(MapSelectState* this, s32 arg1) { +void func_80800AD0_unknown(UNUSED MapSelectState* this, UNUSED s32 arg1) { if (D_80121212 != 0) { n64dd_SetDiskVersion(1); } } -void func_80800B08_unknown(MapSelectState* this, s32 arg1) { +void func_80800B08_unknown(UNUSED MapSelectState* this, UNUSED s32 arg1) { if (D_80121212 != 0) { n64dd_SetDiskVersion(0); } @@ -290,7 +292,7 @@ static MapSelectEntry sMapSelectEntries[] = { void MapSelect_UpdateMenu(MapSelectState* this) { Input* input = &this->state.input[0]; - s32 pad; + STACK_PAD(s32); MapSelectEntry* selectedEntry; if (this->verticalInputAccumulator == 0) { @@ -544,7 +546,7 @@ static const char* sLoadingMessages[] = { T(GFXP_HIRAGANA "アワテナイアワテナイ。ヒトヤスミヒトヤスミ。", "Don't worry, don't worry. Take a break, take a break."), }; -void MapSelect_PrintLoadingMessage(MapSelectState* this, GfxPrint* printer) { +void MapSelect_PrintLoadingMessage(UNUSED MapSelectState* this, GfxPrint* printer) { s32 randomMsg; GfxPrint_SetPos(printer, 10, 15); @@ -558,13 +560,13 @@ static const char* sAgeLabels[] = { T(GFXP_HIRAGANA "5(ワカスギ)", "5(very young)"), }; -void MapSelect_PrintAgeSetting(MapSelectState* this, GfxPrint* printer, s32 age) { +void MapSelect_PrintAgeSetting(UNUSED MapSelectState* this, GfxPrint* printer, s32 age) { GfxPrint_SetPos(printer, 4, 26); GfxPrint_SetColor(printer, 255, 255, 55, 255); GfxPrint_Printf(printer, "Age:%s", sAgeLabels[age]); } -void MapSelect_PrintCutsceneSetting(MapSelectState* this, GfxPrint* printer, u16 csIndex) { +void MapSelect_PrintCutsceneSetting(UNUSED MapSelectState* this, GfxPrint* printer, u16 csIndex) { char* label; GfxPrint_SetPos(printer, 4, 25); @@ -693,7 +695,7 @@ void MapSelect_Main(GameState* thisx) { MapSelect_Draw(this); } -void MapSelect_Destroy(GameState* thisx) { +void MapSelect_Destroy(UNUSED GameState* thisx) { PRINTF("%c", BEL); PRINTF(T("*** view_cleanupはハングアップするので、呼ばない ***\n", "*** view_cleanup will hang, so it won't be called ***\n")); diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 907fdb886c..b7c497c8eb 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -20,6 +20,7 @@ #include "regs.h" #include "segment_symbols.h" #include "sequence.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "sys_debug_controller.h" #include "sys_freeze.h" @@ -101,15 +102,15 @@ void ConsoleLogo_SetupView(ConsoleLogoState* this, f32 x, f32 y, f32 z) { void ConsoleLogo_Draw(ConsoleLogoState* this) { static s16 sTitleRotY = 0; static Lights1 sTitleLights = gdSPDefLights1(100, 100, 100, 255, 255, 255, 69, 69, 69); - u16 y; u16 idx; - s32 pad1; + STACK_PAD(s32); Vec3f v3; Vec3f v1; Vec3f v2; - s32 pad2; - s32 pad3; +#if OOT_VERSION != IQUE_CN + STACK_PADS(s32, 2); +#endif OPEN_DISPS(this->state.gfxCtx, "../z_title.c", 395); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 87a30a53b5..1c859342ca 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -1,6 +1,7 @@ #include "z_kaleido_scope.h" #include "array_count.h" +#include "attributes.h" #include "controller.h" #include "gfx.h" #include "printf.h" @@ -9,6 +10,7 @@ #include "ocarina.h" #include "play_state.h" #include "save.h" +#include "stack_pad.h" #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" @@ -75,11 +77,11 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { gOcarinaBtnIconCLeftTex, // OCARINA_BTN_C_LEFT gOcarinaBtnIconCUpTex, // OCARINA_BTN_C_UP }; - static u16 D_8082A144[] = { + UNUSED static u16 D_8082A144[] = { 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, }; static s16 sPlayedSongBtnsAlpha[SONG_MAX_LENGTH] = { 0 }; - static s32 sUnused1 = 0; + UNUSED static s32 sUnused1 = 0; static s16 sSongsPrimRed[] = { 150, // QUEST_SONG_MINUET @@ -161,7 +163,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { /* QUEST_SKULL_TOKEN */ { QUEST_STONE_OF_AGONY, QUEST_SONG_LULLABY, CURSOR_TO_LEFT, QUEST_HEART_PIECE }, /* QUEST_HEART_PIECE */ { CURSOR_NONE, QUEST_SONG_TIME, QUEST_GERUDOS_CARD, QUEST_MEDALLION_SHADOW }, }; - static s32 sUnused2 = 0; + UNUSED static s32 sUnused2 = 0; PauseContext* pauseCtx = &play->pauseCtx; Input* input = &play->state.input[0]; @@ -176,7 +178,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { s16 cursor; s16 i; s16 targetColorIndex; - s16 pad2; + STACK_PAD(s16); s16 cursorItem; s16 gsTokenDigits[3]; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c index 2ba3fd1139..269bc58159 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c @@ -6,6 +6,7 @@ #include "gfx_setupdl.h" #include "gfxalloc.h" #include "printf.h" +#include "stack_pad.h" #include "translation.h" #include "play_state.h" #include "save.h" @@ -176,7 +177,7 @@ static s16 sSlotItems[] = { void KaleidoScope_DrawInventoryEditorText(Gfx** gfxP) { GfxPrint printer; - s32 pad[2]; + STACK_PADS(s32, 2); GfxPrint_Init(&printer); GfxPrint_Open(&printer, *gfxP); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 1f573ca3e3..9cacc7c210 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -6,6 +6,7 @@ #include "printf.h" #include "regs.h" #include "sfx.h" +#include "stack_pad.h" #include "translation.h" #include "play_state.h" #include "player.h" @@ -78,7 +79,7 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u s32 textureHeight; s32 remainingSize; s32 textureSize; - s32 pad; + STACK_PAD(s32); s32 i; OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_equipment.c", 68); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index 00c57579b0..42ef0a2a9c 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -1,5 +1,6 @@ #include "z_kaleido_scope.h" +#include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" #include "language_array.h" @@ -419,7 +420,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { }; static s16 pointPulseStage = 1; static s16 pointPulseTimer = 20; - static s16 D_8082A5B8[] = { 64, 64, 64, 28 }; + UNUSED static s16 D_8082A5B8[] = { 64, 64, 64, 28 }; static s16 areaBoxPosX[] = { -41, // WORLD_MAP_AREA_HYRULE_FIELD 19, // WORLD_MAP_AREA_KAKARIKO_VILLAGE diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 2a76a40fa2..8ef69e63bb 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1,5 +1,6 @@ #include "z_kaleido_scope.h" +#include "attributes.h" #include "libc64/sleep.h" #include "array_count.h" #include "controller.h" @@ -17,6 +18,7 @@ #include "segmented_address.h" #include "seqcmd.h" #include "sfx.h" +#include "stack_pad.h" #include "sys_matrix.h" #include "terminal.h" #include "title_setup_state.h" @@ -910,8 +912,9 @@ static s16 sCursorColors[][3] = { static void* sSavePromptMessageTexs[] = LANGUAGE_ARRAY(gPauseSavePromptJPNTex, gPauseSavePromptENGTex, gPauseSavePromptGERTex, gPauseSavePromptFRATex); -static void* sSaveConfirmationTexs[] = LANGUAGE_ARRAY(gPauseSaveConfirmationJPNTex, gPauseSaveConfirmationENGTex, - gPauseSaveConfirmationGERTex, gPauseSaveConfirmationFRATex); +UNUSED static void* sSaveConfirmationTexs[] = + LANGUAGE_ARRAY(gPauseSaveConfirmationJPNTex, gPauseSaveConfirmationENGTex, gPauseSaveConfirmationGERTex, + gPauseSaveConfirmationFRATex); static void* sContinuePromptTexs[] = LANGUAGE_ARRAY(gContinuePlayingJPNTex, gContinuePlayingENGTex, gContinuePlayingGERTex, gContinuePlayingFRATex); @@ -1143,7 +1146,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex) { PauseContext* pauseCtx = &play->pauseCtx; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 955); @@ -1686,7 +1689,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { }; static s16 D_8082AE00 = 20; static s16 D_8082AE04 = 0; - static s16 D_8082AE08[] = { + UNUSED static s16 D_8082AE08[] = { 10, 16, 16, 17, 12, 13, 18, 17, 17, 19, 13, 21, 20, 21, 14, 15, 15, 15, 11, 14, }; static s16 D_8082AE30[] = { @@ -3576,7 +3579,7 @@ void KaleidoScope_UpdateCursorVtx(PlayState* play) { void KaleidoScope_LoadDungeonMap(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; #if PLATFORM_N64 || OOT_PAL - s32 pad; + STACK_PAD(s32); #endif DMA_REQUEST_SYNC(interfaceCtx->mapSegment, diff --git a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 05371b7149..953d786d81 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -1,6 +1,7 @@ #if PLATFORM_N64 #include "n64dd.h" #endif +#include "attributes.h" #include "regs.h" #include "sys_matrix.h" #include "z_kaleido_scope.h" @@ -31,7 +32,7 @@ static PauseMapMarkInfo sMapMarkInfoTable[] = { extern PauseMapMarksData gPauseMapMarkDataTable[]; -void PauseMapMark_Init(PlayState* play) { +void PauseMapMark_Init(UNUSED PlayState* play) { gBossMarkState = 0; gBossMarkScale = 1.0f; gLoadedPauseMarkDataTable = gPauseMapMarkDataTable; @@ -42,7 +43,7 @@ void PauseMapMark_Init(PlayState* play) { #endif } -void PauseMapMark_Clear(PlayState* play) { +void PauseMapMark_Clear(UNUSED PlayState* play) { #if PLATFORM_N64 if ((B_80121220 != NULL) && (B_80121220->unk_38 != NULL)) { B_80121220->unk_38(&gLoadedPauseMarkDataTable);