~ubuntu-branches/ubuntu/oneiric/xmp/oneiric

« back to all changes in this revision

Viewing changes to docs/formats/samples.txt

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-01-15 01:15:22 UTC
  • mfrom: (1.1.8 upstream) (4.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100115011522-r4otlsg687ee1yx4
Tags: 3.0.0+20090923-1ubuntu1
* Merge from debian testing (LP: #507732).  Reamining changes:
  + Add PulseAudio support:
    - debian/rules: Add --enable-pulseaudio to ./configure
  + RFE Compile with 128 bit mixer:
    - dpatch support

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
How to decompess .IT samples:
3
 
 
4
 
Basic structure:
5
 
 
6
 
Offset  Length                  Meaning
7
 
0       2 (word)                <Compressed byte count>
8
 
2       <Compressed byte count> Compressed sample data
9
 
 
10
 
The size of the uncompressed data is 32kb or the remainder of the sample,
11
 
whichever is less.
12
 
 
13
 
Code to decompress sample data:
14
 
 
15
 
Each procedure is given DS:SI as the compressed buffer, ES:DI points to the
16
 
destination buffer for the sample. CX = <Decompressed byte count>
17
 
 
18
 
These routines haven't been optimised at all - they are the ones that have
19
 
been used in IT itself, so they should be sufficiently fast.
20
 
 
21
 
;�������������������������������������������������������������������������������
22
 
 
23
 
Proc            D_Decompress16BitData
24
 
 
25
 
                PushAD
26
 
                Mov     BP, CX
27
 
                Mov     CX, 1100h
28
 
                ShR     BP, 1
29
 
                Xor     DX, DX
30
 
                Xor     BX, BX
31
 
 
32
 
D_Decompress16BitData1:
33
 
                Push    CX
34
 
 
35
 
                Mov     EAX, [SI]
36
 
                Mov     CL, DL
37
 
                ShR     EAX, CL
38
 
 
39
 
                Add     DL, CH
40
 
                Mov     CX, DX
41
 
                ShR     CX, 3
42
 
                Add     SI, CX
43
 
                And     DL, 7
44
 
 
45
 
                Pop     CX
46
 
 
47
 
                Cmp     CH, 6
48
 
                JA      D_Decompress16BitA
49
 
 
50
 
                ShL     EAX, CL
51
 
                Cmp     AX, 8000h
52
 
                JE      D_Decompress16BitDepthChange1
53
 
 
54
 
D_Decompress16BitD:
55
 
                SAR     AX, CL
56
 
 
57
 
D_Decompress16BitC:
58
 
                Add     BX, AX
59
 
                Mov     [ES:DI], BX
60
 
                Add     DI, 2
61
 
 
62
 
                Dec     BP
63
 
                JNZ     D_Decompress16BitData1
64
 
 
65
 
                PopAD
66
 
                Ret
67
 
 
68
 
D_Decompress16BitDepthChange1:
69
 
                ShR     EAX, 16
70
 
                And     AL, 15
71
 
 
72
 
                Inc     AX
73
 
 
74
 
                Add     DL, 4
75
 
 
76
 
D_Decompress16BitDepthChange3:
77
 
                Cmp     AL, CH
78
 
                SBB     AL, 0FFh
79
 
                Mov     CL, 16
80
 
                Mov     CH, AL
81
 
                Sub     CL, AL
82
 
                AdC     CL, 0
83
 
 
84
 
                Jmp     D_Decompress16BitData1
85
 
 
86
 
D_Decompress16BitA:
87
 
                Cmp     CH, 16
88
 
                JA      D_Decompress16BitB
89
 
 
90
 
                Push    DX
91
 
                Mov     EDX, 10000h
92
 
                ShR     EDX, CL
93
 
                Dec     DX
94
 
                And     AX, DX
95
 
                ShR     DX, 1
96
 
                Add     DX, 8
97
 
                Cmp     AX, DX
98
 
                JA      D_Decompress16BitE
99
 
                Sub     DX, 16
100
 
                Cmp     AX, DX
101
 
                JBE     D_Decompress16BitE
102
 
 
103
 
                Sub     AX, DX
104
 
                Pop     DX
105
 
                Jmp     D_Decompress16BitDepthChange3
106
 
 
107
 
D_Decompress16BitE:
108
 
                Pop     DX
109
 
                ShL     AX, CL
110
 
                Jmp     D_Decompress16BitD
111
 
 
112
 
D_Decompress16BitB:
113
 
                Test    EAX, 10000h
114
 
                JZ      D_Decompress16BitC
115
 
 
116
 
                Mov     CL, 16
117
 
                Inc     AX
118
 
 
119
 
                Sub     CL, AL
120
 
                Mov     CH, AL
121
 
 
122
 
                Jmp     D_Decompress16BitData1
123
 
 
124
 
EndP            D_Decompress16BitData
125
 
 
126
 
;�������������������������������������������������������������������������������
127
 
 
128
 
Proc            D_Decompress8BitData
129
 
 
130
 
                PushA
131
 
                Mov     BP, CX
132
 
 
133
 
                Mov     BX, 900h
134
 
                Xor     CX, CX
135
 
                Xor     DX, DX
136
 
 
137
 
D_Decompress8BitData1:
138
 
                Push    CX
139
 
                Mov     AX, [SI]
140
 
                Mov     CL, CH
141
 
 
142
 
                ShR     AX, CL
143
 
                Pop     CX
144
 
 
145
 
                Add     CH, BH
146
 
                Mov     DL, CH
147
 
                And     CH, 7
148
 
                ShR     DL, 3
149
 
                Add     SI, DX
150
 
 
151
 
                Cmp     BH, 6
152
 
                JA      D_Decompress8BitA
153
 
 
154
 
                ShL     AX, CL
155
 
 
156
 
                Cmp     AL, 80h
157
 
                JE      D_Decompress8BitDepthChange1
158
 
 
159
 
D_Decompress8BitWriteData2:
160
 
                SAR     AL, CL
161
 
 
162
 
D_Decompress8BitWriteData:
163
 
                Add     BL, AL
164
 
                Mov     [ES:DI], BL
165
 
 
166
 
                Inc     DI
167
 
                Dec     BP
168
 
 
169
 
                JNZ     D_Decompress8BitData1
170
 
                PopA
171
 
                Ret
172
 
 
173
 
D_Decompress8BitDepthChange1:
174
 
                Mov     AL, AH
175
 
                Add     CH, 3
176
 
 
177
 
                And     AL, 7
178
 
                Mov     DL, CH
179
 
 
180
 
                And     CH, 7
181
 
                ShR     DL, 3
182
 
 
183
 
                Add     SI, DX
184
 
                Jmp     D_Decompress8BitD
185
 
 
186
 
D_Decompress8BitA:
187
 
                Cmp     BH, 8
188
 
                JA      D_Decompress8BitC
189
 
                JE      D_Decompress8BitB
190
 
 
191
 
                ShL     AL, 1
192
 
                Cmp     AL, 78h
193
 
                JB      D_Decompress8BitWriteData2
194
 
                Cmp     AL, 86h
195
 
                JA      D_Decompress8BitWriteData2
196
 
 
197
 
                ShR     AL, 1
198
 
                Sub     AL, 3Ch
199
 
                Jmp     D_Decompress8BitD
200
 
 
201
 
D_Decompress8BitB:
202
 
                Cmp     AL, 7Ch
203
 
                JB      D_Decompress8BitWriteData
204
 
                Cmp     AL, 83h
205
 
                JA      D_Decompress8BitWriteData
206
 
 
207
 
                Sub     AL, 7Ch
208
 
 
209
 
D_Decompress8BitD:
210
 
                Mov     CL, 8
211
 
                Inc     AX
212
 
 
213
 
                Cmp     AL, BH
214
 
                SBB     AL, 0FFh
215
 
                Mov     BH, AL
216
 
                Sub     CL, AL
217
 
                AdC     CL, 0
218
 
 
219
 
                Jmp     D_Decompress8BitData1
220
 
 
221
 
D_Decompress8BitC:
222
 
                And     AX, 1FFh
223
 
 
224
 
                Test    AX, 100h
225
 
                JZ      D_Decompress8BitWriteData
226
 
 
227
 
                Jmp     D_Decompress8BitD
228
 
 
229
 
EndP            D_Decompress8BitData
230
 
 
231