Skip to Content
The Alchemy Project

src/scene/jupiter_lighthouse_ground_floor.c

The ground floor of Jupiter Lighthouse, inside its main gates. More…

Macros

NameDescription
#defineOWN_fdMapGridGetMetatileBehaviorThis unit declares its own form of fdMapGridGetMetatileBehavior, below.
#defineFLAG_GATES_BUTTON_HELD FLAG_SCENE_TEMP(0x00)Set while Felix stands on the button by the gates, which holds them open.
#defineEFFECT_SET_MODE fdActorSelectAnimation
#defineEFFECT_SET_SCRIPT fdActorStartScript
#defineMETATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Enumerations

NameDescription
enumanonymous enum { ACTOR_GATES_PILLAR }The stone pillar Felix pushes onto the button by the gates, after the two winged statues in ActorPlacements.
enumanonymous enum { GATES_BUTTON_METATILE_X, GATES_BUTTON_METATILE_Z }The button's metatile, which the pillar is moved onto.
enumanonymous enum { CUE_GATES_BUTTON, CUE_OFF_GATES_BUTTON }The step cues of the button: its metatile, and the eight metatiles round it that Felix steps off it onto.
enumanonymous enum { METATILE_BEHAVIOR_CYCLONE_TELEPORTER }The teleporter pad's metatile behavior, at metatile (29, 47).
enumanonymous enum { GATES_STAND_OPEN, GATES_SLIDE_OPEN }How scJupiterLighthouseOpenGates opens the gates.

Functions

NameDescription
Sint32fdMapGridGetMetatileBehavior (Sint32 x, Sint32 z, Sint32 layer)The ROM's callers here are compiled against this form, which returns an Sint32 where the definition returns a Uint8.
voidscJupiterLighthouseStepOnButton (void)Felix steps onto the purple button between the gates, metatile (17, 33): both gates slide open with a thud, and stay open while he stands on it.
voidscJupiterLighthouseStepOffButton (void)Felix steps off the purple button onto one of the metatiles round it: the gates he held open slide shut with a heavy thud.
const SCENE_ENTRANCE *scGetEntrances (void)Where the party can enter: the cave under the spring has its own entrances.
const SCENE_REGION *scGetExitRegions (void)The regions of the rooms whose exits are rectangles: the Chestbeaters' room and the stream room.
const Uint32 *scGetExits (void)The dock's ways lead back the way the party came into Lemuria, which the harbour and the shore of Ancient Lemuria note in FLAG_LEMURIA_OTHER_WAY_IN.
const ACTOR_PLACE *scGetActorPlacements (void)The scene's actor placements: a room of names for its entrance, else the debug room's.
voidscJupiterLighthouseLeaveByCyclone (void)Felix casts Cyclone on the purple teleporter pad, metatile (29, 47): the whirlwind takes the party back down to the basement's teleporters.
voidscJupiterLighthouseOpenGates (Sint32 how)Opens both sandstone gates: GATES_SLIDE_OPEN has them thud and slide open through their half-open picture, GATES_STAND_OPEN simply shows them open.
voidscJupiterLighthouseCloseGates (void)Slides both sandstone gates shut with a heavy thud, through their half-open picture.
voidscJupiterLighthouseCheckPillarOnButton (void)Opens the gates for good once the stone pillar stands on the button.
const CUE *scGetCues (void)The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's.
Sint32scInit (void)Sets up the floor: Felix arriving by the teleporter comes up in its ring of light, and the gates stand open while the pillar or Felix holds the button.
Sint32scPrepareMap (void)Sets the scene's arrival flags before the map is built.
voidsyGameFlagSetByte (Sint32 flag, Sint32 value)Sets the whole byte flags is in.
static inline voidscPaletteCycleSetTick (Sint32 value)Sets the palette cycle's tick counter.
Sint32scPosFlatDistance (FIXED *from, FIXED *to)The distance between two positions across the ground (x and z), in whole pixels.
voidscFieldEffectSpawn (Sint32 x, Sint32 y, Sint32 z, Sint32 velocityX, Sint32 velocityY, Sint32 velocityZ, Uint32 flags, const EFFECT_OPTIONS *options)Spawns a field effect at x, y, z moving at the velocity given, its type, scale, palette, priority, script, rotation, spin and update chosen by the EFFECT_USE_ flags from the options.
voidscLightSpritesSetPriority (Sint32 value)Sets the priority the lit actors' sprites are drawn at.
voidscCrackedTileCrack ()Cracks the tile under the leader, swapping in its cracked picture.
voidscCrackedTileFall ()A cracked tile gives way under Felix, who drops through it.

