Subversion Repositories Kolibri OS

Rev

Rev 8524 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8524 Rev 9587
1
;   MENUET FAR [MFAR] PRE-ALPHA-8.1
1
;   MENUET FAR [MFAR] PRE-ALPHA-8.1
2
;   2003-2004 (C) Mike Semenyako aka mike.dld
2
;   2003-2004 (C) Mike Semenyako aka mike.dld
3
;   Compile with FASM for Menuet
3
;   Compile with FASM for Menuet
4
 
4
 
5
use32
5
use32
6
org 0
6
org 0
7
 
7
 
8
  db 'MENUET01' ; 8 byte id
8
  db 'MENUET01' ; 8 byte id
9
  dd $01        ; header version
9
  dd $01        ; header version
10
  dd START      ; start of code
10
  dd START      ; start of code
11
  dd I_END      ; size of image
11
  dd I_END      ; size of image
12
  dd MEM_USED   ; memory for app
12
  dd MEM_USED   ; memory for app
13
  dd $007FF0    ; esp
13
  dd $007FF0    ; esp
14
  dd $00,$00    ; I_Param , I_Icon
14
  dd $00,$00    ; I_Param , I_Icon
15
 
15
 
16
;
16
;
17
;     START:SIZE
17
;     START:SIZE
18
;
18
;
19
; +00000000:00007FF0 - image
19
; +00000000:00007FF0 - image
20
; +00007FF0:00007FF0 - stack
20
; +00007FF0:00007FF0 - stack
21
; +00008000:00000300 - path strings buffer
21
; +00008000:00000300 - path strings buffer
22
; +00008300:0003FD00 - files data
22
; +00008300:0003FD00 - files data
23
; +00048000:00000300 - temporary file read area
23
; +00048000:00000300 - temporary file read area
24
; +00048300:00004000 - memory for OS (read/write buffer)
24
; +00048300:00004000 - memory for OS (read/write buffer)
25
; +0004C300:FFFB3CFF - dinamically allocated for copy, view, edit etc.
25
; +0004C300:FFFB3CFF - dinamically allocated for copy, view, edit etc.
26
;
26
;
27
 
27
 
28
include 'macros.inc'
28
include 'macros.inc'
29
include 'menuet.inc'
29
include 'menuet.inc'
30
include 'mfar.inc'
30
include 'mfar.inc'
31
 
31
 
32
START:
32
START:
33
 
33
 
34
        mcall   MF_RDREADFILE,fcfile,0,-1,fc ; read user colors
34
        mcall   MF_RDREADFILE,fcfile,0,-1,fc ; read user colors
35
 
35
 
36
        mov     esi,p_rd                ; left panel = RD
36
        mov     esi,p_rd                ; left panel = RD
37
        mov     edi,f_path0
37
        mov     edi,f_path0
38
        mov     ecx,p_rd.size
38
        mov     ecx,p_rd.size
39
        rep     movsb
39
        rep     movsb
40
        mov     esi,p_hd                ; right panel = HD
40
        mov     esi,p_hd                ; right panel = HD
41
        mov     edi,f_path1
41
        mov     edi,f_path1
42
        mov     ecx,p_hd.size
42
        mov     ecx,p_hd.size
43
        rep     movsb
43
        rep     movsb
44
 
44
 
45
redraw_all:
45
redraw_all:
46
        call    draw_window_full
46
        call    draw_window_full
47
        jmp     still
47
        jmp     still
48
redraw_files:
48
redraw_files:
49
        call    draw_files
49
        call    draw_files
50
still:
50
still:
51
        mcall   MF_WAITEVWTO,100        ; waiting 1 sec
51
        mcall   MF_WAITEVWTO,100        ; waiting 1 sec
52
        jmpe    al,,\
52
        jmpe    al,,\
53
          EV_REDRAW,redraw_all,\
53
          EV_REDRAW,redraw_all,\
54
          EV_KEY,key,\
54
          EV_KEY,key,\
55
          EV_BUTTON,button
55
          EV_BUTTON,button
56
 
56
 
57
;  after every 1 second [when no other events occur] updating files info
57
;  after every 1 second [when no other events occur] updating files info
58
;  eg. requesting ACTIVE panel files data and drawing it
58
;  eg. requesting ACTIVE panel files data and drawing it
59
;; timed redraw {
59
;; timed redraw {
60
        mov     dl,[active_panel]
60
        mov     dl,[active_panel]
61
        cmp     dl,0
61
        cmp     dl,0
62
        jne    ._00
62
        jne    ._00
63
        push    [d_ltsz]
63
        push    [d_ltsz]
64
        jmp     @f
64
        jmp     @f
65
   ._00:
65
   ._00:
66
        push    [d_rtsz]
66
        push    [d_rtsz]
67
    @@:
67
    @@:
68
        call    get_files_data
68
        call    get_files_data
69
        pop     eax
69
        pop     eax
70
        cmp     dl,0
70
        cmp     dl,0
71
        jne    ._01
71
        jne    ._01
72
        cmp     eax,[d_ltsz]
72
        cmp     eax,[d_ltsz]
73
        jmp     @f
73
        jmp     @f
74
   ._01:
74
   ._01:
75
        cmp     eax,[d_rtsz]
75
        cmp     eax,[d_rtsz]
76
    @@:
76
    @@:
77
        je      still                   ; nothing happened, waiting again
77
        je      still                   ; nothing happened, waiting again
78
        mov     al,dl
78
        mov     al,dl
79
        jmp     redraw_files
79
        jmp     redraw_files
80
;; }
80
;; }
81
 
81
 
82
; key pressed event
82
; key pressed event
83
 key:
83
 key:
84
        mcall   MF_GETKEY               ; get key-code
84
        mcall   MF_GETKEY               ; get key-code
85
 
85
 
86
        movzx   ecx,[active_panel]
86
        movzx   ecx,[active_panel]
87
 
87
 
88
        jmpe    ah,k_directional,\
88
        jmpe    ah,k_directional,\
89
          VK_RETURN,k_return,\          ; execute something
89
          VK_RETURN,k_return,\          ; execute something
90
          VK_TAB,k_tab,\                ; change active panel
90
          VK_TAB,k_tab,\                ; change active panel
91
          VK_F5,k_f5,\                  ; copy
91
          VK_F5,k_f5,\                  ; copy
92
          VK_F10,mfar_exit,\            ; terminate
92
          VK_F10,mfar_exit,\            ; terminate
93
          VK_CTRLF3,k_ctrl_f3,\         ; sort by name
93
          VK_CTRLF3,k_ctrl_f3,\         ; sort by name
94
          VK_CTRLF4,k_ctrl_f4           ; sort by extension
94
          VK_CTRLF4,k_ctrl_f4           ; sort by extension
95
;------------------------------------------------------------------------------
95
;------------------------------------------------------------------------------
96
  k_return:
96
  k_return:
97
        call    execute_current_file
97
        call    execute_current_file
98
        jmp     still
98
        jmp     still
99
;------------------------------------------------------------------------------
99
;------------------------------------------------------------------------------
100
  k_tab:
100
  k_tab:
101
        mov     edi,[fc.background]
101
        mov     edi,[fc.background]
102
        call    draw_sel                ; hide current file selection
102
        call    draw_sel                ; hide current file selection
103
        xor     [active_panel],1        ; changing active panel
103
        xor     [active_panel],1        ; changing active panel
104
        call    draw_path               ; drawing path of new panel
104
        call    draw_path               ; drawing path of new panel
105
        mov     dl,[active_panel]
105
        mov     dl,[active_panel]
106
        call    get_files_data          ; requesting panel files info
106
        call    get_files_data          ; requesting panel files info
107
        mov     edi,sel_color
107
        mov     edi,sel_color
108
        call    draw_sel                ; show current file
108
        call    draw_sel                ; show current file
109
        mov     al,[active_panel]
109
        mov     al,[active_panel]
110
        call    draw_file_info          ; and its info (size,date)
110
        call    draw_file_info          ; and its info (size,date)
111
        jmp     still
111
        jmp     still
112
;------------------------------------------------------------------------------
112
;------------------------------------------------------------------------------
113
  k_f5:
113
  k_f5:
114
        call    copy_file
114
        call    copy_file
115
        jc      still
115
        jc      still
116
        jmp     redraw_all
116
        jmp     redraw_all
117
;------------------------------------------------------------------------------
117
;------------------------------------------------------------------------------
118
  k_ctrl_f3:
118
  k_ctrl_f3:
119
        jecxz  ._00
119
        jecxz  ._00
120
        cmp     [r_sort],0
120
        cmp     [r_sort],0
121
        je      still
121
        je      still
122
        mov     [r_sort],0
122
        mov     [r_sort],0
123
        jmp     @f
123
        jmp     @f
124
   ._00:
124
   ._00:
125
        cmp     [l_sort],0
125
        cmp     [l_sort],0
126
        je      still
126
        je      still
127
        mov     [l_sort],0
127
        mov     [l_sort],0
128
    @@:
128
    @@:
129
        mov     al,cl
129
        mov     al,cl
130
        call    mfar_sort
130
        call    mfar_sort
131
        jmp     redraw_files
131
        jmp     redraw_files
132
;------------------------------------------------------------------------------
132
;------------------------------------------------------------------------------
133
  k_ctrl_f4:
133
  k_ctrl_f4:
134
        jecxz  ._00
134
        jecxz  ._00
135
        cmp     [r_sort],1
135
        cmp     [r_sort],1
136
        je      still
136
        je      still
137
        mov     [r_sort],1
137
        mov     [r_sort],1
