Subversion Repositories Kolibri OS

Rev

Rev 5446 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5446 Rev 5458
1
; 1.0.1
1
; 1.0.1
2
 
2
 
3
 DEBUG equ 0
3
 DEBUG equ 0
4
 WIN_SIZE equ 120
4
 WIN_SIZE equ 120
5
 TIMER equ 60
5
 TIMER equ 60
6
 
6
 
7
    use32
7
    use32
8
    org     0
8
    org     0
9
    db	    'MENUET01'
9
    db	    'MENUET01'
10
    dd	    1, daemon_entry, @end, @memory, @stack, @params, 0
10
    dd	    1, daemon_entry, @end, @memory, @stack, @params, 0
11
 
11
 
12
    include "../../macros.inc"
12
    include "../../macros.inc"
13
    include "../../proc32.inc"
13
    include "../../proc32.inc"
14
    include "../../dll.inc"
14
    include "../../dll.inc"
15
    include "macros.inc"
15
    include "macros.inc"
16
if DEBUG eq 1
16
if DEBUG eq 1
17
    include "../../debug.inc"
17
    include "../../debug.inc"
18
end if
18
end if
19
;=====================================================================
19
;=====================================================================
20
 
20
 
21
 daemon_entry:
21
 daemon_entry:
22
    mcall   68, 11
22
    mcall   68, 11
23
    mcall   68, 22, shm_name, 512, 5
23
    mcall   68, 22, shm_name, 512, 5
24
    mov     [shm], eax
24
    mov     [shm], eax
25
 
25
 
26
    mcall   9, buffer, -1
26
    mcall   9, buffer, -1
27
    mov     esi, dword[buffer + 30]
27
    mov     esi, dword[buffer + 30]
28
    mov     edi, eax
28
    mov     edi, eax
29
 
29
 
30
  @@:
30
  @@:
31
    mcall   9, buffer, edi
31
    mcall   9, buffer, edi
32
    cmpe    dword[buffer + 30], esi, .next
32
    cmpe    dword[buffer + 30], esi, .next
33
    cmpe    dword[buffer + 10], dword "@Vol", open_1
33
    cmpe    dword[buffer + 10], dword "@Vol", open_1
34
    cmpe    dword[buffer + 10], dword "@VOL", open_1
34
    cmpe    dword[buffer + 10], dword "@VOL", open_1
35
    cmpe    dword[buffer + 10], dword "@vol", open_1
35
    cmpe    dword[buffer + 10], dword "@vol", open_1
36
if DEBUG eq 1
36
if DEBUG eq 1
37
    cmpe    dword[buffer + 10], dword "Volu", open_1
37
    cmpe    dword[buffer + 10], dword "Volu", open_1
38
    cmpe    dword[buffer + 10], dword "VOLu", open_1
38
    cmpe    dword[buffer + 10], dword "VOLu", open_1
39
    cmpe    dword[buffer + 10], dword "volu", open_1
39
    cmpe    dword[buffer + 10], dword "volu", open_1
40
end if
40
end if
41
 .next:
41
 .next:
42
    dec     edi
42
    dec     edi
43
    jnz     @b
43
    jnz     @b
44
 
44
 
45
    mov     eax, [shm]
45
    mov     eax, [shm]
46
    mov     [eax], dword 0
46
    mov     [eax], dword 0
47
    mcall   40, 10b
47
    mcall   40, 10b
48
    mcall   66, 1, 1
48
    mcall   66, 1, 1
49
    mcall   66, 4, 77, 0x110
49
    mcall   66, 4, 77, 0x110
50
    mcall   66, 4, 75, 0x110
50
    mcall   66, 4, 75, 0x110
51
    mcall   66, 4, 80, 0x110
51
    mcall   66, 4, 80, 0x110
52
if DEBUG eq 1
52
if DEBUG eq 1
53
    mcall   66, 4, 16, 0x110
53
    mcall   66, 4, 16, 0x110
54
end if
54
end if
55
 
55
 
56
    stdcall dll.Load, @imports
56
    stdcall dll.Load, @imports
57
    stdcall dword[img.decode], icons, icons.size, 0
57
    stdcall dword[img.decode], icons, icons.size, 0
58
    mov     dword[image.data], eax
