示例#1
0
        public DisassemblyWindow(Nes nes)
        {
            InitializeComponent();
            Init();

            Nes = nes;
        }
示例#2
0
        public Breakpoints(Nes nes)
        {
            InitializeComponent();

            this.nes = nes;
            PopulateList();
        }
示例#3
0
        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();
        }
示例#4
0
        public DisassemblyWindow(Nes nes)
        {
            InitializeComponent();
            Init();

            Nes = nes;
        }
示例#5
0
        public Breakpoints(Nes nes)
        {
            InitializeComponent();

            this.nes = nes;
            PopulateList();
        }
示例#6
0
        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();
        }
示例#7
0
文件: Nes.cs 项目: shilrobot/emu6502
        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();
        }
示例#8
0
        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);
        }
示例#9
0
        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();
        }
示例#10
0
 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;
 }
示例#11
0
        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);
        }
示例#12
0
 public Mapper(Nes nes)
 {
     this.nes = nes;
 }
示例#13
0
文件: NROM.cs 项目: shilrobot/emu6502
 public NROM(Nes nes)
     : base(nes)
 {
 }
示例#14
0
        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);
        }
示例#15
0
文件: Ppu.cs 项目: shilrobot/emu6502
 public Ppu(Nes nes)
 {
     this.nes = nes;
 }
示例#16
0
文件: MMC1.cs 项目: shilrobot/emu6502
 public MMC1(Nes nes)
     : base(nes)
 {
 }
示例#17
0
 public Ppu(Nes nes)
 {
     this.nes = nes;
 }
示例#18
0
 public Mapper(Nes nes)
 {
     this.nes = nes;
 }
示例#19
0
 public MMC1(Nes nes)
     : base(nes)
 {
 }
示例#20
0
 public NesMemory(Nes nes)
 {
     this.nes = nes;
     this.rom = nes.Rom;
 }
示例#21
0
 public UxROM(Nes nes)
     : base(nes)
 {
 }
示例#22
0
 public UxROM(Nes nes)
     : base(nes)
 {
 }
示例#23
0
 public NesMemory(Nes nes)
 {
     this.nes = nes;
     this.rom = nes.Rom;
 }
示例#24
0
 public NROM(Nes nes)
     : base(nes)
 {
 }