home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / CHOSNECK / CHOS2.ZIP / CHOSNECK.2ND / STUFF / DATAS.ZIP / ART54.SCR < prev    next >
Encoding:
Text File  |  2003-12-08  |  6.0 KB  |  138 lines

  1. <head>
  2. <title="...forever...">
  3. <font=monaco10.fnt>
  4. <font=newy36.fnt>
  5. <font=time24.fnt>
  6. <image=back.raw w=256 h=256 t=-1>
  7. <buf=1863>
  8. <bgcolor=-1>
  9. <background=0> 
  10. <link_color=253>
  11. <module=console.mod>
  12. <pal=back.pal>
  13. colors:
  14. 251 - black
  15. </head>
  16. <body>
  17. <frame x=0 y=0 w=640 h=1863 b=-1 c=-1>
  18.  
  19.  
  20.                                  |  |  |  |  |
  21.                                +---------------+
  22.                               _|   BLITTER     |_
  23.                               _| Step by Step  |_
  24.                                +---------------+
  25.                                  |  |  |  |  |
  26.  
  27.                   By Saulot/ Nokturnal/ Chosneck TEAM ' 2003
  28.  
  29.  
  30. 1)  Firstly  we  need to calculate the starting buffer of our source raster. In
  31. this helps us the following equation:
  32.  
  33. [screen address] + y * (line lenght) + 2 * (x/16) * (number of planes)
  34.  
  35. We write the result into $ff8a24 address.
  36.  
  37. 2)  We calculated  the source raster we need to calculate the destination using
  38. the same equation from 1). The result has to be written into $ff8a32.
  39.  
  40. 3)  We need to estimate  the interleave between the words in a one bitplane. (1
  41. bitplane=0,  2  bitplanes=1, 3 bitplanes=2, 4 bitplanes=3). We write the needed
  42. value  into $ff82a20 for source raster and into $ff8a2e for destination raster.
  43. Usually  the 2 value is written, other values let you, for example copying of a
  44. single bitplane.
  45.  
  46. 4)  We estimate the offset between the particular screen lines:
  47.     offset= lenght of the line - (width of copied block-2)
  48. "Length  of the line" and "width of copied block" are rounded off to 16 pixels,
  49. e.g  9 pixels are 4 words in 320*200. The values are written to $ff8a22(source)
  50. and  $ff8a30  (destination).  We  can  set  the different values for source and
  51. destination,  this  gives  us  the  possibility to copy of screens in different
  52. resolutions, copying of single bitplanes etc.
  53.  
  54. 5)  Now is time to estimate of the copied block size:
  55. To X_COUNT register we need to write the width of destination in words (e.g for
  56. 18 pixels we write 8) If the  block  has  to be additionally shifted we have to
  57. enlarge it's size for 16 pixels (4 words must be added).
  58.  
  59. 6)  Setting of values for masking and shifting:
  60. The  state  of 4 least significant bits in SKEW register ($ff8a3d) tells us how
  61. many bits to the right source raster has to be shifted. The masking of unwanted
  62. bits  is needed, e.g if the sprite in the buffer has to be shifted 4 bits, then
  63. the  first 4 and the last 12 bits has to be unchanged. And now we step into the
  64. realm of endmask registers.
  65.  
  66.    There are three mask registers:
  67.    endmask1 (mask of a 1st word),
  68.    endmask2 (all the words inbetween endmask1 and endmask3),
  69.    endmask3 (mask at the ending word)
  70.  
  71.    In our example it will look like this:
  72.    (%0000 1111 1111 1111)[endmask1],
  73.    (%1111 1111 1111 1111)[endmask2],
  74.    (%1111 0000 0000 0000)[endmask3].
  75.  
  76. Set  of  masks needed in transfer of blocks not being the multiplication of 16:
  77.  
  78. E.g we have to transfer block of 25 pixel width, to X_COUNT we write "8" value.
  79. After  that  blitter copies 8 words(or 32 pixels). Not needed pixels from 25 to
  80. 31  we  mask  with  $8000   (%1000  0000  0000  0000) applied to endmask3.  The
  81. same  solution applies to copying of whole  blocks on coordinates not being the
  82. multiplication of 16. In this case Blitter  gets the not needed bits, which has
  83. to  be  masked  from endmask1  register  e.g  for  x=100  in ST-LOW, the offset
  84. which has to be added to screen adress is 48, and endmask1=$0fff.
  85.  
  86. 7)  Now  is  time  to  set  how  the  content  of  halftoneRAM will be added to
  87. destination  data.  16  logic operations are available (source<-->destination).
  88. The  kind  of  logic operation is chosen by writing the appropriate value(0-15)
  89. into blitter's OP register ($ff8a3b).
  90.  
  91. 8)  Possibility  of  modification  of  copied data gives us the halftoneRAM (16
  92. registers  in  total).  With  HOP  register  we  can  choose  one of four logic
  93. operations,  which  has  to  be  performed  between  data  block and cyclically
  94. changing halftoneRAM registers.  If  we   additionally  clear  the  SMUDGE  bit
  95. in $ff8a3c register, then 4 least significant  bits let you choose the specific
  96. halftoneRAM register, which has to be  used  as  a  first one. If SMUDGE bit is
  97. set, about used halftoneRAM register, 4  least  significant bits of source data
  98. block have the deciding role.
  99.  
  100. 9)  Blitter requires the size of destination block not the source. There can be
  101. the  situation when source data can be different in lenght in comparison to the
  102. data  after the shifting operation has been done. To avoid unwanted gaps in the
  103. memory (words are treated with masks), we have to set NFSR and FXSR bits:
  104.  
  105.  
  106. NFSR  = 1 - Blitter is not reading the last word of source data (used when data
  107. after  the  shifting  are  increased  by  1  word).
  108.  
  109. FXSR  =  1  -  Blitter  reads  additionally 1 word of source data (set when the
  110. source  data after the shifting are 1 word longer).
  111.  
  112.  
  113. Before  we  start  the  use  of  Blitter  we  have  to  choose the mode of it's
  114. operation. There are two modes:
  115.  
  116.  
  117. HOG  MODE  -  normal  mode  - blitter takes control over the bus until the data
  118. transfer is done.
  119.  
  120. INTERLACED  MODE  -  Blitter  and  M68k are sharing the bus (they are switching
  121. between themselves for a constant period of 64 CPU cycles).
  122.  
  123.  
  124. In  case HOG mode no detection of ending transmision is needed, because the bus
  125. is  busy  until  the transfer is done.   INTERLACED  mode  requires the test of
  126. 7th  bit  of  control  register($ff8a3c)  for   detecting   the   end  of  data
  127. transmission. It can be done also via MFP interrupt register, Blitter generates
  128. the interrupt on the 3rd level after the end of data transfer.
  129.  
  130.  
  131. -- - --- -- -------------------------------------------------------------------
  132.  CHOSNECK 4th appearance                                           contact us:
  133.  done by the dream survivors                                 greymsb@poczta.fm
  134. ----------------------------------------------------------------- -- - --- ----
  135. </frame>
  136. </body>
  137.  
  138.