Fix inconsistent static s/g names

This commit is contained in:
GriffinR 2022-05-17 13:51:54 -04:00
parent ef4d99c87e
commit 593e2c9be0
42 changed files with 528 additions and 534 deletions

View File

@ -12,7 +12,7 @@ MysteryGiftScript_AlteringCave_:
release release
end end
sText_MysteryGiftAlteringCave:: sText_MysteryGiftAlteringCave:
.string "Thank you for using the MYSTERY\n" .string "Thank you for using the MYSTERY\n"
.string "GIFT System.\p" .string "GIFT System.\p"
.string "There appears to be a rumor about\n" .string "There appears to be a rumor about\n"

View File

@ -3,7 +3,7 @@ gBirchDexRatingText_AreYouCurious::
.string "Are you curious about how your\n" .string "Are you curious about how your\n"
.string "POKéDEX is coming along?$" .string "POKéDEX is coming along?$"
gBirchDexRatingText_Cancel: gBirchDexRatingText_Cancel::
.string "Hm? Oh, you haven't caught enough\n" .string "Hm? Oh, you haven't caught enough\n"
.string "POKéMON to make it worthwhile.$" .string "POKéMON to make it worthwhile.$"

View File

@ -319,7 +319,7 @@
#define B_WIN_TYPE_NORMAL 0 #define B_WIN_TYPE_NORMAL 0
#define B_WIN_TYPE_ARENA 1 #define B_WIN_TYPE_ARENA 1
// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates // Window Ids for sStandardBattleWindowTemplates / sBattleArenaWindowTemplates
#define B_WIN_MSG 0 #define B_WIN_MSG 0
#define B_WIN_ACTION_PROMPT 1 // "What will {x} do?" #define B_WIN_ACTION_PROMPT 1 // "What will {x} do?"
#define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu #define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu

View File

@ -1634,7 +1634,7 @@
#define FLAGS_COUNT (DAILY_FLAGS_END + 1) #define FLAGS_COUNT (DAILY_FLAGS_END + 1)
// Special Flags (Stored in EWRAM (gSpecialFlags), not in the SaveBlock) // Special Flags (Stored in EWRAM (sSpecialFlags), not in the SaveBlock)
#define SPECIAL_FLAGS_START 0x4000 #define SPECIAL_FLAGS_START 0x4000
#define FLAG_HIDE_MAP_NAME_POPUP (SPECIAL_FLAGS_START + 0x0) #define FLAG_HIDE_MAP_NAME_POPUP (SPECIAL_FLAGS_START + 0x0)
#define FLAG_DONT_TRANSITION_MUSIC (SPECIAL_FLAGS_START + 0x1) #define FLAG_DONT_TRANSITION_MUSIC (SPECIAL_FLAGS_START + 0x1)

View File

@ -324,7 +324,6 @@ extern u16 gSpecialVar_ContestRank;
extern u8 gNumLinkContestPlayers; extern u8 gNumLinkContestPlayers;
extern u8 gHighestRibbonRank; extern u8 gHighestRibbonRank;
extern struct ContestResources *gContestResources; extern struct ContestResources *gContestResources;
extern u8 sContestBgCopyFlags;
extern struct ContestWinner gCurContestWinner; extern struct ContestWinner gCurContestWinner;
extern u8 gCurContestWinnerIsForArtist; extern u8 gCurContestWinnerIsForArtist;
extern u8 gCurContestWinnerSaveIdx; extern u8 gCurContestWinnerSaveIdx;

View File

@ -3,7 +3,7 @@
static const char AgbLibFlashVersion[] = "FLASH1M_V103"; static const char AgbLibFlashVersion[] = "FLASH1M_V103";
const struct FlashSetupInfo * const sSetupInfos[] = static const struct FlashSetupInfo * const sSetupInfos[] =
{ {
&MX29L010, &MX29L010,
&LE26FV10N1TS, &LE26FV10N1TS,

View File

@ -15,7 +15,7 @@ static void AnimOverheatFlame_Step(struct Sprite *);
static void AnimTask_DragonDanceWaver_Step(u8); static void AnimTask_DragonDanceWaver_Step(u8);
static void UpdateDragonDanceScanlineEffect(struct Task *); static void UpdateDragonDanceScanlineEffect(struct Task *);
EWRAM_DATA static u16 gUnusedOverheatData[7] = {0}; EWRAM_DATA static u16 sUnusedOverheatData[7] = {0};
static const union AnimCmd sAnim_OutrageOverheatFire_0[] = static const union AnimCmd sAnim_OutrageOverheatFire_0[] =
{ {
@ -426,7 +426,7 @@ static void AnimOverheatFlame(struct Sprite *sprite)
sprite->data[3] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[3];
sprite->callback = AnimOverheatFlame_Step; sprite->callback = AnimOverheatFlame_Step;
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
gUnusedOverheatData[i] = sprite->data[i]; sUnusedOverheatData[i] = sprite->data[i];
} }
static void AnimOverheatFlame_Step(struct Sprite *sprite) static void AnimOverheatFlame_Step(struct Sprite *sprite)

View File

@ -248,7 +248,7 @@ static const struct SubspriteTable sFrozenIceCubeSubspriteTable[] =
{ARRAY_COUNT(sFrozenIceCubeSubsprites), sFrozenIceCubeSubsprites}, {ARRAY_COUNT(sFrozenIceCubeSubsprites), sFrozenIceCubeSubsprites},
}; };
static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate = static const struct SpriteTemplate sFrozenIceCubeSpriteTemplate =
{ {
.tileTag = ANIM_TAG_ICE_CUBE, .tileTag = ANIM_TAG_ICE_CUBE,
.paletteTag = ANIM_TAG_ICE_CUBE, .paletteTag = ANIM_TAG_ICE_CUBE,
@ -389,7 +389,7 @@ void AnimTask_FrozenIceCube(u8 taskId)
x -= 6; x -= 6;
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
spriteId = CreateSprite(&gFrozenIceCubeSpriteTemplate, x, y, 4); spriteId = CreateSprite(&sFrozenIceCubeSpriteTemplate, x, y, 4);
if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF) if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF)
gSprites[spriteId].invisible = TRUE; gSprites[spriteId].invisible = TRUE;
SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable); SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable);

View File

