Every cart-Forth host word compiles to a single HCALL <id> bytecode op. The wire ids are stable; the same ids appear in cart binaries and in the bytecode disassembler. Surface names match the host word in the Forth reference.
Display (0x00 – 0x07)
Id
Name
Stack effect
Summary
0x00
cls
( c -- )
Clear the screen to color index `c`.
0x01
pixel
( x y c -- )
Set pixel at (x,y) to color index `c`.
0x02
sprite
( tile x y flags -- )
Draw sprite `tile` at (x,y). `flags` bits: 1=hflip, 2=vflip, 4=wrap. Color 0 in the tile is transparent.
0x03
rect
( x y w h c -- )
Draw filled w×h rectangle at (x,y) in color `c`.
0x04
line
( x0 y0 x1 y1 c -- )
Draw a line from (x0,y0) to (x1,y1) in color `c`.
0x05
print
( x y c addr len -- )
Render text from RAM at (x,y) in color `c` using the 4×6 font; `\n` advances to a new line.
0x06
camera
( x y -- )
Set the camera offset (subtracted from draw coords).
0x07
clip
( x y w h -- )
Set the clipping rectangle for subsequent draws.
Audio (0x20 – 0x24, 4 wired)
Id
Name
Stack effect
Summary
0x20
note!
( pitch instrument voice -- )
Trigger MIDI `pitch` on `voice` using `instrument`'s ADSR.
0x21
mute!
( voice -- )
Silence `voice` immediately (no release ramp).
0x22
play-pattern
( pattern -- )
Start the host tracker engine on `pattern`. Loops until `stop-music`.
0x23
play-once
( pattern -- )
Like `play-pattern` but auto-stops on row wrap (one pass). Use for SFX + game-over jingles.
0x24
stop-music
( -- )
Stop the host tracker engine.
Input (0x40 – 0x41, 2 wired)
Id
Name
Stack effect
Summary
0x40
btn
( id -- flag )
Push -1 if button `id` is held this frame, else 0.
0x41
btnp
( id -- flag )
Push -1 if button `id` was pressed this frame (rising edge), else 0.