58
    mov     dword[image.data], eax
59
    stdcall dword[img.to_rgb], dword[image.data], image
59
    stdcall dword[img.to_rgb], dword[image.data], image
60
    stdcall dword[img.destroy], dword[image.data]
60
    stdcall dword[img.destroy], dword[image.data]
61
 
61
 
62
 ; load driver
62
 ; load driver
63
    mcall   68, 16, snd_driver.name
63
    mcall   68, 16, snd_driver.name
64
    mov     [snd_driver], eax
64
    mov     [snd_driver], eax
65
    cmpe    eax, 0, exit
65
    cmpe    eax, 0, exit
66
 
66
 
67
    mcall   70, is_load
67
    mcall   70, is_load
68
    cmpe    eax, 0, @f
68
    cmpe    eax, 0, @f
69
    mov     dword[volume], 5
69
    mov     dword[volume], 5
70
  @@:
70
  @@:
71
    mcall   70, is_save
71
    mcall   70, is_save
72
    call    set_sound_proc
72
    call    set_sound_proc
73
 
73
 
74
 update:
74
 update:
75
    mcall   23, 5
75
    mcall   23, 5
76
    cmpe    al, EV_KEY, key
76
    cmpe    al, EV_KEY, key
77
    mov     eax, [shm]
77
    mov     eax, [shm]
78
    cmpne   [eax], dword 0, open_2
78
    cmpne   [eax], dword 0, open_2
79
    jmp     update
79
    jmp     update
80
 
80
 
81
 open_1:
81
 open_1:
82
    mov     ebx, 1
82
    mov     ebx, 1
83
    cmpne   [@params], byte '+', @f
83
    cmpne   [@params], byte '+', @f
84
    mov     ebx, 2
84
    mov     ebx, 2
85
  @@:
85
  @@:
86
    cmpne   [@params], byte '-', @f
86
    cmpne   [@params], byte '-', @f
87
    mov     ebx, 3
87
    mov     ebx, 3
88
  @@:
88
  @@:
89
    cmpne   [@params], byte 'm', @f
89
    cmpne   [@params], byte 'm', @f
90
    mov     ebx, 4
90
    mov     ebx, 4
91
  @@:
91
  @@:
92
    mov     eax, [shm]
92
    mov     eax, [shm]
93
    mov     [eax], ebx
93
    mov     [eax], ebx
94
    jmp     exit
94
    jmp     exit
95
 
95
 
96
 open_2:
96
 open_2:
97
    mov     eax, [shm]
97
    mov     eax, [shm]
98
    mov     ebx, [eax]
98
    mov     ebx, [eax]
99
    mov     [command], ebx
99
    mov     [command], ebx
100
    mov     [eax], dword 0
100
    mov     [eax], dword 0
101
    cmpne   [win.pid], dword 0, update
101
    cmpne   [win.pid], dword 0, update
102
    mcall   51, 1, _entry, _stack
102
    mcall   51, 1, _entry, _stack
103
    jmp     update
103
    jmp     update
104
 
104
 
105
 key:
105
 key:
106
    mcall   2
106
    mcall   2
107
if DEBUG
107
if DEBUG
108
    cmpe    ah, 16, exit
108
    cmpe    ah, 16, exit
109
end if
109
end if
110
    mov     edx, [shm]
110
    mov     edx, [shm]
111
    cmpne   ah, 77, @f
111
    cmpne   ah, 77, @f
112
 .cm_1:
112
 .cm_1:
113
    cmpne   [win.pid], 0, .else_1
113
    cmpne   [win.pid], 0, .else_1
114
    mov     [edx], dword 2
114
    mov     [edx], dword 2
115
    jmp     open_2
115
    jmp     open_2
116
 .else_1:
116
 .else_1:
117
    mov     [command], 2
117
    mov     [command], 2
118
  @@:
118
  @@:
119
    cmpne   ah, 75, @f
119
    cmpne   ah, 75, @f
120
 .cm_2:
120
 .cm_2:
121
    cmpne   [win.pid], 0, .else_2
121
    cmpne   [win.pid], 0, .else_2
122
    mov     [edx], dword 3
122
    mov     [edx], dword 3
123
    jmp     open_2
