Fix, fix, fix...
This commit is contained in:
parent
e77c1455b3
commit
9d7a522576
|
@ -65,6 +65,8 @@ namespace BizHawk.Client.Common
|
||||||
else
|
else
|
||||||
WasLag[frame] = wasValue;
|
WasLag[frame] = wasValue;
|
||||||
|
|
||||||
|
if (frame != 0)
|
||||||
|
WasLag[frame - 1] = LagLog[frame - 1];
|
||||||
if (frame >= LagLog.Count)
|
if (frame >= LagLog.Count)
|
||||||
LagLog.Add(value.Value);
|
LagLog.Add(value.Value);
|
||||||
else
|
else
|
||||||
|
@ -89,6 +91,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
public void InsertHistoryAt(int frame, bool isLag)
|
public void InsertHistoryAt(int frame, bool isLag)
|
||||||
{ // LagLog was invalidated when the frame was inserted
|
{ // LagLog was invalidated when the frame was inserted
|
||||||
|
if (frame <= LagLog.Count)
|
||||||
LagLog.Insert(frame, isLag);
|
LagLog.Insert(frame, isLag);
|
||||||
WasLag.Insert(frame, isLag);
|
WasLag.Insert(frame, isLag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,8 @@ namespace BizHawk.Client.Common
|
||||||
_log.RemoveAt(frame);
|
_log.RemoveAt(frame);
|
||||||
if (BindMarkersToInput)
|
if (BindMarkersToInput)
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -99,6 +101,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame - 1);
|
Markers.Move(m.Frame, m.Frame - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
Changes = true;
|
Changes = true;
|
||||||
|
@ -122,6 +125,8 @@ namespace BizHawk.Client.Common
|
||||||
_log.RemoveAt(frame);
|
_log.RemoveAt(frame);
|
||||||
if (BindMarkersToInput) // TODO: This is slow, is there a better way to do it?
|
if (BindMarkersToInput) // TODO: This is slow, is there a better way to do it?
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -134,6 +139,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame - 1);
|
Markers.Move(m.Frame, m.Frame - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +161,8 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
if (BindMarkersToInput)
|
if (BindMarkersToInput)
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= removeStart);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= removeStart);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -167,6 +175,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame - (removeUpTo - removeStart));
|
Markers.Move(m.Frame, m.Frame - (removeUpTo - removeStart));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
Changes = true;
|
Changes = true;
|
||||||
|
@ -188,6 +197,8 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
if (BindMarkersToInput)
|
if (BindMarkersToInput)
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -197,6 +208,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame + 1);
|
Markers.Move(m.Frame, m.Frame + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeLog.SetGeneralRedo();
|
ChangeLog.SetGeneralRedo();
|
||||||
|
@ -212,9 +224,10 @@ namespace BizHawk.Client.Common
|
||||||
Changes = true;
|
Changes = true;
|
||||||
InvalidateAfter(frame);
|
InvalidateAfter(frame);
|
||||||
|
|
||||||
|
|
||||||
if (BindMarkersToInput)
|
if (BindMarkersToInput)
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -224,6 +237,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame + inputLog.Count());
|
Markers.Move(m.Frame, m.Frame + inputLog.Count());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeLog.SetGeneralRedo();
|
ChangeLog.SetGeneralRedo();
|
||||||
|
@ -277,6 +291,8 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
if (BindMarkersToInput)
|
if (BindMarkersToInput)
|
||||||
{
|
{
|
||||||
|
bool wasRecording = ChangeLog.IsRecording;
|
||||||
|
ChangeLog.IsRecording = false;
|
||||||
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
int firstIndex = Markers.FindIndex(m => m.Frame >= frame);
|
||||||
if (firstIndex != -1)
|
if (firstIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -286,6 +302,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers.Move(m.Frame, m.Frame + count);
|
Markers.Move(m.Frame, m.Frame + count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -276,6 +276,15 @@ namespace BizHawk.Client.Common
|
||||||
History.Last().Add(new MovieActionMarker(newMarker, oldPosition, old_message));
|
History.Last().Add(new MovieActionMarker(newMarker, oldPosition, old_message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddInputBind(int frame, bool isDelete, string name = "", bool force = false)
|
||||||
|
{
|
||||||
|
if (IsRecording || force)
|
||||||
|
{
|
||||||
|
AddMovieAction(name);
|
||||||
|
History.Last().Add(new MovieActionBindInput(Movie, frame, isDelete));
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,10 +511,16 @@ namespace BizHawk.Client.Common
|
||||||
bool wasRecording = movie.ChangeLog.IsRecording;
|
bool wasRecording = movie.ChangeLog.IsRecording;
|
||||||
movie.ChangeLog.IsRecording = false;
|
movie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
//if (isFloat)
|
if (isFloat)
|
||||||
// movie.SetFloatStates(FirstFrame, LastFrame - FirstFrame + 1, buttonName, oldState);
|
{
|
||||||
//else
|
for (int i = 0; i < oldState.Count; i++)
|
||||||
// movie.SetBoolState(FirstFrame, buttonName, oldState == 1);
|
movie.SetFloatState(FirstFrame + i, buttonName, oldState[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 0; i < oldState.Count; i++)
|
||||||
|
movie.SetBoolState(FirstFrame + i, buttonName, oldState[i] == 1);
|
||||||
|
}
|
||||||
|
|
||||||
movie.ChangeLog.IsRecording = wasRecording;
|
movie.ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
|
@ -522,5 +537,67 @@ namespace BizHawk.Client.Common
|
||||||
movie.ChangeLog.IsRecording = wasRecording;
|
movie.ChangeLog.IsRecording = wasRecording;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MovieActionBindInput : IMovieAction
|
||||||
|
{
|
||||||
|
public int FirstFrame { get; private set; }
|
||||||
|
public int LastFrame { get; private set; }
|
||||||
|
|
||||||
|
private string log;
|
||||||
|
private bool delete;
|
||||||
|
|
||||||
|
private bool bindMarkers;
|
||||||
|
|
||||||
|
public MovieActionBindInput(TasMovie movie, int frame, bool isDelete)
|
||||||
|
{
|
||||||
|
FirstFrame = LastFrame = frame;
|
||||||
|
log = movie.GetInputLogEntry(frame);
|
||||||
|
delete = isDelete;
|
||||||
|
bindMarkers = movie.BindMarkersToInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Undo(TasMovie movie)
|
||||||
|
{
|
||||||
|
bool wasRecording = movie.ChangeLog.IsRecording;
|
||||||
|
bool wasBinding = movie.BindMarkersToInput;
|
||||||
|
movie.ChangeLog.IsRecording = false;
|
||||||
|
movie.BindMarkersToInput = bindMarkers;
|
||||||
|
|
||||||
|
if (delete) // Insert
|
||||||
|
{
|
||||||
|
movie.InsertInput(FirstFrame, log);
|
||||||
|
movie.InsertLagHistory(FirstFrame + 1, true);
|
||||||
|
}
|
||||||
|
else // Delete
|
||||||
|
{
|
||||||
|
movie.RemoveFrame(FirstFrame);
|
||||||
|
movie.RemoveLagHistory(FirstFrame + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
movie.ChangeLog.IsRecording = wasRecording;
|
||||||
|
movie.BindMarkersToInput = bindMarkers;
|
||||||
|
}
|
||||||
|
public void Redo(TasMovie movie)
|
||||||
|
{
|
||||||
|
bool wasRecording = movie.ChangeLog.IsRecording;
|
||||||
|
bool wasBinding = movie.BindMarkersToInput;
|
||||||
|
movie.ChangeLog.IsRecording = false;
|
||||||
|
movie.BindMarkersToInput = bindMarkers;
|
||||||
|
|
||||||
|
if (delete)
|
||||||
|
{
|
||||||
|
movie.RemoveFrame(FirstFrame);
|
||||||
|
movie.RemoveLagHistory(FirstFrame + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
movie.InsertInput(FirstFrame, log);
|
||||||
|
movie.InsertLagHistory(FirstFrame + 1, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
movie.ChangeLog.IsRecording = wasRecording;
|
||||||
|
movie.BindMarkersToInput = bindMarkers;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
|
@ -165,11 +165,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
65536,
|
65536,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
|
||||||
this.DiskCapacityNumeric.Minimum = new decimal(new int[] {
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0});
|
0});
|
||||||
this.DiskCapacityNumeric.Name = "DiskCapacityNumeric";
|
this.DiskCapacityNumeric.Name = "DiskCapacityNumeric";
|
||||||
this.DiskCapacityNumeric.Size = new System.Drawing.Size(55, 20);
|
this.DiskCapacityNumeric.Size = new System.Drawing.Size(55, 20);
|
||||||
|
@ -206,11 +201,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
65536,
|
65536,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
|
||||||
this.SaveCapacityNumeric.Minimum = new decimal(new int[] {
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0});
|
0});
|
||||||
this.SaveCapacityNumeric.Name = "SaveCapacityNumeric";
|
this.SaveCapacityNumeric.Name = "SaveCapacityNumeric";
|
||||||
this.SaveCapacityNumeric.Size = new System.Drawing.Size(55, 20);
|
this.SaveCapacityNumeric.Size = new System.Drawing.Size(55, 20);
|
||||||
|
|
|
@ -867,9 +867,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
int player = 0;
|
int player = 0;
|
||||||
|
|
||||||
foreach (var column in columns)
|
foreach (InputRoll.RollColumn column in columns)
|
||||||
{
|
{
|
||||||
var menuItem = new ToolStripMenuItem
|
ToolStripMenuItem menuItem = new ToolStripMenuItem
|
||||||
{
|
{
|
||||||
Text = column.Text + " (" + column.Name + ")",
|
Text = column.Text + " (" + column.Name + ")",
|
||||||
Checked = column.Visible,
|
Checked = column.Visible,
|
||||||
|
@ -888,14 +888,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
(sender.OwnerItem as ToolStripMenuItem).ShowDropDown();
|
(sender.OwnerItem as ToolStripMenuItem).ShowDropDown();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (column.Name.StartsWith("P" + (player + 1)))
|
if (column.Name.StartsWith("P") && char.IsNumber(column.Name, 1))
|
||||||
{
|
player = int.Parse(column.Name[1].ToString());
|
||||||
player++;
|
else
|
||||||
ColumnsSubMenu.DropDownItems.Add(playerMenus[player]);
|
player = 0;
|
||||||
}
|
|
||||||
playerMenus[player].DropDownItems.Add(menuItem);
|
playerMenus[player].DropDownItems.Add(menuItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 1; i < playerMenus.Length; i++)
|
||||||
|
ColumnsSubMenu.DropDownItems.Add(playerMenus[i]);
|
||||||
|
|
||||||
ColumnsSubMenu.DropDownItems.Add(new ToolStripSeparator());
|
ColumnsSubMenu.DropDownItems.Add(new ToolStripSeparator());
|
||||||
for (int i = 1; i < playerMenus.Length; i++)
|
for (int i = 1; i < playerMenus.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (frame < Emulator.Frame) // We are rewinding
|
if (frame < Emulator.Frame) // We are rewinding
|
||||||
{
|
{
|
||||||
var goToFrame = frame == 0 ? 0 : frame - 1;
|
int goToFrame = frame == 0 ? 0 : frame - 1;
|
||||||
|
|
||||||
if (CurrentTasMovie[goToFrame].HasState) // Go back 1 frame and emulate to get the display (we don't store that)
|
if (CurrentTasMovie[goToFrame].HasState) // Go back 1 frame and emulate to get the display (we don't store that)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (frame > 0) // We can't emulate up to frame 0!
|
if (frame > 0) // We can't emulate up to frame 0!
|
||||||
{
|
{
|
||||||
|
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
GlobalWin.MainForm.FrameAdvance();
|
GlobalWin.MainForm.FrameAdvance();
|
||||||
|
if (!wasPaused)
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalWin.DisplayManager.NeedsToPaint = true;
|
GlobalWin.DisplayManager.NeedsToPaint = true;
|
||||||
|
@ -63,7 +66,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (frame == Emulator.Frame + 1) // Just emulate a frame we only have 1 to go!
|
if (frame == Emulator.Frame + 1) // Just emulate a frame we only have 1 to go!
|
||||||
{
|
{
|
||||||
|
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
GlobalWin.MainForm.FrameAdvance();
|
GlobalWin.MainForm.FrameAdvance();
|
||||||
|
if (!wasPaused)
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -89,7 +95,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (frame == Emulator.Frame + 1) // We are at the end of the movie and advancing one frame, therefore we are recording, simply emulate a frame
|
if (frame == Emulator.Frame + 1) // We are at the end of the movie and advancing one frame, therefore we are recording, simply emulate a frame
|
||||||
{
|
{
|
||||||
|
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
||||||
GlobalWin.MainForm.FrameAdvance();
|
GlobalWin.MainForm.FrameAdvance();
|
||||||
|
if (!wasPaused)
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -217,6 +217,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
TasView.LoadSettingsSerialized(settingsJson);
|
TasView.LoadSettingsSerialized(settingsJson);
|
||||||
RefreshTasView();
|
RefreshTasView();
|
||||||
|
|
||||||
|
SetUpToolStripColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetUpColumns()
|
private void SetUpColumns()
|
||||||
|
@ -353,6 +355,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CurrentTasMovie.PropertyChanged += new PropertyChangedEventHandler(this.TasMovie_OnPropertyChanged);
|
CurrentTasMovie.PropertyChanged += new PropertyChangedEventHandler(this.TasMovie_OnPropertyChanged);
|
||||||
CurrentTasMovie.Filename = DefaultTasProjName(); // TODO don't do this, take over any mainform actions that can crash without a filename
|
CurrentTasMovie.Filename = DefaultTasProjName(); // TODO don't do this, take over any mainform actions that can crash without a filename
|
||||||
CurrentTasMovie.PopulateWithDefaultHeaderValues();
|
CurrentTasMovie.PopulateWithDefaultHeaderValues();
|
||||||
|
SetTasMovieCallbacks();
|
||||||
CurrentTasMovie.ClearChanges(); // Don't ask to save changes here.
|
CurrentTasMovie.ClearChanges(); // Don't ask to save changes here.
|
||||||
HandleMovieLoadStuff();
|
HandleMovieLoadStuff();
|
||||||
|
|
||||||
|
@ -371,9 +374,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return false;
|
return false;
|
||||||
WantsToControlStopMovie = true;
|
WantsToControlStopMovie = true;
|
||||||
|
|
||||||
|
CurrentTasMovie.ChangeLog.ClearLog();
|
||||||
CurrentTasMovie.ClearChanges();
|
CurrentTasMovie.ClearChanges();
|
||||||
|
|
||||||
SetTasMovieCallbacks();
|
|
||||||
SetTextProperty();
|
SetTextProperty();
|
||||||
MessageStatusLabel.Text = Path.GetFileName(CurrentTasMovie.Filename) + " loaded.";
|
MessageStatusLabel.Text = Path.GetFileName(CurrentTasMovie.Filename) + " loaded.";
|
||||||
|
|
||||||
|
@ -500,6 +503,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CurrentTasMovie.FlushInputCache();
|
CurrentTasMovie.FlushInputCache();
|
||||||
CurrentTasMovie.UseInputCache = false;
|
CurrentTasMovie.UseInputCache = false;
|
||||||
|
|
||||||
|
lastRefresh = Global.Emulator.Frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoAutoRestore()
|
private void DoAutoRestore()
|
||||||
|
@ -508,8 +512,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (_autoRestoreFrame > Emulator.Frame) // Don't unpause if we are already on the desired frame, else runaway seek
|
if (_autoRestoreFrame > Emulator.Frame) // Don't unpause if we are already on the desired frame, else runaway seek
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
|
||||||
GlobalWin.MainForm.PauseOnFrame = _autoRestoreFrame;
|
GlobalWin.MainForm.PauseOnFrame = _autoRestoreFrame;
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,6 +529,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadState(closestState);
|
LoadState(closestState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GlobalWin.MainForm.EmulatorPaused)
|
||||||
GlobalWin.MainForm.PauseOnFrame = frame;
|
GlobalWin.MainForm.PauseOnFrame = frame;
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
|
@ -751,15 +756,27 @@ 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));
|
||||||
|
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
||||||
|
CurrentTasMovie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
CurrentTasMovie.RemoveFrame(Global.Emulator.Frame - 1);
|
CurrentTasMovie.RemoveFrame(Global.Emulator.Frame - 1);
|
||||||
CurrentTasMovie.RemoveLagHistory(Global.Emulator.Frame); // Set frame is not +1. [should change?]
|
CurrentTasMovie.RemoveLagHistory(Global.Emulator.Frame); // Removes from WasLag
|
||||||
|
|
||||||
|
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
||||||
GoToFrame(Emulator.Frame - 1);
|
GoToFrame(Emulator.Frame - 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
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));
|
||||||
|
bool wasRecording = CurrentTasMovie.ChangeLog.IsRecording;
|
||||||
|
CurrentTasMovie.ChangeLog.IsRecording = false;
|
||||||
|
|
||||||
CurrentTasMovie.InsertInput(Global.Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
|
CurrentTasMovie.InsertInput(Global.Emulator.Frame - 1, CurrentTasMovie.GetInputLogEntry(Emulator.Frame - 2));
|
||||||
CurrentTasMovie.InsertLagHistory(Global.Emulator.Frame - 1, true);
|
CurrentTasMovie.InsertLagHistory(Global.Emulator.Frame, true);
|
||||||
|
|
||||||
|
CurrentTasMovie.ChangeLog.IsRecording = wasRecording;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue