The Bresenham algorithm
@DrWatson
Published in
atari
· 10 Nov 2023
... bpl.s .ok2 ; | value of the difference neg.w d3 ; \ between Y1 and Y2 .ok2 cmp.w d2,d3 bhi.s .ver * Part for dX > dY cmp.w d0,d4 ; / Get the bhs.s .do2 ; | heighest exg d0,d4 ; | X and Y exg d1,d5 ; \ in d4.w and d5.w .do2 moveq #10,d2 ; \put #640 lsl.l #6,d2 ; /in d2.l (bytes in scanline) sub.w d0,d4 sub.w d1,d5 add.l d0,d0 adda.l d0,a0 mulu.w d2,d1 adda.l d1,a0 tst.w d5 bpl.s .shit neg.w d5 ; / make the neg.l d2 ; | dX absolute .shit swap d5 ; | and negate the scanline- addq.w #1,d4 ...