Seqx = 0x03C4, /* Sequencer Index, Data at Seqx+1 */
Crtx = 0x03D4, /* CRT Controller Index, Data at Crtx+1 */
Grx = 0x03CE, /* Graphics Controller Index, Data at Grx+1 */
Attrx = 0x03C0, /* Attribute Controller Index and Data */
typedef struct Mode {
char type[Namelen+1]; /* monitor type e.g. "vs1782" */
char size[Namelen+1]; /* size e.g. "1376x1024x8" */
char chan[Namelen+1]; /* channel descriptor, e.g. "m8" or "r8g8b8a8" */
char name[Namelen+1]; /* optional */
int frequency; /* Dot Clock (MHz) */
int deffrequency; /* Default dot clock if calculation can't be done */
int x; /* Horizontal Display End (Crt01), from .size[] */
int y; /* Vertical Display End (Crt18), from .size[] */
int z; /* depth, from .size[] */
int ht; /* Horizontal Total (Crt00) */
int shb; /* Start Horizontal Blank (Crt02) */
int ehb; /* End Horizontal Blank (Crt03) */
int shs; /* optional Start Horizontal Sync (Crt04) */
int ehs; /* optional End Horizontal Sync (Crt05) */
int vt; /* Vertical Total (Crt06) */
int vrs; /* Vertical Retrace Start (Crt10) */
int vre; /* Vertical Retrace End (Crt11) */
typedef struct Edid {
char mfr[4]; /* manufacturer */
char serialstr[16]; /* serial number as string (in extended data) */
char name[16]; /* monitor name as string (in extended data) */
ushort product; /* product code, 0 = unused */
ulong serial; /* serial number, 0 = unused */
uchar version; /* major version number */
uchar revision; /* minor version number */
uchar mfrweek; /* week of manufacture, 0 = unused */
int mfryear; /* year of manufacture, 0 = unused */
uchar dxcm; /* horizontal image size in cm. */
uchar dycm; /* vertical image size in cm. */
int gamma; /* gamma*100 */
int rrmin; /* minimum vertical refresh rate */
int rrmax; /* maximum vertical refresh rate */
int hrmin; /* minimum horizontal refresh rate */
int hrmax; /* maximum horizontal refresh rate */
ulong pclkmax; /* maximum pixel clock */
int flags;
Modelist *modelist; /* list of supported modes */
} Edid;
typedef struct Flag {
int bit;
char *desc;
} Flag;
/*
* The sizes of the register sets are large as many SVGA and GUI chips have extras.
* The Crt registers are ushorts in order to keep overflow bits handy.
* The clock elements are used for communication between the VGA, RAMDAC and clock chips;
* they can use them however they like, it's assumed they will be used compatibly.
*
* The mode->x, mode->y coordinates are the physical size of the screen.
* Virtx and virty are the coordinates of the underlying memory image.
* This can be used to implement panning around a larger screen or to cope
* with chipsets that need the in-memory pixel line width to be a round number.
* For example, virge.c uses this because the Savage chipset needs the pixel
* width to be a multiple of 16. Also, mga2164w.c needs the pixel width
* to be a multiple of 128.
*
* Vga->panning differentiates between these two uses of virtx, virty.
*
* (14 October 2001, rsc) Most drivers don't know the difference between
* mode->x and virtx, a bug that should be corrected. Vga.c, virge.c, and
* mga2164w.c know. For the others, the computation that sets crt[0x13]
* should use virtx instead of mode->x (and maybe other places change too,
* dependent on the driver).
*/
typedef struct Vga {
uchar misc;
uchar feature;
uchar sequencer[256];
ushort crt[256];
uchar graphics[256];
uchar attribute[256];
uchar pixmask;
uchar pstatus;
uchar palette[Pcolours][3];