UbixOS  2.0
ogDisplay_VESA.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _OBJGFX_OGDISPLAY_VESA_H
30 #define _OBJGFX_OGDISPLAY_VESA_H
31 
32 #include <sys/types.h>
33 #include <objgfx40/objgfx40.h>
34 
35 struct TMode_Rec {
43  void* BankSwitch __attribute__((packed));
45  uInt16 xRes __attribute__((packed));
46  uInt16 yRes __attribute__((packed));
47  uInt8 CharWidth __attribute__((packed));
48  uInt8 CharHeight __attribute__((packed));
53  uInt8 BankSize __attribute__((packed));
55  uInt8 Reserved __attribute__((packed));
56  // Direct colour fields (required for Direct/6 and YUV/7 memory models
66  // VESA 2.0 specific fields
67  uInt32 physBasePtr __attribute__((packed));
68  void *OffScreenMemOffset __attribute__((packed));
70  uInt8 paddington[461] __attribute__((packed));
71 };
72 
73 struct TVESA_Rec {
74  char VBESignature[4] __attribute__((packed));
75  uInt8 minVersion __attribute__((packed));
76  uInt8 majVersion __attribute__((packed));
81  // VESA 2.0 specific fields
86  uInt8 paddington[474] __attribute__((packed));
87 };
88 
89 class ogDisplay_VESA: public ogSurface {
90  protected:
94  bool InGraphics;
96  void getModeInfo(uInt16);
97  void getVESAInfo(void);
98  void setMode(uInt16);
99  virtual uInt32 rawGetPixel(uInt32, uInt32);
100  virtual void rawSetPixel(uInt32, uInt32, uInt32);
101  virtual void rawLine(uInt32, uInt32, uInt32, uInt32, uInt32);
102  void setPal(void);
103  public:
104  ogDisplay_VESA(void);
105  virtual bool ogAvail(void);
106  virtual bool ogAlias(ogSurface&, uInt32, uInt32, uInt32, uInt32);
107  virtual void ogClear(uInt32);
108  virtual bool ogClone(ogSurface&);
109  virtual void ogCopyLineTo(uInt32, uInt32, const void *, uInt32);
110  virtual void ogCopyLineFrom(uInt32, uInt32, void *, uInt32);
111  virtual void ogCopyPal(ogSurface&);
112  virtual bool ogCreate(uInt32, uInt32, ogPixelFmt);
113  virtual uInt32 ogGetPixel(int32, int32);
114  virtual void * ogGetPtr(uInt32, uInt32);
115  virtual void ogHLine(int32, int32, int32, uInt32);
116  virtual bool ogLoadPal(const char *);
117  virtual void ogSetPixel(int32, int32, uInt32);
118  virtual void ogSetRGBPalette(uInt8, uInt8, uInt8, uInt8);
119  virtual void ogVFlip(void);
120  virtual void ogVLine(int32, int32, int32, uInt32);
121  virtual ~ogDisplay_VESA(void);
122 };
123 // ogDisplay_VESA
124 
125 #endif
TMode_Rec::BankSize
uInt8 BankSize
Definition: objgfx30.h:85
TMode_Rec::paddington
uInt8 paddington[461]
Definition: objgfx30.h:102
TVESA_Rec::OEMStringPtr
char * OEMStringPtr
Definition: objgfx30.h:109
TMode_Rec::xRes
uInt16 xRes
Definition: objgfx30.h:78
TMode_Rec::Reserved
uInt8 Reserved
Definition: objgfx30.h:87
TVESA_Rec::minVersion
uInt8 minVersion
Definition: objgfx30.h:107
TMode_Rec::Granularity
uInt16 Granularity
Definition: objgfx30.h:72
TVESA_Rec
Definition: objgfx30.h:105
TMode_Rec::__attribute__
uInt16 ModeAttributes __attribute__((packed))
TMode_Rec::BlueMaskSize
uInt8 BlueMaskSize
Definition: objgfx30.h:93
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
ogDisplay_VESA::rawGetPixel
virtual uInt32 rawGetPixel(uInt32, uInt32)
ogDisplay_VESA::rawSetPixel
virtual void rawSetPixel(uInt32, uInt32, uInt32)
TVESA_Rec::__attribute__
char VBESignature[4] __attribute__((packed))
TMode_Rec::NumberOfBanks
uInt8 NumberOfBanks
Definition: objgfx30.h:83
ogDisplay_VESA
Definition: ogDisplay_VESA.h:89
ogDisplay_VESA::setPal
void setPal(void)
ogDisplay_VESA::ScreenSelector
uInt16 ScreenSelector
Definition: ogDisplay_VESA.h:91
ogDisplay_VESA::~ogDisplay_VESA
virtual ~ogDisplay_VESA(void)
uInt16
unsigned short int uInt16
Definition: objgfx30.h:48
ogDisplay_VESA::ogGetPixel
virtual uInt32 ogGetPixel(int32, int32)
ogDisplay_VESA::rawLine
virtual void rawLine(uInt32, uInt32, uInt32, uInt32, uInt32)
TMode_Rec::WindowSize
uInt16 WindowSize
Definition: objgfx30.h:73
ogDisplay_VESA::getVESAInfo
void getVESAInfo(void)
TMode_Rec::ModeAttributes
uInt16 ModeAttributes
Definition: objgfx30.h:69
ogDisplay_VESA::ogClone
virtual bool ogClone(ogSurface &)
TMode_Rec::NumOfImagePages
uInt8 NumOfImagePages
Definition: objgfx30.h:86
ogDisplay_VESA::ogCopyLineFrom
virtual void ogCopyLineFrom(uInt32, uInt32, void *, uInt32)
ogDisplay_VESA::ogCopyPal
virtual void ogCopyPal(ogSurface &)
TMode_Rec::BlueFieldPosition
uInt8 BlueFieldPosition
Definition: objgfx30.h:94
TVESA_Rec::paddington
uInt8 paddington[474]
Definition: objgfx30.h:118
TMode_Rec::NumBitPlanes
uInt8 NumBitPlanes
Definition: objgfx30.h:81
types.h
TMode_Rec::RedFieldPosition
uInt8 RedFieldPosition
Definition: objgfx30.h:90
ogDisplay_VESA::getModeInfo
void getModeInfo(uInt16)
ogDisplay_VESA::ogHLine
virtual void ogHLine(int32, int32, int32, uInt32)
ogDisplay_VESA::ogClear
virtual void ogClear(uInt32)
TVESA_Rec::OEMVendorNamePtr
char * OEMVendorNamePtr
Definition: objgfx30.h:115
ogDisplay_VESA::ogSetPixel
virtual void ogSetPixel(int32, int32, uInt32)
ogDisplay_VESA::ogDisplay_VESA
ogDisplay_VESA(void)
ogDisplay_VESA::VESARec
TVESA_Rec * VESARec
Definition: ogDisplay_VESA.h:92
ogDisplay_VESA::findMode
uInt16 findMode(uInt32, uInt32, uInt32)
uInt8
unsigned char uInt8
Definition: objgfx30.h:47
TMode_Rec::BitsPerPixel
uInt8 BitsPerPixel
Definition: objgfx30.h:82
TMode_Rec::yRes
uInt16 yRes
Definition: objgfx30.h:78
TMode_Rec::MemoryModel
uInt8 MemoryModel
Definition: objgfx30.h:84
ogDisplay_VESA::ogVFlip
virtual void ogVFlip(void)
ogDisplay_VESA::ogCreate
virtual bool ogCreate(uInt32, uInt32, ogPixelFmt)
TMode_Rec::BytesPerLine
uInt16 BytesPerLine
Definition: objgfx30.h:77
TMode_Rec::WindowASeg
uInt16 WindowASeg
Definition: objgfx30.h:74
TVESA_Rec::VideoModePtr
uInt16 * VideoModePtr
Definition: objgfx30.h:111
TMode_Rec::OffScreenMemSize
uInt16 OffScreenMemSize
Definition: objgfx30.h:101
ogDisplay_VESA::ogGetPtr
virtual void * ogGetPtr(uInt32, uInt32)
TVESA_Rec::VBESignature
char VBESignature[4]
Definition: objgfx30.h:106
TMode_Rec::DirectColourMode
uInt8 DirectColourMode
Definition: objgfx30.h:97
TVESA_Rec::OEMProductRevPtr
char * OEMProductRevPtr
Definition: objgfx30.h:117
TMode_Rec::WindowBSeg
uInt16 WindowBSeg
Definition: objgfx30.h:75
TMode_Rec::CharWidth
uInt8 CharWidth
Definition: objgfx30.h:79
ogDisplay_VESA::InGraphics
bool InGraphics
Definition: ogDisplay_VESA.h:94
ogDisplay_VESA::ogVLine
virtual void ogVLine(int32, int32, int32, uInt32)
TMode_Rec::RedMaskSize
uInt8 RedMaskSize
Definition: objgfx30.h:89
TMode_Rec
Definition: objgfx30.h:68
ogDisplay_VESA::ogAlias
virtual bool ogAlias(ogSurface &, uInt32, uInt32, uInt32, uInt32)
ogDisplay_VESA::setMode
void setMode(uInt16)
TVESA_Rec::OEMSoftwareRev
uInt16 OEMSoftwareRev
Definition: objgfx30.h:114
TVESA_Rec::majVersion
uInt8 majVersion
Definition: objgfx30.h:108
TMode_Rec::WindowAFlags
uInt8 WindowAFlags
Definition: objgfx30.h:70
TMode_Rec::GreenFieldPosition
uInt8 GreenFieldPosition
Definition: objgfx30.h:92
TMode_Rec::WindowBFlags
uInt8 WindowBFlags
Definition: objgfx30.h:71
TVESA_Rec::OEMProductNamePtr
char * OEMProductNamePtr
Definition: objgfx30.h:116
ogDisplay_VESA::ogCopyLineTo
virtual void ogCopyLineTo(uInt32, uInt32, const void *, uInt32)
TMode_Rec::BankSwitch
void * BankSwitch
Definition: objgfx30.h:76
TMode_Rec::AlphaMaskSize
uInt8 AlphaMaskSize
Definition: objgfx30.h:95
TMode_Rec::AlphaFieldPosition
uInt8 AlphaFieldPosition
Definition: objgfx30.h:96
ogDisplay_VESA::ModeRec
TMode_Rec * ModeRec
Definition: ogDisplay_VESA.h:93
ogDisplay_VESA::ogSetRGBPalette
virtual void ogSetRGBPalette(uInt8, uInt8, uInt8, uInt8)
TMode_Rec::OffScreenMemOffset
void * OffScreenMemOffset
Definition: objgfx30.h:100
TMode_Rec::CharHeight
uInt8 CharHeight
Definition: objgfx30.h:80
TMode_Rec::GreenMaskSize
uInt8 GreenMaskSize
Definition: objgfx30.h:91
TVESA_Rec::Capabilities
uInt32 Capabilities
Definition: objgfx30.h:110
TVESA_Rec::TotalMemory
uInt16 TotalMemory
Definition: objgfx30.h:112
ogDisplay_VESA::ogAvail
virtual bool ogAvail(void)
ogDisplay_VESA::ogLoadPal
virtual bool ogLoadPal(const char *)