Rev 2212 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2212 | Rev 2382 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | ;; ;; |
15 | ;; ;; |
16 | ;; See file COPYING for details ;; |
16 | ;; See file COPYING for details ;; |
17 | ;; ;; |
17 | ;; ;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 19... | Line 19... | ||
19 | 19 | ||
Line 20... | Line 20... | ||
20 | $Revision: 2212 $ |
20 | $Revision: 2382 $ |
21 | 21 | ||
Line 443... | Line 443... | ||
443 | .no_reverse1: |
443 | .no_reverse1: |
444 | mov eax, [dl_dx] |
444 | mov eax, [dl_dx] |
445 | cdq ; extend eax sing to edx |
445 | cdq ; extend eax sing to edx |
446 | shl eax, 16 ; using 16bit fix-point maths |
446 | shl eax, 16 ; using 16bit fix-point maths |
447 | idiv ebp ; eax = ((x2-x1)*65536)/(y2-y1) |
447 | idiv ebp ; eax = ((x2-x1)*65536)/(y2-y1) |
- | 448 | ;-------------------------------------- |
|
- | 449 | ; correction for the remainder of the division |
|
- | 450 | shl edx, 1 |
|
- | 451 | cmp ebp, edx |
|
- | 452 | jb @f |
|
- | 453 | inc eax |
|
- | 454 | @@: |
|
- | 455 | ;-------------------------------------- |
|
448 | mov edx, ebp ; edx = counter (number of pixels to draw) |
456 | mov edx, ebp ; edx = counter (number of pixels to draw) |
449 | mov ebp, 1 *65536 ; <<16 ; ebp = dy = 1.0 |
457 | mov ebp, 1 *65536; <<16 ; ebp = dy = 1.0 |
450 | mov esi, eax ; esi = dx |
458 | mov esi, eax ; esi = dx |
451 | jmp .y_rules |
459 | jmp .y_rules |
Line 464... | Line 472... | ||
464 | xor edx, edx |
472 | xor edx, edx |
465 | mov eax, [dl_dy] |
473 | mov eax, [dl_dy] |
466 | cdq ; extend eax sing to edx |
474 | cdq ; extend eax sing to edx |
467 | shl eax, 16 ; using 16bit fix-point maths |
475 | shl eax, 16 ; using 16bit fix-point maths |
468 | idiv esi ; eax = ((y2-y1)*65536)/(x2-x1) |
476 | idiv esi ; eax = ((y2-y1)*65536)/(x2-x1) |
- | 477 | ;-------------------------------------- |
|
- | 478 | ; correction for the remainder of the division |
|
- | 479 | shl edx, 1 |
|
- | 480 | cmp esi, edx |
|
- | 481 | jb @f |
|
- | 482 | inc eax |
|
- | 483 | @@: |
|
- | 484 | ;-------------------------------------- |
|
469 | mov edx, esi ; edx = counter (number of pixels to draw) |
485 | mov edx, esi ; edx = counter (number of pixels to draw) |
470 | mov esi, 1 *65536 ;<< 16 ; esi = dx = 1.0 |
486 | mov esi, 1 *65536;<< 16 ; esi = dx = 1.0 |
471 | mov ebp, eax ; ebp = dy |
487 | mov ebp, eax ; ebp = dy |
472 | .y_rules: |
488 | .y_rules: |
473 | mov eax, [dl_x1] |
489 | mov eax, [dl_x1] |
474 | mov ebx, [dl_y1] |
490 | mov ebx, [dl_y1] |
475 | shl eax, 16 |
491 | shl eax, 16 |
476 | shl ebx, 16 |
492 | shl ebx, 16 |
- | 493 | ;----------------------------------------------------------------------------- |
|
477 | align 4 |
494 | align 4 |
478 | .draw: |
495 | .draw: |
479 | push eax ebx |
496 | push eax ebx |
- | 497 | ;-------------------------------------- |
|
- | 498 | ; correction for the remainder of the division |
|
- | 499 | test ah, 0x80 |
|
- | 500 | jz @f |
|
- | 501 | add eax, 1 shl 16 |
|
- | 502 | @@: |
|
- | 503 | ;-------------------------------------- |
|
480 | shr eax, 16 |
504 | shr eax, 16 |
- | 505 | ;-------------------------------------- |
|
- | 506 | ; correction for the remainder of the division |
|
- | 507 | test bh, 0x80 |
|
- | 508 | jz @f |
|
- | 509 | add ebx, 1 shl 16 |
|
- | 510 | @@: |
|
- | 511 | ;-------------------------------------- |
|
481 | shr ebx, 16 |
512 | shr ebx, 16 |
482 | call [putpixel] |
513 | call [putpixel] |
483 | pop ebx eax |
514 | pop ebx eax |
484 | add ebx, ebp ; y = y+dy |
515 | add ebx, ebp ; y = y+dy |
485 | add eax, esi ; x = x+dx |
516 | add eax, esi ; x = x+dx |