;;drawing line from 2 cordinates .proc line_down ;;# (X_pos, Y_pos) # ;;# * # ;;# * # ;;# * # ;;# (X_end, Y_end) # ;;NOTE THAT X_pos <= X_end, Y_pos <= Y_end. Max 45deg! .include "line.inc"; Defines memory positions, ex X_pos ;;We need to clear this memory LDA #$00 STA V STA >dy_2; >dy_2 = dy. Needed for dy_2 (not for V) LDA X_end SEC SBC X_pos STA dx SEC SBC >V STA >V; V, dy_2, =V. ;; V_max = 00000001 11111111 ;; For us to work with unsigned numbers we add 00000001 11111111 ;; to V and the branch logic to V! ;;D = 2*dy - dx + 2*255 ;;Our D is bigger then wikipedia because D is unsigned. LDA >dy_2 STA >D LDA D, D, btp_mem_pos, X) STA (>btp_mem_pos, X) BCS move_8px_left jmp increment_x_pos_end move_8px_left: ;; add +8 to btp_mem_pos. Find more of why in pixel_draw Add_16 >btp_mem_pos, D, D, V, btp_mem_pos, btp_mem_pos, D, dy_2,