~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/xfree86/xf4bpp/vgaVideo.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaVideo.h,v 1.1.2.1 1998/06/27 14:48:54 dawes Exp $ */
 
2
/*
 
3
 * Copyright IBM Corporation 1987,1988,1989
 
4
 *
 
5
 * All Rights Reserved
 
6
 *
 
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.
 
14
 *
 
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
 
21
 * SOFTWARE.
 
22
 *
 
23
*/
 
24
 
 
25
/* $XConsortium: vgaVideo.h /main/4 1996/02/21 17:59:14 kaleb $ */
 
26
 
 
27
#ifdef HAVE_XORG_CONFIG_H
 
28
#include <xorg-config.h>
 
29
#endif
 
30
 
 
31
#include "misc.h"       /* GJA -- for pointer data type */
 
32
#ifdef lint
 
33
#if defined(volatile)
 
34
#undef volatile
 
35
#endif
 
36
#define volatile /**/
 
37
#if defined(const)
 
38
#undef const
 
39
#endif
 
40
#define const /**/
 
41
#if defined(signed)
 
42
#undef signed
 
43
#endif
 
44
#define signed /**/
 
45
#endif
 
46
 
 
47
/*
 
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
 
52
 * ( e.g. AIX-Rt )
 
53
 */
 
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
 
59
#endif
 
60
 
 
61
#if !defined(IMAGE_BYTE_ORDER)
 
62
#define IMAGE_BYTE_ORDER LSBFirst
 
63
#endif
 
64
 
 
65
/* Bit Ordering Macros */
 
66
#if !defined(SCRLEFT8)
 
67
#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
 
68
#endif
 
69
#if !defined(SCRRIGHT8)
 
70
#define SCRRIGHT8(lw, n)        ( (unsigned char) (((unsigned char)lw) >> (n)) )
 
71
#endif
 
72
/* These work ONLY on 8-bit wide Quantities !! */
 
73
#define LeftmostBit ( SCRLEFT8( 0xFF, 7 ) & 0xFF )
 
74
#define RightmostBit ( SCRRIGHT8( 0xFF, 7 ) & 0xFF )
 
75
 
 
76
/*
 
77
 * [ev]ga video screen defines & macros
 
78
 */
 
79
#define VGA_BLACK_PIXEL 0
 
80
#define VGA_WHITE_PIXEL 1
 
81
 
 
82
#define VGA_MAXPLANES 4
 
83
#define VGA_ALLPLANES 0xFL
 
84
 
 
85
#define VIDBASE(pDraw) ((volatile unsigned char *) \
 
86
        (((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))-> \
 
87
                devPrivate.ptr))
 
88
#define BYTES_PER_LINE(pDraw) \
 
89
   ((int)((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))->devKind)
 
90
 
 
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) )
 
95
 
 
96