ReactOS 0.4.15-dev-8146-gdc0ed6d
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
40typedef enum
41{
47
48#pragma pack(push, 1)
49
51{
52 BYTE SupportedModes[3]; // 0x00
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
82 /* ... and offsets 0x84 and 0x85. */
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
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_ */
unsigned char BOOLEAN
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
BYTE CurrModeSupportedPagesNum
Definition: vidbios.h:89
WORD CursorPosition[BIOS_MAX_PAGES]
Definition: vidbios.h:75
WORD CurrModeSupportedColorsNum
Definition: vidbios.h:88
BYTE MaxActiveTextCharBlocksNumber
Definition: vidbios.h:56
BYTE SupportedModes[3]
Definition: vidbios.h:52
uint16_t * LPWORD
Definition: typedefs.h:56
BOOLEAN VidBiosInitialize(VOID)
Definition: vidbios.c:3981
#define BIOS_MAX_PAGES
Definition: vidbios.h:19
VOID VidBiosAttachToConsole(VOID)
Definition: vidbios.c:3907
VOID WINAPI VidBiosVideoService(LPWORD Stack)
Definition: vidbios.c:2947
struct _VGA_STATIC_FUNC_TABLE VGA_STATIC_FUNC_TABLE
struct _VGA_DYNAMIC_FUNC_TABLE * PVGA_DYNAMIC_FUNC_TABLE
VOID VidBiosDetachFromConsole(VOID)
Definition: vidbios.c:3920
struct _VGA_DYNAMIC_FUNC_TABLE VGA_DYNAMIC_FUNC_TABLE
VOID VidBiosPost(VOID)
Definition: vidbios.c:3932
VOID VidBiosCleanup(VOID)
Definition: vidbios.c:4036
struct _VGA_STATIC_FUNC_TABLE * PVGA_STATIC_FUNC_TABLE
SCROLL_DIRECTION
Definition: vidbios.h:41
@ SCROLL_LEFT
Definition: vidbios.h:44
@ SCROLL_DOWN
Definition: vidbios.h:43
@ SCROLL_RIGHT
Definition: vidbios.h:45
@ SCROLL_UP
Definition: vidbios.h:42
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define WINAPI
Definition: msvc.h:6
unsigned char BYTE
Definition: xxhash.c:193