Subversion Repositories Kolibri OS

Rev

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

Rev 139 Rev 485
1
key_codes db 27,182,109,115,114,122,98,118,108,120,99,13,8,32,0,    0, 0,0
1
key_codes db 27,182,109,115,114,122,98,118,108,120,99,13,8,32,0,    0, 0,0
2
   db 180,181,93,91
2
   db 180,181,93,91
3
; bottom actions
3
; bottom actions
4
   db  0, 0, 0, 0, 0,185,0, 0, 0, 0,0,0,92
4
   db  0, 0, 0, 0, 0,185,0, 0, 0, 0,0,0,92
5
btn_codes db  1,  0,  0,  9, 10,  3, 7,  6,  8,  4, 5, 0,0, 0,101,100,11,2
5
btn_codes db  1,  0,  0,  9, 10,  3, 7,  6,  8,  4, 5, 0,0, 0,101,100,11,2
6
   db   0,  0, 0, 0
6
   db   0,  0, 0, 0
7
; bottom actions
7
; bottom actions
8
   db 35,49,48,37,31,32,41,42,40,36,103,104,0
8
   db 35,49,48,37,31,32,41,42,40,36,103,104,0
9
jmps dw  _close, kDel,kMute, bList.shuf, bList.repe, bList.prev, bList.next
9
jmps dw  _close, kDel,kMute, bList.shuf, bList.repe, bList.prev, bList.next
10
   dw  bList.stop, kLoad, Xpress, Rewind.space, auto_load,Rewind, Rewind.space
10
   dw  bList.stop, kLoad, Xpress, Rewind.space, auto_load,Rewind, Rewind.space
11
   dw  bReverse, bShade, bList, bBar, bOctU, bOctD, bSelTrack, bSelChannel
11
   dw  bReverse, bShade, bList, bBar, bOctU, bOctD, bSelTrack, bSelChannel
12
; bottom actions
12
; bottom actions
13
   dw kDel,bLsave,bLload,bRemAll,bAdd,bAddDir,bSelZero,bInvSel,bSelAll,bRemCrop
13
   dw kDel,bLsave,bLload,bRemAll,bAdd,bAddDir,bSelZero,bInvSel,bSelAll,bRemCrop
14
   dw  bMinimize,bAbout,bResetTrk
14
   dw  bMinimize,bAbout,bResetTrk
15
 
15
 
16
jmps_end:
16
jmps_end:
17
 
17
 
18
key:
18
key:
19
    mov  eax,2
19
    mov  eax,2
20
    int  0x40
20
    mcall
21
    mov  edi,key_codes
21
    mov  edi,key_codes
22
    cmp  ah,48
22
    cmp  ah,48
23
    jb   .jump
23
    jb   .jump
24
    cmp  ah,57
24
    cmp  ah,57
25
    ja   .jump
25
    ja   .jump
26
    sub  ah,48
26
    sub  ah,48
27
    mov  byte[channel],ah
27
    mov  byte[channel],ah
28
    jmp  midi_kill
28
    jmp  midi_kill
29
  .jump:
29
  .jump:
30
    mov  ecx,(jmps_end-jmps)/2
30
    mov  ecx,(jmps_end-jmps)/2
31
    mov  ebx,edi
31
    mov  ebx,edi
32
    shr  eax,8
32
    shr  eax,8
33
    repne scasb
33
    repne scasb
34
    jne  play_.noplsel
34
    jne  play_.noplsel
35
    sub  edi,ebx
35
    sub  edi,ebx
36
    jmp  word[jmps+edi*2-2]
36
    jmp  word[jmps+edi*2-2]
37
  kDel:
37
  kDel:
38
    call PL_del
38
    call PL_del
39
    call PL_show
39
    call PL_show
40
    jmp  still
40
    jmp  still
41
  kMute:
41
  kMute:
42
    xor  [flag],FL_MUTE
42
    xor  [flag],FL_MUTE
43
    jmp  still
43
    jmp  still
44
  kLoad:
44
  kLoad:
45
;    dps  'Load'
45
;    dps  'Load'
46
    cmp  [list_count],LISTITEMS
46
    cmp  [list_count],LISTITEMS
47
    jbe  noparam
47
    jbe  noparam
48
    jmp  still
48
    jmp  still
49
  Xpress:
49
  Xpress:
50
    mov  eax,IPC_PLAY
50
    mov  eax,IPC_PLAY
51
    call ipc_send
51
    call ipc_send
52
    jmp  still;Rewind.space
