home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / ddx-mips.zip / MIPS3230.H < prev    next >
C/C++ Source or Header  |  1992-07-31  |  4KB  |  146 lines

  1. /*
  2.  * $XConsortium: mips3230.h,v 1.3 91/07/12 21:33:30 keith Exp $
  3.  *
  4.  * Copyright 1991 MIPS Computer Systems, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of MIPS not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  MIPS makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * MIPS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MIPS
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23. /* $Header: mips3230.h,v 1.3 91/07/15 19:46:39 dd Exp $ */
  24. #ifndef __DDX_MIPS3230_H
  25. #define    __DDX_MIPS3230_H
  26.  
  27. /*
  28.  * RS3230 frame buffer description
  29.  */
  30.  
  31. #ifdef USE_CHAR
  32. typedef unsigned char    DACBITS
  33. #define PAD_TO_DACBITS(var) unsigned char var[3];
  34. #else
  35. typedef unsigned int    DACBITS;
  36. #define PAD_TO_DACBITS(var) 
  37. #endif
  38.  
  39. /* Brooktree Bt459 RAMDAC registers */
  40. struct bt459 {
  41.     PAD_TO_DACBITS(pad0)
  42.     volatile DACBITS    adlo;
  43.     unsigned char pad1[4096 - sizeof (DACBITS)];
  44.     volatile DACBITS    adhi;
  45.     unsigned char pad2[4096 - sizeof (DACBITS)];
  46.     volatile DACBITS    ctrl;
  47.     unsigned char pad3[4096 - sizeof (DACBITS)];
  48.     volatile DACBITS    cmap;
  49.     unsigned char pad4[4096 - sizeof (DACBITS)];
  50. };
  51.  
  52. #define    BT459_SETADDR(r, a)    ((r)->adhi = (a) >> 8, (r)->adlo = (a))
  53.  
  54. /* Bt459 addresses */
  55. #define    BT459_CMAPRAM    0x000
  56. #define    BT459_CURSCOL1    0x181
  57. #define    BT459_CURSCOL2    0x182
  58. #define    BT459_CURSCOL3    0x183
  59. #define    BT459_ID    0x200
  60. #define        BT459_ID_ID        0x4a    /* ID register value */
  61. #define    BT459_CR0    0x201
  62. #define    BT459_CR1    0x202
  63. #define    BT459_CR2    0x203
  64. #define        BT459_CR2_XCURS        2    /* X mode cursor */
  65. #define    BT459_READMASK    0x204
  66. #define    BT459_BLINKMASK    0x206
  67. #define    BT459_CURSCMD    0x300
  68. #define        BT459_CURSCMD_CURSEN    0xc0    /* cursor enable */
  69. #define    BT459_CURSXLO    0x301
  70. #define    BT459_CURSXHI    0x302
  71. #define    BT459_CURSYLO    0x303
  72. #define    BT459_CURSYHI    0x304
  73. #define    BT459_CURSRAM    0x400
  74.  
  75. #define    BT459_CURSMAX    64    /* cursor size */
  76. #define    BT459_CURSBYTES    (64 * 64 * 2 / 8)
  77.  
  78. /* cursor constants */
  79. #define    BT459_CURSK_P    52
  80. #define    BT459_CURSK_H    (388 - 4)
  81. #define    BT459_CURSK_V    (30 - 1)
  82.  
  83. /* cursor address correction -- add result to x, y */
  84. #define    BT459_CURSFIXX(xhot)    (BT459_CURSK_H - BT459_CURSK_P + 31 - (xhot))
  85. #define    BT459_CURSFIXY(yhot)    (BT459_CURSK_V - 32 + 31 - (yhot))
  86.  
  87. /* color frame buffer registers */
  88. struct rs3230c_reg {
  89.     struct bt459 ramdac;
  90.     char pad0[7];
  91.     volatile unsigned char xserver;
  92. #define        RS3230C_XSERVER_UNBLANK    1
  93. #define        RS3230C_XSERVER_PACKED    2
  94. #define        RS3230C_XSERVER_FILL    4
  95.     char pad1[4095];
  96.     volatile unsigned char kernel;
  97. #define        RS3230C_KERNEL_HBLANK    0x10
  98. #define        RS3230C_KERNEL_VBLANK    0x20
  99. #define        RS3230C_KERNEL_IDMASK    0xc0
  100.     char pad2[4088];
  101.     volatile unsigned int mask;
  102.     char pad3[4092];
  103. };
  104.  
  105. /* color frame buffer definitions */
  106. #define    RS3230C_VISW    1280    /* visible pixels per scan line */
  107. #define    RS3230C_VISH    1024    /* scan lines */
  108. #define    RS3230C_BPSL    4096    /* bytes per scan line (as mapped) */
  109.  
  110. /* unpacked mode frame buffer */
  111. struct rs3230c_ufb {
  112.     struct rs3230c_line {
  113.         char vis[RS3230C_VISW];
  114.         char invis[RS3230C_BPSL / 2 - RS3230C_VISW];
  115.         char dup[RS3230C_BPSL / 2];
  116.     } line[RS3230C_VISH];
  117. };
  118.  
  119. /* packed mode frame buffer */
  120. struct rs3230c_pfb {
  121.     char fb[32][1024][64];
  122. };
  123.  
  124. /* packed mode address macros */
  125. #define    RS3230C_PYSHIFT    6
  126. #define    RS3230C_PYMASK    (1023 << RS3230C_PYSHIFT)
  127.  
  128. #define    RS3230C_PXADDR(x)    ((x) & 63 | (((x) >> 6) << 16))
  129. #define    RS3230C_PYADDR(y)    ((y) << RS3230C_PYSHIFT)
  130. #define    RS3230C_PADDR(x, y)    (RS3230C_PXADDR(x) | RS3230C_PYADDR(y))
  131.  
  132.  
  133. /* mono frame buffer definitions */
  134. #define    RS3230M_VISW    1152
  135. #define    RS3230M_VISH    900
  136. #define    RS3230M_BPSL    (RS3230M_VISW / 8)
  137.  
  138. /* mono frame buffer */
  139. struct rs3230m_fb {
  140.     struct rs3230m_line {
  141.         char vis[RS3230M_BPSL];
  142.     } line[RS3230M_VISH];
  143. };
  144.  
  145. #endif /* __DDX_MIPS3230_H */
  146.