예제 #1
0
 public ISNESSystem Merge(ISNESSystem system)
 {
     system.AudioHandler = AudioHandler;
     system.Renderer     = Renderer;
     system.ROM          = ROM;
     ROM.SetSystem(system);
     system.APU.Attach();
     return(system);
 }
        public void Write(string fileName, ISNESSystem system)
        {
            StreamWriter   file       = File.CreateText(fileName);
            var            writer     = new JsonTextWriter(file);
            JsonSerializer serializer = GetSerializer();

            serializer.Serialize(writer, system);
            writer.Close();
            file.Close();
            file.Dispose();
        }
예제 #3
0
 public MainForm(ISNESSystem system, IRenderer renderer, IFPS fps, IKeyMapper keyMapper, OpenSaveFilesDialog dialog)
 {
     Load    += FrmMainLoad;
     KeyDown += FrmMainKeyDown;
     KeyUp   += FrmMainKeyUp;
     Closed  += AppExit;
     Closing += OnClosing;
     _fps     = fps;
     _system  = system;
     _system.FrameRendered += LockFPS;
     _renderer              = renderer;
     _keyMapper             = keyMapper;
     _dialog        = dialog;
     DoubleBuffered = true;
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
 }
예제 #4
0
        private void LoadGamePositionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _system.StopEmulation();
            _dialog.SelectOnly     = false;
            _dialog.SaveSNESSystem = null;
            var result = _dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                _system.FrameRendered -= LockFPS;
                _system = _system.Merge(_dialog.SNESSystem);
                _system.FrameRendered += LockFPS;
                _system?.Run();
            }
            else
            {
                _system.ResumeEmulation();
            }
        }
예제 #5
0
 public void SetSystem(ISNESSystem system)
 {
     _system = system;
 }
예제 #6
0
 public void SetSystem(ISNESSystem snes)
 {
     _snes = snes;
 }