ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

xboxvmp.c
Go to the documentation of this file.
00001 /*
00002  * ReactOS Xbox miniport video driver
00003  * Copyright (C) 2004 Gé van Geldorp
00004  *
00005  * Based on VBE miniport video driver
00006  * Copyright (C) 2004 Filip Navara
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License along
00019  * with this program; if not, write to the Free Software Foundation, Inc.,
00020  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00021  *
00022  * TODO:
00023  * - Check input parameters everywhere.
00024  * - Call VideoPortVerifyAccessRanges to reserve the memory we're about
00025  *   to map.
00026  */
00027 
00028 /* INCLUDES *******************************************************************/
00029 
00030 #include "xboxvmp.h"
00031 
00032 #define I2C_IO_BASE 0xc000
00033 
00034 #define CONTROL_FRAMEBUFFER_ADDRESS_OFFSET 0x600800
00035 
00036 /* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
00037 
00038 ULONG NTAPI
00039 DriverEntry(IN PVOID Context1, IN PVOID Context2)
00040 {
00041   VIDEO_HW_INITIALIZATION_DATA InitData;
00042 
00043   VideoPortZeroMemory(&InitData, sizeof(InitData));
00044   InitData.AdapterInterfaceType = PCIBus;
00045   InitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA);
00046   InitData.HwFindAdapter = XboxVmpFindAdapter;
00047   InitData.HwInitialize = XboxVmpInitialize;
00048   InitData.HwStartIO = XboxVmpStartIO;
00049   InitData.HwResetHw = XboxVmpResetHw;
00050   InitData.HwGetPowerState = XboxVmpGetPowerState;
00051   InitData.HwSetPowerState = XboxVmpSetPowerState;
00052   InitData.HwDeviceExtensionSize = sizeof(XBOXVMP_DEVICE_EXTENSION);
00053 
00054   return VideoPortInitialize(Context1, Context2, &InitData, NULL);
00055 }
00056 
00057 /*
00058  * XboxVmpFindAdapter
00059  *
00060  * Detects the Xbox Nvidia display adapter.
00061  */
00062 
00063 VP_STATUS NTAPI
00064 XboxVmpFindAdapter(
00065    IN PVOID HwDeviceExtension,
00066    IN PVOID HwContext,
00067    IN PWSTR ArgumentString,
00068    IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
00069    OUT PUCHAR Again)
00070 {
00071   PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
00072   VIDEO_ACCESS_RANGE AccessRanges[3];
00073   VP_STATUS Status;
00074 
00075   VideoPortDebugPrint(Trace, "XboxVmpFindAdapter\n");
00076 
00077   XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION) HwDeviceExtension;
00078   Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL, 3, AccessRanges,
00079                                     NULL, NULL, NULL);
00080 
00081   if (NO_ERROR == Status)
00082     {
00083       XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
00084       XboxVmpDeviceExtension->ControlLength = AccessRanges[0].RangeLength;
00085       XboxVmpDeviceExtension->PhysFrameBufferStart = AccessRanges[1].RangeStart;
00086     }
00087 
00088   return Status;
00089 }
00090 
00091 /*
00092  * XboxVmpInitialize
00093  *
00094  * Performs the first initialization of the adapter, after the HAL has given
00095  * up control of the video hardware to the video port driver.
00096  */
00097 
00098 BOOLEAN NTAPI
00099 XboxVmpInitialize(PVOID HwDeviceExtension)
00100 {
00101   PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
00102   ULONG inIoSpace = VIDEO_MEMORY_SPACE_MEMORY;
00103   ULONG Length;
00104 
00105   VideoPortDebugPrint(Trace, "XboxVmpInitialize\n");
00106 
00107   XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION) HwDeviceExtension;
00108 
00109   Length = XboxVmpDeviceExtension->ControlLength;
00110   XboxVmpDeviceExtension->VirtControlStart = NULL;
00111   if (NO_ERROR != VideoPortMapMemory(HwDeviceExtension,
00112                                      XboxVmpDeviceExtension->PhysControlStart,
00113                                      &Length, &inIoSpace,
00114                                      &XboxVmpDeviceExtension->VirtControlStart))
00115     {
00116       VideoPortDebugPrint(Error, "Failed to map control memory\n");
00117       return FALSE;
00118     }
00119   VideoPortDebugPrint(Info, "Mapped 0x%x bytes of control mem at 0x%x to virt addr 0x%x\n",
00120          XboxVmpDeviceExtension->ControlLength,
00121          XboxVmpDeviceExtension->PhysControlStart.u.LowPart,
00122          XboxVmpDeviceExtension->VirtControlStart);
00123 
00124   return TRUE;
00125 }
00126 
00127 /*
00128  * XboxVmpStartIO
00129  *
00130  * Processes the specified Video Request Packet.
00131  */
00132 
00133 BOOLEAN NTAPI
00134 XboxVmpStartIO(
00135    PVOID HwDeviceExtension,
00136    PVIDEO_REQUEST_PACKET RequestPacket)
00137 {
00138   BOOLEAN Result;
00139 
00140   RequestPacket->StatusBlock->Status = ERROR_INVALID_PARAMETER;
00141 
00142   switch (RequestPacket->IoControlCode)
00143     {
00144       case IOCTL_VIDEO_SET_CURRENT_MODE:
00145         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_SET_CURRENT_MODE\n");
00146         if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
00147           {
00148             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00149             return TRUE;
00150           }
00151         Result = XboxVmpSetCurrentMode(
00152             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00153             (PVIDEO_MODE)RequestPacket->InputBuffer,
00154             RequestPacket->StatusBlock);
00155         break;
00156 
00157       case IOCTL_VIDEO_RESET_DEVICE:
00158         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_RESET_DEVICE\n");
00159         Result = XboxVmpResetDevice(
00160             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00161             RequestPacket->StatusBlock);
00162         break;
00163 
00164       case IOCTL_VIDEO_MAP_VIDEO_MEMORY:
00165         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_MAP_VIDEO_MEMORY\n");
00166         if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
00167             RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
00168           {
00169             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00170             return TRUE;
00171           }
00172         Result = XboxVmpMapVideoMemory(
00173             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00174             (PVIDEO_MEMORY)RequestPacket->InputBuffer,
00175             (PVIDEO_MEMORY_INFORMATION)RequestPacket->OutputBuffer,
00176             RequestPacket->StatusBlock);
00177         break;
00178 
00179       case IOCTL_VIDEO_UNMAP_VIDEO_MEMORY:
00180         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_UNMAP_VIDEO_MEMORY\n");
00181         if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
00182           {
00183             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00184             return TRUE;
00185           }
00186         Result = XboxVmpUnmapVideoMemory(
00187             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00188             (PVIDEO_MEMORY)RequestPacket->InputBuffer,
00189             RequestPacket->StatusBlock);
00190         break;
00191 
00192       case IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES:
00193         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES\n");
00194         if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
00195           {
00196             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00197             return TRUE;
00198           }
00199         Result = XboxVmpQueryNumAvailModes(
00200             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00201             (PVIDEO_NUM_MODES)RequestPacket->OutputBuffer,
00202             RequestPacket->StatusBlock);
00203         break;
00204 
00205       case IOCTL_VIDEO_QUERY_AVAIL_MODES:
00206         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_QUERY_AVAIL_MODES\n");
00207         if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
00208           {
00209             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00210             return TRUE;
00211           }
00212         Result = XboxVmpQueryAvailModes(
00213             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00214             (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
00215             RequestPacket->StatusBlock);
00216         break;
00217 
00218       case IOCTL_VIDEO_QUERY_CURRENT_MODE:
00219         VideoPortDebugPrint(Trace, "XboxVmpStartIO IOCTL_VIDEO_QUERY_CURRENT_MODE\n");
00220         if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
00221           {
00222             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
00223             return TRUE;
00224           }
00225         Result = XboxVmpQueryCurrentMode(
00226             (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
00227             (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
00228             RequestPacket->StatusBlock);
00229         break;
00230 
00231       default:
00232         VideoPortDebugPrint(Warn, "XboxVmpStartIO 0x%x not implemented\n");
00233         RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
00234         return FALSE;
00235     }
00236 
00237   if (Result)
00238     {
00239       RequestPacket->StatusBlock->Status = NO_ERROR;
00240     }
00241 
00242   return TRUE;
00243 }
00244 
00245 /*
00246  * XboxVmpResetHw
00247  *
00248  * This function is called to reset the hardware to a known state.
00249  */
00250 
00251 BOOLEAN NTAPI
00252 XboxVmpResetHw(
00253    PVOID DeviceExtension,
00254    ULONG Columns,
00255    ULONG Rows)
00256 {
00257   VideoPortDebugPrint(Trace, "XboxVmpResetHw\n");
00258 
00259   if (! XboxVmpResetDevice((PXBOXVMP_DEVICE_EXTENSION) DeviceExtension, NULL))
00260     {
00261       return FALSE;
00262     }
00263 
00264    return TRUE;
00265 }
00266 
00267 /*
00268  * XboxVmpGetPowerState
00269  *
00270  * Queries whether the device can support the requested power state.
00271  */
00272 
00273 VP_STATUS NTAPI
00274 XboxVmpGetPowerState(
00275    PVOID HwDeviceExtension,
00276    ULONG HwId,
00277    PVIDEO_POWER_MANAGEMENT VideoPowerControl)
00278 {
00279   VideoPortDebugPrint(Error, "XboxVmpGetPowerState is not supported\n");
00280 
00281   return ERROR_INVALID_FUNCTION;
00282 }
00283 
00284 /*
00285  * XboxVmpSetPowerState
00286  *
00287  * Sets the power state of the specified device
00288  */
00289 
00290 VP_STATUS NTAPI
00291 XboxVmpSetPowerState(
00292    PVOID HwDeviceExtension,
00293    ULONG HwId,
00294    PVIDEO_POWER_MANAGEMENT VideoPowerControl)
00295 {
00296   VideoPortDebugPrint(Error, "XboxVmpSetPowerState not supported\n");
00297 
00298   return ERROR_INVALID_FUNCTION;
00299 }
00300 
00301 /*
00302  * VBESetCurrentMode
00303  *
00304  * Sets the adapter to the specified operating mode.
00305  */
00306 
00307 BOOLEAN FASTCALL
00308 XboxVmpSetCurrentMode(
00309    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00310    PVIDEO_MODE RequestedMode,
00311    PSTATUS_BLOCK StatusBlock)
00312 {
00313   if (0 != RequestedMode->RequestedMode)
00314     {
00315       return FALSE;
00316     }
00317 
00318   /* Nothing to do, really. We only support a single mode and we're already
00319      in that mode */
00320   return TRUE;
00321 }
00322 
00323 /*
00324  * XboxVmpResetDevice
00325  *
00326  * Resets the video hardware to the default mode, to which it was initialized
00327  * at system boot.
00328  */
00329 
00330 BOOLEAN FASTCALL
00331 XboxVmpResetDevice(
00332    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00333    PSTATUS_BLOCK StatusBlock)
00334 {
00335   /* There is nothing to be done here */
00336 
00337   return TRUE;
00338 }
00339 
00340 /*
00341  * XboxVmpMapVideoMemory
00342  *
00343  * Maps the video hardware frame buffer and video RAM into the virtual address
00344  * space of the requestor.
00345  */
00346 
00347 BOOLEAN FASTCALL
00348 XboxVmpMapVideoMemory(
00349    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00350    PVIDEO_MEMORY RequestedAddress,
00351    PVIDEO_MEMORY_INFORMATION MapInformation,
00352    PSTATUS_BLOCK StatusBlock)
00353 {
00354   PHYSICAL_ADDRESS FrameBuffer;
00355   ULONG inIoSpace = VIDEO_MEMORY_SPACE_MEMORY;
00356   SYSTEM_BASIC_INFORMATION BasicInfo;
00357   ULONG Length;
00358 
00359   /* FIXME: this should probably be done differently, without native API */
00360   StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
00361 
00362   FrameBuffer.u.HighPart = 0;
00363   if (ZwQuerySystemInformation(SystemBasicInformation,
00364                                           (PVOID) &BasicInfo,
00365                                           sizeof(SYSTEM_BASIC_INFORMATION),
00366                                           &Length) == NO_ERROR)
00367     {
00368       FrameBuffer.u.LowPart = BasicInfo.HighestPhysicalPageNumber * PAGE_SIZE;
00369     }
00370   else
00371     {
00372       VideoPortDebugPrint(Error, "ZwQueryBasicInformation failed, assuming 64MB total memory\n");
00373       FrameBuffer.u.LowPart = 60 * 1024 * 1024;
00374     }
00375 
00376   FrameBuffer.QuadPart += DeviceExtension->PhysFrameBufferStart.QuadPart;
00377   MapInformation->VideoRamBase = RequestedAddress->RequestedVirtualAddress;
00378   MapInformation->VideoRamLength = 4 * 1024 * 1024;
00379   VideoPortMapMemory(DeviceExtension, FrameBuffer,
00380       &MapInformation->VideoRamLength, &inIoSpace,
00381       &MapInformation->VideoRamBase);
00382 
00383   MapInformation->FrameBufferBase = MapInformation->VideoRamBase;
00384   MapInformation->FrameBufferLength = MapInformation->VideoRamLength;
00385 
00386   /* Tell the nVidia controller about the framebuffer */
00387   *((PULONG)((char *) DeviceExtension->VirtControlStart + CONTROL_FRAMEBUFFER_ADDRESS_OFFSET)) = FrameBuffer.u.LowPart;
00388 
00389   VideoPortDebugPrint(Info, "Mapped 0x%x bytes of phys mem at 0x%lx to virt addr 0x%p\n",
00390           MapInformation->VideoRamLength, FrameBuffer.u.LowPart, MapInformation->VideoRamBase);
00391 
00392   return TRUE;
00393 }
00394 
00395 /*
00396  * VBEUnmapVideoMemory
00397  *
00398  * Releases a mapping between the virtual address space and the adapter's
00399  * frame buffer and video RAM.
00400  */
00401 
00402 BOOLEAN FASTCALL
00403 XboxVmpUnmapVideoMemory(
00404    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00405    PVIDEO_MEMORY VideoMemory,
00406    PSTATUS_BLOCK StatusBlock)
00407 {
00408   VideoPortUnmapMemory(DeviceExtension, VideoMemory->RequestedVirtualAddress,
00409                        NULL);
00410 
00411   return TRUE;
00412 }
00413 
00414 /*
00415  * XboxVmpQueryNumAvailModes
00416  *
00417  * Returns the number of video modes supported by the adapter and the size
00418  * in bytes of the video mode information, which can be used to allocate a
00419  * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
00420  */
00421 
00422 BOOLEAN FASTCALL
00423 XboxVmpQueryNumAvailModes(
00424    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00425    PVIDEO_NUM_MODES Modes,
00426    PSTATUS_BLOCK StatusBlock)
00427 {
00428   Modes->NumModes = 1;
00429   Modes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
00430   StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
00431   return TRUE;
00432 }
00433 
00434 static BOOLEAN
00435 ReadfromSMBus(UCHAR Address, UCHAR bRegister, UCHAR Size, ULONG *Data_to_smbus)
00436 {
00437   int nRetriesToLive=50;
00438 
00439   while (0 != (VideoPortReadPortUshort((PUSHORT) (I2C_IO_BASE + 0)) & 0x0800))
00440     {
00441       ;  /* Franz's spin while bus busy with any master traffic */
00442     }
00443 
00444   while (0 != nRetriesToLive--)
00445     {
00446       UCHAR b;
00447       int temp;
00448 
00449       VideoPortWritePortUchar((PUCHAR) (I2C_IO_BASE + 4), (Address << 1) | 1);
00450       VideoPortWritePortUchar((PUCHAR) (I2C_IO_BASE + 8), bRegister);
00451 
00452       temp = VideoPortReadPortUshort((PUSHORT) (I2C_IO_BASE + 0));
00453       VideoPortWritePortUshort((PUSHORT) (I2C_IO_BASE + 0), temp);  /* clear down all preexisting errors */
00454 
00455       switch (Size)
00456         {
00457           case 4:
00458             VideoPortWritePortUchar((PUCHAR) (I2C_IO_BASE + 2), 0x0d);      /* DWORD modus ? */
00459             break;
00460           case 2:
00461             VideoPortWritePortUchar((PUCHAR) (I2C_IO_BASE + 2), 0x0b);      /* WORD modus */
00462             break;
00463           default:
00464             VideoPortWritePortUchar((PUCHAR) (I2C_IO_BASE + 2), 0x0a);      // BYTE
00465             break;
00466         }
00467 
00468       b = 0;
00469 
00470       while (0 == (b & 0x36))
00471         {
00472           b = VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 0));
00473         }
00474 
00475       if (0 != (b & 0x24))
00476         {
00477           /* printf("I2CTransmitByteGetReturn error %x\n", b); */
00478         }
00479 
00480       if(0 == (b & 0x10))
00481         {
00482           /* printf("I2CTransmitByteGetReturn no complete, retry\n"); */
00483         }
00484       else
00485         {
00486           switch (Size)
00487             {
00488               case 4:
00489                 VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 6));
00490                 VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 9));
00491                 VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 9));
00492                 VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 9));
00493                 VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 9));
00494                 break;
00495               case 2:
00496                 *Data_to_smbus = VideoPortReadPortUshort((PUSHORT) (I2C_IO_BASE + 6));
00497                 break;
00498               default:
00499                 *Data_to_smbus = VideoPortReadPortUchar((PUCHAR) (I2C_IO_BASE + 6));
00500                 break;
00501             }
00502 
00503 
00504           return TRUE;
00505         }
00506     }
00507 
00508   return FALSE;
00509 }
00510 
00511 
00512 static BOOLEAN
00513 I2CTransmitByteGetReturn(UCHAR bPicAddressI2cFormat, UCHAR bDataToWrite, ULONG *Return)
00514 {
00515   return ReadfromSMBus(bPicAddressI2cFormat, bDataToWrite, 1, Return);
00516 }
00517 
00518 /*
00519  * XboxVmpQueryAvailModes
00520  *
00521  * Returns information about each video mode supported by the adapter.
00522  */
00523 
00524 BOOLEAN FASTCALL
00525 XboxVmpQueryAvailModes(
00526    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00527    PVIDEO_MODE_INFORMATION VideoMode,
00528    PSTATUS_BLOCK StatusBlock)
00529 {
00530   return XboxVmpQueryCurrentMode(DeviceExtension, VideoMode, StatusBlock);
00531 }
00532 
00533 /*
00534  * VBEQueryCurrentMode
00535  *
00536  * Returns information about current video mode.
00537  */
00538 
00539 BOOLEAN FASTCALL
00540 XboxVmpQueryCurrentMode(
00541    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
00542    PVIDEO_MODE_INFORMATION VideoMode,
00543    PSTATUS_BLOCK StatusBlock)
00544 {
00545   ULONG AvMode = 0;
00546 
00547   VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
00548   VideoMode->ModeIndex = 0;
00549   if (I2CTransmitByteGetReturn(0x10, 0x04, &AvMode))
00550     {
00551       if (1 == AvMode) /* HDTV */
00552         {
00553           VideoMode->VisScreenWidth = 720;
00554         }
00555       else
00556         {
00557           /* FIXME Other possible values of AvMode:
00558            * 0 - AV_SCART_RGB
00559            * 2 - AV_VGA_SOG
00560            * 4 - AV_SVIDEO
00561            * 6 - AV_COMPOSITE
00562            * 7 - AV_VGA
00563            * other AV_COMPOSITE
00564            */
00565           VideoMode->VisScreenWidth = 640;
00566         }
00567     }
00568   else
00569     {
00570       VideoMode->VisScreenWidth = 640;
00571     }
00572    VideoMode->VisScreenHeight = 480;
00573    VideoMode->ScreenStride = VideoMode->VisScreenWidth * 4;
00574    VideoMode->NumberOfPlanes = 1;
00575    VideoMode->BitsPerPlane = 32;
00576    VideoMode->Frequency = 1;
00577    VideoMode->XMillimeter = 0; /* FIXME */
00578    VideoMode->YMillimeter = 0; /* FIXME */
00579    VideoMode->NumberRedBits = 8;
00580    VideoMode->NumberGreenBits = 8;
00581    VideoMode->NumberBlueBits = 8;
00582    VideoMode->RedMask = 0xff0000;
00583    VideoMode->GreenMask = 0x00ff00;
00584    VideoMode->BlueMask = 0x0000ff;
00585    VideoMode->VideoMemoryBitmapWidth = VideoMode->VisScreenWidth;
00586    VideoMode->VideoMemoryBitmapHeight = VideoMode->VisScreenHeight;
00587    VideoMode->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR |
00588       VIDEO_MODE_NO_OFF_SCREEN;
00589    VideoMode->DriverSpecificAttributeFlags = 0;
00590 
00591    StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
00592 
00593    return TRUE;
00594 }
00595 
00596 /* EOF */

Generated on Sat May 26 2012 04:36:58 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.