Subversion Repositories Kolibri OS

Rev

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

Rev 485 Rev 552
1
;   *********************************************
1
;   *********************************************
2
;   *******  DRAW PLAY BAR **********************
2
;   *******  DRAW PLAY BAR **********************
3
;   *********************************************
3
;   *********************************************
4
 
4
 
5
draw_bar:
5
draw_bar:
6
    push eax ebp
6
    push eax ebp
7
    mov  eax,[cur_tick]
7
    mov  eax,[cur_tick]
8
    test eax,eax
8
    test eax,eax
9
    jz   .ex
9
    jz   .ex
10
    mov  ebp,[coo]
10
    mov  ebp,[coo]
11
    mul  dword [ebp-20]
11
    mul  dword [ebp-20]
12
    mov  ebx,[tick_count]
12
    mov  ebx,[tick_count]
13
    test ebx,ebx
13
    test ebx,ebx
14
    jz   .ex
14
    jz   .ex
15
    div  ebx
15
    div  ebx
16
    mov  ebx,[ebp-16]
16
    mov  ebx,[ebp-16]
17
    mov  bx,ax
17
    mov  bx,ax
18
    mov  ecx,[ebp-12]
18
    mov  ecx,[ebp-12]
19
    mov  edx,0x84706a
19
    mov  edx,0x84706a
20
    mov  eax,13
20
    mov  eax,13
21
    mcall
21
    mcall
22
    mov  esi,TOTALTIME_XY
22
    mov  esi,TOTALTIME_XY
23
    mov  eax,[tick_count]
23
    mov  eax,[tick_count]
24
    call draw_total_time
24
    call draw_total_time
25
  .nobar:
25
  .nobar:
26
    mov  esi,[ebp+20]
26
    mov  esi,[ebp+20]
27
    mov  ebx,[ebp+12]
27
    mov  ebx,[ebp+12]
28
    mov  ecx,[ebp+16]
28
    mov  ecx,[ebp+16]
29
    call draw_cur_time
29
    call draw_cur_time
30
    mov  esi,140 shl 16+(WND_HEIGHT-18)
30
    mov  esi,140 shl 16+(WND_HEIGHT-18)
31
    sub  ebx,95 shl 16
31
    sub  ebx,95 shl 16
32
    add  ecx,(WND_HEIGHT-34)shl 16
32
    add  ecx,(WND_HEIGHT-34)shl 16
33
    call draw_cur_time
33
    call draw_cur_time
34
  .ex:
34
  .ex:
35
    pop  ebp eax
35
    pop  ebp eax
36
    ret
36
    ret
37
 
37
 
38
 
38
 
39
 
39
 
40
;   *********************************************
40
;   *********************************************
41
;   *******  Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ *******
41
;   *******  Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ *******
42
;   *********************************************
42
;   *********************************************
43
 
43
 
44
draw_window:
44
draw_window:
45
    mov  eax,12
45
    mov  eax,12
46
    mov  ebx,1
46
    mov  ebx,1
47
    mcall
47
    mcall
48
    or   [flag],FL_BOTTRED
48
    or   [flag],FL_BOTTRED
49
    xor  eax,eax
49
    xor  eax,eax
50
    mov  ebx,100*65536+275
50
    mov  ebx,100*65536+275
51
    mov  ecx,200*65536+WND_HEIGHT
51
    mov  ecx,200*65536+WND_HEIGHT
52
    mov  edi,hdr_raw+12
52
    mov  edi,hdr_raw+8
53
    mov  ebp,[coo]
53
    mov  ebp,[coo]
54
    test [flag],FL_HIDDEN
54
    test [flag],FL_HIDDEN
55
    jz   .nohide1
55
    jz   .nohide1
56
    and  ebx,0xffff
56
    and  ebx,0xffff
57
    and  ecx,0xffff
57
    and  ecx,0xffff
58
    add  edi,275*14*3
58
    add  edi,275*14*3
59
  .nohide1:
59
  .nohide1:
60
    push edi
60
    push edi
61
    mov  edx,WND_BACK
61
    mov  edx,WND_BACK
62
    mov  esi,edx
62
    mov  esi,edx
63
    mov  edi,edx
63
    mov  edi,edx
64
    mcall
64
    mcall
65
    mov  ecx,[channel]
65
    mov  ecx,[channel]
66
    shl  ecx,4
66
    shl  ecx,4
67
    add  cl,[sel_track]
67
    add  cl,[sel_track]
68
    mcall 47,0x20100,,<191,15>,0xf0f000
68
    mcall 47,0x20100,,<191,15>,0xf0f000
