Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 139
Line 1... Line 1...
1
thread:
1
thread:
-
 
2
        mov     edi, textbox_string
-
 
3
        or      ecx, -1
-
 
4
        xor     eax, eax
-
 
5
        repnz   scasb
-
 
6
        not     ecx
-
 
7
        dec     ecx
-
 
8
        mov     [textbox_position], cl
2
        call    draw_window
9
        call    draw_window
3
        call    main_loop
10
        call    main_loop
4
        mov     [status], ST_EXIT
11
        mov     [status], ST_EXIT
5
        mcall   MF_EXIT
12
        mcall   MF_EXIT
Line 34... Line 41...
34
        cmp     ah, 13
41
        cmp     ah, 13
35
        je      .enter
42
        je      .enter
36
        cmp     ah, 8
43
        cmp     ah, 8
37
        je      .backspace
44
        je      .backspace
38
        movzx   ecx, [textbox_position]
45
        movzx   ecx, [textbox_position]
39
        cmp     ecx, 47
46
        cmp     ecx, 255
40
        jae     .enter
47
        jae     .enter
41
        mov     [textbox_string + ecx], ah
48
        mov     [textbox_string + ecx], ah
42
        inc     [textbox_position]
49
        inc     [textbox_position]
43
        call    textbox_draw
50
        call    textbox_draw
44
        jmp     main_loop
51
        jmp     main_loop
Line 48... Line 55...
48
        jmp     main_loop
55
        jmp     main_loop
49
  .backspace:
56
  .backspace:
50
        movzx   ecx, [textbox_position]
57
        movzx   ecx, [textbox_position]
51
        test    ecx, ecx
58
        test    ecx, ecx
52
        jz      main_loop
59
        jz      main_loop
53
        mov     [textbox_string + ecx], byte 0
-
 
54
        dec     [textbox_position]
60
        dec     [textbox_position]
-
 
61
        mov     [textbox_string + ecx - 1], byte 0
55
        call    textbox_draw
62
        call    textbox_draw
56
        jmp     main_loop
63
        jmp     main_loop
Line 57... Line 64...
57
 
64
 
58
 button:
65
 button:
Line 171... Line 178...
171
        cmp     [status], ST_DONE
178
        cmp     [status], ST_DONE
172
        je      main_loop
179
        je      main_loop
173
        mcall   MF_GETMOUSE, MS_COORDS_WINDOW
180
        mcall   MF_GETMOUSE, MS_COORDS_WINDOW
174
        shr     eax, 16 ; get mouse.x
181
        shr     eax, 16 ; get mouse.x
175
        sub     eax, 7
182
        sub     eax, 7
176
        test    eax, eax
-
 
177
        jz      @f
183
        jz      @f
178
        imul    eax, [file_size]
184
        imul    [file_size]
179
        mov     ebx, 286
185
        mov     ebx, 286
180
        cdq
-
 
181
        div     ebx
186
        div     ebx
182
     @@:
187
     @@:
183
        ;dps "block: "
188
        ;dps "block: "
184
        ;dpd eax
189
        ;dpd eax
185
        ;newline
190
        ;newline
186
        mov     [fileinfo.first_block], eax
191
        mov     [fileinfo.first_byte], eax
187
        call    draw_progress_bar
192
        call    draw_progress_bar
188
        jmp     main_loop
193
        jmp     main_loop
189
ret
194
ret
Line 190... Line 195...
190
 
195
 
Line 242... Line 247...
242
;---------------------------------------------------------------------
247
;---------------------------------------------------------------------
Line 243... Line 248...
243
 
248
 
244
draw_progress_bar:
249
draw_progress_bar:
Line 245... Line 250...
245
        pushad
250
        pushad
246
 
251
 
247
        imul    eax, [fileinfo.first_block], PBAR_WIDTH
252
        mov     eax, PBAR_WIDTH
Line 248... Line 253...
248
        cdq
253
        mul     [fileinfo.first_byte]
249
        div     [file_size]
254
        div     [file_size]
250
 
255
 
Line 264... Line 269...
264
 
269
 
265
sz header,       "AC'97 WAV player -  all PCM audio"
270
sz header,       "AC'97 WAV player -  all PCM audio"
Line 266... Line 271...
266
sz buttons_text, " Play    Stop     <<      >>     Vol-    Vol+"
271
sz buttons_text, " Play    Stop     <<      >>     Vol-    Vol+"
267
 
272
 
268
textbox_active    db 0
273
textbox_active    db 0