include/game.h file

Classes

struct OverworldLocation
struct struct_080FCCB4
struct struct_080FD964

Enums

enum EGameTaskState { GAMETASK_TRANSITION, GAMETASK_INIT, GAMETASK_MAIN, GAMETASK_EXIT }
Game tasks states.
enum EGameMainState { GAMEMAIN_INITROOM, GAMEMAIN_CHANGEROOM, GAMEMAIN_UPDATE, GAMEMAIN_CHANGEAREA, GAMEMAIN_MINISHPORTAL, GAMEMAIN_BARRELUPDATE, GAMEMAIN_RESERVED, GAMEMAIN_SUBTASK }
game task main substates

Functions

void ChangeLightLevel(s32 level)
Change the light level of the room.
void SetPopupState(u32 type, u32 choice_idx)
Set the dislayed popup state.
auto CheckAreaOverworld(u32 area) -> bool32
Check if an area is overworld (not dungeon or inside).
auto AreaIsOverworld(void) -> bool32
Check if the current area is overworld.
auto AreaIsDungeon(void) -> bool32
Check if the current area is a dungeon.
auto AreaHasEnemies(void) -> bool32
Check if the current area has enemies.
auto AreaHasNoEnemies(void) -> bool32
Check if the current area has no enemies.
auto AreaHasMap(void) -> bool32
Check if the current area has a map.
auto AreaHasKeys(void) -> bool32
Check if current area has keys.
auto AreaAllowsWarp(void) -> u32
This function was introduced to allow warping from indoor areas (palace of winds).
void sub_08052878(void)
Related to a music bug?
void ModDungeonKeys(s32 keys)
Modify the number of keys the player has for the current dungeon.
auto HasDungeonSmallKey(void) -> bool32
Check if the player has at least one small key for the current dungeon.
auto HasDungeonBigKey(void) -> bool32
Check if the player has the big key for the current dungeon.
auto HasDungeonCompass(void) -> bool32
Check if the player has the compass for the current dungeon.
auto HasDungeonMap(void) -> bool32
Check if the player has the map for the current dungeon.
auto ItemIsSword(u32 item) -> bool32
Check if item is a sword.
auto ItemIsShield(u32 item) -> bool32
Check if item is a shield.
auto GetBottleContaining(u32 item) -> u32
Get the index of the bottle containing the specified item.
void PutItemOnSlot(u32 item)
Put an item in A or B slot.
void ForceEquipItem(u32 item, u32 slot)
Force equip an item.
auto GetItemPrice(u32 item) -> s32
Get item price.
auto GetSaleItemConfirmMessageID(u32 item) -> u32
Get the item purchase enquiry message.
void LoadGfxGroups(void)
Automatically load overworld graphics groups.
void LoadAuxiliaryRoom(u32 area, u32 room)
Load an auxiliary room (no player present).
void InitRoom(void)
Initialize a loaded room.
void InitParachuteRoom(void)
Initialize a parachute room.
void RegisterTransitionManager(void* mgr, void(*)(void*) onEnter, void(*)(void*) onExit)
Register a manager for room changes.
void RoomExitCallback(void)
Call the room exit callback.
void RestoreGameTask(bool32 loadGfx)
Restore the game task from a subtask.
auto CanDispEzloMessage(void) -> bool32
Check if an Ezlo message can be displayed.
void DisplayEzloMessage(void)
Display an Ezlo message.
void SetWorldMapPos(u32 area, u32 room, u32 x, u32 y)
Set the player's world map position.
void SetDungeonMapPos(u32 area, u32 room, u32 x, u32 y)
Set the player's dungeon map position.
auto GetFlagBankOffset(u32 idx) -> u32
Get flag bank offset for area.
auto GetCurrentRoomInfo(void) -> RoomResInfo*
Retrieve information about the current room.
void sub_08052EA0(void)
void sub_08053250(void)
void sub_080533CC(void)
void StartDarkNutTimer(void)
void sub_080534AC(void)
void InitBiggoronTimer(void)
void ResetTmpFlags(void)
void UpdateFakeScroll(void)
If enabled, this type of transition does not change the room and keeps all entities.
void UpdatePlayerMapCoords(void)
void CreateMiscManager(void)
void CheckAreaDiscovery(void)
void UpdateTimerCallbacks(void)
void DecreasePortalTimer(void)
auto CheckRoomExit(void) -> bool32
auto CheckGameOver(void) -> bool32
void InitializePlayer(void)
void LoadRoomBgm(void)
void sub_0805329C(void)
void UpdatePlayerRoomStatus(void)
void sub_08054524(void)
void sub_08052FF4(u32 area, u32 room)
void InitScriptData(void)
void LoadItemGfx(void)
void CloneMapData(void)
This function is used to create a copy of the map data for temporary cutscene changes.
void InitializeCamera(void)
void ForceSetPlayerState(u32 framestate)
void sub_080186D4(void)
void sub_0806F364(void)
void UpdateRoomTracker(void)
void GenerateAreaHint(void)
void sub_0801AE44(bool32 loadGfx)
void sub_080ADE24(void)
void CleanUpGFXSlots(void)
void sub_08051F9C(u32 a1, u32 a2, u32 a3, u32 a4)
void UpdateBgAnimations(void)
void UpdateScroll(void)
void sub_08018710(u32 previousworldEventId)
void sub_0806F38C(void)
void sub_08052010(void)
void ModArrows(s32 arrows)
auto ItemIsBottle(u32 id) -> bool32
void ModShells(s32 shells)

