コード例 #1
0
 public static void drawText(string text, uint x, uint y, uint color, ref Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII screen)
 {
     for (int count = 0; count <= text.Length; count++)
     {
         drawLetter(text.Substring(count, 1), (ushort)x, (ushort)y, color, ref screen);
         x += 7;
     }
 }
コード例 #2
0
ファイル: Kernel.cs プロジェクト: hectormartin42/retro-os
 protected override void Run()
 {
     Console.Write("Input: ");
     var input = Console.ReadLine();
     Console.Write("Text typed: ");
     Console.WriteLine(input);
     RETRO.Drivers.RTC.RTC.PrintTime();
     //VGA.Mode();
     //VGA.Clear(3);
     //VGA.Plot(23, 56, 8);
     Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII SVGA = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();
     SVGA.SetMode(1024, 768, 8);
     for (int x = 0; x < 256; x++)
     {
         ushort y = (ushort)(x * 32);
         SVGA.Fill(y,1,32,32,(uint)x);
     }
 }
コード例 #3
0
        protected override void Run()
        {
            Console.Write("Input: ");
            var input = Console.ReadLine();

            Console.Write("Text typed: ");
            Console.WriteLine(input);
            RETRO.Drivers.RTC.RTC.PrintTime();
            //VGA.Mode();
            //VGA.Clear(3);
            //VGA.Plot(23, 56, 8);
            Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII SVGA = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();
            SVGA.SetMode(1024, 768, 8);
            for (int x = 0; x < 256; x++)
            {
                ushort y = (ushort)(x * 32);
                SVGA.Fill(y, 1, 32, 32, (uint)x);
            }
        }
コード例 #4
0
 public static void drawArray(uint[] letter, ushort x, ushort y, uint color, ref Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII screen)
 {
     for (ushort i = 0; i <= letter.Length; i++)           //This is the Y
     {
         for (ushort j = 0; j <= letter.GetLength(0); j++) //This is X
         {
             if (letter[i].ToString().Substring(j, 1) == "1")
             {
                 screen.SetPixel((ushort)((uint)x + (uint)j), (ushort)((uint)y + (uint)i), color);
             }
             else if (letter[i].ToString().Substring(j, 1) == "2")
             {
             }
             else
             {
                 break;
             }
         }
     }
 }
コード例 #5
0
        public static void Initialize()
        {
            SVGA.setres(800, 600);
            SVGA.clear(Colors.DesktopBlueBackground);
            SVGA.set(10, 10, 0xFF0000);
            SVGA.svga.SetPixel((ushort)15, (ushort)15, 0xFF0000);
            Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII svga1 = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();
            svga1.SetMode((ushort)640, (ushort)480);
            svga1.Clear(Colors.DesktopBlueBackground);
            svga1.SetPixel((ushort)15, (ushort)15, 0xFF0000);
            FlowDOS.Hardware.Mouse.Initialize();
            xold = FlowDOS.Hardware.Mouse.X;
            yold = FlowDOS.Hardware.Mouse.Y;
mainwh:
            xold = FlowDOS.Hardware.Mouse.X;
            yold = FlowDOS.Hardware.Mouse.Y;
            svga1.SetCursor(true, (uint)FlowDOS.Hardware.Mouse.X, (uint)FlowDOS.Hardware.Mouse.Y);
            while ((FlowDOS.Hardware.Mouse.X == xold) && (FlowDOS.Hardware.Mouse.Y == yold))
            {
            }
            goto mainwh;
        }
