source: trunk/asma/Docs/Sap.txt@ 33

Last change on this file since 33 was 32, checked in by pfusik, 25 years ago

Imported ASMA 2.0

File size: 5.2 KB
Line 
1SAP file divides into two parts. First part (in text format) describes
2player/music type. Second part (in binary format) contains player and music
3data formed into Atari Binary File Format. This format has two bytes header
4FF,FF. Next two bytes tell loader, where to load data, and next two bytes
5describes where the data end.
6Init data block ($02E2,$02E3) is not supported.
7
8A little example:
9
10FF FF 00 20 05 20 01 42 A3 04 D5
11\___/ \_________/ \____________/
12 A B C
13
14A - Binary file header identification (always FF FF)
15B - Load addres (StartAddr, EndAddr in LO,HI order - $2000 to $2005)
16C - Data (that will be loaded from StartAddr)
17
18This example will load values 01,42,A3,04,D5 into memory from $2000 to $2005.
19
20
21Player Description format (first part of .sap file)
22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23This description (in text format) is loaded line per line. Each line contains
24command with parameters. Other lines which are not recognized are treated as
25comment lines. Right now only these commands are supported:
26
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".
39
40commands PLAYER, MUSIC, INIT contain addresses in hexadecimal format:
41
42PLAYER A000
43PLAYER 1234
44MUSIC F400
45
46commands SONGS, DEFSONG contain decimal numbers:
47
48SONGS 10
49DEFSONG 9
50
51command TYPE contains single character which describes player type. Right now
52only the following characters are supported:
53
54TYPE C
55TYPE B
56TYPE M
57TYPE S
58TYPE D
59TYPE R
60
61TYPE C - player from CMC (Chaos Music Composer). In this case, also these
62 commands must appear: PLAYER, MUSIC, SONGS, and DEFSONG. Player will
63 be initialized as follows:
64
65 lda #$70
66 ldx #<MUSIC
67 ldy #>MUSIC
68 jsr PLAYER+3
69 lda #$00
70 ldx #DEFSONG
71 jsr PLAYER+3
72
73 in 1/50 intervals will be executed:
74
75 jsr PLAYER+6
76
77TYPE 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
88
89TYPE B - any player. In this case, also these commands must appear: PLAYER,
90 INIT, SONGS, and DEFSONG. Player will be initialized as follows:
91
92 lda #DEFSONG
93 jsr INIT
94
95 in 1/50 intervals will be executed:
96
97 jsr PLAYER
98
99 TYPE B is right now exactly the same like TYPE M but this
100 distinguish is for future SAP releases.
101
102TYPE S - SoftSynth. Like type "C", this type is temporary, and is used only
103 for special type of songs, that were composed using program
104 SoftSynth.
105TYPE 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).
118
119Planned features:
120TYPE R - Registers. In this type, binary part is not an Atari binary file.
121 This part contains values that will be directly written to Pokey
122 registers ($D200-$D208) in 1/50s intervals.
123TIME xx:xx - song duration
124
125How to create .SAP file
126~~~~~~~~~~~~~~~~~~~~~~~
127First of all we need to rip music from a game or a demo and save it in atari
128binary file. Next we can create text file with commands (described above),
129then we can make .sap file by linking thwse two files. We can do that using
130DOS command "copy", e.g.:
131
132copy /b music.txt+music.bin music.sap
133
134The file is done now!
135If you didn't find that song in ASMA, feel free to send it to pg@pinknet.cz
136with all needed information (see ASMA.TXT for details). The song should be
137included in the nearest ASMA update.
Note: See TracBrowser for help on using the repository browser.