Subversion Repositories Kolibri OS

Rev

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

Rev 470 Rev 485
Line 39... Line 39...
39
               dd     memsize - 1024           ; esp
39
               dd     memsize - 1024           ; esp
40
               dd     PARAMS , 0x0               ; I_Param , I_Icon
40
               dd     PARAMS , 0x0               ; I_Param , I_Icon
Line 41... Line 41...
41
 
41
 
Line 42... Line 42...
42
stack_size=4096 + 1024
42
stack_size=4096 + 1024
Line 43... Line 43...
43
 
43
 
Line 44... Line 44...
44
include 'macros.inc'
44
include '..\..\..\macros.inc'
45
 
45
 
Line 61... Line 61...
61
 
61
 
62
still:
62
still:
63
    push still
63
    push still
64
    mov ebx,100                ;1 second
64
    mov ebx,100                ;1 second
65
    mov  eax,23                 ; wait here for event
65
    mov  eax,23                 ; wait here for event
66
    int  0x40
66
    mcall
67
    cmp  eax,1                  ; redraw request ?
67
    cmp  eax,1                  ; redraw request ?
68
    je   draw_window
68
    je   draw_window
69
    cmp  eax,2                  ; key in buffer ?
69
    cmp  eax,2                  ; key in buffer ?
70
    je   read_string
70
    je   read_string
71
    cmp  eax,3                  ; button in buffer ?
71
    cmp  eax,3                  ; button in buffer ?
72
    je   button
72
    je   button
Line 73... Line 73...
73
    jmp display_next
73
    jmp display_next
74
 
74
 
75
button:                       ; BUTTON
75
button:                       ; BUTTON
76
    mov  eax,17
76
    mov  eax,17
77
    int  0x40
77
    mcall
78
    cmp ah,3
78
    cmp ah,3
79
    je set_as_bgr2
79
    je set_as_bgr2
80
    cmp ah,2
80
    cmp ah,2
81
    je slideshow
81
    je slideshow
82
    cmp  ah,1                   ; CLOSE PROGRAM
82
    cmp  ah,1                   ; CLOSE PROGRAM
83
    jne  close_program.exit
83
    jne  close_program.exit
84
close_program:
84
close_program:
85
    mov  eax,-1
85
    mov  eax,-1
86
    int  0x40
86
    mcall
Line 87... Line 87...
87
  .exit:
87
  .exit:
88
    ret
88
    ret
Line 107... Line 107...
107
    pop     ecx
107
    pop     ecx
108
    pop     edx
108
    pop     edx
109
    mov     ebx,edi
109
    mov     ebx,edi
110
    mov     eax,7
110
    mov     eax,7
Line 111... Line 111...
111
 
111
 
112
    int     40h                         ; Put image function
112
    mcall                         ; Put image function
113
.l1:
113
.l1:
114
    popad
114
    popad
Line 169... Line 169...
169
    
169
    
170
    mov     eax, 15
170
    mov     eax, 15
171
    mov     ebx, 1
171
    mov     ebx, 1
172
    mov     ecx, [ebp + x_size]
172
    mov     ecx, [ebp + x_size]
173
    mov     edx, [ebp + y_size]
173
    mov     edx, [ebp + y_size]
Line 174... Line 174...
174
    int     0x40
174
    mcall
175
 
175
 
Line 176... Line 176...
176
    mov     dword [ebp+draw_ptr],put_chunk_to_bgr
176
    mov     dword [ebp+draw_ptr],put_chunk_to_bgr
177
    call    jpeg_display
177
    call    jpeg_display
178
 
178
 
179
    ; Stretch the image to fit
179
    ; Stretch the image to fit
180
    mov     eax, 15
180
    mov     eax, 15
Line 181... Line 181...
181
    mov     ebx, 4
181
    mov     ebx, 4
182
    mov     ecx, 2
182
    mov     ecx, 2
183
    int     0x40
183
    mcall
Line 184... Line 184...
184
 
184
 
185
    mov     eax, 15
185
    mov     eax, 15
Line 212... Line 212...
212
    mov     eax, 15
212
    mov     eax, 15
213
    mov     ebx, 5
213
    mov     ebx, 5
214
    mov     ecx, [x_pointer]
214
    mov     ecx, [x_pointer]
215
    mov     edx, [x_offset]
215
    mov     edx, [x_offset]
216
    mov     esi, [x_numofbytes]
216
    mov     esi, [x_numofbytes]
217
    int     0x40
