public void Prepare(DMAController aController, int aSourceAddress, int aTargetAddress, int aLength) { lastSourceAddress = aSourceAddress; lastTargetAddress = aTargetAddress; length = aLength; controller = aController; totalElapsedCycles = 0; isRunning = true; }
public Device() { CPU = new Z80(this); DMA = new DMAController(this); MMU = new MemoryMapper(this); Cartridge = null; GPU = new VideoController(this); IRQ = new InterruptController(); TIM = new TimerController(this); JOYP = new InputController(this); }
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; }
public EmuGB(ConfigsGB aConfigs) { m_configs = aConfigs; m_cpu = new CPU(); m_ppu = new PPU(); m_apu = new APU(); m_mem = new MEM(); m_dmaController = new DMAController(); m_timerController = new TimerController(); m_joypad = new Joypad(); m_serialIO = new SerialIO(); // Start paused m_paused = true; // Temp binding DrawDisplay = (aPPU) => { }; DrawDisplayLine = (aPPU, aScanline) => { }; m_mem.AttachCPU(m_cpu); m_mem.AttachPPU(m_ppu); m_mem.AttachAPU(m_apu); m_mem.AttachDMAController(m_dmaController); m_mem.AttachTimerController(m_timerController); m_mem.AttachJoypad(m_joypad); m_mem.AttachSerialIO(m_serialIO); m_cpu.ProcessorState.BindCyclesStep(m_ppu.CyclesStep); m_cpu.ProcessorState.BindCyclesStep(m_apu.CyclesStep); m_cpu.ProcessorState.BindCyclesStep(m_dmaController.CyclesStep); m_cpu.ProcessorState.BindCyclesStep(m_timerController.CyclesStep); m_cpu.ProcessorState.BindCyclesStep(m_serialIO.CyclesStep); m_ppu.BindRequestIRQ(m_cpu.RequestIRQ); m_timerController.BindRequestIRQ(m_cpu.RequestIRQ); m_joypad.BindRequestIRQ(m_cpu.RequestIRQ); m_serialIO.BindRequestIRQ(m_cpu.RequestIRQ); //m_ppu.BindDrawDisplayLine(DrawDisplayLine); }
public IOProcessor(DSystem system) { _system = system; _io = new IOPIOBus(); _mem = new IOPMemoryBus(_io); _cpu = new i8085(_mem, _io); _keyboard = new Keyboard(); _mouse = new Mouse(); // // 8" floppy drive used by the IOP // _floppyDrive = new FloppyDrive(_system); // // Add devices to the IO bus // _miscIO = new MiscIO(this); _floppyController = new FloppyController(_floppyDrive, _system); _dma = new DMAController(this); _tty = new Printer(); _beeper = new Beeper(); // // Register DMA devices with controller // _dma.RegisterDevice(_floppyController, 0); // Floppy, DMA Channel 0 _dma.RegisterDevice(_system.CP, 1); // CP, DMA Channel 1 _io.RegisterDevice(_miscIO); _io.RegisterDevice(_floppyController); _io.RegisterDevice(_dma); _io.RegisterDevice(_system.CP); _io.RegisterDevice(_tty); Reset(); }
public void AttachDMAController(DMAController aDMA) { m_dmaController = aDMA; m_dmaController.BindMEM(this); }