How factor-64/wfx works
WFX is a wireframe 3D game/engine for the GBA. Its main loop polls input and dispatches game states into 3D initialization, attract, gameplay, and model-viewer routines; the 3D mode handles player actions, simulation, and drawing. Supporting layers provide level state, entity/model data, enemy behavior, camera math, HUD text, and sound. The supplied mode source is partial, so links to subsystems whose invocation is not visible are omitted; the README documents no further product workflow.
Main entry points: mode3d.c 3D Modes · main.c Game Loop · enemylogic.c Enemy Behavior · sound.c Sound Effects
Components 17
Game Runtime
- Game Loop
source/main.c - 3D Modes
source/mode3d.c - Game State
source/global.c - Endless Mode
source/endless.c
World Simulation
- Level State
source/level3d.c - Entity Operations
source/entity3d.c - Enemy Behavior
source/enemylogic.c - Entity Models
models/models.h
3D Rendering
- Camera
source/camera.c - Wireframe Renderer
source/mode3d.c - Trig Tables
source/trig_lut.c - Reciprocal Table
source/recip_lut.c
Audio and UI
- Sound Effects
source/sound.c - Messages and Scores
source/ui3d/message3d.c - Bitmap Text
source/ui3d/text3d.c
Other components
- Player Input
- GBA Display and Audio
Connections 20
- Player Input → Game Loop: provides input
- Game Loop → 3D Modes: dispatches states
- Game Loop → Game State: reads state
- Game Loop → Sound Effects: updates audio
- Game Loop → GBA Display and Audio: waits for VBlank
- 3D Modes → Wireframe Renderer: renders modes
- Wireframe Renderer → Camera: uses camera
- Wireframe Renderer → Trig Tables: reads angles
- Wireframe Renderer → Reciprocal Table: reads reciprocals
- Wireframe Renderer → GBA Display and Audio: copies framebuffer
- 3D Modes → Sound Effects: plays effects
- 3D Modes → Entity Models: uses templates
- 3D Modes → Messages and Scores: displays messages
- Messages and Scores → Bitmap Text: draws text
- Enemy Behavior → Entity Models: applies templates
- Enemy Behavior → Entity Operations: spawns projectiles
- Enemy Behavior → Sound Effects: plays effects
- 3D Modes → Level State: uses level state
- 3D Modes → Enemy Behavior: uses enemy logic
- 3D Modes → Endless Mode: optional mode