Changeset 34 for trunk/asma/Docs/Sap.txt
- Timestamp:
- Sep 1, 2001, 12:36:40 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/asma/Docs/Sap.txt
r32 r34 1 1 SAP 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. 2 player/music type and contains credits for the song. Second part (in binary 3 format) contains player and music data formed into Atari Binary File format. 19 4 20 5 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: 6 First part - text info 7 ~~~~~~~~~~~~~~~~~~~~~~ 8 For identification of the format, it always starts with "SAP" string. 9 After that the credits follow. However, this is not fixed order, just a 10 recommendation. Each line should end with EOL string (0D 0A). 26 11 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". 12 Credits tags: 13 AUTHOR "" - 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)" 19 NAME "" - 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" 23 DATE "" - 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" 39 29 40 commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format: 30 After that the player info follows: 31 TYPE - player type 32 PLAYER - address of player part which will be executed in 1/50 sec 33 intervals (or as definet with FASTPLAY) 34 MUSIC - address with music data (for type C) 35 INIT - address of player part which will init player (for all types 36 except C) 37 SONGS - number of songs. If SONGS tag not defined, the default value is 38 0. 39 DEFSONG - 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. 43 FASTPLAY - 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) 50 STEREO - tune uses dual POKEY configuration. 51 52 commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format. Both 53 lower- and uppercase characters are allowed for the number. 41 54 42 55 PLAYER A000 43 56 PLAYER 1234 44 MUSIC F40057 MUSIC f42e 45 58 46 59 commands SONGS, DEFSONG contain decimal numbers: … … 49 62 DEFSONG 9 50 63 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 64 command TYPE contains single character which describes player type. The 65 following player types are supported: 60 66 61 67 TYPE C - player from CMC (Chaos Music Composer). In this case, also these … … 75 81 jsr PLAYER+6 76 82 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. 88 85 89 86 TYPE B - any player. In this case, also these commands must appear: PLAYER, … … 97 94 jsr PLAYER 98 95 99 TYPE B is right now exactly the same like TYPE M but this100 distinguish is for future SAP releases.101 102 96 TYPE S - SoftSynth. Like type "C", this type is temporary, and is used only 103 97 for special type of songs, that were composed using program 104 98 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). 99 TYPE 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 113 One more type is recognized by SAP player - TYPE M. Right now it's exactly 114 the same as TYPE B but this differentiation is for future SAP releases. 118 115 119 116 Planned features: … … 121 118 This part contains values that will be directly written to Pokey 122 119 registers ($D200-$D208) in 1/50s intervals. 123 TIME xx:xx - song duration 120 TIME xx:xx - Song duration. This is actually already supported by SAP WinAMP 121 plug-in 122 123 Example of the header: 124 SAP 125 AUTHOR "Jakub Husak" 126 NAME "Inside" 127 DATE "1990" 128 SONGS 3 129 DEFSONG 0 130 TYPE B 131 INIT 0F80 132 PLAYER 247F 133 134 135 Second part - binary data 136 ~~~~~~~~~~~~~~~~~~~~~~~~~ 137 This part contains player and music data represented in Atari binary file 138 format. This format has two bytes header FF,FF. Next two bytes tell loader, 139 where to load data, and next two bytes describes where the data end. 140 Init data block ($02E2,$02E3) is not supported. 141 142 A little example: 143 144 FF FF 00 20 04 20 01 42 A3 04 D5 145 \___/ \_________/ \____________/ 146 A B C 147 148 A - Binary file header identification (always FF FF) 149 B - Load addres (StartAddr, EndAddr in LO,HI order - $2000 to $2004) 150 C - Data (that will be loaded from StartAddr) 151 152 This example will load values 01,42,A3,04,D5 into memory from $2000 to $2004. 153 124 154 125 155 How to create .SAP file … … 132 162 copy /b music.txt+music.bin music.sap 133 163 134 The file is done now!135 If you didn't find that song in ASMA, feel free to send it to p g@pinknet.cz136 with all needed information (see ASMA.TXT for details). The song should be 137 included in the nearest ASMA update.164 The file is made now! 165 If you didn't find that song in ASMA, feel free to send it to p 166 g@dspaudio.com with all needed information (see ASMA.TXT for details). The 167 song should be then included in the nearest ASMA update.
Note: See TracChangeset
for help on using the changeset viewer.