Martin Galway's player (the Ocean "macro-language" driver) cheat sheet

From Martin Galway's player (the Ocean "macro-language" driver) · print · built 2026-08-31

Reference

Cheat sheet#

All from the two reverse-engineered files (sources: s-realdmx-galway-rambo-player, s-realdmx-galway-arkanoid-player).

The stream — one byte-code program per voice, no patterns, no order list:

bytesRambo loaderArkanoid
$00–$58 / $00–$5e + nnnote (C-0 … E-7) with nn = index into a 17-entry duration table (multiples of 4 frames)note with nn = 1-based index into a 32-entry table rebuilt per tune as multiples of its minimum duration
note + $60 + nnnote with an immediate duration in framesnote with a raw tick count
$5f / $bfrest (table / immediate time)$5f nn rest
≥ $c0opcode + 2 parameter bytes (3 bytes; CE has 4)opcode + parameters (1–4 bytes)

Opcodes

Rambo loaderArkanoidmeaning
C0 RETC0 RTSreturn from a call; on an empty stack, stop the voice
CA addr PLAYC2 addr JSRcall a sub-stream (8-level stack per voice)
CE addr,n PLAYTC6 n,addr JSRTcall with a note transpose ($f4 = −12)
C4 addr JMPjump (endless tunes; voices can jump into each other's streams — a delayed echo)
DA nDC REPEAT/NEXTCC nCE FOR/NEXTloops, nestable
CC n TRANS(in JSRT)set the transpose
C2 addr INSTR5D4 addr INSTRcopy 5 bytes: control, AD, SR, gate time, "hrtime"
C4 addr INSTRD2 n,addr SETNIcopy a whole instrument (29 bytes)
C6 addr SETFQF0 addr SETFIcopy the 14-byte frequency program
C8 addr SETPMcopy the 10-byte pulse program
D8 addr ARP(DC $08 addr)load a 10-byte / 4-byte arpeggio table
D0 off,val ISETCA id,val SET, DC id,v1,v2 SET2Ipoke the instrument definition
D6 off,val CISETD6 id,val SETCI, DE id,v1,v2 SET2CIpoke the running instrument — change the sounding note
D4 addr EXECD8 addr EXCTexecute 6502 code from the song (Rambo's morse-code intro; Arkanoid's filter switches)
E0 LF3, E2 addr FILTAfilter on voice 3 (resonance $f, low-pass); load a 16-byte filter envelope

Reading a phrase: p2c9d: REPEAT 8 / $00,$01 / NEXT / REPEAT 4 / $00,$02 / NEXT / RET then PLAYT G4,p2c9d and PLAYT Fx4,p2cb4 (Rambo); sub07: JSRT $1f sub06 / JSRT $1d sub06 / JSRT $1b sub06 / JSRT $1a sub06 / RTS (Arkanoid).

Instrument = 29 bytes ($00–$1c):

offsetcontent
$00–$07four signed 16-bit frequency adders
$08–$0btheir durations in frames/ticks (0 = skip)
$0cinitial delay
$0dflags: $01 reload the stages (loop), $80 reload from the note's own frequency after stage 4, $02 apply adder 4 during the delay (a slide into the note), $08 arpeggio mode (Arkanoid: voice 2 only)
$0e/$0ftwo pulse-width stage lengths
$10pulse delay
$11pulse flags ($80 reset the width and restart, $01 restart the counters)
$12–$15two signed 16-bit pulse adders
$16/$17initial pulse width
$18control byte (the test bit here is a mode flag: release the gate $1b ticks before the next note instead of after the note-on)
$19/$1aAD, SR
$1bgate time ($ff = never release)
$1c"hrtime": frames after gate-off at which the voice's 7 registers are zeroed ($ff = never) — Tognon's "; hard restart"

A vibrato is three adders: !wo 30, !wo -30, !wo 30, !wo 0 / $03,$06,$03,$00 / delay $16, flags $05 (Rambo fq2b91); $14,$00 / $ec,$ff / $14,$00 / $00,$00 / $03,$06 / $03,$00 / $1e,$05 (Arkanoid ins01). A drum: ISET $00,$b0 ; fq1add / ISET $08,$ff ; fq1time / ISET $1a,$a9 ; sr / ISET $1b,$0a ; release. A pulse: $14,$14,$00,$05, $14,$00,$ec,$ff, $00,$08 = 20 frames +20, 20 frames −20 around $0800. An arpeggio table is a 4-note stack including the octave — $00,$04,$07,$0c (Rambo, doubled to 8 entries), arp37: $0c,$00,$03,$07 (Arkanoid, read backwards). Every note starts by writing $00 and then the five register bytes (Rambo) or $08 (test) and then the registers (Arkanoid).

Arkanoid's sample track (own language, opcodes = 6502 opcodes): 81–86 xx play synthesized drum n, wait xx ticks; 87 xx nothing; 20 lo hi JSR; 40 NEXT; 49 xx FOR; 4C lo hi JMP; 60 RTS.