
             NOTES TO ACCOMPANY ENGINE DEMONSTRATION

   In the engine demo,  the  ascii  arrays  are  ViFONT  produced
images.    We  use  more  meaningful pointers to illustrate basic
pointer  manipulation  for  those  would-be,  or  should  we  say
"could-be"    developers.  The program uses the lowest user-level
raster operation call - IOCTL(2) {see window(7)}.  Since each  of
the   4 frames has the same size, we only need to set most of the
urdata information once.  Effectively, the only  change  that  is
necessary is the address of where the image to be drawn is coming
from.  All of the ascii arrays are 70 pixels wide, by  50  pixels
high,  by  10  characters  per  row.   If  you are new to UNIX PC
graphics, you will  have  to  pay  particular  attention  to  the
"character  per  row"  specification.   This  is  required by all
raster operations (except window to window {if they  are  one  in
the  same}).  Somewhere deep inside the UNIX PC kernel   lies the
raster operation vectored to on  ioctl(WIOCRASTOP).  Inside  this
routine,  you  can  be  assured  that the 68010 is set up to do a
character  transfer  using  loop  mode  (one   of   its   fastest
instructions).  In this "loop mode", the 68010 MUST know how many
characters are going to be transferred. A bad specification  here
is  the  most common cause of a PANIC, which we are sure everyone
wants to avoid.  We  use  a  simple  routine,  which  serves  the
purpose in every case where the pixel width of an image is known,
but the characters per row, or "cpr", is   not.  We hope you will
find this useful.

   int tocpr(width)
   int width;
   {
   int cpr;

     cpr = width / 8;     /* How many characters?     */
     if(width % 8) cpr++; /* Any left over?           */
     if(cpr  % 2)  cpr++; /* Do we have even ushorts? */
     return(cpr);
   }

   Please address all comments to:

        Amperfax Corporation         
        1928 N.E. 154th Street
        N.M.B., FL 33162         (305) 944-1477