138
        jmp     @f
138
        jmp     @f
139
   ._00:
139
   ._00:
140
        cmp     [l_sort],1
140
        cmp     [l_sort],1
141
        je      still
141
        je      still
142
        mov     [l_sort],1
142
        mov     [l_sort],1
143
    @@:
143
    @@:
144
        mov     al,al
144
        mov     al,al
145
        call    mfar_sort
145
        call    mfar_sort
146
        jmp     redraw_files
146
        jmp     redraw_files
147
;------------------------------------------------------------------------------
147
;------------------------------------------------------------------------------
148
  k_directional:
148
  k_directional:
149
        cmp     ah,VK_LEFT              ; non-directional keys ?
149
        cmp     ah,VK_LEFT              ; non-directional keys ?
150
        jb      still                   ; ignore them
150
        jb      still                   ; ignore them
151
        cmp     ah,VK_END
151
        cmp     ah,VK_END
152
        ja      still
152
        ja      still
153
        jecxz  ._00
153
        jecxz  ._00
154
        mov     edx,[d_rpos]
154
        mov     edx,[d_rpos]
155
        mov     ebx,[d_rtop]
155
        mov     ebx,[d_rtop]
156
        mov     esi,[d_rcnt]
156
        mov     esi,[d_rcnt]
157
        jmp     @f
157
        jmp     @f
158
   ._00:
158
   ._00:
159
        mov     edx,[d_lpos]
159
        mov     edx,[d_lpos]
160
        mov     ebx,[d_ltop]
160
        mov     ebx,[d_ltop]
161
        mov     esi,[d_lcnt]
161
        mov     esi,[d_lcnt]
162
    @@:
162
    @@:
163
        xor     ebp,ebp                 ; redraw whole panel [0-no, 1-yes]
163
        xor     ebp,ebp                 ; redraw whole panel [0-no, 1-yes]
164
;------------------------------------------------------------------------------
164
;------------------------------------------------------------------------------
165
        jmpe    ah,show_cur,\
165
        jmpe    ah,show_cur,\
166
          VK_LEFT,k_left,\
166
          VK_LEFT,k_left,\
167
          VK_DOWN,k_down,\
167
          VK_DOWN,k_down,\
168
          VK_UP,k_up,\
168
          VK_UP,k_up,\
169
          VK_RIGHT,k_right,\
169
          VK_RIGHT,k_right,\
170
          VK_HOME,k_home,\
170
          VK_HOME,k_home,\
171
          VK_END,k_end
171
          VK_END,k_end
172
  k_left:
172
  k_left:
173
        cmp     edx,0
173
        cmp     edx,0
174
        je      still
174
        je      still
175
        sub     edx,FPC
175
        sub     edx,FPC
176
        jge     @f
176
        jge     @f
177
        xor     edx,edx
177
        xor     edx,edx
178
    @@:
178
    @@:
179
        mov     eax,edx
179
        mov     eax,edx
180
        sub     eax,ebx
180
        sub     eax,ebx
181
        jge     show_cur
181
        jge     show_cur
182
        inc     ebp
182
        inc     ebp
183
        sub     ebx,FPC
183
        sub     ebx,FPC
184
        jge     show_cur
184
        jge     show_cur
185
        xor     ebx,ebx
185
        xor     ebx,ebx
186
        jmp     show_cur
186
        jmp     show_cur
187
;------------------------------------------------------------------------------
187
;------------------------------------------------------------------------------
188
  k_down:
188
  k_down:
189
        lea     eax,[esi-1]
189
        lea     eax,[esi-1]
190
        cmp     edx,eax
190
        cmp     edx,eax
191
        je      still
191
        je      still
192
        inc     edx
192
        inc     edx
193
        mov     eax,edx
193
        mov     eax,edx
194
        sub     eax,ebx
194
        sub     eax,ebx
195
        cmp     eax,FPC*3-1
195
        cmp     eax,FPC*3-1
196
        jle     show_cur
196
        jle     show_cur
197
        inc     ebp
197
        inc     ebp
198
        inc     ebx
198
        inc     ebx
199
        jmp     show_cur
199
        jmp     show_cur
200
;------------------------------------------------------------------------------
200
;------------------------------------------------------------------------------
201
  k_up:
201
  k_up:
202
        cmp     edx,0
202
        cmp     edx,0
203
        je      still
203
        je      still
204
        dec     edx
204
        dec     edx
205
        mov     eax,ebx
205
        mov     eax,ebx
206
        cmp     edx,eax
206
        cmp     edx,eax
207
        jge     show_cur
207
        jge     show_cur
208
        inc     ebp
208
        inc     ebp
209
        dec     ebx
209
        dec     ebx
210
        jmp     show_cur
210
        jmp     show_cur
211
;------------------------------------------------------------------------------
211
;------------------------------------------------------------------------------
212
  k_right:
212
  k_right:
213
        lea     eax,[esi-1]
213
        lea     eax,[esi-1]
214
        cmp     edx,eax
214
        cmp     edx,eax
215
        je      still
215
        je      still
216
        add     edx,FPC
216
        add     edx,FPC
217
        cmp     edx,eax
217
        cmp     edx,eax
218
        jle     @f
218
        jle     @f
219
        mov     edx,eax
219
        mov     edx,eax
220
    @@:
220
    @@:
221
        mov     eax,edx
221
        mov     eax,edx
222
        sub     eax,ebx
222
        sub     eax,ebx
223
        cmp     eax,FPC*3-1
223
        cmp     eax,FPC*3-1
224
        jle     show_cur
224
        jle     show_cur
225
        inc     ebp
225
        inc     ebp
226
        add     ebx,FPC
226
        add     ebx,FPC
227
        jmp     show_cur
227
        jmp     show_cur
228
;------------------------------------------------------------------------------
228
;------------------------------------------------------------------------------
229
  k_home:
229
  k_home:
230
        cmp     edx,0
230
        cmp     edx,0
231
        je      still
231
        je      still
232
        inc     ebp
232
        inc     ebp
233
        xor     edx,edx
233
        xor     edx,edx
234
        xor     ebx,ebx
234
        xor     ebx,ebx
235
        jmp     show_cur
235
        jmp     show_cur
236
;------------------------------------------------------------------------------
236
;------------------------------------------------------------------------------
237
  k_end:
237
  k_end:
238
        lea     eax,[esi-1]
238
        lea     eax,[esi-1]
239
        cmp     edx,eax
239
        cmp     edx,eax
240
        je      still
240
        je      still
241
        mov     edx,eax
241
        mov     edx,eax
242
        mov     edi,eax
242
        mov     edi,eax
243
        sub     edi,ebx
243
        sub     edi,ebx
244
        cmp     edi,FPC*3-1
244
        cmp     edi,FPC*3-1
245
        jle     show_cur
245
        jle     show_cur
246
        inc     ebp
246
        inc     ebp
247
        sub     eax,FPC*3-1
247
        sub     eax,FPC*3-1
248
        mov     ebx,eax
248
        mov     ebx,eax
249
;------------------------------------------------------------------------------
249
;------------------------------------------------------------------------------
250
 
250
 
251
  show_cur:
251
  show_cur:
252
 
252
 
253
        mov     edi,[fc.background]
253
        mov     edi,[fc.background]
254
        call    draw_sel
254
        call    draw_sel
255
 
255
 
256
        jecxz  ._00
256
        jecxz  ._00
257
        mov     [d_rpos],edx
257
        mov     [d_rpos],edx
258
        mov     [d_rtop],ebx
258
        mov     [d_rtop],ebx
259
        jmp     @f
259
        jmp     @f
260
   ._00:
260
   ._00:
261
        mov     [d_lpos],edx
261
        mov     [d_lpos],edx
262
        mov     [d_ltop],ebx
262
        mov     [d_ltop],ebx
263
    @@:
263
    @@:
264
 
264
 
265
        cmp     ebp,0
265
        cmp     ebp,0
266
        mov     al,cl
266
        mov     al,cl
267
        jne     redraw_files
267
        jne     redraw_files
268
 
268
 
269
        mov     edi,[fc.selection]
269
        mov     edi,[fc.selection]
270
        call    draw_sel
270
        call    draw_sel
271
        call    draw_file_info
271
        call    draw_file_info
272
        jmp     still
272
        jmp     still
273
 
273
 
274
  button:
274
  button:
275
        mcall   MF_GETPRSDBTNID
275
        mcall   MF_GETPRSDBTNID
276
        cmp     ah,1
276
        cmp     ah,1
277
        jne     noclose
277
        jne     noclose
278
 
278
 
279
  mfar_exit:
279
  mfar_exit:
280
        mcall   MF_RDDELFILE,fcfile             ; delete existing mfar.dat
280
        mcall   MF_RDDELFILE,fcfile             ; delete existing mfar.dat
281
        mcall   MF_RDWRITEFILE,fcfile,fc,12*4,0 ; create new mfar.dat
281
        mcall   MF_RDWRITEFILE,fcfile,fc,12*4,0 ; create new mfar.dat
282
 
282
 
283
        mcall   MF_TERMINATE                    ; close program
283
        mcall   MF_TERMINATE                    ; close program
284
  noclose:
284
  noclose:
285
        jmp     still
285
        jmp     still
286
 
286
 
287
;------------------------------------------------------------------------------
287
;------------------------------------------------------------------------------
288
;///// DRAW WINDOW ////////////////////////////////////////////////////////////
288
;///// DRAW WINDOW ////////////////////////////////////////////////////////////
289
;------------------------------------------------------------------------------
289
;------------------------------------------------------------------------------
290
 
