Skip to Content
The Alchemy Project

struct HEAP_SLOTS

The heap's 64 words in IWRAM (HeapSlotsWork, 0x03000000): the two pools' next free addresses, then each slot's block once allocated, else null.

Declared in definitions.h.

Fields

NameDescription
void *nextEwramThe EWRAM pool's next free byte.
void *nextIwramThe IWRAM pool's next free byte.
Uint8 *matrixStacksyPushMatrix's save area, one matrix deep.
void *spriteAnimationsThe actor system's sprite animations.
void *spritesThe actor system's sprite pool.
struct ACTOR *actorsThe 64 actors.
struct ACTOR_SYSTEM_STATE *actorSystemThe actor system's state.
void *worldMapAffineThe world map's affine state.
void *mapGridThe field map's scrolling state, or on the world map its perspective view (WORLD_MAP_VIEW).
struct BATTLE_STATE *battleStateA battle's state, from btRun on.
void *battleScanlinesThe battle background's scanline state.
void *battleUnusedUnused: 640 bytes btRun allocates with the battle's other blocks, which nothing reads or writes.
void *cameraStateThe 3D camera (BATTLE_CAMERA) of a battle, the world map or the dice games.
void *unusedAfterCameraNo code allocates or reads this slot.
void *tileScratchA scratch buffer, usually 1 KB, that a picture is decoded into and released as soon as its tiles are in VRAM.
Uint8 *windowStateThe window renderer's state (WIN_STATE).
void *partyStatusThe party status window's layout.
void *glyphTransferThe buffers an icon or portrait is decoded through.
void *selectionMenuThe selection screen's state.
void *unusedAfterSelectionMenuNo code allocates or reads this slot.
void *frameScratchLives for one tick: sySynch() builds the OAM list in it, and the field sprite decoder keeps its code there between its own uses.
void *pictureUploaderA RAM copy of
void *mindReadfdRenderCopyStridedCode, which uploads field sprite pictures to VRAM.
void *battleEffectThe running battle effect's own state.
void *battleCanvasThe running battle effect's pixel canvas.
void *battleSheetThe running battle effect's tile sheet.
Sint32 (*ramCode )(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height)A function run from RAM: the canvas drawing function btEffectBuildBlitter writes (a DRAW_RECTANGLE), or the world map's copy of fdWorldMapUpdateAffineLines, which the world map calls as its own.
void *fieldStateA field scene's FIELD_STATE.
void *paletteCyclesThe palette cycles.
void *weatherThe running ground particles, motes or sparkles.
void *fieldBlendThe field's colour blend state.
struct SCREEN_TRANSITION_STATE *screenTransitionThe screen transition: the window edges and dissolve of a scene change.
void *paletteFadeThe palette fade that moves the BG and sprite palettes toward target colours (PALETTE_FADE).
void *unusedAfterPaletteFadeNo code allocates or reads this slot.
void *lineScrollThe line scroll's state.
void *unusedAfterLineScrollNo code allocates or reads this slot.
void *groundMaskThe ground mask's state (GROUND_MASK_STATE).
struct BATTLE_MESSAGE_STATE *battleMsgThe battle message window.
void *unusedAfterBattleMsgNo code allocates or reads this slot.
struct ROPE_WORK *ropeA rope's state.
struct TIGHTROPE_WORK *tightropeA tightrope's state.
void *hangingVineA hanging vine's state (HANGING_VINE_WORK).
void *battleEntryTimerThe battle's entry transition timer, in ticks.
void *titleIntroThe title intro's state.
struct BATTLE_BACKGROUND_STATE *battleBgThe battle background's view and entry transition (32 bytes), from btRun.
Uint16 *canvasMapThe dice games' sprites, or a field Psynergy's canvas map.
void *unusedAfterCanvasMapNo code allocates this slot.
Sint32 (*ramCodePaired )(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height)A second function as ramCode, released before it: always a btEffectBuildBlitter function, the second of a pair.
void *unusedAfterRamCodePairedNo code allocates or reads this slot.
void *unusedBeforeMsgDecoderNo code allocates or reads this slot.
void *msgDecoderThe message decoder function (TextDecodeSymbol), copied here to run for the length of one message's decoding.
void *bupStateThe save workspace, around each save or load.
void *settingsMenuThe settings menu's state.
void *unusedAfterSettingsMenuNo code allocates or reads this slot.
void *enemyUnitsEach linked console's party, from btRun.
void *menuStateThe menu state shared by the field menu's screens and the shop; each takes it on opening and releases it on closing.
void *fieldEffectStateThe Psynergy effect's state.
void *battleMenuStateThe battle menus' BATTLE_MENU_STATE.
void *iconMenuA command icon menu's state.
void *trialRoadLinkThe Trial Road's link state.
void *canvasSpriteA field Psynergy's canvas sprite.
void *unusedAfterCanvasSpriteNo code allocates or reads this slot.
void *arcEffectA field Psynergy's arc state.
Sint32 *djinniHintsThe Djinn the Naribwe fortune teller may hint at, 320 bytes, while she picks one (naribwe_rooms.c).

