; Routine developed by hiTCH-HiKER/ChAOS iNC. ; for the #amycoders circle compo using the Bresenham algorithm ; ;d0 x offset d2 r (y) d4 d d6 2x-1 ;d1 y offset d3 color d5 x d7 -2y+2 _circle lsl.w #8,d1 * Mittelpunkt von add.w d1,d0 * d0,d1 nach d0 moveq #0,d1 * d1 loeschen moveq #-1,d6 * 2x - 1 move.w d2,d4 * r = d neg.w d4 * d = -r move.w d2,d5 lsl.w #8,d5 sub.w d2,d5 move.w d0,d1 add.w d2,d1 move.b d3,0(a0,d1.l) add.w d5,d1 move.b d3,0(a0,d1.l) move.w d0,d1 sub.w d2,d1 move.b d3,0(a0,d1.l) sub.w d5,d1 move.b d3,0(a0,d1.l) moveq #0,d5 * clear x loop addq #1,d5 * x++ addq #2,d6 * d = d + (2x-1) add.w d6,d4 blt.b draw * if >=0 continue sub.w d2,d4 * d-y sub.w d2,d4 * d-y addq #2,d4 * d+2 subq #1,d2 * y-- draw move.w d2,d1 * y position lsl.w #8,d1 * und add.w d5,d1 * x position, move.w d1,d7 add.w d0,d1 * die zum Mittelpunkt addiert werden! move.b d3,0(a0,d1.l) sub.w d5,d1 sub.w d5,d1 move.b d3,0(a0,d1.l) move.w d0,d1 sub.w d7,d1 move.b d3,0(a0,d1.l) add.w d5,d1 add.w d5,d1 move.b d3,0(a0,d1.l) move.w d5,d1 * x -> d1 lsl.w #8,d1 * d1 * 256 add.w d2,d1 move.w d1,d7 add.w d0,d1 move.b d3,0(a0,d1.l) sub.w d2,d1 * d1 + x sub.w d2,d1 move.b d3,0(a0,d1.l) move.w d0,d1 sub.w d7,d1 move.b d3,0(a0,d1.l) add.w d2,d1 add.w d2,d1 move.b d3,0(a0,d1.l) cmp.w d2,d5 * Ist d2(y--) = d5(x++) ? ble.b loop rts .