69
    movsx ecx,[octave]
69
    movsx ecx,[octave]
70
    add   ecx,100
70
    add   ecx,100
71
    mcall ,0x30000,,<132,15>
71
    mcall ,0x30000,,<132,15>
72
    pop  ebx
72
    pop  ebx
73
    mcall 7,,(275 shl 16+14),0
73
    mcall 7,,(275 shl 16+14),0
74
    mov  esi,0x80ecce7a
74
    mov  esi,0x80ecce7a
75
 
75
 
76
    mov  eax,8
76
    mov  eax,8
77
    mov  ebx,265 shl 16+7
77
    mov  ebx,265 shl 16+7
78
    mov  ecx,3 shl 16+7
78
    mov  ecx,3 shl 16+7
79
    mov  edx,1+1 shl 30
79
    mov  edx,1+1 shl 30
80
    mcall        ; close button
80
    mcall        ; close button
81
    sub  ebx,10 shl 16
81
    sub  ebx,10 shl 16
82
    mov  edx,100+1 shl 30
82
    mov  edx,100+1 shl 30
83
    mcall        ; shade button-101
83
    mcall        ; shade button-101
84
    sub  ebx,10 shl 16
84
    sub  ebx,10 shl 16
85
    add  edx,3
85
    add  edx,3
86
    mcall        ; minimize button-103
86
    mcall        ; minimize button-103
87
    sub  ebx,239 shl 16
87
    sub  ebx,239 shl 16
88
    inc  edx         ; about button-104
88
    inc  edx         ; about button-104
89
    mcall
89
    mcall
90
    xor  esi,esi
90
    xor  esi,esi
91
    xor  edi,edi
91
    xor  edi,edi
92
    mov  ecx,3
92
    mov  ecx,3
93
    pushd [ebp+12]
93
    pushd [ebp+12]
94
    pushd [ebp+16]
94
    pushd [ebp+16]
95
    call draw_navigation
95
    call draw_navigation
96
    add  esp,8
96
    add  esp,8
97
 
97
 
98
    mov  ebx,[ebp-16]
98
    mov  ebx,[ebp-16]
99
    add  ebx,[ebp-20]
99
    add  ebx,[ebp-20]
100
    mov  ecx,[ebp-12]
100
    mov  ecx,[ebp-12]
101
    add  ecx,[ebp-24]
101
    add  ecx,[ebp-24]
102
    mov  esi,0x2c2b46
102
    mov  esi,0x2c2b46
103
    mov  edx,2+1 shl 29
103
    mov  edx,2+1 shl 29
104
    mcall
104
    mcall
105
 
105
 
106
    shr  eax,1
106
    shr  eax,1
107
 
107
 
108
    mov  ecx,12
108
    mov  ecx,12
109
    mov  ebx,FN_XY
109
    mov  ebx,FN_XY
110
    mov  edx,[fn_ptr];I_PARAM;filename
110
    mov  edx,[fn_ptr];I_PARAM;filename
111
    mov  esi,1;[fname_len]
111
    mov  esi,1;[fname_len]
112
    mov  edi,0x00e200
112
    mov  edi,0x00e200
113
  .fnlp:
113
  .fnlp:
114
    push ecx
114
    push ecx
115
    mcall ,,edi
115
    mcall ,,edi
116
    add  ebx,1 shl 16
116
    add  ebx,1 shl 16
117
    mcall
117
    mcall
118
    add  ebx,6 shl 16
118
    add  ebx,6 shl 16
119
    inc  edx
119
    inc  edx
120
    pop  ecx
120
    pop  ecx
121
    loop .fnlp
121
    loop .fnlp
122
    add  ebx,5 shl 16
122
    add  ebx,5 shl 16
123
    mcall ,,0xa0a0a0,text,text_end-text
123
    mcall ,,0xa0a0a0,text,text_end-text
124
    call draw_bar
124
    call draw_bar
125
    call PL_show
125
    call PL_show
126
    test [flag],FL_HIDDEN
126
    test [flag],FL_HIDDEN
127
    jnz  .nohide2
127
    jnz  .nohide2
128
    mov  eax,7
128
    mov  eax,7
129
    mov  ebx,btn_raw+12
129
    mov  ebx,btn_raw+8
130
    mov  ecx,BTNS_SIZE
130
    mov  ecx,BTNS_SIZE
131
    mov  edx,BTNS_XY
131
    mov  edx,BTNS_XY
132
    mcall
132
    mcall
133
  .nohide2:
133
  .nohide2:
134
    mov  esi,FL_SHUFFLE
