From 1524c837cac78d0391acab79ca4c9273054f8a9d Mon Sep 17 00:00:00 2001 From: hugova Date: Sun, 2 Mar 2025 23:14:51 +0100 Subject: [PATCH] A optimisation of line_up_inv.s by moving some logic out of loop --- wip-hugo/routines/memory/line_down.s | 1 - wip-hugo/routines/memory/line_up.s | 17 +++++----- wip-hugo/routines/memory/line_up_inv.s | 47 +++++++++++++------------- wip-hugo/source.s | 2 +- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/wip-hugo/routines/memory/line_down.s b/wip-hugo/routines/memory/line_down.s index 45ce003..9943a61 100644 --- a/wip-hugo/routines/memory/line_down.s +++ b/wip-hugo/routines/memory/line_down.s @@ -28,7 +28,6 @@ STA Y_end ;;~~~~~~~~~~ - ;;We need to clear this memory LDA #$00 STA = Y_end. Max 45deg! + ;;# * (X_end, Y_end) # + ;;# # + ;;# * # + ;;# * # + ;;# (X_pos, Y_pos) # + ;; + ;;NOTE THAT X_pos <= X_end, Y_pos >= Y_end. Max 45deg! -;;Not values but register position in memory + ;;Not values but register position in memory X_end = $04 Y_end = $05 X_pos = $FC @@ -62,7 +62,6 @@ STA D, D, dx_2 - LDA #$00 - STA dx_2, V + STA >dx_2; >dy_2 = dy. Needed for dy_2 (not for V) LDA Y_end SEC SBC Y_pos STA dy + SEC + SBC >V + STA >V; V, dx_2, dx_2 STA >D LDA D, D, dy_2, D, dy_2, D, V, D, dx_2,