Skip to Content
The Alchemy Project

src/scene/epilogue.c

The epilogue: the party's last words, line after line, each speaker's portrait standing in a grey and white border beside the line, over the ending's pictures, from "Finally! More…

Macros

NameDescription
#defineOWN_mnEndingImageStartThis unit declares its own form of mnEndingImageStart, below.
#defineEPILOGUE_NO_PORTRAIT 0x8000A speaker (a sprite number) or'd with this shows the line with no portrait: a voice heard from off the image.
#defineEPILOGUE_WINDOW_OPTIONS 4The epilogue's message windows appear at once, without MESSAGE_WINDOW_ZOOM, and set an option bit that mnMessageOpenWindow never reads.
#defineEPILOGUE_TALL_LINE_AT_FOOT 2scEpilogueShowLineAt's mode for a line of seven or eight rows at the foot of the screen: its window is moved a row down and given no size of its own.

Enumerations

NameDescription
enumEPILOGUE_LINE_POS { LINE_AT_TOP, LINE_IN_MIDDLE, LINE_AT_FOOT }Where on the screen scEpilogueShowLine puts a line.

Functions

NameDescription
Sint32mnEndingImageStart ()Called here through an old-style declaration with an Sint32 result, though the routine takes nothing and returns nothing; OWN_mnEndingImageStart keeps menu.h's prototype out.
BSS_DATAALIGNED (16)The portrait border's VRAM cache entry.
static inline voidscFieldEndingImageShow (Sint32 resource, Uint8 *map, Sint32 pos)Shows one of the ending's pictures, panned pos pixels along it; resource 0 shows no picture.
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.
const CUE *scGetCues (void)The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's.
voidscEpiloguePlacePortraitFrame (void)Each tick while a portrait is shown, draws the border round it.
voidscEpilogueLoadPortraitFrame (void)Loads the portraits' border, a grey and white window border round a green panel (RESOURCE_GREEN_PANEL) in the portrait palette, and starts drawing it each tick.
voidscEpilogueShowLineAt (Sint32 speaker, Sint32 x, Sint32 y, Sint32 portraitX, Sint32 portraitY, Sint32 ticks, Sint32 mode)Opens the epilogue's message window at tile (x, y) and, unless the speaker has EPILOGUE_NO_PORTRAIT, the speaker's portrait at tile (portraitX, portraitY) with its border round it, the window lowered in mode EPILOGUE_TALL_LINE_AT_FOOT.
voidscEpilogueShowLine (Sint32 speaker, Sint32 pos, Sint32 ticks)Shows the epilogue's next line, spoken by speaker (a sprite, whose portrait and voice it takes), at the given position, centred across the screen or, beside a portrait, across the columns right of it; then holds it ticks more.
Sint32scInit (void)Runs the whole epilogue, image after image, then sets out for the file screen, which offers to save the cleared game.
Sint32scPrepareMap (void)Once Briggs is caught the pool has dried up: its colours take the dry ground's.

Variables

NameDescription
Sint32EpiloguePortraitFrameEntryThe portrait border's VRAM cache entry.
Uint8EpilogueUnusedAfterPortraitFrameEntry [268]Unused: 268 bytes after the border's entry that the epilogue never touches.
EFFECT_SPREpiloguePortraitFrameThe border drawn round each portrait, a sprite under the portrait window.
Sint32EpilogueMessage
Sint16EpiloguePortraitY
Sint32EpiloguePortraitFrameTile
Sint8EpiloguePortraitShownNonzero while a portrait is shown, and the border drawn round it.
Sint16EpiloguePortraitXThe portrait's left, in pixels.
extern const Uint16EpilogueNamePanelPalette []The colours of the portraits' border (graphics/epilogue/pal.png).
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.

Description

The epilogue: the party's last words, line after line, each speaker's portrait standing in a grey and white border beside the line, over the ending's pictures, from "Finally! We've reached Vale." (MsgFinallyWeVe) to The End; then it waits for a button, or three minutes, and goes on to the file screen.

Macros in detail

OWN_mnEndingImageStart

#define OWN_mnEndingImageStart

This unit declares its own form of mnEndingImageStart, below.

Definition at line 8 of file epilogue.c.

EPILOGUE_NO_PORTRAIT

