tile(rows: { string }) → void
graphics
one 8x8 tile from 8 strings of 8 hex colour indices ('.' = 0) -> 32 planar bytes
| arg | type | description |
|---|
| 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)
| arg | type | description |
|---|
| rows | { string } | |
| colMajor | boolean? | |
cut(tx: number, ty: number) → void
| arg | type | description |
|---|
| tx | number | |
| ty | number | |
tilesAsm(label: string, tiles: { { number } }) → string
tiles -> "db" source
| arg | type | description |
|---|
| label | string | |
| 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.
| arg | type | description |
|---|
| rows | { string } | |
rgb(r: number, g: number, b: number) → number
SMS colour (6-bit) from 8-bit r, g, b
| arg | type | description |
|---|
| r | number | |
| g | number | |
| b | number | |
q(v: number) → number return math
| arg | type | description |
|---|
| v | number | |
rgbGG(r: number, g: number, b: number) → number
Game Gear colour (12-bit) from 8-bit r, g, b
| arg | type | description |
|---|
| r | number | |
| g | number | |
| b | number | |
q(v: number) → number return math
| arg | type | description |
|---|
| v | number | |
paletteAsm(label: string, cols: { { number } }, gg: boolean?) → string
palette: SMS = 16 bytes, GG = 16 little-endian words. cols = { {r,g,b}, ... }
| arg | type | description |
|---|
| label | string | |
| cols | { { number } } | |
| gg | boolean? | |
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)
| arg | type | description |
|---|
| fg | number | |
| sh | number | |
| bg | number? | |
at(col: number, row: number) → number
name-table VRAM address of tile column/row
| arg | type | description |
|---|
| col | number | |
| row | number | |
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
| arg | type | description |
|---|
| label | string | |
| text | string | |
sineAsm(label: string, amp: number) → string
sine table: 256 signed bytes scaled by amp
| arg | type | description |
|---|
| label | string | |
| amp | number | |
runtime(gg: boolean?) → string
the runtime source for an SMS (gg = false) or Game Gear cart
| arg | type | description |
|---|
| gg | boolean? | |
sdscStrings(name: string, author: string, desc: string) → string
SDSC homebrew header strings (placed in the code area by the game source)
| arg | type | description |
|---|
| name | string | |
| author | string | |
| desc | string | |
assemble(src: string, gg: boolean?) → string
build
assemble a 32 KB cart: SDSC header at 7FE0, TMR SEGA header + checksum at 7FF0
| arg | type | description |
|---|
| src | string | |
| gg | boolean? | |
build(write: boolean?) → void
assemble every game and write the carts; returns { [file] = bytes }
| arg | type | description |
|---|
| write | boolean? | |