123
    jmp     open_2
124
 .else_2:
124
 .else_2:
125
    mov     [command], 3
125
    mov     [command], 3
126
  @@:
126
  @@:
127
    cmpne   ah, 80, @f
127
    cmpne   ah, 80, @f
128
 .cm_3:
128
 .cm_3:
129
    mov     [edx], dword 4
129
    mov     [edx], dword 4
130
    jmp     open_2
130
    jmp     open_2
131
  @@:
131
  @@:
132
    jmp     update
132
    jmp     update
133
 
133
 
134
 exit:
134
 exit:
135
if DEBUG eq 1
135
if DEBUG eq 1
136
    dps     "EXIT"
136
    dps     "EXIT"
137
end if
137
end if
138
    mcall   -1
138
    mcall   -1
139
 
139
 
140
;=====================================================================
140
;=====================================================================
141
 
141
 
142
 _entry:
142
 _entry:
143
    mcall   40, 100111b
143
    mcall   40, 100111b
144
 
144
 
145
    mcall   9, buffer, -1
145
    mcall   9, buffer, -1
146
    mov     ecx, eax
146
    mov     ecx, eax
147
    mov     edx, dword [buffer + 30]
147
    mov     edx, dword [buffer + 30]
148
    mov     [win.pid], edx
148
    mov     [win.pid], edx
149
 
149
 
150
    mcall   14
150
    mcall   14
151
    movzx   ebx, ax
151
    movzx   ebx, ax
152
    shr     eax, 17
152
    shr     eax, 17
153
    shr     ebx, 1
153
    shr     ebx, 1
154
    sub     eax, WIN_SIZE / 2
154
    sub     eax, WIN_SIZE / 2
155
    sub     ebx, WIN_SIZE / 2
155
    sub     ebx, WIN_SIZE / 2
156
    mov     [win.x], eax
156
    mov     [win.x], eax
157
    mov     [win.y], ebx
157
    mov     [win.y], ebx
158
 
158
 
159
    mcall   70, is_load
159
    mcall   70, is_load
160
    cmpe    eax, 0, @f
160
    cmpe    eax, 0, @f
161
    mov     dword[volume], 5
161
    mov     dword[volume], 5
162
  @@:
162
  @@:
163
    mov     dword[timer], TIMER
163
    mov     dword[timer], TIMER
164
 
164
 
165
    jmp     set_sound
165
    jmp     set_sound
166
 
166
 
167
 ;----------------------------
167
 ;----------------------------
168
 
168
 
169
 _update:
169
 _update:
170
    mcall   23, 5
170
    mcall   23, 5
171
    cmpe    al, EV_REDRAW, _redraw
171
    cmpe    al, EV_REDRAW, _redraw
172
    cmpe    al, EV_KEY, _key
172
    cmpe    al, EV_KEY, _key
173
    cmpe    al, EV_BUTTON, _button
173
    cmpe    al, EV_BUTTON, _button
174
    cmpe    al, EV_MOUSE, _mouse
174
    cmpe    al, EV_MOUSE, _mouse
175
 
175
 
176
    cmpne   [command], 2, @f
176
    cmpne   [command], 2, @f
177
    mov     [mute], 0
177
    mov     [mute], 0
178
    cmpe    [volume], dword 10, @f
178
    cmpe    [volume], dword 10, @f
179
    inc     dword[volume]
179
    inc     dword[volume]
180
    jmp     .apply
180
    jmp     .apply
181
  @@:
181
  @@:
182
    cmpne   [command], 3, @f
182
    cmpne   [command], 3, @f
183
    mov     [mute], 0
183
    mov     [mute], 0
184
    cmpe    [volume], dword 0, @f
184
    cmpe    [volume], dword 0, @f
185
    dec     dword[volume]
185
    dec     dword[volume]
186
    jmp     .apply
186
    jmp     .apply
187
  @@:
187
  @@:
188
    cmpne   [command], 4, @f
188
    cmpne   [command], 4, @f
189
    mov     eax, 1
189
    mov     eax, 1
190
    sub     eax, [mute]
190
    sub     eax, [mute]
191
    mov     [mute], eax
191
    mov     [mute], eax
192
    jmp     .apply
192
    jmp     .apply
