From 41b8fec7a887e381d098e58445c828e7e5035c7f Mon Sep 17 00:00:00 2001 From: hugova Date: Tue, 25 Mar 2025 21:40:40 +0100 Subject: [PATCH] Performance improved mult_16 without changing behaviour --- wip-hugo/macros/16aritmatic.s | 14 +++++++++----- wip-hugo/routines/memory/pixel_draw.s | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/wip-hugo/macros/16aritmatic.s b/wip-hugo/macros/16aritmatic.s index 429cd13..2756c9d 100755 --- a/wip-hugo/macros/16aritmatic.s +++ b/wip-hugo/macros/16aritmatic.s @@ -69,13 +69,17 @@ ;; Multiplication of 2 ;; a = a*2 -.macro mult_16 low_, hi_, fast_unsafe -;; IF to run it fast +.macro mult_16 low_, hi_, NOT_ROL +;; IF NOT_ROL .ifblank fast_unsafe - CLC -.endif - ROL low_ + ASL low_ + ROL hi_ +.else + ROL low_ ROL hi_ +.endif + + .endmacro ;;Larger then operation, uses the A register diff --git a/wip-hugo/routines/memory/pixel_draw.s b/wip-hugo/routines/memory/pixel_draw.s index 10f7663..1108e05 100755 --- a/wip-hugo/routines/memory/pixel_draw.s +++ b/wip-hugo/routines/memory/pixel_draw.s @@ -62,16 +62,16 @@ end__: ;;We need to calculate C*40. 40 = 2*2*2*(2^2 +1) ;; _*2^2 - mult_16 >C, C, C, C, C, B, C, C, C, C, C, C, btp_mem_pos, C,