Rev 6359 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6359 | Rev 6379 | ||
---|---|---|---|
Line 88... | Line 88... | ||
88 | screen_y_1: |
88 | screen_y_1: |
89 | mov esi,[CounterX] |
89 | mov esi,[CounterX] |
Line 90... | Line 90... | ||
90 | 90 | ||
91 | screen_x_1: |
91 | screen_x_1: |
92 | mov ecx,[eax] |
- | |
93 | and ecx,0xffffff |
92 | mov ecx,[eax] |
94 | mov ebp,ecx |
93 | mov ebp,ecx |
95 | shr ecx,16 |
94 | shr ecx,16 |
96 | mov [ebx],bp |
95 | mov [ebx],bp |
97 | mov [ebx+2],cl |
96 | mov [ebx+2],cl |
98 | add ebx,3; |
97 | add ebx,3 |
99 | add eax,3 |
98 | add eax,3 |
100 | dec esi |
99 | dec esi |
101 | jnz screen_x_1 |
100 | jnz screen_x_1 |
102 | add eax,[OffsetYPicture] |
101 | add eax,[OffsetYPicture] |
Line 112... | Line 111... | ||
112 | screen_y_2: |
111 | screen_y_2: |
113 | mov esi,[CounterX] |
112 | mov esi,[CounterX] |
Line 114... | Line 113... | ||
114 | 113 | ||
115 | screen_x_2: |
114 | screen_x_2: |
116 | mov ecx,[eax] |
- | |
117 | and ecx,0xffffff |
115 | mov ecx,[eax] |
118 | mov ebp,ecx |
116 | mov ebp,ecx |
119 | shr ecx,16 |
117 | shr ecx,16 |
120 | mov edx,ebx |
118 | mov edx,ebx |
121 | mov [edx],bp |
119 | mov [edx],bp |
Line 126... | Line 124... | ||
126 | add edx,[OffsetYBigPixel] |
124 | add edx,[OffsetYBigPixel] |
127 | mov [edx],bp |
125 | mov [edx],bp |
128 | mov [edx+2],cl |
126 | mov [edx+2],cl |
129 | mov [edx+3],bp |
127 | mov [edx+3],bp |
130 | mov [edx+3+2],cl |
128 | mov [edx+3+2],cl |
131 | add edx,3*2 |
- | |
132 | add edx,[OffsetYBigPixel] |
- | |
133 | add ebx,3*2 |
129 | add ebx,3*2 |
134 | add eax,3 |
130 | add eax,3 |
135 | dec esi |
131 | dec esi |
136 | jnz screen_x_2 |
132 | jnz screen_x_2 |
137 | add eax,[OffsetYPicture] |
133 | add eax,[OffsetYPicture] |
Line 147... | Line 143... | ||
147 | screen_y_4: |
143 | screen_y_4: |
148 | mov esi,[CounterX] |
144 | mov esi,[CounterX] |
Line 149... | Line 145... | ||
149 | 145 | ||
150 | screen_x_4: |
146 | screen_x_4: |
151 | mov ecx,[eax] |
- | |
152 | and ecx,0xffffff |
147 | mov ecx,[eax] |
153 | mov ebp,ecx |
148 | mov ebp,ecx |
154 | shr ecx,16 |
149 | shr ecx,16 |
155 | mov edx,ebx |
150 | mov edx,ebx |
156 | mov [edx],bp |
151 | mov [edx],bp |
Line 189... | Line 184... | ||
189 | mov [edx+3+2],cl |
184 | mov [edx+3+2],cl |
190 | mov [edx+6],bp |
185 | mov [edx+6],bp |
191 | mov [edx+6+2],cl |
186 | mov [edx+6+2],cl |
192 | mov [edx+9],bp |
187 | mov [edx+9],bp |
193 | mov [edx+9+2],cl |
188 | mov [edx+9+2],cl |
194 | add edx,3*4 |
- | |
195 | add edx,[OffsetYBigPixel] |
- | |
196 | add ebx,4*3 |
189 | add ebx,4*3 |
197 | add eax,3 |
190 | add eax,3 |
198 | dec esi |
191 | dec esi |
199 | jnz screen_x_4 |
192 | jnz screen_x_4 |
200 | add eax,[OffsetYPicture] |
193 | add eax,[OffsetYPicture] |
Line 208... | Line 201... | ||
208 | screen_y: |
201 | screen_y: |
209 | mov esi,[CounterX] |
202 | mov esi,[CounterX] |
Line 210... | Line 203... | ||
210 | 203 | ||
211 | screen_x: |
204 | screen_x: |
212 | mov ecx,[eax] |
- | |
213 | and ecx,0xffffff |
205 | mov ecx,[eax] |
214 | mov ebp,ecx |
206 | mov ebp,ecx |
215 | shr ecx,16 |
207 | shr ecx,16 |
216 | ;--------------------------------------------------------- |
208 | ;--------------------------------------------------------- |
217 | push ebx eax |
209 | push ebx eax |
Line 241... | Line 233... | ||
241 | add ebx,[OffsetYWorkScreen] |
233 | add ebx,[OffsetYWorkScreen] |
242 | dec edi |
234 | dec edi |
243 | jnz screen_y |
235 | jnz screen_y |
Line 244... | Line 236... | ||
244 | 236 | ||
- | 237 | fps: |
|
- | 238 | ;calculate selection rect |
|
- | 239 | cmp [instrument_used],1 |
|
- | 240 | jne .no_selection_rect |
|
- | 241 | mov edx,[rectangular_shade_y] |
|
- | 242 | sub edx,[PosY] |
|
- | 243 | mov ecx,[rectangular_shade_x] |
|
245 | fps: |
244 | sub ecx,[PosX] |
- | 245 | mov ebx,[OldY] |
|
- | 246 | sub ebx,[PosY] |
|
- | 247 | mov eax,[OldX] |
|
- | 248 | sub eax,[PosX] |
|
- | 249 | cmp [k],1 |
|
- | 250 | je .zo_1 |
|
- | 251 | cmp eax,ecx |
|
- | 252 | jle @f |
|
- | 253 | xchg eax,ecx |
|
- | 254 | @@: |
|
- | 255 | cmp ebx,edx |
|
- | 256 | jle @f |
|
- | 257 | xchg ebx,edx |
|
- | 258 | @@: |
|
- | 259 | inc eax |
|
- | 260 | inc ebx |
|
- | 261 | imul eax,[k] |
|
- | 262 | imul ebx,[k] |
|
- | 263 | imul ecx,[k] |
|
- | 264 | imul edx,[k] |
|
- | 265 | dec eax |
|
- | 266 | dec ebx |
|
- | 267 | .zo_1: |
|
- | 268 | stdcall draw_selection_rect, eax,ebx,ecx,edx |
|
- | 269 | .no_selection_rect: |
|
246 | mov ebx,[ScreenPointer] |
270 | |
247 | mov ecx,[WorkScreen_SizeX] |
271 | mov ecx,[WorkScreen_SizeX] |
248 | shl ecx,16 |
272 | shl ecx,16 |
249 | add ecx,[WorkScreen_SizeY] |
273 | add ecx,[WorkScreen_SizeY] |
250 | mov edx,((ci_edit_wnd_x_pos+ci_edit_wnd_border) shl 16)\ |
274 | mov edx,((ci_edit_wnd_x_pos+ci_edit_wnd_border) shl 16)\ |
251 | + (ci_edit_wnd_y_pos+ci_edit_wnd_border) |
275 | + (ci_edit_wnd_y_pos+ci_edit_wnd_border) |
- | 276 | mcall SF_PUT_IMAGE, [ScreenPointer] |
|
- | 277 | ret |
|
- | 278 | ;---------------------------------------------------------- |
|
- | 279 | align 4 |
|
- | 280 | proc draw_selection_rect, x0:dword, y0:dword, x1:dword, y1:dword |
|
- | 281 | mov eax,0xffff3fff ;2:2 |
|
- | 282 | mov edx,0xff1f ;1:1 |
|
- | 283 | ||
- | 284 | mov edi,[x0] |
|
- | 285 | mov ebx,[y0] |
|
- | 286 | mov ecx,[x1] |
|
- | 287 | cmp edi,ecx |
|
- | 288 | jle @f |
|
- | 289 | xchg edi,ecx |
|
- | 290 | @@: |
|
- | 291 | call draw_line_h |
|
- | 292 | mov ebx,[y1] |
|
- | 293 | call draw_line_h |
|
- | 294 | ||
- | 295 | mov edi,[x0] |
|
- | 296 | mov ecx,[y0] |
|
- | 297 | cmp ebx,ecx |
|
- | 298 | jle @f |
|
- | 299 | xchg ebx,ecx |
|
- | 300 | @@: |
|
- | 301 | call draw_line_w |
|
- | 302 | mov edi,[x1] |
|
- | 303 | call draw_line_w |
|
- | 304 | ret |
|
- | 305 | endp |
|
- | 306 | ||
- | 307 | ;input: |
|
- | 308 | ; eax - color1(g,r):color2(g,r) |
|
- | 309 | ; dx - color1(b):color2(b) |
|
- | 310 | ; edi - x0 |
|
- | 311 | ; ebx - y0 |
|
- | 312 | ; ecx - x1 (x1 >= x0) |
|
- | 313 | align 4 |
|
- | 314 | draw_line_h: |
|
- | 315 | cmp edi,ecx |
|
- | 316 | je .end_f |
|
- | 317 | cmp ecx,1 |
|
- | 318 | jl .end_f |
|
- | 319 | cmp edi,[WorkScreen_SizeX] |
|
- | 320 | jge .end_f |
|
- | 321 | cmp ebx,0 |
|
- | 322 | jl .end_f |
|
- | 323 | cmp ebx,[WorkScreen_SizeY] |
|
- | 324 | jge .end_f |
|
- | 325 | push ebx ecx edi |
|
- | 326 | cmp ecx,[WorkScreen_SizeX] |
|
- | 327 | jl @f |
|
- | 328 | mov ecx,[WorkScreen_SizeX] |
|
- | 329 | @@: |
|
- | 330 | cmp edi,0 |
|
- | 331 | jge @f |
|
- | 332 | xor edi,edi |
|
- | 333 | @@: |
|
- | 334 | sub ecx,edi |
|
- | 335 | imul ebx,[WorkScreen_SizeX] |
|
- | 336 | add edi,ebx |
|
- | 337 | lea edi,[edi+edi*2] |
|
- | 338 | add edi,[ScreenPointer] |
|
- | 339 | cld |
|
- | 340 | .line_t: |
|
- | 341 | stosw |
|
- | 342 | mov byte[edi],dl |
|
- | 343 | inc edi |
|
- | 344 | bt ecx,1 |
|
- | 345 | jc @f |
|
- | 346 | bt ecx,0 |
|
- | 347 | jc @f |
|
- | 348 | ror eax,16 |
|
- | 349 | ror dx,8 |
|
- | 350 | @@: |
|
- | 351 | dec ecx |
|
- | 352 | jnz .line_t |
|
- | 353 | pop edi ecx ebx |
|
- | 354 | .end_f: |
|
- | 355 | ret |
|
- | 356 | ||
- | 357 | ;input: |
|
- | 358 | ; eax - color1(g,r):color2(g,r) |
|
- | 359 | ; dx - color1(b):color2(b) |
|
- | 360 | ; edi - x0 |
|
- | 361 | ; ebx - y0 |
|
- | 362 | ; ecx - y1 (y1 >= y0) |
|
- | 363 | align 4 |
|
- | 364 | draw_line_w: |
|
- | 365 | cmp edi,0 |
|
- | 366 | jl .end_f |
|
- | 367 | cmp edi,[WorkScreen_SizeX] |
|
- | 368 | jge .end_f |
|
- | 369 | cmp ebx,ecx |
|
- | 370 | je .end_f |
|
- | 371 | cmp ebx,[WorkScreen_SizeY] |
|
- | 372 | jge .end_f |
|
- | 373 | cmp ecx,1 |
|
- | 374 | jl .end_f |
|
- | 375 | push ebx ecx edi |
|
- | 376 | cmp ecx,[WorkScreen_SizeY] |
|
- | 377 | jl @f |
|
- | 378 | mov ecx,[WorkScreen_SizeY] |
|
- | 379 | @@: |
|
- | 380 | cmp ebx,0 |
|
- | 381 | jge @f |
|
- | 382 | xor ebx,ebx |
|
- | 383 | @@: |
|
- | 384 | sub ecx,ebx |
|
- | 385 | cmp ecx,1 |
|
- | 386 | jl .end_f |
|
- | 387 | imul ebx,[WorkScreen_SizeX] |
|
- | 388 | add edi,ebx |
|
- | 389 | lea edi,[edi+edi*2] |
|
- | 390 | add edi,[ScreenPointer] |
|
- | 391 | mov ebx,[WorkScreen_SizeX] |
|
- | 392 | lea ebx,[ebx+ebx*2] |
|
- | 393 | sub ebx,2 |
|
- | 394 | cld |
|
- | 395 | .line_r: |
|
- | 396 | stosw |
|
- | 397 | mov byte[edi],dl |
|
- | 398 | add edi,ebx |
|
- | 399 | bt ecx,1 |
|
- | 400 | jc @f |
|
- | 401 | bt ecx,0 |
|
- | 402 | jc @f |
|
- | 403 | ror eax,16 |
|
- | 404 | ror dx,8 |
|
- | 405 | @@: |
|
- | 406 | dec ecx |
|
- | 407 | jnz .line_r |
|
- | 408 | pop edi ecx ebx |
|
252 | mcall SF_PUT_IMAGE |
409 | .end_f: |
253 | ret |
410 | ret |
254 | ;---------------------------------------------------------- |
411 | ;---------------------------------------------------------- |
255 | ;--------------------clear screen-------------------------- |
412 | ;--------------------clear screen-------------------------- |
- | 413 | ;---------------------------------------------------------- |
|
256 | ;---------------------------------------------------------- |
414 | align 4 |
257 | cleare_screen: |
415 | cleare_screen: |
258 | mov edi,[ScreenPointer] |
416 | mov edi,[ScreenPointer] |
259 | mov ebx,[WorkScreen_SizeX] |
417 | mov ebx,[WorkScreen_SizeX] |
260 | imul ebx,[WorkScreen_SizeY] |
418 | imul ebx,[WorkScreen_SizeY] |