Subversion Repositories Kolibri OS

Rev

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

Rev 147 Rev 485
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;                                                           ;
2
;                                                           ;
3
;    Audio CD player; code by Dmitry Yushko - dma@bn.by     ;
3
;    Audio CD player; code by Dmitry Yushko - dma@bn.by     ;
4
;                                                           ;
4
;                                                           ;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
 
6
 
7
include "macros.inc"
7
include "..\..\..\macros.inc"
8
include "lang.inc"
8
include "lang.inc"
9
 
9
 
10
FALSE  equ 0
10
FALSE  equ 0
11
TRUE   equ 1
11
TRUE   equ 1
12
 
12
 
13
ESC_KEY   equ 27
13
ESC_KEY   equ 27
14
LEFT_KEY  equ 176
14
LEFT_KEY  equ 176
15
RIGHT_KEY equ 179
15
RIGHT_KEY equ 179
16
 
16
 
17
NORMAL_PLAY  equ 0
17
NORMAL_PLAY  equ 0
18
REPEAT_TRACK equ 1
18
REPEAT_TRACK equ 1
19
REPEAT_DISK  equ 2
19
REPEAT_DISK  equ 2
20
SHUFFLE_DISK equ 3
20
SHUFFLE_DISK equ 3
21
 
21
 
22
COLOR_FUNC_BUTS equ 0x00dddddd
22
COLOR_FUNC_BUTS equ 0x00dddddd
23
 
23
 
24
use32
24
use32
25
 
25
 
26
                  org    0x0
26
                  org    0x0
27
                  db     'MENUET01'              ; 8 byte id
27
                  db     'MENUET01'              ; 8 byte id
28
                  dd     0x01                      ; required os
28
                  dd     0x01                      ; required os
29
                  dd     START                   ; program start
29
                  dd     START                   ; program start
30
                  dd     I_END                   ; program image size
30
                  dd     I_END                   ; program image size
31
                  dd     0x2000                  ; required amount of memory
31
                  dd     0x2000                  ; required amount of memory
32
                  dd     0x2000                  ; esp = 0x7fff0
32
                  dd     0x2000                  ; esp = 0x7fff0
33
                  dd     0x0, 0x0              ; reserved=no extended header
33
                  dd     0x0, 0x0              ; reserved=no extended header
34
 
34
 
35
START:
35
START:
36
    call chk_cdrom                      ; start of execution
36
    call chk_cdrom                      ; start of execution
37
    call read_cd
37
    call read_cd
-
 
38
 
-
 
39
  red:                          ; redraw
38
    call draw_window            ; at first, draw the window
40
    call draw_window            ; at first, draw the window
39
still:
41
still:
40
 
42
 
41
    mov  eax,23
43
    mov  eax,23
42
    mov  ebx,10                 ; wait here for event
44
    mov  ebx,10                 ; wait here for event
43
    int  0x40
45
    mcall
44
 
46
 
45
    cmp  eax,1                  ; redraw request ?
47
    cmp  eax,1                  ; redraw request ?
46
    jz   red
48
    jz   red
47
    cmp  eax,2                  ; key in buffer ?
49
    cmp  eax,2                  ; key in buffer ?
48
    jz   key
50
    jz   key
49
    cmp  eax,3                  ; button in buffer ?
51
    cmp  eax,3                  ; button in buffer ?
50
    jz   button
52
    jz   button
51
 
53
 
52
    call draw_info
54
    call draw_info
53
    cmp  [curr_trk],0
55
    cmp  [curr_trk],0
54
    je   @f
56
    je   @f
55
    call current_trk_time
57
    call current_trk_time
56
   @@:
58
   @@:
57
    jmp  still
59
    jmp  still
58
 
-
 
59
  red:                          ; redraw
-
 
60
    call draw_window
-
 
61
 
-
 
62
    jmp  still
60
 
63
 
61
 
64
  key:                          ; key
62
  key:                          ; key
65
    mov  eax,2                  ; just read it and ignore
63
    mov  eax,2                  ; just read it and ignore
66
    int  0x40
64
    mcall
67
 
65
 
68
;======  hotkeys:
66
;======  hotkeys:
69
    cmp  ah,0x61
67
    cmp  ah,0x61
70
    jb   @f
68
    jb   @f
71
    cmp  ah,0x7a
69
    cmp  ah,0x7a
72
    ja   @f
70
    ja   @f
73
    and  ah,11011111b
71
    and  ah,11011111b
74
   @@:
72
   @@:
75
 
73
 
76
    cmp  ah,'P' ;PLAY
74
    cmp  ah,'P' ;PLAY
77
    jne  no_key_play
75
    jne  no_key_play
78
    call play_acd
76
    call play_acd
79
    jmp still
77
    jmp still
80
 no_key_play:
78
 no_key_play:
81
 
79
 
82
    cmp ah,'S' ;STOP
80
    cmp ah,'S' ;STOP
83
    jne no_key_stop
81
    jne no_key_stop
84
    mov [if_paused],FALSE
82
    mov [if_paused],FALSE
85
    call stop_playing
83
    call stop_playing
86
    jmp still
84
    jmp still
87
 no_key_stop:
85
 no_key_stop:
88
 
86
 
89
    cmp ah,'N' ;NEXT
87
    cmp ah,'N' ;NEXT
90
    jne no_key_next
88
    jne no_key_next
91
    call play_next_trk
89
    call play_next_trk
92
    jmp still
90
    jmp still
93
 no_key_next:
91
 no_key_next:
94
 
92
 
95
    cmp ah,'B' ;BACK
93
    cmp ah,'B' ;BACK
96
    jne no_key_back
94
    jne no_key_back
97
    call play_back_trk
95
    call play_back_trk
98
    jmp still
96
    jmp still
99
 no_key_back:
97
 no_key_back:
100
 
98
 
101
    cmp  ah,'F' ;FORWARD
99
    cmp  ah,'F' ;FORWARD
102
    jne  no_key_fwd
100
    jne  no_key_fwd
103
    call fast_forward
101
    call fast_forward
104
    jmp still
102
    jmp still
105
 no_key_fwd:
103
 no_key_fwd:
106
 
104
 
107
    cmp ah,'R' ;REWIND
105
    cmp ah,'R' ;REWIND
108
    jne no_key_rewind
106
    jne no_key_rewind
109
    call fast_rewind
107
    call fast_rewind
110
    jmp still
108
    jmp still
111
 no_key_rewind:
109
 no_key_rewind:
112
 
110
 
113
    cmp ah,'M' ;MODE
111
    cmp ah,'M' ;MODE
114
    jne no_key_mode
112
    jne no_key_mode
115
    call change_mode
113
    call change_mode
116
    jmp still
114
    jmp still
117
 no_key_mode:
115
 no_key_mode:
118
 
116
 
119
 
117
 
120
    cmp ah,'L' ;READ PLAYLIST
118
    cmp ah,'L' ;READ PLAYLIST
121
    jne no_key_list
119
    jne no_key_list
122
    mov [if_paused],FALSE
120
    mov [if_paused],FALSE
123
    mov [curr_trk],0
121
    mov [curr_trk],0
124
    call stop_playing
122
    call stop_playing
125
    call chk_cdrom
123
    call chk_cdrom
126
    call read_cd
124
    call read_cd
127
    jmp still
125
    jmp still
128
 no_key_list:
126
 no_key_list:
129
 
127
 
130
    cmp ah,50      ;F1 key
128
    cmp ah,50      ;F1 key
131
    jz  itsahelpkey
129
    jz  itsahelpkey
132
 
130
 
133
    cmp ah,'H' ;HELP
131
    cmp ah,'H' ;HELP
134
    jne no_key_help
132
    jne no_key_help
135
   itsahelpkey:
133
   itsahelpkey:
136
    cmp [flag],4
134
    cmp [flag],4
137
    je  still
135
    je  still
138
    cmp [flag],1
136
    cmp [flag],1
139
    jne was_it_ok_false
137
    jne was_it_ok_false
140
    mov [was_it_ok],TRUE
138
    mov [was_it_ok],TRUE
141
    jmp flag4_done
139
    jmp flag4_done
142
   was_it_ok_false:
140
   was_it_ok_false:
143
    mov [was_it_ok],FALSE
141
    mov [was_it_ok],FALSE
144
   flag4_done:
142
   flag4_done:
145
    mov [flag],4
143
    mov [flag],4
146
    mov [help_screen],1
144
    mov [help_screen],1
147
    call draw_window
145
    call draw_window
148
    jmp still
146
    jmp still
149
 no_key_help:
147
 no_key_help:
150
 
148
 
151
 
149
 
152
    cmp ah,ESC_KEY
150
    cmp ah,ESC_KEY
153
    jne no_esc_key
151
    jne no_esc_key
154
    cmp [flag],4
152
    cmp [flag],4
155
    jne still
153
    jne still
156
    cmp [was_it_ok],FALSE
154
    cmp [was_it_ok],FALSE
157
    jne was_it_ok_true
155
    jne was_it_ok_true
158
    mov [flag],0
156
    mov [flag],0
159
    jmp end_esc_key
157
    jmp end_esc_key
160
   was_it_ok_true:
158
   was_it_ok_true:
161
    mov [flag],1
159
    mov [flag],1
162
   end_esc_key:
160
   end_esc_key:
163
    call draw_window
161
    call draw_window
164
 no_esc_key:
162
 no_esc_key:
165
 
163
 
166
    cmp ah,LEFT_KEY
164
    cmp ah,LEFT_KEY
167
    jne no_left_key
165
    jne no_left_key
168
    cmp [flag],4
166
    cmp [flag],4
169
    jne still
167
    jne still
170
    cmp [help_screen],1
168
    cmp [help_screen],1
171
    jz  still
169
    jz  still
172
    dec [help_screen]
170
    dec [help_screen]
173
    call draw_window
171
    call draw_window
174
   no_left_key:
172
   no_left_key:
175
 
173
 
176
    cmp ah,RIGHT_KEY
174
    cmp ah,RIGHT_KEY
177
    jne no_right_key
175
    jne no_right_key
178
    cmp [flag],4
176
    cmp [flag],4
179
    jne still
177
    jne still
180
    cmp [help_screen],3
178
    cmp [help_screen],3
181
    jz  still
