Clean up the last extern functions

This commit is contained in:
Phlosioneer 2019-03-02 03:18:08 -05:00
parent ee69426838
commit 49bef25856
27 changed files with 69 additions and 77 deletions

View File

@ -9,5 +9,6 @@
u16 SetFlashTimerIntr(u8 timerNum, void (**intrFunc)(void));
u16 IdentifyFlash(void);
u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src);
#endif //GUARD_AGB_FLASH_H

View File

@ -221,6 +221,7 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5,
// battle_anim_effects_1.c
void sub_810310C(u8 battler, struct Sprite* sprite);
void AnimMoveTwisterParticle(struct Sprite* sprite);
// smokescreen.c
u8 sub_807521C(s16 x, s16 y, u8 a3);

View File

@ -5,5 +5,7 @@ void InitDewfordTrend(void);
void UpdateDewfordTrendPerDay(u16);
void UpdateDewfordTrendPerDay(u16 days);
bool8 sub_81226D8(u16 *a);
void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused);
#endif // GUARD_DEWFORDTREND_H

View File

@ -15,5 +15,6 @@ void InitMatchCallCounters(void);
bool32 TryStartMatchCall(void);
bool32 IsMatchCallTaskActive(void);
void StartMatchCallFromScript(u8* script);
void sub_8197080(u8 *destStr);
#endif //GUARD_MATCH_CALL_H

View File

@ -44,5 +44,6 @@ u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void);
void ResetPokedexScrollPositions(void);
u16 sub_80C0944(void);
void CB2_Pokedex(void);
#endif // GUARD_POKEDEX_H

View File

@ -23,5 +23,6 @@ void LoadMonIconPalette(u16 species);
void sub_80D328C(struct Sprite *sprite);
void sub_80D3014(struct Sprite *sprite);
void sub_80D32C8(struct Sprite *sprite, u8 animNum);
u8 sub_80D30A0(u16 species);
#endif // GUARD_POKEMON_ICON_H

View File

@ -30,5 +30,6 @@ u32 sub_81D427C(void);
void sub_81D4998(void);
void sub_81D3640(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5);
void sub_81D3784(u16 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4);
void CB2_InitPokeNav(void);
#endif //GUARD_POKENAV_H

View File

@ -18,5 +18,6 @@ void sub_801B990(u32, u32);
u8 sub_8013F78(void);
bool32 sub_802C908(u16);
void nullsub_89(u8 taskId);
void var_800D_set_xB(void);
#endif //GUARD_rom_8011DC0_H

View File

@ -92,4 +92,7 @@ u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
u32 sub_8153634(u8 sector, u8* src);
void sub_8153688(u8 taskId);
// save_failed_screen.c
void DoSaveFailedScreen(u8 saveType);
#endif // GUARD_SAVE_H

View File

@ -61,4 +61,7 @@ bool32 sub_80991F8(void);
u8 *sub_8099244(void);
void sub_80992A0(u8 *script, u16 scriptSize);
// srccmd.h
void sub_809BE48(u16 npcId);
#endif // GUARD_SCRIPT_H

View File

@ -33,6 +33,8 @@ void sub_80E8B6C(void);
void sub_80E8BC8(void);
void sub_80E8D4C(void);
void EnableBothScriptContexts(void);
void ReceiveSecretBasesData(void *records, size_t recordSize, u8 linkIdx);
#endif //GUARD_SECRET_BASE_H

View File

@ -284,4 +284,8 @@ void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese);
u32 GetGlyphWidthFont1(u16 glyphId, bool32 isJapanese);
void DecompressGlyphFont9(u16 glyphId);
// unk_text_util_2.c
u16 Font6Func(struct TextPrinter *textPrinter);
u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese);
#endif // GUARD_TEXT_H

View File

