HomeLine-ABit block transferShow mouse

6.13 Text block transfer

Name: »Text block transfer«
Line-A number: $A008
Syntax: Bindings für text_blt
Description: This Line-A function outputs a single character. The source for the character must have the same buildup as in a GDOS raster font. One can can regard the font data as a large image, whose height corresponds to the character height. All characters lie close to each other in this "image". Additionally a GDOS font contains an offset table, containing the offset for each character in this large image. The parameter ade_lo of the font header contains the first ASCII character for which an image and thus also an offset is present. This offset is to be passed together with the font data to this Line-A function. The Y-offset is usually 0. As Line-A does not manage the fonts itself and also does not know the font header, corresponding parameters for the font data have to be passed. To this must be added a string of other parameters for various effects such as italic..., for instance. The following Line-A variables are used:
Variable Meaning
   
wrt_mode Writing mode, the following are possible:
REPLACE 0 Replace
TRANS 1 Transparent (OR)
XOR 2 Inverse (XOR)
INVERS 3 Inverse Transparent (XOR with not(LN_MASK))
xacc_dda Should be set at each call to $8000
dda_inc Scaling factor
t_sclsts Scaling direction, i.e. whether one is enlarging or reducing
mono_status 1 if all characters have the same width, i.e. we are dealing with a non-proprtional font, else 0
sourcex X-coordinate of the character in font to be output; can be obtained from the offset table
sourcey Y-coordinate of the character in the font, normally 0
destx X-coordinate of the screen position at which the character is to be output
desty Y-coordinate of the screen position at which the character is to be output
delx Width of the character, can also be obtained from the font header
dely Height of the character, can also be obtained from the font header
fbase The pointer to the font data, i.e. the ????????????????????????????
fwidth Width of the font image
style Specifies the text effects; individualbits represent individual effects and may be combined:
Bit 0 Bold
Bit 1 Light
Bit 2 Skewed ("italics")
Bit 3 Underlined (is ignored)
Bit 4 Outlined
litemask A mask for light
skewmask A mask for skewed
weight The width for bold
r_off The right offset for skewed, so more or less a parameter for the "slope" of the character
l_off The left offset for skewed, so more or less a parameter for the "slope" of the character
scale 1, if scaling is desired
chup Rotation angle in 1/10 degree; however, only rotation of multiples of 90 degrees are possible, i.e. values 0, 900, 1800, 2700
text_fg Text colour
text_bg Background colour
scrtchp A buffer that should offer twice as much space as occupied by the character, so that Line-A} can calculate the text effects
scrpt2 An index into the buffer that points to the centre of the buffer, i.e. specifies half of the bufer size
clip 1 if clipping is desired, else 0
xmn_clip X-coordinate of the top left corner of the clipping region, if clipping is switched on
ymn_clip Y-coordinate of the top left corner of the clipping region, if clipping is switched on
xmx_clip X-coordinate of the bottom right corner of the clipping region, if clipping is switched on
ymx_clip Y-coordinate of the bottom right corner of the clipping region, if clipping is switched on


The binding from TC passes a pointer to the font header, flags for scaling, style, rotation vector, foreground and background colour not to the text_blt function, but uses the separate function set_text_blt for setting the parameters in the Line-A parameter block. Data about the font are set automatically.
Return value: The function does not return a result.
Availability: All TOS versions.
See also: Binding   Bit block transfer

6.13.1 Bindings for text_blt

Pure-C: void text_blt( int16_t x, int16_t y, uint8_t c );
Assembler:
movem.l   D0-D2/A0-A2,-(A7)  ; Save registers
move.l    pParamblk,A0       ; Pointer parameter block LINEA
move.w    wmode,(36,A0)      ; Writing mode in LINEA.wrt_mode
move.w    mode,(54,A0)       ; Clip mode in LINEA.clip
move.w    cx1,(56,A0)        ; Top left clip corner, X-coordinate in LINEA.xmn_clip
move.w    cy1,(58,A0)        ; Top left clip corner, Y-coordinate in LINEA.ymn_clip
move.w    cx2,(60,A0)        ; Bottom right clip corner, X-coordinate in LINEA.xmx_clip
move.w    cy2,(62,A0)        ; Bottom right clip corner, Y-coordinate in LINEA.ymx_clip
move.w    #$8000,(64,A0)     ; Put $8000 in xacc_dda
move.w    dda_inc,(66,A0)    ; Scaling factor in LINEA.dda_inc
move.w    t_sclsts,(68,A0)   ; Scaling direction in LINEA.t_sclsts
move.w    mono_status,(70,A0); Proportional font in LINEA.mono_status
move.w    sourcex,(72,A0)    ; X-coordinate in font in LINEA.sourcex
move.w    sourcey,(74,A0)    ; Y-coordinate in font in LINEA.sourcey
move.w    destx,(76,A0)      ; X-destination coordinate LINEA.destx
move.w    desty,(78,A0)      ; Y-destination coordinate in LINEA.desty
move.w    delx,(80,A0)       ; Width of the character in LINEA.delx
move.w    dely,(82,A0)       ; Height of the character LINEA.dely
move.l    fbase,(84,A0)      ; Start of font data in LINEA.fbase
move.w    fwidth,(88,A0)     ; Width of the font image in LINEA.fwidth
move.w    style,(90,A0)      ; Write style in LINEA.style
move.w    litemask,(92,A0)   ; Mask for light in LINEA.litemask
move.w    skewmask,(94,A0)   ; Mask for skewed in LINEA.skewmask
move.w    weight,(96,A0)     ; Width for bold in LINEA.weight
move.w    r_off,(98,A0)      ; Skewed offset right in LINEA.r_off
move.w    l_off,(100,A0)     ; Skewed offset left in LINEA.l_off
move.w    scale,(102,A0)     ; VScaling yes/no in LINEA.scale
move.w    chup,(104,A0)      ; Rotation angle in LINEA.chup
move.w    text_fg,(106,A0)   ; Text colour LINEA.text_fg
move.l    scrtchp,(108,A0)   ; Buffer in LINEA.scrtchp
move.w    scrpt2,(112,A0)    ; Index to mid-buffer in LINEA.scrpt2
move.w    text_bg,(114,A0)   ; Background colour in LINEA.text_bg
dc.w      $A008              ; Line-A opcode
movem.l   (A7)+,D0-D2/A0-A2  ; Restore registers

HomeLine-ABit block transferShow mouse