Ejemplo n.º 1
0
        private static void Evaluate()
        {
            if (FirstCharacter == (byte)'E')
            {
                // Move to next line (ESC E)
                VGAText.Newline();
            }
            else if (FirstCharacter == (byte)'[')
            {
                if (FinalCharacter == (byte)'m')
                {
                    // Display Attributes
                    for (int i = 0; i < ParameterCount; i++)
                    {
                        var parameter = GetParameter(i + 1);

                        switch (parameter)
                        {
                        case 30: VGAText.SetColor(VGAColor.Black); break;

                        case 31: VGAText.SetColor(VGAColor.Red); break;

                        case 32: VGAText.SetColor(VGAColor.Green); break;

                        case 33: VGAText.SetColor(VGAColor.Yellow); break;

                        case 34: VGAText.SetColor(VGAColor.Blue); break;

                        case 35: VGAText.SetColor(VGAColor.Magenta); break;

                        case 36: VGAText.SetColor(VGAColor.Cyan); break;

                        case 37: VGAText.SetColor(VGAColor.White); break;

                        case 40: VGAText.SetBackground(VGAColor.Black); break;

                        case 41: VGAText.SetBackground(VGAColor.Red); break;

                        case 42: VGAText.SetBackground(VGAColor.Green); break;

                        case 43: VGAText.SetBackground(VGAColor.Yellow); break;

                        case 44: VGAText.SetBackground(VGAColor.Blue); break;

                        case 45: VGAText.SetBackground(VGAColor.Magenta); break;

                        case 46: VGAText.SetBackground(VGAColor.Cyan); break;

                        case 47: VGAText.SetBackground(VGAColor.White); break;

                        // FUTURE:
                        //0   Reset all attributes
                        //1   Bright
                        //2   Dim
                        //4   Underscore
                        //5   Blink
                        //7   Reverse
                        //8   Hidden

                        default: break;
                        }
                    }
                }
                else if (FinalCharacter == (byte)'J')
                {
                    var parameter = GetParameter(1);

                    switch (parameter)
                    {
                    case 0: break;                             // TODO: Clear screen cursor dowon

                    case 1: break;                             // TODO: Clear screen cursor up

                    case 2: VGAText.Clear(); break;

                    default: break;
                    }
                }
                ClearControlSequences();
            }
        }