290
 
291
func draw_window
291
func draw_window
292
        mcall   MF_WINPROPS,WP_GETSYSCLRS,sc,sizeof.system_colors
292
        mcall   MF_WINPROPS,WP_GETSYSCLRS,sc,sizeof.system_colors
293
 
293
 
294
        mcall   MF_WNDDRAW,WD_BEGINDRAW
294
        mcall   MF_WNDDRAW,WD_BEGINDRAW
295
        mov     edx,[fc.background]
295
        mov     edx,[fc.background]
296
        or      edx,$14000000
296
        or      edx,$14000000
297
		mov     edi,caption
297
		mov     edi,caption
298
        mcall2  MF_DEFWINDOW,90,oX+tW*80+4,45,oY+tH*25+4
298
        mcall2  MF_DEFWINDOW,90,oX+tW*80+4,45,oY+tH*25+4
299
 
299
 
300
        mmov    esi,oX+2,oX+tW*39+2
300
        mmov    esi,oX+2,oX+tW*39+2
301
        mmov    edi,oY+3,oY+tH*22+3
301
        mmov    edi,oY+3,oY+tH*22+3
302
        mov     edx,[fc.default]
302
        mov     edx,[fc.default]
303
        call    draw_frame
303
        call    draw_frame
304
        mmov    esi,oX+tW*40+2,oX+tW*79+2
304
        mmov    esi,oX+tW*40+2,oX+tW*79+2
305
        call    draw_frame
305
        call    draw_frame
306
 
306
 
307
        mcall2  MF_DRAWLINE,oX+tW*13+2,oX+tW*13+2,oY+tH,oY+tH*20+3
307
        mcall2  MF_DRAWLINE,oX+tW*13+2,oX+tW*13+2,oY+tH,oY+tH*20+3
308
        madd    ebx,tW*13,tW*13
308
        madd    ebx,tW*13,tW*13
309
        mcall
309
        mcall
310
        mcall2  ,oX+3,oX+tW*39+1,oY+tH*20+3,oY+tH*20+3
310
        mcall2  ,oX+3,oX+tW*39+1,oY+tH*20+3,oY+tH*20+3
311
        mcall2  ,oX+tW*53+2,oX+tW*53+2,oY+tH,oY+tH*20+3
311
        mcall2  ,oX+tW*53+2,oX+tW*53+2,oY+tH,oY+tH*20+3
312
        madd    ebx,tW*13,tW*13
312
        madd    ebx,tW*13,tW*13
313
        mcall
313
        mcall
314
        mcall2  ,oX+tW*40+3,oX+tW*79+1,oY+tH*20+3,oY+tH*20+3
314
        mcall2  ,oX+tW*40+3,oX+tW*79+1,oY+tH*20+3,oY+tH*20+3
315
 
315
 
316
        mcall1  MF_DRAWTEXT,oX+tW*5,oY+tH,$00ffff00,lname,lname.size
316
        mcall1  MF_DRAWTEXT,oX+tW*5,oY+tH,$00ffff00,lname,lname.size
317
        mcall1  ,oX+tW*18,oY+tH
317
        mcall1  ,oX+tW*18,oY+tH
318
        mcall1  ,oX+tW*31,oY+tH
318
        mcall1  ,oX+tW*31,oY+tH
319
        mcall1  ,oX+tW*45,oY+tH
319
        mcall1  ,oX+tW*45,oY+tH
320
        mcall1  ,oX+tW*58,oY+tH
320
        mcall1  ,oX+tW*58,oY+tH
321
        mcall1  ,oX+tW*71,oY+tH
321
        mcall1  ,oX+tW*71,oY+tH
322
 
322
 
323
        movzx   edi,[l_sort]
323
        movzx   edi,[l_sort]
324
        lea     edx,[edi+sort_kind]
324
        lea     edx,[edi+sort_kind]
325
        mcall1  ,oX+tW,oY+tH,$00ffff00,,1
325
        mcall1  ,oX+tW,oY+tH,$00ffff00,,1
326
        movzx   edi,[r_sort]
326
        movzx   edi,[r_sort]
327
        lea     edx,[edi+sort_kind]
327
        lea     edx,[edi+sort_kind]
328
        mcall1  ,oX+tW*41,oY+tH
328
        mcall1  ,oX+tW*41,oY+tH
329
 
329
 
330
        call    draw_path
330
        call    draw_path
331
        call    draw_bottom_keys
331
        call    draw_bottom_keys
332
 
332
 
333
        mcall   MF_WNDDRAW,WD_ENDDRAW
333
        mcall   MF_WNDDRAW,WD_ENDDRAW
334
        ret
334
        ret
335
endf
335
endf
336
 
336
 
337
;------------------------------------------------------------------------------
337
;------------------------------------------------------------------------------
338
;//////////////////////////////////////////////////////////////////////////////
338
;//////////////////////////////////////////////////////////////////////////////
339
;------------------------------------------------------------------------------
339
;------------------------------------------------------------------------------
340
 
340
 
341
func draw_window_full
341
func draw_window_full
342
        call    draw_window
342
        call    draw_window
343
        mov     edx,1
343
        mov     edx,1
344
        call    get_files_data
344
        call    get_files_data
345
        mov     al,1
345
        mov     al,1
346
        call    draw_files
346
        call    draw_files
347
        mov     edx,0
347
        mov     edx,0
348
        call    get_files_data
348
        call    get_files_data
349
        mov     al,0
349
        mov     al,0
350
        call    draw_files
350
        call    draw_files
351
        ret
351
        ret
352
endf
352
endf
353
 
353
 
354
;------------------------------------------------------------------------------
354
;------------------------------------------------------------------------------
355
;//////////////////////////////////////////////////////////////////////////////
355
;//////////////////////////////////////////////////////////////////////////////
356
;------------------------------------------------------------------------------
356
;------------------------------------------------------------------------------
357
 
357
 
358
align 4
358
align 4
359
len dd ?
359
len dd ?
360
 
360
 
361
func get_normal_path
361
func get_normal_path
362
        pusha
362
        pusha
363
        mov     ecx,5
363
        mov     ecx,5
364
        rep     movsb
364
        rep     movsb
365
        dec     esi
365
        dec     esi
366
        dec     edi
366
        dec     edi
367
        mov     ecx,5
367
        mov     ecx,5
368
        push    eax
368
        push    eax
369
    @@:
369
    @@:
370
        dec     dword[esp]
370
        dec     dword[esp]
371
        jz      @f
371
        jz      @f
372
        lodsb
372
        lodsb
373
        cmp     al,0
373
        cmp     al,0
374
        je      @b
374
        je      @b
375
        cmp     al,' '
375
        cmp     al,' '
376
        je      @b
376
        je      @b
377
        stosb
377
        stosb
378
        inc     ecx
378
        inc     ecx
379
        jmp     @b
379
        jmp     @b
380
    @@:
380
    @@:
381
        pop     eax
381
        pop     eax
382
        mov     byte[edi],'>'
382
        mov     byte[edi],'>'
383
        mov     [len],ecx
383
        mov     [len],ecx
384
        popa
384
        popa
385
        ret
385
        ret
386
endf
386
endf
387
 
387
 
388
;------------------------------------------------------------------------------
388
;------------------------------------------------------------------------------
389
;//////////////////////////////////////////////////////////////////////////////
389
;//////////////////////////////////////////////////////////////////////////////
390
;------------------------------------------------------------------------------
390
;------------------------------------------------------------------------------
391
 
391
 
392
; EAX = length needed
392
; EAX = length needed
393
; ECX = current length
393
; ECX = current length
394
; EDI = path string
394
; EDI = path string
395
func get_path_ellipses
395
func get_path_ellipses
396
        cmp     ecx,eax
396
        cmp     ecx,eax
397
        jbe     @f
397
        jbe     @f
398
        pushad
398
        pushad
399
        lea     esi,[edi+ecx+3+6]       ; ... + /??/?/
399
        lea     esi,[edi+ecx+3+6]       ; ... + /??/?/
400
        sub     esi,eax
400
        sub     esi,eax
401
        add     ecx,edi
401
        add     ecx,edi
402
        sub     ecx,esi
402
        sub     ecx,esi
403
        mov     dword[edi+6],'... '
403
        mov     dword[edi+6],'... '
404
        add     edi,9
404
        add     edi,9
405
        cld
405
        cld
406
        rep     movsb
406
        rep     movsb
407
        mov     [len],eax
407
        mov     [len],eax
408
        popad
408
        popad
409
    @@:
409
    @@:
410
        ret
410
        ret
411
endf
411
endf
412
 
412
 
413
;------------------------------------------------------------------------------
413
;------------------------------------------------------------------------------
414
;//////////////////////////////////////////////////////////////////////////////
414
;//////////////////////////////////////////////////////////////////////////////
415
;------------------------------------------------------------------------------
415
;------------------------------------------------------------------------------
416
 
416
 
417
func draw_path
417
func draw_path
418
        pushad
418
        pushad
419
        cmp     [active_panel],0
419
        cmp     [active_panel],0
420
        jne    ._00
420
        jne    ._00
421
        mov     esi,f_path0
421
        mov     esi,f_path0
422
        mov     eax,[f_plen0]
422
        mov     eax,[f_plen0]
423
        jmp     @f
423
        jmp     @f
424
   ._00:
424
   ._00:
425
        mov     esi,f_path1
425
        mov     esi,f_path1
426
        mov     eax,[f_plen1]
426
        mov     eax,[f_plen1]
427
    @@:
427
    @@:
428
        mov     edi,f_pathn