52
    jmp  still;Rewind.space
53
 auto_load:
53
 auto_load:
54
    call PL_get1stsel
54
    call PL_get1stsel
55
    mov  eax,ebx
55
    mov  eax,ebx
56
  play_:
56
  play_:
57
    mov  [play_num],eax
57
    mov  [play_num],eax
58
    call PL_getbyindex
58
    call PL_getbyindex
59
    mov  edi,filename;fnbuf
59
    mov  edi,filename;fnbuf
60
    rep  movsb
60
    rep  movsb
61
    xor  eax,eax
61
    xor  eax,eax
62
    mov  byte[edi],al
62
    mov  byte[edi],al
63
    and  [flag],not FL_ADD
63
    and  [flag],not FL_ADD
64
    or   [flag],FL_PLAY
64
    or   [flag],FL_PLAY
65
    jmp  open_file
65
    jmp  open_file
66
  .noplsel:
66
  .noplsel:
67
    call PL_get1stsel
67
    call PL_get1stsel
68
    test ebx,ebx
68
    test ebx,ebx
69
    jz   .noupward
69
    jz   .noupward
70
    cmp  al,178
70
    cmp  al,178
71
    jne  .noupa
71
    jne  .noupa
72
  .seldec:
72
  .seldec:
73
    dec  ebx;[listsel]
73
    dec  ebx;[listsel]
74
  .listdraw:
74
  .listdraw:
75
    call PL_clearsel
75
    call PL_clearsel
76
    mov  eax,ebx
76
    mov  eax,ebx
77
    call PL_getbyindex
77
    call PL_getbyindex
78
    or   word[esi-2],FL_MULSEL
78
    or   word[esi-2],FL_MULSEL
79
    call PL_show
79
    call PL_show
80
    jmp  still
80
    jmp  still
81
  .noupa:
81
  .noupa:
82
    cmp  al,184
82
    cmp  al,184
83
    jne  .noupward
83
    jne  .noupward
84
    dec  [listsel]
84
    dec  [listsel]
85
  .swap:
85
  .swap:
86
    dec  ebx
86
    dec  ebx
87
    call PL_swap
87
    call PL_swap
88
    jmp  .listdraw
88
    jmp  .listdraw
89
  .noupward:
89
  .noupward:
90
    inc  ebx
90
    inc  ebx
91
    cmp  bl,[list_count]
91
    cmp  bl,[list_count]
92
    jae  still
92
    jae  still
93
    cmp  al,177
93
    cmp  al,177
94
    je  .listdraw
94
    je  .listdraw
95
  .nodowna:
95
  .nodowna:
96
    cmp  al,183
96
    cmp  al,183
97
    jne  still
97
    jne  still
98
    inc  [listsel]
98
    inc  [listsel]
99
    jmp  .swap
99
    jmp  .swap
100
  Rewind:
100
  Rewind:
101
    push [midi_limit]
101
    push [midi_limit]
102
    pop  [cur_ptr]
102
    pop  [cur_ptr]
103
    and  [cur_tick],0
103
    and  [cur_tick],0
104
    jmp  red
104
    jmp  red
105
  .space:
105
  .space:
106
    cmp  [tick_count],0
106
    cmp  [tick_count],0
107
    jz   still
107
    jz   still
108
    mov  eax,IPC_TRIG
108
    mov  eax,IPC_TRIG
109
    call ipc_send
109
    call ipc_send
110
    jmp  red
110
    jmp  red
111
 
111
 
112
  button:
112
  button:
113
    mov  eax,17
113
    mov  eax,17
114
    int  0x40
114
    mcall
115
    cmp  ah,20
115
    cmp  ah,20
116
    jb   .nobott
116
    jb   .nobott
117
    cmp  ah,25
117
    cmp  ah,25
118
    ja   .nobott
118
    ja   .nobott
119
    sub  ah,20
119
    sub  ah,20
120
    mov  [popup],ah
120
    mov  [popup],ah
121
  .sh:
121
  .sh:
122
    or   [flag],FL_BOTTRED
122
    or   [flag],FL_BOTTRED
123
    call PL_show
123
    call PL_show
124
    jmp  still
124
    jmp  still
125
  .nobott:
125
  .nobott:
126
    cmp  ah,31
126
    cmp  ah,31
127
    jb   .nopop
127
    jb   .nopop
128
    cmp  ah,50
128
    cmp  ah,50
129
    ja   .nopop
129
    ja   .nopop
