Skip to content

Commit

Permalink
un-static-ized
Browse files Browse the repository at this point in the history
  • Loading branch information
Alto1772 committed Feb 17, 2024
1 parent 3b7b17e commit 6ff124b
Show file tree
Hide file tree
Showing 48 changed files with 364 additions and 357 deletions.
10 changes: 5 additions & 5 deletions src/111f0_len_860.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include "nu/nusys.h"
#include "game_modes.h"

static s16 gMapTransitionAlpha;
static s16 gMapTransitionFadeRate;
static s16 gMapTransitionState;
static s16 gMapTransitionStateTime;
static s16 gLoadedFromFileSelect;
BSS s16 gMapTransitionAlpha;
BSS s16 gMapTransitionFadeRate;
BSS s16 gMapTransitionState;
BSS s16 gMapTransitionStateTime;
BSS s16 gLoadedFromFileSelect;

void set_map_change_fade_rate(s16 fadeRate) {
gMapTransitionFadeRate = fadeRate;
Expand Down
3 changes: 2 additions & 1 deletion src/7B440.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ s32 PlayerRunStateTime;
f32 PlayerNormalYaw;
f32 PlayerNormalPitch;
PlayerSpinState gPlayerSpinState;
static s32 PlayerYInterpUpdateDelay;

BSS s32 PlayerYInterpUpdateDelay;

void update_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Expand Down
3 changes: 2 additions & 1 deletion src/7E9D0.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ void* D_8010C924;
s32 D_8010C92C;
s32 D_8010C964;
s32 gSpinHistoryBufferPos;
static s16 D_8010C9B0;
s32 gSpinHistoryPosY[5];
s32 gSpinHistoryPosX[5];
s32 gSpinHistoryPosZ[5];
s16 gSpinHistoryPosAngle[5];

BSS s16 D_8010C9B0;

void func_800E5520(void) {
D_8010C9B0 = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/891b0_len_fb0.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ s32 D_801094A8 = 0;
s16 D_801094AC = 4;
s16 D_801094AE = 4;

static s32 D_8010CFF0;
static s32 D_8010CFF4;
BSS s32 D_8010CFF0;
BSS s32 D_8010CFF4;

void func_800EFD00(void) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/8a160_len_700.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct Unk8a160Outer {
/* 0x00 */ Unk8a160 subs[57]; // one base + 56 others?
} Unk8a160Outer;

static Unk8a160Outer D_8010D000[1];
BSS Unk8a160Outer D_8010D000[1];

void func_800F0CB0(s32 arg0, f32 x, f32 y, f32 scale) {
Unk8a160Outer* outer = &D_8010D000[arg0];
Expand Down
80 changes: 40 additions & 40 deletions src/8a860_len_3f30.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,46 +79,46 @@ s16 PopupContentScissorWidths[] = {
};
#endif

static s32 gPopupState;
static s32 D_8010D644;
static s32 PopupMenu_SelectedIndex;
static s32 PopupMenu_PrevSelectedIndex;
static s32 PopupMenu_Alpha;
static s8 PopupMenu_FirstDisplayIndex;
static s8 PopupMenu_LastDisplayIndex;
static s8 PopupMenu_DisplayedEntryCount;
static s16 D_8010D658;
static s16 D_8010D65A;
static s32 PopupMenu_EmptybarHEID;
static s32 PopupMenu_TitleIconHEID;
static s32 PopupMenu_TimesHEID;
static s32 PopupMenu_PartnerLevelHEID;
static s32 PopupMenu_CursorHEID;
static s32 PopupMenu_UpArrowHEID;
static s32 PopupMenu_DownArrowHEID;
static s32 PopupMenu_EntryIconHEID;
static s16 D_8010D67C;
static s16 D_8010D67E;
static s16 D_8010D680;
static s16 D_8010D682;
static s16 D_8010D684;
static s16 D_8010D686;
static s16 PopupMenu_StarPieceCounterPosX;
static s16 PopupMenu_StarPieceCounterPosY;
static s16 D_8010D68C;
static s8 PopupNotBattle;
static s8 PopupMenu_MaxDisplayableEntryCount;
static s8 D_8010D690;
static s8 D_8010D691;
static s8 D_8010D692;
static s8 D_8010D693;
static s32 gPopupWorker;
static s8 PopupNotDipping;
static s8 PopupDipMode;
static s8 PopupMenu_WasStatusBarIgnoringChanges;
static PopupMenu* gPopupMenu;
static MessagePrintState* D_8010D6A0;
static s32 D_8010D6A4;
BSS s32 gPopupState;
BSS s32 D_8010D644;
BSS s32 PopupMenu_SelectedIndex;
BSS s32 PopupMenu_PrevSelectedIndex;
BSS s32 PopupMenu_Alpha;
BSS s8 PopupMenu_FirstDisplayIndex;
BSS s8 PopupMenu_LastDisplayIndex;
BSS s8 PopupMenu_DisplayedEntryCount;
BSS s16 D_8010D658;
BSS s16 D_8010D65A;
BSS s32 PopupMenu_EmptybarHEID;
BSS s32 PopupMenu_TitleIconHEID;
BSS s32 PopupMenu_TimesHEID;
BSS s32 PopupMenu_PartnerLevelHEID;
BSS s32 PopupMenu_CursorHEID;
BSS s32 PopupMenu_UpArrowHEID;
BSS s32 PopupMenu_DownArrowHEID;
BSS s32 PopupMenu_EntryIconHEID;
BSS s16 D_8010D67C;
BSS s16 D_8010D67E;
BSS s16 D_8010D680;
BSS s16 D_8010D682;
BSS s16 D_8010D684;
BSS s16 D_8010D686;
BSS s16 PopupMenu_StarPieceCounterPosX;
BSS s16 PopupMenu_StarPieceCounterPosY;
BSS s16 D_8010D68C;
BSS s8 PopupNotBattle;
BSS s8 PopupMenu_MaxDisplayableEntryCount;
BSS s8 D_8010D690;
BSS s8 D_8010D691;
BSS s8 D_8010D692;
BSS s8 D_8010D693;
BSS s32 gPopupWorker;
BSS s8 PopupNotDipping;
BSS s8 PopupDipMode;
BSS s8 PopupMenu_WasStatusBarIgnoringChanges;
BSS PopupMenu* gPopupMenu;
BSS MessagePrintState* D_8010D6A0;
BSS s32 D_8010D6A4;

s8 status_bar_is_ignoring_changes(void);

Expand Down
38 changes: 19 additions & 19 deletions src/animator.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ typedef DisplayListBufferHandle AnimatedMeshVertexCopyList[0x60];

s32 gAnimCount;

static AnimatedMeshVertexCopyList D_801533C0;
static AnimatedMeshVertexCopyList D_801536C0;
static AnimatedMeshList D_801539C0;
static AnimatedMeshList D_80153A00;
static AnimatedMeshList* gCurrentAnimMeshListPtr;
static s32 gAnimModelFogEnabled;
static s32 gAnimModelFogR;
static s32 gAnimModelFogG;
static s32 gAnimModelFogB;
static s32 gAnimModelFogA;
static s32 gAnimModelFogStart;
static s32 gAnimModelFogEnd;
static s32 gAnimVtxSegment;
static s32 D_80153A64;
static Matrix4f gAnimRotMtx;
static Matrix4f gAnimScaleMtx;
static Matrix4f gAnimTranslateMtx;
static Matrix4f gAnimRotScaleMtx;
static StaticAnimatorNode** gAnimTreeRoot;
BSS AnimatedMeshVertexCopyList D_801533C0;
BSS AnimatedMeshVertexCopyList D_801536C0;
BSS AnimatedMeshList D_801539C0;
BSS AnimatedMeshList D_80153A00;
BSS AnimatedMeshList* gCurrentAnimMeshListPtr;
BSS s32 gAnimModelFogEnabled;
BSS s32 gAnimModelFogR;
BSS s32 gAnimModelFogG;
BSS s32 gAnimModelFogB;
BSS s32 gAnimModelFogA;
BSS s32 gAnimModelFogStart;
BSS s32 gAnimModelFogEnd;
BSS s32 gAnimVtxSegment;
BSS s32 D_80153A64;
BSS Matrix4f gAnimRotMtx;
BSS Matrix4f gAnimScaleMtx;
BSS Matrix4f gAnimTranslateMtx;
BSS Matrix4f gAnimRotScaleMtx;
BSS StaticAnimatorNode** gAnimTreeRoot;

extern Gfx Gfx_RM1_SURFACE_OPA[];
extern Gfx Gfx_RM1_DECAL_OPA[];
Expand Down
32 changes: 16 additions & 16 deletions src/audio/25f00_len_940.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ u32 nuAuFrameCounter = 0;
u8 nuAuTaskStop = NU_AU_TASK_RUN;
u8 volatile AuSynUseStereo = TRUE;

static u16 AuInitialGlobalVolume;
static OSThread nuAuMgrThread;
static char D_800A1108[0x408];
static u64 AuStack[NU_AU_STACK_SIZE / sizeof(u64)];
static Acmd* AlCmdListBuffers[3];
static NUScTask nuAuTasks[3];
static u8* D_800A3628[3];
static s32 AlFrameSize;
static s32 AlMinFrameSize;
static s32 D_800A363C;
static OSMesgQueue nuAuDmaMesgQ;
static OSMesg nuAuDmaMesgBuf[50];
static OSIoMesg nuAuDmaIOMesgBuf[50];
static NUDMAState nuAuDmaState;
static s32 D_800A3BDC;
static NUDMABuffer nuAuDmaBufList[50];
BSS u16 AuInitialGlobalVolume;
BSS OSThread nuAuMgrThread;
BSS char D_800A1108[0x408];
BSS u64 AuStack[NU_AU_STACK_SIZE / sizeof(u64)];
BSS Acmd* AlCmdListBuffers[3];
BSS NUScTask nuAuTasks[3];
BSS u8* D_800A3628[3];
BSS s32 AlFrameSize;
BSS s32 AlMinFrameSize;
BSS s32 D_800A363C;
BSS OSMesgQueue nuAuDmaMesgQ;
BSS OSMesg nuAuDmaMesgBuf[50];
BSS OSIoMesg nuAuDmaIOMesgBuf[50];
BSS NUDMAState nuAuDmaState;
BSS s32 D_800A3BDC;
BSS NUDMABuffer nuAuDmaBufList[50];

ALHeap nuAuHeap;
AuSynDriver auSynDriver;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/28910_len_5090.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "audio.h"

static void (*CurrentSeqCmdHandler)(BGMPlayer*, BGMPlayerTrack*);
BSS void (*CurrentSeqCmdHandler)(BGMPlayer*, BGMPlayerTrack*);

extern u8 EnvelopeReleaseDefaultFast[];
extern u8 BgmDivisors[8];
Expand Down
12 changes: 6 additions & 6 deletions src/audio/31650.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

static s16 _getVol(s16 arg0, s32 arg1, s16 arg2, u16 arg3);

static s16* AuDelayBufferMain;
static s16* AuDelayBufferAux;
static s32 AuDelayCounter;
static u8 AuDelayedVoiceGroup;
static s16 AuDelayedChannel;
static s32 AuDelayCount;
BSS s16* AuDelayBufferMain;
BSS s16* AuDelayBufferAux;
BSS s32 AuDelayCounter;
BSS u8 AuDelayedVoiceGroup;
BSS s16 AuDelayedChannel;
BSS s32 AuDelayCount;

AuSynDriver* gActiveSynDriverPtr = NULL;
AuSynDriver* gSynDriverPtr = NULL;
Expand Down
9 changes: 5 additions & 4 deletions src/audio/e0b30_len_b80.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
void bgm_update_volume(void);
void bgm_set_target_volume(s16 volume);

static s16 MusicDefaultVolume;
static s16 MusicTargetVolume;
static s16 MusicMaxVolume;
static s16 MusicCurrentVolume;
BSS s16 MusicDefaultVolume;
BSS s16 MusicTargetVolume;
BSS s16 MusicMaxVolume;
BSS s16 MusicCurrentVolume;

MusicSettings gMusicSettings[2];

MusicSettings BlankMusicSettings = {
Expand Down
8 changes: 4 additions & 4 deletions src/audio/sfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ s32 OpenCloseSounds[][2] = {
{ SOUND_CREAKY_WINDOW_OPEN, SOUND_CREAKY_WINDOW_CLOSE },
};

static SoundInstance wEnvSounds[MAX_SOUND_INSTANCES];
static SoundInstance bEnvSounds[MAX_SOUND_INSTANCES];
static SoundInstance* gCurrentEnvSounds;
static s32 SfxReverbMode;
BSS SoundInstance wEnvSounds[MAX_SOUND_INSTANCES];
BSS SoundInstance bEnvSounds[MAX_SOUND_INSTANCES];
BSS SoundInstance* gCurrentEnvSounds;
BSS s32 SfxReverbMode;

void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) {
s32 screenX, screenY, screenZ;
Expand Down
8 changes: 4 additions & 4 deletions src/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ s8 gBackroundWaveEnabled = FALSE;
s16 gBackroundTextureYOffset = 0;
f32 gBackroundWavePhase = 0.0f;

static PAL_BIN gBackgroundPalette[256];
static f32 gBackroundLastScrollValue;
static s32 D_801595A4[3];
BSS PAL_BIN gBackgroundPalette[256];
BSS f32 gBackroundLastScrollValue;
BSS s32 D_801595A4[3];
#if !VERSION_PAL
static s32 D_801595AC;
BSS s32 D_801595AC;
#endif

void load_map_bg(char* optAssetName) {
Expand Down
12 changes: 6 additions & 6 deletions src/cam_mode_zone_interp.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "common.h"

static CamConfiguration gCurrentCamConfiguration;
static f32 D_800A08DC;
static f32 D_800A08E0;
static f32 D_800A08E4;
static f32 D_800A08E8;
static f32 D_800A08EC;
BSS CamConfiguration gCurrentCamConfiguration;
BSS f32 D_800A08DC;
BSS f32 D_800A08E0;
BSS f32 D_800A08E4;
BSS f32 D_800A08E8;
BSS f32 D_800A08EC;

void cam_interp_lookat_pos(Camera* camera, f32 arg1, f32 arg2, s16 arg3);
void func_8003034C(Camera* camera);
Expand Down
30 changes: 15 additions & 15 deletions src/collision.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ typedef struct HitAssetCollider {
CollisionData gCollisionData;
CollisionData gZoneCollisionData;

static f32 gCollisionRayStartX;
static f32 gCollisionRayStartY;
static f32 gCollisionRayStartZ;
static f32 gCollisionRayDirX;
static f32 gCollisionRayDirY;
static f32 gCollisionRayDirZ;
static f32 gCollisionPointX;
static f32 gCollisionPointY;
static f32 gCollisionPointZ;
static f32 gCollisionRayLength;
static f32 gCollisionNormalX;
static f32 gCollisionNormalY;
static f32 gCollisionNormalZ;
static ColliderBackupEntry* gCollisionDataBackup;
static ColliderBackupEntry* gCollisionDataZoneBackup;
BSS f32 gCollisionRayStartX;
BSS f32 gCollisionRayStartY;
BSS f32 gCollisionRayStartZ;
BSS f32 gCollisionRayDirX;
BSS f32 gCollisionRayDirY;
BSS f32 gCollisionRayDirZ;
BSS f32 gCollisionPointX;
BSS f32 gCollisionPointY;
BSS f32 gCollisionPointZ;
BSS f32 gCollisionRayLength;
BSS f32 gCollisionNormalX;
BSS f32 gCollisionNormalY;
BSS f32 gCollisionNormalZ;
BSS ColliderBackupEntry* gCollisionDataBackup;
BSS ColliderBackupEntry* gCollisionDataZoneBackup;

extern Vec3s gEntityColliderFaces[];
extern Vec3f gEntityColliderNormals[];
Expand Down
2 changes: 1 addition & 1 deletion src/crash_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef struct {
/* 0x9D2 */ u16 height;
} CrashScreen; // size = 0x9D4

static CrashScreen gCrashScreen;
BSS CrashScreen gCrashScreen;

u8 gCrashScreencharToGlyph[128] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Expand Down
12 changes: 6 additions & 6 deletions src/curtains.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ Gfx NoControllerGfx[] = {
gsSPEndDisplayList(),
};

static f32 gCurtainScale;
static f32 gCurtainScaleGoal;
static f32 gCurtainFade;
static f32 gCurtainFadeGoal;
static UNK_FUN_PTR(gCurtainDrawCallback);
static Mtx D_8009BAA8[2];
BSS f32 gCurtainScale;
BSS f32 gCurtainScaleGoal;
BSS f32 gCurtainFade;
BSS f32 gCurtainFadeGoal;
BSS UNK_FUN_PTR(gCurtainDrawCallback);
BSS Mtx D_8009BAA8[2];

void initialize_curtains(void) {
gCurtainDrawCallback = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/draw_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct DefaultWindowStyle {
} DefaultWindowStyle; // size = 0x0B

#define BOX_QUAD_BUFFER_NUM 21
static Vtx gBoxQuadBuffer[BOX_QUAD_BUFFER_NUM][16];
BSS Vtx gBoxQuadBuffer[BOX_QUAD_BUFFER_NUM][16];

DefaultWindowStyle gBoxDefaultStyles[] = {
{
Expand Down
Loading

0 comments on commit 6ff124b

Please sign in to comment.