179
    jz  still
182
    inc [help_screen]
180
    inc [help_screen]
183
    call draw_window
181
    call draw_window
184
   no_right_key:
182
   no_right_key:
185
 
183
 
186
 
184
 
187
    jmp  still
185
    jmp  still
188
 
186
 
189
 
187
 
190
  button:                       ; button
188
  button:                       ; button
191
    mov  eax,17
189
    mov  eax,17
192
    int  0x40
190
    mcall
193
 
191
 
194
    cmp  ah,1                   ; button id=1 ?
192
    cmp  ah,1                   ; button id=1 ?
195
    jnz  no_but_close
193
    jnz  no_but_close
196
    mov  eax,24
194
    mov  eax,24
197
    mov  ebx,3
195
    mov  ebx,3
198
    int 0x40
196
    mcall
199
    mov  eax,0xffffffff         ; close this program
197
    mov  eax,0xffffffff         ; close this program
200
    int  0x40
198
    mcall
201
  no_but_close:
199
  no_but_close:
202
 
200
 
203
    cmp  ah,2
201
    cmp  ah,2
204
    jne  no_but_play
202
    jne  no_but_play
205
    call play_acd
203
    call play_acd
206
    jmp still
204
    jmp still
207
 no_but_play:
205
 no_but_play:
208
 
206
 
209
    cmp ah,3
207
    cmp ah,3
210
    jne no_but_stop
208
    jne no_but_stop
211
    mov [if_paused],FALSE
209
    mov [if_paused],FALSE
212
    call stop_playing
210
    call stop_playing
213
    jmp still
211
    jmp still
214
 no_but_stop:
212
 no_but_stop:
215
 
213
 
216
    cmp ah,4
214
    cmp ah,4
217
    jne no_but_reread
215
    jne no_but_reread
218
    mov [curr_trk],0
216
    mov [curr_trk],0
219
    call chk_cdrom
217
    call chk_cdrom
220
    call read_cd
218
    call read_cd
221
    mov [if_paused],FALSE
219
    mov [if_paused],FALSE
222
    call stop_playing
220
    call stop_playing
223
    jmp still
221
    jmp still
224
 no_but_reread:
222
 no_but_reread:
225
 
223
 
226
    cmp ah,5
224
    cmp ah,5
227
    jne no_but_next
225
    jne no_but_next
228
    call play_next_trk
226
    call play_next_trk
229
    jmp still
227
    jmp still
230
   no_but_next:
228
   no_but_next:
231
 
229
 
232
    cmp ah,6
230
    cmp ah,6
233
    jne no_but_back
231
    jne no_but_back
234
    call play_back_trk
232
    call play_back_trk
235
    jmp still
233
    jmp still
236
   no_but_back:
234
   no_but_back:
237
 
235
 
238
    cmp ah,7
236
    cmp ah,7
239
    jne no_but_mode
237
    jne no_but_mode
240
    call change_mode
238
    call change_mode
241
    jmp still
239
    jmp still
242
   no_but_mode:
240
   no_but_mode:
243
 
241
 
244
    cmp ah,8
242
    cmp ah,8
245
    jne no_but_frew
243
    jne no_but_frew
246
    call fast_rewind
244
    call fast_rewind
247
    jmp still
245
    jmp still
248
   no_but_frew:
246
   no_but_frew:
249
 
247
 
250
    cmp ah,9
248
    cmp ah,9
251
    jne no_but_ffwd
249
    jne no_but_ffwd
252
    call fast_forward
250
    call fast_forward
253
    jmp still
251
    jmp still
254
   no_but_ffwd:
252
   no_but_ffwd:
255
 
253
 
256
    cmp  ah,10
254
    cmp  ah,10
257
    jb   no_but_track
255
    jb   no_but_track
258
    cmp  ah,40
256
    cmp  ah,40
259
    ja   no_but_track
257
    ja   no_but_track
260
    call read_cd
258
    call read_cd
261
    cmp  [flag],1
259
    cmp  [flag],1
262
    jne  no_but_track
260
    jne  no_but_track
263
    mov  cl,ah
261
    mov  cl,ah
264
    sub  cl,10
262
    sub  cl,10
265
    mov  [curr_trk],cl
263
    mov  [curr_trk],cl
266
    mov  cl,[max_trk]
264
    mov  cl,[max_trk]
267
    mov  [shuftab],cl
265
    mov  [shuftab],cl
268
    call stop_playing
266
    call stop_playing
269
    call renew_shuftab
267
    call renew_shuftab
270
    call play_n_track
268
    call play_n_track
271
    call rem_time_trk
269
    call rem_time_trk
272
    jmp still
270
    jmp still
273
  no_but_track:
271
  no_but_track:
274
 
272
 
275
    jmp  still
273
    jmp  still
276
 
274
 
277
 
275
 
278
change_mode:
276
change_mode:
279
    cmp [mode],3
277
    cmp [mode],3
280
    jne inc_mode
278
    jne inc_mode
281
    mov [mode],0
279
    mov [mode],0
282
    jmp end_but_mode
280
    jmp end_but_mode
283
   inc_mode:
281
   inc_mode:
284
    inc [mode]
282
    inc [mode]
285
   end_but_mode:
283
   end_but_mode:
286
    call draw_info
284
    call draw_info
287
ret
285
ret
288
 
286
 
289
play_next_trk:
287
play_next_trk:
290
    cmp [curr_trk],0
288
    cmp [curr_trk],0
291
    je  @play_next_trk
289
    je  @play_next_trk
292
    cmp [if_paused],TRUE
290
    cmp [if_paused],TRUE
293
    je  @play_next_trk
291
    je  @play_next_trk
294
    cmp [mode],NORMAL_PLAY
292
    cmp [mode],NORMAL_PLAY
295
    jne play_next_mode1
293
    jne play_next_mode1
296
    xor eax,eax
294
    xor eax,eax
297
    mov al,[curr_trk]
295
    mov al,[curr_trk]
298
    cmp [max_trk],al
296
    cmp [max_trk],al
299
    je  @play_next_trk
297
    je  @play_next_trk
300
    inc [curr_trk]
298
    inc [curr_trk]
301
    cmp [if_stopped],TRUE
299
    cmp [if_stopped],TRUE
302
    je @play_next_trk
300
    je @play_next_trk
303
    call play_n_track
301
    call play_n_track
304
    jmp  @play_next_trk
302
    jmp  @play_next_trk
305
   play_next_mode1:
303
   play_next_mode1:
306
    cmp [mode],REPEAT_TRACK
304
    cmp [mode],REPEAT_TRACK
307
    jne play_next_mode2
305
    jne play_next_mode2
308
    cmp [if_stopped],TRUE
306
    cmp [if_stopped],TRUE
309
    je @play_next_trk
307
    je @play_next_trk
310
    call play_n_track
308
    call play_n_track
311
    jmp  @play_next_trk
309
    jmp  @play_next_trk
312
   play_next_mode2:
310
   play_next_mode2:
313
    cmp [mode],REPEAT_DISK
311
    cmp [mode],REPEAT_DISK
314
    jne play_next_mode3
312
    jne play_next_mode3
315
    xor eax,eax
313
    xor eax,eax
316
    mov al,[curr_trk]
314
    mov al,[curr_trk]
317
    cmp [max_trk],al
315
    cmp [max_trk],al
318
    jne  play_next_mode2_go
316
    jne  play_next_mode2_go
319
    mov [curr_trk],1
317
    mov [curr_trk],1
320
    cmp [if_stopped],TRUE
318
    cmp [if_stopped],TRUE
321
    je @play_next_trk
319
    je @play_next_trk
322
    call play_n_track
320
    call play_n_track
323
    jmp  @play_next_trk
321
    jmp  @play_next_trk
324
   play_next_mode2_go:
322
   play_next_mode2_go:
325
    inc  [curr_trk]
323
    inc  [curr_trk]
326
    cmp [if_stopped],TRUE
324
    cmp [if_stopped],TRUE
327
    je @play_next_trk
325
    je @play_next_trk
328
    call play_n_track
326
    call play_n_track
329
    jmp  @play_next_trk
327
    jmp  @play_next_trk
330
   play_next_mode3:
328
   play_next_mode3:
331
    cmp  [mode],SHUFFLE_DISK
329
    cmp  [mode],SHUFFLE_DISK
332
    jne  @play_next_trk
330
    jne  @play_next_trk
333
   call shuffle_track
331
   call shuffle_track
334
   @play_next_trk:
332
   @play_next_trk:
335
ret
333
ret
336
 
334
 
337
play_back_trk:
335
play_back_trk:
338
    cmp [curr_trk],0
336
    cmp [curr_trk],0
339
    je  @play_back_trk
337
    je  @play_back_trk
340
    cmp [if_paused],TRUE
338
    cmp [if_paused],TRUE
341
    je  @play_back_trk
339
    je  @play_back_trk
342
    cmp [mode],NORMAL_PLAY
340
    cmp [mode],NORMAL_PLAY
343
    jne play_back_mode1
341
    jne play_back_mode1
344
    xor eax,eax
342
    xor eax,eax
345
    mov al,[curr_trk]
343
    mov al,[curr_trk]
346
    cmp al,1
344
    cmp al,1
347
    je  @play_back_trk
345
    je  @play_back_trk
348
    dec [curr_trk]
346
    dec [curr_trk]
349
    cmp [if_stopped],TRUE
347
    cmp [if_stopped],TRUE
350
    je @play_next_trk
348
    je @play_next_trk
351
    call play_n_track
349
    call play_n_track
352
    jmp  @play_back_trk
350
    jmp  @play_back_trk
353
   play_back_mode1:
351
   play_back_mode1:
354
    cmp [mode],REPEAT_TRACK
352
    cmp [mode],REPEAT_TRACK
355
    jne play_back_mode2
353
    jne play_back_mode2
356
    cmp [if_stopped],TRUE
354
    cmp [if_stopped],TRUE
357
    je @play_next_trk
355
    je @play_next_trk
358
    call play_n_track
356
    call play_n_track
359
    jmp  @play_back_trk
357
    jmp  @play_back_trk
360
   play_back_mode2:
358
   play_back_mode2:
361
    cmp [mode],REPEAT_DISK
359
    cmp [mode],REPEAT_DISK
