From c1a79b32b76faea73aea587a8aeb1db4ea3a3321 Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 15 May 2025 17:24:40 +0200 Subject: [PATCH] unroll loop for faster char-draw:s --- wip-hugo/routines/text/char_draw.s | 23 +++++++++++++++++++---- wip-hugo/source.s | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/wip-hugo/routines/text/char_draw.s b/wip-hugo/routines/text/char_draw.s index 00a8099..0dcfd2d 100644 --- a/wip-hugo/routines/text/char_draw.s +++ b/wip-hugo/routines/text/char_draw.s @@ -51,14 +51,29 @@ calculate_screen_position: Add_16 screen_position, screen_position + 1, A, #$00 move_data: - ;; One character is 8 byte, move these bytes to screen LDY #$07 -@loop: LDA (petski_position), Y STA (screen_position), Y - DEY - BNE @loop + DEY ;$06 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$05 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$04 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$03 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$02 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$01 + LDA (petski_position), Y + STA (screen_position), Y + DEY ;$00 LDA (petski_position), Y STA (screen_position), Y RTS diff --git a/wip-hugo/source.s b/wip-hugo/source.s index aaf40c6..72d5184 100755 --- a/wip-hugo/source.s +++ b/wip-hugo/source.s @@ -9,10 +9,10 @@ ;.include "dubbel_buffer/raster_irqs.s" .include "routines/line/line_test.s" -;.include "routines/text/char_draw_test.s" +.include "routines/text/char_draw_test.s" ;.include "routines/pixel/pixel_test.s" ;.include "routines/memory/memcpy_test.s" -.include "routines/memory/memset_test.s" +;.include "routines/memory/memset_test.s" ;.include "routines/triangle/triangle_test.s" exit: JMP exit