Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 18... Line 18...
18
;0.05 fullimg, collimg ~05.05.2004
18
;0.05 fullimg, collimg ~05.05.2004
19
;0.06 getimg ~09.05.2004
19
;0.06 getimg ~09.05.2004
20
;0.07 convbmp ~13.05.2004
20
;0.07 convbmp ~13.05.2004
21
;0.08 fps ~14.05.2004
21
;0.08 fps ~14.05.2004
22
;0.09 drawfbox ~03.06.2004
22
;0.09 drawfbox ~03.06.2004
23
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004
23
;0.10 all macros optimized by halyavin, add at ~07.06.2004
24
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004
24
;0.11 many macros optimized by halyavin, add at ~30.08.2004
25
;0.12 bmptoimg ~07.09.2004
25
;0.12 bmptoimg ~07.09.2004
26
;0.13 imgtoimg ~08.09.2004
26
;0.13 imgtoimg ~08.09.2004
27
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
27
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
28
;0.15 giftoimg, giftoani ~10.09.2004
28
;0.15 giftoimg, giftoani ~10.09.2004
29
;0.16 setframe, rgbtobgr, setbmp deleted ~20.09.2004
29
;0.16 setframe, rgbtobgr, setbmp deleted ~20.09.2004
Line 367... Line 367...
367
 
367
 
368
 
368
 
369
;DrawBox
369
;DrawBox
370
macro drawfbox x,y,xs,ys,color
370
macro drawfbox x,y,xs,ys,color
371
{
371
{
372
    words2reg ebx,x,xs ;x*65536+xs
372
    wordstoreg ebx,x,xs ;x*65536+xs
373
    words2reg ecx,y,ys ;y*65536+ys
373
    wordstoreg ecx,y,ys ;y*65536+ys
374
    mov  edx,color
374
    mov  edx,color
375
    mov  eax,13
375
    mov  eax,13
Line 376... Line 376...
376
    int  0x40
376
    mcall
377
}
377
}
378
 
378
 
Line 383... Line 383...
383
local spdat,savetime,new_time,fps,fps_cntr,out_fps,new_time,ttt
383
local spdat,savetime,new_time,fps,fps_cntr,out_fps,new_time,ttt
384
local no_out_fps
384
local no_out_fps
385
    jmp spdat
385
    jmp spdat
386
savetime dd 0
386
savetime dd 0
387
fps_cntr dd 0
387
fps_cntr dd 0
388
fps	 dd 0
388
fps      dd 0
389
ttt	 dd 0
389
ttt      dd 0
390
spdat:
390
spdat:
391
get_time:
391
get_time:
392
    mov eax,3
392
    mov eax,3
393
    int 0x40
393
    mcall
394
    cmp eax,[savetime]
394
    cmp eax,[savetime]
395
    jne new_time
395
    jne new_time
396
    inc [fps_cntr]
396
    inc [fps_cntr]
397
    cmp dword [ttt],0
397
    cmp dword [ttt],0
398
    je	out_fps
398
    je  out_fps
399
    dec dword [ttt]
399
    dec dword [ttt]
400
    jmp no_out_fps
400
    jmp no_out_fps
401
new_time:
401
new_time:
402
    mov [savetime],eax
402
    mov [savetime],eax
403
    mov ebx,[fps_cntr]
403
    mov ebx,[fps_cntr]
404
    mov [fps],ebx
404
    mov [fps],ebx
405
    mov [fps_cntr],0
405
    mov [fps_cntr],0
406
out_fps:
406
out_fps:
407
if ~(delcolor eq )
407
if ~(delcolor eq )
408
    mov ebx,x*65536+36
408
    mov ebx,x*65536+30
409
    mov ecx,y*65536+7
409
    mov ecx,y*65536+7
410
    mov edx,delcolor
410
    mov edx,delcolor
411
    mov eax,13
411
    mov eax,13
412
    int 0x40
412
    mcall
413
end if
413
end if
414
    mov dword [ttt],fps_show_frequency
414
    mov dword [ttt],fps_show_frequency
415
    mov eax,47
415
    mov eax,47
416
    mov ebx,6*65536
416
    mov ebx,5*65536
417
;   mov bl,0
417
;   mov bl,0
418
    mov edx,x*65536+y
418
    mov edx,x*65536+y
419
    mov esi,color
419
    mov esi,color
420
    mov ecx,[fps]
420
    mov ecx,[fps]
421
    int 0x40
421
    mcall
