2018-02-14 00:58:22 +01:00
|
|
|
#ifndef GUARD_OVERWORLD_H
|
|
|
|
#define GUARD_OVERWORLD_H
|
2017-10-23 00:55:07 +02:00
|
|
|
|
2019-02-10 09:54:50 +01: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 22:55:33 +02:00
|
|
|
#define LINK_KEY_CODE_READY 0x16
|
2019-02-11 02:42:50 +01:00
|
|
|
#define LINK_KEY_CODE_EXIT_ROOM 0x17
|
2019-02-10 09:54:50 +01:00
|
|
|
#define LINK_KEY_CODE_START_BUTTON 0x18
|
|
|
|
#define LINK_KEY_CODE_A_BUTTON 0x19
|
2021-04-06 22:55:33 +02:00
|
|
|
#define LINK_KEY_CODE_IDLE 0x1A
|
2019-02-10 09:54:50 +01:00
|
|
|
|
2019-02-11 02:42:50 +01:00
|
|
|
// 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 22:55:33 +02:00
|
|
|
#define LINK_KEY_CODE_EXIT_SEAT 0x1D
|
2019-02-11 02:42:50 +01:00
|
|
|
#define LINK_KEY_CODE_UNK_8 0x1E
|
|
|
|
|
|
|
|
#define MOVEMENT_MODE_FREE 0
|
|
|
|
#define MOVEMENT_MODE_FROZEN 1
|
|
|
|
#define MOVEMENT_MODE_SCRIPTED 2
|
|
|
|
|
2020-06-20 01:58:56 +02:00
|
|
|
#define SKIP_OBJECT_EVENT_LOAD 1
|
|
|
|
|
2018-09-05 00:31:37 +02:00
|
|
|
struct InitialPlayerAvatarState
|
2017-10-12 09:06:19 +02:00
|
|
|
{
|
2018-09-05 00:31:37 +02:00
|
|
|
u8 transitionFlags;
|
|
|
|
u8 direction;
|
2017-10-12 09:06:19 +02:00
|
|
|
};
|
|
|
|
|
2019-11-21 04:55:44 +01:00
|
|
|
struct LinkPlayerObjectEvent
|
2017-10-12 09:06:19 +02:00
|
|
|
{
|
|
|
|
u8 active;
|
|
|
|
u8 linkPlayerId;
|
2019-11-21 04:55:44 +01:00
|
|
|
u8 objEventId;
|
2019-02-11 02:42:50 +01:00
|
|
|
u8 movementMode;
|
2017-10-12 09:06:19 +02:00
|
|
|
};
|
|
|
|
|
2018-04-18 14:12:41 +02:00
|
|
|
// Exported RAM declarations
|
2018-09-05 00:31:37 +02:00
|
|
|
extern struct WarpData gLastUsedWarp;
|
2019-11-21 04:55:44 +01:00
|
|
|
extern struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4];
|
2018-02-14 00:58:22 +01:00
|
|
|
|
2018-04-18 14:12:41 +02:00
|
|
|
extern u16 *gBGTilemapBuffers1;
|
|
|
|
extern u16 *gBGTilemapBuffers2;
|
|
|
|
extern u16 *gBGTilemapBuffers3;
|
2019-02-10 09:54:50 +01:00
|
|
|
extern u16 gHeldKeyCodeToSend;
|
2018-05-11 01:36:57 +02:00
|
|
|
extern void (*gFieldCallback)(void);
|
2018-11-19 17:16:01 +01:00
|
|
|
extern bool8 (*gFieldCallback2)(void);
|
2019-02-27 04:04:44 +01:00
|
|
|
extern u8 gLocalLinkPlayerId;
|
2018-10-13 19:41:10 +02:00
|
|
|
extern u8 gFieldLinkPlayerCount;
|
|
|
|
|
2018-04-18 14:12:41 +02:00
|
|
|
// Exported ROM declarations
|
2018-09-05 00:31:37 +02:00
|
|
|
extern const struct UCoords32 gDirectionToVectors[];
|
2017-10-12 09:06:19 +02:00
|
|
|
|
2018-02-12 15:01:43 +01: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 06:14:40 +01:00
|
|
|
void LoadObjEventTemplatesFromHeader(void);
|
|
|
|
void LoadSaveblockObjEventScripts(void);
|
|
|
|
void Overworld_SetObjEventTemplateCoords(u8 localId, s16 x, s16 y);
|
|
|
|
void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType);
|
2018-06-21 00:41:51 +02:00
|
|
|
const struct MapLayout *GetMapLayout(void);
|
2018-02-12 15:01:43 +01:00
|
|
|
void ApplyCurrentWarp(void);
|
2018-05-09 12:07:56 +02:00
|
|
|
struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum);
|
2018-09-05 00:31:37 +02:00
|
|
|
struct MapHeader const *const GetDestinationWarpMapHeader(void);
|
|
|
|
void WarpIntoMap(void);
|
2018-12-27 23:30:47 +01: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);
|
|
|
|
void SetWarpDestinationToHealLocation(u8 a1);
|
|
|
|
void SetWarpDestinationToLastHealLocation(void);
|
|
|
|
void SetLastHealLocationWarp(u8 healLocationId);
|
2018-12-28 22:11:15 +01:00
|
|
|
void UpdateEscapeWarp(s16 x, s16 y);
|
2018-12-27 23:30:47 +01:00
|
|
|
void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
|
|
|
|
void SetWarpDestinationToEscapeWarp(void);
|
2018-09-05 00:31:37 +02:00
|
|
|
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 23:30:47 +01:00
|
|
|
void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y);
|
|
|
|
void SetContinueGameWarpToHealLocation(u8 a1);
|
|
|
|
void SetContinueGameWarpToDynamicWarp(int unused);
|
2018-02-14 00:58:22 +01:00
|
|
|
const struct MapConnection *GetMapConnection(u8 dir);
|
2018-09-05 00:31:37 +02:00
|
|
|
bool8 SetDiveWarpEmerge(u16 x, u16 y);
|
|
|
|
bool8 SetDiveWarpDive(u16 x, u16 y);
|
2019-02-22 08:23:46 +01:00
|
|
|
void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum);
|
2018-09-05 00:31:37 +02:00
|
|
|
void ResetInitialPlayerAvatarState(void);
|
|
|
|
void StoreInitialPlayerAvatarState(void);
|
2018-02-12 18:26:26 +01:00
|
|
|
bool32 Overworld_IsBikingAllowed(void);
|
|
|
|
void SetDefaultFlashLevel(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void Overworld_SetFlashLevel(s32 flashLevel);
|
|
|
|
u8 Overworld_GetFlashLevel(void);
|
2018-12-27 23:30:47 +01:00
|
|
|
void SetCurrentMapLayout(u16 mapLayoutId);
|
2020-06-20 01:58:56 +02:00
|
|
|
void SetObjectEventLoadFlag(u8 var);
|
2018-02-14 00:58:22 +01: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 18:26:26 +01:00
|
|
|
void Overworld_ClearSavedMusic(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void Overworld_ChangeMusicToDefault(void);
|
|
|
|
void Overworld_ChangeMusicTo(u16 newMusic);
|
|
|
|
u8 GetMapMusicFadeoutSpeed(void);
|
2018-12-08 21:42:36 +01:00
|
|
|
void TryFadeOutOldMapMusic(void);
|
2018-09-05 00:31:37 +02:00
|
|
|
bool8 BGMusicStopped(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void Overworld_FadeOutMapMusic(void);
|
|
|
|
void UpdateAmbientCry(s16 *state, u16 *delayCounter);
|
2018-02-12 15:01:43 +01:00
|
|
|
u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum);
|
2018-02-14 00:58:22 +01:00
|
|
|
u8 GetMapTypeByWarpData(struct WarpData *warp);
|
2018-12-27 23:30:47 +01:00
|
|
|
u8 GetCurrentMapType(void);
|
2018-10-17 02:11:44 +02:00
|
|
|
u8 GetLastUsedWarpMapType(void);
|
2019-03-01 07:49:11 +01:00
|
|
|
bool8 IsMapTypeOutdoors(u8 mapType);
|
2018-01-02 02:21:30 +01:00
|
|
|
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
|
2019-03-02 10:13:27 +01:00
|
|
|
bool8 IsMapTypeIndoors(u8 mapType);
|
2018-12-27 23:30:47 +01:00
|
|
|
u8 GetSavedWarpRegionMapSectionId(void);
|
|
|
|
u8 GetCurrentRegionMapSectionId(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
u8 GetCurrentMapBattleScene(void);
|
2018-12-27 23:30:47 +01:00
|
|
|
void CleanupOverworldWindowsAndTilemaps(void);
|
2019-02-10 09:54:50 +01:00
|
|
|
bool32 IsUpdateLinkStateCBActive(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void CB1_Overworld(void);
|
|
|
|
void CB2_OverworldBasic(void);
|
|
|
|
void CB2_Overworld(void);
|
|
|
|
void SetMainCallback1(void (*cb)(void));
|
2019-02-11 02:42:50 +01:00
|
|
|
void SetUnusedCallback(void *a0);
|
2018-02-14 00:58:22 +01:00
|
|
|
void CB2_NewGame(void);
|
|
|
|
void CB2_WhiteOut(void);
|
|
|
|
void CB2_LoadMap(void);
|
2020-06-20 01:58:56 +02:00
|
|
|
void CB2_ReturnToFieldContestHall(void);
|
2019-12-17 09:24:44 +01:00
|
|
|
void CB2_ReturnToFieldCableClub(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void CB2_ReturnToField(void);
|
2019-02-10 09:54:50 +01:00
|
|
|
void CB2_ReturnToFieldFromMultiplayer(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void CB2_ReturnToFieldWithOpenMenu(void);
|
|
|
|
void CB2_ReturnToFieldContinueScript(void);
|
2018-07-25 06:18:23 +02:00
|
|
|
void CB2_ReturnToFieldContinueScriptPlayMapMusic(void);
|
2021-04-06 22:55:33 +02:00
|
|
|
void CB2_ReturnToFieldFadeFromBlack(void);
|
2018-02-14 00:58:22 +01:00
|
|
|
void CB2_ContinueSavedGame(void);
|
2019-02-10 09:54:50 +01:00
|
|
|
void ResetAllMultiplayerState(void);
|
2021-04-06 22:55:33 +02:00
|
|
|
u32 GetCableClubPartnersReady(void);
|
|
|
|
u16 SetInCableClubSeat(void);
|
|
|
|
u16 SetLinkWaitingForScript(void);
|
2019-02-11 02:42:50 +01:00
|
|
|
u16 QueueExitLinkRoomKey(void);
|
2021-04-06 22:55:33 +02:00
|
|
|
u16 SetStartedCableClubActivity(void);
|
2021-03-19 01:35:39 +01:00
|
|
|
bool32 Overworld_LinkRecvQueueLengthMoreThan2(void);
|
|
|
|
bool32 Overworld_RecvKeysFromLinkIsRunning(void);
|
|
|
|
bool32 Overworld_SendKeysToLinkIsRunning(void);
|
|
|
|
bool32 IsSendingKeysOverCable(void);
|
2019-11-21 04:55:44 +01:00
|
|
|
void ClearLinkPlayerObjectEvents(void);
|
2018-01-01 17:41:34 +01:00
|
|
|
|
2018-02-14 00:58:22 +01:00
|
|
|
#endif // GUARD_OVERWORLD_H
|