•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileBITBLT adr%
BITBLT x%()

adr%: iexp
x%(): four byte integer array

The command BITBLT calls the Line-A routine of the same name, where as the
command with three parameter arrays calls a VDI-routine. In the command
variation for which an address is given as a parameter, a 76 byte long table
must start at this address. The meaning of the values in this storage area can
be taken from the table that follows. The offset distances of the elements from
the start of the table are shown in the column 'offset'.

In the command variation with the one four byte-Integer array, this array must
have at least 23 elements, a specified parameter standing in each. Which
parameter must stand in which array element can be seen in the column 'index'
in the following table.

The parameters marked with a star are affected by the routine, therefore one
should normally work with the command variant which uses an array parameter,
since a copy of the array is used by the BITBLT routine, the array itself will
not be altered. In contrast, the table elements which were given by the passing
of an address will be changed.

Name        Index  Offset  Meaning
B_WD        00     00      Screen width in pixels
B_HT        01     02      Screen height in pixels
PLANE_CT *  02     04      Number of bit-planes
FG_COL   *  03     06      Foreground color
BG_COL   *  04     08      Background color
OP_TAB      05     10      Logical 'put' mode 0 to 15 (see PUT)
S_XMIN      06     14      x offset for source
S_YMIN      07     16      y offset for source
S_FORM      08     18      Address of the source screen
S_NXWD      09     22      Offset to the next word of the same bit-plane
S_NXLN      10     24      Offset to the next line of the source screen
S_NXPL      11     26      Offset to the next bit-plane (always 2)
D_XMIN      12     28      x offset for destination
D_YMIN      13     30      y offset for destination
D_FORM      14     32      Address of the destination screen
D_NXWD      15     36      Offset to the next word of the same bit-plane
D_NXLN      16     38      Offset to the next line of the destination screen
D_NXPL      17     40      Offset to the next bit-plane (always 2)
P_ADDR      18     42      Pointer to fill pattern table (0=no pattern,
                           Source ANDed with pattern before moving)
P_NXLN      19     46      Offset to the next line of the mask
P_NXPL      20     48      Offset to the next plane of the pattern
P_MASK      21     50      Mask as for HLINE
SPACE    *  22     52      Next 24 bytes are workspace for the Blitter

Examples:

    DIM x%(1000)
    '
    FOR i%=0 TO 639 STEP 8
      LINE i%,0,639,399
    NEXT i%
    '
    GET 0,0,639,399,a$
    mirrorput(0,0,a$)
    '
    PROCEDURE mirrorput(x%,y%,VAR x$)
      IF LEN(x$)>6 ! Only do it if something present
        xx%=V:x%(0)
        a%=V:x$
        b%=INT{a%}
        h%=INT{a%+2}
        '
        INT{xx%}=1
        INT{xx%+2}=h%
        INT{xx%+4}=1
        INT{xx%+6}=1
        INT{xx%+8}=0
        {xx%+10}=&H3030303
        INT{xx%+14}=9999
        INT{xx%+16}=0
        {xx%+18}=a%+6
        INT{xx%+22}=2
        INT{xx%+24}=SHR(b%+16,4)*2
        INT{xx%+26}=2
        INT{xx%+28}=9999
        INT{xx%+30}=0
        {xx%+32}=XBIOS(3)
        INT{xx%+36}=2
        INT{xx%+38}=80
        INT{xx%+40}=2
        {xx%+42}=0    ! p_addr
        INT{xx%+46}=0 ! p_nxln
        INT{xx%+48}=0 ! p_nxpl
        INT{xx%+50}=0 ! p_mask
        '
        ABSOLUTE i&,xx%+14
        ABSOLUTE di&,xx%+28
        '
        FOR i&=0 TO b%
          INT{xx%+4}=1
          di&=SUB(639,i&)
          BITBLT xx%
        NEXT i&
        '
      ENDIF
    RETURN

--> An example of BITBLT adr%.

    DIM x%(1000)
    '
    FOR i%=0 TO 639 STEP 8
      LINE i%,0,639,399
    NEXT i%
    '
    GET 0,0,639,399,a$
    mirrorput(0,0,a$)
    '
    PROCEDURE mirrorput(x%,y%,VAR x$)
      IF LEN(x$)>6 ! Only do if something present
        a%=V:x$
        b%=INT{a%}
        h%=INT{a%+2}
        '
        x%(0)=1
        x%(1)=h%
        x%(2)=1
        x%(3)=1
        x%(4)=0
        x%(5)=&H3030303
        x%(6)=9999
        x%(7)=0
        x%(8)=V:x$+6
        x%(9)=2
        x%(10)=SHR(b%+16,4)*2
        x%(11)=2
        x%(12)=9999
        x%(13)=0
        x%(14)=XBIOS(3)
        x%(15)=2
        x%(16)=80
        x%(17)=2
        x%(18)=0 ! p_addr
        x%(19)=0 ! p_nxln
        x%(20)=0 ! p_nxpl
        x%(21)=0 ! p_mask
        '
        FOR i%=0 TO b%
          x%(6)=i%
          x%(12)=639-i%
          BITBLT x%()
        NEXT i%
        '
      ENDIF
    RETURN

--> An example of BITBLT x%().

Both routines reflect a picture about a vertical line down the center of the
screen. In the routine which uses BITBLT adr%, the number of bit-planes must be
re-specified each time the instruction is issued. Which routine to use is more
or less a matter of taste, as there is very little difference in speed between
the two. A VDI version of the program producing the same effect is listed under
BITBLT in 'Chapter  8 - Graphics'.

Line-A BitBlt+