00001 #ifndef OGDISPLAY_VESA_H
00002 #define OGDISPLAY_VESA_H
00003
00004 #include "objgfx30.h"
00005
00006 struct TMode_Rec {
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
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
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 TVESA_Rec {
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
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 class ogDisplay_VESA : public ogSurface {
00061 protected:
00062 uInt16 ScreenSelector;
00063 TVESA_Rec* VESARec;
00064 TMode_Rec* ModeRec;
00065 bool InGraphics;
00066 uInt16 findMode(uInt32, uInt32, uInt32);
00067 void getModeInfo(uInt16);
00068 void getVESAInfo(void);
00069 void setMode(uInt16);
00070 virtual uInt32 rawGetPixel(uInt32, uInt32);
00071 virtual void rawSetPixel(uInt32, uInt32, uInt32);
00072 virtual void rawLine(uInt32, uInt32, uInt32, uInt32, uInt32);
00073 void setPal(void);
00074 public:
00075 ogDisplay_VESA(void);
00076 virtual bool ogAvail(void);
00077 virtual bool ogAlias(ogSurface&, uInt32, uInt32, uInt32, uInt32);
00078 virtual void ogClear(uInt32);
00079 virtual bool ogClone(ogSurface&);
00080 virtual void ogCopyLineTo(uInt32, uInt32, const void *, uInt32);
00081 virtual void ogCopyLineFrom(uInt32, uInt32, void *, uInt32);
00082 virtual void ogCopyPal(ogSurface&);
00083 virtual bool ogCreate(uInt32, uInt32, ogPixelFmt);
00084 virtual uInt32 ogGetPixel(int32, int32);
00085 virtual void * ogGetPtr(uInt32, uInt32);
00086 virtual void ogHLine(int32, int32, int32, uInt32);
00087 virtual bool ogLoadPal(const char *);
00088 virtual void ogSetPixel(int32, int32, uInt32);
00089 virtual void ogSetRGBPalette(uInt8, uInt8, uInt8, uInt8);
00090 virtual void ogVFlip(void);
00091 virtual void ogVLine(int32, int32, int32, uInt32);
00092 virtual ~ogDisplay_VESA(void);
00093 };
00094
00095 #endif