Everything here is from the SAP format specification on the ASAP site, read through a summarising fetch tool: “our words”.
Lines
One tag a line, ended by CR LF ($0D $0A). A line is an upper-case tag name, optionally followed by one space and an argument: a string, a decimal number, a hexadecimal number or a
single letter. The first line is SAP. The tags are recommended in the order below but not required in it; AUTHOR should come right after SAP so that
GStreamer can identify the file. The viewer flags a line that is not ended by CR LF, a tag listed twice, and a tag it does not know.
Strings
AUTHOR, NAME and DATE take a string in double quotes. The allowed characters are those that are the same in ASCII and ATASCII: the space up to the
underscore, the lower-case letters and the pipe |; the backquote, tilde and curly brackets are not allowed, and a double quote inside is to be avoided. At most 120
characters between the quotes. All three are strongly recommended; "<?>" stands for unknown.
TIME
One or two digits of minutes, a colon, two digits of seconds, optionally a dot and one to three digits of a fraction of a second, optionally a space and the upper-case word
LOOP, which marks where the tune starts to loop for ever (a player may play a looping tune longer). Example: 01:23.456 LOOP.
FASTPLAY
The number of scanlines between calls of the player; a scanline is 114 Atari clock cycles. The default is 312 for PAL (about 50 Hz) and 262 for NTSC (about 60 Hz); for type S it is 78. Common values are 156 (twice a PAL frame), 104 (three times) and 78 (four times). ASAP 3.0.0 and later accept values up to 32767; other players may allow only up to 312. The viewer prints the rate in hertz for both clocks: PAL 1,773,447 Hz and NTSC 1,789,772.5 Hz (the page’s numbers; the exact rate is the clock divided by 114 and by FASTPLAY).
Player types
| TYPE | What it is | How a player runs it |
|---|---|---|
| B | A player routine | Load the subsong number (from 0) into A and call INIT, which returns with RTS; then every FASTPLAY scanlines call PLAYER, which returns with RTS |
| C | CMC music | With A=$70, X=MUSIC low, Y=MUSIC high call PLAYER+3; then A=$00, X=the subsong and call PLAYER+3; then every FASTPLAY call PLAYER+6. To change subsong repeat the two calls |
| D | Digitised music | Like B but INIT does not return: it plays the sound itself with WSYNC and VCOUNT and/or POKEY timer interrupts. PLAYER is called with all registers and flags saved. PLAYER is optional from ASAP 2.1.0 |
| S | SoftSynth music | The format does not use PLAYER (some players want the tag). Every FASTPLAY interval, decrement memory location $45; when it reaches zero increment memory location $B07B. The default FASTPLAY is 78 |
| R | A raw register dump | Not an executable: the values of the POKEY registers $D200 to $D208 for every FASTPLAY interval. The page says no mainstream player supports it |
Game_Music_Emu supports only types B and C (the page says so).
Not described
Known, not yet covered
- The layout of a TYPE R dump beyond “registers D200 to D208 for every interval” (whether it is 9 bytes a frame, in that order, is our reading).
Unknown
- The grammar of DATE beyond the examples; a complete list of versions of the format.