1 /*
2 * PROJECT: ReactOS VGA display driver
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: win32ss/drivers/displays/vga/main/enable.c
5 * PURPOSE:
6 * PROGRAMMERS:
7 */
8
9 #include <vgaddi.h>
10
11 static BOOL VGAInitialized = FALSE;
12
13 static DRVFN FuncList[] =
14 {
15 /* Required Display driver fuctions */
16 {INDEX_DrvAssertMode, (PFN) DrvAssertMode},
17 {INDEX_DrvCompletePDEV, (PFN) DrvCompletePDEV},
18 {INDEX_DrvCopyBits, (PFN) DrvCopyBits},
19 {INDEX_DrvDisablePDEV, (PFN) DrvDisablePDEV},
20 {INDEX_DrvDisableSurface, (PFN) DrvDisableSurface},
21 {INDEX_DrvEnablePDEV, (PFN) DrvEnablePDEV},
22 {INDEX_DrvEnableSurface, (PFN) DrvEnableSurface},
23 {INDEX_DrvGetModes, (PFN) DrvGetModes},
24 {INDEX_DrvLineTo, (PFN) DrvLineTo},
25 {INDEX_DrvPaint, (PFN) DrvPaint},
26 {INDEX_DrvBitBlt, (PFN) DrvBitBlt},
27 {INDEX_DrvTransparentBlt, (PFN) DrvTransparentBlt},
28 {INDEX_DrvMovePointer, (PFN) DrvMovePointer},
29 {INDEX_DrvSetPointerShape, (PFN) DrvSetPointerShape},
30
31 #if 0
32 /* Optional Display driver functions */
33 {INDEX_, },
34 {INDEX_DescribePixelFormat, (PFN) VGADDIDescribePixelFormat},
35 {INDEX_DrvDitherColor, (PFN) VGADDIDitherColor},
36 {INDEX_DrvFillPath, (PFN) VGADDIFillPath},
37 {INDEX_DrvGetTrueTypeFile, (PFN) VGADDIGetTrueTypeFile},
38 {INDEX_DrvLoadFontFile, (PFN) VGADDILoadFontFile},
39 {INDEX_DrvQueryFont, (PFN) VGADDIQueryFont},
40 {INDEX_DrvQueryFontCaps, (PFN) VGADDIQueryFontCaps},
41 {INDEX_DrvQueryFontData, (PFN) VGADDIQueryFontData},
42 {INDEX_DrvQueryFontFile, (PFN) VGADDIQueryFontFile},
43 {INDEX_DrvQueryFontTree, (PFN) VGADDIQueryFontTree},
44 {INDEX_DrvQueryTrueTypeOutline, (PFN) VGADDIQueryTrueTypeOutline},
45 {INDEX_DrvQueryTrueTypeTable, (PFN) VGADDIQueryTrueTypeTable},
46 {INDEX_DrvRealizeBrush, (PFN) VGADDIRealizeBrush},
47 {INDEX_DrvResetPDEV, (PFN) VGADDIResetPDEV},
48 {INDEX_DrvSetPalette, (PFN) VGADDISetPalette},
49 {INDEX_DrvSetPixelFormat, (PFN) VGADDISetPixelFormat},
50 {INDEX_DrvStretchBlt, (PFN) VGADDIStretchBlt},
51 {INDEX_DrvStrokePath, (PFN) VGADDIStrokePath},
52 {INDEX_DrvSwapBuffers, (PFN) VGADDISwapBuffers},
53 {INDEX_DrvTextOut, (PFN) VGADDITextOut},
54 {INDEX_DrvUnloadFontFile, (PFN) VGADDIUnloadFontFile},
55 #endif
56 };
57
58 static GDIINFO gaulCap = {
59 GDI_DRIVER_VERSION, // ulVersion
60 DT_RASDISPLAY, // ulTechnology
61 0, // ulHorzSize
62 0, // ulVertSize
63 0, // ulHorzRes (filled in at initialization)
64 0, // ulVertRes (filled in at initialization)
65 4, // cBitsPixel
66 1, // cPlanes
67 16, // ulNumColors
68 0, // flRaster (DDI reserved field)
69
70 96, // ulLogPixelsX (must be set to 96 according to MSDN)
71 96, // ulLogPixelsY (must be set to 96 according to MSDN)
72
73 TC_RA_ABLE | TC_SCROLLBLT, // flTextCaps
74
75 6, // ulDACRed
76 6, // ulDACGreen
77 6, // ulDACBlue
78
79 0x0024, // ulAspectX (one-to-one aspect ratio)
80 0x0024, // ulAspectY
81 0x0033, // ulAspectXY
82
83 1, // xStyleStep
84 1, // yStyleSte;
85 3, // denStyleStep
86
87 { 0, 0 }, // ptlPhysOffset
88 { 0, 0 }, // szlPhysSize
89
90 0, // ulNumPalReg (win3.1 16 color drivers say 0 too)
91
92 // These fields are for halftone initialization.
93
94 { // ciDevice, ColorInfo
95 { 6700, 3300, 0 }, // Red
96 { 2100, 7100, 0 }, // Green
97 { 1400, 800, 0 }, // Blue
98 { 1750, 3950, 0 }, // Cyan
99 { 4050, 2050, 0 }, // Magenta
100 { 4400, 5200, 0 }, // Yellow
101 { 3127, 3290, 0 }, // AlignmentWhite
102 20000, // RedGamma
103 20000, // GreenGamma
104 20000, // BlueGamma
105 0, 0, 0, 0, 0, 0
106 },
107
108 0, // ulDevicePelsDPI
109 PRIMARY_ORDER_CBA, // ulPrimaryOrder
110 HT_PATSIZE_4x4_M, // ulHTPatternSize
111 HT_FORMAT_4BPP_IRGB, // ulHTOutputFormat
112 HT_FLAG_ADDITIVE_PRIMS, // flHTFlags
113
114 0, // ulVRefresh
115 8, // ulBltAlignment
116 0, // ulPanningHorzRes
117 0, // ulPanningVertRes
118
119 0, // xPanningAlignment
120 0, // yPanningAlignment
121 0, // cxHTPat
122 0, // cyHTPat
123 NULL, // pHTPatA
124 NULL, // pHTPatB
125 NULL, // pHTPatC
126 0, // flShadeBlend
127 0, // ulPhysicalPixelCharacteristics
128 0 // ulPhysicalPixelGamma
129 };
130
131 // Palette for VGA
132
133 typedef struct _VGALOGPALETTE
134 {
135 USHORT ident;
136 USHORT NumEntries;
137 PALETTEENTRY PaletteEntry[16];
138 } VGALOGPALETTE;
139
140 const VGALOGPALETTE VGApalette =
141 {
142
143 0x400, // driver version
144 16, // num entries
145 {
146 { 0x00, 0x00, 0x00, 0x00 }, // 0
147 { 0x80, 0x00, 0x00, 0x00 }, // 1
148 { 0x00, 0x80, 0x00, 0x00 }, // 2
149 { 0x80, 0x80, 0x00, 0x00 }, // 3
150 { 0x00, 0x00, 0x80, 0x00 }, // 4
151 { 0x80, 0x00, 0x80, 0x00 }, // 5
152 { 0x00, 0x80, 0x80, 0x00 }, // 6
153 { 0x80, 0x80, 0x80, 0x00 }, // 7
154 { 0xc0, 0xc0, 0xc0, 0x00 }, // 8
155 { 0xff, 0x00, 0x00, 0x00 }, // 9
156 { 0x00, 0xff, 0x00, 0x00 }, // 10
157 { 0xff, 0xff, 0x00, 0x00 }, // 11
158 { 0x00, 0x00, 0xff, 0x00 }, // 12
159 { 0xff, 0x00, 0xff, 0x00 }, // 13
160 { 0x00, 0xff, 0xff, 0x00 }, // 14
161 { 0xff, 0xff, 0xff, 0x00 } // 15
162 }
163 };
164
165 // Devinfo structure passed back to the engine in DrvEnablePDEV
166
167 #define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"System"}
168 #define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE, L"MS Sans Serif"}
169 #define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"}
170
171 DEVINFO devinfoVGA =
172 {
173 (GCAPS_OPAQUERECT | GCAPS_HORIZSTRIKE | GCAPS_ALTERNATEFILL | GCAPS_MONO_DITHER | GCAPS_COLOR_DITHER |
174 GCAPS_WINDINGFILL | GCAPS_DITHERONREALIZE
175 ), // Graphics capabilities
176
177 SYSTM_LOGFONT, // Default font description
178 HELVE_LOGFONT, // ANSI variable font description
179 COURI_LOGFONT, // ANSI fixed font description
180 0, // Count of device fonts
181 BMF_4BPP, // preferred DIB format
182 8, // Width of color dither
183 8, // Height of color dither
184 NULL, // Default palette to use for this device
185 0 // flGraphicsCaps2
186 };
187
188 BOOL APIENTRY
DrvEnableDriver(IN ULONG EngineVersion,IN ULONG SizeOfDED,OUT PDRVENABLEDATA DriveEnableData)189 DrvEnableDriver(IN ULONG EngineVersion,
190 IN ULONG SizeOfDED,
191 OUT PDRVENABLEDATA DriveEnableData)
192 {
193 DPRINT("DrvEnableDriver called...\n");
194
195 vgaPreCalc();
196
197 VGADDI_InitializeOffScreenMem((SCREEN_X * SCREEN_Y) >> 3, 65536 - ((SCREEN_X * SCREEN_Y) >> 3));
198
199 DriveEnableData->pdrvfn = FuncList;
200 DriveEnableData->c = sizeof(FuncList) / sizeof(DRVFN);
201 DriveEnableData->iDriverVersion = DDI_DRIVER_VERSION_NT4;
202
203 return TRUE;
204 }
205
206 // DrvDisableDriver
207 // DESCRIPTION:
208 // This function is called by the KMGDI at exit. It should cleanup.
209 // ARGUMENTS:
210 // NONE
211 // RETURNS:
212 // NONE
213
214 VOID APIENTRY
DrvDisableDriver(VOID)215 DrvDisableDriver(VOID)
216 {
217 return;
218 }
219
220 // ----------------------------------------------- Driver Implementation
221
222
223 // DrvEnablePDEV
224 // DESCRIPTION:
225 // This function is called after DrvEnableDriver to get information
226 // about the mode that is to be used. This function just returns
227 // information, and should not yet initialize the mode.
228 // ARGUMENTS:
229 // IN DEVMODEW * DM Describes the mode requested
230 // IN LPWSTR LogAddress
231 // IN ULONG PatternCount number of patterns expected
232 // OUT HSURF * SurfPatterns array to contain pattern handles
233 // IN ULONG GDIInfoSize the size of the GDIInfo object passed in
234 // OUT ULONG * GDIInfo GDI Info object
235 // IN ULONG DevInfoSize the size of the DevInfo object passed in
236 // OUT ULONG * DevInfo Device Info object
237 // IN LPWSTR DevDataFile ignore
238 // IN LPWSTR DeviceName Device name
239 // IN HANDLE Driver handle to KM driver
240 // RETURNS:
241 // DHPDEV a handle to a DPev object
242
243 DHPDEV APIENTRY
DrvEnablePDEV(IN DEVMODEW * DM,IN LPWSTR LogAddress,IN ULONG PatternCount,OUT HSURF * SurfPatterns,IN ULONG GDIInfoSize,OUT ULONG * GDIInfo,IN ULONG DevInfoSize,OUT DEVINFO * DevInfo,IN HDEV Dev,IN LPWSTR DeviceName,IN HANDLE Driver)244 DrvEnablePDEV(IN DEVMODEW *DM,
245 IN LPWSTR LogAddress,
246 IN ULONG PatternCount,
247 OUT HSURF *SurfPatterns,
248 IN ULONG GDIInfoSize,
249 OUT ULONG *GDIInfo,
250 IN ULONG DevInfoSize,
251 OUT DEVINFO *DevInfo,
252 IN HDEV Dev,
253 IN LPWSTR DeviceName,
254 IN HANDLE Driver)
255 {
256 PPDEV PDev;
257
258 PDev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG);
259 if (PDev == NULL)
260 {
261 DPRINT1("EngAllocMem failed for PDEV\n");
262 return NULL;
263 }
264 PDev->KMDriver = Driver;
265 DPRINT( "PDev: %x, Driver: %x\n", PDev, PDev->KMDriver );
266
267 gaulCap.ulHorzRes = SCREEN_X;
268 gaulCap.ulVertRes = SCREEN_Y;
269 if (sizeof(GDIINFO) < GDIInfoSize)
270 GDIInfoSize = sizeof(GDIINFO);
271 memcpy(GDIInfo, &gaulCap, GDIInfoSize);
272 DM->dmBitsPerPel = gaulCap.cBitsPixel * gaulCap.cPlanes;
273 DM->dmPelsWidth = gaulCap.ulHorzRes;
274 DM->dmPelsHeight = gaulCap.ulVertRes;
275
276 devinfoVGA.hpalDefault = EngCreatePalette(PAL_INDEXED, 16, (ULONG *) VGApalette.PaletteEntry, 0, 0, 0);
277 if (sizeof(DEVINFO) < DevInfoSize)
278 DevInfoSize = sizeof(DEVINFO);
279 memcpy(DevInfo, &devinfoVGA, DevInfoSize);
280
281 return (DHPDEV) PDev;
282 }
283
284 // DrvCompletePDEV
285 // DESCRIPTION
286 // Called after initialization of PDEV is complete. Supplies
287 // a reference to the GDI handle for the PDEV.
288
289 VOID APIENTRY
DrvCompletePDEV(IN DHPDEV PDev,IN HDEV Dev)290 DrvCompletePDEV(IN DHPDEV PDev,
291 IN HDEV Dev)
292 {
293 ((PPDEV) PDev)->GDIDevHandle = Dev; // Handle to the DC
294 }
295
296 BOOL APIENTRY
DrvAssertMode(IN DHPDEV DPev,IN BOOL Enable)297 DrvAssertMode(IN DHPDEV DPev,
298 IN BOOL Enable)
299 {
300 PPDEV ppdev = (PPDEV)DPev;
301 ULONG returnedDataLength;
302
303 if (Enable)
304 {
305 /* Reenable our graphics mode */
306 if (!InitPointer(ppdev))
307 {
308 /* Failed to set pointer */
309 return FALSE;
310 }
311
312 if (!VGAInitialized)
313 {
314 if (!InitVGA(ppdev, FALSE))
315 {
316 /* Failed to initialize the VGA */
317 return FALSE;
318 }
319 VGAInitialized = TRUE;
320 }
321 }
322 else
323 {
324 /* Go back to last known mode */
325 DPRINT("ppdev: %p, KMDriver: %p\n", ppdev, ppdev->KMDriver);
326 if (EngDeviceIoControl(ppdev->KMDriver, IOCTL_VIDEO_RESET_DEVICE, NULL, 0, NULL, 0, &returnedDataLength))
327 {
328 /* Failed to go back to mode */
329 return FALSE;
330 }
331 VGAInitialized = FALSE;
332 }
333 return TRUE;
334 }
335
336 VOID APIENTRY
DrvDisablePDEV(IN DHPDEV PDev)337 DrvDisablePDEV(IN DHPDEV PDev)
338 {
339 PPDEV ppdev = (PPDEV)PDev;
340
341 /* EngDeletePalette(devinfoVGA.hpalDefault); */
342 if (ppdev->pjPreallocSSBBuffer)
343 EngFreeMem(ppdev->pjPreallocSSBBuffer);
344
345 if (ppdev->pucDIB4ToVGAConvBuffer)
346 EngFreeMem(ppdev->pucDIB4ToVGAConvBuffer);
347
348 DPRINT("Freeing PDEV\n");
349 EngFreeMem(PDev);
350 }
351
352 VOID APIENTRY
DrvDisableSurface(IN DHPDEV PDev)353 DrvDisableSurface(IN DHPDEV PDev)
354 {
355 PPDEV ppdev = (PPDEV)PDev;
356 PDEVSURF pdsurf = ppdev->AssociatedSurf;
357
358 DPRINT("KMDriver: %x\n", ppdev->KMDriver);
359 DeinitVGA(ppdev);
360 /* EngFreeMem(pdsurf->BankSelectInfo); */
361
362 if (pdsurf->BankInfo != NULL)
363 EngFreeMem(pdsurf->BankInfo);
364 if (pdsurf->BankInfo2RW != NULL)
365 EngFreeMem(pdsurf->BankInfo2RW);
366 if (pdsurf->BankBufferPlane0 != NULL)
367 EngFreeMem(pdsurf->BankBufferPlane0);
368 if (ppdev->pPointerAttributes != NULL)
369 EngFreeMem(ppdev->pPointerAttributes);
370
371 /* free any pending saved screen bit blocks */
372 #if 0
373 pSSB = pdsurf->ssbList;
374 while (pSSB != NULL)
375 {
376 /* Point to the next saved screen bits block */
377 pSSBNext = (PSAVED_SCREEN_BITS) pSSB->pvNextSSB;
378
379 /* Free the current block */
380 EngFreeMem(pSSB);
381 pSSB = pSSBNext;
382 }
383 #endif
384 EngDeleteSurface((HSURF) ppdev->SurfHandle);
385 /* EngFreeMem(pdsurf); */ /* free the surface */
386 }
387
388 static VOID
InitSavedBits(IN PPDEV ppdev)389 InitSavedBits(IN PPDEV ppdev)
390 {
391 if (!(ppdev->fl & DRIVER_OFFSCREEN_REFRESHED))
392 return;
393
394 /* set up rect to right of visible screen */
395 ppdev->SavedBitsRight.left = ppdev->sizeSurf.cx;
396 ppdev->SavedBitsRight.top = 0;
397 ppdev->SavedBitsRight.right = ppdev->sizeMem.cx - PLANAR_PELS_PER_CPU_ADDRESS;
398 ppdev->SavedBitsRight.bottom = ppdev->sizeSurf.cy;
399
400 if ((ppdev->SavedBitsRight.right <= ppdev->SavedBitsRight.left) ||
401 (ppdev->SavedBitsRight.bottom <= ppdev->SavedBitsRight.top))
402 {
403 ppdev->SavedBitsRight.left = 0;
404 ppdev->SavedBitsRight.top = 0;
405 ppdev->SavedBitsRight.right = 0;
406 ppdev->SavedBitsRight.bottom = 0;
407 }
408
409 /* set up rect below visible screen */
410 ppdev->SavedBitsBottom.left = 0;
411 ppdev->SavedBitsBottom.top = ppdev->sizeSurf.cy;
412 ppdev->SavedBitsBottom.right = ppdev->sizeMem.cx - PLANAR_PELS_PER_CPU_ADDRESS;
413 ppdev->SavedBitsBottom.bottom = ppdev->sizeMem.cy - ppdev->NumScansUsedByPointer;
414
415 if ((ppdev->SavedBitsBottom.right <= ppdev->SavedBitsBottom.left) ||
416 (ppdev->SavedBitsBottom.bottom <= ppdev->SavedBitsBottom.top))
417 {
418 ppdev->SavedBitsBottom.left = 0;
419 ppdev->SavedBitsBottom.top = 0;
420 ppdev->SavedBitsBottom.right = 0;
421 ppdev->SavedBitsBottom.bottom = 0;
422 }
423
424 ppdev->BitsSaved = FALSE;
425 }
426
427 HSURF APIENTRY
DrvEnableSurface(IN DHPDEV PDev)428 DrvEnableSurface(IN DHPDEV PDev)
429 {
430 PPDEV ppdev = (PPDEV)PDev;
431 PDEVSURF pdsurf;
432 DHSURF dhsurf;
433 HSURF hsurf;
434
435 DPRINT("DrvEnableSurface() called\n");
436
437 /* Initialize the VGA */
438 if (!VGAInitialized)
439 {
440 if (!InitVGA(ppdev, TRUE))
441 goto error_done;
442 VGAInitialized = TRUE;
443 }
444
445 /* dhsurf is of type DEVSURF, which is the drivers specialized surface type */
446 dhsurf = (DHSURF)EngAllocMem(0, sizeof(DEVSURF), ALLOC_TAG);
447 if (dhsurf == NULL)
448 goto error_done;
449
450 pdsurf = (PDEVSURF) dhsurf;
451 pdsurf->ident = DEVSURF_IDENT;
452 pdsurf->flSurf = 0;
453 pdsurf->Format = BMF_PHYSDEVICE;
454 pdsurf->jReserved1 = 0;
455 pdsurf->jReserved2 = 0;
456 pdsurf->ppdev = ppdev;
457 pdsurf->sizeSurf.cx = ppdev->sizeSurf.cx;
458 pdsurf->sizeSurf.cy = ppdev->sizeSurf.cy;
459 pdsurf->NextPlane = 0;
460 pdsurf->Scan0 = ppdev->fbScreen;
461 pdsurf->BitmapStart = ppdev->fbScreen;
462 pdsurf->StartBmp = ppdev->fbScreen;
463 pdsurf->BankInfo = NULL;
464 pdsurf->BankInfo2RW = NULL;
465 pdsurf->BankBufferPlane0 = NULL;
466
467 /* pdsurf->Conv = &ConvertBuffer[0]; */
468
469 if (!InitPointer(ppdev))
470 {
471 DPRINT1("DrvEnablePDEV failed bInitPointer\n");
472 goto error_clean;
473 }
474
475 /* if (!SetUpBanking(pdsurf, ppdev))
476 {
477 DPRINT1("DrvEnablePDEV failed SetUpBanking\n");
478 goto error_clean;
479 } BANKING CODE UNIMPLEMENTED */
480
481 if ((hsurf = EngCreateDeviceSurface(dhsurf, ppdev->sizeSurf, BMF_4BPP)) ==
482 NULL)
483 {
484 /* Call to EngCreateDeviceSurface failed */
485 DPRINT("EngCreateDeviceSurface call failed\n");
486 goto error_clean;
487 }
488
489 InitSavedBits(ppdev);
490
491 if (EngAssociateSurface(hsurf, ppdev->GDIDevHandle, HOOK_BITBLT | HOOK_PAINT | HOOK_LINETO | HOOK_COPYBITS |
492 HOOK_TRANSPARENTBLT))
493 {
494 DPRINT("Successfully associated surface\n");
495 ppdev->SurfHandle = hsurf;
496 ppdev->AssociatedSurf = pdsurf;
497
498 /* Set up an empty saved screen block list */
499 pdsurf->ssbList = NULL;
500
501 return hsurf;
502 }
503 DPRINT("EngAssociateSurface() failed\n");
504 EngDeleteSurface(hsurf);
505
506 error_clean:
507 EngFreeMem(dhsurf);
508
509 error_done:
510 return NULL;
511 }
512
513 ULONG APIENTRY
DrvGetModes(IN HANDLE Driver,IN ULONG DataSize,OUT PDEVMODEW DM)514 DrvGetModes(IN HANDLE Driver,
515 IN ULONG DataSize,
516 OUT PDEVMODEW DM)
517 {
518 DWORD NumModes;
519 DWORD ModeSize;
520 DWORD OutputSize;
521 DWORD OutputModes = DataSize / (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
522 PVIDEO_MODE_INFORMATION VideoModeInformation, VideoTemp;
523
524 NumModes = getAvailableModes(Driver,
525 (PVIDEO_MODE_INFORMATION *) &VideoModeInformation,
526 &ModeSize);
527
528 if (NumModes == 0)
529 return 0;
530
531 if (DM == NULL)
532 {
533 OutputSize = NumModes * (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
534 }
535 else
536 {
537 OutputSize=0;
538 VideoTemp = VideoModeInformation;
539
540 do
541 {
542 if (VideoTemp->Length != 0)
543 {
544 if (OutputModes == 0)
545 break;
546
547 memset(DM, 0, sizeof(DEVMODEW));
548 memcpy(DM->dmDeviceName, DLL_NAME, sizeof(DLL_NAME));
549
550 DM->dmSpecVersion = DM_SPECVERSION;
551 DM->dmDriverVersion = DM_SPECVERSION;
552 DM->dmSize = sizeof(DEVMODEW);
553 DM->dmDriverExtra = DRIVER_EXTRA_SIZE;
554 DM->dmBitsPerPel = VideoTemp->NumberOfPlanes *
555 VideoTemp->BitsPerPlane;
556 DM->dmPelsWidth = VideoTemp->VisScreenWidth;
557 DM->dmPelsHeight = VideoTemp->VisScreenHeight;
558 DM->dmDisplayFrequency = VideoTemp->Frequency;
559 DM->dmDisplayFlags = 0;
560
561 DM->dmFields = DM_BITSPERPEL |
562 DM_PELSWIDTH |
563 DM_PELSHEIGHT |
564 DM_DISPLAYFREQUENCY |
565 DM_DISPLAYFLAGS ;
566
567 /* next DEVMODE entry */
568 OutputModes--;
569
570 DM = (PDEVMODEW) ( ((ULONG_PTR)DM) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
571
572 OutputSize += (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE);
573 }
574
575 VideoTemp = (PVIDEO_MODE_INFORMATION)(((PUCHAR)VideoTemp) + ModeSize);
576
577 } while (--NumModes);
578 }
579 return OutputSize;
580 }
581
DbgPrint(PCCH Format,...)582 ULONG DbgPrint(PCCH Format,...)
583 {
584 va_list ap;
585 va_start(ap, Format);
586 EngDebugPrint("VGADDI", (PCHAR)Format, ap);
587 va_end(ap);
588 return 0;
589 }
590
591 /* EOF */
592