From 54fa061342a058f20acc5b593eaf33b0368c7ebc Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 17 Jul 2025 13:47:12 +0200 Subject: [PATCH] fix line draw bug, that snaps the end to exry 8th pixel --- wip-hugo/routines/line/line_down.s | 1 - wip-hugo/routines/line/line_down_inv.s | 1 - wip-hugo/routines/line/line_test_extensive.s | 4 ++-- wip-hugo/routines/line/line_up.s | 3 ++- wip-hugo/routines/line/line_up_inv.s | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wip-hugo/routines/line/line_down.s b/wip-hugo/routines/line/line_down.s index 87361c1..b0cf736 100644 --- a/wip-hugo/routines/line/line_down.s +++ b/wip-hugo/routines/line/line_down.s @@ -77,7 +77,6 @@ end_selfmod: STA byte_to_paint ;; X = X_end - X_pos LDX dx - LDY #$00 for_x: ;; Paints A to address in |btp_mem_pos* + Y| ;; Y is pixel position in the chunk. Therefor it may be that Y = 0, 1, 2, 3, 4, ,5 ,6 ,7. diff --git a/wip-hugo/routines/line/line_down_inv.s b/wip-hugo/routines/line/line_down_inv.s index 84f723d..d026525 100644 --- a/wip-hugo/routines/line/line_down_inv.s +++ b/wip-hugo/routines/line/line_down_inv.s @@ -51,7 +51,6 @@ selfmod: end_selfmod: JSR pixel_calc ;;only used first pixel. after this relative position is abused STA byte_to_paint - LDY #$00 LDX dy for_y: LDA byte_to_paint diff --git a/wip-hugo/routines/line/line_test_extensive.s b/wip-hugo/routines/line/line_test_extensive.s index df16080..7788aaf 100644 --- a/wip-hugo/routines/line/line_test_extensive.s +++ b/wip-hugo/routines/line/line_test_extensive.s @@ -68,11 +68,11 @@ clear_screen_: long_line_test_b: LDA #$00 STA X_pos_ -LDA #$60 +LDA #$00 STA Y_pos_ LDA #$ff STA X_end -LDA #$0 +LDA #$60 STA Y_end @loop: LDA Y_pos_ diff --git a/wip-hugo/routines/line/line_up.s b/wip-hugo/routines/line/line_up.s index 7952917..4e97bf6 100644 --- a/wip-hugo/routines/line/line_up.s +++ b/wip-hugo/routines/line/line_up.s @@ -54,7 +54,8 @@ end_selfmod: JSR pixel_calc ;;only used first pixel. after this relative position is abused STA byte_to_paint Sub_16 btp_mem_pos, btp_mem_pos + 1, #$01, #$00 ;; Y has always a offset of at least 1 - LDY #$01 + ;LDY #$01 + INY LDX dx for_x: LDA byte_to_paint diff --git a/wip-hugo/routines/line/line_up_inv.s b/wip-hugo/routines/line/line_up_inv.s index fe08ed6..63e1a84 100644 --- a/wip-hugo/routines/line/line_up_inv.s +++ b/wip-hugo/routines/line/line_up_inv.s @@ -52,7 +52,7 @@ selfmod: end_selfmod: JSR pixel_calc ;;only used first pixel. after this relative position is abused STA byte_to_paint - LDY #$00 + ;LDY #$00 LDX dy for_y: LDA byte_to_paint