@ -159,7 +159,7 @@ static void sub_8122804(struct EasyChatPair *s, u16 b, u8 c)
}
}
void ReceiveEasyChatPairsData(void *a, u32 b, u8 unused)
void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t size, u8 unused)
{
u16 i, j, r3, players;
struct EasyChatPair *buffer1, *buffer2, *src, *dst, *foo_of_buffer2;
@ -176,7 +176,7 @@ void ReceiveEasyChatPairsData(void *a, u32 b, u8 unused)
{
players = GetLinkPlayerCount();
for (i = 0; i < players; i++)
memcpy(&(buffer1[i * 5]), (u8 *)a + i * b, 40);
memcpy(&(buffer1[i * 5]), (u8 *)a + i * size, 40);
src = buffer1;
dst = buffer2;
r3 = 0;

View File

@ -141,7 +141,7 @@ void sub_81C7710(void);
static void InitKeys_(void);
static void FreeVars(void);
static void VblankCb_Pokenav(void);
static void Cb2_Pokenav(void);
static void CB2_Pokenav(void);
void sub_81C7C28(void);
void sub_81C72BC(void);
void sub_81C7B74(void);
@ -485,7 +485,7 @@ void sub_81C71E4(u8 taskId)
}
}
void CB2_PokeNav(void)
void CB2_InitPokeNav(void)
{
gUnknown_0203CF40 = Alloc(sizeof(*gUnknown_0203CF40));
if (gUnknown_0203CF40 == NULL)
@ -498,7 +498,7 @@ void CB2_PokeNav(void)
ResetTasks();
SetVBlankCallback(NULL);
CreateTask(sub_81C742C, 0);
SetMainCallback2(Cb2_Pokenav);
SetMainCallback2(CB2_Pokenav);
SetVBlankCallback(VblankCb_Pokenav);
}
}
@ -529,7 +529,7 @@ void sub_81C72BC(void)
FreeAllSpritePalettes();
SetVBlankCallback(NULL);
CreateTask(sub_81C742C, 0);
SetMainCallback2(Cb2_Pokenav);
SetMainCallback2(CB2_Pokenav);
SetVBlankCallback(VblankCb_Pokenav);
}
}
@ -588,7 +588,7 @@ static bool32 AnyMonHasRibbon(void)
return FALSE;
}
static void Cb2_Pokenav(void)
static void CB2_Pokenav(void)
{
RunTasks();
AnimateSprites();

View File

@ -1,13 +1,11 @@
// Includes
#include "global.h"
#include "battle_setup.h"
#include "event_data.h"
#include "string_util.h"
#include "battle.h"
#include "gym_leader_rematch.h"
#include "match_call.h"
extern void sub_8197080(u8 *dest);
extern const u8 gTrainerClassNames[][13];
// Static type declarations

View File

@ -34,9 +34,8 @@
#include "daycare.h"
#include "international_string_util.h"
#include "constants/battle_frontier.h"
#include "dewford_trend.h"
extern void ReceiveSecretBasesData(struct SecretBaseRecord *, size_t, u8);
extern void ReceiveEasyChatPairsData(struct EasyChatPair *, size_t, u8);
// Static type declarations

View File

@ -2,6 +2,7 @@
#include "reshow_battle_screen.h"
#include "battle.h"
#include "palette.h"
#include "pokemon.h"
#include "main.h"
#include "scanline_effect.h"
#include "text.h"
@ -18,8 +19,6 @@
extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[];
extern void SetMultiuseSpriteTemplateToTrainerBack(u16 backPicId, u8 battlerPosition);
// this file's functions
static void CB2_ReshowBattleScreenAfterMenu(void);
static bool8 LoadBattlerSpriteGfx(u8 battlerId);

View File

@ -12,8 +12,6 @@
extern const union AnimCmd *const gUnknown_085950E0[];
extern const union AnimCmd *const gUnknown_085954D0[];
extern void AnimMoveTwisterParticle(struct Sprite *);
void sub_81109F0(struct Sprite *);
void sub_8110AB4(struct Sprite *);
void AnimDirtParticleAcrossScreen(struct Sprite *);

View File

@ -33,8 +33,7 @@
#include "start_menu.h"
#include "data2.h"
#include "field_screen_effect.h"
extern void HealPlayerParty(void);
#include "script_pokemon_util_80F87D8.h"
struct UnkStruct_Shared
{

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "agb_flash.h"
#include "gba/flash_internal.h"
#include "fieldmap.h"
#include "save.h"
#include "task.h"
#include "decompress.h"
@ -8,6 +10,7 @@
#include "pokemon_storage_system.h"
#include "main.h"
#include "trainer_hill.h"
#include "link.h"
#include "constants/game_stat.h"
static u16 CalculateChecksum(void *data, u16 size);
@ -70,12 +73,6 @@ const struct SaveSectionOffsets gSaveSectionOffsets[] =
SAVEBLOCK_CHUNK(gPokemonStorage, 8),
};
extern void DoSaveFailedScreen(u8); // save_failed_screen
extern bool32 ProgramFlashSectorAndVerify(u8 sector, u8 *data);
extern void save_serialize_map(void);
extern void sub_800ADF8(void);
extern bool8 IsLinkTaskFinished(void);
// iwram common
u16 gLastWrittenSector;
u32 gLastSaveCounter;

View File

@ -43,8 +43,6 @@
#include "constants/species.h"
#include "constants/trainers.h"
extern void mapldr_default(void);
// Static type declarations
struct SecretBaseListMenuBuffer {

View File

@ -7,10 +7,12 @@
#include "event_object_movement.h"
#include "event_obj_lock.h"
#include "event_scripts.h"
#include "fieldmap.h"
#include "field_effect.h"
#include "field_player_avatar.h"
#include "field_specials.h"
#include "field_weather.h"
#include "field_screen_effect.h"
#include "frontier_pass.h"
#include "frontier_util.h"
#include "gpu_regs.h"
@ -26,6 +28,7 @@
#include "palette.h"
#include "party_menu.h"
#include "pokedex.h"
#include "pokenav.h"
#include "safari_zone.h"
#include "save.h"
#include "scanline_effect.h"
@ -40,6 +43,7 @@
#include "trainer_card.h"
#include "window.h"
#include "constants/songs.h"
#include "rom_8011DC0.h"
// Menu actions
enum
@ -84,18 +88,6 @@ EWRAM_DATA static u8 sSaveDialogTimer = 0;
EWRAM_DATA static bool8 sSavingComplete = FALSE;
EWRAM_DATA static u8 sSaveInfoWindowId = 0;
// Extern variables.
extern u8 gLocalLinkPlayerId;
// Extern functions in not decompiled files.
extern void sub_80AF688(void);
extern void var_800D_set_xB(void);
extern void sub_808B864(void);
extern void CB2_Pokedex(void);
extern void PlayRainStoppingSoundEffect(void);
extern void CB2_PokeNav(void);
extern void save_serialize_map(void);
// Menu action callbacks
static bool8 StartMenuPokedexCallback(void);
static bool8 StartMenuPokemonCallback(void);
@ -656,7 +648,7 @@ static bool8 StartMenuPokeNavCallback(void)
PlayRainStoppingSoundEffect();
RemoveExtraStartMenuWindows();
CleanupOverworldWindowsAndTilemaps();
SetMainCallback2(CB2_PokeNav); // Display PokeNav
SetMainCallback2(CB2_InitPokeNav); // Display PokeNav
return TRUE;
}

View File

@ -12,10 +12,6 @@
#include "menu.h"
#include "dynamic_placeholder_text_util.h"
extern u8 GetKeypadIconWidth(u8 keypadIconId);
extern u16 Font6Func(struct TextPrinter *textPrinter);
extern u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese);
EWRAM_DATA struct TextPrinter gTempTextPrinter = {0};
EWRAM_DATA struct TextPrinter gTextPrinters[NUM_TEXT_PRINTERS] = {0};

