Skip to content

Layer 3: System Layer ​

Responsibility ​

Game engine subsystems that implement high-level functionality. These systems provide the core capabilities that game code builds upon.


Subsystem Overview ​

SubsystemDocument
AudioAudio Subsystem
PhysicsPhysics Subsystem
Touch InputTouch Input
Tile AnimationTile Animation
Resolution ScalingResolution Scaling

Architecture Diagrams ​

Rendering Pipeline (Game Code → Display) ​

Logical vs Physical Resolution ​

Indexed Color → RGB565 ​

PC Keyboard/Mouse Mapping ​

UI Composition ​

System Architecture ​


Data Flow ​

Game Loop Flow ​

Audio Pipeline ​

Game Code
    │
    ▼ (submitCommand)
AudioCommandQueue (Thread-Safe)
    │
    ▼ (processCommands)
AudioScheduler
    │
    ├──▶ Pulse Channel
    ├──▶ Triangle Channel
    ├──▶ Noise Channel
    └──▶ Music Sequencer
    │
    ▼ (generateSamples)
Mixer (with LUT)
    │
    ▼
AudioBackend
    ├──▶ ESP32_I2S_AudioBackend
    ├──▶ ESP32_DAC_AudioBackend
    └──▶ SDL2_AudioBackend

Modular Compilation Flags ​

SubsystemFlagDefault
AudioPIXELROOT32_ENABLE_AUDIOEnabled
PhysicsPIXELROOT32_ENABLE_PHYSICSEnabled
UI SystemPIXELROOT32_ENABLE_UI_SYSTEMEnabled
ParticlesPIXELROOT32_ENABLE_PARTICLESEnabled
Touch InputPIXELROOT32_ENABLE_TOUCHDisabled
Tile AnimationsPIXELROOT32_ENABLE_TILE_ANIMATIONSEnabled
Static tilemap framebuffer cache (4bpp)PIXELROOT32_ENABLE_STATIC_TILEMAP_FB_CACHEEnabled
Static layer snapshot (game-drawn layers)PIXELROOT32_ENABLE_STATIC_LAYER_SNAPSHOTDisabled
Dirty Regions (selective clear)PIXELROOT32_ENABLE_DIRTY_REGIONSDisabled

SubsystemDocument
AudioAudio Subsystem
PhysicsPhysics Subsystem
Touch InputTouch Input
Tile AnimationTile Animation
Resolution ScalingResolution Scaling
MemoryMemory System
API ReferenceAPI Index

Released under the MIT License.