src/scene/title.c
The Title (SceneIdTitle): the screens between scenes that are not on a map, chosen by entrance. More…
#include "scene/title.h"#include "macros.h"#include "resource_ids.h"#include "debug/debug.h"#include "field/script_inline.h"#include "field/map_grid.h"#include "graphics/graphics.h"#include "menu/menu.h"#include "sound/sound_driver_symbols.h"#include "shared/scene_entrances_mapless.c"
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { LETTERING_PALETTE } | The lettering's sprite palette. |
enum | anonymous enum { LETTERING_ROWS } | In the German, Spanish, French and Italian pictures, the lettering's rows at the bottom of the screen. |
Functions
| Name | Description | |
|---|---|---|
BSS_DATA | ALIGNED (16) | Unused: forty-four bytes nothing reads or writes. |
static void | scTitleRevealScreen (Sint32 unused) | Shows the Golden Sun logo for TITLE_FROM_WORLD_MAP: the logo fades up from black over the lettering being written in, then the screen opens. |
static void | scTitleLoadBackground (void) | Loads the Golden Sun logo onto BG2 (title.h's LOGO_ map) with the screen faded to black. |
const SCENE_ENTRANCE * | scGetEntrances (void) | The scene tables fdEngineRun reads; the title has no exits, actors or cues. |
const SCENE_EXIT_REGION * | scGetExitRegions (void) | The scene has no exit regions: its regions entry returns none. |
const Uint32 * | scGetExits (void) | Both scenes share one exit table. |
const ACTOR_PLACE * | scGetActorPlacements (void) | Some villagers only turn back after talking once the flood is over or their family has gone home. |
const CUE * | scGetCues (void) | The first water beast's cave changes its cues once the first drain has lowered its water: the beast is gone and its two puddles can be frozen. |
Sint32 | scInit (void) | Plays the screens the entrance asks for, then sets the scene that follows. |
static void | scTitleLoadSprites (Sint32 unused) | Loads the "To Be Continued" lettering's sprites and their palette. |
static void | scTitleUpdateSpriteReveal (void) | The event that queues the "To Be Continued" lettering each tick, writing it in from the left a column every two ticks, each new column flickering for its first few. |
Variables
| Name | Description | |
|---|---|---|
Uint8 | TitleUnusedBeforeRevealTick [44] | Unused: forty-four bytes nothing reads or writes. |
Sint16 | TitleRevealTick | Ticks since the lettering's reveal began; a column appears every two. |
Uint8 | TitleUnusedAfterRevealTick [18] | Unused: eighteen bytes nothing reads or writes. |
TITLE_SPR | TitleSprites [18] | |
extern Uint32 | TitleExits [] | |
extern ACTOR_PLACE | TitleActorPlacements [] | |
extern CUE | TitleCues [] | |
extern Sint16 | TitleVramBlock | The VRAM cache entry holding the lettering's tiles, which is -1 until scTitleLoadSprites takes one. |
Description
The Title (SceneIdTitle): the screens between scenes that are not on a map,
chosen by entrance.
TITLE_AFTER_RUN, at power-on: the publisher's and Camelot's logos and the title, looping until a key is pressed, then the File Screen.TITLE_FROM_VALE_PLAZA, at the prologue's end: the title held while the years pass (MUS_THE_PASSAGE_OF_TIME), then Vale, the party grown up.TITLE_FROM_LEMURIAN_SHIP, once the party sails away: the staff credits, then the File Screen.TITLE_FROM_WORLD_MAP, after the ending on Jenna and Kraden's island: the Golden Sun logo with "To Be Continued" written in under it from the left, held a minute or until a key, then back to the logos.
Enumerations in detail
anonymous enum
enum { LETTERING_PALETTE }
The lettering's sprite palette.
| Enumerator | Value | Description |
|---|---|---|
LETTERING_PALETTE | 15 |
Definition at line 167 of file title.c.
anonymous enum
enum { LETTERING_ROWS }
In the German, Spanish, French and Italian pictures, the lettering's rows at the bottom of the screen.
| Enumerator | Value | Description |
|---|---|---|
LETTERING_ROWS | 32 |
Definition at line 174 of file title.c.
Functions in detail
scTitleRevealScreen
static void scTitleRevealScreen(Sint32 unused)
Shows the Golden Sun logo for TITLE_FROM_WORLD_MAP: the logo fades up from
black over the lettering being written in, then the screen opens.
References fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), scTitleLoadBackground(), scTitleLoadSprites(), scTitleUpdateSpriteReveal(), Sint32, sySetTickEvent(), sySynch() and TitleRevealTick.
Referenced by scInit().
Definition at lines 45 and 316 of file title.c.
scTitleLoadBackground
static void scTitleLoadBackground(void)
Loads the Golden Sun logo onto BG2 (title.h's LOGO_ map) with the screen
faded to black.
References BgScrollWork, scFieldDecompressTaggedLZ(), Sint32, syDMAXCopy(), syResourceGetTableEntry() and syScreenFadeToBlack().
Referenced by scTitleRevealScreen().
Definition at lines 46 and 359 of file title.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
The scene tables fdEngineRun reads; the title has no exits, actors or cues.
References ScreenEntrances.
Definition at line 49 of file title.c.
scGetExitRegions
const SCENE_EXIT_REGION *scGetExitRegions(void)
Definition at line 54 of file title.c.
scGetExits
const Uint32 *scGetExits(void)
References TitleExits.
Definition at line 59 of file title.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References TitleActorPlacements.
Definition at line 64 of file title.c.
scGetCues
const CUE *scGetCues(void)
References TitleCues.
Definition at line 69 of file title.c.
scInit
Sint32 scInit(void)
Plays the screens the entrance asks for, then sets the scene that follows.
References fdActorGet(), fdScriptSetDestination(), fdScriptWait(), gmPartyEndChildhood(), MainRoutineStateWork, mnSaveScanFileSummaries(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), PerData, PerPush, scTitleRevealScreen(), Sint32, syImportCreditsRun(), syImportTitleShowCamelotLogo(), syResourceReservedNoOperation(), syScreenFadeToBlack(), syScreenFadeWait(), sySoundPlay() and sySynch().
Definition at line 75 of file title.c.
scTitleLoadSprites
static void scTitleLoadSprites(Sint32 unused)
Loads the "To Be Continued" lettering's sprites and their palette.
References mnVRAMLoad(), scFieldDecompressTaggedLZ(), Sint32, syDMAXCopy(), syHeapAllocateEWRAM(), syHeapRelease(), syResourceGetTableEntry(), syVRAMCacheFindFreeEntry() and TitleVramBlock.
Referenced by scTitleRevealScreen().
Definition at line 180 of file title.c.
scTitleUpdateSpriteReveal
static void scTitleUpdateSpriteReveal(void)
The event that queues the "To Be Continued" lettering each tick, writing it in from the left a column every two ticks, each new column flickering for its first few.
References Sint32, syOAMAddSpriteAtDepth(), TickCount, TitleRevealTick, TitleSprites, TitleVramBlock and VramCacheEntries.
Referenced by scTitleRevealScreen().
Definition at line 234 of file title.c.
Variables in detail
TitleUnusedBeforeRevealTick
Uint8 TitleUnusedBeforeRevealTick[44]
Unused: forty-four bytes nothing reads or writes.
Definition at line 25 of file title.c.
TitleRevealTick
Sint16 TitleRevealTick
Ticks since the lettering's reveal began; a column appears every two.
Referenced by scTitleRevealScreen() and scTitleUpdateSpriteReveal().
Definition at line 28 of file title.c.
TitleUnusedAfterRevealTick
Uint8 TitleUnusedAfterRevealTick[18]
Unused: eighteen bytes nothing reads or writes.
Definition at line 31 of file title.c.
TitleSprites
TITLE_SPR TitleSprites[18]
TITLE_SPR TitleSprites[120]
Referenced by scTitleUpdateSpriteReveal().
Definition at lines 36 and 38 of file title.c.
TitleExits
extern Uint32 TitleExits[]
Uint32 TitleExits[]
Referenced by scGetExits().
Definition at lines 40 and 408 of file title.c.
TitleActorPlacements
extern ACTOR_PLACE TitleActorPlacements[]
ACTOR_PLACE TitleActorPlacements[]
Referenced by scGetActorPlacements().
Definition at lines 41 and 412 of file title.c.
TitleCues
extern CUE TitleCues[]
CUE TitleCues[]
Referenced by scGetCues().
Definition at lines 42 and 416 of file title.c.
TitleVramBlock
extern Sint16 TitleVramBlock
Sint16 TitleVramBlock
The VRAM cache entry holding the lettering's tiles, which is -1 until
scTitleLoadSprites takes one.
Referenced by scTitleLoadSprites() and scTitleUpdateSpriteReveal().