134
    mov  esi,FL_SHUFFLE
135
    mov  edi,btncoords+8
135
    mov  edi,btncoords+8
136
    mov  eax,13
136
    mov  eax,13
137
    mov  edx,0xd600
137
    mov  edx,0xd600
138
    mov  ecx,2
138
    mov  ecx,2
139
  .loo3:
139
  .loo3:
140
    test [flag],esi
140
    test [flag],esi
141
    je   .el
141
    je   .el
142
    mov  ebx,[edi]
142
    mov  ebx,[edi]
143
    add  ebx,5 shl 16
143
    add  ebx,5 shl 16
144
    add  ebx,[ebp]
144
    add  ebx,[ebp]
145
    mov  bx,3
145
    mov  bx,3
146
    push ecx
146
    push ecx
147
    mov  ecx,[edi+4]
147
    mov  ecx,[edi+4]
148
    add  ecx,4 shl 16
148
    add  ecx,4 shl 16
149
    add  ecx,[ebp+4]
149
    add  ecx,[ebp+4]
150
    mov  cx,2
150
    mov  cx,2
151
    mcall
151
    mcall
152
    pop  ecx
152
    pop  ecx
153
  .el:
153
  .el:
154
    add  edi,8
154
    add  edi,8
155
    inc  esi
155
    inc  esi
156
    loop .loo3
156
    loop .loo3
157
 
157
 
158
  .enddraw:
158
  .enddraw:
159
    mov  eax,12
159
    mov  eax,12
160
    mov  ebx,2
160
    mov  ebx,2
161
    mcall
161
    mcall
162
    ret
162
    ret
163
 
163
 
164
draw_navigation:
164
draw_navigation:
165
; ebp - coordinates
165
; ebp - coordinates
166
    push esi edi ecx
166
    push esi edi ecx
167
    mov  eax,8
167
    mov  eax,8
168
 
168
 
169
    mov  ecx,5
169
    mov  ecx,5
170
    mov  ebx,[ebp]
170
    mov  ebx,[ebp]
171
    add  ebx,[ebp-8]
171
    add  ebx,[ebp-8]
172
    add  ebx,esi
172
    add  ebx,esi
173
    mov  edx,3+1 shl 30
173
    mov  edx,3+1 shl 30
174
  .btnloo:
174
  .btnloo:
175
    push ecx
175
    push ecx
176
    mov  ecx,[ebp+4]
176
    mov  ecx,[ebp+4]
177
    add  ecx,[ebp-4]
177
    add  ecx,[ebp-4]
178
    add  ecx,edi
178
    add  ecx,edi
179
    mcall
179
    mcall
180
    pop  ecx
180
    pop  ecx
181
    add  ebx,[ebp+8]
181
    add  ebx,[ebp+8]
182
    inc  edx
182
    inc  edx
183
    loop .btnloo
183
    loop .btnloo
184
    pop  ecx
184
    pop  ecx
185
 
185
 
186
    lea  edi,[ebp+24]
186
    lea  edi,[ebp+24]
187
  .btnloo2:
187
  .btnloo2:
188
    mov  ebx,[edi]
188
    mov  ebx,[edi]
189
    add  ebx,[ebp]
189
    add  ebx,[ebp]
190
    add  ebx,[esp+4]
190
    add  ebx,[esp+4]
191
    push ecx
191
    push ecx
192
    mov  ecx,[edi+4]
192
    mov  ecx,[edi+4]
193
    add  ecx,[ebp+4]
193
    add  ecx,[ebp+4]
194
    add  ecx,[esp+4]
194
    add  ecx,[esp+4]
195
    mcall
195
    mcall
196
    pop  ecx
196
    pop  ecx
197
    add  edi,8
197
    add  edi,8
198
    inc  edx
198
    inc  edx
199
    loop .btnloo2
199
    loop .btnloo2
200
    pop  edi esi
200
    pop  edi esi
201
    ret
201
    ret
202
 
202
 
203
draw_cur_time:
203
draw_cur_time:
204
    pusha
204
    pusha
205
    mcall 13,,,WND_BACK
205
    mcall 13,,,WND_BACK
206
    mcall 8,,,101+1 shl 29+1 shl 30
206
    mcall 8,,,101+1 shl 29+1 shl 30
207
    mov  ebx,[tick_count]
207
    mov  ebx,[tick_count]
208
    mov  eax,[cur_tick]
208
    mov  eax,[cur_tick]
209
    test [flag],FL_REVERSE
209
    test [flag],FL_REVERSE
210
    jz   .norev
210
    jz   .norev