193
 
193
 
194
 .apply:
194
 .apply:
195
    mov     [command], 0
195
    mov     [command], 0
196
    jmp     set_sound
196
    jmp     set_sound
197
  @@:
197
  @@:
198
 
198
 
199
    mcall   18, 7
199
    mcall   18, 7
200
    mov     ecx, eax
200
    mov     ecx, eax
201
    mcall   9, buffer
201
    mcall   9, buffer
202
    mov     eax, dword[buffer + 30]
202
    mov     eax, dword[buffer + 30]
203
    cmpne   [win.pid], eax, _exit
203
    cmpne   [win.pid], eax, _exit
204
 
204
 
205
    dec     dword[timer]
205
    dec     dword[timer]
206
    jnz     _update
206
    jnz     _update
207
 
207
 
208
 ;----------------------------
208
 ;----------------------------
209
 
209
 
210
 _exit:
210
 _exit:
211
if DEBUG eq 1
211
if DEBUG eq 1
212
    dps     "CLOSE"
212
    dps     "CLOSE"
213
end if
213
end if
214
    mov     [win.pid], 0
214
    mov     [win.pid], 0
215
    mcall   70, is_save
215
    mcall   70, is_save
216
    mcall   -1
216
    mcall   -1
217
 
217
 
218
 ;----------------------------
218
 ;----------------------------
219
 
219
 
220
 _button:
220
 _button:
221
    mcall   17
221
    mcall   17
222
    cmpe    ah, 1, _exit
222
    cmpe    ah, 1, _exit
223
    cmpe    ah, 3, toggle_mute
223
    cmpe    ah, 3, toggle_mute
224
    jmp     _update
224
    jmp     _update
225
 
225
 
226
 ;----------------------------
226
 ;----------------------------
227
 
227
 
228
 _key:
228
 _key:
229
    mcall   2
229
    mcall   2
230
    cmpe    ah, 027, _exit
230
    cmpe    ah, 027, _exit
231
    cmpe    ah, 176, dec_volume ; <-
231
    cmpe    ah, 176, dec_volume ; <-
232
    cmpe    ah, 183, dec_volume ; PgDown
232
    cmpe    ah, 183, dec_volume ; PgDown
233
    cmpe    ah, 179, inc_volume ; ->
233
    cmpe    ah, 179, inc_volume ; ->
234
    cmpe    ah, 184, inc_volume ; PgUp
234
    cmpe    ah, 184, inc_volume ; PgUp
-
 
235
    cmpe    ah, 178, unmute_volume ; ^
-
 
236
    cmpe    ah, 180, unmute_volume ; Home
235
    cmpe    ah, 177, toggle_mute ; v
237
    cmpe    ah, 177, toggle_mute ; v
236
    cmpe    ah, 181, toggle_mute ; End
238
    cmpe    ah, 181, toggle_mute ; End
237
 
239
 
238
    jmp     _update
240
    jmp     _update
239
 
241
 
240
 ;----------------------------
242
 ;----------------------------
241
 
243
 
242
 _mouse:
244
 _mouse:
243
    mcall   37, 7
245
    mcall   37, 7
244
    cmpe    eax, 0, _update
246
    cmpe    eax, 0, _update
245
 
247
 
246
    mov     esi, eax
248
    mov     esi, eax
247
    mcall   37, 1
249
    mcall   37, 1
248
    movzx   ebx, ax
250
    movzx   ebx, ax
249
    shr     eax, 16
251
    shr     eax, 16
250
    cmpg    eax, WIN_SIZE, _update
252
    cmpg    eax, WIN_SIZE, _update
251
    cmpg    ebx, WIN_SIZE, _update
253
    cmpg    ebx, WIN_SIZE, _update
252
 
254
 
253
    cmpe    si, 1,  dec_volume
255
    cmpe    si, 1,  dec_volume
254
    jne     inc_volume
256
    jne     inc_volume
255
 
257
 
256
 ;----------------------------
258
 ;----------------------------
257
 
259
 
258
 dec_volume:
260
 dec_volume:
259
    cmpe    dword[volume], 0, _update
261
    cmpe    dword[volume], 0, _update
260
    dec     dword[volume]
262
    dec     dword[volume]
