Merge branch 'master' of https://github.com/TASVideos/BizHawk
This commit is contained in:
commit
b8f2bafa1d
|
@ -199,6 +199,8 @@ namespace BizHawk.Client.Common
|
||||||
errorMsg = except.ToString();
|
errorMsg = except.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.Filename += "." + BkmMovie.Extension;
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,6 +335,8 @@ namespace BizHawk.Client.Common
|
||||||
var minuend = Math.Min(lastFrame + 1, movie.InputLogLength);
|
var minuend = Math.Min(lastFrame + 1, movie.InputLogLength);
|
||||||
if (firstFrame > minuend)
|
if (firstFrame > minuend)
|
||||||
undoLength = minuend;
|
undoLength = minuend;
|
||||||
|
else if (firstFrame == minuend)
|
||||||
|
undoLength = Math.Max(lastFrame + 1, movie.InputLogLength) - firstFrame;
|
||||||
else
|
else
|
||||||
undoLength = minuend - firstFrame;
|
undoLength = minuend - firstFrame;
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ namespace BizHawk.Client.Common
|
||||||
public TasMovieMarkerList Markers { get; set; }
|
public TasMovieMarkerList Markers { get; set; }
|
||||||
public bool BindMarkersToInput { get; set; }
|
public bool BindMarkersToInput { get; set; }
|
||||||
public bool UseInputCache { get; set; }
|
public bool UseInputCache { get; set; }
|
||||||
|
public bool LastPositionStable = true;
|
||||||
public string NewBranchText = "";
|
public string NewBranchText = "";
|
||||||
public int CurrentBranch { get; set; }
|
public int CurrentBranch { get; set; }
|
||||||
public int BranchCount { get { return Branches.Count; } }
|
public int BranchCount { get { return Branches.Count; } }
|
||||||
|
@ -310,12 +311,18 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public void GreenzoneCurrentFrame()
|
public void GreenzoneCurrentFrame()
|
||||||
{
|
{
|
||||||
LagLog[Global.Emulator.Frame] = Global.Emulator.AsInputPollable().IsLagFrame;
|
if (Global.Emulator.Frame > LastValidFrame)
|
||||||
|
{
|
||||||
|
// emulated a new frame, current editing segment may change now. taseditor logic
|
||||||
|
LastPositionStable = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!StateManager.HasState(Global.Emulator.Frame))
|
LagLog[Global.Emulator.Frame] = Global.Emulator.AsInputPollable().IsLagFrame;
|
||||||
{
|
|
||||||
StateManager.Capture();
|
if (!StateManager.HasState(Global.Emulator.Frame))
|
||||||
}
|
{
|
||||||
|
StateManager.Capture();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearLagLog()
|
public void ClearLagLog()
|
||||||
|
|
|
@ -221,7 +221,8 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var result = MessageBox.Show("Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
// ensure topmost, not to have to minimize everything to see and use our modal window, if it somehow got covered
|
||||||
|
var result = MessageBox.Show(new Form(){TopMost = true},"Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
||||||
if (result == DialogResult.Yes)
|
if (result == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
if (encodedPath != null)
|
if (encodedPath != null)
|
||||||
|
|
|
@ -14,10 +14,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
// General
|
// General
|
||||||
case "Pause":
|
case "Pause":
|
||||||
// check this here since TogglePause() has no idea who triggered it
|
|
||||||
// and we need to treat pause hotkey specially in tastudio
|
|
||||||
if (GlobalWin.MainForm.EmulatorPaused && GlobalWin.Tools.IsLoaded<TAStudio>())
|
|
||||||
GlobalWin.Tools.TAStudio.IgnoreSeekFrame = true;
|
|
||||||
TogglePause();
|
TogglePause();
|
||||||
break;
|
break;
|
||||||
case "Toggle Throttle":
|
case "Toggle Throttle":
|
||||||
|
|
|
@ -607,7 +607,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public LoadRomArgs CurrentlyOpenRomArgs;
|
public LoadRomArgs CurrentlyOpenRomArgs;
|
||||||
public bool PauseAVI = false;
|
public bool PauseAVI = false;
|
||||||
public bool PressFrameAdvance = false;
|
public bool PressFrameAdvance = false;
|
||||||
public bool PressRewind = false;
|
public bool HoldFrameAdvance = false; // necessary for tastudio > button
|
||||||
|
public bool PressRewind = false; // necessary for tastudio < button
|
||||||
public bool FastForward = false;
|
public bool FastForward = false;
|
||||||
public bool TurboFastForward = false;
|
public bool TurboFastForward = false;
|
||||||
public bool RestoreReadWriteOnStop = false;
|
public bool RestoreReadWriteOnStop = false;
|
||||||
|
@ -2678,7 +2679,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
runFrame = true;
|
runFrame = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.ClientControls["Frame Advance"] || PressFrameAdvance)
|
if (Global.ClientControls["Frame Advance"] || PressFrameAdvance || HoldFrameAdvance)
|
||||||
{
|
{
|
||||||
// handle the initial trigger of a frame advance
|
// handle the initial trigger of a frame advance
|
||||||
if (_frameAdvanceTimestamp == 0)
|
if (_frameAdvanceTimestamp == 0)
|
||||||
|
@ -2687,8 +2688,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
runFrame = true;
|
runFrame = true;
|
||||||
_runloopFrameadvance = true;
|
_runloopFrameadvance = true;
|
||||||
_frameAdvanceTimestamp = currentTimestamp;
|
_frameAdvanceTimestamp = currentTimestamp;
|
||||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
|
||||||
GlobalWin.Tools.TAStudio.IgnoreSeekFrame = false;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2864,6 +2863,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
UpdateToolsAfter();
|
UpdateToolsAfter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GlobalWin.Tools.IsLoaded<TAStudio>() &&
|
||||||
|
GlobalWin.Tools.TAStudio.LastPositionFrame == Global.Emulator.Frame)
|
||||||
|
{
|
||||||
|
TasMovieRecord record = (Global.MovieSession.Movie as TasMovie)[Global.Emulator.Frame];
|
||||||
|
if (!record.Lagged.HasValue && IsSeeking)
|
||||||
|
// haven't yet greenzoned the frame, hence it's after editing
|
||||||
|
// then we want to pause here. taseditor fasion
|
||||||
|
PauseEmulator();
|
||||||
|
}
|
||||||
|
|
||||||
if (IsSeeking && Global.Emulator.Frame == PauseOnFrame.Value)
|
if (IsSeeking && Global.Emulator.Frame == PauseOnFrame.Value)
|
||||||
{
|
{
|
||||||
PauseEmulator();
|
PauseEmulator();
|
||||||
|
@ -2882,7 +2891,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (Global.ClientControls["Rewind"] || PressRewind)
|
if (Global.ClientControls["Rewind"] || PressRewind)
|
||||||
{
|
{
|
||||||
UpdateToolsAfter();
|
UpdateToolsAfter();
|
||||||
PressRewind = false;
|
//PressRewind = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UpdateFrame)
|
if (UpdateFrame)
|
||||||
|
|
|
@ -94,6 +94,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
EmulatorLuaLibrary.YieldCallback = EmuYield;
|
EmulatorLuaLibrary.YieldCallback = EmuYield;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Restart()
|
||||||
|
{
|
||||||
|
foreach (var lib in Libraries)
|
||||||
|
{
|
||||||
|
ServiceInjector.UpdateServices(Global.Emulator.ServiceProvider, lib.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public LuaDocumentation Docs { get; private set; }
|
public LuaDocumentation Docs { get; private set; }
|
||||||
public bool IsRunning { get; set; }
|
public bool IsRunning { get; set; }
|
||||||
public EventWaitHandle LuaWait { get; private set; }
|
public EventWaitHandle LuaWait { get; private set; }
|
||||||
|
|
|
@ -135,6 +135,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
|
// Even if the lua console is self-rebooting from client.reboot_core() we still want to re-inject dependencies
|
||||||
|
if (IsRebootingCore)
|
||||||
|
{
|
||||||
|
LuaImp.Restart();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (LuaImp != null && LuaImp.GuiLibrary != null && LuaImp.GuiLibrary.HasLuaSurface)
|
if (LuaImp != null && LuaImp.GuiLibrary != null && LuaImp.GuiLibrary.HasLuaSurface)
|
||||||
{
|
{
|
||||||
LuaImp.GuiLibrary.DrawFinish();
|
LuaImp.GuiLibrary.DrawFinish();
|
||||||
|
|
|
@ -126,7 +126,9 @@
|
||||||
this.FrameAdvanceButton.TabIndex = 3;
|
this.FrameAdvanceButton.TabIndex = 3;
|
||||||
this.FrameAdvanceButton.Text = ">";
|
this.FrameAdvanceButton.Text = ">";
|
||||||
this.FrameAdvanceButton.UseVisualStyleBackColor = true;
|
this.FrameAdvanceButton.UseVisualStyleBackColor = true;
|
||||||
this.FrameAdvanceButton.Click += new System.EventHandler(this.FrameAdvanceButton_Click);
|
this.FrameAdvanceButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FrameAdvanceButton_MouseDown);
|
||||||
|
this.FrameAdvanceButton.MouseLeave += new System.EventHandler(this.FrameAdvanceButton_MouseLeave);
|
||||||
|
this.FrameAdvanceButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.FrameAdvanceButton_MouseUp);
|
||||||
//
|
//
|
||||||
// PauseButton
|
// PauseButton
|
||||||
//
|
//
|
||||||
|
@ -148,7 +150,9 @@
|
||||||
this.RewindButton.TabIndex = 1;
|
this.RewindButton.TabIndex = 1;
|
||||||
this.RewindButton.Text = "<";
|
this.RewindButton.Text = "<";
|
||||||
this.RewindButton.UseVisualStyleBackColor = true;
|
this.RewindButton.UseVisualStyleBackColor = true;
|
||||||
this.RewindButton.Click += new System.EventHandler(this.RewindButton_Click);
|
this.RewindButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RewindButton_MouseDown);
|
||||||
|
this.RewindButton.MouseLeave += new System.EventHandler(this.RewindButton_MouseLeave);
|
||||||
|
this.RewindButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RewindButton_MouseUp);
|
||||||
//
|
//
|
||||||
// PreviousMarkerButton
|
// PreviousMarkerButton
|
||||||
//
|
//
|
||||||
|
|
|
@ -115,45 +115,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Tastudio.GoToPreviousMarker();
|
Tastudio.GoToPreviousMarker();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RewindButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (GlobalWin.MainForm.IsSeeking)
|
|
||||||
{
|
|
||||||
GlobalWin.MainForm.PauseOnFrame--;
|
|
||||||
if (Global.Emulator.Frame == GlobalWin.MainForm.PauseOnFrame)
|
|
||||||
{
|
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
|
||||||
Tastudio.StopSeeking();
|
|
||||||
}
|
|
||||||
Tastudio.RefreshDialog();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tastudio.GoToPreviousFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PauseButton_Click(object sender, EventArgs e)
|
private void PauseButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (GlobalWin.MainForm.EmulatorPaused)
|
|
||||||
Tastudio.IgnoreSeekFrame = true;
|
|
||||||
Tastudio.TogglePause();
|
Tastudio.TogglePause();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FrameAdvanceButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (GlobalWin.MainForm.IsSeeking)
|
|
||||||
{
|
|
||||||
GlobalWin.MainForm.PauseOnFrame++;
|
|
||||||
Tastudio.RefreshDialog();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tastudio.GoToNextFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NextMarkerButton_Click(object sender, EventArgs e)
|
private void NextMarkerButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Tastudio.GoToNextMarker();
|
Tastudio.GoToNextMarker();
|
||||||
|
@ -193,5 +159,37 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
RecordingMode ^= true;
|
RecordingMode ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RewindButton_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.PressRewind = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RewindButton_MouseUp(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.PressRewind = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RewindButton_MouseLeave(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.PressRewind = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FrameAdvanceButton_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.HoldFrameAdvance = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FrameAdvanceButton_MouseLeave(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.HoldFrameAdvance = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FrameAdvanceButton_MouseUp(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalWin.MainForm.HoldFrameAdvance = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,21 +78,24 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool Rewind()
|
public bool Rewind()
|
||||||
{
|
{
|
||||||
//if (GlobalWin.MainForm.IsSeeking)
|
// copypasted from TasView_MouseWheel(), just without notch logic
|
||||||
//{
|
if (Mainform.IsSeeking)
|
||||||
// GlobalWin.MainForm.PauseOnFrame--;
|
{
|
||||||
// if (Emulator.Frame == GlobalWin.MainForm.PauseOnFrame)
|
Mainform.PauseOnFrame--;
|
||||||
// {
|
// that's a weird condition here, but for whatever reason it works best
|
||||||
// GlobalWin.MainForm.PauseEmulator();
|
if (Emulator.Frame >= Mainform.PauseOnFrame)
|
||||||
// GlobalWin.MainForm.PauseOnFrame = null;
|
{
|
||||||
// StopSeeking();
|
Mainform.PauseEmulator();
|
||||||
// }
|
Mainform.PauseOnFrame = null;
|
||||||
// RefreshDialog();
|
StopSeeking();
|
||||||
//}
|
GoToPreviousFrame();
|
||||||
//else
|
}
|
||||||
//{
|
RefreshDialog();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
GoToPreviousFrame();
|
GoToPreviousFrame();
|
||||||
//}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IgnoreSeekFrame = false; // don't unpause
|
|
||||||
StopSeeking();
|
StopSeeking();
|
||||||
|
|
||||||
if (CurrentTasMovie != null && CurrentTasMovie.Changes)
|
if (CurrentTasMovie != null && CurrentTasMovie.Changes)
|
||||||
|
|
|
@ -62,29 +62,25 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (_autoRestorePaused == null)
|
if (_autoRestorePaused == null)
|
||||||
{
|
{
|
||||||
_autoRestorePaused = GlobalWin.MainForm.EmulatorPaused;
|
_autoRestorePaused = Mainform.EmulatorPaused;
|
||||||
if (GlobalWin.MainForm.IsSeeking) // If seeking, do not shorten seek.
|
if (Mainform.IsSeeking) // If seeking, do not shorten seek.
|
||||||
_autoRestoreFrame = GlobalWin.MainForm.PauseOnFrame;
|
_autoRestoreFrame = Mainform.PauseOnFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
|
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastValidFrame);
|
||||||
StartSeeking(_autoRestoreFrame, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartSeeking(int? frame, bool pause = false)
|
private void StartSeeking(int? frame)
|
||||||
{
|
{
|
||||||
if (!frame.HasValue)
|
if (!frame.HasValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_seekStartFrame = Emulator.Frame;
|
_seekStartFrame = Emulator.Frame;
|
||||||
GlobalWin.MainForm.PauseOnFrame = frame.Value;
|
Mainform.PauseOnFrame = frame.Value;
|
||||||
int? diff = GlobalWin.MainForm.PauseOnFrame - _seekStartFrame;
|
int? diff = Mainform.PauseOnFrame - _seekStartFrame;
|
||||||
|
|
||||||
if (pause)
|
Mainform.UnpauseEmulator();
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
|
||||||
else
|
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
|
||||||
|
|
||||||
if (!_seekBackgroundWorker.IsBusy && diff.Value > TasView.VisibleRows)
|
if (!_seekBackgroundWorker.IsBusy && diff.Value > TasView.VisibleRows)
|
||||||
_seekBackgroundWorker.RunWorkerAsync();
|
_seekBackgroundWorker.RunWorkerAsync();
|
||||||
|
@ -98,11 +94,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TastudioRecordMode();
|
TastudioRecordMode();
|
||||||
_wasRecording = false;
|
_wasRecording = false;
|
||||||
}
|
}
|
||||||
if (IgnoreSeekFrame)
|
|
||||||
{
|
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
|
||||||
IgnoreSeekFrame = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool FloatEditingMode
|
public bool FloatEditingMode
|
||||||
|
@ -111,7 +102,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCFEDFC); Why?
|
// public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCFEDFC); Why?
|
||||||
public static Color CurrentFrame_InputLog = Color.FromArgb(0xB5E7F7);
|
public static Color CurrentFrame_InputLog = Color.FromArgb(0x00B5E7F7);
|
||||||
|
public static Color SeekFrame_InputLog = Color.FromArgb(0x70B5E7F7);
|
||||||
|
|
||||||
public static Color GreenZone_FrameCol = Color.FromArgb(0xDDFFDD);
|
public static Color GreenZone_FrameCol = Color.FromArgb(0xDDFFDD);
|
||||||
public static Color GreenZone_InputLog = Color.FromArgb(0xD2F9D3);
|
public static Color GreenZone_InputLog = Color.FromArgb(0xD2F9D3);
|
||||||
|
@ -159,7 +151,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (columnName == CursorColumnName)
|
if (columnName == CursorColumnName)
|
||||||
{
|
{
|
||||||
if (index == Emulator.Frame && index == GlobalWin.MainForm.PauseOnFrame)
|
if (index == Emulator.Frame && index == Mainform.PauseOnFrame)
|
||||||
{
|
{
|
||||||
bitmap = TasView.HorizontalOrientation ?
|
bitmap = TasView.HorizontalOrientation ?
|
||||||
ts_v_arrow_green_blue :
|
ts_v_arrow_green_blue :
|
||||||
|
@ -171,7 +163,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ts_v_arrow_blue :
|
ts_v_arrow_blue :
|
||||||
ts_h_arrow_blue;
|
ts_h_arrow_blue;
|
||||||
}
|
}
|
||||||
else if (index == GlobalWin.MainForm.PauseOnFrame)
|
else if (index == LastPositionFrame)
|
||||||
{
|
{
|
||||||
bitmap = TasView.HorizontalOrientation ?
|
bitmap = TasView.HorizontalOrientation ?
|
||||||
ts_v_arrow_green :
|
ts_v_arrow_green :
|
||||||
|
@ -227,11 +219,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (player != 0 && player % 2 == 0)
|
if (player != 0 && player % 2 == 0)
|
||||||
color = Color.FromArgb(0x0D000000);
|
color = Color.FromArgb(0x0D000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TasView_QueryRowBkColor(int index, ref Color color)
|
private void TasView_QueryRowBkColor(int index, ref Color color)
|
||||||
{
|
{
|
||||||
TasMovieRecord record = CurrentTasMovie[index];
|
TasMovieRecord record = CurrentTasMovie[index];
|
||||||
|
|
||||||
if (Emulator.Frame == index)
|
if (Mainform.IsSeeking && Mainform.PauseOnFrame == index)
|
||||||
|
{
|
||||||
|
color = CurrentFrame_InputLog;
|
||||||
|
}
|
||||||
|
else if (!Mainform.IsSeeking && Emulator.Frame == index)
|
||||||
{
|
{
|
||||||
color = CurrentFrame_InputLog;
|
color = CurrentFrame_InputLog;
|
||||||
}
|
}
|
||||||
|
@ -404,9 +401,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (e.Button == MouseButtons.Middle)
|
if (e.Button == MouseButtons.Middle)
|
||||||
{
|
{
|
||||||
if (GlobalWin.MainForm.EmulatorPaused)
|
if (Mainform.EmulatorPaused)
|
||||||
IgnoreSeekFrame = false;
|
{
|
||||||
TogglePause();
|
TasMovieRecord record = CurrentTasMovie[LastPositionFrame];
|
||||||
|
if (!record.Lagged.HasValue && LastPositionFrame > Global.Emulator.Frame)
|
||||||
|
StartSeeking(LastPositionFrame);
|
||||||
|
else
|
||||||
|
Mainform.UnpauseEmulator();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mainform.PauseEmulator();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +426,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (e.Button == MouseButtons.Left)
|
if (e.Button == MouseButtons.Left)
|
||||||
{
|
{
|
||||||
|
bool wasHeld = _leftButtonHeld;
|
||||||
_leftButtonHeld = true;
|
_leftButtonHeld = true;
|
||||||
// SuuperW: Exit float editing mode, or re-enter mouse editing
|
// SuuperW: Exit float editing mode, or re-enter mouse editing
|
||||||
if (_floatEditRow != -1)
|
if (_floatEditRow != -1)
|
||||||
|
@ -459,7 +466,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else // User changed input
|
else // User changed input
|
||||||
{
|
{
|
||||||
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
bool wasPaused = Mainform.EmulatorPaused;
|
||||||
|
|
||||||
|
if (Emulator.Frame > frame || CurrentTasMovie.LastValidFrame > frame)
|
||||||
|
{
|
||||||
|
if (wasPaused && !Mainform.IsSeeking && !CurrentTasMovie.LastPositionStable)
|
||||||
|
{
|
||||||
|
LastPositionFrame = Emulator.Frame;
|
||||||
|
CurrentTasMovie.LastPositionStable = true; // until new frame is emulated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Global.MovieSession.MovieControllerAdapter.Type.BoolButtons.Contains(buttonName))
|
if (Global.MovieSession.MovieControllerAdapter.Type.BoolButtons.Contains(buttonName))
|
||||||
{
|
{
|
||||||
CurrentTasMovie.ChangeLog.BeginNewBatch("Paint Bool " + buttonName + " from frame " + frame);
|
CurrentTasMovie.ChangeLog.BeginNewBatch("Paint Bool " + buttonName + " from frame " + frame);
|
||||||
|
@ -533,10 +550,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
// taseditor behavior
|
// taseditor behavior
|
||||||
if (!wasPaused)
|
if (!wasPaused)
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
|
|
||||||
if (!Settings.AutoRestoreLastPosition)
|
|
||||||
IgnoreSeekFrame = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e.Button == System.Windows.Forms.MouseButtons.Right)
|
else if (e.Button == System.Windows.Forms.MouseButtons.Right)
|
||||||
|
@ -653,20 +667,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_supressContextMenu = true;
|
_supressContextMenu = true;
|
||||||
int notch = e.Delta / 120;
|
int notch = e.Delta / 120;
|
||||||
|
if (notch > 1)
|
||||||
|
notch *= 2;
|
||||||
|
|
||||||
if (GlobalWin.MainForm.IsSeeking)
|
// warning: tastudio rewind hotkey/button logic is copypasted from here!
|
||||||
|
if (Mainform.IsSeeking && !Mainform.EmulatorPaused)
|
||||||
{
|
{
|
||||||
if (e.Delta < 0)
|
Mainform.PauseOnFrame -= notch;
|
||||||
GlobalWin.MainForm.PauseOnFrame++;
|
// that's a weird condition here, but for whatever reason it works best
|
||||||
else
|
if (notch > 0 && Global.Emulator.Frame >= Mainform.PauseOnFrame)
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.PauseOnFrame--;
|
Mainform.PauseEmulator();
|
||||||
if (Global.Emulator.Frame == GlobalWin.MainForm.PauseOnFrame)
|
Mainform.PauseOnFrame = null;
|
||||||
{
|
StopSeeking();
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
GoToFrame(Emulator.Frame - notch);
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
|
||||||
StopSeeking();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
RefreshDialog();
|
RefreshDialog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void NewTasMenuItem_Click(object sender, EventArgs e)
|
private void NewTasMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (GlobalWin.MainForm.GameIsClosing)
|
if (Mainform.GameIsClosing)
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// TODO: if highlighting 2 rows and pasting 3, only paste 2 of them
|
// TODO: if highlighting 2 rows and pasting 3, only paste 2 of them
|
||||||
// FCEUX Taseditor does't do this, but I think it is the expected behavior in editor programs
|
// FCEUX Taseditor does't do this, but I think it is the expected behavior in editor programs
|
||||||
|
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
|
|
||||||
if (_tasClipboard.Any())
|
if (_tasClipboard.Any())
|
||||||
{
|
{
|
||||||
|
@ -404,7 +404,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -416,7 +416,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void PasteInsertMenuItem_Click(object sender, EventArgs e)
|
private void PasteInsertMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
|
|
||||||
if (_tasClipboard.Any())
|
if (_tasClipboard.Any())
|
||||||
{
|
{
|
||||||
|
@ -433,7 +433,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -447,7 +447,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.AnyRowsSelected)
|
if (TasView.AnyRowsSelected)
|
||||||
{
|
{
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -494,7 +494,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.AnyRowsSelected)
|
if (TasView.AnyRowsSelected)
|
||||||
{
|
{
|
||||||
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
bool wasPaused = Mainform.EmulatorPaused;
|
||||||
bool needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame);
|
bool needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame);
|
||||||
int rollBackFrame = TasView.FirstSelectedIndex.Value;
|
int rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -528,7 +528,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.AnyRowsSelected)
|
if (TasView.AnyRowsSelected)
|
||||||
{
|
{
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
var rollBackFrame = TasView.FirstSelectedIndex.Value;
|
||||||
if (rollBackFrame >= CurrentTasMovie.InputLogLength)
|
if (rollBackFrame >= CurrentTasMovie.InputLogLength)
|
||||||
|
@ -549,7 +549,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -563,7 +563,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (TasView.AnyRowsSelected)
|
if (TasView.AnyRowsSelected)
|
||||||
{
|
{
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
var framesToInsert = TasView.SelectedRows.ToList();
|
var framesToInsert = TasView.SelectedRows.ToList();
|
||||||
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
|
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
|
||||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
|
@ -583,7 +583,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -595,7 +595,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void InsertFrameMenuItem_Click(object sender, EventArgs e)
|
private void InsertFrameMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
var wasPaused = Mainform.EmulatorPaused;
|
||||||
var insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
|
var insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
|
||||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -621,7 +621,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
|
private void InsertNumFramesMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
bool wasPaused = GlobalWin.MainForm.EmulatorPaused;
|
bool wasPaused = Mainform.EmulatorPaused;
|
||||||
int insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
|
int insertionFrame = TasView.AnyRowsSelected ? TasView.FirstSelectedIndex.Value : 0;
|
||||||
bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -720,7 +720,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame;
|
int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.FrameAdvance();
|
Mainform.FrameAdvance();
|
||||||
|
|
||||||
if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame))
|
if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame))
|
||||||
{
|
{
|
||||||
|
@ -936,7 +936,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
new MovieHeaderEditor(CurrentTasMovie)
|
new MovieHeaderEditor(CurrentTasMovie)
|
||||||
{
|
{
|
||||||
Owner = GlobalWin.MainForm,
|
Owner = Mainform,
|
||||||
Location = this.ChildPointToScreen(TasView)
|
Location = this.ChildPointToScreen(TasView)
|
||||||
}.Show();
|
}.Show();
|
||||||
UpdateChangesIndicator();
|
UpdateChangesIndicator();
|
||||||
|
@ -946,7 +946,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
new StateHistorySettingsForm(CurrentTasMovie.TasStateManager.Settings)
|
new StateHistorySettingsForm(CurrentTasMovie.TasStateManager.Settings)
|
||||||
{
|
{
|
||||||
Owner = GlobalWin.MainForm,
|
Owner = Mainform,
|
||||||
Location = this.ChildPointToScreen(TasView),
|
Location = this.ChildPointToScreen(TasView),
|
||||||
Statable = this.StatableEmulator
|
Statable = this.StatableEmulator
|
||||||
}.ShowDialog();
|
}.ShowDialog();
|
||||||
|
@ -1231,13 +1231,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
StartFromNowSeparator.Visible =StartNewProjectFromNowMenuItem.Visible || StartANewProjectFromSaveRamMenuItem.Visible;
|
StartFromNowSeparator.Visible =StartNewProjectFromNowMenuItem.Visible || StartANewProjectFromSaveRamMenuItem.Visible;
|
||||||
RemoveMarkersContextMenuItem.Enabled = CurrentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this).
|
RemoveMarkersContextMenuItem.Enabled = CurrentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this).
|
||||||
CancelSeekContextMenuItem.Enabled = GlobalWin.MainForm.PauseOnFrame.HasValue;
|
CancelSeekContextMenuItem.Enabled = Mainform.PauseOnFrame.HasValue;
|
||||||
BranchContextMenuItem.Visible = TasView.CurrentCell.RowIndex == Emulator.Frame;
|
BranchContextMenuItem.Visible = TasView.CurrentCell.RowIndex == Emulator.Frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CancelSeekContextMenuItem_Click(object sender, EventArgs e)
|
private void CancelSeekContextMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
Mainform.PauseOnFrame = null;
|
||||||
RefreshTasView();
|
RefreshTasView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1255,7 +1255,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
|
TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
|
||||||
index, (byte[])StatableEmulator.SaveStateBinary().Clone());
|
index, (byte[])StatableEmulator.SaveStateBinary().Clone());
|
||||||
|
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
Mainform.PauseEmulator();
|
||||||
LoadFile(new FileInfo(newProject.Filename), true);
|
LoadFile(new FileInfo(newProject.Filename), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1270,7 +1270,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TasMovie newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie(
|
TasMovie newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie(
|
||||||
SaveRamEmulator.CloneSaveRam());
|
SaveRamEmulator.CloneSaveRam());
|
||||||
|
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
Mainform.PauseEmulator();
|
||||||
LoadFile(new FileInfo(newProject.Filename), true);
|
LoadFile(new FileInfo(newProject.Filename), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,10 +43,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;
|
bool wasPaused = Mainform.EmulatorPaused;
|
||||||
GlobalWin.MainForm.FrameAdvance();
|
Mainform.FrameAdvance();
|
||||||
if (!wasPaused)
|
if (!wasPaused)
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
Mainform.UnpauseEmulator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsInMenuLoop { get; private set; }
|
public bool IsInMenuLoop { get; private set; }
|
||||||
public bool IgnoreSeekFrame { get; set; }
|
|
||||||
|
|
||||||
[ConfigPersist]
|
[ConfigPersist]
|
||||||
public TAStudioSettings Settings { get; set; }
|
public TAStudioSettings Settings { get; set; }
|
||||||
|
@ -111,6 +110,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
get { return Global.MovieSession.Movie as TasMovie; }
|
get { return Global.MovieSession.Movie as TasMovie; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MainForm Mainform
|
||||||
|
{
|
||||||
|
get { return GlobalWin.MainForm; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Separates "restore last position" logic from seeking caused by navigation.
|
||||||
|
/// TASEditor never kills LastPositionFrame, and it only pauses on it,
|
||||||
|
/// if it hasn't been greenzoned beforehand and middle mouse button was pressed.
|
||||||
|
/// </summary>
|
||||||
|
public int LastPositionFrame { get; set; }
|
||||||
|
|
||||||
#region "Initializing"
|
#region "Initializing"
|
||||||
|
|
||||||
public TAStudio()
|
public TAStudio()
|
||||||
|
@ -158,7 +169,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TasView.PointedCellChanged += TasView_PointedCellChanged;
|
TasView.PointedCellChanged += TasView_PointedCellChanged;
|
||||||
TasView.MultiSelect = true;
|
TasView.MultiSelect = true;
|
||||||
TasView.MaxCharactersInHorizontal = 1;
|
TasView.MaxCharactersInHorizontal = 1;
|
||||||
IgnoreSeekFrame = false;
|
LastPositionFrame = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AutosaveTimerEventProcessor(object sender, EventArgs e)
|
private void AutosaveTimerEventProcessor(object sender, EventArgs e)
|
||||||
|
@ -244,7 +255,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
int diff = Global.Emulator.Frame - _seekStartFrame.Value;
|
int diff = Global.Emulator.Frame - _seekStartFrame.Value;
|
||||||
int unit = GlobalWin.MainForm.PauseOnFrame.Value - _seekStartFrame.Value;
|
int unit = Mainform.PauseOnFrame.Value - _seekStartFrame.Value;
|
||||||
double progress = 0;
|
double progress = 0;
|
||||||
|
|
||||||
if (diff != 0 && unit != 0)
|
if (diff != 0 && unit != 0)
|
||||||
|
@ -503,16 +514,16 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EngageTastudio()
|
private void EngageTastudio()
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
Mainform.PauseOnFrame = null;
|
||||||
GlobalWin.OSD.AddMessage("TAStudio engaged");
|
GlobalWin.OSD.AddMessage("TAStudio engaged");
|
||||||
SetTasMovieCallbacks();
|
SetTasMovieCallbacks();
|
||||||
SetTextProperty();
|
SetTextProperty();
|
||||||
GlobalWin.MainForm.PauseEmulator();
|
Mainform.PauseEmulator();
|
||||||
GlobalWin.MainForm.RelinquishControl(this);
|
Mainform.RelinquishControl(this);
|
||||||
_originalEndAction = Global.Config.MovieEndAction;
|
_originalEndAction = Global.Config.MovieEndAction;
|
||||||
GlobalWin.MainForm.ClearRewindData();
|
Mainform.ClearRewindData();
|
||||||
Global.Config.MovieEndAction = MovieEndAction.Record;
|
Global.Config.MovieEndAction = MovieEndAction.Record;
|
||||||
GlobalWin.MainForm.SetMainformMovieInfo();
|
Mainform.SetMainformMovieInfo();
|
||||||
Global.MovieSession.ReadOnly = true;
|
Global.MovieSession.ReadOnly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,7 +657,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (movie == null)
|
if (movie == null)
|
||||||
movie = CurrentTasMovie;
|
movie = CurrentTasMovie;
|
||||||
SetTasMovieCallbacks(movie as TasMovie);
|
SetTasMovieCallbacks(movie as TasMovie);
|
||||||
bool result = GlobalWin.MainForm.StartNewMovie(movie, record);
|
bool result = Mainform.StartNewMovie(movie, record);
|
||||||
TastudioPlayMode();
|
TastudioPlayMode();
|
||||||
_initializing = false;
|
_initializing = false;
|
||||||
|
|
||||||
|
@ -698,17 +709,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void TastudioStopMovie()
|
private void TastudioStopMovie()
|
||||||
{
|
{
|
||||||
Global.MovieSession.StopMovie(false);
|
Global.MovieSession.StopMovie(false);
|
||||||
GlobalWin.MainForm.SetMainformMovieInfo();
|
Mainform.SetMainformMovieInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisengageTastudio()
|
private void DisengageTastudio()
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
Mainform.PauseOnFrame = null;
|
||||||
GlobalWin.OSD.AddMessage("TAStudio disengaged");
|
GlobalWin.OSD.AddMessage("TAStudio disengaged");
|
||||||
Global.MovieSession.Movie = MovieService.DefaultInstance;
|
Global.MovieSession.Movie = MovieService.DefaultInstance;
|
||||||
GlobalWin.MainForm.TakeBackControl();
|
Mainform.TakeBackControl();
|
||||||
Global.Config.MovieEndAction = _originalEndAction;
|
Global.Config.MovieEndAction = _originalEndAction;
|
||||||
GlobalWin.MainForm.SetMainformMovieInfo();
|
Mainform.SetMainformMovieInfo();
|
||||||
// Do not keep TAStudio's disk save states.
|
// Do not keep TAStudio's disk save states.
|
||||||
//if (Directory.Exists(statesPath)) Directory.Delete(statesPath, true);
|
//if (Directory.Exists(statesPath)) Directory.Delete(statesPath, true);
|
||||||
//TODO - do we need to dispose something here instead?
|
//TODO - do we need to dispose something here instead?
|
||||||
|
@ -795,8 +806,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (_autoRestorePaused.HasValue && !_autoRestorePaused.Value)
|
if (_autoRestorePaused.HasValue && !_autoRestorePaused.Value)
|
||||||
{
|
{
|
||||||
// this happens when we're holding the left button while unpaused - view scrolls down, new input gets drawn, seek pauses
|
// this happens when we're holding the left button while unpaused - view scrolls down, new input gets drawn, seek pauses
|
||||||
IgnoreSeekFrame = true;
|
Mainform.UnpauseEmulator();
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
|
||||||
}
|
}
|
||||||
_autoRestorePaused = null;
|
_autoRestorePaused = null;
|
||||||
}
|
}
|
||||||
|
@ -819,7 +829,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// frame == Emualtor.Frame when frame == 0
|
// frame == Emualtor.Frame when frame == 0
|
||||||
if (frame > Emulator.Frame)
|
if (frame > Emulator.Frame)
|
||||||
{
|
{
|
||||||
if (GlobalWin.MainForm.EmulatorPaused || GlobalWin.MainForm.IsSeeking) // make seek frame keep up with emulation on fast scrolls
|
if (Mainform.EmulatorPaused || Mainform.IsSeeking) // make seek frame keep up with emulation on fast scrolls
|
||||||
{
|
{
|
||||||
StartSeeking(frame);
|
StartSeeking(frame);
|
||||||
}
|
}
|
||||||
|
@ -861,7 +871,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void TogglePause()
|
public void TogglePause()
|
||||||
{
|
{
|
||||||
GlobalWin.MainForm.TogglePause();
|
Mainform.TogglePause();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetSplicer()
|
private void SetSplicer()
|
||||||
|
|
|
@ -456,12 +456,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, tool.GetType()))
|
if (ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, tool.GetType()))
|
||||||
{
|
{
|
||||||
ServiceInjector.UpdateServices(Global.Emulator.ServiceProvider, tool);
|
ServiceInjector.UpdateServices(Global.Emulator.ServiceProvider, tool);
|
||||||
bool restartTool = false;
|
|
||||||
if ((tool.IsHandleCreated && !tool.IsDisposed) || tool is RamWatch) // Hack for RAM Watch - in display watches mode it wants to keep running even closed, it will handle disposed logic
|
if ((tool.IsHandleCreated && !tool.IsDisposed) || tool is RamWatch) // Hack for RAM Watch - in display watches mode it wants to keep running even closed, it will handle disposed logic
|
||||||
restartTool = true;
|
|
||||||
if (tool is LuaConsole && ((LuaConsole)tool).IsRebootingCore)
|
|
||||||
restartTool = false;
|
|
||||||
if (restartTool)
|
|
||||||
{
|
{
|
||||||
tool.Restart();
|
tool.Restart();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,17 +44,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
int mode = addr & 3;
|
int mode = addr & 3;
|
||||||
int prg_high = value & 0x3F;
|
int prg_high = value & 0x3F;
|
||||||
bool prg_low = value.Bit(7);
|
bool prg_low = value.Bit(7);
|
||||||
int prg_low_val = prg_low ? 1 : 0;
|
int prg_low_val = 0;
|
||||||
|
if (mode==2)
|
||||||
|
prg_low_val = prg_low ? 1 : 0;
|
||||||
bool mirror = value.Bit(6);
|
bool mirror = value.Bit(6);
|
||||||
SetMirrorType(mirror ? EMirrorType.Horizontal : EMirrorType.Vertical);
|
SetMirrorType(!mirror ? EMirrorType.Horizontal : EMirrorType.Vertical);
|
||||||
|
|
||||||
switch(mode)
|
switch(mode)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
prg_banks_8k[0] = (byte)((prg_high * 2 + 0) ^ prg_low_val);
|
prg_banks_8k[0] = (byte)((prg_high * 2 + 0) ^ prg_low_val);
|
||||||
prg_banks_8k[1] = (byte)((prg_high * 2 + 1) ^ prg_low_val);
|
prg_banks_8k[1] = (byte)((prg_high * 2 + 1) ^ prg_low_val);
|
||||||
prg_banks_8k[2] = (byte)((prg_high * 2 + 2) ^ prg_low_val);
|
prg_high = prg_high | 0x01;
|
||||||
prg_banks_8k[3] = (byte)((prg_high * 2 + 3) ^ prg_low_val);
|
prg_banks_8k[2] = (byte)((prg_high * 2 + 0) ^ prg_low_val);
|
||||||
|
prg_banks_8k[3] = (byte)((prg_high * 2 + 1) ^ prg_low_val);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
prg_banks_8k[0] = (byte)((prg_high*2+0) ^ prg_low_val);
|
prg_banks_8k[0] = (byte)((prg_high*2+0) ^ prg_low_val);
|
||||||
|
|
|
@ -236,7 +236,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
irq_pending = true;
|
irq_pending = true;
|
||||||
SyncIRQ();
|
SyncIRQ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,6 +251,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
if (irq_countdown == 0)
|
if (irq_countdown == 0)
|
||||||
{
|
{
|
||||||
ClockIRQ();
|
ClockIRQ();
|
||||||
|
if (irq_mode==true)
|
||||||
|
irq_countdown = 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,9 +57,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
delay--;
|
delay--;
|
||||||
if(delay==0)
|
if(delay==0 && irq_pending)
|
||||||
board.IRQSignal = true;
|
board.IRQSignal = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,11 +189,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
break;
|
break;
|
||||||
case 0x4002:
|
case 0x4002:
|
||||||
if (!pal16) break;
|
if (!pal16) break;
|
||||||
mmc3.WritePRG(0x6000, value);
|
mmc3.WritePRG(0x6001, value);
|
||||||
break;
|
break;
|
||||||
case 0x4003:
|
case 0x4003:
|
||||||
if (!pal16) break;
|
if (!pal16) break;
|
||||||
mmc3.WritePRG(0x6001, value);
|
mmc3.WritePRG(0x6000, value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x6000:
|
case 0x6000:
|
||||||
|
|
Loading…
Reference in New Issue