Subversion Repositories Kolibri OS

Rev

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

Rev 223 Rev 532
Line 2... Line 2...
2
gif_hash_offset = gif_hash_area
2
gif_hash_offset = gif_hash_area
Line 3... Line 3...
3
 
3
 
4
macro gif2img gifsrc,imgsrc
4
macro gif2img gifsrc,imgsrc
5
{
5
{
6
local hasharea, ReadGIF, nextblock,_null
6
local hasharea, ReadGIF, nextblock,_null
7
local globalColor, img_count, cur_info, img_start
7
;local globalColor, img_count, cur_info, img_start
8
local codesize, compsize, bit_count, CC, EOI, Palette
8
;local codesize, compsize, bit_count, CC, EOI, Palette
9
local block_ofs, table_ptr, gifmacend
9
;local block_ofs, table_ptr, gifmacend
10
local no_gc, block_skip, no_comm, noextblock, uselocal
10
local no_gc, block_skip, no_comm, noextblock, uselocal
11
local setPal, filltable, reinit, cycle, zadd, noinc
11
local setPal, filltable, reinit, cycle, zadd, noinc
12
local notintable, er, zend, nxt, continue, ex, Gif_skipmap
12
local notintable, er, zend, nxt, continue, ex, Gif_skipmap
13
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
13
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
Line 27... Line 27...
27
    else
27
    else
28
    mov  eax,hasharea
28
    mov  eax,hasharea
29
    end if
29
    end if
Line 30... Line 30...
30
 
30
 
31
    call ReadGIF
31
    call ReadGIF
Line 32... Line 32...
32
    jmp  gifmacend
32
    ret
33
 
33
 
34
    if defined gif_hash_offset
34
    if defined gif_hash_offset
35
    else
35
    else
Line 44... Line 44...
44
    xor  eax,eax
44
    xor  eax,eax
45
    mov  [globalColor],eax
45
    mov  [globalColor],eax
46
    mov  [img_count],eax
46
    mov  [img_count],eax
47
    inc  eax
47
    inc  eax
48
    cmp  dword[esi],'GIF8'
48
    cmp  dword[esi],'GIF8'
49
    jne  er	       ; signature
49
    jne  ex	       ; signature
50
    mov  ecx,[esi+0xa]
50
    mov  ecx,[esi+0xa]
51
    inc  eax
51
    inc  eax
52
    add  esi,0xd
52
    add  esi,0xd
53
    mov  edi,esi
53
    mov  edi,esi
54
    bt	 ecx,7
54
    bt	 ecx,7
Line 79... Line 79...
79
    jne  nextblock
79
    jne  nextblock
80
    add  edi,13
80
    add  edi,13
81
    jmp  block_skip
81
    jmp  block_skip
82
noextblock:
82
noextblock:
83
    cmp  byte[edi],0x2c    ; image beginning
83
    cmp  byte[edi],0x2c    ; image beginning
84
    jne  er
84
    jne  ex
85
    inc  [img_count]
85
    inc  [img_count]
86
    inc  edi
86
    inc  edi
87
    mov  esi,[cur_info]
87
    mov  esi,[cur_info]
88
    xchg esi,edi
88
    xchg esi,edi
89
;    movsd
89
;    movsd
Line 135... Line 135...
135
filltable:
135
filltable:
136
    stosd
136
    stosd
137
    inc  eax
137
    inc  eax
138
    loop filltable
138
    loop filltable
139
    pop  edi
139
    pop  edi
140
    mov  [img_start],edi
-
 
141
reinit:
140
reinit:
142
    mov  edx,[EOI]
141
    mov  edx,[EOI]
143
    inc  edx
142
    inc  edx
144
    push [codesize]
143
    push [codesize]
145
    pop  [compsize]
144
    pop  [compsize]
Line 178... Line 177...
178
    push ebx
177
    push ebx
179
    movzx eax,bx
178
    movzx eax,bx
180
    call Gif_output
179
    call Gif_output
181
    pop  ebx eax
180
    pop  ebx eax
182
    jmp  zadd
181
    jmp  zadd
183
er:
-
 
184
    pop  edi
-
 
185
    jmp  ex
-
 
186
zend:
182
zend:
187
;    mov  eax,[.cur_info]    ; skip offset to next frame
183
;    mov  eax,[.cur_info]    ; skip offset to next frame
188
;    mov  [eax],edi
184
;    mov  [eax],edi
189
    mov  [cur_info],edi
185
    mov  [cur_info],edi
190
    add  esi,2
186
    add  esi,2
Line 195... Line 191...
195
    inc  edi
191
    inc  edi
196
    jmp  nxt
192
    jmp  nxt
197
continue:
193
continue:
198
;    cmp  byte[edi],0x3b    ;read next frame
194
;    cmp  byte[edi],0x3b    ;read next frame
199
;    jne  nextblock
195
;    jne  nextblock
200
    xor  eax,eax
-
 
201
    stosd
-
 
202
    mov  ecx,[img_count]
196
    mov  ecx,[img_count]
203
ex:
197
ex:
204
    pop  edi esi
198
    pop  edi esi
205
    ret
199
    ret
Line 281... Line 275...
281
 
275
 
282
    loop loop2
276
    loop loop2
283
    pop  edx eax esi
277
    pop  edx eax esi
Line 284... Line -...
284
    ret
-
 
285
 
-
 
286
    globalColor dd 1
-
 
287
    img_count dd 1
-
 
288
    cur_info dd 1	 ; image table pointer
-
 
289
    img_start dd 1
-
 
290
    codesize dd 1
-
 
291
    compsize dd 1
-
 
292
    bit_count dd 1
-
 
293
    CC dd 1
-
 
294
    EOI dd 1
-
 
295
    Palette dd 1
-
 
Line 296... Line 278...
296
    block_ofs dd 1
278
    ret
297
    table_ptr dd 1
279