Skip to content

Commit 5b64368

Browse files
Merge pull request #229 from aura-systems/impl-svgaIIconsole
Implement SVGAII Console again
2 parents 42cb23b + 85a1d78 commit 5b64368

File tree

8 files changed

+56
-98
lines changed

8 files changed

+56
-98
lines changed

Aura Operating System/Aura_Boot/Kernel.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ protected override void BeforeRun()
3333

3434
#region Console Encoding Provider
3535

36-
Encoding.RegisterProvider(CosmosEncodingProvider.Instance);
37-
38-
if (Global.AConsole.Type == System.AConsole.ConsoleType.Graphical)
36+
if (Global.AConsole.Type == System.AConsole.ConsoleType.Graphical && Global.AConsole.Name != "SVGAII")
3937
{
38+
Encoding.RegisterProvider(CosmosEncodingProvider.Instance);
4039
Console.InputEncoding = Encoding.Unicode;
4140
Console.OutputEncoding = Encoding.Unicode;
4241
}
43-
else
42+
else if (Global.AConsole.Type == System.AConsole.ConsoleType.Text)
4443
{
45-
44+
Encoding.RegisterProvider(CosmosEncodingProvider.Instance);
4645
Console.InputEncoding = Encoding.GetEncoding(437);
4746
Console.OutputEncoding = Encoding.GetEncoding(437);
4847
}
@@ -75,6 +74,8 @@ protected override void BeforeRun()
7574

7675
#region Scan boot.bat
7776

77+
int counter = 0;
78+
7879
if (Global.ContainsVolumes())
7980
{
8081
CustomConsole.WriteLineInfo("Scanning for boot.bat...");
@@ -83,11 +84,20 @@ protected override void BeforeRun()
8384
{
8485
if (File.Exists(vol.mName + "\\boot.bat"))
8586
{
87+
CustomConsole.WriteLineOK("Found " + vol.mName + "\\boot.bat");
88+
8689
Apps.System.Batch.Execute(vol.mName + "\\boot.bat");
90+
91+
counter++;
8792
}
8893
}
8994
}
9095

96+
if (counter == 0)
97+
{
98+
CustomConsole.WriteLineOK("No boot.bat found.");
99+
}
100+
91101
#endregion
92102

93103
CustomConsole.WriteLineInfo("Press any key to continue...");

Aura Operating System/Aura_OS/Properties/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Aura_OS
22
{
33
public class VersionInfo
44
{
5-
public static string revision = "170120220412";
5+
public static string revision = "170120222212";
66
}
77
}

Aura Operating System/Aura_OS/System/AConsole/Console.cs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -72,54 +72,6 @@ public enum ConsoleType
7272

7373
public static class ConsoleMode
7474
{
75-
public enum Mode800x600
76-
{
77-
Rows = 87,
78-
Cols = 37
79-
};
80-
81-
public enum Mode1152x864
82-
{
83-
Rows = 127,
84-
Cols = 54
85-
};
86-
87-
public enum Mode1280x768
88-
{
89-
Rows = 141,
90-
Cols = 48
91-
};
92-
93-
public enum Mode1280x800
94-
{
95-
Rows = 141,
96-
Cols = 48
97-
};
98-
99-
public enum Mode1360x768
100-
{
101-
Rows = 149, //+1?
102-
Cols = 48
103-
};
104-
105-
public enum Mode1366x768
106-
{
107-
Rows = 150,
108-
Cols = 48
109-
};
110-
111-
public enum Mode1600x1200
112-
{
113-
Rows = 176,
114-
Cols = 75
115-
};
116-
117-
public enum Mode1920x1080
118-
{
119-
Rows = 141, // Not good value
120-
Cols = 48 // Not good value
121-
};
122-
12375
public static string GetConsoleInfo()
12476
{
12577
if (Global.AConsole.Type == ConsoleType.Graphical)

Aura Operating System/Aura_OS/System/AConsole/GraphicConsole.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
* PROGRAMMERS: Valentin Charbonnier <valentinbreiz@gmail.com>
55
*/
66

7-
87
using System;
98
using System.Drawing;
109
using Cosmos.Debug.Kernel;
1110
using Cosmos.System.Graphics;
1211

1312
namespace Aura_OS.System.AConsole
1413
{
15-
public class GraphicalConsole : Console
14+
public class GraphicConsole : Console
1615
{
1716

1817
public Graphics.Graphics graphics;
1918

2019

21-
public GraphicalConsole()
20+
public GraphicConsole()
2221
{
2322
graphics = new Graphics.Graphics();
2423

Aura Operating System/Aura_OS/System/CustomConsole.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ public class CustomConsole
1515
public static void WriteLineInfo(string text)
1616
{
1717
Console.ForegroundColor = ConsoleColor.Cyan;
18-
Console.Write("[Info] ");
18+
Global.AConsole.Write("[Info] ".ToCharArray());
1919
Console.ForegroundColor = ConsoleColor.White;
20-
Console.Write(text + "\n");
20+
Global.AConsole.Write((text + "\n").ToCharArray());
2121
Global.debugger.Send("[Info] " + text);
2222
}
2323
public static void WriteLineWarning(string text)
2424
{
2525
Console.ForegroundColor = ConsoleColor.Yellow;
26-
Console.Write("[WARNING] ");
26+
Global.AConsole.Write("[WARNING] ".ToCharArray());
2727
Console.ForegroundColor = ConsoleColor.White;
28-
Console.Write(text + "\n");
28+
Global.AConsole.Write((text + "\n").ToCharArray());
2929
Global.debugger.Send("[WARNING] " + text);
3030
}
3131
/// <summary>
@@ -38,25 +38,25 @@ public static void WriteLineWarning(string text)
3838
public static void WriteLineCustom(ConsoleColor tipColor,string text,string tipText)
3939
{
4040
Console.ForegroundColor = tipColor;
41-
Console.Write("[" + tipText + "] ");
41+
Global.AConsole.Write(("[" + tipText + "] ").ToCharArray());
4242
Console.ForegroundColor = ConsoleColor.White;
43-
Console.Write(text + "\n");
43+
Global.AConsole.Write((text + "\n").ToCharArray());
4444
Global.debugger.Send("[" + tipText + "] " + text);
4545
}
4646
public static void WriteLineOK(string text)
4747
{
4848
Console.ForegroundColor = ConsoleColor.Green;
49-
Console.Write("[OK] ");
49+
Global.AConsole.Write("[OK] ".ToCharArray());
5050
Console.ForegroundColor = ConsoleColor.White;
51-
Console.Write(text + "\n");
51+
Global.AConsole.Write((text + "\n").ToCharArray());
5252
Global.debugger.Send("[OK] " + text);
5353
}
5454
public static void WriteLineError(string text)
5555
{
5656
Console.ForegroundColor = ConsoleColor.DarkRed;
57-
Console.Write("[Error] ");
57+
Global.AConsole.Write(("[Error] ").ToCharArray());
5858
Console.ForegroundColor = ConsoleColor.White;
59-
Console.Write(text + "\n");
59+
Global.AConsole.Write((text + "\n").ToCharArray());
6060
Global.debugger.Send("[Error] " + text);
6161
}
6262
}

0 commit comments

Comments
 (0)