1
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaVideo.h,v 1.1.2.1 1998/06/27 14:48:54 dawes Exp $ */
3
* Copyright IBM Corporation 1987,1988,1989
7
* Permission to use, copy, modify, and distribute this software and its
8
* documentation for any purpose and without fee is hereby granted,
9
* provided that the above copyright notice appear in all copies and that
10
* both that copyright notice and this permission notice appear in
11
* supporting documentation, and that the name of IBM not be
12
* used in advertising or publicity pertaining to distribution of the
13
* software without specific, written prior permission.
15
* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17
* IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
25
/* $XConsortium: vgaVideo.h /main/4 1996/02/21 17:59:14 kaleb $ */
27
#ifdef HAVE_XORG_CONFIG_H
28
#include <xorg-config.h>
31
#include "misc.h" /* GJA -- for pointer data type */
48
* References to all pc ( i.e. '286 ) memory in the
49
* regions used by the [ev]ga server ( the 128K windows )
50
* MUST be long-word ( i.e. 32-bit ) reads or writes.
51
* This definition will change for other memory architectures
54
typedef unsigned char VideoAdapterObject ;
55
typedef volatile VideoAdapterObject *VideoMemoryPtr ;
56
typedef volatile VideoAdapterObject *VgaMemoryPtr ;
57
#if !defined(BITMAP_BIT_ORDER)
58
#define BITMAP_BIT_ORDER MSBFirst
61
#if !defined(IMAGE_BYTE_ORDER)
62
#define IMAGE_BYTE_ORDER LSBFirst
65
/* Bit Ordering Macros */
66
#if !defined(SCRLEFT8)
67
#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
69
#if !defined(SCRRIGHT8)
70
#define SCRRIGHT8(lw, n) ( (unsigned char) (((unsigned char)lw) >> (n)) )
72
/* These work ONLY on 8-bit wide Quantities !! */
73
#define LeftmostBit ( SCRLEFT8( 0xFF, 7 ) & 0xFF )
74
#define RightmostBit ( SCRRIGHT8( 0xFF, 7 ) & 0xFF )
77
* [ev]ga video screen defines & macros
79
#define VGA_BLACK_PIXEL 0
80
#define VGA_WHITE_PIXEL 1
82
#define VGA_MAXPLANES 4
83
#define VGA_ALLPLANES 0xFL
85
#define VIDBASE(pDraw) ((volatile unsigned char *) \
86
(((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))-> \
88
#define BYTES_PER_LINE(pDraw) \
89
((int)((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))->devKind)
91
#define ROW_OFFSET( x ) ( ( x ) >> 3 )
92
#define BIT_OFFSET( x ) ( ( x ) & 0x7 )
93
#define SCREENADDRESS( pWin, x, y ) \
94
( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + ROW_OFFSET(x) )