130
    mov  [popup],-1
130
    mov  [popup],-1
131
    or   [flag],FL_BOTTRED
131
    or   [flag],FL_BOTTRED
132
    call PL_show
132
    call PL_show
133
 
133
 
134
SH_POPUP equ 10
134
SH_POPUP equ 10
135
  if SH_POPUP eq 1
135
  if SH_POPUP eq 1
136
    mov  ebx,eax
136
    mov  ebx,eax
137
    shr  ebx,8
137
    shr  ebx,8
138
    dps  'Popup#='
138
    dps  'Popup#='
139
    dpd  ebx
139
    dpd  ebx
140
    jmp  .sh
140
    jmp  .sh
141
  end if
141
  end if
142
  .nopop:
142
  .nopop:
143
    mov  edi,btn_codes
143
    mov  edi,btn_codes
144
    jmp  key.jump
144
    jmp  key.jump
145
  bReverse:
145
  bReverse:
146
    xor  [flag],FL_REVERSE
146
    xor  [flag],FL_REVERSE
147
    call draw_bar
147
    call draw_bar
148
    jmp  still
148
    jmp  still
149
  _close:
149
  _close:
150
    call kill
150
    call kill
151
    or   eax,-1
151
    or   eax,-1
152
    int  0x40
152
    mcall
153
 
153
 
154
  bShade:
154
  bShade:
155
    call Shade
155
    call Shade
156
    jmp  still
156
    jmp  still
157
  Shade:
157
  Shade:
158
    xor  [flag],FL_HIDDEN
158
    xor  [flag],FL_HIDDEN
159
    test [flag],FL_HIDDEN
159
    test [flag],FL_HIDDEN
160
    jz  .open
160
    jz  .open
161
    mov  esi,14
161
    mov  esi,14
162
    mov  [coo],main_coo2
162
    mov  [coo],main_coo2
163
    jmp  .op
163
    jmp  .op
164
  .open:
164
  .open:
165
    mov  esi,WND_HEIGHT
165
    mov  esi,WND_HEIGHT
166
    mov  [coo],main_coo
166
    mov  [coo],main_coo
167
  .op:
167
  .op:
168
    mov  ebx,-1
168
    mov  ebx,-1
169
    mov  ecx,ebx
169
    mov  ecx,ebx
170
    mov  edx,ebx
170
    mov  edx,ebx
171
    mov  eax,67
171
    mov  eax,67
172
    int  0x40
172
    mcall
173
    ret
173
    ret
174
  bMinimize:
174
  bMinimize:
175
;    mcall 18,10
175
;    mcall 18,10
176
    jmp  still
176
    jmp  still
177
  bList:
177
  bList:
178
    mov  [popup],-1
178
    mov  [popup],-1
179
    mov  edx,[listsel]
179
    mov  edx,[listsel]
180
    call PL_getitemclick
180
    call PL_getitemclick
181
    mov  [listsel],eax
181
    mov  [listsel],eax
182
    mcall 66,3
182
    mcall 66,3
183
    mov  ebx,eax
183
    mov  ebx,eax
184
;    dph  ebx
184
;    dph  ebx
185
    test ebx,1100b
185
    test ebx,1100b
186
    jnz  .mul
186
    jnz  .mul
187
    call PL_clearsel
187
    call PL_clearsel
188
    test ebx,11b
188
    test ebx,11b
189
    jz   .skipor
189
    jz   .skipor
190
    mov  ecx,[listsel]
190
    mov  ecx,[listsel]
191
    mov  [listsel],edx
191
    mov  [listsel],edx
192
    cmp  ecx,edx
192
    cmp  ecx,edx
193
    je   .skipor
193
    je   .skipor
194
    ja   .above
194
    ja   .above
195
    xchg ecx,edx
195
    xchg ecx,edx
196
  .above:
196
  .above:
197
    sub  ecx,edx
197
    sub  ecx,edx
198
    inc  ecx
198
    inc  ecx
199
    mov  eax,edx
199
    mov  eax,edx
200
    push ecx
200
    push ecx
201
    call PL_getbyindex
201
    call PL_getbyindex
202
    sub  esi,2
202
    sub  esi,2
203
    pop  ecx
203
    pop  ecx
204
    call PL_shiftsel
204
    call PL_shiftsel
205
    jmp  .plsh
205
    jmp  .plsh
206
  .mul:
206
  .mul:
207
    bts  [flag],15
207
    bts  [flag],15
208
    jc   .skipor
208
    jc   .skipor
