pokeemerald/include/overworld.h

159 lines
5.7 KiB
C
Raw Normal View History

2018-02-13 23:58:22 +00:00
#ifndef GUARD_OVERWORLD_H
#define GUARD_OVERWORLD_H
Decoration + decoration_inventory (#89) * SetDecorationInventoriesPointers * ClearDecorationInventories * CheckHasDecoration * DecorationAdd * DecorationCheckSpace * DecorationRemove * sub_8161A38 * CountDecorations; Funcion renaming * Disassemble decoration data structs, tilemaps, and descriptions * sub_8126968 * sub_81269D4 * through sub_8126A88 * through sub_8126B2C * sub_8126B80 * sub_8126C08 * sub_8126C48 * sub_8126CA4 * sub_8126D10 * sub_8126E44 * sub_8126E8C * sub_8126F68 * sub_8127058 * sub_8127088 * sub_81270E8 * through sub_8127208 * through sub_8127268 * sub_8127284 * through sub_81272F8 * sub_8127330 * through sub_8127480 * sub_81274A0 * sub_8127500; makefile now tells scaninc to scan headers * Actual real fix to mapfile being in build/emerald instead of wd * through sub_812759C * through sub_812764C * through sub_8127744 * through sub_81277BC * sub_81277E8 * sub_8127814 * through sub_81279C4 * through sub_8127ACC * sub_8127B04 * sub_8127B54 * sub_8127B90 * sub_8127D38 * sub_8127E18 * sub_8127F68 * sub_8128060 * ConfigureCameraObjectForPlacingDecoration * SetUpPlacingDecorationPlayerAvatar * sub_812826C * through sub_8128414 * through sub_81284F4 * sub_812853C * sub_8128950 * through sub_8128AAC * through sub_8128BBC * c1_overworld_prev_quest * sub_8128C64 * sub_8128CD4 * sub_8128D10 * sub_8128DB4 * through sub_8128E18 * through sub_8129068 * sub_8129088 * through sub_81291E8 * sub_812925C * sub_81292D0 * sub_81292E8 * gpu_pal_decompress_alloc_tag_and_upload * AddDecorationIconObjectFromIconTable * GetDecorationIconPicOrPalette * AddDecorationIconObjectFromFieldObject * AddDecorationIconObject * through sub_8129708 * sub_81297F8 * sub_81298EC * SetUpPuttingAwayDecorationPlayerAvatar * sub_8129ABC * sub_8129B34 * sub_8129BCC * through sub_8129C74 * through sub_8129D8C * sub_8129E0C * sub_8129E74 * sub_8129F20 * sub_8129FC8 * sub_812A040 * nonmatching sub_812A0E8 * through sub_812A22C * sub_812A25C * sub_812A2C4 * through sub_812A39C * Remaining fns in decoration.s * Decompile decoration headers * Decompile all remaining decoration data that had already been disassembled * Disassemble two data objects * Suggest structure of list menu template * decompile through decoration list menu template * Disassemble decoration icon graphics table * Rip icon gfx * Decompile deco icon table * Decompile more data related to drawing decorations * Decompile gUnknown_085A7250 structs * Decompile two sprite templates * Decompile remaining data in decoration.s * Decompile decoration ewram * deco -> decor
2017-10-22 22:55:07 +00:00
#define LINK_KEY_CODE_NULL 0x00
#define LINK_KEY_CODE_EMPTY 0x11
#define LINK_KEY_CODE_DPAD_DOWN 0x12
#define LINK_KEY_CODE_DPAD_UP 0x13
#define LINK_KEY_CODE_DPAD_LEFT 0x14
#define LINK_KEY_CODE_DPAD_RIGHT 0x15
2021-04-06 20:55:33 +00:00
#define LINK_KEY_CODE_READY 0x16
#define LINK_KEY_CODE_EXIT_ROOM 0x17
#define LINK_KEY_CODE_START_BUTTON 0x18
#define LINK_KEY_CODE_A_BUTTON 0x19
2021-04-06 20:55:33 +00:00
#define LINK_KEY_CODE_IDLE 0x1A
// These two are a hack to stop user input until link stuff can be
// resolved.
#define LINK_KEY_CODE_HANDLE_RECV_QUEUE 0x1B
#define LINK_KEY_CODE_HANDLE_SEND_QUEUE 0x1C
2021-04-06 20:55:33 +00:00
#define LINK_KEY_CODE_EXIT_SEAT 0x1D
#define LINK_KEY_CODE_UNK_8 0x1E
#define MOVEMENT_MODE_FREE 0
#define MOVEMENT_MODE_FROZEN 1
#define MOVEMENT_MODE_SCRIPTED 2
#define SKIP_OBJECT_EVENT_LOAD 1
struct InitialPlayerAvatarState
2017-10-12 07:06:19 +00:00
{
u8 transitionFlags;
u8 direction;
2017-10-12 07:06:19 +00:00
};
struct LinkPlayerObjectEvent
2017-10-12 07:06:19 +00:00
{
u8 active;
u8 linkPlayerId;
u8 objEventId;
u8 movementMode;
2017-10-12 07:06:19 +00:00
};
extern struct WarpData gLastUsedWarp;
extern struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4];
2018-02-13 23:58:22 +00:00
extern u16 *gOverworldTilemapBuffer_Bg2;
extern u16 *gOverworldTilemapBuffer_Bg1;
extern u16 *gOverworldTilemapBuffer_Bg3;
extern u16 gHeldKeyCodeToSend;
extern void (*gFieldCallback)(void);
2018-11-19 16:16:01 +00:00
extern bool8 (*gFieldCallback2)(void);
2019-02-27 03:04:44 +00:00
extern u8 gLocalLinkPlayerId;
2018-10-13 17:41:10 +00:00
extern u8 gFieldLinkPlayerCount;
extern const struct UCoords32 gDirectionToVectors[];
2017-10-12 07:06:19 +00:00
2018-02-12 14:01:43 +00:00
void DoWhiteOut(void);
void Overworld_ResetStateAfterFly(void);
void Overworld_ResetStateAfterTeleport(void);
void Overworld_ResetStateAfterDigEscRope(void);
void ResetGameStats(void);
void IncrementGameStat(u8 index);
u32 GetGameStat(u8 index);
void SetGameStat(u8 index, u32 value);
void ApplyNewEncryptionKeyToGameStats(u32 newKey);
2019-11-21 05:14:40 +00:00
void LoadObjEventTemplatesFromHeader(void);
void LoadSaveblockObjEventScripts(void);
2021-11-15 15:57:22 +00:00
void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y);
void SetObjEventTemplateMovementType(u8 localId, u8 movementType);
2018-06-20 22:41:51 +00:00
const struct MapLayout *GetMapLayout(void);
2018-02-12 14:01:43 +00:00
void ApplyCurrentWarp(void);
2018-05-09 10:07:56 +00:00
struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum);
struct MapHeader const *const GetDestinationWarpMapHeader(void);
void WarpIntoMap(void);
2018-12-27 22:30:47 +00:00
void SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetWarpDestinationToMapWarp(s8 mapGroup, s8 mapNum, s8 warpId);
void SetDynamicWarp(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId);
void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetWarpDestinationToDynamicWarp(u8 unused);
2022-06-01 16:41:57 +00:00
void SetWarpDestinationToHealLocation(u8 healLocationId);
2018-12-27 22:30:47 +00:00
void SetWarpDestinationToLastHealLocation(void);
void SetLastHealLocationWarp(u8 healLocationId);
2018-12-28 21:11:15 +00:00
void UpdateEscapeWarp(s16 x, s16 y);
2018-12-27 22:30:47 +00:00
void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetWarpDestinationToEscapeWarp(void);
void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
2018-12-27 22:30:47 +00:00
void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y);
2022-06-01 16:41:57 +00:00
void SetContinueGameWarpToHealLocation(u8 healLocationId);
2018-12-27 22:30:47 +00:00
void SetContinueGameWarpToDynamicWarp(int unused);
2018-02-13 23:58:22 +00:00
const struct MapConnection *GetMapConnection(u8 dir);
bool8 SetDiveWarpEmerge(u16 x, u16 y);
bool8 SetDiveWarpDive(u16 x, u16 y);
void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum);
void ResetInitialPlayerAvatarState(void);
void StoreInitialPlayerAvatarState(void);
2018-02-12 17:26:26 +00:00
bool32 Overworld_IsBikingAllowed(void);
void SetDefaultFlashLevel(void);
2021-11-15 15:57:22 +00:00
void SetFlashLevel(s32 flashLevel);
u8 GetFlashLevel(void);
2018-12-27 22:30:47 +00:00
void SetCurrentMapLayout(u16 mapLayoutId);
void SetObjectEventLoadFlag(u8 var);
2018-02-13 23:58:22 +00:00
u16 GetLocationMusic(struct WarpData *warp);
u16 GetCurrLocationDefaultMusic(void);
u16 GetWarpDestinationMusic(void);
void Overworld_ResetMapMusic(void);
void Overworld_PlaySpecialMapMusic(void);
void Overworld_SetSavedMusic(u16 songNum);
2018-02-12 17:26:26 +00:00
void Overworld_ClearSavedMusic(void);
2018-02-13 23:58:22 +00:00
void Overworld_ChangeMusicToDefault(void);
void Overworld_ChangeMusicTo(u16 newMusic);
u8 GetMapMusicFadeoutSpeed(void);
2018-12-08 20:42:36 +00:00
void TryFadeOutOldMapMusic(void);
bool8 BGMusicStopped(void);
2018-02-13 23:58:22 +00:00
void Overworld_FadeOutMapMusic(void);
void UpdateAmbientCry(s16 *state, u16 *delayCounter);
2018-02-12 14:01:43 +00:00
u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum);
2018-02-13 23:58:22 +00:00
u8 GetMapTypeByWarpData(struct WarpData *warp);
2018-12-27 22:30:47 +00:00
u8 GetCurrentMapType(void);
2018-10-17 00:11:44 +00:00
u8 GetLastUsedWarpMapType(void);
2019-03-01 06:49:11 +00:00
bool8 IsMapTypeOutdoors(u8 mapType);
2018-01-02 01:21:30 +00:00
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
2019-03-02 09:13:27 +00:00
bool8 IsMapTypeIndoors(u8 mapType);
2018-12-27 22:30:47 +00:00
u8 GetSavedWarpRegionMapSectionId(void);
u8 GetCurrentRegionMapSectionId(void);
2018-02-13 23:58:22 +00:00
u8 GetCurrentMapBattleScene(void);
2018-12-27 22:30:47 +00:00
void CleanupOverworldWindowsAndTilemaps(void);
bool32 IsOverworldLinkActive(void);
2018-02-13 23:58:22 +00:00
void CB1_Overworld(void);
void CB2_OverworldBasic(void);
void CB2_Overworld(void);
void SetMainCallback1(void (*cb)(void));
2022-06-01 16:41:57 +00:00
void SetUnusedCallback(void *func);
2018-02-13 23:58:22 +00:00
void CB2_NewGame(void);
void CB2_WhiteOut(void);
void CB2_LoadMap(void);
void CB2_ReturnToFieldContestHall(void);
2019-12-17 08:24:44 +00:00
void CB2_ReturnToFieldCableClub(void);
2018-02-13 23:58:22 +00:00
void CB2_ReturnToField(void);
void CB2_ReturnToFieldFromMultiplayer(void);
2018-02-13 23:58:22 +00:00
void CB2_ReturnToFieldWithOpenMenu(void);
void CB2_ReturnToFieldContinueScript(void);
void CB2_ReturnToFieldContinueScriptPlayMapMusic(void);
2021-04-06 20:55:33 +00:00
void CB2_ReturnToFieldFadeFromBlack(void);
2018-02-13 23:58:22 +00:00
void CB2_ContinueSavedGame(void);
void ResetAllMultiplayerState(void);
2021-04-06 20:55:33 +00:00
u32 GetCableClubPartnersReady(void);
u16 SetInCableClubSeat(void);
u16 SetLinkWaitingForScript(void);
u16 QueueExitLinkRoomKey(void);
2021-04-06 20:55:33 +00:00
u16 SetStartedCableClubActivity(void);
bool32 Overworld_IsRecvQueueAtMax(void);
2021-03-19 00:35:39 +00:00
bool32 Overworld_RecvKeysFromLinkIsRunning(void);
bool32 Overworld_SendKeysToLinkIsRunning(void);
bool32 IsSendingKeysOverCable(void);
void ClearLinkPlayerObjectEvents(void);
2018-01-01 16:41:34 +00:00
2018-02-13 23:58:22 +00:00
#endif // GUARD_OVERWORLD_H