Skip to Content
The Alchemy Project

include/game/main_routine.h

The main routine, which runs the game's engines one after another, and the scene changes between them.

Included by system.h.

Enumerations

NameDescription
enumGAME_START { GAME_START_TITLE, GAME_START_DEBUG_VALE, GAME_START_DEBUG_FI … }gmMainRoutineRun's mode: where the game starts.

Functions

NameDescription
voidgmTakeExit (Sint32 exitId)game/main_routine.c documents each.
voidgmReturnFromEngine (Sint32 result)Chooses where the game continues after an engine other than the field engine (see gmMainRoutineRun). result is its result: -1 when the party was defeated, which revives the leader with 1 HP (and, with FLAG_CHILDHOOD, fully heals Isaac and Garet) and returns to the story battle's defeat point (fdScriptSetDefeatDestination) or, when none is set, to the restart point, usually the last Sanctum (fdSetRestartPoint).
Sint32gmGetArea (Sint32 sceneId)Returns the area sceneId belongs to.
voidgmLoadOverlay (Sint32 unused)Loads the current scene's overlay code (its resource) into OverlayArea.
voidgmArrive (Sint32 unused, Sint32 keep)Updates the flags and state that last for one scene or one area, on entering the current scene.

Description

The main routine, which runs the game's engines one after another, and the scene changes between them.

Enumerations in detail

GAME_START

enum GAME_START

gmMainRoutineRun's mode: where the game starts.

EnumeratorValueDescription
GAME_START_TITLE0the Title, with the state cleared
GAME_START_DEBUG_VALE1in debug mode, SceneIdValePlaza
GAME_START_DEBUG_FILE_SCREEN2in debug mode, the File Screen

Definition at line 10 of file main_routine.h.