vga.h 3.19 KB
Newer Older
1 2
/*
 * VGA emulation
3
 *
4
 * Copyright 1998 Ove Kåven
5
 *
6 7 8 9 10 11 12 13 14 15 16 17
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23
 */

#ifndef __WINE_VGA_H
#define __WINE_VGA_H

24 25 26
#include <stdarg.h>

#include "windef.h"
27
#include "winbase.h"
28
#include "wingdi.h"
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
 * VGA VESA definitions
 */
/* mode descriptor */
enum modetype {TEXT=0, GRAPHIC=1};
/* Wine internal information about video modes */
typedef struct {
    WORD Mode;
    BOOL ModeType;
    WORD TextCols;  /* columns of text in display */
    WORD TextRows;  /* rows of text in display */
    WORD CharWidth;
    WORD CharHeight;
    WORD Width;  /* width of display in pixels */
    WORD Height; /* height of display in pixels */
    WORD Depth;  /* bits per pixel */
    WORD Colors; /* total available colors */
    WORD ScreenPages;
    BOOL Supported;
} VGA_MODE;

extern const VGA_MODE VGA_modelist[];

/* all vga modes */
const VGA_MODE *VGA_GetModeInfo(WORD mode);
int VGA_SetMode(WORD mode);

57
/* graphics mode */
58 59
int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth);
void VGA_SetPalette(PALETTEENTRY*pal,int start,int len);
60
void VGA_SetColor16(int reg,int color);
61 62 63
char VGA_GetColor16(int reg);
void VGA_Set16Palette(char *Table);
void VGA_Get16Palette(char *Table);
64
void VGA_SetWindowStart(int start);
65
int  VGA_GetWindowStart(void);
66
void VGA_ShowMouse(BOOL show);
67 68 69
void VGA_UpdatePalette(void);
void VGA_SetPaletteIndex(unsigned index);
void VGA_SetBright(BOOL bright);
70
void VGA_WritePixel(unsigned color, unsigned page, unsigned col, unsigned row);
71 72

/* text mode */
73 74
void VGA_InitAlphaMode(unsigned*Xres,unsigned*Yres);
void VGA_SetAlphaMode(unsigned Xres,unsigned Yres);
75
BOOL VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres);
76
void VGA_SetCursorShape(unsigned char start_options,unsigned char end);
77
void VGA_SetCursorPos(unsigned X,unsigned Y);
78
void VGA_GetCursorPos(unsigned*X,unsigned*Y);
79
void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count);
80
void VGA_PutChar(BYTE ascii);
81
void VGA_ClearText(unsigned row1, unsigned col1,
82 83
                  unsigned row2, unsigned col2,
                  BYTE attr);
84
void VGA_ScrollUpText(unsigned row1, unsigned col1,
85 86
                     unsigned row2, unsigned col2,
                     unsigned lines, BYTE attr);
87
void VGA_ScrollDownText(unsigned row1, unsigned col1,
88 89
                       unsigned row2, unsigned col2,
                       unsigned lines, BYTE attr);
90
void VGA_GetCharacterAtCursor(BYTE *ascii, BYTE *attr);
91 92

/* control */
93
void VGA_ioport_out(WORD port, BYTE val);
94
BYTE VGA_ioport_in(WORD port);
95
void VGA_Clean(void);
96 97

#endif /* __WINE_VGA_H */