428
        mov     edi,f_pathn
429
        call    get_normal_path
429
        call    get_normal_path
430
        mov     eax,39
430
        mov     eax,39
431
        mov     ecx,[len]
431
        mov     ecx,[len]
432
        mov     edi,f_pathn
432
        mov     edi,f_pathn
433
        call    get_path_ellipses
433
        call    get_path_ellipses
434
        mcall2  MF_FILLRECT,oX-1,tW*80+1,oY+tH*23-1,tH,[fc.pathbg]
434
        mcall2  MF_FILLRECT,oX-1,tW*80+1,oY+tH*23-1,tH,[fc.pathbg]
435
        mcall1  MF_DRAWTEXT,oX,oY+tH*23,[fc.path],f_pathn,[len]
435
        mcall1  MF_DRAWTEXT,oX,oY+tH*23,[fc.path],f_pathn,[len]
436
        popad
436
        popad
437
        ret
437
        ret
438
endf
438
endf
439
 
439
 
440
;------------------------------------------------------------------------------
440
;------------------------------------------------------------------------------
441
;//////////////////////////////////////////////////////////////////////////////
441
;//////////////////////////////////////////////////////////////////////////////
442
;------------------------------------------------------------------------------
442
;------------------------------------------------------------------------------
443
 
443
 
444
; AL = panel
444
; AL = panel
445
func draw_files
445
func draw_files
446
        push    eax
446
        push    eax
447
        mmov    ecx,oY+tH*2-1,tH*FPC
447
        mmov    ecx,oY+tH*2-1,tH*FPC
448
        mov     edx,[fc.background]
448
        mov     edx,[fc.background]
449
        cmp     al,0
449
        cmp     al,0
450
        mov     eax,MF_FILLRECT
450
        mov     eax,MF_FILLRECT
451
        jne    ._00
451
        jne    ._00
452
        mcall1  ,oX+tW-2,tW*12+3
452
        mcall1  ,oX+tW-2,tW*12+3
453
        mcall1  ,oX+tW*14-2,tW*12+3
453
        mcall1  ,oX+tW*14-2,tW*12+3
454
        mcall1  ,oX+tW*27-2,tW*12+3
454
        mcall1  ,oX+tW*27-2,tW*12+3
455
        mmov    ebx,oX+tW,oY+tH*2
455
        mmov    ebx,oX+tW,oY+tH*2
456
        mov     edx,[d_ltop]
456
        mov     edx,[d_ltop]
457
        shl     edx,4
457
        shl     edx,4
458
        add     edx,lstart
458
        add     edx,lstart
459
        mov     edi,[d_lcnt]
459
        mov     edi,[d_lcnt]
460
        mov     esi,edi
460
        mov     esi,edi
461
        sub     edi,[d_ltop]
461
        sub     edi,[d_ltop]
462
        jmp     @f
462
        jmp     @f
463
   ._00:
463
   ._00:
464
        mcall1  ,oX+tW*41-2,tW*12+3
464
        mcall1  ,oX+tW*41-2,tW*12+3
465
        mcall1  ,oX+tW*54-2,tW*12+3
465
        mcall1  ,oX+tW*54-2,tW*12+3
466
        mcall1  ,oX+tW*67-2,tW*12+3
466
        mcall1  ,oX+tW*67-2,tW*12+3
467
        mmov    ebx,oX+tW*41,oY+tH*2
467
        mmov    ebx,oX+tW*41,oY+tH*2
468
        mov     edx,[d_rtop]
468
        mov     edx,[d_rtop]
469
        shl     edx,4
469
        shl     edx,4
470
        add     edx,rstart
470
        add     edx,rstart
471
        mov     edi,[d_rcnt]
471
        mov     edi,[d_rcnt]
472
        mov     esi,edi
472
        mov     esi,edi
473
        sub     edi,[d_rtop]
473
        sub     edi,[d_rtop]
474
    @@:
474
    @@:
475
        cmp     esi,0
475
        cmp     esi,0
476
        je     .exit_nok                ; no files
476
        je     .exit_nok                ; no files
477
 
477
 
478
        mov     ecx,3
478
        mov     ecx,3
479
   .next_col:
479
   .next_col:
480
        push    ecx
480
        push    ecx
481
        mov     ecx,FPC
481
        mov     ecx,FPC
482
   .next_row:
482
   .next_row:
483
        dec     edi
483
        dec     edi
484
        jge     @f
484
        jge     @f
485
        pop     eax
485
        pop     eax
486
        jmp    .exit_ok
486
        jmp    .exit_ok
487
    @@:
487
    @@:
488
        push    ecx
488
        push    ecx
489
        call    get_file_color
489
        call    get_file_color
490
        mov     esi,edx
490
        mov     esi,edx
491
        call    get_file_name
491
        call    get_file_name
492
        push    edx
492
        push    edx
493
        mcall   4,,,f_name,12           ; draw file name
493
        mcall   4,,,f_name,12           ; draw file name
494
        pop     edx ecx
494
        pop     edx ecx
495
        add     ebx,tH
495
        add     ebx,tH
496
 
496
 
497
        add     edx,16
497
        add     edx,16
498
        dec     ecx
498
        dec     ecx
499
        jnz    .next_row
499
        jnz    .next_row
500
        pop     ecx
500
        pop     ecx
501
        dec     ecx
501
        dec     ecx
502
        jz     .exit_ok
502
        jz     .exit_ok
503
        madd    ebx,tW*13,0
503
        madd    ebx,tW*13,0
504
        mov     bx,oY+tH*2
504
        mov     bx,oY+tH*2
505
        jmp    .next_col
505
        jmp    .next_col
506
 
506
 
507
   .exit_ok:
507
   .exit_ok:
508
        mov     edi,sel_color
508
        mov     edi,sel_color
509
        call    draw_sel
509
        call    draw_sel
510
   .exit_nok:
510
   .exit_nok:
511
        pop     eax
511
        pop     eax
512
        call    draw_file_info
512
        call    draw_file_info
513
        ret
513
        ret
514
endf
514
endf
515
 
515
 
516
;------------------------------------------------------------------------------
516
;------------------------------------------------------------------------------
517
;//////////////////////////////////////////////////////////////////////////////
517
;//////////////////////////////////////////////////////////////////////////////
518
;------------------------------------------------------------------------------
518
;------------------------------------------------------------------------------
519
 
519
 
520
func draw_bottom_keys
520
func draw_bottom_keys
521
        pushad
521
        pushad
522
        mcall2  MF_FILLRECT,oX-1,tW*80+1,oY+tH*24-1,tH+1,[fc.pathbg]
522
        mcall2  MF_FILLRECT,oX-1,tW*80+1,oY+tH*24-1,tH+1,[fc.pathbg]
523
        dec     ecx
523
        dec     ecx
524
        mcall1  ,oX+tW-1,tW*6+1,,[fc.keysbg]
524
        mcall1  ,oX+tW-1,tW*6+1,,[fc.keysbg]
525
        mov     esi,7
525
        mov     esi,7
526
    @@:
526
    @@:
527
        madd    ebx,tW*8,0
527
        madd    ebx,tW*8,0
528
        mcall
528
        mcall
529
        dec     esi
529
        dec     esi
530
        jge     @b
530
        jge     @b
531
        mcall1  ,oX+tW*73-1,tW*7+1
531
        mcall1  ,oX+tW*73-1,tW*7+1
532
        mcall   MF_DRAWNUMBER,$00010100,1,oX*65536+(oY+tH*24),[fc.path]
532
        mcall   MF_DRAWNUMBER,$00010100,1,oX*65536+(oY+tH*24),[fc.path]
533
        sub     edx,$00010000
533
        sub     edx,$00010000
534
    @@:
534
    @@:
535
        inc     cl
535
        inc     cl
536
        madd    edx,tW*8,0
536
        madd    edx,tW*8,0
537
        mcall
537
        mcall
538
        cmp     cl,10
538
        cmp     cl,10
539
        jb      @b
539
        jb      @b
540
        mcall1  MF_DRAWTEXT,oX+tW,oY+tH*24,[fc.keys],btmkeys,btmkeys.size
540
        mcall1  MF_DRAWTEXT,oX+tW,oY+tH*24,[fc.keys],btmkeys,btmkeys.size
541
        popad
541
        popad
542
        ret
542
        ret
543
endf
543
endf
544
 
544
 
545
;------------------------------------------------------------------------------
545
;------------------------------------------------------------------------------
546
;//////////////////////////////////////////////////////////////////////////////
546
;//////////////////////////////////////////////////////////////////////////////
547
;------------------------------------------------------------------------------
547
;------------------------------------------------------------------------------
548
 
548
 
549
; ESI = X1*65536+X2
549
; ESI = X1*65536+X2
550
; EDI = Y1*65536+Y2
550
; EDI = Y1*65536+Y2
551
; EDX = color
551
; EDX = color
552
func draw_frame
552
func draw_frame
553
        mov     ecx,edi
553
        mov     ecx,edi
554
        mov     ebx,edi
554
        mov     ebx,edi
555
        shr     ebx,16
555
        shr     ebx,16
556
        mov     cx,bx
556
        mov     cx,bx
557
        mcall   MF_DRAWLINE,esi
557
        mcall   MF_DRAWLINE,esi
558
        mov     ecx,edi
558
        mov     ecx,edi
559
        shl     ecx,16
559
        shl     ecx,16
560
        mov     cx,di
560
        mov     cx,di
561
        mcall
561
        mcall
562
        mov     ebx,esi
562
        mov     ebx,esi