Description

The heap's 64 words in IWRAM (HeapSlotsWork, 0x03000000): the two pools' next free addresses, then each slot's block once allocated, else null.

struct HEAP_SLOTS

Referenced by btEffectRunBind(), btEffectRunCriticalHit(), btEffectRunDjinnBeams(), btEffectRunHeartbreak(), btEffectRunMercury(), btEffectRunStreakVolley(), btEffectRunSwirlSwipe(), btEffectRunThorn(), btEffectRunUnusedTriangleStrike(), btEffectRunVenus(), btEffectRunVine(), btEffectRunWhiplash(), btStagingRunItem(), btStagingRunPsynergyCast(), btTransitionRun(), fdCameraWorldToScreen(), fdEffectInitSparkles(), fdMotesStart(), fdPsynergyMarkWorldMapTilesUsed(), fdPsynergyParch(), fdWeatherStartRain(), mnMessageDecode(), mnStatusScreenRun(), scGabombaStatueChamberAkafubuOffersToHelp(), scInit(), syHeapAllocate(), syHeapAllocateEWRAM(), syHeapFillFreeWords(), syHeapGetRemainingEWRAM(), syHeapGetRemainingIWRAM(), syHeapInit(), syHeapSlotAllocate() and syHeapSlotAllocateEWRAM().

Definition at line 774 of file definitions.h.

Fields in detail

nextEwram

void *nextEwram

The EWRAM pool's next free byte.

nextIwram

void *nextIwram

The IWRAM pool's next free byte.

matrixStack

Uint8 *matrixStack

syPushMatrix's save area, one matrix deep.

spriteAnimations

void *spriteAnimations

The actor system's sprite animations.

sprites

void *sprites

The actor system's sprite pool.

actors

struct ACTOR *actors

The 64 actors.

actorSystem

struct ACTOR_SYSTEM_STATE *actorSystem

The actor system's state.

worldMapAffine

void *worldMapAffine

The world map's affine state.

mapGrid

void *mapGrid

The field map's scrolling state, or on the world map its perspective view (WORLD_MAP_VIEW).

battleState

struct BATTLE_STATE *battleState

A battle's state, from btRun on.

battleScanlines

void *battleScanlines

The battle background's scanline state.

battleUnused

void *battleUnused

Unused: 640 bytes btRun allocates with the battle's other blocks, which nothing reads or writes.

cameraState

void *cameraState

The 3D camera (BATTLE_CAMERA) of a battle, the world map or the dice games.

unusedAfterCamera

void *unusedAfterCamera

No code allocates or reads this slot.

tileScratch

void *tileScratch

A scratch buffer, usually 1 KB, that a picture is decoded into and released as soon as its tiles are in VRAM.

windowState

Uint8 *windowState

The window renderer's state (WIN_STATE).

partyStatus

void *partyStatus

The party status window's layout.

glyphTransfer

void *glyphTransfer

The buffers an icon or portrait is decoded through.

selectionMenu

void *selectionMenu

The selection screen's state.

unusedAfterSelectionMenu

void *unusedAfterSelectionMenu

No code allocates or reads this slot.

frameScratch

void *frameScratch

Lives for one tick: sySynch() builds the OAM list in it, and the field sprite decoder keeps its code there between its own uses.

