home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / apa16 / apa16Hdwr.c < prev    next >
C/C++ Source or Header  |  1991-12-30  |  4KB  |  122 lines

  1. /***********************************************************
  2.         Copyright IBM Corporation 1987,1988
  3.  
  4.                       All Rights Reserved
  5.  
  6. Permission to use, copy, modify, and distribute this software and its 
  7. documentation for any purpose and without fee is hereby granted, 
  8. provided that the above copyright notice appear in all copies and that
  9. both that copyright notice and this permission notice appear in 
  10. supporting documentation, and that the name of IBM not be
  11. used in advertising or publicity pertaining to distribution of the
  12. software without specific, written prior permission.  
  13.  
  14. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16. IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20. SOFTWARE.
  21.  
  22. ******************************************************************/
  23. /* $Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16Hdwr.c,v 5.0 1991/12/30 19:22:51 jfc Exp $ */
  24. /* $Source: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/apa16/RCS/apa16Hdwr.c,v $ */
  25.  
  26. #ifndef lint
  27. static char *rcsid = "$Id: apa16Hdwr.c,v 5.0 1991/12/30 19:22:51 jfc Exp $";
  28. #endif
  29.  
  30. #include "Xmd.h"
  31.  
  32. #include "OScompiler.h"
  33. #include "apa16Hdwr.h"
  34.     /*
  35.      * variables and functions to manipulate the apa16
  36.      * rasterop hardware
  37.      */
  38.  
  39. #if 0
  40. int    apa16Qoffset;
  41. int    apa16Qoverflow = 0;
  42. int    apa16Qmerge_mode_old;
  43. #else
  44. struct apa16Qvars apa16Qvars;
  45. #endif
  46.  
  47. #ifdef NOT_X
  48. #define ErrorF printf
  49. #endif
  50.  
  51. /***============================================================***/
  52.  
  53. unsigned short apa16_rop2stype[16] = {
  54.     /* GXclear */        0,
  55.     /* GXand */        1,
  56.     /* GXandReverse */    2,
  57.     /* GXcopy */        9,
  58.     /* GXandInverted */    8,
  59.     /* GXnoop */        0,
  60.     /* GXxor */        0xa,
  61.     /* GXor */        0xb,
  62.     /* GXnor */        0,
  63.     /* GXequiv */        0,
  64.     /* GXinvert */        0,
  65.     /* GXorReverse */    0,
  66.     /* GXcopyInverted */    0,
  67.     /* GXorInverted */    0xc,
  68.     /* GXnand */        0xe,
  69.     /* GXSet */        0};
  70.  
  71. unsigned short apa16_rop2logop[16] = {
  72.     /* GXclear */        0x0,
  73.     /* GXand */        0x1,
  74.     /* GXandReverse */    0x2,
  75.     /* GXcopy */        0x3,
  76.     /* GXandInverted */    0x8,
  77.     /* GXnoop */        0x9,
  78.     /* GXxor */        0xa,
  79.     /* GXor */        0xb,
  80.     /* GXnor */        BAD_LOGOP,
  81.     /* GXequiv */        BAD_LOGOP,
  82.     /* GXinvert */        BAD_LOGOP,
  83.     /* GXorReverse */    BAD_LOGOP,
  84.     /* GXcopyInverted */    BAD_LOGOP,
  85.     /* GXorInverted */    0xc,
  86.     /* GXnand */        0xe,
  87.     /* GXSet */        0xf};
  88.  
  89. /*
  90.  * apa16CheckQ()
  91.  * 
  92.  * This routine is called from the IBM common code to handle the
  93.  * overflow queue.  Sometimes, the queue space is larger than the
  94.  * maximum number of instructions (1023), so with this routine,
  95.  * we can take advantage of the extra space.
  96.  *
  97.  * It is only called from the event-checking loop.  The reason it
  98.  * is required is that if there is a sudden stop of graphic activity
  99.  * that there be some method to tell the hardware that it has more
  100.  * queued commands.  The commands must not be left lingering, as
  101.  * this will have the wrong effect on the screen.  Also, the queue
  102.  * counter going to zero seems to have unpredictable results; it
  103.  * appears that the next instruction if it appears like a branch will
  104.  * be executed sending us to la-la land.
  105.  */
  106.  
  107. apa16CheckQ()
  108. {
  109.     /*
  110.      * The following lines have been commented out since we are
  111.      * not currently using overflow.  Some glitches have been
  112.      * seen in the queue handling, and until all the problems
  113.      * are found, it is easier leaving out this new feature.
  114.      */
  115. #if 0
  116.     while ( ((QUEUE_CNTR&0x3ff) < 0x3ff) && apa16Qoverflow ) {
  117.     INCR_QUEUE_CNTR();
  118.     apa16Qoverflow--;
  119.     }
  120. #endif
  121. }
  122.