The shape of a Super FX game: the game runs every frame, the GSU renders on its own clock, the NMI puts finished frames on screen.
A square of the city at night, in the rain. Above the projector in its middle, a hologram turns and bobs: a data cube, a pink cube inside it, the struts between them, and the two beams that rise from the projector's rim. The GSU draws it at 30 frames per second while a sight follows the D-pad at 60 and SNESMOD music plays. Neither waits for the other: the renderer runs from the GSU's code cache, so the CPU keeps the ROM and its game loop; gsuPresent() double-buffers the frames, and the NMI moves each one to VRAM a piece per VBlank, showing it only once all of it has landed.
Then open superfx_game_skeleton.sfc in luna (or bsnes). Hold the D-pad.
| File | Purpose |
|---|---|
| main.c | Game loop, sight, rotation and projection, the edge table, job pacing |
| gsu_cube.sfx | Bresenham + PLOT renderer that runs from the code cache: joins the points through the edge table |
| gsu_loader.asm | .incbin of the renderer |
| res/square.png | the square (BG2): 541 tiles, palette slot 1 |
| res/sight.png | the pad's sight, 16x16 |
| Word address | Content |
|---|---|
| $0000, $2000 | BG1's two char blocks, the GSU's frames (16 KB each) |
| $4000 | BG2's tiles, the square (to $61CF) |
| $6000 | the OBJ name base; its first table overlaps the square's tiles and is not used |
| $7000 | the sight, OBJ tile 256 (the second name table) |
| $7800 | BG1's map, the bitmap's column-major tilemap |
| $7C00 | BG2's map |
| File | What | Made by |
|---|---|---|
| res/square.png | the square in the rain, its projector in the middle, 256x144 padded to 256x256 | devtools/art_assets/build.py from assets/neo-lumen/backgrounds/square.png (PixelLab) |
| res/sight.png | the sight: four bright corner brackets and a magenta centre, ringed with ink | assets/neo-lumen/ui/sight.png (PixelLab), the ink ring added by devtools/art_assets/build.py |
CC0, like the rest of the Néo-Lumen assets (assets/neo-lumen/README.md). The music is audio/snesmod_music's module.
testing/manifests/superfx_game_skeleton.toml holds RIGHT for 60 frames and checks the sight moved 60 pixels (the game never skipped a frame), about 30 presented frames per second and no bus violation. testing/vram_dma_blank.py checks every framebuffer byte lands in blank, as whole frames into alternating blocks, with every swap after a whole frame.
| Module | Purpose |
|---|---|
| console | System initialization, WaitForVBlank |
| sprite | The sight (OAM) |
| dma | Palettes and the sight's tiles |
| background | BG1 mode, map, scroll, char base; BG2's scroll |
| asset | bgLoad(): the square's tiles, palette and map in one call |
| input | The D-pad |
| superfx | Cache jobs, presentation, letterbox, bitmap tilemap (added by USE_SUPERFX) |
| snesmod | The music (audio/snesmod_music's module; added by USE_SNESMOD) |