src/gameUtils.c file

Game Utils.

Classes

struct PopupOption

Functions

auto StairsAreValid(void) -> u32
void ClearFlagArray(const u16*)
void DummyHandler(u32* a1)
void DarknutTimerHandler(u32* a1)
void BiggoronTimerHandler(u32* a1)
void InitAllRoomResInfo(void)
void InitRoomResInfo(RoomResInfo* info, RoomHeader* hdr, u32 area, u32 room)
void sub_080532E4(void)
void ResetTimerFlags(void)
void SetPopupState(u32 type, u32 choice_idx)
Set the dislayed popup state.
void InitializePlayer(void)
auto AreaIsOverworld(void) -> bool32
Check if the current area is overworld.
auto CheckAreaOverworld(u32 area) -> bool32
Check if an area is overworld (not dungeon or inside).
auto AreaAllowsWarp(void) -> bool32
This function was introduced to allow warping from indoor areas (palace of winds).
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 ModHealth(s32 delta) -> s32
void ModRupees(s32 delta)
void ModDungeonKeys(s32 keys)
Modify the number of keys the player has for the current dungeon.
auto AreaHasKeys(void) -> bool32
Check if current area has keys.
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.
void RestoreGameTask(bool32 loadGfx)
Restore the game task from a subtask.
void LoadRoomBgm(void)
void sub_08052878(void)
Related to a music bug?
void sub_0805289C(void)
auto CheckGameOver(void) -> bool32
void RoomExitCallback(void)
Call the room exit callback.
auto CheckRoomExit(void) -> bool32
void InitParachuteRoom(void)
Initialize a parachute room.
void InitRoomTransition(void)
auto CanDispEzloMessage(void) -> bool32
Check if an Ezlo message can be displayed.
void DisplayEzloMessage(void)
Display an Ezlo message.
void DecreasePortalTimer(void)
void UpdatePlayerMapCoords(void)
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.
void InitRoom(void)
Initialize a loaded room.
auto GetFlagBankOffset(u32 idx) -> u32
Get flag bank offset for area.
void RegisterTransitionManager(void* mgr, void(*)() onEnter, void(*)() onExit)
Set manager responsible for handling room changes.
auto GetCurrentRoomInfo(void) -> RoomResInfo*
Retrieve information about the current room.
void sub_08052EA0(void)
auto sub_08052EF4(s32 idx) -> u32
void UpdateFakeScroll(void)
If enabled, this type of transition does not change the room and keeps all entities.
void LoadAuxiliaryRoom(u32 area, u32 room)
Load an auxiliary room (no player present).
void sub_08052FF4(u32 area, u32 room)
void ChangeLightLevel(s32 level)
Change the light level of the room.
void sub_080530B0(void)
void UpdateGlobalProgress(void)
Update the global progress (0 - 10).
auto sub_08053144(void) -> u32
void CheckAreaDiscovery(void)
void UpdatePlayerRoomStatus(void)
void sub_08053250(void)
void sub_0805329C(void)
void LoadGfxGroups(void)
Automatically load overworld graphics groups.
void LoadItemGfx(void)
void sub_080533CC(void)
void UpdateTimerCallbacks(void)
void StartDarkNutTimer(void)
void sub_080534AC(void)
void InitBiggoronTimer(void)
void ResetTmpFlags(void)

Variables

void** gAreaTileSets
void** gAreaRoomMaps
void* gAreaTiles
void** gAreaTable
u8 gUnk_0200AF14
u8 gPaletteBufferBackup

Function documentation

void SetPopupState(u32 type, u32 choice_idx)

Set the dislayed popup state.

Parameters
type The popup type.
choice_idx The choice index.

bool32 AreaIsOverworld(void)

Check if the current area is overworld.

Returns True if the current area is overworld.

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 AreaAllowsWarp(void)

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

Returns True if the current area allows warping.

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.

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 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.

void LoadAuxiliaryRoom(u32 area, u32 room)

Load an auxiliary room (no player present).

Parameters
area Area index.
room Room index.

void ChangeLightLevel(s32 level)

Change the light level of the room.

Parameters
level The new light level.

void UpdateGlobalProgress(void)

Update the global progress (0 - 10).

There are 10 different indicators of game completion: 9 : Flag SEIIKI_STAINED_GLASS 8 : Flag LV5_CLEAR 7 : Flag OUBO_KAKERA 6 : Flag LV4_CLEAR 5 : Flag LV3_CLEAR 4 : Flag SOUGEN_08_TORITSUKI 2 : Flag LV1_CLEAR 1 : Default }