422
no_out_fps:
422
no_out_fps:
423
}
423
}
Line 424... Line 424...
424
 
424
 
425
; COLLIMG - Collusion image's
425
; COLLIMG - Collusion image's
Line 460... Line 460...
460
	ja  bc
460
	ja  bc
461
nbc:
461
nbc:
462
	xor ecx,ecx
462
	xor ecx,ecx
463
	ret
463
	ret
464
end if
464
end if
465
bounce:
465
bounce:	
466
	mov otv,1
466
	mov otv,1
467
exit:
467
exit:	
468
}
468
}
Line 469... Line 469...
469
 
469
 
470
macro rgbtobgr image
470
macro rgbtobgr image
471
{
471
{
Line 493... Line 493...
493
    add  ebx,8
493
    add  ebx,8
494
    mov  cx,[arg3]
494
    mov  cx,[arg3]
495
    shl  ecx,16
495
    shl  ecx,16
496
    add  cx,[arg3+4]
496
    add  cx,[arg3+4]
497
;    wordstoreg ecx,[arg3],[arg3+4]
497
;    wordstoreg ecx,[arg3],[arg3+4]
498
    words2reg edx, x , y  ;arg1*65536+arg2
498
    wordstoreg edx, x , y  ;arg1*65536+arg2
499
    int  0x40
499
    mcall
500
}
500
}
Line 501... Line 501...
501
 
501
 
502
macro setframe x , y ,arg3
502
macro setframe x , y ,arg3
503
{
503
{
504
    mov  eax,7
504
    mov  eax,7
505
    mov  ebx,arg3
505
    mov  ebx,arg3
506
    add  ebx,8
506
    add  ebx,8
507
    words2reg edx, x , y  ;arg1*65536+arg2
507
    wordstoreg edx, x , y  ;arg1*65536+arg2
508
    add  edx,dword [arg3]
508
    add  edx,dword [arg3]
509
    mov  ecx,dword [arg3+4]
509
    mov  ecx,dword [arg3+4]
510
    int  0x40
510
    mcall
Line 511... Line 511...
511
}
511
}
512
 
512
 
Line 695... Line 695...
695
    pop  ebp
695
    pop  ebp
696
    pop  edi
696
    pop  edi
697
    sub  esi,dword [bmptoimg_data_area_bps]
697
    sub  esi,dword [bmptoimg_data_area_bps]
698
    sub  esi,dword [bmptoimg_data_area_bps]
698
    sub  esi,dword [bmptoimg_data_area_bps]
699
    cmp  esi,dword [bmptoimg_data_area_sop]
699
    cmp  esi,dword [bmptoimg_data_area_sop]
700
    jb	 end_bmp
700
    jb   end_bmp
701
    add  edi,eax
701
    add  edi,eax
702
    add  ebp,eax
702
    add  ebp,eax
703
    jmp  nextstring
703
    jmp  nextstring
Line 704... Line 704...
704
 
704
 
705
  convertno32:
705
  convertno32:
706
    mov  ebx,bmp_load_area
706
    mov  ebx,bmp_load_area
707
    add  ebx, [bmp_load_area+14]
707
    add  ebx, [bmp_load_area+14]
708
    add  ebx,14 	 ;start of color table
708
    add  ebx,14          ;start of color table
709
    push esi
709
    push esi
710
    add  esi,dword [bmptoimg_data_area_bps]
710
    add  esi,dword [bmptoimg_data_area_bps]
711
    mov  dword [bmptoimg_data_area_eos],esi
711
    mov  dword [bmptoimg_data_area_eos],esi
712
    pop  esi
712
    pop  esi
713
  nextelem:
713
  nextelem:
714
    push eax
714
    push eax
715
    movzx eax,byte [esi]
715
    movzx eax,byte [esi]
716
    cmp  word [bmp_load_area+28],4
716
    cmp  word [bmp_load_area+28],4
717
    je	 convert4bpp
717
    je   convert4bpp
718
    cmp  word [bmp_load_area+28],1
718
    cmp  word [bmp_load_area+28],1
719
    je	 convert1bpp
719
    je   convert1bpp
Line 720... Line 720...
720
    call converttable
720
    call converttable
721
 
721
 
722
  convert2:
722
  convert2:
Line 748... Line 748...
748
  convert1bpp:
748
  convert1bpp:
749
    mov  ecx,eax
749
    mov  ecx,eax
750
    mov  edx,7
750
    mov  edx,7
