src/common.c file

Classes

struct PaletteGroup
struct GfxItem
struct struct_02017AA0
struct PACKED

Enums

enum DungeonMapObjectTypes { DMO_TYPE_NONE, DMO_TYPE_PLAYER, DMO_TYPE_CHEST, DMO_TYPE_ENTRY, DMO_TYPE_BOSS }

Functions

static void StoreKeyInput(Input* input, u32 keyInput)
void ClearOAM(void)
void ResetScreenRegs(void)
void MessageFromFusionTarget(u32)
void sub_0801E24C(s32, s32)
void sub_0801E290(u32, u32, u32)
auto GetIndexInKinstoneBag(u32) -> s32
auto sub_0807CB24(u32, u32) -> u32
void SortKinstoneBag(void)
auto GetRoomProperty(u32 area, u32 room, u32 property) -> void*
auto sub_0801DF10(const DungeonLayout* lyt) -> u32
auto IsRoomVisited(TileEntity* tileEntity, u32 bank) -> bool32
auto sub_0801DF60(u32 a1, u8* p) -> u32
auto sub_0801DF78(u32 a1, u32 a2) -> u32
void DrawMapPixel(u32 x, u32 y, s32 color)
void sub_0801E64C(s32 x1, s32 y1, s32 x2, s32 y2, s32 offset)
auto DecToHex(u32 value) -> u32
auto ReadBit(void* src, u32 bit) -> u32
auto WriteBit(void* src, u32 bit) -> u32
auto ClearBit(void* src, u32 bit) -> u32
void MemFill16(u32 value, void* dest, u32 size)
Fill memory with 16 bit value.
void MemFill32(u32 value, void* dest, u32 size)
Fill memory with 32 bit value.
void MemClear(void* dest, u32 size)
Clear memory.
void MemCopy(const void* src, void* dest, u32 size)
Copy memory.
void ReadKeyInput(void)
Refresh gInput from system registers.
void LoadPaletteGroup(u32 group)
Loads a packed group of palettes.
void LoadPalettes(const u8* src, s32 destPaletteNum, s32 numPalettes)
void SetColor(u32 colorIndex, u32 color)
Set color in the palette.
void SetFillColor(u32 color, u32 disable_layers)
void LoadGfxGroup(u32 group)
Loads a packed group of tiles.
void sub_0801D898(void* dest, void* src, u32 word, u32 size)
auto zMalloc(u32 size) -> void*
Allocate memory on heap.
void zFree(void* ptr)
Free memory from heap.
void zMallocInit(void)
Initialize the heap.
void DispReset(bool32 refresh)
Reset All display system registers.
auto sub_0801DB94(void) -> u32
void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size)
void sub_0801DD58(u32 area, u32 room)
void LoadDungeonMap(void)
void DrawDungeonFeatures(u32 floor, void* data, u32 size)
void InitializeFuseInfo(Entity* entity, u32 textIndex, u32 cancelledTextIndex, u32 fusingTextIndex)
auto PerformFuseAction(void) -> u32
void Fuse_Action0(void)
void Fuse_Action1(void)
void Fuse_Action2(void)
void Fuse_Action3(void)
void sub_0801E104(void)
void sub_0801E120(void)
void sub_0801E154(u32 a1)
void sub_0801E160(u32 a1, u32 a2, u32 a3)
void sub_0801E1B8(u32 a1, u32 a2)
void sub_0801E1EC(u32 a1, u32 a2, u32 a3)
void sub_0801E31C(u32 sp00, u32 sp04, s32 r10, s32 r9)
void sub_0801E49C(s32 baseX, s32 baseY, s32 radius, u32 baseAngle)
void NotifyFusersOnFusionDone(KinstoneId kinstoneId)
void AddKinstoneToBag(KinstoneId kinstoneId)
void RemoveKinstoneFromBag(KinstoneId kinstoneId)
auto GetAmountInKinstoneBag(KinstoneId kinstoneId) -> u32
auto CheckKinstoneFused(KinstoneId kinstoneId) -> u32
auto CheckFusionMapMarkerDisabled(KinstoneId kinstoneId) -> bool32
auto GetIndexInKinstoneBag(KinstoneId kinstoneId) -> s32
void UpdateVisibleFusionMapMarkers(void)
auto GetFusionToOffer(Entity* entity) -> KinstoneId
auto GetRandomSharedFusion(u8* fuserData) -> u32