362
    jne play_back_mode3
360
    jne play_back_mode3
363
    xor eax,eax
361
    xor eax,eax
364
    mov al,[curr_trk]
362
    mov al,[curr_trk]
365
    cmp al,1
363
    cmp al,1
366
    jne  play_back_mode2_go
364
    jne  play_back_mode2_go
367
    mov al,[max_trk]
365
    mov al,[max_trk]
368
    mov [curr_trk],al
366
    mov [curr_trk],al
369
    cmp [if_stopped],TRUE
367
    cmp [if_stopped],TRUE
370
    je @play_next_trk
368
    je @play_next_trk
371
    call play_n_track
369
    call play_n_track
372
    jmp  @play_back_trk
370
    jmp  @play_back_trk
373
   play_back_mode2_go:
371
   play_back_mode2_go:
374
    dec  [curr_trk]
372
    dec  [curr_trk]
375
    cmp [if_stopped],TRUE
373
    cmp [if_stopped],TRUE
376
    je @play_next_trk
374
    je @play_next_trk
377
    call play_n_track
375
    call play_n_track
378
    jmp  @play_back_trk
376
    jmp  @play_back_trk
379
   play_back_mode3: ;(shuffle)
377
   play_back_mode3: ;(shuffle)
380
;   call shuffle_track
378
;   call shuffle_track
381
   @play_back_trk:
379
   @play_back_trk:
382
ret
380
ret
383
 
381
 
384
 
382
 
385
current_trk_time:
383
current_trk_time:
386
    cmp [if_stopped],TRUE
384
    cmp [if_stopped],TRUE
387
    je  menshe
385
    je  menshe
388
    call get_uptime
386
    call get_uptime
389
    mov ebx,[stimtrk]
387
    mov ebx,[stimtrk]
390
    sub eax,ebx
388
    sub eax,ebx
391
   ; eax now is seconds from track start * 100
389
   ; eax now is seconds from track start * 100
392
    xor edx,edx
390
    xor edx,edx
393
    mov ecx,100
391
    mov ecx,100
394
    div ecx
392
    div ecx
395
    mov [curr_trk_pg_time],eax
393
    mov [curr_trk_pg_time],eax
396
    mov ebx,[curr_trk_length]
394
    mov ebx,[curr_trk_length]
397
;    add eax,1 ;{inc curr time on 1 sec)
395
;    add eax,1 ;{inc curr time on 1 sec)
398
    cmp eax,ebx
396
    cmp eax,ebx
399
    jb  menshe
397
    jb  menshe
400
    call stop_playing
398
    call stop_playing
401
    cmp [mode],SHUFFLE_DISK
399
    cmp [mode],SHUFFLE_DISK
402
    jne @f
400
    jne @f
403
    call shuffle_track
401
    call shuffle_track
404
   @@:
402
   @@:
405
    cmp [mode],REPEAT_TRACK
403
    cmp [mode],REPEAT_TRACK
406
    je  @@mode_repeat_1
404
    je  @@mode_repeat_1
407
    mov al,[max_trk]
405
    mov al,[max_trk]
408
    cmp [curr_trk],al
406
    cmp [curr_trk],al
409
    jb  @@next_trk_ok
407
    jb  @@next_trk_ok
410
    cmp [mode],REPEAT_DISK
408
    cmp [mode],REPEAT_DISK
411
    jne menshe
409
    jne menshe
412
    mov [curr_trk],0
410
    mov [curr_trk],0
413
   @@next_trk_ok:
411
   @@next_trk_ok:
414
    inc [curr_trk]
412
    inc [curr_trk]
415
   @@mode_repeat_1:
413
   @@mode_repeat_1:
416
    call play_n_track
414
    call play_n_track
417
   menshe:
415
   menshe:
418
ret
416
ret
419
 
417
 
420
 
418
 
421
rem_time_trk:
419
rem_time_trk:
422
    call get_uptime
420
    call get_uptime
423
    mov  [stimtrk],eax
421
    mov  [stimtrk],eax
424
    ret
422
    ret
425
 
423
 
426
fast_forward:
424
fast_forward:
427
    cmp [if_stopped],TRUE
425
    cmp [if_stopped],TRUE
428
    je end_ffwd
426
    je end_ffwd
429
    mov eax,[curr_trk_pg_time]
427
    mov eax,[curr_trk_pg_time]
430
    add eax,5
428
    add eax,5
431
    cmp eax,[curr_trk_length]
429
    cmp eax,[curr_trk_length]
432
    jae end_ffwd
430
    jae end_ffwd
433
    cmp [stimtrk],500
431
    cmp [stimtrk],500
434
    jbe end_ffwd
432
    jbe end_ffwd
435
    sub [stimtrk],500
433
    sub [stimtrk],500
436
    call current_trk_time
434
    call current_trk_time
437
    call play_from_x_time
435
    call play_from_x_time
438
   end_ffwd:
436
   end_ffwd:
439
ret
437
ret
440
 
438
 
441
fast_rewind:
439
fast_rewind:
442
    cmp [if_stopped],TRUE
440
    cmp [if_stopped],TRUE
443
    je end_frew
441
    je end_frew
444
    cmp [curr_trk_pg_time],5
442
    cmp [curr_trk_pg_time],5
445
    jbe end_frew
443
    jbe end_frew
446
    add [stimtrk],500
444
    add [stimtrk],500
447
    call current_trk_time
445
    call current_trk_time
448
    call play_from_x_time
446
    call play_from_x_time
449
   end_frew:
447
   end_frew:
450
ret
448
ret
451
 
449
 
452
renew_shuftab:
450
renew_shuftab:
453
    mov  ecx,40
451
    mov  ecx,40
454
   @rn:
452
   @rn:
455
    mov  [shuftab+ecx],cl
453
    mov  [shuftab+ecx],cl
456
    loop @rn
454
    loop @rn
457
    mov  cl,[max_trk]
455
    mov  cl,[max_trk]
458
    mov  [shuftab],cl
456
    mov  [shuftab],cl
459
ret
457
ret
460
 
458
 
461
 
459
 
462
shuffle_track:
460
shuffle_track:
463
   call get_uptime
461
   call get_uptime
464
   ror  eax,16
462
   ror  eax,16
465
   cmp  eax,0
463
   cmp  eax,0
466
   je   shuffle_track
464
   je   shuffle_track
467
   xor  ecx,ecx
465
   xor  ecx,ecx
468
   mov  cl,[shuftab]
466
   mov  cl,[shuftab]
469
   cmp  ecx,1
467
   cmp  ecx,1
470
   je   @enddsk
468
   je   @enddsk
471
   xor  edx,edx
469
   xor  edx,edx
472
   div  ecx
470
   div  ecx
473
   cmp  edx,0
471
   cmp  edx,0
474
   je   shuffle_track
472
   je   shuffle_track
475
   xor  ecx,ecx
473
   xor  ecx,ecx
476
   mov  cl,[max_trk]
474
   mov  cl,[max_trk]
477
 @main_loop:
475
 @main_loop:
478
   xor  eax,eax
476
   xor  eax,eax
479
   mov  al,[shuftab+ecx]
477
   mov  al,[shuftab+ecx]
480
   cmp  al,0
478
   cmp  al,0
481
   je   @f
479
   je   @f
482
   dec  edx
480
   dec  edx
483
   cmp  edx,0
481
   cmp  edx,0
484
   jne  @f
482
   jne  @f
485
   mov  cl,[shuftab]
483
   mov  cl,[shuftab]
486
   dec  cl
484
   dec  cl
487
   mov  [shuftab],cl
485
   mov  [shuftab],cl
488
   mov  [shuftab+eax],0
486
   mov  [shuftab+eax],0
489
   mov  [curr_trk],al
487
   mov  [curr_trk],al
490
   call play_n_track
488
   call play_n_track
491
   jmp  @endofshuffle
489
   jmp  @endofshuffle
492
 @@:
490
 @@:
493
   loop @main_loop
491
   loop @main_loop
494
   jmp  @endofshuffle
492
   jmp  @endofshuffle
495
 @enddsk:
493
 @enddsk:
496
   call stop_playing
494
   call stop_playing
497
 @endofshuffle:
495
 @endofshuffle:
498
 
496
 
499
ret
497
ret
500
 
498
 
501
 
499
 
502
 
500
 
503
 
501
 
504
play_from_x_time:
502
play_from_x_time:
505
    xor  ecx,ecx
503
    xor  ecx,ecx
506
    mov  cl,[curr_trk]
504
    mov  cl,[curr_trk]
507
    shl  cl,3
505
    shl  cl,3
508
    add  cl,1
506
    add  cl,1
509
    add  ecx,cdp
507
    add  ecx,cdp
510
    mov  ebx,[ecx]
508
    mov  ebx,[ecx]
511
    mov  ecx,ebx
509
    mov  ecx,ebx
512
    and  ecx,0x00ffffff
510
    and  ecx,0x00ffffff
513
 
511
 
514
    mov  eax,[curr_trk_pg_time]
512
    mov  eax,[curr_trk_pg_time]
515
    xor  edx,edx
513
    xor  edx,edx
516
    mov  ebx,60
514
    mov  ebx,60
517
    div  ebx
515
    div  ebx
518
    add  cl,al ;mins
516
    add  cl,al ;mins
519
    add  dl,ch
517
    add  dl,ch
520
    xor eax,eax
518
    xor eax,eax
521
    mov al,dl
519
    mov al,dl
522
    xor edx,edx
520
    xor edx,edx
523
    div ebx
521
    div ebx
524
    add cl,al   ;real min
522
    add cl,al   ;real min
525
    mov ch,dl   ;real sec
523
    mov ch,dl   ;real sec
526
 
524
 
527
    mov  eax,24
525
    mov  eax,24
528
    mov  ebx,1
526
    mov  ebx,1
529
    int  0x40
527
    mcall
530
    ret
528
    ret
531
 
529
 
532
play_n_track:
530
play_n_track:
533
    mov  [if_paused],FALSE
531
    mov  [if_paused],FALSE
534
    mov  [if_stopped],FALSE
532
    mov  [if_stopped],FALSE
535
    mov  [curr_trk_pg_time],0
533
    mov  [curr_trk_pg_time],0
536
    call draw_window
534
    call draw_window
