EAudio

EAUDIO · REFERENCEALPHA · USE AT YOUR OWN RISK

Command reference

EAudio 0.3 uses OSWORD &C0 with a fixed 64-byte request block and a 16-byte reply.

ByteValueMeaning
064bytes sent
116bytes returned
2–5EAUDsignature
60–7command on entry; 0 success / 1 invalid request on return
7&A5acknowledgement - clear before each call
8–15payloadcommand data or reply

Commands

#CommandPayloadEffect
0INIT-Reset state and define envelopes 1–4. Must come first.
1MUSIC_STARTbank, score page, score offsetStart a three-voice score held in a sideways ROM.
2MUSIC_STOP-Stop music.
3SFXeffect ID 0–49Play an effect, subject to channel priority.
4TICK-Top up each music voice’s MOS queue. Call regularly, including from menu loops.
5STATUS-Reply: active music at byte 8, active effect at byte 9.
6SILENCE-Music off; all four channels flushed.
7VOLUME0 mute … 3 fullRescale envelopes and fixed amplitudes.

Built-in effects

IDPriorityIntended useSound
03deathdirge E4–C4–A3, held
22player hurtshort low tone
32level upfanfare C5–E5–G5–C6, ringing
40pickupbell: F6 and C7 together
61killwhite-noise snap then a low crunch; noise channel only
80menu keyhigh white-noise tick
92chest openssparkle G5–B5–D6–G6
103boss arrivesdrum boom then a two-voice fanfare in D minor
110purchasenoise “ch-ing”
121low healthheartbeat lub-dub
others0genericone-semitone tone scale

Envelopes: 1 bell, 2 sting, 3 thud, 4 music. Tone notes take the next free tone channel, or one playing a strictly lower-priority effect; otherwise they are dropped. Menu effects stay on the noise channel so they never interrupt menu music.

Score format

A score starts with three 16-bit voice offsets. Each voice is a list of (pitch, duration) pairs; pitch 0 is a rest and duration 0 loops the voice. Bit 7 of a duration marks the first note of a bar, which EAudio starts with MOS sync so the three voices wait for each other.