563
        mov     ecx,esi
563
        mov     ecx,esi
564
        shr     ecx,16
564
        shr     ecx,16
565
        mov     bx,cx
565
        mov     bx,cx
566
        mcall   ,,edi
566
        mcall   ,,edi
567
        mov     ebx,esi
567
        mov     ebx,esi
568
        shl     ebx,16
568
        shl     ebx,16
569
        mov     bx,si
569
        mov     bx,si
570
        mcall
570
        mcall
571
        ret
571
        ret
572
endf
572
endf
573
 
573
 
574
;------------------------------------------------------------------------------
574
;------------------------------------------------------------------------------
575
;//////////////////////////////////////////////////////////////////////////////
575
;//////////////////////////////////////////////////////////////////////////////
576
;------------------------------------------------------------------------------
576
;------------------------------------------------------------------------------
577
 
577
 
578
; EDX = pointer to file data
578
; EDX = pointer to file data
579
func get_file_color
579
func get_file_color
580
        push    esi
580
        push    esi
581
        mov     cl,[edx+11]
581
        mov     cl,[edx+11]
582
        test    cl,(FA_HIDDEN or FA_SYSTEM)
582
        test    cl,(FA_HIDDEN or FA_SYSTEM)
583
        jz      @f
583
        jz      @f
584
        mov     ecx,[fc.system]
584
        mov     ecx,[fc.system]
585
        jmp    .exit
585
        jmp    .exit
586
    @@:
586
    @@:
587
        test    cl,FA_FOLDER
587
        test    cl,FA_FOLDER
588
        jz      @f
588
        jz      @f
589
        mov     ecx,[fc.folder]
589
        mov     ecx,[fc.folder]
590
        jmp    .exit
590
        jmp    .exit
591
    @@:
591
    @@:
592
        mov     ecx,[edx+7]
592
        mov     ecx,[edx+7]
593
        and     ecx,$ffffff00
593
        and     ecx,$ffffff00
594
        or      ecx,$00000020
594
        or      ecx,$00000020
595
 
595
 
596
        mov     esi,ext0-4
596
        mov     esi,ext0-4
597
    @@:
597
    @@:
598
        lodsd
598
        lodsd
599
        or      eax,eax
599
        or      eax,eax
600
        jz      @f
600
        jz      @f
601
        cmp     ecx,eax
601
        cmp     ecx,eax
602
        jne     @b
602
        jne     @b
603
        mov     ecx,[fc.executable]
603
        mov     ecx,[fc.executable]
604
        jmp    .exit
604
        jmp    .exit
605
    @@:
605
    @@:
606
        lodsd
606
        lodsd
607
        or      eax,eax
607
        or      eax,eax
608
        jz      @f
608
        jz      @f
609
        cmp     ecx,eax
609
        cmp     ecx,eax
610
        jne     @b
610
        jne     @b
611
        mov     ecx,[fc.bitmap]
611
        mov     ecx,[fc.bitmap]
612
        jmp    .exit
612
        jmp    .exit
613
    @@:
613
    @@:
614
        lodsd
614
        lodsd
615
        or      eax,eax
615
        or      eax,eax
616
        je      @f
616
        je      @f
617
        cmp     ecx,eax
617
        cmp     ecx,eax
618
        jne     @b
618
        jne     @b
619
        mov     ecx,[fc.source]
619
        mov     ecx,[fc.source]
620
        jmp    .exit
620
        jmp    .exit
621
    @@:
621
    @@:
622
        mov     ecx,[fc.default]
622
        mov     ecx,[fc.default]
623
   .exit:
623
   .exit:
624
        pop     esi
624
        pop     esi
625
        ret
625
        ret
626
endf
626
endf
627
 
627
 
628
;------------------------------------------------------------------------------
628
;------------------------------------------------------------------------------
629
;//////////////////////////////////////////////////////////////////////////////
629
;//////////////////////////////////////////////////////////////////////////////
630
;------------------------------------------------------------------------------
630
;------------------------------------------------------------------------------
631
 
631
 
632
; EDI = color
632
; EDI = color
633
func draw_sel
633
func draw_sel
634
        pushad
634
        pushad
635
        cmp     [active_panel],0
635
        cmp     [active_panel],0
636
        jne    ._00
636
        jne    ._00
637
        mov     eax,[d_lpos]
637
        mov     eax,[d_lpos]
638
        sub     eax,[d_ltop]
638
        sub     eax,[d_ltop]
639
        mov     esi,[d_lcnt]
639
        mov     esi,[d_lcnt]
640
        jmp     @f
640
        jmp     @f
641
   ._00:
641
   ._00:
642
        mov     eax,[d_rpos]
642
        mov     eax,[d_rpos]
643
        sub     eax,[d_rtop]
643
        sub     eax,[d_rtop]
644
        mov     esi,[d_rcnt]
644
        mov     esi,[d_rcnt]
645
    @@:
645
    @@:
646
        cmp     esi,0
646
        cmp     esi,0
647
        je     .exit
647
        je     .exit
648
        mov     cl,FPC
648
        mov     cl,FPC
649
        div     cl
649
        div     cl
650
        mov     bp,ax
650
        mov     bp,ax
651
        and     eax,$000000FF
651
        and     eax,$000000FF
652
        mov     cl,tW*13
652
        mov     cl,tW*13
653
        mul     cl
653
        mul     cl
654
        add     ax,oX+tW-2
654
        add     ax,oX+tW-2
655
        push    eax
655
        push    eax
656
        shl     eax,16
656
        shl     eax,16
657
        mov     ax,tW*12+3
657
        mov     ax,tW*12+3
658
        mov     ebx,eax
658
        mov     ebx,eax
659
        mov     ax,bp
659
        mov     ax,bp
660
        shr     eax,8
660
        shr     eax,8
661
        and     eax,$000000FF
661
        and     eax,$000000FF
662
        mov     cl,tH
662
        mov     cl,tH
663
        mul     cl
663
        mul     cl
664
        add     ax,oY+tH*2-1
664
        add     ax,oY+tH*2-1
665
        push    eax
665
        push    eax
666
        shl     eax,16
666
        shl     eax,16
667
        mov     ax,tH
667
        mov     ax,tH
668
        mov     ecx,eax
668
        mov     ecx,eax
669
        mov     edx,edi
669
        mov     edx,edi
670
        cmp     [active_panel],0
670
        cmp     [active_panel],0
671
        je      @f
671
        je      @f
672
        madd    ebx,(40*6),0
672
        madd    ebx,(40*6),0
673
    @@:
673
    @@:
674
        mcall   MF_FILLRECT
674
        mcall   MF_FILLRECT
675
 
675
 
676
        pop     eax
676
        pop     eax
677
        movzx   ebx,ax
677
        movzx   ebx,ax
678
        inc     bx
678
        inc     bx
679
        pop     eax
679
        pop     eax
680
        add     ax,2
680
        add     ax,2
681
        shl     eax,16
681
        shl     eax,16
682
        or      ebx,eax
682
        or      ebx,eax
683
        cmp     [active_panel],0
683
        cmp     [active_panel],0
684
        jne    ._01
684
        jne    ._01
685
        mov     edx,[d_lpos]
685
        mov     edx,[d_lpos]
686
        shl     edx,4
686
        shl     edx,4
687
        add     edx,lstart
687
        add     edx,lstart
688
        jmp     @f
688
        jmp     @f
689
   ._01:
689
   ._01:
690
        mov     edx,[d_rpos]
690
        mov     edx,[d_rpos]
691
        shl     edx,4
691
        shl     edx,4
692
        add     edx,rstart
692
        add     edx,rstart
693
    @@:
693
    @@:
694
        mov     esi,edx
694
        mov     esi,edx
695
        call    get_file_name
695
        call    get_file_name
696
        call    get_file_color
696
        call    get_file_color
697
        cmp     ecx,edi
697
        cmp     ecx,edi
698
        jne     @f
698
        jne     @f
699
        xor     ecx,ecx
699
        xor     ecx,ecx
700
    @@:
700
    @@:
701
        cmp     [active_panel],0
701
        cmp     [active_panel],0
702
        je      @f
702
        je      @f
703
        madd    ebx,tW*40,0
703
        madd    ebx,tW*40,0
704
    @@:
704
    @@:
705
        mcall   MF_DRAWTEXT,,,f_name,12
705
        mcall   MF_DRAWTEXT,,,f_name,12
706
   .exit:
706
   .exit:
707
        popad
707
        popad
708
        ret
708
        ret
709
endf
709
endf
710
 
710
 
711
;------------------------------------------------------------------------------
711
;------------------------------------------------------------------------------
712
;//////////////////////////////////////////////////////////////////////////////
712
;//////////////////////////////////////////////////////////////////////////////
713
;------------------------------------------------------------------------------
713
;------------------------------------------------------------------------------
714
 
714
 
715
; AL = panel
715
; AL = panel
716
func draw_file_info
716
func draw_file_info
717
        push    eax
717
        push    eax
718
        mmov    ecx,oY+tH*21,tH
718
        mmov    ecx,oY+tH*21,tH
719
        mov     edx,[fc.background]
719
        mov     edx,[fc.background]
720
        cmp     al,0
720
        cmp     al,0
721
        mov     eax,MF_FILLRECT
721
        mov     eax,MF_FILLRECT
722
        jne    ._00
722
        jne    ._00
723
        mcall1  ,oX+tW,tW*38+1
723
        mcall1  ,oX+tW,tW*38+1
724
        mov     esi,[d_lpos]
724
        mov     esi,[d_lpos]
725
        shl     esi,4