Variables

const OverworldLocation gOverworldLocations
const struct_080FD964 gUnk_080FD964

Function documentation

void ChangeLightLevel(s32 level)

Change the light level of the room.

Parameters
level The new light level.

void SetPopupState(u32 type, u32 choice_idx)

Set the dislayed popup state.

Parameters
type The popup type.
choice_idx The choice index.

bool32 CheckAreaOverworld(u32 area)

Check if an area is overworld (not dungeon or inside).

Parameters
area The area to check.
Returns True if the area is overworld.

bool32 AreaIsOverworld(void)

Check if the current area is overworld.

Returns True if the current area is overworld.

bool32 AreaIsDungeon(void)

Check if the current area is a dungeon.

Returns True if the current area is a dungeon.

bool32 AreaHasEnemies(void)

Check if the current area has enemies.

Returns True if the current area has enemies.

bool32 AreaHasNoEnemies(void)

Check if the current area has no enemies.

Returns True if the current area has no enemies.

bool32 AreaHasMap(void)

Check if the current area has a map.

Returns True if the current area has a map.

bool32 AreaHasKeys(void)

Check if current area has keys.

Returns True if the current area has keys.

u32 AreaAllowsWarp(void)

This function was introduced to allow warping from indoor areas (palace of winds).

Returns True if the current area allows warping.

bool32 HasDungeonSmallKey(void)

Check if the player has at least one small key for the current dungeon.

Returns True if the player has a small key.

bool32 HasDungeonBigKey(void)

Check if the player has the big key for the current dungeon.

Returns True if the player has the big key.

bool32 HasDungeonCompass(void)

Check if the player has the compass for the current dungeon.

Returns True if the player has the compass.

bool32 HasDungeonMap(void)

Check if the player has the map for the current dungeon.

Returns True if the player has the map.

bool32 ItemIsSword(u32 item)

Check if item is a sword.

Parameters
item The item to check.
Returns True if the item is a sword.

bool32 ItemIsShield(u32 item)

Check if item is a shield.

Returns True if the item is a shield.

u32 GetBottleContaining(u32 item)

Get the index of the bottle containing the specified item.

Parameters
item The item to check.
Returns Bottle index, or 0 if the item is not in a bottle.

void PutItemOnSlot(u32 item)

Put an item in A or B slot.

Parameters
item The item to put.

void ForceEquipItem(u32 item, u32 slot)

Force equip an item.

Parameters
item The item to equip.
slot The slot to equip the item in.

s32 GetItemPrice(u32 item)

Get item price.

Parameters
item The item to get the price of.
Returns The price of the item.

u32 GetSaleItemConfirmMessageID(u32 item)

Get the item purchase enquiry message.

Parameters
item The item to get the message for.
Returns The message index.

void LoadAuxiliaryRoom(u32 area, u32 room)

Load an auxiliary room (no player present).

Parameters
area Area index.
room Room index.

void RegisterTransitionManager(void* mgr, void(*)(void*) onEnter, void(*)(void*) onExit)

Register a manager for room changes.

Parameters
mgr Manager to register.
onEnter Room enter callback.
onExit Room exit callback.

bool32 CanDispEzloMessage(void)

Check if an Ezlo message can be displayed.

Returns True if an Ezlo message can be displayed.

void SetWorldMapPos(u32 area, u32 room, u32 x, u32 y)

Set the player's world map position.

Parameters
area Area index.
room Room index.
x X position.
y Y position.

void SetDungeonMapPos(u32 area, u32 room, u32 x, u32 y)

Set the player's dungeon map position.

Parameters
area Area index.
room Room index.
x X position.
y Y position.

u32 GetFlagBankOffset(u32 idx)

Get flag bank offset for area.

Parameters
idx Area index.
Returns Flag bank offset.

RoomResInfo* GetCurrentRoomInfo(void)

Retrieve information about the current room.

Returns RoomResInfo object.