@ -159,7 +159,7 @@ const struct BgTemplate gBattleBgTemplates[] =
}, },
}; };
static const struct WindowTemplate gStandardBattleWindowTemplates[] = static const struct WindowTemplate sStandardBattleWindowTemplates[] =
{ {
[B_WIN_MSG] = { [B_WIN_MSG] = {
.bg = 0, .bg = 0,
@ -380,7 +380,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
DUMMY_WIN_TEMPLATE DUMMY_WIN_TEMPLATE
}; };
static const struct WindowTemplate gBattleArenaWindowTemplates[] = static const struct WindowTemplate sBattleArenaWindowTemplates[] =
{ {
[B_WIN_MSG] = { [B_WIN_MSG] = {
.bg = 0, .bg = 0,
@ -594,8 +594,8 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
const struct WindowTemplate * const gBattleWindowTemplates[] = const struct WindowTemplate * const gBattleWindowTemplates[] =
{ {
[B_WIN_TYPE_NORMAL] = gStandardBattleWindowTemplates, [B_WIN_TYPE_NORMAL] = sStandardBattleWindowTemplates,
[B_WIN_TYPE_ARENA] = gBattleArenaWindowTemplates, [B_WIN_TYPE_ARENA] = sBattleArenaWindowTemplates,
}; };
static const struct BattleBackground sBattleTerrainTable[] = static const struct BattleBackground sBattleTerrainTable[] =

View File

@ -687,7 +687,7 @@ struct
{ {
u32 facilityClass; u32 facilityClass;
const u8 *const *strings; const u8 *const *strings;
} const sPartnerTrainerTextTables[] = } static const sPartnerTrainerTextTables[] =
{ {
{FACILITY_CLASS_LASS, sPartnerTextsLass}, {FACILITY_CLASS_LASS, sPartnerTextsLass},
{FACILITY_CLASS_YOUNGSTER, sPartnerTextsYoungster}, {FACILITY_CLASS_YOUNGSTER, sPartnerTextsYoungster},
@ -769,7 +769,7 @@ struct
u8 nature; u8 nature;
u8 evs[NUM_STATS]; u8 evs[NUM_STATS];
u16 moves[MAX_MON_MOVES]; u16 moves[MAX_MON_MOVES];
} const sStevenMons[MULTI_PARTY_SIZE] = } static const sStevenMons[MULTI_PARTY_SIZE] =
{ {
{ {
.species = SPECIES_METANG, .species = SPECIES_METANG,

View File

@ -8,7 +8,7 @@
#include "international_string_util.h" #include "international_string_util.h"
#include "constants/coins.h" #include "constants/coins.h"
EWRAM_DATA u8 sCoinsWindowId = 0; static EWRAM_DATA u8 sCoinsWindowId = 0;
void PrintCoinsString(u32 coinAmount) void PrintCoinsString(u32 coinAmount)
{ {

View File

@ -352,7 +352,7 @@ EWRAM_DATA u16 gSpecialVar_ContestRank = 0;
EWRAM_DATA u8 gNumLinkContestPlayers = 0; EWRAM_DATA u8 gNumLinkContestPlayers = 0;
EWRAM_DATA u8 gHighestRibbonRank = 0; EWRAM_DATA u8 gHighestRibbonRank = 0;
EWRAM_DATA struct ContestResources *gContestResources = NULL; EWRAM_DATA struct ContestResources *gContestResources = NULL;
EWRAM_DATA u8 sContestBgCopyFlags = 0; static EWRAM_DATA u8 sContestBgCopyFlags = 0;
EWRAM_DATA struct ContestWinner gCurContestWinner = {0}; EWRAM_DATA struct ContestWinner gCurContestWinner = {0};
EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0; EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0;
EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0; EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0;
@ -625,7 +625,7 @@ static const struct SpriteTemplate sSpriteTemplate_ApplauseMeter =
.callback = SpriteCallbackDummy .callback = SpriteCallbackDummy
}; };
const struct OamData sOam_Judge = static const struct OamData sOam_Judge =
{ {
.y = 0, .y = 0,
.affineMode = ST_OAM_AFFINE_OFF, .affineMode = ST_OAM_AFFINE_OFF,
@ -639,7 +639,7 @@ const struct OamData sOam_Judge =
.paletteNum = 2, .paletteNum = 2,
}; };
const struct SpriteTemplate sSpriteTemplate_Judge = static const struct SpriteTemplate sSpriteTemplate_Judge =
{ {
.tileTag = TAG_JUDGE, .tileTag = TAG_JUDGE,
.paletteTag = TAG_JUDGE, .paletteTag = TAG_JUDGE,
@ -650,7 +650,7 @@ const struct SpriteTemplate sSpriteTemplate_Judge =
.callback = SpriteCallbackDummy .callback = SpriteCallbackDummy
}; };
const struct CompressedSpriteSheet sSpriteSheet_Judge = static const struct CompressedSpriteSheet sSpriteSheet_Judge =
{ {
.data = gContestJudgeGfx, .data = gContestJudgeGfx,
.size = 0x800, .size = 0x800,
@ -664,13 +664,13 @@ static const struct CompressedSpriteSheet sSpriteSheet_JudgeSymbols =
.tag = TAG_JUDGE_SYMBOLS_GFX .tag = TAG_JUDGE_SYMBOLS_GFX
}; };
const struct CompressedSpritePalette sSpritePalette_JudgeSymbols = static const struct CompressedSpritePalette sSpritePalette_JudgeSymbols =
{ {
.data = gContestJudgeSymbolsPal, .data = gContestJudgeSymbolsPal,
.tag = TAG_CONTEST_SYMBOLS_PAL .tag = TAG_CONTEST_SYMBOLS_PAL
}; };
const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble = static const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble =
{ {
.tileTag = TAG_JUDGE_SYMBOLS_GFX, .tileTag = TAG_JUDGE_SYMBOLS_GFX,
.paletteTag = TAG_CONTEST_SYMBOLS_PAL, .paletteTag = TAG_CONTEST_SYMBOLS_PAL,
@ -876,7 +876,7 @@ static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CON
} }
}; };
const struct OamData sOam_ContestantsTurnBlinkEffect = static const struct OamData sOam_ContestantsTurnBlinkEffect =
{ {
.y = 0, .y = 0,
.affineMode = ST_OAM_AFFINE_DOUBLE, .affineMode = ST_OAM_AFFINE_DOUBLE,
@ -891,13 +891,13 @@ const struct OamData sOam_ContestantsTurnBlinkEffect =
.affineParam = 0, .affineParam = 0,
}; };
const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] = static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] =
{ {
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
AFFINEANIMCMD_END AFFINEANIMCMD_END
}; };
const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] =
{ {
AFFINEANIMCMD_FRAME(3, 3, 0, 15), AFFINEANIMCMD_FRAME(3, 3, 0, 15),
AFFINEANIMCMD_FRAME(-3, -3, 0, 15), AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
@ -906,13 +906,13 @@ const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] =
AFFINEANIMCMD_END AFFINEANIMCMD_END
}; };
const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] = static const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] =
{ {
sAffineAnim_ContestantsTurnBlinkEffect_0, sAffineAnim_ContestantsTurnBlinkEffect_0,
sAffineAnim_ContestantsTurnBlinkEffect_1 sAffineAnim_ContestantsTurnBlinkEffect_1
}; };
const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = static const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] =
{ {
{ {
.tileTag = TAG_BLINK_EFFECT_CONTESTANT0, .tileTag = TAG_BLINK_EFFECT_CONTESTANT0,
@ -952,7 +952,7 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA
} }
}; };
static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] = static const s8 sContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] =
{ {
[CONTEST_CATEGORY_COOL] = { [CONTEST_CATEGORY_COOL] = {
[CONTEST_CATEGORY_COOL] = +1, [CONTEST_CATEGORY_COOL] = +1,
@ -4744,7 +4744,7 @@ static void UpdateApplauseMeter(void)
s8 Contest_GetMoveExcitement(u16 move) s8 Contest_GetMoveExcitement(u16 move)
{ {
return gContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory]; return sContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory];
} }
static u8 StartApplauseOverflowAnimation(void) static u8 StartApplauseOverflowAnimation(void)

View File

@ -1272,7 +1272,7 @@ static const union AnimCmd *const sAnimTable_RayquazaSpotlightEffect[] = {
sAnim_RayquazaSpotlightEffect, sAnim_RayquazaSpotlightEffect,
}; };
const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { static const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = {
overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0), overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0),
}; };

View File

@ -174,10 +174,10 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText =
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}; };
static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal");
static const struct SpritePalette gSpritePalette_TradeScreenText = static const struct SpritePalette sSpritePalette_TradeScreenText =
{ {
.data = TradeScreenTextPalette, .data = sTradeScreenTextPalette,
.tag = PALTAG_MENU_TEXT .tag = PALTAG_MENU_TEXT
}; };

View File

@ -1,4 +1,4 @@
static const union AnimCmd gAnimCmd_Brendan_1[] = static const union AnimCmd sAnimCmd_Brendan_1[] =
{ {
ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(0, 24),
ANIMCMD_FRAME(1, 9), ANIMCMD_FRAME(1, 9),
@ -8,7 +8,7 @@ static const union AnimCmd gAnimCmd_Brendan_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_May_Steven_1[] = static const union AnimCmd sAnimCmd_May_Steven_1[] =
{ {
ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(0, 24),
ANIMCMD_FRAME(1, 9), ANIMCMD_FRAME(1, 9),
@ -18,7 +18,7 @@ static const union AnimCmd gAnimCmd_May_Steven_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_Wally_1[] = static const union AnimCmd sAnimCmd_Wally_1[] =
{ {
ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(0, 24),
ANIMCMD_FRAME(1, 9), ANIMCMD_FRAME(1, 9),
@ -28,7 +28,7 @@ static const union AnimCmd gAnimCmd_Wally_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_Red_1[] = static const union AnimCmd sAnimCmd_Red_1[] =
{ {
ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(1, 20),
ANIMCMD_FRAME(2, 6), ANIMCMD_FRAME(2, 6),
@ -38,7 +38,7 @@ static const union AnimCmd gAnimCmd_Red_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_Leaf_1[] = static const union AnimCmd sAnimCmd_Leaf_1[] =
{ {
ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(1, 20),
ANIMCMD_FRAME(2, 6), ANIMCMD_FRAME(2, 6),
@ -48,7 +48,7 @@ static const union AnimCmd gAnimCmd_Leaf_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] = static const union AnimCmd sAnimCmd_RubySapphireBrendan_1[] =
{ {
ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(0, 24),
ANIMCMD_FRAME(1, 9), ANIMCMD_FRAME(1, 9),
@ -58,7 +58,7 @@ static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] =
ANIMCMD_END, ANIMCMD_END,
}; };
static const union AnimCmd gAnimCmd_RubySapphireMay_1[] = static const union AnimCmd sAnimCmd_RubySapphireMay_1[] =
{ {
ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(0, 24),
ANIMCMD_FRAME(1, 9), ANIMCMD_FRAME(1, 9),
@ -71,49 +71,49 @@ static const union AnimCmd gAnimCmd_RubySapphireMay_1[] =
static const union AnimCmd *const sBackAnims_Brendan[] = static const union AnimCmd *const sBackAnims_Brendan[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_Brendan_1, sAnimCmd_Brendan_1,
}; };
static const union AnimCmd *const sBackAnims_May[] = static const union AnimCmd *const sBackAnims_May[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_May_Steven_1, sAnimCmd_May_Steven_1,
}; };
static const union AnimCmd *const sBackAnims_Red[] = static const union AnimCmd *const sBackAnims_Red[] =
{ {
sAnim_GeneralFrame0, sAnim_GeneralFrame0,
gAnimCmd_Red_1, sAnimCmd_Red_1,
}; };
static const union AnimCmd *const sBackAnims_Leaf[] = static const union AnimCmd *const sBackAnims_Leaf[] =
{ {
sAnim_GeneralFrame0, sAnim_GeneralFrame0,
gAnimCmd_Leaf_1, sAnimCmd_Leaf_1,
}; };
static const union AnimCmd *const sBackAnims_RubySapphireBrendan[] = static const union AnimCmd *const sBackAnims_RubySapphireBrendan[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_RubySapphireBrendan_1, sAnimCmd_RubySapphireBrendan_1,
}; };
static const union AnimCmd *const sBackAnims_RubySapphireMay[] = static const union AnimCmd *const sBackAnims_RubySapphireMay[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_RubySapphireMay_1, sAnimCmd_RubySapphireMay_1,
}; };
static const union AnimCmd *const sBackAnims_Wally[] = static const union AnimCmd *const sBackAnims_Wally[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_Wally_1, sAnimCmd_Wally_1,
}; };
static const union AnimCmd *const sBackAnims_Steven[] = static const union AnimCmd *const sBackAnims_Steven[] =
{ {
sAnim_GeneralFrame3, sAnim_GeneralFrame3,
gAnimCmd_May_Steven_1, sAnimCmd_May_Steven_1,
}; };
const union AnimCmd *const *const gTrainerBackAnimsPtrTable[] = const union AnimCmd *const *const gTrainerBackAnimsPtrTable[] =

View File

@ -4546,7 +4546,7 @@ struct
{ {
u8 id; u8 id;
void (*func)(void); void (*func)(void);
} const sGfxFuncs[] = } static const sGfxFuncs[] =
{ {
{GFXFUNC_LOAD, LoadGfx}, // Element not used, LoadGfx is passed directly to SetGfxFunc {GFXFUNC_LOAD, LoadGfx}, // Element not used, LoadGfx is passed directly to SetGfxFunc
{GFXFUNC_SHOW_NAMES, ShowNames}, {GFXFUNC_SHOW_NAMES, ShowNames},

View File

@ -30,7 +30,7 @@ EWRAM_DATA u16 gSpecialVar_Facing = 0;
EWRAM_DATA u16 gSpecialVar_MonBoxId = 0; EWRAM_DATA u16 gSpecialVar_MonBoxId = 0;
EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0;
EWRAM_DATA u16 gSpecialVar_Unused_0x8014 = 0; EWRAM_DATA u16 gSpecialVar_Unused_0x8014 = 0;
EWRAM_DATA static u8 gSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0};
extern u16 *const gSpecialVars[]; extern u16 *const gSpecialVars[];
@ -38,7 +38,7 @@ void InitEventData(void)
{ {
memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags)); memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags));
memset(gSaveBlock1Ptr->vars, 0, sizeof(gSaveBlock1Ptr->vars)); memset(gSaveBlock1Ptr->vars, 0, sizeof(gSaveBlock1Ptr->vars));
memset(gSpecialFlags, 0, sizeof(gSpecialFlags)); memset(sSpecialFlags, 0, sizeof(sSpecialFlags));
} }
void ClearTempFieldEventData(void) void ClearTempFieldEventData(void)
@ -205,7 +205,7 @@ u8 *GetFlagPointer(u16 id)
else if (id < SPECIAL_FLAGS_START) else if (id < SPECIAL_FLAGS_START)
return &gSaveBlock1Ptr->flags[id / 8]; return &gSaveBlock1Ptr->flags[id / 8];
else else
return &gSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; return &sSpecialFlags[(id - SPECIAL_FLAGS_START) / 8];
} }
u8 FlagSet(u16 id) u8 FlagSet(u16 id)

