home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / ibm / skyway / skyReg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-16  |  4.8 KB  |  111 lines

  1. /*
  2.  * $XConsortium: skyReg.h,v 1.2 91/07/16 13:16:14 jap Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989,1990,1991
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * License to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND 
  18.  * NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
  19.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23.  * SOFTWARE.
  24.  *
  25. */
  26.  
  27. /*
  28.  * skyReg.h - hardware register support
  29.  */
  30.  
  31. #ifndef SKYREG_H
  32. #define SKYREG_H
  33.  
  34. #define SKYWAYSetMode(index,m)  \
  35.     SKYWAY_MODE_REG(index) = (m) ; \
  36.     SKYWAY_WINCTRL_REG(index) = 0x00
  37.  
  38. #define SKYWAYSetRGBColor(index,r,g,b)  \
  39.     { SKYWAY_SINDEX_REG(index)   =  (PALETTESEQ  << 8) ; \
  40.       SKYWAY_SINDEX_REG(index)   =  (PALETTEDATA << 8) | ((r) >> 8) ; \
  41.       SKYWAY_SINDEX_REG(index)  =  (PALETTEDATA << 8) | ((g) >> 8) ; \
  42.       SKYWAY_SINDEX_REG(index)  =  (PALETTEDATA << 8) | ((b) >> 8) ; }
  43.  
  44. #define SKYWAYSetColorIndex(index,n)            \
  45.     { SKYWAY_SINDEX_REG(index) = (PALETTEMASK << 8) | 0xff ; \
  46.       SKYWAY_SINDEX_REG(index) = (SPINDEXLO << 8) | (0xff & (n)) ; \
  47.       SKYWAY_SINDEX_REG(index) =  (SPINDEXHI << 8) | 0x00 ;}
  48.  
  49. #define SKYWAYSetWidth(index,d)         SKYWAY_DM1_REG(index) = (short)(d)
  50. #define SKYWAYSetHeight(index,d)                SKYWAY_DM2_REG(index) = (short)(d)
  51. #define SKYWAYSetForegroundColor(index,f)       SKYWAY_FC_REG(index) = (int)(f)
  52. #define SKYWAYSetBackgroundColor(index,b)       SKYWAY_BC_REG(index) = (int)(b)
  53. #define SKYWAYSetCarryChain(index,c)            SKYWAY_CC_REG(index) = (unsigned int)(c)
  54. #define SKYWAYSetCCV(index,c)                   SKYWAY_CCV_REG(index) = (int) (c)
  55. #define SKYWAYSetCCC(index,c)                   SKYWAY_CCC_REG(index) = (unsigned short)(c)
  56.  
  57. #define SKYWAYSetForegroundMix(index,f) SKYWAY_FM_REG(index) = (f)
  58. #define SKYWAYSetBackgroundMix(index,b) SKYWAY_BM_REG(index) = (b)
  59.  
  60. #define SKYWAYSetPixmapWidth(index,w)     SKYWAY_PMW_REG(index) = (short)(w)
  61. #define SKYWAYSetPixmapHeight(index,h)  SKYWAY_PMH_REG(index) = (short)(h)
  62. #define SKYWAYSetPixmapBase(index,b)    SKYWAY_PMB_REG(index) = (unsigned int)(b)
  63. #define SKYWAYSetPixmapIndex(index,i)   SKYWAY_PMI_REG(index) = (short)(i)
  64. #define SKYWAYSetPixmapControl(index,c) SKYWAY_PMC_REG(index) = (unsigned char)(c)
  65. #define SKYWAYSetPixmapFormat(index,f)  SKYWAY_PMF_REG(index) = (short)(f)
  66.  
  67. #define SKYWAYSetBresenhamError(index,e)    SKYWAY_BME_REG(index) = (int) (e)
  68. #define SKYWAYSetBresenhamErrorK1(index,k1) SKYWAY_BMK1_REG(index) = (int) (k1)
  69. #define SKYWAYSetBresenhamErrorK2(index,k2) SKYWAY_BMK2_REG(index) = (int) (k2)
  70. #define SKYWAYSetDirectionSteps(index,d)    SKYWAY_DRT_REG(index) = (int) (d)
  71. #define SKYWAYSetPixelOp(index,p)             SKYWAY_PO_REG(index) = (unsigned int) (p)
  72.  
  73. #define SKYWAYSetDimension(index,w,h) \
  74.     { SKYWAY_DM1_REG(index) = (short) (w) ; \
  75.       SKYWAY_DM2_REG(index) = (short) (h) ; }
  76.  
  77. #define SKYWAYSetPixmapMaskOffset(index,x,y) \
  78.     { SKYWAY_MASKX_REG(index) = (short) (x) ; \
  79.       SKYWAY_MASKY_REG(index) = (short) (y) ; }
  80.  
  81. #define SKYWAYSetPixmapSrcOffset(index,x,y) \
  82.     { SKYWAY_SRCX_REG(index) = (short) (x) ; \
  83.       SKYWAY_SRCY_REG(index) = (short) (y) ; }
  84.  
  85. #define SKYWAYSetPixmapDstOffset(index,x,y) \
  86.     { SKYWAY_DSTX_REG(index) = (short) (x) ; \
  87.       SKYWAY_DSTY_REG(index) = (short) (y) ; }
  88.  
  89. #define SKYWAYSetPixmapPatOffset(index,x,y) \
  90.     { SKYWAY_PATX_REG(index) = (short) (x) ; \
  91.       SKYWAY_PATY_REG(index) = (short) (y) ; }
  92.  
  93. #define SKYWAYSetPageDirBase(index,p)       SKYWAY_PD_REG(index) = (unsigned int) (p)
  94. #define SKYWAYSetVirtualAddr(index,v)       SKYWAY_VA_REG(index) = (unsigned int) (v)
  95. #define SKYWAYGetStateALength(index,a)    (a) = SKYWAY_LA_REG(index)
  96. #define SKYWAYGetStateBLength(index,b)    (b) = SKYWAY_LB_REG (index)
  97.  
  98. #define SKYWAYSetPlaneMask(index,p)   SKYWAY_PM_REG (index)= (p)
  99. #define SKYWAYSetALU(index,a)   \
  100.     { SKYWAYSetForegroundMix(index,a) ; \
  101.       SKYWAYSetBackgroundMix(index,a) ; }
  102.  
  103. #define SKYWAYSetupScreenPixmap(index,pixsize) \
  104.  { SKYWAYSetPixmapIndex(index,PixMapC) ; \
  105.    SKYWAYSetPixmapBase(index,SKYWAY_COP_START) ; \
  106.    SKYWAYSetPixmapWidth(index,1280 - 1) ; \
  107.    SKYWAYSetPixmapHeight(index,1024 - 1) ; \
  108.    SKYWAYSetPixmapFormat(index,MI1 | pixsize) ; }
  109.  
  110. #endif /* SKYREG_H */
  111.