Rev 1921 | Rev 2397 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1921 | Rev 2388 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;================================================================================================;; |
1 | ;;================================================================================================;; |
2 | ;;//// pcx.asm //// (c) dunkaist, 2010 ///////////////////////////////////////////////////////////;; |
2 | ;;//// pcx.asm //// (c) dunkaist, 2010,2012 //////////////////////////////////////////////////////;; |
3 | ;;================================================================================================;; |
3 | ;;================================================================================================;; |
4 | ;; ;; |
4 | ;; ;; |
5 | ;; This file is part of Common development libraries (Libs-Dev). ;; |
5 | ;; This file is part of Common development libraries (Libs-Dev). ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;; |
7 | ;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;; |
Line 57... | Line 57... | ||
57 | inc eax |
57 | inc eax |
Line 58... | Line 58... | ||
58 | 58 | ||
59 | .is_not_pcx: |
59 | .is_not_pcx: |
60 | pop edi ecx |
60 | pop edi ecx |
61 | ret |
- | |
62 | 61 | ret |
|
Line -... | Line 62... | ||
- | 62 | endp |
|
63 | endp |
63 | |
64 | 64 | ||
65 | ;;================================================================================================;; |
65 | ;;================================================================================================;; |
66 | proc img.decode.pcx _data, _length, _options ;////////////////////////////////////////////////////;; |
66 | proc img.decode.pcx _data, _length, _options ;////////////////////////////////////////////////////;; |
67 | ;;------------------------------------------------------------------------------------------------;; |
67 | ;;------------------------------------------------------------------------------------------------;; |
Line 138... | Line 138... | ||
138 | mov ebx, [total_bpl] |
138 | mov ebx, [total_bpl] |
Line 139... | Line 139... | ||
139 | 139 | ||
140 | ._24bit.begin: |
140 | ._24bit.begin: |
141 | mov ax, word[bpl] |
141 | mov ax, word[bpl] |
142 | ._24bit.decode: |
142 | ._24bit.decode: |
143 | call get_byte |
143 | call pcx._.get_byte |
144 | ._24bit.write_sequence: |
144 | ._24bit.write_sequence: |
145 | mov [edi], dl |
145 | mov [edi], dl |
146 | dec ax |
146 | dec ax |
147 | add edi, [nplanes] |
147 | add edi, [nplanes] |
Line 205... | Line 205... | ||
205 | mov edi, [eax+Image.Data] |
205 | mov edi, [eax + Image.Data] |
Line 206... | Line 206... | ||
206 | 206 | ||
207 | .indexed.begin: |
207 | .indexed.begin: |
208 | mov ax, word[bpl] |
208 | mov ax, word[bpl] |
209 | .indexed.decode: |
209 | .indexed.decode: |
210 | call get_byte |
210 | call pcx._.get_byte |
211 | .indexed.write_sequence: |
211 | .indexed.write_sequence: |
212 | mov [edi], dl |
212 | mov [edi], dl |
213 | inc edi |
213 | inc edi |
214 | dec ax |
214 | dec ax |
Line 254... | Line 254... | ||
254 | .monochrome.begin: |
254 | .monochrome.begin: |
255 | mov ebx, [total_bpl] |
255 | mov ebx, [total_bpl] |
256 | mov ax, [xsize] |
256 | mov ax, [xsize] |
Line 257... | Line 257... | ||
257 | 257 | ||
258 | .monochrome.decode: |
258 | .monochrome.decode: |
259 | call get_byte |
259 | call pcx._.get_byte |
260 | .monochrome.write_sequence: |
260 | .monochrome.write_sequence: |
261 | mov [edi], dl |
261 | mov [edi], dl |
262 | inc edi |
262 | inc edi |
263 | cmp ax, 8 |
263 | cmp ax, 8 |
Line 268... | Line 268... | ||
268 | jmp .monochrome.decode |
268 | jmp .monochrome.decode |
Line 269... | Line 269... | ||
269 | 269 | ||
270 | .monochrome.is_last_byte_in_line: |
270 | .monochrome.is_last_byte_in_line: |
271 | test ebx, ebx |
271 | test ebx, ebx |
272 | jng @f |
272 | jng @f |
273 | call get_byte |
273 | call pcx._.get_byte |
274 | jmp .monochrome.is_last_byte_in_line |
274 | jmp .monochrome.is_last_byte_in_line |
275 | @@: |
275 | @@: |
276 | dec word[ysize] |
276 | dec word[ysize] |
277 | jnz .monochrome.begin |
277 | jnz .monochrome.begin |
Line 280... | Line 280... | ||
280 | 280 | ||
281 | .quit: |
281 | .quit: |
282 | popa |
282 | popa |
283 | mov eax, [retvalue] |
283 | mov eax, [retvalue] |
284 | ret |
- | |
285 | 284 | ret |
|
Line 286... | Line -... | ||
286 | endp |
- | |
287 | 285 | endp |
|
288 | 286 | ||
289 | 287 | ||
290 | ;;================================================================================================;; |
288 | ;;================================================================================================;; |
291 | proc img.encode.pcx _img, _p_length, _options ;///////////////////////////////////////////////////;; |
289 | proc img.encode.pcx _img, _p_length, _options ;///////////////////////////////////////////////////;; |
Line 307... | Line 305... | ||
307 | ;;================================================================================================;; |
305 | ;;================================================================================================;; |
308 | ;! Below are private procs you should never call directly from your code ;; |
306 | ;! Below are private procs you should never call directly from your code ;; |
309 | ;;================================================================================================;; |
307 | ;;================================================================================================;; |
310 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
308 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
311 | ;;================================================================================================;; |
309 | ;;================================================================================================;; |
312 | proc get_byte |
310 | proc pcx._.get_byte |
Line 313... | Line 311... | ||
313 | 311 | ||
314 | mov dh, byte[esi] |
312 | mov dh, byte[esi] |
315 | inc esi |
313 | inc esi |
316 | cmp dh, 0xC0 |
314 | cmp dh, 0xC0 |
Line 323... | Line 321... | ||
323 | mov dl, byte[esi] |
321 | mov dl, byte[esi] |
324 | inc esi |
322 | inc esi |
325 | .exit1: |
323 | .exit1: |
326 | movzx ecx, dh |
324 | movzx ecx, dh |
327 | sub ebx, ecx |
325 | sub ebx, ecx |
328 | - | ||
329 | ret |
326 | ret |
330 | endp |
327 | endp |
- | 328 | ||
- | 329 | ||
331 | ;;================================================================================================;; |
330 | ;;================================================================================================;; |
332 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
331 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
333 | ;;================================================================================================;; |
332 | ;;================================================================================================;; |
334 | ;! Below is private data you should never use directly from your code ;; |
333 | ;! Below is private data you should never use directly from your code ;; |
335 | ;;================================================================================================;; |
334 | ;;================================================================================================;; |
336 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
335 | ;;////////////////////////////////////////////////////////////////////////////////////////////////;; |
337 | ;;================================================================================================;; |
336 | ;;================================================================================================;;>>>> |
338 | - | ||
339 | ;>>>> |
- | |
340 | 337 |