예제 #1
0
        public DisassemblyWindow(Nes nes)
        {
            InitializeComponent();
            Init();

            Nes = nes;
        }
예제 #2
0
        public Breakpoints(Nes nes)
        {
            InitializeComponent();

            this.nes = nes;
            PopulateList();
        }
예제 #3
0
파일: Nes.cs 프로젝트: DualBrain/emu6502-1
        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
파일: Mapper.cs 프로젝트: shilrobot/emu6502
 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
파일: UxROM.cs 프로젝트: shilrobot/emu6502
 public UxROM(Nes nes)
     : base(nes)
 {
 }
예제 #23
0
 public NesMemory(Nes nes)
 {
     this.nes = nes;
     this.rom = nes.Rom;
 }
예제 #24
0
파일: NROM.cs 프로젝트: DualBrain/emu6502-1
 public NROM(Nes nes)
     : base(nes)
 {
 }