Subversion Repositories Kolibri OS

Rev

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

Rev 6652 Rev 6704
Line 941... Line 941...
941
	.end10:
941
	.end10:
942
	cmp dword[ebx+z_stream.next_out],Z_NULL
942
	cmp dword[ebx+z_stream.next_out],Z_NULL
943
	je .beg0
943
	je .beg0
944
	cmp dword[ebx+z_stream.next_in],Z_NULL
944
	cmp dword[ebx+z_stream.next_in],Z_NULL
945
	jne @f
945
	jne @f
946
	cmp word[ebx+z_stream.avail_in],0
946
	cmp dword[ebx+z_stream.avail_in],0
947
	jne .beg0
947
	jne .beg0
948
	@@:
948
	@@:
949
	cmp dword[edi+deflate_state.status],FINISH_STATE
949
	cmp dword[edi+deflate_state.status],FINISH_STATE
950
	jne .end0
950
	jne .end0
951
	cmp dword[flush],Z_FINISH
951
	cmp dword[flush],Z_FINISH
Line 1336... Line 1336...
1336
		; Make sure there is something to do and avoid duplicate consecutive
1336
		; Make sure there is something to do and avoid duplicate consecutive
1337
		; flushes. For repeated and useless calls with Z_FINISH, we keep
1337
		; flushes. For repeated and useless calls with Z_FINISH, we keep
1338
		; returning Z_STREAM_END instead of Z_BUF_ERROR.
1338
		; returning Z_STREAM_END instead of Z_BUF_ERROR.
1339
		jmp @f
1339
		jmp @f
1340
	.end13:
1340
	.end13:
1341
	cmp word[ebx+z_stream.avail_in],0
1341
	cmp dword[ebx+z_stream.avail_in],0
1342
	jne @f
1342
	jne @f
1343
	RANK dword[old_flush],esi
1343
	RANK dword[old_flush],esi
1344
	RANK dword[flush],eax
1344
	RANK dword[flush],eax
1345
	cmp eax,esi
1345
	cmp eax,esi
1346
	jg @f
1346
	jg @f
Line 1351... Line 1351...
1351
	@@:
1351
	@@:
Line 1352... Line 1352...
1352
 
1352
 
1353
	; User must not provide more input after the first FINISH:
1353
	; User must not provide more input after the first FINISH:
1354
	cmp dword[edi+deflate_state.status],FINISH_STATE
1354
	cmp dword[edi+deflate_state.status],FINISH_STATE
1355
	jne @f
1355
	jne @f
1356
	cmp word[ebx+z_stream.avail_in],0
1356
	cmp dword[ebx+z_stream.avail_in],0
1357
	je @f ;if (..==.. && ..!=0)
1357
	je @f ;if (..==.. && ..!=0)
1358
		ERR_RETURN ebx, Z_BUF_ERROR
1358
		ERR_RETURN ebx, Z_BUF_ERROR
1359
		jmp .end_f
1359
		jmp .end_f
Line 1360... Line 1360...
1360
	@@:
1360
	@@:
Line 1361... Line 1361...
1361
 
1361
 
1362
	; Start a new block or continue the current one.
1362
	; Start a new block or continue the current one.
1363
 
1363
 
1364
	cmp word[ebx+z_stream.avail_in],0
1364
	cmp dword[ebx+z_stream.avail_in],0
1365
	jne @f
1365
	jne @f
1366
	cmp dword[edi+deflate_state.lookahead],0
1366
	cmp dword[edi+deflate_state.lookahead],0
Line 1660... Line 1660...
1660
;    Bytef *buf
1660
;    Bytef *buf
1661
;    unsigned size
1661
;    unsigned size
1662
align 4
1662
align 4
1663
proc read_buf uses ebx ecx, strm:dword, buf:dword, size:dword
1663
proc read_buf uses ebx ecx, strm:dword, buf:dword, size:dword
1664
	mov ebx,[strm]
1664
	mov ebx,[strm]
1665
	movzx eax,word[ebx+z_stream.avail_in]
1665
	mov eax,[ebx+z_stream.avail_in]
Line 1666... Line 1666...
1666
 
1666
 
1667
	cmp eax,[size]
1667
	cmp eax,[size]
1668
	jle @f ;if (..>..)
1668
	jle @f ;if (..>..)
1669
		mov eax,[size]
1669
		mov eax,[size]
Line 1672... Line 1672...
1672
	jg @f
1672
	jg @f
1673
		xor eax,eax
1673
		xor eax,eax
1674
		jmp .end_f ;if (..==0) return 0
1674
		jmp .end_f ;if (..==0) return 0
1675
	@@:
1675
	@@:
Line 1676... Line 1676...
1676
 
1676
 
Line 1677... Line 1677...
1677
	sub [ebx+z_stream.avail_in],ax
1677
	sub [ebx+z_stream.avail_in],eax
1678
 
1678
 
1679
	stdcall zmemcpy, [buf],[ebx+z_stream.next_in],eax
1679
	stdcall zmemcpy, [buf],[ebx+z_stream.next_in],eax
1680
	mov ecx,[ebx+z_stream.state]
1680
	mov ecx,[ebx+z_stream.state]
Line 2076... Line 2076...
2076
			loop .cycle2 ;while (..)
2076
			loop .cycle2 ;while (..)
2077
end if
2077
end if
2078
			pop ecx ebx
2078
			pop ecx ebx
2079
			add ebx,ecx
2079
			add ebx,ecx
2080
		.end0:
2080
		.end0:
2081
		cmp word[edx+z_stream.avail_in],0
2081
		cmp dword[edx+z_stream.avail_in],0
2082
		je .cycle0end ;if (..==0) break
2082
		je .cycle0end ;if (..==0) break
Line 2083... Line 2083...
2083
 
2083
 
2084
		; If there was no sliding:
2084
		; If there was no sliding:
2085
		;    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
2085
		;    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
Line 2155... Line 2155...
2155
		; If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
2155
		; If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
2156
		; but this is not important since only literal bytes will be emitted.
2156
		; but this is not important since only literal bytes will be emitted.
Line 2157... Line 2157...
2157
 
2157
 
2158
		cmp dword[edi+deflate_state.lookahead],MIN_LOOKAHEAD
2158
		cmp dword[edi+deflate_state.lookahead],MIN_LOOKAHEAD
2159
		jge .cycle0end
2159
		jge .cycle0end
2160
		cmp word[edx+z_stream.avail_in],0
2160
		cmp dword[edx+z_stream.avail_in],0
2161
		jne .cycle0
2161
		jne .cycle0
Line 2162... Line 2162...
2162
	.cycle0end: ;while (..<.. && ..!=..)
2162
	.cycle0end: ;while (..<.. && ..!=..)
2163
 
2163