#include "stddef.h"
#include <stdarg.h>
#include "windef.h"
#include "wingdi.h"
#include "winddi.h"
#include "devioctl.h"
#include "ntddvdeo.h"
#include "debug.h"
Go to the source code of this file.
|
#define | MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256)) |
|
#define | DRIVER_EXTRA_SIZE 0 |
|
#define | DLL_NAME L"vga" |
|
#define | STANDARD_DEBUG_PREFIX "Vga risc: " |
|
#define | ALLOC_TAG 'rgvD' |
|
#define | VAL(data, px, pl, pos) ((data) >> (((px) * 4) + (pl)) & 1) << (pos) |
|
#define | SET_PLANE_DATA(x, y, a, b) (x) |= VAL(y, (((-1 + ((((b) % 8) % 2) << 1) - (((b) % 8) + 1) + 8))), a, b) |
|
#define | ALIGN_DOWN_BY(size, align) ((ULONG_PTR)(size) & ~((ULONG_PTR)(align) - 1)) |
|
#define | ALIGN_UP_BY(size, align) (ALIGN_DOWN_BY(((ULONG_PTR)(size) + align - 1), align)) |
|
◆ ALIGN_DOWN_BY
◆ ALIGN_UP_BY
◆ ALLOC_TAG
◆ DLL_NAME
◆ DRIVER_EXTRA_SIZE
◆ MAX_CLUT_SIZE
◆ SET_PLANE_DATA
#define SET_PLANE_DATA |
( |
|
x, |
|
|
|
y, |
|
|
|
a, |
|
|
|
b |
|
) |
| (x) |= VAL(y, (((-1 + ((((b) % 8) % 2) << 1) - (((b) % 8) + 1) + 8))), a, b) |
◆ STANDARD_DEBUG_PREFIX
#define STANDARD_DEBUG_PREFIX "Vga risc: " |
◆ VAL
◆ PDEV
◆ PPDEV
◆ bInit256ColorPalette()
Definition at line 226 of file palette.c.
227{
230 ULONG ulReturnedDataLength;
233
235 {
236
237
238
239
243
244
245
246
247
248 cColors = 256;
250
251 while(cColors--)
252 {
253 pScreenClutData[cColors].
Red = ppdev->
pPal[cColors].
peRed >>
259 pScreenClutData[cColors].
Unused = 0;
260 }
261
262
263
264
265
266 if (EngDeviceIoControl(ppdev->
hDriver,
268 pScreenClut,
271 0,
272 &ulReturnedDataLength))
273 {
274 DISPDBG((0,
"Failed bEnablePalette"));
276 }
277 }
278
279 DISPDBG((5,
"Passed bEnablePalette"));
280
282}
#define IOCTL_VIDEO_SET_COLOR_REGISTERS
struct VIDEO_CLUT * PVIDEO_CLUT
struct _VIDEO_CLUTDATA * PVIDEO_CLUTDATA
union VIDEO_CLUT::@3174 LookupTable[1]
Referenced by DrvEnableSurface().
◆ bInitPaletteInfo()
Definition at line 67 of file palette.c.
68{
71
73}
BOOL bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo)
Referenced by DrvEnablePDEV().
◆ bInitPDEV()
◆ bInitPointer()
◆ bInitSURF()
Definition at line 168 of file screen.c.
169{
170 DWORD returnedDataLength;
174
175 ULONG RemappingNeeded = 0;
176
177
178
179
180
181 if (EngDeviceIoControl(ppdev->
hDriver,
185
186 &RemappingNeeded,
188
189 &returnedDataLength))
190 {
191 RIP(
"DISP bInitSURF failed IOCTL_SET_MODE\n");
193 }
194
195
196
197
198
199
200 if (bFirst || RemappingNeeded)
201 {
202
204
205 if (EngDeviceIoControl(ppdev->
hDriver,
207 &videoMemory,
209 &videoMemoryInformation,
211 &returnedDataLength))
212 {
213 RIP(
"DISP bInitSURF failed IOCTL_VIDEO_MAP\n");
215 }
216
218
221 {
222 RIP(
"VideoRamBase does not correspond to FrameBufferBase\n");
223 }
224
225
226
227
228
230
232
233 DISPDBG((1,
"Frame buffer memory is not accessible.\n"));
235 }
236
238
239
240
241
242
244
245
246
248
249
250
251
252
253
254
255
257 {
259 }
260 else
261 {
263 }
264
268
271
273
274 DISPDBG((0,
"bInitPointer EngAllocMem failed\n"));
276 }
277
285 }
286
288}
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
#define IOCTL_VIDEO_SET_CURRENT_MODE
struct _VIDEO_POINTER_ATTRIBUTES VIDEO_POINTER_ATTRIBUTES
struct _VIDEO_POINTER_ATTRIBUTES * PVIDEO_POINTER_ATTRIBUTES
#define VIDEO_MODE_COLOR_POINTER
void * EngAllocMem(int zero, unsigned long size, int tag=0)
VIDEO_POINTER_CAPABILITIES PointerCapabilities
DWORD cjPointerAttributes
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes
PVOID RequestedVirtualAddress
Referenced by DrvAssertMode(), and DrvEnableSurface().
◆ getAvailableModes()
Definition at line 651 of file screen.c.
655{
659
660
661
662
663
664 if (EngDeviceIoControl(
hDriver,
667 0,
668 &modes,
670 &ulTemp))
671 {
672 DISPDBG((0,
"getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n"));
673 return 0;
674 }
675
677
678
679
680
681
685
686 if (*modeInformation ==
NULL)
687 {
688 DISPDBG((0,
"getAvailableModes failed EngAllocMem\n"));
689
690 return 0;
691 }
692
693
694
695
696
697 if (EngDeviceIoControl(
hDriver,
700 0,
701 *modeInformation,
703 &ulTemp))
704 {
705
706 DISPDBG((0,
"getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n"));
707
709 *modeInformation =
NULL;
710
711 return 0;
712 }
713
714
715
716
717
718
719
721 pVideoTemp = *modeInformation;
722
723
724
725
726
727
728
729 while (ulTemp--)
730 {
735
736 {
738 }
739
742 }
743
745
746}
#define VIDEO_MODE_GRAPHICS
struct _VIDEO_MODE_INFORMATION * PVIDEO_MODE_INFORMATION
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
ULONG ModeInformationLength
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
◆ vDisablePalette()
Definition at line 82 of file palette.c.
83{
84
85
87 {
90 }
91
92
93#if 0
96#endif
97
98}
ENGAPI BOOL APIENTRY EngDeletePalette(_In_ _Post_ptr_invalid_ HPALETTE hpal)
Referenced by DrvDisablePDEV().
◆ vDisableSURF()
Definition at line 297 of file screen.c.
298{
299 DWORD returnedDataLength;
301
303
306 &videoMemory,
309 0,
310 &returnedDataLength))
311 {
312 RIP(
"DISP vDisableSURF failed IOCTL_VIDEO_UNMAP\n");
313 }
314}
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Referenced by DrvDisableSurface().