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

vgaddi.h
Go to the documentation of this file.
00001 #define _WINBASE_
00002 #define _WINDOWS_H
00003 #include <stdarg.h>
00004 #include <windef.h>
00005 #include <guiddef.h>
00006 #include <wingdi.h>
00007 #include <winddi.h>
00008 #include <winioctl.h>
00009 #include <ntddvdeo.h>
00010 #include <ioaccess.h>
00011 
00012 #include "vgavideo/vgavideo.h"
00013 #include "objects/brush.h"
00014 #include "objects/bitblt.h"
00015 
00016 #ifndef NDEBUG
00017 #define DPRINT DbgPrint
00018 #else
00019 #define DPRINT
00020 #endif
00021 #define DPRINT1 DbgPrint
00022 
00023 /* FIXME - what a headers mess.... */
00024 
00025 #define DDKFASTAPI __fastcall
00026 #define FASTCALL __fastcall
00027 
00028 ULONG DbgPrint(PCCH Format,...);
00029 
00030 static __inline BOOLEAN
00031 RemoveEntryList(
00032   IN PLIST_ENTRY  Entry)
00033 {
00034   PLIST_ENTRY OldFlink;
00035   PLIST_ENTRY OldBlink;
00036 
00037   OldFlink = Entry->Flink;
00038   OldBlink = Entry->Blink;
00039   OldFlink->Blink = OldBlink;
00040   OldBlink->Flink = OldFlink;
00041   return (OldFlink == OldBlink);
00042 }
00043 
00044 static __inline VOID
00045 InsertHeadList(
00046   IN PLIST_ENTRY  ListHead,
00047   IN PLIST_ENTRY  Entry)
00048 {
00049   PLIST_ENTRY OldFlink;
00050   OldFlink = ListHead->Flink;
00051   Entry->Flink = OldFlink;
00052   Entry->Blink = ListHead;
00053   OldFlink->Blink = Entry;
00054   ListHead->Flink = Entry;
00055 }
00056 
00057 static __inline VOID
00058 InitializeListHead(
00059   IN PLIST_ENTRY  ListHead)
00060 {
00061   ListHead->Flink = ListHead->Blink = ListHead;
00062 }
00063 
00064 /***********************************************************/
00065 
00066 #define DS_SOLIDBRUSH  0x00000001
00067 #define DS_GREYBRUSH   0x00000002
00068 #define DS_BRUSH       0x00000004
00069 #define DS_DIB         0x00000008
00070 
00071 #define POW2(stride) (!((stride) & ((stride)-1)))   // TRUE if stride is power of 2
00072 #define BROKEN_RASTERS(stride,cy) ((!(POW2(stride))) && ((stride*cy) > 0x10000))
00073 
00074 #define ENUM_RECT_LIMIT   50
00075 
00076 typedef struct _RECT_ENUM
00077 {
00078   ULONG c;
00079   RECTL arcl[ENUM_RECT_LIMIT];
00080 } RECT_ENUM;
00081 
00082 // Cursor coordinates
00083 typedef struct  _XYPAIR
00084 {
00085   USHORT  x;
00086   USHORT  y;
00087 } XYPAIR;
00088 
00089 typedef struct _SAVED_SCREEN_BITS
00090 {
00091   BOOL Free;
00092   DWORD Offset;
00093   ULONG Size;
00094   LIST_ENTRY ListEntry;
00095 } SAVED_SCREEN_BITS, *PSAVED_SCREEN_BITS;
00096 
00097 // Cursor states
00098 #define CURSOR_COLOR     0x00000004
00099 #define CURSOR_HW        0x00000010
00100 #define CURSOR_HW_ACTIVE 0x00000020
00101 #define CURSOR_ANIMATE   0x00000040
00102 
00103 typedef struct _PDEV
00104 {
00105   ULONG fl; // driver flags
00106 
00107   // Handles
00108   HANDLE KMDriver;
00109   HDEV   GDIDevHandle;   // engine's handle to PDEV
00110   HSURF  SurfHandle;     // engine's handle to surface
00111   PVOID  AssociatedSurf; // associated surface
00112 
00113   // Cursor
00114   XYPAIR xyHotSpot; // cursor hotspot
00115 
00116   // Pointer
00117   PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // HW Pointer Attributes
00118   PSAVED_SCREEN_BITS ImageBehindCursor;
00119   ULONG   XorMaskStartOffset;         // Start offset of hardware pointer
00120                                       //  XOR mask relative to AND mask for
00121                                       //  passing to HW pointer
00122   DWORD   PointerAttributes;          // Size of buffer allocated
00123   DWORD   flPreallocSSBBufferInUse;   // True if preallocated saved screen
00124                                       //  bits buffer is in use
00125   PUCHAR  pjPreallocSSBBuffer;        // Pointer to preallocated saved screen
00126                                       //  bits buffer, if there is one
00127   ULONG   ulPreallocSSBSize;          // Size of preallocated saved screen
00128                                       //  bits buffer
00129   VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities
00130   PUCHAR  pucDIB4ToVGAConvBuffer;     // DIB4->VGA conversion table buffer
00131   PUCHAR  pucDIB4ToVGAConvTables;     // Pointer to DIB4->VGA conversion
00132 
00133   // Misc
00134   ULONG  ModeNum;   // mode index for current VGA mode
00135 
00136   SIZEL  sizeSurf;  // displayed size of the surface
00137   PBYTE  fbScreen;  // pointer to the frame buffer
00138   RECTL  SavedBitsRight;  // invisible part right of screen
00139   RECTL  SavedBitsBottom; // invisible part at the bottom of the screen
00140   BOOL   BitsSaved;       // TRUE if bits are currently saved
00141   SIZEL  sizeMem;         // actual size (in pixels) of video memory
00142   LONG   NumScansUsedByPointer; // # scans of offscreen memory used by
00143 
00144 } PDEV, *PPDEV;
00145 
00146 typedef struct {
00147   RECTL BankBounds; // Pixels addressable in this bank
00148   ULONG BankOffset; // Offset of bank start from bitmap start if linearly addressable
00149 } BANK_INFO, *PBANK_INFO;
00150 
00151 typedef enum {
00152   JustifyTop = 0,
00153   JustifyBottom,
00154 } BANK_JUST;
00155 
00156 // bank control function vector
00157 //typedef VOID (*PFN_BankControl)(PDEVSURF, ULONG, BANK_JUST);
00158 typedef VOID (*PFN_BankControl)(PVOID, ULONG, BANK_JUST);
00159 
00160 // DEVSURF -- definition of a surface as seen and used by the various VGA
00161 // drivers
00162 
00163 typedef struct _DEVSURF
00164 {
00165   IDENT ident;  // Identifier for debugging ease
00166   ULONG flSurf; // DS_ flags as defined below
00167   BYTE  Color;  // Solid color surface if DS_SOLIDBRUSH
00168 
00169 // If DS_SOLIDBRUSH, the following fields are undefined and not guaranteed to
00170 // have been allocated!
00171 
00172   BYTE  Format;     // BMF_*, BMF_PHYSDEVICE
00173   BYTE  jReserved1; // Reserved
00174   BYTE  jReserved2; // Reserved
00175   PPDEV ppdev;      // Pointer to associated PDEV
00176   SIZEL sizeSurf;   // Size of the surface
00177   ULONG NextScan;   // Offset from scan  "n" to "n+1"
00178   ULONG NextPlane;  // Offset from plane "n" to "n+1"
00179   PVOID Scan0;      // Pointer to scan 0 of bitmap
00180                     // (actual address of start of bank, for banked VGA surface)
00181   PVOID StartBmp;   // Pointer to start of bitmap
00182   PVOID Conv;       // Pointer to DIB/Planer conversion buffer
00183 
00184 // Banking variables; used only for banked VGA surfaces
00185 
00186   PVIDEO_BANK_SELECT BankSelectInfo;
00187   ULONG       Bank2RWSkip;            // Offset from one bank index to next to make two 32K banks appear to be
00188                                       // one seamless 64K bank
00189   PFN         pfnBankSwitchCode;
00190   VIDEO_BANK_TYPE BankingType;
00191   ULONG       BitmapSize;             // Length of bitmap if there were no banking, in CPU addressable bytes
00192   ULONG PtrBankScan;       // Last scan line in pointer work bank
00193   RECTL WindowClip1;       // Single-window banking clip rect
00194   RECTL WindowClip2[2];    // Double-window banking clip rects for
00195                            //  windows 0 & 1
00196   ULONG WindowBank[2];     // Current banks mapped into windows
00197                            //  0 & 1 (used in 2 window mode only)
00198   PBANK_INFO  BankInfo;         // Pointer to array of bank clip info
00199   ULONG       BankInfoLength;    // Length of pbiBankInfo, in entries
00200   PBANK_INFO  BankInfo2RW;      // Same as above, but for 2RW window
00201   ULONG       BankInfo2RWLength; // case
00202   PFN_BankControl pfnBankControl;     // Pointer to bank control function
00203   PFN_BankControl pfnBankControl2Window; // Pointer to double-window bank
00204                                       //  control function
00205   PVOID BitmapStart;   // Single-window bitmap start pointer (adjusted as
00206                        // necessary to make window map in at proper offset)
00207   PVOID BitmapStart2Window[2];   // Double-window window 0 and 1 bitmap start
00208   PVOID BankBufferPlane0;        // Pointer to temp buffer capable of
00209                                  // storing one full bank for plane 0 for 1
00210                                  // R/W case; capable of storing  one full
00211                                  // bank height of edge bytes for all four
00212                                  // planes for the 1R/1W case. Also used to
00213                                  // point to text building buffer in all
00214                                  // cases. This is the pointer used to
00215                                  // dealloc bank working storage for all
00216                                  // four planes
00217 
00218   // The following 3 pointers used by 1 R/W banked devices
00219   PVOID       BankBufferPlane1; // Like above, but for plane 1
00220   PVOID       BankBufferPlane2; // Like above, but for plane 2
00221   PVOID       BankBufferPlane3; // Like above, but for plane 3
00222   ULONG       TempBufferSize;   // Full size of temp buffer pointed to
00223                                 // by pvBankBufferPlane0
00224 
00225   ULONG       ajBits[1];           // Bits will start here for device bitmaps
00226   PSAVED_SCREEN_BITS ssbList;      // Pointer to start of linked list of
00227                                     //  saved screen bit blocks
00228 } DEVSURF, *PDEVSURF;
00229 
00230 typedef VOID (*PFN_ScreenToScreenBlt)(PDEVSURF, PRECTL, PPOINTL, INT);
00231 
00232 // BMF_PHYSDEVICE format type
00233 
00234 #define BMF_PHYSDEVICE  0xFF
00235 #define BMF_DFB         0xFE
00236 
00237 // Identifiers used in debugging (DEVSURF.ident)
00238 
00239 #define PDEV_IDENT      ('V' + ('P' << 8) + ('D' << 16) + ('V' << 24))
00240 #define DEVSURF_IDENT   ('V' + ('S' << 8) + ('R' << 16) + ('F' << 24))
00241 
00242 BOOL InitVGA(PPDEV ppdev, BOOL bFirst); // screen.c: initialize VGA mode
00243 BOOL DeinitVGA(PPDEV ppdev); // screen.c: Free resources allocated in InitVGA
00244 
00245 #define DRIVER_EXTRA_SIZE 0
00246 #define ALLOC_TAG  'agvD' // Dvga tag
00247 #define DLL_NAME  L"vga" // DLL name in Unicode
00248 
00249 #define MAX_SCAN_WIDTH              2048  // pixels
00250 #define DRIVER_OFFSCREEN_REFRESHED  0x04L // if not set, don't use offscreen memory
00251 #define PLANAR_PELS_PER_CPU_ADDRESS 8
00252 #define PACKED_PELS_PER_CPU_ADDRESS 2
00253 
00254 BOOL VGAtoGDI(
00255   SURFOBJ *Dest, SURFOBJ *Source, SURFOBJ *Mask, XLATEOBJ *ColorTranslation,
00256   RECTL   *DestRect, POINTL *SourcePoint);
00257 
00258 VOID
00259 VGADDI_BltFromSavedScreenBits(ULONG DestX,
00260                   ULONG DestY,
00261                   PSAVED_SCREEN_BITS Src,
00262                   ULONG SizeX,
00263                   ULONG SizeY);
00264 VOID
00265 VGADDI_BltToSavedScreenBits(PSAVED_SCREEN_BITS Dest,
00266                 ULONG SourceX,
00267                 ULONG SourceY,
00268                 ULONG SizeX,
00269                 ULONG SizeY);
00270 VOID
00271 VGADDI_FreeSavedScreenBits(PSAVED_SCREEN_BITS SavedBits);
00272 PSAVED_SCREEN_BITS
00273 VGADDI_AllocSavedScreenBits(ULONG Size);
00274 VOID
00275 VGADDI_InitializeOffScreenMem(ULONG Start, ULONG Length);
00276 
00277 BOOL InitPointer(PPDEV ppdev);
00278 DWORD getAvailableModes(HANDLE Driver,
00279                         PVIDEO_MODE_INFORMATION *modeInformation,
00280                         DWORD *ModeSize);
00281 
00282 VOID FASTCALL
00283 vgaReadScan(int x, int y, int w, void *b);
00284 
00285 VOID FASTCALL
00286 vgaWriteScan(int x, int y, int w, void *b);

Generated on Fri May 25 2012 04:36:26 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.