From adef2c0f56c4a0cbcc4814a8ee4ce9322d0f8aee Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 3 Apr 2025 00:21:01 +0200 Subject: [PATCH] Make line draw faster --- wip-hugo/routines/line/line_down.s | 10 +++++++--- wip-hugo/source.s | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wip-hugo/routines/line/line_down.s b/wip-hugo/routines/line/line_down.s index 0484956..afed9d4 100644 --- a/wip-hugo/routines/line/line_down.s +++ b/wip-hugo/routines/line/line_down.s @@ -64,7 +64,12 @@ selfmod: STA case_1 +7 end_selfmod: JSR pixel_draw ;;only used first pixel. after this relative position is abused - LDX X_pos + ;; X = X_end - X_pos + LDA X_end + SEC + SBC X_pos + TAX + ;LDX X_pos LDY #$00 for_x: ;; Paints A to address in |btp_mem_pos* + Y| @@ -84,8 +89,7 @@ move_8px_left: LDA #%10000000 STA byte_to_paint increment_pixel_x_end: - INX - CPX X_end + DEX BEQ end ;We keep track on when to stop line draw with the X registry. ;;If D < %00000010 00000000: case_2 ;;else case 1. diff --git a/wip-hugo/source.s b/wip-hugo/source.s index 324ebf3..8650072 100755 --- a/wip-hugo/source.s +++ b/wip-hugo/source.s @@ -6,8 +6,8 @@ .include "routines/memory/mem.inc" ;;Code to run .include "STARTUP.s" -;.include "routines/line/line_test_time.s" -.include "routines/memory/memcpy_test.s" +.include "routines/line/line_test_time.s" +;.include "routines/memory/memcpy_test.s" exit: jmp exit .include "routines/line/line.s"