View File

@ -481,13 +481,13 @@ static const struct Subsprite sSubsprites_HofMonitorBig[] =
static const struct SubspriteTable sSubspriteTable_HofMonitorBig = subsprite_table(sSubsprites_HofMonitorBig); static const struct SubspriteTable sSubspriteTable_HofMonitorBig = subsprite_table(sSubsprites_HofMonitorBig);
const union AnimCmd sAnim_Static[] = static const union AnimCmd sAnim_Static[] =
{ {
ANIMCMD_FRAME(.imageValue = 0, .duration = 1), ANIMCMD_FRAME(.imageValue = 0, .duration = 1),
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
const union AnimCmd sAnim_Flicker[] = static const union AnimCmd sAnim_Flicker[] =
{ {
ANIMCMD_FRAME(.imageValue = 0, .duration = 16), ANIMCMD_FRAME(.imageValue = 0, .duration = 16),
ANIMCMD_FRAME(.imageValue = 1, .duration = 16), ANIMCMD_FRAME(.imageValue = 1, .duration = 16),
@ -501,7 +501,7 @@ const union AnimCmd sAnim_Flicker[] =
}; };
// Flicker on and off, for the Pokéballs / monitors during the PokéCenter heal effect // Flicker on and off, for the Pokéballs / monitors during the PokéCenter heal effect
const union AnimCmd *const sAnims_Flicker[] = static const union AnimCmd *const sAnims_Flicker[] =
{ {
sAnim_Static, sAnim_Static,
sAnim_Flicker sAnim_Flicker
@ -556,7 +556,7 @@ static const struct SpriteTemplate sSpriteTemplate_HofMonitorSmall =
.callback = SpriteCB_HallOfFameMonitor .callback = SpriteCB_HallOfFameMonitor
}; };
void (*const sPokecenterHealEffectFuncs[])(struct Task *) = static void (*const sPokecenterHealEffectFuncs[])(struct Task *) =
{ {
PokecenterHealEffect_Init, PokecenterHealEffect_Init,
PokecenterHealEffect_WaitForBallPlacement, PokecenterHealEffect_WaitForBallPlacement,
@ -564,7 +564,7 @@ void (*const sPokecenterHealEffectFuncs[])(struct Task *) =
PokecenterHealEffect_WaitForSoundAndEnd PokecenterHealEffect_WaitForSoundAndEnd
}; };
void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = static void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) =
{ {
HallOfFameRecordEffect_Init, HallOfFameRecordEffect_Init,
HallOfFameRecordEffect_WaitForBallPlacement, HallOfFameRecordEffect_WaitForBallPlacement,
@ -572,7 +572,7 @@ void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) =
HallOfFameRecordEffect_WaitForSoundAndEnd HallOfFameRecordEffect_WaitForSoundAndEnd
}; };
void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) = static void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) =
{ {
PokeballGlowEffect_PlaceBalls, PokeballGlowEffect_PlaceBalls,
PokeballGlowEffect_TryPlaySe, PokeballGlowEffect_TryPlaySe,
@ -598,7 +598,7 @@ static const u8 sPokeballGlowReds[] = {16, 12, 8, 0};
static const u8 sPokeballGlowGreens[] = {16, 12, 8, 0}; static const u8 sPokeballGlowGreens[] = {16, 12, 8, 0};
static const u8 sPokeballGlowBlues[] = { 0, 0, 0, 0}; static const u8 sPokeballGlowBlues[] = { 0, 0, 0, 0};
bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = static bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) =
{ {
FallWarpEffect_Init, FallWarpEffect_Init,
FallWarpEffect_WaitWeather, FallWarpEffect_WaitWeather,
@ -609,7 +609,7 @@ bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) =
FallWarpEffect_End, FallWarpEffect_End,
}; };
bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = static bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) =
{ {
EscalatorWarpOut_Init, EscalatorWarpOut_Init,
EscalatorWarpOut_WaitForPlayer, EscalatorWarpOut_WaitForPlayer,
@ -619,7 +619,7 @@ bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) =
EscalatorWarpOut_Down_End, EscalatorWarpOut_Down_End,
}; };
bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = static bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) =
{ {
EscalatorWarpIn_Init, EscalatorWarpIn_Init,
EscalatorWarpIn_Down_Init, EscalatorWarpIn_Down_Init,
@ -630,7 +630,7 @@ bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) =
EscalatorWarpIn_End, EscalatorWarpIn_End,
}; };
bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) = static bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) =
{ {
WaterfallFieldEffect_Init, WaterfallFieldEffect_Init,
WaterfallFieldEffect_ShowMon, WaterfallFieldEffect_ShowMon,
@ -639,14 +639,14 @@ bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *)
WaterfallFieldEffect_ContinueRideOrEnd, WaterfallFieldEffect_ContinueRideOrEnd,
}; };
bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) = static bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) =
{ {
DiveFieldEffect_Init, DiveFieldEffect_Init,
DiveFieldEffect_ShowMon, DiveFieldEffect_ShowMon,
DiveFieldEffect_TryWarp, DiveFieldEffect_TryWarp,
}; };
bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = static bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) =
{ {
LavaridgeGymB1FWarpEffect_Init, LavaridgeGymB1FWarpEffect_Init,
LavaridgeGymB1FWarpEffect_CameraShake, LavaridgeGymB1FWarpEffect_CameraShake,
@ -656,7 +656,7 @@ bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEve
LavaridgeGymB1FWarpEffect_Warp, LavaridgeGymB1FWarpEffect_Warp,
}; };
bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = static bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) =
{ {
LavaridgeGymB1FWarpExitEffect_Init, LavaridgeGymB1FWarpExitEffect_Init,
LavaridgeGymB1FWarpExitEffect_StartPopOut, LavaridgeGymB1FWarpExitEffect_StartPopOut,
@ -664,7 +664,7 @@ bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct Objec
LavaridgeGymB1FWarpExitEffect_End, LavaridgeGymB1FWarpExitEffect_End,
}; };
bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = static bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) =
{ {
LavaridgeGym1FWarpEffect_Init, LavaridgeGym1FWarpEffect_Init,
LavaridgeGym1FWarpEffect_AshPuff, LavaridgeGym1FWarpEffect_AshPuff,
@ -673,7 +673,7 @@ bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEven
LavaridgeGym1FWarpEffect_Warp, LavaridgeGym1FWarpEffect_Warp,
}; };
void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) = static void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) =
{ {
EscapeRopeWarpOutEffect_Init, EscapeRopeWarpOutEffect_Init,
EscapeRopeWarpOutEffect_Spin, EscapeRopeWarpOutEffect_Spin,
@ -2277,7 +2277,7 @@ static void EscapeRopeWarpOutEffect_Spin(struct Task *task)
} }
} }
void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = { static void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = {
EscapeRopeWarpInEffect_Init, EscapeRopeWarpInEffect_Init,
EscapeRopeWarpInEffect_Spin EscapeRopeWarpInEffect_Spin
}; };
@ -2448,7 +2448,7 @@ static void FieldCallback_TeleportWarpIn(void)
CreateTask(Task_TeleportWarpIn, 0); CreateTask(Task_TeleportWarpIn, 0);
} }
void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = { static void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = {
TeleportWarpInFieldEffect_Init, TeleportWarpInFieldEffect_Init,
TeleportWarpInFieldEffect_SpinEnter, TeleportWarpInFieldEffect_SpinEnter,
TeleportWarpInFieldEffect_SpinGround TeleportWarpInFieldEffect_SpinGround
@ -2582,7 +2582,7 @@ bool8 FldEff_FieldMoveShowMonInit(void)
return FALSE; return FALSE;
} }
void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = { static void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = {
FieldMoveShowMonOutdoorsEffect_Init, FieldMoveShowMonOutdoorsEffect_Init,
FieldMoveShowMonOutdoorsEffect_LoadGfx, FieldMoveShowMonOutdoorsEffect_LoadGfx,
FieldMoveShowMonOutdoorsEffect_CreateBanner, FieldMoveShowMonOutdoorsEffect_CreateBanner,
@ -2750,7 +2750,7 @@ static void LoadFieldMoveOutdoorStreaksTilemap(u16 offs)
#define tBgOffset data[4] #define tBgOffset data[4]
#define tMonSpriteId data[15] #define tMonSpriteId data[15]
void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = { static void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = {
FieldMoveShowMonIndoorsEffect_Init, FieldMoveShowMonIndoorsEffect_Init,
FieldMoveShowMonIndoorsEffect_LoadGfx, FieldMoveShowMonIndoorsEffect_LoadGfx,
FieldMoveShowMonIndoorsEffect_SlideBannerOn, FieldMoveShowMonIndoorsEffect_SlideBannerOn,
@ -2978,7 +2978,7 @@ u8 FldEff_UseSurf(void)
return FALSE; return FALSE;
} }
void (*const sSurfFieldEffectFuncs[])(struct Task *) = { static void (*const sSurfFieldEffectFuncs[])(struct Task *) = {
SurfFieldEffect_Init, SurfFieldEffect_Init,
SurfFieldEffect_FieldMovePose, SurfFieldEffect_FieldMovePose,
SurfFieldEffect_ShowMon, SurfFieldEffect_ShowMon,
@ -3154,7 +3154,7 @@ u8 FldEff_UseFly(void)
return 0; return 0;
} }
void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = { static void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = {
FlyOutFieldEffect_FieldMovePose, FlyOutFieldEffect_FieldMovePose,
FlyOutFieldEffect_ShowMon, FlyOutFieldEffect_ShowMon,
FlyOutFieldEffect_BirdLeaveBall, FlyOutFieldEffect_BirdLeaveBall,
@ -3444,7 +3444,7 @@ u8 FldEff_FlyIn(void)
return 0; return 0;
} }
void (*const sFlyInFieldEffectFuncs[])(struct Task *) = { static void (*const sFlyInFieldEffectFuncs[])(struct Task *) = {
FlyInFieldEffect_BirdSwoopDown, FlyInFieldEffect_BirdSwoopDown,
FlyInFieldEffect_FlyInWithBird, FlyInFieldEffect_FlyInWithBird,
FlyInFieldEffect_JumpOffBird, FlyInFieldEffect_JumpOffBird,
@ -3675,7 +3675,7 @@ static void StartEndingDeoxysRockCameraShake(u8 taskId)
#undef tEndDelay #undef tEndDelay
#undef tEnding #undef tEnding
void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { static void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = {
DestroyDeoxysRockEffect_CameraShake, DestroyDeoxysRockEffect_CameraShake,
DestroyDeoxysRockEffect_RockFragments, DestroyDeoxysRockEffect_RockFragments,
DestroyDeoxysRockEffect_WaitAndEnd, DestroyDeoxysRockEffect_WaitAndEnd,

View File

@ -53,7 +53,7 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId);
static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1; const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1;
const struct ScanlineEffectParams sFlashEffectParams = static const struct ScanlineEffectParams sFlashEffectParams =
{ {
&REG_WIN0H, &REG_WIN0H,
((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1, ((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1,

View File

@ -31,7 +31,7 @@ enum
}; };
//. rodata //. rodata
static const s8 gTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; static const s8 sTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0};
static const u8 sSSTidalSailEastMovementScript[] = static const u8 sSSTidalSailEastMovementScript[] =
{ {
@ -109,10 +109,10 @@ void Task_Truck2(u8 taskId)
} }
else else
{ {
if (gTruckCamera_HorizontalTable[data[1]] == 2) if (sTruckCamera_HorizontalTable[data[1]] == 2)
gTasks[taskId].func = Task_Truck3; gTasks[taskId].func = Task_Truck3;
cameraXpan = gTruckCamera_HorizontalTable[data[1]]; cameraXpan = sTruckCamera_HorizontalTable[data[1]];
cameraYpan = GetTruckCameraBobbingY(data[2]); cameraYpan = GetTruckCameraBobbingY(data[2]);
SetCameraPanning(cameraXpan, cameraYpan); SetCameraPanning(cameraXpan, cameraYpan);
box1 = GetTruckBoxMovement(data[2] + 30) * 4; box1 = GetTruckBoxMovement(data[2] + 30) * 4;
@ -144,7 +144,7 @@ static void Task_Truck3(u8 taskId)
} }
else else
{ {
cameraXpan = gTruckCamera_HorizontalTable[data[1]]; cameraXpan = sTruckCamera_HorizontalTable[data[1]];
cameraYpan = 0; cameraYpan = 0;
SetCameraPanning(cameraXpan, 0); SetCameraPanning(cameraXpan, 0);
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3); SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);

View File

@ -72,7 +72,7 @@ static const u8 *sPaletteGammaTypes;
// The drought weather effect uses a precalculated color lookup table. Presumably this // The drought weather effect uses a precalculated color lookup table. Presumably this
// is because the underlying color shift calculation is slow. // is because the underlying color shift calculation is slow.
const u16 sDroughtWeatherColors[][0x1000] = { static const u16 sDroughtWeatherColors[][0x1000] = {
INCBIN_U16("graphics/weather/drought/colors_0.bin"), INCBIN_U16("graphics/weather/drought/colors_0.bin"),
INCBIN_U16("graphics/weather/drought/colors_1.bin"), INCBIN_U16("graphics/weather/drought/colors_1.bin"),
INCBIN_U16("graphics/weather/drought/colors_2.bin"), INCBIN_U16("graphics/weather/drought/colors_2.bin"),

View File

@ -15,8 +15,8 @@
#include "gpu_regs.h" #include "gpu_regs.h"
// EWRAM // EWRAM
EWRAM_DATA static u8 gCurrentAbnormalWeather = 0; EWRAM_DATA static u8 sCurrentAbnormalWeather = 0;
EWRAM_DATA static u16 gUnusedWeatherRelated = 0; EWRAM_DATA static u16 sUnusedWeatherRelated = 0;
// CONST // CONST
const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal"); const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal");
@ -1815,7 +1815,7 @@ static void UpdateFogDiagonalMovement(void)
gWeatherPtr->fogDPosY = gSpriteCoordOffsetY + gWeatherPtr->fogDYOffset; gWeatherPtr->fogDPosY = gSpriteCoordOffsetY + gWeatherPtr->fogDYOffset;
} }
static const struct SpriteSheet gFogDiagonalSpriteSheet = static const struct SpriteSheet sFogDiagonalSpriteSheet =
{ {
.data = gWeatherFogDiagonalTiles, .data = gWeatherFogDiagonalTiles,
.size = sizeof(gWeatherFogDiagonalTiles), .size = sizeof(gWeatherFogDiagonalTiles),
@ -1870,7 +1870,7 @@ static void CreateFogDiagonalSprites(void)
if (!gWeatherPtr->fogDSpritesCreated) if (!gWeatherPtr->fogDSpritesCreated)
{ {
fogDiagonalSpriteSheet = gFogDiagonalSpriteSheet; fogDiagonalSpriteSheet = sFogDiagonalSpriteSheet;
LoadSpriteSheet(&fogDiagonalSpriteSheet); LoadSpriteSheet(&fogDiagonalSpriteSheet);
for (i = 0; i < NUM_FOG_DIAGONAL_SPRITES; i++) for (i = 0; i < NUM_FOG_DIAGONAL_SPRITES; i++)
{ {
@ -2429,8 +2429,8 @@ static void UpdateBubbleSprite(struct Sprite *sprite)
// Unused function. // Unused function.
static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1) static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1)
{ {
gCurrentAbnormalWeather = a0; sCurrentAbnormalWeather = a0;
gUnusedWeatherRelated = a1; sUnusedWeatherRelated = a1;
} }
static void Task_DoAbnormalWeather(u8 taskId) static void Task_DoAbnormalWeather(u8 taskId)
@ -2443,7 +2443,7 @@ static void Task_DoAbnormalWeather(u8 taskId)
if (data[15]-- <= 0) if (data[15]-- <= 0)
{ {
SetNextWeather(data[1]); SetNextWeather(data[1]);
gCurrentAbnormalWeather = data[1]; sCurrentAbnormalWeather = data[1];
data[15] = 600; data[15] = 600;
data[0]++; data[0]++;
} }
@ -2452,7 +2452,7 @@ static void Task_DoAbnormalWeather(u8 taskId)
if (data[15]-- <= 0) if (data[15]-- <= 0)
{ {
SetNextWeather(data[2]); SetNextWeather(data[2]);
gCurrentAbnormalWeather = data[2]; sCurrentAbnormalWeather = data[2];
data[15] = 600; data[15] = 600;
data[0] = 0; data[0] = 0;
} }
@ -2466,19 +2466,19 @@ static void CreateAbnormalWeatherTask(void)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
data[15] = 600; data[15] = 600;
if (gCurrentAbnormalWeather == WEATHER_DOWNPOUR) if (sCurrentAbnormalWeather == WEATHER_DOWNPOUR)
{ {
data[1] = WEATHER_DROUGHT; data[1] = WEATHER_DROUGHT;
data[2] = WEATHER_DOWNPOUR; data[2] = WEATHER_DOWNPOUR;
} }
else if (gCurrentAbnormalWeather == WEATHER_DROUGHT) else if (sCurrentAbnormalWeather == WEATHER_DROUGHT)
{ {
data[1] = WEATHER_DOWNPOUR; data[1] = WEATHER_DOWNPOUR;
data[2] = WEATHER_DROUGHT; data[2] = WEATHER_DROUGHT;
} }
else else
{ {
gCurrentAbnormalWeather = WEATHER_DOWNPOUR; sCurrentAbnormalWeather = WEATHER_DOWNPOUR;
data[1] = WEATHER_DROUGHT; data[1] = WEATHER_DROUGHT;
data[2] = WEATHER_DOWNPOUR; data[2] = WEATHER_DOWNPOUR;
} }
@ -2526,13 +2526,13 @@ void DoCurrentWeather(void)
{ {
if (!FuncIsActiveTask(Task_DoAbnormalWeather)) if (!FuncIsActiveTask(Task_DoAbnormalWeather))
CreateAbnormalWeatherTask(); CreateAbnormalWeatherTask();
weather = gCurrentAbnormalWeather; weather = sCurrentAbnormalWeather;
} }
else else
{ {
if (FuncIsActiveTask(Task_DoAbnormalWeather)) if (FuncIsActiveTask(Task_DoAbnormalWeather))
DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather));
gCurrentAbnormalWeather = WEATHER_DOWNPOUR; sCurrentAbnormalWeather = WEATHER_DOWNPOUR;
} }
SetNextWeather(weather); SetNextWeather(weather);
} }
@ -2545,13 +2545,13 @@ void ResumePausedWeather(void)
{ {
if (!FuncIsActiveTask(Task_DoAbnormalWeather)) if (!FuncIsActiveTask(Task_DoAbnormalWeather))
CreateAbnormalWeatherTask(); CreateAbnormalWeatherTask();
weather = gCurrentAbnormalWeather; weather = sCurrentAbnormalWeather;
} }
else else
{ {
if (FuncIsActiveTask(Task_DoAbnormalWeather)) if (FuncIsActiveTask(Task_DoAbnormalWeather))
DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather));
gCurrentAbnormalWeather = WEATHER_DOWNPOUR; sCurrentAbnormalWeather = WEATHER_DOWNPOUR;
} }
SetCurrentAndNextWeather(weather); SetCurrentAndNextWeather(weather);
} }

View File

@ -25,10 +25,10 @@ struct ConnectionFlags
u8 east:1; u8 east:1;
}; };
EWRAM_DATA static u16 gBackupMapData[MAX_MAP_DATA_SIZE] = {0}; EWRAM_DATA static u16 sBackupMapData[MAX_MAP_DATA_SIZE] = {0};
EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct MapHeader gMapHeader = {0};
EWRAM_DATA struct Camera gCamera = {0}; EWRAM_DATA struct Camera gCamera = {0};
EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0}; EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly
struct BackupMapLayout gBackupMapLayout; struct BackupMapLayout gBackupMapLayout;
@ -87,14 +87,14 @@ void InitMapFromSavedGame(void)
void InitBattlePyramidMap(bool8 setPlayerPosition) void InitBattlePyramidMap(bool8 setPlayerPosition)
{ {
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateBattlePyramidFloorLayout(gBackupMapData, setPlayerPosition); GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition);
} }
void InitTrainerHillMap(void) void InitTrainerHillMap(void)
{ {
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateTrainerHillFloorLayout(gBackupMapData); GenerateTrainerHillFloorLayout(sBackupMapData);
} }
static void InitMapLayoutData(struct MapHeader *mapHeader) static void InitMapLayoutData(struct MapHeader *mapHeader)
@ -103,8 +103,8 @@ static void InitMapLayoutData(struct MapHeader *mapHeader)
int width; int width;
int height; int height;
mapLayout = mapHeader->mapLayout; mapLayout = mapHeader->mapLayout;
CpuFastFill16(MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
gBackupMapLayout.map = gBackupMapData; gBackupMapLayout.map = sBackupMapData;
width = mapLayout->width + MAP_OFFSET_W; width = mapLayout->width + MAP_OFFSET_W;
gBackupMapLayout.width = width; gBackupMapLayout.width = width;
height = mapLayout->height + MAP_OFFSET_H; height = mapLayout->height + MAP_OFFSET_H;
@ -140,7 +140,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
{ {
count = mapHeader->connections->count; count = mapHeader->connections->count;
connection = mapHeader->connections->connections; connection = mapHeader->connections->connections;
gMapConnectionFlags = sDummyConnectionFlags; sMapConnectionFlags = sDummyConnectionFlags;
for (i = 0; i < count; i++, connection++) for (i = 0; i < count; i++, connection++)
{ {
struct MapHeader const *cMap = GetMapHeaderFromConnection(connection); struct MapHeader const *cMap = GetMapHeaderFromConnection(connection);
@ -149,19 +149,19 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
{ {
case CONNECTION_SOUTH: case CONNECTION_SOUTH:
FillSouthConnection(mapHeader, cMap, offset); FillSouthConnection(mapHeader, cMap, offset);
gMapConnectionFlags.south = TRUE; sMapConnectionFlags.south = TRUE;
break; break;
case CONNECTION_NORTH: case CONNECTION_NORTH:
FillNorthConnection(mapHeader, cMap, offset); FillNorthConnection(mapHeader, cMap, offset);
gMapConnectionFlags.north = TRUE; sMapConnectionFlags.north = TRUE;
break; break;
case CONNECTION_WEST: case CONNECTION_WEST:
FillWestConnection(mapHeader, cMap, offset); FillWestConnection(mapHeader, cMap, offset);
gMapConnectionFlags.west = TRUE; sMapConnectionFlags.west = TRUE;
break; break;
case CONNECTION_EAST: case CONNECTION_EAST:
FillEastConnection(mapHeader, cMap, offset); FillEastConnection(mapHeader, cMap, offset);
gMapConnectionFlags.east = TRUE; sMapConnectionFlags.east = TRUE;
break; break;
} }
} }
@ -436,7 +436,7 @@ void SaveMapView(void)
for (i = y; i < y + MAP_OFFSET_H; i++) for (i = y; i < y + MAP_OFFSET_H; i++)
{ {
for (j = x; j < x + MAP_OFFSET_W; j++) for (j = x; j < x + MAP_OFFSET_W; j++)
*mapView++ = gBackupMapData[width * i + j]; *mapView++ = sBackupMapData[width * i + j];
} }
} }
@ -491,8 +491,8 @@ static void LoadSavedMapView(void)
for (j = x; j < x + MAP_OFFSET_W; j++) for (j = x; j < x + MAP_OFFSET_W; j++)
{ {
if (!SkipCopyingMetatileFromSavedMap(&gBackupMapData[j + width * i], width, yMode)) if (!SkipCopyingMetatileFromSavedMap(&sBackupMapData[j + width * i], width, yMode))
gBackupMapData[j + width * i] = *mapView; sBackupMapData[j + width * i] = *mapView;
mapView++; mapView++;
} }
} }
@ -554,7 +554,7 @@ static void MoveMapViewToBackup(u8 direction)
desti = width * (y + y0); desti = width * (y + y0);
srci = (y + r8) * MAP_OFFSET_W + r9; srci = (y + r8) * MAP_OFFSET_W + r9;
src = &mapView[srci + i]; src = &mapView[srci + i];
dest = &gBackupMapData[x0 + desti + j]; dest = &sBackupMapData[x0 + desti + j];
*dest = *src; *dest = *src;
i++; i++;
j++; j++;
@ -570,28 +570,28 @@ int GetMapBorderIdAt(int x, int y)
if (x >= (gBackupMapLayout.width - (MAP_OFFSET + 1))) if (x >= (gBackupMapLayout.width - (MAP_OFFSET + 1)))
{ {
if (!gMapConnectionFlags.east) if (!sMapConnectionFlags.east)
return CONNECTION_INVALID; return CONNECTION_INVALID;
return CONNECTION_EAST; return CONNECTION_EAST;
} }
else if (x < MAP_OFFSET) else if (x < MAP_OFFSET)
{ {
if (!gMapConnectionFlags.west) if (!sMapConnectionFlags.west)
return CONNECTION_INVALID; return CONNECTION_INVALID;
return CONNECTION_WEST; return CONNECTION_WEST;
} }
else if (y >= (gBackupMapLayout.height - MAP_OFFSET)) else if (y >= (gBackupMapLayout.height - MAP_OFFSET))
{ {
if (!gMapConnectionFlags.south) if (!sMapConnectionFlags.south)
return CONNECTION_INVALID; return CONNECTION_INVALID;
return CONNECTION_SOUTH; return CONNECTION_SOUTH;
} }
else if (y < MAP_OFFSET) else if (y < MAP_OFFSET)
{ {
if (!gMapConnectionFlags.north) if (!sMapConnectionFlags.north)
return CONNECTION_INVALID; return CONNECTION_INVALID;
return CONNECTION_NORTH; return CONNECTION_NORTH;

View File

@ -35,8 +35,8 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite);
// static const rom data // static const rom data
static const u16 sRotatingBall_Pal[] = INCBIN_U16("graphics/bag/rotating_ball.gbapal"); static const u16 sRotatingBall_Pal[] = INCBIN_U16("graphics/bag/rotating_ball.gbapal");
static const u8 sRotatingBall_Gfx[] = INCBIN_U8("graphics/bag/rotating_ball.4bpp"); static const u8 sRotatingBall_Gfx[] = INCBIN_U8("graphics/bag/rotating_ball.4bpp");
static const u8 gCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp"); static const u8 sCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp");
static const u16 gCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal"); static const u16 sCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal");
static const struct OamData sBagOamData = static const struct OamData sBagOamData =
{ {
@ -269,7 +269,7 @@ static const struct SpriteFrameImage sBerryPicSpriteImageTable[] =
{&gDecompressionBuffer[0], 0x800}, {&gDecompressionBuffer[0], 0x800},
}; };
static const struct SpriteTemplate gBerryPicSpriteTemplate = static const struct SpriteTemplate sBerryPicSpriteTemplate =
{ {
.tileTag = TAG_NONE, .tileTag = TAG_NONE,
.paletteTag = TAG_BERRY_PIC_PAL, .paletteTag = TAG_BERRY_PIC_PAL,
@ -308,7 +308,7 @@ static const union AffineAnimCmd *const sBerryPicRotatingAnimCmds[] =
sSpriteAffineAnim_BerryPicRotation2 sSpriteAffineAnim_BerryPicRotation2
}; };
static const struct SpriteTemplate gBerryPicRotatingSpriteTemplate = static const struct SpriteTemplate sBerryPicRotatingSpriteTemplate =
{ {
.tileTag = TAG_NONE, .tileTag = TAG_NONE,
.paletteTag = TAG_BERRY_PIC_PAL, .paletteTag = TAG_BERRY_PIC_PAL,
@ -404,7 +404,7 @@ static const union AnimCmd *const sBerryCheckCircleSpriteAnimTable[] =
sSpriteAnim_BerryCheckCircle sSpriteAnim_BerryCheckCircle
}; };
static const struct SpriteTemplate gBerryCheckCircleSpriteTemplate = static const struct SpriteTemplate sBerryCheckCircleSpriteTemplate =
{ {
.tileTag = TAG_BERRY_CHECK_CIRCLE_GFX, .tileTag = TAG_BERRY_CHECK_CIRCLE_GFX,
.paletteTag = TAG_BERRY_CHECK_CIRCLE_GFX, .paletteTag = TAG_BERRY_CHECK_CIRCLE_GFX,
@ -609,7 +609,7 @@ static void LoadBerryGfx(u8 berryId)
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y) u8 CreateBerryTagSprite(u8 id, s16 x, s16 y)
{ {
LoadBerryGfx(id); LoadBerryGfx(id);
return CreateSprite(&gBerryPicSpriteTemplate, x, y, 0); return CreateSprite(&sBerryPicSpriteTemplate, x, y, 0);
} }
void FreeBerryTagSpritePalette(void) void FreeBerryTagSpritePalette(void)
@ -624,7 +624,7 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine)
FreeSpritePaletteByTag(TAG_BERRY_PIC_PAL); FreeSpritePaletteByTag(TAG_BERRY_PIC_PAL);
LoadBerryGfx(berryId); LoadBerryGfx(berryId);
spriteId = CreateSprite(&gBerryPicRotatingSpriteTemplate, x, y, 0); spriteId = CreateSprite(&sBerryPicRotatingSpriteTemplate, x, y, 0);
if (startAffine == TRUE) if (startAffine == TRUE)
StartSpriteAffineAnim(&gSprites[spriteId], 1); StartSpriteAffineAnim(&gSprites[spriteId], 1);
@ -633,5 +633,5 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine)
u8 CreateBerryFlavorCircleSprite(s16 x) u8 CreateBerryFlavorCircleSprite(s16 x)
{ {
return CreateSprite(&gBerryCheckCircleSpriteTemplate, x, 116, 0); return CreateSprite(&sBerryCheckCircleSpriteTemplate, x, 116, 0);
} }