Variables

u8 gUnk_03003DE0
u8 gzHeap
u8 gUnk_02035542
u32 gDungeonMap
s16 gUnk_02018EE0
void(*const gFuseActions
struct_02017AA0 gUnk_02017AA0
const PaletteGroup* gPaletteGroups
const u8 gGlobalGfxAndPalettes
u32 gUsedPalettes
u16 gPaletteBuffer
const GfxItem* gGfxGroups
const u32 gUnk_080C9460
u8 gMapData
const DungeonLayout*const *const gDungeonLayouts
u8 gMapDataBottomSpecial
u8* gUnk_08001DCC
const u16 gUnk_080C93E0
const DungeonLayout gDungeonLayouts_None_None
const DungeonLayout*const gDungeonLayouts_None
const DungeonLayout gDungeonLayouts_DeepwoodShrine_1F
const DungeonLayout gDungeonLayouts_DeepwoodShrine_B1
const DungeonLayout gDungeonLayouts_DeepwoodShrine_B2
const DungeonLayout*const gDungeonLayouts_DeepwoodShrine
const DungeonLayout gDungeonLayouts_CaveOfFlames_1F
const DungeonLayout gDungeonLayouts_CaveOfFlames_B1
const DungeonLayout gDungeonLayouts_CaveOfFlames_B2
const DungeonLayout gDungeonLayouts_CaveOfFlames_B3
const DungeonLayout*const gDungeonLayouts_CaveOfFlames
const DungeonLayout gDungeonLayouts_FortressOfWinds_3F
const DungeonLayout gDungeonLayouts_FortressOfWinds_2F
const DungeonLayout gDungeonLayouts_FortressOfWinds_1F
const DungeonLayout*const gDungeonLayouts_FortressOfWinds
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B1
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B2
const DungeonLayout gDungeonLayouts_TempleOfDroplets_B3
const DungeonLayout*const gDungeonLayouts_TempleOfDroplets
const DungeonLayout gDungeonLayouts_PalaceOfWinds_5F
const DungeonLayout gDungeonLayouts_PalaceOfWinds_4F
const DungeonLayout gDungeonLayouts_PalaceOfWinds_3F
const DungeonLayout gDungeonLayouts_PalaceOfWinds_2F
const DungeonLayout gDungeonLayouts_PalaceOfWinds_1F
const DungeonLayout*const gDungeonLayouts_PalaceOfWinds
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_3F
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_2F
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_1F
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_B1
const DungeonLayout gDungeonLayouts_DarkHyruleCastle_B2
const DungeonLayout*const gDungeonLayouts_DarkHyruleCastle
const DungeonFloorMetadata gDungeonFloorMetadatas
const KinstoneWorldEvent gKinstoneWorldEvents
const u32 gUnk_080CA06C
const u8 SharedFusions

Function documentation

void MemFill16(u32 value, void* dest, u32 size)

Fill memory with 16 bit value.

Parameters
value Fill value.
dest Destination.
size Byte count.

void MemFill32(u32 value, void* dest, u32 size)

Fill memory with 32 bit value.

Parameters
value Fill value.
dest Destination.
size Byte count.

void MemClear(void* dest, u32 size)

Clear memory.

Parameters
dest Destination
size Byte count.

void MemCopy(const void* src, void* dest, u32 size)

Copy memory.

Parameters
src Source.
dest Destination.
size Byte count.

void LoadPaletteGroup(u32 group)

Loads a packed group of palettes.

Parameters
group Group number.

void SetColor(u32 colorIndex, u32 color)

Set color in the palette.

Parameters
colorIndex Color index.
color Color.

void LoadGfxGroup(u32 group)

Loads a packed group of tiles.

Parameters
group Group number.

void* zMalloc(u32 size)

Allocate memory on heap.

Parameters
size u32 Size to be allocated.
Returns Pointer to allocated memory.

The heap size is 0x1000 bytes and should be used sparingly. It is customary for entities store the returned pointer in the Entity.myHeap field.

void zFree(void* ptr)

Free memory from heap.

Parameters
ptr Pointer to be freed.

The Entity system will automatically free the pointer stored in the Entity.myHeap field.

void DispReset(bool32 refresh)

Reset All display system registers.

Parameters
refresh Request refresh of HUD layer (bg 0).