751
  nextbit:
751
  nextbit:
752
    xor  eax,eax
752
    xor  eax,eax
753
    bt	 ecx,edx
753
    bt   ecx,edx
754
    jnc  noaddelem
754
    jnc  noaddelem
755
    inc  eax
755
    inc  eax
756
  noaddelem:
756
  noaddelem:
757
    push edx
757
    push edx
758
    call converttable
758
    call converttable
759
    pop  edx
759
    pop  edx
760
    dec  edx
760
    dec  edx
761
    js	 convert2
761
    js   convert2
762
    add  edi,3
762
    add  edi,3
Line 763... Line 763...
763
 
763
 
Line 764... Line 764...
764
    add  ebp,3
764
    add  ebp,3
Line 774... Line 774...
774
    ret
774
    ret
Line 775... Line 775...
775
 
775
 
776
bmptoimg_data_area_count=bmptoimg_data_area_count+1
776
bmptoimg_data_area_count=bmptoimg_data_area_count+1
777
if bmptoimg_data_area_count = 1
777
if bmptoimg_data_area_count = 1
778
; DATA AREA
778
; DATA AREA
779
bmptoimg_soi		    dd 0
779
bmptoimg_soi                dd 0
780
bmptoimg_data_area_bps	    dd 0
780
bmptoimg_data_area_bps      dd 0
781
bmptoimg_data_area_dwps     dd 0
781
bmptoimg_data_area_dwps     dd 0
782
bmptoimg_data_area_sop	    dd 0
782
bmptoimg_data_area_sop      dd 0
783
bmptoimg_data_area_eop	    dd 0
783
bmptoimg_data_area_eop      dd 0
784
bmptoimg_data_area_eos	    dd 0
784
bmptoimg_data_area_eos      dd 0
Line 785... Line 785...
785
end if
785
end if
786
 
786
 
787
end_bmp:
787
end_bmp:
Line 814... Line 814...
814
;    hasharea:
814
;    hasharea:
815
;    times 4096 dd 0 ;4096
815
;    times 4096 dd 0 ;4096
816
;    end if
816
;    end if
817
;sss:
817
;sss:
Line 818... Line 818...
818
 
818
 
819
    mov  esi,gifsrc	      ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
819
    mov  esi,gifsrc           ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
Line 820... Line 820...
820
    mov  edi,imgsrc	      ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
820
    mov  edi,imgsrc           ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
821
 
821
 
822
    if defined gif_hash_offset
822
    if defined gif_hash_offset
823
    mov  eax,gif_hash_offset	; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
823
    mov  eax,gif_hash_offset    ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
824
    else
824
    else
Line 825... Line 825...
825
    mov  eax,hasharea	      ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
825
    mov  eax,hasharea         ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
826
    end if
826
    end if
827
 
827
 
Line 843... Line 843...
843
    xor  eax,eax
843
    xor  eax,eax
844
    mov  [globalColor],eax
844
    mov  [globalColor],eax
845
    mov  [img_count],eax
845
    mov  [img_count],eax
846
    inc  eax
846
    inc  eax
847
    cmp  dword[esi],'GIF8'
847
    cmp  dword[esi],'GIF8'
848
    jne  er	       ; signature
848
    jne  er            ; signature
849
    mov  ecx,[esi+0xa]
849
    mov  ecx,[esi+0xa]
850
    inc  eax
850
    inc  eax
851
    add  esi,0xd
851
    add  esi,0xd
852
    mov  edi,esi
852
    mov  edi,esi
853
    bt	 ecx,7
853
    bt   ecx,7
854
    jnc  nextblock
854
    jnc  nextblock
855
    mov  [globalColor],esi
855
    mov  [globalColor],esi
856
    call Gif_skipmap
856
    call Gif_skipmap
857
nextblock:
857
nextblock:
858
    cmp  byte[edi],0x21
858
    cmp  byte[edi],0x21
Line 889... Line 889...
889
    movsd
889
    movsd
Line 890... Line 890...
890
 
890
 
891
    push edi
891
    push edi
892
    movzx ecx,word[esi]
892
    movzx ecx,word[esi]
893
    inc  esi
893
    inc  esi
894
    bt	 ecx,7
894
    bt   ecx,7
895
    jc	 uselocal
895
    jc   uselocal
896
    push [globalColor]
896
    push [globalColor]
897
    mov  edi,esi
897
    mov  edi,esi
898
    jmp  setPal
898
    jmp  setPal
