ReactOS  0.4.13-dev-982-g9853eab
vidbios.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GPL - See COPYING in the top level directory
3  * PROJECT: ReactOS Virtual DOS Machine
4  * FILE: subsystems/mvdm/ntvdm/bios/vidbios.h
5  * PURPOSE: VDM 32-bit Video BIOS Support Library
6  * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7  * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8  */
9 
10 #ifndef _VIDBIOS_H_
11 #define _VIDBIOS_H_
12 
13 /* DEFINES ********************************************************************/
14 
15 #define BIOS_VIDEO_INTERRUPT 0x10
16 
17 #define CONSOLE_FONT_HEIGHT 8
18 #define BIOS_DEFAULT_VIDEO_MODE 0x03
19 #define BIOS_MAX_PAGES 8
20 #define BIOS_MAX_VIDEO_MODE 0x13
21 #define DEFAULT_ATTRIBUTE 0x07
22 
23 #define GRAPHICS_VIDEO_SEG 0xA000
24 #define TEXT_VIDEO_SEG 0xB800
25 #define CGA_EVEN_VIDEO_SEG 0xB800
26 #define CGA_ODD_VIDEO_SEG 0xBA00
27 #define VIDEO_BIOS_DATA_SEG 0xC000
28 
29 #define FONT_8x8_OFFSET 0x0100
30 #define FONT_8x8_HIGH_OFFSET 0x0500
31 #define FONT_8x16_OFFSET 0x0900
32 #define FONT_8x14_OFFSET 0x1900
33 
34 #define FONT_8x8_COMPAT_OFFSET 0xFA6E
35 
36 #define VIDEO_STATE_INFO_OFFSET 0x3000 // == 0x1900 + (sizeof(Font8x14) == 0x0E00) + 0x0900 for padding
37 
38 #define VIDEO_BIOS_ROM_SIZE 0x4000
39 
40 typedef enum
41 {
47 
48 #pragma pack(push, 1)
49 
50 typedef struct _VGA_STATIC_FUNC_TABLE
51 {
52  BYTE SupportedModes[3]; // 0x00
53  DWORD Reserved0; // 0x03
58  WORD Reserved1; // 0x0c
60  BYTE Reserved2; // 0x0f
62 
64 {
66 
67  /*
68  * The following fields follow the same order as in the BDA,
69  * from offset 0x49 up to offset 0x66...
70  */
71  BYTE VideoMode; // 0x04
78  BYTE VideoPage; // 0x1d
79  WORD CrtBasePort; // 0x1e
82  /* ... and offsets 0x84 and 0x85. */
83  BYTE ScreenRows; // 0x22
85 
90  BYTE Scanlines; // 0x2a
93 
94  /* Contains part of information from BDA::VGAFlags (offset 0x89) */
95  BYTE VGAFlags; // 0x2d
96 
97  BYTE Reserved0[3]; // 0x2e
100  BYTE VGADispInfo; // 0x33
101 
102  BYTE Reserved1[12]; // 0x34 - 0x40
104 
105 #pragma pack(pop)
106 
107 /* MACROS *********************************************************************/
108 
109 //
110 // These macros are defined for ease-of-use of some VGA I/O ports
111 // whose addresses depend whether we are in Monochrome or Colour mode.
112 //
113 #define VGA_INSTAT1_READ Bda->CrtBasePort + 6 // VGA_INSTAT1_READ_MONO or VGA_INSTAT1_READ_COLOR
114 #define VGA_CRTC_INDEX Bda->CrtBasePort // VGA_CRTC_INDEX_MONO or VGA_CRTC_INDEX_COLOR
115 #define VGA_CRTC_DATA Bda->CrtBasePort + 1 // VGA_CRTC_DATA_MONO or VGA_CRTC_DATA_COLOR
116 
117 /* FUNCTIONS ******************************************************************/
118 
120 
123 
127 
128 #endif /* _VIDBIOS_H_ */
VOID WINAPI VidBiosVideoService(LPWORD Stack)
Definition: vidbios.c:2947
struct _VGA_DYNAMIC_FUNC_TABLE * PVGA_DYNAMIC_FUNC_TABLE
struct _VGA_STATIC_FUNC_TABLE VGA_STATIC_FUNC_TABLE
#define BIOS_MAX_PAGES
Definition: vidbios.h:19
VOID VidBiosAttachToConsole(VOID)
Definition: vidbios.c:3907
VOID VidBiosPost(VOID)
Definition: vidbios.c:3932
VOID VidBiosDetachFromConsole(VOID)
Definition: vidbios.c:3920
VOID VidBiosCleanup(VOID)
Definition: vidbios.c:4036
struct _VGA_STATIC_FUNC_TABLE * PVGA_STATIC_FUNC_TABLE
unsigned char BOOLEAN
#define WINAPI
Definition: msvc.h:8
WORD CursorPosition[BIOS_MAX_PAGES]
Definition: vidbios.h:75
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
WORD CurrModeSupportedColorsNum
Definition: vidbios.h:88
unsigned char BYTE
Definition: mem.h:68
SCROLL_DIRECTION
Definition: vidbios.h:40
BYTE CurrModeSupportedPagesNum
Definition: vidbios.h:89
uint16_t * LPWORD
Definition: typedefs.h:54
BYTE SupportedModes[3]
Definition: vidbios.h:52
BYTE MaxActiveTextCharBlocksNumber
Definition: vidbios.h:56
BOOLEAN VidBiosInitialize(VOID)
Definition: vidbios.c:3981
struct _VGA_DYNAMIC_FUNC_TABLE VGA_DYNAMIC_FUNC_TABLE