コード例 #1
0
 public static ControlScheme DebugNavigation(DebugLogger debugLogger, StandardKeyboard k)
 {
     return(new ControlScheme()
            .AddControl(() => k.OemTilde.JustPressed, () => debugLogger.Hidden = !debugLogger.Hidden)
            .AddControl(() => k.F1.JustPressed, () => debugLogger.PrevPage())
            .AddControl(() => k.F2.JustPressed, () => debugLogger.NextPage()));
 }
コード例 #2
0
        public DogTreasureHuntScene(Ecosystem ecosystem, Keycosystem keycosystem, SpriteBatch spriteBatch, ContentManager content, StandardKeyboard keyboard)
        {
            this.Ecosystem   = ecosystem;
            this.Keycosystem = keycosystem;
            this.Keyboard    = keyboard;

            this.SpriteBatch = spriteBatch;
            this.Content     = content;
        }
コード例 #3
0
        public BasicKeycosystem(Game game, Director director, GameTimer timer, KeyStateObserver observer) : base(timer, observer)
        {
            var k      = new StandardKeyboard();
            var scheme = new ControlScheme()
                         .AddControl(() => k.Escape.IsPressed, game.Exit)
                         .AddControl(() => k.F2.DurationPressed > TimeSpan.FromSeconds(2).Ticks, () => director.LoadScene(Scenes.SceneSelect));

            this.AddController(1, k)
            .AddController(1, new StandardMouse())
            .AddControlScheme("System", scheme);
        }
コード例 #4
0
ファイル: Setup.cs プロジェクト: modulexcite/MOSA-Project
        /// <summary>
        /// Start the Device Driver System.
        /// </summary>
        static public void Start()
        {
            // Find all drivers
            deviceDriverRegistry.RegisterBuiltInDeviceDrivers();

            // Start drivers for ISA devices
            StartISADevices();

            // Start drivers for PCI devices
            StartPCIDevices();

            // Get CMOS, StandardKeyboard, and PIC driver instances
            CMOS     = (CMOS)deviceManager.GetDevices(new FindDevice.WithName("CMOS")).First.Value;
            Keyboard = (StandardKeyboard)deviceManager.GetDevices(new FindDevice.WithName("StandardKeyboard")).First.Value;
        }
コード例 #5
0
ファイル: Setup.cs プロジェクト: modulexcite/MOSA-Project
        /// <summary>
        /// Start the Device Driver System.
        /// </summary>
        static public void Start()
        {
            // Find all drivers
            Boot.Console.Write("Finding Drivers...");
            deviceDriverRegistry.RegisterBuiltInDeviceDrivers();
            var count = deviceDriverRegistry.GetPCIDeviceDrivers().Count + deviceDriverRegistry.GetISADeviceDrivers().Count;

            Boot.Console.WriteLine("[Completed: " + count.ToString() + " found]");

            // Start drivers for ISA devices
            StartISADevices();

            // Start drivers for PCI devices
            StartPCIDevices();

            // Get CMOS, StandardKeyboard, and PIC driver instances
            CMOS     = (CMOS)deviceManager.GetDevices(new FindDevice.WithName("CMOS")).First.Value;
            Keyboard = (StandardKeyboard)deviceManager.GetDevices(new FindDevice.WithName("StandardKeyboard")).First.Value;
        }
コード例 #6
0
ファイル: Setup.cs プロジェクト: tralivali1234/MOSA-Project
        /// <summary>
        /// Start the Device Driver System.
        /// </summary>
        static public void Start()
        {
            // Find all drivers
            Boot.Console.Write("Finding Drivers...");
            deviceDriverRegistry.RegisterBuiltInDeviceDrivers();
            var count = deviceDriverRegistry.GetPCIDeviceDrivers().Count + deviceDriverRegistry.GetISADeviceDrivers().Count;

            Boot.Console.WriteLine("[Completed: " + count.ToString() + " found]");

            // Start drivers for ISA devices
            StartISADevices();

            // Start drivers for PCI devices
            StartPCIDevices();

            // Get CMOS, StandardKeyboard, and PIC driver instances
            CMOS             = (CMOS)deviceManager.GetDevices(new WithName("CMOS")).First.Value;
            StandardKeyboard = (StandardKeyboard)deviceManager.GetDevices(new WithName("StandardKeyboard")).First.Value;

            Boot.Console.Write("Finding disk controllers...");
            var diskcontroller = new DiskControllerManager(Setup.DeviceManager);

            diskcontroller.CreateDiskDevices();

            var diskcontrollers = deviceManager.GetDevices(new IsDiskControllerDevice());

            Boot.Console.WriteLine("[Completed: " + diskcontrollers.Count.ToString() + " found]");
            foreach (var device in diskcontrollers)
            {
                Boot.Console.Write("Found controller ");
                Boot.InBrackets(device.Name, Mosa.Kernel.x86.Colors.White, Mosa.Kernel.x86.Colors.LightGreen);
                Boot.Console.WriteLine();
            }

            Boot.Console.Write("Finding disks...");
            var disks = deviceManager.GetDevices(new IsDiskDevice());

            Boot.Console.WriteLine("[Completed: " + disks.Count.ToString() + " found]");
            foreach (var disk in disks)
            {
                Boot.Console.Write("Spinning up disk ");
                Boot.InBrackets(disk.Name, Mosa.Kernel.x86.Colors.White, Mosa.Kernel.x86.Colors.LightGreen);
                Boot.Console.Write(" " + (disk as IDiskDevice).TotalBlocks.ToString() + " blocks");
                Boot.Console.WriteLine();
            }

            partitionManager.CreatePartitionDevices();

            Boot.Console.Write("Finding partitions...");
            var partitions = deviceManager.GetDevices(new IsPartitionDevice());

            Boot.Console.WriteLine("[Completed: " + partitions.Count.ToString() + " found]");
            foreach (var partition in partitions)
            {
                Boot.Console.Write("Opening partition: ");
                Boot.InBrackets(partition.Name, Mosa.Kernel.x86.Colors.White, Mosa.Kernel.x86.Colors.LightGreen);
                Boot.Console.Write(" " + (partition as IPartitionDevice).BlockCount.ToString() + " blocks");
                Boot.Console.WriteLine();
            }

            Boot.Console.Write("Finding file systems...");
            var filesystem = deviceManager.GetDevices(new IsPartitionDevice());

            //Boot.Console.WriteLine("[Completed: " + filesystem.Count.ToString() + " found]");
            foreach (var partition in partitions)
            {
                var fat = new FatFileSystem(partition as IPartitionDevice);

                if (fat.IsValid)
                {
                    Boot.Console.WriteLine("Found a FAT file system!");

                    var filename = "TEST.TXT";

                    var location = fat.FindEntry(filename);

                    if (location.IsValid)
                    {
                        Boot.Console.WriteLine("Found: " + filename);

                        var fatFileStream = new FatFileStream(fat, location);

                        uint len = (uint)fatFileStream.Length;

                        Boot.Console.WriteLine("Length: " + len.ToString());

                        Boot.Console.WriteLine("Reading File:");

                        for (;;)
                        {
                            int i = fatFileStream.ReadByte();

                            if (i < 0)
                            {
                                break;
                            }

                            Boot.Console.Write((char)i);
                        }
                    }
                }
            }
        }
コード例 #7
0
 public Windows98Machine()
 {
     monitor  = new Monitor();           //Viola DIP
     keyboard = new StandardKeyboard();
 }