Changeset 34 for trunk/asma/Docs/Sap.txt


Ignore:
Timestamp:
Sep 1, 2001, 12:36:40 AM (23 years ago)
Author:
pfusik
Message:

Imported ASMA 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/asma/Docs/Sap.txt

    r32 r34  
    11SAP file divides into two parts. First part (in text format) describes
    2 player/music type. Second part (in binary format) contains player and music
    3 data formed into Atari Binary File Format. This format has two bytes header
    4 FF,FF. Next two bytes tell loader, where to load data, and next two bytes
    5 describes where the data end.
    6 Init data block ($02E2,$02E3) is not supported.
    7 
    8 A little example:
    9 
    10 FF FF 00 20 05 20 01 42 A3 04 D5
    11 \___/ \_________/ \____________/
    12   A        B            C
    13 
    14 A - Binary file header identification (always FF FF)
    15 B - Load addres (StartAddr, EndAddr in LO,HI order - $2000 to $2005)
    16 C - Data (that will be loaded from StartAddr)
    17 
    18 This example will load values 01,42,A3,04,D5 into memory from $2000 to $2005.
     2player/music type and contains credits for the song. Second part (in binary
     3format) contains player and music data formed into Atari Binary File format.
    194
    205
    21 Player Description format (first part of .sap file)
    22 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    23 This description (in text format) is loaded line per line. Each line contains
    24 command with parameters. Other lines which are not recognized are treated as
    25 comment lines. Right now only these commands are supported:
     6First part - text info
     7~~~~~~~~~~~~~~~~~~~~~~
     8For identification of the format, it always starts with "SAP" string.
     9After that the credits follow. However, this is not fixed order, just a
     10recommendation. Each line should end with EOL string (0D 0A).
    2611
    27    TYPE      - player type
    28    PLAYER    - address of player part which will be executed in 1/50 sec
    29                intervals
    30    MUSIC     - address with data
    31    INIT      - address of player part which will init player
    32    SONGS     - number of songs
    33    DEFSONG   - first song which will be played when .sap will be loaded
    34    FASTPLAY  - number of lines between each call of playing routine (312 by
    35                default, which is one screen - 1/50 of sec.). For example for
    36                double-speed tune put here the value 156 (312/2). 99% of tunes
    37                are single-speed which means that you don't have to define the
    38                FASTPLAY variable for them. Works for player TYPE "B".
     12Credits tags:
     13AUTHOR "" - Name of composer. For ASMA purposes, the name should consist of
     14            real name and nickname (scene handle) in parentheses. No scene
     15            group allowed. If song was composed by more authors, use "&".
     16            Examples:
     17            AUTHOR "Dariusz Duma (Dhor)"
     18            AUTHOR "Lukasz Sychowicz (X-Ray) & Piotr Swierszcz (Samurai)"
     19NAME "" - Song title. No restrictions, except for it shouldn't contain
     20          quotation marks. Use apostroph instead.
     21          Example:
     22          NAME "Jocky Wilson's Darts Challenge"
     23DATE "" - Copyright year. If exact date is known, it can also be included in
     24          DD/MM/YYYY format.
     25          Examples:
     26          DATE "1986"
     27          DATE "28/08/1997"
     28          DATE "12/2000"
    3929
    40 commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format:
     30After that the player info follows:
     31TYPE      - player type
     32PLAYER    - address of player part which will be executed in 1/50 sec
     33            intervals (or as definet with FASTPLAY)
     34MUSIC     - address with music data (for type C)
     35INIT      - address of player part which will init player (for all types
     36            except C)
     37SONGS     - number of songs. If SONGS tag not defined, the default value is
     38            0.
     39DEFSONG   - first song which will be played when .sap will be loaded.
     40            This value is counted from zero (if there are 5 songs in the
     41            file and the last is the default, the value will be DEFSONG 4).
     42            The default is 0 if DEFSONG not defined.
     43FASTPLAY  - number of lines between each call of playing routine (312 by
     44            default, which is one screen - 1/50 of sec.). For example for
     45            double-speed tune put here the value 156 (312/2). 99% of tunes
     46            are single-speed which means that you don't have to define the
     47            FASTPLAY variable for them. Works for player TYPE "B".
     48            Another values recommended: 104 (triple speed), 78 (quadruple
     49            speed)
     50STEREO - tune uses dual POKEY configuration.
     51
     52commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format. Both
     53lower- and uppercase characters are allowed for the number.
    4154
    4255PLAYER A000
    4356PLAYER 1234
    44 MUSIC  F400
     57MUSIC  f42e
    4558
    4659commands SONGS, DEFSONG contain decimal numbers:
     
    4962DEFSONG 9
    5063
    51 command TYPE contains single character which describes player type. Right now
    52 only the following characters are supported:
    53 
    54 TYPE C
    55 TYPE B
    56 TYPE M
    57 TYPE S
    58 TYPE D
    59 TYPE R
     64command TYPE contains single character which describes player type. The
     65following player types are supported:
    6066
    6167TYPE C - player from CMC (Chaos Music Composer). In this case, also these
     
    7581         jsr PLAYER+6
    7682
    77 TYPE M - player from ???????? (this player was used by composers like Adam
    78          Gilmore, David Whittaker, etc). In this case, also these commands
    79          must appear: PLAYER, INIT, SONGS, and DEFSONG. Player will be
    80          initialized as follows:
    81 
    82          lda #DEFSONG
    83          jsr INIT
    84 
    85          in 1/50 intervals will be executed:
    86 
    87          jsr PLAYER
     83         This is just internal structure already contained in SAP player, you
     84         don't have to add this code to the CMC player.
    8885
    8986TYPE B - any player. In this case, also these commands must appear: PLAYER,
     
    9794         jsr PLAYER
    9895
    99          TYPE B is right now exactly the same like TYPE M but this
    100          distinguish is for future SAP releases.
    101 
    10296TYPE S - SoftSynth. Like type "C", this type is temporary, and is used only
    10397         for special type of songs, that were composed using program
    10498         SoftSynth.
    105 TYPE D - Digital. In SAP file with this type, must be also defined commands
    106          "INIT" and "PLAYER". "PLAYER" (like in type "B") sets address of
    107          procedure that will be called in 1/50s intervals and (like in type
    108          "B") must end with RTS opcode. INIT this time is a bit different. It
    109          sets address of procedure that will be called (with number of song
    110          in register A) to initialize program, but it can't end with RTS. It
    111          should start playing digis in endless loop. In SAP player there are
    112          emulated two ANTIC registers $D40A and $D40B that can help playing
    113          samples. D40B register increases its contents each two screen lines.
    114          D40A holds CPU till the end of actually created line. SAP emulates
    115          Atari in PAL with disabled screen. It means that we have 312 PAL
    116          lines, while each lines has 105 CPU cycles and 9 cycles of memory
    117          refresh (114 cycles per line).
     99TYPE D - Digital. In SAP file with this type, there must be also defined
     100         commands "INIT" and "PLAYER". "PLAYER" (like in type B) sets
     101         address of procedure that will be called in 1/50s intervals and
     102         (like in type B) must end with RTS opcode. INIT this time is a bit
     103         different. It sets address of procedure that will be called (with
     104         number of song in register A) to initialize program, but it can't
     105         end with RTS. It should start playing digis in endless loop. In SAP
     106         player two ANTIC registers $D40A and $D40B are emulated. They help
     107         playing samples. D40B register increases its contents each two
     108         screen lines. D40A holds CPU till the end of actually drawn line.
     109         SAP emulates Atari in PAL with disabled screen. It means that we
     110         have 312 lines per screen, each taking 105 CPU cycles and 9 cycles
     111         of memory refresh (114 cycles per line).
     112
     113One more type is recognized by SAP player - TYPE M. Right now it's exactly
     114the same as TYPE B but this differentiation is for future SAP releases.
    118115
    119116Planned features:
     
    121118         This part contains values that will be directly written to Pokey
    122119         registers ($D200-$D208) in 1/50s intervals.
    123 TIME xx:xx - song duration
     120TIME xx:xx - Song duration. This is actually already supported by SAP WinAMP
     121             plug-in
     122
     123Example of the header:
     124SAP
     125AUTHOR "Jakub Husak"
     126NAME "Inside"
     127DATE "1990"
     128SONGS 3
     129DEFSONG 0
     130TYPE B
     131INIT 0F80
     132PLAYER 247F
     133
     134
     135Second part - binary data
     136~~~~~~~~~~~~~~~~~~~~~~~~~
     137This part contains player and music data represented in Atari binary file
     138format. This format has two bytes header FF,FF. Next two bytes tell loader,
     139where to load data, and next two bytes describes where the data end.
     140Init data block ($02E2,$02E3) is not supported.
     141
     142A little example:
     143
     144FF FF 00 20 04 20 01 42 A3 04 D5
     145\___/ \_________/ \____________/
     146  A        B            C
     147
     148A - Binary file header identification (always FF FF)
     149B - Load addres (StartAddr, EndAddr in LO,HI order - $2000 to $2004)
     150C - Data (that will be loaded from StartAddr)
     151
     152This example will load values 01,42,A3,04,D5 into memory from $2000 to $2004.
     153
    124154
    125155How to create .SAP file
     
    132162copy /b music.txt+music.bin music.sap
    133163
    134 The file is done now!
    135 If you didn't find that song in ASMA, feel free to send it to pg@pinknet.cz
    136 with all needed information (see ASMA.TXT for details). The song should be
    137 included in the nearest ASMA update.
     164The file is made now!
     165If you didn't find that song in ASMA, feel free to send it to p
     166g@dspaudio.com with all needed information (see ASMA.TXT for details). The
     167song should be then included in the nearest ASMA update.
Note: See TracChangeset for help on using the changeset viewer.