Esempio n. 1
0
        public static uint SysTVGetScrMode(ref SysPoint Size)
        {
            uint result = 0;

            Windows.GetConsoleScreenBufferInfo(Windows.GetStdHandle((int)StdHandles.STD_OUTPUT_HANDLE), out SysBufInfo);
            switch (SysBufInfo.dwSize.Y)
            {
            case 25: result = 0x0003;
                break;

            case 43:
            case 50: result = 0x0103;
                break;

            default: result = 0x00ff;
                break;
            }

            Size.X = SysBufInfo.dwSize.X;
            Size.Y = SysBufInfo.dwSize.Y;
            if (Size.Y > 234)
            {
                Size.Y = 234;
            }
            return(result);
        }
Esempio n. 2
0
        public static void InitVideo()
        {
            SysTVGetCurType(ref StrtCurY1, ref StrtCurY2, ref StrtCurVisible);
            SysPoint Dummy = new SysPoint();

            if (StartupMode != 0xFFFF)
            {
                StartupMode = SysTVGetScrMode(ref Dummy);
            }
            if (StartupMode != ScreenMode)
            {
                SysTVSetScrMode((int)ScreenMode);
            }
            SetCrtData();
        }
Esempio n. 3
0
        public static void SetCrtData()
        {
            int      Y1, Y2;
            bool     Visible;
            SysPoint SrcSize = new SysPoint();

            ScreenMode   = SysTVGetScrMode(ref SrcSize);
            ScreenHeight = (byte)SrcSize.Y;
            ScreenWidth  = (byte)SrcSize.X;
            HiResScreen  = true;
            SaveScreen   = new CHAR_INFO[(ScreenWidth) * (ScreenHeight)];
            Y1           = 0;
            Y2           = 0;
            Visible      = true;
            SysTVGetCurType(ref Y1, ref Y2, ref Visible);
        }