Tastudio - use the Emulator property not Global.Emulator, fix another CoreExension method
This commit is contained in:
parent
546947041b
commit
5258f9385c
|
@ -149,7 +149,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return new TasBranch
|
return new TasBranch
|
||||||
{
|
{
|
||||||
Frame = Tastudio.Emulator.Frame,
|
Frame = Tastudio.Emulator.Frame,
|
||||||
CoreData = (byte[])((Global.Emulator as IStatable).SaveStateBinary().Clone()),
|
CoreData = (byte[])(Tastudio.StatableEmulator.SaveStateBinary().Clone()),
|
||||||
InputLog = Movie.InputLog.Clone(),
|
InputLog = Movie.InputLog.Clone(),
|
||||||
OSDFrameBuffer = GlobalWin.MainForm.CaptureOSD(),
|
OSDFrameBuffer = GlobalWin.MainForm.CaptureOSD(),
|
||||||
LagLog = Movie.TasLagLog.Clone(),
|
LagLog = Movie.TasLagLog.Clone(),
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void MarkerView_QueryItemBkColor(int index, InputRoll.RollColumn column, ref Color color)
|
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))
|
if (prev != null && index == Markers.IndexOf(prev))
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public void AddMarker(bool editText = false, int? frame = null)
|
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
|
// 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)
|
if (editText)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
MaybeFollowCursor();
|
MaybeFollowCursor();
|
||||||
|
|
||||||
if (TasView.IsPartiallyVisible(Global.Emulator.Frame) || TasView.IsPartiallyVisible(lastRefresh))
|
if (TasView.IsPartiallyVisible(Emulator.Frame) || TasView.IsPartiallyVisible(lastRefresh))
|
||||||
refreshNeeded = true;
|
refreshNeeded = true;
|
||||||
|
|
||||||
RefreshDialog(refreshNeeded);
|
RefreshDialog(refreshNeeded);
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void JumpToGreenzone()
|
private void JumpToGreenzone()
|
||||||
{
|
{
|
||||||
if (Global.Emulator.Frame > CurrentTasMovie.LastValidFrame)
|
if (Emulator.Frame > CurrentTasMovie.LastValidFrame)
|
||||||
{
|
{
|
||||||
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
|
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
|
||||||
}
|
}
|
||||||
|
@ -209,8 +209,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithBGColor)
|
if (Emulator.Frame != index && CurrentTasMovie.Markers.IsMarker(index) && Settings.DenoteMarkersWithBGColor)
|
||||||
color = Marker_FrameCol;
|
color = Marker_FrameCol;
|
||||||
else
|
else
|
||||||
color = Color.FromArgb(0x60FFFFFF);
|
color = Color.FromArgb(0x60FFFFFF);
|
||||||
}
|
}
|
||||||
else if (FloatEditingMode &&
|
else if (FloatEditingMode &&
|
||||||
(index == _floatEditRow || _extraFloatRows.Contains(index)) &&
|
(index == _floatEditRow || _extraFloatRows.Contains(index)) &&
|
||||||
|
@ -219,7 +219,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
color = AnalogEdit_Col;
|
color = AnalogEdit_Col;
|
||||||
}
|
}
|
||||||
|
|
||||||
int player = Global.Emulator.ControllerDefinition.PlayerNumber(columnName);
|
int player = Emulator.ControllerDefinition.PlayerNumber(columnName);
|
||||||
if (player != 0 && player % 2 == 0)
|
if (player != 0 && player % 2 == 0)
|
||||||
color = Color.FromArgb(0x0D000000);
|
color = Color.FromArgb(0x0D000000);
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (Mainform.EmulatorPaused)
|
if (Mainform.EmulatorPaused)
|
||||||
{
|
{
|
||||||
TasMovieRecord record = CurrentTasMovie[LastPositionFrame];
|
TasMovieRecord record = CurrentTasMovie[LastPositionFrame];
|
||||||
if (!record.Lagged.HasValue && LastPositionFrame > Global.Emulator.Frame)
|
if (!record.Lagged.HasValue && LastPositionFrame > Emulator.Frame)
|
||||||
StartSeeking(LastPositionFrame);
|
StartSeeking(LastPositionFrame);
|
||||||
else
|
else
|
||||||
Mainform.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
|
@ -703,7 +703,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
Mainform.PauseOnFrame -= notch;
|
Mainform.PauseOnFrame -= notch;
|
||||||
// that's a weird condition here, but for whatever reason it works best
|
// 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.PauseEmulator();
|
||||||
Mainform.PauseOnFrame = null;
|
Mainform.PauseOnFrame = null;
|
||||||
|
|
|
@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
lastState = Emulator.Frame;
|
lastState = Emulator.Frame;
|
||||||
}
|
}
|
||||||
} while (Global.Emulator.Frame < goToFrame);
|
} while (Emulator.Frame < goToFrame);
|
||||||
|
|
||||||
MessageBox.Show("Integrity Check passed");
|
MessageBox.Show("Integrity Check passed");
|
||||||
}
|
}
|
||||||
|
@ -1100,7 +1100,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
.Where(x => !string.IsNullOrWhiteSpace(x.Text))
|
.Where(x => !string.IsNullOrWhiteSpace(x.Text))
|
||||||
.Where(x => x.Name != "FrameColumn");
|
.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;
|
playerMenus[0] = ColumnsSubMenu;
|
||||||
for (int i = 1; i < playerMenus.Length; i++)
|
for (int i = 1; i < playerMenus.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int diff = Global.Emulator.Frame - _seekStartFrame.Value;
|
int diff = Emulator.Frame - _seekStartFrame.Value;
|
||||||
int unit = Mainform.PauseOnFrame.Value - _seekStartFrame.Value;
|
int unit = Mainform.PauseOnFrame.Value - _seekStartFrame.Value;
|
||||||
double progress = 0;
|
double progress = 0;
|
||||||
|
|
||||||
|
@ -785,7 +785,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CurrentTasMovie.FlushInputCache();
|
CurrentTasMovie.FlushInputCache();
|
||||||
CurrentTasMovie.UseInputCache = false;
|
CurrentTasMovie.UseInputCache = false;
|
||||||
|
|
||||||
lastRefresh = Global.Emulator.Frame;
|
lastRefresh = Emulator.Frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoAutoRestore()
|
private void DoAutoRestore()
|
||||||
|
@ -988,12 +988,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (lagLog.WasLagged.Value && !isLag)
|
if (lagLog.WasLagged.Value && !isLag)
|
||||||
{ // Deleting this frame requires rewinding a frame.
|
{ // 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;
|
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = false;
|
CurrentTasMovie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
CurrentTasMovie.RemoveFrame(Global.Emulator.Frame - 1);
|
CurrentTasMovie.RemoveFrame(Emulator.Frame - 1);
|
||||||
CurrentTasMovie.RemoveLagHistory(Global.Emulator.Frame); // Removes from WasLag
|
CurrentTasMovie.RemoveLagHistory(Emulator.Frame); // Removes from WasLag
|
||||||
|
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
||||||
GoToFrame(Emulator.Frame - 1);
|
GoToFrame(Emulator.Frame - 1);
|
||||||
|
@ -1001,12 +1001,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else if (!lagLog.WasLagged.Value && isLag)
|
else if (!lagLog.WasLagged.Value && isLag)
|
||||||
{ // (it shouldn't need to rewind, since the inserted input wasn't polled)
|
{ // (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;
|
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = false;
|
CurrentTasMovie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
CurrentTasMovie.InsertInput(Global.Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
|
CurrentTasMovie.InsertInput(Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
|
||||||
CurrentTasMovie.InsertLagHistory(Global.Emulator.Frame, true);
|
CurrentTasMovie.InsertLagHistory(Emulator.Frame, true);
|
||||||
|
|
||||||
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -9,14 +9,14 @@ namespace BizHawk.Client.MultiHawk.CoreExtensions
|
||||||
{
|
{
|
||||||
public static string DisplayName(this IEmulator core)
|
public static string DisplayName(this IEmulator core)
|
||||||
{
|
{
|
||||||
var attributes = Global.Emulator.Attributes();
|
var attributes = core.Attributes();
|
||||||
|
|
||||||
var str = (!attributes.Released ? "(Experimental) " : string.Empty) +
|
var str = (!attributes.Released ? "(Experimental) " : string.Empty) +
|
||||||
attributes.CoreName;
|
attributes.CoreName;
|
||||||
|
|
||||||
if (Global.Emulator is LibsnesCore)
|
if (core is LibsnesCore)
|
||||||
{
|
{
|
||||||
str += " (" + ((LibsnesCore)Global.Emulator).CurrentProfile + ")";
|
str += " (" + ((LibsnesCore)core).CurrentProfile + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
|
|
Loading…
Reference in New Issue