211
    xchg eax,ebx
211
    xchg eax,ebx
212
    sub  eax,ebx
212
    sub  eax,ebx
213
    lea  ebx,[esi-6 shl 16]
213
    lea  ebx,[esi-6 shl 16]
214
    push eax
214
    push eax
215
    mcall 4,,0xf000,dots+1,1
215
    mcall 4,,0xf000,dots+1,1
216
    pop  eax
216
    pop  eax
217
  .norev:
217
  .norev:
218
    mov  [esp+28],eax
218
    mov  [esp+28],eax
219
    popa
219
    popa
220
draw_total_time:      ; eax -time to show
220
draw_total_time:      ; eax -time to show
221
    pusha
221
    pusha
222
    xor  edx,edx
222
    xor  edx,edx
223
    mov  ebx,100
223
    mov  ebx,100
224
    div  ebx
224
    div  ebx
225
    xor  edx,edx
225
    xor  edx,edx
226
    mov  ebx,60
226
    mov  ebx,60
227
    div  ebx
227
    div  ebx
228
    push edx
228
    push edx
229
    mov  ecx,eax
229
    mov  ecx,eax
230
    mcall 47,0x20000,,esi,0xf000
230
    mcall 47,0x20000,,esi,0xf000
231
    pop  ecx
231
    pop  ecx
232
    add  edx,17 shl 16
232
    add  edx,17 shl 16
233
    mcall
233
    mcall
234
    sub  edx,5 shl 16
234
    sub  edx,5 shl 16
235
    mcall 4,edx,esi,dots,1
235
    mcall 4,edx,esi,dots,1
236
    popa
236
    popa
237
    ret
237
    ret
238
 
238
 
239
BOTT_BTN equ 25 shl 16+18
239
BOTT_BTN equ 25 shl 16+18
240
BOTT_SIZEX equ 25
240
BOTT_SIZEX equ 25
241
BOTT_SIZEY equ 18
241
BOTT_SIZEY equ 18
242
BOTT_S     equ BOTT_SIZEX*BOTT_SIZEY*3
242
BOTT_S     equ BOTT_SIZEX*BOTT_SIZEY*3
243
BOTT_X  equ PL_X
243
BOTT_X  equ PL_X
244
BOTT_Y  equ (WND_HEIGHT-27)
244
BOTT_Y  equ (WND_HEIGHT-27)
245
BOTT_SPACE equ 30 shl 16
245
BOTT_SPACE equ 30 shl 16
246
 
246
 
247
popup db -1
247
popup db -1
248
 
248
 
249
draw_bottom:
249
draw_bottom:
250
    pusha
250
    pusha
251
    mcall 13,175,(BOTT_Y-5)shl 16+24,WND_BACK
251
    mcall 13,175,(BOTT_Y-5)shl 16+24,WND_BACK
252
    add  ebx,(266-30)shl 16-135
252
    add  ebx,(266-30)shl 16-135
253
    mcall
253
    mcall
254
    mov  ecx,5
254
    mov  ecx,5
255
    mov  esi,bot_btn
255
    mov  esi,bot_btn
256
    push esi
256
    push esi
257
    mov  ebx,bottom_raw+12
257
    mov  ebx,bottom_raw+8
258
    xor  eax,eax
258
    xor  eax,eax
259
  .nxt:
259
  .nxt:
260
    push ecx
260
    push ecx
261
    lodsw
261
    lodsw
262
    shl  eax,16
262
    shl  eax,16
263
    lea  edx,[eax+BOTT_Y]
263
    lea  edx,[eax+BOTT_Y]
264
    mcall 7,,BOTT_BTN
264
    mcall 7,,BOTT_BTN
265
    add  ebx,BOTT_S*4
265
    add  ebx,BOTT_S*4
266
    pop  ecx
266
    pop  ecx
267
    cmp  ecx,4
267
    cmp  ecx,4
268
    jne  .noadj
268
    jne  .noadj
269
    add  ebx,BOTT_S
269
    add  ebx,BOTT_S
270
  .noadj:
270
  .noadj:
271
    loop .nxt
271
    loop .nxt
272
    mov  esi,[esp]
272
    mov  esi,[esp]
273
    mov  ecx,5
273
    mov  ecx,5
274
    mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
274
    mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
275
    mov  edx,20+1 shl 30
275
    mov  edx,20+1 shl 30
276
  .nxt2:
276
  .nxt2:
277
    push ecx
277
    push ecx
278
    lodsw
278
    lodsw
279
    shl  eax,16
279
    shl  eax,16
280
    lea  ebx,[eax+BOTT_SIZEX+2 shl 16-3]
