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:
| bytes | Rambo loader | Arkanoid |
|---|---|---|
$00–$58 / $00–$5e + nn | note (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 + nn | note with an immediate duration in frames | note with a raw tick count |
$5f / $bf | rest (table / immediate time) | $5f nn rest |
≥ $c0 | opcode + 2 parameter bytes (3 bytes; CE has 4) | opcode + parameters (1–4 bytes) |
Opcodes
| Rambo loader | Arkanoid | meaning |
|---|---|---|
C0 RET | C0 RTS | return from a call; on an empty stack, stop the voice |
CA addr PLAY | C2 addr JSR | call a sub-stream (8-level stack per voice) |
CE addr,n PLAYT | C6 n,addr JSRT | call with a note transpose ($f4 = −12) |
| — | C4 addr JMP | jump (endless tunes; voices can jump into each other's streams — a delayed echo) |
DA n … DC REPEAT/NEXT | CC n … CE FOR/NEXT | loops, nestable |
CC n TRANS | (in JSRT) | set the transpose |
C2 addr INSTR5 | D4 addr INSTR | copy 5 bytes: control, AD, SR, gate time, "hrtime" |
C4 addr INSTR | D2 n,addr SETNI | copy a whole instrument (29 bytes) |
C6 addr SETFQ | F0 addr SETFI | copy the 14-byte frequency program |
C8 addr SETPM | — | copy the 10-byte pulse program |
D8 addr ARP | (DC $08 addr) | load a 10-byte / 4-byte arpeggio table |
D0 off,val ISET | CA id,val SET, DC id,v1,v2 SET2I | poke the instrument definition |
D6 off,val CISET | D6 id,val SETCI, DE id,v1,v2 SET2CI | poke the running instrument — change the sounding note |
D4 addr EXEC | D8 addr EXCT | execute 6502 code from the song (Rambo's morse-code intro; Arkanoid's filter switches) |
| — | E0 LF3, E2 addr FILTA | filter 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):
| offset | content |
|---|---|
$00–$07 | four signed 16-bit frequency adders |
$08–$0b | their durations in frames/ticks (0 = skip) |
$0c | initial delay |
$0d | flags: $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/$0f | two pulse-width stage lengths |
$10 | pulse delay |
$11 | pulse flags ($80 reset the width and restart, $01 restart the counters) |
$12–$15 | two signed 16-bit pulse adders |
$16/$17 | initial pulse width |
$18 | control 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/$1a | AD, SR |
$1b | gate 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.