209
    mov  eax,edx
209
    mov  eax,edx
210
    call PL_getbyindex
210
    call PL_getbyindex
211
    or  word[esi-2],FL_MULSEL
211
    or  word[esi-2],FL_MULSEL
212
  .skipor:
212
  .skipor:
213
    mov  eax,[listsel]
213
    mov  eax,[listsel]
214
    call PL_getbyindex
214
    call PL_getbyindex
215
    xor  word[esi-2],FL_MULSEL
215
    xor  word[esi-2],FL_MULSEL
216
  .plsh:
216
  .plsh:
217
    call PL_show
217
    call PL_show
218
    mcall 40,111b
218
    mcall 40,111b
219
    mcall 23,30
219
    mcall 23,30
220
    push eax
220
    push eax
221
    mcall 40,1000111b
221
    mcall 40,1000111b
222
    pop  eax
222
    pop  eax
223
    cmp  eax,3
223
    cmp  eax,3
224
    jne  still
224
    jne  still
225
    mcall 17
225
    mcall 17
226
    cmp  ah,11
226
    cmp  ah,11
227
    jne  still
227
    jne  still
228
    call PL_getitemclick
228
    call PL_getitemclick
229
    cmp  eax,[listsel]
229
    cmp  eax,[listsel]
230
    je  auto_load
230
    je  auto_load
231
    mov  [listsel],eax
231
    mov  [listsel],eax
232
    call PL_show
232
    call PL_show
233
    jmp  still
233
    jmp  still
234
  .repe:
234
  .repe:
235
    xor  [flag],FL_REPEAT
235
    xor  [flag],FL_REPEAT
236
    jmp  red
236
    jmp  red
237
  .stop:
237
  .stop:
238
    mov  eax,IPC_PAUS
238
    mov  eax,IPC_PAUS
239
    call ipc_send
239
    call ipc_send
240
    jmp  Rewind
240
    jmp  Rewind
241
  .shuf:
241
  .shuf:
242
    xor  [flag],FL_SHUFFLE
242
    xor  [flag],FL_SHUFFLE
243
    jmp  red
243
    jmp  red
244
  .prev:
244
  .prev:
245
    mov  eax,[play_num]
245
    mov  eax,[play_num]
246
    test eax,eax
246
    test eax,eax
247
    jz   still
247
    jz   still
248
    dec  eax
248
    dec  eax
249
    jmp  play_
249
    jmp  play_
250
  .next:
250
  .next:
251
    mov  eax,[play_num]
251
    mov  eax,[play_num]
252
    inc  eax
252
    inc  eax
253
    cmp  al,[list_count]
253
    cmp  al,[list_count]
254
    jae  still
254
    jae  still
255
    jmp  play_
255
    jmp  play_
256
  bBar:
256
  bBar:
257
    cmp  [tick_count],0
257
    cmp  [tick_count],0
258
    jz   still
258
    jz   still
259
    mov  eax,37
259
    mov  eax,37
260
    mov  ebx,1
260
    mov  ebx,1
261
    int  0x40
261
    mcall
262
    mov  ebp,[coo]
262
    mov  ebp,[coo]
263
    sub  eax,[ebp-16]
263
    sub  eax,[ebp-16]
264
    shr  eax,16
264
    shr  eax,16
265
    mov  ebx,[tick_count]
265
    mov  ebx,[tick_count]
266
    mul  ebx
266
    mul  ebx
267
    mov  ebx,[ebp-20]
267
    mov  ebx,[ebp-20]
268
    div  ebx
268
    div  ebx
269
    mov  ebx,eax ; ebx - selected tick
269
    mov  ebx,eax ; ebx - selected tick
270
    xor  ecx,ecx
270
    xor  ecx,ecx
271
    mov  esi,[midi_limit]
271
    mov  esi,[midi_limit]
272
  .further:
272
  .further:
273
    lodsw
273
    lodsw
274
    and  eax,0x7f
274
    and  eax,0x7f
275
    add  ecx,eax
275
    add  ecx,eax
276
    cmp  ecx,ebx
276
    cmp  ecx,ebx
277
    jb   .further
277
    jb   .further
278
    sub  ecx,eax
278
    sub  ecx,eax
279
    mov  [cur_tick],ecx
279
    mov  [cur_tick],ecx
280
    sub  esi,2
280
    sub  esi,2
281
    mov  [cur_ptr],esi
281
    mov  [cur_ptr],esi
282
  drw:
282
  drw:
283
    jmp  red