537
;    mov  eax,26
535
;    mov  eax,26
538
;    mov  ebx,9
536
;    mov  ebx,9
539
;    int  0x40
537
;    mcall
540
    call get_uptime
538
    call get_uptime
541
    mov  [stimtrk],eax
539
    mov  [stimtrk],eax
542
    xor  ebx,ebx
540
    xor  ebx,ebx
543
    xor  ecx,ecx
541
    xor  ecx,ecx
544
    mov  cl,[curr_trk]
542
    mov  cl,[curr_trk]
545
    inc  cl
543
    inc  cl
546
    shl  cl,3
544
    shl  cl,3
547
    add  cl,1
545
    add  cl,1
548
    add  ecx,cdp
546
    add  ecx,cdp
549
    mov  ebx,[ecx]
547
    mov  ebx,[ecx]
550
    and  ecx,0x00ffffff
548
    and  ecx,0x00ffffff
551
    mov  ecx,ebx
549
    mov  ecx,ebx
552
   ;get_minutes:
550
   ;get_minutes:
553
   and  ecx,0x000000ff
551
   and  ecx,0x000000ff
554
   mov  eax,ecx
552
   mov  eax,ecx
555
   imul eax,60
553
   imul eax,60
556
   ;get_seconds:
554
   ;get_seconds:
557
   mov ecx,ebx
555
   mov ecx,ebx
558
   and ecx,0x0000ff00
556
   and ecx,0x0000ff00
559
   shr ecx,8
557
   shr ecx,8
560
   add eax,ecx
558
   add eax,ecx
561
   ;eax now is next pos in secs
559
   ;eax now is next pos in secs
562
   mov [next_pos_sec],eax
560
   mov [next_pos_sec],eax
563
 ;eax now is current pos in secs
561
 ;eax now is current pos in secs
564
    xor  ebx,ebx
562
    xor  ebx,ebx
565
    xor  ecx,ecx
563
    xor  ecx,ecx
566
    mov  cl,[curr_trk]
564
    mov  cl,[curr_trk]
567
    shl  cl,3
565
    shl  cl,3
568
    add  cl,1
566
    add  cl,1
569
    add  ecx,cdp
567
    add  ecx,cdp
570
    mov  ebx,[ecx]
568
    mov  ebx,[ecx]
571
    and  ecx,0x00ffffff
569
    and  ecx,0x00ffffff
572
    mov  ecx,ebx
570
    mov  ecx,ebx
573
   ;get_minutes:
571
   ;get_minutes:
574
   and  ecx,0x000000ff
572
   and  ecx,0x000000ff
575
   mov  eax,ecx
573
   mov  eax,ecx
576
   imul eax,60
574
   imul eax,60
577
   ;get_seconds:
575
   ;get_seconds:
578
   mov ecx,ebx
576
   mov ecx,ebx
579
   and ecx,0x0000ff00
577
   and ecx,0x0000ff00
580
   shr ecx,8
578
   shr ecx,8
581
   add eax,ecx
579
   add eax,ecx
582
   ;eax now is current pos in secs
580
   ;eax now is current pos in secs
583
   mov ecx,[next_pos_sec]
581
   mov ecx,[next_pos_sec]
584
   sub ecx,eax
582
   sub ecx,eax
585
   ;eax now is length of trk in sec
583
   ;eax now is length of trk in sec
586
   mov [curr_trk_length],ecx
584
   mov [curr_trk_length],ecx
587
;now play that!
585
;now play that!
588
    mov ecx,ebx
586
    mov ecx,ebx
589
    mov  eax,24
587
    mov  eax,24
590
    mov  ebx,1
588
    mov  ebx,1
591
    int  0x40
589
    mcall
592
    ret
590
    ret
593
 
591
 
594
 
592
 
595
play_acd:
593
play_acd:
596
    call chk_cdrom
594
    call chk_cdrom
597
    call read_cd
595
    call read_cd
598
    call draw_window
596
    call draw_window
599
    call renew_shuftab
597
    call renew_shuftab
600
    mov  cl,[curr_trk]
598
    mov  cl,[curr_trk]
601
    cmp  cl,0
599
    cmp  cl,0
602
    jnz  play_acd_trk_ok
600
    jnz  play_acd_trk_ok
603
    mov  cl,[max_trk]
601
    mov  cl,[max_trk]
604
    mov  [shuftab],cl
602
    mov  [shuftab],cl
605
    mov  [curr_trk],1
603
    mov  [curr_trk],1
606
    jmp  playing_no_pause
604
    jmp  playing_no_pause
607
   play_acd_trk_ok:
605
   play_acd_trk_ok:
608
;   start_chk_on_pause:
606
;   start_chk_on_pause:
609
    cmp  [if_paused],TRUE
607
    cmp  [if_paused],TRUE
610
    jne   pause_playing
608
    jne   pause_playing
611
    mov  [if_stopped],FALSE
609
    mov  [if_stopped],FALSE
612
    mov  [if_paused],FALSE
610
    mov  [if_paused],FALSE
613
    call current_trk_time
611
    call current_trk_time
614
    mov  eax,[curr_trk_pg_time]
612
    mov  eax,[curr_trk_pg_time]
615
    mov  ebx,[paused_time]
613
    mov  ebx,[paused_time]
616
    sub  eax,ebx
614
    sub  eax,ebx
617
    imul eax,100
615
    imul eax,100
618
    add  [stimtrk],eax
616
    add  [stimtrk],eax
619
    call current_trk_time
617
    call current_trk_time
620
    call play_from_x_time
618
    call play_from_x_time
621
    call draw_window
619
    call draw_window
622
    jmp  end_play_acd
620
    jmp  end_play_acd
623
   pause_playing:
621
   pause_playing:
624
    cmp  [curr_trk_pg_time],0
622
    cmp  [curr_trk_pg_time],0
625
    je   playing_no_pause
623
    je   playing_no_pause
626
    mov  eax,[curr_trk_pg_time]
624
    mov  eax,[curr_trk_pg_time]
627
    mov  [paused_time],eax
625
    mov  [paused_time],eax
628
    mov  [if_paused],TRUE
626
    mov  [if_paused],TRUE
629
    call stop_playing
627
    call stop_playing
630
    call draw_window
628
    call draw_window
631
    jmp  end_play_acd
629
    jmp  end_play_acd
632
   playing_no_pause:
630
   playing_no_pause:
633
    mov  [if_paused],FALSE
631
    mov  [if_paused],FALSE
634
    call rem_time_trk
632
    call rem_time_trk
635
    call  play_n_track
633
    call  play_n_track
636
    call  draw_window
634
    call  draw_window
637
   end_play_acd:
635
   end_play_acd:
638
    ret
636
    ret
639
 
637
 
640
stop_playing:
638
stop_playing:
641
    mov eax, 24
639
    mov eax, 24
642
    mov ebx,3
640
    mov ebx,3
643
    int 0x40
641
    mcall
644
    mov  cl,[max_trk]
642
    mov  cl,[max_trk]
645
    mov  [shuftab],cl
643
    mov  [shuftab],cl
646
    mov [if_stopped],TRUE
644
    mov [if_stopped],TRUE
647
    cmp [if_paused],TRUE
645
    cmp [if_paused],TRUE
648
    je  end_stop_playing
646
    je  end_stop_playing
649
    mov [curr_trk_pg_time],0
647
    mov [curr_trk_pg_time],0
650
   end_stop_playing:
648
   end_stop_playing:
651
    call draw_window
649
    call draw_window
652
ret
650
ret
653
 
651
 
654
;   *********************************************
652
;   *********************************************
655
;   *******  WINDOW DEFINITIONS AND DRAW ********
653
;   *******  WINDOW DEFINITIONS AND DRAW ********
656
;   *********************************************
654
;   *********************************************
657
 
655
 
658
draw_info:
656
draw_info:
659
    ;bar->
657
    ;bar->
660
    mov eax,13
658
    mov eax,13
661
    mov ebx, 10 shl 16 + 41
659
    mov ebx, 10 shl 16 + 41
662
    mov ecx,120 shl 16 + 9
660
    mov ecx,120 shl 16 + 9
663
    mov edx,0x00ffffff
661
    mov edx,0x00ffffff
664
    int 0x40
662
    mcall
665
    mov ebx, 96 shl 16 + 11
663
    mov ebx, 96 shl 16 + 11
666
    int 0x40
664
    mcall
667
    mov ebx, 185 shl 16 + 11
665
    mov ebx, 185 shl 16 + 11
668
    int 0x40
666
    mcall
669
    mov ebx, 200 shl 16 + 11
667
    mov ebx, 200 shl 16 + 11
670
    int 0x40
668
    mcall
671
    mov ebx, 150 shl 16 + 11
669
    mov ebx, 150 shl 16 + 11
672
    int 0x40
670
    mcall
673
    mov ebx, 165 shl 16 + 11
671
    mov ebx, 165 shl 16 + 11
674
    int 0x40
672
    mcall
675
   ;bar<-
673
   ;bar<-
676
 
674
 
677
    mov  eax,4
675
    mov  eax,4
678
    mov  ebx,10 shl 16 +120
676
    mov  ebx,10 shl 16 +120
679
    mov  ecx,0x00111111
677
    mov  ecx,0x00111111
680
    cmp  [mode],NORMAL_PLAY
678
    cmp  [mode],NORMAL_PLAY
681
    jne  info_mode_1
679
    jne  info_mode_1
682
    mov  edx,mode_normal
680
    mov  edx,mode_normal
683
    jmp  info_mode_end
681
    jmp  info_mode_end
684
   info_mode_1:
682
   info_mode_1:
685
    cmp  [mode],REPEAT_TRACK
683
    cmp  [mode],REPEAT_TRACK
686
    jne  info_mode_2
684
    jne  info_mode_2
687
    mov  edx,mode_repeat_1
685
    mov  edx,mode_repeat_1
688
    jmp  info_mode_end
686
    jmp  info_mode_end
689
   info_mode_2:
687
   info_mode_2:
690
    cmp  [mode],REPEAT_DISK
688
    cmp  [mode],REPEAT_DISK
691
    jne  info_mode_3
689
    jne  info_mode_3
692
    mov  edx,mode_repeat_all
690
    mov  edx,mode_repeat_all
