From 2a5eaa1ea2372e00955b3c65d82e5077a8b92546 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Fri, 1 Apr 2016 16:35:02 +1100 Subject: [PATCH] Simplifying char blit --- 025.scroll_text/blitchar.s | 17 ++++++----------- 025.scroll_text/scroll_text.s | 10 ++++++---- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/025.scroll_text/blitchar.s b/025.scroll_text/blitchar.s index 4e0e0f5..b8b51eb 100644 --- a/025.scroll_text/blitchar.s +++ b/025.scroll_text/blitchar.s @@ -22,7 +22,6 @@ BlitChar8: movem.l d0-d3/a0-a2,-(sp) mulu.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH,d1 ; ypos bytes lea font(pc),a1 ; font pointer - lea fontMask,a2 ; font mask pointer sub.w #'!',d2 ; index = char - '!' move.w d2,d3 @@ -31,16 +30,10 @@ BlitChar8: add.l #1,d3 ; while we have a weird font image, '!' starts on second line mulu.w #FONTMAP_WIDTH_BYTES*SCREEN_BIT_DEPTH*FONT_HEIGHT,d3 ; d3 *= #FONTMAP_WIDTH_BYTES*SCREEN_BIT_DEPTH*FONT_HEIGHT - if MASKED_FONT==1 - add.w d3,a2 ; add y offset in lines to fontMask address - add.l d2,a2 ; add offset into mask - endif add.l #(FONT_HEIGHT*SCREEN_BIT_DEPTH*FONTMAP_WIDTH_BYTES)-FONTMAP_WIDTH_BYTES+0,a1 ; last word - descending mode add.w d3,a1 ; add y offset in lines to font address add.w d2,a1 ; add offset into font - add.l #(FONT_HEIGHT*SCREEN_BIT_DEPTH*FONTMAP_WIDTH_BYTES)-FONTMAP_WIDTH_BYTES+0,a2 ; last word - descending mode - lsr.w #3,d0 ; d0 = xpos bytes add.l d0,a0 ; dest += XPOS_BYTES @@ -72,11 +65,13 @@ BlitChar8: .continue: - if MASKED_FONT==1 - move.l a2,BLTAPTH(a6) ; mask bitplane - endif - move.l a1,BLTBPTH(a6) ; source bitplane + + if MASKED_FONT==1 + add.l #fontMask-font,a1 + move.l a1,BLTAPTH(a6) ; mask bitplane + endif + move.l a0,BLTCPTH(a6) ; background top left corner move.l a0,BLTDPTH(a6) ; destination top left corner diff --git a/025.scroll_text/scroll_text.s b/025.scroll_text/scroll_text.s index 60fdc23..baa8127 100644 --- a/025.scroll_text/scroll_text.s +++ b/025.scroll_text/scroll_text.s @@ -4,6 +4,8 @@ xdef onscreen xdef offscreen xdef copperListBplPtr + +Y_POS equ 16 byteMap: dc.l Entry @@ -43,8 +45,8 @@ MainLoop: if 0 ;; test move.b #'B',d2 - move.l #32,d0 ; xpos - move.l #100,d1 ; ypos + move.l #16,d0 ; xpos + move.l #0,d1 ; ypos move.l onscreen,a0 jsr BlitChar8 bra MainLoop @@ -62,14 +64,14 @@ MainLoop: .moreText: move.b (a3)+,d2 move.l #BITPLANE_WIDTH-16,d0 ; xpos - move.l #16,d1 ; ypos + move.l #Y_POS,d1 ; ypos move.l onscreen,a0 jsr BlitChar8 move.l #0,shiftcounter .shift: move.l onscreen,a0 move.l #FONT_HEIGHT,d1 - move.l #16,d2 + move.l #Y_POS,d2 jsr BlitScroll add.l #1,shiftcounter