******************************************************************************* * font.library.I 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 ******************************************************************************* * 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