From 494e9dc5f9fde5794d582b38633c6e0d1d404f3f Mon Sep 17 00:00:00 2001 From: hugova Date: Tue, 4 Mar 2025 21:00:21 +0100 Subject: [PATCH] A fix of line_up_inv such that X_pos < X_end like all other line_* implementations. --- wip-hugo/routines/memory/line/line_up_inv.s | 28 +++++++-------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/wip-hugo/routines/memory/line/line_up_inv.s b/wip-hugo/routines/memory/line/line_up_inv.s index cf2aa19..57deeff 100644 --- a/wip-hugo/routines/memory/line/line_up_inv.s +++ b/wip-hugo/routines/memory/line/line_up_inv.s @@ -1,11 +1,11 @@ ;drawing line from 2 cordinates .proc line_up_inv - ;;# (X_pos, Y_pos) # + ;;# (X_end, Y_end) # ;;# * # ;;# * # ;;# * # - ;;# (X_end, Y_end) # - ;;NOTE THAT Y_pos <= Y_end, X_pos >= X_end. Min 45deg! + ;;# (X_pos, Y_pos) # + ;;NOTE THAT Y_pos >) Y_end, X_pos <= X_end. Min 45deg! ;;Not values but register position in memory X_end = $04 @@ -17,16 +17,6 @@ V = $0809 D = $0a0b - ;example values ~~~~~ SHOULD BE PRECOMPILED - ;LDA #$60 - ;STA X_pos - ;STA Y_pos - ;LDA #$50 - ;STA X_end - ;LDA #$90 - ;STA Y_end - ;;~~~~~~~~~~ - ;We need to clear this memory LDA #$00 STA V STA >dx_2; >dy_2 = dy. Needed for dy_2 (not for V) - LDA Y_end + LDA Y_pos SEC - SBC Y_pos + SBC Y_end STA dy SEC SBC >V @@ -63,7 +53,7 @@ for_y: jsr pixel_draw ;;Increment Y until Y_pos = Y_end and X_pos = X_end - INC Y_pos + DEC Y_pos LDY Y_pos CPY Y_end BEQ end @@ -72,7 +62,7 @@ for_y: ;;else case 1. Lag_16 >D, D, V,