View File

@ -21,6 +21,7 @@
#include "gpu_regs.h"
#include "international_string_util.h"
#include "pokedex.h"
#include "pokemon_icon.h"
#include "graphics.h"
#include "pokemon_icon.h"
#include "trainer_pokemon_sprites.h"
@ -89,9 +90,6 @@ struct TrainerCardData
u8 language;
};
//external functions
extern u8 sub_80D30A0(u16);
// EWRAM
EWRAM_DATA struct TrainerCard gTrainerCards[4] = {0};
EWRAM_DATA static struct TrainerCardData *sData = NULL;

View File

@ -17,8 +17,6 @@
#include "constants/event_object_movement_constants.h"
#include "constants/field_effects.h"
extern void sub_809BE48(u16 npcId);
// this file's functions
static u8 CheckTrainer(u8 eventObjectId);
static u8 GetTrainerApproachDistance(struct EventObject *trainerObj);

View File

@ -214,7 +214,7 @@ static void DecompressGlyphFont6(u16 glyph)
gUnknown_03002F90.unk81 = 0x10;
}
u8 GetGlyphWidthFont6(void)
u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese)
{
return 0x10;
}

View File

@ -13,34 +13,33 @@
#include "constants/battle.h"
#include "constants/rgb.h"
extern void sub_810721C(struct Sprite *);
extern void sub_8107228(struct Sprite *);
extern void sub_8107260(struct Sprite *);
extern void sub_8107380(struct Sprite *);
extern void sub_8107408(struct Sprite *);
extern void sub_8107430(struct Sprite *);
extern void sub_810744C(struct Sprite *);
extern void sub_81074E4(struct Sprite *);
extern void sub_81075EC(struct Sprite *);
extern void sub_8107674(struct Sprite *);
extern void sub_8107730(struct Sprite *);
extern void sub_81077A4(struct Sprite *);
extern void sub_81077C0(struct Sprite *);
extern void sub_80A78AC(struct Sprite *);
extern void sub_8107894(struct Sprite *);
extern void sub_81078D0(struct Sprite *);
extern void sub_810790C(struct Sprite *);
extern void sub_8108034(struct Sprite *);
extern void sub_8108098(struct Sprite *);
extern void sub_810851C(struct Sprite *);
extern void sub_81087C0(struct Sprite *);
extern void sub_810886C(struct Sprite *);
extern void sub_8108B2C(struct Sprite *);
extern void sub_8108B94(struct Sprite *);
extern void sub_8108BE0(struct Sprite *);
extern void sub_8108C08(struct Sprite *);
extern void sub_8108C54(struct Sprite *);
extern void sub_8108CDC(struct Sprite *);
void sub_810721C(struct Sprite *);
void sub_8107228(struct Sprite *);
void sub_8107260(struct Sprite *);
void sub_8107380(struct Sprite *);
void sub_8107408(struct Sprite *);
void sub_8107430(struct Sprite *);
void sub_810744C(struct Sprite *);
void sub_81074E4(struct Sprite *);
void sub_81075EC(struct Sprite *);
void sub_8107674(struct Sprite *);
void sub_8107730(struct Sprite *);
void sub_81077A4(struct Sprite *);
void sub_81077C0(struct Sprite *);
void sub_8107894(struct Sprite *);
void sub_81078D0(struct Sprite *);
void sub_810790C(struct Sprite *);
void sub_8108034(struct Sprite *);
void sub_8108098(struct Sprite *);
void sub_810851C(struct Sprite *);
void sub_81087C0(struct Sprite *);
void sub_810886C(struct Sprite *);
void sub_8108B2C(struct Sprite *);
void sub_8108B94(struct Sprite *);
void sub_8108BE0(struct Sprite *);
void sub_8108C08(struct Sprite *);
void sub_8108C54(struct Sprite *);
void sub_8108CDC(struct Sprite *);
void sub_810756C(u8);
void sub_81076F4(u8);
void sub_8107B84(u8);