Variables

NameDescription
Sint32WhirlwindRidingThe state of the code every Jupiter Lighthouse room's overlay keeps its own copy of: a whirlwind's ride (shared/whirlwind_*.c), the palette cycle (shared/palette_cycle_step.c), the lit actors' sprites (shared/light_sprites_*.c) and the cracked tiles (shared/cracked_tile_*.c).
Uint16PaletteCycleColors [16]A copy of the room's cycling palette, BG palette CYCLE_PALETTE, which the cycle takes its colours from (scJupiterLighthouseLoadPalettes).
Uint16PaletteCycleUnlitPalette [2]Palette 13's first two colours; it is copied whole, with the unlit colours after them.
Uint16PaletteCycleUnlitColors [14]
Sint16LightSpriteTileThe glows drawn over the symbol blocks (scLightSpritesDraw): the VRAM cache entry of their tiles, how many actors carry one and which, their sprites, the large mode, the priority (-1 for each actor's own) and the picture row.
Sint16LightSpriteCount
LIGHT_OAMLightSpriteOams [16]
Sint16LightSpritesLarge
Sint16LightSpritePriority
METATILE_TARGETCrackedTilesThe cracked floors' metatiles, found by shared/cracked_tile_find.c.
extern Sint32PaletteCyclePausesInScripts
extern Sint32PaletteCycleTickThe palette cycle's tick, -1 before it starts, and whether scripts hold it (fdPaletteCycleStep).
extern Sint32WhirlwindEndScript []
Uint32SceneExits []The room has no exits of its own.
ACTOR_PLACEActorPlacements []The room's people: the party's four rows, then PSYNERGY_TEST_ACTOR_ID's.
CUESceneCues []The room's scripts: talking to its people, Mind Read on them, the metatiles examined, and the field Psynergy each spot answers.
const Sint32 *FieldEffectDurationScripts []The field effects' three scripts by how long an effect lasts: short, medium and long.

Description

The ground floor of Jupiter Lighthouse, inside its main gates. The party first comes in from below, rising out of the basement's Cyclone teleporter. Two sandstone gates close the passage north and south of a purple button at metatile (17, 33). Standing on the button holds them open (scJupiterLighthouseStepOnButton), and they slide shut as Felix steps off (scJupiterLighthouseStepOffButton); the stone pillar west of it, pushed or Moved three metatiles east onto the button, opens them for good (scJupiterLighthouseCheckPillarOnButton), so the way in from the lighthouse's entrance stays open. Cyclone on the teleporter pad at metatile (29, 47) takes the party back down (scJupiterLighthouseLeaveByCyclone).

Macros in detail

OWN_fdMapGridGetMetatileBehavior

#define OWN_fdMapGridGetMetatileBehavior

This unit declares its own form of fdMapGridGetMetatileBehavior, below.

Definition at line 13 of file jupiter_lighthouse_ground_floor.c.

FLAG_GATES_BUTTON_HELD

#define FLAG_GATES_BUTTON_HELD FLAG_SCENE_TEMP(0x00)

Set while Felix stands on the button by the gates, which holds them open.

Referenced by scInit(), scJupiterLighthouseStepOffButton() and scJupiterLighthouseStepOnButton().

Definition at line 26 of file jupiter_lighthouse_ground_floor.c.

EFFECT_SET_MODE

#define EFFECT_SET_MODE fdActorSelectAnimation

Referenced by EFFECT_SPAWN.

Definition at line 347 of file jupiter_lighthouse_ground_floor.c.

EFFECT_SET_SCRIPT

#define EFFECT_SET_SCRIPT fdActorStartScript

Referenced by EFFECT_SPAWN.

Definition at line 348 of file jupiter_lighthouse_ground_floor.c.

METATILE_PUSH_SLOT_ENTRY

#define METATILE_PUSH_SLOT_ENTRY syOAMAddSpriteAtDepthClamped

Referenced by scCrackedTileUpdate().

Definition at line 351 of file jupiter_lighthouse_ground_floor.c.

Enumerations in detail

anonymous enum

enum { ACTOR_GATES_PILLAR }

The stone pillar Felix pushes onto the button by the gates, after the two winged statues in ActorPlacements.

EnumeratorValueDescription
ACTOR_GATES_PILLARACTOR_FIRST_PLACED + 2

Definition at line 30 of file jupiter_lighthouse_ground_floor.c.

anonymous enum

enum { GATES_BUTTON_METATILE_X, GATES_BUTTON_METATILE_Z }

The button's metatile, which the pillar is moved onto.

EnumeratorValueDescription
GATES_BUTTON_METATILE_X17
GATES_BUTTON_METATILE_Z33

Definition at line 36 of file jupiter_lighthouse_ground_floor.c.

anonymous enum

enum { CUE_GATES_BUTTON, CUE_OFF_GATES_BUTTON }

The step cues of the button: its metatile, and the eight metatiles round it that Felix steps off it onto.

EnumeratorValueDescription
CUE_GATES_BUTTON20
CUE_OFF_GATES_BUTTON21

Definition at line 44 of file jupiter_lighthouse_ground_floor.c.

anonymous enum

enum { METATILE_BEHAVIOR_CYCLONE_TELEPORTER }

The teleporter pad's metatile behavior, at metatile (29, 47).

EnumeratorValueDescription
METATILE_BEHAVIOR_CYCLONE_TELEPORTER30

Definition at line 51 of file jupiter_lighthouse_ground_floor.c.

anonymous enum

enum { GATES_STAND_OPEN, GATES_SLIDE_OPEN }

How scJupiterLighthouseOpenGates opens the gates.

EnumeratorValueDescription
GATES_STAND_OPEN
GATES_SLIDE_OPEN

Definition at line 106 of file jupiter_lighthouse_ground_floor.c.

Functions in detail

scJupiterLighthouseStepOnButton

void scJupiterLighthouseStepOnButton(void)

Felix steps onto the purple button between the gates, metatile (17, 33): both gates slide open with a thud, and stay open while he stands on it.

References fdScriptGetFlag(), fdScriptSetFlag() and scJupiterLighthouseOpenGates().

Referenced by SceneCues.

Definition at lines 74 and 159 of file jupiter_lighthouse_ground_floor.c.

scJupiterLighthouseStepOffButton

void scJupiterLighthouseStepOffButton(void)

Felix steps off the purple button onto one of the metatiles round it: the gates he held open slide shut with a heavy thud. If the stone pillar has just been pushed onto the button, they open for good instead.

References fdScriptClearFlag(), fdScriptGetFlag(), scJupiterLighthouseCheckPillarOnButton() and scJupiterLighthouseCloseGates().

Referenced by SceneCues.

Definition at lines 75 and 171 of file jupiter_lighthouse_ground_floor.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References SceneEntrances.

Definition at line 77 of file jupiter_lighthouse_ground_floor.c.

scGetExitRegions

const SCENE_REGION *scGetExitRegions(void)

Definition at line 82 of file jupiter_lighthouse_ground_floor.c.

scGetExits

const Uint32 *scGetExits(void)

References SceneExits.

Definition at line 87 of file jupiter_lighthouse_ground_floor.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References ActorPlacements.

Definition at line 92 of file jupiter_lighthouse_ground_floor.c.

scJupiterLighthouseLeaveByCyclone

void scJupiterLighthouseLeaveByCyclone(void)

Felix casts Cyclone on the purple teleporter pad, metatile (29, 47): the whirlwind takes the party back down to the basement's teleporters.

References scFieldScriptSetExitRequest().

Referenced by SceneCues.

Definition at line 99 of file jupiter_lighthouse_ground_floor.c.

scJupiterLighthouseOpenGates

void scJupiterLighthouseOpenGates(Sint32 how)

Opens both sandstone gates: GATES_SLIDE_OPEN has them thud and slide open through their half-open picture, GATES_STAND_OPEN simply shows them open.

References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered(), fdScriptPlaySound(), Sint32 and sySynch().

Referenced by scInit(), scJupiterLighthouseCheckPillarOnButton() and scJupiterLighthouseStepOnButton().

Definition at line 114 of file jupiter_lighthouse_ground_floor.c.

scJupiterLighthouseCloseGates

void scJupiterLighthouseCloseGates(void)

Slides both sandstone gates shut with a heavy thud, through their half-open picture.

References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered(), fdScriptPlaySound() and sySynch().

Referenced by scJupiterLighthouseStepOffButton().

Definition at line 131 of file jupiter_lighthouse_ground_floor.c.

scJupiterLighthouseCheckPillarOnButton

void scJupiterLighthouseCheckPillarOnButton(void)

Opens the gates for good once the stone pillar stands on the button.

References fdActorGet(), fdScriptGetFlag(), fdScriptSetFlag() and scJupiterLighthouseOpenGates().

Referenced by scJupiterLighthouseFinishMovingBlock(), scJupiterLighthouseMoveButtonPillar() and scJupiterLighthouseStepOffButton().

Definition at line 144 of file jupiter_lighthouse_ground_floor.c.

scGetCues

const CUE *scGetCues(void)

References SceneCues.

Definition at line 183 of file jupiter_lighthouse_ground_floor.c.

scInit

Sint32 scInit(void)

Sets up the floor: Felix arriving by the teleporter comes up in its ring of light, and the gates stand open while the pillar or Felix holds the button.

References fdActorAppearInWhirlwind(), fdScriptGetFlag(), MainRoutineStateWork, scJupiterLighthouseOpenGates() and Sint32.

Definition at line 190 of file jupiter_lighthouse_ground_floor.c.

scPrepareMap

Sint32 scPrepareMap(void)

Sets the scene's arrival flags before the map is built. Returns 0.

References scSetArrivalFlags() and Sint32.

Definition at line 209 of file jupiter_lighthouse_ground_floor.c.

scPaletteCycleSetTick

static inline void scPaletteCycleSetTick(Sint32 value)

Sets the palette cycle's tick counter.

References PaletteCycleTick and Sint32.

Referenced by scJupiterLighthouseLoadPalettes() and scTrialRoadStartPaletteCycle().

Definition at line 226 of file jupiter_lighthouse_ground_floor.c.

scLightSpritesSetPriority

void scLightSpritesSetPriority(Sint32 value)

Sets the priority the lit actors' sprites are drawn at.

References LightSpritePriority and Sint32.

Referenced by scInit().

Definition at line 262 of file jupiter_lighthouse_ground_floor.c.

Variables in detail

WhirlwindRiding

Sint32 WhirlwindRiding

References Sint32.

Referenced by scInit(), scJupiterLighthouseRaiseUpperWhirlwind(), scJupiterLighthouseRaiseWhirlwind(), scJupiterLighthouseRideUpperWhirlwind(), scJupiterLighthouseRideWhirlwind() and scWhirlwindUpdate().

Definition at line 58 of file jupiter_lighthouse_ground_floor.c.

PaletteCycleColors

Uint16 PaletteCycleColors[16]

Referenced by fdPaletteCycleFade(), fdPaletteCycleStep(), scJupiterLighthouseLoadPalettes() and scPaletteSetColorsFade().

Definition at line 59 of file jupiter_lighthouse_ground_floor.c.

PaletteCycleUnlitPalette

Uint16 PaletteCycleUnlitPalette[2]

Palette 13's first two colours; it is copied whole, with the unlit colours after them.

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 62 of file jupiter_lighthouse_ground_floor.c.

PaletteCycleUnlitColors

Uint16 PaletteCycleUnlitColors[14]

Referenced by scJupiterLighthouseLoadPalettes().

Definition at line 63 of file jupiter_lighthouse_ground_floor.c.

LightSpriteTile

Sint16 LightSpriteTile

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 64 of file jupiter_lighthouse_ground_floor.c.

LightSpriteCount

Sint16 LightSpriteCount

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesAdd(), scLightSpritesAddCounted(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 65 of file jupiter_lighthouse_ground_floor.c.

LightSpriteOams

LIGHT_OAM LightSpriteOams[16]

Referenced by scLightSpritesDraw().

Definition at line 67 of file jupiter_lighthouse_ground_floor.c.

LightSpritesLarge

Sint16 LightSpritesLarge

Referenced by scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow() and scLightSpritesInitPathGlows().

Definition at line 68 of file jupiter_lighthouse_ground_floor.c.

LightSpritePriority

Sint16 LightSpritePriority

Referenced by scAnemosInnerSanctumDullahanSetLightPriority(), scAnemosInnerSanctumDullahanStartLightSprites(), scLightSpritesDraw(), scLightSpritesInitChannelPieces(), scLightSpritesInitEnergyBlockGlow(), scLightSpritesInitPathGlows() and scLightSpritesSetPriority().

Definition at line 69 of file jupiter_lighthouse_ground_floor.c.

CrackedTiles

METATILE_TARGET CrackedTiles

Referenced by scCrackedTileFind(), scCrackedTilePlaceLanding(), scCrackedTileStep() and scCrackedTileUpdate().

Definition at line 70 of file jupiter_lighthouse_ground_floor.c.

PaletteCyclePausesInScripts

extern Sint32 PaletteCyclePausesInScripts

Sint32 PaletteCyclePausesInScripts

References Sint32.

Referenced by fdPaletteCycleStep(), scJupiterLighthouseLoadPalettes() and scPaletteCycleSetPausesInScripts().

Definition at lines 219 and 326 of file jupiter_lighthouse_ground_floor.c.

PaletteCycleTick

extern Sint32 PaletteCycleTick

Sint32 PaletteCycleTick

References Sint32.

Referenced by fdPaletteCycleStep() and scPaletteCycleSetTick().

Definition at lines 223 and 324 of file jupiter_lighthouse_ground_floor.c.

WhirlwindEndScript

extern Sint32 WhirlwindEndScript[]

Sint32 WhirlwindEndScript[]

References Sint32.

Referenced by scWhirlwindUpdate().

Definition at lines 237 and 328 of file jupiter_lighthouse_ground_floor.c.

SceneExits

Uint32 SceneExits[]

Referenced by scGetExits().

Definition at line 273 of file jupiter_lighthouse_ground_floor.c.

ActorPlacements

ACTOR_PLACE ActorPlacements[]

Referenced by scGetActorPlacements().

Definition at line 292 of file jupiter_lighthouse_ground_floor.c.

SceneCues

CUE SceneCues[]

References scJupiterLighthouseFinishMovingBlock(), scJupiterLighthouseLeaveByCyclone(), scJupiterLighthouseStepOffButton() and scJupiterLighthouseStepOnButton().

Referenced by scGetCues().

Definition at line 302 of file jupiter_lighthouse_ground_floor.c.

FieldEffectDurationScripts

const Sint32 *FieldEffectDurationScripts[]

extern const Sint32 *FieldEffectDurationScripts[]

References FieldEffectLongScript, FieldEffectMediumScript, FieldEffectShortScript and Sint32.

Referenced by fdEffectSpawnResident(), scFieldEffectSpawn() and scFieldEffectSpawnLocal().

Definition at lines 335 and 345 of file jupiter_lighthouse_ground_floor.c.