#define EPILOGUE_NO_PORTRAIT 0x8000

A speaker (a sprite number) or'd with this shows the line with no portrait: a voice heard from off the image.

Referenced by scEpilogueShowLine(), scEpilogueShowLineAt() and scInit().

Definition at line 138 of file epilogue.c.

EPILOGUE_WINDOW_OPTIONS

#define EPILOGUE_WINDOW_OPTIONS 4

The epilogue's message windows appear at once, without MESSAGE_WINDOW_ZOOM, and set an option bit that mnMessageOpenWindow never reads.

Referenced by scEpilogueShowLineAt().

Definition at line 142 of file epilogue.c.

EPILOGUE_TALL_LINE_AT_FOOT

#define EPILOGUE_TALL_LINE_AT_FOOT 2

scEpilogueShowLineAt's mode for a line of seven or eight rows at the foot of the screen: its window is moved a row down and given no size of its own.

Referenced by scEpilogueShowLine() and scEpilogueShowLineAt().

Definition at line 146 of file epilogue.c.

Enumerations in detail

EPILOGUE_LINE_POS

enum EPILOGUE_LINE_POS

Where on the screen scEpilogueShowLine puts a line.

EnumeratorValueDescription
LINE_AT_TOP
LINE_IN_MIDDLE
LINE_AT_FOOTbelow the image

Definition at line 209 of file epilogue.c.

Functions in detail

scFieldEndingImageShow

static inline void scFieldEndingImageShow(Sint32 resource, Uint8 *map, Sint32 pos)

Shows one of the ending's pictures, panned pos pixels along it; resource 0 shows no picture.

References mnEndingImageShow() and Sint32.

Referenced by scInit().

Definition at line 45 of file epilogue.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References SceneEntrances.

Definition at line 53 of file epilogue.c.

scGetExitRegions

const SCENE_REGION *scGetExitRegions(void)

Definition at line 58 of file epilogue.c.

scGetExits

const Uint32 *scGetExits(void)

References SceneExits.

Definition at line 63 of file epilogue.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References ActorPlacements.

Definition at line 68 of file epilogue.c.

scGetCues

const CUE *scGetCues(void)

References SceneCues.

Definition at line 73 of file epilogue.c.

scEpiloguePlacePortraitFrame

void scEpiloguePlacePortraitFrame(void)

Each tick while a portrait is shown, draws the border round it.

References EpiloguePortraitFrame, EpiloguePortraitShown, EpiloguePortraitX, EpiloguePortraitY and fdEffectSpriteDraw().

Referenced by scEpilogueLoadPortraitFrame().

Definition at line 79 of file epilogue.c.

scEpilogueLoadPortraitFrame

void scEpilogueLoadPortraitFrame(void)

Loads the portraits' border, a grey and white window border round a green panel (RESOURCE_GREEN_PANEL) in the portrait palette, and starts drawing it each tick.

References EpilogueNamePanelPalette, EpiloguePortraitFrame, EpiloguePortraitFrameEntry, EpiloguePortraitFrameTile, EpiloguePortraitShown, mnVRAMLoad(), scEpiloguePlacePortraitFrame(), scFieldEffectSpriteInit(), scFieldSetTickEvent(), Sint32, syDecompressTaggedLZ(), syDMAXCopy(), syHeapAllocate(), syHeapCallAlternatePool(), syHeapRelease(), syResourceGetTableEntry() and syVRAMCacheFindFreeEntry().

Referenced by scInit().

Definition at line 106 of file epilogue.c.

scEpilogueShowLineAt

void scEpilogueShowLineAt(Sint32 speaker, Sint32 x, Sint32 y, Sint32 portraitX, Sint32 portraitY, Sint32 ticks, Sint32 mode)

Opens the epilogue's message window at tile (x, y) and, unless the speaker has EPILOGUE_NO_PORTRAIT, the speaker's portrait at tile (portraitX, portraitY) with its border round it, the window lowered in mode EPILOGUE_TALL_LINE_AT_FOOT. Then it waits for the text, closes both windows and waits the given ticks.

References EpilogueMessage, EpiloguePortraitShown, EpiloguePortraitX, EpiloguePortraitY, fdSpeakerGetVoice(), mnMessageAllTyped(), mnMessageOpenWindow(), mnPortraitOpenWindow(), mnWindowClose(), Sint32 and sySynch().