693
    jmp  info_mode_end
691
    jmp  info_mode_end
694
   info_mode_3:
692
   info_mode_3:
695
    cmp  [mode],SHUFFLE_DISK
693
    cmp  [mode],SHUFFLE_DISK
696
    jne  info_mode_end
694
    jne  info_mode_end
697
    mov  edx,mode_shuffle
695
    mov  edx,mode_shuffle
698
;    mov  ecx,0x00aaaaaa
696
;    mov  ecx,0x00aaaaaa
699
;    mov  cl,[max_trk]
697
;    mov  cl,[max_trk]
700
;    mov  [shuftab],cl
698
;    mov  [shuftab],cl
701
    jmp  info_mode_end
699
    jmp  info_mode_end
702
   info_mode_end:
700
   info_mode_end:
703
    mov  esi,7
701
    mov  esi,7
704
    int 0x40
702
    mcall
705
 
703
 
706
  ;num info ->
704
  ;num info ->
707
    mov  eax,47
705
    mov  eax,47
708
    xor  ebx,ebx
706
    xor  ebx,ebx
709
    mov  bl,0
707
    mov  bl,0
710
    mov  bh,0
708
    mov  bh,0
711
    or   ebx,0x20000            ;X0000 - number of digits to draw
709
    or   ebx,0x20000            ;X0000 - number of digits to draw
712
    xor  ecx,ecx
710
    xor  ecx,ecx
713
    mov  cl, [curr_trk]            ;number to draw
711
    mov  cl, [curr_trk]            ;number to draw
714
    mov  edx,96 shl 16 + 120
712
    mov  edx,96 shl 16 + 120
715
    mov  esi,0x111111
713
    mov  esi,0x111111
716
    int 0x40
714
    mcall
717
    mov  eax,[curr_trk_pg_time]
715
    mov  eax,[curr_trk_pg_time]
718
    xor  edx,edx
716
    xor  edx,edx
719
    mov  ecx,60
717
    mov  ecx,60
720
    div  ecx
718
    div  ecx
721
    push edx
719
    push edx
722
    mov  ecx,eax
720
    mov  ecx,eax
723
    mov  eax,47
721
    mov  eax,47
724
    mov  edx,150 shl 16 + 120
722
    mov  edx,150 shl 16 + 120
725
    int  0x40
723
    mcall
726
    pop ecx
724
    pop ecx
727
    mov  edx,165 shl 16 + 120
725
    mov  edx,165 shl 16 + 120
728
    int 0x40
726
    mcall
729
    mov  eax,[curr_trk_length]
727
    mov  eax,[curr_trk_length]
730
    xor  edx,edx
728
    xor  edx,edx
731
    mov  ecx,60
729
    mov  ecx,60
732
    div  ecx
730
    div  ecx
733
    push edx
731
    push edx
734
    mov  ecx,eax
732
    mov  ecx,eax
735
    mov  eax,47
733
    mov  eax,47
736
    mov  edx,185 shl 16 + 120
734
    mov  edx,185 shl 16 + 120
737
    int  0x40
735
    mcall
738
    pop  ecx
736
    pop  ecx
739
    mov  edx,200 shl 16 + 120
737
    mov  edx,200 shl 16 + 120
740
    int  0x40
738
    mcall
741
   ;num info <-
739
   ;num info <-
742
ret
740
ret
743
 
741
 
744
 
742
 
745
draw_window:
743
draw_window:
746
 
744
 
747
    mov  eax,12                    ; function 12:tell os about windowdraw
745
    mov  eax,12                    ; function 12:tell os about windowdraw
748
    mov  ebx,1                     ; 1, start of draw
746
    mov  ebx,1                     ; 1, start of draw
749
    int  0x40
747
    mcall
750
                                   ; DRAW WINDOW
748
                                   ; DRAW WINDOW
751
    mov  eax,0                     ; function 0 : define and draw window
749
    mov  eax,0                     ; function 0 : define and draw window
752
    mov  ebx, 50*65536+219         ; [x start] *65536 + [x size]
750
    mov  ebx, 50*65536+219         ; [x start] *65536 + [x size]
753
    mov  ecx,100*65536+168         ; [y start] *65536 + [y size]
751
    mov  ecx,100*65536+168         ; [y start] *65536 + [y size]
754
    mov  edx,0x03ffffff            ; color of work area RRGGBB
752
    mov  edx,0x03ffffff            ; color of work area RRGGBB
755
    mov  esi,0x8099bbff            ; color of grab bar  RRGGBB,8->color glide
753
    mov  esi,0x8099bbff            ; color of grab bar  RRGGBB,8->color glide
756
    mov  edi,0x0099bbee            ; color of frames    RRGGBB
754
    mov  edi,0x0099bbee            ; color of frames    RRGGBB
757
    int  0x40
755
    mcall
758
                                   ; WINDOW LABEL
756
                                   ; WINDOW LABEL
759
    mov  eax,4                     ; function 4 : write text to window
757
    mov  eax,4                     ; function 4 : write text to window
760
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
758
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
761
    mov  ecx,0x1000ffff            ; color of text RRGGBB
759
    mov  ecx,0x1000ffff            ; color of text RRGGBB
762
    mov  edx,labelt                ; pointer to text beginning
760
    mov  edx,labelt                ; pointer to text beginning
763
    mov  esi,labellen-labelt       ; text length
761
    mov  esi,labellen-labelt       ; text length
764
    int  0x40
762
    mcall
765
 
763
 
766
    mov  eax,13                    ;bar
764
    mov  eax,13                    ;bar
767
    mov  ebx,8 shl 16 + 204
765
    mov  ebx,8 shl 16 + 204
768
    mov  ecx,28 shl 16 + 84
766
    mov  ecx,28 shl 16 + 84
769
    mov  edx,0x000fe6f5
767
    mov  edx,0x000fe6f5
770
    int  0x40
768
    mcall
771
 
769
 
772
    ;info ->
770
    ;info ->
773
    mov  eax,4
771
    mov  eax,4
774
    mov  ebx,63 shl 16 + 120
772
    mov  ebx,63 shl 16 + 120
775
    mov  ecx,0x00111111
773
    mov  ecx,0x00111111
776
    mov  edx,playing_trk_info
774
    mov  edx,playing_trk_info
777
    mov  esi,6
775
    mov  esi,6
778
    int 0x40
776
    mcall
779
    mov  ebx,120 shl 16 + 120
777
    mov  ebx,120 shl 16 + 120
780
    mov  edx,playing_time_info
778
    mov  edx,playing_time_info
781
;    mov  esi,5
779
;    mov  esi,5
782
    dec  esi
780
    dec  esi
783
    int 0x40
781
    mcall
784
    mov  ebx,178 shl 16 + 120
782
    mov  ebx,178 shl 16 + 120
785
    mov  edx,slash
783
    mov  edx,slash
786
    mov  esi,1
784
    mov  esi,1
787
    int 0x40
785
    mcall
788
    mov  ebx,196 shl 16 + 120
786
    mov  ebx,196 shl 16 + 120
789
    mov  edx,column
787
    mov  edx,column
790
;    mov  esi,1
788
;    mov  esi,1
791
    int 0x40
789
    mcall
792
    mov  ebx,161 shl 16 + 120
790
    mov  ebx,161 shl 16 + 120
793
    mov  edx,column
791
    mov  edx,column
794
;    mov  esi,1
792
;    mov  esi,1
795
    int 0x40
793
    mcall
796
    ;info <-
794
    ;info <-
797
 
795
 
798
; button  MODE
796
; button  MODE
799
    mov  eax,8
797
    mov  eax,8
800
    mov  ebx,12*65536+20
798
    mov  ebx,12*65536+20
801
    mov  ecx,135*65536+20
799
    mov  ecx,135*65536+20
802
    mov  edx,7
800
    mov  edx,7
803
    mov  esi,COLOR_FUNC_BUTS
801
    mov  esi,COLOR_FUNC_BUTS
804
    int 0x40
802
    mcall
805
   ; text
803
   ; text
806
    mov  eax,4
804
    mov  eax,4
807
    mov  ebx,19*65536+142
805
    mov  ebx,19*65536+142
808
    mov  ecx,0x100f73f5;ffff0f
806
    mov  ecx,0x100f73f5;ffff0f
809
    mov  edx,but_mode_lab
807
    mov  edx,but_mode_lab
810
    mov  esi,1
808
    mov  esi,1
811
    int  0x40
809
    mcall
812
 
810
 
813
; button  BACK
811
; button  BACK
814
    mov  eax,8
812
    mov  eax,8
815
    mov  ebx,37*65536+20
813
    mov  ebx,37*65536+20
816
    mov  ecx,135*65536+20
814
    mov  ecx,135*65536+20
817
    mov  edx,6
815
    mov  edx,6
818
    mov  esi,COLOR_FUNC_BUTS
816
    mov  esi,COLOR_FUNC_BUTS
819
    int 0x40
817
    mcall
820
    mov [coord_x],51
818
    mov [coord_x],51
821
    mov [coord_y],141
819
    mov [coord_y],141
822
    call draw_left_triangle
820
    call draw_left_triangle
823
    mov [coord_x],44
821
    mov [coord_x],44
824
    call draw_vertical_line
822
    call draw_vertical_line
825
 
823
 
826
; button  NEXT
824
; button  NEXT
827
    mov  eax,8
825
    mov  eax,8
828
    mov  ebx,62*65536+20
826
    mov  ebx,62*65536+20
829
    mov  ecx,135*65536+20
827
    mov  ecx,135*65536+20
830
    mov  edx,5
828
    mov  edx,5
831
    mov  esi,COLOR_FUNC_BUTS
829
    mov  esi,COLOR_FUNC_BUTS
832
    int 0x40
830
    mcall
833
    mov [coord_x],68
831
    mov [coord_x],68
834
    mov [coord_y],141
832
    mov [coord_y],141
835
    call draw_right_triangle
833
    call draw_right_triangle
836
    mov [coord_x],74
834
    mov [coord_x],74
837
    call draw_vertical_line
835
    call draw_vertical_line
838
 
836
 
839
; button  REWIND
837
; button  REWIND
840
    mov  eax,8
838
    mov  eax,8
841
    mov  ebx,87*65536+20
839
    mov  ebx,87*65536+20
