示例#1
0
        public Machine(Form uiForm)
        {
            picDevice     = new PIC8259();
            vgaDevice     = new VGA();
            FloppyDrive   = new Floppy();
            dmaController = new DMAController();
            keyboard      = new KeyboardDevice();
            ataDevice     = new ATA();

            if (SystemConfig.Machine.Floppies.Count > 0)
            {
                FloppyDrive.MountImage(SystemConfig.Machine.Floppies[0].Image);
            }

            switch (Settings.Default.graphics.ToUpper())
            {
                //case "XNA":
                //    throw new Exception("XNA not supported OwO");
                //    //gui = new XNAUI(uiForm, vgaDevice);
                //    break;
                //case "SDL":
                //    gui = new SDLUI(uiForm, vgaDevice);
                //    break;
            }

            gui = new SHARPDX(uiForm, vgaDevice); // SharpDX it is
            //gui = new ASCII(uiForm, vgaDevice); // ASCII test

            Application.Idle += new System.EventHandler(ApplicationIdle);

            gui.KeyDown += new EventHandler <UIntEventArgs>(GUIKeyDown);
            gui.KeyUp   += new EventHandler <UIntEventArgs>(GUIKeyUp);

            gui.Init();

            devices = new IDevice[]
            {
                FloppyDrive, new CMOS(ataDevice), new Misc(), new PIT8253(), picDevice, keyboard, dmaController, vgaDevice, ataDevice
            };

            CPU = new CPU.CPU();

            picDevice.Interrupt += PicDeviceInterrupt;

            SetupSystem();

            CPU.IORead  += CPUIORead;
            CPU.IOWrite += CPUIOWrite;
        }
示例#2
0
文件: MainForm.cs 项目: ferib/VM86CS
        private void PrintRegisters()
        {
            CPU.CPU cpu = machine.CPU;

            EAX.Text = cpu.EAX.ToString("X8");
            EBX.Text = cpu.EBX.ToString("X8");
            ECX.Text = cpu.ECX.ToString("X8");
            EDX.Text = cpu.EDX.ToString("X8");
            ESI.Text = cpu.ESI.ToString("X8");
            EDI.Text = cpu.EDI.ToString("X8");
            EBP.Text = cpu.EBP.ToString("X8");
            ESP.Text = cpu.ESP.ToString("X8");
            CS.Text  = cpu.CS.ToString("X4");
            DS.Text  = cpu.DS.ToString("X4");
            ES.Text  = cpu.ES.ToString("X4");
            FS.Text  = cpu.FS.ToString("X4");
            GS.Text  = cpu.GS.ToString("X4");
            SS.Text  = cpu.SS.ToString("X4");

            CF.Text   = cpu.CF ? "CF" : "cf";
            PF.Text   = cpu.PF ? "PF" : "pf";
            AF.Text   = cpu.AF ? "AF" : "af";
            ZF.Text   = cpu.ZF ? "ZF" : "zf";
            SF.Text   = cpu.SF ? "SF" : "sf";
            TF.Text   = cpu.TF ? "TF" : "tf";
            IF.Text   = cpu.IF ? "IF" : "if";
            DF.Text   = cpu.DF ? "DF" : "df";
            OF.Text   = cpu.OF ? "OF" : "of";
            IOPL.Text = cpu.IOPL.ToString("X2");
            AC.Text   = cpu.AC ? "AC" : "ac";
            NT.Text   = cpu.NT ? "NT" : "nt";
            RF.Text   = cpu.RF ? "RF" : "rf";
            VM.Text   = cpu.VM ? "VM" : "vm";
            VIF.Text  = cpu.VIF ? "VIF" : "vif";
            VIP.Text  = cpu.VIP ? "VIP" : "vip";
        }
示例#3
0
文件: Machine.cs 项目: cryogen/VM86CS
        public Machine(Form uiForm)
        {
            picDevice = new PIC8259();
            vgaDevice = new VGA();
            FloppyDrive = new Floppy();
            dmaController = new DMAController();
            keyboard = new KeyboardDevice();
            ataDevice = new ATA();

            if(SystemConfig.Machine.Floppies.Count > 0)
            {
                FloppyDrive.MountImage(SystemConfig.Machine.Floppies[0].Image);
            }

            switch (Settings.Default.graphics.ToUpper())
            {
                case "XNA":
                    gui = new XNAUI(uiForm, vgaDevice);
                    break;
                case "SDL":
                    gui = new SDLUI(uiForm, vgaDevice);
                    break;
            }

            Application.Idle += new System.EventHandler(ApplicationIdle);

            gui.KeyDown += new EventHandler<UIntEventArgs>(GUIKeyDown);
            gui.KeyUp += new EventHandler<UIntEventArgs>(GUIKeyUp);

            gui.Init();

            devices = new IDevice[]
                          {
                              FloppyDrive, new CMOS(ataDevice), new Misc(), new PIT8253(), picDevice, keyboard, dmaController, vgaDevice, ataDevice
                          };

            CPU = new CPU.CPU();

            picDevice.Interrupt += PicDeviceInterrupt;

            SetupSystem();

            CPU.IORead += CPUIORead;
            CPU.IOWrite += CPUIOWrite;
        }