コード例 #6
0
 public static void drawLetter(string letter, ushort x, ushort y, uint color, ref Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII screen)
 {
     if (letter.Length != 1)
     {
     }
     else
     {
         //Do the magic
         if (letter == " ")
         {
             drawArray(space, x, y, color, ref screen);
         }
         else if (letter == "/")
         {
             drawArray(slash, x, y, color, ref screen);
         }
         else if (letter == @"""")
         {
             drawArray(quote, x, y, color, ref screen);
         }
         else if (letter == @"\")
         {
             drawArray(backslash, x, y, color, ref screen);
         }
         else if (letter == ":")
         {
             drawArray(colon, x, y, color, ref screen);
         }
         else if (letter == ";")
         {
             drawArray(semicolon, x, y, color, ref screen);
         }
         else if (letter == ">")
         {
             drawArray(arrowright, x, y, color, ref screen);
         }
         else if (letter == "<")
         {
             drawArray(arrowleft, x, y, color, ref screen);
         }
         else if (letter == ",")
         {
             drawArray(comma, x, y, color, ref screen);
         }
         else if (letter == ".")
         {
             drawArray(dot, x, y, color, ref screen);
         }
         else if (letter == "!")
         {
             drawArray(excla, x, y, color, ref screen);
         }
         else if (letter == "a")
         {
             drawArray(a, x, y, color, ref screen);
         }
         else if (letter == "b")
         {
             drawArray(b, x, y, color, ref screen);
         }
         else if (letter == "c")
         {
             drawArray(c, x, y, color, ref screen);
         }
         else if (letter == "d")
         {
             drawArray(d, x, y, color, ref screen);
         }
         else if (letter == "e")
         {
             drawArray(e, x, y, color, ref screen);
         }
         else if (letter == "f")
         {
             drawArray(f, x, y, color, ref screen);
         }
         else if (letter == "g")
         {
             drawArray(g, x, y, color, ref screen);
         }
         else if (letter == "h")
         {
             drawArray(h, x, y, color, ref screen);
         }
         else if (letter == "i")
         {
             drawArray(i, x, y, color, ref screen);
         }
         else if (letter == "j")
         {
             drawArray(j, x, y, color, ref screen);
         }
         else if (letter == "k")
         {
             drawArray(k, x, y, color, ref screen);
         }
         else if (letter == "l")
         {
             drawArray(l, x, y, color, ref screen);
         }
         else if (letter == "m")
         {
             drawArray(m, x, y, color, ref screen);
         }
         else if (letter == "n")
         {
             drawArray(n, x, y, color, ref screen);
         }
         else if (letter == "o")
         {
             drawArray(o, x, y, color, ref screen);
         }
         else if (letter == "p")
         {
             drawArray(p, x, y, color, ref screen);
         }
         else if (letter == "q")
         {
             drawArray(q, x, y, color, ref screen);
         }
         else if (letter == "r")
         {
             drawArray(r, x, y, color, ref screen);
         }
         else if (letter == "s")
         {
             drawArray(s, x, y, color, ref screen);
         }
         else if (letter == "t")
         {
             drawArray(t, x, y, color, ref screen);
         }
         else if (letter == "u")
         {
             drawArray(u, x, y, color, ref screen);
         }
         else if (letter == "v")
         {
             drawArray(v, x, y, color, ref screen);
         }
         else if (letter == "w")
         {
             drawArray(w, x, y, color, ref screen);
         }
         else if (letter == "x")
         {
             drawArray(sx, x, y, color, ref screen);
         }
         else if (letter == "y")
         {
             drawArray(sy, x, y, color, ref screen);
         }
         else if (letter == "z")
         {
             drawArray(z, x, y, color, ref screen);
         }
         else if (letter == "0")
         {
             drawArray(n0, x, y, color, ref screen);
         }
         else if (letter == "1")
         {
             drawArray(n1, x, y, color, ref screen);
         }
         else if (letter == "2")
         {
             drawArray(n2, x, y, color, ref screen);
         }
         else if (letter == "3")
         {
             drawArray(n3, x, y, color, ref screen);
         }
         else if (letter == "4")
         {
             drawArray(n4, x, y, color, ref screen);
         }
         else if (letter == "5")
         {
             drawArray(n5, x, y, color, ref screen);
         }
         else if (letter == "6")
         {
             drawArray(n6, x, y, color, ref screen);
         }
         else if (letter == "7")
         {
             drawArray(n7, x, y, color, ref screen);
         }
         else if (letter == "8")
         {
             drawArray(n8, x, y, color, ref screen);
         }
         else if (letter == "9")
         {
             drawArray(n9, x, y, color, ref screen);
         }
     }
 }