From 47d53ecf78919f2074d37f8d6517a31d49295535 Mon Sep 17 00:00:00 2001 From: hugova Date: Mon, 24 Mar 2025 17:07:14 +0100 Subject: [PATCH] Fix performance by using pointer tricks for ADD. 20% faster line drawing --- wip-hugo/routines/line/line_down.s | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/wip-hugo/routines/line/line_down.s b/wip-hugo/routines/line/line_down.s index 7082617..b7ffead 100644 --- a/wip-hugo/routines/line/line_down.s +++ b/wip-hugo/routines/line/line_down.s @@ -53,15 +53,12 @@ LDY #$00 jsr pixel_draw ;;only used first pixel. after this relative position is abused - -;;From line_test_time this is at program_start + list_file_offset = $080D + $0116 = $0923 for_x: - ;; Lets increment btp_mem_pos with +8 - ;; Read more in pixel_draw to understand this! - LDX #$00 + ;; Paints A to address i btp_mem_pos* + Y + ;; Y is our Y-pos-chunk-offset. LDA byte_to_paint - ORA (>btp_mem_pos, X) - STA (>btp_mem_pos, X) + ORA (>btp_mem_pos), Y + STA (>btp_mem_pos), Y increment_pixel_x: CLC ROR byte_to_paint @@ -84,7 +81,7 @@ increment_pixel_x_end: case_1:; C =1 so we can use ! Sub_16 >D, V, btp_mem_pos, btp_mem_pos, C=1 ;; +320-8 bytes LDY #$00 - Add_16 >btp_mem_pos, btp_mem_pos,