diff --git a/include/cable_club.h b/include/cable_club.h index ebdc82b46..60d56460d 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -15,5 +15,6 @@ void sub_80B360C(void); bool32 sub_80B2AF4(u16 *arg0, u16 *arg1); void sub_80B3AF8(u8 taskId); void task00_08081A90(u8 taskId); +bool32 sub_80B39D4(u8 linkPlayerIndex); #endif //GUARD_CABLE_CLUB_H diff --git a/include/field_camera.h b/include/field_camera.h index fdc4c5450..fecea244e 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -32,5 +32,6 @@ void SetCameraPanningCallback(void (*a)(void)); void SetCameraPanning(s16 a, s16 b); void InstallCameraPanAheadCallback(void); void UpdateCameraPanning(void); +void FieldUpdateBgTilemapScroll(void); #endif //GUARD_FIELD_CAMERA_H diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 3cc4a8324..738cceb3e 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -37,5 +37,7 @@ u8 sub_8068F18(void); bool8 dive_warp(struct MapPosition *position, u16 b); int SetCableClubWarp(void); u8 TrySetDiveWarp(void); +const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction); +u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position); #endif // GUARD_FIELDCONTROLAVATAR_H diff --git a/include/field_effect.h b/include/field_effect.h index 7620cedcd..205dbb68a 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -13,6 +13,7 @@ extern bool8 (*gFieldCallback2)(void); u32 FieldEffectStart(u8); bool8 FieldEffectActiveListContains(u8 id); +void FieldEffectActiveListClear(void); void sub_80B69DC(void); u8 AddNewGameBirchObject(s16, s16, u8); void FieldEffectStop(struct Sprite *sprite, u8 id); diff --git a/include/field_message_box.h b/include/field_message_box.h index 9515a54fd..58f782d9c 100644 --- a/include/field_message_box.h +++ b/include/field_message_box.h @@ -17,5 +17,6 @@ void HideFieldMessageBox(void); bool8 IsFieldMessageBoxHidden(void); u8 GetFieldMessageBoxMode(void); void sub_8098374(void); +void InitFieldMessageBox(void); #endif // GUARD_FIELD_MESSAGE_BOX_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 3aedec5de..45cd0dbd9 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -60,5 +60,8 @@ bool8 IsPlayerFacingSurfableFishableWater(void); bool8 IsPlayerSurfingNorth(void); void sub_808C228(u8 direction); u8 sub_808BCD0(void); +void sub_808B578(void); +u8 GetFRLGAvatarGraphicsIdByGender(u8); +u8 GetRSAvatarGraphicsIdByGender(u8); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index 7f12bcd36..2b8b3a5a3 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -40,5 +40,6 @@ void sub_80B0268(void); void sub_80B0534(void); void sub_80B058C(void); void sub_80B05B4(void); +void WriteFlashScanlineEffectBuffer(u8 flashLevel); #endif // GUARD_FIELD_SCREEN_EFFECT_H diff --git a/include/field_specials.h b/include/field_specials.h index 10433299b..981d65c0a 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -23,5 +23,7 @@ bool8 sub_813B9C0(void); void SetShoalItemFlag(u16 v0); void UpdateFrontierManiac(u16 a0); void UpdateFrontierGambler(u16 a0); +void ResetCyclingRoadChallengeData(void); +bool8 warp0_in_pokecenter(void); #endif // GUARD_FIELD_SPECIALS_H diff --git a/include/field_weather.h b/include/field_weather.h index 91dcef1dc..2d73f2b94 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -233,5 +233,6 @@ void SetSav1WeatherFromCurrMapHeader(void); void SetWeather(u32 weather); void DoCurrentWeather(void); void UpdateWeatherPerDay(u16 increment); +void sub_80AEE84(void); #endif // GUARD_WEATHER_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 3c7b7536d..24bc4989a 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -33,6 +33,12 @@ void InitMap(void); void InitMapFromSavedGame(void); void InitTrainerHillMap(void); void InitBattlePyramidMap(bool8 setPlayerPosition); +void copy_map_tileset1_tileset2_to_vram(struct MapLayout const *mapLayout); +void apply_map_tileset1_tileset2_palette(struct MapLayout const *mapLayout); +void apply_map_tileset2_palette(struct MapLayout const *mapLayout); +void copy_map_tileset2_to_vram_2(struct MapLayout const *mapLayout); +extern void copy_map_tileset1_to_vram(const struct MapLayout *); +extern void copy_map_tileset2_to_vram(const struct MapLayout *); void SpriteCB_PokeballGlow(struct Sprite *); void SpriteCB_PokecenterMonitor(struct Sprite *); diff --git a/include/link.h b/include/link.h index 9552f062c..52a631570 100644 --- a/include/link.h +++ b/include/link.h @@ -312,5 +312,7 @@ void sub_800AB18(void); void sub_8009F18(void); bool8 sub_800AA60(void); void sub_800ABF4(u16 a0); +bool32 sub_8009F3C(void); +u32 sub_800B4DC(void); #endif // GUARD_LINK_H diff --git a/include/link_rfu.h b/include/link_rfu.h index 08cab616c..d468d6c49 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -282,5 +282,6 @@ void sub_800EF7C(void); bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); s32 sub_800E87C(u8 idx); void sub_8011BA4(void); +void sub_8010198(void); #endif //GUARD_LINK_RFU_H diff --git a/include/match_call.h b/include/match_call.h index 1f431bfaf..17d40d41c 100644 --- a/include/match_call.h +++ b/include/match_call.h @@ -11,5 +11,6 @@ enum { }; s32 GetRematchIdxByTrainerIdx(s32 trainerIdx); +void InitMatchCallCounters(void); #endif //GUARD_MATCH_CALL_H diff --git a/include/secret_base.h b/include/secret_base.h index 4b44d4678..57ad81fee 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -22,6 +22,8 @@ void sub_80EB56C(void); void sub_80EB9E0(void); void sub_80EBB28(void); void WarpIntoSecretBase(const struct MapPosition *position, const struct MapEvents *events); +bool8 sub_80E909C(void); +void sub_80EB218(void); // SetCurrentSecretBaseFromPosition void sub_80E9608(const struct MapPosition *position, const struct MapEvents *events); diff --git a/include/tileset_anims.h b/include/tileset_anims.h new file mode 100755 index 000000000..17d883cd2 --- /dev/null +++ b/include/tileset_anims.h @@ -0,0 +1,9 @@ +#ifndef GUARD_TILESET_ANIMS_H +#define GUARD_TILESET_ANIMS_H + +void cur_mapheader_run_tileset_funcs_after_some_cpuset(void); +void sub_80A0A2C(void); +void sub_80A0A38(void); +void TransferTilesetAnimsBuffer(void); + +#endif // GUARD_TILESET_ANIMS_H diff --git a/src/field_specials.c b/src/field_specials.c index f2ebf2b8e..3c26085dd 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1956,7 +1956,7 @@ void sub_8139D98(void) } } -bool32 warp0_in_pokecenter(void) +bool8 warp0_in_pokecenter(void) { static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, 0xFFFF }; diff --git a/src/new_game.c b/src/new_game.c index 158120245..f68ed3d4f 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -8,6 +8,7 @@ #include "lottery_corner.h" #include "play_time.h" #include "mauville_old_man.h" +#include "match_call.h" #include "lilycove_lady.h" #include "load_save.h" #include "pokeblock.h" @@ -47,7 +48,6 @@ extern void NewGameInitPCItems(void); extern void ClearDecorationInventories(void); extern void ResetFanClub(void); extern void copy_strings_to_sav1(void); -extern void InitMatchCallCounters(void); extern void sub_801AFD8(void); extern void sub_800E5AC(void); extern void ResetContestLinkResults(void); diff --git a/src/overworld.c b/src/overworld.c index 2bc4f96d5..43610fe09 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -19,6 +19,7 @@ #include "field_tasks.h" #include "field_weather.h" #include "fieldmap.h" +#include "fldeff.h" #include "gpu_regs.h" #include "heal_location.h" #include "link.h" @@ -28,6 +29,7 @@ #include "alloc.h" #include "m4a.h" #include "map_name_popup.h" +#include "match_call.h" #include "menu.h" #include "metatile_behavior.h" #include "mirage_tower.h" @@ -42,14 +44,15 @@ #include "save.h" #include "save_location.h" #include "script.h" -// #include "script_pokemon_80C4.h" +#include "script_pokemon_util_80F87D8.h" #include "secret_base.h" #include "sound.h" #include "start_menu.h" #include "task.h" -// #include "tileset_anim.h" +#include "tileset_anims.h" #include "time_events.h" #include "trainer_hill.h" +#include "trainer_pokemon_sprites.h" #include "tv.h" #include "scanline_effect.h" #include "wild_encounter.h" @@ -85,71 +88,11 @@ extern const u8 gUnknown_082773F5[]; extern const u8 gUnknown_082774EF[]; extern const u8 gUnknown_08277509[]; -// vars extern const struct MapLayout *const gMapLayouts[]; extern const struct MapHeader *const *const gMapGroups[]; -extern const s32 gMaxFlashLevel; +extern const int gMaxFlashLevel; extern const u16 gUnknown_82EC7C4[]; -// functions -extern void HealPlayerParty(void); -extern void move_tilemap_camera_to_upper_left_corner(void); -extern void cur_mapheader_run_tileset_funcs_after_some_cpuset(void); -extern void DrawWholeMapView(void); -extern void copy_map_tileset1_tileset2_to_vram(const struct MapLayout *); -extern void apply_map_tileset1_tileset2_palette(const struct MapLayout *); -extern void ResetCyclingRoadChallengeData(void); -extern void ApplyNewEncryptionKeyToWord(u32 *word, u32 newKey); -extern void mapheader_run_script_with_tag_x5(void); -extern void ResetFieldTasksArgs(void); -extern void sub_80A0A2C(void); -extern void apply_map_tileset2_palette(const struct MapLayout *); -extern void copy_map_tileset2_to_vram_2(const struct MapLayout *); -extern void RestartWildEncounterImmunitySteps(void); -extern void ShowMapNamePopup(void); -extern bool32 sub_808651C(void); -extern bool8 sub_80AF6A4(void); -extern bool8 sub_80E909C(void); -extern void c2_change_map(void); -extern void sub_81D5DF8(void); -extern void sub_80EB218(void); -extern void sub_80AF3C8(void); -extern void sub_808B578(void); -extern void sub_80AF314(void); -extern void sub_80AF214(void); -extern void sub_80AF188(void); -extern void RotatingGate_InitPuzzleAndGraphics(void); -extern void sub_80AF168(void); -extern void sub_80AF3C8(void); -extern void ExecuteTruckSequence(void); -extern void sub_80A0A38(void); -extern void WriteFlashScanlineEffectBuffer(u8); -extern void InitMatchCallCounters(void); -extern void sub_80EDB44(void); -extern void InitFieldMessageBox(void); -extern void copy_map_tileset1_to_vram(const struct MapLayout *); -extern void copy_map_tileset2_to_vram(const struct MapLayout *); -extern void FieldUpdateBgTilemapScroll(void); -extern void TransferTilesetAnimsBuffer(void); -extern bool8 warp0_in_pokecenter(void); -extern void ResetAllPicSprites(void); -extern void FieldEffectActiveListClear(void); -extern void SetUpFieldTasks(void); -extern void ShowStartMenu(void); -extern void sub_80AEE84(void); -extern void mapldr_default(void); -extern bool32 sub_800F0B8(void); -extern bool32 sub_8009F3C(void); -extern void sub_8010198(void); -extern u32 sub_800B4DC(void); -extern bool32 sub_80B39D4(u8); -extern const u8* GetInteractedLinkPlayerScript(struct MapPosition *a1, u8, u8); -extern u8 *GetCoordEventScriptAtMapPosition(void*); -extern u8 GetFRLGAvatarGraphicsIdByGender(u8); -extern u8 GetRSAvatarGraphicsIdByGender(u8); -extern void UpdateEventObjectSpriteVisibility(struct Sprite*, u8); - -// this file's functions static void Overworld_ResetStateAfterWhiteOut(void); static void c2_80567AC(void); static void CB2_LoadMap2(void);