View File

@ -336,7 +336,7 @@ static const struct Landmark *const Landmarks_MtChimney_2[] =
NULL, NULL,
}; };
static const struct LandmarkList gLandmarkLists[] = static const struct LandmarkList sLandmarkLists[] =
{ {
{MAPSEC_ROUTE_103, 2, Landmarks_Route103_2}, {MAPSEC_ROUTE_103, 2, Landmarks_Route103_2},
{MAPSEC_ROUTE_104, 0, Landmarks_Route104_0}, {MAPSEC_ROUTE_104, 0, Landmarks_Route104_0},
@ -420,21 +420,21 @@ static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id)
{ {
u16 i = 0; u16 i = 0;
for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++) for (; sLandmarkLists[i].mapSection != MAPSEC_NONE; i++)
{ {
if (gLandmarkLists[i].mapSection > mapSection) if (sLandmarkLists[i].mapSection > mapSection)
return NULL; return NULL;
if (gLandmarkLists[i].mapSection == mapSection) if (sLandmarkLists[i].mapSection == mapSection)
break; break;
} }
if (gLandmarkLists[i].mapSection == MAPSEC_NONE) if (sLandmarkLists[i].mapSection == MAPSEC_NONE)
return NULL; return NULL;
for (; gLandmarkLists[i].mapSection == mapSection; i++) for (; sLandmarkLists[i].mapSection == mapSection; i++)
{ {
if (gLandmarkLists[i].id == id) if (sLandmarkLists[i].id == id)
return gLandmarkLists[i].landmarks; return sLandmarkLists[i].landmarks;
} }
return NULL; return NULL;

View File

@ -680,7 +680,7 @@ SoundMainRAM_Unk2:
ldr r1, [r4, o_SoundChannel_wav] ldr r1, [r4, o_SoundChannel_wav]
add r2, r2, r1 add r2, r2, r1
add r2, r2, 0x10 add r2, r2, 0x10
ldr r5, =gDecodingBuffer ldr r5, =sDecodingBuffer
ldr r6, =gDeltaEncodingTable ldr r6, =gDeltaEncodingTable
mov r7, 0x40 mov r7, 0x40
ldrb lr, [r2], 1 ldrb lr, [r2], 1
@ -701,7 +701,7 @@ _081DD57C:
subs r7, r7, 2 subs r7, r7, 2
bgt _081DD568 bgt _081DD568
_081DD594: _081DD594:
ldr r5, =gDecodingBuffer ldr r5, =sDecodingBuffer
and r0, r3, 0x3F and r0, r3, 0x3F
ldrsb r1, [r5, r0] ldrsb r1, [r5, r0]
pop {r0,r2,r5-r7,pc} pop {r0,r2,r5-r7,pc}
@ -1911,6 +1911,6 @@ _081DDD90:
.align 2, 0 @ Don't pad with nop. .align 2, 0 @ Don't pad with nop.
.bss .bss
gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM sDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM
.space 0x40 .space 0x40
.size gDecodingBuffer, .-gDecodingBuffer .size sDecodingBuffer, .-sDecodingBuffer

View File

@ -69,7 +69,7 @@ u8 gLinkVSyncDisabled;
u32 IntrMain_Buffer[0x200]; u32 IntrMain_Buffer[0x200];
s8 gPcmDmaCounter; s8 gPcmDmaCounter;
static EWRAM_DATA u16 gTrainerId = 0; static EWRAM_DATA u16 sTrainerId = 0;
//EWRAM_DATA void (**gFlashTimerIntrFunc)(void) = NULL; //EWRAM_DATA void (**gFlashTimerIntrFunc)(void) = NULL;
@ -201,12 +201,12 @@ void SeedRngAndSetTrainerId(void)
u16 val = REG_TM1CNT_L; u16 val = REG_TM1CNT_L;
SeedRng(val); SeedRng(val);
REG_TM1CNT_H = 0; REG_TM1CNT_H = 0;
gTrainerId = val; sTrainerId = val;
} }
u16 GetGeneratedTrainerIdLower(void) u16 GetGeneratedTrainerIdLower(void)
{ {
return gTrainerId; return sTrainerId;
} }
void EnableVCountIntrAtLine150(void) void EnableVCountIntrAtLine150(void)