842
    mov  ecx,135*65536+20
840
    mov  ecx,135*65536+20
843
    mov  edx,8
841
    mov  edx,8
844
    mov  esi,COLOR_FUNC_BUTS
842
    mov  esi,COLOR_FUNC_BUTS
845
    int 0x40
843
    mcall
846
    mov [coord_x],102
844
    mov [coord_x],102
847
    mov [coord_y],141
845
    mov [coord_y],141
848
    call draw_left_triangle
846
    call draw_left_triangle
849
    mov [coord_x],97
847
    mov [coord_x],97
850
    call draw_left_triangle
848
    call draw_left_triangle
851
 
849
 
852
; button   STOP
850
; button   STOP
853
    mov  eax,8
851
    mov  eax,8
854
    mov  ebx,112*65536+20
852
    mov  ebx,112*65536+20
855
    mov  ecx,135*65536+20
853
    mov  ecx,135*65536+20
856
    mov  edx,3
854
    mov  edx,3
857
    mov  esi,COLOR_FUNC_BUTS
855
    mov  esi,COLOR_FUNC_BUTS
858
    int 0x40
856
    mcall
859
    mov [coord_x],118
857
    mov [coord_x],118
860
    mov [coord_y],142
858
    mov [coord_y],142
861
    call draw_square
859
    call draw_square
862
 
860
 
863
 
861
 
864
; button  PLAY
862
; button  PLAY
865
    mov  eax,8
863
    mov  eax,8
866
    mov  ebx,137*65536+20
864
    mov  ebx,137*65536+20
867
    mov  ecx,135*65536+20
865
    mov  ecx,135*65536+20
868
    mov  edx,2
866
    mov  edx,2
869
    mov  esi,COLOR_FUNC_BUTS
867
    mov  esi,COLOR_FUNC_BUTS
870
    int 0x40
868
    mcall
871
    cmp [if_stopped],TRUE
869
    cmp [if_stopped],TRUE
872
    je  playing_paused
870
    je  playing_paused
873
    cmp [if_paused],TRUE
871
    cmp [if_paused],TRUE
874
    je  playing_paused
872
    je  playing_paused
875
    mov [coord_x],144
873
    mov [coord_x],144
876
    mov [coord_y],141
874
    mov [coord_y],141
877
    call draw_vertical_line
875
    call draw_vertical_line
878
    mov [coord_x],149
876
    mov [coord_x],149
879
    call draw_vertical_line
877
    call draw_vertical_line
880
    jmp end_draw_play
878
    jmp end_draw_play
881
   playing_paused:
879
   playing_paused:
882
    mov [coord_x],144
880
    mov [coord_x],144
883
    mov [coord_y],141
881
    mov [coord_y],141
884
    call draw_right_triangle
882
    call draw_right_triangle
885
   end_draw_play:
883
   end_draw_play:
886
 
884
 
887
 
885
 
888
; button   FORWARD
886
; button   FORWARD
889
    mov  eax,8
887
    mov  eax,8
890
    mov  ebx,162*65536+20
888
    mov  ebx,162*65536+20
891
    mov  ecx,135*65536+20
889
    mov  ecx,135*65536+20
892
    mov  edx,9
890
    mov  edx,9
893
    mov  esi,COLOR_FUNC_BUTS
891
    mov  esi,COLOR_FUNC_BUTS
894
    int 0x40
892
    mcall
895
    mov [coord_x],167
893
    mov [coord_x],167
896
    mov [coord_y],141
894
    mov [coord_y],141
897
    call draw_right_triangle
895
    call draw_right_triangle
898
    mov [coord_x],172
896
    mov [coord_x],172
899
    call draw_right_triangle
897
    call draw_right_triangle
900
 
898
 
901
; button  RE-READ PLAYLIST
899
; button  RE-READ PLAYLIST
902
    mov  eax,8
900
    mov  eax,8
903
    mov  ebx,187*65536+20
901
    mov  ebx,187*65536+20
904
    mov  ecx,135*65536+20
902
    mov  ecx,135*65536+20
905
    mov  edx,4
903
    mov  edx,4
906
    mov  esi,COLOR_FUNC_BUTS
904
    mov  esi,COLOR_FUNC_BUTS
907
    int 0x40
905
    mcall
908
    mov  [coord_x],192
906
    mov  [coord_x],192
909
    mov  [coord_y],140
907
    mov  [coord_y],140
910
    call draw_vert_list_line
908
    call draw_vert_list_line
911
    dec  [coord_y]
909
    dec  [coord_y]
912
    call draw_hor_list_line
910
    call draw_hor_list_line
913
    mov  [coord_y], 151
911
    mov  [coord_y], 151
914
    call draw_hor_list_line
912
    call draw_hor_list_line
915
    mov  [coord_x],202
913
    mov  [coord_x],202
916
    mov  [coord_y],140
914
    mov  [coord_y],140
917
    call draw_vert_list_line
915
    call draw_vert_list_line
918
    mov  [coord_x],195
916
    mov  [coord_x],195
919
    mov  [coord_y], 142
917
    mov  [coord_y], 142
920
    call draw_str_list_line
918
    call draw_str_list_line
921
    mov  [coord_y],145
919
    mov  [coord_y],145
922
    call draw_str_list_line
920
    call draw_str_list_line
923
    mov  [coord_y],148
921
    mov  [coord_y],148
924
    call draw_str_list_line
922
    call draw_str_list_line
925
 
923
 
926
    cmp  [flag],1
924
    cmp  [flag],1
927
    jne  flag2
925
    jne  flag2
928
;Draw tracs buttons
926
;Draw tracs buttons
929
    xor  eax,eax
927
    xor  eax,eax
930
    xor  ebx,ebx
928
    xor  ebx,ebx
931
    mov  ecx,10
929
    mov  ecx,10
932
    mov  al,[cdp+3]
930
    mov  al,[cdp+3]
933
    mov  [max_trk],al
931
    mov  [max_trk],al
934
    xor  edi,edi
932
    xor  edi,edi
935
    mov  di,ax
933
    mov  di,ax
936
    mov  [posx],12
934
    mov  [posx],12
937
    mov  [posy],32
935
    mov  [posy],32
938
    mov  [tracs],1
936
    mov  [tracs],1
939
 draw_tracs_buttons:
937
 draw_tracs_buttons:
940
    mov  eax,8
938
    mov  eax,8
941
    xor  ebx,ebx
939
    xor  ebx,ebx
942
    mov  bl,[posx]
940
    mov  bl,[posx]
943
    shl  ebx,16
941
    shl  ebx,16
944
    add  ebx,15
942
    add  ebx,15
945
    xor  ecx,ecx
943
    xor  ecx,ecx
946
    mov  cl,[posy]
944
    mov  cl,[posy]
947
    shl  ecx,16
945
    shl  ecx,16
948
    add  ecx,15
946
    add  ecx,15
949
    xor  edx,edx
947
    xor  edx,edx
950
    mov  dx,[tracs]
948
    mov  dx,[tracs]
951
    add  edx,10
949
    add  edx,10
952
    mov  esi,0xaaaaaa
950
    mov  esi,0xaaaaaa
953
    add  esi,edi
951
    add  esi,edi
954
    int  0x40
952
    mcall
955
   ;---draw tracs numbers
953
   ;---draw tracs numbers
956
    mov  eax,47
954
    mov  eax,47
957
    xor  ebx,ebx
955
    xor  ebx,ebx
958
    mov  bl,0
956
    mov  bl,0
959
    or   ebx,0x20000            ;number of digits to draw
957
    or   ebx,0x20000            ;number of digits to draw
960
    xor  ecx,ecx
958
    xor  ecx,ecx
961
    mov  cx, [tracs]            ;number to draw
959
    mov  cx, [tracs]            ;number to draw
962
    xor  edx,edx
960
    xor  edx,edx
963
    mov  dl,[posx]
961
    mov  dl,[posx]
964
    add  dl,3
962
    add  dl,3
965
    shl  edx,16
963
    shl  edx,16
966
    add  dl,[posy]
964
    add  dl,[posy]
967
    add  dl,5
965
    add  dl,5
968
    mov  esi,0xffffff
966
    mov  esi,0xffffff
969
    int 0x40
967
    mcall
970
   ;---
968
   ;---
971
    mov  al,[posx]
969
    mov  al,[posx]
972
    add  al,20
970
    add  al,20
973
    mov  [posx],al
971
    mov  [posx],al
974
    xor  eax,eax
972
    xor  eax,eax
975
    mov  ax,[tracs]
973
    mov  ax,[tracs]
976
    mov  bl,10
974
    mov  bl,10
977
    div  bl
975
    div  bl
978
    cmp  ah,0
976
    cmp  ah,0
979
    jnz  no_new_str
977
    jnz  no_new_str
980
    mov  al,[posxstart]
978
    mov  al,[posxstart]
981
    mov  [posx], al
979
    mov  [posx], al
982
    mov  al,[posy]
980
    mov  al,[posy]
983
    add  al,20
981
    add  al,20
984
    mov  [posy],al
982
    mov  [posy],al
985
  no_new_str:
983
  no_new_str:
986
    inc  [tracs]
984
    inc  [tracs]
987
    cmp  [tracs],41
985
    cmp  [tracs],41
988
    je   flag2
986
    je   flag2
989
    dec  edi
987
    dec  edi
990
    cmp  edi,0
988
    cmp  edi,0
991
    jnz  draw_tracs_buttons
989
    jnz  draw_tracs_buttons
992
 
990
 
993
  flag2:
991
  flag2:
994
    cmp [flag],2
992
    cmp [flag],2
995
    jne flag3
993
    jne flag3
996
    mov eax,4
994
    mov eax,4
997
    mov ebx, 20 shl 16 +67
995
    mov ebx, 20 shl 16 +67
998
    mov ecx,0x10ffff00
996
    mov ecx,0x10ffff00
999
    mov edx,define_cdrom
997
    mov edx,define_cdrom
1000
    mov esi,define_cdrom_len-define_cdrom
998
    mov esi,define_cdrom_len-define_cdrom
1001
    int 0x40
999
    mcall
1002
  flag3:
1000
  flag3:
1003
    cmp [flag],3
1001
    cmp [flag],3
1004
    jne flag4
