Subversion Repositories Kolibri OS

Rev

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

Rev 193 Rev 485
Line 25... Line 25...
25
    dd      0x10000        ; memory for app
25
    dd      0x10000        ; memory for app
26
    dd      0x10000        ; esp
26
    dd      0x10000        ; esp
27
    dd      0x0 , 0x0      ; I_Param , I_Icon
27
    dd      0x0 , 0x0      ; I_Param , I_Icon
Line 28... Line 28...
28
 
28
 
29
include 'lang.inc'
29
include 'lang.inc'
30
include 'macros.inc'       ; very useful stuff for MeOS
30
include '..\..\..\macros.inc'       ; very useful stuff for MeOS
Line 31... Line 31...
31
STRLEN = 48                ; maximal length of filename
31
STRLEN = 48                ; maximal length of filename
Line 37... Line 37...
37
    call draw_window       ; at first, draw the window
37
    call draw_window       ; at first, draw the window
Line 38... Line 38...
38
 
38
 
Line 39... Line 39...
39
still:                     ; main cycle of application begins here
39
still:                     ; main cycle of application begins here
40
 
40
 
Line 41... Line 41...
41
    mov  eax,10     ; wait here for event
41
    mov  eax,10     ; wait here for event
42
    int  0x40
42
    mcall
43
 
43
 
44
    dec  eax        ; redraw request ?
44
    dec  eax        ; redraw request ?
Line 50... Line 50...
50
 
50
 
Line 51... Line 51...
51
    jmp  still
51
    jmp  still
52
 
52
 
53
  key:              ; key event handler
53
  key:              ; key event handler
54
    mov  eax,2      ;   just read it and ignore
54
    mov  eax,2      ;   just read it and ignore
Line 55... Line 55...
55
    int  0x40
55
    mcall
56
    jmp  still      ;   return to main loop
56
    jmp  still      ;   return to main loop
57
 
57
 
Line 58... Line 58...
58
  button:           ; button
58
  button:           ; button
59
    mov  eax,17     ;   get id
59
    mov  eax,17     ;   get id
Line 60... Line 60...
60
    int  0x40
60
    mcall
Line 96... Line 96...
96
    mov  edi,[addr]    ; address of string
96
    mov  edi,[addr]    ; address of string
97
    add  edi,[temp]    ; cursor position
97
    add  edi,[temp]    ; cursor position
Line 98... Line 98...
98
 
98
 
99
  .waitev:
99
  .waitev:
100
    mov  eax,10
100
    mov  eax,10
101
    int  0x40
101
    mcall
102
    cmp  eax,2
102
    cmp  eax,2
103
    jnz  still
103
    jnz  still
104
;   mov  eax,2
104
;   mov  eax,2
105
    int  0x40
105
    mcall
106
    shr  eax,8
106
    shr  eax,8
107
    cmp  eax,8
107
    cmp  eax,8
108
    jnz  .nobs         ; BACKSPACE
108
    jnz  .nobs         ; BACKSPACE
109
    cmp  edi,[addr]
109
    cmp  edi,[addr]
Line 139... Line 139...
139
    jmp  still
139
    jmp  still
Line 140... Line 140...
140
 
140
 
141
 
141
 
142
  close:
142
  close:
Line 143... Line 143...
143
    or   eax,-1        ; close program
143
    or   eax,-1        ; close program
144
    int  0x40
144
    mcall
145
 
145
 
Line 163... Line 163...
163
    ; allocate memory
163
    ; allocate memory
164
    mov  ecx,[param_info+32]   ;ebx
164
    mov  ecx,[param_info+32]   ;ebx
165
    add  ecx,0x10000 ; size of memory needed = 0x10000+filesize
165
    add  ecx,0x10000 ; size of memory needed = 0x10000+filesize
166
    mov  eax,64      ; func 64
166
    mov  eax,64      ; func 64
167
    mov  ebx,1       ; resize application memory
167
    mov  ebx,1       ; resize application memory
168
    int  0x40
168
    mcall
Line 169... Line 169...
169
 
169
 
170
    ; check if alloc function failed
170
    ; check if alloc function failed
171
    test eax,eax     ; non-zero value means error
171
    test eax,eax     ; non-zero value means error
172
    je   .ok_memory
172
    je   .ok_memory
Line 195... Line 195...
195
 
195
 
196
    ; return to the initial amount of memory
196
    ; return to the initial amount of memory
197
    mov  eax,64
197
    mov  eax,64
198
    mov  ebx,1
198
    mov  ebx,1
199
    mov  ecx,0x10000
199
    mov  ecx,0x10000
Line 200... Line 200...
200
    int  0x40
200
    mcall
Line 201... Line 201...
201
 
201
 
Line 208... Line 208...
208
    mov  eax,4
208
    mov  eax,4
209
    mov  ebx,20*65536+83
209
    mov  ebx,20*65536+83
210
    mov  ecx,0x10ff0000
210
    mov  ecx,0x10ff0000
211
    mov  edx,[errors+edi*8]
211
    mov  edx,[errors+edi*8]
212
    mov  esi,[errors+edi*8+4]
212
    mov  esi,[errors+edi*8+4]
213
    int  0x40
213
    mcall
214
jmp still
214
jmp still
Line 215... Line 215...
215
 
215
 
216
 
216
 
Line 220... Line 220...
220
    mov  ebx,107*65536+STRLEN*6
220
    mov  ebx,107*65536+STRLEN*6
221
    mov  ecx,[ya]
221
    mov  ecx,[ya]
222
    shl  ecx,16
222
    shl  ecx,16
223
    add  ecx,9