View File

@ -371,7 +371,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] =
DUMMY_WIN_TEMPLATE DUMMY_WIN_TEMPLATE
}; };
static const struct WindowTemplate gNewGameBirchSpeechTextWindows[] = static const struct WindowTemplate sNewGameBirchSpeechTextWindows[] =
{ {
{ {
.bg = 0, .bg = 0,
@ -457,7 +457,7 @@ static const struct MenuAction sMenuActions_Gender[] = {
{gText_BirchGirl, NULL} {gText_BirchGirl, NULL}
}; };
static const u8 *const gMalePresetNames[] = { static const u8 *const sMalePresetNames[] = {
gText_DefaultNameStu, gText_DefaultNameStu,
gText_DefaultNameMilton, gText_DefaultNameMilton,
gText_DefaultNameTom, gText_DefaultNameTom,
@ -480,7 +480,7 @@ static const u8 *const gMalePresetNames[] = {
gText_DefaultNameQuincy gText_DefaultNameQuincy
}; };
static const u8 *const gFemalePresetNames[] = { static const u8 *const sFemalePresetNames[] = {
gText_DefaultNameKimmy, gText_DefaultNameKimmy,
gText_DefaultNameTiara, gText_DefaultNameTiara,
gText_DefaultNameBella, gText_DefaultNameBella,
@ -1325,7 +1325,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId)
} }
else else
{ {
InitWindows(gNewGameBirchSpeechTextWindows); InitWindows(sNewGameBirchSpeechTextWindows);
LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMainMenuWindowFrameTiles(0, 0xF3);
LoadMessageBoxGfx(0, 0xFC, 0xF0); LoadMessageBoxGfx(0, 0xFC, 0xF0);
NewGameBirchSpeech_ShowDialogueWindow(0, 1); NewGameBirchSpeech_ShowDialogueWindow(0, 1);
@ -1851,7 +1851,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void)
REG_IME = savedIme; REG_IME = savedIme;
SetVBlankCallback(VBlankCB_MainMenu); SetVBlankCallback(VBlankCB_MainMenu);
SetMainCallback2(CB2_MainMenu); SetMainCallback2(CB2_MainMenu);
InitWindows(gNewGameBirchSpeechTextWindows); InitWindows(sNewGameBirchSpeechTextWindows);
LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMainMenuWindowFrameTiles(0, 0xF3);
LoadMessageBoxGfx(0, 0xFC, 0xF0); LoadMessageBoxGfx(0, 0xFC, 0xF0);
PutWindowTilemap(0); PutWindowTilemap(0);
@ -2087,7 +2087,7 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay)
static void NewGameBirchSpeech_ShowGenderMenu(void) static void NewGameBirchSpeech_ShowGenderMenu(void)
{ {
DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); DrawMainMenuWindowBorder(&sNewGameBirchSpeechTextWindows[1], 0xF3);
FillWindowPixelBuffer(1, PIXEL_FILL(1)); FillWindowPixelBuffer(1, PIXEL_FILL(1));
PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender); PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender);
InitMenuInUpperLeftCornerNormal(1, ARRAY_COUNT(sMenuActions_Gender), 0); InitMenuInUpperLeftCornerNormal(1, ARRAY_COUNT(sMenuActions_Gender), 0);
@ -2106,9 +2106,9 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
u8 i; u8 i;
if (gSaveBlock2Ptr->playerGender == MALE) if (gSaveBlock2Ptr->playerGender == MALE)
name = gMalePresetNames[nameId]; name = sMalePresetNames[nameId];
else else
name = gFemalePresetNames[nameId]; name = sFemalePresetNames[nameId];
for (i = 0; i < PLAYER_NAME_LENGTH; i++) for (i = 0; i < PLAYER_NAME_LENGTH; i++)
gSaveBlock2Ptr->playerName[i] = name[i]; gSaveBlock2Ptr->playerName[i] = name[i];
gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS; gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS;

View File

@ -176,25 +176,25 @@ static const u8 sRegionMapSectionId_To_PopUpThemeIdMapping[] =
[MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_MARBLE [MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_MARBLE
}; };
static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); static const u8 sText_PyramidFloor1[] = _("PYRAMID FLOOR 1");
static const u8 gText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); static const u8 sText_PyramidFloor2[] = _("PYRAMID FLOOR 2");
static const u8 gText_PyramidFloor3[] = _("PYRAMID FLOOR 3"); static const u8 sText_PyramidFloor3[] = _("PYRAMID FLOOR 3");
static const u8 gText_PyramidFloor4[] = _("PYRAMID FLOOR 4"); static const u8 sText_PyramidFloor4[] = _("PYRAMID FLOOR 4");
static const u8 gText_PyramidFloor5[] = _("PYRAMID FLOOR 5"); static const u8 sText_PyramidFloor5[] = _("PYRAMID FLOOR 5");
static const u8 gText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6");
static const u8 gText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7");
static const u8 gText_Pyramid[] = _("PYRAMID"); static const u8 sText_Pyramid[] = _("PYRAMID");
static const u8 * const gBattlePyramid_MapHeaderStrings[] = static const u8 * const sBattlePyramid_MapHeaderStrings[] =
{ {
gText_PyramidFloor1, sText_PyramidFloor1,
gText_PyramidFloor2, sText_PyramidFloor2,
gText_PyramidFloor3, sText_PyramidFloor3,
gText_PyramidFloor4, sText_PyramidFloor4,
gText_PyramidFloor5, sText_PyramidFloor5,
gText_PyramidFloor6, sText_PyramidFloor6,
gText_PyramidFloor7, sText_PyramidFloor7,
gText_Pyramid, sText_Pyramid,
}; };
// Unused // Unused
@ -309,12 +309,12 @@ static void ShowMapNamePopUpWindow(void)
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)
{ {
withoutPrefixPtr = &(mapDisplayHeader[3]); withoutPrefixPtr = &(mapDisplayHeader[3]);
mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[7]; mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[7];
} }
else else
{ {
withoutPrefixPtr = &(mapDisplayHeader[3]); withoutPrefixPtr = &(mapDisplayHeader[3]);
mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum]; mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum];
} }
StringCopy(withoutPrefixPtr, mapDisplayHeaderSource); StringCopy(withoutPrefixPtr, mapDisplayHeaderSource);
} }

