diff --git a/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj b/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj index daac456de0..4444e73164 100644 --- a/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj +++ b/BizHawk.Client.ApiHawk/BizHawk.Client.ApiHawk.csproj @@ -99,6 +99,14 @@ + + + + + + + + diff --git a/BizHawk.Client.ApiHawk/Classes/ClientApi.cs b/BizHawk.Client.ApiHawk/Classes/ClientApi.cs index 30b9424167..8dd45af913 100644 --- a/BizHawk.Client.ApiHawk/Classes/ClientApi.cs +++ b/BizHawk.Client.ApiHawk/Classes/ClientApi.cs @@ -4,11 +4,12 @@ using System.Linq; using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; - using BizHawk.Client.Common; using BizHawk.Emulation.Cores.Nintendo.Gameboy; using BizHawk.Emulation.Cores.PCEngine; using BizHawk.Emulation.Cores.Sega.MasterSystem; +using BizHawk.Client.ApiHawk.Classes.Events; +using System.IO; namespace BizHawk.Client.ApiHawk { @@ -28,10 +29,31 @@ namespace BizHawk.Client.ApiHawk internal static readonly BizHawkSystemIdToEnumConverter SystemIdConverter = new BizHawkSystemIdToEnumConverter(); internal static readonly JoypadStringToEnumConverter JoypadConverter = new JoypadStringToEnumConverter(); - public static event EventHandler RomLoaded; - private static List allJoypads; + /// + /// Occurs before a quickload is done (just after user has pressed the shortcut button + /// or has click on the item menu) + /// + public static event BeforeQuickLoadEventHandler BeforeQuickLoad; + /// + /// Occurs before a quicksave is done (just after user has pressed the shortcut button + /// or has click on the item menu) + /// + public static event BeforeQuickSaveEventHandler BeforeQuickSave; + /// + /// Occurs when a ROM is succesfully loaded + /// + public static event EventHandler RomLoaded; + /// + /// Occurs when a savestate is sucessfully loaded + /// + public static event StateLoadedEventHandler StateLoaded; + /// + /// Occurs when a savestate is successfully saved + /// + public static event StateSavedEventHandler StateSaved; + #endregion #region cTor(s) @@ -95,6 +117,80 @@ namespace BizHawk.Client.ApiHawk } } + + /// + /// Load a savestate specified by its name + /// + /// Savetate friendly name + public static void LoadState(string name) + { + MethodInfo method = mainFormClass.GetMethod("LoadState"); + method.Invoke(clientMainFormInstance, new object[] { Path.Combine(PathManager.GetSaveStatePath(Global.Game), string.Format("{0}.{1}", name, "State")), name, false, false }); + } + + + /// + /// Raised before a quickload is done (just after pressing shortcut button) + /// + /// Object who raised the event + /// Slot used for quickload + /// A boolean that can be set if users want to handle save themselves; if so, BizHawk won't do anything + public static void OnBeforeQuickLoad(object sender, string quickSaveSlotName, out bool eventHandled) + { + eventHandled = false; + if (BeforeQuickLoad != null) + { + BeforeQuickLoadEventArgs e = new BeforeQuickLoadEventArgs(quickSaveSlotName); + BeforeQuickLoad(sender, e); + eventHandled = e.Handled; + } + } + + + /// + /// Raised before a quicksave is done (just after pressing shortcut button) + /// + /// Object who raised the event + /// Slot used for quicksave + /// A boolean that can be set if users want to handle save themselves; if so, BizHawk won't do anything + public static void OnBeforeQuickSave(object sender, string quickSaveSlotName, out bool eventHandled) + { + eventHandled = false; + if (BeforeQuickSave != null) + { + BeforeQuickSaveEventArgs e = new BeforeQuickSaveEventArgs(quickSaveSlotName); + BeforeQuickSave(sender, e); + eventHandled = e.Handled; + } + } + + + /// + /// Raise when a state is loaded + /// + /// Object who raised the event + /// User friendly name for saved state + public static void OnStateLoaded(object sender, string stateName) + { + if (StateLoaded != null) + { + StateLoaded(sender, new StateLoadedEventArgs(stateName)); + } + } + + /// + /// Raise when a state is saved + /// + /// Object who raised the event + /// User friendly name for saved state + public static void OnStateSaved(object sender, string stateName) + { + if (StateSaved != null) + { + StateSaved(sender, new StateSavedEventArgs(stateName)); + } + } + /// /// Raise when a rom is successfully Loaded /// @@ -113,6 +209,17 @@ namespace BizHawk.Client.ApiHawk } + /// + /// Save a state with specified name + /// + /// Savetate friendly name + public static void SaveState(string name) + { + MethodInfo method = mainFormClass.GetMethod("SaveState"); + method.Invoke(clientMainFormInstance, new object[] { Path.Combine(PathManager.GetSaveStatePath(Global.Game), string.Format("{0}.{1}", name, "State")), name, false }); + } + + /// /// Sets the extra padding added to the 'native' surface so that you can draw HUD elements in predictable placements /// diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickLoadEventArgs.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickLoadEventArgs.cs new file mode 100644 index 0000000000..85fe83d1f8 --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickLoadEventArgs.cs @@ -0,0 +1,68 @@ +using System; + +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// This class holds event data for BeforeQuickLoad event + /// + public sealed class BeforeQuickLoadEventArgs : EventArgs + { + #region Fields + + private bool _Handled = false; + private string _QuickSaveSlotName; + + #endregion + + #region cTor(s) + + internal BeforeQuickLoadEventArgs(string name) + { + _QuickSaveSlotName = name; + } + + #endregion + + #region Properties + + /// + /// Gets or sets value that defined if saved has been handled or not + /// + public bool Handled + { + get + { + return _Handled; + } + set + { + _Handled = value; + } + } + + /// + /// Gets quicksave name + /// + public string Name + { + get + { + return _QuickSaveSlotName; + } + } + + + /// + /// Gets slot used for quicksave + /// + public int Slot + { + get + { + return int.Parse(_QuickSaveSlotName.Substring(_QuickSaveSlotName.Length - 1)); + } + } + + #endregion + } +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickSaveEventArgs.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickSaveEventArgs.cs new file mode 100644 index 0000000000..b186f82aba --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/BeforeQuickSaveEventArgs.cs @@ -0,0 +1,69 @@ +using System; + +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// This class holds event data for BeforeQuickSave event + /// + public sealed class BeforeQuickSaveEventArgs : EventArgs + { + #region Fields + + private bool _Handled = false; + private string _QuickSaveSlotName; + + #endregion + + #region cTor(s) + + internal BeforeQuickSaveEventArgs(string name) + { + _QuickSaveSlotName = name; + } + + #endregion + + #region Properties + + /// + /// Gets or sets value that defined if saved has been handled or not + /// + public bool Handled + { + get + { + return _Handled; + } + set + { + _Handled = value; + } + } + + + /// + /// Gets quicksave name + /// + public string Name + { + get + { + return _QuickSaveSlotName; + } + } + + + /// + /// Gets slot used for quicksave + /// + public int Slot + { + get + { + return int.Parse(_QuickSaveSlotName.Substring(_QuickSaveSlotName.Length - 1)); + } + } + + #endregion + } +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateLoadedEventArgs.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateLoadedEventArgs.cs new file mode 100644 index 0000000000..0dfc5b3729 --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateLoadedEventArgs.cs @@ -0,0 +1,44 @@ +using System; + +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// This class holds event data for StateLoaded event + /// + public sealed class StateLoadedEventArgs: EventArgs + { + #region Fields + + string _Name; + + #endregion + + #region cTor(s) + + /// + /// Initialize a new instance of + /// + /// User friendly name of loaded state + internal StateLoadedEventArgs(string stateName) + { + _Name = stateName; + } + + #endregion + + #region Properties + + /// + /// Gets user friendly name of the loaded savestate + /// + public string Name + { + get + { + return _Name; + } + } + + #endregion + } +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateSavedEventArgs.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateSavedEventArgs.cs new file mode 100644 index 0000000000..a2d00690eb --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventArgs/StateSavedEventArgs.cs @@ -0,0 +1,44 @@ +using System; + +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// This class holds event data for StateSaved event + /// + public sealed class StateSavedEventArgs : EventArgs + { + #region Fields + + string _Name; + + #endregion + + #region cTor(s) + + /// + /// Initialize a new instance of + /// + /// User friendly name of loaded state + internal StateSavedEventArgs(string stateName) + { + _Name = stateName; + } + + #endregion + + #region Properties + + /// + /// Gets user friendly name of the loaded savestate + /// + public string Name + { + get + { + return _Name; + } + } + + #endregion + } +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickLoadEventhandler.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickLoadEventhandler.cs new file mode 100644 index 0000000000..86c19b7bef --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickLoadEventhandler.cs @@ -0,0 +1,9 @@ +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// Represent a method that will handle the event raised before a quickload is done + /// + /// Object that raised the event + /// Event arguments + public delegate void BeforeQuickLoadEventHandler(object sender, BeforeQuickLoadEventArgs e); +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickSaveEventhandler.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickSaveEventhandler.cs new file mode 100644 index 0000000000..fdb5ba6fab --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/BeforeQuickSaveEventhandler.cs @@ -0,0 +1,9 @@ +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// Represent a method that will handle the event raised before a quicksave is done + /// + /// Object that raised the event + /// Event arguments + public delegate void BeforeQuickSaveEventHandler(object sender, BeforeQuickSaveEventArgs e); +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateLoadedEventHandler.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateLoadedEventHandler.cs new file mode 100644 index 0000000000..e5debf85d6 --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateLoadedEventHandler.cs @@ -0,0 +1,9 @@ +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// Represent a method that will handle the event raised when a savestate is loaded + /// + /// Object that raised the event + /// Event arguments + public delegate void StateLoadedEventHandler(object sender, StateLoadedEventArgs e); +} diff --git a/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateSavedEventHandler.cs b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateSavedEventHandler.cs new file mode 100644 index 0000000000..ae8a026171 --- /dev/null +++ b/BizHawk.Client.ApiHawk/Classes/Events/EventHandlers/StateSavedEventHandler.cs @@ -0,0 +1,9 @@ +namespace BizHawk.Client.ApiHawk.Classes.Events +{ + /// + /// Represent a method that will handle the event raised when a savestate is saved + /// + /// Object that raised the event + /// Event arguments + public delegate void StateSavedEventHandler(object sender, StateSavedEventArgs e); +} diff --git a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs index 1217959080..dc6ac9e114 100644 --- a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs +++ b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs @@ -75,12 +75,13 @@ namespace BizHawk.Client.ApiHawk /// /// File that will be reflected /// A new ; assembly path can be found in the Tag property - /// For the moment, you could only load a dll that have a form (which implements ) + /// For the moment, you could only load a dll that have a form (which implements ) private static ToolStripMenuItem GenerateToolTipFromFileName(string fileName) { Type customFormType; Assembly externalToolFile; ToolStripMenuItem item = null; + try { externalToolFile = Assembly.LoadFrom(fileName); diff --git a/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd b/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd index e67e4c43d9..8a40328080 100644 --- a/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd +++ b/BizHawk.Client.ApiHawk/Resources/ApiClassDiagram.cd @@ -53,7 +53,7 @@ - CQEAAAAAgAAAQAAAAAABQAIAAAAAoGAACCAAAAAQAAA= + CwEAAAAAgAMAQEAAAAAJQAoAAAEAgWAACCACAAAQAiA= Classes\ClientApi.cs @@ -81,14 +81,42 @@ - AQAACAAAAIAAAACBAAgAAABAEAAAAAAAAAAAAAAAAAA= + AQAACAAAAIAAAACBAAgAAABAEAAAAAAAAAACGAAAAAA= Classes\Joypad.cs - + + + + + AAAAAAAAAAAAAAAAAAAAIAQAAAAAAAAAAAAAAAAAAAA= + Classes\Events\EventArgs\StateLoadedEventArgs.cs + + + + + + AAAAAAAAAAAAAAAAAAAAIAQAAAAAAAAAAAAAAAAAAAA= + Classes\Events\EventArgs\StateSavedEventArgs.cs + + + + + + AAAAAAAAIAAAQAAAAACAAAAAAAAAAAAAAAAAAAAAAgA= + Classes\Events\EventArgs\BeforeQuickSaveEventArgs.cs + + + + + + AAAAAAAAIAAAQAAAAACAAAAAAAAAAAAAAAAAAAAAAgA= + Classes\Events\EventArgs\BeforeQuickLoadEventArgs.cs + + @@ -131,5 +159,33 @@ + + + + AAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAA= + Classes\Events\EventHandlers\StateLoadedEventHandler.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAgA= + Classes\Events\EventHandlers\StateSavedEventHandler.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAEA= + Classes\Events\EventHandlers\BeforeQuickSaveEventhandler.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACAAAAA= + Classes\Events\EventHandlers\BeforeQuickLoadEventhandler.cs + + \ No newline at end of file diff --git a/BizHawk.Client.Common/Properties/AssemblyInfo.cs b/BizHawk.Client.Common/Properties/AssemblyInfo.cs index fd4306b2af..6fe9a22893 100644 --- a/BizHawk.Client.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.Common/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Client.Common")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Client.Common")] diff --git a/BizHawk.Client.Common/config/Binding.cs b/BizHawk.Client.Common/config/Binding.cs index adf8f20f5a..9ae6aeda96 100644 --- a/BizHawk.Client.Common/config/Binding.cs +++ b/BizHawk.Client.Common/config/Binding.cs @@ -221,6 +221,13 @@ namespace BizHawk.Client.Common Bind("TAStudio", "Add Branch", "Alt+Insert"), Bind("TAStudio", "Delete Branch", "Alt+Delete"), + Bind("TAStudio", "Toggle Follow Cursor", "Shift+F"), + Bind("TAStudio", "Toggle Auto-Restore", "Shift+R"), + Bind("TAStudio", "Toggle Turbo Seek", "Shift+S"), + Bind("TAStudio", "Clear Frames", "Delete"), + Bind("TAStudio", "Insert Frame", "Insert"), + Bind("TAStudio", "Delete Frames", "Ctrl+Delete"), + Bind("TAStudio", "Clone Frames", "Ctrl+Insert"), Bind("SNES", "Toggle BG 1"), Bind("SNES", "Toggle BG 2"), diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs index e9e0b1bc83..e2f0b36048 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs @@ -29,7 +29,7 @@ namespace BizHawk.Client.Common Directory.CreateDirectory(directory_info.FullName); } - Write(backupName); + Write(backupName, backup: true); } public virtual bool Load(bool preload) @@ -168,7 +168,7 @@ namespace BizHawk.Client.Common return Load(true); } - protected virtual void Write(string fn) + protected virtual void Write(string fn, bool backup = false) { var file = new FileInfo(fn); if (!file.Directory.Exists) @@ -207,7 +207,8 @@ namespace BizHawk.Client.Common } } - Changes = false; + if (!backup) + Changes = false; } protected void ClearBeforeLoad() diff --git a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs index 7b7be4bad5..b10a6ab1e7 100644 --- a/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs +++ b/BizHawk.Client.Common/movie/conversions/MovieConversionExtensions.cs @@ -75,10 +75,9 @@ namespace BizHawk.Client.Common.MovieConversionExtensions return tas; } - public static Bk2Movie ToBk2(this IMovie old, bool copy = false) + public static Bk2Movie ToBk2(this IMovie old, bool copy = false, bool backup = false) { - var newFilename = old.Filename + "." + Bk2Movie.Extension; - var bk2 = new Bk2Movie(newFilename); + var bk2 = new Bk2Movie(old.Filename.Replace(old.PreferredExtension, Bk2Movie.Extension)); for (var i = 0; i < old.InputLogLength; i++) { @@ -115,7 +114,9 @@ namespace BizHawk.Client.Common.MovieConversionExtensions bk2.BinarySavestate = old.BinarySavestate; bk2.SaveRam = old.SaveRam; - bk2.Save(); + if (!backup) + bk2.Save(); + return bk2; } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs index 1562eac56e..6b89f0dd7b 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.History.cs @@ -414,24 +414,24 @@ namespace BizHawk.Client.Common public void Undo(TasMovie movie) { if (FirstFrame == -1) // Action: Place marker - movie.Markers.Remove(movie.Markers.Get(LastFrame)); + movie.Markers.Remove(movie.Markers.Get(LastFrame), true); else if (LastFrame == -1) // Action: Remove marker - movie.Markers.Add(FirstFrame, oldMessage); + movie.Markers.Add(FirstFrame, oldMessage, true); else // Action: Move/rename marker { - movie.Markers.Move(LastFrame, FirstFrame); + movie.Markers.Move(LastFrame, FirstFrame, true); movie.Markers.Get(LastFrame).Message = oldMessage; } } public void Redo(TasMovie movie) { if (FirstFrame == -1) // Action: Place marker - movie.Markers.Add(LastFrame, oldMessage); + movie.Markers.Add(LastFrame, oldMessage, true); else if (LastFrame == -1) // Action: Remove marker - movie.Markers.Remove(movie.Markers.Get(FirstFrame)); + movie.Markers.Remove(movie.Markers.Get(FirstFrame), true); else // Action: Move/rename marker { - movie.Markers.Move(FirstFrame, LastFrame); + movie.Markers.Move(FirstFrame, LastFrame, true); movie.Markers.Get(LastFrame).Message = newMessage; } } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs index 8338415819..41baa15c1a 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.Common public Func ClientSettingsForSave { get; set; } public Action GetClientSettingsOnLoad { get; set; } - protected override void Write(string fn) + protected override void Write(string fn, bool backup = false) { var file = new FileInfo(fn); if (!file.Directory.Exists) @@ -83,7 +83,8 @@ namespace BizHawk.Client.Common bs.PutLump(BinaryStateLump.Session, tw => tw.WriteLine(Session.ToString())); } - Changes = false; + if (!backup) + Changes = false; } public override bool Load(bool preload) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 107dd0448c..0fd425b6fe 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -177,7 +177,7 @@ namespace BizHawk.Client.Common } } - // This event is Raised ony when Changes is TOGGLED. + // This event is Raised only when Changes is TOGGLED. private void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index 3328df7ed4..c2054f51a5 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -109,30 +109,38 @@ namespace BizHawk.Client.Common return sb.ToString(); } + // the inherited one public new void Add(TasMovieMarker item) + { + Add(item, false); + } + + public void Add(TasMovieMarker item, bool fromHistory) { var existingItem = this.FirstOrDefault(m => m.Frame == item.Frame); if (existingItem != null) { if (existingItem.Message != item.Message) { - _movie.ChangeLog.AddMarkerChange(item, item.Frame, existingItem.Message); + if (!fromHistory) + _movie.ChangeLog.AddMarkerChange(item, item.Frame, existingItem.Message); existingItem.Message = item.Message; OnListChanged(NotifyCollectionChangedAction.Replace); } } else { - _movie.ChangeLog.AddMarkerChange(item); + if (!fromHistory) + _movie.ChangeLog.AddMarkerChange(item); base.Add(item); this.Sort((m1, m2) => m1.Frame.CompareTo(m2.Frame)); OnListChanged(NotifyCollectionChangedAction.Add); } } - public void Add(int frame, string message) + public void Add(int frame, string message, bool fromHistory = false) { - Add(new TasMovieMarker(frame, message)); + Add(new TasMovieMarker(frame, message), fromHistory); } public new void AddRange(IEnumerable collection) @@ -146,9 +154,16 @@ namespace BizHawk.Client.Common _movie.ChangeLog.EndBatch(); } + // the inherited one public new void Insert(int index, TasMovieMarker item) { - _movie.ChangeLog.AddMarkerChange(item); + Insert(index, item, false); + } + + public void Insert(int index, TasMovieMarker item, bool fromHistory) + { + if (!fromHistory) + _movie.ChangeLog.AddMarkerChange(item); base.Insert(index, item); this.Sort((m1, m2) => m1.Frame.CompareTo(m2.Frame)); OnListChanged(NotifyCollectionChangedAction.Add); @@ -167,11 +182,18 @@ namespace BizHawk.Client.Common OnListChanged(NotifyCollectionChangedAction.Add); } + // the inherited one public new void Remove(TasMovieMarker item) + { + Remove(item, false); + } + + public void Remove(TasMovieMarker item, bool fromHistory) { if (item == null || item.Frame == 0) // TODO: Don't do this. return; - _movie.ChangeLog.AddMarkerChange(null, item.Frame, item.Message); + if (!fromHistory) + _movie.ChangeLog.AddMarkerChange(null, item.Frame, item.Message); base.Remove(item); OnListChanged(NotifyCollectionChangedAction.Remove); } @@ -195,14 +217,14 @@ namespace BizHawk.Client.Common return removeCount; } - public void Move(int fromFrame, int toFrame) + public void Move(int fromFrame, int toFrame, bool fromHistory = false) { TasMovieMarker m = Get(fromFrame); if (m == null) // TODO: Don't do this. return; _movie.ChangeLog.AddMarkerChange(m, m.Frame); - Insert(0, new TasMovieMarker(toFrame, m.Message)); - Remove(m); + Insert(0, new TasMovieMarker(toFrame, m.Message), fromHistory); + Remove(m, fromHistory); } /// diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManagerSettings.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManagerSettings.cs index b8e9fbe2f9..8e2be48434 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManagerSettings.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManagerSettings.cs @@ -3,7 +3,6 @@ using System.ComponentModel; using System.Text; using Newtonsoft.Json; - namespace BizHawk.Client.Common { public class TasStateManagerSettings @@ -104,9 +103,9 @@ namespace BizHawk.Client.Common sb.AppendLine(DiskSaveCapacitymb.ToString()); sb.AppendLine(Capacitymb.ToString()); sb.AppendLine(DiskCapacitymb.ToString()); - sb.AppendLine(StateGap.ToString()); sb.AppendLine(BranchStatesInTasproj.ToString()); sb.AppendLine(EraseBranchStatesFirst.ToString()); + sb.AppendLine(StateGap.ToString()); return sb.ToString(); } @@ -115,39 +114,48 @@ namespace BizHawk.Client.Common { if (!string.IsNullOrWhiteSpace(settings)) { - string[] lines = settings.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); - Capacitymb = int.Parse(lines[1]); - int refCapacity; - - if (!int.TryParse(lines[0], out refCapacity)) + try { - if (bool.Parse(lines[0])) - DiskSaveCapacitymb = Capacitymb; + string[] lines = settings.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + Capacitymb = int.Parse(lines[1]); + int refCapacity; + + if (!int.TryParse(lines[0], out refCapacity)) + { + if (bool.Parse(lines[0])) + DiskSaveCapacitymb = Capacitymb; + else + DiskSaveCapacitymb = 0; + } else - DiskSaveCapacitymb = 0; + DiskSaveCapacitymb = refCapacity; + + if (lines.Length > 2) + DiskCapacitymb = int.Parse(lines[2]); + else + DiskCapacitymb = 512; + + if (lines.Length > 3) + BranchStatesInTasproj = bool.Parse(lines[3]); + else + BranchStatesInTasproj = false; + + if (lines.Length > 4) + EraseBranchStatesFirst = bool.Parse(lines[4]); + else + EraseBranchStatesFirst = true; + + if (lines.Length > 5) + StateGap = int.Parse(lines[5]); + else + StateGap = 4; + } + catch (Exception) + { + // "GreenZoneSettings inconsistent, ignoring" + // if we don't catch it, the project won't load + // but dialog boxes aren't supposed to exist here? } - else - DiskSaveCapacitymb = refCapacity; - - if (lines.Length > 2) - DiskCapacitymb = int.Parse(lines[2]); - else - DiskCapacitymb = 512; - - if (lines.Length > 3) - StateGap = int.Parse(lines[3]); - else - StateGap = 4; - - if (lines.Length > 4) - BranchStatesInTasproj = bool.Parse(lines[4]); - else - BranchStatesInTasproj = false; - - if (lines.Length > 5) - EraseBranchStatesFirst = bool.Parse(lines[5]); - else - EraseBranchStatesFirst = true; } } } diff --git a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs index d5b3433be2..085b59e766 100644 --- a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Client.DiscoHawk")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Client.DiscoHawk")] diff --git a/BizHawk.Client.EmuHawk/BizBox.Designer.cs b/BizHawk.Client.EmuHawk/BizBox.Designer.cs index f13e742ba9..aefb76b681 100644 --- a/BizHawk.Client.EmuHawk/BizBox.Designer.cs +++ b/BizHawk.Client.EmuHawk/BizBox.Designer.cs @@ -166,7 +166,7 @@ this.linkLabel3.Size = new System.Drawing.Size(63, 13); this.linkLabel3.TabIndex = 20; this.linkLabel3.TabStop = true; - this.linkLabel3.Text = "Contributers"; + this.linkLabel3.Text = "Contributors"; this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked); // // DateLabel diff --git a/BizHawk.Client.EmuHawk/BizBox.cs b/BizHawk.Client.EmuHawk/BizBox.cs index ee7077cc64..5f5276a76e 100644 --- a/BizHawk.Client.EmuHawk/BizBox.cs +++ b/BizHawk.Client.EmuHawk/BizBox.cs @@ -57,7 +57,6 @@ namespace BizHawk.Client.EmuHawk { Dock = DockStyle.Top }); - } linkLabel2.Text = "Commit # " + SubWCRev.GIT_SHORTHASH; @@ -75,7 +74,7 @@ namespace BizHawk.Client.EmuHawk private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start("https://github.com/TASVideos/BizHawk/commit/" + SubWCRev.GIT_SHORTHASH); + System.Diagnostics.Process.Start("https://github.com/TASVideos/BizHawk/graphs/contributors"); } } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs index 641d76714a..ddceabf662 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs @@ -14,6 +14,10 @@ namespace BizHawk.Client.EmuHawk // General 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.TAStudio.IgnoreSeekFrame = true; TogglePause(); break; case "Toggle Throttle": @@ -349,6 +353,27 @@ namespace BizHawk.Client.EmuHawk case "Delete Branch": GlobalWin.Tools.TAStudio.RemoveBranchExtrenal(); break; + case "Toggle Follow Cursor": + GlobalWin.Tools.TAStudio.TasPlaybackBox.FollowCursor ^= true; + break; + case "Toggle Auto-Restore": + GlobalWin.Tools.TAStudio.TasPlaybackBox.AutoRestore ^= true; + break; + case "Toggle Turbo Seek": + GlobalWin.Tools.TAStudio.TasPlaybackBox.TurboSeek ^= true; + break; + case "Clear Frames": + GlobalWin.Tools.TAStudio.ClearFramesExternal(); + break; + case "Insert Frame": + GlobalWin.Tools.TAStudio.InsertFrameExternal(); + break; + case "Delete Frames": + GlobalWin.Tools.TAStudio.DeleteFramesExternal(); + break; + case "Clone Frames": + GlobalWin.Tools.TAStudio.CloneFramesExternal(); + break; // SNES case "Toggle BG 1": diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 0024be8a3c..890c45f739 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -34,6 +34,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64; using BizHawk.Client.EmuHawk.WinFormExtensions; using BizHawk.Client.EmuHawk.ToolExtensions; using BizHawk.Client.EmuHawk.CoreExtensions; +using BizHawk.Client.ApiHawk; namespace BizHawk.Client.EmuHawk { @@ -3700,6 +3701,8 @@ namespace BizHawk.Client.EmuHawk if (SavestateManager.LoadStateFile(path, userFriendlyStateName)) { + ClientApi.OnStateLoaded(this, userFriendlyStateName); + if (GlobalWin.Tools.Has()) { GlobalWin.Tools.LuaConsole.LuaImp.CallLoadStateEvent(userFriendlyStateName); @@ -3732,6 +3735,13 @@ namespace BizHawk.Client.EmuHawk return; } + bool handled; + ClientApi.OnBeforeQuickLoad(this, quickSlotName, out handled); + if (handled) + { + return; + } + if (IsSlave && master.WantsToControlSavestates) { master.LoadQuickSave(SlotToInt(quickSlotName)); @@ -3766,6 +3776,8 @@ namespace BizHawk.Client.EmuHawk { SavestateManager.SaveStateFile(path, userFriendlyStateName); + ClientApi.OnStateSaved(this, userFriendlyStateName); + GlobalWin.OSD.AddMessage("Saved state: " + userFriendlyStateName); } catch (IOException) @@ -3786,6 +3798,13 @@ namespace BizHawk.Client.EmuHawk return; } + bool handled; + ClientApi.OnBeforeQuickSave(this, quickSlotName, out handled); + if(handled) + { + return; + } + if (IsSlave && master.WantsToControlSavestates) { master.SaveQuickSave(SlotToInt(quickSlotName)); @@ -4009,16 +4028,37 @@ namespace BizHawk.Client.EmuHawk private bool Rewind(ref bool runFrame, long currentTimestamp) { + var isRewinding = false; + if (IsSlave && master.WantsToControlRewind) { if (Global.ClientControls["Rewind"] || PressRewind) { - runFrame = true; // TODO: the master should be deciding this! - return master.Rewind(); + if (_frameRewindTimestamp == 0) + { + isRewinding = true; + _frameRewindTimestamp = currentTimestamp; + } + else + { + double timestampDeltaMs = (double)(currentTimestamp - _frameRewindTimestamp) / Stopwatch.Frequency * 1000.0; + isRewinding = timestampDeltaMs >= Global.Config.FrameProgressDelayMs; + } + + if (isRewinding) + { + runFrame = true; // TODO: the master should be deciding this! + master.Rewind(); + } } + else + { + _frameRewindTimestamp = 0; + } + + return isRewinding; } - var isRewinding = false; if (Global.Rewinder.RewindActive && (Global.ClientControls["Rewind"] || PressRewind) && !Global.MovieSession.Movie.IsRecording) // Rewind isn't "bulletproof" and can desync a recording movie! { diff --git a/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs b/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs index 29a2b0178f..e544a01ef3 100644 --- a/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.EmuHawk/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Client.EmuHawk")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Client.EmuHawk")] diff --git a/BizHawk.Client.EmuHawk/tools/InputPrompt.Designer.cs b/BizHawk.Client.EmuHawk/tools/InputPrompt.Designer.cs index 2228b9d927..b7ff252ac5 100644 --- a/BizHawk.Client.EmuHawk/tools/InputPrompt.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/InputPrompt.Designer.cs @@ -28,72 +28,76 @@ /// private void InitializeComponent() { - this.PromptLabel = new System.Windows.Forms.Label(); - this.PromptBox = new System.Windows.Forms.TextBox(); - this.OK = new System.Windows.Forms.Button(); - this.Cancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // PromptLabel - // - this.PromptLabel.AutoSize = true; - this.PromptLabel.Location = new System.Drawing.Point(33, 9); - this.PromptLabel.Name = "PromptLabel"; - this.PromptLabel.Size = new System.Drawing.Size(73, 13); - this.PromptLabel.TabIndex = 0; - this.PromptLabel.Text = "Enter a value:"; - // - // PromptBox - // - this.PromptBox.Location = new System.Drawing.Point(36, 25); - this.PromptBox.Name = "PromptBox"; - this.PromptBox.Size = new System.Drawing.Size(164, 20); - this.PromptBox.TabIndex = 1; - this.PromptBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.PromptBox_KeyPress); - // - // OK - // - this.OK.Location = new System.Drawing.Point(36, 67); - this.OK.Name = "OK"; - this.OK.Size = new System.Drawing.Size(75, 23); - this.OK.TabIndex = 2; - this.OK.Text = "&OK"; - this.OK.UseVisualStyleBackColor = true; - this.OK.Click += new System.EventHandler(this.Ok_Click); - // - // Cancel - // - this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Location = new System.Drawing.Point(125, 67); - this.Cancel.Name = "Cancel"; - this.Cancel.Size = new System.Drawing.Size(75, 23); - this.Cancel.TabIndex = 3; - this.Cancel.Text = "&Cancel"; - this.Cancel.UseVisualStyleBackColor = true; - this.Cancel.Click += new System.EventHandler(this.Cancel_Click); - // - // InputPrompt - // - this.AcceptButton = this.OK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.Cancel; - this.ClientSize = new System.Drawing.Size(235, 106); - this.Controls.Add(this.Cancel); - this.Controls.Add(this.OK); - this.Controls.Add(this.PromptBox); - this.Controls.Add(this.PromptLabel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(241, 133); - this.Name = "InputPrompt"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Input Prompt"; - this.Load += new System.EventHandler(this.InputPrompt_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.PromptLabel = new System.Windows.Forms.Label(); + this.PromptBox = new System.Windows.Forms.TextBox(); + this.OK = new System.Windows.Forms.Button(); + this.Cancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // PromptLabel + // + this.PromptLabel.AutoSize = true; + this.PromptLabel.Location = new System.Drawing.Point(33, 9); + this.PromptLabel.Name = "PromptLabel"; + this.PromptLabel.Size = new System.Drawing.Size(73, 13); + this.PromptLabel.TabIndex = 0; + this.PromptLabel.Text = "Enter a value:"; + // + // PromptBox + // + this.PromptBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.PromptBox.Location = new System.Drawing.Point(36, 25); + this.PromptBox.Name = "PromptBox"; + this.PromptBox.Size = new System.Drawing.Size(164, 20); + this.PromptBox.TabIndex = 1; + this.PromptBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.PromptBox_KeyPress); + // + // OK + // + this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.OK.Location = new System.Drawing.Point(36, 67); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 2; + this.OK.Text = "&OK"; + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.Ok_Click); + // + // Cancel + // + this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(125, 67); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 3; + this.Cancel.Text = "&Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // InputPrompt + // + this.AcceptButton = this.OK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(235, 106); + this.Controls.Add(this.Cancel); + this.Controls.Add(this.OK); + this.Controls.Add(this.PromptBox); + this.Controls.Add(this.PromptLabel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(241, 138); + this.Name = "InputPrompt"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Input Prompt"; + this.Load += new System.EventHandler(this.InputPrompt_Load); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/BizHawk.Client.EmuHawk/tools/InputPrompt.cs b/BizHawk.Client.EmuHawk/tools/InputPrompt.cs index 4193b501b5..83b5c5c7f3 100644 --- a/BizHawk.Client.EmuHawk/tools/InputPrompt.cs +++ b/BizHawk.Client.EmuHawk/tools/InputPrompt.cs @@ -1,13 +1,15 @@ using System; using System.Drawing; using System.Windows.Forms; +using System.Linq; using BizHawk.Common.StringExtensions; namespace BizHawk.Client.EmuHawk { /// - /// A simple form that prompts the user for a single line of input + /// A simple form that prompts the user for a single line of input. + /// Supports multiline messages /// public partial class InputPrompt : Form { @@ -24,8 +26,15 @@ namespace BizHawk.Client.EmuHawk public string Message { - get { return PromptLabel.Text; } - set { PromptLabel.Text = value ?? string.Empty; } + get + { + return PromptLabel.Text; + } + set + { + PromptLabel.Text = value ?? string.Empty; + Height += PromptLabel.Font.Height * Message.Count(x => x == '\n'); + } } public string InitialValue diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs index c6aeadfe5b..1aa03bfda3 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk public TAStudio Tastudio { get; set; } - [Browsable(false)] + [Browsable(true)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] public bool TurboSeek { @@ -28,11 +28,11 @@ namespace BizHawk.Client.EmuHawk set { - TurboSeekCheckbox.Checked = Global.Config.TurboSeek = value; + TurboSeekCheckbox.Checked = value; } } - [Browsable(false)] + [Browsable(true)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] public bool AutoRestore { @@ -43,11 +43,11 @@ namespace BizHawk.Client.EmuHawk set { - AutoRestoreCheckbox.Checked = Tastudio.Settings.AutoRestoreLastPosition = value; + AutoRestoreCheckbox.Checked = value; } } - [Browsable(false)] + [Browsable(true)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] public bool FollowCursor { @@ -97,6 +97,8 @@ namespace BizHawk.Client.EmuHawk private void PauseButton_Click(object sender, EventArgs e) { + if (GlobalWin.MainForm.EmulatorPaused) + Tastudio.IgnoreSeekFrame = true; Tastudio.TogglePause(); } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 749c48e727..dcb25fd15a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -41,6 +41,8 @@ namespace BizHawk.Client.EmuHawk this.OpenTASMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveTASMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveAsTASMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveBackupMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveBk2BackupMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RecentSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -69,10 +71,10 @@ namespace BizHawk.Client.EmuHawk this.PasteInsertMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CutMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.ClearMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ClearFramesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.InsertFrameMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DeleteFramesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.CloneMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.CloneFramesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.InsertNumFramesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.TruncateMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -83,11 +85,15 @@ namespace BizHawk.Client.EmuHawk this.SetMaxUndoLevelsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SetBranchCellHoverIntervalMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SetSeekingCutoffIntervalMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.setAutosaveIntervalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator26 = new System.Windows.Forms.ToolStripSeparator(); + this.autosaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SetAutosaveIntervalMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutosaveAsBk2MenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AutosaveAsBackupFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.BackupPerFileSaveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.AutoRestoreOnMouseUpOnlyMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutoadjustInputMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.DrawInputByDraggingMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.applyPatternToPaintedInputToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.onlyOnAutoFireColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -143,9 +149,11 @@ namespace BizHawk.Client.EmuHawk this.ColumnsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); this.HelpSubMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.EnableTooltipsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.TASEditorManualOnlineMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ForumThreadMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.EnableTooltipsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TasView = new BizHawk.Client.EmuHawk.InputRoll(); this.TasStatusStrip = new StatusStripEx(); this.MessageStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); @@ -226,6 +234,8 @@ namespace BizHawk.Client.EmuHawk this.OpenTASMenuItem, this.SaveTASMenuItem, this.SaveAsTASMenuItem, + this.SaveBackupMenuItem, + this.SaveBk2BackupMenuItem, this.RecentSubMenu, this.toolStripSeparator1, this.saveSelectionToMacroToolStripMenuItem, @@ -297,6 +307,21 @@ namespace BizHawk.Client.EmuHawk this.SaveAsTASMenuItem.Text = "Save As"; this.SaveAsTASMenuItem.Click += new System.EventHandler(this.SaveAsTasMenuItem_Click); // + // SaveBackupMenuItem + // + this.SaveBackupMenuItem.Name = "SaveBackupMenuItem"; + this.SaveBackupMenuItem.Size = new System.Drawing.Size(201, 22); + this.SaveBackupMenuItem.Text = "Save Backup"; + this.SaveBackupMenuItem.Click += new System.EventHandler(this.SaveBackupMenuItem_Click); + // + // SaveBk2BackupMenuItem + // + this.SaveBk2BackupMenuItem.Name = "SaveBk2BackupMenuItem"; + this.SaveBk2BackupMenuItem.Size = new System.Drawing.Size(201, 22); + this.SaveBk2BackupMenuItem.Text = "Save Bk2 Backup"; + this.SaveBk2BackupMenuItem.Visible = false; + this.SaveBk2BackupMenuItem.Click += new System.EventHandler(this.SaveBk2BackupMenuItem_Click); + // // RecentSubMenu // this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -390,10 +415,10 @@ namespace BizHawk.Client.EmuHawk this.PasteInsertMenuItem, this.CutMenuItem, this.toolStripSeparator8, - this.ClearMenuItem, + this.ClearFramesMenuItem, this.InsertFrameMenuItem, this.DeleteFramesMenuItem, - this.CloneMenuItem, + this.CloneFramesMenuItem, this.InsertNumFramesMenuItem, this.toolStripSeparator6, this.TruncateMenuItem, @@ -526,19 +551,17 @@ namespace BizHawk.Client.EmuHawk this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Size = new System.Drawing.Size(288, 6); // - // ClearMenuItem + // ClearFramesMenuItem // - this.ClearMenuItem.Name = "ClearMenuItem"; - this.ClearMenuItem.ShortcutKeyDisplayString = ""; - this.ClearMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; - this.ClearMenuItem.Size = new System.Drawing.Size(291, 22); - this.ClearMenuItem.Text = "Clear"; - this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click); + this.ClearFramesMenuItem.Name = "ClearFramesMenuItem"; + this.ClearFramesMenuItem.ShortcutKeyDisplayString = ""; + this.ClearFramesMenuItem.Size = new System.Drawing.Size(291, 22); + this.ClearFramesMenuItem.Text = "Clear"; + this.ClearFramesMenuItem.Click += new System.EventHandler(this.ClearFramesMenuItem_Click); // // InsertFrameMenuItem // this.InsertFrameMenuItem.Name = "InsertFrameMenuItem"; - this.InsertFrameMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Insert; this.InsertFrameMenuItem.Size = new System.Drawing.Size(291, 22); this.InsertFrameMenuItem.Text = "&Insert"; this.InsertFrameMenuItem.Click += new System.EventHandler(this.InsertFrameMenuItem_Click); @@ -546,18 +569,16 @@ namespace BizHawk.Client.EmuHawk // DeleteFramesMenuItem // this.DeleteFramesMenuItem.Name = "DeleteFramesMenuItem"; - this.DeleteFramesMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete))); this.DeleteFramesMenuItem.Size = new System.Drawing.Size(291, 22); this.DeleteFramesMenuItem.Text = "&Delete"; this.DeleteFramesMenuItem.Click += new System.EventHandler(this.DeleteFramesMenuItem_Click); // - // CloneMenuItem + // CloneFramesMenuItem // - this.CloneMenuItem.Name = "CloneMenuItem"; - this.CloneMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert))); - this.CloneMenuItem.Size = new System.Drawing.Size(291, 22); - this.CloneMenuItem.Text = "&Clone"; - this.CloneMenuItem.Click += new System.EventHandler(this.CloneMenuItem_Click); + this.CloneFramesMenuItem.Name = "CloneFramesMenuItem"; + this.CloneFramesMenuItem.Size = new System.Drawing.Size(291, 22); + this.CloneFramesMenuItem.Text = "&Clone"; + this.CloneFramesMenuItem.Click += new System.EventHandler(this.CloneFramesMenuItem_Click); // // InsertNumFramesMenuItem // @@ -608,11 +629,12 @@ namespace BizHawk.Client.EmuHawk this.SetMaxUndoLevelsMenuItem, this.SetBranchCellHoverIntervalMenuItem, this.SetSeekingCutoffIntervalMenuItem, - this.setAutosaveIntervalToolStripMenuItem, - this.AutosaveAsBk2MenuItem, + this.toolStripSeparator26, + this.autosaveToolStripMenuItem, + this.BackupPerFileSaveMenuItem, this.toolStripSeparator9, + this.AutoRestoreOnMouseUpOnlyMenuItem, this.AutoadjustInputMenuItem, - this.toolStripSeparator11, this.DrawInputByDraggingMenuItem, this.applyPatternToPaintedInputToolStripMenuItem, this.onlyOnAutoFireColumnsToolStripMenuItem, @@ -654,25 +676,61 @@ namespace BizHawk.Client.EmuHawk this.SetSeekingCutoffIntervalMenuItem.Visible = false; this.SetSeekingCutoffIntervalMenuItem.Click += new System.EventHandler(this.SetSeekingCutoffIntervalMenuItem_Click); // - // setAutosaveIntervalToolStripMenuItem + // toolStripSeparator26 // - this.setAutosaveIntervalToolStripMenuItem.Name = "setAutosaveIntervalToolStripMenuItem"; - this.setAutosaveIntervalToolStripMenuItem.Size = new System.Drawing.Size(253, 22); - this.setAutosaveIntervalToolStripMenuItem.Text = "Set Autosave Interval"; - this.setAutosaveIntervalToolStripMenuItem.Click += new System.EventHandler(this.SetAutosaveIntervalMenuItem_Click); + this.toolStripSeparator26.Name = "toolStripSeparator26"; + this.toolStripSeparator26.Size = new System.Drawing.Size(250, 6); + // + // autosaveToolStripMenuItem + // + this.autosaveToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.SetAutosaveIntervalMenuItem, + this.AutosaveAsBk2MenuItem, + this.AutosaveAsBackupFileMenuItem}); + this.autosaveToolStripMenuItem.Name = "autosaveToolStripMenuItem"; + this.autosaveToolStripMenuItem.Size = new System.Drawing.Size(253, 22); + this.autosaveToolStripMenuItem.Text = "Autosave"; + // + // SetAutosaveIntervalMenuItem + // + this.SetAutosaveIntervalMenuItem.Name = "SetAutosaveIntervalMenuItem"; + this.SetAutosaveIntervalMenuItem.Size = new System.Drawing.Size(202, 22); + this.SetAutosaveIntervalMenuItem.Text = "Set Autosave Interval"; + this.SetAutosaveIntervalMenuItem.Click += new System.EventHandler(this.SetAutosaveIntervalMenuItem_Click); // // AutosaveAsBk2MenuItem // this.AutosaveAsBk2MenuItem.Name = "AutosaveAsBk2MenuItem"; - this.AutosaveAsBk2MenuItem.Size = new System.Drawing.Size(253, 22); + this.AutosaveAsBk2MenuItem.Size = new System.Drawing.Size(202, 22); this.AutosaveAsBk2MenuItem.Text = "Autosave As Bk2"; this.AutosaveAsBk2MenuItem.Click += new System.EventHandler(this.AutosaveAsBk2MenuItem_Click); // + // AutosaveAsBackupFileMenuItem + // + this.AutosaveAsBackupFileMenuItem.Name = "AutosaveAsBackupFileMenuItem"; + this.AutosaveAsBackupFileMenuItem.Size = new System.Drawing.Size(202, 22); + this.AutosaveAsBackupFileMenuItem.Text = "Autosave As Backup File"; + this.AutosaveAsBackupFileMenuItem.Click += new System.EventHandler(this.AutosaveAsBackupFileMenuItem_Click); + // + // BackupPerFileSaveMenuItem + // + this.BackupPerFileSaveMenuItem.Name = "BackupPerFileSaveMenuItem"; + this.BackupPerFileSaveMenuItem.Size = new System.Drawing.Size(253, 22); + this.BackupPerFileSaveMenuItem.Text = "Backup Per File Save"; + this.BackupPerFileSaveMenuItem.Click += new System.EventHandler(this.BackupPerFileSaveMenuItem_Click); + // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Size = new System.Drawing.Size(250, 6); // + // AutoRestoreOnMouseUpOnlyMenuItem + // + this.AutoRestoreOnMouseUpOnlyMenuItem.Name = "AutoRestoreOnMouseUpOnlyMenuItem"; + this.AutoRestoreOnMouseUpOnlyMenuItem.Size = new System.Drawing.Size(253, 22); + this.AutoRestoreOnMouseUpOnlyMenuItem.Text = "Auto-restore on Mouse Up only"; + this.AutoRestoreOnMouseUpOnlyMenuItem.Click += new System.EventHandler(this.AutoRestoreOnMouseUpOnlyMenuItem_Click); + // // AutoadjustInputMenuItem // this.AutoadjustInputMenuItem.CheckOnClick = true; @@ -680,11 +738,6 @@ namespace BizHawk.Client.EmuHawk this.AutoadjustInputMenuItem.Size = new System.Drawing.Size(253, 22); this.AutoadjustInputMenuItem.Text = "Auto-adjust Input according to Lag"; // - // toolStripSeparator11 - // - this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(250, 6); - // // DrawInputByDraggingMenuItem // this.DrawInputByDraggingMenuItem.Name = "DrawInputByDraggingMenuItem"; @@ -1116,32 +1169,50 @@ namespace BizHawk.Client.EmuHawk // HelpSubMenu // this.HelpSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.EnableTooltipsMenuItem, + this.TASEditorManualOnlineMenuItem, + this.ForumThreadMenuItem, + this.aboutToolStripMenuItem, this.toolStripSeparator10, - this.aboutToolStripMenuItem}); + this.EnableTooltipsMenuItem}); this.HelpSubMenu.Name = "HelpSubMenu"; this.HelpSubMenu.Size = new System.Drawing.Size(40, 20); this.HelpSubMenu.Text = "&Help"; // - // EnableTooltipsMenuItem + // TASEditorManualOnlineMenuItem // - this.EnableTooltipsMenuItem.Enabled = false; - this.EnableTooltipsMenuItem.Name = "EnableTooltipsMenuItem"; - this.EnableTooltipsMenuItem.Size = new System.Drawing.Size(157, 22); - this.EnableTooltipsMenuItem.Text = "&Enable Tooltips"; + this.TASEditorManualOnlineMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Help; + this.TASEditorManualOnlineMenuItem.Name = "TASEditorManualOnlineMenuItem"; + this.TASEditorManualOnlineMenuItem.Size = new System.Drawing.Size(217, 22); + this.TASEditorManualOnlineMenuItem.Text = "TAS Editor Manual Online..."; + this.TASEditorManualOnlineMenuItem.Click += new System.EventHandler(this.TASEditorManualOnlineMenuItem_Click); // - // toolStripSeparator10 + // ForumThreadMenuItem // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(154, 6); + this.ForumThreadMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.TAStudio; + this.ForumThreadMenuItem.Name = "ForumThreadMenuItem"; + this.ForumThreadMenuItem.Size = new System.Drawing.Size(217, 22); + this.ForumThreadMenuItem.Text = "Forum Thread..."; + this.ForumThreadMenuItem.Click += new System.EventHandler(this.ForumThreadMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Enabled = false; this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(217, 22); this.aboutToolStripMenuItem.Text = "&About"; // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(214, 6); + // + // EnableTooltipsMenuItem + // + this.EnableTooltipsMenuItem.Enabled = false; + this.EnableTooltipsMenuItem.Name = "EnableTooltipsMenuItem"; + this.EnableTooltipsMenuItem.Size = new System.Drawing.Size(217, 22); + this.EnableTooltipsMenuItem.Text = "&Enable Tooltips"; + // // TasView // this.TasView.AllowColumnReorder = false; @@ -1170,6 +1241,7 @@ namespace BizHawk.Client.EmuHawk this.TasView.ScrollSpeed = 1; this.TasView.SeekingCutoffInterval = 0; this.TasView.Size = new System.Drawing.Size(289, 528); + this.TasView.suspendHotkeys = false; this.TasView.TabIndex = 1; this.TasView.ColumnClick += new BizHawk.Client.EmuHawk.InputRoll.ColumnClickEventHandler(this.TasView_ColumnClick); this.TasView.ColumnRightClick += new BizHawk.Client.EmuHawk.InputRoll.ColumnClickEventHandler(this.TasView_ColumnRightClick); @@ -1274,39 +1346,39 @@ namespace BizHawk.Client.EmuHawk this.StartNewProjectFromNowMenuItem, this.StartANewProjectFromSaveRamMenuItem}); this.RightClickMenu.Name = "RightClickMenu"; - this.RightClickMenu.Size = new System.Drawing.Size(243, 480); + this.RightClickMenu.Size = new System.Drawing.Size(254, 480); this.RightClickMenu.Opened += new System.EventHandler(this.RightClickMenu_Opened); // // SetMarkersContextMenuItem // this.SetMarkersContextMenuItem.Name = "SetMarkersContextMenuItem"; - this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22); this.SetMarkersContextMenuItem.Text = "Set Markers"; this.SetMarkersContextMenuItem.Click += new System.EventHandler(this.SetMarkersMenuItem_Click); // // SetMarkerWithTextContextMenuItem // this.SetMarkerWithTextContextMenuItem.Name = "SetMarkerWithTextContextMenuItem"; - this.SetMarkerWithTextContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.SetMarkerWithTextContextMenuItem.Size = new System.Drawing.Size(253, 22); this.SetMarkerWithTextContextMenuItem.Text = "Set Marker with Text"; this.SetMarkerWithTextContextMenuItem.Click += new System.EventHandler(this.SetMarkerWithTextMenuItem_Click); // // RemoveMarkersContextMenuItem // this.RemoveMarkersContextMenuItem.Name = "RemoveMarkersContextMenuItem"; - this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22); this.RemoveMarkersContextMenuItem.Text = "Remove Markers"; this.RemoveMarkersContextMenuItem.Click += new System.EventHandler(this.RemoveMarkersMenuItem_Click); // // toolStripSeparator15 // this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator15.Size = new System.Drawing.Size(250, 6); // // DeselectContextMenuItem // this.DeselectContextMenuItem.Name = "DeselectContextMenuItem"; - this.DeselectContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.DeselectContextMenuItem.Size = new System.Drawing.Size(253, 22); this.DeselectContextMenuItem.Text = "Deselect"; this.DeselectContextMenuItem.Click += new System.EventHandler(this.DeselectMenuItem_Click); // @@ -1314,39 +1386,39 @@ namespace BizHawk.Client.EmuHawk // this.SelectBetweenMarkersContextMenuItem.Name = "SelectBetweenMarkersContextMenuItem"; this.SelectBetweenMarkersContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); - this.SelectBetweenMarkersContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.SelectBetweenMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22); this.SelectBetweenMarkersContextMenuItem.Text = "Select between Markers"; this.SelectBetweenMarkersContextMenuItem.Click += new System.EventHandler(this.SelectBetweenMarkersMenuItem_Click); // // toolStripSeparator16 // this.toolStripSeparator16.Name = "toolStripSeparator16"; - this.toolStripSeparator16.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator16.Size = new System.Drawing.Size(250, 6); // // UngreenzoneContextMenuItem // this.UngreenzoneContextMenuItem.Name = "UngreenzoneContextMenuItem"; - this.UngreenzoneContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.UngreenzoneContextMenuItem.Size = new System.Drawing.Size(253, 22); this.UngreenzoneContextMenuItem.Text = "Clear Greenzone"; this.UngreenzoneContextMenuItem.Click += new System.EventHandler(this.ClearGreenzoneMenuItem_Click); // // CancelSeekContextMenuItem // this.CancelSeekContextMenuItem.Name = "CancelSeekContextMenuItem"; - this.CancelSeekContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.CancelSeekContextMenuItem.Size = new System.Drawing.Size(253, 22); this.CancelSeekContextMenuItem.Text = "Cancel Seek"; this.CancelSeekContextMenuItem.Click += new System.EventHandler(this.CancelSeekContextMenuItem_Click); // // toolStripSeparator17 // this.toolStripSeparator17.Name = "toolStripSeparator17"; - this.toolStripSeparator17.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator17.Size = new System.Drawing.Size(250, 6); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C"; - this.copyToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(253, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click); // @@ -1354,7 +1426,7 @@ namespace BizHawk.Client.EmuHawk // this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; this.pasteToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V"; - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(253, 22); this.pasteToolStripMenuItem.Text = "Paste"; this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click); // @@ -1362,7 +1434,7 @@ namespace BizHawk.Client.EmuHawk // this.pasteInsertToolStripMenuItem.Name = "pasteInsertToolStripMenuItem"; this.pasteInsertToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+V"; - this.pasteInsertToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.pasteInsertToolStripMenuItem.Size = new System.Drawing.Size(253, 22); this.pasteInsertToolStripMenuItem.Text = "Paste Insert"; this.pasteInsertToolStripMenuItem.Click += new System.EventHandler(this.PasteInsertMenuItem_Click); // @@ -1370,28 +1442,28 @@ namespace BizHawk.Client.EmuHawk // this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; this.cutToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X"; - this.cutToolStripMenuItem.Size = new System.Drawing.Size(242, 22); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(253, 22); this.cutToolStripMenuItem.Text = "Cut"; this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutMenuItem_Click); // // separateToolStripMenuItem // this.separateToolStripMenuItem.Name = "separateToolStripMenuItem"; - this.separateToolStripMenuItem.Size = new System.Drawing.Size(239, 6); + this.separateToolStripMenuItem.Size = new System.Drawing.Size(250, 6); // // ClearContextMenuItem // this.ClearContextMenuItem.Name = "ClearContextMenuItem"; this.ClearContextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; - this.ClearContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.ClearContextMenuItem.Size = new System.Drawing.Size(253, 22); this.ClearContextMenuItem.Text = "Clear"; - this.ClearContextMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click); + this.ClearContextMenuItem.Click += new System.EventHandler(this.ClearFramesMenuItem_Click); // // InsertFrameContextMenuItem // this.InsertFrameContextMenuItem.Name = "InsertFrameContextMenuItem"; this.InsertFrameContextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Insert; - this.InsertFrameContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.InsertFrameContextMenuItem.Size = new System.Drawing.Size(253, 22); this.InsertFrameContextMenuItem.Text = "Insert"; this.InsertFrameContextMenuItem.Click += new System.EventHandler(this.InsertFrameMenuItem_Click); // @@ -1399,7 +1471,7 @@ namespace BizHawk.Client.EmuHawk // this.DeleteFramesContextMenuItem.Name = "DeleteFramesContextMenuItem"; this.DeleteFramesContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete))); - this.DeleteFramesContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.DeleteFramesContextMenuItem.Size = new System.Drawing.Size(253, 22); this.DeleteFramesContextMenuItem.Text = "Delete"; this.DeleteFramesContextMenuItem.Click += new System.EventHandler(this.DeleteFramesMenuItem_Click); // @@ -1407,54 +1479,54 @@ namespace BizHawk.Client.EmuHawk // this.CloneContextMenuItem.Name = "CloneContextMenuItem"; this.CloneContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert))); - this.CloneContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.CloneContextMenuItem.Size = new System.Drawing.Size(253, 22); this.CloneContextMenuItem.Text = "Clone"; - this.CloneContextMenuItem.Click += new System.EventHandler(this.CloneMenuItem_Click); + this.CloneContextMenuItem.Click += new System.EventHandler(this.CloneFramesMenuItem_Click); // // InsertNumFramesContextMenuItem // this.InsertNumFramesContextMenuItem.Name = "InsertNumFramesContextMenuItem"; this.InsertNumFramesContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.Insert))); - this.InsertNumFramesContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.InsertNumFramesContextMenuItem.Size = new System.Drawing.Size(253, 22); this.InsertNumFramesContextMenuItem.Text = "Insert # of Frames"; this.InsertNumFramesContextMenuItem.Click += new System.EventHandler(this.InsertNumFramesMenuItem_Click); // // toolStripSeparator18 // this.toolStripSeparator18.Name = "toolStripSeparator18"; - this.toolStripSeparator18.Size = new System.Drawing.Size(239, 6); + this.toolStripSeparator18.Size = new System.Drawing.Size(250, 6); // // TruncateContextMenuItem // this.TruncateContextMenuItem.Name = "TruncateContextMenuItem"; - this.TruncateContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.TruncateContextMenuItem.Size = new System.Drawing.Size(253, 22); this.TruncateContextMenuItem.Text = "Truncate Movie"; this.TruncateContextMenuItem.Click += new System.EventHandler(this.TruncateMenuItem_Click); // // BranchContextMenuItem // this.BranchContextMenuItem.Name = "BranchContextMenuItem"; - this.BranchContextMenuItem.Size = new System.Drawing.Size(242, 22); + this.BranchContextMenuItem.Size = new System.Drawing.Size(253, 22); this.BranchContextMenuItem.Text = "&Branch"; this.BranchContextMenuItem.Click += new System.EventHandler(this.BranchContextMenuItem_Click); // // StartFromNowSeparator // this.StartFromNowSeparator.Name = "StartFromNowSeparator"; - this.StartFromNowSeparator.Size = new System.Drawing.Size(239, 6); + this.StartFromNowSeparator.Size = new System.Drawing.Size(250, 6); // // StartNewProjectFromNowMenuItem // this.StartNewProjectFromNowMenuItem.Name = "StartNewProjectFromNowMenuItem"; - this.StartNewProjectFromNowMenuItem.Size = new System.Drawing.Size(242, 22); + this.StartNewProjectFromNowMenuItem.Size = new System.Drawing.Size(253, 22); this.StartNewProjectFromNowMenuItem.Text = "Start a new project from Now"; this.StartNewProjectFromNowMenuItem.Click += new System.EventHandler(this.StartNewProjectFromNowMenuItem_Click); // // StartANewProjectFromSaveRamMenuItem // this.StartANewProjectFromSaveRamMenuItem.Name = "StartANewProjectFromSaveRamMenuItem"; - this.StartANewProjectFromSaveRamMenuItem.Size = new System.Drawing.Size(242, 22); + this.StartANewProjectFromSaveRamMenuItem.Size = new System.Drawing.Size(253, 22); this.StartANewProjectFromSaveRamMenuItem.Text = "Start a new project from SaveRam"; this.StartANewProjectFromSaveRamMenuItem.Click += new System.EventHandler(this.StartANewProjectFromSaveRamMenuItem_Click); // @@ -1586,9 +1658,9 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem InsertFrameMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private System.Windows.Forms.ToolStripMenuItem CloneMenuItem; + private System.Windows.Forms.ToolStripMenuItem CloneFramesMenuItem; private System.Windows.Forms.ToolStripMenuItem DeleteFramesMenuItem; - private System.Windows.Forms.ToolStripMenuItem ClearMenuItem; + private System.Windows.Forms.ToolStripMenuItem ClearFramesMenuItem; private System.Windows.Forms.ToolStripMenuItem InsertNumFramesMenuItem; private System.Windows.Forms.ToolStripMenuItem SelectAllMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; @@ -1613,7 +1685,6 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SetMaxUndoLevelsMenuItem; private System.Windows.Forms.ToolStripMenuItem AutoadjustInputMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; private System.Windows.Forms.ToolStripMenuItem DrawInputByDraggingMenuItem; private System.Windows.Forms.ToolStripMenuItem UseInputKeysItem; private System.Windows.Forms.ToolStripMenuItem BindMarkersToInputMenuItem; @@ -1626,7 +1697,7 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem SettingsSubMenu; private StatusStripEx TasStatusStrip; private System.Windows.Forms.ToolStripStatusLabel MessageStatusLabel; - private PlaybackBox TasPlaybackBox; + public PlaybackBox TasPlaybackBox; private System.Windows.Forms.ToolStripStatusLabel SplicerStatusLabel; private System.Windows.Forms.ToolStripMenuItem MetaSubMenu; private System.Windows.Forms.ToolStripMenuItem HeaderMenuItem; @@ -1720,7 +1791,16 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem SetBranchCellHoverIntervalMenuItem; private System.Windows.Forms.ToolStripMenuItem SetMarkerWithTextContextMenuItem; private System.Windows.Forms.ToolStripMenuItem SetSeekingCutoffIntervalMenuItem; - private System.Windows.Forms.ToolStripMenuItem setAutosaveIntervalToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator26; + private System.Windows.Forms.ToolStripMenuItem TASEditorManualOnlineMenuItem; + private System.Windows.Forms.ToolStripMenuItem ForumThreadMenuItem; + private System.Windows.Forms.ToolStripMenuItem autosaveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem SetAutosaveIntervalMenuItem; private System.Windows.Forms.ToolStripMenuItem AutosaveAsBk2MenuItem; + private System.Windows.Forms.ToolStripMenuItem AutosaveAsBackupFileMenuItem; + private System.Windows.Forms.ToolStripMenuItem BackupPerFileSaveMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveBackupMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveBk2BackupMenuItem; + private System.Windows.Forms.ToolStripMenuItem AutoRestoreOnMouseUpOnlyMenuItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index 4eb586e791..e361238f0a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -112,7 +112,7 @@ namespace BizHawk.Client.EmuHawk if (result == DialogResult.Yes) { _exiting = true; // Asking to save changes should only ever be called when closing something - SaveTasMenuItem_Click(null, null); + SaveTas(null, null); } else if (result == DialogResult.No) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index b182669ae4..14160e6871 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -92,6 +92,11 @@ namespace BizHawk.Client.EmuHawk public void StopSeeking() { _seekBackgroundWorker.CancelAsync(); + if (IgnoreSeekFrame) + { + GlobalWin.MainForm.UnpauseEmulator(); + IgnoreSeekFrame = false; + } } public bool FloatEditingMode @@ -393,6 +398,8 @@ namespace BizHawk.Client.EmuHawk if (e.Button == MouseButtons.Middle) { + if (GlobalWin.MainForm.EmulatorPaused) + IgnoreSeekFrame = false; TogglePause(); return; } @@ -467,6 +474,9 @@ namespace BizHawk.Client.EmuHawk } else _patternPaint = false; + + if (!Settings.AutoRestoreOnMouseUpOnly) + DoTriggeredAutoRestoreIfNeeded(); } else { @@ -643,6 +653,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.MainForm.PauseOnFrame = null; } } + RefreshDialog(); } else { @@ -822,6 +833,12 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.SetBoolState(i, _startBoolDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column JumpToGreenzone(); } + + if (!Settings.AutoRestoreOnMouseUpOnly) + { + _triggerAutoRestore = true; + DoTriggeredAutoRestoreIfNeeded(); + } } } @@ -844,6 +861,12 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.SetFloatState(i, _startFloatDrawColumn, setVal); // Notice it uses new row, old column, you can only paint across a single column JumpToGreenzone(); } + + if (!Settings.AutoRestoreOnMouseUpOnly) + { + _triggerAutoRestore = true; + DoTriggeredAutoRestoreIfNeeded(); + } } } @@ -996,7 +1019,11 @@ namespace BizHawk.Client.EmuHawk DoTriggeredAutoRestoreIfNeeded(); } } - + } + else + { + // not using StopSeeking() here, since it has special logic and should only happen when seek frame is reashed + CancelSeekContextMenuItem_Click(null, null); } RefreshDialog(); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index d7ca1eabb2..72d73da5ab 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -76,12 +76,12 @@ namespace BizHawk.Client.EmuHawk private bool _exiting = false; - private void SaveTasMenuItem_Click(object sender, EventArgs e) + private void SaveTas(object sender, EventArgs e) { if (string.IsNullOrEmpty(CurrentTasMovie.Filename) || CurrentTasMovie.Filename == DefaultTasProjName()) { - SaveAsTasMenuItem_Click(sender, e); + SaveAsTas(sender, e); } else { @@ -90,14 +90,23 @@ namespace BizHawk.Client.EmuHawk this.Cursor = Cursors.WaitCursor; Update(); CurrentTasMovie.Save(); + if (Settings.AutosaveInterval > 0) + _autosaveTimer.Start(); + MessageStatusLabel.Text = CurrentTasMovie.Name + " saved."; Settings.RecentTas.Add(CurrentTasMovie.Filename); - _autosaveTimer.Start(); - MessageStatusLabel.Text = Path.GetFileName(CurrentTasMovie.Filename) + " saved."; this.Cursor = Cursors.Default; } } - private void SaveAsTasMenuItem_Click(object sender, EventArgs e) + // call this one from the menu only + private void SaveTasMenuItem_Click(object sender, EventArgs e) + { + SaveTas(sender, e); + if (Settings.BackupPerFileSave) + SaveBackupMenuItem_Click(sender, e); + } + + private void SaveAsTas(object sender, EventArgs e) { _autosaveTimer.Stop(); var filename = CurrentTasMovie.Filename; @@ -121,10 +130,56 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.Save(); Settings.RecentTas.Add(CurrentTasMovie.Filename); SetTextProperty(); - _autosaveTimer.Start(); MessageStatusLabel.Text = Path.GetFileName(CurrentTasMovie.Filename) + " saved."; this.Cursor = Cursors.Default; } + // keep insisting + if (Settings.AutosaveInterval > 0) + _autosaveTimer.Start(); + } + + // call this one from the menu only + private void SaveAsTasMenuItem_Click(object sender, EventArgs e) + { + SaveAsTas(sender, e); + if (Settings.BackupPerFileSave) + SaveBackupMenuItem_Click(sender, e); + } + + private void SaveBackupMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(CurrentTasMovie.Filename) || + CurrentTasMovie.Filename == DefaultTasProjName()) + { + SaveAsTas(sender, e); + } + else + { + _autosaveTimer.Stop(); + MessageStatusLabel.Text = "Saving..."; + this.Cursor = Cursors.WaitCursor; + Update(); + CurrentTasMovie.SaveBackup(); + if (Settings.AutosaveInterval > 0) + _autosaveTimer.Start(); + MessageStatusLabel.Text = "Backup .tasproj saved to \"Movie backups\" path."; + Settings.RecentTas.Add(CurrentTasMovie.Filename); + this.Cursor = Cursors.Default; + } + } + + private void SaveBk2BackupMenuItem_Click(object sender, EventArgs e) + { + _autosaveTimer.Stop(); + var bk2 = CurrentTasMovie.ToBk2(copy: true, backup: true); + MessageStatusLabel.Text = "Exporting to .bk2..."; + this.Cursor = Cursors.WaitCursor; + Update(); + bk2.SaveBackup(); + if (Settings.AutosaveInterval > 0) + _autosaveTimer.Start(); + MessageStatusLabel.Text = "Backup .bk2 saved to \"Movie backups\" path."; + this.Cursor = Cursors.Default; } private void saveSelectionToMacroToolStripMenuItem_Click(object sender, EventArgs e) @@ -166,8 +221,9 @@ namespace BizHawk.Client.EmuHawk this.Cursor = Cursors.WaitCursor; Update(); bk2.Save(); - _autosaveTimer.Start(); - MessageStatusLabel.Text = Path.GetFileName(bk2.Filename) + " exported."; + if (Settings.AutosaveInterval > 0) + _autosaveTimer.Start(); + MessageStatusLabel.Text = bk2.Name + " exported."; this.Cursor = Cursors.Default; } @@ -180,6 +236,55 @@ namespace BizHawk.Client.EmuHawk #region Edit + private void EditSubMenu_DropDownOpened(object sender, EventArgs e) + { + DeselectMenuItem.Enabled = + SelectBetweenMarkersMenuItem.Enabled = + CopyMenuItem.Enabled = + CutMenuItem.Enabled = + ClearFramesMenuItem.Enabled = + DeleteFramesMenuItem.Enabled = + CloneFramesMenuItem.Enabled = + TruncateMenuItem.Enabled = + TasView.AnyRowsSelected; + ReselectClipboardMenuItem.Enabled = + PasteMenuItem.Enabled = + PasteInsertMenuItem.Enabled = + _tasClipboard.Any(); + + ClearGreenzoneMenuItem.Enabled = + CurrentTasMovie != null && CurrentTasMovie.TasStateManager.Any(); + + GreenzoneICheckSeparator.Visible = + StateHistoryIntegrityCheckMenuItem.Visible = + VersionInfo.DeveloperBuild; + + ClearFramesMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Clear Frames"].Bindings; + InsertFrameMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Insert Frame"].Bindings; + DeleteFramesMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Delete Frames"].Bindings; + CloneFramesMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Clone Frames"].Bindings; + } + + public void ClearFramesExternal() + { + ClearFramesMenuItem_Click(null, null); + } + + public void InsertFrameExternal() + { + InsertFrameMenuItem_Click(null, null); + } + + public void DeleteFramesExternal() + { + DeleteFramesMenuItem_Click(null, null); + } + + public void CloneFramesExternal() + { + CloneFramesMenuItem_Click(null, null); + } + private void UndoMenuItem_Click(object sender, EventArgs e) { if (CurrentTasMovie.ChangeLog.Undo() < Emulator.Frame) @@ -211,30 +316,6 @@ namespace BizHawk.Client.EmuHawk _undoForm.UpdateValues(); } - private void EditSubMenu_DropDownOpened(object sender, EventArgs e) - { - DeselectMenuItem.Enabled = - SelectBetweenMarkersMenuItem.Enabled = - CopyMenuItem.Enabled = - CutMenuItem.Enabled = - ClearMenuItem.Enabled = - DeleteFramesMenuItem.Enabled = - CloneMenuItem.Enabled = - TruncateMenuItem.Enabled = - TasView.AnyRowsSelected; - ReselectClipboardMenuItem.Enabled = - PasteMenuItem.Enabled = - PasteInsertMenuItem.Enabled = - _tasClipboard.Any(); - - ClearGreenzoneMenuItem.Enabled = - CurrentTasMovie != null && CurrentTasMovie.TasStateManager.Any(); - - GreenzoneICheckSeparator.Visible = - StateHistoryIntegrityCheckMenuItem.Visible = - VersionInfo.DeveloperBuild; - } - private void DeselectMenuItem_Click(object sender, EventArgs e) { TasView.DeselectAll(); @@ -408,7 +489,7 @@ namespace BizHawk.Client.EmuHawk } } - private void ClearMenuItem_Click(object sender, EventArgs e) + private void ClearFramesMenuItem_Click(object sender, EventArgs e) { if (TasView.AnyRowsSelected) { @@ -477,7 +558,7 @@ namespace BizHawk.Client.EmuHawk } } - private void CloneMenuItem_Click(object sender, EventArgs e) + private void CloneFramesMenuItem_Click(object sender, EventArgs e) { if (TasView.AnyRowsSelected) { @@ -662,6 +743,17 @@ namespace BizHawk.Client.EmuHawk #region Config + private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) + { + DrawInputByDraggingMenuItem.Checked = Settings.DrawInput; + AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause; + AutoRestoreOnMouseUpOnlyMenuItem.Checked = Settings.AutoRestoreOnMouseUpOnly; + EmptyNewMarkerNotesMenuItem.Checked = Settings.EmptyMarkers; + AutosaveAsBk2MenuItem.Checked = Settings.AutosaveAsBk2; + AutosaveAsBackupFileMenuItem.Checked = Settings.AutosaveAsBackupFile; + BackupPerFileSaveMenuItem.Checked = Settings.BackupPerFileSave; + } + private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e) { using (var prompt = new InputPrompt @@ -730,18 +822,19 @@ namespace BizHawk.Client.EmuHawk using (var prompt = new InputPrompt { TextInputType = InputPrompt.InputType.Unsigned, - Message = "Autosave Interval in seconds", + Message = "Autosave Interval in seconds\nSet to 0 to disable", InitialValue = (Settings.AutosaveInterval / 1000).ToString() }) { DialogResult result = prompt.ShowDialog(); if (result == DialogResult.OK) { - int val = int.Parse(prompt.PromptText) * 1000; + uint val = uint.Parse(prompt.PromptText) * 1000; + Settings.AutosaveInterval = val; if (val > 0) { - Settings.AutosaveInterval = val; - _autosaveTimer.Interval = val; + _autosaveTimer.Interval = (int)val; + _autosaveTimer.Start(); } } } @@ -752,12 +845,14 @@ namespace BizHawk.Client.EmuHawk Settings.AutosaveAsBk2 ^= true; } - private void ConfigSubMenu_DropDownOpened(object sender, EventArgs e) + private void AutosaveAsBackupFileMenuItem_Click(object sender, EventArgs e) { - DrawInputByDraggingMenuItem.Checked = Settings.DrawInput; - AutopauseAtEndOfMovieMenuItem.Checked = Settings.AutoPause; - EmptyNewMarkerNotesMenuItem.Checked = Settings.EmptyMarkers; - AutosaveAsBk2MenuItem.Checked = Settings.AutosaveAsBk2; + Settings.AutosaveAsBackupFile ^= true; + } + + private void BackupPerFileSaveMenuItem_Click(object sender, EventArgs e) + { + Settings.BackupPerFileSave ^= true; } private void DrawInputByDraggingMenuItem_Click(object sender, EventArgs e) @@ -785,6 +880,11 @@ namespace BizHawk.Client.EmuHawk Settings.AutoPause ^= true; } + private void AutoRestoreOnMouseUpOnlyMenuItem_Click(object sender, EventArgs e) + { + Settings.AutoRestoreOnMouseUpOnly ^= true; + } + private void autoHoldToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { if (autoHoldToolStripMenuItem.Checked) @@ -894,6 +994,31 @@ namespace BizHawk.Client.EmuHawk hideWasLagFramesToolStripMenuItem.Checked = TasView.HideWasLagFrames; } + private void iconsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + denoteStatesWithIconsToolStripMenuItem.Checked = Settings.denoteStatesWithIcons; + denoteStatesWithBGColorToolStripMenuItem.Checked = Settings.denoteStatesWithBGColor; + denoteMarkersWithIconsToolStripMenuItem.Checked = Settings.denoteMarkersWithIcons; + denoteMarkersWithBGColorToolStripMenuItem.Checked = Settings.denoteMarkersWithBGColor; + } + + private void followCursorToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + alwaysScrollToolStripMenuItem.Checked = Settings.FollowCursorAlwaysScroll; + scrollToViewToolStripMenuItem.Checked = false; + scrollToTopToolStripMenuItem.Checked = false; + scrollToBottomToolStripMenuItem.Checked = false; + scrollToCenterToolStripMenuItem.Checked = false; + if (TasView.ScrollMethod == "near") + scrollToViewToolStripMenuItem.Checked = true; + else if (TasView.ScrollMethod == "top") + scrollToTopToolStripMenuItem.Checked = true; + else if (TasView.ScrollMethod == "bottom") + scrollToBottomToolStripMenuItem.Checked = true; + else + scrollToCenterToolStripMenuItem.Checked = true; + } + private void RotateMenuItem_Click(object sender, EventArgs e) { TasView.HorizontalOrientation ^= true; @@ -937,14 +1062,6 @@ namespace BizHawk.Client.EmuHawk TasView.ScrollMethod = Settings.FollowCursorScrollMethod = "center"; } - private void iconsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - denoteStatesWithIconsToolStripMenuItem.Checked = Settings.denoteStatesWithIcons; - denoteStatesWithBGColorToolStripMenuItem.Checked = Settings.denoteStatesWithBGColor; - denoteMarkersWithIconsToolStripMenuItem.Checked = Settings.denoteMarkersWithIcons; - denoteMarkersWithBGColorToolStripMenuItem.Checked = Settings.denoteMarkersWithBGColor; - } - private void denoteStatesWithIconsToolStripMenuItem_Click(object sender, EventArgs e) { TasView.denoteStatesWithIcons = Settings.denoteStatesWithIcons = denoteStatesWithIconsToolStripMenuItem.Checked; @@ -969,23 +1086,6 @@ namespace BizHawk.Client.EmuHawk RefreshDialog(); } - private void followCursorToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - alwaysScrollToolStripMenuItem.Checked = Settings.FollowCursorAlwaysScroll; - scrollToViewToolStripMenuItem.Checked = false; - scrollToTopToolStripMenuItem.Checked = false; - scrollToBottomToolStripMenuItem.Checked = false; - scrollToCenterToolStripMenuItem.Checked = false; - if (TasView.ScrollMethod == "near") - scrollToViewToolStripMenuItem.Checked = true; - else if (TasView.ScrollMethod == "top") - scrollToTopToolStripMenuItem.Checked = true; - else if (TasView.ScrollMethod == "bottom") - scrollToBottomToolStripMenuItem.Checked = true; - else - scrollToCenterToolStripMenuItem.Checked = true; - } - private void wheelScrollSpeedToolStripMenuItem_Click(object sender, EventArgs e) { InputPrompt inputpromt = new InputPrompt(); @@ -1175,5 +1275,19 @@ namespace BizHawk.Client.EmuHawk } #endregion + + #region Help + + private void TASEditorManualOnlineMenuItem_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("http://www.fceux.com/web/help/taseditor/"); + } + + private void ForumThreadMenuItem_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("http://tasvideos.org/forum/viewtopic.php?t=13505"); + } + + #endregion } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 7a89934c7c..d34889c154 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -50,6 +50,7 @@ namespace BizHawk.Client.EmuHawk } public bool IsInMenuLoop { get; private set; } + public bool IgnoreSeekFrame { get; set; } [ConfigPersist] public TAStudioSettings Settings { get; set; } @@ -67,8 +68,11 @@ namespace BizHawk.Client.EmuHawk FollowCursorScrollMethod = "near"; BranchCellHoverInterval = 1; SeekingCutoffInterval = 2; // unused, relying on VisibleRows is smarter + AutoRestoreOnMouseUpOnly = true; AutosaveInterval = 120000; AutosaveAsBk2 = false; + AutosaveAsBackupFile = false; + BackupPerFileSave = false; // default to taseditor fashion denoteStatesWithIcons = false; denoteStatesWithBGColor = true; @@ -87,8 +91,11 @@ namespace BizHawk.Client.EmuHawk public string FollowCursorScrollMethod { get; set; } public int BranchCellHoverInterval { get; set; } public int SeekingCutoffInterval { get; set; } - public int AutosaveInterval { get; set; } + public bool AutoRestoreOnMouseUpOnly { get; set; } + public uint AutosaveInterval { get; set; } public bool AutosaveAsBk2 { get; set; } + public bool AutosaveAsBackupFile { get; set; } + public bool BackupPerFileSave { get; set; } public bool denoteStatesWithIcons { get; set; } public bool denoteStatesWithBGColor { get; set; } @@ -138,6 +145,7 @@ namespace BizHawk.Client.EmuHawk InitializeSeekWorker(); WantsToControlStopMovie = true; + WantsToControlRestartMovie = true; TasPlaybackBox.Tastudio = this; MarkerControl.Tastudio = this; BookMarkControl.Tastudio = this; @@ -150,25 +158,30 @@ namespace BizHawk.Client.EmuHawk TasView.PointedCellChanged += TasView_PointedCellChanged; TasView.MultiSelect = true; TasView.MaxCharactersInHorizontal = 1; - WantsToControlRestartMovie = true; - - _autosaveTimer.Interval = Settings.AutosaveInterval; - _autosaveTimer.Tick += AutosaveTimerEventProcessor; - _autosaveTimer.Start(); + IgnoreSeekFrame = false; } private void AutosaveTimerEventProcessor(object sender, EventArgs e) { - if (!CurrentTasMovie.Changes) + if (CurrentTasMovie == null) return; - if (Settings.AutosaveAsBk2) + if (!CurrentTasMovie.Changes || Settings.AutosaveInterval == 0) + return; + + if (Settings.AutosaveAsBackupFile) { - ToBk2MenuItem_Click(sender, e); + if (Settings.AutosaveAsBk2) + SaveBk2BackupMenuItem_Click(sender, e); + else + SaveBackupMenuItem_Click(sender, e); } else { - SaveTasMenuItem_Click(sender, e); + if (Settings.AutosaveAsBk2) + ToBk2MenuItem_Click(sender, e); + else + SaveTas(sender, e); } } @@ -292,7 +305,14 @@ namespace BizHawk.Client.EmuHawk TasView.denoteStatesWithIcons = Settings.denoteStatesWithIcons; TasView.denoteStatesWithBGColor = Settings.denoteStatesWithBGColor; TasView.denoteMarkersWithIcons = Settings.denoteMarkersWithIcons; - TasView.denoteMarkersWithBGColor = Settings.denoteMarkersWithBGColor; + TasView.denoteMarkersWithBGColor = Settings.denoteMarkersWithBGColor; + + _autosaveTimer.Tick += AutosaveTimerEventProcessor; + if (Settings.AutosaveInterval > 0) + { + _autosaveTimer.Interval = (int)Settings.AutosaveInterval; + _autosaveTimer.Start(); + } // Remembering Split container logic int defaultMainSplitDistance = MainVertialSplit.SplitterDistance; @@ -975,8 +995,8 @@ namespace BizHawk.Client.EmuHawk private void TAStudio_KeyDown(object sender, KeyEventArgs e) { - if (e.KeyCode == Keys.F) - TasPlaybackBox.FollowCursor ^= true; + //if (e.KeyCode == Keys.F) + // TasPlaybackBox.FollowCursor ^= true; } private void MainVertialSplit_SplitterMoved(object sender, SplitterEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.Designer.cs index 39fe8220b7..ad6a57aa75 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/UndoHistoryForm.Designer.cs @@ -88,31 +88,31 @@ this.sepToolStripMenuItem, this.clearHistoryToHereToolStripMenuItem}); this.RightClickMenu.Name = "RightClickMenu"; - this.RightClickMenu.Size = new System.Drawing.Size(211, 76); + this.RightClickMenu.Size = new System.Drawing.Size(209, 76); // // undoHereToolStripMenuItem // this.undoHereToolStripMenuItem.Name = "undoHereToolStripMenuItem"; - this.undoHereToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.undoHereToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.undoHereToolStripMenuItem.Text = "Undo To Selection"; this.undoHereToolStripMenuItem.Click += new System.EventHandler(this.undoHereToolStripMenuItem_Click); // // redoHereToolStripMenuItem // this.redoHereToolStripMenuItem.Name = "redoHereToolStripMenuItem"; - this.redoHereToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.redoHereToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.redoHereToolStripMenuItem.Text = "Redo To Selection"; this.redoHereToolStripMenuItem.Click += new System.EventHandler(this.redoHereToolStripMenuItem_Click); // // sepToolStripMenuItem // this.sepToolStripMenuItem.Name = "sepToolStripMenuItem"; - this.sepToolStripMenuItem.Size = new System.Drawing.Size(207, 6); + this.sepToolStripMenuItem.Size = new System.Drawing.Size(205, 6); // // clearHistoryToHereToolStripMenuItem // this.clearHistoryToHereToolStripMenuItem.Name = "clearHistoryToHereToolStripMenuItem"; - this.clearHistoryToHereToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.clearHistoryToHereToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.clearHistoryToHereToolStripMenuItem.Text = "Clear History To Selection"; this.clearHistoryToHereToolStripMenuItem.Click += new System.EventHandler(this.clearHistoryToHereToolStripMenuItem_Click); // @@ -212,6 +212,7 @@ this.Controls.Add(this.HistoryView); this.Name = "UndoHistoryForm"; this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Undo History"; this.RightClickMenu.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.MaxStepsNum)).EndInit(); diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogStick.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogStick.cs index 089c08056b..64330ededc 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogStick.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogStick.cs @@ -15,6 +15,8 @@ namespace BizHawk.Client.EmuHawk private bool _programmaticallyUpdatingNumerics; private bool _readonly; + private int rangeAverageX; //for coordinate transformation when non orthogonal (like PSX for example) + private int rangeAverageY; private EventHandler manualXYValueChangedEventHandler; private EventHandler polarNumericChangedEventHandler; @@ -60,6 +62,9 @@ namespace BizHawk.Client.EmuHawk MaxYNumeric.Minimum = 1; MaxYNumeric.Maximum = 100; MaxYNumeric.Value = 100; // Note: these trigger change events that change the analog stick too + + rangeAverageX = (int)((RangeX[0] + RangeX[2]) / 2); + rangeAverageY = (int)((RangeY[0] + RangeY[2]) / 2); } #region IVirtualPadControl Implementation @@ -166,11 +171,12 @@ namespace BizHawk.Client.EmuHawk ManualX.ValueChanged -= manualXYValueChangedEventHandler; ManualY.ValueChanged -= manualXYValueChangedEventHandler; - ManualX.Value = Math.Ceiling(manualR.Value * (decimal)Math.Cos(Math.PI * (double)manualTheta.Value / 180)).Clamp(-127, 127); - ManualY.Value = Math.Ceiling(manualR.Value * (decimal)Math.Sin(Math.PI * (double)manualTheta.Value / 180)).Clamp(-127, 127); + ManualX.Value = Math.Ceiling(manualR.Value * (decimal)Math.Cos(Math.PI * (double)manualTheta.Value / 180)).Clamp(-127, 127) + rangeAverageX; + ManualY.Value = Math.Ceiling(manualR.Value * (decimal)Math.Sin(Math.PI * (double)manualTheta.Value / 180)).Clamp(-127, 127) + rangeAverageY; AnalogStick.X = (int)ManualX.Value; AnalogStick.Y = (int)ManualY.Value; + AnalogStick.HasValue = true; AnalogStick.Refresh(); @@ -222,8 +228,8 @@ namespace BizHawk.Client.EmuHawk manualR.ValueChanged -= polarNumericChangedEventHandler; manualTheta.ValueChanged -= polarNumericChangedEventHandler; - manualR.Value = (decimal)Math.Sqrt(Math.Pow(AnalogStick.X, 2) + Math.Pow(AnalogStick.Y, 2)); - manualTheta.Value = (decimal)(Math.Atan2(AnalogStick.Y, AnalogStick.X) * (180 / Math.PI)); + manualR.Value = (decimal)Math.Sqrt(Math.Pow(AnalogStick.X - rangeAverageX, 2) + Math.Pow(AnalogStick.Y - rangeAverageY, 2)); + manualTheta.Value = (decimal)(Math.Atan2(AnalogStick.Y - rangeAverageY, AnalogStick.X - rangeAverageX) * (180 / Math.PI)); manualR.ValueChanged += polarNumericChangedEventHandler; manualTheta.ValueChanged += polarNumericChangedEventHandler; diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs index 71082ec872..d2b0b00819 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -32,7 +32,7 @@ namespace BizHawk.Client.EmuHawk return new PadSchema { IsConsole = false, - DefaultSize = new Size(420, 260), + DefaultSize = new Size(500, 290), DisplayName = "DualShock Player" + controller, Buttons = new[] { @@ -179,7 +179,7 @@ namespace BizHawk.Client.EmuHawk MidValueSec = 128, MaxValueSec = 255, DisplayName = "", - Location = new Point(210, 120), + Location = new Point(260, 120), Type = PadSchema.PadInputType.AnalogStick } } diff --git a/BizHawk.Common/Properties/AssemblyInfo.cs b/BizHawk.Common/Properties/AssemblyInfo.cs index 6d25e1fa67..6fc72f8f0e 100644 --- a/BizHawk.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Common/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Common")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Common")] diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs index d660cc4f9d..6d672d139f 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryDomainImpls.cs @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Common public override byte PeekByte(long addr) { - if ((ulong)addr >= (ulong)Size) + if ((ulong)addr < (ulong)Size) return ((byte*)Data)[addr ^ 1]; else throw new ArgumentOutOfRangeException("addr"); @@ -117,8 +117,8 @@ namespace BizHawk.Emulation.Common public override void PokeByte(long addr, byte val) { if (Writable) - { - if ((ulong)addr >= (ulong)Size) + { + if ((ulong)addr < (ulong)Size) ((byte*)Data)[addr ^ 1] = val; else throw new ArgumentOutOfRangeException("addr"); diff --git a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs index b386dd14f1..aa3ee8415d 100644 --- a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Emulation.Common")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Emulation.Common")] diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ICodeDataLog.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ICodeDataLog.cs index 7dae0cdedd..1eaf4cbaf9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ICodeDataLog.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ICodeDataLog.cs @@ -1,56 +1,56 @@ -using System; -using System.IO; -using System.Collections.Generic; - -using BizHawk.Emulation.Common; - -namespace BizHawk.Emulation.Cores.Nintendo.Gameboy -{ - partial class Gameboy - { - void ICodeDataLogger.SetCDL(CodeDataLog cdl) - { - CDL = cdl; - if(cdl == null) - LibGambatte.gambatte_setcdcallback(GambatteState, null); - else - LibGambatte.gambatte_setcdcallback(GambatteState, CDCallback); - } - - void ICodeDataLogger.NewCDL(CodeDataLog cdl) - { - cdl["ROM"] = new byte[MemoryDomains["ROM"].Size]; - - //cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it - cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size]; - - if (MemoryDomains.Has("CartRAM")) - cdl["CartRAM"] = new byte[MemoryDomains["WRAM"].Size]; - - cdl.SubType = "GB"; - cdl.SubVer = 0; - } - - //not supported - void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl) { } - - CodeDataLog CDL; - LibGambatte.CDCallback CDCallback; - void CDCallbackProc(int addr, LibGambatte.CDLog_AddrType addrtype, LibGambatte.CDLog_Flags flags) - { - if (CDL == null) return; - if (!CDL.Active) return; - string key; - switch (addrtype) - { - case LibGambatte.CDLog_AddrType.ROM: key = "ROM"; break; - case LibGambatte.CDLog_AddrType.HRAM: key = "HRAM"; break; - case LibGambatte.CDLog_AddrType.WRAM: key = "WRAM"; break; - case LibGambatte.CDLog_AddrType.CartRAM: key = "CartRAM"; break; - default: throw new InvalidOperationException("Juniper lightbulb proxy"); - } - CDL[key][addr] |= (byte)flags; - } - - } +using System; +using System.IO; +using System.Collections.Generic; + +using BizHawk.Emulation.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.Gameboy +{ + partial class Gameboy + { + void ICodeDataLogger.SetCDL(CodeDataLog cdl) + { + CDL = cdl; + if(cdl == null) + LibGambatte.gambatte_setcdcallback(GambatteState, null); + else + LibGambatte.gambatte_setcdcallback(GambatteState, CDCallback); + } + + void ICodeDataLogger.NewCDL(CodeDataLog cdl) + { + cdl["ROM"] = new byte[MemoryDomains["ROM"].Size]; + + //cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it + cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size]; + + if (MemoryDomains.Has("CartRAM")) + cdl["CartRAM"] = new byte[MemoryDomains["CartRAM"].Size]; + + cdl.SubType = "GB"; + cdl.SubVer = 0; + } + + //not supported + void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl) { } + + CodeDataLog CDL; + LibGambatte.CDCallback CDCallback; + void CDCallbackProc(int addr, LibGambatte.CDLog_AddrType addrtype, LibGambatte.CDLog_Flags flags) + { + if (CDL == null) return; + if (!CDL.Active) return; + string key; + switch (addrtype) + { + case LibGambatte.CDLog_AddrType.ROM: key = "ROM"; break; + case LibGambatte.CDLog_AddrType.HRAM: key = "HRAM"; break; + case LibGambatte.CDLog_AddrType.WRAM: key = "WRAM"; break; + case LibGambatte.CDLog_AddrType.CartRAM: key = "CartRAM"; break; + default: throw new InvalidOperationException("Juniper lightbulb proxy"); + } + CDL[key][addr] |= (byte)flags; + } + + } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs index 182639cd76..df8554c494 100644 --- a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Emulation")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Emulation")] diff --git a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs index acde16fa20..bd0b20f81e 100644 --- a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BizHawk.Emulation.DiscSystem")] -[assembly: AssemblyDescription("http://code.google.com/p/bizhawk")] +[assembly: AssemblyDescription("http://tasvideos.org/Bizhawk.html")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BizHawk")] [assembly: AssemblyProduct("BizHawk.Emulation.DiscSystem")] diff --git a/Dist/BuildAndPackage.bat b/Dist/BuildAndPackage.bat index 5c2e2cb9a2..c64992180c 100644 --- a/Dist/BuildAndPackage.bat +++ b/Dist/BuildAndPackage.bat @@ -33,7 +33,7 @@ rem explicitly list the OK ones here as individual copies. until then.... copy *.dll dll rem Now, we're about to zip and then unzip. Why, you ask? Because that's just the way this evolved. -..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe DiscoHawk.exe defctrl.json dll shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x dll\libsneshawk-64*.exe -x *.ilk -x dll\gpgx.elf -x dll\miniclient.* -x dll\*.xml +..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe DiscoHawk.exe defctrl.json dll shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x dll\libsneshawk-64*.exe -x *.ilk -x dll\gpgx.elf -x dll\miniclient.* cd ..\Dist .\unzip.exe %NAME% -d temp diff --git a/output/dll/octoshock.dll b/output/dll/octoshock.dll index 751238f81c..42d56035e3 100644 Binary files a/output/dll/octoshock.dll and b/output/dll/octoshock.dll differ diff --git a/psx/octoshock/psx/cdc.cpp b/psx/octoshock/psx/cdc.cpp index d3f05a9a4d..c50f535c2f 100644 --- a/psx/octoshock/psx/cdc.cpp +++ b/psx/octoshock/psx/cdc.cpp @@ -951,7 +951,8 @@ void PS_CDC::HandlePlayRead(void) if((Mode & MODE_REPORT) && (((SubQBuf_Safe[0x9] >> 4) != ReportLastF) || Forward || Backward) && SubQChecksumOK) { uint8 tr[8]; -#if 0 + //zero 14-jun-2016 - useful after all for fixing bugs in "Fantastic Pinball Kyutenkai" +#if 1 uint16 abs_lev_max = 0; bool abs_lev_chselect = SubQBuf_Safe[0x8] & 0x01; @@ -979,8 +980,11 @@ void PS_CDC::HandlePlayRead(void) tr[5] = SubQBuf_Safe[0x9]; // A F } - tr[6] = 0; //abs_lev_max >> 0; - tr[7] = 0; //abs_lev_max >> 8; + //zero 14-jun-2016 - useful after all for fixing bugs in "Fantastic Pinball Kyutenkai" + //tr[6] = 0; //abs_lev_max >> 0; + //tr[7] = 0; //abs_lev_max >> 8; + tr[6] = abs_lev_max >> 0; + tr[7] = abs_lev_max >> 8; SetAIP(CDCIRQ_DATA_READY, 8, tr); }