public CMOS(ATA ata) { statusA = 0x26; /* default 32.768 divider and default rate selection */ statusB = 0x02; /* no DST, 12 hour clock, BCD, all flags cleared */ statusC = 0x00; statusD = 0x80; ataDevice = ata; }
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; }