223
    add  ecx,9
224
    mov  edx,0xf2f2f2
224
    mov  edx,0xf2f2f2
225
    int  0x40
225
    mcall
Line 226... Line 226...
226
 
226
 
227
    mov  eax,4
227
    mov  eax,4
228
    mov  ebx,109*65536
228
    mov  ebx,109*65536
229
    add  ebx,[ya]
229
    add  ebx,[ya]
230
    xor  ecx,ecx
230
    xor  ecx,ecx
231
    mov  edx,[addr]
231
    mov  edx,[addr]
232
    mov  esi,STRLEN
232
    mov  esi,STRLEN
Line 233... Line 233...
233
    int  0x40
233
    mcall
Line 234... Line 234...
234
 
234
 
Line 242... Line 242...
242
 
242
 
Line 243... Line 243...
243
draw_window:
243
draw_window:
244
 
244
 
245
    mov  eax, 12                   ; function 12:tell os about windowdraw
245
    mov  eax, 12                   ; function 12:tell os about windowdraw
Line 246... Line 246...
246
    mov  ebx, 1                    ; 1, start of draw
246
    mov  ebx, 1                    ; 1, start of draw
247
    int  0x40
247
    mcall
248
 
248
 
249
                                   ; DRAW WINDOW
249
                                   ; DRAW WINDOW
250
    xor  eax, eax                  ; function 0 : define and draw window
250
    xor  eax, eax                  ; function 0 : define and draw window
251
    mov  ebx, 160*65536+415        ; [x start] *65536 + [x size]
-
 
252
    mov  ecx, 160*65536+100        ; [y start] *65536 + [y size]
-
 
253
    mov  edx, 0x03DDDDDD           ; color of work area RRGGBB
251
    mov  ebx, 160*65536+415        ; [x start] *65536 + [x size]
254
    int  0x40
-
 
255
 
-
 
256
                                   ; WINDOW LABEL
-
 
257
    mov  eax, 4                    ; function 4 : write text to window
-
 
258
    mov  ebx, 8*65536+8            ; [x start] *65536 + [y start]
-
 
259
    mov  ecx, 0x10ffffff           ; color of text RRGGBB
252
    mov  ecx, 160*65536+100        ; [y start] *65536 + [y size]
Line 260... Line 253...
260
    mov  edx, header               ; pointer to text beginning
253
    mov  edx, 0x13DDDDDD           ; color of work area RRGGBB
261
    mov  esi, header.size          ; text length
254
    mov  edi, title                ; WINDOW LABEL
262
    int  0x40
255
    mcall
263
 
256
 
264
    mov  eax, 8                    ; COPY BUTTON
257
    mov  eax, 8                    ; COPY BUTTON
265
    mov  ebx, 20*65536+375
258
    mov  ebx, 20*65536+375
Line 266... Line 259...
266
    mov  ecx, 63*65536+16
259
    mov  ecx, 63*65536+16
267
    mov  edx, 2
260
    mov  edx, 2
268
    mov  esi, 0xCCCCCC
261
    mov  esi, 0xCCCCCC
269
    int  0x40
262
    mcall
270
 
263
 
Line 271... Line 264...
271
    mov  ebx, 105*65536+290
264
    mov  ebx, 105*65536+290
272
    mov  ecx, 33*65536+12
265
    mov  ecx, 33*65536+12
273
    mov  edx, 4
266
    mov  edx, 4
274
    mov  esi, 0xEBEBEB
267
    mov  esi, 0xEBEBEB
275
    int  0x40
268
    mcall
Line 276... Line 269...
276
 
269
 
277
    mov  ebx, 105*65536+290
270
    mov  ebx, 105*65536+290
278
    mov  ecx, 49*65536+12
271
    mov  ecx, 49*65536+12
279
    mov  edx, 5
272
    mov  edx, 5
Line 294... Line 287...
294
    xor  ecx, ecx
287
    xor  ecx, ecx
295
    mov  edx, text
288
    mov  edx, text
296
    mov  esi, STRLEN+59-45
289
    mov  esi, STRLEN+59-45
297
  newline:
290
  newline:
298
    mov  eax, 4
291
    mov  eax, 4
299
    int  0x40
292
    mcall
300
    add  ebx, 16
293
    add  ebx, 16
301
    add  edx, STRLEN+59-45
294
    add  edx, STRLEN+59-45
302
    cmp  [edx], byte 'x'
295
    cmp  [edx], byte 'x'
303
    jnz  newline
296
    jnz  newline
Line 304... Line 297...
304
 
297
 
305
    mov  eax, 12                   ; function 12:tell os about windowdraw
298
    mov  eax, 12                   ; function 12:tell os about windowdraw
306
    mov  ebx, 2                    ; 2, end of draw
299
    mov  ebx, 2                    ; 2, end of draw
Line 307... Line 300...
307
    int  0x40
300
    mcall
Line 308... Line 301...
308
 
301
 
Line 389... Line 382...
389
  fr, 'DESTINATION:  |                                               ',\
382
  fr, 'DESTINATION:  |                                               ',\
390
  fr, '                           COPIER                             ',\
383
  fr, '                           COPIER                             ',\
391
  fr, 'x'
384
  fr, 'x'
Line 392... Line 385...
392
 
385
 
393
 
386
 
394
lsz  header,\
387
lsz  title,\
395
  ru, 'ŠŽˆŽ‚€’œ ”€‰‹',\
388
  ru, 'ŠŽˆŽ‚€’œ ”€‰‹',\
396
  en, 'SYSTREE FILE COPIER',\
389
  en, 'SYSTREE FILE COPIER',\