1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00

More minor isolated fixes (#1258)

* Fix reversed array access in z_boss_dodongo.c

* Remove useless return in z_en_encount2.c

* Remove some redundant externs or declarations

* Move some undefs to be performed as early as possible

* AudioOcarina_ResetStaffs -> AudioOcarina_ResetStaves

The plural appears to be staves for the music term

* Remove some uses of UNK_PTR

* Use NULL for pointers set to 0 in z_game_dlftbls.c

* Remove useless !! in z_en_tk.c

* Revert "AudioOcarina_ResetStaffs -> AudioOcarina_ResetStaves"

This reverts commit 1b7fe62408.

* Remove more redundant externs from PR suggestion
This commit is contained in:
Roman971 2022-06-05 18:48:44 +02:00 committed by GitHub
parent bd4912a1bd
commit b28ad659e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 12 additions and 33 deletions

View file

@ -202,8 +202,6 @@ extern volatile OSTime gRDPTotalTime;
extern ActiveSound gActiveSounds[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8
extern u8 gSoundBankMuted[];
extern u8 D_801333F0;
extern u8 gAudioSfxSwapOff;
extern u16 gAudioSfxSwapSource[10];
extern u16 gAudioSfxSwapTarget[10];
extern u8 gAudioSfxSwapMode[10];

View file

@ -1453,11 +1453,11 @@ typedef struct {
/* 0x08 */ u32 vromEnd; // if applicable
/* 0x0C */ void* vramStart; // if applicable
/* 0x10 */ void* vramEnd; // if applicable
/* 0x14 */ UNK_PTR unk_14;
/* 0x14 */ void* unk_14;
/* 0x18 */ void* init; // initializes and executes the given context
/* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
/* 0x20 */ UNK_PTR unk_20;
/* 0x24 */ UNK_PTR unk_24;
/* 0x20 */ void* unk_20;
/* 0x24 */ void* unk_24;
/* 0x28 */ UNK_TYPE4 unk_28;
/* 0x2C */ u32 instanceSize;
} GameStateOverlay; // size = 0x30

View file

@ -309,13 +309,12 @@ typedef enum {
/* 0x6E */ SCENE_ID_MAX
} SceneID;
#undef DEFINE_SCENE
// this define exists to preserve shiftability for an unused scene that is
// listed in the entrance table
#define SCENE_UNUSED_6E SCENE_ID_MAX
#undef DEFINE_SCENE
// Entrance Index Enum
#define DEFINE_ENTRANCE(enum, _1, _2, _3, _4, _5, _6) enum,
@ -324,6 +323,8 @@ typedef enum {
/* 0x614 */ ENTR_MAX
} EntranceIndex;
#undef DEFINE_ENTRANCE
#define ENTR_LOAD_OPENING -1
typedef enum {
@ -336,8 +337,6 @@ typedef enum {
/* 0x7FFF */ ENTR_RETURN_GROTTO // Grottos and normal Fairy Fountain
} ReturnEntranceIndex;
#undef DEFINE_ENTRANCE
typedef enum {
/* 0 */ SDC_DEFAULT,
/* 1 */ SDC_SPOT00,

View file

@ -2297,12 +2297,6 @@ f32 D_80131C8C = 0.0f;
// =========== Audio Debugging ===========
extern u16 gAudioSfxSwapSource[];
extern u16 gAudioSfxSwapTarget[];
extern u8 gAudioSfxSwapMode[];
extern u8 gAudioSfxSwapOff;
extern u8 D_801333F0;
u32 sDebugPadHold;
u32 sDebugPadBtnLast;
u32 sDebugPadPress;

View file

@ -3,10 +3,10 @@
#define GAMESTATE_OVERLAY(name, init, destroy, size) \
{ \
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
_ovl_##name##SegmentEnd, 0, init, destroy, 0, 0, 0, size \
_ovl_##name##SegmentEnd, NULL, init, destroy, NULL, NULL, 0, size \
}
#define GAMESTATE_OVERLAY_INTERNAL(init, destroy, size) \
{ NULL, 0, 0, NULL, NULL, 0, init, destroy, 0, 0, 0, size }
{ NULL, 0, 0, NULL, NULL, NULL, init, destroy, NULL, NULL, 0, size }
GameStateOverlay gGameStateOverlayTable[] = {
GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)),

View file

@ -9,8 +9,6 @@ s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
s32 SkelAnime_Once(SkelAnime* skelAnime);
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
static u32 sDisableAnimQueueFlags = 0;
static u32 sAnimQueueFlags;

View file

@ -1,7 +1,5 @@
#include "global.h"
extern OSViContext* __osViNext;
void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount) {
register u32 prevInt = __osDisableInt();

View file

@ -55,7 +55,7 @@ static InitChainEntry sInitChain[] = {
};
void func_808C1190(s16* arg0, u8* arg1, s16 arg2) {
if (arg2[arg1] != 0) {
if (arg1[arg2] != 0) {
arg0[arg2 / 2] = 0;
}
}

View file

@ -111,7 +111,6 @@ void EnEncount2_Wait(EnEncount2* this, PlayState* play) {
}
break;
}
return;
}
void EnEncount2_SpawnRocks(EnEncount2* this, PlayState* play) {

View file

@ -3106,10 +3106,6 @@ void EnHorse_BgCheckSlowMoving(EnHorse* this, PlayState* play) {
}
}
void EnHorse_HighJumpInit(EnHorse* this, PlayState* play);
void EnHorse_Stub2(EnHorse* this);
void EnHorse_Stub1(EnHorse* this);
void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) {
s32 pad;
s32 pad2;

View file

@ -1095,7 +1095,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
s32 pad;
Vec3s sp48;
u8 i;
UNK_PTR ptr;
void* ptr;
if (1) {}

View file

@ -56,7 +56,6 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, PlayState* play);
void EnSkj_FinishOcarinaGameRound(EnSkj* this, PlayState* play);
void EnSkj_WaitForNextRound(EnSkj* this, PlayState* play);
void EnSkj_WaitForOfferResponse(EnSkj* this, PlayState* play);
void EnSkj_SetupWaitForOcarina(EnSkj* this, PlayState* play);
void EnSkj_CleanupOcarinaGame(EnSkj* this, PlayState* play);
void EnSkj_Fade(EnSkj* this, PlayState* play);

View file

@ -491,7 +491,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (gSaveContext.dayTime <= CLOCK_TIME(18, 0) || gSaveContext.dayTime >= CLOCK_TIME(21, 0) || !!LINK_IS_ADULT ||
if (gSaveContext.dayTime <= CLOCK_TIME(18, 0) || gSaveContext.dayTime >= CLOCK_TIME(21, 0) || LINK_IS_ADULT ||
play->sceneNum != SCENE_SPOT02) {
Actor_Kill(&this->actor);
return;

View file

@ -33,8 +33,6 @@ void ObjectKankyo_DrawLightning(ObjectKankyo* this, PlayState* play);
void ObjectKankyo_DrawSunGraveSpark(ObjectKankyo* this, PlayState* play);
void ObjectKankyo_DrawBeams(ObjectKankyo* this, PlayState* play);
extern Mtx D_01000000;
static void* sEffLightningTextures[] = {
gEffLightning1Tex, gEffLightning2Tex, gEffLightning3Tex, gEffLightning4Tex,
gEffLightning5Tex, gEffLightning6Tex, gEffLightning7Tex, gEffLightning8Tex,