283
    jmp  red
284
 
284
 
285
OCT_CH equ 3
285
OCT_CH equ 3
286
  bOctU:
286
  bOctU:
287
    add  [octave],OCT_CH
287
    add  [octave],OCT_CH
288
    jmp  midi_kill
288
    jmp  midi_kill
289
  bOctD:
289
  bOctD:
290
    sub  [octave],OCT_CH
290
    sub  [octave],OCT_CH
291
    jmp  midi_kill
291
    jmp  midi_kill
292
  bSelChannel:
292
  bSelChannel:
293
    call get_num
293
    call get_num
294
    cmp  eax,-1
294
    cmp  eax,-1
295
    je   still
295
    je   still
296
    dps  <13,10,'Channel#'>
296
    dps  <13,10,'Channel#'>
297
    dpd  eax
297
    dpd  eax
298
    mov  [channel],eax
298
    mov  [channel],eax
299
    jmp  midi_kill
299
    jmp  midi_kill
300
  bSelTrack:
300
  bSelTrack:
301
    call get_num
301
    call get_num
302
    cmp  eax,-1
302
    cmp  eax,-1
303
    je   still
303
    je   still
304
    dps  <13,10,'Track#'>
304
    dps  <13,10,'Track#'>
305
    dpd  eax
305
    dpd  eax
306
    mov  [sel_track],al
306
    mov  [sel_track],al
307
    jmp  midi_kill
307
    jmp  midi_kill
308
  bResetTrk:
308
  bResetTrk:
309
    xor  eax,eax
309
    xor  eax,eax
310
    mov  [sel_track],al
310
    mov  [sel_track],al
311
    mov  [channel],eax
311
    mov  [channel],eax
312
    dps  <13,10,'Both track & channel are 0',13,10>
312
    dps  <13,10,'Both track & channel are 0',13,10>
313
    jmp  midi_kill
313
    jmp  midi_kill
314
  bLsave:
314
  bLsave:
315
    call PL_save
315
    call PL_save
316
  bLload:
316
  bLload:
317
    call PL_load
317
    call PL_load
318
    jmp  red
318
    jmp  red
319
  bRemAll:
319
  bRemAll:
320
    and  [list_count],0
320
    and  [list_count],0
321
    mov  [play_limit],playlist-2
321
    mov  [play_limit],playlist-2
322
    jmp  red
322
    jmp  red
323
  bAdd:
323
  bAdd:
324
    movzx eax,[list_count]
324
    movzx eax,[list_count]
325
    dpd  eax
325
    dpd  eax
326
    call fopen
326
    call fopen
327
    mov  edi,filename
327
    mov  edi,filename
328
    cmp  byte[edi],0
328
    cmp  byte[edi],0
329
    jz   still
329
    jz   still
330
    call str_len
330
    call str_len
331
    xchg eax,ecx
331
    xchg eax,ecx
332
    mov  esi,edi
332
    mov  esi,edi
333
    jmp  add_song
333
    jmp  add_song
334
  bAddDir:
334
  bAddDir:
335
    call fopen
335
    call fopen
336
    mov  edi,filename
336
    mov  edi,filename
337
    cmp  byte[edi],0
337
    cmp  byte[edi],0
338
    jz   still
338
    jz   still
339
    call find_slash
339
    call find_slash
340
    lea  edx,[edi-filename+fnbuf] ; edx -> '/'
340
    lea  edx,[edi-filename+fnbuf] ; edx -> '/'
341
    and  byte[edi],0
341
    and  byte[edi],0
342
    mov  esi,filename
342
    mov  esi,filename
343
    mov  edi,fnbuf
343
    mov  edi,fnbuf
344
    mov  ecx,1024/4
344
    mov  ecx,1024/4
345
    rep  movsd
345
    rep  movsd
346
        and     dword [dir_info+4], 0
346
        and     dword [dir_info+4], 0
347
  .nxt2:
347
  .nxt2:
348
        mcall   70, dir_info
348
        mcall   70, dir_info
349
        cmp     ebx, 1
349
        cmp     ebx, 1
350
        jnz     red ;still
350
        jnz     red ;still
351
        test    byte [dir_table+32], 11000b     ; exclude directories & vol label
351
        test    byte [dir_table+32], 11000b     ; exclude directories & vol label
352
        jnz     .no
352
        jnz     .no
353
        mov     edi, dir_table+32+40
353
        mov     edi, dir_table+32+40
354
        mov     esi, edi
