5 void outxay(USHORT ad
, UCHAR x
, UCHAR y
)
7 USHORT xy
= (x
<< 8) + y
;
9 VideoPortWritePortUshort((PUSHORT
)ad
, xy
);
12 void setMode(VideoMode mode
)
15 unsigned int y
, c
, a
, m
, n
;
17 VideoPortWritePortUchar((PUCHAR
)MISC
, mode
.Misc
);
18 VideoPortWritePortUchar((PUCHAR
)STATUS
, 0);
19 VideoPortWritePortUchar((PUCHAR
)FEATURE
, mode
.Feature
);
23 outxay(SEQ
, mode
.Seq
[x
], x
);
26 VideoPortWritePortUshort((PUSHORT
)CRTC
, 0x11);
27 VideoPortWritePortUshort((PUSHORT
)CRTC
, (mode
.Crtc
[0x11] & 0x7f));
31 outxay(CRTC
, mode
.Crtc
[x
], x
);
36 outxay(GRAPHICS
, mode
.Gfx
[x
], x
);
39 x
=VideoPortReadPortUchar((PUCHAR
)FEATURE
);
43 VideoPortWritePortUchar((PUCHAR
)ATTRIB
, x
);
44 VideoPortWritePortUchar((PUCHAR
)ATTRIB
, mode
.Attrib
[x
]);
47 x
=VideoPortReadPortUchar((PUCHAR
)STATUS
);
49 VideoPortWritePortUchar((PUCHAR
)ATTRIB
, 0x20);
53 0xa000, /* 0xe3, */ 0xc3, 0x00,
55 {0x02, 0x01, 0x0f, 0x00, 0x06 },
57 {0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e, 0x00, 0x40, 0x00, 0x00,
58 0x00, 0x00, 0x00, 0x59, 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
61 {0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x0f, 0xff},
63 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
64 0x0c, 0x0d, 0x0e, 0x0f, 0x81, 0x00, 0x0f, 0x00, 0x00}
70 {0x03, 0x01, 0x0f, 0x00, 0x0e},
72 {0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, 0x00, 0x41, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x9c, 0x0e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3,
76 {0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x07, 0x0f, 0xff},
78 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
79 0x0c, 0x0d, 0x0e, 0x0f, 0x41, 0x00, 0x0f, 0x00, 0x00}
84 { 0x03, 0x00, 0x3, 0x00, 0x2 },
86 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f, 0x00, 0x4f, 0x0e, 0x0f,
87 0x00, 0x00, 0x00, 0x00, 0x9c, 0x0e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
90 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x00, 0xff },
92 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
93 0x0c, 0x0d, 0x0e, 0x0f, 0x0c, 0x00, 0x0f, 0x08, 0x00 }
100 // FIXME: Use Vidport to map the memory properly
101 vidmem
= (char *)(0xd0000000 + 0xa0000);
104 WRITE_PORT_USHORT((PUSHORT
)0x3C4, 0x0f02); // index=MASK MAP, write to all bitplanes
106 // RtlZeroMemory(vidmem, 38400);
107 RtlZeroMemory(vidmem
, 64000);
113 VOID
VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock
)
117 OBJECT_ATTRIBUTES Attr
;
124 RtlInitUnicodeString( &Name
, L
"\\TextConsoleRefreshEvent" );
125 InitializeObjectAttributes( &Attr
, &Name
, 0, 0, 0 );
126 Status
= NtOpenEvent( &Event
, STANDARD_RIGHTS_ALL
, &Attr
);
127 if( !NT_SUCCESS( Status
) )
128 DbgPrint( "VGA: Failed to open refresh event\n" );
130 NtSetEvent( Event
, 1 );