•  Back 
  •  Line-A Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-Filev_gtext()
$A008 - TextBlt                                                      Line-A

Function      Blit a single character to the screen.

Parameters    When performing this call, the following Line-A variables
              are evaluated:

              Variable  Meaning

              WRMODE     Writing mode (see comments below).

              CLIP,
              XMINCL,
              YMINCL,
              XMAXCL,
              YMAXCL    Standard clipping flags and extents.

              XDDA      Scaling accumulator (should be initialized to
                        $8000 prior to each TextBlt call when scaling).

              DDAINC    This amount specifies the fractional amount to
                        scale the character outputted by. If scaling down,
                        this value may by found by the formula:

                        0x100 * scaled size / actual size

                        If scaling up, this value may be found with
                        the formula:

                        0x100 * (scaled size - actual size) / actual size

                        This variable is only evaluated if scaling
                        is active.

              SCALDIR   Scaling direction (1 = up, 0 = down).

              MONO      If 1 set to monospacing mode, if 0 set to
                        proportional spacing mode.

              SOURCEX,  SOURCEX is the pixel offset into the font form of
              SOURCEY   the character you wish to render. SOURCEY is
                        usually 0 indicating that you wish to render the
                        character from the top.

              DESTX,    DESTX and DESTY specify the destination screen
              DESTY     coordinates of the character.

              DELX,     DELX and DELY specify the width and height of the
              DELY      character to print.

              FBASE     Pointer to start of font data.

              FWIDTH    Width of font form.

              STYLE     STYLE is a mask of the following bits indicating
                        special effects:

                           0x01 = Bold
                           0x02 = Light
                           0x04 = Italic
                           0x08 = Underlined
                           0x10 = Outlined

              LITEMASK  Mask used to lighten text (usually $5555).

              SKEWMASK  Mask used to italicize text (usually $5555).

              WEIGHT    Width by which to thicken boldface text (should be
                        set from font header).

              ROFF      Offset above character baseline when skewing (set
                        from font header).

              LOFF      Offset below character baseline when skewing (from
                        font header).

              SCALE     Scaling flag (0 = no scaling, 1 = scale text).

              CHUP      Character rotation vector (may be 0, 900, 1800,
                        or 2700).

              TEXTFG    Text foreground color.

              SCRTCHP   Pointer to start of text special effects buffer
                        (should be twice as large as the largest distorted
                        character and is only required when using
                        a special effect).

              SCRPT2    Offset of scaling buffer in SCRTCHP (midpoint).

              TEXTBG    Text background color.

Example       ; Print a NULL-terminated string with
Binding       ; no effects or clipping

                 move.w   #0,36(a5)    ; WRMODE
                 move.w   #0,54(a5)    ; CLIP
                 move.w   #1,106(a5)   ; TEXTFG
                 move.w   #0,114(a5)   ; TEXTBG
                 move.w   #100,76(a5)  ; DESTX
                 move.w   #100,78(a5)  ; DESTY
                 move.w   #4,90(a5)    ; STYLE
                 move.w   #0,102(a5)   ; SCALE
                 move.w   #1,70(a5)    ; MONO

              ; Find the 8x8 font
                 move.w   4(a6),a6       ; Address of 8x8 font
                 move.w   76(a6),84(a5)  ; FBASE
                 move.w   80(a6),88(a5)  ; FWIDTH
                 move.w   82(a6),82(a5)  ; DELY

              ; Print the string
                 lea      string,a2
                 move.l   72(a6),a3       ; offset table
                 moveq.l  #0,d0
              print:
                 move.b   (a2)+,d0        ; Get next char
                 ble      end
                 sub.w    36(a6),d0       ; Fix offset
                 lsl.w    #1,d0           ; Double for WORD offset
                 move.w   0(a3,d0),72(a5) ; SOURCEX
                 move.w   2(a3,d0),d0     ; x of next char
                 sub.w    72(a5),d0       ; get true width
                 move.w   d0,80(a5)       ; DELX
                 moveq.l  #0,74(a5)       ; SOURCEY
                 movem.l  a0-a2,-(sp)     ; Save a0-a2
                 .dc.w    $A008
                 movem.l  (a7)+,a0-a2     ; Restore regs
                 bra      print
              end:
                 rts

                 .data
              string:
                 .dc.b   "The Atari Compendium",0

Comments      The value for WRMODE is a special case with TextBlt. Values
              from 0-3 translate to the standard VDI modes. Values from
              4-19 translate to the BitBlt modes 0-15.

See Also      v_gtext()