217
    mcall
218
    mov     eax, [x_numofbytes]
218
    mov     eax, [x_numofbytes]
219
    add     [x_pointer], eax
219
    add     [x_pointer], eax
220
    mov     eax, [x_numofb2]
220
    mov     eax, [x_numofb2]
221
    add     [x_offset], eax
221
    add     [x_offset], eax
222
    dec     [x_counter]
222
    dec     [x_counter]
Line 238... Line 238...
238
 
238
 
239
    mov  eax,48
239
    mov  eax,48
240
    mov  ebx,3
240
    mov  ebx,3
241
    mov  ecx,sc
241
    mov  ecx,sc
242
    mov  edx,sizeof.system_colors
242
    mov  edx,sizeof.system_colors
Line 243... Line 243...
243
    int  0x40
243
    mcall
244
 
244
 
245
    mov  eax,12
245
    mov  eax,12
Line 246... Line 246...
246
    mov  ebx,1
246
    mov  ebx,1
247
    int  0x40
247
    mcall
248
 
248
 
249
    ; Draw the window to the appropriate size - it may have
249
    ; Draw the window to the appropriate size - it may have
Line 261... Line 261...
261
 
261
 
262
dw_001:
262
dw_001:
263
    mov     eax, 9
263
    mov     eax, 9
264
    mov ebx, memsize - 1024
264
    mov ebx, memsize - 1024
265
    mov ecx, -1
265
    mov ecx, -1
266
    int     0x40
266
    mcall
267
    mov     eax, [ebx + 34]
267
    mov     eax, [ebx + 34]
268
    mov     [winxo], ax
268
    mov     [winxo], ax
269
    mov     eax, [ebx + 38]
269
    mov     eax, [ebx + 38]
270
    mov     [winyo], ax
270
    mov     [winyo], ax
Line 280... Line 280...
280
        mov     cx, [winys]
280
        mov     cx, [winys]
Line 281... Line 281...
281
 
281
 
282
    xor  eax,eax                   ; DRAW WINDOW
282
    xor  eax,eax                   ; DRAW WINDOW
283
    mov  edx,[sc.work]
283
    mov  edx,[sc.work]
284
    or   edx,0x33000000
284
    or   edx,0x33000000
285
    mov  edi,header                ; WINDOW LABEL
285
    mov  edi,title                ; WINDOW LABEL
Line 286... Line 286...
286
    int  0x40
286
    mcall
287
 
287
 
288
 
288
 
289
    mov  eax,8                     ; BUTTON 2: slideshow
289
    mov  eax,8                     ; BUTTON 2: slideshow
290
    mov  ebx,57
290
    mov  ebx,57
291
    mov  cx, [winys]
291
    mov  cx, [winys]
292
    sub  cx, 39
292
    sub  cx, 39
293
    shl  ecx, 16
293
    shl  ecx, 16
294
    add  ecx, 12
294
    add  ecx, 12
Line 295... Line 295...
295
    mov  esi, [sc.work_button]
295
    mov  esi, [sc.work_button]
296
    mov  edx,2
296
    mov  edx,2
297
    int  0x40
297
    mcall
298
 
298
 
299
    mov  eax,4                     ; Button text
299
    mov  eax,4                     ; Button text
300
    movzx ebx, word [winys]
300
    movzx ebx, word [winys]
301
    add   ebx, 3 shl 16 - 36
301
    add   ebx, 3 shl 16 - 36
Line 302... Line 302...
302
    mov  ecx,[sc.work_button_text]
302
    mov  ecx,[sc.work_button_text]
303
    mov  edx,setname
303
    mov  edx,setname
304
    mov  esi,setnamelen-setname
304
    mov  esi,setnamelen-setname
Line 314... Line 314...
314
    sub  cx, 39
314
    sub  cx, 39
315
    shl  ecx, 16
315
    shl  ecx, 16
316
    add  ecx, 12
316
    add  ecx, 12
317
    mov  esi, [sc.work_button]
317
    mov  esi, [sc.work_button]
318
    mov  edx,3
318
    mov  edx,3
319
    int  0x40
319
    mcall
Line 320... Line 320...
320
 
320
 
321
    mov  eax,4                     ; Button text
321
    mov  eax,4                     ; Button text
322
    movzx ebx, word [winxs]
322
    movzx ebx, word [winxs]
323
    sub   ebx, 63
323
    sub   ebx, 63
324
    shl   ebx,16
324
    shl   ebx,16