View File

@ -318,7 +318,7 @@ static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *, struct Obje
static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8);
static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8);
static u8 (*const gLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = static u8 (*const sLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) =
{ {
[MOVEMENT_MODE_FREE] = MovementEventModeCB_Normal, [MOVEMENT_MODE_FREE] = MovementEventModeCB_Normal,
[MOVEMENT_MODE_FROZEN] = MovementEventModeCB_Ignored, [MOVEMENT_MODE_FROZEN] = MovementEventModeCB_Ignored,
@ -330,7 +330,7 @@ static u8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *, struct Obje
static u8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8);
// These handlers return TRUE if the movement was scripted and successful, and FALSE otherwise. // These handlers return TRUE if the movement was scripted and successful, and FALSE otherwise.
static bool8 (*const gLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = static bool8 (*const sLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) =
{ {
FacingHandler_DoNothing, FacingHandler_DoNothing,
FacingHandler_DpadMovement, FacingHandler_DpadMovement,
@ -349,7 +349,7 @@ static void MovementStatusHandler_EnterFreeMode(struct LinkPlayerObjectEvent *,
static void MovementStatusHandler_TryAdvanceScript(struct LinkPlayerObjectEvent *, struct ObjectEvent *); static void MovementStatusHandler_TryAdvanceScript(struct LinkPlayerObjectEvent *, struct ObjectEvent *);
// These handlers are run after an attempted movement. // These handlers are run after an attempted movement.
static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) = static void (*const sMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) =
{ {
// FALSE: // FALSE:
MovementStatusHandler_EnterFreeMode, MovementStatusHandler_EnterFreeMode,
@ -3048,9 +3048,9 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing)
{ {
// This is a hack to split this code onto two separate lines, without declaring a local variable. // This is a hack to split this code onto two separate lines, without declaring a local variable.
// C++ style inline variables would be nice here. // C++ style inline variables would be nice here.
#define TEMP gLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing) #define TEMP sLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing)
gMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent); sMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent);
// Clean up the hack. // Clean up the hack.
#undef TEMP #undef TEMP
@ -3061,7 +3061,7 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing)
static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
{ {
return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir);
} }
static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
@ -3072,7 +3072,7 @@ static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerOb
// Identical to MovementEventModeCB_Normal // Identical to MovementEventModeCB_Normal
static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
{ {
return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir);
} }
static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)

View File

@ -60,13 +60,13 @@ static void Task_BlendPalettesGradually(u8 taskId);
// unaligned word reads are issued in BlendPalette otherwise // unaligned word reads are issued in BlendPalette otherwise
ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0}; ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0};
ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0}; ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0};
EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0}; static EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0};
EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0}; EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0};
static EWRAM_DATA u32 sFiller = 0; static EWRAM_DATA u32 sFiller = 0;
static EWRAM_DATA u32 sPlttBufferTransferPending = 0; static EWRAM_DATA u32 sPlttBufferTransferPending = 0;
EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_DECOMP_BUFFER_SIZE] = {0}; EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_DECOMP_BUFFER_SIZE] = {0};
static const struct PaletteStructTemplate gDummyPaletteStructTemplate = { static const struct PaletteStructTemplate sDummyPaletteStructTemplate = {
.id = 0xFFFF, .id = 0xFFFF,
.state = 1 .state = 1
}; };
@ -352,7 +352,7 @@ void PaletteStruct_ResetById(u16 id)
static void PaletteStruct_Reset(u8 paletteNum) static void PaletteStruct_Reset(u8 paletteNum)
{ {
sPaletteStructs[paletteNum].template = &gDummyPaletteStructTemplate; sPaletteStructs[paletteNum].template = &sDummyPaletteStructTemplate;
sPaletteStructs[paletteNum].active = FALSE; sPaletteStructs[paletteNum].active = FALSE;
sPaletteStructs[paletteNum].baseDestOffset = 0; sPaletteStructs[paletteNum].baseDestOffset = 0;
sPaletteStructs[paletteNum].destOffset = 0; sPaletteStructs[paletteNum].destOffset = 0;

View File

@ -840,7 +840,7 @@ static const u8 sText_No000[] = _("{NO}000");
static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp"); static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp");
static const u8 sText_TenDashes[] = _("----------"); static const u8 sText_TenDashes[] = _("----------");
ALIGNED(4) static const u8 gExpandedPlaceholder_PokedexDescription[] = _(""); ALIGNED(4) static const u8 sExpandedPlaceholder_PokedexDescription[] = _("");
#include "data/pokemon/pokedex_text.h" #include "data/pokemon/pokedex_text.h"
#include "data/pokemon/pokedex_entries.h" #include "data/pokemon/pokedex_entries.h"
@ -4138,7 +4138,7 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry)
if (owned) if (owned)
description = gPokedexEntries[num].description; description = gPokedexEntries[num].description;
else else
description = gExpandedPlaceholder_PokedexDescription; description = sExpandedPlaceholder_PokedexDescription;
PrintInfoScreenText(description, GetStringCenterAlignXOffset(FONT_NORMAL, description, 0xF0), 0x5F); PrintInfoScreenText(description, GetStringCenterAlignXOffset(FONT_NORMAL, description, 0xF0), 0x5F);
} }