261
    jmp     unmute_volume
263
    jmp     unmute_volume
262
 
264
 
263
 inc_volume:
265
 inc_volume:
264
    cmpe    dword[volume], 10, _update
266
    cmpe    dword[volume], 10, _update
265
    inc     dword[volume]
267
    inc     dword[volume]
266
    jmp     unmute_volume
268
    jmp     unmute_volume
267
 
269
 
268
 toggle_mute:
270
 toggle_mute:
269
    mov     eax, 1
271
    mov     eax, 1
270
    sub     eax, [mute]
272
    sub     eax, [mute]
271
    mov     [mute], eax
273
    mov     [mute], eax
272
    jmp     @f
274
    jmp     @f
273
 
275
 
274
 unmute_volume:
276
 unmute_volume:
275
    mov     dword[mute], 0
277
    mov     dword[mute], 0
276
 
278
 
277
 set_sound:
279
 set_sound:
278
  @@:
280
  @@:
279
    call    set_sound_proc
281
    call    set_sound_proc
280
    mov     dword[timer], TIMER
282
    mov     dword[timer], TIMER
281
    call    draw_icon
283
    call    draw_icon
282
    call    draw_bar
284
    call    draw_bar
283
    jmp     _update
285
    jmp     _update
284
 
286
 
285
 set_sound_proc:
287
 set_sound_proc:
286
    mov     [snd_driver.command], 6
288
    mov     [snd_driver.command], 6
287
    mov     [snd_driver.inputsz], 4
289
    mov     [snd_driver.inputsz], 4
288
    mov     [snd_driver.output], 0
290
    mov     [snd_driver.output], 0
289
    mov     [snd_driver.outputsz], 0
291
    mov     [snd_driver.outputsz], 0
290
    mov     [snd_driver.input], buffer
292
    mov     [snd_driver.input], buffer
291
    mov     edi, 10
293
    mov     edi, 10
292
    cmpe    [mute], 1, .set_sound
294
    cmpe    [mute], 1, .set_sound
293
    sub     edi, [volume]
295
    sub     edi, [volume]
294
  .set_sound:
296
  .set_sound:
295
    imul    edi, 479
297
    imul    edi, 479
296
    neg     edi
298
    neg     edi
297
    mov     dword[buffer], edi
299
    mov     dword[buffer], edi
298
    mcall   68, 17, snd_driver
300
    mcall   68, 17, snd_driver
299
    ret
301
    ret
300
 
302
 
301
 ;----------------------------
303
 ;----------------------------
302
 
304
 
303
 _redraw:
305
 _redraw:
304
    call    draw_window
306
    call    draw_window
305
    call    draw_icon
307
    call    draw_icon
306
    call    draw_bar
308
    call    draw_bar
307
 
309
 
308
    jmp     _update
310
    jmp     _update
309
 
311
 
310
 ;----------------------------
312
 ;----------------------------
311
 
313
 
312
 draw_window:
314
 draw_window:
313
    mcall   0, <[win.x], WIN_SIZE + 1>, <[win.y], WIN_SIZE + 1>, 0x61000000
315
    mcall   0, <[win.x], WIN_SIZE + 1>, <[win.y], WIN_SIZE + 1>, 0x61000000
314
 
316
 
315
    mcall   13, <0, WIN_SIZE>, <1, WIN_SIZE - 2>, 0x3D3D3D
317
    mcall   13, <0, WIN_SIZE>, <1, WIN_SIZE - 2>, 0x3D3D3D
316
    mcall     , <1, WIN_SIZE - 2>, <0, 1>
318
    mcall     , <1, WIN_SIZE - 2>, <0, 1>
317
    mcall     , 		 , 
319
    mcall     , 		 , 
318
 
320
 
319
    mcall   8, <0, WIN_SIZE>, <0, WIN_SIZE>, 0x60000002
321
    mcall   8, <0, WIN_SIZE>, <0, WIN_SIZE>, 0x60000002
320
    mcall    , <20, 80>, <22, 60>, 0x60000003
322
    mcall    , <20, 80>, <22, 60>, 0x60000003
321
 
323
 
322
    ret
324
    ret
323
 
325
 
324
 ;----------------------------
326
 ;----------------------------
325
 
