home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / SVGALIB / SVGALIB1.TAR / svgalib / src / ramdac.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-21  |  2.1 KB  |  84 lines

  1.  
  2. /* DacMethods type. */
  3.  
  4. typedef struct {
  5.     int id;
  6.     char *name;
  7.     int flags;
  8.     /*
  9.      * The following function tries to detect the DAC;
  10.      * returns nonzero if succesful.
  11.      */
  12.     int (*probe)();
  13.     /*
  14.      * The following function initializes the DAC; it is usually
  15.      * called once after detection.
  16.      */
  17.     void (*initialize)();
  18.     /*
  19.      * The following function fills in dot clock limits, and
  20.      * mapping functions for the raw clock and horizontal
  21.      * CRTC timing, in the cardspecs structure.
  22.      */
  23.     void (*qualifyCardSpecs)(CardSpecs *cardspecs);
  24.     /*
  25.      * The following function saves RAMDAC registers into regs.
  26.      */
  27.     void (*saveState)(unsigned char *regs);
  28.     /*
  29.      * The following function sets the RAMDAC registers with the
  30.      * values from regs.
  31.      */
  32.     void (*restoreState)(unsigned char *regs);
  33.     /*
  34.      * The following function sets up the RAMDAC register values
  35.      * for the desired color operating mode. If the DAC has
  36.      * programmable clocks, it should also program the clock.
  37.      */
  38.     void (*initializeState)(unsigned char *regs, int bpp, int colormode,
  39.         int pixelclock);
  40.     int stateSize;    /* Size in bytes of the state (saved registers). */
  41. } DacMethods;
  42.  
  43. /* IDs */
  44.  
  45. #define NORMAL_DAC    1
  46. #define S3_GENDAC    2    /* S3-GenDAC (8-bit DAC). */
  47. #define S3_SDAC        3    /* S3-SDAC (16-bit DAC). */
  48. #define TRIO64        4    /* Trio64 internal DAC. */
  49. #define SIERRA_32K    5    /* Basic DAC with 32K color mode support. */
  50.  
  51. /* Flags. */
  52.  
  53. #define DAC_HAS_PROGRAMMABLE_CLOCKS    0x1
  54.  
  55. /* Color modes. */
  56.  
  57. #define CLUT8_6        0
  58. #define CLUT8_8        1
  59. #define RGB16_555    2
  60. #define RGB16_565    3
  61. #define RGB32_888_B    4    /* Blue byte first. */
  62.  
  63.  
  64. /* Variables defined in ramdac.c. */
  65.  
  66. extern DacMethods normal_dac_methods;
  67. extern DacMethods S3_SDAC_methods;
  68. extern DacMethods S3_GENDAC_methods;
  69. extern DacMethods Trio64_methods;
  70. extern DacMethods Sierra_32K_methods;
  71.  
  72. extern DacMethods *all_dacs[];    /* List of all defined DACs. */
  73.  
  74.  
  75. /* Functions defined in ramdac.c. */
  76.  
  77. /*
  78.  * The following function probes the DACs in daclist, which must be
  79.  * terminated by NULL. It returns the detected DAC if succesful, NULL
  80.  * otherwise. The detected DAC is also initialized.
  81.  */
  82.  
  83. extern DacMethods *probeDacs( DacMethods **daclist );
  84.