View File

@ -1040,7 +1040,7 @@ static const struct BgTemplate sBgTemplates[] =
}, },
}; };
static const struct SpritePalette gWaveformSpritePalette = static const struct SpritePalette sWaveformSpritePalette =
{ {
sWaveform_Pal, PALTAG_MISC_2 sWaveform_Pal, PALTAG_MISC_2
}; };
@ -3844,7 +3844,7 @@ static bool8 InitPokeStorageWindows(void)
static void LoadWaveformSpritePalette(void) static void LoadWaveformSpritePalette(void)
{ {
LoadSpritePalette(&gWaveformSpritePalette); LoadSpritePalette(&sWaveformSpritePalette);
} }
static void InitPalettesAndSprites(void) static void InitPalettesAndSprites(void)

View File

@ -105,7 +105,7 @@ static const u8 sHelpBarTextColors[3] =
TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY
}; };
static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = static const struct CompressedSpriteSheet sSpinningPokenavSpriteSheet[] =
{ {
{ {
.data = sSpinningPokenav_Gfx, .data = sSpinningPokenav_Gfx,
@ -114,7 +114,7 @@ static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
} }
}; };
static const struct SpritePalette gSpinningNavgearPalettes[] = static const struct SpritePalette sSpinningNavgearPalettes[] =
{ {
{ {
.data = sSpinningPokenav_Pal, .data = sSpinningPokenav_Pal,
@ -583,10 +583,10 @@ static void InitPokenavMainMenuResources(void)
u8 spriteId; u8 spriteId;
struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU); struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++) for (i = 0; i < ARRAY_COUNT(sSpinningPokenavSpriteSheet); i++)
LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]); LoadCompressedSpriteSheet(&sSpinningPokenavSpriteSheet[i]);
Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes); Pokenav_AllocAndLoadPalettes(sSpinningNavgearPalettes);
menu->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0)); menu->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0));
spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0); spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0);
menu->spinningPokenav = &gSprites[spriteId]; menu->spinningPokenav = &gSprites[spriteId];

View File

