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

homebrew

The Master System package's own homebrew carts, written here in Z80 assembly and assembled in the engine with `mastersystem.asm`: a shared runtime (boot, VDP setup, vblank wait, pads + Pause, sprite table, text, BCD scores, PSG sound effects and a two-voice music player, RNG, bat…

by◐Deata·posted 2d ago
What it does

mastersystem.homebrew

The Master System package's own homebrew carts, written here in Z80 assembly and assembled in the engine with mastersystem.asm: a shared runtime (boot, VDP setup, vblank wait, pads + Pause, sprite table, text, BCD scores, PSG sound effects and a two-voice music player, RNG, battery RAM, line-interrupt hook), a 5x7 font and tile helpers that turn pixel art written as strings into SMS planar tiles, the SDSC + TMR SEGA headers, and one module per game. All of it, and the ROMs it builds, is original work released under CC0 1.0 (public domain): copy, change and redistribute freely.

local H = require("mastersystem.homebrew")
H.build()   -- assembles every game into /zero/source/mastersystem_roms/

Each game advances the byte at RAM $C000 once per logic step (the logic-rate probe the speed checks read).

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

tile(rows: { string }) → void

graphics one 8x8 tile from 8 strings of 8 hex colour indices ('.' = 0) -> 32 planar bytes

argtypedescription
rows{ string }

image(rows: { string }, colMajor: boolean?) → void

a WxH image (rows of hex chars) cut into 8x8 tiles, row-major (8x16 sprites: pass colMajor = true so each column's top/bottom tiles are adjacent)

argtypedescription
rows{ string }
colMajorboolean?

cut(tx: number, ty: number) → void

argtypedescription
txnumber
tynumber

tilesAsm(label: string, tiles: { { number } }) → string

tiles -> "db" source

argtypedescription
labelstring
tiles{ { number } }

tilemap(rows: { string }) → void

a painted image (rows of hex colour chars, width a multiple of 8) cut into unique tiles. Returns the tiles and, per tile row, the tile numbers (0-based, indices into `tiles`) — the name-table map of the image.

argtypedescription
rows{ string }

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

SMS colour (6-bit) from 8-bit r, g, b

argtypedescription
rnumber
gnumber
bnumber

q(v: number) → number return math

argtypedescription
vnumber

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

Game Gear colour (12-bit) from 8-bit r, g, b

argtypedescription
rnumber
gnumber
bnumber

q(v: number) → number return math

argtypedescription
vnumber

paletteAsm(label: string, cols: { { number } }, gg: boolean?) → string

palette: SMS = 16 bytes, GG = 16 little-endian words. cols = { {r,g,b}, ... }

argtypedescription
labelstring
cols{ { number } }
ggboolean?

fontTiles(fg: number, sh: number, bg: number?) → void

64 tiles for ASCII 32..95: glyph in colour `fg` with a drop shadow in `sh` (bg = colour behind the glyph, default 0 = transparent / backdrop)

argtypedescription
fgnumber
shnumber
bgnumber?

at(col: number, row: number) → number

name-table VRAM address of tile column/row

argtypedescription
colnumber
rownumber

noteTableAsm( ) → string

PSG periods for MIDI notes 36..99 (NTSC 3.579545 MHz: period = clock / (32 f))

trackAsm(label: string, text: string) → string

a music track from "C4:8 E4:8 R:4 ..." (note name + octave : frames), looped

argtypedescription
labelstring
textstring

sineAsm(label: string, amp: number) → string

sine table: 256 signed bytes scaled by amp

argtypedescription
labelstring
ampnumber

runtime(gg: boolean?) → string

the runtime source for an SMS (gg = false) or Game Gear cart

argtypedescription
ggboolean?

sdscStrings(name: string, author: string, desc: string) → string

SDSC homebrew header strings (placed in the code area by the game source)

argtypedescription
namestring
authorstring
descstring

assemble(src: string, gg: boolean?) → string

build assemble a 32 KB cart: SDSC header at 7FE0, TMR SEGA header + checksum at 7FF0

argtypedescription
srcstring
ggboolean?

build(write: boolean?) → void

assemble every game and write the carts; returns { [file] = bytes }

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.