home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol1 / gfx / blitter next >
Text File  |  1990-01-26  |  5KB  |  157 lines

  1. (c)  Copyright 1989 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice, and 
  3. is provided "as is" without warranty of any kind, either expressed or implied.  
  4. The entire risk as to the use of this information is assumed by the user.
  5.  
  6.  
  7.  
  8.                          The Lost Blitter Docs
  9.  
  10.                            Carolyn Scheppner
  11.  
  12.  
  13.    The original pre-1.0 Amiga Hardware docs contained some important
  14. information on blitter moves which never made it into any revision of the
  15. Hardware manual.  These docs detail the correct use of modulo, shift,
  16. and size when moving data with the blitter. 
  17.  
  18.  
  19.  
  20. COPYING DATA USING THE BLITTER
  21. ------------------------------
  22.  
  23. 3.1  WHEN SOURCE AND DESTINATION OVERLAP
  24.  
  25.  
  26. 3.1.1  HOW TO DETERMINE BLITTER DIRECTION
  27.  
  28.    IF THERE IS A DATA OVERLAP,
  29.    
  30.       If you are moving data to a lower memory address,
  31.       run the blitter in ASCENDING mode.
  32.  
  33.       If you are moving data to a higher memory address,
  34.       run the blitter in DESCENDING mode.
  35.  
  36.       NOTE: If you are doing a fill operation, the blitter has been
  37.             designed to FILL only in the DESCENDING mode.
  38.  
  39.  
  40.    IF YOU ARE SHIFTING BY ONLY 1 TO 15 BITS (in either direction)
  41.    
  42.       You should run the blitter in the direction which is correct
  43.       for the SHIFT operation (see "3.3 WHEN A DATA SHIFT IS REQUIRED").
  44.       Even though the data move directions are the opposite of those
  45.       described above, the source data will not be destroyed because
  46.       the blitter buffers one word internally during the move.
  47.  
  48.    
  49.    IF THERE IS NO OVERLAP BETWEEN SOURCE AND DESTINATION
  50.  
  51.       You may run the blitter in ASCENDING or DESCENDING mode.
  52.       In this case, you will choose the direction based on the
  53.       need for shifting the source data relative to the word
  54.       alignment of the destination area.
  55.  
  56.  
  57. 3.1.2  ASCENDING OR DESCENDING MODE
  58.  
  59.   To set up the blitter for ASCENDING mode:
  60.       1. Set the BLTCON1 bit called DESC to 0 (Not DESCending)
  61.       2. Write source and destination address pointers to
  62.          point to the LOWEST addresses of the blocks.
  63.       3. Set the modulos correctly (see section 3.2)
  64.       4. Start the blitter by writing the count of words to move
  65.          into BLTSIZE (bits 15-6 vert. size, bits 5-0 horiz. size in words)
  66.  
  67.   To set up the blitter for DESCENDING mode:
  68.       1. Set the BLTCON1 bit called DESC to 1
  69.       2. Write source and destination address pointers to
  70.          the HIGHEST addresses of the data blocks.
  71.       3. Set the modulos correctly (see section 3.2)
  72.       4. Start the blitter.
  73.  
  74.  
  75.  
  76. 3.2  WHEN DATA STORAGE LAYOUT DIFFERS
  77.  
  78.    Each of the sources and the destination has a separate register
  79.    called a modulo.  As the blitter reaches the end of each horizontal
  80.    word count (from the BLTSIZE register), the value of the modulo 
  81.    for each source or destination is added to the pointer for that
  82.    item.
  83.  
  84.    Example of single source and destination:
  85.  
  86.       Source area data (packed):
  87.  
  88.                *line1*line2*line3*
  89.  
  90.          Modulo for this source area is 0 since all of the data is
  91.          packed end to end in sequentially increasing addresses.
  92.          
  93.  
  94.       Destination area data (after the move)
  95.  
  96.                ----------------------------
  97.                |                          |
  98.                |                          |
  99.                |    *line1*<-----modulo---|
  100.                |--->*line2*               |
  101.                |    *line3*               |
  102.                |                          |
  103.                |__________________________|
  104.  
  105.          Modulo = words between end of line1 and start of line2
  106.  
  107.  
  108.    In cases where there is a bit shift required between the source
  109.    and the destination, you must specify a modulo that is 1 less
  110.    than your calculated modulo. (-1 for packed data)
  111.    This is because one extra word per horizontal line must be
  112.    moved to account for the blitter bit-shift operation.
  113.  
  114.  
  115. 3.3  WHEN A DATA SHIFT IS REQUIRED
  116.  
  117.    The source data may be shifted by 0 to 15 bits before it is stored
  118.    in the destination area.  This shift may be applied to either
  119.    source A, or B, or both.
  120.  
  121. 3.3.1  HOW THE SOURCE DATA SHIFT WORKS
  122.  
  123.    In the blitter, a shift always means a delay.
  124.    When data is taken from the memory, there will be a 0 to 15 bit
  125.    delay before that data is used along with the other source data
  126.    to form the output.
  127.  
  128.    If the blitter is running in ASCENDING mode, any delay will cause
  129.    the fetched memory bits to be combined with bits at a higher memory
  130.    address. (if onscreen, a shift to the right)
  131.  
  132.    If the blitter is running in DESCENDING mode, any delay will cause
  133.    the fetched memory bits to be combined with bits at a lower memory
  134.    address. (if onscreen, a shift to the left)
  135.  
  136. 3.3.2  SIZE OF MOVE IF DATA IS SHIFTED
  137.  
  138.    When an object is being moved within a bitplane, you must tell the
  139.    blitter how many data words (16 bits) are needed to fully contain
  140.    the object you wish to move.  This is specified as a horizontal
  141.    and a vertical count.
  142.  
  143.    If you have defined an object that is 4 words wide and aligned on
  144.    a word boundary, and no bit-shift is required, you can tell the
  145.    blitter that it should move 4 words horizontally.
  146.  
  147.    If there IS a bit-shift required, you MUST specify that the blitter
  148.    move ONE MORE WORD horizontally than the number in which the 
  149.    object can be contained.
  150.  
  151.  
  152.  
  153.  
  154.     
  155.    
  156.  
  157.