Referenced by scEpilogueShowLine().

Definition at line 153 of file epilogue.c.

scEpilogueShowLine

void scEpilogueShowLine(Sint32 speaker, Sint32 pos, Sint32 ticks)

Shows the epilogue's next line, spoken by speaker (a sprite, whose portrait and voice it takes), at the given position, centred across the screen or, beside a portrait, across the columns right of it; then holds it ticks more.

References EpilogueMessage, mnTextGetMessageSize(), scEpilogueShowLineAt() and Sint32.

Referenced by scInit().

Definition at line 219 of file epilogue.c.

scInit

Sint32 scInit(void)

Runs the whole epilogue, image after image, then sets out for the file screen, which offers to save the cleared game. Returns 0.

References BgScrollWork, EpilogueMessage, fdActorGet(), fdScriptClearFlag(), fdScriptPlaySound(), fdScriptSetDestination(), MainRoutineStateWork, mnEndingImageLowerTopStrip(), mnEndingImageSetTargetRow(), mnEndingImageStart(), mnEndingImageWaitForScroll(), mnWindowSystemInitField(), OamCopyEnabled, PerWork, scEpilogueLoadPortraitFrame(), scEpilogueShowLine(), scFieldEndingImageShow(), scFieldScriptWait(), Sint32, syPrintClear(), sySynch() and syWindowLoadGraphics().

Definition at line 280 of file epilogue.c.

scPrepareMap

Sint32 scPrepareMap(void)

References Sint32.

Definition at line 467 of file epilogue.c.

Variables in detail

EpiloguePortraitFrameEntry

Sint32 EpiloguePortraitFrameEntry

The portrait border's VRAM cache entry.

References Sint32.

Referenced by scEpilogueLoadPortraitFrame().

Definition at line 26 of file epilogue.c.

EpilogueUnusedAfterPortraitFrameEntry

Uint8 EpilogueUnusedAfterPortraitFrameEntry[268]

Unused: 268 bytes after the border's entry that the epilogue never touches.

Definition at line 28 of file epilogue.c.

EpiloguePortraitFrame

EFFECT_SPR EpiloguePortraitFrame

The border drawn round each portrait, a sprite under the portrait window.

Referenced by scEpilogueLoadPortraitFrame() and scEpiloguePlacePortraitFrame().

Definition at line 30 of file epilogue.c.

EpilogueMessage

Sint32 EpilogueMessage

References Sint32.

Referenced by scEpilogueShowLine(), scEpilogueShowLineAt() and scInit().

Definition at line 31 of file epilogue.c.

EpiloguePortraitY

Sint16 EpiloguePortraitY

Referenced by scEpiloguePlacePortraitFrame() and scEpilogueShowLineAt().

Definition at line 32 of file epilogue.c.

EpiloguePortraitFrameTile

Sint32 EpiloguePortraitFrameTile

References Sint32.

Referenced by scEpilogueLoadPortraitFrame().

Definition at line 33 of file epilogue.c.

EpiloguePortraitShown

Sint8 EpiloguePortraitShown

Nonzero while a portrait is shown, and the border drawn round it.

Referenced by scEpilogueLoadPortraitFrame(), scEpiloguePlacePortraitFrame() and scEpilogueShowLineAt().

Definition at line 35 of file epilogue.c.

EpiloguePortraitX

Sint16 EpiloguePortraitX

The portrait's left, in pixels.

Referenced by scEpiloguePlacePortraitFrame() and scEpilogueShowLineAt().

Definition at line 37 of file epilogue.c.

EpilogueNamePanelPalette

extern const Uint16 EpilogueNamePanelPalette[]

The colours of the portraits' border (graphics/epilogue/pal.png).

Referenced by scEpilogueLoadPortraitFrame().

Definition at line 41 of file epilogue.c.

SceneExits

Uint32 SceneExits[]

Referenced by scGetExits().

Definition at line 91 of file epilogue.c.

ActorPlacements

ACTOR_PLACE ActorPlacements[]

Referenced by scGetActorPlacements().

Definition at line 95 of file epilogue.c.

SceneCues

CUE SceneCues[]

Referenced by scGetCues().

Definition at line 99 of file epilogue.c.