From 1ad8071f75737a0d9d5ce8b97d46e346847f394e Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 17 Jul 2025 14:00:56 +0200 Subject: [PATCH] Reduses one CMP instruction in line_down_inv by drawing the line in the other direction --- wip-hugo/routines/line/line_down_inv.s | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/wip-hugo/routines/line/line_down_inv.s b/wip-hugo/routines/line/line_down_inv.s index d026525..f7430c1 100644 --- a/wip-hugo/routines/line/line_down_inv.s +++ b/wip-hugo/routines/line/line_down_inv.s @@ -49,20 +49,26 @@ selfmod: LDA V + 1 STA case_1 + 7 end_selfmod: + LDA X_end + STA X_pos + LDA Y_end + STA Y_pos + JSR pixel_calc ;;only used first pixel. after this relative position is abused STA byte_to_paint + INY + Sub_16 btp_mem_pos, btp_mem_pos + 1, #$01, #$00 LDX dy for_y: LDA byte_to_paint ORA (btp_mem_pos), Y STA (btp_mem_pos), Y increment_y_pos: - INY - CPY #$08 + DEY BNE increment_y_pos_end move_8px_down: - LDY #$00 - Add_16 btp_mem_pos, btp_mem_pos + 1, #$3F ,#$01, ! + LDY #$08 + Sub_16 btp_mem_pos, btp_mem_pos + 1, #$40 ,#$01 increment_y_pos_end: DEX ;CPX Y_end @@ -71,11 +77,11 @@ increment_y_pos_end: case_1: Sub_16_A D, D + 1, #>V, #dx_2, #