Subversion Repositories Kolibri OS

Rev

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

Rev 532 Rev 547
Line 25... Line 25...
25
;                   1) correction for changed function 15,
25
;                   1) correction for changed function 15,
26
;                   2) use monochrome background if free memory there are less than 2 MB
26
;                   2) use monochrome background if free memory there are less than 2 MB
27
;                   3) use COL0 - COL9 boot parameter
27
;                   3) use COL0 - COL9 boot parameter
28
;                   0=black,1=white,2=green,3=lilas,4=grey
28
;                   0=black,1=white,2=green,3=lilas,4=grey
29
;                   5=light-blue,6=blue,7=salad,8=pink,9=yellow
29
;                   5=light-blue,6=blue,7=salad,8=pink,9=yellow
-
 
30
;    version 0.17   17th June 2007
-
 
31
;                   diamond (background definition now uses shared memory)
Line 30... Line 32...
30
                  
32
                  
31
               memsize=20000h
33
               memsize=20000h
32
               org 0
34
               org 0
Line 33... Line 35...
33
 PARAMS     =    memsize - 1024
35
 PARAMS     =    memsize - 1024
34
 
36
 
Line 35... Line 37...
35
appname equ 'Jpegview '
37
appname equ 'Jpegview '
Line 36... Line 38...
36
version equ '0.16'
38
version equ '0.17'
37
 
39
 
Line 48... Line 50...
48
stack_size=4096 + 1024
50
stack_size=4096 + 1024
Line 49... Line 51...
49
 
51
 
Line 50... Line 52...
50
include '..\..\..\macros.inc'
52
include '..\..\..\macros.inc'
-
 
53
 
Line 51... Line 54...
51
 
54
START:                          ; start of execution
52
START:                          ; start of execution
55
        mcall   68,11           ; initialize heap
Line 53... Line 56...
53
 
56
 
Line 231... Line 234...
231
    mov     ebx, 1
234
    mov     ebx, 1
232
    mov     ecx, [ebp + x_size]
235
    mov     ecx, [ebp + x_size]
233
    mov     edx, [ebp + y_size]
236
    mov     edx, [ebp + y_size]
234
    mcall
237
    mcall
Line -... Line 238...
-
 
238
 
-
 
239
        mov     ebx, 6
-
 
240
        mcall
-
 
241
        test    eax, eax
-
 
242
        jz      .end
-
 
243
        mov     [ipc_mem_out], eax
235
 
244
 
236
    mov     dword [ebp+draw_ptr],put_chunk_to_bgr
245
    mov     dword [ebp+draw_ptr],put_chunk_to_mem
Line -... Line 246...
-
 
246
    call    jpeg_display
-
 
247
 
-
 
248
        mov     eax, 15
-
 
249
        mov     ebx, 7
-
 
250
        mov     ecx, [ipc_mem_out]
237
    call    jpeg_display
251
        mcall
238
 
252
 
239
    ; Stretch the image to fit
253
    ; Stretch the image to fit
240
    mov     eax, 15
254
    mov     eax, 15
241
    mov     ebx, 4
255
    mov     ebx, 4
Line 251... Line 265...
251
    ret
265
    ret
Line 252... Line 266...
252
 
266
 
Line 253... Line 267...
253
;******************************************************************************
267
;******************************************************************************
254
 
-
 
255
ipc_service:
268
 
256
        mcall   68, 11
269
ipc_service:
257
        mov     esi, PARAMS+1
270
        mov     esi, PARAMS+1
258
        xor     eax, eax
271
        xor     eax, eax
259
        xor     ecx, ecx
272
        xor     ecx, ecx
Line 308... Line 321...
308
        lea     eax, [eax*3+8]
321
        lea     eax, [eax*3+8]
309
        mov     ecx, eax
322
        mov     ecx, eax
310
        mcall   68, 12
323
        mcall   68, 12
311
        test    eax, eax
324
        test    eax, eax
312
        jz      .end
325
        jz      .end
-
 
326
        add     eax, 8
