;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- ;;drawing line from 2 cordinates ;;# (X_pos, Y_pos) # ;;# * # ;;# * # ;;# * # ;;# (X_end, Y_end) # ;;NOTE THAT X_pos <= X_end, Y_pos <= Y_end. Max 45deg! .proc line_down .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 dx SEC SBC >V STA >V; V, dy_2, =V. ;; V_max = %00000001 11111111 ;; We therefor need to add this offset to V 00000001 11111111 ;; and to its branch logic later in the loop. ;;D = 2*dy - dx + 2*255 LDA >dy_2 STA >D LDA D, D, btp_mem_pos), Y STA (>btp_mem_pos), Y increment_pixel_x: LSR byte_to_paint ; Rotates the pixel one bit to the left ON THE SCREEN. BCC increment_pixel_x_end; We need to move to the next chunk move_8px_left: ;; Next chunk is 8 addresses away. Look in pixel_draw for more detail. Add_16 >btp_mem_pos, D, D, V, C=1 LDY #$00 ;; Switch to chunk bellow Add_16 >btp_mem_pos, D, dy_2,