public DisassemblyWindow(Nes nes) { InitializeComponent(); Init(); Nes = nes; }
public Breakpoints(Nes nes) { InitializeComponent(); this.nes = nes; PopulateList(); }
public Nes(string romfile) { ActiveNes = this; Rom = new Rom(romfile); Mem = new NesMemory(this); Cpu = new Chip6502(Mem); Ppu = new Ppu(this); switch (Rom.MapperNumber) { case 0: Mapper = new NROM(this); break; case 1: Mapper = new MMC1(this); break; case 2: Mapper = new UxROM(this); break; default: // TODO: Cleaner... throw new Exception("Unknown mapper"); } Reset(); }
public Debugger() { InitializeComponent(); OpenFileDialog dlg = new OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory();// @"p:\csharp\emu6502\roms"; if (dlg.ShowDialog() != DialogResult.OK) { Application.Exit(); return; } nes = new Nes(dlg.FileName); UpdateScreen(); UpdateTitle(); Application.Idle += new EventHandler(Application_Idle); outputWindow = new PpuOutput(nes); outputWindow.Show(this); //outputWindow.Hide(); disassembly2.Nes = nes; disassembly2.Update(); disassembly2.SelectAddress(nes.Cpu.PC); sw.Start(); }
public Nes(string romfile) { ActiveNes=this; Rom = new Rom(romfile); Mem = new NesMemory(this); Cpu = new Chip6502(Mem); Ppu = new Ppu(this); switch (Rom.MapperNumber) { case 0: Mapper = new NROM(this); break; case 1: Mapper = new MMC1(this); break; case 2: Mapper = new UxROM(this); break; default: // TODO: Cleaner... throw new Exception("Unknown mapper"); } Reset(); }
public PpuOutput(Nes nes) { InitializeComponent(); //this.DoubleBuffered = true; this.ClientSize = new Size(Ppu.ScreenWidth * 3, Ppu.ScreenHeight * 3); this.ppu = nes.Ppu; this.nes = nes; PresentationParameters pp = new PresentationParameters(); pp.AutoDepthStencilFormat = DepthFormat.Depth16; pp.BackBufferCount = 1; pp.BackBufferFormat = SurfaceFormat.Bgr32; pp.BackBufferWidth = Ppu.ScreenWidth; pp.BackBufferHeight = Ppu.ScreenHeight; pp.DeviceWindowHandle = this.Handle; pp.EnableAutoDepthStencil = true; pp.IsFullScreen = false; pp.MultiSampleType = MultiSampleType.None; pp.PresentationInterval = PresentInterval.Default; // TODO pp.RenderTargetUsage = RenderTargetUsage.PreserveContents; pp.SwapEffect = SwapEffect.Discard; pp.PresentationInterval = PresentInterval.One; device = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, DeviceType.Hardware, this.Handle, pp); tex = new Texture2D(device, Ppu.ScreenWidth, Ppu.ScreenHeight, 1, TextureUsage.None, SurfaceFormat.Bgr32); sb = new SpriteBatch(device); }
private double Benchmark(string name, string romPath) { Nes nes = new Nes(romPath); bool render; int cycles = 341*262*60*10; Stopwatch sw = new Stopwatch(); sw.Start(); for(int i=0; i<10*60; ++i) nes.RunOneFrame();//cycles, out render); sw.Stop(); double time = sw.ElapsedTicks / (double)Stopwatch.Frequency; textBox.AppendText(String.Format("{0}: {1:0.000} s\r\n", name, time)); Refresh(); return time; }
private double Benchmark(string name, string romPath) { Nes nes = new Nes(romPath); bool render; int cycles = 341 * 262 * 60 * 10; Stopwatch sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 10 * 60; ++i) { nes.RunOneFrame();//cycles, out render); } sw.Stop(); double time = sw.ElapsedTicks / (double)Stopwatch.Frequency; textBox.AppendText(String.Format("{0}: {1:0.000} s\r\n", name, time)); Refresh(); return(time); }
public Mapper(Nes nes) { this.nes = nes; }
public NROM(Nes nes) : base(nes) { }
public PpuOutput(Nes nes) { InitializeComponent(); //this.DoubleBuffered = true; this.ClientSize = new Size(Ppu.ScreenWidth*3, Ppu.ScreenHeight*3); this.ppu = nes.Ppu; this.nes = nes; PresentationParameters pp = new PresentationParameters(); pp.AutoDepthStencilFormat = DepthFormat.Depth16; pp.BackBufferCount = 1; pp.BackBufferFormat = SurfaceFormat.Bgr32; pp.BackBufferWidth = Ppu.ScreenWidth; pp.BackBufferHeight = Ppu.ScreenHeight; pp.DeviceWindowHandle = this.Handle; pp.EnableAutoDepthStencil = true; pp.IsFullScreen = false; pp.MultiSampleType = MultiSampleType.None; pp.PresentationInterval = PresentInterval.Default; // TODO pp.RenderTargetUsage = RenderTargetUsage.PreserveContents; pp.SwapEffect = SwapEffect.Discard; pp.PresentationInterval = PresentInterval.One; device = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, DeviceType.Hardware, this.Handle, pp); tex = new Texture2D(device, Ppu.ScreenWidth, Ppu.ScreenHeight, 1, TextureUsage.None, SurfaceFormat.Bgr32); sb = new SpriteBatch(device); }
public Ppu(Nes nes) { this.nes = nes; }
public MMC1(Nes nes) : base(nes) { }
public NesMemory(Nes nes) { this.nes = nes; this.rom = nes.Rom; }
public UxROM(Nes nes) : base(nes) { }