1002
    jne flag4
1005
    mov eax,4
1003
    mov eax,4
1006
    mov ebx, 47 shl 16 +67
1004
    mov ebx, 47 shl 16 +67
1007
    mov ecx,0x10ffff00
1005
    mov ecx,0x10ffff00
1008
    mov edx,no_cda
1006
    mov edx,no_cda
1009
    mov esi,no_cda_len-no_cda
1007
    mov esi,no_cda_len-no_cda
1010
    int 0x40
1008
    mcall
1011
  flag4:
1009
  flag4:
1012
    cmp [flag],4
1010
    cmp [flag],4
1013
    jne flag5
1011
    jne flag5
1014
   ;help screen
1012
   ;help screen
1015
   cmp [help_screen],1
1013
   cmp [help_screen],1
1016
   jnz @hs2
1014
   jnz @hs2
1017
   mov edx,help1
1015
   mov edx,help1
1018
   jmp @ehs
1016
   jmp @ehs
1019
  @hs2:
1017
  @hs2:
1020
   cmp [help_screen],2
1018
   cmp [help_screen],2
1021
   jnz @hs3
1019
   jnz @hs3
1022
   mov edx,help2
1020
   mov edx,help2
1023
   jmp @ehs
1021
   jmp @ehs
1024
  @hs3:
1022
  @hs3:
1025
   mov edx,help3
1023
   mov edx,help3
1026
  @ehs:
1024
  @ehs:
1027
   xor edi,edi
1025
   xor edi,edi
1028
   mov ebx,25*65536+30
1026
   mov ebx,25*65536+30
1029
  new_line:
1027
  new_line:
1030
   mov eax,4
1028
   mov eax,4
1031
   mov ecx,0x111111
1029
   mov ecx,0x111111
1032
   mov esi,31
1030
   mov esi,31
1033
   int 0x40
1031
   mcall
1034
  noline:
1032
  noline:
1035
   add ebx,10
1033
   add ebx,10
1036
   add edx,31
1034
   add edx,31
1037
   inc edi
1035
   inc edi
1038
   cmp [edx],byte 'x'
1036
   cmp [edx],byte 'x'
1039
   jnz new_line
1037
   jnz new_line
1040
  flag5:
1038
  flag5:
1041
  call draw_info
1039
  call draw_info
1042
 
1040
 
1043
    mov  eax,12                    ; function 12:tell os about windowdraw
1041
    mov  eax,12                    ; function 12:tell os about windowdraw
1044
    mov  ebx,2                     ; 2, end of draw
1042
    mov  ebx,2                     ; 2, end of draw
1045
    int  0x40
1043
    mcall
1046
 
1044
 
1047
ret
1045
ret
1048
 
1046
 
1049
draw_right_triangle:
1047
draw_right_triangle:
1050
    mov ebx,[coord_x]
1048
    mov ebx,[coord_x]
1051
    mov ecx,[coord_y]
1049
    mov ecx,[coord_y]
1052
    mov edx,0x00111111
1050
    mov edx,0x00111111
1053
    mov esi,5
1051
    mov esi,5
1054
    mov eax,9
1052
    mov eax,9
1055
   start_draw_pixel:
1053
   start_draw_pixel:
1056
    push ebx
1054
    push ebx
1057
    cmp  eax,5
1055
    cmp  eax,5
1058
    jb   y_menshe_5
1056
    jb   y_menshe_5
1059
    mov  esi,10
1057
    mov  esi,10
1060
    sub  esi,eax
1058
    sub  esi,eax
1061
    jmp  draw_pixel
1059
    jmp  draw_pixel
1062
   y_menshe_5:
1060
   y_menshe_5:
1063
    mov  esi,eax
1061
    mov  esi,eax
1064
   draw_pixel:
1062
   draw_pixel:
1065
    dec  esi
1063
    dec  esi
1066
    inc  ebx
1064
    inc  ebx
1067
    push eax
1065
    push eax
1068
    mov  eax,1
1066
    mov  eax,1
1069
    int  0x40
1067
    mcall
1070
    pop  eax
1068
    pop  eax
1071
    cmp  esi,0
1069
    cmp  esi,0
1072
    jne  draw_pixel
1070
    jne  draw_pixel
1073
    pop  ebx
1071
    pop  ebx
1074
    dec  eax
1072
    dec  eax
1075
    inc  ecx
1073
    inc  ecx
1076
    cmp  eax,0
1074
    cmp  eax,0
1077
    jne  start_draw_pixel
1075
    jne  start_draw_pixel
1078
ret
1076
ret
1079
 
1077
 
1080
draw_square:
1078
draw_square:
1081
    mov ebx,[coord_x]
1079
    mov ebx,[coord_x]
1082
    mov ecx,[coord_y]
1080
    mov ecx,[coord_y]
1083
    mov edx,0x00111111
1081
    mov edx,0x00111111
1084
    mov eax,7
1082
    mov eax,7
1085
   q_start_draw_pixel:
1083
   q_start_draw_pixel:
1086
    push ebx
1084
    push ebx
1087
    mov  esi,7
1085
    mov  esi,7
1088
   q_draw_pixel:
1086
   q_draw_pixel:
1089
    dec  esi
1087
    dec  esi
1090
    inc  ebx
1088
    inc  ebx
1091
    push eax
1089
    push eax
1092
    mov  eax,1
1090
    mov  eax,1
1093
    int  0x40
1091
    mcall
1094
    pop  eax
1092
    pop  eax
1095
    cmp  esi,0
1093
    cmp  esi,0
1096
    jne  q_draw_pixel
1094
    jne  q_draw_pixel
1097
    pop  ebx
1095
    pop  ebx
1098
    dec  eax
1096
    dec  eax
1099
    inc  ecx
1097
    inc  ecx
1100
    cmp  eax,0
1098
    cmp  eax,0
1101
    jne  q_start_draw_pixel
1099
    jne  q_start_draw_pixel
1102
ret
1100
ret
1103
 
1101
 
1104
draw_left_triangle:
1102
draw_left_triangle:
1105
    mov ebx,[coord_x]
1103
    mov ebx,[coord_x]
1106
    mov ecx,[coord_y]
1104
    mov ecx,[coord_y]
1107
    mov edx,0x00111111
1105
    mov edx,0x00111111
1108
    mov esi,5
1106
    mov esi,5
1109
    mov eax,9
1107
    mov eax,9
1110
   l_start_draw_pixel:
1108
   l_start_draw_pixel:
1111
    push ebx
1109
    push ebx
1112
    cmp  eax,5
1110
    cmp  eax,5
1113
    jb   l_y_menshe_5
1111
    jb   l_y_menshe_5
1114
    mov  esi,10
1112
    mov  esi,10
1115
    sub  esi,eax
1113
    sub  esi,eax
1116
    jmp  l_draw_pixel
1114
    jmp  l_draw_pixel
1117
   l_y_menshe_5:
1115
   l_y_menshe_5:
1118
    mov  esi,eax
1116
    mov  esi,eax
1119
   l_draw_pixel:
1117
   l_draw_pixel:
1120
    dec  esi
1118
    dec  esi
1121
    dec  ebx
1119
    dec  ebx
1122
    push eax
1120
    push eax
1123
    mov  eax,1
1121
    mov  eax,1
1124
    int  0x40
1122
    mcall
1125
    pop  eax
1123
    pop  eax
1126
    cmp  esi,0
1124
    cmp  esi,0
1127
    jne  l_draw_pixel
1125
    jne  l_draw_pixel
1128
    pop  ebx
1126
    pop  ebx
1129
    dec  eax
1127
    dec  eax
1130
    inc  ecx
1128
    inc  ecx
1131
    cmp  eax,0
1129
    cmp  eax,0
1132
    jne  l_start_draw_pixel
1130
    jne  l_start_draw_pixel
1133
ret
1131
ret
1134
 
1132
 
1135
draw_vertical_line:
1133
draw_vertical_line:
1136
    mov  eax,2
1134
    mov  eax,2
1137
    mov  ebx,[coord_x]
1135
    mov  ebx,[coord_x]
1138
    mov  edx,0x00111111
1136
    mov  edx,0x00111111
1139
  @@draw_2_line:
1137
  @@draw_2_line:
1140
    mov  ecx,[coord_y]
1138
    mov  ecx,[coord_y]
1141
    dec  ecx
1139
    dec  ecx
1142
    mov  esi,9
1140
    mov  esi,9
1143
   start_draw_vline:
1141
   start_draw_vline:
1144
    inc  ecx
1142
    inc  ecx
1145
    push eax
1143
    push eax
1146
    mov  eax,1
1144
    mov  eax,1
1147
    int  0x40
1145
    mcall
1148
    pop  eax
1146
    pop  eax
1149
    dec  esi
1147
    dec  esi
1150
    cmp  esi,0
1148
    cmp  esi,0
1151
    jne  start_draw_vline
1149
    jne  start_draw_vline
1152
    dec  eax
1150
    dec  eax
1153
    inc ebx
1151
    inc ebx
1154
    cmp  eax,0
1152
    cmp  eax,0
1155
    jne  @@draw_2_line
1153
    jne  @@draw_2_line
1156
ret
1154
ret
1157
 
1155
 
1158
draw_vert_list_line:
1156
draw_vert_list_line:
1159
    mov  eax,1
1157
    mov  eax,1
1160
    mov  ebx,[coord_x]
1158
    mov  ebx,[coord_x]
1161
    mov  edx,0x00111111
1159
    mov  edx,0x00111111
1162
    mov  ecx,[coord_y]
1160
    mov  ecx,[coord_y]
1163
    dec  ecx
1161
    dec  ecx
1164
    mov  esi,11
1162
    mov  esi,11
1165
   vlstart_draw_vline:
1163
   vlstart_draw_vline:
1166
    inc  ecx
1164
    inc  ecx
1167
    int  0x40
1165
    mcall
1168
    dec  esi
1166
    dec  esi
1169
    cmp  esi,0
1167
    cmp  esi,0
1170
    jne  vlstart_draw_vline
1168
    jne  vlstart_draw_vline
1171
    dec  eax
1169
    dec  eax
1172
    inc ebx
1170
    inc ebx
1173
ret
1171
ret
1174
 
1172
 