899
uselocal:
899
uselocal:
Line 907... Line 907...
907
    pop  [Palette]
907
    pop  [Palette]
908
    lea  esi,[edi+1]
908
    lea  esi,[edi+1]
909
    mov  edi,[table_ptr]
909
    mov  edi,[table_ptr]
910
    xor  eax,eax
910
    xor  eax,eax
911
    cld
911
    cld
912
    lodsb		; eax - block_count
912
    lodsb               ; eax - block_count
913
    add  eax,esi
913
    add  eax,esi
914
    mov  [block_ofs],eax
914
    mov  [block_ofs],eax
915
    mov  [bit_count],8
915
    mov  [bit_count],8
916
    mov  eax,1
916
    mov  eax,1
917
    shl  eax,cl
917
    shl  eax,cl
Line 931... Line 931...
931
    inc  edx
931
    inc  edx
932
    push [codesize]
932
    push [codesize]
933
    pop  [compsize]
933
    pop  [compsize]
934
    call Gif_get_sym
934
    call Gif_get_sym
935
    cmp  eax,[CC]
935
    cmp  eax,[CC]
936
    je	 reinit
936
    je   reinit
937
    call Gif_output
937
    call Gif_output
938
cycle:
938
cycle:
939
    movzx ebx,ax
939
    movzx ebx,ax
940
    call Gif_get_sym
940
    call Gif_get_sym
941
    cmp  eax,edx
941
    cmp  eax,edx
942
    jae  notintable
942
    jae  notintable
943
    cmp  eax,[CC]
943
    cmp  eax,[CC]
944
    je	 reinit
944
    je   reinit
945
    cmp  eax,[EOI]
945
    cmp  eax,[EOI]
946
    je	 zend
946
    je   zend
947
    call Gif_output
947
    call Gif_output
948
zadd:
948
zadd:
949
    push eax
949
    push eax
950
    mov  eax,[table_ptr]
950
    mov  eax,[table_ptr]
951
    mov  [eax+edx*4],ebx
951
    mov  [eax+edx*4],ebx
Line 995... Line 995...
995
Gif_skipmap:
995
Gif_skipmap:
996
; in: ecx - image descriptor, esi - pointer to colormap
996
; in: ecx - image descriptor, esi - pointer to colormap
997
; out: edi - pointer to area after colormap
997
; out: edi - pointer to area after colormap
Line 998... Line 998...
998
 
998
 
999
    and  ecx,111b
999
    and  ecx,111b
1000
    inc  ecx		; color map size
1000
    inc  ecx            ; color map size
1001
    mov  ebx,1
1001
    mov  ebx,1
1002
    shl  ebx,cl
1002
    shl  ebx,cl
1003
    lea  ebx,[ebx*2+ebx]
1003
    lea  ebx,[ebx*2+ebx]
1004
    lea  edi,[esi+ebx]
1004
    lea  edi,[esi+ebx]
Line 1013... Line 1013...
1013
    rcr  eax,1
1013
    rcr  eax,1
1014
    dec  [bit_count]
1014
    dec  [bit_count]
1015
    jnz  loop1
1015
    jnz  loop1
1016
    inc  esi
1016
    inc  esi
1017
    cmp  esi,[block_ofs]
1017
    cmp  esi,[block_ofs]
1018
    jb	 noblock
1018
    jb   noblock
1019
    push eax
1019
    push eax
1020
    xor  eax,eax
1020
    xor  eax,eax
1021
    lodsb
1021
    lodsb
1022
    test eax,eax
1022
    test eax,eax
1023
    jnz  nextbl
1023
    jnz  nextbl
Line 1055... Line 1055...
1055
 
1055
 
1056
    lea  esi,[eax+eax*2]
1056
    lea  esi,[eax+eax*2]
Line 1057... Line 1057...
1057
    add  esi,[Palette]
1057
    add  esi,[Palette]
1058
 
1058
 
1059
    if COLOR_ORDER eq MENUETOS
1059
    if COLOR_ORDER eq MENUETOS
1060
	mov  esi,[esi]
1060
        mov  esi,[esi]
1061
	bswap esi
1061
        bswap esi
1062
	shr  esi,8
1062
        shr  esi,8
1063
	mov  [edi],esi
1063
        mov  [edi],esi
1064
	add  edi,3
1064
        add  edi,3
1065
    else
1065
    else
1066
	movsw
1066
        movsw
Line 1067... Line 1067...
1067
	movsb
1067
        movsb
