home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Examples / DriverKit / QVision / QVision_reloc.tproj / QVisionModes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-27  |  3.2 KB  |  125 lines

  1. /*
  2.  * Copyright (c) 1993-1996 by NeXT Software, Inc. as an unpublished work.
  3.  * All rights reserved.
  4.  *
  5.  * QVisionModes.h -- internal definitions for QVision driver.
  6.  *
  7.  * Author:  Derek B Clegg    21 May 1993
  8.  *
  9.  * Based on work by Joe Pasqua, 30 September 1992.
  10.  */
  11.  
  12. #ifndef QVISIONMODES_H__
  13. #define QVISIONMODES_H__
  14.  
  15. #import <objc/objc.h>
  16. #import <driverkit/displayDefs.h>
  17. #import "vgaModes.h"
  18.  
  19. #define QVISION_ISA_ID       0x0E113021
  20. #define    QVISION_EISA_ID      0x0E113011
  21. #define    ORION_ISA_ID         0x0E113121
  22. #define    ORION_EISA_ID        0x0E113111
  23. #define    ORION12_ISA_ID       0x0E113122
  24. #define    ORION12_EISA_ID      0x0E113112
  25.  
  26. enum QVAdapterType {
  27.     UnknownAdapter = -1,
  28.     QVisionAdapter = 0,
  29.     OrionAdapter = 1,
  30.     Orion12Adapter = 2,
  31.     QVision1280P = 3        /* PCI card */
  32. };
  33. typedef enum QVAdapterType QVAdapterType;
  34.  
  35. enum DACtype {
  36.     UnknownDAC,
  37.     Bt484,        /* BrookTree 484. */
  38.     Bt485,        /* BrookTree 485. */
  39.     Bt485A,        /* BrookTree 485A. */
  40.     ATT20C505        /* AT&T 20C505 */
  41. };
  42. typedef enum DACtype DACtype;
  43.  
  44. /* Sizes of the various data sets. */
  45.  
  46. struct QVisionMode {
  47.     const char *name;        /* The name of this mode. */
  48.     QVAdapterType adapter;    /* The adapter required for this mode. */
  49.     BOOL needsPixelDoubling;    /* YES if this mode requires pixel doubling. */
  50.  
  51.     /* Control register 1 value (63CA).  */
  52.     unsigned char ctrlReg1;
  53.  
  54.     /* DAC command register 1 value (13C8). */
  55.     unsigned char dacCmd1;
  56.  
  57.     /* Overflow register 1 value (3CF.42). */
  58.     unsigned char overflow1;
  59.  
  60.     /* Overflow register 2 values (3CF.51). */
  61.     unsigned char overflow2;
  62.  
  63.     /* Standard VGA data. */
  64.     VGAMode vgaData;
  65. };
  66. typedef struct QVisionMode QVisionMode;
  67.  
  68. extern IODisplayInfo QVisionModeTable[];
  69. extern const int QVisionModeTableCount;
  70.  
  71. #define DEFAULT_QVISION_MODE    17    /* 800 x 600 x 8 @ 60Hz. */
  72.  
  73. /* Port Addresses for Various Registers */
  74.  
  75. #define SEQ_PIXEL_WR_MSK    0x02
  76. #define GC_PLANE_WR_MSK        0x08
  77.  
  78. /* Control Registers */
  79. #define PAGE_REG_0        0x45    /* This is a GFXC index. */
  80. #define PAGE_REG_1        0x46    /* This is a GFXC index. */
  81. #define HI_ADDR_MAP        0x48    /* This is a GFXC index. */
  82. #define ENV_REG_1        0x50    /* This is a GFXC index. */
  83. #define VIRT_CTRLR_SEL        0x83C4
  84. #define CTRL_REG_1        0x63CA
  85. #define    QVGA_CTL_2        0x23C7
  86. #define    QVGA_CTL_3        0x63CB
  87.  
  88. /* CTRL_REG_1 values */
  89. #define PACKED_PIXEL_VIEW        0x00
  90. #define PLANAR_VIEW             0x08
  91. #define EXPAND_TO_FG             0x10
  92. #define EXPAND_TO_BG             0x18
  93. #define BITS_PER_PIX_4           0x00
  94. #define BITS_PER_PIX_8           0x02
  95. #define BITS_PER_PIX_16          0x04
  96. #define BITS_PER_PIX_32          0x06
  97.  
  98. /* DAC Registers */
  99. #define PALETTE_WRITE        0x3C8
  100. #define PALETTE_READ        0x3C7
  101. #define PALETTE_DATA        0x3C9
  102. #define CO_COLOR_WRITE        0x83C8
  103. #define CO_COLOR_DATA        0x83C9
  104. #define DAC_CMD_0        0x83C6
  105. #define DAC_CMD_1        0x13C8
  106. #define DAC_CMD_2        0x13C9
  107. #define    DAC_EXT_REG        0x13C6
  108.  
  109. /* BIOS Capability Register. */
  110. #define BIOS_CAPABILITY_REG1    0x56
  111. #define BIOS_CAPABILITY_REG2    0x57
  112.  
  113. /*  Use IOLog_dbg(("format", arg, ...)) to get debugging ingo when building
  114.     the `debug' target.  Actually though, it is a whole lot easier to define
  115.     DEBUG here so `make install' works normally.  */
  116. #ifdef QVISION_DEBUG
  117. #define IOLog_dbg(x) IOLog x
  118. #else
  119. #define IOLog_dbg(x)
  120. #endif
  121.  
  122.  
  123.  
  124. #endif    /* QVISIONMODES_H__ */
  125.