Repository navigation
Application‐Lifecycle
Gustavo Adrien Polli edited this page Jul 13, 2026
·
1 revision
The execution loop of FantasyConsole functions via a structured, deterministic 60Hz processing pipeline managed directly by the Rust runtime environment and its underlying SDL2 ticker.
Cold Boot Execution
│
┌──────────▼──────────┐
│ _init() Lifecycle │ ◄─── Once per environment initialization
└──────────┬──────────┘
│
┌─────────────►─────────────┐
│ │
┌─┴───────────────────────────┴─┐
│ _update() Loop (60Hz) │ ◄─── Resolves network replication, button maps, game logic
└─┬───────────────────────────┬─┘
│ │
┌─▼───────────────────────────▼─┐
│ _draw() Loop (60Hz) │ ◄─── Compiles primitive geometry and outputs frame
└─┬───────────────────────────┬─┘
│ │
└─────────────◄─────────────┘
When an executable binary initializes, the CartLoader intercepts the targeted .p8 text layout or .p8.png steganographic canvas shell.
- It checks metadata boundaries to execute automatic polymorphism, reshaping core internal memory maps to fit either PICO-8 (128x128) or TIC-80 (240x136) architectural layouts.
- Once memory offsets are stabilized, the internal context loads the script code into the
LuaVMplatform environment and triggers the native_init()callback function exactly once.
Locked at a stable 60Hz frequency, the main thread calls the internal _update() callback loop to process active state transformations:
- Polling local multidimensional player matrices to capture physical real-time game controllers (
WASDandArrow Keys). - Advancing mathematical physics counters, custom procedural arrays, or audio tracker registers.
Immediately following the physics update phase, the thread triggers the _draw() callback loop to commit graphic modifications downstream onto the screen buffer:
- The system evaluates active hardware scissoring regions (
clip()) on the pure CPU rasterizer layer before processing drawing streams to prevent VRAM buffer overflow hazards. - The software rasterizer parses layout tables, computes unrolled Bresenham line steps, and converts text bitmaps.
- Finally, the internal SDL2 texture backend receives the pixel streaming buffer, updating the surface visor to maintain fluid visual execution without drop frames.