;;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! ;;Not values but register position in memory X_end = $04 Y_end = $05 X_pos = $FC Y_pos = $FB dx = $0c dy_2 = $0607 V = $0809 D = $0a0b ;;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, D, D, V, D, dy_2,