Subversion Repositories Kolibri OS

Rev

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

Rev 5716 Rev 5722
Line 18... Line 18...
18
        push    ecx edx edi
18
        push    ecx edx edi
19
        mov     dl, [palettesize]
19
        mov     dl, [palettesize]
20
        DEBUGF  1, "Loading palette of %u colors\n", dl
20
        DEBUGF  1, "Loading palette of %u colors\n", dl
21
        mov     edi, palette
21
        mov     edi, palette
22
  .loop:
22
  .loop:
23
        call    pixel_to_24bpp
23
        call    load_pixel_trle
24
        mov     [edi], ecx
24
        mov     [edi], ecx
25
        add     edi, 4
25
        add     edi, 4
26
        dec     dl
26
        dec     dl
27
        jnz     .loop
27
        jnz     .loop
28
        pop     edi edx ecx
28
        pop     edi edx ecx
Line 29... Line 29...
29
 
29
 
Line -... Line 30...
-
 
30
        ret
-
 
31
 
-
 
32
 
-
 
33
load_pixel_trle:         ; returns in ecx
-
 
34
 
-
 
35
        push    eax
-
 
36
  @@:
-
 
37
        lea     eax, [esi+BYTES_PER_PIXEL]
-
 
38
        cmp     [datapointer], eax
-
 
39
        jae     @f
-
 
40
        call    read_data.more
-
 
41
        jmp     @b
-
 
42
  @@:
-
 
43
 
-
 
44
if BITS_PER_PIXEL = 8
-
 
45
 
-
 
46
        push    ebx
-
 
47
 
-
 
48
        mov     bl, 36
-
 
49
        mov     al, [esi]
-
 
50
        and     al, 7
-
 
51
        mul     bl
-
 
52
        mov     ch, al          ; red
-
 
53
 
-
 
54
        mov     al, [esi]
-
 
55
        shr     al, 3
-
 
56
        and     al, 7
-
 
57
        mul     bl
-
 
58
        mov     cl, al          ; green
-
 
59
 
-
 
60
        mov     bl, 85
-
 
61
        mov     al, [esi]
-
 
62
        shr     al, 6
-
 
63
        and     al, 3
-
 
64
        mul     bl
-
 
65
        shl     ecx, 8
-
 
66
        mov     cl, al          ; blue
-
 
67
 
-
 
68
        inc     esi
-
 
69
        pop     ebx
-
 
70
 
-
 
71
else if BITS_PER_PIXEL = 16
-
 
72
 
-
 
73
        lodsw
-
 
74
        mov     cl, ah
-
 
75
        and     al, 0xf8        ; red
-
 
76
 
-
 
77
        mov     cx, ax
-
 
78
        shl     cx, 5
-
 
79
        and     ch, 0xfc        ; green
-
 
80
        shl     ecx, 8
-
 
81
 
-
 
82
        mov     cl, al
-
 
83
        shl     cl, 3
-
 
84
        and     cx, 0x00f8      ; blue
-
 
85
 
-
 
86
else    ; 32 BPP gets packed to 24 BPP
-
 
87
 
-
 
88
        mov     ecx, [esi]
-
 
89
        and     ecx, 0x00ffffff
-
 
90
        add     esi, 3
-
 
91
 
-
 
92
end if
-
 
93
        pop     eax
-
 
94
 
30
        ret
95
        ret
Line 31... Line 96...
31
 
96
 
Line 32... Line 97...
32
 
97
 
Line 60... Line 125...
60
        add     eax, [subrectangle.y]
125
        add     eax, [subrectangle.y]
61
        movzx   ebx, [screen.width]
126
        movzx   ebx, [screen.width]
62
        mul     ebx
127
        mul     ebx
63
        add     eax, [rectangle.x]
128
        add     eax, [rectangle.x]
64
        add     eax, [subrectangle.x]
129
        add     eax, [subrectangle.x]
65
        lea     edi, [framebuffer_data+eax*3]
130
        lea     edi, [framebuffer+eax*3]
Line 66... Line 131...
66
 
131
 
67
; Calculate offset between two rows of pixels
132
; Calculate offset between two rows of pixels
68
        movzx   eax, [screen.width]
133
        movzx   eax, [screen.width]
69
        sub     eax, [subrectangle.width]
134
        sub     eax, [subrectangle.width]
Line 195... Line 260...
195
        dec     edx
260
        dec     edx
196
        jnz     .rle_line
261
        jnz     .rle_line
197
        jmp     .next_tile
262
        jmp     .next_tile
Line 198... Line 263...
198
 
263
 
199
  .rle_reload:
-
 
200
        ; load pixel value
264
  .rle_reload:
Line 201... Line 265...
201
        call    pixel_to_24bpp
265
        call    load_pixel_trle
202
 
266
 
203
  @@:
267
  @@:
204
        lea     eax, [esi+1]
268
        lea     eax, [esi+1]
Line 445... Line 509...
445
 
509
 
446
        DEBUGF  1, "RAW tile\n"
510
        DEBUGF  1, "RAW tile\n"
447
  .raw_line:
511
  .raw_line:
448
        mov     ebx, [subrectangle.width]
512
        mov     ebx, [subrectangle.width]
449
  .raw_pixel:
513
  .raw_pixel:
450
        call    pixel_to_24bpp
514
        call    load_pixel_trle
451
        mov     word[edi], cx
515
        mov     word[edi], cx
452
        shr     ecx, 16
516
        shr     ecx, 16
453
        add     edi, 2
517
        add     edi, 2
454
        mov     byte[edi], cl
518
        mov     byte[edi], cl
Line 463... Line 527...
463
 
527
 
464
 
528
 
465
; Single color tile
529
; Single color tile
466
  .solid:
530
  .solid:
467
        DEBUGF  1, "Solid tile\n"
531
        DEBUGF  1, "Solid tile\n"
468
        call    pixel_to_24bpp
532
        call    load_pixel_trle
Line 469... Line 533...
469
        mov     eax, ecx
533
        mov     eax, ecx
470
        shr     eax, 16
534
        shr     eax, 16