@ -324,7 +324,7 @@ static const match_call_text_data_t sWallyTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF } { NULL, 0xFFFF, 0xFFFF }
}; };
const struct MatchCallLocationOverride sWallyLocationData[] = { static const struct MatchCallLocationOverride sWallyLocationData[] = {
{ FLAG_HIDE_MAUVILLE_CITY_WALLY, MAPSEC_VERDANTURF_TOWN }, { FLAG_HIDE_MAUVILLE_CITY_WALLY, MAPSEC_VERDANTURF_TOWN },
{ FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, MAPSEC_NONE }, { FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, MAPSEC_NONE },
{ FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, MAPSEC_VICTORY_ROAD }, { FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, MAPSEC_VICTORY_ROAD },

View File

@ -146,7 +146,7 @@ static const struct WindowTemplate sMapSecInfoWindowTemplate =
#include "data/region_map/city_map_entries.h" #include "data/region_map/city_map_entries.h"
const struct OamData sCityZoomTextSprite_OamData = static const struct OamData sCityZoomTextSprite_OamData =
{ {
.y = 0, .y = 0,
.affineMode = ST_OAM_AFFINE_OFF, .affineMode = ST_OAM_AFFINE_OFF,

File diff suppressed because it is too large Load Diff

View File

@ -612,12 +612,10 @@ static const u8 sRotatingGate_ArmLayout[][4 * 2] =
}, },
}; };
// ewram static EWRAM_DATA u8 sRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0};
static EWRAM_DATA u8 gRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0}; static EWRAM_DATA const struct RotatingGatePuzzle *sRotatingGate_PuzzleConfig = NULL;
static EWRAM_DATA const struct RotatingGatePuzzle *gRotatingGate_PuzzleConfig = NULL; static EWRAM_DATA u8 sRotatingGate_PuzzleCount = 0;
static EWRAM_DATA u8 gRotatingGate_PuzzleCount = 0;
// text
static s32 GetCurrentMapRotatingGatePuzzleType(void) static s32 GetCurrentMapRotatingGatePuzzleType(void)
{ {
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(FORTREE_CITY_GYM) && if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(FORTREE_CITY_GYM) &&
@ -640,9 +638,9 @@ static void RotatingGate_ResetAllGateOrientations(void)
s32 i; s32 i;
u8 *ptr = (u8 *)GetVarPointer(VAR_TEMP_0); u8 *ptr = (u8 *)GetVarPointer(VAR_TEMP_0);
for (i = 0; i < gRotatingGate_PuzzleCount; i++) for (i = 0; i < sRotatingGate_PuzzleCount; i++)
{ {
ptr[i] = gRotatingGate_PuzzleConfig[i].orientation; ptr[i] = sRotatingGate_PuzzleConfig[i].orientation;
} }
} }
@ -683,12 +681,12 @@ static void RotatingGate_LoadPuzzleConfig(void)
switch (puzzleType) switch (puzzleType)
{ {
case PUZZLE_FORTREE_CITY_GYM: case PUZZLE_FORTREE_CITY_GYM:
gRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig; sRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig;
gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig); sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig);
break; break;
case PUZZLE_ROUTE110_TRICK_HOUSE_PUZZLE6: case PUZZLE_ROUTE110_TRICK_HOUSE_PUZZLE6:
gRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig; sRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig;
gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig); sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig);
break; break;
case PUZZLE_NONE: case PUZZLE_NONE:
default: default:
@ -696,7 +694,7 @@ static void RotatingGate_LoadPuzzleConfig(void)
} }
for (i = 0; i < ROTATING_GATE_PUZZLE_MAX - 1; i++) for (i = 0; i < ROTATING_GATE_PUZZLE_MAX - 1; i++)
gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; sRotatingGate_GateSpriteIds[i] = MAX_SPRITES;
} }
static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY) static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY)
@ -710,15 +708,15 @@ static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY)
s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y = gSaveBlock1Ptr->pos.y - 2;
s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H;
for (i = 0; i < gRotatingGate_PuzzleCount; i++) for (i = 0; i < sRotatingGate_PuzzleCount; i++)
{ {
s16 x3 = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; s16 x3 = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET;
s16 y3 = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; s16 y3 = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET;
if (y <= y3 && y2 >= y3 && x <= x3 && x2 >= x3 && if (y <= y3 && y2 >= y3 && x <= x3 && x2 >= x3 &&
gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) sRotatingGate_GateSpriteIds[i] == MAX_SPRITES)
{ {
gRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY); sRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY);
} }
} }
} }
@ -730,7 +728,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY)
u8 spriteId; u8 spriteId;
s16 x, y; s16 x, y;
const struct RotatingGatePuzzle *gate = &gRotatingGate_PuzzleConfig[gateId]; const struct RotatingGatePuzzle *gate = &sRotatingGate_PuzzleConfig[gateId];
if (gate->shape == GATE_SHAPE_L1 || gate->shape == GATE_SHAPE_T1) if (gate->shape == GATE_SHAPE_L1 || gate->shape == GATE_SHAPE_T1)
template = sSpriteTemplate_RotatingGateRegular; template = sSpriteTemplate_RotatingGateRegular;
@ -827,20 +825,20 @@ static void RotatingGate_DestroyGatesOutsideViewport(void)
s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y = gSaveBlock1Ptr->pos.y - 2;
s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H;
for (i = 0; i < gRotatingGate_PuzzleCount; i++) for (i = 0; i < sRotatingGate_PuzzleCount; i++)
{ {
s16 xGate = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; s16 xGate = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET;
s16 yGate = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; s16 yGate = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET;
if (gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) if (sRotatingGate_GateSpriteIds[i] == MAX_SPRITES)
continue; continue;
if (xGate < x || xGate > x2 || yGate < y || yGate > y2) if (xGate < x || xGate > x2 || yGate < y || yGate > y2)
{ {
struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[i]]; struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[i]];
FreeSpriteOamMatrix(sprite); FreeSpriteOamMatrix(sprite);
DestroySprite(sprite); DestroySprite(sprite);
gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; sRotatingGate_GateSpriteIds[i] = MAX_SPRITES;
} }
} }
} }
@ -862,9 +860,9 @@ static s32 RotatingGate_CanRotate(u8 gateId, s32 rotationDirection)
orientation = RotatingGate_GetGateOrientation(gateId); orientation = RotatingGate_GetGateOrientation(gateId);
shape = gRotatingGate_PuzzleConfig[gateId].shape; shape = sRotatingGate_PuzzleConfig[gateId].shape;
x = gRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET; x = sRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET;
y = gRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET; y = sRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET;
// Loop through the gate's "arms" clockwise (north, south, east, west) // Loop through the gate's "arms" clockwise (north, south, east, west)
for (i = GATE_ARM_NORTH; i <= GATE_ARM_WEST; i++) for (i = GATE_ARM_NORTH; i <= GATE_ARM_WEST; i++)
@ -891,15 +889,15 @@ static s32 RotatingGate_HasArm(u8 gateId, u8 armInfo)
s32 isLongArm = armInfo % 2; s32 isLongArm = armInfo % 2;
s8 armOrientation = (arm - RotatingGate_GetGateOrientation(gateId) + 4) % 4; s8 armOrientation = (arm - RotatingGate_GetGateOrientation(gateId) + 4) % 4;
s32 shape = gRotatingGate_PuzzleConfig[gateId].shape; s32 shape = sRotatingGate_PuzzleConfig[gateId].shape;
return sRotatingGate_ArmLayout[shape][armOrientation * 2 + isLongArm]; return sRotatingGate_ArmLayout[shape][armOrientation * 2 + isLongArm];
} }
static void RotatingGate_TriggerRotationAnimation(u8 gateId, s32 rotationDirection) static void RotatingGate_TriggerRotationAnimation(u8 gateId, s32 rotationDirection)
{ {
if (gRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES) if (sRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES)
{ {
struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[gateId]]; struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[gateId]];
sprite->data[1] = rotationDirection; sprite->data[1] = rotationDirection;
sprite->data[2] = RotatingGate_GetGateOrientation(gateId); sprite->data[2] = RotatingGate_GetGateOrientation(gateId);
} }
@ -957,10 +955,10 @@ bool8 CheckForRotatingGatePuzzleCollision(u8 direction, s16 x, s16 y)
if (!GetCurrentMapRotatingGatePuzzleType()) if (!GetCurrentMapRotatingGatePuzzleType())
return FALSE; return FALSE;
for (i = 0; i < gRotatingGate_PuzzleCount; i++) for (i = 0; i < sRotatingGate_PuzzleCount; i++)
{ {
s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET;
s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET;
if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1)
{ {
@ -995,10 +993,10 @@ bool8 CheckForRotatingGatePuzzleCollisionWithoutAnimation(u8 direction, s16 x, s
if (!GetCurrentMapRotatingGatePuzzleType()) if (!GetCurrentMapRotatingGatePuzzleType())
return FALSE; return FALSE;
for (i = 0; i < gRotatingGate_PuzzleCount; i++) for (i = 0; i < sRotatingGate_PuzzleCount; i++)
{ {
s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET;
s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET;
if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1)
{ {

View File

@ -6,7 +6,6 @@
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/event_object_movement.h" #include "constants/event_object_movement.h"
// static functions
static void ScriptMovement_StartMoveObjects(u8 priority); static void ScriptMovement_StartMoveObjects(u8 priority);
static u8 GetMoveObjectsTaskId(void); static u8 GetMoveObjectsTaskId(void);
static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 objEventId, const u8 *movementScript); static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 objEventId, const u8 *movementScript);
@ -17,10 +16,8 @@ static void ScriptMovement_UnfreezeActiveObjects(u8 taskId);
static void ScriptMovement_MoveObjects(u8 taskId); static void ScriptMovement_MoveObjects(u8 taskId);
static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript); static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript);
// EWRAM_DATA static EWRAM_DATA const u8 *sMovementScripts[OBJECT_EVENTS_COUNT] = {0};
static EWRAM_DATA const u8 *gMovementScripts[OBJECT_EVENTS_COUNT] = {0};
// text
bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript) bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript)
{ {
u8 objEventId; u8 objEventId;
@ -167,12 +164,12 @@ static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId)
static void SetMovementScript(u8 moveScrId, const u8 *movementScript) static void SetMovementScript(u8 moveScrId, const u8 *movementScript)
{ {
gMovementScripts[moveScrId] = movementScript; sMovementScripts[moveScrId] = movementScript;
} }
static const u8 *GetMovementScript(u8 moveScrId) static const u8 *GetMovementScript(u8 moveScrId)
{ {
return gMovementScripts[moveScrId]; return sMovementScripts[moveScrId];
} }
static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript) static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript)

View File

@ -537,7 +537,7 @@ const u16 *const gTilesetAnims_BattlePyramid_StatueShadow[] = {
gTilesetAnims_BattlePyramid_StatueShadow_Frame2 gTilesetAnims_BattlePyramid_StatueShadow_Frame2
}; };
static const u16 *const gTilesetAnims_BattleDomeFloorLightPals[] = { static const u16 *const sTilesetAnims_BattleDomeFloorLightPals[] = {
gTilesetAnims_BattleDomePals0_0, gTilesetAnims_BattleDomePals0_0,
gTilesetAnims_BattleDomePals0_1, gTilesetAnims_BattleDomePals0_1,
gTilesetAnims_BattleDomePals0_2, gTilesetAnims_BattleDomePals0_2,
@ -1167,7 +1167,7 @@ static void QueueAnimTiles_BattlePyramid_StatueShadow(u16 timer)
static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) static void BlendAnimPalette_BattleDome_FloorLights(u16 timer)
{ {
CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32);
BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF);
if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) != TASK_NONE) if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) != TASK_NONE)
{ {
@ -1178,7 +1178,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer)
static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer) static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer)
{ {
CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32);
if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) == TASK_NONE) if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) == TASK_NONE)
{ {
BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF);

View File

@ -2195,7 +2195,7 @@ static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void)
sTradeMenuData->timer++; sTradeMenuData->timer++;
break; break;
case GFXTAG_MENU_TEXT_COUNT: case GFXTAG_MENU_TEXT_COUNT:
LoadSpritePalette(&gSpritePalette_TradeScreenText); LoadSpritePalette(&sSpritePalette_TradeScreenText);
sTradeMenuData->timer++; sTradeMenuData->timer++;
break; break;
case GFXTAG_MENU_TEXT_COUNT + 1: case GFXTAG_MENU_TEXT_COUNT + 1:

View File

@ -723,7 +723,7 @@ static const u8 *const sTVInSearchOfTrainersTextGroup[] = {
// Secret Base Secrets TV Show states for actions that can be taken in a secret base // Secret Base Secrets TV Show states for actions that can be taken in a secret base
// The flags that determine whether or not the action was taken are commented // The flags that determine whether or not the action was taken are commented
const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] = static const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] =
{ {
SBSECRETS_STATE_USED_CHAIR, // SECRET_BASE_USED_CHAIR SBSECRETS_STATE_USED_CHAIR, // SECRET_BASE_USED_CHAIR
SBSECRETS_STATE_USED_BALLOON, // SECRET_BASE_USED_BALLOON SBSECRETS_STATE_USED_BALLOON, // SECRET_BASE_USED_BALLOON