include "includes.i" xdef DrawText ;; BLTCON? configuration ;; http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node011C.html ;; blitter logic function minterm truth table ;; fill in D column for desired function ;; A(mask) B(bob) C(bg) D(dest) ;; - - - - ;; 0 0 0 0 ;; 0 0 1 1 ;; 0 1 0 0 ;; 0 1 1 1 ;; 1 0 0 0 ;; 1 0 1 0 ;; 1 1 0 1 ;; 1 1 1 1 ;; read D column from bottom up = 11001010 = $ca ;; this is used in the LF? bits BLIT_LF_MINTERM equ $ca BLIT_DEST equ $100 BLIT_SRCC equ $200 BLIT_SRCB equ $400 BLIT_SRCA equ $800 BLIT_ASHIFTSHIFT equ 12 ;Bit index of ASH? bits BLIT_BOB_WIDTH equ 32 ; Must blit extra word to allow shifting BLIT_BOB_HEIGHT equ 10 BLIT_BOB_WIDTH_BYTES equ BLIT_BOB_WIDTH/8 BLIT_BOB_WIDTH_WORDS equ BLIT_BOB_WIDTH/16 blitWait: tst DMACONR(a6) ;for compatibility .waitblit: btst #6,DMACONR(a6) bne.s .waitblit rts ;; blitobject ;; d0 - xpos ;; d1 - ypos ;; d3 - odd character ;; a0 - display ;; a1 - object ;; a2 - mask blitText: movem.l d0-a6,-(sp) bsr blitWait ;; d0 = XPOS ;; d1 = YPOS ;; d3 = odd character ;; d4 = XPOS_BYTES move.w d0,d4 ; d4 = XPOS lsr.w #3,d4 ; d4 = XPOS_BYTES cmp.b #1,d3 bne .evenChar .oddChar sub.w #8,d0 move.w #$00FF,BLTAFWM(a6) ; no mask for first word move.w #$0000,BLTALWM(a6) ; mask out last word sub.l #1,a0 bra .continue .evenChar: move.w #$ff00,BLTAFWM(a6) ; no mask for first word move.w #$0000,BLTALWM(a6) ; mask out last word .continue: ;; this shift will give us the bits to shift (bits 0-3) in bits (12-15) of d0 lsl.w #8,d0 ; BLIT_SOURCE_SHIFT<