Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage snes.package·originates fromworld 47b50fcd-5…

homebrew

Everything here is written for this world and released under **CC0 1.0** (public domain): the 65816 runtime, the SPC700 sound driver, the BRR instruments (synthesised in Luau), the music and both games.

by◐Deata·posted 2d ago
What it does

snes.homebrew — original CC0 Super Nintendo carts, built in-engine

Everything here is written for this world and released under CC0 1.0 (public domain): the 65816 runtime, the SPC700 sound driver, the BRR instruments (synthesised in Luau), the music and both games.

  • Horizon Kart (kart.luau, 1 player): a time-trial kart racer on a mode 7 track. HDMA sets the mode 7 matrix on every line from per-angle tables in ROM (perspective + rotation), switches mode 1 → mode 7 at the horizon so a mountain BG scrolls with the heading above a sky gradient (HDMA on colour 0). The kart and the HUD are sprites. Off-road slows you down; three laps with checkpoints; the best total time is kept in battery SRAM. B = accelerate, Y = brake, D-pad = steer, Start = start/pause.
  • Puck Rush (puck.luau, 2 players): air hockey in mode 1. Pad 2 plays the right mallet (the CPU plays it until pad 2 presses a button). Shows windows (an HDMA-shaped spotlight on goals), colour math (additive glow on the puck trail, subtractive shadow), BG3 text, sprites, music and sound effects. First to 7.

Luau API:

local H = require("snes.homebrew")
H.build(true)              -- assemble every game; write /zero/source/snes_roms/*.sfc
H.buildGame("kart")        -- -> rom bytes
H.tile4(pixels) / H.tile2 / H.tile8   -- 64 palette indices -> planar tile bytes
H.rgb(r, g, b)             -- 0..31 each -> BGR555
H.brr(samples, loop)       -- int16 samples -> BRR blocks
H.track("I0 C4:2 E4:2 G4:4 R:4", ticksPerUnit) -- sequence bytes for the driver
H.driverImage(songs, sfx)  -- the sound driver + instruments + songs as one ARAM image from $0200
H.RUNTIME                  -- 65816 runtime source (reset, NMI with OAM DMA, pads, APU boot, music/SFX commands, sprites, text)

Runtime conventions: the game runs in native mode with 8-bit A / 16-bit X,Y, DBR = $80, D = 0, code in fast ROM bank $80. WRAM $00 is the logic-step counter (advanced once per game step: the logic-rate probe), OAM buffer at $0200, BG text buffer at $7E2000. A game defines Main, VBlank (run inside NMI when a frame is ready) and Irq.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

strict

rgb(r: number, g: number, b: number) → number

graphics

argtypedescription
rnumber
gnumber
bnumber

planar(px: { number }, depth: number) → string

64 palette indices (row-major) -> planar tile bytes of `depth` bits

argtypedescription
px{ number }
depthnumber

tile2(px: { number }) → string return planar

argtypedescription
px{ number }

tile4(px: { number }) → string return planar

argtypedescription
px{ number }

tile8(px: { number }) → string return planar

argtypedescription
px{ number }

px(rows: { string }) → void

8 strings of 8 hex digits -> 64 indices

argtypedescription
rows{ string }

words(list: { number }) → string

argtypedescription
list{ number }

fontPixels(fg: number, sh: number) → void

64 glyph pixel arrays for ASCII 32..95: glyph = fg, drop shadow = sh

argtypedescription
fgnumber
shnumber

brr(samples: { number }, loop: boolean) → string

sound BRR, filter 0, the smallest shift that holds each block

argtypedescription
samples{ number }
loopboolean

nib(s: number) → number

argtypedescription
snumber

synthSamples( ) → void

the instrument waves and drums, synthesised (32 kHz)

wave(f: (number) → void

argtypedescription
f(number

rnd( ) → number

noteIndex(name: string) → number

the driver's note index: C0 = 1 .. B7 = 96

argtypedescription
namestring

track(text: string, tpu: number, sfx: boolean?) → string

"I0 C4:2 E4:2 R:4 ..." -> sequence bytes (durations in units * ticksPerUnit at 100 ticks/s)

argtypedescription
textstring
tpunumber
sfxboolean?

bytesAsm(s: string) → string

argtypedescription
sstring

driverImage(songs: { { any } }, sfx: { string }) → void

the driver + tables + songs + sfx + samples, as one ARAM image from $0200 songs: list of { 6 track strings (or false) } ; sfx: list of track strings

argtypedescription
songs{ { any } }
sfx{ string }

headerAsm(title: string, romKB: number, sramKB: number) → string

the header + vectors at $80FFC0 (LoROM, fast ROM)

argtypedescription
titlestring
romKBnumber
sramKBnumber

assembleGame(g: any) → string

assemble a game: runtime + game source + header, the sound image at $818000

argtypedescription
gany

buildGame(name: string) → string

argtypedescription
namestring

build(write: boolean?) → void

assemble every game; write them to /zero/source/snes_roms when `write`

argtypedescription
writeboolean?

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.