Rev 2177 | Rev 2230 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2177 | Rev 2185 | ||
---|---|---|---|
1 | format MS COFF |
1 | format MS COFF |
2 | public EXPORTS |
2 | public EXPORTS |
3 | section '.flat' code readable align 16 |
3 | section '.flat' code readable align 16 |
4 | 4 | ||
5 | include '../../../../macros.inc' |
5 | include '../../../../macros.inc' |
6 | include '../../../../proc32.inc' |
6 | include '../../../../proc32.inc' |
7 | 7 | ||
8 | ;----------------------------------------------------------------------------- |
8 | ;----------------------------------------------------------------------------- |
9 | mem.alloc dd ? ;äãªæ¨ï ¤«ï ¢ë¤¥«¥¨ï ¯ ¬ï⨠|
9 | mem.alloc dd ? ;äãªæ¨ï ¤«ï ¢ë¤¥«¥¨ï ¯ ¬ï⨠|
10 | mem.free dd ? ;äãªæ¨ï ¤«ï ®á¢®¡®¦¤¥¨ï ¯ ¬ï⨠|
10 | mem.free dd ? ;äãªæ¨ï ¤«ï ®á¢®¡®¦¤¥¨ï ¯ ¬ï⨠|
11 | mem.realloc dd ? ;äãªæ¨ï ¤«ï ¯¥à¥à á¯à¥¤¥«¥¨ï ¯ ¬ï⨠|
11 | mem.realloc dd ? ;äãªæ¨ï ¤«ï ¯¥à¥à á¯à¥¤¥«¥¨ï ¯ ¬ï⨠|
12 | dll.load dd ? |
12 | dll.load dd ? |
13 | 13 | ||
14 | BUF_STRUCT_SIZE equ 21 |
14 | BUF_STRUCT_SIZE equ 21 |
15 | buf2d_data equ dword[edi] ;¤ ë¥ ¡ãä¥à ¨§®¡à ¦¥¨ï |
15 | buf2d_data equ dword[edi] ;¤ ë¥ ¡ãä¥à ¨§®¡à ¦¥¨ï |
16 | buf2d_w equ dword[edi+8] ;è¨à¨ ¡ãä¥à |
16 | buf2d_w equ dword[edi+8] ;è¨à¨ ¡ãä¥à |
17 | buf2d_h equ dword[edi+12] ;¢ëá®â ¡ãä¥à |
17 | buf2d_h equ dword[edi+12] ;¢ëá®â ¡ãä¥à |
18 | buf2d_l equ word[edi+4] |
18 | buf2d_l equ word[edi+4] |
19 | buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã |
19 | buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã |
20 | buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢ ¨ á¯à ¢ ¤«ï ¡ãä¥à |
20 | buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢ ¨ á¯à ¢ ¤«ï ¡ãä¥à |
21 | buf2d_color equ dword[edi+16] ;梥â ä® ¡ãä¥à |
21 | buf2d_color equ dword[edi+16] ;梥â ä® ¡ãä¥à |
22 | buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥¨ï |
22 | buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥¨ï |
23 | 23 | ||
24 | struct buf_2d_header |
24 | struct buf_2d_header |
25 | img_data dd ? |
25 | img_data dd ? |
26 | left dw ? ;+4 left |
26 | left dw ? ;+4 left |
27 | top dw ? ;+6 top |
27 | top dw ? ;+6 top |
28 | size_x dd ? ;+8 w |
28 | size_x dd ? ;+8 w |
29 | size_y dd ? ;+12 h |
29 | size_y dd ? ;+12 h |
30 | color dd ? ;+16 color |
30 | color dd ? ;+16 color |
31 | bit_pp db ? ;+21 bit in pixel |
31 | bit_pp db ? ;+21 bit in pixel |
32 | ends |
32 | ends |
33 | 33 | ||
34 | macro swap v1, v2 { |
34 | macro swap v1, v2 { |
35 | push v1 |
35 | push v1 |
36 | push v2 |
36 | push v2 |
37 | pop v1 |
37 | pop v1 |
38 | pop v2 |
38 | pop v2 |
39 | } |
39 | } |
40 | 40 | ||
41 | ;ä« £¨, ¤«ï äãªæ¨¨ ®¡à¥§ ¨ï ¡ãä¥à |
41 | ;ä« £¨, ¤«ï äãªæ¨¨ ®¡à¥§ ¨ï ¡ãä¥à |
42 | BUF2D_OPT_CROP_TOP equ 1 ;®¡à¥§ª ᢥàåã |
42 | BUF2D_OPT_CROP_TOP equ 1 ;®¡à¥§ª ᢥàåã |
43 | BUF2D_OPT_CROP_LEFT equ 2 ;®¡à¥§ª á«¥¢ |
43 | BUF2D_OPT_CROP_LEFT equ 2 ;®¡à¥§ª á«¥¢ |
44 | BUF2D_OPT_CROP_BOTTOM equ 4 ;®¡à¥§ª ᨧã |
44 | BUF2D_OPT_CROP_BOTTOM equ 4 ;®¡à¥§ª ᨧã |
45 | BUF2D_OPT_CROP_RIGHT equ 8 ;®¡à¥§ª á¯à ¢ |
45 | BUF2D_OPT_CROP_RIGHT equ 8 ;®¡à¥§ª á¯à ¢ |
46 | BUF2D_BIT_OPT_CROP_TOP equ 0 |
46 | BUF2D_BIT_OPT_CROP_TOP equ 0 |
47 | BUF2D_BIT_OPT_CROP_LEFT equ 1 |
47 | BUF2D_BIT_OPT_CROP_LEFT equ 1 |
48 | BUF2D_BIT_OPT_CROP_BOTTOM equ 2 |
48 | BUF2D_BIT_OPT_CROP_BOTTOM equ 2 |
49 | BUF2D_BIT_OPT_CROP_RIGHT equ 3 |
49 | BUF2D_BIT_OPT_CROP_RIGHT equ 3 |
50 | 50 | ||
51 | ;input: |
51 | ;input: |
52 | ; eax = 㪠§ ⥫ì äãªæ¨î ¢ë¤¥«¥¨ï ¯ ¬ï⨠|
52 | ; eax = 㪠§ ⥫ì äãªæ¨î ¢ë¤¥«¥¨ï ¯ ¬ï⨠|
53 | ; ebx = ... ®á¢®¡®¦¤¥¨ï ¯ ¬ï⨠|
53 | ; ebx = ... ®á¢®¡®¦¤¥¨ï ¯ ¬ï⨠|
54 | ; ecx = ... ¯¥à¥à á¯à¥¤¥«¥¨ï ¯ ¬ï⨠|
54 | ; ecx = ... ¯¥à¥à á¯à¥¤¥«¥¨ï ¯ ¬ï⨠|
55 | ; edx = ... § £à㧪¨ ¡¨¡«¨®â¥ª¨ (¯®ª ¥ ¨á¯®«ì§ã¥âáï) |
55 | ; edx = ... § £à㧪¨ ¡¨¡«¨®â¥ª¨ (¯®ª ¥ ¨á¯®«ì§ã¥âáï) |
56 | align 16 |
56 | align 16 |
57 | lib_init: |
57 | lib_init: |
58 | mov dword[mem.alloc], eax |
58 | mov dword[mem.alloc], eax |
59 | mov dword[mem.free], ebx |
59 | mov dword[mem.free], ebx |
60 | mov dword[mem.realloc], ecx |
60 | mov dword[mem.realloc], ecx |
61 | mov dword[dll.load], edx |
61 | mov dword[dll.load], edx |
62 | ret |
62 | ret |
63 | 63 | ||
64 | ;input: |
64 | ;input: |
65 | ; ebx = coord x |
65 | ; ebx = coord x |
66 | ; ecx = coord y |
66 | ; ecx = coord y |
67 | ; edx = pixel color |
67 | ; edx = pixel color |
68 | ; edi = pointer to buffer struct |
68 | ; edi = pointer to buffer struct |
69 | align 4 |
69 | align 4 |
70 | draw_pixel: |
70 | draw_pixel: |
71 | ;cmp buf2d_bits,24 |
71 | ;cmp buf2d_bits,24 |
72 | ;jne @f |
72 | ;jne @f |
73 | bt ebx,31 |
73 | bt ebx,31 |
74 | jc @f |
74 | jc @f |
75 | bt ecx,31 |
75 | bt ecx,31 |
76 | jc @f |
76 | jc @f |
77 | cmp ebx,buf2d_w |
77 | cmp ebx,buf2d_w |
78 | jge @f |
78 | jge @f |
79 | cmp ecx,buf2d_h |
79 | cmp ecx,buf2d_h |
80 | jge @f |
80 | jge @f |
81 | push esi |
81 | push esi |
82 | mov esi,buf2d_w ;size x |
82 | mov esi,buf2d_w ;size x |
83 | imul esi,ecx ;size_x*y |
83 | imul esi,ecx ;size_x*y |
84 | add esi,ebx ;size_x*y+x |
84 | add esi,ebx ;size_x*y+x |
85 | lea esi,[esi+esi*2] ;(size_x*y+x)*3 |
85 | lea esi,[esi+esi*2] ;(size_x*y+x)*3 |
86 | add esi,buf2d_data ;ptr+(size_x*y+x)*3 |
86 | add esi,buf2d_data ;ptr+(size_x*y+x)*3 |
87 | 87 | ||
88 | mov word[esi],dx ;copy pixel color |
88 | mov word[esi],dx ;copy pixel color |
89 | ror edx,16 |
89 | ror edx,16 |
90 | mov byte[esi+2],dl |
90 | mov byte[esi+2],dl |
91 | ror edx,16 |
91 | ror edx,16 |
92 | pop esi |
92 | pop esi |
93 | @@: |
93 | @@: |
94 | ret |
94 | ret |
95 | 95 | ||
96 | ;input: |
96 | ;input: |
97 | ; ebx = coord x |
97 | ; ebx = coord x |
98 | ; ecx = coord y |
98 | ; ecx = coord y |
99 | ; edi = pointer to buffer struct |
99 | ; edi = pointer to buffer struct |
100 | ;output: |
100 | ;output: |
101 | ; eax = 梥â â®çª¨ |
101 | ; eax = 梥â â®çª¨ |
102 | ; ¢ á«ãç ¥ ®è¨¡ª¨ eax = 0xffffffff |
102 | ; ¢ á«ãç ¥ ®è¨¡ª¨ eax = 0xffffffff |
103 | align 4 |
103 | align 4 |
104 | get_pixel_24: |
104 | get_pixel_24: |
105 | mov eax,0xffffffff |
105 | mov eax,0xffffffff |
106 | 106 | ||
107 | bt ebx,31 |
107 | bt ebx,31 |
108 | jc @f |
108 | jc @f |
109 | bt ecx,31 |
109 | bt ecx,31 |
110 | jc @f |
110 | jc @f |
111 | cmp ebx,buf2d_w |
111 | cmp ebx,buf2d_w |
112 | jge @f |
112 | jge @f |
113 | cmp ecx,buf2d_h |
113 | cmp ecx,buf2d_h |
114 | jge @f |
114 | jge @f |
115 | push esi |
115 | push esi |
116 | mov esi,buf2d_w ;size x |
116 | mov esi,buf2d_w ;size x |
117 | imul esi,ecx ;size_x*y |
117 | imul esi,ecx ;size_x*y |
118 | add esi,ebx ;size_x*y+x |
118 | add esi,ebx ;size_x*y+x |
119 | lea esi,[esi+esi*2] ;(size_x*y+x)*3 |
119 | lea esi,[esi+esi*2] ;(size_x*y+x)*3 |
120 | add esi,buf2d_data ;ptr+(size_x*y+x)*3 |
120 | add esi,buf2d_data ;ptr+(size_x*y+x)*3 |
121 | 121 | ||
122 | xor eax,eax |
122 | xor eax,eax |
123 | mov ax,word[esi] ;copy pixel color |
123 | mov ax,word[esi] ;copy pixel color |
124 | ror eax,16 |
124 | ror eax,16 |
125 | mov al,byte[esi+2] |
125 | mov al,byte[esi+2] |
126 | ror eax,16 |
126 | ror eax,16 |
127 | pop esi |
127 | pop esi |
128 | @@: |
128 | @@: |
129 | ret |
129 | ret |
130 | 130 | ||
131 | 131 | ||
132 | ;ᮧ¤ ¨¥ ¡ãä¥à |
132 | ;ᮧ¤ ¨¥ ¡ãä¥à |
133 | align 4 |
133 | align 4 |
134 | proc buf_create, buf_struc:dword |
134 | proc buf_create, buf_struc:dword |
135 | pushad |
135 | pushad |
136 | mov edi,dword[buf_struc] |
136 | mov edi,dword[buf_struc] |
137 | mov ecx,buf2d_w |
137 | mov ecx,buf2d_w |
138 | mov ebx,buf2d_h |
138 | mov ebx,buf2d_h |
139 | imul ecx,ebx |
139 | imul ecx,ebx |
140 | cmp buf2d_bits,24 |
140 | cmp buf2d_bits,24 |
141 | jne @f |
141 | jne @f |
142 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
142 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
143 | ;;;inc ecx ;§ ¯ ᮩ ¡ ©â ¢ ª®æ¥ ¡ãä¥à , çâ®-¡ë ¥ £«î稫¨ ¥ª®â®àë¥ äãªæ¨¨ ¨§®¡à ¦¥¨ïå ªà âëå 4 |
143 | ;;;inc ecx ;§ ¯ ᮩ ¡ ©â ¢ ª®æ¥ ¡ãä¥à , çâ®-¡ë ¥ £«î稫¨ ¥ª®â®àë¥ äãªæ¨¨ ¨§®¡à ¦¥¨ïå ªà âëå 4 |
144 | @@: |
144 | @@: |
145 | cmp buf2d_bits,32 |
145 | cmp buf2d_bits,32 |
146 | jne @f |
146 | jne @f |
147 | shl ecx,2 ; 32 bit = 4 |
147 | shl ecx,2 ; 32 bit = 4 |
148 | @@: |
148 | @@: |
149 | invoke mem.alloc,ecx |
149 | invoke mem.alloc,ecx |
150 | mov buf2d_data,eax |
150 | mov buf2d_data,eax |
151 | 151 | ||
152 | stdcall buf_clear,edi,buf2d_color ;®ç¨á⪠¡ãä¥à ä®®¢ë¬ 梥⮬ |
152 | stdcall buf_clear,edi,buf2d_color ;®ç¨á⪠¡ãä¥à ä®®¢ë¬ 梥⮬ |
153 | popad |
153 | popad |
154 | ret |
154 | ret |
155 | endp |
155 | endp |
156 | 156 | ||
157 | ;ᮧ¤ ¨¥ ¡ãä¥à ®á®¢¥ ¨§®¡à ¦¥¨ï rgb |
157 | ;ᮧ¤ ¨¥ ¡ãä¥à ®á®¢¥ ¨§®¡à ¦¥¨ï rgb |
158 | align 4 |
158 | align 4 |
159 | proc buf_create_f_img, buf_struc:dword, rgb_data:dword |
159 | proc buf_create_f_img, buf_struc:dword, rgb_data:dword |
160 | pushad |
160 | pushad |
161 | mov edi,dword[buf_struc] |
161 | mov edi,dword[buf_struc] |
162 | mov ecx,buf2d_w |
162 | mov ecx,buf2d_w |
163 | mov ebx,buf2d_h |
163 | mov ebx,buf2d_h |
164 | imul ecx,ebx |
164 | imul ecx,ebx |
165 | cmp buf2d_bits,24 |
165 | cmp buf2d_bits,24 |
166 | jne @f |
166 | jne @f |
167 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
167 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
168 | ;;;inc ecx ;§ ¯ ᮩ ¡ ©â ¢ ª®æ¥ ¡ãä¥à , çâ®-¡ë ¥ £«î稫¨ ¥ª®â®àë¥ äãªæ¨¨ ¨§®¡à ¦¥¨ïå ªà âëå 4 |
168 | ;;;inc ecx ;§ ¯ ᮩ ¡ ©â ¢ ª®æ¥ ¡ãä¥à , çâ®-¡ë ¥ £«î稫¨ ¥ª®â®àë¥ äãªæ¨¨ ¨§®¡à ¦¥¨ïå ªà âëå 4 |
169 | @@: |
169 | @@: |
170 | cmp buf2d_bits,32 |
170 | cmp buf2d_bits,32 |
171 | jne @f |
171 | jne @f |
172 | shl ecx,2 ; 32 bit = 4 |
172 | shl ecx,2 ; 32 bit = 4 |
173 | @@: |
173 | @@: |
174 | invoke mem.alloc,ecx |
174 | invoke mem.alloc,ecx |
175 | mov buf2d_data,eax |
175 | mov buf2d_data,eax |
176 | 176 | ||
177 | cmp buf2d_bits,24 |
177 | cmp buf2d_bits,24 |
178 | jne @f |
178 | jne @f |
179 | cld |
179 | cld |
180 | mov esi,[rgb_data] |
180 | mov esi,[rgb_data] |
181 | mov edi,eax ;eax=buf2d_data |
181 | mov edi,eax ;eax=buf2d_data |
182 | rep movsb ;ª®¯¨à㥬 ¡¨âë ¨§®¡à ¦¥¨ï ¢ ¡ãä¥à |
182 | rep movsb ;ª®¯¨à㥬 ¡¨âë ¨§®¡à ¦¥¨ï ¢ ¡ãä¥à |
183 | jmp .end_create |
183 | jmp .end_create |
184 | @@: |
184 | @@: |
185 | stdcall buf_clear,edi,buf2d_color ;®ç¨á⪠¡ãä¥à ä®®¢ë¬ 梥⮬ |
185 | stdcall buf_clear,edi,buf2d_color ;®ç¨á⪠¡ãä¥à ä®®¢ë¬ 梥⮬ |
186 | .end_create: |
186 | .end_create: |
187 | popad |
187 | popad |
188 | ret |
188 | ret |
189 | endp |
189 | endp |
190 | 190 | ||
191 | align 4 |
191 | align 4 |
192 | proc buf_clear, buf_struc:dword, color:dword ;®ç¨á⪠¡ãä¥à § ¤ ë¬ æ¢¥â®¬ |
192 | proc buf_clear, buf_struc:dword, color:dword ;®ç¨á⪠¡ãä¥à § ¤ ë¬ æ¢¥â®¬ |
193 | pushad |
193 | pushad |
194 | mov edi,dword[buf_struc] |
194 | mov edi,dword[buf_struc] |
195 | 195 | ||
196 | mov ecx,buf2d_w |
196 | mov ecx,buf2d_w |
197 | mov ebx,buf2d_h |
197 | mov ebx,buf2d_h |
198 | imul ecx,ebx |
198 | imul ecx,ebx |
199 | 199 | ||
200 | cld |
200 | cld |
201 | 201 | ||
202 | cmp buf2d_bits,8 |
202 | cmp buf2d_bits,8 |
203 | jne .end_clear_8 |
203 | jne .end_clear_8 |
204 | mov edi,buf2d_data |
204 | mov edi,buf2d_data |
205 | mov al,byte[color] |
205 | mov al,byte[color] |
206 | rep stosb |
206 | rep stosb |
207 | jmp .end_clear_32 |
207 | jmp .end_clear_32 |
208 | .end_clear_8: |
208 | .end_clear_8: |
209 | 209 | ||
210 | cmp buf2d_bits,24 |
210 | cmp buf2d_bits,24 |
211 | jne .end_clear_24 |
211 | jne .end_clear_24 |
212 | mov edi,buf2d_data |
212 | mov edi,buf2d_data |
213 | mov eax,dword[color] |
213 | mov eax,dword[color] |
214 | mov ebx,eax |
214 | mov ebx,eax |
215 | shr ebx,16 |
215 | shr ebx,16 |
216 | @@: |
216 | @@: |
217 | stosw |
217 | stosw |
218 | mov byte[edi],bl |
218 | mov byte[edi],bl |
219 | inc edi |
219 | inc edi |
220 | loop @b |
220 | loop @b |
221 | jmp .end_clear_32 |
221 | jmp .end_clear_32 |
222 | .end_clear_24: |
222 | .end_clear_24: |
223 | 223 | ||
224 | cmp buf2d_bits,32 |
224 | cmp buf2d_bits,32 |
225 | jne .end_clear_32 |
225 | jne .end_clear_32 |
226 | mov edi,buf2d_data |
226 | mov edi,buf2d_data |
227 | mov eax,dword[color] |
227 | mov eax,dword[color] |
228 | rep stosd |
228 | rep stosd |
229 | ;jmp .end_clear_32 |
229 | ;jmp .end_clear_32 |
230 | .end_clear_32: |
230 | .end_clear_32: |
231 | popad |
231 | popad |
232 | ret |
232 | ret |
233 | endp |
233 | endp |
234 | 234 | ||
235 | ;äãªæ¨ï ¤«ï ®¡à¥§ ¨ï ¡ãä¥à®¢ 8 ¨ 24 ¡¨âëå, ¯® § ¤ ®¬ã 梥âã. |
235 | ;äãªæ¨ï ¤«ï ®¡à¥§ ¨ï ¡ãä¥à®¢ 8 ¨ 24 ¡¨âëå, ¯® § ¤ ®¬ã 梥âã. |
236 | ;¯ à ¬¥âà opt § ¤ ¥âáï ª®¬¡¨ 樥© ª®áâ â: |
236 | ;¯ à ¬¥âà opt § ¤ ¥âáï ª®¬¡¨ 樥© ª®áâ â: |
237 | ; BUF2D_OPT_CROP_TOP - ®¡à¥§ª ᢥàåã |
237 | ; BUF2D_OPT_CROP_TOP - ®¡à¥§ª ᢥàåã |
238 | ; BUF2D_OPT_CROP_LEFT - ®¡à¥§ª á«¥¢ |
238 | ; BUF2D_OPT_CROP_LEFT - ®¡à¥§ª á«¥¢ |
239 | ; BUF2D_OPT_CROP_BOTTOM - ®¡à¥§ª ᨧã |
239 | ; BUF2D_OPT_CROP_BOTTOM - ®¡à¥§ª ᨧã |
240 | ; BUF2D_OPT_CROP_RIGHT - ®¡à¥§ª á¯à ¢ |
240 | ; BUF2D_OPT_CROP_RIGHT - ®¡à¥§ª á¯à ¢ |
241 | align 4 |
241 | align 4 |
242 | proc buf_crop_color, buf_struc:dword, color:dword, opt:dword |
242 | proc buf_crop_color, buf_struc:dword, color:dword, opt:dword |
243 | locals |
243 | locals |
244 | crop_r dd ? |
244 | crop_r dd ? |
245 | endl |
245 | endl |
246 | pushad |
246 | pushad |
247 | mov edi,dword[buf_struc] |
247 | mov edi,dword[buf_struc] |
248 | cmp buf2d_bits,24 |
248 | cmp buf2d_bits,24 |
249 | jne .24end_f |
249 | jne .24end_f |
250 | 250 | ||
251 | bt dword[opt],BUF2D_BIT_OPT_CROP_BOTTOM |
251 | bt dword[opt],BUF2D_BIT_OPT_CROP_BOTTOM |
252 | jae .24no_crop_bottom |
252 | jae .24no_crop_bottom |
253 | mov eax,dword[color] |
253 | mov eax,dword[color] |
254 | mov edx,eax ;ax = colors - r,g |
254 | mov edx,eax ;ax = colors - r,g |
255 | shr edx,16 ;dl = color - b |
255 | shr edx,16 ;dl = color - b |
256 | mov ecx,buf2d_h |
256 | mov ecx,buf2d_h |
257 | cmp ecx,1 |
257 | cmp ecx,1 |
258 | jle .24no_crop_bottom ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
258 | jle .24no_crop_bottom ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
259 | mov ebx,buf2d_w |
259 | mov ebx,buf2d_w |
260 | imul ecx,ebx |
260 | imul ecx,ebx |
261 | lea esi,[ecx+ecx*2] ;esi=3*ecx |
261 | lea esi,[ecx+ecx*2] ;esi=3*ecx |
262 | add esi,buf2d_data |
262 | add esi,buf2d_data |
263 | cld |
263 | cld |
264 | @@: |
264 | @@: |
265 | sub esi,3 |
265 | sub esi,3 |
266 | cmp word[esi],ax |
266 | cmp word[esi],ax |
267 | jne @f |
267 | jne @f |
268 | cmp byte[esi+2],dl |
268 | cmp byte[esi+2],dl |
269 | jne @f |
269 | jne @f |
270 | loop @b |
270 | loop @b |
271 | @@: |
271 | @@: |
272 | lea ebx,[ebx+ebx*2] |
272 | lea ebx,[ebx+ebx*2] |
273 | xor edx,edx |
273 | xor edx,edx |
274 | mov eax,buf2d_h |
274 | mov eax,buf2d_h |
275 | imul eax,ebx |
275 | imul eax,ebx |
276 | add eax,buf2d_data ;eax - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
276 | add eax,buf2d_data ;eax - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
277 | @@: |
277 | @@: |
278 | add esi,ebx |
278 | add esi,ebx |
279 | cmp esi,eax |
279 | cmp esi,eax |
280 | jge @f |
280 | jge @f |
281 | inc edx ;¢ëç¨á«ï¥¬ ç¨á«® ¯®«ëå áâப ¤«ï ®¡à¥§ ¨ï |
281 | inc edx ;¢ëç¨á«ï¥¬ ç¨á«® ¯®«ëå áâப ¤«ï ®¡à¥§ ¨ï |
282 | loop @b |
282 | loop @b |
283 | @@: |
283 | @@: |
284 | cmp edx,0 |
284 | cmp edx,0 |
285 | je .24no_crop_bottom |
285 | je .24no_crop_bottom |
286 | cmp edx,buf2d_h |
286 | cmp edx,buf2d_h |
287 | jge .24no_crop_bottom ;çâ®-¡ë ¥ ¯®«ãç¨âì ¯ãá⮩ ¡ãä¥à |
287 | jge .24no_crop_bottom ;çâ®-¡ë ¥ ¯®«ãç¨âì ¯ãá⮩ ¡ãä¥à |
288 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
288 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
289 | mov ecx,buf2d_h |
289 | mov ecx,buf2d_h |
290 | imul ecx,ebx ;ecx = ®¢ë© à §¬¥à ¨§®¡à ¦¥¨ï |
290 | imul ecx,ebx ;ecx = ®¢ë© à §¬¥à ¨§®¡à ¦¥¨ï |
291 | invoke mem.realloc,buf2d_data,ecx |
291 | invoke mem.realloc,buf2d_data,ecx |
292 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
292 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
293 | .24no_crop_bottom: |
293 | .24no_crop_bottom: |
294 | 294 | ||
295 | bt dword[opt],BUF2D_BIT_OPT_CROP_TOP |
295 | bt dword[opt],BUF2D_BIT_OPT_CROP_TOP |
296 | jae .24no_crop_top |
296 | jae .24no_crop_top |
297 | mov eax,dword[color] |
297 | mov eax,dword[color] |
298 | mov edx,eax ;ax = colors - r,g |
298 | mov edx,eax ;ax = colors - r,g |
299 | shr edx,16 ;dl = color - b |
299 | shr edx,16 ;dl = color - b |
300 | mov esi,buf2d_data |
300 | mov esi,buf2d_data |
301 | mov ecx,buf2d_h |
301 | mov ecx,buf2d_h |
302 | cmp ecx,1 |
302 | cmp ecx,1 |
303 | jle .24no_crop_top ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
303 | jle .24no_crop_top ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
304 | dec ecx ;¯à¨ ®¡à¥§ ¨¨ ¤®«¦ ®áâ âìáï ¬¨¨¬ã¬ 1- áâப ¯¨ªá¥«¥© |
304 | dec ecx ;¯à¨ ®¡à¥§ ¨¨ ¤®«¦ ®áâ âìáï ¬¨¨¬ã¬ 1- áâப ¯¨ªá¥«¥© |
305 | mov ebx,buf2d_w |
305 | mov ebx,buf2d_w |
306 | imul ecx,ebx |
306 | imul ecx,ebx |
307 | cld |
307 | cld |
308 | @@: |
308 | @@: |
309 | cmp word[esi],ax |
309 | cmp word[esi],ax |
310 | jne @f |
310 | jne @f |
311 | cmp byte[esi+2],dl |
311 | cmp byte[esi+2],dl |
312 | jne @f |
312 | jne @f |
313 | add esi,3 |
313 | add esi,3 |
314 | loop @b |
314 | loop @b |
315 | @@: |
315 | @@: |
316 | lea ebx,[ebx+ebx*2] |
316 | lea ebx,[ebx+ebx*2] |
317 | xor edx,edx |
317 | xor edx,edx |
318 | @@: |
318 | @@: |
319 | sub esi,ebx |
319 | sub esi,ebx |
320 | cmp esi,buf2d_data |
320 | cmp esi,buf2d_data |
321 | jl @f |
321 | jl @f |
322 | inc edx ;¢ëç¨á«ï¥¬ ç¨á«® ¯®«ëå áâப ¤«ï ®¡à¥§ ¨ï |
322 | inc edx ;¢ëç¨á«ï¥¬ ç¨á«® ¯®«ëå áâப ¤«ï ®¡à¥§ ¨ï |
323 | loop @b |
323 | loop @b |
324 | @@: |
324 | @@: |
325 | cmp edx,0 |
325 | cmp edx,0 |
326 | je .24no_crop_top |
326 | je .24no_crop_top |
327 | xor eax,eax |
327 | xor eax,eax |
328 | sub eax,edx |
328 | sub eax,edx |
329 | mov ebx,buf2d_h |
329 | mov ebx,buf2d_h |
330 | sub ebx,edx |
330 | sub ebx,edx |
331 | stdcall buf_offset_h, edi, eax, edx, ebx ;ᤢ¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢ ¡ãä¥à¥ ¢¢¥àå (eax<0) |
331 | stdcall buf_offset_h, edi, eax, edx, ebx ;ᤢ¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢ ¡ãä¥à¥ ¢¢¥àå (eax<0) |
332 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
332 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
333 | mov ecx,buf2d_h |
333 | mov ecx,buf2d_h |
334 | add buf2d_t,dx ;ᤢ¨£ ¥¬ ®âáâ㯠¢¨§, ç¨á«® ®¡à¥§ ëå áâப |
334 | add buf2d_t,dx ;ᤢ¨£ ¥¬ ®âáâ㯠¢¨§, ç¨á«® ®¡à¥§ ëå áâப |
335 | mov ebx,buf2d_w |
335 | mov ebx,buf2d_w |
336 | imul ecx,ebx |
336 | imul ecx,ebx |
337 | lea ecx,[ecx+ecx*2] |
337 | lea ecx,[ecx+ecx*2] |
338 | invoke mem.realloc,buf2d_data,ecx |
338 | invoke mem.realloc,buf2d_data,ecx |
339 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
339 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
340 | .24no_crop_top: |
340 | .24no_crop_top: |
341 | 341 | ||
342 | bt dword[opt],BUF2D_BIT_OPT_CROP_RIGHT |
342 | bt dword[opt],BUF2D_BIT_OPT_CROP_RIGHT |
343 | jae .24no_crop_right |
343 | jae .24no_crop_right |
344 | mov eax,dword[color] |
344 | mov eax,dword[color] |
345 | mov edx,eax ;ax = colors - r,g |
345 | mov edx,eax ;ax = colors - r,g |
346 | shr edx,16 ;dl = color - b |
346 | shr edx,16 ;dl = color - b |
347 | mov ebx,buf2d_w |
347 | mov ebx,buf2d_w |
348 | cmp ebx,1 |
348 | cmp ebx,1 |
349 | jle .24no_crop_right ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
349 | jle .24no_crop_right ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
350 | lea ebx,[ebx+ebx*2] |
350 | lea ebx,[ebx+ebx*2] |
351 | mov esi,ebx |
351 | mov esi,ebx |
352 | imul esi,buf2d_h |
352 | imul esi,buf2d_h |
353 | add esi,buf2d_data ;esi - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
353 | add esi,buf2d_data ;esi - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
354 | mov dword[crop_r],0 |
354 | mov dword[crop_r],0 |
355 | cld |
355 | cld |
356 | .24found_beg_right: |
356 | .24found_beg_right: |
357 | sub esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
357 | sub esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
358 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
358 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
359 | @@: |
359 | @@: |
360 | cmp word[esi],ax |
360 | cmp word[esi],ax |
361 | jne .24found_right |
361 | jne .24found_right |
362 | cmp byte[esi+2],dl |
362 | cmp byte[esi+2],dl |
363 | jne .24found_right |
363 | jne .24found_right |
364 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
364 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
365 | loop @b |
365 | loop @b |
366 | inc dword[crop_r] |
366 | inc dword[crop_r] |
367 | 367 | ||
368 | mov ecx,buf2d_w |
368 | mov ecx,buf2d_w |
369 | dec ecx ;1 ª®«®ª § ¯ á |
369 | dec ecx ;1 ª®«®ª § ¯ á |
370 | cmp dword[crop_r],ecx |
370 | cmp dword[crop_r],ecx |
371 | jge .24found_right |
371 | jge .24found_right |
372 | 372 | ||
373 | sub esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
373 | sub esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
374 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
374 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
375 | @@: |
375 | @@: |
376 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
376 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
377 | cmp word[esi],ax |
377 | cmp word[esi],ax |
378 | jne .24found_right |
378 | jne .24found_right |
379 | cmp byte[esi+2],dl |
379 | cmp byte[esi+2],dl |
380 | jne .24found_right |
380 | jne .24found_right |
381 | loop @b |
381 | loop @b |
382 | inc dword[crop_r] |
382 | inc dword[crop_r] |
383 | 383 | ||
384 | mov ecx,buf2d_w |
384 | mov ecx,buf2d_w |
385 | dec ecx ;1 ª®«®ª § ¯ á |
385 | dec ecx ;1 ª®«®ª § ¯ á |
386 | cmp dword[crop_r],ecx |
386 | cmp dword[crop_r],ecx |
387 | jl .24found_beg_right |
387 | jl .24found_beg_right |
388 | 388 | ||
389 | .24found_right: |
389 | .24found_right: |
390 | cmp dword[crop_r],0 |
390 | cmp dword[crop_r],0 |
391 | je .24no_crop_right |
391 | je .24no_crop_right |
392 | mov ecx,buf2d_w |
392 | mov ecx,buf2d_w |
393 | sub ecx,dword[crop_r] |
393 | sub ecx,dword[crop_r] |
394 | stdcall img_rgb_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
394 | stdcall img_rgb_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
395 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
395 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
396 | mov ebx,buf2d_h |
396 | mov ebx,buf2d_h |
397 | imul ecx,ebx |
397 | imul ecx,ebx |
398 | lea ecx,[ecx+ecx*2] |
398 | lea ecx,[ecx+ecx*2] |
399 | invoke mem.realloc,buf2d_data,ecx |
399 | invoke mem.realloc,buf2d_data,ecx |
400 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
400 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
401 | .24no_crop_right: |
401 | .24no_crop_right: |
402 | 402 | ||
403 | bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT |
403 | bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT |
404 | jae .24no_crop_left |
404 | jae .24no_crop_left |
405 | mov eax,dword[color] |
405 | mov eax,dword[color] |
406 | mov edx,eax ;ax = colors - r,g |
406 | mov edx,eax ;ax = colors - r,g |
407 | shr edx,16 ;dl = color - b |
407 | shr edx,16 ;dl = color - b |
408 | mov ebx,buf2d_w |
408 | mov ebx,buf2d_w |
409 | cmp ebx,1 |
409 | cmp ebx,1 |
410 | jle .24no_crop_left ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
410 | jle .24no_crop_left ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
411 | lea ebx,[ebx+ebx*2] |
411 | lea ebx,[ebx+ebx*2] |
412 | mov esi,buf2d_data ;esi - 㪠§ ⥫ì 箫® ¡ãä¥à ¨§®¡à ¦¥¨ï |
412 | mov esi,buf2d_data ;esi - 㪠§ ⥫ì 箫® ¡ãä¥à ¨§®¡à ¦¥¨ï |
413 | mov dword[crop_r],0 |
413 | mov dword[crop_r],0 |
414 | cld |
414 | cld |
415 | .24found_beg_left: |
415 | .24found_beg_left: |
416 | 416 | ||
417 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
417 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
418 | @@: |
418 | @@: |
419 | cmp word[esi],ax |
419 | cmp word[esi],ax |
420 | jne .24found_left |
420 | jne .24found_left |
421 | cmp byte[esi+2],dl |
421 | cmp byte[esi+2],dl |
422 | jne .24found_left |
422 | jne .24found_left |
423 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
423 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
424 | loop @b |
424 | loop @b |
425 | inc dword[crop_r] |
425 | inc dword[crop_r] |
426 | add esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
426 | add esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
427 | 427 | ||
428 | mov ecx,buf2d_w |
428 | mov ecx,buf2d_w |
429 | dec ecx ;1 ª®«®ª § ¯ á |
429 | dec ecx ;1 ª®«®ª § ¯ á |
430 | cmp dword[crop_r],ecx |
430 | cmp dword[crop_r],ecx |
431 | jge .24found_left |
431 | jge .24found_left |
432 | 432 | ||
433 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
433 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
434 | @@: |
434 | @@: |
435 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
435 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
436 | cmp word[esi],ax |
436 | cmp word[esi],ax |
437 | jne .24found_left |
437 | jne .24found_left |
438 | cmp byte[esi+2],dl |
438 | cmp byte[esi+2],dl |
439 | jne .24found_left |
439 | jne .24found_left |
440 | loop @b |
440 | loop @b |
441 | inc dword[crop_r] |
441 | inc dword[crop_r] |
442 | add esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
442 | add esi,3 ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
443 | 443 | ||
444 | mov ecx,buf2d_w |
444 | mov ecx,buf2d_w |
445 | dec ecx ;1 ª®«®ª § ¯ á |
445 | dec ecx ;1 ª®«®ª § ¯ á |
446 | cmp dword[crop_r],ecx |
446 | cmp dword[crop_r],ecx |
447 | jl .24found_beg_left |
447 | jl .24found_beg_left |
448 | 448 | ||
449 | .24found_left: |
449 | .24found_left: |
450 | cmp dword[crop_r],0 |
450 | cmp dword[crop_r],0 |
451 | je .24no_crop_left |
451 | je .24no_crop_left |
452 | mov ecx,buf2d_w |
452 | mov ecx,buf2d_w |
453 | sub ecx,dword[crop_r] |
453 | sub ecx,dword[crop_r] |
454 | stdcall img_rgb_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
454 | stdcall img_rgb_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
455 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
455 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
456 | mov ebx,buf2d_h |
456 | mov ebx,buf2d_h |
457 | imul ecx,ebx |
457 | imul ecx,ebx |
458 | lea ecx,[ecx+ecx*2] |
458 | lea ecx,[ecx+ecx*2] |
459 | invoke mem.realloc,buf2d_data,ecx |
459 | invoke mem.realloc,buf2d_data,ecx |
460 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
460 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
461 | mov eax,dword[crop_r] |
461 | mov eax,dword[crop_r] |
462 | add buf2d_l,ax |
462 | add buf2d_l,ax |
463 | .24no_crop_left: |
463 | .24no_crop_left: |
464 | 464 | ||
465 | .24end_f: |
465 | .24end_f: |
466 | 466 | ||
467 | 467 | ||
468 | cmp buf2d_bits,8 |
468 | cmp buf2d_bits,8 |
469 | jne .8end_f |
469 | jne .8end_f |
470 | 470 | ||
471 | bt dword[opt],BUF2D_BIT_OPT_CROP_BOTTOM |
471 | bt dword[opt],BUF2D_BIT_OPT_CROP_BOTTOM |
472 | jae .8no_crop_bottom |
472 | jae .8no_crop_bottom |
473 | mov eax,dword[color] |
473 | mov eax,dword[color] |
474 | mov esi,buf2d_data |
474 | mov esi,buf2d_data |
475 | mov ecx,buf2d_h |
475 | mov ecx,buf2d_h |
476 | cmp ecx,1 |
476 | cmp ecx,1 |
477 | jle .8no_crop_bottom ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
477 | jle .8no_crop_bottom ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
478 | mov ebx,buf2d_w |
478 | mov ebx,buf2d_w |
479 | imul ecx,ebx |
479 | imul ecx,ebx |
480 | mov esi,ecx |
480 | mov esi,ecx |
481 | add esi,buf2d_data |
481 | add esi,buf2d_data |
482 | cld |
482 | cld |
483 | @@: |
483 | @@: |
484 | dec esi |
484 | dec esi |
485 | cmp byte[esi],al |
485 | cmp byte[esi],al |
486 | jne @f |
486 | jne @f |
487 | loop @b |
487 | loop @b |
488 | @@: |
488 | @@: |
489 | xor edx,edx |
489 | xor edx,edx |
490 | mov eax,buf2d_h |
490 | mov eax,buf2d_h |
491 | imul eax,ebx |
491 | imul eax,ebx |
492 | add eax,buf2d_data ;eax - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
492 | add eax,buf2d_data ;eax - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
493 | @@: |
493 | @@: |
494 | add esi,ebx |
494 | add esi,ebx |
495 | cmp esi,eax |
495 | cmp esi,eax |
496 | jge @f |
496 | jge @f |
497 | inc edx |
497 | inc edx |
498 | loop @b |
498 | loop @b |
499 | @@: |
499 | @@: |
500 | cmp edx,0 |
500 | cmp edx,0 |
501 | je .8no_crop_bottom |
501 | je .8no_crop_bottom |
502 | cmp edx,buf2d_h |
502 | cmp edx,buf2d_h |
503 | jge .8no_crop_bottom ;çâ®-¡ë ¥ ¯®«ãç¨âì ¯ãá⮩ ¡ãä¥à |
503 | jge .8no_crop_bottom ;çâ®-¡ë ¥ ¯®«ãç¨âì ¯ãá⮩ ¡ãä¥à |
504 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
504 | sub buf2d_h,edx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
505 | mov ecx,buf2d_h |
505 | mov ecx,buf2d_h |
506 | imul ecx,ebx ;ecx = ®¢ë© à §¬¥à ¨§®¡à ¦¥¨ï |
506 | imul ecx,ebx ;ecx = ®¢ë© à §¬¥à ¨§®¡à ¦¥¨ï |
507 | invoke mem.realloc,buf2d_data,ecx |
507 | invoke mem.realloc,buf2d_data,ecx |
508 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
508 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
509 | .8no_crop_bottom: |
509 | .8no_crop_bottom: |
510 | 510 | ||
511 | bt dword[opt],BUF2D_BIT_OPT_CROP_TOP |
511 | bt dword[opt],BUF2D_BIT_OPT_CROP_TOP |
512 | jae .8no_crop_top |
512 | jae .8no_crop_top |
513 | mov eax,dword[color] |
513 | mov eax,dword[color] |
514 | mov esi,buf2d_data |
514 | mov esi,buf2d_data |
515 | mov ecx,buf2d_h |
515 | mov ecx,buf2d_h |
516 | cmp ecx,1 |
516 | cmp ecx,1 |
517 | jle .8no_crop_top ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
517 | jle .8no_crop_top ;¯à®¢¥à塞 á«ãç © ¥á«¨ ¢ëá®â ¡ãä¥à 1 ¯¨ªá¥«ì |
518 | dec ecx ;¯à¨ ®¡à¥§ ¨¨ ¤®«¦ ®áâ âìáï ¬¨¨¬ã¬ 1- áâப ¯¨ªá¥«¥© |
518 | dec ecx ;¯à¨ ®¡à¥§ ¨¨ ¤®«¦ ®áâ âìáï ¬¨¨¬ã¬ 1- áâப ¯¨ªá¥«¥© |
519 | mov ebx,buf2d_w |
519 | mov ebx,buf2d_w |
520 | imul ecx,ebx |
520 | imul ecx,ebx |
521 | cld |
521 | cld |
522 | @@: |
522 | @@: |
523 | cmp byte[esi],al |
523 | cmp byte[esi],al |
524 | jne @f |
524 | jne @f |
525 | inc esi |
525 | inc esi |
526 | loop @b |
526 | loop @b |
527 | @@: |
527 | @@: |
528 | xor edx,edx |
528 | xor edx,edx |
529 | @@: |
529 | @@: |
530 | sub esi,ebx |
530 | sub esi,ebx |
531 | cmp esi,buf2d_data |
531 | cmp esi,buf2d_data |
532 | jl @f |
532 | jl @f |
533 | inc edx |
533 | inc edx |
534 | loop @b |
534 | loop @b |
535 | @@: |
535 | @@: |
536 | cmp edx,0 |
536 | cmp edx,0 |
537 | je .8no_crop_top |
537 | je .8no_crop_top |
538 | xor eax,eax |
538 | xor eax,eax |
539 | sub eax,edx |
539 | sub eax,edx |
540 | mov ebx,buf2d_h |
540 | mov ebx,buf2d_h |
541 | sub ebx,edx |
541 | sub ebx,edx |
542 | stdcall buf_offset_h, edi, eax, edx, ebx |
542 | stdcall buf_offset_h, edi, eax, edx, ebx |
543 | mov ecx,buf2d_h |
543 | mov ecx,buf2d_h |
544 | sub ecx,edx |
544 | sub ecx,edx |
545 | mov buf2d_h,ecx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
545 | mov buf2d_h,ecx ;㬥ìè ¥¬ ¢ëá®âã ¡ãä¥à |
546 | add buf2d_t,dx ;ᤢ¨£ ¥¬ ®âáâ㯠¢¨§, ç¨á«® ®¡à¥§ ëå áâப |
546 | add buf2d_t,dx ;ᤢ¨£ ¥¬ ®âáâ㯠¢¨§, ç¨á«® ®¡à¥§ ëå áâப |
547 | mov ebx,buf2d_w |
547 | mov ebx,buf2d_w |
548 | imul ecx,ebx |
548 | imul ecx,ebx |
549 | invoke mem.realloc,buf2d_data,ecx |
549 | invoke mem.realloc,buf2d_data,ecx |
550 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
550 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
551 | .8no_crop_top: |
551 | .8no_crop_top: |
552 | 552 | ||
553 | bt dword[opt],BUF2D_BIT_OPT_CROP_RIGHT |
553 | bt dword[opt],BUF2D_BIT_OPT_CROP_RIGHT |
554 | jae .8no_crop_right |
554 | jae .8no_crop_right |
555 | mov eax,dword[color] |
555 | mov eax,dword[color] |
556 | mov ebx,buf2d_w |
556 | mov ebx,buf2d_w |
557 | cmp ebx,1 |
557 | cmp ebx,1 |
558 | jle .8no_crop_right ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
558 | jle .8no_crop_right ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
559 | mov esi,ebx |
559 | mov esi,ebx |
560 | imul esi,buf2d_h |
560 | imul esi,buf2d_h |
561 | add esi,buf2d_data ;esi - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
561 | add esi,buf2d_data ;esi - 㪠§ â¥«ì ª®¥æ ¡ãä¥à ¨§®¡à ¦¥¨ï |
562 | xor edx,edx |
562 | xor edx,edx |
563 | cld |
563 | cld |
564 | 564 | ||
565 | .8found_beg: |
565 | .8found_beg: |
566 | dec esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
566 | dec esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
567 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
567 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
568 | @@: |
568 | @@: |
569 | cmp byte[esi],al |
569 | cmp byte[esi],al |
570 | jne .8found |
570 | jne .8found |
571 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
571 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
572 | loop @b |
572 | loop @b |
573 | inc edx |
573 | inc edx |
574 | mov ecx,buf2d_w |
574 | mov ecx,buf2d_w |
575 | dec ecx ;1 ª®«®ª § ¯ á |
575 | dec ecx ;1 ª®«®ª § ¯ á |
576 | cmp edx,ecx |
576 | cmp edx,ecx |
577 | jge .8found |
577 | jge .8found |
578 | 578 | ||
579 | dec esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
579 | dec esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢«¥¢® |
580 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
580 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
581 | @@: |
581 | @@: |
582 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
582 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
583 | cmp byte[esi],al |
583 | cmp byte[esi],al |
584 | jne .8found |
584 | jne .8found |
585 | loop @b |
585 | loop @b |
586 | inc edx |
586 | inc edx |
587 | 587 | ||
588 | mov ecx,buf2d_w |
588 | mov ecx,buf2d_w |
589 | dec ecx ;1 ª®«®ª § ¯ á |
589 | dec ecx ;1 ª®«®ª § ¯ á |
590 | cmp edx,ecx |
590 | cmp edx,ecx |
591 | jl .8found_beg |
591 | jl .8found_beg |
592 | 592 | ||
593 | .8found: |
593 | .8found: |
594 | cmp edx,0 |
594 | cmp edx,0 |
595 | je .8no_crop_right |
595 | je .8no_crop_right |
596 | mov ecx,buf2d_w |
596 | mov ecx,buf2d_w |
597 | sub ecx,edx |
597 | sub ecx,edx |
598 | stdcall img_gray_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
598 | stdcall img_gray_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
599 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
599 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
600 | mov ebx,buf2d_h |
600 | mov ebx,buf2d_h |
601 | imul ecx,ebx |
601 | imul ecx,ebx |
602 | invoke mem.realloc,buf2d_data,ecx |
602 | invoke mem.realloc,buf2d_data,ecx |
603 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
603 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
604 | .8no_crop_right: |
604 | .8no_crop_right: |
605 | 605 | ||
606 | bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT |
606 | bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT |
607 | jae .8no_crop_left |
607 | jae .8no_crop_left |
608 | mov eax,dword[color] |
608 | mov eax,dword[color] |
609 | mov ebx,buf2d_w |
609 | mov ebx,buf2d_w |
610 | cmp ebx,1 |
610 | cmp ebx,1 |
611 | jle .8no_crop_left ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
611 | jle .8no_crop_left ; á«ãç © ¥á«¨ è¨à¨ ¡ãä¥à 1 ¯¨ªá¥«ì |
612 | mov esi,buf2d_data ;esi - 㪠§ ⥫ì 箫® ¡ãä¥à ¨§®¡à ¦¥¨ï |
612 | mov esi,buf2d_data ;esi - 㪠§ ⥫ì 箫® ¡ãä¥à ¨§®¡à ¦¥¨ï |
613 | mov edx,0 |
613 | mov edx,0 |
614 | cld |
614 | cld |
615 | .8found_beg_left: |
615 | .8found_beg_left: |
616 | 616 | ||
617 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
617 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
618 | @@: |
618 | @@: |
619 | cmp word[esi],ax |
619 | cmp word[esi],ax |
620 | jne .8found_left |
620 | jne .8found_left |
621 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
621 | add esi,ebx ;¯àë£ ¥¬ ¨¦îî áâபã |
622 | loop @b |
622 | loop @b |
623 | inc edx |
623 | inc edx |
624 | inc esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
624 | inc esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
625 | 625 | ||
626 | mov ecx,buf2d_w |
626 | mov ecx,buf2d_w |
627 | dec ecx ;1 ª®«®ª § ¯ á |
627 | dec ecx ;1 ª®«®ª § ¯ á |
628 | cmp edx,ecx |
628 | cmp edx,ecx |
629 | jge .8found_left |
629 | jge .8found_left |
630 | 630 | ||
631 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
631 | mov ecx,buf2d_h ;¢®ááâ ®¢«¥¨¥ ecx ¤«ï ®¢®£® 横« |
632 | @@: |
632 | @@: |
633 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
633 | sub esi,ebx ;¯àë£ ¥¬ ¢¥àåîî áâபã |
634 | cmp word[esi],ax |
634 | cmp word[esi],ax |
635 | jne .8found_left |
635 | jne .8found_left |
636 | loop @b |
636 | loop @b |
637 | inc edx |
637 | inc edx |
638 | inc esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
638 | inc esi ;¤¢¨£ ¥¬áï 1-ã ª®«®ªã ¢¯à ¢® |
639 | 639 | ||
640 | mov ecx,buf2d_w |
640 | mov ecx,buf2d_w |
641 | dec ecx ;1 ª®«®ª § ¯ á |
641 | dec ecx ;1 ª®«®ª § ¯ á |
642 | cmp edx,ecx |
642 | cmp edx,ecx |
643 | jl .8found_beg_left |
643 | jl .8found_beg_left |
644 | 644 | ||
645 | .8found_left: |
645 | .8found_left: |
646 | cmp edx,0 |
646 | cmp edx,0 |
647 | je .8no_crop_left |
647 | je .8no_crop_left |
648 | mov ecx,buf2d_w |
648 | mov ecx,buf2d_w |
649 | sub ecx,edx |
649 | sub ecx,edx |
650 | stdcall img_gray_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
650 | stdcall img_gray_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ®¢®¬ã à §¬¥àã |
651 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
651 | mov buf2d_w,ecx ;áâ ¢¨¬ ®¢ãî è¨à¨ã ¤«ï ¡ãä¥à |
652 | mov ebx,buf2d_h |
652 | mov ebx,buf2d_h |
653 | imul ecx,ebx |
653 | imul ecx,ebx |
654 | invoke mem.realloc,buf2d_data,ecx |
654 | invoke mem.realloc,buf2d_data,ecx |
655 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
655 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
656 | mov eax,edx |
656 | mov eax,edx |
657 | add buf2d_l,ax |
657 | add buf2d_l,ax |
658 | .8no_crop_left: |
658 | .8no_crop_left: |
659 | 659 | ||
660 | .8end_f: |
660 | .8end_f: |
661 | 661 | ||
662 | popad |
662 | popad |
663 | ret |
663 | ret |
664 | endp |
664 | endp |
665 | 665 | ||
666 | ;®¡à¥§ ¥¬ 梥⮥ ¨§®¡à ¦¥¨¥ á ¯à ¢®© áâ®à®ë |
666 | ;®¡à¥§ ¥¬ 梥⮥ ¨§®¡à ¦¥¨¥ á ¯à ¢®© áâ®à®ë |
667 | ;input: |
667 | ;input: |
668 | ;data_rgb - pointer to rgb data |
668 | ;data_rgb - pointer to rgb data |
669 | ;size_w_old - width img in pixels |
669 | ;size_w_old - width img in pixels |
670 | ;size_w_new - new width img in pixels |
670 | ;size_w_new - new width img in pixels |
671 | ;size_h - height img in pixels |
671 | ;size_h - height img in pixels |
672 | align 4 |
672 | align 4 |
673 | proc img_rgb_crop_r, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
673 | proc img_rgb_crop_r, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
674 | pushad |
674 | pushad |
675 | mov eax, dword[size_w_old] |
675 | mov eax, dword[size_w_old] |
676 | lea eax, dword[eax+eax*2] ;eax = width(old) * 3(rgb) |
676 | lea eax, dword[eax+eax*2] ;eax = width(old) * 3(rgb) |
677 | mov ebx, dword[size_w_new] |
677 | mov ebx, dword[size_w_new] |
678 | lea ebx, dword[ebx+ebx*2] ;ebx = width(new) * 3(rgb) |
678 | lea ebx, dword[ebx+ebx*2] ;ebx = width(new) * 3(rgb) |
679 | mov edx, dword[size_h] |
679 | mov edx, dword[size_h] |
680 | mov edi, dword[data_rgb] ;edi - ¯®«ãç ¥â ¤ ë¥ |
680 | mov edi, dword[data_rgb] ;edi - ¯®«ãç ¥â ¤ ë¥ |
681 | mov esi, edi |
681 | mov esi, edi |
682 | add edi, ebx |
682 | add edi, ebx |
683 | add esi, eax |
683 | add esi, eax |
684 | cld |
684 | cld |
685 | @@: |
685 | @@: |
686 | dec edx ;㬥ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப 1 |
686 | dec edx ;㬥ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப 1 |
687 | cmp edx,0 |
687 | cmp edx,0 |
688 | jle @f |
688 | jle @f |
689 | mov ecx, ebx |
689 | mov ecx, ebx |
690 | rep movsb ;¯¥à¥®á (ª®¯¨à®¢ ¨¥) áâப¨ ¯¨ªá¥«¥© |
690 | rep movsb ;¯¥à¥®á (ª®¯¨à®¢ ¨¥) áâப¨ ¯¨ªá¥«¥© |
691 | add esi,eax ;¯¥à¥å®¤ ®¢ãî áâà®çªã ¨§®¡à ¦¥¨ï |
691 | add esi,eax ;¯¥à¥å®¤ ®¢ãî áâà®çªã ¨§®¡à ¦¥¨ï |
692 | sub esi,ebx |
692 | sub esi,ebx |
693 | jmp @b |
693 | jmp @b |
694 | @@: |
694 | @@: |
695 | popad |
695 | popad |
696 | ret |
696 | ret |
697 | endp |
697 | endp |
698 | 698 | ||
699 | ;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥¨¥ á ¯à ¢®© áâ®à®ë |
699 | ;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥¨¥ á ¯à ¢®© áâ®à®ë |
700 | ;input: |
700 | ;input: |
701 | ;data_gray - pointer to gray data |
701 | ;data_gray - pointer to gray data |
702 | ;size_w_old - width img in pixels |
702 | ;size_w_old - width img in pixels |
703 | ;size_w_new - new width img in pixels |
703 | ;size_w_new - new width img in pixels |
704 | ;size_h - height img in pixels |
704 | ;size_h - height img in pixels |
705 | align 4 |
705 | align 4 |
706 | proc img_gray_crop_r, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
706 | proc img_gray_crop_r, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
707 | pushad |
707 | pushad |
708 | mov eax, dword[size_w_old] |
708 | mov eax, dword[size_w_old] |
709 | mov ebx, dword[size_w_new] |
709 | mov ebx, dword[size_w_new] |
710 | mov edx, dword[size_h] |
710 | mov edx, dword[size_h] |
711 | mov edi, dword[data_gray] ;edi - ¯®«ãç ¥â ¤ ë¥ |
711 | mov edi, dword[data_gray] ;edi - ¯®«ãç ¥â ¤ ë¥ |
712 | mov esi, edi |
712 | mov esi, edi |
713 | add edi, ebx |
713 | add edi, ebx |
714 | add esi, eax |
714 | add esi, eax |
715 | cld |
715 | cld |
716 | @@: |
716 | @@: |
717 | dec edx ;㬥ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப 1 |
717 | dec edx ;㬥ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப 1 |
718 | cmp edx,0 |
718 | cmp edx,0 |
719 | jle @f |
719 | jle @f |
720 | mov ecx, ebx |
720 | mov ecx, ebx |
721 | rep movsb ;¯¥à¥®á (ª®¯¨à®¢ ¨¥) áâப¨ ¯¨ªá¥«¥© |
721 | rep movsb ;¯¥à¥®á (ª®¯¨à®¢ ¨¥) áâப¨ ¯¨ªá¥«¥© |
722 | add esi,eax ;¯¥à¥å®¤ ®¢ãî áâà®çªã ¨§®¡à ¦¥¨ï |
722 | add esi,eax ;¯¥à¥å®¤ ®¢ãî áâà®çªã ¨§®¡à ¦¥¨ï |
723 | sub esi,ebx |
723 | sub esi,ebx |
724 | jmp @b |
724 | jmp @b |
725 | @@: |
725 | @@: |
726 | popad |
726 | popad |
727 | ret |
727 | ret |
728 | endp |
728 | endp |
729 | 729 | ||
730 | ;®¡à¥§ ¥¬ 梥⮥ ¨§®¡à ¦¥¨¥ á «¥¢®© áâ®à®ë |
730 | ;®¡à¥§ ¥¬ 梥⮥ ¨§®¡à ¦¥¨¥ á «¥¢®© áâ®à®ë |
731 | ;input: |
731 | ;input: |
732 | ;data_rgb - pointer to rgb data |
732 | ;data_rgb - pointer to rgb data |
733 | ;size_w_old - width img in pixels |
733 | ;size_w_old - width img in pixels |
734 | ;size_w_new - new width img in pixels |
734 | ;size_w_new - new width img in pixels |
735 | ;size_h - height img in pixels |
735 | ;size_h - height img in pixels |
736 | align 4 |
736 | align 4 |
737 | proc img_rgb_crop_l, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
737 | proc img_rgb_crop_l, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
738 | pushad |
738 | pushad |
739 | mov edi,dword[data_rgb] |
739 | mov edi,dword[data_rgb] |
740 | mov esi,edi |
740 | mov esi,edi |
741 | mov eax,dword[size_w_old] |
741 | mov eax,dword[size_w_old] |
742 | mov ebx,dword[size_w_new] |
742 | mov ebx,dword[size_w_new] |
743 | cmp eax,ebx |
743 | cmp eax,ebx |
744 | jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥¨ï ¥ ¬®¦¥â ¡ëâì ¬¥ìè¥ ®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ¨ï ª à⨪¨) |
744 | jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥¨ï ¥ ¬®¦¥â ¡ëâì ¬¥ìè¥ ®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ¨ï ª à⨪¨) |
745 | lea eax,[eax+eax*2] |
745 | lea eax,[eax+eax*2] |
746 | lea ebx,[ebx+ebx*2] |
746 | lea ebx,[ebx+ebx*2] |
747 | sub eax,ebx |
747 | sub eax,ebx |
748 | mov edx,dword[size_h] ;¢ëá®â ¨§®¡à ¦¥¨ï |
748 | mov edx,dword[size_h] ;¢ëá®â ¨§®¡à ¦¥¨ï |
749 | cld |
749 | cld |
750 | @@: |
750 | @@: |
751 | add esi,eax |
751 | add esi,eax |
752 | mov ecx,ebx |
752 | mov ecx,ebx |
753 | rep movsb |
753 | rep movsb |
754 | dec edx |
754 | dec edx |
755 | cmp edx,0 |
755 | cmp edx,0 |
756 | jg @b |
756 | jg @b |
757 | .end_f: |
757 | .end_f: |
758 | popad |
758 | popad |
759 | ret |
759 | ret |
760 | endp |
760 | endp |
761 | 761 | ||
762 | ;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥¨¥ á «¥¢®© áâ®à®ë |
762 | ;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥¨¥ á «¥¢®© áâ®à®ë |
763 | ;input: |
763 | ;input: |
764 | ;data_gray - pointer to gray data |
764 | ;data_gray - pointer to gray data |
765 | ;size_w_old - width img in pixels |
765 | ;size_w_old - width img in pixels |
766 | ;size_w_new - new width img in pixels |
766 | ;size_w_new - new width img in pixels |
767 | ;size_h - height img in pixels |
767 | ;size_h - height img in pixels |
768 | align 4 |
768 | align 4 |
769 | proc img_gray_crop_l, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
769 | proc img_gray_crop_l, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword |
770 | pushad |
770 | pushad |
771 | mov edi,dword[data_gray] |
771 | mov edi,dword[data_gray] |
772 | mov esi,edi |
772 | mov esi,edi |
773 | mov eax,dword[size_w_old] |
773 | mov eax,dword[size_w_old] |
774 | mov ebx,dword[size_w_new] |
774 | mov ebx,dword[size_w_new] |
775 | cmp eax,ebx |
775 | cmp eax,ebx |
776 | jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥¨ï ¥ ¬®¦¥â ¡ëâì ¬¥ìè¥ ®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ¨ï ª à⨪¨) |
776 | jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥¨ï ¥ ¬®¦¥â ¡ëâì ¬¥ìè¥ ®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ¨ï ª à⨪¨) |
777 | sub eax,ebx |
777 | sub eax,ebx |
778 | mov edx,dword[size_h] ;¢ëá®â ¨§®¡à ¦¥¨ï |
778 | mov edx,dword[size_h] ;¢ëá®â ¨§®¡à ¦¥¨ï |
779 | cld |
779 | cld |
780 | @@: |
780 | @@: |
781 | add esi,eax |
781 | add esi,eax |
782 | mov ecx,ebx |
782 | mov ecx,ebx |
783 | rep movsb |
783 | rep movsb |
784 | dec edx |
784 | dec edx |
785 | cmp edx,0 |
785 | cmp edx,0 |
786 | jg @b |
786 | jg @b |
787 | .end_f: |
787 | .end_f: |
788 | popad |
788 | popad |
789 | ret |
789 | ret |
790 | endp |
790 | endp |
791 | 791 | ||
792 | ;hoffs - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ª®âàë¥ ¯®¤¨¬ ¥âáï/®¯ã᪠¥âáï ¨§®¡à ¦¥¨¥ |
792 | ;hoffs - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ª®âàë¥ ¯®¤¨¬ ¥âáï/®¯ã᪠¥âáï ¨§®¡à ¦¥¨¥ |
793 | ;img_t - ¢ëá®â , á ª®â®à®© ç¨ ¥âáï ¤¢¨£ îé ïáï ç áâì ¨§®¡à ¦¥¨ï |
793 | ;img_t - ¢ëá®â , á ª®â®à®© ç¨ ¥âáï ¤¢¨£ îé ïáï ç áâì ¨§®¡à ¦¥¨ï |
794 | align 4 |
794 | align 4 |
795 | proc buf_offset_h, buf_struc:dword, hoffs:dword, img_t:dword, img_h:dword ;ᤢ¨£ ¥â ¨§®¡à ¦¥¨¥ ¯® ¢ëá®â¥ |
795 | proc buf_offset_h, buf_struc:dword, hoffs:dword, img_t:dword, img_h:dword ;ᤢ¨£ ¥â ¨§®¡à ¦¥¨¥ ¯® ¢ëá®â¥ |
796 | pushad |
796 | pushad |
797 | mov edi,dword[buf_struc] |
797 | mov edi,dword[buf_struc] |
798 | cmp buf2d_bits,24 |
798 | cmp buf2d_bits,24 |
799 | jne .end_move_24 |
799 | jne .end_move_24 |
800 | 800 | ||
801 | mov eax,[hoffs] |
801 | mov eax,[hoffs] |
802 | cmp eax,0 |
802 | cmp eax,0 |
803 | je .end_move_24 |
803 | je .end_move_24 |
804 | mov ebx,buf2d_w |
804 | mov ebx,buf2d_w |
805 | mov edx,dword[img_t] |
805 | mov edx,dword[img_t] |
806 | mov ecx,dword[img_h] ;ecx - ¢ëá®â ᤢ¨£ ¥¬ëå ¤ ëå |
806 | mov ecx,dword[img_h] ;ecx - ¢ëá®â ᤢ¨£ ¥¬ëå ¤ ëå |
807 | cmp ecx,buf2d_h |
807 | cmp ecx,buf2d_h |
808 | jge .end_f ;®è¨¡®ç®¥ ãá«®¢¨¥, ¢ëá®â ¨§®¡à ¦¥¨ï ¬¥ìè¥ ç¥¬ ¢ëá®â ᤢ¨£ ¥¬®£® ¨§®¡à ¦¥¨ï |
808 | jge .end_f ;®è¨¡®ç®¥ ãá«®¢¨¥, ¢ëá®â ¨§®¡à ¦¥¨ï ¬¥ìè¥ ç¥¬ ¢ëá®â ᤢ¨£ ¥¬®£® ¨§®¡à ¦¥¨ï |
809 | imul ecx,ebx ;ecx - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ ᤢ¨£ ¥¬ëå ¤ ëå |
809 | imul ecx,ebx ;ecx - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ ᤢ¨£ ¥¬ëå ¤ ëå |
810 | lea ecx,[ecx+ecx*2] |
810 | lea ecx,[ecx+ecx*2] |
811 | imul ebx,edx |
811 | imul ebx,edx |
812 | lea ebx,[ebx+ebx*2] |
812 | lea ebx,[ebx+ebx*2] |
813 | mov esi,buf2d_data |
813 | mov esi,buf2d_data |
814 | add esi,ebx |
814 | add esi,ebx |
815 | 815 | ||
816 | add edx,eax ;edx = img_t+hoffs (hoffs<0) |
816 | add edx,eax ;edx = img_t+hoffs (hoffs<0) |
817 | mov ebx,buf2d_w |
817 | mov ebx,buf2d_w |
818 | imul ebx,edx |
818 | imul ebx,edx |
819 | lea ebx,[ebx+ebx*2] |
819 | lea ebx,[ebx+ebx*2] |
820 | mov edi,buf2d_data ;¯®§¨æ¨ï, ªã¤ ¡ã¤¥â ¤¢¨£ âìáï ¨§®¡à ¦¥¨¥ |
820 | mov edi,buf2d_data ;¯®§¨æ¨ï, ªã¤ ¡ã¤¥â ¤¢¨£ âìáï ¨§®¡à ¦¥¨¥ |
821 | add edi,ebx |
821 | add edi,ebx |
822 | 822 | ||
823 | cmp eax,0 |
823 | cmp eax,0 |
824 | jg .move_down_24 |
824 | jg .move_down_24 |
825 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¢¥àå |
825 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¢¥àå |
826 | cld |
826 | cld |
827 | rep movsb |
827 | rep movsb |
828 | jmp .end_f |
828 | jmp .end_f |
829 | .move_down_24: |
829 | .move_down_24: |
830 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¨§ |
830 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¨§ |
831 | add esi,ecx |
831 | add esi,ecx |
832 | dec esi |
832 | dec esi |
833 | add edi,ecx |
833 | add edi,ecx |
834 | dec edi |
834 | dec edi |
835 | std |
835 | std |
836 | rep movsb |
836 | rep movsb |
837 | jmp .end_f |
837 | jmp .end_f |
838 | .end_move_24: |
838 | .end_move_24: |
839 | 839 | ||
840 | ;stdcall print_err,sz_buf2d_offset_h,txt_err_n24b |
840 | ;stdcall print_err,sz_buf2d_offset_h,txt_err_n24b |
841 | 841 | ||
842 | cmp buf2d_bits,8 |
842 | cmp buf2d_bits,8 |
843 | jne .end_move_8 |
843 | jne .end_move_8 |
844 | 844 | ||
845 | mov eax,[hoffs] |
845 | mov eax,[hoffs] |
846 | cmp eax,0 |
846 | cmp eax,0 |
847 | je .end_move_8 |
847 | je .end_move_8 |
848 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¢¥àå |
848 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¢¥àå |
849 | mov ebx,buf2d_w |
849 | mov ebx,buf2d_w |
850 | mov edx,dword[img_t] |
850 | mov edx,dword[img_t] |
851 | mov ecx,dword[img_h] ;ecx - ¢ëá®â ᤢ¨£ ¥¬ëå ¤ ëå |
851 | mov ecx,dword[img_h] ;ecx - ¢ëá®â ᤢ¨£ ¥¬ëå ¤ ëå |
852 | cmp ecx,buf2d_h |
852 | cmp ecx,buf2d_h |
853 | jge .end_f ;®è¨¡®ç®¥ ãá«®¢¨¥, ¢ëá®â ¨§®¡à ¦¥¨ï ¬¥ìè¥ ç¥¬ ¢ëá®â ᤢ¨£ ¥¬®£® ¨§®¡à ¦¥¨ï |
853 | jge .end_f ;®è¨¡®ç®¥ ãá«®¢¨¥, ¢ëá®â ¨§®¡à ¦¥¨ï ¬¥ìè¥ ç¥¬ ¢ëá®â ᤢ¨£ ¥¬®£® ¨§®¡à ¦¥¨ï |
854 | imul ecx,ebx ;ecx - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ ᤢ¨£ ¥¬ëå ¤ ëå |
854 | imul ecx,ebx ;ecx - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ ᤢ¨£ ¥¬ëå ¤ ëå |
855 | imul ebx,edx |
855 | imul ebx,edx |
856 | mov esi,buf2d_data |
856 | mov esi,buf2d_data |
857 | add esi,ebx |
857 | add esi,ebx |
858 | 858 | ||
859 | add edx,eax ;edx = img_t+hoffs (hoffs<0) |
859 | add edx,eax ;edx = img_t+hoffs (hoffs<0) |
860 | mov ebx,buf2d_w |
860 | mov ebx,buf2d_w |
861 | imul ebx,edx |
861 | imul ebx,edx |
862 | mov edi,buf2d_data ;¯®§¨æ¨ï, ªã¤ ¡ã¤¥â ¤¢¨£ âìáï ¨§®¡à ¦¥¨¥ |
862 | mov edi,buf2d_data ;¯®§¨æ¨ï, ªã¤ ¡ã¤¥â ¤¢¨£ âìáï ¨§®¡à ¦¥¨¥ |
863 | add edi,ebx |
863 | add edi,ebx |
864 | 864 | ||
865 | cmp eax,0 |
865 | cmp eax,0 |
866 | jg .move_down_8 |
866 | jg .move_down_8 |
867 | cld |
867 | cld |
868 | rep movsb |
868 | rep movsb |
869 | jmp .end_f |
869 | jmp .end_f |
870 | .move_down_8: |
870 | .move_down_8: |
871 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¨§ |
871 | ;¤¢¨£ ¥¬ ¨§®¡à ¦¥¨¥ ¢¨§ |
872 | add esi,ecx |
872 | add esi,ecx |
873 | dec esi |
873 | dec esi |
874 | add edi,ecx |
874 | add edi,ecx |
875 | dec edi |
875 | dec edi |
876 | std |
876 | std |
877 | rep movsb |
877 | rep movsb |
878 | jmp .end_f |
878 | jmp .end_f |
879 | .end_move_8: |
879 | .end_move_8: |
880 | 880 | ||
881 | .end_f: |
881 | .end_f: |
882 | popad |
882 | popad |
883 | ret |
883 | ret |
884 | endp |
884 | endp |
885 | 885 | ||
886 | 886 | ||
887 | align 4 |
887 | align 4 |
888 | proc buf_draw_buf, buf_struc:dword |
888 | proc buf_draw_buf, buf_struc:dword |
889 | pushad |
889 | pushad |
890 | mov edi,dword[buf_struc] |
890 | mov edi,dword[buf_struc] |
891 | cmp buf2d_bits,24 |
891 | cmp buf2d_bits,24 |
892 | jne .error |
892 | jne .error |
893 | mov eax,7 |
893 | mov eax,7 |
894 | mov ebx,buf2d_data |
894 | mov ebx,buf2d_data |
895 | 895 | ||
896 | mov ecx,buf2d_w |
896 | mov ecx,buf2d_w |
897 | ror ecx,16 |
897 | ror ecx,16 |
898 | mov edx,buf2d_h |
898 | mov edx,buf2d_h |
899 | mov cx,dx |
899 | mov cx,dx |
900 | 900 | ||
901 | mov edx,buf2d_size_lt |
901 | mov edx,buf2d_size_lt |
902 | ror edx,16 |
902 | ror edx,16 |
903 | int 0x40 |
903 | int 0x40 |
904 | jmp .end_draw_24 |
904 | jmp .end_draw_24 |
905 | .error: |
905 | .error: |
906 | stdcall print_err,sz_buf2d_draw,txt_err_n24b |
906 | stdcall print_err,sz_buf2d_draw,txt_err_n24b |
907 | .end_draw_24: |
907 | .end_draw_24: |
908 | popad |
908 | popad |
909 | ret |
909 | ret |
910 | endp |
910 | endp |
911 | 911 | ||
912 | align 4 |
912 | align 4 |
913 | proc buf_delete, buf_struc:dword |
913 | proc buf_delete, buf_struc:dword |
914 | push eax edi |
914 | push eax edi |
915 | mov edi,dword[buf_struc] |
915 | mov edi,dword[buf_struc] |
916 | invoke mem.free,buf2d_data |
916 | invoke mem.free,buf2d_data |
917 | pop edi eax |
917 | pop edi eax |
918 | ret |
918 | ret |
919 | endp |
919 | endp |
920 | 920 | ||
921 | align 4 |
921 | align 4 |
922 | proc buf_resize, buf_struc:dword, new_w:dword, new_h:dword |
922 | proc buf_resize, buf_struc:dword, new_w:dword, new_h:dword |
923 | pushad |
923 | pushad |
924 | mov edi,dword[buf_struc] |
924 | mov edi,dword[buf_struc] |
925 | cmp buf2d_bits,24 |
925 | cmp buf2d_bits,24 |
926 | jne .24bit |
926 | jne .24bit |
927 | mov eax,dword[new_w] |
927 | mov eax,dword[new_w] |
928 | cmp eax,1 |
928 | cmp eax,1 |
929 | jl @f |
929 | jl @f |
930 | mov buf2d_w,eax |
930 | mov buf2d_w,eax |
931 | @@: |
931 | @@: |
932 | mov ecx,buf2d_w |
932 | mov ecx,buf2d_w |
933 | mov eax,dword[new_h] |
933 | mov eax,dword[new_h] |
934 | cmp eax,1 |
934 | cmp eax,1 |
935 | jl @f |
935 | jl @f |
936 | mov buf2d_h,eax |
936 | mov buf2d_h,eax |
937 | @@: |
937 | @@: |
938 | mov ebx,buf2d_h |
938 | mov ebx,buf2d_h |
939 | imul ecx,ebx |
939 | imul ecx,ebx |
940 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
940 | lea ecx,[ecx+ecx*2] ; 24 bit = 3 |
941 | invoke mem.realloc,buf2d_data,ecx ;¨§¬¥ï¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
941 | invoke mem.realloc,buf2d_data,ecx ;¨§¬¥ï¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
942 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
942 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
943 | .24bit: |
943 | .24bit: |
944 | popad |
944 | popad |
945 | ret |
945 | ret |
946 | endp |
946 | endp |
947 | 947 | ||
948 | align 4 |
948 | align 4 |
949 | proc buf_line_brs, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, coord_y1:dword, color:dword |
949 | proc buf_line_brs, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, coord_y1:dword, color:dword |
950 | locals |
950 | locals |
951 | loc_1 dd ? |
951 | loc_1 dd ? |
952 | loc_2 dd ? |
952 | loc_2 dd ? |
953 | napravl db ? |
953 | napravl db ? |
954 | endl |
954 | endl |
955 | pushad |
955 | pushad |
956 | mov edx,dword[color] |
956 | mov edx,dword[color] |
957 | 957 | ||
958 | mov eax,dword[coord_x1] |
958 | mov eax,dword[coord_x1] |
959 | sub eax,dword[coord_x0] |
959 | sub eax,dword[coord_x0] |
960 | bt eax,31 |
960 | bt eax,31 |
961 | jae @f |
961 | jae @f |
962 | neg eax |
962 | neg eax |
963 | inc eax |
963 | inc eax |
964 | @@: |
964 | @@: |
965 | mov ebx,dword[coord_y1] |
965 | mov ebx,dword[coord_y1] |
966 | sub ebx,dword[coord_y0] |
966 | sub ebx,dword[coord_y0] |
967 | bt ebx,31 |
967 | bt ebx,31 |
968 | jae @f |
968 | jae @f |
969 | neg ebx |
969 | neg ebx |
970 | inc ebx |
970 | inc ebx |
971 | @@: |
971 | @@: |
972 | 972 | ||
973 | mov [napravl],byte 0 ;bool steep=false |
973 | mov [napravl],byte 0 ;bool steep=false |
974 | cmp eax,ebx |
974 | cmp eax,ebx |
975 | jle @f |
975 | jle @f |
976 | mov [napravl],byte 1 ;bool steep=true |
976 | mov [napravl],byte 1 ;bool steep=true |
977 | swap dword[coord_x0],dword[coord_y0] ;swap(x0, y0); |
977 | swap dword[coord_x0],dword[coord_y0] ;swap(x0, y0); |
978 | swap dword[coord_x1],dword[coord_y1] ;swap(x1, y1); |
978 | swap dword[coord_x1],dword[coord_y1] ;swap(x1, y1); |
979 | @@: |
979 | @@: |
980 | mov eax,dword[coord_y0] ;x0 |
980 | mov eax,dword[coord_y0] ;x0 |
981 | cmp eax,dword[coord_y1] ;if(x0>x1) |
981 | cmp eax,dword[coord_y1] ;if(x0>x1) |
982 | jle @f |
982 | jle @f |
983 | swap dword[coord_y0],dword[coord_y1] ;swap(x0, x1); |
983 | swap dword[coord_y0],dword[coord_y1] ;swap(x0, x1); |
984 | swap dword[coord_x0],dword[coord_x1] ;swap(y0, y1); |
984 | swap dword[coord_x0],dword[coord_x1] ;swap(y0, y1); |
985 | @@: |
985 | @@: |
986 | 986 | ||
987 | ; int deltax esi |
987 | ; int deltax esi |
988 | ; int deltay edi |
988 | ; int deltay edi |
989 | ; int error ebp-6 |
989 | ; int error ebp-6 |
990 | ; int ystep ebp-8 |
990 | ; int ystep ebp-8 |
991 | 991 | ||
992 | mov eax,dword[coord_y0] |
992 | mov eax,dword[coord_y0] |
993 | mov esi,dword[coord_y1] |
993 | mov esi,dword[coord_y1] |
994 | sub esi,eax ;deltax = y1-y0 |
994 | sub esi,eax ;deltax = y1-y0 |
995 | mov ebx,esi |
995 | mov ebx,esi |
996 | shr ebx,1 |
996 | shr ebx,1 |
997 | mov [loc_1],ebx ;error = deltax/2 |
997 | mov [loc_1],ebx ;error = deltax/2 |
998 | 998 | ||
999 | mov eax,dword[coord_x0] |
999 | mov eax,dword[coord_x0] |
1000 | mov edi,dword[coord_x1] |
1000 | mov edi,dword[coord_x1] |
1001 | mov [loc_2],dword -1 ;ystep = -1 |
1001 | mov [loc_2],dword -1 ;ystep = -1 |
1002 | cmp eax,edi ;if (x0 |
1002 | cmp eax,edi ;if (x0 |
1003 | jge @f |
1003 | jge @f |
1004 | mov [loc_2],dword 1 ;ystep = 1 |
1004 | mov [loc_2],dword 1 ;ystep = 1 |
1005 | @@: |
1005 | @@: |
1006 | sub edi,eax ;x1-x0 |
1006 | sub edi,eax ;x1-x0 |
1007 | 1007 | ||
1008 | bts edi,31 |
1008 | bts edi,31 |
1009 | jae @f |
1009 | jae @f |
1010 | neg edi |
1010 | neg edi |
1011 | inc edi |
1011 | inc edi |
1012 | @@: |
1012 | @@: |
1013 | and edi,0x7fffffff ;deltay = abs(x1-x0) |
1013 | and edi,0x7fffffff ;deltay = abs(x1-x0) |
1014 | 1014 | ||
1015 | mov eax,edi |
1015 | mov eax,edi |
1016 | mov edi,[buf_struc] |
1016 | mov edi,[buf_struc] |
1017 | cmp buf2d_bits,24 |
1017 | cmp buf2d_bits,24 |
1018 | jne .coord_end |
1018 | jne .coord_end |
1019 | 1019 | ||
1020 | cmp [napravl],0 |
1020 | cmp [napravl],0 |
1021 | jne .coord_yx |
1021 | jne .coord_yx |
1022 | mov ebx,dword[coord_x0] |
1022 | mov ebx,dword[coord_x0] |
1023 | mov ecx,dword[coord_y0] |
1023 | mov ecx,dword[coord_y0] |
1024 | 1024 | ||
1025 | @@: ;for (x=x0 ; x |
1025 | @@: ;for (x=x0 ; x |
1026 | cmp ecx,dword[coord_y1] |
1026 | cmp ecx,dword[coord_y1] |
1027 | jg @f ;jge ??? |
1027 | jg @f ;jge ??? |
1028 | call draw_pixel |
1028 | call draw_pixel |
1029 | 1029 | ||
1030 | sub dword[loc_1],eax ;error -= deltay |
1030 | sub dword[loc_1],eax ;error -= deltay |
1031 | cmp dword[loc_1],0 ;if(error<0) |
1031 | cmp dword[loc_1],0 ;if(error<0) |
1032 | jge .if0 |
1032 | jge .if0 |
1033 | add ebx,[loc_2] ;y += ystep |
1033 | add ebx,[loc_2] ;y += ystep |
1034 | add [loc_1],esi ;error += deltax |
1034 | add [loc_1],esi ;error += deltax |
1035 | .if0: |
1035 | .if0: |
1036 | inc ecx |
1036 | inc ecx |
1037 | jmp @b |
1037 | jmp @b |
1038 | @@: |
1038 | @@: |
1039 | jmp .coord_end |
1039 | jmp .coord_end |
1040 | .coord_yx: |
1040 | .coord_yx: |
1041 | mov ebx,dword[coord_y0] |
1041 | mov ebx,dword[coord_y0] |
1042 | mov ecx,dword[coord_x0] |
1042 | mov ecx,dword[coord_x0] |
1043 | 1043 | ||
1044 | @@: ;for (x=x0 ; x |
1044 | @@: ;for (x=x0 ; x |
1045 | cmp ebx,dword[coord_y1] |
1045 | cmp ebx,dword[coord_y1] |
1046 | jg @f ;jge ??? |
1046 | jg @f ;jge ??? |
1047 | call draw_pixel |
1047 | call draw_pixel |
1048 | 1048 | ||
1049 | sub dword[loc_1],eax ;error -= deltay |
1049 | sub dword[loc_1],eax ;error -= deltay |
1050 | cmp dword[loc_1],0 ;if(error<0) |
1050 | cmp dword[loc_1],0 ;if(error<0) |
1051 | jge .if1 |
1051 | jge .if1 |
1052 | add ecx,[loc_2] ;y += ystep |
1052 | add ecx,[loc_2] ;y += ystep |
1053 | add [loc_1],esi ;error += deltax |
1053 | add [loc_1],esi ;error += deltax |
1054 | .if1: |
1054 | .if1: |
1055 | inc ebx |
1055 | inc ebx |
1056 | jmp @b |
1056 | jmp @b |
1057 | @@: |
1057 | @@: |
1058 | .coord_end: |
1058 | .coord_end: |
1059 | popad |
1059 | popad |
1060 | ret |
1060 | ret |
1061 | endp |
1061 | endp |
1062 | 1062 | ||
1063 | ;à¨á®¢ ¨¥ £®à¨§®â «ì®© «¨¨¨, ¯®â®¬ã ¥â ¯ à ¬¥âà coord_y1 |
1063 | ;à¨á®¢ ¨¥ £®à¨§®â «ì®© «¨¨¨, ¯®â®¬ã ¥â ¯ à ¬¥âà coord_y1 |
1064 | align 4 |
1064 | align 4 |
1065 | proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, color:dword |
1065 | proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, color:dword |
1066 | pushad |
1066 | pushad |
1067 | mov edi,[buf_struc] |
1067 | mov edi,[buf_struc] |
1068 | cmp buf2d_bits,24 |
1068 | cmp buf2d_bits,24 |
1069 | jne .end24 |
1069 | jne .end24 |
1070 | 1070 | ||
1071 | mov ecx,dword[coord_y0] |
1071 | mov ecx,dword[coord_y0] |
1072 | bt ecx,31 |
1072 | bt ecx,31 |
1073 | jc .end24 ;¥á«¨ ª®®à¤¨ â y0 ®âà¨æ ⥫ì ï |
1073 | jc .end24 ;¥á«¨ ª®®à¤¨ â y0 ®âà¨æ ⥫ì ï |
1074 | cmp ecx,buf2d_h |
1074 | cmp ecx,buf2d_h |
1075 | jge .end24 ;¥á«¨ ª®®à¤¨ â y0 ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1075 | jge .end24 ;¥á«¨ ª®®à¤¨ â y0 ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1076 | 1076 | ||
1077 | mov ebx,dword[coord_x0] |
1077 | mov ebx,dword[coord_x0] |
1078 | mov esi,dword[coord_x1] |
1078 | mov esi,dword[coord_x1] |
1079 | cmp ebx,esi |
1079 | cmp ebx,esi |
1080 | jle @f |
1080 | jle @f |
1081 | xchg ebx,esi ;¥á«¨ x0 > x1 â® ¬¥ï¥¬ ¬¥áâ ¬¨ x0 ¨ x1 |
1081 | xchg ebx,esi ;¥á«¨ x0 > x1 â® ¬¥ï¥¬ ¬¥áâ ¬¨ x0 ¨ x1 |
1082 | @@: |
1082 | @@: |
- | 1083 | bt ebx,31 |
|
- | 1084 | jae @f |
|
- | 1085 | ;¥á«¨ ª®®à¤¨ â x0 ®âà¨æ ⥫ì ï |
|
- | 1086 | xor ebx,ebx |
|
- | 1087 | @@: |
|
1083 | cmp esi,buf2d_w |
1088 | cmp esi,buf2d_w |
1084 | jl @f |
1089 | jl @f |
- | 1090 | ;¥á«¨ ª®®à¤¨ â x0 ¡®«ìè¥ è¨à¨ë ¡ãä¥à |
|
1085 | mov esi,buf2d_w |
1091 | mov esi,buf2d_w |
1086 | ;dec esi |
1092 | ;dec esi |
1087 | @@: |
1093 | @@: |
- | 1094 | cmp ebx,esi |
|
- | 1095 | jge .end24 ;¥á«¨ x0 >= x1 ¬®¦¥â ¢®§¨ªãâì ª®£¤ ®¡¥ ª®®à¤¨ âë x0, x1 室¨«¨áì § ®¤¨¬ ¨§ ¯à¥¤¥«®¢ ¡ãä¥à |
|
1088 | 1096 | ||
1089 | ;¢ eax ¢ëç¨á«ï¥¬ ç «® 1-© â®çª¨ «¨¨¨ ¢ ¡ãä¥à¥ ¨§®¡à ¦¥¨ï |
1097 | ;¢ eax ¢ëç¨á«ï¥¬ ç «® 1-© â®çª¨ «¨¨¨ ¢ ¡ãä¥à¥ ¨§®¡à ¦¥¨ï |
1090 | mov eax,buf2d_w ;size x |
1098 | mov eax,buf2d_w ;size x |
1091 | imul eax,ecx ;size_x*y |
1099 | imul eax,ecx ;size_x*y |
1092 | add eax,ebx ;size_x*y+x |
1100 | add eax,ebx ;size_x*y+x |
1093 | lea eax,[eax+eax*2] ;(size_x*y+x)*3 |
1101 | lea eax,[eax+eax*2] ;(size_x*y+x)*3 |
1094 | add eax,buf2d_data ;ptr+(size_x*y+x)*3 |
1102 | add eax,buf2d_data ;ptr+(size_x*y+x)*3 |
- | 1103 | ||
- | 1104 | mov ecx,esi |
|
1095 | 1105 | sub ecx,ebx ;¢ ecx ª®««¨ç¥á⢮ â®ç¥ª «¨¨¨ ¢ë¢®¤¨¬ëå ¢ ¡ãä¥à |
|
- | 1106 | mov edx,dword[color] |
|
- | 1107 | mov ebx,edx ;ª®®à¤¨ â x0 ¢ ebx 㦥 ¥ 㦠|
|
- | 1108 | ror edx,16 ;¯®¢®à 稢 ¥¬ ॣ¨áâà çâ® ¡ë 3-© ¡ ©â ¯®¯ « ¢ dl |
|
1096 | mov edx,dword[color] |
1109 | cld |
1097 | @@: ;横« ¯® ®á¨ x ®â x0 ¤® x1 |
- | |
1098 | cmp ebx,esi |
- | |
1099 | jge @f |
- | |
1100 | bt ebx,31 |
- | |
1101 | jc .otr_x |
1110 | @@: ;横« ¯® ®á¨ x ®â x0 ¤® x1 |
1102 | mov word[eax],dx ;copy pixel color |
- | |
1103 | ror edx,16 |
1111 | mov word[eax],bx ;copy pixel color |
1104 | mov byte[eax+2],dl |
- | |
1105 | ror edx,16 |
- | |
1106 | .otr_x: |
1112 | mov byte[eax+2],dl |
1107 | add eax,3 |
- | |
1108 | inc ebx |
1113 | add eax,3 |
1109 | jmp @b |
- | |
1110 | @@: |
1114 | loop @b |
1111 | .end24: |
1115 | .end24: |
1112 | popad |
1116 | popad |
1113 | ret |
1117 | ret |
1114 | endp |
1118 | endp |
1115 | 1119 | ||
1116 | align 4 |
1120 | align 4 |
1117 | proc buf_rect_by_size, buf_struc:dword, coord_x:dword,coord_y:dword,w:dword,h:dword, color:dword |
1121 | proc buf_rect_by_size, buf_struc:dword, coord_x:dword,coord_y:dword,w:dword,h:dword, color:dword |
1118 | pushad |
1122 | pushad |
1119 | mov edi,[buf_struc] |
1123 | mov edi,[buf_struc] |
1120 | cmp buf2d_bits,24 |
1124 | cmp buf2d_bits,24 |
1121 | jne .coord_end |
1125 | jne .coord_end |
1122 | 1126 | ||
1123 | mov eax,[coord_x] |
1127 | mov eax,[coord_x] |
1124 | mov ebx,[coord_y] |
1128 | mov ebx,[coord_y] |
1125 | mov ecx,[w] |
1129 | mov ecx,[w] |
1126 | cmp ecx,1 |
1130 | cmp ecx,1 |
1127 | jl .coord_end |
1131 | jl .coord_end |
1128 | add ecx,eax |
1132 | add ecx,eax |
1129 | dec ecx |
1133 | dec ecx |
1130 | mov edx,[h] |
1134 | mov edx,[h] |
1131 | cmp edx,1 |
1135 | cmp edx,1 |
1132 | jl .coord_end |
1136 | jl .coord_end |
1133 | 1137 | ||
1134 | add edx,ebx |
1138 | add edx,ebx |
1135 | dec edx |
1139 | dec edx |
1136 | mov esi,dword[color] |
1140 | mov esi,dword[color] |
1137 | stdcall buf_line_h, edi, eax, ebx, ecx, esi ;«¨¨ï - |
1141 | stdcall buf_line_h, edi, eax, ebx, ecx, esi ;«¨¨ï - |
1138 | stdcall buf_line_brs, edi, eax, ebx, eax, edx, esi ;«¨¨ï | |
1142 | stdcall buf_line_brs, edi, eax, ebx, eax, edx, esi ;«¨¨ï | |
1139 | stdcall buf_line_h, edi, eax, edx, ecx, esi ;«¨¨ï - |
1143 | stdcall buf_line_h, edi, eax, edx, ecx, esi ;«¨¨ï - |
1140 | stdcall buf_line_brs, edi, ecx, ebx, ecx, edx, esi ;«¨¨ï | |
1144 | stdcall buf_line_brs, edi, ecx, ebx, ecx, edx, esi ;«¨¨ï | |
1141 | .coord_end: |
1145 | .coord_end: |
1142 | popad |
1146 | popad |
1143 | ret |
1147 | ret |
1144 | endp |
1148 | endp |
1145 | 1149 | ||
1146 | align 4 |
1150 | align 4 |
1147 | proc buf_filled_rect_by_size, buf_struc:dword, coord_x:dword,coord_y:dword,w:dword,h:dword, color:dword |
1151 | proc buf_filled_rect_by_size, buf_struc:dword, coord_x:dword,coord_y:dword,w:dword,h:dword, color:dword |
1148 | pushad |
1152 | pushad |
1149 | mov edi,[buf_struc] |
1153 | mov edi,[buf_struc] |
1150 | cmp buf2d_bits,24 |
1154 | cmp buf2d_bits,24 |
1151 | jne .coord_end |
1155 | jne .coord_end |
1152 | mov eax,[coord_x] |
1156 | mov eax,[coord_x] |
1153 | mov ebx,[coord_y] |
1157 | mov ebx,[coord_y] |
1154 | mov edx,[w] |
1158 | mov edx,[w] |
1155 | add edx,eax |
1159 | add edx,eax |
1156 | mov ecx,[h] |
1160 | mov ecx,[h] |
1157 | cmp ecx,1 ;áà ¢¥¨¥ á ¬¨¨¬ «ì® ¢®§¬®¦®© ¢ëá®â®© |
1161 | cmp ecx,1 ;áà ¢¥¨¥ á ¬¨¨¬ «ì® ¢®§¬®¦®© ¢ëá®â®© |
1158 | jl .coord_end ;¥á«¨ ¢ëá®â ¬¥ìè¥ 1-£® ¯¨ªá¥«ï |
1162 | jl .coord_end ;¥á«¨ ¢ëá®â ¬¥ìè¥ 1-£® ¯¨ªá¥«ï |
1159 | mov esi,dword[color] |
1163 | mov esi,dword[color] |
1160 | cld |
1164 | cld |
1161 | @@: |
1165 | @@: |
1162 | stdcall buf_line_h, edi, eax, ebx, edx, esi ;«¨¨ï - |
1166 | stdcall buf_line_h, edi, eax, ebx, edx, esi ;«¨¨ï - |
1163 | inc ebx |
1167 | inc ebx |
1164 | loop @b |
1168 | loop @b |
1165 | .coord_end: |
1169 | .coord_end: |
1166 | popad |
1170 | popad |
1167 | ret |
1171 | ret |
1168 | endp |
1172 | endp |
1169 | 1173 | ||
1170 | align 4 |
1174 | align 4 |
1171 | proc buf_circle, buf_struc:dword, coord_x:dword, coord_y:dword, r:dword, color:dword |
1175 | proc buf_circle, buf_struc:dword, coord_x:dword, coord_y:dword, r:dword, color:dword |
1172 | locals |
1176 | locals |
1173 | po_x dd ? |
1177 | po_x dd ? |
1174 | po_y dd ? |
1178 | po_y dd ? |
1175 | endl |
1179 | endl |
1176 | pushad |
1180 | pushad |
1177 | mov edi,dword[buf_struc] |
1181 | mov edi,dword[buf_struc] |
1178 | cmp buf2d_bits,24 |
1182 | cmp buf2d_bits,24 |
1179 | jne .error |
1183 | jne .error |
1180 | mov edx,dword[color] |
1184 | mov edx,dword[color] |
1181 | 1185 | ||
1182 | finit |
1186 | finit |
1183 | fild dword[coord_x] |
1187 | fild dword[coord_x] |
1184 | fild dword[coord_y] |
1188 | fild dword[coord_y] |
1185 | fild dword[r] |
1189 | fild dword[r] |
1186 | fldz ;px=0 |
1190 | fldz ;px=0 |
1187 | fld st1 ;py=r |
1191 | fld st1 ;py=r |
1188 | 1192 | ||
1189 | fldpi |
1193 | fldpi |
1190 | fmul st0,st3 |
1194 | fmul st0,st3 |
1191 | fistp dword[po_x] |
1195 | fistp dword[po_x] |
1192 | mov esi,dword[po_x] ;esi=pi*r |
1196 | mov esi,dword[po_x] ;esi=pi*r |
1193 | shl esi,1 ;esi=2*pi*r |
1197 | shl esi,1 ;esi=2*pi*r |
1194 | 1198 | ||
1195 | ;st0 = py |
1199 | ;st0 = py |
1196 | ;st1 = px |
1200 | ;st1 = px |
1197 | ;st2 = r |
1201 | ;st2 = r |
1198 | ;st3 = y |
1202 | ;st3 = y |
1199 | ;st4 = x |
1203 | ;st4 = x |
1200 | 1204 | ||
1201 | @@: |
1205 | @@: |
1202 | ;Point(px + x, y - py) |
1206 | ;Point(px + x, y - py) |
1203 | fld st1 ;st0=px |
1207 | fld st1 ;st0=px |
1204 | fadd st0,st5 ;st0=px+x |
1208 | fadd st0,st5 ;st0=px+x |
1205 | fistp dword[po_x] |
1209 | fistp dword[po_x] |
1206 | mov ebx,dword[po_x] |
1210 | mov ebx,dword[po_x] |
1207 | fld st3 ;st0=y |
1211 | fld st3 ;st0=y |
1208 | fsub st0,st1 ;st0=y-py |
1212 | fsub st0,st1 ;st0=y-py |
1209 | fistp dword[po_y] |
1213 | fistp dword[po_y] |
1210 | mov ecx,dword[po_y] |
1214 | mov ecx,dword[po_y] |
1211 | call draw_pixel |
1215 | call draw_pixel |
1212 | ;px += py/r |
1216 | ;px += py/r |
1213 | fld st0 ;st0=py |
1217 | fld st0 ;st0=py |
1214 | fdiv st0,st3 ;st0=py/r |
1218 | fdiv st0,st3 ;st0=py/r |
1215 | faddp st2,st0 ;st3+=st0 |
1219 | faddp st2,st0 ;st3+=st0 |
1216 | ;py -= px/r |
1220 | ;py -= px/r |
1217 | fld st1 ;st0=px |
1221 | fld st1 ;st0=px |
1218 | fdiv st0,st3 ;st0=px/r |
1222 | fdiv st0,st3 ;st0=px/r |
1219 | fsubp st1,st0 ;st2-=st0 |
1223 | fsubp st1,st0 ;st2-=st0 |
1220 | 1224 | ||
1221 | dec esi |
1225 | dec esi |
1222 | cmp esi,0 |
1226 | cmp esi,0 |
1223 | jge @b |
1227 | jge @b |
1224 | jmp .exit_fun |
1228 | jmp .exit_fun |
1225 | .error: |
1229 | .error: |
1226 | stdcall print_err,sz_buf2d_circle,txt_err_n24b |
1230 | stdcall print_err,sz_buf2d_circle,txt_err_n24b |
1227 | .exit_fun: |
1231 | .exit_fun: |
1228 | 1232 | ||
1229 | popad |
1233 | popad |
1230 | ret |
1234 | ret |
1231 | endp |
1235 | endp |
1232 | 1236 | ||
1233 | ;äãªæ¨ï ¤«ï § «¨¢ª¨ ®¡« á⨠¢ë¡à ë¬ æ¢¥â®¬ |
1237 | ;äãªæ¨ï ¤«ï § «¨¢ª¨ ®¡« á⨠¢ë¡à ë¬ æ¢¥â®¬ |
1234 | align 4 |
1238 | align 4 |
1235 | proc buf_flood_fill, buf_struc:dword, coord_x:dword, coord_y:dword, mode:dword, color_f:dword, color_b:dword |
1239 | proc buf_flood_fill, buf_struc:dword, coord_x:dword, coord_y:dword, mode:dword, color_f:dword, color_b:dword |
1236 | pushad |
1240 | pushad |
1237 | mov edi,[buf_struc] |
1241 | mov edi,[buf_struc] |
1238 | cmp buf2d_bits,24 |
1242 | cmp buf2d_bits,24 |
1239 | jne .end24 |
1243 | jne .end24 |
1240 | 1244 | ||
1241 | mov ebx,dword[coord_x] |
1245 | mov ebx,dword[coord_x] |
1242 | mov ecx,dword[coord_y] |
1246 | mov ecx,dword[coord_y] |
1243 | mov edx,dword[color_f] |
1247 | mov edx,dword[color_f] |
1244 | mov esi,dword[color_b] |
1248 | mov esi,dword[color_b] |
1245 | 1249 | ||
1246 | cmp dword[mode],1 ;¢ § ¢¨á¨¬®á⨠®â 'mode' ®¯à¥¤¥«ï¥¬ ª ª¨¬ «£®à¨â¬®¬ ¡ã¤¥¬ ¯®«ì§®¢ âìáï |
1250 | cmp dword[mode],1 ;¢ § ¢¨á¨¬®á⨠®â 'mode' ®¯à¥¤¥«ï¥¬ ª ª¨¬ «£®à¨â¬®¬ ¡ã¤¥¬ ¯®«ì§®¢ âìáï |
1247 | je @f |
1251 | je @f |
1248 | call buf_flood_fill_recurs_0 ;§ «¨¢ ¥¬ ¤® ¯¨ªá¥«¥© 梥â esi |
1252 | call buf_flood_fill_recurs_0 ;§ «¨¢ ¥¬ ¤® ¯¨ªá¥«¥© 梥â esi |
1249 | jmp .end24 |
1253 | jmp .end24 |
1250 | @@: |
1254 | @@: |
1251 | call buf_flood_fill_recurs_1 ;§ «¨¢ ¥¬ ¯¨ªá¥«¨ ¨¬¥î騥 梥â esi |
1255 | call buf_flood_fill_recurs_1 ;§ «¨¢ ¥¬ ¯¨ªá¥«¨ ¨¬¥î騥 梥â esi |
1252 | 1256 | ||
1253 | .end24: |
1257 | .end24: |
1254 | popad |
1258 | popad |
1255 | ret |
1259 | ret |
1256 | endp |
1260 | endp |
1257 | 1261 | ||
1258 | ;input: |
1262 | ;input: |
1259 | ; ebx = coord_x |
1263 | ; ebx = coord_x |
1260 | ; ecx = coord_y |
1264 | ; ecx = coord_y |
1261 | ; edx = 梥⠧ «¨¢ª¨ |
1265 | ; edx = 梥⠧ «¨¢ª¨ |
1262 | ; esi = æ¢¥â £à ¨æë, ¤® ª®â®à®© ¡ã¤¥â ¨â¨ § «¨¢ª |
1266 | ; esi = æ¢¥â £à ¨æë, ¤® ª®â®à®© ¡ã¤¥â ¨â¨ § «¨¢ª |
1263 | ; edi = buf_struc |
1267 | ; edi = buf_struc |
1264 | ;output: |
1268 | ;output: |
1265 | ; eax = ¯®àâ¨âáï |
1269 | ; eax = ¯®àâ¨âáï |
1266 | align 4 |
1270 | align 4 |
1267 | buf_flood_fill_recurs_0: |
1271 | buf_flood_fill_recurs_0: |
1268 | call get_pixel_24 |
1272 | call get_pixel_24 |
1269 | cmp eax,0xffffffff ;if error coords |
1273 | cmp eax,0xffffffff ;if error coords |
1270 | je .end_fun |
1274 | je .end_fun |
1271 | cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, § ç¨â § «¨¢ª ¢ í⮩ ®¡« á⨠㦥 ¡ë« ᤥ« |
1275 | cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, § ç¨â § «¨¢ª ¢ í⮩ ®¡« á⨠㦥 ¡ë« ᤥ« |
1272 | je .end_fun |
1276 | je .end_fun |
1273 | 1277 | ||
1274 | call draw_pixel |
1278 | call draw_pixel |
1275 | 1279 | ||
1276 | dec ebx |
1280 | dec ebx |
1277 | call get_pixel_24 |
1281 | call get_pixel_24 |
1278 | cmp eax,esi |
1282 | cmp eax,esi |
1279 | je @f |
1283 | je @f |
1280 | call buf_flood_fill_recurs_0 |
1284 | call buf_flood_fill_recurs_0 |
1281 | @@: |
1285 | @@: |
1282 | inc ebx |
1286 | inc ebx |
1283 | 1287 | ||
1284 | 1288 | ||
1285 | inc ebx |
1289 | inc ebx |
1286 | call get_pixel_24 |
1290 | call get_pixel_24 |
1287 | cmp eax,esi |
1291 | cmp eax,esi |
1288 | je @f |
1292 | je @f |
1289 | call buf_flood_fill_recurs_0 |
1293 | call buf_flood_fill_recurs_0 |
1290 | @@: |
1294 | @@: |
1291 | dec ebx |
1295 | dec ebx |
1292 | 1296 | ||
1293 | dec ecx |
1297 | dec ecx |
1294 | call get_pixel_24 |
1298 | call get_pixel_24 |
1295 | cmp eax,esi |
1299 | cmp eax,esi |
1296 | je @f |
1300 | je @f |
1297 | call buf_flood_fill_recurs_0 |
1301 | call buf_flood_fill_recurs_0 |
1298 | @@: |
1302 | @@: |
1299 | inc ecx |
1303 | inc ecx |
1300 | 1304 | ||
1301 | inc ecx |
1305 | inc ecx |
1302 | call get_pixel_24 |
1306 | call get_pixel_24 |
1303 | cmp eax,esi |
1307 | cmp eax,esi |
1304 | je @f |
1308 | je @f |
1305 | call buf_flood_fill_recurs_0 |
1309 | call buf_flood_fill_recurs_0 |
1306 | @@: |
1310 | @@: |
1307 | dec ecx |
1311 | dec ecx |
1308 | 1312 | ||
1309 | .end_fun: |
1313 | .end_fun: |
1310 | ret |
1314 | ret |
1311 | 1315 | ||
1312 | ;input: |
1316 | ;input: |
1313 | ; ebx = coord_x |
1317 | ; ebx = coord_x |
1314 | ; ecx = coord_y |
1318 | ; ecx = coord_y |
1315 | ; edx = 梥⠧ «¨¢ª¨ |
1319 | ; edx = 梥⠧ «¨¢ª¨ |
1316 | ; esi = 梥⠯¨ªá¥«¥©, ¯® ª®â®àë¬ ¡ã¤¥â ¨â¨ § «¨¢ª |
1320 | ; esi = 梥⠯¨ªá¥«¥©, ¯® ª®â®àë¬ ¡ã¤¥â ¨â¨ § «¨¢ª |
1317 | ; edi = buf_struc |
1321 | ; edi = buf_struc |
1318 | ;output: |
1322 | ;output: |
1319 | ; eax = ¯®àâ¨âáï |
1323 | ; eax = ¯®àâ¨âáï |
1320 | align 4 |
1324 | align 4 |
1321 | buf_flood_fill_recurs_1: |
1325 | buf_flood_fill_recurs_1: |
1322 | call get_pixel_24 |
1326 | call get_pixel_24 |
1323 | cmp eax,0xffffffff ;if error coords |
1327 | cmp eax,0xffffffff ;if error coords |
1324 | je .end_fun |
1328 | je .end_fun |
1325 | cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, § ç¨â § «¨¢ª ¢ í⮩ ®¡« á⨠㦥 ¡ë« ᤥ« |
1329 | cmp eax,edx ;¥á«¨ 梥⠯¨ªá¥«ï ᮢ¯ « á 梥⮬ § «¨¢ª¨, § ç¨â § «¨¢ª ¢ í⮩ ®¡« á⨠㦥 ¡ë« ᤥ« |
1326 | je .end_fun |
1330 | je .end_fun |
1327 | cmp eax,esi ;¥á«¨ 梥⠯¨ªá¥«ï ¥ ᮢ¯ « á § «¨¢ ¥¬ë¬ 梥⮬ § «¨¢ª¨, â® ¯à¥ªà é ¥¬ § «¨¢ªã |
1331 | cmp eax,esi ;¥á«¨ 梥⠯¨ªá¥«ï ¥ ᮢ¯ « á § «¨¢ ¥¬ë¬ 梥⮬ § «¨¢ª¨, â® ¯à¥ªà é ¥¬ § «¨¢ªã |
1328 | jne .end_fun |
1332 | jne .end_fun |
1329 | 1333 | ||
1330 | call draw_pixel |
1334 | call draw_pixel |
1331 | 1335 | ||
1332 | dec ebx |
1336 | dec ebx |
1333 | call get_pixel_24 |
1337 | call get_pixel_24 |
1334 | cmp eax,esi |
1338 | cmp eax,esi |
1335 | jne @f |
1339 | jne @f |
1336 | call buf_flood_fill_recurs_1 |
1340 | call buf_flood_fill_recurs_1 |
1337 | @@: |
1341 | @@: |
1338 | inc ebx |
1342 | inc ebx |
1339 | 1343 | ||
1340 | 1344 | ||
1341 | inc ebx |
1345 | inc ebx |
1342 | call get_pixel_24 |
1346 | call get_pixel_24 |
1343 | cmp eax,esi |
1347 | cmp eax,esi |
1344 | jne @f |
1348 | jne @f |
1345 | call buf_flood_fill_recurs_1 |
1349 | call buf_flood_fill_recurs_1 |
1346 | @@: |
1350 | @@: |
1347 | dec ebx |
1351 | dec ebx |
1348 | 1352 | ||
1349 | dec ecx |
1353 | dec ecx |
1350 | call get_pixel_24 |
1354 | call get_pixel_24 |
1351 | cmp eax,esi |
1355 | cmp eax,esi |
1352 | jne @f |
1356 | jne @f |
1353 | call buf_flood_fill_recurs_1 |
1357 | call buf_flood_fill_recurs_1 |
1354 | @@: |
1358 | @@: |
1355 | inc ecx |
1359 | inc ecx |
1356 | 1360 | ||
1357 | inc ecx |
1361 | inc ecx |
1358 | call get_pixel_24 |
1362 | call get_pixel_24 |
1359 | cmp eax,esi |
1363 | cmp eax,esi |
1360 | jne @f |
1364 | jne @f |
1361 | call buf_flood_fill_recurs_1 |
1365 | call buf_flood_fill_recurs_1 |
1362 | @@: |
1366 | @@: |
1363 | dec ecx |
1367 | dec ecx |
1364 | 1368 | ||
1365 | .end_fun: |
1369 | .end_fun: |
1366 | ret |
1370 | ret |
1367 | 1371 | ||
1368 | ;äãªæ¨ï ¤«ï à¨á®¢ ¨ï â®çª¨ |
1372 | ;äãªæ¨ï ¤«ï à¨á®¢ ¨ï â®çª¨ |
1369 | align 4 |
1373 | align 4 |
1370 | proc buf_set_pixel, buf_struc:dword, coord_x:dword, coord_y:dword, color:dword |
1374 | proc buf_set_pixel, buf_struc:dword, coord_x:dword, coord_y:dword, color:dword |
1371 | pushad |
1375 | pushad |
1372 | mov edi,[buf_struc] |
1376 | mov edi,[buf_struc] |
1373 | cmp buf2d_bits,24 |
1377 | cmp buf2d_bits,24 |
1374 | jne .end24 |
1378 | jne .end24 |
1375 | mov ebx,dword[coord_x] |
1379 | mov ebx,dword[coord_x] |
1376 | mov ecx,dword[coord_y] |
1380 | mov ecx,dword[coord_y] |
1377 | mov edx,dword[color] |
1381 | mov edx,dword[color] |
1378 | call draw_pixel |
1382 | call draw_pixel |
1379 | .end24: |
1383 | .end24: |
1380 | popad |
1384 | popad |
1381 | ret |
1385 | ret |
1382 | endp |
1386 | endp |
1383 | 1387 | ||
1384 | align 4 |
1388 | align 4 |
1385 | proc buf_img_wdiv2, buf_struc:dword |
1389 | proc buf_img_wdiv2, buf_struc:dword |
1386 | pushad |
1390 | pushad |
1387 | mov edi,dword[buf_struc] |
1391 | mov edi,dword[buf_struc] |
1388 | cmp buf2d_bits,24 |
1392 | cmp buf2d_bits,24 |
1389 | jne .end_draw_24 |
1393 | jne .end_draw_24 |
1390 | mov eax,buf2d_w |
1394 | mov eax,buf2d_w |
1391 | mov ecx,buf2d_h |
1395 | mov ecx,buf2d_h |
1392 | imul ecx,eax |
1396 | imul ecx,eax |
1393 | stdcall img_rgb24_wdiv2, buf2d_data,ecx |
1397 | stdcall img_rgb24_wdiv2, buf2d_data,ecx |
1394 | .end_draw_24: |
1398 | .end_draw_24: |
1395 | popad |
1399 | popad |
1396 | ret |
1400 | ret |
1397 | endp |
1401 | endp |
1398 | 1402 | ||
1399 | ;input: |
1403 | ;input: |
1400 | ;data_rgb - pointer to rgb data |
1404 | ;data_rgb - pointer to rgb data |
1401 | ;size - count img pixels (size img data / 3(rgb) ) |
1405 | ;size - count img pixels (size img data / 3(rgb) ) |
1402 | align 4 |
1406 | align 4 |
1403 | proc img_rgb24_wdiv2 data_rgb:dword, size:dword |
1407 | proc img_rgb24_wdiv2 data_rgb:dword, size:dword |
1404 | ;push eax ebx ecx edx |
1408 | ;push eax ebx ecx edx |
1405 | mov eax,dword[data_rgb] |
1409 | mov eax,dword[data_rgb] |
1406 | mov ecx,dword[size] ;ecx = size |
1410 | mov ecx,dword[size] ;ecx = size |
1407 | lea ecx,[ecx+ecx*2] |
1411 | lea ecx,[ecx+ecx*2] |
1408 | cld |
1412 | cld |
1409 | @@: ;§ ⥬¥¨¥ 梥⠯¨ªá¥«¥© |
1413 | @@: ;§ ⥬¥¨¥ 梥⠯¨ªá¥«¥© |
1410 | shr byte[eax],1 |
1414 | shr byte[eax],1 |
1411 | inc eax |
1415 | inc eax |
1412 | loop @b |
1416 | loop @b |
1413 | 1417 | ||
1414 | mov eax,dword[data_rgb] |
1418 | mov eax,dword[data_rgb] |
1415 | mov ecx,dword[size] ;ecx = size |
1419 | mov ecx,dword[size] ;ecx = size |
1416 | shr ecx,1 |
1420 | shr ecx,1 |
1417 | @@: ;á«®¦¥¨¥ 梥⮢ ¯¨ªá¥«¥© |
1421 | @@: ;á«®¦¥¨¥ 梥⮢ ¯¨ªá¥«¥© |
1418 | mov bx,word[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤¥£® ¯¨ªá¥«ï |
1422 | mov bx,word[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤¥£® ¯¨ªá¥«ï |
1419 | add word[eax],bx |
1423 | add word[eax],bx |
1420 | mov bl,byte[eax+5] ;ª®¯¨à㥬 梥â á®á¥¤¥£® ¯¨ªá¥«ï |
1424 | mov bl,byte[eax+5] ;ª®¯¨à㥬 梥â á®á¥¤¥£® ¯¨ªá¥«ï |
1421 | add byte[eax+2],bl |
1425 | add byte[eax+2],bl |
1422 | add eax,6 ;=2*3 |
1426 | add eax,6 ;=2*3 |
1423 | loop @b |
1427 | loop @b |
1424 | 1428 | ||
1425 | mov eax,dword[data_rgb] |
1429 | mov eax,dword[data_rgb] |
1426 | add eax,3 |
1430 | add eax,3 |
1427 | mov ebx,eax |
1431 | mov ebx,eax |
1428 | add ebx,3 |
1432 | add ebx,3 |
1429 | mov ecx,dword[size] ;ecx = size |
1433 | mov ecx,dword[size] ;ecx = size |
1430 | shr ecx,1 |
1434 | shr ecx,1 |
1431 | dec ecx ;«¨è¨© ¯¨ªá¥«ì |
1435 | dec ecx ;«¨è¨© ¯¨ªá¥«ì |
1432 | @@: ;¯®¤¦ ⨥ ¯¨ªá¥«¥© |
1436 | @@: ;¯®¤¦ ⨥ ¯¨ªá¥«¥© |
1433 | mov edx,dword[ebx] |
1437 | mov edx,dword[ebx] |
1434 | mov word[eax],dx |
1438 | mov word[eax],dx |
1435 | shr edx,16 |
1439 | shr edx,16 |
1436 | mov byte[eax+2],dl |
1440 | mov byte[eax+2],dl |
1437 | 1441 | ||
1438 | add eax,3 |
1442 | add eax,3 |
1439 | add ebx,6 |
1443 | add ebx,6 |
1440 | loop @b |
1444 | loop @b |
1441 | ;pop edx ecx ebx eax |
1445 | ;pop edx ecx ebx eax |
1442 | ret |
1446 | ret |
1443 | endp |
1447 | endp |
1444 | 1448 | ||
1445 | align 4 |
1449 | align 4 |
1446 | proc buf_img_hdiv2, buf_struc:dword |
1450 | proc buf_img_hdiv2, buf_struc:dword |
1447 | pushad |
1451 | pushad |
1448 | mov edi,dword[buf_struc] |
1452 | mov edi,dword[buf_struc] |
1449 | cmp buf2d_bits,24 |
1453 | cmp buf2d_bits,24 |
1450 | jne .end_draw_24 |
1454 | jne .end_draw_24 |
1451 | mov eax,buf2d_w |
1455 | mov eax,buf2d_w |
1452 | mov ecx,buf2d_h |
1456 | mov ecx,buf2d_h |
1453 | imul ecx,eax |
1457 | imul ecx,eax |
1454 | stdcall img_rgb24_hdiv2, buf2d_data,ecx,eax |
1458 | stdcall img_rgb24_hdiv2, buf2d_data,ecx,eax |
1455 | .end_draw_24: |
1459 | .end_draw_24: |
1456 | popad |
1460 | popad |
1457 | ret |
1461 | ret |
1458 | endp |
1462 | endp |
1459 | 1463 | ||
1460 | ;input: |
1464 | ;input: |
1461 | ;data_rgb - pointer to rgb data |
1465 | ;data_rgb - pointer to rgb data |
1462 | ;size - count img pixels (size img data / 3(rgb) ) |
1466 | ;size - count img pixels (size img data / 3(rgb) ) |
1463 | ;size_w - width img in pixels |
1467 | ;size_w - width img in pixels |
1464 | align 4 |
1468 | align 4 |
1465 | proc img_rgb24_hdiv2, data_rgb:dword, size:dword, size_w:dword |
1469 | proc img_rgb24_hdiv2, data_rgb:dword, size:dword, size_w:dword |
1466 | ;pushad |
1470 | ;pushad |
1467 | 1471 | ||
1468 | mov eax,dword[data_rgb] ;eax = |
1472 | mov eax,dword[data_rgb] ;eax = |
1469 | mov ecx,dword[size] ;ecx = size |
1473 | mov ecx,dword[size] ;ecx = size |
1470 | lea ecx,[ecx+ecx*2] |
1474 | lea ecx,[ecx+ecx*2] |
1471 | cld |
1475 | cld |
1472 | @@: ;§ ⥬¥¨¥ 梥⠯¨ªá¥«¥© |
1476 | @@: ;§ ⥬¥¨¥ 梥⠯¨ªá¥«¥© |
1473 | shr byte[eax],1 |
1477 | shr byte[eax],1 |
1474 | inc eax |
1478 | inc eax |
1475 | loop @b |
1479 | loop @b |
1476 | 1480 | ||
1477 | mov eax,dword[data_rgb] ;eax = |
1481 | mov eax,dword[data_rgb] ;eax = |
1478 | mov edi,dword[size_w] |
1482 | mov edi,dword[size_w] |
1479 | lea esi,[edi+edi*2] ;esi = width*3(rgb) |
1483 | lea esi,[edi+edi*2] ;esi = width*3(rgb) |
1480 | mov ebx,esi |
1484 | mov ebx,esi |
1481 | add ebx,eax |
1485 | add ebx,eax |
1482 | mov ecx,dword[size] ;ecx = size |
1486 | mov ecx,dword[size] ;ecx = size |
1483 | shr ecx,1 |
1487 | shr ecx,1 |
1484 | xor edi,edi |
1488 | xor edi,edi |
1485 | @@: ;á«®¦¥¨¥ 梥⮢ ¯¨ªá¥«¥© |
1489 | @@: ;á«®¦¥¨¥ 梥⮢ ¯¨ªá¥«¥© |
1486 | mov dx,word[ebx] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1490 | mov dx,word[ebx] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1487 | add word[eax],dx |
1491 | add word[eax],dx |
1488 | mov dl,byte[ebx+2] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1492 | mov dl,byte[ebx+2] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1489 | add byte[eax+2],dl |
1493 | add byte[eax+2],dl |
1490 | 1494 | ||
1491 | add eax,3 |
1495 | add eax,3 |
1492 | add ebx,3 |
1496 | add ebx,3 |
1493 | inc edi |
1497 | inc edi |
1494 | cmp edi,dword[size_w] |
1498 | cmp edi,dword[size_w] |
1495 | jl .old_line |
1499 | jl .old_line |
1496 | add eax,esi |
1500 | add eax,esi |
1497 | add ebx,esi |
1501 | add ebx,esi |
1498 | xor edi,edi |
1502 | xor edi,edi |
1499 | .old_line: |
1503 | .old_line: |
1500 | loop @b |
1504 | loop @b |
1501 | 1505 | ||
1502 | 1506 | ||
1503 | mov eax,dword[data_rgb] ;eax = |
1507 | mov eax,dword[data_rgb] ;eax = |
1504 | add eax,esi ;esi = width*3(rgb) |
1508 | add eax,esi ;esi = width*3(rgb) |
1505 | mov ebx,esi |
1509 | mov ebx,esi |
1506 | add ebx,eax |
1510 | add ebx,eax |
1507 | mov ecx,dword[size] ;ecx = size |
1511 | mov ecx,dword[size] ;ecx = size |
1508 | shr ecx,1 |
1512 | shr ecx,1 |
1509 | sub ecx,dword[size_w] ;«¨èïï áâப ¯¨ªá¥«¥© |
1513 | sub ecx,dword[size_w] ;«¨èïï áâப ¯¨ªá¥«¥© |
1510 | xor edi,edi |
1514 | xor edi,edi |
1511 | @@: ;¯®¤¦ ⨥ ¯¨ªá¥«¥© |
1515 | @@: ;¯®¤¦ ⨥ ¯¨ªá¥«¥© |
1512 | mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1516 | mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠨¦¥£® ¯¨ªá¥«ï |
1513 | mov word[eax],dx |
1517 | mov word[eax],dx |
1514 | shr edx,16 |
1518 | shr edx,16 |
1515 | mov byte[eax+2],dl |
1519 | mov byte[eax+2],dl |
1516 | 1520 | ||
1517 | add eax,3 |
1521 | add eax,3 |
1518 | add ebx,3 |
1522 | add ebx,3 |
1519 | inc edi |
1523 | inc edi |
1520 | cmp edi,dword[size_w] |
1524 | cmp edi,dword[size_w] |
1521 | jl .old_line_2 |
1525 | jl .old_line_2 |
1522 | add ebx,esi |
1526 | add ebx,esi |
1523 | xor edi,edi |
1527 | xor edi,edi |
1524 | .old_line_2: |
1528 | .old_line_2: |
1525 | loop @b |
1529 | loop @b |
1526 | 1530 | ||
1527 | ;popad |
1531 | ;popad |
1528 | ret |
1532 | ret |
1529 | endp |
1533 | endp |
1530 | 1534 | ||
1531 | ;¯à¥®¡à §®¢ ¨¥ ¡ãä¥à ¨§ 24-¡¨â®£® ¢ 8-¡¨âë© |
1535 | ;¯à¥®¡à §®¢ ¨¥ ¡ãä¥à ¨§ 24-¡¨â®£® ¢ 8-¡¨âë© |
1532 | ; spectr - ®¯à¥¤¥«ï¥â ª ª®© ᯥªâà ¡à âì ¯à¨ ¯à¥®¡à §®¢ ¨¨ 0-ᨨ©, 1-§¥«¥ë©, 2-ªà áë© |
1536 | ; spectr - ®¯à¥¤¥«ï¥â ª ª®© ᯥªâà ¡à âì ¯à¨ ¯à¥®¡à §®¢ ¨¨ 0-ᨨ©, 1-§¥«¥ë©, 2-ªà áë© |
1533 | align 4 |
1537 | align 4 |
1534 | proc buf_conv_24_to_8, buf_struc:dword, spectr:dword |
1538 | proc buf_conv_24_to_8, buf_struc:dword, spectr:dword |
1535 | pushad |
1539 | pushad |
1536 | mov edi,dword[buf_struc] |
1540 | mov edi,dword[buf_struc] |
1537 | cmp buf2d_bits,24 |
1541 | cmp buf2d_bits,24 |
1538 | jne .error |
1542 | jne .error |
1539 | mov eax,buf2d_w |
1543 | mov eax,buf2d_w |
1540 | mov ecx,buf2d_h |
1544 | mov ecx,buf2d_h |
1541 | imul ecx,eax |
1545 | imul ecx,eax |
1542 | mov esi,ecx |
1546 | mov esi,ecx |
1543 | ;ebx - ¯ ¬ïâì ¨§ ª®â®à®© ª®¯¨àã¥âáï |
1547 | ;ebx - ¯ ¬ïâì ¨§ ª®â®à®© ª®¯¨àã¥âáï |
1544 | ;edx - ¯ ¬ïâì ªã¤ ª®¯¨àã¥âáï |
1548 | ;edx - ¯ ¬ïâì ªã¤ ª®¯¨àã¥âáï |
1545 | mov edx,buf2d_data |
1549 | mov edx,buf2d_data |
1546 | mov ebx,edx |
1550 | mov ebx,edx |
1547 | cmp [spectr],3 |
1551 | cmp [spectr],3 |
1548 | jge @f |
1552 | jge @f |
1549 | add ebx,[spectr] |
1553 | add ebx,[spectr] |
1550 | @@: |
1554 | @@: |
1551 | mov al,byte[ebx] |
1555 | mov al,byte[ebx] |
1552 | mov byte[edx],al |
1556 | mov byte[edx],al |
1553 | add ebx,3 |
1557 | add ebx,3 |
1554 | inc edx |
1558 | inc edx |
1555 | loop @b |
1559 | loop @b |
1556 | mov buf2d_bits,8 |
1560 | mov buf2d_bits,8 |
1557 | invoke mem.realloc,buf2d_data,esi ;㬥ìè ¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
1561 | invoke mem.realloc,buf2d_data,esi ;㬥ìè ¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
1558 | jmp .end_conv |
1562 | jmp .end_conv |
1559 | .error: |
1563 | .error: |
1560 | stdcall print_err,sz_buf2d_conv_24_to_8,txt_err_n24b |
1564 | stdcall print_err,sz_buf2d_conv_24_to_8,txt_err_n24b |
1561 | .end_conv: |
1565 | .end_conv: |
1562 | popad |
1566 | popad |
1563 | ret |
1567 | ret |
1564 | endp |
1568 | endp |
1565 | 1569 | ||
1566 | ;¯à¥®¡à §®¢ ¨¥ ¡ãä¥à ¨§ 24-¡¨â®£® ¢ 32-¡¨âë© |
1570 | ;¯à¥®¡à §®¢ ¨¥ ¡ãä¥à ¨§ 24-¡¨â®£® ¢ 32-¡¨âë© |
1567 | align 4 |
1571 | align 4 |
1568 | proc buf_conv_24_to_32, buf_struc:dword, buf_str8:dword |
1572 | proc buf_conv_24_to_32, buf_struc:dword, buf_str8:dword |
1569 | pushad |
1573 | pushad |
1570 | mov edi,dword[buf_struc] |
1574 | mov edi,dword[buf_struc] |
1571 | cmp buf2d_bits,24 |
1575 | cmp buf2d_bits,24 |
1572 | jne .error1 |
1576 | jne .error1 |
1573 | mov ecx,buf2d_w |
1577 | mov ecx,buf2d_w |
1574 | mov ebx,buf2d_h |
1578 | mov ebx,buf2d_h |
1575 | imul ebx,ecx |
1579 | imul ebx,ecx |
1576 | mov ecx,ebx ;ecx = size 8 b |
1580 | mov ecx,ebx ;ecx = size 8 b |
1577 | shl ebx,2 ;ebx = size 32 b |
1581 | shl ebx,2 ;ebx = size 32 b |
1578 | invoke mem.realloc,buf2d_data,ebx ;㢥«¨ç¨¢ ¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
1582 | invoke mem.realloc,buf2d_data,ebx ;㢥«¨ç¨¢ ¥¬ ¯ ¬ïâì § ¨¬ ¥¬ãî ¡ãä¥à®¬ |
1579 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
1583 | mov buf2d_data,eax ; á«ãç © ¥á«¨ ¨§¬¥¨«áï 㪠§ â¥«ì ¤ ë¥ |
1580 | mov buf2d_bits,32 |
1584 | mov buf2d_bits,32 |
1581 | mov edx,ebx ;edx = size 32 b |
1585 | mov edx,ebx ;edx = size 32 b |
1582 | sub ebx,ecx ;ebx = size 24 b |
1586 | sub ebx,ecx ;ebx = size 24 b |
1583 | mov eax,ecx |
1587 | mov eax,ecx |
1584 | ;eax - à §¬¥à 8 ¡¨âëå ¤ ëå |
1588 | ;eax - à §¬¥à 8 ¡¨âëå ¤ ëå |
1585 | ;ebx - à §¬¥à 24 ¡¨âëå ¤ ëå |
1589 | ;ebx - à §¬¥à 24 ¡¨âëå ¤ ëå |
1586 | ;edx - à §¬¥à 32 ¡¨âëå ¤ ëå |
1590 | ;edx - à §¬¥à 32 ¡¨âëå ¤ ëå |
1587 | add ebx,buf2d_data |
1591 | add ebx,buf2d_data |
1588 | add edx,buf2d_data |
1592 | add edx,buf2d_data |
1589 | mov edi,dword[buf_str8] |
1593 | mov edi,dword[buf_str8] |
1590 | cmp buf2d_bits,8 |
1594 | cmp buf2d_bits,8 |
1591 | jne .error2 |
1595 | jne .error2 |
1592 | add eax,buf2d_data |
1596 | add eax,buf2d_data |
1593 | mov edi,edx |
1597 | mov edi,edx |
1594 | ;eax - 㪠§ â¥«ì ª®¥æ 8 ¡¨âëå ¤ ëå |
1598 | ;eax - 㪠§ â¥«ì ª®¥æ 8 ¡¨âëå ¤ ëå |
1595 | ;ebx - 㪠§ â¥«ì ª®¥æ 24 ¡¨âëå ¤ ëå |
1599 | ;ebx - 㪠§ â¥«ì ª®¥æ 24 ¡¨âëå ¤ ëå |
1596 | ;edi - 㪠§ â¥«ì ª®¥æ 32 ¡¨âëå ¤ ëå |
1600 | ;edi - 㪠§ â¥«ì ª®¥æ 32 ¡¨âëå ¤ ëå |
1597 | @@: |
1601 | @@: |
1598 | sub edi,4 ;®â¨¬ ¥¬ ¢ ç «¥ 横« , |
1602 | sub edi,4 ;®â¨¬ ¥¬ ¢ ç «¥ 横« , |
1599 | sub ebx,3 ; ¯®â®¬ã, ç⮠㪠§ ⥫¨ áâ®ïâ |
1603 | sub ebx,3 ; ¯®â®¬ã, ç⮠㪠§ ⥫¨ áâ®ïâ |
1600 | dec eax ; § ¯à¥¤¥« ¬¨ ¡ãä¥à®¢ |
1604 | dec eax ; § ¯à¥¤¥« ¬¨ ¡ãä¥à®¢ |
1601 | mov edx,dword[ebx] |
1605 | mov edx,dword[ebx] |
1602 | mov dword[edi],edx |
1606 | mov dword[edi],edx |
1603 | mov dl,byte[eax] |
1607 | mov dl,byte[eax] |
1604 | mov byte[edi+3],dl |
1608 | mov byte[edi+3],dl |
1605 | loop @b |
1609 | loop @b |
1606 | 1610 | ||
1607 | jmp .end_conv |
1611 | jmp .end_conv |
1608 | .error1: |
1612 | .error1: |
1609 | stdcall print_err,sz_buf2d_conv_24_to_32,txt_err_n24b |
1613 | stdcall print_err,sz_buf2d_conv_24_to_32,txt_err_n24b |
1610 | jmp .end_conv |
1614 | jmp .end_conv |
1611 | .error2: |
1615 | .error2: |
1612 | stdcall print_err,sz_buf2d_conv_24_to_32,txt_err_n8b |
1616 | stdcall print_err,sz_buf2d_conv_24_to_32,txt_err_n8b |
1613 | .end_conv: |
1617 | .end_conv: |
1614 | popad |
1618 | popad |
1615 | ret |
1619 | ret |
1616 | endp |
1620 | endp |
1617 | 1621 | ||
1618 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (24b|32b) ¢ buf_destination (24b) |
1622 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (24b|32b) ¢ buf_destination (24b) |
1619 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1623 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1620 | ; ¯à®§à ç®áâì ¯à¨ ª®¯¨à®¢ ¨¨ ¥ ãç¨âë¢ ¥âáï |
1624 | ; ¯à®§à ç®áâì ¯à¨ ª®¯¨à®¢ ¨¨ ¥ ãç¨âë¢ ¥âáï |
1621 | align 4 |
1625 | align 4 |
1622 | proc buf_bit_blt, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword |
1626 | proc buf_bit_blt, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword |
1623 | locals |
1627 | locals |
1624 | right_bytes dd ? |
1628 | right_bytes dd ? |
1625 | endl |
1629 | endl |
1626 | pushad |
1630 | pushad |
1627 | 1631 | ||
1628 | mov edi,[buf_source] |
1632 | mov edi,[buf_source] |
1629 | cmp buf2d_bits,24 |
1633 | cmp buf2d_bits,24 |
1630 | je .sou24 |
1634 | je .sou24 |
1631 | cmp buf2d_bits,32 |
1635 | cmp buf2d_bits,32 |
1632 | je .sou32 |
1636 | je .sou32 |
1633 | jmp .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1637 | jmp .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1634 | 1638 | ||
1635 | .sou24: ;¢ ¨áâ®ç¨ª¥ 24 ¡¨â ï ª à⨪ |
1639 | .sou24: ;¢ ¨áâ®ç¨ª¥ 24 ¡¨â ï ª à⨪ |
1636 | mov eax,buf2d_w |
1640 | mov eax,buf2d_w |
1637 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1641 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1638 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1642 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1639 | 1643 | ||
1640 | mov edi,[buf_destination] |
1644 | mov edi,[buf_destination] |
1641 | cmp buf2d_bits,24 |
1645 | cmp buf2d_bits,24 |
1642 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1646 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1643 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1647 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1644 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1648 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1645 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1649 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1646 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1650 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1647 | mov ecx,[coord_y] |
1651 | mov ecx,[coord_y] |
1648 | cmp ecx,ebx |
1652 | cmp ecx,ebx |
1649 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1653 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1650 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1654 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1651 | cmp ecx,ebx |
1655 | cmp ecx,ebx |
1652 | jle @f |
1656 | jle @f |
1653 | sub ecx,ebx |
1657 | sub ecx,ebx |
1654 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1658 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1655 | @@: |
1659 | @@: |
1656 | mov ebx,buf2d_w |
1660 | mov ebx,buf2d_w |
1657 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1661 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1658 | imul ecx,[coord_y] |
1662 | imul ecx,[coord_y] |
1659 | add ecx,[coord_x] |
1663 | add ecx,[coord_x] |
1660 | lea ecx,[ecx+ecx*2] |
1664 | lea ecx,[ecx+ecx*2] |
1661 | add ecx,buf2d_data |
1665 | add ecx,buf2d_data |
1662 | sub ebx,eax |
1666 | sub ebx,eax |
1663 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1667 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1664 | 1668 | ||
1665 | mov [right_bytes],0 |
1669 | mov [right_bytes],0 |
1666 | mov ecx,[coord_x] |
1670 | mov ecx,[coord_x] |
1667 | cmp ecx,ebx |
1671 | cmp ecx,ebx |
1668 | jl @f |
1672 | jl @f |
1669 | sub ecx,ebx |
1673 | sub ecx,ebx |
1670 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1674 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1671 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1675 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1672 | lea ecx,[ecx+ecx*2] ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1676 | lea ecx,[ecx+ecx*2] ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1673 | mov [right_bytes],ecx |
1677 | mov [right_bytes],ecx |
1674 | @@: |
1678 | @@: |
1675 | 1679 | ||
1676 | lea eax,[eax+eax*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1680 | lea eax,[eax+eax*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1677 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1681 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1678 | 1682 | ||
1679 | cld |
1683 | cld |
1680 | cmp [right_bytes],0 |
1684 | cmp [right_bytes],0 |
1681 | jg .copy_1 |
1685 | jg .copy_1 |
1682 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1686 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1683 | mov ecx,eax |
1687 | mov ecx,eax |
1684 | rep movsb |
1688 | rep movsb |
1685 | add edi,ebx |
1689 | add edi,ebx |
1686 | dec edx |
1690 | dec edx |
1687 | cmp edx,0 |
1691 | cmp edx,0 |
1688 | jg .copy_0 |
1692 | jg .copy_0 |
1689 | jmp .copy_end |
1693 | jmp .copy_end |
1690 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1694 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1691 | mov ecx,eax |
1695 | mov ecx,eax |
1692 | rep movsb |
1696 | rep movsb |
1693 | add edi,ebx |
1697 | add edi,ebx |
1694 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1698 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1695 | dec edx |
1699 | dec edx |
1696 | cmp edx,0 |
1700 | cmp edx,0 |
1697 | jg .copy_1 |
1701 | jg .copy_1 |
1698 | jmp .copy_end |
1702 | jmp .copy_end |
1699 | 1703 | ||
1700 | .sou32: ;¢ ¨áâ®ç¨ª¥ 32 ¡¨â ï ª à⨪ |
1704 | .sou32: ;¢ ¨áâ®ç¨ª¥ 32 ¡¨â ï ª à⨪ |
1701 | mov eax,buf2d_w |
1705 | mov eax,buf2d_w |
1702 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1706 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1703 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1707 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1704 | 1708 | ||
1705 | mov edi,[buf_destination] |
1709 | mov edi,[buf_destination] |
1706 | cmp buf2d_bits,24 |
1710 | cmp buf2d_bits,24 |
1707 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1711 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1708 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1712 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1709 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1713 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1710 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1714 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1711 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1715 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1712 | mov ecx,[coord_y] |
1716 | mov ecx,[coord_y] |
1713 | cmp ecx,ebx |
1717 | cmp ecx,ebx |
1714 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1718 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1715 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1719 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1716 | cmp ecx,ebx |
1720 | cmp ecx,ebx |
1717 | jle @f |
1721 | jle @f |
1718 | sub ecx,ebx |
1722 | sub ecx,ebx |
1719 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1723 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1720 | @@: |
1724 | @@: |
1721 | mov ebx,buf2d_w |
1725 | mov ebx,buf2d_w |
1722 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1726 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1723 | imul ecx,[coord_y] |
1727 | imul ecx,[coord_y] |
1724 | add ecx,[coord_x] |
1728 | add ecx,[coord_x] |
1725 | lea ecx,[ecx+ecx*2] |
1729 | lea ecx,[ecx+ecx*2] |
1726 | add ecx,buf2d_data |
1730 | add ecx,buf2d_data |
1727 | sub ebx,eax |
1731 | sub ebx,eax |
1728 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1732 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1729 | 1733 | ||
1730 | mov [right_bytes],0 |
1734 | mov [right_bytes],0 |
1731 | mov ecx,[coord_x] |
1735 | mov ecx,[coord_x] |
1732 | cmp ecx,ebx |
1736 | cmp ecx,ebx |
1733 | jl @f |
1737 | jl @f |
1734 | sub ecx,ebx |
1738 | sub ecx,ebx |
1735 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1739 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1736 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1740 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1737 | shl ecx,2 ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1741 | shl ecx,2 ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1738 | mov [right_bytes],ecx |
1742 | mov [right_bytes],ecx |
1739 | @@: |
1743 | @@: |
1740 | 1744 | ||
1741 | ;eax - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1745 | ;eax - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1742 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1746 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1743 | 1747 | ||
1744 | cld |
1748 | cld |
1745 | cmp [right_bytes],0 |
1749 | cmp [right_bytes],0 |
1746 | jg .copy_3 |
1750 | jg .copy_3 |
1747 | .copy_2: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1751 | .copy_2: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1748 | mov ecx,eax |
1752 | mov ecx,eax |
1749 | @@: |
1753 | @@: |
1750 | movsw |
1754 | movsw |
1751 | movsb |
1755 | movsb |
1752 | inc esi |
1756 | inc esi |
1753 | loop @b |
1757 | loop @b |
1754 | add edi,ebx |
1758 | add edi,ebx |
1755 | dec edx |
1759 | dec edx |
1756 | cmp edx,0 |
1760 | cmp edx,0 |
1757 | jg .copy_2 |
1761 | jg .copy_2 |
1758 | jmp .copy_end |
1762 | jmp .copy_end |
1759 | .copy_3: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1763 | .copy_3: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1760 | mov ecx,eax |
1764 | mov ecx,eax |
1761 | @@: |
1765 | @@: |
1762 | movsw |
1766 | movsw |
1763 | movsb |
1767 | movsb |
1764 | inc esi |
1768 | inc esi |
1765 | loop @b |
1769 | loop @b |
1766 | add edi,ebx |
1770 | add edi,ebx |
1767 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1771 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1768 | dec edx |
1772 | dec edx |
1769 | cmp edx,0 |
1773 | cmp edx,0 |
1770 | jg .copy_3 |
1774 | jg .copy_3 |
1771 | 1775 | ||
1772 | .copy_end: |
1776 | .copy_end: |
1773 | popad |
1777 | popad |
1774 | ret |
1778 | ret |
1775 | endp |
1779 | endp |
1776 | 1780 | ||
1777 | ;input: |
1781 | ;input: |
1778 | ; esi = pointer to color1 + transparent |
1782 | ; esi = pointer to color1 + transparent |
1779 | ; edi = pointer to background color2 |
1783 | ; edi = pointer to background color2 |
1780 | ;output: |
1784 | ;output: |
1781 | ; [edi] = combine color |
1785 | ; [edi] = combine color |
1782 | align 4 |
1786 | align 4 |
1783 | combine_colors: |
1787 | combine_colors: |
1784 | push ax bx cx dx |
1788 | push ax bx cx dx |
1785 | mov bx,0x00ff ;---get transparent--- |
1789 | mov bx,0x00ff ;---get transparent--- |
1786 | mov cl,byte[esi+3] ;pro |
1790 | mov cl,byte[esi+3] ;pro |
1787 | xor ch,ch |
1791 | xor ch,ch |
1788 | sub bx,cx ;256-pro |
1792 | sub bx,cx ;256-pro |
1789 | ;---blye--- |
1793 | ;---blye--- |
1790 | xor ah,ah |
1794 | xor ah,ah |
1791 | mov al,byte[esi] |
1795 | mov al,byte[esi] |
1792 | imul ax,bx |
1796 | imul ax,bx |
1793 | xor dh,dh |
1797 | xor dh,dh |
1794 | mov dl,byte[edi] |
1798 | mov dl,byte[edi] |
1795 | imul dx,cx |
1799 | imul dx,cx |
1796 | add ax,dx |
1800 | add ax,dx |
1797 | mov byte[edi],ah |
1801 | mov byte[edi],ah |
1798 | ;---green--- |
1802 | ;---green--- |
1799 | xor ah,ah |
1803 | xor ah,ah |
1800 | mov al,byte[esi+1] |
1804 | mov al,byte[esi+1] |
1801 | imul ax,bx |
1805 | imul ax,bx |
1802 | xor dh,dh |
1806 | xor dh,dh |
1803 | mov dl,byte[edi+1] |
1807 | mov dl,byte[edi+1] |
1804 | imul dx,cx |
1808 | imul dx,cx |
1805 | add ax,dx |
1809 | add ax,dx |
1806 | mov byte[edi+1],ah |
1810 | mov byte[edi+1],ah |
1807 | ;---red--- |
1811 | ;---red--- |
1808 | xor ah,ah |
1812 | xor ah,ah |
1809 | mov al,byte[esi+2] |
1813 | mov al,byte[esi+2] |
1810 | imul ax,bx |
1814 | imul ax,bx |
1811 | xor dh,dh |
1815 | xor dh,dh |
1812 | mov dl,byte[edi+2] |
1816 | mov dl,byte[edi+2] |
1813 | imul dx,cx |
1817 | imul dx,cx |
1814 | add ax,dx |
1818 | add ax,dx |
1815 | mov byte[edi+2],ah |
1819 | mov byte[edi+2],ah |
1816 | 1820 | ||
1817 | pop dx cx bx ax |
1821 | pop dx cx bx ax |
1818 | ret |
1822 | ret |
1819 | 1823 | ||
1820 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (32b) ¢ buf_destination (24b) |
1824 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (32b) ¢ buf_destination (24b) |
1821 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1825 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1822 | ; ¯à¨ ª®¯¨à®¢ ¨¨ ãç¨âë¢ ¥âáï ¯à®§à ç®áâì |
1826 | ; ¯à¨ ª®¯¨à®¢ ¨¨ ãç¨âë¢ ¥âáï ¯à®§à ç®áâì |
1823 | align 4 |
1827 | align 4 |
1824 | proc buf_bit_blt_transp, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword |
1828 | proc buf_bit_blt_transp, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword |
1825 | locals |
1829 | locals |
1826 | right_bytes dd ? |
1830 | right_bytes dd ? |
1827 | endl |
1831 | endl |
1828 | pushad |
1832 | pushad |
1829 | 1833 | ||
1830 | mov edi,[buf_source] |
1834 | mov edi,[buf_source] |
1831 | cmp buf2d_bits,32 |
1835 | cmp buf2d_bits,32 |
1832 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1836 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1833 | mov eax,buf2d_w |
1837 | mov eax,buf2d_w |
1834 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1838 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1835 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1839 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1836 | 1840 | ||
1837 | mov edi,[buf_destination] |
1841 | mov edi,[buf_destination] |
1838 | cmp buf2d_bits,24 |
1842 | cmp buf2d_bits,24 |
1839 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1843 | jne .copy_end ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1840 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1844 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1841 | mov ecx,[coord_y] |
1845 | mov ecx,[coord_y] |
1842 | cmp ecx,ebx |
1846 | cmp ecx,ebx |
1843 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1847 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1844 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1848 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1845 | cmp ecx,ebx |
1849 | cmp ecx,ebx |
1846 | jle @f |
1850 | jle @f |
1847 | sub ecx,ebx |
1851 | sub ecx,ebx |
1848 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1852 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1849 | @@: |
1853 | @@: |
1850 | mov ebx,buf2d_w |
1854 | mov ebx,buf2d_w |
1851 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1855 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1852 | imul ecx,[coord_y] |
1856 | imul ecx,[coord_y] |
1853 | add ecx,[coord_x] |
1857 | add ecx,[coord_x] |
1854 | lea ecx,[ecx+ecx*2] |
1858 | lea ecx,[ecx+ecx*2] |
1855 | add ecx,buf2d_data |
1859 | add ecx,buf2d_data |
1856 | sub ebx,eax |
1860 | sub ebx,eax |
1857 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1861 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1858 | 1862 | ||
1859 | mov [right_bytes],0 |
1863 | mov [right_bytes],0 |
1860 | mov ecx,[coord_x] |
1864 | mov ecx,[coord_x] |
1861 | cmp ecx,ebx |
1865 | cmp ecx,ebx |
1862 | jl @f |
1866 | jl @f |
1863 | sub ecx,ebx |
1867 | sub ecx,ebx |
1864 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1868 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
1865 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1869 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
1866 | shl ecx,2 ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1870 | shl ecx,2 ;ecx - ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
1867 | mov [right_bytes],ecx |
1871 | mov [right_bytes],ecx |
1868 | @@: |
1872 | @@: |
1869 | 1873 | ||
1870 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1874 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
1871 | 1875 | ||
1872 | cld |
1876 | cld |
1873 | cmp [right_bytes],0 |
1877 | cmp [right_bytes],0 |
1874 | jg .copy_1 |
1878 | jg .copy_1 |
1875 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1879 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
1876 | mov ecx,eax |
1880 | mov ecx,eax |
1877 | @@: |
1881 | @@: |
1878 | call combine_colors |
1882 | call combine_colors |
1879 | add edi,3 |
1883 | add edi,3 |
1880 | add esi,4 |
1884 | add esi,4 |
1881 | loop @b |
1885 | loop @b |
1882 | add edi,ebx |
1886 | add edi,ebx |
1883 | dec edx |
1887 | dec edx |
1884 | cmp edx,0 |
1888 | cmp edx,0 |
1885 | jg .copy_0 |
1889 | jg .copy_0 |
1886 | jmp .copy_end |
1890 | jmp .copy_end |
1887 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1891 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
1888 | mov ecx,eax |
1892 | mov ecx,eax |
1889 | @@: |
1893 | @@: |
1890 | call combine_colors |
1894 | call combine_colors |
1891 | add edi,3 |
1895 | add edi,3 |
1892 | add esi,4 |
1896 | add esi,4 |
1893 | loop @b |
1897 | loop @b |
1894 | add edi,ebx |
1898 | add edi,ebx |
1895 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1899 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
1896 | dec edx |
1900 | dec edx |
1897 | cmp edx,0 |
1901 | cmp edx,0 |
1898 | jg .copy_1 |
1902 | jg .copy_1 |
1899 | 1903 | ||
1900 | .copy_end: |
1904 | .copy_end: |
1901 | popad |
1905 | popad |
1902 | ret |
1906 | ret |
1903 | endp |
1907 | endp |
1904 | 1908 | ||
1905 | ;input: |
1909 | ;input: |
1906 | ; ebx - color1 |
1910 | ; ebx - color1 |
1907 | ; esi = pointer to transparent |
1911 | ; esi = pointer to transparent |
1908 | ; edi = pointer to background color2 |
1912 | ; edi = pointer to background color2 |
1909 | ;output: |
1913 | ;output: |
1910 | ; [edi] = combine color |
1914 | ; [edi] = combine color |
1911 | align 4 |
1915 | align 4 |
1912 | combine_colors_2: |
1916 | combine_colors_2: |
1913 | push ax ebx cx dx si |
1917 | push ax ebx cx dx si |
1914 | mov cl,byte[esi] ;pro |
1918 | mov cl,byte[esi] ;pro |
1915 | xor ch,ch |
1919 | xor ch,ch |
1916 | mov si,0x00ff ;---get transparent--- |
1920 | mov si,0x00ff ;---get transparent--- |
1917 | sub si,cx ;256-pro |
1921 | sub si,cx ;256-pro |
1918 | 1922 | ||
1919 | ;---blye--- |
1923 | ;---blye--- |
1920 | mov al,bl |
1924 | mov al,bl |
1921 | xor ah,ah |
1925 | xor ah,ah |
1922 | shr ebx,8 |
1926 | shr ebx,8 |
1923 | imul ax,si |
1927 | imul ax,si |
1924 | xor dh,dh |
1928 | xor dh,dh |
1925 | mov dl,byte[edi] |
1929 | mov dl,byte[edi] |
1926 | imul dx,cx |
1930 | imul dx,cx |
1927 | add ax,dx |
1931 | add ax,dx |
1928 | mov byte[edi],ah |
1932 | mov byte[edi],ah |
1929 | ;---green--- |
1933 | ;---green--- |
1930 | mov al,bl |
1934 | mov al,bl |
1931 | xor ah,ah |
1935 | xor ah,ah |
1932 | shr ebx,8 |
1936 | shr ebx,8 |
1933 | imul ax,si |
1937 | imul ax,si |
1934 | xor dh,dh |
1938 | xor dh,dh |
1935 | mov dl,byte[edi+1] |
1939 | mov dl,byte[edi+1] |
1936 | imul dx,cx |
1940 | imul dx,cx |
1937 | add ax,dx |
1941 | add ax,dx |
1938 | mov byte[edi+1],ah |
1942 | mov byte[edi+1],ah |
1939 | ;---red--- |
1943 | ;---red--- |
1940 | mov al,bl |
1944 | mov al,bl |
1941 | xor ah,ah |
1945 | xor ah,ah |
1942 | imul ax,si |
1946 | imul ax,si |
1943 | xor dh,dh |
1947 | xor dh,dh |
1944 | mov dl,byte[edi+2] |
1948 | mov dl,byte[edi+2] |
1945 | imul dx,cx |
1949 | imul dx,cx |
1946 | add ax,dx |
1950 | add ax,dx |
1947 | mov byte[edi+2],ah |
1951 | mov byte[edi+2],ah |
1948 | 1952 | ||
1949 | pop si dx cx ebx ax |
1953 | pop si dx cx ebx ax |
1950 | ret |
1954 | ret |
1951 | 1955 | ||
1952 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (8b) ¢ buf_destination (24b) |
1956 | ;äãªæ¨ï ª®¯¨àã¥â ¨§®¡à ¦¥¨¥ ¨§ ¡ãä¥à buf_source (8b) ¢ buf_destination (24b) |
1953 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1957 | ; 㪠§ë¢ îâáï ª®®à¤¨ âë ¢áâ ¢ª¨ ¡ãä¥à buf_source ®â®á¨â¥«ì® buf_destination |
1954 | align 4 |
1958 | align 4 |
1955 | proc buf_bit_blt_alpha, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword, color:dword |
1959 | proc buf_bit_blt_alpha, buf_destination:dword, coord_x:dword, coord_y:dword, buf_source:dword, color:dword |
1956 | locals |
1960 | locals |
1957 | right_bytes dd ? |
1961 | right_bytes dd ? |
1958 | dest_w_bytes dd ? ;ª®««¨ç¥á⢮ ¡ ©â ¢ ¡ãä¥à¥ ¯à¨¥¬¨ª¥ ¯® è¨à¨¥ - è¨à¨ ¢áâ ¢«ï¥¬®© ª à⨪¨ |
1962 | dest_w_bytes dd ? ;ª®««¨ç¥á⢮ ¡ ©â ¢ ¡ãä¥à¥ ¯à¨¥¬¨ª¥ ¯® è¨à¨¥ - è¨à¨ ¢áâ ¢«ï¥¬®© ª à⨪¨ |
1959 | endl |
1963 | endl |
1960 | pushad |
1964 | pushad |
1961 | 1965 | ||
1962 | mov edi,[buf_source] |
1966 | mov edi,[buf_source] |
1963 | cmp buf2d_bits,8 |
1967 | cmp buf2d_bits,8 |
1964 | jne .error1 ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1968 | jne .error1 ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1965 | mov eax,buf2d_w |
1969 | mov eax,buf2d_w |
1966 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1970 | mov edx,buf2d_h ;¢ëá®â ª®¯¨à㥬®© ª à⨪¨ |
1967 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1971 | mov esi,buf2d_data ;¤ ë¥ ª®¯¨à㥬®© ª à⨪¨ |
1968 | 1972 | ||
1969 | mov edi,[buf_destination] |
1973 | mov edi,[buf_destination] |
1970 | cmp buf2d_bits,24 |
1974 | cmp buf2d_bits,24 |
1971 | jne .error2 ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1975 | jne .error2 ;ä®à¬ â ¡ãä¥à ¥ ¯®®¤¥à¦¨¢ ¥âáï |
1972 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1976 | mov ebx,[coord_x] ;¢ ebx ¢à¥¬¥® áâ ¢¨¬ ®âáâ㯠¨§®¡à ¦¥¨ï (¤«ï ¯à®¢¥àª¨) |
1973 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1977 | cmp ebx,buf2d_w ;¯à®¢¥à塞 ¢« §¨â «¨ ¨§®¡à ¦¥¨¥ ¯® è¨à¨¥ |
1974 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1978 | jge .copy_end ;¥á«¨ ¨§®¡à ¦¥¨¥ ¯®«®áâìî ¢ë« §¨â § ¯à ¢ãî áâ®à®ã |
1975 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1979 | mov ebx,buf2d_h ;ebx - ¢ëá®â ®á®¢®£® ¡ãä¥à |
1976 | mov ecx,[coord_y] |
1980 | mov ecx,[coord_y] |
1977 | cmp ecx,ebx |
1981 | cmp ecx,ebx |
1978 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1982 | jge .copy_end ;¥á«¨ ª®®à¤¨ â 'y' ¡®«ìè¥ ¢ëá®âë ¡ãä¥à |
1979 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1983 | add ecx,edx ;ecx - ¨¦ïï ª®®à¤¨ â ª®¯¨à㥬®© ª à⨪¨ |
1980 | cmp ecx,ebx |
1984 | cmp ecx,ebx |
1981 | jle @f |
1985 | jle @f |
1982 | sub ecx,ebx |
1986 | sub ecx,ebx |
1983 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1987 | sub edx,ecx ;㬥ìè ¥¬ ¢ëá®âã ª®¯¨à㥬®© ª à⨪¨, ¢ á«ãç¥ ª®£¤ ® ¢ë« §¨â § ¨¦îî £à ¨æã |
1984 | @@: |
1988 | @@: |
1985 | mov ebx,buf2d_w |
1989 | mov ebx,buf2d_w |
1986 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1990 | mov ecx,ebx ;ecx ¨á¯®«ì§ã¥¬ ¤«ï ¢à¥¬¥ëå 楫¥© |
1987 | imul ecx,[coord_y] |
1991 | imul ecx,[coord_y] |
1988 | add ecx,[coord_x] |
1992 | add ecx,[coord_x] |
1989 | lea ecx,[ecx+ecx*2] |
1993 | lea ecx,[ecx+ecx*2] |
1990 | add ecx,buf2d_data |
1994 | add ecx,buf2d_data |
1991 | sub ebx,eax |
1995 | sub ebx,eax |
1992 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1996 | mov edi,ecx ;edi 㪠§ â¥«ì ¤ ë¥ ¡ãä¥à , ªã¤ ¡ã¤¥â ¯à®¨§¢®¤¨âáï ª®¯¨à®¢ ¨¥ |
1993 | 1997 | ||
1994 | mov [right_bytes],0 |
1998 | mov [right_bytes],0 |
1995 | mov ecx,[coord_x] |
1999 | mov ecx,[coord_x] |
1996 | cmp ecx,ebx |
2000 | cmp ecx,ebx |
1997 | jl @f |
2001 | jl @f |
1998 | sub ecx,ebx |
2002 | sub ecx,ebx |
1999 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
2003 | sub eax,ecx ;㪮à 稢 ¥¬ ª®¯¨à㥬ãî áâபã |
2000 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
2004 | add ebx,ecx ;㤫¨ï¥¬ áâப㠤«ï ᤢ¨£ £« ¢®© ª à⨪¨ ¡ãä¥à |
2001 | ;ecx - ç¨á«® ¯¨ªá¥«¥© ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
2005 | ;ecx - ç¨á«® ¯¨ªá¥«¥© ¢ 1-© áâப¥ ª à⨪¨, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî áâ®à®ã |
2002 | mov [right_bytes],ecx |
2006 | mov [right_bytes],ecx |
2003 | @@: |
2007 | @@: |
2004 | 2008 | ||
2005 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
2009 | lea ebx,[ebx+ebx*2] ;ª®««¨ç¥á⢮ ¡ ©â ¢ 1-© áâப¥ ¡ãä¥à ¬¨ãá ç¨á«® ¡ ©â ¢ 1-© áâப¥ ª®¯¨à㥬®© ª à⨪¨ |
2006 | mov [dest_w_bytes],ebx |
2010 | mov [dest_w_bytes],ebx |
2007 | mov ebx,[color] |
2011 | mov ebx,[color] |
2008 | 2012 | ||
2009 | cld |
2013 | cld |
2010 | cmp [right_bytes],0 |
2014 | cmp [right_bytes],0 |
2011 | jg .copy_1 |
2015 | jg .copy_1 |
2012 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
2016 | .copy_0: ;¯à®á⮥ ª®¯¨à®¢ ¨¥ |
2013 | mov ecx,eax |
2017 | mov ecx,eax |
2014 | @@: |
2018 | @@: |
2015 | call combine_colors_2 |
2019 | call combine_colors_2 |
2016 | add edi,3 |
2020 | add edi,3 |
2017 | inc esi |
2021 | inc esi |
2018 | loop @b |
2022 | loop @b |
2019 | add edi,[dest_w_bytes] |
2023 | add edi,[dest_w_bytes] |
2020 | dec edx |
2024 | dec edx |
2021 | cmp edx,0 |
2025 | cmp edx,0 |
2022 | jg .copy_0 |
2026 | jg .copy_0 |
2023 | jmp .copy_end |
2027 | jmp .copy_end |
2024 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
2028 | .copy_1: ;¥ ¯à®á⮥ ª®¯¨à®¢ ¨¥ (ª à⨪ ¢ë« §¨â § ¯à ¢ãî áâ®à®ã) |
2025 | mov ecx,eax |
2029 | mov ecx,eax |
2026 | @@: |
2030 | @@: |
2027 | call combine_colors_2 |
2031 | call combine_colors_2 |
2028 | add edi,3 |
2032 | add edi,3 |
2029 | inc esi |
2033 | inc esi |
2030 | loop @b |
2034 | loop @b |
2031 | add edi,[dest_w_bytes] |
2035 | add edi,[dest_w_bytes] |
2032 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
2036 | add esi,[right_bytes] ;¤®¡ ¢«ï¥¬ ¡ ©âë, ª®â®àë¥ ¢ë« §ïâ § ¯à ¢ãî £à ¨æã |
2033 | dec edx |
2037 | dec edx |
2034 | cmp edx,0 |
2038 | cmp edx,0 |
2035 | jg .copy_1 |
2039 | jg .copy_1 |
2036 | 2040 | ||
2037 | jmp .copy_end |
2041 | jmp .copy_end |
2038 | .error1: |
2042 | .error1: |
2039 | stdcall print_err,sz_buf2d_bit_blt_alpha,txt_err_n8b |
2043 | stdcall print_err,sz_buf2d_bit_blt_alpha,txt_err_n8b |
2040 | jmp .copy_end |
2044 | jmp .copy_end |
2041 | .error2: |
2045 | .error2: |
2042 | stdcall print_err,sz_buf2d_bit_blt_alpha,txt_err_n24b |
2046 | stdcall print_err,sz_buf2d_bit_blt_alpha,txt_err_n24b |
2043 | .copy_end: |
2047 | .copy_end: |
2044 | popad |
2048 | popad |
2045 | ret |
2049 | ret |
2046 | endp |
2050 | endp |
2047 | 2051 | ||
2048 | ;¯à¥®¡à §®¢ ¨¥ 8-¡¨â®£® ¡ãä¥à à §¬¥à®¬ 16*16 ¢ à §¬¥à 1*256 ᨬ¢®«®¢ |
2052 | ;¯à¥®¡à §®¢ ¨¥ 8-¡¨â®£® ¡ãä¥à à §¬¥à®¬ 16*16 ¢ à §¬¥à 1*256 ᨬ¢®«®¢ |
2049 | align 4 |
2053 | align 4 |
2050 | proc buf_convert_text_matrix, buf_struc:dword |
2054 | proc buf_convert_text_matrix, buf_struc:dword |
2051 | locals |
2055 | locals |
2052 | tmp_mem dd ? |
2056 | tmp_mem dd ? |
2053 | c1 dw ? |
2057 | c1 dw ? |
2054 | c2 dd ? |
2058 | c2 dd ? |
2055 | c3 dw ? |
2059 | c3 dw ? |
2056 | endl |
2060 | endl |
2057 | pushad |
2061 | pushad |
2058 | mov edi,dword[buf_struc] |
2062 | mov edi,dword[buf_struc] |
2059 | cmp buf2d_bits,8 |
2063 | cmp buf2d_bits,8 |
2060 | jne .error |
2064 | jne .error |
2061 | mov ecx,buf2d_h |
2065 | mov ecx,buf2d_h |
2062 | mov ebx,ecx |
2066 | mov ebx,ecx |
2063 | shr ebx,4 ;¯à¥¤¯®« £ ¥¬ çâ® ¢ ¡ãä¥à¥ 16 áâப á ᨬ¢®« ¬¨, ¯®â®¬ã ¤¥«¨¬ 2^4 |
2067 | shr ebx,4 ;¯à¥¤¯®« £ ¥¬ çâ® ¢ ¡ãä¥à¥ 16 áâப á ᨬ¢®« ¬¨, ¯®â®¬ã ¤¥«¨¬ 2^4 |
2064 | mov edx,buf2d_w |
2068 | mov edx,buf2d_w |
2065 | imul ecx,edx ;ecx = size 8 b |
2069 | imul ecx,edx ;ecx = size 8 b |
2066 | invoke mem.alloc,ecx ;¢ë¤¥«ï¥¬ ¢à¥¬¥ãî ¯ ¬ïâì |
2070 | invoke mem.alloc,ecx ;¢ë¤¥«ï¥¬ ¢à¥¬¥ãî ¯ ¬ïâì |
2067 | mov [tmp_mem],eax ;eax - new memory |
2071 | mov [tmp_mem],eax ;eax - new memory |
2068 | 2072 | ||
2069 | shr edx,4 ;¯à¥¤¯®« £ ¥¬ çâ® ¢ ¡ãä¥à¥ 16 ª®«®®ª á ᨬ¢®« ¬¨, ¯®â®¬ã ¤¥«¨¬ 2^4 |
2073 | shr edx,4 ;¯à¥¤¯®« £ ¥¬ çâ® ¢ ¡ãä¥à¥ 16 ª®«®®ª á ᨬ¢®« ¬¨, ¯®â®¬ã ¤¥«¨¬ 2^4 |
2070 | mov eax,ebx |
2074 | mov eax,ebx |
2071 | imul ebx,edx ;¢ëç¨á«ï¥¬ ª®®«¨ç¥á⢮ ¯¨ªá¥«¥© 1 ᨬ¢®« |
2075 | imul ebx,edx ;¢ëç¨á«ï¥¬ ª®®«¨ç¥á⢮ ¯¨ªá¥«¥© 1 ᨬ¢®« |
2072 | ;eax = bhe - ¢ëá®â ¡ãª¢ë |
2076 | ;eax = bhe - ¢ëá®â ¡ãª¢ë |
2073 | ;ebx = bwi*bhe - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ 1-© ¡ãª¢¥ |
2077 | ;ebx = bwi*bhe - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ¢ 1-© ¡ãª¢¥ |
2074 | ;edx = bwi - è¨à¨ ¡ãª¢ë |
2078 | ;edx = bwi - è¨à¨ ¡ãª¢ë |
2075 | ;ecx,esi,edi - ¨á¯®«ì§ãîâáï ¢ 横«¥ .c_0 |
2079 | ;ecx,esi,edi - ¨á¯®«ì§ãîâáï ¢ 横«¥ .c_0 |
2076 | shr buf2d_w,4 |
2080 | shr buf2d_w,4 |
2077 | shl buf2d_h,4 ;¯à¥®¡à §®¢ë¢ ¥¬ à §¬¥àë ¡ãä¥à |
2081 | shl buf2d_h,4 ;¯à¥®¡à §®¢ë¢ ¥¬ à §¬¥àë ¡ãä¥à |
2078 | 2082 | ||
2079 | cld |
2083 | cld |
2080 | mov esi,buf2d_data |
2084 | mov esi,buf2d_data |
2081 | mov edi,[tmp_mem] |
2085 | mov edi,[tmp_mem] |
2082 | mov word[c3],16 |
2086 | mov word[c3],16 |
2083 | .c_3: |
2087 | .c_3: |
2084 | mov dword[c2],eax |
2088 | mov dword[c2],eax |
2085 | .c_2: |
2089 | .c_2: |
2086 | mov word[c1],16 |
2090 | mov word[c1],16 |
2087 | .c_1: |
2091 | .c_1: |
2088 | mov ecx,edx ;.c_0: |
2092 | mov ecx,edx ;.c_0: |
2089 | rep movsb |
2093 | rep movsb |
2090 | add edi,ebx |
2094 | add edi,ebx |
2091 | sub edi,edx ;edi+=(bwi*bhe-bwi) |
2095 | sub edi,edx ;edi+=(bwi*bhe-bwi) |
2092 | dec word[c1] |
2096 | dec word[c1] |
2093 | cmp word[c1],0 |
2097 | cmp word[c1],0 |
2094 | jg .c_1 |
2098 | jg .c_1 |
2095 | add edi,edx |
2099 | add edi,edx |
2096 | shl ebx,4 |
2100 | shl ebx,4 |
2097 | sub edi,ebx ;edi-=(16*bwi*bhe-bwi) |
2101 | sub edi,ebx ;edi-=(16*bwi*bhe-bwi) |
2098 | shr ebx,4 |
2102 | shr ebx,4 |
2099 | dec dword[c2] |
2103 | dec dword[c2] |
2100 | cmp dword[c2],0 |
2104 | cmp dword[c2],0 |
2101 | jg .c_2 |
2105 | jg .c_2 |
2102 | sub edi,ebx |
2106 | sub edi,ebx |
2103 | shl ebx,4 |
2107 | shl ebx,4 |
2104 | add edi,ebx ;edi+=(15*bwi*bhe) |
2108 | add edi,ebx ;edi+=(15*bwi*bhe) |
2105 | shr ebx,4 |
2109 | shr ebx,4 |
2106 | dec word[c3] |
2110 | dec word[c3] |
2107 | cmp word[c3],0 |
2111 | cmp word[c3],0 |
2108 | jg .c_3 |
2112 | jg .c_3 |
2109 | 2113 | ||
2110 | mov edi,dword[buf_struc] ;ª®¯¨à®¢ ¨¥ ®¢®© ¬ âà¨æë ¢ ®á®¢®© ¡ãä¥à |
2114 | mov edi,dword[buf_struc] ;ª®¯¨à®¢ ¨¥ ®¢®© ¬ âà¨æë ¢ ®á®¢®© ¡ãä¥à |
2111 | mov edi,buf2d_data |
2115 | mov edi,buf2d_data |
2112 | mov esi,[tmp_mem] |
2116 | mov esi,[tmp_mem] |
2113 | mov ecx,ebx |
2117 | mov ecx,ebx |
2114 | shl ecx,8 |
2118 | shl ecx,8 |
2115 | rep movsb |
2119 | rep movsb |
2116 | invoke mem.free,[tmp_mem] ;ç¨á⨬ ¢à¥¬¥ãî ¯ ¬ïâì |
2120 | invoke mem.free,[tmp_mem] ;ç¨á⨬ ¢à¥¬¥ãî ¯ ¬ïâì |
2117 | jmp .end_conv |
2121 | jmp .end_conv |
2118 | .error: |
2122 | .error: |
2119 | stdcall print_err,sz_buf2d_convert_text_matrix,txt_err_n8b |
2123 | stdcall print_err,sz_buf2d_convert_text_matrix,txt_err_n8b |
2120 | .end_conv: |
2124 | .end_conv: |
2121 | popad |
2125 | popad |
2122 | ret |
2126 | ret |
2123 | endp |
2127 | endp |
2124 | 2128 | ||
2125 | align 4 |
2129 | align 4 |
2126 | buf_s_matr buf_2d_header ? ;«®ª «ì ï ¬ âà¨æ ᨬ¢®« |
2130 | buf_s_matr buf_2d_header ? ;«®ª «ì ï ¬ âà¨æ ᨬ¢®« |
2127 | 2131 | ||
2128 | align 4 |
2132 | align 4 |
2129 | proc buf_draw_text, buf_struc:dword, buf_t_matr:dword, text:dword, coord_x:dword, coord_y:dword, color:dword |
2133 | proc buf_draw_text, buf_struc:dword, buf_t_matr:dword, text:dword, coord_x:dword, coord_y:dword, color:dword |
2130 | locals |
2134 | locals |
2131 | buf_t_matr_offs dd ? |
2135 | buf_t_matr_offs dd ? |
2132 | endl |
2136 | endl |
2133 | pushad |
2137 | pushad |
2134 | mov edi,dword[buf_struc] |
2138 | mov edi,dword[buf_struc] |
2135 | cmp buf2d_bits,24 |
2139 | cmp buf2d_bits,24 |
2136 | jne .error2 |
2140 | jne .error2 |
2137 | mov edi,dword[buf_t_matr] |
2141 | mov edi,dword[buf_t_matr] |
2138 | cmp buf2d_bits,8 |
2142 | cmp buf2d_bits,8 |
2139 | jne .error1 |
2143 | jne .error1 |
2140 | mov edx,buf2d_data |
2144 | mov edx,buf2d_data |
2141 | mov [buf_t_matr_offs],edx |
2145 | mov [buf_t_matr_offs],edx |
2142 | mov ecx,BUF_STRUCT_SIZE ;ª®¯¨à㥬 áâàãªâãàã ⥪á⮢®© ¬ âà¨æë |
2146 | mov ecx,BUF_STRUCT_SIZE ;ª®¯¨à㥬 áâàãªâãàã ⥪á⮢®© ¬ âà¨æë |
2143 | mov esi,edi |
2147 | mov esi,edi |
2144 | lea edi,[buf_s_matr] |
2148 | lea edi,[buf_s_matr] |
2145 | cld |
2149 | cld |
2146 | rep movsb |
2150 | rep movsb |
2147 | lea edi,[buf_s_matr] |
2151 | lea edi,[buf_s_matr] |
2148 | shr buf2d_h,8 ;¤¥«¨¬ ¢ëá®âã ᨬ¢®«ì®£® ¡ãä¥à 256, ¤«ï 宦¤¥¨ï ¢ëá®âë 1-£® ᨬ¢®« |
2152 | shr buf2d_h,8 ;¤¥«¨¬ ¢ëá®âã ᨬ¢®«ì®£® ¡ãä¥à 256, ¤«ï 宦¤¥¨ï ¢ëá®âë 1-£® ᨬ¢®« |
2149 | mov ebx,buf2d_h ;¡¥à¥¬ ¢ëá®âã ᨬ¢®« |
2153 | mov ebx,buf2d_h ;¡¥à¥¬ ¢ëá®âã ᨬ¢®« |
2150 | mov ecx,buf2d_w ;¡¥à¥¬ è¨à¨ã ᨬ¢®« |
2154 | mov ecx,buf2d_w ;¡¥à¥¬ è¨à¨ã ᨬ¢®« |
2151 | 2155 | ||
2152 | mov eax,[coord_x] |
2156 | mov eax,[coord_x] |
2153 | mov esi,[text] |
2157 | mov esi,[text] |
2154 | cmp byte[esi],0 |
2158 | cmp byte[esi],0 |
2155 | je .end_draw ;¥á«¨ ¯ãáâ ï áâப |
2159 | je .end_draw ;¥á«¨ ¯ãáâ ï áâப |
2156 | @@: |
2160 | @@: |
2157 | xor edx,edx |
2161 | xor edx,edx |
2158 | mov dl,byte[esi] ;¡¥à¥¬ ª®¤ ᨬ¢®« |
2162 | mov dl,byte[esi] ;¡¥à¥¬ ª®¤ ᨬ¢®« |
2159 | imul edx,ebx ;㬮¦ ¥¬ ¥£® ¢ëá®âã ᨬ¢®« |
2163 | imul edx,ebx ;㬮¦ ¥¬ ¥£® ¢ëá®âã ᨬ¢®« |
2160 | imul edx,ecx ;㬮¦ ¥¬ è¨à¨ã ᨬ¢®« |
2164 | imul edx,ecx ;㬮¦ ¥¬ è¨à¨ã ᨬ¢®« |
2161 | add edx,[buf_t_matr_offs] ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 0-£® ᨬ¢®« , â. ¥. ¯®«ãç ¥âáï ᬥ饨¥ ¢ë¢®¤¨¬®£® ᨬ¢®« |
2165 | add edx,[buf_t_matr_offs] ;¯à¨¡ ¢«ï¥¬ ᬥ饨¥ 0-£® ᨬ¢®« , â. ¥. ¯®«ãç ¥âáï ᬥ饨¥ ¢ë¢®¤¨¬®£® ᨬ¢®« |
2162 | mov buf2d_data,edx ;¢ «®ª «ìë© ¡ãä¥à ᨬ¢®« , áâ ¢¨¬ 㪠§ ⥫ì ã¦ë© ᨬ¢®« ¨§ ¡ãä¥à buf_t_matr |
2166 | mov buf2d_data,edx ;¢ «®ª «ìë© ¡ãä¥à ᨬ¢®« , áâ ¢¨¬ 㪠§ ⥫ì ã¦ë© ᨬ¢®« ¨§ ¡ãä¥à buf_t_matr |
2163 | stdcall buf_bit_blt_alpha, [buf_struc], eax,[coord_y], edi,[color] |
2167 | stdcall buf_bit_blt_alpha, [buf_struc], eax,[coord_y], edi,[color] |
2164 | add eax,ecx |
2168 | add eax,ecx |
2165 | .new_s: |
2169 | .new_s: |
2166 | inc esi |
2170 | inc esi |
2167 | cmp byte[esi],13 |
2171 | cmp byte[esi],13 |
2168 | jne .no_13 |
2172 | jne .no_13 |
2169 | mov eax,[coord_x] |
2173 | mov eax,[coord_x] |
2170 | add [coord_y],ebx |
2174 | add [coord_y],ebx |
2171 | jmp .new_s |
2175 | jmp .new_s |
2172 | .no_13: |
2176 | .no_13: |
2173 | cmp byte[esi],0 |
2177 | cmp byte[esi],0 |
2174 | jne @b |
2178 | jne @b |
2175 | jmp .end_draw |
2179 | jmp .end_draw |
2176 | .error1: |
2180 | .error1: |
2177 | stdcall print_err,sz_buf2d_draw_text,txt_err_n8b |
2181 | stdcall print_err,sz_buf2d_draw_text,txt_err_n8b |
2178 | jmp .end_draw |
2182 | jmp .end_draw |
2179 | .error2: |
2183 | .error2: |
2180 | stdcall print_err,sz_buf2d_draw_text,txt_err_n24b |
2184 | stdcall print_err,sz_buf2d_draw_text,txt_err_n24b |
2181 | .end_draw: |
2185 | .end_draw: |
2182 | popad |
2186 | popad |
2183 | ret |
2187 | ret |
2184 | endp |
2188 | endp |
2185 | 2189 | ||
2186 | align 4 |
2190 | align 4 |
2187 | proc print_err, fun:dword, mes:dword ;¢ë¢®¤¨¬ á®®¡é¥¨¥ ®¡ 訡ª¥ ¤®áªã ®â« ¤ª¨ |
2191 | proc print_err, fun:dword, mes:dword ;¢ë¢®¤¨¬ á®®¡é¥¨¥ ®¡ 訡ª¥ ¤®áªã ®â« ¤ª¨ |
2188 | pushad |
2192 | pushad |
2189 | mov eax,63 |
2193 | mov eax,63 |
2190 | mov ebx,1 |
2194 | mov ebx,1 |
2191 | 2195 | ||
2192 | mov esi,[fun] |
2196 | mov esi,[fun] |
2193 | @@: |
2197 | @@: |
2194 | mov cl,byte[esi] |
2198 | mov cl,byte[esi] |
2195 | int 0x40 |
2199 | int 0x40 |
2196 | inc esi |
2200 | inc esi |
2197 | cmp byte[esi],0 |
2201 | cmp byte[esi],0 |
2198 | jne @b |
2202 | jne @b |
2199 | mov cl,':' |
2203 | mov cl,':' |
2200 | int 0x40 |
2204 | int 0x40 |
2201 | mov cl,' ' |
2205 | mov cl,' ' |
2202 | int 0x40 |
2206 | int 0x40 |
2203 | mov esi,[mes] |
2207 | mov esi,[mes] |
2204 | @@: |
2208 | @@: |
2205 | mov cl,byte[esi] |
2209 | mov cl,byte[esi] |
2206 | int 0x40 |
2210 | int 0x40 |
2207 | inc esi |
2211 | inc esi |
2208 | cmp byte[esi],0 |
2212 | cmp byte[esi],0 |
2209 | jne @b |
2213 | jne @b |
2210 | popad |
2214 | popad |
2211 | ret |
2215 | ret |
2212 | endp |
2216 | endp |
2213 | 2217 | ||
2214 | ;input: |
2218 | ;input: |
2215 | ; ebp+8 = p0 |
2219 | ; ebp+8 = p0 |
2216 | ; ebp+12 = p1 |
2220 | ; ebp+12 = p1 |
2217 | align 4 |
2221 | align 4 |
2218 | line_len4i: |
2222 | line_len4i: |
2219 | push ebp |
2223 | push ebp |
2220 | mov ebp,esp |
2224 | mov ebp,esp |
2221 | finit |
2225 | finit |
2222 | fild word [ebp+8] |
2226 | fild word [ebp+8] |
2223 | fisub word [ebp+12] |
2227 | fisub word [ebp+12] |
2224 | fmul st0,st0 ;st0=x^2 |
2228 | fmul st0,st0 ;st0=x^2 |
2225 | fild word [ebp+10] |
2229 | fild word [ebp+10] |
2226 | fisub word [ebp+14] |
2230 | fisub word [ebp+14] |
2227 | fmul st0,st0 ;st0=y^2 |
2231 | fmul st0,st0 ;st0=y^2 |
2228 | fadd st0,st1 |
2232 | fadd st0,st1 |
2229 | fsqrt |
2233 | fsqrt |
2230 | fstp dword [ebp+12] |
2234 | fstp dword [ebp+12] |
2231 | pop ebp |
2235 | pop ebp |
2232 | ret 4 ;8 |
2236 | ret 4 ;8 |
2233 | 2237 | ||
2234 | align 4 |
2238 | align 4 |
2235 | proc buf_curve_bezier, buffer:dword, coord_p0:dword,coord_p1:dword,coord_p2:dword, color:dword |
2239 | proc buf_curve_bezier, buffer:dword, coord_p0:dword,coord_p1:dword,coord_p2:dword, color:dword |
2236 | locals |
2240 | locals |
2237 | delt_t dd ? |
2241 | delt_t dd ? |
2238 | opr_param dd ? |
2242 | opr_param dd ? |
2239 | v_poi_0 dd ? |
2243 | v_poi_0 dd ? |
2240 | endl |
2244 | endl |
2241 | pushad |
2245 | pushad |
2242 | 2246 | ||
2243 | ;float t, xt,yt; |
2247 | ;float t, xt,yt; |
2244 | ;for(t=.0;t<1.;t+=.005){ |
2248 | ;for(t=.0;t<1.;t+=.005){ |
2245 | ; xt=pow(1.-t,2)*x0+2*t*(1.-t)*x1+pow(t,2)*x2; |
2249 | ; xt=pow(1.-t,2)*x0+2*t*(1.-t)*x1+pow(t,2)*x2; |
2246 | ; yt=pow(1.-t,2)*y0+2*t*(1.-t)*y1+pow(t,2)*y2; |
2250 | ; yt=pow(1.-t,2)*y0+2*t*(1.-t)*y1+pow(t,2)*y2; |
2247 | ; dc.SetPixel(xt,yt,255L); |
2251 | ; dc.SetPixel(xt,yt,255L); |
2248 | ;} |
2252 | ;} |
2249 | 2253 | ||
2250 | mov edx,[color] ;set curve color |
2254 | mov edx,[color] ;set curve color |
2251 | mov edi,[buffer] |
2255 | mov edi,[buffer] |
2252 | xor ebx,ebx |
2256 | xor ebx,ebx |
2253 | xor ecx,ecx |
2257 | xor ecx,ecx |
2254 | 2258 | ||
2255 | finit |
2259 | finit |
2256 | 2260 | ||
2257 | ; calculate delta t |
2261 | ; calculate delta t |
2258 | stdcall line_len4i, dword[coord_p1],dword[coord_p0] |
2262 | stdcall line_len4i, dword[coord_p1],dword[coord_p0] |
2259 | fadd dword[esp] |
2263 | fadd dword[esp] |
2260 | add esp,4 ;pop ... |
2264 | add esp,4 ;pop ... |
2261 | 2265 | ||
2262 | stdcall line_len4i, dword[coord_p2],dword[coord_p1] |
2266 | stdcall line_len4i, dword[coord_p2],dword[coord_p1] |
2263 | fadd dword[esp] |
2267 | fadd dword[esp] |
2264 | add esp,4 ;pop ... |
2268 | add esp,4 ;pop ... |
2265 | 2269 | ||
2266 | fadd st0,st0 ; len*=2 |
2270 | fadd st0,st0 ; len*=2 |
2267 | ftst |
2271 | ftst |
2268 | fstsw ax |
2272 | fstsw ax |
2269 | 2273 | ||
2270 | fld1 |
2274 | fld1 |
2271 | sahf |
2275 | sahf |
2272 | jle @f ;¨§¡¥£ ¥¬ ¤¥«¥¨ï 0 |
2276 | jle @f ;¨§¡¥£ ¥¬ ¤¥«¥¨ï 0 |
2273 | fdiv st0,st1 |
2277 | fdiv st0,st1 |
2274 | @@: |
2278 | @@: |
2275 | fstp dword[delt_t] |
2279 | fstp dword[delt_t] |
2276 | 2280 | ||
2277 | finit |
2281 | finit |
2278 | 2282 | ||
2279 | ;fild word[coord_p2+2] ;y2 |
2283 | ;fild word[coord_p2+2] ;y2 |
2280 | fild word[coord_p1+2] ;y1 |
2284 | fild word[coord_p1+2] ;y1 |
2281 | fild word[coord_p0+2] ;y0 |
2285 | fild word[coord_p0+2] ;y0 |
2282 | fild word[coord_p2] ;x2 |
2286 | fild word[coord_p2] ;x2 |
2283 | fild word[coord_p1] ;x1 |
2287 | fild word[coord_p1] ;x1 |
2284 | fild word[coord_p0] ;x0 |
2288 | fild word[coord_p0] ;x0 |
2285 | fld dword[delt_t] |
2289 | fld dword[delt_t] |
2286 | fldz ;t=.0 |
2290 | fldz ;t=.0 |
2287 | 2291 | ||
2288 | @@: |
2292 | @@: |
2289 | fld1 |
2293 | fld1 |
2290 | fsub st0,st1 ;1.-t |
2294 | fsub st0,st1 ;1.-t |
2291 | fmul st0,st0 ;pow(1.-t,2) |
2295 | fmul st0,st0 ;pow(1.-t,2) |
2292 | fmul st0,st3 ;...*x0 |
2296 | fmul st0,st3 ;...*x0 |
2293 | fstp dword[opr_param] |
2297 | fstp dword[opr_param] |
2294 | 2298 | ||
2295 | fld1 |
2299 | fld1 |
2296 | fsub st0,st1 ;1.-t |
2300 | fsub st0,st1 ;1.-t |
2297 | fmul st0,st1 ;(1.-t)*t |
2301 | fmul st0,st1 ;(1.-t)*t |
2298 | fadd st0,st0 |
2302 | fadd st0,st0 |
2299 | fmul st0,st4 ;...*x1 |
2303 | fmul st0,st4 ;...*x1 |
2300 | mov esi,dword[opr_param] |
2304 | mov esi,dword[opr_param] |
2301 | fstp dword[opr_param] |
2305 | fstp dword[opr_param] |
2302 | 2306 | ||
2303 | fldz |
2307 | fldz |
2304 | fadd st0,st1 ;0+t |
2308 | fadd st0,st1 ;0+t |
2305 | fmul st0,st0 ;t*t |
2309 | fmul st0,st0 ;t*t |
2306 | fmul st0,st5 ;...*x2 |
2310 | fmul st0,st5 ;...*x2 |
2307 | 2311 | ||
2308 | fadd dword[opr_param] |
2312 | fadd dword[opr_param] |
2309 | mov dword[opr_param],esi |
2313 | mov dword[opr_param],esi |
2310 | fadd dword[opr_param] |
2314 | fadd dword[opr_param] |
2311 | fistp word[v_poi_0] ;x |
2315 | fistp word[v_poi_0] ;x |
2312 | 2316 | ||
2313 | fld1 |
2317 | fld1 |
2314 | fsub st0,st1 ;1.-t |
2318 | fsub st0,st1 ;1.-t |
2315 | fmul st0,st0 ;pow(1.-t,2) |
2319 | fmul st0,st0 ;pow(1.-t,2) |
2316 | fmul st0,st6 ;...*y0 |
2320 | fmul st0,st6 ;...*y0 |
2317 | fstp dword[opr_param] |
2321 | fstp dword[opr_param] |
2318 | 2322 | ||
2319 | fld1 |
2323 | fld1 |
2320 | fsub st0,st1 ;1.-t |
2324 | fsub st0,st1 ;1.-t |
2321 | fmul st0,st1 ;(1.-t)*t |
2325 | fmul st0,st1 ;(1.-t)*t |
2322 | fadd st0,st0 |
2326 | fadd st0,st0 |
2323 | fmul st0,st7 ;...*y1 |
2327 | fmul st0,st7 ;...*y1 |
2324 | mov esi,dword[opr_param] |
2328 | mov esi,dword[opr_param] |
2325 | fstp dword[opr_param] |
2329 | fstp dword[opr_param] |
2326 | 2330 | ||
2327 | fldz |
2331 | fldz |
2328 | fadd st0,st1 ;0+t |
2332 | fadd st0,st1 ;0+t |
2329 | fmul st0,st0 ;t*t |
2333 | fmul st0,st0 ;t*t |
2330 | fimul word[coord_p2+2] ;...*y2 |
2334 | fimul word[coord_p2+2] ;...*y2 |
2331 | 2335 | ||
2332 | fadd dword[opr_param] |
2336 | fadd dword[opr_param] |
2333 | mov dword[opr_param],esi |
2337 | mov dword[opr_param],esi |
2334 | fadd dword[opr_param] |
2338 | fadd dword[opr_param] |
2335 | fistp word[v_poi_0+2] ;y |
2339 | fistp word[v_poi_0+2] ;y |
2336 | 2340 | ||
2337 | mov eax,1 |
2341 | mov eax,1 |
2338 | mov bx,word[v_poi_0+2] |
2342 | mov bx,word[v_poi_0+2] |
2339 | mov cx,word[v_poi_0] |
2343 | mov cx,word[v_poi_0] |
2340 | call draw_pixel |
2344 | call draw_pixel |
2341 | 2345 | ||
2342 | fadd st0,st1 ;t+dt |
2346 | fadd st0,st1 ;t+dt |
2343 | 2347 | ||
2344 | fld1 |
2348 | fld1 |
2345 | fcomp |
2349 | fcomp |
2346 | fstsw ax |
2350 | fstsw ax |
2347 | sahf |
2351 | sahf |
2348 | jae @b |
2352 | jae @b |
2349 | 2353 | ||
2350 | popad |
2354 | popad |
2351 | ret |
2355 | ret |
2352 | endp |
2356 | endp |
2353 | 2357 | ||
2354 | txt_err_n8b db 'need buffer 8 bit',13,10,0 |
2358 | txt_err_n8b db 'need buffer 8 bit',13,10,0 |
2355 | txt_err_n24b db 'need buffer 24 bit',13,10,0 |
2359 | txt_err_n24b db 'need buffer 24 bit',13,10,0 |
2356 | 2360 | ||
2357 | align 16 |
2361 | align 16 |
2358 | EXPORTS: |
2362 | EXPORTS: |
2359 | dd sz_lib_init, lib_init |
2363 | dd sz_lib_init, lib_init |
2360 | dd sz_buf2d_create, buf_create |
2364 | dd sz_buf2d_create, buf_create |
2361 | dd sz_buf2d_create_f_img, buf_create_f_img |
2365 | dd sz_buf2d_create_f_img, buf_create_f_img |
2362 | dd sz_buf2d_clear, buf_clear |
2366 | dd sz_buf2d_clear, buf_clear |
2363 | dd sz_buf2d_draw, buf_draw_buf |
2367 | dd sz_buf2d_draw, buf_draw_buf |
2364 | dd sz_buf2d_delete, buf_delete |
2368 | dd sz_buf2d_delete, buf_delete |
2365 | dd sz_buf2d_resize, buf_resize |
2369 | dd sz_buf2d_resize, buf_resize |
2366 | dd sz_buf2d_line, buf_line_brs |
2370 | dd sz_buf2d_line, buf_line_brs |
2367 | dd sz_buf2d_rect_by_size, buf_rect_by_size |
2371 | dd sz_buf2d_rect_by_size, buf_rect_by_size |
2368 | dd sz_buf2d_filled_rect_by_size, buf_filled_rect_by_size |
2372 | dd sz_buf2d_filled_rect_by_size, buf_filled_rect_by_size |
2369 | dd sz_buf2d_circle, buf_circle |
2373 | dd sz_buf2d_circle, buf_circle |
2370 | dd sz_buf2d_img_hdiv2, buf_img_hdiv2 |
2374 | dd sz_buf2d_img_hdiv2, buf_img_hdiv2 |
2371 | dd sz_buf2d_img_wdiv2, buf_img_wdiv2 |
2375 | dd sz_buf2d_img_wdiv2, buf_img_wdiv2 |
2372 | dd sz_buf2d_conv_24_to_8, buf_conv_24_to_8 |
2376 | dd sz_buf2d_conv_24_to_8, buf_conv_24_to_8 |
2373 | dd sz_buf2d_conv_24_to_32, buf_conv_24_to_32 |
2377 | dd sz_buf2d_conv_24_to_32, buf_conv_24_to_32 |
2374 | dd sz_buf2d_bit_blt, buf_bit_blt |
2378 | dd sz_buf2d_bit_blt, buf_bit_blt |
2375 | dd sz_buf2d_bit_blt_transp, buf_bit_blt_transp |
2379 | dd sz_buf2d_bit_blt_transp, buf_bit_blt_transp |
2376 | dd sz_buf2d_bit_blt_alpha, buf_bit_blt_alpha |
2380 | dd sz_buf2d_bit_blt_alpha, buf_bit_blt_alpha |
2377 | dd sz_buf2d_curve_bezier, buf_curve_bezier |
2381 | dd sz_buf2d_curve_bezier, buf_curve_bezier |
2378 | dd sz_buf2d_convert_text_matrix, buf_convert_text_matrix |
2382 | dd sz_buf2d_convert_text_matrix, buf_convert_text_matrix |
2379 | dd sz_buf2d_draw_text, buf_draw_text |
2383 | dd sz_buf2d_draw_text, buf_draw_text |
2380 | dd sz_buf2d_crop_color, buf_crop_color |
2384 | dd sz_buf2d_crop_color, buf_crop_color |
2381 | dd sz_buf2d_offset_h, buf_offset_h |
2385 | dd sz_buf2d_offset_h, buf_offset_h |
2382 | dd sz_buf2d_flood_fill, buf_flood_fill |
2386 | dd sz_buf2d_flood_fill, buf_flood_fill |
2383 | dd sz_buf2d_set_pixel, buf_set_pixel |
2387 | dd sz_buf2d_set_pixel, buf_set_pixel |
2384 | dd 0,0 |
2388 | dd 0,0 |
2385 | sz_lib_init db 'lib_init',0 |
2389 | sz_lib_init db 'lib_init',0 |
2386 | sz_buf2d_create db 'buf2d_create',0 |
2390 | sz_buf2d_create db 'buf2d_create',0 |
2387 | sz_buf2d_create_f_img db 'buf2d_create_f_img',0 |
2391 | sz_buf2d_create_f_img db 'buf2d_create_f_img',0 |
2388 | sz_buf2d_clear db 'buf2d_clear',0 ;®ç¨á⪠¡ãä¥à 㪠§ ë¬ æ¢¥â®¬ |
2392 | sz_buf2d_clear db 'buf2d_clear',0 ;®ç¨á⪠¡ãä¥à 㪠§ ë¬ æ¢¥â®¬ |
2389 | sz_buf2d_draw db 'buf2d_draw',0 |
2393 | sz_buf2d_draw db 'buf2d_draw',0 |
2390 | sz_buf2d_delete db 'buf2d_delete',0 |
2394 | sz_buf2d_delete db 'buf2d_delete',0 |
2391 | sz_buf2d_resize db 'buf2d_resize',0 |
2395 | sz_buf2d_resize db 'buf2d_resize',0 |
2392 | sz_buf2d_line db 'buf2d_line',0 ;à¨á®¢ ¨¥ «¨¨¨ |
2396 | sz_buf2d_line db 'buf2d_line',0 ;à¨á®¢ ¨¥ «¨¨¨ |
2393 | sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 ;à¨á®¢ ¨¥ à ¬ª¨ ¯àאַ㣮«ì¨ª , 2-ï ª®®à¤¨ â § ¤ ¯® à §¬¥àã |
2397 | sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 ;à¨á®¢ ¨¥ à ¬ª¨ ¯àאַ㣮«ì¨ª , 2-ï ª®®à¤¨ â § ¤ ¯® à §¬¥àã |
2394 | sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 ;à¨á®¢ ¨¥ § «¨â®£® ¯àאַ㣮«ì¨ª , 2-ï ª®®à¤¨ â § ¤ ¯® à §¬¥àã |
2398 | sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 ;à¨á®¢ ¨¥ § «¨â®£® ¯àאַ㣮«ì¨ª , 2-ï ª®®à¤¨ â § ¤ ¯® à §¬¥àã |
2395 | sz_buf2d_circle db 'buf2d_circle',0 ;à¨á®¢ ¨¥ ®ªà㦮á⨠|
2399 | sz_buf2d_circle db 'buf2d_circle',0 ;à¨á®¢ ¨¥ ®ªà㦮á⨠|
2396 | sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0 ;ᦠ⨥ ¨§®¡à ¦¥¨ï ¯® ¢ëá®â¥ ¢ 2 à § (à §¬¥à ¡ãä¥à ¥ ¬¥ï¥âáï) |
2400 | sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0 ;ᦠ⨥ ¨§®¡à ¦¥¨ï ¯® ¢ëá®â¥ ¢ 2 à § (à §¬¥à ¡ãä¥à ¥ ¬¥ï¥âáï) |
2397 | sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0 ;ᦠ⨥ ¨§®¡à ¦¥¨ï ¯® è¨à¨¥ ¢ 2 à § (à §¬¥à ¡ãä¥à ¥ ¬¥ï¥âáï) |
2401 | sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0 ;ᦠ⨥ ¨§®¡à ¦¥¨ï ¯® è¨à¨¥ ¢ 2 à § (à §¬¥à ¡ãä¥à ¥ ¬¥ï¥âáï) |
2398 | sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0 |
2402 | sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0 |
2399 | sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0 |
2403 | sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0 |
2400 | sz_buf2d_bit_blt db 'buf2d_bit_blt',0 |
2404 | sz_buf2d_bit_blt db 'buf2d_bit_blt',0 |
2401 | sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0 |
2405 | sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0 |
2402 | sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0 |
2406 | sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0 |
2403 | sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0 |
2407 | sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0 |
2404 | sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0 |
2408 | sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0 |
2405 | sz_buf2d_draw_text db 'buf2d_draw_text',0 |
2409 | sz_buf2d_draw_text db 'buf2d_draw_text',0 |
2406 | sz_buf2d_crop_color db 'buf2d_crop_color',0 |
2410 | sz_buf2d_crop_color db 'buf2d_crop_color',0 |
2407 | sz_buf2d_offset_h db 'buf2d_offset_h',0 |
2411 | sz_buf2d_offset_h db 'buf2d_offset_h',0 |
2408 | sz_buf2d_flood_fill db 'buf2d_flood_fill',0 |
2412 | sz_buf2d_flood_fill db 'buf2d_flood_fill',0 |
2409 | sz_buf2d_set_pixel db 'buf2d_set_pixel',01.;t+=.005){ |
2413 | sz_buf2d_set_pixel db 'buf2d_set_pixel',01.;t+=.005){ |
2410 | ;>0) |
2414 | ;>0) |
2411 | >0) |
2415 | >0) |
2412 | >0) |
2416 | >0) |
2413 | >0) |
2417 | >0) |
2414 | >0) |
2418 | >0) |
2415 | > |
2419 | > |