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(); }
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); }
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(); } }
public void SetSystem(ISNESSystem system) { _system = system; }
public void SetSystem(ISNESSystem snes) { _snes = snes; }