The Lemurian ship's hidden harbor at Lalivero, and the end of the game. More...
Go to the source code of this file.
Data Structures | |
| struct | WaveMapLayer |
| The map's scrolling layers, as the swell moves them. More... | |
| struct | WaveMap |
| The map work, seen for the scrolling layers the swell moves. More... | |
| struct | RippleScrollWork |
| The water's ripple, this scene's view of the HBlank scroll work (gHBlankScrollWork, struct DisplayScrollWork): two pages of per-line scroll offsets, swapped each frame, built from a sine table. More... | |
| struct | CurtainSprite |
| The curtains: three columns of eight 32 by 8 sprites that close in from the sides as the ship sails. More... | |
Macros | |
| #define | LEMURIAN_SHIP_DEPARTURE_DELAY_FRAMES 80 |
| #define | ACTOR_SPRITE(actor) |
| The sprite of a ship piece or a party actor. | |
| #define | SET_PRIORITY(actor, n) |
| Sets one of the sprite's two priority bits of a ship piece or a party actor: 9 sets the first, any other the second. | |
Enumerations | |
| enum | { SHIP_NORTH = 8 , SHIP_SOUTH = 9 } |
| enum | { ENTRANCE_99 = 99 } |
| An entrance the table does not list; arriving by it hands the leader the Black Orb. More... | |
Functions | |
| static void | Ripple_Stop (void) |
| Takes the ripple's callbacks off and stops DMA 0. | |
| static void | Curtain_Start (void) |
| Fills a 256-byte tile with colour 1 and starts the curtains 48 pixels open. | |
| s32 | Math_DivideUnsigned () |
| const struct SceneEntrance * | LemurianShip_GetEntrances (void) |
| const struct SceneRegion * | LemurianShip_GetRegions (void) |
| const u32 * | LemurianShip_GetExits (void) |
| const struct ScenePlacement * | LemurianShip_GetPlacements (void) |
| The ship's two pieces; the party's own actors fill the first three rows. | |
| static void | LeaveTheShip (void) |
| The way out, back into Lalivero's interiors: leaves and clears the backdrop colour. | |
| static void | Ripple_StopForReveal (void) |
| Stops the water's ripple while Reveal shows the scene. | |
| static void | Ripple_Start (void) |
| Starts the two-axis ripple with its original frequencies and amplitudes. | |
| const struct SceneEvent * | LemurianShip_GetEvents (void) |
| The exit, Reveal and the Black Orb at the water's edge (cell code 10). | |
| static void | ShipGlow_CyclePalette (void) |
| Slides a window of six colours along gShipGlowPalettes into palette 7's colours 4 to 9, one step every 6 frames, so the ship's glow ripples. | |
| static void | Spray_Update (union FieldObject *fieldObject) |
| A drop of spray rises and wobbles for its timer, then falls back by gSprayFallScript, which frees it. | |
| static void | OrbGlow_Fade (void) |
| Every 40 frames, the Black Orb's glow fades a step, down to 4. | |
| static void | Ship_UpdateSwell (void) |
| The Black Orb's glow pulses in the blend, the ship (layers 6 and 7) and everyone on deck bob with the swell, and spray rises from the water. | |
| static s32 | Leader_StepOnDeck (struct ScriptInterpreter *interpreter) |
| Remembers the leader's height on deck, so that from then on he bobs with the ship. | |
| static s32 | Garet_StepOnDeck (struct ScriptInterpreter *interpreter) |
| Remembers Garet's boarding height for the swell callback. | |
| static s32 | Mia_StepOnDeck (struct ScriptInterpreter *interpreter) |
| Remembers Mia's boarding height for the swell callback. | |
| static s32 | Ivan_StepOnDeck (struct ScriptInterpreter *interpreter) |
| Remembers Ivan's boarding height for the swell callback. | |
| static void | SetSail (void) |
| The others step out and talk over the journey while three questions shape their replies, everyone boards, and the ship sails east as the curtains close and the game goes to the clear screen. | |
| static __inline__ s32 | Wave_Offset (s32 angle, s32 amplitude, u16 base) |
| One line's ripple offset. | |
| static void | RaiseTheShip (void) |
| The Black Orb glows, the water lights up, spray rises and the ship comes up out of the sea 90 pixels; then the party sets sail. | |
| s32 | LemurianShip_SetupScene (void) |
| Sets the harbor up: the ship sunk 90 pixels, its pieces and the party drawn behind the water layers, and the ripple running. | |
| void | DisplayScroll_ArmHBlankDma (void) |
| Arms DMA 0 to copy the shown ripple page, a line each HBlank, into background 3's scroll registers, writing the first line itself. | |
| void | DisplayScroll_BuildAndSwapHBlankPage (void) |
| Builds the other ripple page and swaps it in. | |
| static void | Curtain_Close (void) |
| Moves the curtains a step closer and queues their 24 sprites. | |
Variables | |
| static struct CurtainSprite | sCurtainSprites [24] |
| static s16 | sCurtainGap |
| static s16 | sCurtainVramSlot |
| u16 | gShipGlowPalettes [] |
| The ship's glow: ShipGlow_CyclePalette shows six of these colours at a time, from a start that moves one colour every 6 frames. | |
| s32 | gSprayFallScript [] |
| A drop of spray, at the end of its rise: freed. | |
| s16 | gRippleSine [256] |
| struct SceneEntrance | gLemurianShipEntrances [] |
| u32 | gLemurianShipExits [] |
| struct ScenePlacement | gLemurianShipPlacements [] |
| struct SceneEvent | gLemurianShipEvents [] |
| s32 | gOrbGlowActive = 0 |
| s32 | gOrbGlowPhase = 0 |
| s32 | gOrbGlowStrength = 16 |
| s32 | gOrbGlowFadeFrames = 0 |
| s32 | gSprayActive = 0 |
| s32 | gSwellActive = 0 |
| s32 | gSwellPhase = 0 |
| s32 | gShipHullY = 0 |
| s32 | gShipDeckY = 0 |
| s32 | gLeaderDeckY = -0x10000 |
| s32 | gGaretDeckY = -0x10000 |
| s32 | gMiaDeckY = -0x10000 |
| s32 | gIvanDeckY = -0x10000 |
| u32 | gShipGlowStep [] |
| s32 | gLeaderBoardsShip [] |
| s32 | gGaretBoardsShip [] |
| s32 | gIvanBoardsShip [] |
| s32 | gMiaBoardsShip [] |
The Lemurian ship's hidden harbor at Lalivero, and the end of the game.
The leader steps up with the Black Orb: it glows, spray rises and the ancient ship comes up out of the water. The party boards, talks over the journey so far and sails; curtains close and the game goes to the clear screen.
Definition in file lemurian_ship.c.
| #define LEMURIAN_SHIP_DEPARTURE_DELAY_FRAMES 80 |
Definition at line 59 of file lemurian_ship.c.
Referenced by SetSail().
| #define ACTOR_SPRITE | ( | actor | ) |
The sprite of a ship piece or a party actor.
Definition at line 77 of file lemurian_ship.c.
| #define SET_PRIORITY | ( | actor, | |
| n ) |
Sets one of the sprite's two priority bits of a ship piece or a party actor: 9 sets the first, any other the second.
Definition at line 81 of file lemurian_ship.c.
Referenced by LemurianShip_SetupScene().
| anonymous enum |
| Enumerator | |
|---|---|
| SHIP_NORTH | the ship, in two pieces of sprite 0x1f6 |
| SHIP_SOUTH | |
Definition at line 65 of file lemurian_ship.c.
| anonymous enum |
An entrance the table does not list; arriving by it hands the leader the Black Orb.
| Enumerator | |
|---|---|
| ENTRANCE_99 | |
Definition at line 72 of file lemurian_ship.c.
|
static |
Takes the ripple's callbacks off and stops DMA 0.
Called by Ripple_StopForReveal.
Definition at line 828 of file lemurian_ship.c.
Referenced by Ripple_Stop(), and Ripple_StopForReveal().
|
static |
Fills a 256-byte tile with colour 1 and starts the curtains 48 pixels open.
Called by SetSail as the ship leaves; adds Curtain_Close.
Definition at line 893 of file lemurian_ship.c.
Referenced by Curtain_Start(), and SetSail().
| s32 Math_DivideUnsigned | ( | ) |
| const struct SceneEntrance * LemurianShip_GetEntrances | ( | void | ) |
Definition at line 87 of file lemurian_ship.c.
Referenced by LemurianShip_GetEntrances().
| const struct SceneRegion * LemurianShip_GetRegions | ( | void | ) |
Definition at line 91 of file lemurian_ship.c.
Referenced by LemurianShip_GetRegions().
| const u32 * LemurianShip_GetExits | ( | void | ) |
Definition at line 93 of file lemurian_ship.c.
Referenced by LemurianShip_GetExits().
| const struct ScenePlacement * LemurianShip_GetPlacements | ( | void | ) |
The ship's two pieces; the party's own actors fill the first three rows.
Definition at line 96 of file lemurian_ship.c.
Referenced by LemurianShip_GetPlacements().
|
static |
The way out, back into Lalivero's interiors: leaves and clears the backdrop colour.
Reached by stepping on cell code 1 (gLemurianShipEvents); takes exit 1.
Definition at line 103 of file lemurian_ship.c.
Referenced by LeaveTheShip().
|
static |
Stops the water's ripple while Reveal shows the scene.
Reached by Reveal's phase 5 anywhere in the scene; Ripple_Start, at phase 4, starts the ripple again.
Definition at line 111 of file lemurian_ship.c.
Referenced by Ripple_StopForReveal().
|
static |
Starts the two-axis ripple with its original frequencies and amplitudes.
Called by LemurianShip_SetupScene, and reached by Reveal's phase 4 as the spell ends.
Definition at line 116 of file lemurian_ship.c.
Referenced by LemurianShip_SetupScene(), and Ripple_Start().
| const struct SceneEvent * LemurianShip_GetEvents | ( | void | ) |
The exit, Reveal and the Black Orb at the water's edge (cell code 10).
Definition at line 122 of file lemurian_ship.c.
Referenced by LemurianShip_GetEvents().
|
static |
Slides a window of six colours along gShipGlowPalettes into palette 7's colours 4 to 9, one step every 6 frames, so the ship's glow ripples.
Run each frame once RaiseTheShip has brought the ship up.
Definition at line 129 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and ShipGlow_CyclePalette().
|
static |
A drop of spray rises and wobbles for its timer, then falls back by gSprayFallScript, which frees it.
The update hook Ship_UpdateSwell gives each drop it creates.
Definition at line 146 of file lemurian_ship.c.
Referenced by Ship_UpdateSwell(), and Spray_Update().
|
static |
Every 40 frames, the Black Orb's glow fades a step, down to 4.
Run each frame while the ship rises; RaiseTheShip adds and removes it.
Definition at line 174 of file lemurian_ship.c.
Referenced by OrbGlow_Fade(), and RaiseTheShip().
|
static |
The Black Orb's glow pulses in the blend, the ship (layers 6 and 7) and everyone on deck bob with the swell, and spray rises from the water.
Run each frame from RaiseTheShip to the end of the game; each part runs while its flag (gOrbGlowActive, gSwellActive, gSprayActive) is set.
Definition at line 205 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
|
static |
Remembers the leader's height on deck, so that from then on he bobs with the ship.
Called by gLeaderBoardsShip as he steps on deck; the other members' boarding scripts call their own copies below.
Definition at line 282 of file lemurian_ship.c.
Referenced by Leader_StepOnDeck().
|
static |
Remembers Garet's boarding height for the swell callback.
Definition at line 293 of file lemurian_ship.c.
Referenced by Garet_StepOnDeck().
|
static |
Remembers Mia's boarding height for the swell callback.
Definition at line 304 of file lemurian_ship.c.
Referenced by Mia_StepOnDeck().
|
static |
Remembers Ivan's boarding height for the swell callback.
Definition at line 315 of file lemurian_ship.c.
Referenced by Ivan_StepOnDeck().
|
static |
The others step out and talk over the journey while three questions shape their replies, everyone boards, and the ship sails east as the curtains close and the game goes to the clear screen.
Called by RaiseTheShip once the ship has risen. Sets FLAG_KEEP_MUSIC and sends the party to the clear screen (SceneId_Title, entrance 9).
Definition at line 330 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and SetSail().
One line's ripple offset.
Definition at line 582 of file lemurian_ship.c.
Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and Wave_Offset().
|
static |
The Black Orb glows, the water lights up, spray rises and the ship comes up out of the sea 90 pixels; then the party sets sail.
Reached by using the Black Orb at the water's edge (cell code 10). Adds the swell and glow callbacks, which run to the end of the game, and calls SetSail.
Definition at line 593 of file lemurian_ship.c.
Referenced by RaiseTheShip().
| s32 LemurianShip_SetupScene | ( | void | ) |
Sets the harbor up: the ship sunk 90 pixels, its pieces and the party drawn behind the water layers, and the ripple running.
The scene's initialization; arriving by entrance 99, which the entrance table does not list, first gives the leader the Black Orb.
Definition at line 694 of file lemurian_ship.c.
Referenced by LemurianShip_SetupScene().
| void DisplayScroll_ArmHBlankDma | ( | void | ) |
Arms DMA 0 to copy the shown ripple page, a line each HBlank, into background 3's scroll registers, writing the first line itself.
Scheduler callback for the wavy background: restarts DMA 0 each frame to copy the current page's BG1 to BG3 scroll offsets into the scroll registers one scanline at a time.
Run each frame; DisplayScroll_InitializeHBlankDma adds it and Ripple_Stop removes it.
The first line is written directly; the DMA writes three words at each HBlank from then on.
Definition at line 766 of file lemurian_ship.c.
| void DisplayScroll_BuildAndSwapHBlankPage | ( | void | ) |
Builds the other ripple page and swaps it in.
Scheduler callback for the wavy background: fills the hidden page with each scanline's BG3, BG2 and BG1 offsets, the scroll plus a sine wave for x and for y (an axis with no step stays flat), then shows that page.
Run each frame; DisplayScroll_InitializeHBlankDma adds it and Ripple_Stop removes it.
Definition at line 789 of file lemurian_ship.c.
|
static |
Moves the curtains a step closer and queues their 24 sprites.
Run each frame from Curtain_Start to the end of the game.
Definition at line 853 of file lemurian_ship.c.
Referenced by Curtain_Close(), and Curtain_Start().
|
static |
Definition at line 847 of file lemurian_ship.c.
Referenced by Curtain_Close().
|
static |
Definition at line 848 of file lemurian_ship.c.
Referenced by Curtain_Close(), and Curtain_Start().
|
static |
Definition at line 849 of file lemurian_ship.c.
Referenced by Curtain_Close(), and Curtain_Start().
| u16 gShipGlowPalettes[] |
The ship's glow: ShipGlow_CyclePalette shows six of these colours at a time, from a start that moves one colour every 6 frames.
Definition at line 907 of file lemurian_ship.c.
Referenced by ShipGlow_CyclePalette().
| s32 gSprayFallScript[] |
A drop of spray, at the end of its rise: freed.
Definition at line 913 of file lemurian_ship.c.
Referenced by Spray_Update().
| s16 gRippleSine[256] |
Definition at line 918 of file lemurian_ship.c.
Referenced by Wave_Offset().
| struct SceneEntrance gLemurianShipEntrances[] |
Definition at line 954 of file lemurian_ship.c.
Referenced by LemurianShip_GetEntrances().
| u32 gLemurianShipExits[] |
Definition at line 960 of file lemurian_ship.c.
Referenced by LemurianShip_GetExits().
| struct ScenePlacement gLemurianShipPlacements[] |
Definition at line 966 of file lemurian_ship.c.
Referenced by LemurianShip_GetPlacements().
| struct SceneEvent gLemurianShipEvents[] |
Definition at line 980 of file lemurian_ship.c.
Referenced by LemurianShip_GetEvents().
| s32 gOrbGlowActive = 0 |
Definition at line 991 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gOrbGlowPhase = 0 |
Definition at line 993 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gOrbGlowStrength = 16 |
Definition at line 995 of file lemurian_ship.c.
Referenced by OrbGlow_Fade(), and Ship_UpdateSwell().
| s32 gOrbGlowFadeFrames = 0 |
Definition at line 997 of file lemurian_ship.c.
Referenced by OrbGlow_Fade(), and RaiseTheShip().
| s32 gSprayActive = 0 |
Definition at line 999 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gSwellActive = 0 |
Definition at line 1001 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gSwellPhase = 0 |
Definition at line 1003 of file lemurian_ship.c.
Referenced by Ship_UpdateSwell().
| s32 gShipHullY = 0 |
Definition at line 1005 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gShipDeckY = 0 |
Definition at line 1007 of file lemurian_ship.c.
Referenced by RaiseTheShip(), and Ship_UpdateSwell().
| s32 gLeaderDeckY = -0x10000 |
Definition at line 1009 of file lemurian_ship.c.
Referenced by Leader_StepOnDeck(), and Ship_UpdateSwell().
| s32 gGaretDeckY = -0x10000 |
Definition at line 1011 of file lemurian_ship.c.
Referenced by Garet_StepOnDeck(), and Ship_UpdateSwell().
| s32 gMiaDeckY = -0x10000 |
Definition at line 1013 of file lemurian_ship.c.
Referenced by Mia_StepOnDeck(), and Ship_UpdateSwell().
| s32 gIvanDeckY = -0x10000 |
Definition at line 1015 of file lemurian_ship.c.
Referenced by Ivan_StepOnDeck(), and Ship_UpdateSwell().
| u32 gShipGlowStep[] |
Definition at line 1017 of file lemurian_ship.c.
Referenced by ShipGlow_CyclePalette().
| s32 gLeaderBoardsShip[] |
Definition at line 1021 of file lemurian_ship.c.
Referenced by SetSail().
| s32 gGaretBoardsShip[] |
Definition at line 1045 of file lemurian_ship.c.
Referenced by SetSail().
| s32 gIvanBoardsShip[] |
Definition at line 1067 of file lemurian_ship.c.
Referenced by SetSail().
| s32 gMiaBoardsShip[] |
Definition at line 1091 of file lemurian_ship.c.
Referenced by SetSail().