325
    mov   bx, word [winys]
325
    mov   bx, word [winys]
326
    sub   bx,36
326
    sub   bx,36
327
    mov  ecx,[sc.work_button_text]
327
    mov  ecx,[sc.work_button_text]
328
    mov  edx,setbgr
328
    mov  edx,setbgr
329
    mov  esi,setbgrlen-setbgr
329
    mov  esi,setbgrlen-setbgr
330
    int  0x40
330
    mcall
331
    call    print_strings
331
    call    print_strings
332
    call    load_image
332
    call    load_image
333
    mov     eax,12                    ; function 12:tell os about windowdraw
333
    mov     eax,12                    ; function 12:tell os about windowdraw
334
    mov     ebx,2                     ; 2, end of draw
334
    mov     ebx,2                     ; 2, end of draw
Line 335... Line 335...
335
    int     0x40
335
    mcall
Line 336... Line 336...
336
 
336
 
337
    ret
337
    ret
338
 
338
 
339
 
339
 
340
 
340
 
341
    ; Read in the image file name.
341
    ; Read in the image file name.
342
read_string:
342
read_string:
343
    movzx edi,byte[name_string.cursor]
343
    movzx edi,byte[name_string.cursor]
344
    add     edi,name_string
344
    add     edi,name_string
345
    mov     eax,2
345
    mov     eax,2
346
    int     0x40                        ; Get the key value
346
    mcall                        ; Get the key value
Line 389... Line 389...
389
    movzx    ecx, word [winys]
389
    movzx    ecx, word [winys]
390
    sub     ecx, 40
390
    sub     ecx, 40
391
    add     ecx, 1  shl 16
391
    add     ecx, 1  shl 16
Line 392... Line 392...
392
 
392
 
393
    mov     edx,[sc.work]
393
    mov     edx,[sc.work]
394
    int     0x40
394
    mcall
395
    mov    ebp,[jpeg_st]
395
    mov    ebp,[jpeg_st]
396
    test    ebp,ebp
396
    test    ebp,ebp
397
    jz      .exit
397
    jz      .exit
398
    mov     dword [ebp+draw_ptr],put_image
398
    mov     dword [ebp+draw_ptr],put_image
Line 407... Line 407...
407
    mov     cx, [winys]
407
    mov     cx, [winys]
408
    sub     cx, 39
408
    sub     cx, 39
409
    shl     ecx, 16
409
    shl     ecx, 16
410
    add     ecx, 12
410
    add     ecx, 12
411
    mov     edx,0xffffff
411
    mov     edx,0xffffff
412
    int     0x40
412
    mcall
Line 413... Line 413...
413
 
413
 
414
    mov     eax,4               ;
414
    mov     eax,4               ;
415
    movzx   ebx, word [winys]
415
    movzx   ebx, word [winys]
416
    add     ebx, 61 shl 16 - 37
416
    add     ebx, 61 shl 16 - 37
417
    mov     ecx,0x000000
417
    mov     ecx,0x000000
418
    mov     edx,name_string
418
    mov     edx,name_string
419
    mov     esi,60
419
    mov     esi,60
420
    int     0x40
420
    mcall
421
    popa
421
    popa
Line 422... Line 422...
422
    ret
422
    ret
423
 
423
 
Line 453... Line 453...
453
@@:
453
@@:
454
        mov     byte [ebx], 1
454
        mov     byte [ebx], 1
455
        mov     byte [ebx+12], 1
455
        mov     byte [ebx+12], 1
456
        mov     dword [ebx+16], dirinfo
456
        mov     dword [ebx+16], dirinfo
457
        mov     eax, 70
457
        mov     eax, 70
458
        int     0x40
458
        mcall
459
        mov     eax, [file_dir]
459
        mov     eax, [file_dir]
460
        inc     dword [eax+4]
460
        inc     dword [eax+4]
461
        cmp     ebx, 1
461
        cmp     ebx, 1
462
        jz      @f
462
        jz      @f
463
        mov     eax, [file_dir]
463
        mov     eax, [file_dir]
Line 500... Line 500...
500
 
500
 
Line 501... Line 501...
501
 
501
 
502
; DATA AREA
502
; DATA AREA
503
 
503
 
504
wcolor          dd  0x000000
504
wcolor          dd  0x000000
Line 505... Line 505...
505
header          db  appname,version,0
505
title          db  appname,version,0
506
setname          db  'SLIDESHOW'
506
setname          db  'SLIDESHOW'