327
 
326
 draw_icon:
328
 draw_icon:
327
    mcall   7, image, <30, 45>, <31, 30>
329
    mcall   7, image, <30, 45>, <31, 30>
328
 
330
 
329
    cmpe    dword[mute], 0, @f
331
    cmpe    dword[mute], 0, @f
330
    mov     ebx, 30 * 45 * 3 * 5 + image
332
    mov     ebx, 30 * 45 * 3 * 5 + image
331
    jmp     .draw
333
    jmp     .draw
332
  @@:
334
  @@:
333
    cmpne   dword[volume], 0, @f
335
    cmpne   dword[volume], 0, @f
334
    mov     ebx, 30 * 45 * 3 * 1 + image
336
    mov     ebx, 30 * 45 * 3 * 1 + image
335
    jmp     .draw
337
    jmp     .draw
336
  @@:
338
  @@:
337
    cmpge  dword[volume], 5, @f
339
    cmpge  dword[volume], 5, @f
338
    mov     ebx, 30 * 45 * 3 * 2 + image
340
    mov     ebx, 30 * 45 * 3 * 2 + image
339
    jmp     .draw
341
    jmp     .draw
340
  @@:
342
  @@:
341
    cmpge  dword[volume], 9, @f
343
    cmpge  dword[volume], 9, @f
342
    mov     ebx, 30 * 45 * 3 * 3 + image
344
    mov     ebx, 30 * 45 * 3 * 3 + image
343
    jmp     .draw
345
    jmp     .draw
344
  @@:
346
  @@:
345
    mov     ebx, 30 * 45 * 3 * 4 + image
347
    mov     ebx, 30 * 45 * 3 * 4 + image
346
 .draw:
348
 .draw:
347
    mcall    ,	    ,	      , <61, 30>
349
    mcall    ,	    ,	      , <61, 30>
348
 
350
 
349
    ret
351
    ret
350
 
352
 
351
 ;----------------------------
353
 ;----------------------------
352
 
354
 
353
 draw_bar:
355
 draw_bar:
354
 ;; draw shadow
356
 ;; draw shadow
355
    mov     eax, 13
357
    mov     eax, 13
356
    mov     ebx, 11 shl 16 + 9
358
    mov     ebx, 11 shl 16 + 9
357
    mov     ecx, 100 shl 16 + 1
359
    mov     ecx, 100 shl 16 + 1
358
    mov     edx, 0x252525
360
    mov     edx, 0x252525
359
    mov     esi, 10
361
    mov     esi, 10
360
  @@:
362
  @@:
361
    cmpe    esi, 0, @f
363
    cmpe    esi, 0, @f
362
    mcall
364
    mcall
363
    add     ebx, 10 shl 16
365
    add     ebx, 10 shl 16
364
    dec     esi
366
    dec     esi
365
    jmp     @b
367
    jmp     @b
366
  @@:
368
  @@:
367
 
369
 
368
 ;; draw active
370
 ;; draw active
369
    mov     ebx, 11 shl 16 + 9
371
    mov     ebx, 11 shl 16 + 9
370
    mov     ecx, 96 shl 16 + 4
372
    mov     ecx, 96 shl 16 + 4
371
    mov     edx, 0xE5E5E5
373
    mov     edx, 0xE5E5E5
372
    mov     esi, [volume]
374
    mov     esi, [volume]
373
  @@:
375
  @@:
374
    cmpe    esi, 0, @f
376
    cmpe    esi, 0, @f
375
    mcall
377
    mcall
376
    add     ebx, 10 shl 16
378
    add     ebx, 10 shl 16
377
    dec     esi
379
    dec     esi
378
    jmp     @b
380
    jmp     @b
379
  @@:
381
  @@:
380
 
382
 
381
 ;; draw inactive
383
 ;; draw inactive
382
    mov     ebx, 11 shl 16 + 9
384
    mov     ebx, 11 shl 16 + 9
383
    mov     edx, 0x737373
385
    mov     edx, 0x737373
384
    mov     esi, 10
386
    mov     esi, 10
385
    sub     esi, [volume]
387
    sub     esi, [volume]
386
    imul    edi, [volume], 10
388
    imul    edi, [volume], 10
387
    shl     edi, 16
