From 2b7c76eee8598ec0e852899c8f72cd40b37d655c Mon Sep 17 00:00:00 2001 From: GrygrFlzr_cp <366b784df8ce53ec8c2e7755fd87694697c6f240dcqeuZkv> Date: Fri, 5 Feb 2010 09:44:09 +0000 Subject: [PATCH] --- .../GrygrFlzr/Mouse Test/Mouse Test.csproj | 90 ++++++++++++++++++ .../GrygrFlzr/Mouse Test/Program.cs | 41 ++++++++ .../Mouse Test/Properties/AssemblyInfo.cs | 36 +++++++ .../Playgrounds/GrygrFlzr/Test OS/Program.cs | 50 ++++++++++ .../Test OS/Properties/AssemblyInfo.cs | 36 +++++++ .../GrygrFlzr/Test OS/Test OS.csproj | 78 +++++++++++++++ .../GrygrFlzr/VGA Mouse Cursor/Program.cs | 80 ++++++++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++ .../VGA Mouse Cursor/VGA Mouse Cursor.csproj | 94 +++++++++++++++++++ .../VGA with keyboard input/Program.cs | 39 ++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++ .../VGA with keyboard input.csproj | 90 ++++++++++++++++++ 12 files changed, 706 insertions(+) create mode 100644 source/Playgrounds/GrygrFlzr/Mouse Test/Mouse Test.csproj create mode 100644 source/Playgrounds/GrygrFlzr/Mouse Test/Program.cs create mode 100644 source/Playgrounds/GrygrFlzr/Mouse Test/Properties/AssemblyInfo.cs create mode 100644 source/Playgrounds/GrygrFlzr/Test OS/Program.cs create mode 100644 source/Playgrounds/GrygrFlzr/Test OS/Properties/AssemblyInfo.cs create mode 100644 source/Playgrounds/GrygrFlzr/Test OS/Test OS.csproj create mode 100644 source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Program.cs create mode 100644 source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Properties/AssemblyInfo.cs create mode 100644 source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/VGA Mouse Cursor.csproj create mode 100644 source/Playgrounds/GrygrFlzr/VGA with keyboard input/Program.cs create mode 100644 source/Playgrounds/GrygrFlzr/VGA with keyboard input/Properties/AssemblyInfo.cs create mode 100644 source/Playgrounds/GrygrFlzr/VGA with keyboard input/VGA with keyboard input.csproj diff --git a/source/Playgrounds/GrygrFlzr/Mouse Test/Mouse Test.csproj b/source/Playgrounds/GrygrFlzr/Mouse Test/Mouse Test.csproj new file mode 100644 index 000000000..8d2b4309a --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Mouse Test/Mouse Test.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {07FF9656-7E66-48B5-972B-23DF73301730} + WinExe + Properties + Mouse_Test + Mouse Test + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + + + + + + + + {1F0EDE86-F6D4-4355-9A97-10E90457770C} + Cosmos.Compiler.Builder + + + {5C293BB9-FB42-495E-AAD9-D15888631CA4} + Cosmos.Sys.FileSystem + + + {E2C54C80-75F3-4249-93B4-0003A4AF705F} + CosmosBoot + + + {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755} + Cosmos.Hardware + + + {A1F83D9F-2D44-4264-A08B-416797123018} + Cosmos.Kernel + + + {819DB8FC-5DA1-461F-83C9-2F5C88088C94} + Cosmos.Sys + + + + + \ No newline at end of file diff --git a/source/Playgrounds/GrygrFlzr/Mouse Test/Program.cs b/source/Playgrounds/GrygrFlzr/Mouse Test/Program.cs new file mode 100644 index 000000000..b4a50410f --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Mouse Test/Program.cs @@ -0,0 +1,41 @@ +using System; +using System.IO; +using Cosmos.Compiler.Builder; +using Cosmos.Hardware; +using Cosmos.Sys; + +namespace Mouse_Test +{ + class Program + { + #region Cosmos Builder logic + // Most users wont touch this. This will call the Cosmos Build tool + [STAThread] + static void Main(string[] args) + { + BuildUI.Run(); + } + #endregion + + // Main entry point of the kernel + public static void Init() + { + var xBoot = new Cosmos.Sys.Boot(); + xBoot.Execute(); + Console.Clear(); + Console.WriteLine("Loading Mouse"); + Mouse.Initialize(); + Console.WriteLine("Mouse Loaded"); + //VGAScreen.SetMode640x480x2(); + bool x = true; + while (x == true) + { + Console.WriteLine("Mouse X:" + Mouse.X); + Console.WriteLine("Mouse Y:" + Mouse.Y); + PIT.Wait(100); + Console.Clear(); + } + Cosmos.Sys.Deboot.ShutDown(); + } + } +} diff --git a/source/Playgrounds/GrygrFlzr/Mouse Test/Properties/AssemblyInfo.cs b/source/Playgrounds/GrygrFlzr/Mouse Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..ebf8e0451 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Mouse Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Mouse Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("]")] +[assembly: AssemblyProduct("Mouse Test")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2f72bca1-deaf-48d4-be10-349a5a4bd3db")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/source/Playgrounds/GrygrFlzr/Test OS/Program.cs b/source/Playgrounds/GrygrFlzr/Test OS/Program.cs new file mode 100644 index 000000000..a26fee8c4 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Test OS/Program.cs @@ -0,0 +1,50 @@ +using System; +using System.IO; +using Cosmos.Compiler.Builder; +using Cosmos.Hardware; +using Cosmos.Sys; +using Cosmos.Debug; + +namespace VGA_Mouse_Cursor +{ + class Program + { + #region Cosmos Builder logic + // Most users wont touch this. This will call the Cosmos Build tool + [STAThread] + static void Main(string[] args) + { + BuildUI.Run(); + } + #endregion + + // Main entry point of the kernel + public static void Init() + { + var xBoot = new Cosmos.Sys.Boot(); + xBoot.Execute(); + Mouse.Initialize(); + VGAScreen.SetMode320x200x8(); + VGAScreen.SetPaletteEntry(0, 0, 0, 0); + VGAScreen.SetPaletteEntry(1, 63, 0, 0); + VGAScreen.SetPaletteEntry(2, 63, 63, 63); + VGAScreen.Clear(0); //clean everything up + + uint mx = (uint)Mouse.X; + uint my = (uint)Mouse.Y; + VGAScreen.SetPixel320x200x8(mx, my, 2); //Start drawing mouse + VGAScreen.SetPixel320x200x8(mx, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 3, my + 3, 2); + while (true) + { + + } + + } + } +} diff --git a/source/Playgrounds/GrygrFlzr/Test OS/Properties/AssemblyInfo.cs b/source/Playgrounds/GrygrFlzr/Test OS/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..395792217 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Test OS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Test OS")] +[assembly: AssemblyDescription("This is an OS based on my VGA Mouse Cursor Program")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test OS")] +[assembly: AssemblyCopyright("Copyright © GrygrFlzr 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5137523e-abe7-4856-9120-fc9aae1eb902")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/source/Playgrounds/GrygrFlzr/Test OS/Test OS.csproj b/source/Playgrounds/GrygrFlzr/Test OS/Test OS.csproj new file mode 100644 index 000000000..29eb24ebc --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/Test OS/Test OS.csproj @@ -0,0 +1,78 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {27C543CD-A06F-47EB-81F6-21B386999830} + WinExe + Properties + Test_OS + Test OS + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + {AB24E403-54F3-4F67-B5E0-119A7227AAC1} + Cosmos.Debug.Common + + + {1F0EDE86-F6D4-4355-9A97-10E90457770C} + Cosmos.Compiler.Builder + + + {5C293BB9-FB42-495E-AAD9-D15888631CA4} + Cosmos.Sys.FileSystem + + + {E2C54C80-75F3-4249-93B4-0003A4AF705F} + CosmosBoot + + + {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755} + Cosmos.Hardware + + + {A1F83D9F-2D44-4264-A08B-416797123018} + Cosmos.Kernel + + + {819DB8FC-5DA1-461F-83C9-2F5C88088C94} + Cosmos.Sys + + + + + \ No newline at end of file diff --git a/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Program.cs b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Program.cs new file mode 100644 index 000000000..7692dbdf8 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Program.cs @@ -0,0 +1,80 @@ +using System; +using System.IO; +using Cosmos.Compiler.Builder; +using Cosmos.Hardware; +using Cosmos.Sys; +using Cosmos.Debug; + +namespace VGA_Mouse_Cursor +{ + class Program + { + #region Cosmos Builder logic + // Most users wont touch this. This will call the Cosmos Build tool + [STAThread] + static void Main(string[] args) + { + BuildUI.Run(); + } + #endregion + + // Main entry point of the kernel + public static void Init() + { + var xBoot = new Cosmos.Sys.Boot(); + xBoot.Execute(); + //Console.Clear(); + Mouse.Initialize(); + VGAScreen.SetMode320x200x8(); + VGAScreen.SetPaletteEntry(0, 0, 0, 0); + VGAScreen.SetPaletteEntry(1, 63, 0, 0); + VGAScreen.SetPaletteEntry(2, 63, 63, 63); + VGAScreen.Clear(0); //clean everything up + uint mx = (uint)Mouse.X; + uint my = (uint)Mouse.Y; + VGAScreen.SetPixel320x200x8(mx, my, 2); //Start drawing mouse + VGAScreen.SetPixel320x200x8(mx, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 3, my + 3, 2); + while(true) + { + if ((uint)Mouse.X != mx || (uint)Mouse.Y != my) //redraw mouse when changed + { + VGAScreen.SetPixel320x200x8(mx, my, 0); + VGAScreen.SetPixel320x200x8(mx, my + 1, 0); + VGAScreen.SetPixel320x200x8(mx, my + 2, 0); + VGAScreen.SetPixel320x200x8(mx + 1, my, 0); + VGAScreen.SetPixel320x200x8(mx + 2, my, 0); + VGAScreen.SetPixel320x200x8(mx + 1, my + 1, 0); + VGAScreen.SetPixel320x200x8(mx + 2, my + 2, 0); + VGAScreen.SetPixel320x200x8(mx + 3, my + 3, 0); + + mx = (uint)Mouse.X; //Rewrite values + my = (uint)Mouse.Y; + + VGAScreen.SetPixel320x200x8(mx, my, 2); //draw the new cursor + VGAScreen.SetPixel320x200x8(mx, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my, 2); + VGAScreen.SetPixel320x200x8(mx + 1, my + 1, 2); + VGAScreen.SetPixel320x200x8(mx + 2, my + 2, 2); + VGAScreen.SetPixel320x200x8(mx + 3, my + 3, 2); + } + if (Keyboard.ReadKey() == ConsoleKey.Escape) //if esc shutdown + { + Cosmos.Sys.Deboot.ShutDown(); + } + if (Keyboard.ReadKey() == ConsoleKey.F10) //if F10 reboot + { + Cosmos.Sys.Deboot.Reboot(); + } + } + + } + } +} diff --git a/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Properties/AssemblyInfo.cs b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..248e73e63 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VGA Mouse Cursor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VGA Mouse Cursor")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b6f4f45f-76ea-4c1b-8062-c23210fc8d5e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/VGA Mouse Cursor.csproj b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/VGA Mouse Cursor.csproj new file mode 100644 index 000000000..e222f0775 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA Mouse Cursor/VGA Mouse Cursor.csproj @@ -0,0 +1,94 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {F3AF3AAE-6934-48B2-A308-4489481CC1CB} + WinExe + Properties + VGA_Mouse_Cursor + VGA Mouse Cursor + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + + + + + + + + {AB24E403-54F3-4F67-B5E0-119A7227AAC1} + Cosmos.Debug.Common + + + {1F0EDE86-F6D4-4355-9A97-10E90457770C} + Cosmos.Compiler.Builder + + + {5C293BB9-FB42-495E-AAD9-D15888631CA4} + Cosmos.Sys.FileSystem + + + {E2C54C80-75F3-4249-93B4-0003A4AF705F} + CosmosBoot + + + {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755} + Cosmos.Hardware + + + {A1F83D9F-2D44-4264-A08B-416797123018} + Cosmos.Kernel + + + {819DB8FC-5DA1-461F-83C9-2F5C88088C94} + Cosmos.Sys + + + + + \ No newline at end of file diff --git a/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Program.cs b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Program.cs new file mode 100644 index 000000000..19dc1e916 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Program.cs @@ -0,0 +1,39 @@ +using System; +using System.IO; +using Cosmos.Compiler.Builder; +using Cosmos.Hardware; +using Cosmos.Sys; + +namespace VGA_with_keyboard_input +{ + class Program + { + #region Cosmos Builder logic + // Most users wont touch this. This will call the Cosmos Build tool + [STAThread] + static void Main(string[] args) + { + BuildUI.Run(); + } + #endregion + + // Main entry point of the kernel + public static void Init() + { + var xBoot = new Cosmos.Sys.Boot(); + xBoot.Execute(); + Console.Clear(); + Console.WriteLine("Loading PIT..."); + Console.WriteLine("Waiting 3 secs..."); + PIT.Wait(3000); + Console.WriteLine(); + bool x = true; + while (x == true) + { + Console.Read(); + x = false; + } + Cosmos.Sys.Deboot.ShutDown(); + } + } +} diff --git a/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Properties/AssemblyInfo.cs b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..6e501d1b8 --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VGA with keyboard input")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VGA with keyboard input")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e888c92c-235e-4415-bf0e-c3f1170837e8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/source/Playgrounds/GrygrFlzr/VGA with keyboard input/VGA with keyboard input.csproj b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/VGA with keyboard input.csproj new file mode 100644 index 000000000..e60b7633d --- /dev/null +++ b/source/Playgrounds/GrygrFlzr/VGA with keyboard input/VGA with keyboard input.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {A642536B-E714-4C35-AD64-38B6B60E6D0B} + WinExe + Properties + VGA_with_keyboard_input + VGA with keyboard input + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + + + + + + + + {1F0EDE86-F6D4-4355-9A97-10E90457770C} + Cosmos.Compiler.Builder + + + {5C293BB9-FB42-495E-AAD9-D15888631CA4} + Cosmos.Sys.FileSystem + + + {E2C54C80-75F3-4249-93B4-0003A4AF705F} + CosmosBoot + + + {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755} + Cosmos.Hardware + + + {A1F83D9F-2D44-4264-A08B-416797123018} + Cosmos.Kernel + + + {819DB8FC-5DA1-461F-83C9-2F5C88088C94} + Cosmos.Sys + + + + + \ No newline at end of file