280
    lea  ebx,[eax+BOTT_SIZEX+2 shl 16-3]
281
    mcall 8,,ebp
281
    mcall 8,,ebp
282
    inc  edx
282
    inc  edx
283
    pop  ecx
283
    pop  ecx
284
    loop .nxt2
284
    loop .nxt2
285
    pop  esi
285
    pop  esi
286
    call draw_popup
286
    call draw_popup
287
    popa
287
    popa
288
    ret
288
    ret
289
 
289
 
290
draw_popup:
290
draw_popup:
291
    movsx eax,[popup]
291
    movsx eax,[popup]
292
    cmp  eax,0
292
    cmp  eax,0
293
    jge  .ok
293
    jge  .ok
294
    mov  edx,30+1 shl 31
294
    mov  edx,30+1 shl 31
295
    mov  ecx,21
295
    mov  ecx,21
296
    mov  eax,8
296
    mov  eax,8
297
  .clr:
297
  .clr:
298
    mcall
298
    mcall
299
    inc  edx
299
    inc  edx
300
    loop .clr
300
    loop .clr
301
    jmp  .ex
301
    jmp  .ex
302
  .ok:
302
  .ok:
303
    push eax
303
    push eax
304
    lea  edx,[eax+1 shl 31+20]
304
    lea  edx,[eax+1 shl 31+20]
305
    mcall 8
305
    mcall 8
306
    pop  eax
306
    pop  eax
307
    mov  ebx,eax
307
    mov  ebx,eax
308
    shl  eax,2
308
    shl  eax,2
309
    mov  ecx,3
309
    mov  ecx,3
310
    cmp  eax,4
310
    cmp  eax,4
311
    jne  .noadj1
311
    jne  .noadj1
312
    inc  ecx
312
    inc  ecx
313
  .noadj1:
313
  .noadj1:
314
    cmp  eax,8
314
    cmp  eax,8
315
    jb   .noadj2
315
    jb   .noadj2
316
    inc  eax
316
    inc  eax
317
  .noadj2:
317
  .noadj2:
318
    inc  eax
318
    inc  eax
319
    push eax
319
    push eax
320
    movzx edx,word[bot_btn+ebx*2]
320
    movzx edx,word[bot_btn+ebx*2]
321
    shl  edx,16
321
    shl  edx,16
322
    add  edx,BOTT_Y
322
    add  edx,BOTT_Y
323
    push edx
323
    push edx
324
  .noadj3:
324
  .noadj3:
325
    imul ebx,eax,BOTT_S
325
    imul ebx,eax,BOTT_S
326
    add  ebx,bottom_raw+12
326
    add  ebx,bottom_raw+8
327
    push ecx
327
    push ecx
328
  .nxt:
328
  .nxt:
329
    push ecx
329
    push ecx
330
    mcall 7,,BOTT_BTN
330
    mcall 7,,BOTT_BTN
331
    add  ebx,BOTT_S
331
    add  ebx,BOTT_S
332
    sub  edx,BOTT_SIZEY
332
    sub  edx,BOTT_SIZEY
333
    pop  ecx
333
    pop  ecx
334
    loop .nxt
334
    loop .nxt
335
    pop  ecx ebx edx
335
    pop  ecx ebx edx
336
    mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
336
    mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
337
    mov  eax,8
337
    mov  eax,8
338
    add  edx,1 shl 30+30
338
    add  edx,1 shl 30+30
339
    add  ebx,2 shl 16
339
    add  ebx,2 shl 16
340
    mov  bx,BOTT_SIZEX-3
340
    mov  bx,BOTT_SIZEX-3
341
  .nxt2:
341
  .nxt2:
342
    push ecx
342
    push ecx
343
    mcall ,,ebp
343
    mcall ,,ebp
344
    inc  edx
344
    inc  edx
345
    sub  ebp,BOTT_SIZEY shl 16
345
    sub  ebp,BOTT_SIZEY shl 16
346
    pop  ecx
346
    pop  ecx
347
    loop .nxt2
347
    loop .nxt2
348
  .ex:
348
  .ex:
349
    ret
349
    ret
350
 
350
 
351
bot_btn:
351
bot_btn:
352
    dw 10,40,70,100,240
352
    dw 10,40,70,100,240
353
 
353
 
354
about1:
354
about1:
355
  db 13,10,'* MIDAMP for KolibriOS v1.1 by Willow, July 2005 *',13,10,0
355
  db 13,10,'* MIDAMP for KolibriOS v1.1 by Willow, July 2005 *',13,10,0