725
        shl     esi,4
726
        add     esi,lstart
726
        add     esi,lstart
727
        mov     edi,[d_lcnt]
727
        mov     edi,[d_lcnt]
728
        jmp     @f
728
        jmp     @f
729
   ._00:
729
   ._00:
730
        mcall1  ,oX+tW*41,tW*38+1
730
        mcall1  ,oX+tW*41,tW*38+1
731
        mov     esi,[d_rpos]
731
        mov     esi,[d_rpos]
732
        shl     esi,4
732
        shl     esi,4
733
        add     esi,rstart
733
        add     esi,rstart
734
        mov     edi,[d_rcnt]
734
        mov     edi,[d_rcnt]
735
    @@:
735
    @@:
736
        cmp     edi,0
736
        cmp     edi,0
737
        jne     @f
737
        jne     @f
738
        pop     eax
738
        pop     eax
739
        ret
739
        ret
740
    @@:
740
    @@:
741
        call    get_file_info
741
        call    get_file_info
742
        mov     dword[file_info+17],'    '
742
        mov     dword[file_info+17],'    '
743
        mov     word[file_info+15],'  '
743
        mov     word[file_info+15],'  '
744
        test    byte[esi+11],FA_FOLDER
744
        test    byte[esi+11],FA_FOLDER
745
        jz      @f
745
        jz      @f
746
        mov     dword[file_info+21],' DIR'
746
        mov     dword[file_info+21],' DIR'
747
        jmp    .no_size
747
        jmp    .no_size
748
    @@:
748
    @@:
749
        mov     dword[file_info+21],'    '
749
        mov     dword[file_info+21],'    '
750
        mov     eax,[f_size]
750
        mov     eax,[f_size]
751
        mov     esi,file_info+24
751
        mov     esi,file_info+24
752
        mov     ebx,10
752
        mov     ebx,10
753
        mov     ecx,ebx
753
        mov     ecx,ebx
754
    @@:
754
    @@:
755
        xor     edx,edx
755
        xor     edx,edx
756
        div     ebx
756
        div     ebx
757
        add     dl,'0'
757
        add     dl,'0'
758
        mov     [esi],dl
758
        mov     [esi],dl
759
        or      eax,eax
759
        or      eax,eax
760
        jz     .no_size
760
        jz     .no_size
761
        dec     esi
761
        dec     esi
762
        loop    @b
762
        loop    @b
763
   .no_size:
763
   .no_size:
764
        pop     eax
764
        pop     eax
765
        mmov    edx,oX+tW*35,oY+tH*21
765
        mmov    edx,oX+tW*35,oY+tH*21
766
        mmov    ebx,oX+tW,oY+tH*21
766
        mmov    ebx,oX+tW,oY+tH*21
767
        cmp     al,0
767
        cmp     al,0
768
        je      @f
768
        je      @f
769
        madd    edx,tW*40,0
769
        madd    edx,tW*40,0
770
        madd    ebx,tW*40,0
770
        madd    ebx,tW*40,0
771
    @@:
771
    @@:
772
        push    edx
772
        push    edx
773
        mcall   MF_DRAWTEXT,,[fc.default],file_info,34
773
        mcall   MF_DRAWTEXT,,[fc.default],file_info,34
774
        pop     edx
774
        pop     edx
775
        mov     esi,ecx
775
        mov     esi,ecx
776
        mov     cx,[f_year]
776
        mov     cx,[f_year]
777
        mcall   MF_DRAWNUMBER,$00040000
777
        mcall   MF_DRAWNUMBER,$00040000
778
        sub     edx,$00240000 ; 6*6 = $24
778
        sub     edx,$00240000 ; 6*6 = $24
779
        movzx   ecx,[f_day]
779
        movzx   ecx,[f_day]
780
        mcall   ,$00020000
780
        mcall   ,$00020000
781
        add     edx,$00120000
781
        add     edx,$00120000
782
        mov     cl,[f_mnth]
782
        mov     cl,[f_mnth]
783
        mcall
783
        mcall
784
        ret
784
        ret
785
endf
785
endf
786
 
786
 
787
;------------------------------------------------------------------------------
787
;------------------------------------------------------------------------------
788
;//////////////////////////////////////////////////////////////////////////////
788
;//////////////////////////////////////////////////////////////////////////////
789
;------------------------------------------------------------------------------
789
;------------------------------------------------------------------------------
790
 
790
 
791
func get_file_name
791
func get_file_name
792
        pushad
792
        pushad
793
        mov     eax,[esi+0]
793
        mov     eax,[esi+0]
794
        mov     [f_name+0],eax
794
        mov     [f_name+0],eax
795
        mov     eax,[esi+4]
795
        mov     eax,[esi+4]
796
        mov     [f_name+4],eax
796
        mov     [f_name+4],eax
797
        mov     eax,[esi+8]
797
        mov     eax,[esi+8]
798
        shl     eax,8
798
        shl     eax,8
799
        and     eax,$FFFFFF00
799
        and     eax,$FFFFFF00
800
        or      al,$00000020
800
        or      al,$00000020
801
        mov     [f_name+8],eax
801
        mov     [f_name+8],eax
802
        popad
802
        popad
803
        ret
803
        ret
804
endf
804
endf
805
 
805
 
806
;------------------------------------------------------------------------------
806
;------------------------------------------------------------------------------
807
;//////////////////////////////////////////////////////////////////////////////
807
;//////////////////////////////////////////////////////////////////////////////
808
;------------------------------------------------------------------------------
808
;------------------------------------------------------------------------------
809
 
809
 
810
; ESI = pointer to file data
810
; ESI = pointer to file data
811
func get_file_info
811
func get_file_info
812
        pushad
812
        pushad
813
        mov     eax,[esi+12]
813
        mov     eax,[esi+12]
814
        mov     dword[f_info],FS_READ
814
        mov     dword[f_info],FS_READ
815
        mov     [f_info+4],eax
815
        mov     [f_info+4],eax
816
        mov     dword[f_info+12],read_area
816
        mov     dword[f_info+12],read_area
817
        mcall   MF_FSACCESS,f_info
817
        mcall   MF_FSACCESS,f_info
818
        cmp     eax,ERR_SUCCESS
818
        cmp     eax,ERR_SUCCESS
819
        je      @f
819
        je      @f
820
        cmp     eax,ERR_FS_LAST
820
        cmp     eax,ERR_FS_LAST
821
        ja      @f
821
        ja      @f
822
        popad
822
        popad
823
        stc
823
        stc
824
        ret
824
        ret
825
    @@:
825
    @@:
826
        mov     eax,read_area
826
        mov     eax,read_area
827
        mov     ecx,16
827
        mov     ecx,16
828
   .next_file:
828
   .next_file:
829
        mov     edx,[esi+0]
829
        mov     edx,[esi+0]
830
        cmp     [eax+0],edx
830
        cmp     [eax+0],edx
831
        jne     @f
831
        jne     @f
832
        mov     edx,[esi+4]
832
        mov     edx,[esi+4]
833
        cmp     [eax+4],edx
833
        cmp     [eax+4],edx
834
        jne     @f
834
        jne     @f
835
        mov     edx,[esi+8]
835
        mov     edx,[esi+8]
836
        cmp     [eax+8],edx
836
        cmp     [eax+8],edx
837
        jne     @f
837
        jne     @f
838
        mov     esi,eax
838
        mov     esi,eax
839
        jmp     .found
839
        jmp     .found
840
    @@:
840
    @@:
841
        add     eax,32
841
        add     eax,32
842
        loop   .next_file
842
        loop   .next_file
843
   .found:
843
   .found:
844
        push    esi
844
        push    esi
845
        mov     eax,'    '
845
        mov     eax,'    '
846
        mov     ecx,3
846
        mov     ecx,3
847
        mov     edi,file_info
847
        mov     edi,file_info
848
        rep     stosd
848
        rep     stosd
849
        mov     edi,file_info
849
        mov     edi,file_info
850
        mov     ecx,2
850
        mov     ecx,2
851
        rep     movsd
851
        rep     movsd
852
        mov     edi,file_info
852
        mov     edi,file_info
853
    @@:
853
    @@:
854
        cmp     byte[edi],' '
854
        cmp     byte[edi],' '
855
        jbe     @f
855
        jbe     @f
856
        inc     edi
856
        inc     edi
857
        jmp     @b
857
        jmp     @b
858
    @@:
858
    @@:
859
        mov     eax,[esi]
859
        mov     eax,[esi]
860
        shl     eax,8
860
        shl     eax,8
861
        mov     al,'.'
861
        mov     al,'.'
862
        cmp     eax,'.   '
862
        cmp     eax,'.   '
863
        je      @f
863
        je      @f
864
        mov     [edi],eax
864
        mov     [edi],eax
865
    @@:
865
    @@:
866
        pop     esi
866
        pop     esi
867
        mov     eax,[esi+28]
867
        mov     eax,[esi+28]
868
        mov     [f_size],eax
868
        mov     [f_size],eax
869
        mov     eax,[esi+24]
869
        mov     eax,[esi+24]
870
        mov     [f_day],al
870
        mov     [f_day],al
871
        and     [f_day],00011111b
871
        and     [f_day],00011111b
872
        shr     eax,5
872
        shr     eax,5
873
        mov     [f_mnth],al
873
        mov     [f_mnth],al
874
        and     [f_mnth],00001111b
874
        and     [f_mnth],00001111b
875
        shr     eax,4
875
        shr     eax,4
876
        mov     [f_year],ax
876
        mov     [f_year],ax