389
    shl     edi, 16
388
    add     ebx, edi
390
    add     ebx, edi
389
  @@:
391
  @@:
390
    cmpe    esi, 0, @f
392
    cmpe    esi, 0, @f
391
    mcall
393
    mcall
392
    add     ebx, 10 shl 16
394
    add     ebx, 10 shl 16
393
    dec     esi
395
    dec     esi
394
    jmp     @b
396
    jmp     @b
395
  @@:
397
  @@:
396
 
398
 
397
    ret
399
    ret
398
 
400
 
399
 ;----------------------------
401
 ;----------------------------
400
 
402
 
401
 @imports:
403
 @imports:
402
    library img, "libimg.obj"
404
    library img, "libimg.obj"
403
    import  img, \
405
    import  img, \
404
	img.init,    "lib_init", \
406
	img.init,    "lib_init", \
405
	img.to_rgb,  "img_to_rgb2", \
407
	img.to_rgb,  "img_to_rgb2", \
406
	img.decode,  "img_decode", \
408
	img.decode,  "img_decode", \
407
	img.destroy, "img_destroy"
409
	img.destroy, "img_destroy"
408
 
410
 
409
 ;----------------------------
411
 ;----------------------------
410
 
412
 
411
 volume_dat db "/sys/settings/volume.dat", 0
413
 volume_dat db "/sys/settings/volume.dat", 0
412
 
414
 
413
 is_save:
415
 is_save:
414
	    dd 2
416
	    dd 2
415
	    dd 0
417
	    dd 0
416
	    dd 0
418
	    dd 0
417
	    dd 8
419
	    dd 8
418
	    dd volume
420
	    dd volume
419
	    db 0
421
	    db 0
420
	    dd volume_dat
422
	    dd volume_dat
421
 
423
 
422
 is_load:
424
 is_load:
423
	    dd 0
425
	    dd 0
424
	    dd 0
426
	    dd 0
425
	    dd 0
427
	    dd 0
426
	    dd 8
428
	    dd 8
427
	    dd volume
429
	    dd volume
428
	    db 0
430
	    db 0
429
	    dd volume_dat
431
	    dd volume_dat
430
 
432
 
431
 icons	    file "icon.png"
433
 icons	    file "icon.png"
432
  .size     = $-icons
434
  .size     = $-icons
433
 snd_driver.name:
435
 snd_driver.name:
434
	    db "SOUND", 0
436
	    db "SOUND", 0
435
 shm_name   db "volume-man", 0
437
 shm_name   db "volume-man", 0
436
 
438
 
437
 @end:
439
 @end:
438
 
440
 
439
;=====================================================================
441
;=====================================================================
440
 
442
 
441
 win:
443
 win:
442
  .x	    rd 1
444
  .x	    rd 1
443
  .y	    rd 1
445
  .y	    rd 1
444
  .pid	    rd 1
446
  .pid	    rd 1
445
 
447
 
446
 image	    rb 45 * 30 * 6 * 3
448
 image	    rb 45 * 30 * 6 * 3
447
  .data     rd 1
449
  .data     rd 1
448
 
450
 
449
 shm	    rd 1
451
 shm	    rd 1
450
 volume     rd 1
452
 volume     rd 1
451
 timer	    rd 1
453
 timer	    rd 1
452
 mute	    rd 1
454
 mute	    rd 1
453
 command    rd 1
455
 command    rd 1
454
 buffer     rb 1024
456
 buffer     rb 1024
455
 snd_driver rd 1
457
 snd_driver rd 1
456
  .command  rd 1
458
  .command  rd 1
457
  .input    rd 1
459
  .input    rd 1
458
  .inputsz  rd 1
460
  .inputsz  rd 1
459
  .output   rd 1
461
  .output   rd 1
460
  .outputsz rd 1
462
  .outputsz rd 1
461
 
463
 
462
;=====================================================================
464
;=====================================================================
463
	    rb 2048
465
	    rb 2048
464
 _stack:
466
 _stack:
465
	    rb 2048
467
	    rb 2048
466
 @stack:
468
 @stack:
467
 @params    rb 256
469
 @params    rb 256
468
 
470
 
469
 @memory:
471
 @memory:
470
>
472
>