Exemple #1
0
 protected override void Run()
 {
     try
     {
         bool loop = true; /// Avoid a Stupid Debugger loop
         while (loop)
         {
             canvas.ClearBuf(Color.Green);
             // canvas.Render();
             int X = (int)Sys.MouseManager.X;
             int Y = (int)Sys.MouseManager.Y;
             // canvas.DrawFilledRectangle(new Pen(Color.Crimson), X, Y, 20, 20);
             //     Kernel.helper.Render();
             //canvas.Render();
             var input = Console.ReadLine();
             MainCommands.RunConsoleCommand(input);
         }
     }
     catch (Exception error)
     {
         Console.BackgroundColor = ConsoleColor.Red;
         Console.ForegroundColor = ConsoleColor.White;
         Console.Clear();
         m_log.WarnFormat("SYSTEM CRASH", MainCommands.UpperCase("System Crashed with exception: " + error.Message + "."));
         m_log.WarnFormat("SYSTEM CRASH", MainCommands.UpperCase("If this keeps happening please Contact the Author of RetroBasic at " + system_email));
         Console.ReadKey();
         Console.BackgroundColor = ConsoleColor.Blue;
         Console.Clear();
         StartScreen();
     }
 }
Exemple #2
0
        public static void StartScreen()
        {
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.White;
            Console.Clear();
            string boot = "**** COSMOS BASIC V1 ****";

            Console.SetCursorPosition((Console.WindowWidth - boot.Length) / 2, Console.CursorTop);
            Console.WriteLine(boot);
            string memory = MemoryManager.UsedMemory().ToString() + " MB / " + MemoryManager.TotalMemory().ToString() + " MB (used / total)";

            Console.SetCursorPosition((Console.WindowWidth - memory.Length) / 2, Console.CursorTop + 1);
            Console.WriteLine(MainCommands.UpperCase(memory));
            Console.WriteLine("READY.");
        }