877
        and     [f_year],01111111b
877
        and     [f_year],01111111b
878
        add     [f_year],1980
878
        add     [f_year],1980
879
        popad
879
        popad
880
        clc
880
        clc
881
        ret
881
        ret
882
endf
882
endf
883
 
883
 
884
;------------------------------------------------------------------------------
884
;------------------------------------------------------------------------------
885
;//////////////////////////////////////////////////////////////////////////////
885
;//////////////////////////////////////////////////////////////////////////////
886
;------------------------------------------------------------------------------
886
;------------------------------------------------------------------------------
887
 
887
 
888
; DL = panel
888
; DL = panel
889
func get_files_data
889
func get_files_data
890
        pushad
890
        pushad
891
        mov     [d_tcnt],0
891
        mov     [d_tcnt],0
892
        mov     [d_ttsz],0
892
        mov     [d_ttsz],0
893
        cmp     dl,0
893
        cmp     dl,0
894
        jne    ._00
894
        jne    ._00
895
        mov     esi,f_path0
895
        mov     esi,f_path0
896
        mov     ecx,[f_plen0]
896
        mov     ecx,[f_plen0]
897
        jmp     @f
897
        jmp     @f
898
   ._00:
898
   ._00:
899
        mov     esi,f_path1
899
        mov     esi,f_path1
900
        mov     ecx,[f_plen1]
900
        mov     ecx,[f_plen1]
901
    @@:
901
    @@:
902
        push    edi
902
        push    edi
903
        mov     edi,f_info.path
903
        mov     edi,f_info.path
904
        mov     byte[edi+ecx],0
904
        mov     byte[edi+ecx],0
905
        rep     movsb
905
        rep     movsb
906
        pop     edi
906
        pop     edi
907
        cmp     dl,0
907
        cmp     dl,0
908
        jne    ._01
908
        jne    ._01
909
        mov     edi,lstart
909
        mov     edi,lstart
910
        jmp     @f
910
        jmp     @f
911
   ._01:
911
   ._01:
912
        mov     edi,rstart
912
        mov     edi,rstart
913
    @@:
913
    @@:
914
        push    edx
914
        push    edx
915
        xor     ebp,ebp
915
        xor     ebp,ebp
916
        mov     dword[f_info],FS_READ          ; read
916
        mov     dword[f_info],FS_READ          ; read
917
        mov     dword[f_info+8],1              ; 1 block
917
        mov     dword[f_info+8],1              ; 1 block
918
        mov     dword[f_info+12],read_area     ; to read_area
918
        mov     dword[f_info+12],read_area     ; to read_area
919
   .next_block:
919
   .next_block:
920
        mov     dword[f_info+4],ebp            ; starting from block #ebp
920
        mov     dword[f_info+4],ebp            ; starting from block #ebp
921
        mcall   MF_FSACCESS,f_info
921
        mcall   MF_FSACCESS,f_info
922
        cmp     eax,ERR_SUCCESS
922
        cmp     eax,ERR_SUCCESS
923
        je      @f
923
        je      @f
924
        cmp     eax,ERR_FS_LAST
924
        cmp     eax,ERR_FS_LAST
925
        ja      @f
925
        ja      @f
926
        jmp    .exit
926
        jmp    .exit
927
    @@:
927
    @@:
928
        mov     esi,read_area
928
        mov     esi,read_area
929
        mov     ecx,16
929
        mov     ecx,16
930
   .next_file:
930
   .next_file:
931
        cmp     word[esi],0             ; end of entries
931
        cmp     word[esi],0             ; end of entries
932
        je     .exit
932
        je     .exit
933
        cmp     word[esi],'. '          ; self-pointer
933
        cmp     word[esi],'. '          ; self-pointer
934
        je     .skip
934
        je     .skip
935
        test    byte[esi+11],FA_LABEL   ; disk label
935
        test    byte[esi+11],FA_LABEL   ; disk label
936
        jnz    .skip
936
        jnz    .skip
937
        cmp     byte[esi+11],$0F        ; fat32
937
        cmp     byte[esi+11],$0F        ; fat32
938
        je     .skip
938
        je     .skip
939
        cmp     byte[esi],$E5           ; erased
939
        cmp     byte[esi],$E5           ; erased
940
        je     .skip
940
        je     .skip
941
        mov     eax,[esi+28]            ; add file size
941
        mov     eax,[esi+28]            ; add file size
942
        add     [d_ttsz],eax            ; to folder size
942
        add     [d_ttsz],eax            ; to folder size
943
        push    ecx
943
        push    ecx
944
        mov     ecx,3
944
        mov     ecx,3
945
        rep     movsd                   ; copy name, attriputes
945
        rep     movsd                   ; copy name, attriputes
946
        mov     [edi],ebp               ; and block number
946
        mov     [edi],ebp               ; and block number
947
        add     edi,4
947
        add     edi,4
948
        add     esi,20
948
        add     esi,20
949
        inc     [d_tcnt]                ; increase folder files counter
949
        inc     [d_tcnt]                ; increase folder files counter
950
;       cmp     [d_tcnt],max_cnt
950
;       cmp     [d_tcnt],max_cnt
951
;       je     .exit
951
;       je     .exit
952
        pop     ecx
952
        pop     ecx
953
        jmp     @f
953
        jmp     @f
954
   .skip:
954
   .skip:
955
        add     esi,32
955
        add     esi,32
956
    @@:
956
    @@:
957
        loop   .next_file
957
        loop   .next_file
958
 
958
 
959
        cmp     [d_tcnt],max_cnt
959
        cmp     [d_tcnt],max_cnt
960
        je     .exit
960
        je     .exit
961
        inc     ebp
961
        inc     ebp
962
        jmp    .next_block
962
        jmp    .next_block
963
   .exit:
963
   .exit:
964
        pop     edx
964
        pop     edx
965
        push    [d_ttsz]
965
        push    [d_ttsz]
966
        mov     eax,[d_tcnt]
966
        mov     eax,[d_tcnt]
967
        cmp     dl,0
967
        cmp     dl,0
968
        jne    ._02
968
        jne    ._02
969
        mov     [d_lcnt],eax
969
        mov     [d_lcnt],eax
970
        pop     [d_ltsz]
970
        pop     [d_ltsz]
971
        jmp     @f
971
        jmp     @f
972
   ._02:
972
   ._02:
973
        mov     [d_rcnt],eax
973
        mov     [d_rcnt],eax
974
        pop     [d_rtsz]
974
        pop     [d_rtsz]
975
    @@:
975
    @@:
976
        popad
976
        popad
977
        mov     al,dl
977
        mov     al,dl
978
        call    mfar_sort
978
        call    mfar_sort
979
        ret
979
        ret
980
endf
980
endf
981
 
981
 
982
;------------------------------------------------------------------------------
982
;------------------------------------------------------------------------------
983
;//////////////////////////////////////////////////////////////////////////////
983
;//////////////////////////////////////////////////////////////////////////////
984
;------------------------------------------------------------------------------
984
;------------------------------------------------------------------------------
985
 
985
 
986
func execute_current_file
986
func execute_current_file
987
        pushad
987
        pushad
988
        cmp     [active_panel],0
988
        cmp     [active_panel],0
989
        jne    ._00
989
        jne    ._00
990
        mov     esi,[d_lpos]
990
        mov     esi,[d_lpos]
991
        shl     esi,4
991
        shl     esi,4
992
        add     esi,lstart
992
        add     esi,lstart
993
        mov     edi,f_path0
993
        mov     edi,f_path0
994
        mov     ecx,f_plen0
994
        mov     ecx,f_plen0
995
        jmp     @f
995
        jmp     @f
996
   ._00:
996
   ._00:
997
        mov     esi,[d_rpos]
997
        mov     esi,[d_rpos]
998
        shl     esi,4
998
        shl     esi,4
999
        add     esi,rstart
999
        add     esi,rstart
1000
        mov     edi,f_path1
1000
        mov     edi,f_path1
1001
        mov     ecx,f_plen1
1001
        mov     ecx,f_plen1
1002
    @@:
1002
    @@:
1003
        call    get_file_info
1003
        call    get_file_info
1004
        test    byte[esi+11],FA_FOLDER
1004
        test    byte[esi+11],FA_FOLDER
1005
        jz     .file
1005
        jz     .file
1006
        cmp     word[esi],'..'
1006
        cmp     word[esi],'..'
1007
        jne    .enter_dir
1007
        jne    .enter_dir
1008
        add     edi,[ecx]
1008
        add     edi,[ecx]
1009
        dec     edi
1009
        dec     edi
1010
    @@:
1010
    @@:
1011
        dec     [f_plen1]
1011
        dec     [f_plen1]
1012
        cmp     byte[edi],'/'
1012
        cmp     byte[edi],'/'
1013
        je      @f
1013
        je      @f
1014
        dec     edi
1014
        dec     edi
1015
        jmp     @b
1015
        jmp     @b
1016
    @@:
1016
    @@:
1017
        mov     dword[edi],0
1017
        mov     dword[edi],0
1018
        jmp     @f
1018
        jmp     @f
1019
   .enter_dir:
1019
   .enter_dir:
1020
        add     edi,[ecx]
1020
        add     edi,[ecx]
1021
        push    ecx edi
1021
        push    ecx edi
1022
        mov     byte[edi],'/'
1022
        mov     byte[edi],'/'
1023
        inc     edi
1023
        inc     edi
1024
        mov     esi,file_info
1024
        mov     esi,file_info
1025
        mov     ecx,3
1025
        mov     ecx,3
1026
        cld
1026
        cld