354
        mov     esi, edi
355
        xor     eax, eax
355
        xor     eax, eax
356
        or      ecx, -1
356
        or      ecx, -1
357
        repnz   scasb
357
        repnz   scasb
358
        mov     eax, [edi-5]
358
        mov     eax, [edi-5]
359
        or      eax, 0x20202000
359
        or      eax, 0x20202000
360
        cmp     eax, '.mid'
360
        cmp     eax, '.mid'
361
        jz      .ok
361
        jz      .ok
362
        cmp     eax, '.kar'
362
        cmp     eax, '.kar'
363
        jnz     .no
363
        jnz     .no
364
.ok:
364
.ok:
365
        lea     ecx, [edi-dir_table-32-40-1]
365
        lea     ecx, [edi-dir_table-32-40-1]
366
        mov     edi, edx
366
        mov     edi, edx
367
        rep     movsb
367
        rep     movsb
368
        mov     ecx, edi
368
        mov     ecx, edi
369
        mov     esi, fnbuf
369
        mov     esi, fnbuf
370
        sub     ecx, esi
370
        sub     ecx, esi
371
        call    PL_add
371
        call    PL_add
372
.no:
372
.no:
373
        inc     dword [dir_info+4]
373
        inc     dword [dir_info+4]
374
        jmp     .nxt2
374
        jmp     .nxt2
375
  bSelZero:
375
  bSelZero:
376
    call PL_clearsel
376
    call PL_clearsel
377
    jmp  red
377
    jmp  red
378
  bInvSel:
378
  bInvSel:
379
    call PL_invsel
379
    call PL_invsel
380
    jmp  red
380
    jmp  red
381
  bSelAll:
381
  bSelAll:
382
    call PL_clearsel
382
    call PL_clearsel
383
    call PL_invsel
383
    call PL_invsel
384
    jmp  red
384
    jmp  red
385
  bRemCrop:
385
  bRemCrop:
386
    call PL_invsel
386
    call PL_invsel
387
    call PL_del
387
    call PL_del
388
    jmp  bSelAll
388
    jmp  bSelAll
389
  bAbout:
389
  bAbout:
390
    mov  edx,about1
390
    mov  edx,about1
391
    call debug_outstr
391
    call debug_outstr
392
    jmp  still
392
    jmp  still
393
 
393
 
394
get_num:  ; out: eax-number entered
394
get_num:  ; out: eax-number entered
395
    or   [flag],FL_LOCK
395
    or   [flag],FL_LOCK
396
    mcall 10
396
    mcall 10
397
    dpd  eax
397
    dpd  eax
398
    cmp  eax,1
398
    cmp  eax,1
399
    jne  .nored
399
    jne  .nored
400
    call draw_window
400
    call draw_window
401
    jmp  get_num
401
    jmp  get_num
402
  .nored:
402
  .nored:
403
    cmp  eax,2
403
    cmp  eax,2
404
    jne  .nokey
404
    jne  .nokey
405
    mcall 2
405
    mcall 2
406
    movzx eax,ah
406
    movzx eax,ah
407
    sub  eax,'0'
407
    sub  eax,'0'
408
    jl   .none
408
    jl   .none
409
    cmp  eax,9
409
    cmp  eax,9
410
    jbe  .ok
410
    jbe  .ok
411
  .none:
411
  .none:
412
    mov  eax,-1
412
    mov  eax,-1
413
  .ok:
413
  .ok:
414
    and  [flag],not FL_LOCK
414
    and  [flag],not FL_LOCK
415
    ret
415
    ret
416
  .nokey:
416
  .nokey:
417
    cmp  eax,3
417
    cmp  eax,3
418
    jne  get_num
418
    jne  get_num
419
    mcall 17
419
    mcall 17
420
    jmp  get_num
420
    jmp  get_num
421
 
421
 
422
find_slash:
422
find_slash:
423
; in: edi-filename, out: edi-slash ptr-1
423
; in: edi-filename, out: edi-slash ptr-1
424
    push eax ecx
424
    push eax ecx
425
    call str_len
425
    call str_len
426
    mov  ecx,eax
426
    mov  ecx,eax
427
    std
427
    std
428
    add  edi,eax
428
    add  edi,eax
429
    mov  al,'/'
429
    mov  al,'/'
430
    repne scasb
430
    repne scasb
431
    cld
431
    cld
432
    add  edi,2
432
    add  edi,2
433
    pop  ecx eax
433
    pop  ecx eax
434
    ret
434
    ret