# ogDisplay_UbixOS.h

Go to the documentation of this file.

    00001 #ifndef OGDISPLAY_UBIXOS_H
    00002 #define OGDISPLAY_UBIXOS_H
    00003
    00004 #include <objgfx40/objgfx40.h>
    00005
    00006 struct ogModeInfo {
    00007     uInt16 modeAttributes     __attribute__((packed));
    00008     uInt8  windowAFlags       __attribute__((packed));
    00009     uInt8  windowBFlags       __attribute__((packed));
    00010     uInt16 granularity        __attribute__((packed));
    00011     uInt16 windowSize         __attribute__((packed));
    00012     uInt16 windowASeg         __attribute__((packed));
    00013     uInt16 windowBSeg         __attribute__((packed));
    00014     void*  bankSwitch         __attribute__((packed));
    00015     uInt16 bytesPerLine       __attribute__((packed));
    00016     uInt16 xRes               __attribute__((packed));
    00017     uInt16 yRes               __attribute__((packed));
    00018     uInt8  charWidth          __attribute__((packed));
    00019     uInt8  charHeight         __attribute__((packed));
    00020     uInt8  numBitPlanes       __attribute__((packed));
    00021     uInt8  bitsPerPixel       __attribute__((packed));
    00022     uInt8  numberOfBanks      __attribute__((packed));
    00023     uInt8  memoryModel        __attribute__((packed));
    00024     uInt8  bankSize           __attribute__((packed));
    00025     uInt8  numOfImagePages    __attribute__((packed));
    00026     uInt8  reserved           __attribute__((packed));
    00027     // Direct colour fields (required for Direct/6 and YUV/7 memory models
    00028     uInt8  redMaskSize        __attribute__((packed));
    00029     uInt8  redFieldPosition   __attribute__((packed));
    00030     uInt8  greenMaskSize      __attribute__((packed));
    00031     uInt8  greenFieldPosition __attribute__((packed));
    00032     uInt8  blueMaskSize       __attribute__((packed));
    00033     uInt8  blueFieldPosition  __attribute__((packed));
    00034     uInt8  alphaMaskSize      __attribute__((packed));
    00035     uInt8  alphaFieldPosition __attribute__((packed));
    00036     uInt8  directColourMode   __attribute__((packed));
    00037     // VESA 2.0 specific fields
    00038     uInt32 physBasePtr        __attribute__((packed));
    00039     void*  offScreenMemOffset __attribute__((packed));
    00040     uInt16 offScreenMemSize   __attribute__((packed));
    00041     uInt8  paddington[461]    __attribute__((packed));
    00042 };
    00043
    00044 struct ogVESAInfo {
    00045     char    VBESignature[4]   __attribute__((packed));
    00046     uInt8   minVersion        __attribute__((packed));
    00047     uInt8   majVersion        __attribute__((packed));
    00048     uInt32  OEMStringPtr      __attribute__((packed));
    00049     uInt32  capabilities      __attribute__((packed));
    00050     uInt32  videoModePtr      __attribute__((packed));
    00051     uInt16  totalMemory       __attribute__((packed));
    00052     // VESA 2.0 specific fields
    00053     uInt16  OEMSoftwareRev    __attribute__((packed));
    00054     uInt32  OEMVendorNamePtr  __attribute__((packed));
    00055     uInt32  OEMProductNamePtr __attribute__((packed));
    00056     uInt32  OEMProductRevPtr  __attribute__((packed));
    00057     uInt8   paddington[474]   __attribute__((packed));
    00058 };
    00059
    00060
    00061 class ogDisplay_UbixOS : public ogSurface {
    00062  protected:
    00063   void *         pages[2];
    00064   uInt32         activePage;
    00065   uInt32         visualPage;
    00066   ogVESAInfo *   VESAInfo;
    00067   ogModeInfo *   modeInfo;
    00068
    00069   uInt16         FindMode(uInt32, uInt32, uInt32);
    00070   void           GetModeInfo(uInt16);
    00071   void           GetVESAInfo(void);
    00072   void           SetMode(uInt16);
    00073   void           SetPal(void);
    00074  public:
    00075                  ogDisplay_UbixOS(void);
    00076   virtual bool   ogAlias(ogSurface&, uInt32, uInt32, uInt32, uInt32);
    00077   virtual bool   ogClone(ogSurface&);
    00078   virtual void   ogCopyPalette(ogSurface&);
    00079   virtual bool   ogCreate(uInt32, uInt32, ogPixelFmt);
    00080   virtual bool   ogLoadPalette(const char *);
    00081   virtual void   ogSetPalette(const ogRGBA8[]);
    00082   virtual void   ogSetPalette(uInt8, uInt8, uInt8, uInt8);
    00083   virtual void   ogSetPalette(uInt8, uInt8, uInt8, uInt8, uInt8);
    00084   virtual        ~ogDisplay_UbixOS(void);
    00085 }; // ogDisplay_UbixOS
    00086
    00087 #endif