pictureUploader

void *pictureUploader

A RAM copy of

mindRead

void *mindRead

fdRenderCopyStridedCode, which uploads field sprite pictures to VRAM.

Mind Read's wave state.

battleEffect

void *battleEffect

The running battle effect's own state. The dice games keep their own state in this slot and the next two.

battleCanvas

void *battleCanvas

The running battle effect's pixel canvas.

battleSheet

void *battleSheet

The running battle effect's tile sheet.

ramCode

Sint32 (*ramCode)(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height)

A function run from RAM: the canvas drawing function btEffectBuildBlitter writes (a DRAW_RECTANGLE), or the world map's copy of fdWorldMapUpdateAffineLines, which the world map calls as its own.

fieldState

void *fieldState

A field scene's FIELD_STATE.

paletteCycles

void *paletteCycles

The palette cycles.

weather

void *weather

The running ground particles, motes or sparkles.

fieldBlend

void *fieldBlend

The field's colour blend state.

screenTransition

struct SCREEN_TRANSITION_STATE *screenTransition

The screen transition: the window edges and dissolve of a scene change.

paletteFade

void *paletteFade

The palette fade that moves the BG and sprite palettes toward target colours (PALETTE_FADE).

unusedAfterPaletteFade

void *unusedAfterPaletteFade

No code allocates or reads this slot.

lineScroll

void *lineScroll

The line scroll's state.

unusedAfterLineScroll

void *unusedAfterLineScroll

No code allocates or reads this slot.

groundMask

void *groundMask

The ground mask's state (GROUND_MASK_STATE).

battleMsg

struct BATTLE_MESSAGE_STATE *battleMsg

The battle message window.

unusedAfterBattleMsg

void *unusedAfterBattleMsg

No code allocates or reads this slot.

rope

struct ROPE_WORK *rope

A rope's state.

tightrope

struct TIGHTROPE_WORK *tightrope

A tightrope's state.

hangingVine

void *hangingVine

A hanging vine's state (HANGING_VINE_WORK).

battleEntryTimer

void *battleEntryTimer

The battle's entry transition timer, in ticks.

titleIntro

void *titleIntro

The title intro's state.

battleBg

struct BATTLE_BACKGROUND_STATE *battleBg

The battle background's view and entry transition (32 bytes), from btRun.

canvasMap

Uint16 *canvasMap

The dice games' sprites, or a field Psynergy's canvas map.

unusedAfterCanvasMap

void *unusedAfterCanvasMap

No code allocates this slot.

ramCodePaired

Sint32 (*ramCodePaired)(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height)

A second function as ramCode, released before it: always a btEffectBuildBlitter function, the second of a pair.

unusedAfterRamCodePaired

void *unusedAfterRamCodePaired

No code allocates or reads this slot.

unusedBeforeMsgDecoder

void *unusedBeforeMsgDecoder

No code allocates or reads this slot.

msgDecoder

void *msgDecoder

The message decoder function (TextDecodeSymbol), copied here to run for the length of one message's decoding.

bupState

void *bupState

The save workspace, around each save or load.

settingsMenu

void *settingsMenu

The settings menu's state.

unusedAfterSettingsMenu

void *unusedAfterSettingsMenu

No code allocates or reads this slot.

enemyUnits

void *enemyUnits

Each linked console's party, from btRun.

void *menuState

The menu state shared by the field menu's screens and the shop; each takes it on opening and releases it on closing.

fieldEffectState

void *fieldEffectState

The Psynergy effect's state.

battleMenuState

void *battleMenuState

The battle menus' BATTLE_MENU_STATE.

iconMenu

void *iconMenu

A command icon menu's state.

void *trialRoadLink

The Trial Road's link state.

canvasSprite

void *canvasSprite

A field Psynergy's canvas sprite.

unusedAfterCanvasSprite

void *unusedAfterCanvasSprite

No code allocates or reads this slot.

arcEffect

void *arcEffect

A field Psynergy's arc state.

djinniHints

Sint32 *djinniHints

The Djinn the Naribwe fortune teller may hint at, 320 bytes, while she picks one (naribwe_rooms.c).