MultiHawk - some more fixes, and reference Global.Emulator less

This commit is contained in:
adelikat 2015-03-02 01:49:04 +00:00
parent 84113b551b
commit f44f32997d
1 changed files with 10 additions and 16 deletions

View File

@ -917,7 +917,7 @@ namespace BizHawk.Client.MultiHawk
Global.DisableSecondaryThrottling = _unthrottled || turbo || fastForward; Global.DisableSecondaryThrottling = _unthrottled || turbo || fastForward;
// realtime throttle is never going to be so exact that using a double here is wrong // realtime throttle is never going to be so exact that using a double here is wrong
_throttle.SetCoreFps(Global.Emulator.CoreComm.VsyncRate); _throttle.SetCoreFps(EmulatorWindows.Master.Emulator.CoreComm.VsyncRate);
_throttle.signal_paused = EmulatorPaused; _throttle.signal_paused = EmulatorPaused;
_throttle.signal_unthrottle = _unthrottled || turbo; _throttle.signal_unthrottle = _unthrottled || turbo;
_throttle.signal_overrideSecondaryThrottle = fastForward && (Global.Config.SoundThrottle || Global.Config.VSyncThrottle || Global.Config.VSync); _throttle.signal_overrideSecondaryThrottle = fastForward && (Global.Config.SoundThrottle || Global.Config.VSyncThrottle || Global.Config.VSync);
@ -1139,7 +1139,7 @@ namespace BizHawk.Client.MultiHawk
RebootCoresMenuItem_Click(null, null); RebootCoresMenuItem_Click(null, null);
Global.Emulator = EmulatorWindows.First().Emulator; Global.Emulator = EmulatorWindows.Master.Emulator;
if (Global.MovieSession.PreviousNES_InQuickNES.HasValue) if (Global.MovieSession.PreviousNES_InQuickNES.HasValue)
{ {
@ -1155,27 +1155,21 @@ namespace BizHawk.Client.MultiHawk
Global.Config.RecentMovies.Add(movie.Filename); Global.Config.RecentMovies.Add(movie.Filename);
if (Global.Emulator.HasSavestates() && movie.StartsFromSavestate) if (EmulatorWindows.Master.Emulator.HasSavestates() && movie.StartsFromSavestate)
{ {
if (movie.TextSavestate != null) if (movie.TextSavestate != null)
{ {
Global.Emulator.AsStatable().LoadStateText(new StringReader(movie.TextSavestate)); EmulatorWindows.Master.Emulator.AsStatable().LoadStateText(new StringReader(movie.TextSavestate));
} }
else else
{ {
Global.Emulator.AsStatable().LoadStateBinary(new BinaryReader(new MemoryStream(movie.BinarySavestate, false))); EmulatorWindows.Master.Emulator.AsStatable().LoadStateBinary(new BinaryReader(new MemoryStream(movie.BinarySavestate, false)));
} }
if (movie.SavestateFramebuffer != null)
foreach (var ew in EmulatorWindows)
{ {
var b1 = movie.SavestateFramebuffer; ew.Emulator.ResetCounters();
var b2 = Global.Emulator.VideoProvider().GetVideoBuffer();
int len = Math.Min(b1.Length, b2.Length);
for (int i = 0; i < len; i++)
{
b2[i] = b1[i];
}
} }
Global.Emulator.ResetCounters();
} }
Global.MovieSession.RunQueuedMovie(record); Global.MovieSession.RunQueuedMovie(record);
@ -1196,7 +1190,7 @@ namespace BizHawk.Client.MultiHawk
private void controllerConfigToolStripMenuItem_Click(object sender, EventArgs e) private void controllerConfigToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var controller = new ControllerConfig(Global.Emulator.ControllerDefinition); var controller = new ControllerConfig(EmulatorWindows.Master.Emulator.ControllerDefinition);
if (controller.ShowDialog() == DialogResult.OK) if (controller.ShowDialog() == DialogResult.OK)
{ {
InitControls(); InitControls();
@ -1213,7 +1207,7 @@ namespace BizHawk.Client.MultiHawk
{ {
if (EmulatorWindows.Any()) if (EmulatorWindows.Any())
{ {
Global.Emulator = EmulatorWindows.First().Emulator; Global.Emulator = EmulatorWindows.Master.Emulator;
} }
else else
{ {