OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
Examples

Every OpenSNES example program, with annotated source code. More...

Files

file  game.h
 What the screens of shard_dash share: the layout, the rules, the run's result.
file  main.c
 Two S-DSP programs — noise drums and hardware vibrato — hot-swapped with apuReset().
file  main.c
 Samples at addresses the game chooses: a resident set and a swap area.
file  main.c
 One-shot sound effects from WAV files, converted by the build.
file  main.c
 Sound effects the way a game engine drives them: voices by number.
file  main.c
 Tracker music with transport controls, and sound effects over it, via SNESMOD.
file  main.c
 Soundboard — the audio v2 engine driven entirely from C.
file  main.c
 Speech synthesis — the SNES says "OPEN SNES... DAVEO".
file  main.c
 Mode 0 parallax scrolling with four independent 2bpp backgrounds.
file  main.c
 Static 16-color background display in Mode 1 (4bpp).
file  main.c
 Backgrounds — offset-per-tile in Mode 2 and Mode 4: per-column scroll from BG3.
file  main.c
 Mode 3 full-color (256-color, 8bpp) background.
file  main.c
 Hi-res text — BG Mode 5 + interlace (512 horizontal pixels).
file  main.c
 Aim, distance, and angle showcase for <snes/math.h>.
file  main.c
 AABB and tile-based collision detection with visual feedback.
file  main.c
 Game skeleton — the smallest complete game: title -> play -> over.
file  main.c
 Game math & UI, rung — panel HUD: a status box that survives a dialog.
file  main.c
 Basics — ppuReset(): the next screen starts from a clean PPU.
file  main.c
 Scene stack demo — title → counter → pause overlay.
file  main.c
 SA-1 Murmuration Demo — 128 neon moths in Lissajous sine patterns.
file  main.c
 SuperFX 3D — auto-rotating wireframe cube (2-axis rotation).
file  main.c
 Super FX game skeleton — a game loop at 60 fps while the GSU renders.
file  main.c
 Direct color — the pixel byte IS the color (CGWSEL bit 0).
file  main.c
 HiColor — 1792 colors on screen from a 4bpp background.
file  main.c
 Colour — palette cycling: animate without touching a pixel.
file  main.c
 Colour — shadow & tint: recolour a whole scene at once.
file  main.c
 Two ways to mix two layers: colour addition, and pseudo-hires.
file  main.c
 Scrolling platformer with object engine and enemy AI.
file  main.c
 RPG template — a Tiled-driven street of the city, its residents, a dialog box.
file  main.c
 shmup — a vertical shoot 'em up: scrolling, enemies, bullets
file  main.c
 Fundamentals — how a glyph is drawn: hand-coded 2bpp font tiles.
file  main.c
 Falling-blocks puzzle with 3-layer BG architecture, DAS input, and SNESMOD audio.
file  main.c
 Breakout game with brick collision, paddle physics, and level cycling.
file  main.c
 Kit's Rooftop Run — a side-scrolling platformer, title to game over.
file  main.c
 shard_dash: a small game in several files, with a test for each screen
file  main.c
 HDMA-driven backdrop gradients: a direct table, and an indirect one.
file  main.c
 Interactive showcase of all four HDMA library helper effects.
file  main.c
 HDMA wave: build the table by hand, then let the hdma module do it.
file  main.c
 Both controllers on a terminal's test screen: buttons lit, the edges, a frame counter.
file  main.c
 SNES mouse input with cursor sprite, buttons, and sensitivity.
file  main.c
 SNES Super Scope light gun detection, calibration, and firing.
file  main.c
 Scrolling map with animated sprite character.
file  main.c
 HiROM memory mapping mode with 64KB bank access.
file  main.c
 LZ77 decompression into RAM, screen on: lzssDecodeRam.
file  main.c
 SRAM battery-backed save with multiple save slots.
file  main.c
 DSP-1 ground: the Super Mario Kart floor — per-scanline Mode 7 matrices streamed by the coprocessor's Raster command.
file  main.c
 Mode 7 EXTBG: one plane split in two layers, an orb flying between them.
file  main.c
 Mode 7 racing — hover-bikes on a rooftop circuit, F-Zero style.
file  main.c
 Mode 7 perspective with an HDMA split screen (F-Zero style).
file  main.c
 Rotating Mode 7 perspective — full matrix driven by 4 HDMA channels.
file  main.c
 Mode 7 rotation and scaling, flown over: a glider, its shadow and the altitude.
file  main.c
 A threshold camera over two layers in parallax: Kit runs on the roofs.
file  main.c
 Mixed scrolling, a title screen: three layers, three scrolls — the rain, a fixed logo, a moving message.
file  main.c
 HDMA-driven parallax scrolling with three speed zones.
file  main.c
 Eight-direction scrolling over a map of 1,433 distinct characters.
file  main.c
 Direction-based sprite animation with horizontal flip.
file  main.c
 End-to-end Aseprite sprite pipeline: art + timeline → animated metasprite.
file  main.c
 Dynamic sprite engine: per-frame VRAM tile streaming, single sprites and metasprites.
file  main.c
 Display a single static 32x32 sprite.
file  main.c
 Interactive demo of all six SNES OBJ size modes.
file  main.c
 Sprites showcase — a swarm of neon moths, and the OAM throughput ceiling.
file  main.c
 World-space sprites — a camera, culling, a depth sort and OAM in one call per batch.
file  main.c
 Text — proportional text composed at the pixel in a 2bpp layer.
file  main.c
 Text — print a string with the built-in font.
file  main.c
 Screen transitions: brightness fades and the mosaic filter.
file  main.c
 An HDMA-shaped window: a torch beam in a dark alley, masking layers or lighting them.
file  main.c
 Multi-window HDMA — both windows' edges driven per scanline.
file  play.c
 The round: walk Kit to GOAL shards before the clock runs out.
file  result.c
 The result screen: the round's outcome, the best time, then back to the title.
file  save.c
 The save: magic, version, checksum, and defaults when anything is off.
file  save.h
 The save: one versioned, checksummed record in SRAM.
file  screen.c
 The screen layer (see screen.h).
file  screen.h
 The screen layer: what every screen outside the round needs.
file  title.c
 The title screen: the logo, the rules, the best time.
file  ui.c
 Text helpers shared by the screens.
file  ui.h
 Text helpers shared by the screens.

Detailed Description

Every OpenSNES example program, with annotated source code.

Each example's main.c carries @par SNES Concepts (the hardware features it uses), @par What to Observe (what to look for when it runs) and @par Modules Used (the library modules it links). The files below are those sources; for the examples by topic, with their READMEs and screenshots, see Browse Examples by Category.