Tastudio - use the Emulator property not Global.Emulator, fix another CoreExension method

This commit is contained in:
adelikat 2016-12-04 12:30:51 -06:00
parent 546947041b
commit 5258f9385c
7 changed files with 23 additions and 23 deletions

View File

@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk
return new TasBranch
{
Frame = Tastudio.Emulator.Frame,
CoreData = (byte[])((Global.Emulator as IStatable).SaveStateBinary().Clone()),
CoreData = (byte[])(Tastudio.StatableEmulator.SaveStateBinary().Clone()),
InputLog = Movie.InputLog.Clone(),
OSDFrameBuffer = GlobalWin.MainForm.CaptureOSD(),
LagLog = Movie.TasLagLog.Clone(),

View File

@ -52,7 +52,7 @@ namespace BizHawk.Client.EmuHawk
private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
{
var prev = Markers.PreviousOrCurrent(Global.Emulator.Frame);//Temp fix
var prev = Markers.PreviousOrCurrent(Emulator.Frame);//Temp fix
if (prev != null && index == Markers.IndexOf(prev))
{
@ -161,7 +161,7 @@ namespace BizHawk.Client.EmuHawk
public void AddMarker(bool editText = false, int? frame = null)
{
// feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame
var markerFrame = frame ?? Global.Emulator.Frame;
var markerFrame = frame ?? Emulator.Frame;
if (editText)
{

View File

@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
MaybeFollowCursor();
if (TasView.IsPartiallyVisible(Global.Emulator.Frame) || TasView.IsPartiallyVisible(lastRefresh))
if (TasView.IsPartiallyVisible(Emulator.Frame) || TasView.IsPartiallyVisible(lastRefresh))
refreshNeeded = true;
RefreshDialog(refreshNeeded);

View File

@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
private void JumpToGreenzone()
{
if (Global.Emulator.Frame > CurrentTasMovie.LastValidFrame)
if (Emulator.Frame > CurrentTasMovie.LastValidFrame)
{
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
}
@ -209,8 +209,8 @@ namespace BizHawk.Client.EmuHawk
{
if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithBGColor)
color = Marker_FrameCol;
else
color = Color.FromArgb(0x60FFFFFF);
else
color = Color.FromArgb(0x60FFFFFF);
}
else if (FloatEditingMode &&
(index == _floatEditRow || _extraFloatRows.Contains(index)) &&
@ -219,7 +219,7 @@ namespace BizHawk.Client.EmuHawk
color = AnalogEdit_Col;
}
int player = Global.Emulator.ControllerDefinition.PlayerNumber(columnName);
int player = Emulator.ControllerDefinition.PlayerNumber(columnName);
if (player != 0 && player % 2 == 0)
color = Color.FromArgb(0x0D000000);
}
@ -413,7 +413,7 @@ namespace BizHawk.Client.EmuHawk
if (Mainform.EmulatorPaused)
{
TasMovieRecord record = CurrentTasMovie[LastPositionFrame];
if (!record.Lagged.HasValue && LastPositionFrame > Global.Emulator.Frame)
if (!record.Lagged.HasValue && LastPositionFrame > Emulator.Frame)
StartSeeking(LastPositionFrame);
else
Mainform.UnpauseEmulator();
@ -703,7 +703,7 @@ namespace BizHawk.Client.EmuHawk
{
Mainform.PauseOnFrame -= notch;
// that's a weird condition here, but for whatever reason it works best
if (notch > 0 && Global.Emulator.Frame >= Mainform.PauseOnFrame)
if (notch > 0 && Emulator.Frame >= Mainform.PauseOnFrame)
{
Mainform.PauseEmulator();
Mainform.PauseOnFrame = null;

View File

@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk
lastState = Emulator.Frame;
}
} while (Global.Emulator.Frame < goToFrame);
} while (Emulator.Frame < goToFrame);
MessageBox.Show("Integrity Check passed");
}
@ -1100,7 +1100,7 @@ namespace BizHawk.Client.EmuHawk
.Where(x => !string.IsNullOrWhiteSpace(x.Text))
.Where(x => x.Name != "FrameColumn");
ToolStripMenuItem[] playerMenus = new ToolStripMenuItem[Global.Emulator.ControllerDefinition.PlayerCount + 1];
ToolStripMenuItem[] playerMenus = new ToolStripMenuItem[Emulator.ControllerDefinition.PlayerCount + 1];
playerMenus[0] = ColumnsSubMenu;
for (int i = 1; i < playerMenus.Length; i++)
{

View File

@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk
break;
}
int diff = Global.Emulator.Frame - _seekStartFrame.Value;
int diff = Emulator.Frame - _seekStartFrame.Value;
int unit = Mainform.PauseOnFrame.Value - _seekStartFrame.Value;
double progress = 0;
@ -785,7 +785,7 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.FlushInputCache();
CurrentTasMovie.UseInputCache = false;
lastRefresh = Global.Emulator.Frame;
lastRefresh = Emulator.Frame;
}
private void DoAutoRestore()
@ -988,12 +988,12 @@ namespace BizHawk.Client.EmuHawk
{
if (lagLog.WasLagged.Value && !isLag)
{ // Deleting this frame requires rewinding a frame.
CurrentTasMovie.ChangeLog.AddInputBind(Global.Emulator.Frame - 1, true, "Bind Input; Delete " + (Global.Emulator.Frame - 1));
CurrentTasMovie.ChangeLog.AddInputBind(Emulator.Frame - 1, true, "Bind Input; Delete " + (Emulator.Frame - 1));
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
CurrentTasMovie.ChangeLog.IsRecording = false;
CurrentTasMovie.RemoveFrame(Global.Emulator.Frame - 1);
CurrentTasMovie.RemoveLagHistory(Global.Emulator.Frame); // Removes from WasLag
CurrentTasMovie.RemoveFrame(Emulator.Frame - 1);
CurrentTasMovie.RemoveLagHistory(Emulator.Frame); // Removes from WasLag
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
GoToFrame(Emulator.Frame - 1);
@ -1001,12 +1001,12 @@ namespace BizHawk.Client.EmuHawk
}
else if (!lagLog.WasLagged.Value && isLag)
{ // (it shouldn't need to rewind, since the inserted input wasn't polled)
CurrentTasMovie.ChangeLog.AddInputBind(Global.Emulator.Frame - 1, false, "Bind Input; Insert " + (Global.Emulator.Frame - 1));
CurrentTasMovie.ChangeLog.AddInputBind(Emulator.Frame - 1, false, "Bind Input; Insert " + (Emulator.Frame - 1));
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
CurrentTasMovie.ChangeLog.IsRecording = false;
CurrentTasMovie.InsertInput(Global.Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
CurrentTasMovie.InsertLagHistory(Global.Emulator.Frame, true);
CurrentTasMovie.InsertInput(Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
CurrentTasMovie.InsertLagHistory(Emulator.Frame, true);
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
return true;

View File

@ -9,14 +9,14 @@ namespace BizHawk.Client.MultiHawk.CoreExtensions
{
public static string DisplayName(this IEmulator core)
{
var attributes = Global.Emulator.Attributes();
var attributes = core.Attributes();
var str = (!attributes.Released ? "(Experimental) " : string.Empty) +
attributes.CoreName;
if (Global.Emulator is LibsnesCore)
if (core is LibsnesCore)
{
str += " (" + ((LibsnesCore)Global.Emulator).CurrentProfile + ")";
str += " (" + ((LibsnesCore)core).CurrentProfile + ")";
}
return str;