General information
~~~~~~~~~~~~~~~~~~~
SAP file divides into two parts. First part (in text format) describes
player/music type. Second part (in binary format) contains player and music
data formed into Atari Binary File Format. This format has two bytes header
FF,FF. Next two bytes tell loader, where to load data, and next two bytes
describes where the data end.
Init data block ($02E2,$02E3) is not supported.


Player Description format (first part of .sap file)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This description (in text format) is loaded line per line. Each line contains
command with parameters. Other lines which are not recognized are treated as
comment lines. Right now only these commands are supported:

   TYPE      - player type
   PLAYER    - address of player part which will be executed in 1/50 sec
               intervals
   MUSIC     - address with data
   INIT      - address of player part which will init player
   SONGS     - number of songs
   DEFSONG   - first song which will be played when .sap will be loaded

commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format:

PLAYER A000
PLAYER 1234
MUSIC  F400

commands SONGS, DEFSONG contain decimal numbers:

SONGS 10
DEFSONG 9

command TYPE contains single character which describes player type. Right now
only the following characters are supported:

TYPE C
TYPE B
TYPE M

TYPE C - player from CMC (Chaos Music Composer). In this case, also these
         commands must appear: PLAYER, MUSIC, SONGS, and DEFSONG. Player will
         be initialized as follows:

         lda #$70
         ldx #<MUSIC
         ldy #>MUSIC
         jsr PLAYER+6
         lda #$00
         ldx #DEFSONG
         jsr PLAYER+6

         in 1/50 intervals will be executed:

         jsr PLAYER+3

TYPE M - player from ???????? (this player was used by composers like Adam
         Gilmore, David Whittaker, etc). In this case, also these commands
         must appear: PLAYER, INIT, SONGS, and DEFSONG. Player will be
         initialized as follows:

         lda #DEFSONG
         jsr INIT

         in 1/50 intervals will be executed:

         jsr PLAYER

TYPE B - any player. In this case, also these commands must appear: PLAYER,
         INIT, SONGS, and DEFSONG. Player will be initialized as follows:

         lda #DEFSONG
         jsr INIT

         in 1/50 intervals will be executed:

         jsr PLAYER

         TYPE B is right now exactly the same like TYPE M but this
         distinguish is for future SAP releases.


How to create .SAP file
~~~~~~~~~~~~~~~~~~~~~~~
First of all we need to rip music from a game or a demo and save it in atari
binary file. Next we can create text file with commands (described above),
then we can make .sap file by linking thwse two files. We can do that using
DOS command "copy", e.g.:

copy /b music.txt+music.bin music.sap

The file is done!
