******************************************************************************* * font.library.S Written by Readysoft. * Copyright 1992,1993,1994 RS. All rights reserved. 1992.05.08.-1994.05.18. * v2.4. ******************************************************************************* ******************************************************************************* * Macros ******************************************************************************* ;------------------------------------------------------------------------------ ; FontName Macro ;------------------------------------------------------------------------------ FNT.NAM MACRO DC.B 'font.library',0 EVEN ENDM ;------------------------------------------------------------------------------ ; FontObject Macro ;------------------------------------------------------------------------------ FNT.OBJ MACRO DC.W \1 ItemNum ENDM ;------------------------------------------------------------------------------ ; FontObjItem Macro ;------------------------------------------------------------------------------ FNT.OI MACRO DC.W \1,\2 dXPos,dYPos DC.B \3,\4 FontCode,Image ENDM ;------------------------------------------------------------------------------ ; FontText Macro ;------------------------------------------------------------------------------ FNT.TXT MACRO DC.W \1 ItemNum ENDM ;------------------------------------------------------------------------------ ; FontTextItem Macro ;------------------------------------------------------------------------------ FNT.TI MACRO DC.W \1,\2 dXPos,dYPos DC.B \3,0 FontCode DC.L \4 StringPtr ENDM ******************************************************************************* * LIB Macro ******************************************************************************* FNT.LIB MACRO ******************************************************************************* * Constant Definitions ******************************************************************************* ;------------------------------------------------------------------------------ ; FontHeader Structure ;------------------------------------------------------------------------------ RSRESET fnt_fh_Ident RS.L 1 identifier word 'FONT' fnt_fh_Version RS.L 1 version code fnt_fh_Size RS.L 1 font size fnt_fh_ImageDS RS.L 1 image data size fnt_fh_AnImgDS RS.L 1 animage data size fnt_fh_AnimDS RS.L 1 anim data size fnt_fh_GfxDS RS.L 1 gfx data size fnt_fh_MaskDS RS.L 1 mask data size fnt_fh_NextBPl RS.L 1 offs of next bitplane fnt_fh_NextRaw RS.W 1 offs of next raw fnt_fh_Width RS.W 1 gfx width in pixel fnt_fh_Height RS.W 1 gfx height in pixel fnt_fh_Depth RS.W 1 number of bitplanes fnt_fh_Images RS.B 1 number of images fnt_fh_AnImgs RS.B 1 number of anim images fnt_fh_Anims RS.B 1 number of anims fnt_fh_Inited RS.B 1 initialized fnt_fh_ImageDP RS.L 1 image data ptr fnt_fh_AnImgDP RS.L 1 animage data ptr fnt_fh_AnimDP RS.L 1 anim data ptr fnt_fh_GfxDP RS.L 1 gfx data ptr fnt_fh_MaskDP RS.L 1 mask data ptr fnt_fh_IndexT RS.B 256 index table fnt_fh_ImageT RS.B 256 image table fnt_fh_AnImgT RS.B 256 animage table fnt_fh_SizeOf RS.B 0 ;------------------------------------------------------------------------------ ; FontImage Structure ;------------------------------------------------------------------------------ RSRESET fnt_im_Code RS.B 1 identifier code fnt_im_NotUsed RS.B 3 not used area fnt_im_XPos RS.W 1 all in pixel fnt_im_YPos RS.W 1 fnt_im_Width RS.W 1 fnt_im_Height RS.W 1 fnt_im_Mask RS.L 1 blitter mask fnt_im_Offs RS.L 1 data offs fnt_im_OffsDesc RS.L 1 data offs in Desc mode fnt_im_Shift RS.B 1 shift value fnt_im_MaxShR RS.B 1 max. shift right fnt_im_WWidth RS.W 1 width in word fnt_im_Modulo RS.W 1 blitter gfx/mask modulo fnt_im_BlitSize RS.W 1 blitter size fnt_im_SizeOf RS.B 0 IF fnt_im_SizeOf<>32 PRINTT '** Incorrect fnt_im_SizeOf !' ENDC ;------------------------------------------------------------------------------ ; FontAnim Structure ;------------------------------------------------------------------------------ RSRESET fnt_an_Code RS.B 1 identifier code fnt_an_Speed RS.B 1 speed (vblank/change) fnt_an_SpeedCnt RS.B 1 speed counter fnt_an_PhaseCnt RS.B 1 phase counter fnt_an_Queue RS.L 1 ptr to image queue fnt_an_SizeOf RS.B 0 IF fnt_an_SizeOf<>8 PRINTT '** Incorrect fnt_an_SizeOf !' ENDC ;------------------------------------------------------------------------------ ; FontObject Structure ;------------------------------------------------------------------------------ RSRESET fnt_ob_ItemNum RS.W 1 # of objitems fnt_ob_ObjItems RS.B 0 sequence of objitems fnt_ob_SizeOf RS.B 0 ;------------------------------------------------------------------------------ ; FontObjItem Structure ;------------------------------------------------------------------------------ RSRESET fnt_oi_dXPos RS.W 1 screen dxpos fnt_oi_dYPos RS.W 1 screen dypos fnt_oi_FontCode RS.B 1 font code fnt_oi_Image RS.B 1 image code fnt_oi_SizeOf RS.B 0 ;------------------------------------------------------------------------------ ; FontText Structure ;------------------------------------------------------------------------------ RSRESET fnt_tx_ItemNum RS.W 1 # of txtitems fnt_tx_TxtItems RS.B 0 sequence of txtitems fnt_tx_SizeOf RS.B 0 ;------------------------------------------------------------------------------ ; FontTextItem Structure ;------------------------------------------------------------------------------ RSRESET fnt_ti_dXPos RS.W 1 screen dxpos fnt_ti_dYPos RS.W 1 screen dypos fnt_ti_FontCode RS.B 1 font code fnt_ti_NotUsed RS.B 1 not used fnt_ti_String RS.L 0 string pointer fnt_ti_SizeOf RS.B 0 ;------------------------------------------------------------------------------ ; Index Codes ;------------------------------------------------------------------------------ fnt_in_NotUsed EQU 0 fnt_in_Image EQU 1 fnt_in_Anim EQU 2 ;------------------------------------------------------------------------------ ; AnimControl Codes ;------------------------------------------------------------------------------ fnt_ac_End EQU 0 end of queue fnt_ac_Wait EQU 1 wait fnt_ac_Speed EQU 2 set speed ;------------------------------------------------------------------------------ ; Error Codes ;------------------------------------------------------------------------------ fnt_er_OK EQU $00000000 all right fnt_er_NoFont EQU $00820001 not a font header fnt_er_Version EQU $00820002 different version fnt_er_Inited EQU $00820003 not initialized fnt_er_Code EQU $00820004 incorrect code fnt_er_Index EQU $00820005 undefined index fnt_er_UnDef EQU $8082ffff undefined error ******************************************************************************* * Varibles ******************************************************************************* RSRESET fnt_FontTable RS.L 256 font pointers fnt_Image RS.B fnt_im_SizeOf image data buffer fnt_SizeOf RS.B 0 ******************************************************************************* * Routine Offsets ******************************************************************************* RSRESET RS.B -6 fnt_Init RS.B -6 fnt_InitFont RS.B -6 fnt_WriteImage RS.B -6 fnt_WriteObject RS.B -6 fnt_WriteString RS.B -6 fnt_WriteText RS.B -6 fnt_ClearImage RS.B -6 fnt_ClearObject RS.B -6 fnt_ClearString RS.B -6 fnt_ClearText RS.B -6 fnt_TBWrtImage RS.B -6 fnt_TBWrtObject RS.B -6 fnt_TBWrtString RS.B -6 fnt_TBWrtText RS.B -6 fnt_TBClrImage RS.B -6 fnt_TBClrObject RS.B -6 fnt_TBClrString RS.B -6 fnt_TBClrText RS.B -6 fnt_GetImage RS.B -6 fnt_CutImage RS.B -6 fnt_AnimStep RS.B -6 fnt_AskFontAddr RS.B -6 ******************************************************************************* * Code ******************************************************************************* jmp fnt.AskFontAddr jmp fnt.AnimStep jmp fnt.CutImage jmp fnt.GetImage jmp fnt.TBClrText jmp fnt.TBClrString jmp fnt.TBClrObject jmp fnt.TBClrImage jmp fnt.TBWrtText jmp fnt.TBWrtString jmp fnt.TBWrtObject jmp fnt.TBWrtImage jmp fnt.ClearText jmp fnt.ClearString jmp fnt.ClearObject jmp fnt.ClearImage jmp fnt.WriteText jmp fnt.WriteString jmp fnt.WriteObject jmp fnt.WriteImage jmp fnt.InitFont jmp fnt.Init font.lib BLK.B fnt_SizeOf,0 EVEN ;------------------------------------------------------------------------------ ; Init NoOp ;------------------------------------------------------------------------------ fnt.Init movem.l d0/a0/a5,-(a7) lea font.lib(pc),a5 move.l a5,a0 clear varible area move.w #fnt_SizeOf-1,d0 .Clear clr.b (a0)+ dbf d0,.Clear movem.l (a7)+,d0/a0/a5 rts ;------------------------------------------------------------------------------ ; InitFont FontCode,PublicData,ChipData(d1,a0,a1) --> Error(d0) ;------------------------------------------------------------------------------ fnt.InitFont movem.l d1-a6,-(a7) lea font.lib(pc),a5 tst.b d1 correct code ? beq .CodeErr moveq #0,d4 move.b d1,d4 lsl.w #2,d4 Code * 4 lea fnt_FontTable(a5),a4 tst.l 0(a4,d4.w) free code ? bne .CodeErr cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) already initialized ? bne .Inited move.b d1,fnt_fh_Inited(a0) store FontCode move.l a0,d0 adda.l #fnt_fh_SizeOf,d0 move.l d0,fnt_fh_ImageDP(a0) --> ImageDP adda.l fnt_fh_ImageDS(a0),d0 move.l d0,fnt_fh_AnImgDP(a0) --> AnImgDP adda.l fnt_fh_AnImgDS(a0),d0 move.l d0,fnt_fh_AnimDP(a0) --> AnimDP adda.l fnt_fh_AnimDS(a0),d0 move.l a1,d1 tst.l d1 sliced font ? bne.s .Sliced move.l d0,d1 .Sliced move.l d1,fnt_fh_GfxDP(a0) --> GfxDP adda.l fnt_fh_GfxDS(a0),d1 move.l d1,fnt_fh_MaskDP(a0) --> MaskDP .Images move.l fnt_fh_ImageDP(a0),a1 initializing images lea fnt_fh_IndexT(a0),a2 lea fnt_fh_ImageT(a0),a3 moveq #0,d7 .NextIm cmpi.b fnt_fh_Images(a0),d7 end ? beq.s .AnImgs bsr fnt.InitImage initialize image moveq #0,d0 move.b fnt_im_Code(a1),d0 move.b #fnt_in_Image,0(a2,d0.w) Type --> IndexTable move.b d7,0(a3,d0.w) Code --> ImageTable lea fnt_im_SizeOf(a1),a1 next image addq.b #1,d7 bra.s .NextIm .AnImgs move.l fnt_fh_AnImgDP(a0),a1 initializing animages lea fnt_fh_AnImgT(a0),a3 moveq #0,d7 .NextAIm cmpi.b fnt_fh_AnImgs(a0),d7 end ? beq.s .Anims bsr fnt.InitImage initialize image moveq #0,d0 move.b fnt_im_Code(a1),d0 move.b d7,0(a3,d0.w) Code --> AnImageTbl lea fnt_im_SizeOf(a1),a1 next image addq.b #1,d7 bra.s .NextAIm .Anims move.l fnt_fh_AnimDP(a0),a1 initializing anims lea fnt_fh_IndexT(a0),a2 lea fnt_fh_ImageT(a0),a3 lea fnt_fh_AnImgT(a0),a4 move.l a0,d6 font address moveq #0,d7 .NextAnim cmpi.b fnt_fh_Anims(a0),d7 beq .OK add.l d6,fnt_an_Queue(a1) relocate queue addr. moveq #0,d0 move.b fnt_an_Code(a1),d0 move.b #fnt_in_Anim,0(a2,d0.w) Type --> IndexTable move.l fnt_an_Queue(a1),a6 moveq #0,d1 move.b (a6),d1 first item code move.b 0(a4,d1.w),0(a3,d0.w) Code --> CodeTable lea fnt_an_SizeOf(a1),a1 addq.b #1,d7 bra .NextAnim .OK moveq #0,d1 move.b fnt_fh_Inited(a0),d1 restore FontCode st fnt_fh_Inited(a0) initialized .Inited lsl.w #2,d1 Code * 4 lea fnt_FontTable(a5),a1 insert font into move.l a0,0(a1,d1.w) FontTable moveq #0,d0 all right .Exit movem.l (a7)+,d1-a6 rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .CodeErr move.l #fnt_er_Code,d0 incorrect code bra.s .Exit ;------------------------------------------------------------------------------ ; WriteImage Image,FontCode,XPos,YPos,Screen(d0,d1,d2,d3,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.WriteImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr and.l #$ff,d0 and.l #$ffff,d2 and.l #$ffff,d3 lea fnt_fh_IndexT(a0),a1 address of index table move.b 0(a1,d0.w),d1 index lea fnt_fh_ImageT(a0),a1 move.b 0(a1,d0.w),d0 code cmpi.b #fnt_in_Image,d1 Image ? beq.s .Image cmpi.b #fnt_in_Anim,d1 Anim ? beq.s .AnImage bra .IndexErr .Image move.l fnt_fh_ImageDP(a0),a1 bra.s .DataOK .AnImage move.l fnt_fh_AnImgDP(a0),a1 .DataOK lsl.l #5,d0 ImageNum*fnt_im_SizeOf adda.l d0,a1 bsr fnt.BlitImage move.w fnt_im_Width(a1),d0 movem.l (a7)+,d1-a6 add.w d0,d2 XPos := XPos+Width moveq #0,d0 all right rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .IndexErr move.l #fnt_er_Index,d0 undefined index .Exit movem.l (a7)+,d1-a6 rts ;------------------------------------------------------------------------------ ; WriteObject XPos,YPos,Object,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.WriteObject movem.l d1/d7/a1,-(a7) moveq #0,d0 moveq #0,d1 move.w (a1)+,d7 # of objitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Image bsr fnt.WriteImage movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop .Exit movem.l (a7)+,d1/d7/a1 rts ;------------------------------------------------------------------------------ ; WriteString FontCode,XPos,YPos,String,Screen(d1,d2,d3,a0,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.WriteString move.l a0,-(a7) .Loop move.b (a0)+,d0 next char beq.s .Exit end if null bsr fnt.WriteImage tst.b d0 error ? beq.s .Loop .Exit move.l (a7)+,a0 rts ;------------------------------------------------------------------------------ ; WriteText XPos,YPos,Text,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.WriteText movem.l d7/a0-a1,-(a7) moveq #0,d0 move.w (a1)+,d7 # of txtitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Not Used move.l (a1)+,a0 String bsr fnt.WriteString movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop next txtitem .Exit movem.l (a7)+,d7/a0-a1 rts ;------------------------------------------------------------------------------ ; ClearImage Image,FontCode,XPos,YPos,Screen(d0,d1,d2,d3,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.ClearImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr and.l #$ff,d0 and.l #$ffff,d2 and.l #$ffff,d3 lea fnt_fh_IndexT(a0),a1 address of index table move.b 0(a1,d0.w),d1 index lea fnt_fh_ImageT(a0),a1 move.b 0(a1,d0.w),d0 code cmpi.b #fnt_in_Image,d1 Image ? beq.s .Image cmpi.b #fnt_in_Anim,d1 Anim ? beq.s .AnImage bra .IndexErr .Image move.l fnt_fh_ImageDP(a0),a1 bra.s .DataOK .AnImage move.l fnt_fh_AnImgDP(a0),a1 .DataOK lsl.l #5,d0 ImageNum*fnt_im_SizeOf adda.l d0,a1 bsr fnt.ClearPlanes move.w fnt_im_Width(a1),d0 movem.l (a7)+,d1-a6 add.w d0,d2 XPos := XPos+Width moveq #0,d0 all right rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .IndexErr move.l #fnt_er_Index,d0 undefined index .Exit movem.l (a7)+,d1-a6 rts ;------------------------------------------------------------------------------ ; ClearObject XPos,YPos,Object,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.ClearObject movem.l d1/d7/a1,-(a7) moveq #0,d0 moveq #0,d1 move.w (a1)+,d7 # of objitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Image bsr fnt.ClearImage movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop .Exit movem.l (a7)+,d1/d7/a1 rts ;------------------------------------------------------------------------------ ; ClearString FontCode,XPos,YPos,String,Screen(d1,d2,d3,a0,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.ClearString move.l a0,-(a7) .Loop move.b (a0)+,d0 next char beq.s .Exit end if null bsr fnt.ClearImage tst.b d0 error ? beq.s .Loop .Exit move.l (a7)+,a0 rts ;------------------------------------------------------------------------------ ; ClearText XPos,YPos,Text,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.ClearText movem.l d6-d7/a0-a1,-(a7) moveq #0,d0 moveq #0,d6 move.w (a1)+,d7 # of txtitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d6 StrLen move.l a1,a0 String bsr fnt.ClearString movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit lea 0(a1,d6.w),a1 next txtitem dbf d7,.Loop .Exit movem.l (a7)+,d6-d7/a0-a1 rts ;------------------------------------------------------------------------------ ; TBWrtImage Image,FontCode,XPos,YPos,Screen(d0,d1,d2,d3,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBWrtImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr and.l #$ff,d0 and.l #$ffff,d2 and.l #$ffff,d3 lea fnt_fh_IndexT(a0),a1 address of index table move.b 0(a1,d0.w),d1 index lea fnt_fh_ImageT(a0),a1 move.b 0(a1,d0.w),d0 code cmpi.b #fnt_in_Image,d1 Image ? beq.s .Image cmpi.b #fnt_in_Anim,d1 Anim ? beq.s .AnImage bra .IndexErr .Image move.l fnt_fh_ImageDP(a0),a1 bra.s .DataOK .AnImage move.l fnt_fh_AnImgDP(a0),a1 .DataOK lsl.l #5,d0 ImageNum*fnt_im_SizeOf adda.l d0,a1 bsr fnt.TestBorder test border cmpa.l #0,a1 out of border ? beq.s .Exit bsr fnt.BlitImage move.w fnt_im_Width(a1),d0 movem.l (a7)+,d1-a6 add.w d0,d2 XPos := XPos+Width moveq #0,d0 all right rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .IndexErr move.l #fnt_er_Index,d0 undefined index .Exit movem.l (a7)+,d1-a6 rts ;------------------------------------------------------------------------------ ; TBWrtObject XPos,YPos,Object,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBWrtObject movem.l d1/d7/a1,-(a7) moveq #0,d0 moveq #0,d1 move.w (a1)+,d7 # of objitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Image bsr fnt.TBWrtImage movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop .Exit movem.l (a7)+,d1/d7/a1 rts ;------------------------------------------------------------------------------ ; TBWrtString FontCode,XPos,YPos,String,Screen(d1,d2,d3,a0,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBWrtString move.l a0,-(a7) .Loop move.b (a0)+,d0 next char beq.s .Exit end if null bsr fnt.TBWrtImage tst.b d0 error ? beq.s .Loop .Exit move.l (a7)+,a0 rts ;------------------------------------------------------------------------------ ; TBWrtText XPos,YPos,Text,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBWrtText movem.l d7/a0-a1,-(a7) moveq #0,d0 move.w (a1)+,d7 # of txtitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Not Used move.l (a1)+,a0 String bsr fnt.TBWrtString movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop next txtitem .Exit movem.l (a7)+,d7/a0-a1 rts ;------------------------------------------------------------------------------ ; TBClrImage Image,FontCode,XPos,YPos,Screen(d0,d1,d2,d3,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBClrImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr and.l #$ff,d0 and.l #$ffff,d2 and.l #$ffff,d3 lea fnt_fh_IndexT(a0),a1 address of index table move.b 0(a1,d0.w),d1 index lea fnt_fh_ImageT(a0),a1 move.b 0(a1,d0.w),d0 code cmpi.b #fnt_in_Image,d1 Image ? beq.s .Image cmpi.b #fnt_in_Anim,d1 Anim ? beq.s .AnImage bra .IndexErr .Image move.l fnt_fh_ImageDP(a0),a1 bra.s .DataOK .AnImage move.l fnt_fh_AnImgDP(a0),a1 .DataOK lsl.l #5,d0 ImageNum*fnt_im_SizeOf adda.l d0,a1 bsr fnt.TestBorder test border cmpa.l #0,a1 out of border ? beq.s .Exit bsr fnt.ClearPlanes move.w fnt_im_Width(a1),d0 movem.l (a7)+,d1-a6 add.w d0,d2 XPos := XPos+Width moveq #0,d0 all right rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .IndexErr move.l #fnt_er_Index,d0 undefined index .Exit movem.l (a7)+,d1-a6 rts ;------------------------------------------------------------------------------ ; TBClrObject XPos,YPos,Object,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBClrObject movem.l d1/d7/a1,-(a7) moveq #0,d0 moveq #0,d1 move.w (a1)+,d7 # of objitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d0 Image bsr fnt.TBClrImage movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit dbf d7,.Loop .Exit movem.l (a7)+,d1/d7/a1 rts ;------------------------------------------------------------------------------ ; TBClrString FontCode,XPos,YPos,String,Screen(d1,d2,d3,a0,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBClrString move.l a0,-(a7) .Loop move.b (a0)+,d0 next char beq.s .Exit end if null bsr fnt.TBClrImage tst.b d0 error ? beq.s .Loop .Exit move.l (a7)+,a0 rts ;------------------------------------------------------------------------------ ; TBClrText XPos,YPos,Text,Screen(d2,d3,a1,a2) --> Error(d0) ;------------------------------------------------------------------------------ fnt.TBClrText movem.l d6-d7/a0-a1,-(a7) moveq #0,d0 moveq #0,d6 move.w (a1)+,d7 # of txtitems beq.s .Exit subq.w #1,d7 .Loop movem.l d2-d3,-(a7) store XPos,YPos add.w (a1)+,d2 dXPos add.w (a1)+,d3 dYPos move.b (a1)+,d1 FontCode move.b (a1)+,d6 StrLen move.l a1,a0 String bsr fnt.TBClrString movem.l (a7)+,d2-d3 restore XPos,YPos tst.l d0 error ? bne.s .Exit lea 0(a1,d6.w),a1 next txtitem dbf d7,.Loop .Exit movem.l (a7)+,d6-d7/a0-a1 rts ;------------------------------------------------------------------------------ ; GetImage Image,FontCode,Buffer(d0,d1,a0) --> Error(d0) ;------------------------------------------------------------------------------ fnt.GetImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 move.l a0,a2 store Buffer address lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr and.l #$ff,d0 lea fnt_fh_IndexT(a0),a1 address of index table move.b 0(a1,d0.w),d1 index lea fnt_fh_ImageT(a0),a1 move.b 0(a1,d0.w),d0 code cmpi.b #fnt_in_Image,d1 Image ? beq.s .Image cmpi.b #fnt_in_Anim,d1 Anim ? beq.s .AnImage bra .IndexErr .Image move.l fnt_fh_ImageDP(a0),a1 bra.s .DataOK .AnImage move.l fnt_fh_AnImgDP(a0),a1 .DataOK lsl.l #5,d0 ImageNum*fnt_im_SizeOf adda.l d0,a1 moveq #fnt_im_SizeOf-1,d7 copy image data .CopyImage move.b (a1)+,(a2)+ into Buffer dbf d7,.CopyImage moveq #0,d0 all right .Exit movem.l (a7)+,d1-a6 rts .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .IndexErr move.l #fnt_er_Index,d0 undefined index bra.s .Exit ;------------------------------------------------------------------------------ ; CutImage Buffer,FontCode,XPos,YPos,Screen(a0,d1,d2,d3,a2) ;------------------------------------------------------------------------------ fnt.CutImage movem.l d1-a6,-(a7) lea font.lib(pc),a5 move.l a0,a1 store Buffer address lea fnt_FontTable(a5),a0 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a0,d1.w),a0 Font address in a0 bsr fnt.InitImage bsr fnt.BlitImage move.w fnt_im_Width(a1),d0 movem.l (a7)+,d1-a6 add.w d0,d2 XPos := XPos+Width moveq #0,d0 all right rts ;------------------------------------------------------------------------------ ; AnimStep FontCode(d1) --> Error(d0) ;------------------------------------------------------------------------------ fnt.AnimStep movem.l d1/d7/a0-a5,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a1 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a1,d1.w),a0 Font address in a0 cmpi.l #'FONT',fnt_fh_Ident(a0) real font data ? bne .NoFont cmpi.l #'v2.4',fnt_fh_Version(a0) version OK ? bne .VersErr tst.b fnt_fh_Inited(a0) initialized ? beq .InitErr move.l fnt_fh_AnimDP(a0),a1 lea fnt_fh_ImageT(a0),a2 lea fnt_fh_AnImgT(a0),a3 moveq #0,d7 .NextAnim cmpi.b fnt_fh_Anims(a0),d7 beq .OK tst.b fnt_an_SpeedCnt(a1) bne.s .NoChange move.b fnt_an_Speed(a1),d0 move.b d0,fnt_an_SpeedCnt(a1) move.l fnt_an_Queue(a1),a4 .NextCode moveq #0,d1 move.b fnt_an_PhaseCnt(a1),d1 phase moveq #0,d0 move.b 0(a4,d1.w),d0 current code bne.s .CodeOK move.b 1(a4,d1.w),d0 control code after 0 cmpi.b #fnt_ac_End,d0 end ? beq.s .End cmpi.b #fnt_ac_Wait,d0 wait ? beq.s .Wait cmpi.b #fnt_ac_Speed,d0 speed ? beq.s .Speed addq.b #2,fnt_an_PhaseCnt(a1) unknown code bra.s .NextCode .End clr.b fnt_an_PhaseCnt(a1) end of queue bra.s .NextCode .Wait move.b 2(a4,d1.w),d0 parameter move.b d0,fnt_an_SpeedCnt(a1) wait addq.b #3,fnt_an_PhaseCnt(a1) bra.s .NoChange .Speed move.b 2(a4,d1.w),d0 parameter move.b d0,fnt_an_Speed(a1) set speed addq.b #3,fnt_an_PhaseCnt(a1) bra.s .NoChange .CodeOK moveq #0,d1 move.b fnt_an_Code(a1),d1 move.b 0(a3,d0.w),0(a2,d1.w) Code --> ImageTbl addq.b #1,fnt_an_PhaseCnt(a1) .NoChange subq.b #1,fnt_an_SpeedCnt(a1) lea fnt_an_SizeOf(a1),a1 addq.b #1,d7 bra .NextAnim .NoFont move.l #fnt_er_NoFont,d0 not a font header bra.s .Exit .VersErr move.l #fnt_er_Version,d0 different version bra.s .Exit .InitErr move.l #fnt_er_Inited,d0 not initialized bra.s .Exit .OK move.l #fnt_er_OK,d0 all right .Exit movem.l (a7)+,d1/d7/a0-a5 rts ;------------------------------------------------------------------------------ ; AskFontAddr FontCode(d1) --> Address(a0) ;------------------------------------------------------------------------------ fnt.AskFontAddr movem.l d1/a5,-(a7) lea font.lib(pc),a5 lea fnt_FontTable(a5),a0 and.l #$ff,d1 lsl.w #2,d1 Code * 4 move.l 0(a0,d1.w),a0 CodeTable movem.l (a7)+,d1/a5 rts ******************************************************************************* * Private Routines ******************************************************************************* ;------------------------------------------------------------------------------ ; InitImage ;------------------------------------------------------------------------------ fnt.InitImage movem.l d0-d2,-(a7) move.w fnt_im_XPos(a1),d0 and.b #$f,d0 move.b d0,fnt_im_Shift(a1) --> Shift move.w fnt_im_XPos(a1),d0 move.w d0,d1 add.w fnt_im_Width(a1),d0 lsr.w #4,d0 lsr.w #4,d1 sub.w d1,d0 bne.s .Wide addq.w #1,d0 .Wide addq.w #1,d0 move.w d0,fnt_im_WWidth(a1) --> WordWidth move.w fnt_fh_NextRaw(a0),d0 sub.w fnt_im_WWidth(a1),d0 sub.w fnt_im_WWidth(a1),d0 move.w d0,fnt_im_Modulo(a1) --> Modulo move.w fnt_im_Height(a1),d0 lsl.w #6,d0 add.w fnt_im_WWidth(a1),d0 move.w d0,fnt_im_BlitSize(a1) --> BlitSize move.l #$ffffffff,d0 moveq #0,d1 move.w fnt_im_XPos(a1),d1 and.w #$f,d1 lsr.w d1,d0 swap d0 move.w fnt_im_XPos(a1),d1 add.w fnt_im_Width(a1),d1 and.w #$f,d1 moveq #16,d2 sub.b d1,d2 move.b d2,fnt_im_MaxShR(a1) --> MaxShiftR lsl.w d2,d0 move.w fnt_im_XPos(a1),d1 move.w d1,d2 add.w fnt_im_Width(a1),d2 and.w #$fff0,d1 and.w #$fff0,d2 cmp.w d1,d2 bne.s .Wide2 move.w d0,d1 swap d0 and.w d1,d0 swap d0 clr.w d0 .Wide2 move.l d0,fnt_im_Mask(a1) --> Mask move.w fnt_fh_NextRaw(a0),d0 mulu fnt_im_YPos(a1),d0 moveq #0,d1 move.w fnt_im_XPos(a1),d1 lsr.w #3,d1 bclr #0,d1 add.l d1,d0 move.l d0,fnt_im_Offs(a1) --> Offs move.w fnt_im_Height(a1),d0 subq.w #1,d0 mulu fnt_fh_NextRaw(a0),d0 moveq #0,d1 move.w fnt_im_WWidth(a1),d1 add.l d1,d0 add.l d1,d0 subq.l #2,d0 add.l fnt_im_Offs(a1),d0 move.l d0,fnt_im_OffsDesc(a1) --> OffsDesc movem.l (a7)+,d0-d2 rts ;------------------------------------------------------------------------------ ; BlitImage ;------------------------------------------------------------------------------ fnt.BlitImage move.w fnt_fh_Depth(a0),d0 # of font planes cmp.w inl_sc_Depth(a2),d0 # of screen planes ble.s .DepthOK move.w inl_sc_Depth(a2),d0 .DepthOK move.l d2,d7 XPos move.l inl_sc_BitPlane(a2),a3 muls inl_sc_NextRaw(a2),d3 YPos * NextRaw ext.l d2 asr.l #4,d2 XPos / 16 asl.l #1,d2 add.l d2,d3 adda.l d3,a3 and.l #$f,d7 0..15 --> ScrShift sub.b fnt_im_Shift(a1),d7 ScrShift-fc.Shift bmi .Left Desc Mode beq .NoShift No Shift cmp.b fnt_im_MaxShR(a1),d7 Normal Mode ble .Right .RightSl move.l fnt_im_Offs(a1),a4 move.l a4,a5 adda.l fnt_fh_GfxDP(a0),a4 A4 : BLTBPT adda.l fnt_fh_MaskDP(a0),a5 A5 : BLTAPT ror.w #4,d7 move.l #$0fca0000,d1 or.l d7,d1 swap d7 or.l d7,d1 D1 : BLTCON01 move.l fnt_im_Mask(a1),d2 D2 : BLTAFWM,BLTALWM clr.w d2 move.w inl_sc_NextRaw(a2),d3 sub.w fnt_im_WWidth(a1),d3 sub.w fnt_im_WWidth(a1),d3 D3 : BLTCMOD,BLTDMOD move.w fnt_im_Modulo(a1),d4 D4 : BLTAMOD,BLTBMOD move.w fnt_im_BlitSize(a1),d5 D5 : BLTSIZE move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl move.l fnt_fh_NextBPl(a0),d7 D7 : GfxNextBPl bsr fnt.BlitPlanes moveq #0,d2 move.w fnt_im_WWidth(a1),d2 subq.w #1,d2 lsl.w #1,d2 add.l d2,a3 add.l d2,a4 add.l d2,a5 subq.w #2,d2 add.w d2,d3 add.w d2,d4 move.l fnt_im_Mask(a1),d2 D2 : BLTAFWM,BLTALWM swap d2 clr.w d2 and.w #$ffc0,d5 or.w #$0002,d5 bsr fnt.BlitPlanes bra .OK .Right move.l fnt_im_Offs(a1),a4 move.l a4,a5 adda.l fnt_fh_GfxDP(a0),a4 A4 : BLTBPT adda.l fnt_fh_MaskDP(a0),a5 A5 : BLTAPT ror.w #4,d7 move.l #$0fca0000,d1 or.l d7,d1 swap d7 or.l d7,d1 D1 : BLTCON01 move.l fnt_im_Mask(a1),d2 D2 : BLTAFWM,BLTALWM move.w inl_sc_NextRaw(a2),d3 sub.w fnt_im_WWidth(a1),d3 sub.w fnt_im_WWidth(a1),d3 D3 : BLTCMOD,BLTDMOD move.w fnt_im_Modulo(a1),d4 D4 : BLTAMOD,BLTBMOD move.w fnt_im_BlitSize(a1),d5 D5 : BLTSIZE move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl move.l fnt_fh_NextBPl(a0),d7 D7 : GfxNextBPl bsr fnt.BlitPlanes bra .OK .Left move.w fnt_im_Height(a1),d6 Height in pixel subq.w #1,d6 mulu inl_sc_NextRaw(a2),d6 moveq #0,d5 move.w fnt_im_WWidth(a1),d5 Width in word lsl.w #1,d5 add.l d6,d5 adda.l d5,a3 subq.l #2,a3 A3 : BLTCPT,BLTDPT move.l fnt_im_OffsDesc(a1),a4 move.l a4,a5 adda.l fnt_fh_GfxDP(a0),a4 A4 : BLTBPT adda.l fnt_fh_MaskDP(a0),a5 A5 : BLTAPT neg.b d7 ror.w #4,d7 move.l #$0fca0002,d1 or.l d7,d1 swap d7 or.l d7,d1 D1 : BLTCON01 move.l fnt_im_Mask(a1),d2 swap d2 D2 : BLTAFWM,BLTALWM move.w inl_sc_NextRaw(a2),d3 sub.w fnt_im_WWidth(a1),d3 sub.w fnt_im_WWidth(a1),d3 D3 : BLTCMOD,BLTDMOD move.w fnt_im_Modulo(a1),d4 D4 : BLTAMOD,BLTBMOD move.w fnt_im_BlitSize(a1),d5 D5 : BLTSIZE move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl move.l fnt_fh_NextBPl(a0),d7 D7 : GfxNextBPl bsr fnt.BlitPlanes bra .OK .NoShift cmp.b #16,fnt_im_MaxShR(a1) beq .Narrow move.l fnt_im_Offs(a1),a4 move.l a4,a5 adda.l fnt_fh_GfxDP(a0),a4 A4 : BLTBPT adda.l fnt_fh_MaskDP(a0),a5 A5 : BLTAPT move.l #$0fca0000,d1 D1 : BLTCON01 move.l fnt_im_Mask(a1),d2 D2 : BLTAFWM,BLTALWM move.w inl_sc_NextRaw(a2),d3 sub.w fnt_im_WWidth(a1),d3 sub.w fnt_im_WWidth(a1),d3 D3 : BLTCMOD,BLTDMOD move.w fnt_im_Modulo(a1),d4 D4 : BLTAMOD,BLTBMOD move.w fnt_im_BlitSize(a1),d5 D5 : BLTSIZE move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl move.l fnt_fh_NextBPl(a0),d7 D7 : GfxNextBPl bsr fnt.BlitPlanes bra .OK .Narrow move.l fnt_im_Offs(a1),a4 move.l a4,a5 adda.l fnt_fh_GfxDP(a0),a4 A4 : BLTBPT adda.l fnt_fh_MaskDP(a0),a5 A5 : BLTAPT move.l #$0fca0000,d1 D1 : BLTCON01 move.l fnt_im_Mask(a1),d2 D2 : BLTAFWM,BLTALWM move.w inl_sc_NextRaw(a2),d3 sub.w fnt_im_WWidth(a1),d3 sub.w fnt_im_WWidth(a1),d3 D3 : BLTCMOD,BLTDMOD move.w fnt_im_Modulo(a1),d4 D4 : BLTAMOD,BLTBMOD move.w fnt_im_BlitSize(a1),d5 D5 : BLTSIZE move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl move.l fnt_fh_NextBPl(a0),d7 D7 : GfxNextBPl move.w #$ffff,d2 addq.w #2,d3 addq.w #2,d4 subq.w #1,d5 bsr fnt.BlitPlanes .OK rts ;------------------------------------------------------------------------------ ; BlitPlanes ;------------------------------------------------------------------------------ fnt.BlitPlanes movem.l d0-d1/a3-a4/a6,-(a7) subq.w #1,d0 d0 : depth-1 lea $dff000,a6 bsr fnt.WaitBlit tst.l fnt_fh_MaskDS(a0) masked font ? bne.s .Masked and.l #$f7ffffff,d1 bit USEA off move.w #$ffff,$74(a6) BLTADAT .Masked move.l d1,$40(a6) BLTCON01 move.l d2,$44(a6) BLTAFWM,BLTALWM move.w d3,$60(a6) BLTCMOD move.w d3,$66(a6) BLTDMOD move.w d4,$64(a6) BLTAMOD move.w d4,$62(a6) BLTBMOD .Planes bsr fnt.WaitBlit move.l a3,$48(a6) BLTCPT screen move.l a3,$54(a6) BLTDPT screen move.l a4,$4c(a6) BLTBPT data move.l a5,$50(a6) BLTAPT mask move.w d5,$58(a6) BLTSIZE adda.l d6,a3 adda.l d7,a4 dbf d0,.Planes movem.l (a7)+,d0-d1/a3-a4/a6 rts ;------------------------------------------------------------------------------ ; ClearPlanes ;------------------------------------------------------------------------------ fnt.ClearPlanes move.w fnt_fh_Depth(a0),d0 # of font planes cmp.w inl_sc_Depth(a2),d0 # of screen planes ble.s .DepthOK move.w inl_sc_Depth(a2),d0 .DepthOK subq.w #1,d0 move.l d2,d7 XPos move.l inl_sc_BackScr(a2),a3 move.l inl_sc_BitPlane(a3),a3 move.l inl_sc_BitPlane(a2),a4 mulu inl_sc_NextRaw(a2),d3 YPos * NextLine lsr.w #4,d2 XPos / 16 add.l d2,d3 add.l d2,d3 adda.l d3,a3 A3 : BLTAPT adda.l d3,a4 A4 : BLTDPT add.w fnt_im_Width(a1),d7 XPos+Width subq.w #1,d7 lsr.w #4,d7 sub.w d2,d7 addq.w #1,d7 WordWidth move.w fnt_im_BlitSize(a1),d5 and.w #$ffc0,d5 add.w d7,d5 D5 : BLITSIZE lsl.w #1,d7 ByteWidth move.w inl_sc_NextRaw(a2),d3 sub.w d7,d3 D3 : BLTAMOD,BLTDMOD move.l inl_sc_NextBPl(a2),d6 D6 : ScrNextBPl lea $dff000,a6 bsr fnt.WaitBlit move.l #$09f00000,$40(a6) BLTCON01 move.l #$ffffffff,$44(a6) BLTAFWM,BLTALWM move.w d3,$64(a6) BLTAMOD move.w d3,$66(a6) BLTDMOD .Planes bsr fnt.WaitBlit move.l a3,$50(a6) BLTAPT mask move.l a4,$54(a6) BLTDPT screen move.w d5,$58(a6) BLTSIZE adda.l d6,a3 adda.l d6,a4 dbf d0,.Planes rts ;------------------------------------------------------------------------------ ; TestBorder ;------------------------------------------------------------------------------ fnt.TestBorder move.w inl_sc_BPWidth(a2),d0 width in d0 move.w inl_sc_BPHeight(a2),d1 height in d1 subq.w #1,d0 subq.w #1,d1 move.w d2,d4 x1 in d2 move.w d3,d5 y1 in d3 add.w fnt_im_Width(a1),d4 add.w fnt_im_Height(a1),d5 subq.w #1,d4 x2 in d4 subq.w #1,d5 y2 in d5 tst.w d4 x2 < 0 ? bmi.s .Out tst.w d5 y2 < 0 ? bmi.s .Out cmp.w d2,d0 x1 > width ? bmi.s .Out cmp.w d3,d1 y1 > height ? bmi.s .Out move.l a1,a3 copy image data lea fnt_Image(a5),a4 into buffer moveq #fnt_im_SizeOf-1,d7 .CopyImage move.b (a3)+,(a4)+ dbf d7,.CopyImage lea fnt_Image(a5),a1 tst.w d2 x1 < 0 ? bpl.s .X1OK sub.w d2,fnt_im_XPos(a1) fx = fx-x1 add.w d2,fnt_im_Width(a1) fw = fw+x1 clr.w d2 x1 = 0 .X1OK tst.w d3 y1 < 0 ? bpl.s .Y1OK sub.w d3,fnt_im_YPos(a1) fy = fy-y1 add.w d3,fnt_im_Height(a1) fh = fh+y1 clr.w d3 y1 = 0 .Y1OK cmp.w d4,d0 x2 > width ? bpl.s .X2OK add.w d0,fnt_im_Width(a1) fw = fw+width sub.w d4,fnt_im_Width(a1) fw = fw-x2 move.w d0,d4 x2 = width .X2OK cmp.w d5,d1 y2 > height ? bpl.s .Y2OK add.w d1,fnt_im_Height(a1) fh = fh+height sub.w d5,fnt_im_Height(a1) fh = fh-y2 move.w d1,d5 y2 = height .Y2OK bsr fnt.InitImage bra.s .Exit .Out lea $0,a1 out of border .Exit rts ;------------------------------------------------------------------------------ ; WaitBlit NoOp ;------------------------------------------------------------------------------ fnt.WaitBlit btst #14,$dff002 bne.s fnt.WaitBlit rts ******************************************************************************* * Data ******************************************************************************* DC.W -1 ENDM