From 3c14f4094dde08ba304cd2a01c4549cd84879351 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Sun, 27 Mar 2016 20:03:27 +1100 Subject: [PATCH] More small optimisations --- 024.simple_text/blittext.s | 45 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/024.simple_text/blittext.s b/024.simple_text/blittext.s index b302c01..3f3b7d2 100644 --- a/024.simple_text/blittext.s +++ b/024.simple_text/blittext.s @@ -53,20 +53,13 @@ DrawChar8: add.w #1,d5 ; while we have a weird font image, '!' starts on second line move.l d6,a1 ; #font mulu.w #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH*FONT_HEIGHT,d5 + if MASKED_FONT==1 move.l d7,a2 ; #fontMask add.w d5,a2 ; add y offset in lines to fontMask address endif + add.w d5,a1 ; add y offset in lines to font address - - btst #0,d2 ; blitter does words only, so we need to know if its an odd or even character - beq .even ; then shift it into position with the blitter shift -.odd: ; this check is repeated in .blitChar8 so should be refactored - moveq #1,d3 - bra .c1 -.even: - moveq #0,d3 -.c1: add.w d2,a1 ; add offset into font if MASKED_FONT==1 @@ -74,24 +67,24 @@ DrawChar8: endif .blitChar8: - ;; kills a4,d2,d4 + ;; kills a4,d2,d4,d5 ;; d0 - xpos ;; d1 - ypos bytes - ;; d3 - odd character = 1, even character = 0 + ;; d2.0 - odd character = 1, even character = 0 ;; a4 - display ;; a1 - object ;; a2 - mask move.l d0,d4 - move.l d0,d2 + move.l d0,d5 lsr.w #3,d4 ; d4 = XPOS_BYTES WaitBlitter - btst #0,d3 + btst #0,d2 beq .evenChar .oddChar - subq #8,d2 + subq #8,d5 ; offset the x position for the odd character move.w #$00FF,BLTAFWM(a6) ; select the second (odd) character in the word subq #1,a4 @@ -100,29 +93,27 @@ DrawChar8: move.w #$FF00,BLTAFWM(a6) ; select the first character in the word .continue: - ;; this shift will give us the bits to shift (bits 0-3) in bits (12-15) of d2 - lsl.w #8,d2 ; BLIT_SOURCE_SHIFT<