diff --git a/src/sys/graphics/objgfx30.cpp b/src/sys/graphics/objgfx30.cpp index c1a7787..7c091a5 100755 --- a/src/sys/graphics/objgfx30.cpp +++ b/src/sys/graphics/objgfx30.cpp @@ -1193,7 +1193,7 @@ lSize = 0; DataState = og_None; return; -} // TGfx0::~TGfx0() +} // TGfx0::~TGfx0 /* * @@ -1206,7 +1206,70 @@ VESARec = NULL; ModeRec = NULL; return; -} +} // TScreen::TScreen + +void +TScreen::setupMode(UInt16 mode) { + UInt32 size, count; + // IsVesaInstalled(); + + if (mode==gm320x200x256) { + xRes = 320; + yRes = 200; + MaxX = 319; + MaxY = 199; + BPP = 8; + + Buffer = (void *)0xA0000; + + RedFieldPosition = 0; + GreenFieldPosition = 0; + BlueFieldPosition = 0; + + RedShifter = 0; + GreenShifter = 0; + BlueShifter = 0; + } // if + else { + mode |= 0x4000; // attempt lfb + // GetModeInfo(mode); + if (ModeRec->PhysBasePtr == 0) return; + size = ModeRec->yRes*ModeRec->BytesPerLine; +// Buffer = MapPhysicalToLinear(ModeRec->PhysBasePtr,size); + + xRes = ModeRec->BytesPerLine; + yRes = ModeRec->yRes; + MaxX = ModeRec->xRes-1; + MaxY = yRes-1; + + RedFieldPosition = ModeRec->RedFieldPosition; + GreenFieldPosition = ModeRec->GreenFieldPosition; + BlueFieldPosition = ModeRec->BlueFieldPosition; + + RedShifter = 8-ModeRec->RedMaskSize; + GreenShifter = 8-ModeRec->GreenMaskSize; + BlueShifter = 8-ModeRec->BlueMaskSize; + + BPP = ModeRec->BitsPerPixel; + } // else + + Owner = this; + + DataState = og_Aliasing; + InGraphics = TRUE; + + if ((LineOfs!=NULL) && (lSize!=0)) free(LineOfs); + lSize = yRes*sizeof(UInt32); + LineOfs = (UInt32*)malloc(lSize); + if (LineOfs == NULL) return; + LineOfs[0] = 0; + for (count=1; count<=yRes-1; count++) + LineOfs[count] = LineOfs[count-1]+xRes; + // InitVESAMode(mode); + if (pal==NULL) pal = (TRGB*)malloc(256*sizeof(TRGB)); + // getPal(); + return; +} // TScreen::setupMode TScreen::~TScreen(void) { return; diff --git a/src/sys/graphics/objgfx30.h b/src/sys/graphics/objgfx30.h index 3e64d34..9ddf7dc 100755 --- a/src/sys/graphics/objgfx30.h +++ b/src/sys/graphics/objgfx30.h @@ -200,6 +200,7 @@ bool InGraphics; public: TScreen(void); + void setupMode(UInt16); ~TScreen(void); }; // TScreen #endif