1175
draw_hor_list_line:
1173
draw_hor_list_line:
1176
    mov  eax,1
1174
    mov  eax,1
1177
    mov  ebx,[coord_x]
1175
    mov  ebx,[coord_x]
1178
    mov  edx,0x00111111
1176
    mov  edx,0x00111111
1179
    mov  ecx,[coord_y]
1177
    mov  ecx,[coord_y]
1180
    dec  ebx
1178
    dec  ebx
1181
    mov  esi,11
1179
    mov  esi,11
1182
   hlstart_draw_vline:
1180
   hlstart_draw_vline:
1183
    inc  ebx
1181
    inc  ebx
1184
    int  0x40
1182
    mcall
1185
    dec  esi
1183
    dec  esi
1186
    cmp  esi,0
1184
    cmp  esi,0
1187
    jne  hlstart_draw_vline
1185
    jne  hlstart_draw_vline
1188
    dec  eax
1186
    dec  eax
1189
    inc ebx
1187
    inc ebx
1190
ret
1188
ret
1191
 
1189
 
1192
draw_str_list_line:
1190
draw_str_list_line:
1193
    mov  eax,1
1191
    mov  eax,1
1194
    mov  ebx,[coord_x]
1192
    mov  ebx,[coord_x]
1195
    mov  edx,0x00111111
1193
    mov  edx,0x00111111
1196
    mov  ecx,[coord_y]
1194
    mov  ecx,[coord_y]
1197
    dec  ebx
1195
    dec  ebx
1198
    mov  esi,5
1196
    mov  esi,5
1199
   slstart_draw_vline:
1197
   slstart_draw_vline:
1200
    inc  ebx
1198
    inc  ebx
1201
    int  0x40
1199
    mcall
1202
    dec  esi
1200
    dec  esi
1203
    cmp  esi,0
1201
    cmp  esi,0
1204
    jne  slstart_draw_vline
1202
    jne  slstart_draw_vline
1205
    dec  eax
1203
    dec  eax
1206
    inc ebx
1204
    inc ebx
1207
ret
1205
ret
1208
 
1206
 
1209
 
1207
 
1210
 chk_cdrom:
1208
 chk_cdrom:
1211
    mov eax,24
1209
    mov eax,24
1212
    mov ebx,1
1210
    mov ebx,1
1213
    int 0x40
1211
    mcall
1214
    cmp eax,0
1212
    cmp eax,0
1215
    je chk_cdrom_ok
1213
    je chk_cdrom_ok
1216
    mov [flag],2
1214
    mov [flag],2
1217
    call draw_window
1215
    call draw_window
1218
    jmp  chk_cdrom_end
1216
    jmp  chk_cdrom_end
1219
   chk_cdrom_ok:
1217
   chk_cdrom_ok:
1220
    mov [flag],0
1218
    mov [flag],0
1221
   chk_cdrom_end:
1219
   chk_cdrom_end:
1222
ret
1220
ret
1223
 
1221
 
1224
read_cd:
1222
read_cd:
1225
    mov [if_stopped],TRUE
1223
    mov [if_stopped],TRUE
1226
    push ax
1224
    push ax
1227
    cmp [flag],2
1225
    cmp [flag],2
1228
    je  read_cd_end
1226
    je  read_cd_end
1229
    mov al,101
1227
    mov al,101
1230
    mov [cdp+3],al
1228
    mov [cdp+3],al
1231
    mov eax,24
1229
    mov eax,24
1232
    mov ebx,2
1230
    mov ebx,2
1233
    mov ecx, cdp
1231
    mov ecx, cdp
1234
    mov edx,321
1232
    mov edx,321
1235
    int 0x40
1233
    mcall
1236
    mov [flag],1
1234
    mov [flag],1
1237
    mov al,100
1235
    mov al,100
1238
    cmp [cdp+3],al
1236
    cmp [cdp+3],al
1239
    jb  read_cd_end
1237
    jb  read_cd_end
1240
    mov [flag],3
1238
    mov [flag],3
1241
    call draw_window
1239
    call draw_window
1242
 read_cd_end:
1240
 read_cd_end:
1243
    pop ax
1241
    pop ax
1244
ret
1242
ret
1245
 
1243
 
1246
get_uptime:
1244
get_uptime:
1247
    push ebx
1245
    push ebx
1248
    mov  eax,26
1246
    mov  eax,26
1249
    mov  ebx,9
1247
    mov  ebx,9
1250
    int  0x40
1248
    mcall
1251
    pop  ebx
1249
    pop  ebx
1252
ret
1250
ret
1253
 
1251
 
1254
; DATA AREA
1252
; DATA AREA
1255
 
1253
 
1256
paused_time dd 0
1254
paused_time dd 0
1257
if_paused db FALSE
1255
if_paused db FALSE
1258
coord_x dd 0
1256
coord_x dd 0
1259
coord_y dd 0
1257
coord_y dd 0
1260
flag db 0
1258
flag db 0
1261
tracs dw 1
1259
tracs dw 1
1262
posx db 12
1260
posx db 12
1263
posy db 32
1261
posy db 32
1264
posxstart db 12
1262
posxstart db 12
1265
curr_trk db 0
1263
curr_trk db 0
1266
max_trk db 0
1264
max_trk db 0
1267
stimtrk dd 0
1265
stimtrk dd 0
1268
help_screen db 0
1266
help_screen db 0
1269
next_pos_sec dd 0
1267
next_pos_sec dd 0
1270
curr_trk_length dd 0
1268
curr_trk_length dd 0
1271
curr_trk_pg_time dd 0
1269
curr_trk_pg_time dd 0
1272
was_it_ok db FALSE
1270
was_it_ok db FALSE
1273
if_stopped db FALSE
1271
if_stopped db FALSE
1274
mode db NORMAL_PLAY
1272
mode db NORMAL_PLAY
1275
 
1273
 
1276
shuftab  db 00,01,02,03,04,05,06,07,08,09
1274
shuftab  db 00,01,02,03,04,05,06,07,08,09
1277
         db 10,11,12,13,14,15,16,17,18,19
1275
         db 10,11,12,13,14,15,16,17,18,19
1278
         db 20,21,22,23,24,25,26,27,28,29
1276
         db 20,21,22,23,24,25,26,27,28,29
1279
         db 30,31,32,33,34,35,36,37,38,39
1277
         db 30,31,32,33,34,35,36,37,38,39
1280
         db 40
1278
         db 40
1281
 
1279
 
1282
but_mode_lab: db 'M'
1280
but_mode_lab: db 'M'
1283
 
1281
 
1284
playing_time_info: db 'Time '
1282
playing_time_info: db 'Time '
1285
slash  db '/'
1283
slash  db '/'
1286
column db ':'
1284
column db ':'
1287
mode_normal db     'Normal '
1285
mode_normal db     'Normal '
1288
mode_repeat_1 db   'Rep trk'
1286
mode_repeat_1 db   'Rep trk'
1289
mode_repeat_all db 'Rep all'
1287
mode_repeat_all db 'Rep all'
1290
mode_shuffle db    'Shuffle'
1288
mode_shuffle db    'Shuffle'
1291
playing_trk_info: db 'Track '
1289
playing_trk_info: db 'Track '
1292
 
1290
 
1293
define_cdrom: db 'Please, define your CD-ROM'
1291
define_cdrom: db 'Please, define your CD-ROM'
1294
define_cdrom_len:
1292
define_cdrom_len:
1295
 
1293
 
1296
no_cda: db 'Audio CD not found'
1294
no_cda: db 'Audio CD not found'
1297
no_cda_len:
1295
no_cda_len:
1298
 
1296
 
1299
labelt:
1297
labelt:
1300
   db   'CD player'
1298
   db   'CD player'
1301
labellen:
1299
labellen:
1302
 
1300
 
1303
help1: db 'HotKeys:                       '
1301
help1: db 'HotKeys:                       '
1304
       db 'H - this screen (Help)         '
1302
       db 'H - this screen (Help)         '
1305
       db 'P - Play/Pause current track   '
1303
       db 'P - Play/Pause current track   '
1306
       db 'S - Stop playing               '
1304
       db 'S - Stop playing               '
1307
       db 'L - re-read playList           '
1305
       db 'L - re-read playList           '
1308
       db 'N - play Next track            '
1306
       db 'N - play Next track            '
1309
       db 'B - play previous track (Back) '
1307
       db 'B - play previous track (Back) '
1310
       db '                        next ->'
1308
       db '                        next ->'
1311
       db 'x'
1309
       db 'x'
1312
help2: db 'HotKeys:                       '
1310
help2: db 'HotKeys:                       '
1313
       db 'F - fast Forward track         '
1311
       db 'F - fast Forward track         '
1314
       db 'R - fast Rewind track          '
1312
       db 'R - fast Rewind track          '
1315
       db 'M - change Mode                '
1313
       db 'M - change Mode                '
1316
       db '                               '
1314
       db '                               '
1317
       db '                               '
1315
       db '                               '
1318
       db '                               '
1316
       db '                               '
1319
       db '<- prev                 next ->'
1317
       db '<- prev                 next ->'
1320
       db 'x'
1318
       db 'x'
1321
help3: db 'About:                         '
1319
help3: db 'About:                         '
1322
       db 'Audio CD Player ver 1.1beta-2  '
1320
       db 'Audio CD Player ver 1.1beta-2  '
1323
       db 'All questions, wishes and      '
1321
       db 'All questions, wishes and      '
1324
       db 'advices please send to:        '
1322
       db 'advices please send to:        '
1325
       db '       E-mail:  dma@bn.by      '
1323
       db '       E-mail:  dma@bn.by      '
1326
       db '       FidoNet: 2:450/258.75   '
1324
       db '       FidoNet: 2:450/258.75   '
1327
       db '                               '
1325
       db '                               '
1328
       db '<- prev                        '
1326
       db '<- prev                        '
1329
       db 'x'
1327
       db 'x'
1330
cdp:
1328
cdp:
1331
 
1329
 
1332
 I_END:
1330
 I_END:
1333
 
1331
 
1334
;>
1332
;>
1335
ret
1333
ret
1336
 
1334
 
1337
 
1335
 
1338
draw_window:
1336
draw_window:
1339
 
1337
 
1340
>
1338
>
1341
 
1339
 
1342
>
1340
>