313
        mov     [ipc_mem_out], eax
327
        mov     [ipc_mem_out], eax
314
        mov     ebx, [ebp + x_size]
328
        mov     ebx, [ebp + x_size]
315
        mov     [eax], ebx
329
        mov     [eax-8], ebx
316
        mov     ebx, [ebp + y_size]
330
        mov     ebx, [ebp + y_size]
317
        mov     [eax+4], ebx
331
        mov     [eax-4], ebx
Line 318... Line 332...
318
 
332
 
319
    mov     dword [ebp+draw_ptr],put_chunk_to_mem
333
    mov     dword [ebp+draw_ptr],put_chunk_to_mem
Line 320... Line 334...
320
    call    jpeg_display
334
    call    jpeg_display
321
 
335
 
322
; IPC response
336
; IPC response
323
        mov     esi, [ebp + x_size]
337
        mov     esi, [ebp + x_size]
324
        imul    esi, [ebp + y_size]
338
        imul    esi, [ebp + y_size]
-
 
339
        lea     esi, [esi*3+8]
325
        lea     esi, [esi*3+8]
340
        mov     edx, [ipc_mem_out]
326
        mov     edx, [ipc_mem_out]
341
        sub     edx, 8
327
.response:
342
.response:
328
        mov     ecx, [ipc_mem]
343
        mov     ecx, [ipc_mem]
Line 354... Line 369...
354
        popad
369
        popad
355
        ret
370
        ret
Line 356... Line 371...
356
 
371
 
Line 357... Line -...
357
;******************************************************************************
-
 
358
 
-
 
359
put_chunk_to_bgr:
-
 
360
    pushad
-
 
361
 
-
 
362
    mov     [x_pointer], edi
-
 
363
    mov     esi, ecx
-
 
364
    imul    esi, 3
-
 
365
    mov     [x_numofbytes], esi
-
 
366
    mov     ecx, [ebp + x_size]
-
 
367
    imul    ecx, ebx
-
 
368
    add     ecx, eax
-
 
369
    imul    ecx, 3
-
 
370
    mov     [x_offset], ecx
-
 
371
    mov     [x_counter], edx
-
 
372
    mov     eax, [ebp + x_size]
-
 
373
    imul    eax, 3
-
 
374
    mov     [x_numofb2], eax
-
 
375
 .new_string:
-
 
376
    mov     eax, 15
-
 
377
    mov     ebx, 5
-
 
378
    mov     ecx, [x_pointer]
-
 
379
    mov     edx, [x_offset]
-
 
380
    mov     esi, [x_numofbytes]
-
 
381
    mcall
-
 
382
    mov     eax, [x_numofbytes]
-
 
383
    add     [x_pointer], eax
-
 
384
    mov     eax, [x_numofb2]
-
 
385
    add     [x_offset], eax
-
 
386
    dec     [x_counter]
-
 
387
    jnz     .new_string
-
 
388
 
-
 
389
    popad
-
 
390
    ret
-
 
391
 
-
 
392
;******************************************************************************
372
;******************************************************************************
393
 
373
 
394
put_chunk_to_mem:
374
put_chunk_to_mem:
395
; in: (eax,ebx) = start coordinates of chunk
375
; in: (eax,ebx) = start coordinates of chunk
396
;     (ecx,edx) = sizes of chunk
376
;     (ecx,edx) = sizes of chunk
397
;     edi -> chunk data
377
;     edi -> chunk data
398
        push    esi edi edx
378
        push    esi edi edx
399
        mov     esi, edi
379
        mov     esi, edi
400
        mov     edi, ebx
380
        mov     edi, ebx
401
        imul    edi, [ebp + x_size]
381
        imul    edi, [ebp + x_size]
402
        add     edi, eax
382
        add     edi, eax
403
        lea     edi, [edi*3+8]
383
        lea     edi, [edi*3]
404
        add     edi, [ipc_mem_out]
384
        add     edi, [ipc_mem_out]
405
@@:
385
@@:
406
        push    ecx edi
386
        push    ecx edi