1068
    end if
1068
    end if
1069
 
1069
 
Line 1070... Line 1070...
1070
    loop loop2
1070
    loop loop2
1071
    pop  edx eax esi
1071
    pop  edx eax esi
1072
    ret
1072
    ret
1073
 
1073
 
1074
    globalColor dd 1
1074
    globalColor dd 1
1075
    img_count dd 1
1075
    img_count dd 1
1076
    cur_info dd 1	 ; image table pointer
1076
    cur_info dd 1        ; image table pointer
1077
    img_start dd 1
1077
    img_start dd 1
Line 1099... Line 1099...
1099
local setPal, filltable, reinit, cycle, zadd, noinc
1099
local setPal, filltable, reinit, cycle, zadd, noinc
1100
local notintable, er, zend, nxt, continue, ex, Gif_skipmap
1100
local notintable, er, zend, nxt, continue, ex, Gif_skipmap
1101
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
1101
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
1102
local Gif_output, next, loop2
1102
local Gif_output, next, loop2
Line 1103... Line 1103...
1103
 
1103
 
Line 1104... Line 1104...
1104
_null equ 0x1000 ; 0x1000
1104
_null fix 0x1000 ; 0x1000
1105
 
1105
 
Line 1106... Line 1106...
1106
    mov  esi,gifsrc	      ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
1106
    mov  esi,gifsrc           ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
1107
    mov  edi,imgsrc	      ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
1107
    mov  edi,imgsrc           ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
1108
 
1108
 
1109
    if defined gif_hash_offset
1109
    if defined gif_hash_offset
1110
    mov  eax,gif_hash_offset	; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
1110
    mov  eax,gif_hash_offset    ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
Line 1111... Line 1111...
1111
    else
1111
    else
1112
    mov  eax,hasharea	      ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
1112
    mov  eax,hasharea         ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
Line 1128... Line 1128...
1128
    xor  eax,eax
1128
    xor  eax,eax
1129
    mov  [globalColor],eax
1129
    mov  [globalColor],eax
1130
    mov  [img_count],eax
1130
    mov  [img_count],eax
1131
    inc  eax
1131
    inc  eax
1132
    cmp  dword[esi],'GIF8'
1132
    cmp  dword[esi],'GIF8'
1133
    jne  er	       ; signature
1133
    jne  er            ; signature
1134
    mov  ecx,[esi+0xa]
1134
    mov  ecx,[esi+0xa]
1135
    inc  eax
1135
    inc  eax
1136
    add  esi,0xd
1136
    add  esi,0xd
1137
    mov  edi,esi
1137
    mov  edi,esi
1138
    bt	 ecx,7
1138
    bt   ecx,7
1139
    jnc  nextblock
1139
    jnc  nextblock
1140
    mov  [globalColor],esi
1140
    mov  [globalColor],esi
1141
    call Gif_skipmap
1141
    call Gif_skipmap
1142
nextblock:
1142
nextblock:
1143
    cmp  byte[edi],0x21
1143
    cmp  byte[edi],0x21
Line 1185... Line 1185...
1185
    add esi,8
1185
    add esi,8
Line 1186... Line 1186...
1186
 
1186
 
1187
    push edi
1187
    push edi
1188
    movzx ecx,word[esi]
1188
    movzx ecx,word[esi]
1189
    inc  esi
1189
    inc  esi
1190
    bt	 ecx,7
1190
    bt   ecx,7
1191
    jc	 uselocal
1191
    jc   uselocal
1192
    push [globalColor]
1192
    push [globalColor]
1193
    mov  edi,esi
1193
    mov  edi,esi
1194
    jmp  setPal
1194
    jmp  setPal
1195
uselocal:
1195
uselocal:
Line 1203... Line 1203...
1203
    pop  [Palette]
1203
    pop  [Palette]
1204
    lea  esi,[edi+1]
1204
    lea  esi,[edi+1]
1205
    mov  edi,[table_ptr]
1205
    mov  edi,[table_ptr]
1206
    xor  eax,eax
1206
    xor  eax,eax
1207
    cld
1207
    cld
1208
    lodsb		; eax - block_count
1208
    lodsb               ; eax - block_count
1209
    add  eax,esi
1209
    add  eax,esi
1210
    mov  [block_ofs],eax
1210
    mov  [block_ofs],eax
1211
    mov  [bit_count],8
1211
    mov  [bit_count],8
1212
    mov  eax,1
1212
    mov  eax,1
