svga.h

00001 /***************************************************************************
00002                           svga.h  -  description
00003                              -------------------
00004     begin                : Sat Feb 7 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019  #ifndef __SVGA_H
00020  #define __SVGA_H
00021 
00022  #include "common/ktypes.h"
00023  #include "common/kconst.h"
00024  #include "core/kasm.h"
00025 
00026  typedef struct
00027  {
00028         DB VbeSignature[4];
00029         DW VbeVersion;
00030         DD OemStringPtr;
00031         DB Capabilities[4];
00032         DD VideoModePtr;
00033         DW TotalMemory;
00034         DW OemSoftwareRev;
00035         DD OemVendorNamePtr;
00036         DD OemProductNamePtr;
00037         DD OemProductRevPtr;
00038         DB Reserved[222];
00039         DB OemData[256];
00040  } VBEINFO;
00041 
00042  typedef struct {
00043   short   ModeAttributes  ;         /* Mode attributes                  */
00044   char    WinAAttributes  ;         /* Window A attributes              */
00045   char    WinBAttributes  ;         /* Window B attributes              */
00046   short   WinGranularity  ;         /* Window granularity in k          */
00047   short   WinSize  ;                /* Window size in k                 */
00048   short   WinASegment  ;            /* Window A segment                 */
00049   short   WinBSegment  ;            /* Window B segment                 */
00050   void    *WinFuncPtr  ;            /* Pointer to window function       */
00051   short   BytesPerScanLine  ;       /* Bytes per scanline               */
00052   short   XResolution  ;            /* Horizontal resolution            */
00053   short   YResolution  ;            /* Vertical resolution              */
00054   char    XCharSize  ;              /* Character cell width             */
00055   char    YCharSize  ;              /* Character cell height            */
00056   char    NumberOfPlanes  ;         /* Number of memory planes          */
00057   char    BitsPerPixel  ;           /* Bits per pixel                   */
00058   char    NumberOfBanks  ;          /* Number of CGA style banks        */
00059   char    MemoryModel  ;            /* Memory model type                */
00060   char    BankSize  ;               /* Size of CGA style banks          */
00061   char    NumberOfImagePages  ;     /* Number of images pages           */
00062   char    res1  ;                   /* Reserved                         */
00063   char    RedMaskSize  ;            /* Size of direct color red mask    */
00064   char    RedFieldPosition  ;       /* Bit posn of lsb of red mask      */
00065   char    GreenMaskSize  ;          /* Size of direct color green mask  */
00066   char    GreenFieldPosition  ;     /* Bit posn of lsb of green mask    */
00067   char    BlueMaskSize  ;           /* Size of direct color blue mask   */
00068   char    BlueFieldPosition  ;      /* Bit posn of lsb of blue mask     */
00069   char    RsvdMaskSize  ;           /* Size of direct color res mask    */
00070   char    RsvdFieldPosition  ;      /* Bit posn of lsb of res mask      */
00071   char    DirectColorModeInfo  ;    /* Direct color mode attributes     */
00072 
00073   /* VESA 2.0 variables */
00074   long    PhysBasePtr;           /* physical address for flat frame buffer */
00075   long    OffScreenMemOffset;            /* pointer to start of off screen memory */
00076   short   OffScreenMemSize;      /* amount of off screen memory in 1k units */
00077   char    res2[206]  ;              /* Pad to 256 byte block size       */
00078 }VBE_ModeInfo;
00079 
00080   extern VBEINFO* VbeInfoBlock;
00081   extern VBE_ModeInfo vbe_mode;
00082   extern DB vgabios_buffer[0x8000]; //32Kb
00083   extern DB svga_stack[1024];
00084 
00085   extern DB BIOSData[0x600];
00086 
00087   
00088  void PMID_detect();
00089  void VBE_getmodeinfo(unsigned short mode, VBE_ModeInfo *modeinfo);
00090   int init_mode(unsigned short mode);
00091   void setbank(int bank);
00092   void putpixel(short x, short y, char c); /* for 8 bit, 256 color modes */
00093  
00094  #endif

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7