Startup Sequence & Main Menu
Relevant source files
The following files were used as context for generating this wiki page:
The startup sequence orchestrates the transition from application launch to active gameplay. It plays installed splash animations, presents the title screen, and initializes the data-driven book menu. The sequence ensures that all required game assets are prepared and exported before world entry.
The system supports both native and browser hosts, providing faithful reproduction of the original game's visual and audio presentation. It handles cinematic playback, persistent settings management, and session restoration through the main menu interface.
Startup Orchestration
The StartupPlugin manages the initial presentation states. It plays timed splash frames followed by a static title image. The plugin remains active during AppState::Loading and AppState::Menu.
Startup Presentation Flow
This diagram illustrates the progression from initial launch through the splash sequence to the main menu.
Splash Variants
The engine supports two primary splash animations derived from the original game files.
| Variant | Description | Original File Reference |
|---|---|---|
Windows | Default Glide splash used in GOG Windows release. | 3DfxSpl2.dll |
Dos | Older shield animation found in DOS Glide overlays. | glide2x_emu.ovl |
Sources: crates/cyrus-startup/src/lib.rs:31-40, crates/cyrus-startup/src/lib.rs:142-145
Asset Preparation
The LoadingPlugin scans the installation directory and prepares assets for the menu and HUD. A background worker thread performs these operations to avoid blocking the main application loop.
Preparation Logic
- The worker thread starts with a dedicated 8 MiB stack size to accommodate deep parser calls.
- It executes
export_menuandexport_hudfor presentation hosts. - It performs a full
preloadscan for direct or headless hosts to verify format coverage. - The system reports progress via
LoadingProgressand emits aMenuPreparedresource upon completion.
Sources: crates/cyrus-startup/src/preparation.rs:40-65, crates/cyrus-startup/src/preparation.rs:90-112
Menu Export Data
The export_menu function extracts geometry, text, and widgets from the original game data.
Main Menu System
The main menu uses a data-driven book interface. It manages navigation, selection, and activation of menu entries defined in MENU.INI.
Menu State Management
The MenuState resource tracks the current page, selected items, and interaction status. It handles different contexts such as standard Startup, player Death, or LastGame confirmation.
- Navigation: Input is sampled via
PlayerBindings. The system skips disabled or hidden entries and wraps around page boundaries. - Visuals: The menu is rasterized to a 640×480 image and displayed as a sprite.
- Clock: The menu initializes a
SimulationClockusing settings fromSYSTEM.INI.
Sources: crates/cyrus-startup/src/menu.rs:75-120, crates/cyrus-startup/src/menu.rs:395-430
Menu Actions
Menu entries trigger specific behaviors based on their assigned action IDs.
| Action ID Range | Behavior |
|---|---|
-2 | Requests application quit. |
1, 2 | Opens Save or Load pages. |
10 | Resets session for New Game and plays introduction movie. |
101, 102 | Opens the description editor for manual save slots. |
202 | Restores a selected save slot through the host session boundary. |
301..=305 | Plays the cinematic movie associated with the entry. |
710..=724 | Triggers key rebinding for the selected control. |
Sources: crates/cyrus-startup/src/menu.rs:563-630, crates/cyrus-assets/src/startup/menu_export.rs:188-198
Launch Requests and Shortcuts
The application supports command-line and URL parameters to bypass the standard startup sequence. The LaunchRequest resource captures these shortcuts.
Command-Line Integration
The native binary maps arguments to startup behaviors:
--skip-startup: Bypasses the splash animation.--new-game: Directly initiates a new game from the book.--movie [INDEX]: Plays a specific movie by itsMENU.INIindex.--load-slot [SLOT]: Restores the newest revision of a specific save slot.
Sources: crates/cyrus/src/main.rs:150-180, crates/cyrus-startup/src/menu.rs:39-50
World Entry and Loading
World entry begins after a menu selection or launch shortcut. The process uses the StartGame resource to manage the transition.
World Entry Sequence
- Scene Request: The system issues a
SceneRequestfor the destination world ID. - Loading Screen: A random variant of the destination's transition artwork is displayed.
- Progress Tracking: A red progress bar and percentage label indicate asset loading status.
- Transition: The system fades the loading screen out before handing control to the game world.
Sources: crates/cyrus-startup/src/menu.rs:786-820, crates/cyrus-startup/README.md:95-105
World Entry Coordination
Summary
The startup and menu system provides a bridge between the host environment and the faithful game simulation. It coordinates asynchronous asset preparation with synchronous presentation rules. By utilizing data-driven configurations from original files, it maintains fidelity while allowing for modern enhancements like high-frame-rate rendering and fast loading.