1027
        rep     movsd
1027
        rep     movsd
1028
        mov     dword[edi],0
1028
        mov     dword[edi],0
1029
        pop     esi ecx
1029
        pop     esi ecx
1030
        sub     edi,esi
1030
        sub     edi,esi
1031
        add     dword[ecx],edi
1031
        add     dword[ecx],edi
1032
        mov     [d_rpos],0
1032
        mov     [d_rpos],0
1033
        mov     [d_rtop],0
1033
        mov     [d_rtop],0
1034
    @@:
1034
    @@:
1035
        mov     dl,[active_panel]
1035
        mov     dl,[active_panel]
1036
        call    get_files_data
1036
        call    get_files_data
1037
        call    draw_path
1037
        call    draw_path
1038
        mov     al,dl
1038
        mov     al,dl
1039
        call    draw_files
1039
        call    draw_files
1040
        jmp    .exit
1040
        jmp    .exit
1041
   .file:
1041
   .file:
1042
        mov     eax,[esi+8]
1042
        mov     eax,[esi+8]
1043
        shl     eax,8
1043
        shl     eax,8
1044
        and     eax,$FFFFFF00
1044
        and     eax,$FFFFFF00
1045
        or      eax,$00000020
1045
        or      eax,$00000020
1046
        cmp     eax,'    '
1046
        cmp     eax,'    '
1047
        jne    .exit
1047
        jne    .exit
1048
 
1048
 
1049
        mov     esi,edi
1049
        mov     esi,edi
1050
        mov     eax,[ecx]
1050
        mov     eax,[ecx]
1051
        mov     edi,f_pathn
1051
        mov     edi,f_pathn
1052
        call    get_normal_path
1052
        call    get_normal_path
1053
        mov     esi,f_pathn
1053
        mov     esi,f_pathn
1054
        mov     ecx,[len]
1054
        mov     ecx,[len]
1055
        dec     ecx
1055
        dec     ecx
1056
        mov     edi,f_info.path
1056
        mov     edi,f_info.path
1057
        rep     movsb
1057
        rep     movsb
1058
        mov     byte[edi],'/'
1058
        mov     byte[edi],'/'
1059
        inc     edi
1059
        inc     edi
1060
        mov     esi,file_info
1060
        mov     esi,file_info
1061
    @@:
1061
    @@:
1062
        movsb
1062
        movsb
1063
        cmp     byte[esi],0
1063
        cmp     byte[esi],0
1064
        je      @f
1064
        je      @f
1065
        cmp     byte[esi],' '
1065
        cmp     byte[esi],' '
1066
        jne     @b
1066
        jne     @b
1067
    @@:
1067
    @@:
1068
        mov     byte[edi],0
1068
        mov     byte[edi],0
1069
        mov     dword[f_info],FS_EXECUTE
1069
        mov     dword[f_info],FS_EXECUTE
1070
        mov     dword[f_info+12],0
1070
        mov     dword[f_info+12],0
1071
        mcall   MF_FSACCESS,f_info
1071
        mcall   MF_FSACCESS,f_info
1072
   .exit:
1072
   .exit:
1073
        popad
1073
        popad
1074
        ret
1074
        ret
1075
endf
1075
endf
1076
 
1076
 
1077
;------------------------------------------------------------------------------
1077
;------------------------------------------------------------------------------
1078
;//////////////////////////////////////////////////////////////////////////////
1078
;//////////////////////////////////////////////////////////////////////////////
1079
;------------------------------------------------------------------------------
1079
;------------------------------------------------------------------------------
1080
 
1080
 
1081
func delete_current_file
1081
func delete_current_file
1082
        pushad
1082
        pushad
1083
        popad
1083
        popad
1084
        ret
1084
        ret
1085
endf
1085
endf
1086
 
1086
 
1087
;------------------------------------------------------------------------------
1087
;------------------------------------------------------------------------------
1088
;///// INCLUDES ///////////////////////////////////////////////////////////////
1088
;///// INCLUDES ///////////////////////////////////////////////////////////////
1089
;------------------------------------------------------------------------------
1089
;------------------------------------------------------------------------------
1090
 
1090
 
1091
include 'mf-copy.inc'
1091
include 'mf-copy.inc'
1092
include 'mf-sort.inc'
1092
include 'mf-sort.inc'
1093
 
1093
 
1094
;------------------------------------------------------------------------------
1094
;------------------------------------------------------------------------------
1095
;///// DATA ///////////////////////////////////////////////////////////////////
1095
;///// DATA ///////////////////////////////////////////////////////////////////
1096
;------------------------------------------------------------------------------
1096
;------------------------------------------------------------------------------
1097
 
1097
 
1098
align 4
1098
align 4
1099
 
1099
 
1100
f_size dd ?
1100
f_size dd ?
1101
f_day  db ?
1101
f_day  db ?
1102
f_mnth db ?
1102
f_mnth db ?
1103
f_year dw ?
1103
f_year dw ?
1104
 
1104
 
1105
d_lpos dd 0
1105
d_lpos dd 0
1106
d_ltop dd 0
1106
d_ltop dd 0
1107
d_lcnt dd 0
1107
d_lcnt dd 0
1108
d_ltsz dd 0
1108
d_ltsz dd 0
1109
d_rpos dd 0
1109
d_rpos dd 0
1110
d_rtop dd 0
1110
d_rtop dd 0
1111
d_rcnt dd 0
1111
d_rcnt dd 0
1112
d_rtsz dd 0
1112
d_rtsz dd 0
1113
d_tpos dd ?
1113
d_tpos dd ?
1114
d_ttop dd ?
1114
d_ttop dd ?
1115
d_tcnt dd ?
1115
d_tcnt dd ?
1116
d_ttsz dd ?
1116
d_ttsz dd ?
1117
 
1117
 
1118
f_info:
1118
f_info:
1119
 dd 0
1119
 dd 0
1120
 dd 0
1120
 dd 0
1121
 dd ?
1121
 dd ?
1122
 dd read_area
1122
 dd read_area
1123
 dd MEM_FOR_OS
1123
 dd MEM_FOR_OS
1124
.path:
1124
.path:
1125
 rb 255
1125
 rb 255
1126
 
1126
 
1127
f_plen0 dd 5
1127
f_plen0 dd 5
1128
f_plen1 dd 5
1128
f_plen1 dd 5
1129
 
1129
 
1130
sz caption,'MFAR : PRE-ALPHA-8.1',0
1130
sz caption,'MFAR : PRE-ALPHA-8.1',0
1131
sz fcfile,'MFAR    DAT'
1131
sz fcfile,'MFAR    DAT'
1132
sz p_hd,'/HD/1',0
1132
sz p_hd,'/HD/1',0
1133
sz p_rd,'/RD/1',0
1133
sz p_rd,'/SYS',0
1134
ext0:
1134
ext0:
1135
  db '     EXE COM BAT CMD'
1135
  db '     EXE COM BAT CMD'
1136
  dd 0
1136
  dd 0
1137
ext1:
1137
ext1:
1138
  db ' BMP GIF JPG PNG WMF'
1138
  db ' BMP GIF JPG PNG WMF'
1139
  dd 0
1139
  dd 0
1140
ext2:
1140
ext2:
1141
  db ' ASM INC'
1141
  db ' ASM INC'
1142
  dd 0
1142
  dd 0
1143
 
1143
 
1144
;----- LANGUAGE-SPECIFIC STRINGS -----
1144
;----- LANGUAGE-SPECIFIC STRINGS -----
1145
include 'mf-lang.inc'
1145
include 'mf-lang.inc'
1146
;-------------------------------------
1146
;-------------------------------------
1147
 
1147
 
1148
f_name: rb 12
1148
f_name: rb 12
1149
file_info: db '                              .  .'
1149
file_info: db '                              .  .'
1150
active_panel db 0
1150
active_panel db 0
1151
;---------------------------------
1151
;---------------------------------
1152
 
1152
 
1153
sel_color  = $00008080
1153
sel_color  = $00008080
1154
 
1154
 
1155
FPC        = 18
1155
FPC        = 18
1156
 
1156
 
1157
MEM_FOR_OS = $48300
1157
MEM_FOR_OS = $48300
1158
MEM_USED   = $4C300
1158
MEM_USED   = $4C300
1159
read_area  = $48000
1159
read_area  = $48000
1160
fdata_size = $40000-$300
1160
fdata_size = $40000-$300
1161
max_cnt    = fdata_size/32
1161
max_cnt    = fdata_size/32
1162
lstart     = $8000+$300
1162
lstart     = $8000+$300
1163
rstart     = lstart+max_cnt*16
1163
rstart     = lstart+max_cnt*16
1164
 
1164
 
1165
f_path0    = $8000
1165
f_path0    = $8000
1166
f_path1    = $8000+$100
1166
f_path1    = $8000+$100
1167
f_pathn    = $8000+$200
1167
f_pathn    = $8000+$200
1168
 
1168
 
1169
align 4
1169
align 4
1170
 
1170
 
1171
sc system_colors
1171
sc system_colors
1172
fc mfar_colors
1172
fc mfar_colors
1173
 
1173
 
1174
I_END:
1174
I_END:
1175
; 16 bytes per entry:
1175
; 16 bytes per entry:
1176
;  -> 8 bytes - name
1176
;  -> 8 bytes - name
1177
;  -> 3 bytes - extension
1177
;  -> 3 bytes - extension
1178
;  -> 1 byte  - attributes
1178
;  -> 1 byte  - attributes
1179
;  -> 4 bytes - block number
1179
;  -> 4 bytes - block number