1213
    shl  eax,cl
1213
    shl  eax,cl
Line 1227... Line 1227...
1227
    inc  edx
1227
    inc  edx
1228
    push [codesize]
1228
    push [codesize]
1229
    pop  [compsize]
1229
    pop  [compsize]
1230
    call Gif_get_sym
1230
    call Gif_get_sym
1231
    cmp  eax,[CC]
1231
    cmp  eax,[CC]
1232
    je	 reinit
1232
    je   reinit
1233
    call Gif_output
1233
    call Gif_output
1234
cycle:
1234
cycle:
1235
    movzx ebx,ax
1235
    movzx ebx,ax
1236
    call Gif_get_sym
1236
    call Gif_get_sym
1237
    cmp  eax,edx
1237
    cmp  eax,edx
1238
    jae  notintable
1238
    jae  notintable
1239
    cmp  eax,[CC]
1239
    cmp  eax,[CC]
1240
    je	 reinit
1240
    je   reinit
1241
    cmp  eax,[EOI]
1241
    cmp  eax,[EOI]
1242
    je	 zend
1242
    je   zend
1243
    call Gif_output
1243
    call Gif_output
1244
zadd:
1244
zadd:
1245
    push eax
1245
    push eax
1246
    mov  eax,[table_ptr]
1246
    mov  eax,[table_ptr]
1247
    mov  [eax+edx*4],ebx
1247
    mov  [eax+edx*4],ebx
Line 1291... Line 1291...
1291
Gif_skipmap:
1291
Gif_skipmap:
1292
; in: ecx - image descriptor, esi - pointer to colormap
1292
; in: ecx - image descriptor, esi - pointer to colormap
1293
; out: edi - pointer to area after colormap
1293
; out: edi - pointer to area after colormap
Line 1294... Line 1294...
1294
 
1294
 
1295
    and  ecx,111b
1295
    and  ecx,111b
1296
    inc  ecx		; color map size
1296
    inc  ecx            ; color map size
1297
    mov  ebx,1
1297
    mov  ebx,1
1298
    shl  ebx,cl
1298
    shl  ebx,cl
1299
    lea  ebx,[ebx*2+ebx]
1299
    lea  ebx,[ebx*2+ebx]
1300
    lea  edi,[esi+ebx]
1300
    lea  edi,[esi+ebx]
Line 1309... Line 1309...
1309
    rcr  eax,1
1309
    rcr  eax,1
1310
    dec  [bit_count]
1310
    dec  [bit_count]
1311
    jnz  loop1
1311
    jnz  loop1
1312
    inc  esi
1312
    inc  esi
1313
    cmp  esi,[block_ofs]
1313
    cmp  esi,[block_ofs]
1314
    jb	 noblock
1314
    jb   noblock
1315
    push eax
1315
    push eax
1316
    xor  eax,eax
1316
    xor  eax,eax
1317
    lodsb
1317
    lodsb
1318
    test eax,eax
1318
    test eax,eax
1319
    jnz  nextbl
1319
    jnz  nextbl
Line 1351... Line 1351...
1351
 
1351
 
1352
    lea  esi,[eax+eax*2]
1352
    lea  esi,[eax+eax*2]
Line 1353... Line 1353...
1353
    add  esi,[Palette]
1353
    add  esi,[Palette]
1354
 
1354
 
1355
    if COLOR_ORDER eq MENUETOS
1355
    if COLOR_ORDER eq MENUETOS
1356
	mov  esi,[esi]
1356
        mov  esi,[esi]
1357
	bswap esi
1357
        bswap esi
1358
	shr  esi,8
1358
        shr  esi,8
1359
	mov  [edi],esi
1359
        mov  [edi],esi
1360
	add  edi,3
1360
        add  edi,3
1361
    else
1361
    else
1362
	movsw
1362
        movsw
Line 1363... Line 1363...
1363
	movsb
1363
        movsb
1364
    end if
1364
    end if
1365
 
1365
 
Line 1366... Line 1366...
1366
    loop loop2
1366
    loop loop2
1367
    pop  edx eax esi
1367
    pop  edx eax esi
1368
    ret
1368
    ret
1369
 
1369
 
1370
    globalColor dd 1
1370
    globalColor dd 1
1371
    img_count dd 1
1371
    img_count dd 1
1372
    cur_info dd 1	 ; image table pointer
1372
    cur_info dd 1        ; image table pointer
1373
    img_start dd 1
1373
    img_start dd 1