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.
0x08
blit
( sheet sx sy w h dx dy flags -- )
GameTank only: copy a w×h rect from sprite sheet `sheet` at (sx,sy) to the framebuffer at (dx,dy). `flags` bits: 1=hflip, 2=vflip, 4=transparent, 8=fill.
Audio (0x20 – 0x27, 8 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-music
( pattern -- )
Start the music slot on `pattern`, looping. Cart-Forth alias: `play-pattern`.
0x23
play-once
( pattern -- )
One-shot SFX on auto-allocated slot. Equivalent to passing pattern + -1 to `play-sfx` (e.g. `2 -1 play-sfx`).
0x25
play-sfx
( pattern slot -- )
One-shot SFX; `slot` 0..=3 or -1 for auto.
0x26
loop-sfx
( pattern slot -- )
Looping SFX; same slot semantics as `play-sfx`.
0x24
stop-music
( -- )
Stop the music slot only.
0x27
stop-sfx
( slot -- )
Stop SFX slot 0..=3 or all SFX (-1).
0x28
set-bpm
( frames-per-row -- )
Set the music slot's tempo (frames per row, 2..=64). Takes effect at the next row boundary. No-op when music is stopped; never affects SFX slots.
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.