Skip to Content
The Alchemy Project

include/scene/scene_puzzles.h

Dungeon and room puzzle structs, metatile keys, cracked-tile constants, traps, springs, doors and thawed map offsets shared by scenes.

Included by scene.h.

Structures

NameDescription
structCELLA map metatile, or a step between metatiles, kept as one 8-byte pair.
structANKOHL_RUINS_SPROne of the eight sprites the sand draws: where it starts, how the level moves it, and its OAM entry as syOAMAddSpriteAtDepthClamped takes it.
structANKOHL_RUINS_SPR_STATEAnkohl Ruins' sand (AnkohlRuinsSand): its sprites' VRAM cache entry, its level, map layer 1's offset before it rose, and its eight sprites.
structANKOHL_RUINS_SAND_ROWA block of metatiles the sand fills in Ankohl Ruins once its level reaches level: width by height metatiles from (x, z).
structPUZZLE_METATILEA metatile of Gabomba Statue's channel puzzle: its kind, whether it is blocked, its shape and what stands on it.
structTRAP_ENTRYA row of a scene's trap table, ended by an actor of 0xffff: an actor and its flag.
structSPRING_TOSS_MOTIONLemuria spring's toss (LemuriaSpringToss): the tick the coin is let go, its trail of positions and its shadow, its velocity, and the ticks the spring still draws it in.
structSPRING_OBSTACLEOne of the spring's moving obstacles: its position and heading, and the timers its motion and its hits keep.
structLEMURIAN_SHIP_WARPA door of the Lemurian ship: the step cue it answers, its opening's metatile animation and the metatile it opens at.
structSPOTA place on the Sea of Time's lap, in 16.16 pixels.
structSPOTSThe six places of the Sea of Time's lap where spray rises once the lap has been run more than three times.
structSAVED_COLThe 14 colours of BG palette 3 (entries 1 to 14) that the fade returns to, copied from palette RAM by scInit and rotated by scSeaOfTimeAnimateSea in step with BG palette entries 49 to 62.
structTREASURE_ISLE_METATILEA spiky rock's metatile on Treasure Isle (scTreasureIsleRaiseSpikyRock).

Macros

NameDescription
#definePILLAR_SINK_DEPTH 32How far a pillar sinks, its top then level with the floor: into the floor as Blaze at a torch lowers it in Magma Rock, and into its gap as Move drops it in Jupiter Lighthouse.
#defineMETATILE_KEY (x, z) (((x) << 16) + (z))The metatile stampers of Air's Rock's and Magma Rock's insides keep the last metatile they stamped under the leader in one word, x in the high half and z in the low (scAirsRockInsideStampMetatileUnderLeader, scMagmaRockInsideStampStepMetatile): the word for metatile (x, z), and the x and z a word holds.
#defineMETATILE_KEY_X (key) ((key) >> 16)
#defineMETATILE_KEY_Z (key) ((key) & 0xffff)
#defineMARS_LIGHTHOUSE_THAWED_MAPS

Enumerations

NameDescription
enumanonymous enum { METATILE_BEHAVIOR_CRACKED_TILE }The metatile behavior of a cracked tile in the Jupiter Lighthouse rooms with cracked floors (the left tower's lower room, the cracked floor room and the right tower's upper room), the kind scCrackedTileFind looks for; a tile takes the next one up as it cracks.
enumanonymous enum { THROUGH_CRACKED_TILE }The fall through such a tile to the floor below, on the room's own map: the exit it takes and the entrance it lands at share the number.

Variables

NameDescription
extern charMapIndexMarsLighthouseOutsideMapsWork holds Mars Lighthouse's nineteen maps twice, from its outside to its Venus ledge: frozen, then again in the colours the lighthouse takes once it is thawed (FLAG_MARS_LIGHTHOUSE_THAWED).
extern charMapIndexMarsLighthouseOutsideThawed

Description

Dungeon and room puzzle structs, metatile keys, cracked-tile constants, traps, springs, doors and thawed map offsets shared by scenes.

Macros in detail

PILLAR_SINK_DEPTH

#define PILLAR_SINK_DEPTH 32

How far a pillar sinks, its top then level with the floor: into the floor as Blaze at a torch lowers it in Magma Rock, and into its gap as Move drops it in Jupiter Lighthouse.

Referenced by scInit(), scPrepareMap() and SinkPillar().

Definition at line 20 of file scene_puzzles.h.

METATILE_KEY

#define METATILE_KEY(x, z) (((x) << 16) + (z))

The metatile stampers of Air's Rock's and Magma Rock's insides keep the last metatile they stamped under the leader in one word, x in the high half and z in the low (scAirsRockInsideStampMetatileUnderLeader, scMagmaRockInsideStampStepMetatile): the word for metatile (x, z), and the x and z a word holds.

Referenced by scAirsRockInsideRestoreMetatileBehindLeader(), scAirsRockInsideStampMetatileUnderLeader(), scAirsRockInsideStampOtherMetatileUnderLeader(), scAirsRockInsideStampWideMetatileUnderLeader(), scMagmaRockInsideStampOtherStepMetatile(), scMagmaRockInsideStampStepMetatile() and scMagmaRockInsideTrackStepMetatile().

Definition at line 151 of file scene_puzzles.h.

METATILE_KEY_X

#define METATILE_KEY_X(key) ((key) >> 16)

Referenced by scAirsRockInsideRestoreMetatileBehindLeader() and scMagmaRockInsideTrackStepMetatile().

Definition at line 152 of file scene_puzzles.h.

METATILE_KEY_Z

#define METATILE_KEY_Z(key) ((key) & 0xffff)

Referenced by scAirsRockInsideRestoreMetatileBehindLeader() and scMagmaRockInsideTrackStepMetatile().

Definition at line 153 of file scene_puzzles.h.

MARS_LIGHTHOUSE_THAWED_MAPS

#define MARS_LIGHTHOUSE_THAWED_MAPS

Referenced by scMarsLighthouseStarRoomUseMarsStar() and scPrepareMap().

Definition at line 161 of file scene_puzzles.h.

Enumerations in detail

anonymous enum

enum { METATILE_BEHAVIOR_CRACKED_TILE }

The metatile behavior of a cracked tile in the Jupiter Lighthouse rooms with cracked floors (the left tower's lower room, the cracked floor room and the right tower's upper room), the kind scCrackedTileFind looks for; a tile takes the next one up as it cracks.

EnumeratorValueDescription
METATILE_BEHAVIOR_CRACKED_TILE33

Definition at line 169 of file scene_puzzles.h.

anonymous enum

enum { THROUGH_CRACKED_TILE }

The fall through such a tile to the floor below, on the room's own map: the exit it takes and the entrance it lands at share the number.

EnumeratorValueDescription
THROUGH_CRACKED_TILE13

Definition at line 176 of file scene_puzzles.h.

Variables in detail

MapIndexMarsLighthouseOutside

extern char MapIndexMarsLighthouseOutside

MapsWork holds Mars Lighthouse's nineteen maps twice, from its outside to its Venus ledge: frozen, then again in the colours the lighthouse takes once it is thawed (FLAG_MARS_LIGHTHOUSE_THAWED). A frozen map's thawed copy is MARS_LIGHTHOUSE_THAWED_MAPS rows on, the distance the linker gives between the two first rows (map/resources.s).

Definition at line 159 of file scene_puzzles.h.

MapIndexMarsLighthouseOutsideThawed

extern char MapIndexMarsLighthouseOutsideThawed

Definition at line 160 of file scene_puzzles.h.